@inkeep/open-knowledge 0.47.0-beta.9 → 0.47.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/dist/{acp-harness-probe-C0SsnC09.mjs → acp-harness-probe-qJUo1ApO.mjs} +2 -2
  2. package/dist/cli.mjs +57 -57
  3. package/dist/config-schema.json +2 -45
  4. package/dist/config.user.schema.json +2 -45
  5. package/dist/constants-CUaf8eE_.mjs +2 -0
  6. package/dist/fs-traced-CbQ-GS7x.mjs +1 -0
  7. package/dist/{fs-traced-ArlA_yTp.mjs → fs-traced-OS6B1cZZ.mjs} +2 -2
  8. package/dist/git-handle-D0uAjBAd.mjs +1 -0
  9. package/dist/{git-handle-B9cFlvR2.mjs → git-handle-RLYVdszV.mjs} +2 -2
  10. package/dist/index.d.mts +2 -23
  11. package/dist/index.mjs +1 -1
  12. package/dist/{init-C2fAn6PM.mjs → init-C55e2NNl.mjs} +36 -36
  13. package/dist/init-D8a-XbzA.mjs +1 -0
  14. package/dist/{launch-json-removal-whUgkww7.mjs → launch-json-removal-D3Q9yvyd.mjs} +2 -2
  15. package/dist/{loader-CU4Jbdky.mjs → loader-BsX_JrrA.mjs} +2 -2
  16. package/dist/loader-O6z6lVhP.mjs +1 -0
  17. package/dist/md-manager-CrYbAiKl.mjs +2 -0
  18. package/dist/{open-browser-DtS0SaFA.mjs → open-browser-4sOlBbCM.mjs} +2 -2
  19. package/dist/parse-worker.mjs +1 -1
  20. package/dist/{preview-DGtR2PF8.mjs → preview-BAWt2Pnh.mjs} +2 -2
  21. package/dist/preview-Bq9cv2G5.mjs +1 -0
  22. package/dist/public/assets/{ActivityModeContent-BSIeX2WL.js → ActivityModeContent-DnjDjPFp.js} +1 -1
  23. package/dist/public/assets/{AgentDiffPane-u4kU4q9y.js → AgentDiffPane-Th6j3NhO.js} +1 -1
  24. package/dist/public/assets/{AgentThreadClientBinder-CMHNZB8k.js → AgentThreadClientBinder-BVm5Ldhz.js} +1 -1
  25. package/dist/public/assets/{ChangedOutsideBadge-Byr7iRWr.js → ChangedOutsideBadge-DVfCTGd2.js} +1 -1
  26. package/dist/public/assets/{CodeMirrorPropInput-kJZpOqjB.js → CodeMirrorPropInput-DmM8F7PJ.js} +1 -1
  27. package/dist/public/assets/{ConsentDialogBody-VKhCzQXH.js → ConsentDialogBody-CB447Y2k.js} +1 -1
  28. package/dist/public/assets/{DocumentContext-B5qum6Oo.js → DocumentContext-B0g_vd8N.js} +9 -9
  29. package/dist/public/assets/{EditorModeToggle-C7I7X4RS.js → EditorModeToggle-DKuXrb9b.js} +1 -1
  30. package/dist/public/assets/{EnableSyncConfirmDialog-C5lcZQ0m.js → EnableSyncConfirmDialog-BQttSYlY.js} +1 -1
  31. package/dist/public/assets/FeedbackForm-FbNH_TYS.js +1 -0
  32. package/dist/public/assets/{GraphPanel-BKU-sjWQ.js → GraphPanel-DK2w8FEz.js} +1 -1
  33. package/dist/public/assets/{ImportSkillDialog-eU2Zr5ex.js → ImportSkillDialog-DHfVuiKL.js} +1 -1
  34. package/dist/public/assets/{LintConfigEditor-xKBwOmU6.js → LintConfigEditor-B-7Pe22_.js} +1 -1
  35. package/dist/public/assets/{ManagedArtifactProperties-C8FxdLXe.js → ManagedArtifactProperties-B-Y5eayN.js} +2 -2
  36. package/dist/public/assets/ManagedArtifactProperties-Ddk1e_f6.js +1 -0
  37. package/dist/public/assets/{McpConsentDialogBody-5vUQ_tGC.js → McpConsentDialogBody-DPMIdjmd.js} +1 -1
  38. package/dist/public/assets/{MermaidDocEditor-BZ9qREZ6.js → MermaidDocEditor-CBHNf1No.js} +1 -1
  39. package/dist/public/assets/{ReportBugDialogBody-rA74DPnv.js → ReportBugDialogBody-CXLxw7Fr.js} +1 -1
  40. package/dist/public/assets/{SchemaConfigEditor-BzlmoCOH.js → SchemaConfigEditor-DG-dOTBT.js} +1 -1
  41. package/dist/public/assets/{SessionsHost-D1cUv-UU.js → SessionsHost-DjbdveAp.js} +2 -2
  42. package/dist/public/assets/SettingsDialogBody-CFwua7VK.js +12 -0
  43. package/dist/public/assets/{ShareBranchSwitchDialog-COHEBcfz.js → ShareBranchSwitchDialog-CyWPLWZG.js} +1 -1
  44. package/dist/public/assets/{ShareReceiveDialog-DcNIOm6y.js → ShareReceiveDialog-C-fxd4DJ.js} +1 -1
  45. package/dist/public/assets/{ShareReceiveMissDialog-DVZqfzBh.js → ShareReceiveMissDialog-Y4PyuUCZ.js} +1 -1
  46. package/dist/public/assets/{SkillEditBanner-nlYN__8g.js → SkillEditBanner-Dbu0PwqP.js} +1 -1
  47. package/dist/public/assets/{SkillOriginInline-BBZCbGv3.js → SkillOriginInline-DuFc7cZs.js} +1 -1
  48. package/dist/public/assets/{SkillToolbarControls-VrT7GSrm.js → SkillToolbarControls-B4k3LXLX.js} +1 -1
  49. package/dist/public/assets/{SourceEditor-DQatC6rT.js → SourceEditor-BCMM4zJn.js} +1 -1
  50. package/dist/public/assets/{TerminalPanel-BHk4hxn3.js → TerminalPanel-DkXL03UX.js} +1 -1
  51. package/dist/public/assets/{TerminalWindowApp-C81f0KjQ.js → TerminalWindowApp-DH34WwKL.js} +1 -1
  52. package/dist/public/assets/{TextDocEditor-BSQz8TPb.js → TextDocEditor-DEdxUQxb.js} +1 -1
  53. package/dist/public/assets/{ThreadView-FpQMMfQp.js → ThreadView-ktubIY9d.js} +1 -1
  54. package/dist/public/assets/{TimelineDiffPane-DRAMrTuM.js → TimelineDiffPane-DSvFVt40.js} +1 -1
  55. package/dist/public/assets/{agent-diff-store-BMOeSX25.js → agent-diff-store-BX4UT3y1.js} +1 -1
  56. package/dist/public/assets/{agent-visibility-CRJC_Mmi.js → agent-visibility-CYBYXsoR.js} +1 -1
  57. package/dist/public/assets/auth-state-cache-ZZgXmLCf.js +11 -0
  58. package/dist/public/assets/{client-version-NCw3CPbg.js → client-version-DN8Gnc8R.js} +1 -1
  59. package/dist/public/assets/config-context-CdjtvoAz.js +1 -0
  60. package/dist/public/assets/config-provider-CKct7q_G.js +4 -0
  61. package/dist/public/assets/{dist-0V5DS-jp2.js → dist-DIn3VYDc2.js} +182 -182
  62. package/dist/public/assets/{doc-paths-eqs57MlK.js → doc-paths-KCjzuC60.js} +1 -1
  63. package/dist/public/assets/{documents-events-BtZ7NV1t.js → documents-events-FrlFXuC-.js} +1 -1
  64. package/dist/public/assets/{file-tree-adapter-CheEwQMW.js → file-tree-adapter-BBMHbQG5.js} +1 -1
  65. package/dist/public/assets/{file-tree-utils-KtcdmJ_g.js → file-tree-utils-DeyBapi2.js} +1 -1
  66. package/dist/public/assets/{folder-config-api-DT4VLF_M.js → folder-config-api-OU19qNKs.js} +1 -1
  67. package/dist/public/assets/globals-BLjNYywW.css +1 -0
  68. package/dist/public/assets/{globals-BlQP66GU.js → globals-D4ycChQP.js} +1 -1
  69. package/dist/public/assets/index-Bnezs-Zg.js +2092 -0
  70. package/dist/public/assets/{lint-config-client-CKDOijIM.js → lint-config-client-D7DpNIwn.js} +1 -1
  71. package/dist/public/assets/{markdownlint-rule-browser-P1sDghK_.js → markdownlint-rule-browser-eFxHHf9q.js} +1 -1
  72. package/dist/public/assets/{navigation-targets-gc61t_Ad.js → navigation-targets-BDSeZX3c.js} +1 -1
  73. package/dist/public/assets/{open-managed-artifact-tab-DnKux2mI.js → open-managed-artifact-tab-Wkw7QMir.js} +1 -1
  74. package/dist/public/assets/{pending-receive-nav-store-VNTolH5C.js → pending-receive-nav-store-BN0afFCO.js} +1 -1
  75. package/dist/public/assets/{project-paths-B8XPtMMF.js → project-paths-DF-eCznB.js} +1 -1
  76. package/dist/public/assets/{prop-types-BdjIW0eY.js → prop-types-MABP6X1c.js} +1 -1
  77. package/dist/public/assets/{radio-group-CvYE9US5.js → radio-group-MAC3jHHk.js} +1 -1
  78. package/dist/public/assets/{receive-store-Cv1sOLk9.js → receive-store-CTNYU3q-.js} +1 -1
  79. package/dist/public/assets/{selection-context-bQG3wbZN.js → selection-context-BgucOSM-.js} +1 -1
  80. package/dist/public/assets/{skill-actions-BQVwP81Q.js → skill-actions-By3ZQhYp.js} +2 -2
  81. package/dist/public/assets/skill-scope-DkGQeaIH.js +1 -0
  82. package/dist/public/assets/{skills-api-MKau2YTq.js → skills-api-BCiYKVSk.js} +1 -1
  83. package/dist/public/assets/{src-CChG2POU.js → src-C_O1F_4l.js} +1 -1
  84. package/dist/public/assets/{tag-pill-input-_lxupqbK.js → tag-pill-input-3Bkld5bN.js} +1 -1
  85. package/dist/public/assets/{target-navigation-intent-BAyNSKBJ.js → target-navigation-intent-BZ8rve8n.js} +1 -1
  86. package/dist/public/assets/{terminal-launch-events-CwG2wSZB.js → terminal-launch-events-DbpTBIvl.js} +1 -1
  87. package/dist/public/assets/{terminal-telemetry--GWjCDpk.js → terminal-telemetry-BMiT9GUh.js} +1 -1
  88. package/dist/public/assets/{typing-burst-detector-BPenX-sr.js → typing-burst-detector-DDN6b6N7.js} +2 -2
  89. package/dist/public/assets/{uninstall-Dy_6kiW_.js → uninstall-DJBDkbwq.js} +1 -1
  90. package/dist/public/assets/{use-activity-panel-BsN0fEDd.js → use-activity-panel-CInEut0L.js} +1 -1
  91. package/dist/public/assets/{use-collab-url-BPCGWweY.js → use-collab-url-ecWCytiv.js} +1 -1
  92. package/dist/public/assets/use-live-xterm-theme-Bf72FxVk.js +1 -0
  93. package/dist/public/assets/{use-open-skill-Civ_cY4Q.js → use-open-skill-C3UqDa0B.js} +1 -1
  94. package/dist/public/assets/{use-settings-route-1lmVz-nQ.js → use-settings-route-CYvmk4XT.js} +1 -1
  95. package/dist/public/assets/{use-skill-directory-DXhI7ilx.js → use-skill-directory-Ce1Wy5Qf.js} +1 -1
  96. package/dist/public/assets/{use-skill-origin-_K8KHC47.js → use-skill-origin-DscI7Fo0.js} +1 -1
  97. package/dist/public/assets/{use-skills-BfXZuh-E.js → use-skills-B19yYlmR.js} +1 -1
  98. package/dist/public/assets/{use-terminal-enabled-BfSuv1_p.js → use-terminal-enabled-D556BQSW.js} +1 -1
  99. package/dist/public/assets/{use-timeline-entry-diff-DDbjjCJ4.js → use-timeline-entry-diff-C_2VFthE.js} +1 -1
  100. package/dist/public/assets/{use-workspace-BqaxnWdM.js → use-workspace-008C-zhL.js} +1 -1
  101. package/dist/public/index.html +55 -67
  102. package/dist/public/uninstall.html +5 -5
  103. package/dist/{repair-launch-json-Brj1-LMk.mjs → repair-launch-json-BLWZjHxK.mjs} +2 -2
  104. package/dist/{repair-mcp-configs-Bi7KOjif.mjs → repair-mcp-configs-CTYAl0ua.mjs} +2 -2
  105. package/dist/{repair-skills-BXCsRRL9.mjs → repair-skills-BikzcmQr.mjs} +2 -2
  106. package/dist/repair-skills-CCM2p_7S.mjs +1 -0
  107. package/dist/schemas/v0/config.user.schema.json +2 -45
  108. package/dist/server-lock-CiN5OJ-t.mjs +1 -0
  109. package/dist/{server-lock-B1IPSV1G.mjs → server-lock-DgWnoftI.mjs} +2 -2
  110. package/dist/{sleep-ByqzSHar.mjs → sleep-C5OfWWWx.mjs} +2 -2
  111. package/dist/src-CGOjzQCL.mjs +1 -0
  112. package/dist/{src-CHGk5YB-.mjs → src-CWDcUomk.mjs} +417 -417
  113. package/dist/src-Cgpp8Pf-.mjs +20 -0
  114. package/dist/{src-xqnWcl6h.mjs → src-pJ6LEXKc.mjs} +88 -88
  115. package/dist/{start-hb3NTHme.mjs → start-TnxpB5de.mjs} +3 -3
  116. package/dist/start-tOC8nkMr.mjs +1 -0
  117. package/dist/{write-project-skill-d8JhYDYY.mjs → write-project-skill-B8LGhuHT.mjs} +4 -4
  118. package/package.json +5 -5
  119. package/dist/constants-DTE7K2E0.mjs +0 -2
  120. package/dist/fs-traced-C9U9YUGm.mjs +0 -1
  121. package/dist/git-handle-pq-bTXGz.mjs +0 -1
  122. package/dist/init-c-4dhErq.mjs +0 -1
  123. package/dist/loader-DPapNPkX.mjs +0 -1
  124. package/dist/md-manager-CQwbqiDq.mjs +0 -2
  125. package/dist/preview-Cid6IIcN.mjs +0 -1
  126. package/dist/public/assets/FeedbackForm-CpjJyb9E.js +0 -1
  127. package/dist/public/assets/ManagedArtifactProperties-Ck3gsN1B.js +0 -1
  128. package/dist/public/assets/SettingsDialogBody-Cg9DTpQ7.js +0 -12
  129. package/dist/public/assets/auth-state-cache-BUKZaRRr.js +0 -11
  130. package/dist/public/assets/config-context-wTySMMh_.js +0 -1
  131. package/dist/public/assets/config-provider-BtDy9McS.js +0 -4
  132. package/dist/public/assets/globals-CqGu_JES.css +0 -1
  133. package/dist/public/assets/index-Dc2fupRN.js +0 -2092
  134. package/dist/public/assets/skill-scope-C6bIed6c.js +0 -1
  135. package/dist/public/assets/use-live-xterm-theme-ChdaDRFM.js +0 -1
  136. package/dist/repair-skills-xur4yCYG.mjs +0 -1
  137. package/dist/server-lock-BWO8zIgq.mjs +0 -1
  138. package/dist/src-DT-UPj26.mjs +0 -20
  139. package/dist/src-DjMcdwEK.mjs +0 -1
  140. package/dist/start-Cqf7Xs6l.mjs +0 -1
@@ -0,0 +1,12 @@
1
+ import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{Yt as r,yn as i}from"./DocumentContext-B0g_vd8N.js";import{t as a}from"./react-f2sANaYj.js";import{n as o,r as s}from"./dist-Nvb76hAm.js";import{t as c}from"./useQuery-ZeEDLtxh.js";import{n as l}from"./dist-PQ5KMVDh.js";import{t as u}from"./compiler-runtime-BfE3aGVn.js";import{a as d,c as f,s as p,u as m}from"./terminal-input-events-BGPQuYMh.js";import{t as h}from"./utils-CPqDy6Hr.js";import{i as g,n as _,o as v,s as y,t as b}from"./ChangedOutsideBadge-DVfCTGd2.js";import{t as x}from"./button-RQ5o7P7w.js";import{i as S,n as C,t as w}from"./tooltip-x7BNUa3s.js";import{n as T,r as E,t as D}from"./collapsible-OhEmjTXw.js";import{a as O,c as k,i as A,n as j,o as M,r as N,s as P,t as F}from"./dialog-FGMqkFjm.js";import{t as I}from"./checkbox-DoJAOcMt.js";import{a as L,m as R,r as z,t as B}from"./dropdown-menu-AlVJ7dJz.js";import{t as V}from"./label-G0lbYOgL.js";import{i as H,n as ee,o as U,s as te,t as ne}from"./select-BUOcREjn.js";import{i as re,n as W,r as ie,t as G}from"./radio-group-MAC3jHHk.js";import{t as K}from"./switch-BuVbhbtp.js";import{n as q,t as ae}from"./toggle-group-Cnezoq-B.js";import{C as J,a as oe,b as se,c as Y,d as ce,f as le,h as ue,l as de,n as fe,o as pe,r as me,s as he,t as ge,u as _e,y as ve}from"./agent-visibility-CYBYXsoR.js";import{i as ye}from"./terminal-telemetry-BMiT9GUh.js";import{$ as be,$a as xe,Ao as Se,Fo as Ce,Nt as we,Po as Te,Pt as Ee,Qa as De,Qr as Oe,So as ke,To as Ae,Za as je,_a as Me,_o as Ne,co as Pe,do as Fe,fa as Ie,fo as Le,ho as Re,jo as ze,ko as Be,ma as Ve,mt as He,no as Ue,po as We,pr as Ge,to as Ke,yo as qe}from"./dist-DIn3VYDc2.js";import{t as Je}from"./createLucideIcon-DihYAFEK.js";import{a as Ye,c as Xe,d as Ze,s as Qe,t as $e}from"./EnableSyncConfirmDialog-BQttSYlY.js";import{t as et}from"./arrow-up-right-CxtRAecj.js";import{t as tt}from"./RegisteredAgentIcon-H3tp7x07.js";import{t as nt}from"./check-BIbL8Vva.js";import{t as rt}from"./chevron-right-CABnKLlm.js";import{i as it}from"./prop-types-MABP6X1c.js";import{A as at,B as ot,D as st,F as ct,H as lt,M as ut,N as dt,O as ft,P as pt,R as mt,_ as ht,b as gt,c as _t,d as vt,f as yt,h as bt,i as xt,j as St,l as Ct,m as wt,n as Tt,o as Et,p as Dt,u as Ot,v as kt,y as At}from"./auth-state-cache-ZZgXmLCf.js";import{o as jt}from"./folder-config-api-OU19qNKs.js";import{t as Mt}from"./info-BO0f2XRt.js";import{t as Nt}from"./loader-circle-DJ1nzSAL.js";import{c as Pt,i as Ft}from"./field-CmzMDU7U.js";import{t as It}from"./square-pen-DbfX_rTK.js";import{t as Lt}from"./trash-2-WxyktwvM.js";import{t as Rt}from"./triangle-alert-C2yId37R.js";import{t as zt}from"./x-xV4a4mi6.js";import{n as X}from"./dist-uN7pEWl0.js";import{t as Bt}from"./ConfigSharingInfoTooltip-C4ydhukC.js";import{t as Vt}from"./input-Cm94Cun3.js";import{t as Ht}from"./dist-CzC3AWOn.js";import{d as Ut}from"./doc-paths-KCjzuC60.js";import{a as Wt,c as Gt,d as Kt,g as qt,l as Jt,p as Yt,u as Xt}from"./use-settings-route-CYvmk4XT.js";import{K as Zt}from"./navigation-targets-BDSeZX3c.js";import{t as Qt}from"./badge-CAMtyz4F.js";import"./config-provider-CKct7q_G.js";import{a as $t,c as en,d as tn,f as nn,l as rn,n as an,p as on,r as sn,s as cn,u as ln}from"./config-context-CdjtvoAz.js";import{t as un}from"./external-link-Dvu-nzFi.js";import{t as dn}from"./textarea-Cl4IJ1LU.js";import{t as fn}from"./lint-plugin-meta-BxfSlkph.js";import{t as pn}from"./skeleton-Zj40UZU5.js";import{d as mn,n as hn,r as gn,t as _n,u as vn}from"./lint-config-client-D7DpNIwn.js";import{a as yn,d as bn,f as xn,i as Sn,l as Cn,m as wn,o as Tn,p as En,s as Dn,t as On,u as kn}from"./sortable.esm-BuA5-2It.js";import{t as An}from"./open-managed-artifact-tab-Wkw7QMir.js";import{a as jn,f as Mn,i as Nn,n as Pn,o as Fn,p as In,r as Ln,s as Rn,t as zn}from"./form-DJq6IJkN.js";import{t as Bn}from"./tag-pill-input-3Bkld5bN.js";import{t as Vn}from"./markdownlint-rule-browser-eFxHHf9q.js";import{i as Hn,n as Un}from"./schema-fields-view-intent-DVVFEaIP.js";import{n as Wn,t as Gn}from"./use-terminal-enabled-D556BQSW.js";var Kn=Je(`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=u(),Q=e(a(),1),$=n(),qn=`settings-sharing-title`;function Jn(){let e=(0,Z.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)(Yn,{}):(0,$.jsx)(Xn,{}),e[0]=n):n=e[0],n}function Yn(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`h3`,{id:qn,className:`text-base font-semibold`,children:(0,$.jsx)(o,{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":qn,className:`space-y-3`,children:(0,$.jsxs)(`div`,{className:`space-y-1`,children:[t,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`7YRrJ9`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})}})})]})}),e[1]=n):n=e[1],n}function Xn(){let e=(0,Z.c)(39),{_:t}=s(),[n,r]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(null),u;e[0]===t?u=e[1]:(u=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(Qn)}},e[0]=t,e[1]=u);let d=u,f;e[2]===d?f=e[3]:(f=()=>{d()},e[2]=d,e[3]=f);let p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],e[4]=p):p=e[4],(0,Q.useEffect)(f,p);let m;e[5]!==t||e[6]!==i||e[7]!==d||e[8]!==n?(m=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||i||n.mode===e)return;a(!0),l(null);let o=null,s=null;try{o=await r.setMode(e)}catch(e){s=e}if(a(!1),s!==null){X.error(s instanceof Error?s.message:t({id:`qZv5ZR`}));return}o!==null&&(o.kind===`refused-tracked`?(l({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 d())},e[5]=t,e[6]=i,e[7]=d,e[8]=n,e[9]=m):m=e[9];let h=m,g;e[10]!==t||e[11]!==i||e[12]!==d||e[13]!==n?(g=async function(){let e=window.okDesktop?.sharing;if(!e||n===null||i)return;a(!0);let r=null,o=null;try{r=await e.setSkillsShared(!1)}catch(e){o=e}if(a(!1),o!==null){X.error(o instanceof Error?o.message:t({id:`onTlRk`}));return}if(r!==null){if(r.kind===`no-exclude`){let e=r.reason===`no-git`?t({id:`Xwump4`}):r.reason===`inaccessible`?t({id:`PlGC6r`}):t({id:`zcmYx4`});X.warning(t({id:`4h3e0H`,values:{detail:e}}));return}X.success(t({id:`P3S14k`})),await d()}},e[10]=t,e[11]=i,e[12]=d,e[13]=n,e[14]=g):g=e[14];let _=g;if(n===null){let t;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":qn,className:`space-y-3`,children:[(0,$.jsx)(`h3`,{id:qn,className:`text-base font-semibold`,children:(0,$.jsx)(o,{id:`cs4mps`})}),(0,$.jsx)(pn,{className:`h-24`})]}),e[15]=t):t=e[15],t}let v=n.mode===`no-git`,y;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`h3`,{id:qn,className:`text-base font-semibold`,children:(0,$.jsx)(o,{id:`cs4mps`})}),(0,$.jsx)(Bt,{})]}),e[16]=y):y=e[16];let b;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[y,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`N55YNr`})})]}),e[17]=b):b=e[17];let S;e[18]!==i||e[19]!==v||e[20]!==h||e[21]!==n.mode?(S=v?(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)(o,{id:`ju38ms`})}):(0,$.jsxs)(G,{value:n.mode,onValueChange:e=>void h(e),disabled:i,className:`gap-2`,"aria-labelledby":qn,"data-testid":`settings-sharing-radiogroup`,children:[(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(W,{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)(o,{id:`0Gd0NU`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`dJw2_7`})})]})]}),(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(W,{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)(o,{id:`QjzFZj`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`un-K1H`})})]})]})]}),e[18]=i,e[19]=v,e[20]=h,e[21]=n.mode,e[22]=S):S=e[22];let C;e[23]!==i||e[24]!==_||e[25]!==n.mode||e[26]!==n.skillsShared?(C=n.mode===`local-only`&&n.skillsShared?(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-skills-exception`,children:[(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(o,{id:`Kiytqd`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`K0FgsP`})})]}),(0,$.jsx)(x,{variant:`outline`,size:`sm`,disabled:i,onClick:()=>void _(),children:(0,$.jsx)(o,{id:`9uI_rE`})})]}):null,e[23]=i,e[24]=_,e[25]=n.mode,e[26]=n.skillsShared,e[27]=C):C=e[27];let w;e[28]===c?w=e[29]:(w=c===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)(o,{id:`ZscwQ0`})}),(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:c.remediation}),(0,$.jsx)(x,{variant:`outline`,size:`sm`,onClick:()=>l(null),children:(0,$.jsx)(o,{id:`1QfxQT`})})]}),e[28]=c,e[29]=w);let T;e[30]!==c||e[31]!==n.mode||e[32]!==n.trackedUpstream?(T=n.trackedUpstream.length>0&&n.mode!==`no-git`&&c===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)(o,{id:`LhWYpm`})}),(0,$.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(Zn)}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`1XSMhZ`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]}):null,e[30]=c,e[31]=n.mode,e[32]=n.trackedUpstream,e[33]=T):T=e[33];let E;return e[34]!==T||e[35]!==S||e[36]!==C||e[37]!==w?(E=(0,$.jsxs)(`section`,{"aria-labelledby":qn,className:`space-y-4`,"data-testid":`settings-sharing`,children:[b,S,C,w,T]}),e[34]=T,e[35]=S,e[36]=C,e[37]=w,e[38]=E):E=e[38],E}function Zn(e){return(0,$.jsx)(`li`,{children:e},e)}function Qn(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[],skillsShared:!1}}function $n(e){let t=(0,Z.c)(35),{authQueryTransport:n,authTransport:r}=e,{_:i}=s(),a;t[0]===n?a=t[1]:(a=n??mt(),t[0]=n,t[1]=a);let c=a,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l={phase:`loading`},t[2]=l):l=t[2];let[u,d]=(0,Q.useState)(l),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(null),v=(0,Q.useRef)(!1),y;t[3]===c?y=t[4]:(y=async function(){d({phase:`loading`});try{let e=await c.status();d({phase:`loaded`,result:e}),Tt(e.authenticated)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),d({phase:`check-failed`})}},t[3]=c,t[4]=y);let b=y,S;t[5]===b?S=t[6]:(S=()=>{b()},t[5]=b,t[6]=S);let C;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(C=[],t[7]=C):C=t[7],(0,Q.useEffect)(S,C);let w;t[8]!==i||t[9]!==b||t[10]!==c?(w=async function(){if(v.current)return;v.current=!0,p(!1),h(!0),_(null);let e=null;try{let t=c.signout?await c.signout():{ok:!1,error:i({id:`8cpOa8`})};t.ok||(e=t.error??i({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=i({id:`8cpOa8`})}await b(),e&&_(e),h(!1),v.current=!1},t[8]=i,t[9]=b,t[10]=c,t[11]=w):w=t[11];let T=w,E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(`h3`,{id:`settings-account-title`,className:`text-base font-semibold`,children:(0,$.jsx)(o,{id:`AeXO77`})}),t[12]=E):E=t[12];let D;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[E,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`E6lrpp`})})]}),t[13]=D):D=t[13];let O;t[14]!==g||t[15]!==m||t[16]!==T||t[17]!==b||t[18]!==u.phase||t[19]!==u.result?(O=u.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)(o,{id:`IWGfGF`})}),(0,$.jsx)(pn,{className:`h-4 w-40`}),(0,$.jsx)(pn,{className:`h-8 w-32`})]}):u.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)(o,{id:`T_wG4n`})}),(0,$.jsx)(x,{variant:`outline`,size:`sm`,onClick:()=>void b(),children:(0,$.jsx)(o,{id:`KDw4GX`})})]}):u.result.authenticated?u.result.tier===`A`?(0,$.jsx)(tr,{login:u.result.login}):(0,$.jsx)(er,{login:u.result.login,disconnecting:m,error:g,onDisconnect:()=>void T()}):(0,$.jsx)(nr,{onConnect:()=>p(!0)}),t[14]=g,t[15]=m,t[16]=T,t[17]=b,t[18]=u.phase,t[19]=u.result,t[20]=O):O=t[20];let k;t[21]===b?k=t[22]:(k=e=>{p(e),e||b()},t[21]=b,t[22]=k);let A=u.phase===`loaded`?u.result.host:void 0,j=u.phase===`loaded`?u.result.ghAvailable:void 0,M;t[23]===b?M=t[24]:(M=()=>{b()},t[23]=b,t[24]=M);let N;t[25]!==f||t[26]!==r||t[27]!==k||t[28]!==A||t[29]!==j||t[30]!==M?(N=(0,$.jsx)(ct,{open:f,onOpenChange:k,transport:r,host:A,ghAvailable:j,onSuccess:M}),t[25]=f,t[26]=r,t[27]=k,t[28]=A,t[29]=j,t[30]=M,t[31]=N):N=t[31];let P;return t[32]!==N||t[33]!==O?(P=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[D,O,N]}),t[32]=N,t[33]=O,t[34]=P):P=t[34],P}function er(e){let t=(0,Z.c)(20),{login:n,disconnecting:r,error:i,onDisconnect:a}=e,s;t[0]===n?s=t[1]:(s=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(o,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=s);let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(o,{id:`nxlOpL`})}),t[2]=c):c=t[2];let l;t[3]===s?l=t[4]:(l=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[s,c]}),t[3]=s,t[4]=l);let u;t[5]===r?u=t[6]:(u=r?(0,$.jsx)(o,{id:`rppgXF`}):(0,$.jsx)(o,{id:`-K0AvT`}),t[5]=r,t[6]=u);let d;t[7]!==r||t[8]!==a||t[9]!==u?(d=(0,$.jsx)(x,{variant:`outline`,onClick:a,disabled:r,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:u}),t[7]=r,t[8]=a,t[9]=u,t[10]=d):d=t[10];let f;t[11]!==l||t[12]!==d?(f=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[l,d]}),t[11]=l,t[12]=d,t[13]=f):f=t[13];let p;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,$.jsx)(o,{id:`msOK6I`})}),t[14]=p):p=t[14];let m;t[15]===i?m=t[16]:(m=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]=m);let h;return t[17]!==f||t[18]!==m?(h=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[f,p,m]}),t[17]=f,t[18]=m,t[19]=h):h=t[19],h}function tr(e){let t=(0,Z.c)(5),{login:n}=e,r;t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(o,{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)(o,{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 nr(e){let t=(0,Z.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)(o,{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)(o,{id:`EJuO7B`})})]}),t[1]=i):i=t[1];let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(o,{id:`5lWFkC`}),t[2]=a):a=t[2];let s;return t[3]===n?s=t[4]:(s=(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)(x,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=s),s}function rr(e){return e.kind===`editor`?`editor:${e.id}`:e.kind===`skill`?`skill:${e.id}`:`path`}function ir(e){let t=(0,Z.c)(11),{testId:n,children:r}=e,{_:i}=s(),a;t[0]===i?a=t[1]:(a=i({id:`2B6eYX`}),t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Mt,{className:`size-3.5`}),t[2]=o):o=t[2];let c;t[3]!==a||t[4]!==n?(c=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(x,{variant:`ghost`,size:`icon`,className:`mt-1.5 mr-1.5 h-6 w-6 shrink-0 text-muted-foreground opacity-60 hover:opacity-100`,"aria-label":a,"data-testid":n,children:o})}),t[3]=a,t[4]=n,t[5]=c):c=t[5];let l;t[6]===r?l=t[7]:(l=(0,$.jsx)(C,{side:`left`,className:`max-w-sm text-left`,children:(0,$.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:r})}),t[6]=r,t[7]=l);let u;return t[8]!==c||t[9]!==l?(u=(0,$.jsxs)(w,{children:[c,l]}),t[8]=c,t[9]=l,t[10]=u):u=t[10],u}function ar(){let e=(0,Z.c)(38),{_:t}=s(),n=typeof window<`u`?window.okDesktop??null:null,[r,i]=(0,Q.useState)(null),[a,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(null),d,f;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{if(!n)return;let e=!1;return n.integrations.status().then(t=>{e||i(t)}).catch(()=>{e||c(!0)}),()=>{e=!0}},f=[n],e[0]=d,e[1]=f):(d=e[0],f=e[1]),(0,Q.useEffect)(d,f);let p;e[2]===t?p=e[3]:(p=async function(e,r){if(n){u(rr(e));try{let t=await n.integrations.setComponent({component:e,enabled:r});i(t.status),t.ok||X.error(t.error)}catch(e){let n=e;X.error(t({id:`gfdqcY`,values:{0:n instanceof Error?n.message:String(n)}}))}u(null)}},e[2]=t,e[3]=p);let m=p,h;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(`h3`,{id:`settings-ai-tools-title`,className:`text-base font-semibold`,children:(0,$.jsx)(o,{id:`_5qBNl`})}),e[4]=h):h=e[4];let g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[h,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`mLAjyL`})})]}),e[5]=g):g=e[5];let _=g;if(!n||a){let t;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`ai-tools-unavailable`,children:(0,$.jsx)(o,{id:`O4PnDd`})})]}),e[6]=t):t=e[6],t}if(r===null){let t;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsxs)(`div`,{className:`space-y-2`,"data-testid":`ai-tools-loading`,children:[(0,$.jsx)(pn,{className:`h-10 w-full`}),(0,$.jsx)(pn,{className:`h-10 w-full`}),(0,$.jsx)(pn,{className:`h-10 w-full`})]})]}),e[7]=t):t=e[7],t}let v=l!==null||!r.available,y=r.path.shellDetected||r.path.installed,b;e[8]===r.available?b=e[9]:(b=!r.available&&(0,$.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,"data-testid":`ai-tools-read-only`,children:(0,$.jsx)(o,{id:`OplnBG`})}),e[8]=r.available,e[9]=b);let x;e[10]!==t||e[11]!==m||e[12]!==v||e[13]!==y||e[14]!==r.path.installed||e[15]!==r.path.rcFilesToTouch?(x=y&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(o,{id:`ALhMYW`})}),(0,$.jsxs)(`div`,{className:`flex items-start overflow-hidden rounded-md border border-border bg-card/50 hover:bg-accent`,children:[(0,$.jsxs)(V,{htmlFor:`ai-tools-path`,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(I,{id:`ai-tools-path`,checked:r.path.installed,disabled:v,onCheckedChange:()=>void m({kind:`path`},!r.path.installed),className:`mt-0.5`,"data-testid":`ai-tools-path-checkbox`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(o,{id:`Fsx78O`,components:{0:(0,$.jsx)(`code`,{className:`inline-code`})}})}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`ai-tools-path-status`,children:r.path.installed?t({id:`yhdqox`}):t({id:`04XyCH`,values:{0:r.path.rcFilesToTouch.join(`, `)}})})]})]}),(0,$.jsxs)(ir,{testId:`ai-tools-path-info`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(o,{id:`f9lQNJ`})}),r.path.rcFilesToTouch.map(sr),(0,$.jsx)(`p`,{className:`pt-1`,children:(0,$.jsx)(o,{id:`CWzc2T`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]})]})]}),e[10]=t,e[11]=m,e[12]=v,e[13]=y,e[14]=r.path.installed,e[15]=r.path.rcFilesToTouch,e[16]=x):x=e[16];let S;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(o,{id:`psfGPX`})}),e[17]=S):S=e[17];let C;if(e[18]!==t||e[19]!==m||e[20]!==v||e[21]!==r.editors){let n;e[23]!==t||e[24]!==m||e[25]!==v?(n=e=>{let n=e.state===`installed`||e.state===`foreign`,r=v||e.state===`unmanageable`,i=e.state===`not-installed`&&!e.detected,a=`https://openknowledge.ai/docs/integrations/${Me[e.id]}`,s=e.state===`installed`?t({id:`eQkgKV`}):e.state===`foreign`?t({id:`AczYxH`}):e.state===`unmanageable`?t({id:`LbmLyU`}):e.detected?t({id:`bBE5tC`}):null,c=e.state===`foreign`||e.state===`unmanageable`?`text-xs text-amber-600 dark:text-amber-400`:`text-xs text-muted-foreground`;return(0,$.jsxs)(`li`,{className:r?`flex items-start`:`flex items-start hover:bg-accent`,children:[(0,$.jsxs)(V,{htmlFor:`ai-tools-editor-${e.id}`,className:r?`flex flex-1 items-start gap-2.5 px-3 py-2.5 font-normal`:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(I,{id:`ai-tools-editor-${e.id}`,checked:n,disabled:r,onCheckedChange:()=>void m({kind:`editor`,id:e.id},!n),className:`mt-0.5`,"data-testid":`ai-tools-editor-checkbox-${e.id}`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.label}),s!==null&&(0,$.jsx)(`span`,{className:c,"data-testid":`ai-tools-editor-status-${e.id}`,children:s})]})]}),i&&(0,$.jsxs)(`a`,{href:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>un(e,a),onAuxClick:e=>un(e,a),"aria-label":t({id:`D-Oh1s`,values:{0:e.label}}),className:`flex shrink-0 items-center gap-0.5 px-2 py-2.5 text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`ai-tools-editor-status-${e.id}`,children:[(0,$.jsx)(o,{id:`P_bX4O`}),(0,$.jsx)(et,{className:`size-3`,"aria-hidden":!0})]}),(0,$.jsxs)(ir,{testId:`ai-tools-editor-info-${e.id}`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(o,{id:`J2eKUI`})}),(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e.configPath??t({id:`ndwmea`})})}),(0,$.jsx)(`p`,{className:`pt-1 opacity-70`,children:(0,$.jsx)(o,{id:`VIwCaD`})}),(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e.entryLocator})})]})]},e.id)},e[23]=t,e[24]=m,e[25]=v,e[26]=n):n=e[26],C=r.editors.map(n),e[18]=t,e[19]=m,e[20]=v,e[21]=r.editors,e[22]=C}else C=e[22];let w;e[27]===C?w=e[28]:(w=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[S,(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:C})]}),e[27]=C,e[28]=w);let T;e[29]!==m||e[30]!==v||e[31]!==r.skills?(T=r.skills.length>0&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(o,{id:`28B21t`})}),(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:r.skills.map(e=>(0,$.jsxs)(`li`,{className:`flex items-start hover:bg-accent`,children:[(0,$.jsxs)(V,{htmlFor:`ai-tools-skill-${e.id}`,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(I,{id:`ai-tools-skill-${e.id}`,checked:e.installed,disabled:v,onCheckedChange:()=>void m({kind:`skill`,id:e.id},!e.installed),className:`mt-0.5`,"data-testid":`ai-tools-skill-checkbox-${e.id}`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(`code`,{children:e.name})}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`ai-tools-skill-status-${e.id}`,children:e.id===`discovery`?(0,$.jsx)(o,{id:`0inVGS`}):(0,$.jsx)(o,{id:`FXk_zY`})})]})]}),(0,$.jsxs)(ir,{testId:`ai-tools-skill-info-${e.id}`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(o,{id:`HSh8u_`})}),e.paths.map(or)]})]},e.id))})]}),e[29]=m,e[30]=v,e[31]=r.skills,e[32]=T):T=e[32];let E;return e[33]!==T||e[34]!==b||e[35]!==x||e[36]!==w?(E=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,b,x,w,T]}),e[33]=T,e[34]=b,e[35]=x,e[36]=w,e[37]=E):E=e[37],E}function or(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}function sr(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}function cr(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 lr(e,t,n){return e.id===`custom`?cr(Fe(on(t))):e.scheme?cr(Fe(e.scheme)):cr(ln(n))}function ur(e){let t=(0,Z.c)(36),{theme:n,customSeed:r,defaultMode:i}=e,a,o,s,c,l,u,d,f,p;t[0]!==r||t[1]!==i||t[2]!==n?(a=lr(n,r,i),u=!0,d=`aspect-[4/3] w-full overflow-hidden rounded-md border`,f={backgroundColor:a.surface,borderColor:a.line},p=(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(dr),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):(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]);let m;t[12]!==o||t[13]!==s||t[14]!==c?(m=(0,$.jsx)(`div`,{className:o,style:s,children:c}),t[12]=o,t[13]=s,t[14]=c,t[15]=m):m=t[15];let h;t[16]===a.dots[1]?h=t[17]:(h=(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-full`,style:{backgroundColor:a.dots[1]}}),t[16]=a.dots[1],t[17]=h);let g;t[18]===a.line?g=t[19]:(g=(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-full opacity-60`,style:{backgroundColor:a.line}}),t[18]=a.line,t[19]=g);let _;t[20]===a.dots[0]?_=t[21]:(_=(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:a.dots[0]}}),t[20]=a.dots[0],t[21]=_);let v;t[22]!==h||t[23]!==g||t[24]!==_?(v=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1 px-1.5`,children:[h,g,_]}),t[22]=h,t[23]=g,t[24]=_,t[25]=v):v=t[25];let y;t[26]!==v||t[27]!==l||t[28]!==m?(y=(0,$.jsxs)(`div`,{className:l,children:[m,v]}),t[26]=v,t[27]=l,t[28]=m,t[29]=y):y=t[29];let b;return t[30]!==y||t[31]!==u||t[32]!==d||t[33]!==f||t[34]!==p?(b=(0,$.jsxs)(`div`,{"aria-hidden":u,className:d,style:f,children:[p,y]}),t[30]=y,t[31]=u,t[32]=d,t[33]=f,t[34]=p,t[35]=b):b=t[35],b}function dr(e,t){return(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function fr(e){let t=(0,Z.c)(11),{value:n,onSelect:r,customSeed:i,defaultMode:a,id:o,"aria-label":c,"aria-describedby":l}=e,u=a===void 0?`light`:a,{_:d}=s(),f=Pe.some(e=>e.id===n)?n:`default`,p;t[0]!==d||t[1]!==i||t[2]!==u?(p=Pe.map(e=>(0,$.jsxs)(ie,{value:e.id,className:h(`group/tile flex flex-col gap-1.5 rounded-lg border-2 border-transparent p-1 text-left outline-none`,`hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40`,`data-checked:border-primary`),children:[(0,$.jsx)(ur,{theme:e,customSeed:i,defaultMode:u}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between px-0.5`,children:[(0,$.jsx)(`span`,{className:`text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:e.id===`custom`?en(on(i))===`dark`?d({id:`pvnfJD`}):d({id:`1njn7W`}):e.kind===`system`?d({id:`R9Khdg`}):e.kind===`light`?d({id:`1njn7W`}):d({id:`pvnfJD`})})]})]},e.id)),t[0]=d,t[1]=i,t[2]=u,t[3]=p):p=t[3];let m;return t[4]!==l||t[5]!==c||t[6]!==o||t[7]!==r||t[8]!==f||t[9]!==p?(m=(0,$.jsx)(re,{id:o,"aria-label":c,"aria-describedby":l,value:f,onValueChange:r,className:`grid w-full grid-cols-2 gap-2 sm:grid-cols-3`,children:p}),t[4]=l,t[5]=c,t[6]=o,t[7]=r,t[8]=f,t[9]=p,t[10]=m):m=t[10],m}function pr(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)]:pr(r,t)}}function mr(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 hr(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 gr(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 _r(e){if(!ke(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 vr(){let e=(0,Z.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(pn,{className:`h-5 w-32`}),n=(0,$.jsx)(pn,{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)(pn,{className:`h-9 w-full`}),(0,$.jsx)(pn,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function yr({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=s(),a=In(),c=Te(xe,e.path),l=c?hr(c):void 0,u=c?mr(c):void 0,d=c?gr(c):void 0,f=c?Ne(c):void 0,p=f?.scope===`project`&&t!==`project`||f?.scope===`user`&&t!==`user`,m=e.path.join(`.`),g=i(e.label),[_,v]=(0,Q.useState)(!1),y=(0,Q.useRef)(null);(0,Q.useEffect)(()=>()=>{y.current&&clearTimeout(y.current)},[]);let b=()=>{v(!0),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>v(!1),1200)},T=()=>{let e=n(m);return e&&b(),e},E=()=>a.getFieldState(m).isDirty?T():!0,D=()=>{let e=u===void 0?null:u;a.setValue(m,e,{shouldDirty:!1}),T()},O=h(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(Nn,{control:a.control,name:m,render:({field:n})=>{let r=!p&&(u!==void 0||n.value!==void 0);return(0,$.jsxs)(jn,{className:O,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(Fn,{className:`text-sm font-medium`,children:g}),r?(0,$.jsxs)(w,{children:[(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(x,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:D,"aria-label":i({id:`lhjq3G`,values:{labelText:g}}),children:(0,$.jsx)(Pt,{className:`size-3.5`})})}),(0,$.jsx)(C,{children:(0,$.jsx)(o,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)(Ln,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Pn,{children:(0,$.jsx)(br,{field:e,ctl:n,typeTag:l,enumOptions:d,onCommit:E})}),(0,$.jsx)(wr,{visible:_,srOnly:e.control===`theme-tiles`})]}),(0,$.jsx)(Rn,{"data-field-error":e.path.join(`.`)})]})}})}function br({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:i,...a}){"use no memo";let{_:o}=s(),{setTheme:c,systemTheme:u}=l(),d=sn()?.merged??null;if(e.control===`theme-tiles`){let{id:n,...r}=a,s=d?.appearance?.customTheme,l=d?.appearance?.theme,f=l===`light`||l===`dark`?l:u===`dark`?`dark`:`light`;return(0,$.jsx)(fr,{...r,id:n,value:typeof t.value==`string`?t.value:`default`,customSeed:s,defaultMode:f,"aria-label":o(e.label),onSelect:e=>{if($t(e,s),e===`custom`)c(en(on(s))===`dark`?`dark`:`light`);else{let t=Re(e);t&&c(t)}t.onChange(e),i()}})}if(n===`boolean`)return(0,$.jsx)(K,{...a,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,...s}=a,l=e.path[0]===`appearance`&&e.path[1]===`theme`;return(0,$.jsx)(ae,{...s,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(l&&c(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":o(e.label),children:r.map((e,t)=>(0,$.jsx)(q,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,$.jsx)(Sr,{ctl:t,onCommit:i,...a}):n===`array`?(0,$.jsx)(Cr,{ctl:t,onCommit:i,...a}):(0,$.jsx)(xr,{ctl:t,onCommit:i,...a})}function xr({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(Vt,{...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 Sr({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,Q.useState)(e.value===void 0?``:String(e.value)),a=(0,Q.useRef)(e.value);(0,Q.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)(Vt,{...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 Cr({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
2
+ `):``,[i,a]=(0,Q.useState)(r),o=(0,Q.useRef)(r);(0,Q.useEffect)(()=>{let t=Array.isArray(e.value)?e.value.join(`
3
+ `):``;t!==o.current&&(a(t),o.current=t)},[e.value]);let s=()=>{let n=i.split(`
4
+ `).map(e=>e.trim()).filter(e=>e.length>0);e.onChange(n),t(),o.current=n.join(`
5
+ `)};return(0,$.jsx)(dn,{...n,value:i,ref:e.ref,onChange:e=>a(e.target.value),onBlur:()=>{e.onBlur(),s()},rows:Math.max(2,Math.min(6,i.split(`
6
+ `).length)),className:`field-sizing-fixed min-h-16 rounded-md bg-background px-3 py-1.5 font-mono text-xs md:text-xs dark:bg-background`})}function wr(e){let t=(0,Z.c)(5),{visible:n,srOnly:r}=e,i=r===void 0?!1:r,a;t[0]!==i||t[1]!==n?(a=n?(0,$.jsxs)($.Fragment,{children:[i?null:(0,$.jsx)(nt,{"aria-hidden":`true`,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(o,{id:`idD8Ev`})})]}):null,t[0]=i,t[1]=n,t[2]=a):a=t[2];let s;return t[3]===a?s=t[4]:(s=(0,$.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`text-emerald-600`,children:a}),t[3]=a,t[4]=s),s}function Tr(e){let t=(0,Z.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=Mn(i),o,s;t[4]!==e||t[5]!==a?(o=()=>e.subscribe(e=>{Er(a,e)}),s=[e,a],t[4]=e,t[5]=a,t[6]=o,t[7]=s):(o=t[6],s=t[7]),(0,Q.useEffect)(o,s);let c;t[8]!==e||t[9]!==a?(c=t=>Dr(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 Er(e,t){e.reset(t,{keepDirtyValues:!0,keepDirty:!0,keepTouched:!0})}function Dr(e,t,n){let r=e.getValues(n),i=pr(Ar(n),r),a=t.patch(i);if(a.ok)return e.clearErrors(n),e.resetField(n,{defaultValue:r,keepError:!1}),!0;if(ke(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:Or(a.error,n)});return!1}function Or(e,t){if(ke(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>kr(e,t));if(n)return n.message}return qe(e)}function kr(e,t){return e.path.map(String).join(`.`)===t}function Ar(e){return e.split(`.`)}var jr=`content.attachmentFolderPath`,Mr=`attachments`;function Nr(e){let t=Se(e);return t===`./`?`same-folder`:t===`/`?`content-root`:t.startsWith(`./`)?`current-folder-subfolder`:`content-root-folder`}function Pr(e){let t=Se(e);return t===`./`||t===`/`?Mr:t.startsWith(`./`)?t.slice(2)||Mr:t}function Fr(e){return e.trim().replace(/^(?:\.\/)+/,``).replace(/\/{2,}/g,`/`).replace(/\/+$/g,``)}function Ir(e,t){let n=Fr(t)||Mr;return e===`same-folder`?`./`:e===`content-root`?`/`:e===`current-folder-subfolder`?`./${n}`:n}function Lr(){let e=(0,Z.c)(4),{projectBinding:t,projectConfig:n,projectSynced:r}=an();if(!t||!r||!n){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(vr,{}),e[0]=t):t=e[0],t}let i=n.content.attachmentFolderPath??`./`,a;return e[1]!==i||e[2]!==t?(a=(0,$.jsx)(Rr,{binding:t,value:i},i),e[1]=i,e[2]=t,e[3]=a):a=e[3],a}function Rr(e){let t=(0,Z.c)(50),{binding:n,value:r}=e,{_:i}=s(),a;t[0]===r?a=t[1]:(a=()=>Nr(r),t[0]=r,t[1]=a);let[c,l]=(0,Q.useState)(a),u;t[2]===r?u=t[3]:(u=()=>Pr(r),t[2]=r,t[3]=u);let[d,f]=(0,Q.useState)(u),[p,m]=(0,Q.useState)(null),[g,_]=(0,Q.useState)(!1),[v,y]=(0,Q.useState)(!1),b=(0,Q.useRef)(null),x=(0,Q.useRef)(null),S,C;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>()=>{b.current&&clearTimeout(b.current),x.current&&clearTimeout(x.current)},C=[],t[4]=S,t[5]=C):(S=t[4],C=t[5]),(0,Q.useEffect)(S,C);let w,T;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>xt(e=>{if(e.docName!==`__config__/project`||_r(e.error)!==jr)return;let t=Or(e.error,jr);X.error(qe(e.error),{duration:8e3}),m(t),y(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{y(!1),m(null)},600)}),T=[],t[6]=w,t[7]=T):(w=t[6],T=t[7]),(0,Q.useEffect)(w,T);let E;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>{_(!0),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>_(!1),1200)},t[8]=E):E=t[8];let D=E,O;t[9]!==i||t[10]!==n?(O=e=>{let t=n.patch({content:{attachmentFolderPath:e}});if(t.ok){m(null),D();return}let r=Or(t.error,jr);m(r),X.error(i({id:`eQxm13`,values:{detail:r}}))},t[9]=i,t[10]=n,t[11]=O):O=t[11];let k=O,A;t[12]!==k||t[13]!==d?(A=e=>{if(e!==`same-folder`&&e!==`content-root`&&e!==`current-folder-subfolder`&&e!==`content-root-folder`)return;let t=e,n=t===`current-folder-subfolder`||t===`content-root-folder`?d||Mr:d;l(t),f(n),k(Ir(t,n))},t[12]=k,t[13]=d,t[14]=A):A=t[14];let j=A,M;t[15]!==k||t[16]!==d||t[17]!==c?(M=()=>{let e=Ir(c,d);f(Pr(e)),k(e)},t[15]=k,t[16]=d,t[17]=c,t[18]=M):M=t[18];let N=M,P=c===`current-folder-subfolder`||c===`content-root-folder`,F;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(`h3`,{id:`settings-attachments-title`,className:`text-base font-semibold`,children:(0,$.jsx)(o,{id:`w_Sphq`})}),t[19]=F):F=t[19];let I;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[F,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`Hnl9nT`})})]}),t[20]=I):I=t[20];let L=v&&`animate-settings-flash`,R;t[21]===L?R=t[22]:(R=h(`rounded-md border p-3`,L),t[21]=L,t[22]=R);let z;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(`div`,{className:`text-sm font-medium`,id:`settings-attachments-location-label`,children:(0,$.jsx)(o,{id:`AsqRE_`})}),t[23]=z):z=t[23];let B;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[z,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(o,{id:`vppAju`})})]}),t[24]=B):B=t[24];let V;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(U,{"aria-labelledby":`settings-attachments-location-label`,"data-testid":`settings-attachments-mode`,size:`sm`,children:(0,$.jsx)(te,{})}),t[25]=V):V=t[25];let re;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsx)(H,{value:`same-folder`,children:(0,$.jsx)(o,{id:`Q7W-mC`})}),t[26]=re):re=t[26];let W;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(H,{value:`content-root`,children:(0,$.jsx)(o,{id:`yWSvcf`})}),t[27]=W):W=t[27];let ie;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(H,{value:`current-folder-subfolder`,children:(0,$.jsx)(o,{id:`0YUS3Q`})}),t[28]=ie):ie=t[28];let G;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsxs)(ee,{children:[re,W,ie,(0,$.jsx)(H,{value:`content-root-folder`,children:(0,$.jsx)(o,{id:`qAx7xG`})})]}),t[29]=G):G=t[29];let K;t[30]!==c||t[31]!==j?(K=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(16rem,18rem)] sm:items-start`,children:[B,(0,$.jsxs)(ne,{value:c,onValueChange:j,children:[V,G]})]}),t[30]=c,t[31]=j,t[32]=K):K=t[32];let q;t[33]!==i||t[34]!==N||t[35]!==d||t[36]!==P?(q=P?(0,$.jsxs)(`div`,{className:`mt-3 max-w-sm space-y-1`,children:[(0,$.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:`settings-attachments-folder-input`,children:(0,$.jsx)(o,{id:`kNqMMd`})}),(0,$.jsx)(Vt,{id:`settings-attachments-folder-input`,value:d,placeholder:i({id:`OeAl1e`}),onChange:e=>f(e.target.value),onBlur:N,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),N())},className:`h-8 text-sm`,"data-testid":`settings-attachments-folder`})]}):null,t[33]=i,t[34]=N,t[35]=d,t[36]=P,t[37]=q):q=t[37];let ae;t[38]===p?ae=t[39]:(ae=p?(0,$.jsx)(`p`,{className:`text-1sm text-destructive`,"data-field-error":jr,role:`alert`,children:p}):null,t[38]=p,t[39]=ae);let J;t[40]===g?J=t[41]:(J=(0,$.jsx)(wr,{visible:g}),t[40]=g,t[41]=J);let oe;t[42]!==ae||t[43]!==J?(oe=(0,$.jsxs)(`div`,{className:`mt-2 flex min-h-5 items-center gap-2`,children:[ae,J]}),t[42]=ae,t[43]=J,t[44]=oe):oe=t[44];let se;return t[45]!==R||t[46]!==K||t[47]!==q||t[48]!==oe?(se=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-attachments-title`,className:`space-y-3`,"data-testid":`settings-attachments`,children:[I,(0,$.jsxs)(`div`,{className:R,"data-field":jr,"data-scope":`project`,children:[K,q,oe]})]}),t[45]=R,t[46]=K,t[47]=q,t[48]=oe,t[49]=se):se=t[49],se}function zr(e){let t=(0,Z.c)(21),{icon:n,name:r,hint:i,checked:a,disabled:o,ariaLabel:s,testId:c,onToggle:l}=e,u;t[0]===n?u=t[1]:(u=(0,$.jsx)(`span`,{className:`flex h-5 shrink-0 items-center`,children:n}),t[0]=n,t[1]=u);let d;t[2]===r?d=t[3]:(d=(0,$.jsx)(`span`,{className:`truncate text-sm leading-5`,children:r}),t[2]=r,t[3]=d);let f;t[4]===i?f=t[5]:(f=i?(0,$.jsx)(`span`,{className:`truncate text-muted-foreground text-1sm`,children:i}):null,t[4]=i,t[5]=f);let p;t[6]!==d||t[7]!==f?(p=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[d,f]}),t[6]=d,t[7]=f,t[8]=p):p=t[8];let m;t[9]!==u||t[10]!==p?(m=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5`,children:[u,p]}),t[9]=u,t[10]=p,t[11]=m):m=t[11];let h;t[12]!==s||t[13]!==a||t[14]!==o||t[15]!==l||t[16]!==c?(h=(0,$.jsx)(K,{checked:a,disabled:o,onCheckedChange:l,"aria-label":s,"data-testid":c}),t[12]=s,t[13]=a,t[14]=o,t[15]=l,t[16]=c,t[17]=h):h=t[17];let g;return t[18]!==m||t[19]!==h?(g=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,children:[m,h]}),t[18]=m,t[19]=h,t[20]=g):g=t[20],g}function Br(e){let t=(0,Z.c)(9),{label:n,children:r,labelId:i}=e,a;t[0]!==n||t[1]!==i?(a=(0,$.jsx)(`h4`,{id:i,className:`mb-2 font-mono text-muted-foreground text-xs uppercase tracking-wide`,children:n}),t[0]=n,t[1]=i,t[2]=a):a=t[2];let o;t[3]===r?o=t[4]:(o=(0,$.jsx)(`div`,{className:`divide-y overflow-hidden rounded-md border`,children:r}),t[3]=r,t[4]=o);let s;return t[5]!==i||t[6]!==a||t[7]!==o?(s=(0,$.jsxs)(`section`,{"aria-labelledby":i,children:[a,o]}),t[5]=i,t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function Vr(){let e=(0,Z.c)(50),{_:t}=s(),n=le(),r=J(),{states:a,refresh:o}=y(),l=v(),[u,d]=(0,Q.useState)(``),[f,p]=(0,Q.useState)(!1),m;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={queryKey:[`acp-catalog`],queryFn:Wr,staleTime:3e5},e[0]=m):m=e[0];let h=c(m),g;e[1]===o?g=e[2]:(g=()=>{o()},e[1]=o,e[2]=g);let _=(0,Q.useEffectEvent)(g),b;e[3]===_?b=e[4]:(b=()=>{_()},e[3]=_,e[4]=b);let S;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(S=[],e[5]=S):S=e[5],(0,Q.useEffect)(b,S);let C=h.data?.agents,w;e[6]===r?w=e[7]:(w=new Set(r.map(Ur)),e[6]=r,e[7]=w);let T=w,E;e[8]===l?.installedClis?E=e[9]:(E=l?.installedClis??{},e[8]=l?.installedClis,e[9]=E);let D=E,O;if(e[10]!==t||e[11]!==h||e[12]!==C||e[13]!==D||e[14]!==n||e[15]!==u||e[16]!==T||e[17]!==f||e[18]!==a||e[19]!==l){let r=u.trim().toLowerCase(),o=e=>r===``||e.toLowerCase().includes(r),s=(C??[]).filter(e=>o(e.name)),c=l===null?[]:Ee.filter(e=>o(we[e].displayName)),m=ue.filter(e=>o(e.displayName)),g=r!==``,_=!h.isLoading&&!h.isError,v=g&&_&&s.length===0&&c.length===0&&m.length===0,y=!g||h.isLoading||h.isError||s.length>0,b=l!==null&&(!g||c.length>0),S=!g||m.length>0,w;e[21]!==n||e[22]!==T?(w=e=>{let t=T.has(`${e.source}:${e.id}`),r=e.supported===!0&&e.harness?.availability===`present`;return fe(n,e.source,e.id,t||r,e.supported)},e[21]=n,e[22]=T,e[23]=w):w=e[23];let E=w,k;e[24]===E?k=e[25]:(k=e=>e.harness!==void 0||E(e),e[24]=E,e[25]=k);let A=s.filter(k),j=g||f?s:A,M=g?0:s.length-A.length,N;e[26]===t?N=e[27]:(N=t({id:`jRAGrQ`}),e[26]=t,e[27]=N);let P;e[28]===N?P=e[29]:(P=(0,$.jsx)(`h3`,{id:`settings-configure-agents-title`,className:`font-semibold text-base`,children:N}),e[28]=N,e[29]=P);let F;e[30]===t?F=e[31]:(F=t({id:`OcBurH`}),e[30]=t,e[31]=F);let I;e[32]===F?I=e[33]:(I=(0,$.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:F}),e[32]=F,e[33]=I);let L;e[34]!==P||e[35]!==I?(L=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[P,I]}),e[34]=P,e[35]=I,e[36]=L):L=e[36];let R;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsx)(i,{className:`-translate-y-1/2 absolute top-1/2 left-2.5 size-4 text-muted-foreground`,"aria-hidden":`true`}),e[37]=R):R=e[37];let z;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>d(e.target.value),e[38]=z):z=e[38];let B;e[39]===t?B=e[40]:(B=t({id:`-7s4fw`}),e[39]=t,e[40]=B);let V;e[41]===t?V=e[42]:(V=t({id:`-7s4fw`}),e[41]=t,e[42]=V);let H;e[43]!==u||e[44]!==B||e[45]!==V?(H=(0,$.jsxs)(`div`,{className:`relative`,children:[R,(0,$.jsx)(Vt,{value:u,onChange:z,placeholder:B,"aria-label":V,className:`pl-8`,"data-testid":`configure-agents-search`})]}),e[43]=u,e[44]=B,e[45]=V,e[46]=H):H=e[46];let ee;e[47]!==t||e[48]!==v?(ee=v?(0,$.jsx)(`p`,{className:`py-6 text-center text-muted-foreground text-sm`,"data-testid":`configure-agents-no-results`,children:t({id:`Nay2Yr`})}):null,e[47]=t,e[48]=v,e[49]=ee):ee=e[49],O=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-configure-agents-title`,className:`space-y-6`,"data-testid":`settings-configure-agents`,children:[L,H,ee,y?(0,$.jsx)(Br,{label:(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[t({id:`RXEbZy`}),(0,$.jsx)(he,{})]}),labelId:`settings-configure-agents-in-app`,children:h.isLoading?(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2 px-3 py-6 text-muted-foreground text-sm`,children:[(0,$.jsx)(Nt,{className:`size-4 animate-spin`,"aria-hidden":`true`}),t({id:`ucXZ0k`})]}):h.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)(Kn,{className:`size-5`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:t({id:`FqGWeR`})}),(0,$.jsx)(x,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void h.refetch(),children:t({id:`6gRgw8`})})]}):(C?.length??0)===0?(0,$.jsx)(`p`,{className:`px-3 py-6 text-center text-muted-foreground text-sm`,children:t({id:`QQbwzK`})}):(0,$.jsxs)($.Fragment,{children:[j.map(e=>{let r=E(e),i=e.supported?e.description:t({id:`5jEnaB`});return(0,$.jsx)(zr,{icon:(0,$.jsx)(tt,{agentId:e.id,iconUrl:e.iconUrl,className:`size-4`}),name:e.name,hint:i,checked:r,disabled:!e.supported,ariaLabel:t({id:`FZtBeR`,values:{0:e.name}}),testId:`configure-agents-in-app-${e.source}:${e.id}`,onToggle:t=>{t?(se({source:e.source,id:e.id,name:e.name,supported:e.supported,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}},{makeDefault:!1}),_e(de(e.source,e.id),!0)):(_e(de(e.source,e.id),!1),ve(`${e.source}:${e.id}`,e=>fe(n,e.source,e.id,!0,e.supported)))}},`${e.source}:${e.id}`)}),M>0?(0,$.jsx)(x,{type:`button`,variant:`ghost`,onClick:()=>p(Hr),className:`w-full justify-center rounded-none font-normal text-1sm text-muted-foreground`,"data-testid":`configure-agents-in-app-show-more`,children:t(f?{id:`6lGV3K`}:{id:`np9pbC`,values:{inAppHiddenCount:M}})}):null]})}):null,b?(0,$.jsx)(Br,{label:t({id:`ALhMYW`}),labelId:`settings-configure-agents-terminal`,children:c.map(e=>{let{displayName:r}=we[e],i=D[e]===!1;return(0,$.jsx)(zr,{icon:(0,$.jsx)(pe,{id:oe(e),className:`size-4`,"aria-hidden":`true`}),name:t({id:`QYfQdv`,values:{displayName:r}}),hint:i?t({id:`5SwVv1`}):void 0,checked:me(n,e,D),ariaLabel:t({id:`27TLNq`,values:{displayName:r}}),testId:`configure-agents-terminal-${e}`,onToggle:t=>_e(ce(e),t)},e)})}):null,S?(0,$.jsx)(Br,{label:t({id:`BBqGS9`}),labelId:`settings-configure-agents-desktop`,children:m.map(e=>{let r=a[e.id]?.installed??null;return(0,$.jsx)(zr,{icon:(0,$.jsx)(pe,{id:e.id,className:`size-4`,"aria-hidden":`true`}),name:e.displayName,hint:r===!1?t({id:`5SwVv1`}):void 0,checked:ge(n,e.id),ariaLabel:t({id:`FZtBeR`,values:{0:e.displayName}}),testId:`configure-agents-desktop-${e.id}`,onToggle:t=>_e(Y(e.id),t)},e.id)})}):null]}),e[10]=t,e[11]=h,e[12]=C,e[13]=D,e[14]=n,e[15]=u,e[16]=T,e[17]=f,e[18]=a,e[19]=l,e[20]=O}else O=e[20];return O}function Hr(e){return!e}function Ur(e){return`${e.source}:${e.id}`}function Wr(e){let{signal:t}=e;return ye(t)}function Gr(){let e=(0,Z.c)(35),{_:t}=s(),{projectConfig:n,projectSynced:r,projectBinding:i}=an(),a=r&&i!==null,c=n?.validation?.links??`warning`,l=n?.validation?.fileTreeIndicators!==!1,u;e[0]!==t||e[1]!==i?(u=function(e){if(i===null){X.error(t({id:`dVaXnv`}));return}let n=i.patch({validation:e});n.ok||X.error(t({id:`NrFwux`,values:{0:qe(n.error)}}))},e[0]=t,e[1]=i,e[2]=u):u=e[2];let d=u,f;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`h3`,{id:`settings-content-rules-title`,className:`text-base font-semibold`,children:(0,$.jsx)(o,{id:`OPOiKn`})}),e[3]=f):f=e[3];let p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[f,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`FTBN5g`})})]}),e[4]=p):p=e[4];let m;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(V,{htmlFor:`settings-content-rules-links`,className:`text-sm font-medium`,children:(0,$.jsx)(o,{id:`8ruqQi`})}),e[5]=m):m=e[5];let h;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[m,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`N-IonL`})})]}),e[6]=h):h=e[6];let g;e[7]===d?g=e[8]:(g=e=>d({links:e}),e[7]=d,e[8]=g);let _=!a,v;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(U,{id:`settings-content-rules-links`,className:`w-36 shrink-0`,"data-testid":`settings-content-rules-links`,children:(0,$.jsx)(te,{})}),e[9]=v):v=e[9];let y;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(H,{value:`off`,children:(0,$.jsx)(o,{id:`Nwbs0q`})}),e[10]=y):y=e[10];let b;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(H,{value:`warning`,children:(0,$.jsx)(o,{id:`r6y-jM`})}),e[11]=b):b=e[11];let x;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsxs)(ee,{children:[y,b,(0,$.jsx)(H,{value:`error`,children:(0,$.jsx)(o,{id:`SlfejT`})})]}),e[12]=x):x=e[12];let S;e[13]!==c||e[14]!==g||e[15]!==_?(S=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2`,children:[h,(0,$.jsxs)(ne,{value:c,onValueChange:g,disabled:_,children:[v,x]})]}),e[13]=c,e[14]=g,e[15]=_,e[16]=S):S=e[16];let C;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(V,{htmlFor:`settings-content-rules-indicators`,className:`text-sm font-medium`,children:(0,$.jsx)(o,{id:`x3kWeu`})}),e[17]=C):C=e[17];let w;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[C,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`ktspdq`})})]}),e[18]=w):w=e[18];let T=!a,E;e[19]===d?E=e[20]:(E=e=>d({fileTreeIndicators:e}),e[19]=d,e[20]=E);let D;e[21]!==t||e[22]!==l?(D=t(l?{id:`U9tm58`}:{id:`uR2YT3`}),e[21]=t,e[22]=l,e[23]=D):D=e[23];let O;e[24]!==l||e[25]!==T||e[26]!==E||e[27]!==D?(O=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2`,children:[w,(0,$.jsx)(K,{id:`settings-content-rules-indicators`,checked:l,disabled:T,onCheckedChange:E,"aria-label":D,"data-testid":`settings-content-rules-indicators`})]}),e[24]=l,e[25]=T,e[26]=E,e[27]=D,e[28]=O):O=e[28];let k;e[29]!==S||e[30]!==O?(k=(0,$.jsxs)(`div`,{className:`divide-y rounded-md border`,children:[S,O]}),e[29]=S,e[30]=O,e[31]=k):k=e[31];let A;e[32]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`settings-content-rules-plugins-note`,children:(0,$.jsx)(o,{id:`YDL7N6`})}),e[32]=A):A=e[32];let j;return e[33]===k?j=e[34]:(j=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-content-rules-title`,className:`space-y-4`,"data-testid":`settings-content-rules`,children:[p,k,A]}),e[33]=k,e[34]=j),j}function Kr({binding:e}){return Yt(e).split(` / `).map((e,t)=>t===0?(0,$.jsx)(r,{"aria-label":qt(e),children:e},`kbd-${e}`):(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(o,{id:`qEue6Q`})}),(0,$.jsx)(`span`,{"aria-hidden":`true`,children:` / `}),(0,$.jsx)(r,{"aria-label":qt(e),children:e})]},`or-${e}`))}function qr(){let e=(0,Z.c)(6),{_:t}=s(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`h3`,{id:`settings-hotkeys-title`,className:`text-base font-semibold`,children:(0,$.jsx)(o,{id:`4KmEoC`})}),e[0]=n):n=e[0];let r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[n,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`RaPMZv`})})]}),e[1]=r):r=e[1];let i;e[2]===t?i=e[3]:(i=Kt.map(e=>{let n=Jt.filter(t=>t.category===e);return n.length===0?null:(0,$.jsxs)(`section`,{"aria-labelledby":`settings-hotkeys-${e}`,children:[(0,$.jsx)(`h4`,{id:`settings-hotkeys-${e}`,className:`mb-2 font-mono text-muted-foreground text-xs uppercase tracking-wide`,children:t(Xt[e])}),(0,$.jsx)(`ul`,{"aria-labelledby":`settings-hotkeys-${e}`,className:`m-0 list-none overflow-hidden rounded-md border p-0`,children:n.map(e=>{let n=`settings-hotkey-${e.id}-title`,r=`settings-hotkey-${e.id}-description`,i=e.bindings.reduce(Jr,0)>4;return(0,$.jsxs)(`li`,{"aria-describedby":r,"aria-labelledby":n,className:h(`grid gap-2 border-border border-b px-3 py-3 last:border-b-0`,i?`sm:grid-cols-1`:`sm:grid-cols-[minmax(0,1fr)_minmax(0,auto)]`),"data-testid":`settings-hotkey-${e.id}`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(`p`,{className:`font-medium text-sm`,id:n,children:t(e.title)}),(0,$.jsxs)(Qt,{variant:`gray`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(o,{id:`iXTp5j`})}),t(e.scope)]})]}),(0,$.jsx)(`p`,{className:`text-muted-foreground text-sm`,id:r,children:t(e.description)})]}),(0,$.jsx)(`div`,{className:h(`flex min-w-0 max-w-full self-start content-start flex-wrap items-start gap-1.5`,i?`sm:justify-start`:`sm:max-w-[38rem] sm:justify-end`),children:e.bindings.map(t=>(0,$.jsx)(Kr,{binding:t},`${e.id}-${t.mac}-${t.windowsLinux}`))})]},e.id)})})]},e)}),e[2]=t,e[3]=i);let a;return e[4]===i?a=e[5]:(a=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-hotkeys-title`,className:`space-y-5`,"data-testid":`settings-hotkeys`,children:[r,(0,$.jsx)(`div`,{className:`space-y-6`,"data-testid":`settings-hotkeys-list`,children:i})]}),e[4]=i,e[5]=a),a}function Jr(e,t){return e+Yt(t).split(` / `).length}function Yr(){(0,Z.c)(16);let[e,t]=(0,Q.useState)(!1),{skillInstalled:n,refresh:r}=at();return null}function Xr(){let e=(0,Z.c)(32),{_:t}=s(),{projectLocalConfig:n,projectLocalSynced:r,projectLocalBinding:i}=an(),[a,c]=(0,Q.useState)(!1),l=(0,Q.useRef)(null),u=n?.linkPreviews?.enabled??!1,d=r&&i!==null,f;e[0]!==t||e[1]!==i?(f=function(e){if(i===null)return X.error(t({id:`ax9kie`})),!1;let n=i.patch({linkPreviews:{enabled:e}});if(!n.ok){let r=qe(n.error);return X.error(t(e?{id:`ZatAO_`,values:{detail:r}}:{id:`RO-yts`,values:{detail:r}})),!1}return!0},e[0]=t,e[1]=i,e[2]=f):f=e[2];let p=f,m;e[3]===p?m=e[4]:(m=function(e){if(e){c(!0);return}p(!1)},e[3]=p,e[4]=m);let h=m,g;e[5]===p?g=e[6]:(g=function(){p(!0)&&c(!1)},e[5]=p,e[6]=g);let _=g,v;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(`h3`,{id:`settings-link-previews-title`,className:`text-base font-semibold`,children:(0,$.jsx)(o,{id:`gh27t1`})}),e[7]=v):v=e[7];let y;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[v,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`cGV6Mh`})})]}),e[8]=y):y=e[8];let b;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(`label`,{htmlFor:`settings-link-previews-toggle`,className:`text-sm font-medium`,children:(0,$.jsx)(o,{id:`ENpRJV`})}),e[9]=b):b=e[9];let x;e[10]===u?x=e[11]:(x=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[b,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,"data-testid":`settings-link-previews-body`,children:u?(0,$.jsx)(o,{id:`rVJpLz`}):(0,$.jsx)(o,{id:`YjMLg2`})})]}),e[10]=u,e[11]=x);let S=!d,C;e[12]!==t||e[13]!==u?(C=t(u?{id:`5Umg9i`}:{id:`KpOJFY`}),e[12]=t,e[13]=u,e[14]=C):C=e[14];let w;e[15]!==u||e[16]!==h||e[17]!==S||e[18]!==C?(w=(0,$.jsx)(K,{ref:l,id:`settings-link-previews-toggle`,checked:u,disabled:S,onCheckedChange:h,"aria-label":C,"data-testid":`settings-link-previews-toggle`}),e[15]=u,e[16]=h,e[17]=S,e[18]=C,e[19]=w):w=e[19];let T;e[20]!==x||e[21]!==w?(T=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[x,w]}),e[20]=x,e[21]=w,e[22]=T):T=e[22];let E;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm mt-2`,children:(0,$.jsx)(o,{id:`Xk0-VC`})}),e[23]=E):E=e[23];let D;e[24]===T?D=e[25]:(D=(0,$.jsxs)(`div`,{className:`rounded-md border p-3`,children:[T,E]}),e[24]=T,e[25]=D);let O;e[26]!==a||e[27]!==_?(O=(0,$.jsx)(Zr,{open:a,onOpenChange:c,onConfirm:_,returnFocusRef:l}),e[26]=a,e[27]=_,e[28]=O):O=e[28];let k;return e[29]!==D||e[30]!==O?(k=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-link-previews-title`,className:`space-y-3`,"data-testid":`settings-link-previews`,children:[y,D,O]}),e[29]=D,e[30]=O,e[31]=k):k=e[31],k}function Zr(e){let t=(0,Z.c)(17),{open:n,onOpenChange:r,onConfirm:i,returnFocusRef:a}=e,s;t[0]===a?s=t[1]:(s=e=>{e.preventDefault(),a.current?.focus()},t[0]=a,t[1]=s);let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(k,{children:(0,$.jsx)(o,{id:`MqsbfN`})}),t[2]=c):c=t[2];let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsxs)(P,{children:[c,(0,$.jsx)(O,{children:(0,$.jsx)(o,{id:`VFQXPl`})})]}),t[3]=l):l=t[3];let u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(`p`,{className:`mb-2 font-medium`,children:(0,$.jsx)(o,{id:`2Snes1`})}),t[4]=u):u=t[4];let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(j,{children:(0,$.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2.5 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,children:[u,(0,$.jsxs)(`ul`,{className:`list-disc space-y-1.5 pl-5`,children:[(0,$.jsx)(`li`,{children:(0,$.jsx)(o,{id:`My0wYT`})}),(0,$.jsx)(`li`,{children:(0,$.jsx)(o,{id:`lmBPt0`})}),(0,$.jsx)(`li`,{children:(0,$.jsx)(o,{id:`5AzM72`})})]})]})}),t[5]=d):d=t[5];let f;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(N,{asChild:!0,children:(0,$.jsx)(x,{variant:`outline`,children:(0,$.jsx)(o,{id:`dEgA5A`})})}),t[6]=f):f=t[6];let p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(o,{id:`iMkWoF`}),t[7]=p):p=t[7];let m;t[8]===i?m=t[9]:(m=(0,$.jsxs)(M,{children:[f,(0,$.jsx)(x,{onClick:i,"data-testid":`settings-link-previews-confirm-enable`,children:p})]}),t[8]=i,t[9]=m);let h;t[10]!==s||t[11]!==m?(h=(0,$.jsxs)(A,{className:`sm:max-w-lg`,"data-testid":`settings-link-previews-confirm`,onCloseAutoFocus:s,children:[l,d,m]}),t[10]=s,t[11]=m,t[12]=h):h=t[12];let g;return t[13]!==r||t[14]!==n||t[15]!==h?(g=(0,$.jsx)(F,{open:n,onOpenChange:r,children:h}),t[13]=r,t[14]=n,t[15]=h,t[16]=g):g=t[16],g}var Qr=[`unmatched`,`invalid`,`suspicious`],$r=` appliesTo glob `,ei=` (frontmatter mapping for `,ti=` — `;function ni(e){if(!e.startsWith(`"`))return null;for(let t=1;t<e.length;t++){let n=e[t];if(n===`\\`){t++;continue}if(n===`"`)try{return{value:JSON.parse(e.slice(0,t+1)),rest:e.slice(t+1)}}catch{return null}}return null}function ri(e){let t=Qr.find(t=>e.startsWith(`${t}${$r}`));if(t===void 0)return null;let n=ni(e.slice(t.length+16));if(n===null)return null;let r=n.rest.lastIndexOf(ei);if(r===-1||!n.rest.endsWith(`)`))return null;let i=n.rest.slice(r+26,-1);if(i===``)return null;let a=n.rest.slice(0,r);if(!a.startsWith(ti))return null;let o=a.slice(3);return o===``?null:{kind:t,pattern:n.value,detail:o,file:i}}function ii(e){let t=new Map;for(let n of e){let e=ri(n);if(e===null)continue;let r=t.get(e.file);r===void 0&&(r=new Map,t.set(e.file,r));let i=r.get(e.pattern);r.set(e.pattern,i===void 0?e.detail:`${i}; ${e.detail}`)}return t}var ai=8e3;function oi({pluginId:e,label:t}){X.success(Ht._({id:`XfA5xx`,values:{label:t}}),{id:`plugin-enabled-${e}`,description:Ht._({id:`2wTb8w`}),duration:ai,action:{label:Ht._({id:`Yp-Hi_`}),onClick:()=>Wt(e)}})}function si(e){let t=(0,Z.c)(10),{scope:n}=e,r=`settings-scope-badge-${n}`,i;t[0]===n?i=t[1]:(i=n===`user`?(0,$.jsx)(o,{id:`7PzzBU`}):(0,$.jsx)(o,{id:`e0NrBM`}),t[0]=n,t[1]=i);let a;t[2]!==r||t[3]!==i?(a=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(Qt,{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 s;t[5]===n?s=t[6]:(s=(0,$.jsx)(C,{children:n===`user`?(0,$.jsx)(o,{id:`a7P3nH`}):(0,$.jsx)(o,{id:`494br3`})}),t[5]=n,t[6]=s);let c;return t[7]!==a||t[8]!==s?(c=(0,$.jsxs)(w,{children:[a,s]}),t[7]=a,t[8]=s,t[9]=c):c=t[9],c}function ci(){let e=(0,Z.c)(7),{_:t}=s(),{projectConfig:n,projectSynced:r,projectBinding:i}=an(),a=n?.contentRules,o=r&&i!==null,c;e[0]!==t||e[1]!==i?(c=function(e){if(i===null)return X.error(t({id:`dVaXnv`})),!1;let n=i.patch({contentRules:e});return n.ok?!0:(X.error(t({id:`NrFwux`,values:{0:qe(n.error)}})),!1)},e[0]=t,e[1]=i,e[2]=c):c=e[2];let l=c,u;return e[3]!==o||e[4]!==a||e[5]!==l?(u={contentRules:a,bindingReady:o,write:l},e[3]=o,e[4]=a,e[5]=l,e[6]=u):u=e[6],u}function li(e,t){return{[e]:{enabled:t}}}function ui(e){let t=(0,Z.c)(2),{id:n}=e;switch(n){case`markdownlint`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(o,{id:`Vftef5`}),t[0]=e):e=t[0],e}case`frontmatter`:{let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(o,{id:`78G7R3`}),t[1]=e):e=t[1],e}}}function di(){let e=(0,Z.c)(12),{_:t}=s(),{contentRules:n,bindingReady:r,write:i}=ci(),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`h3`,{id:`settings-plugins-title`,className:`text-base font-semibold`,children:(0,$.jsx)(o,{id:`ohUJJM`})}),e[0]=a):a=e[0];let c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[a,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`oXlLi4`})})]}),e[1]=c):c=e[1];let l;e[2]!==t||e[3]!==r||e[4]!==n||e[5]!==i?(l=fn.map(e=>{let a=n?.[e.id]?.enabled===!0;return(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsxs)(V,{htmlFor:`settings-plugin-toggle-${e.id}`,className:`inline-flex items-center gap-1.5 text-sm font-medium`,children:[e.label,e.id===`frontmatter`?(0,$.jsx)(Hn,{}):null]}),(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(ui,{id:e.id})})]}),(0,$.jsx)(K,{id:`settings-plugin-toggle-${e.id}`,checked:a,disabled:!r,onCheckedChange:t=>{i(li(e.id,t))&&t&&oi({pluginId:e.id,label:e.label})},"aria-label":t(a?{id:`y5UgU8`,values:{0:e.label}}:{id:`FZtBeR`,values:{0:e.label}}),"data-testid":`settings-plugin-toggle-${e.id}`})]},e.id)}),e[2]=t,e[3]=r,e[4]=n,e[5]=i,e[6]=l):l=e[6];let u;e[7]===l?u=e[8]:(u=(0,$.jsx)(`div`,{className:`divide-y rounded-md border`,"data-testid":`settings-plugins-list`,children:l}),e[7]=l,e[8]=u);let d;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`settings-plugins-audit-pointer`,children:(0,$.jsx)(o,{id:`9KooKn`})}),e[9]=d):d=e[9];let f;return e[10]===u?f=e[11]:(f=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-plugins-title`,className:`space-y-4`,"data-testid":`settings-plugins-manage`,children:[c,u,d]}),e[10]=u,e[11]=f),f}function fi(e){let t=(0,Z.c)(15),{userBinding:n}=e,{_:r}=s(),{userConfig:i}=an(),a=i?.appearance?.colorThemeEnabled!==!1,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(`h3`,{id:`settings-user-plugins-title`,className:`text-base font-semibold`,children:(0,$.jsx)(o,{id:`ohUJJM`})}),t[0]=c):c=t[0];let l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[c,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`k2fEi7`})})]}),t[1]=l):l=t[1];let u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(V,{htmlFor:`settings-plugin-toggle-theme`,className:`text-sm font-medium`,children:(0,$.jsx)(o,{id:`fJ3EbT`})}),t[2]=u):u=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[u,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`YRavYS`})})]}),t[3]=d):d=t[3];let f=n===null,p;t[4]!==r||t[5]!==n?(p=e=>{if(n){if(!n.patch({appearance:{colorThemeEnabled:e}}).ok){X.error(r({id:`C_Lyvh`}));return}e&&oi({pluginId:`theme`,label:r({id:`fJ3EbT`})})}},t[4]=r,t[5]=n,t[6]=p):p=t[6];let m;t[7]!==r||t[8]!==a?(m=r(a?{id:`cOJyVj`}:{id:`G_hVTP`}),t[7]=r,t[8]=a,t[9]=m):m=t[9];let h;return t[10]!==f||t[11]!==p||t[12]!==m||t[13]!==a?(h=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-user-plugins-title`,className:`space-y-4`,"data-testid":`settings-user-plugins-manage`,children:[l,(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-user-plugins-list`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[d,(0,$.jsx)(K,{id:`settings-plugin-toggle-theme`,checked:a,disabled:f,onCheckedChange:p,"aria-label":m,"data-testid":`settings-plugin-toggle-theme`})]})})]}),t[10]=f,t[11]=p,t[12]=m,t[13]=a,t[14]=h):h=t[14],h}function pi(e){let t=(0,Z.c)(22),{titleId:n,title:r,scope:i,beta:a,docUrl:c,children:l}=e,{_:u}=s(),d;t[0]!==r||t[1]!==n?(d=(0,$.jsx)(`h3`,{id:n,className:`text-base font-semibold`,children:r}),t[0]=r,t[1]=n,t[2]=d):d=t[2];let f;t[3]===a?f=t[4]:(f=a?(0,$.jsx)(Hn,{}):null,t[3]=a,t[4]=f);let p;t[5]===i?p=t[6]:(p=i?(0,$.jsx)(si,{scope:i}):null,t[5]=i,t[6]=p);let m;t[7]!==d||t[8]!==f||t[9]!==p?(m=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[d,f,p]}),t[7]=d,t[8]=f,t[9]=p,t[10]=m):m=t[10];let h;t[11]===l?h=t[12]:(h=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:l}),t[11]=l,t[12]=h);let g;t[13]!==u||t[14]!==c||t[15]!==r||t[16]!==n?(g=c===void 0?null:(0,$.jsxs)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>un(e,c),onAuxClick:e=>un(e,c),"aria-label":u({id:`Li4U-T`,values:{title:r}}),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)(o,{id:`zwWKhA`}),(0,$.jsx)(et,{"aria-hidden":!0,className:`size-3`})]}),t[13]=u,t[14]=c,t[15]=r,t[16]=n,t[17]=g):g=t[17];let _;return t[18]!==m||t[19]!==h||t[20]!==g?(_=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[m,h,g]}),t[18]=m,t[19]=h,t[20]=g,t[21]=_):_=t[21],_}function mi(e){return fn.find(t=>t.id===e)?.docUrl}function hi(e){let t=(0,Z.c)(6),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{initialRuleQuery:r}=n,i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=mi(`markdownlint`),t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(pi,{titleId:`settings-plugin-markdownlint-title`,title:`markdownlint`,scope:`project`,docUrl:i,children:(0,$.jsx)(o,{id:`WFEbV1`,components:{0:(0,$.jsx)(`a`,{href:`https://github.com/DavidAnson/markdownlint`,target:`_blank`,rel:`noopener noreferrer`,onClick:_i,onAuxClick:gi,className:`inline-flex items-center gap-0.5 text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`}),1:(0,$.jsx)(et,{"aria-hidden":!0,className:`size-3`})}})}),t[3]=a):a=t[3];let s;return t[4]===r?s=t[5]:(s=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-plugin-markdownlint-title`,className:`space-y-4`,"data-testid":`settings-plugin-markdownlint`,children:[a,(0,$.jsx)(Vn,{initialRuleQuery:r})]}),t[4]=r,t[5]=s),s}function gi(e){return un(e,`https://github.com/DavidAnson/markdownlint`)}function _i(e){return un(e,`https://github.com/DavidAnson/markdownlint`)}function vi(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function yi(e){let t=(0,Z.c)(20),{summary:n}=e;switch(n.kind){case`everything`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(o,{id:`0zAhu6`}),t[0]=e):e=t[0],e}case`folder-recursive`:{let e;return t[1]===n.folder?e=t[2]:(e=(0,$.jsx)(o,{id:`OZavHH`,values:{0:n.folder}}),t[1]=n.folder,t[2]=e),e}case`folder-direct`:{let e;return t[3]===n.folder?e=t[4]:(e=(0,$.jsx)(o,{id:`CWjM1r`,values:{0:n.folder}}),t[3]=n.folder,t[4]=e),e}case`exact`:{let e;return t[5]===n.target?e=t[6]:(e=(0,$.jsx)(o,{id:`c3ZGrq`,values:{0:n.target}}),t[5]=n.target,t[6]=e),e}case`name-anywhere`:{let e;return t[7]===n.name?e=t[8]:(e=(0,$.jsx)(o,{id:`QLgdT6`,values:{0:n.name}}),t[7]=n.name,t[8]=e),e}case`folder-anywhere`:{let e;return t[9]===n.folder?e=t[10]:(e=(0,$.jsx)(o,{id:`_yB-24`,values:{0:n.folder}}),t[9]=n.folder,t[10]=e),e}case`folder-recursive-nested`:{let e;return t[11]!==n.folder||t[12]!==n.root?(e=(0,$.jsx)(o,{id:`paCw0z`,values:{0:n.folder,1:n.root}}),t[11]=n.folder,t[12]=n.root,t[13]=e):e=t[13],e}case`matches-nothing`:{let e;return t[14]===n.pattern?e=t[15]:(e=(0,$.jsx)(o,{id:`J2_JuX`,values:{0:n.pattern}}),t[14]=n.pattern,t[15]=e),e}case`invalid`:{let e;return t[16]===n.pattern?e=t[17]:(e=(0,$.jsx)(o,{id:`5aahsI`,values:{0:n.pattern}}),t[16]=n.pattern,t[17]=e),e}case`pattern`:{let e;return t[18]===n.pattern?e=t[19]:(e=(0,$.jsx)(o,{id:`SiFgBx`,values:{0:n.pattern}}),t[18]=n.pattern,t[19]=e),e}}}function bi(e){let t=(0,Z.c)(4),{file:n,appliesTo:r}=e,i;if(t[0]!==r||t[1]!==n){let{includes:e,excludes:a}=Oe(r),s=xi,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(o,{id:`p98xmP`}),t[3]=c):c=t[3],i=(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`frontmatter-schema-applies-summary-${n}`,children:[c,` `,e.length===0?(0,$.jsx)(yi,{summary:{kind:`everything`}}):s(e),a.length>0?(0,$.jsxs)($.Fragment,{children:[` `,(0,$.jsx)(o,{id:`YGNRB5`}),` `,s(a)]}):null,`.`]}),t[0]=r,t[1]=n,t[2]=i}else i=t[2];return i}function xi(e){return e.map(Si)}function Si(e,t){return(0,$.jsxs)(`span`,{children:[t>0?`, `:null,(0,$.jsx)(yi,{summary:e})]},t)}function Ci(e){return e.enabled!==!1}function wi(e){let t=(0,Z.c)(49),{file:n,mapping:r,disabled:i,globProblems:a,onToggle:c,onAppliesToChange:l,onDelete:u}=e,{_:d}=s(),f;t[0]===r?f=t[1]:(f=r!==void 0&&Ci(r),t[0]=r,t[1]=f);let p=f,m;t[2]===n?m=t[3]:(m=()=>{Un(n),window.location.hash=Ut(n)},t[2]=n,t[3]=m);let h=m,g=`frontmatter-schema-row-${n}`,_;t[4]===n?_=t[5]:(_=(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-sm`,title:n,children:n}),t[4]=n,t[5]=_);let v;t[6]!==d||t[7]!==n?(v=d({id:`74C2zx`,values:{file:n}}),t[6]=d,t[7]=n,t[8]=v):v=t[8];let y=`frontmatter-schema-edit-${n}`,b,S;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(It,{"aria-hidden":!0,className:`size-3`}),S=(0,$.jsx)(o,{id:`ePK91l`}),t[9]=b,t[10]=S):(b=t[9],S=t[10]);let C;t[11]!==h||t[12]!==v||t[13]!==y?(C=(0,$.jsxs)(x,{variant:`outline`,size:`sm`,className:`h-6 shrink-0 gap-1 px-2 text-xs`,onClick:h,"aria-label":v,"data-testid":y,children:[b,S]}),t[11]=h,t[12]=v,t[13]=y,t[14]=C):C=t[14];let w;t[15]!==d||t[16]!==i||t[17]!==n||t[18]!==u?(w=u===null?null:(0,$.jsx)(x,{variant:`ghost`,size:`icon`,className:`h-5 w-5 shrink-0 text-muted-foreground opacity-60 hover:opacity-100`,disabled:i,"aria-label":d({id:`mHf8mp`,values:{file:n}}),onClick:u,"data-testid":`frontmatter-schema-delete-${n}`,children:(0,$.jsx)(Lt,{className:`size-3.5`})}),t[15]=d,t[16]=i,t[17]=n,t[18]=u,t[19]=w):w=t[19];let T;t[20]!==d||t[21]!==n||t[22]!==p?(T=d(p?{id:`mAzs2H`,values:{file:n}}:{id:`EO4Dt1`,values:{file:n}}),t[20]=d,t[21]=n,t[22]=p,t[23]=T):T=t[23];let E=`frontmatter-schema-toggle-${n}`,D;t[24]!==i||t[25]!==p||t[26]!==c||t[27]!==T||t[28]!==E?(D=(0,$.jsx)(K,{checked:p,disabled:i,"aria-label":T,onCheckedChange:c,"data-testid":E}),t[24]=i,t[25]=p,t[26]=c,t[27]=T,t[28]=E,t[29]=D):D=t[29];let O;t[30]!==w||t[31]!==D||t[32]!==C?(O=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[C,w,D]}),t[30]=w,t[31]=D,t[32]=C,t[33]=O):O=t[33];let k;t[34]!==O||t[35]!==_?(k=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[_,O]}),t[34]=O,t[35]=_,t[36]=k):k=t[36];let A;t[37]!==d||t[38]!==i||t[39]!==n||t[40]!==a||t[41]!==r?.appliesTo||t[42]!==p||t[43]!==l?(A=p?(0,$.jsxs)(`div`,{className:`mt-2 space-y-1 pl-1.5`,children:[(0,$.jsx)(V,{htmlFor:`frontmatter-schema-applies-${n}`,className:`text-xs`,children:(0,$.jsx)(o,{id:`5Y17qa`})}),(0,$.jsx)(Bn,{id:`frontmatter-schema-applies-${n}`,value:vi(r?.appliesTo),grammar:`free-text`,disabled:i,entryProblems:a,onChange:l,placeholder:d({id:`R_U_A4`}),"aria-label":d({id:`a45f2c`})}),(0,$.jsx)(bi,{file:n,appliesTo:r?.appliesTo})]}):null,t[37]=d,t[38]=i,t[39]=n,t[40]=a,t[41]=r?.appliesTo,t[42]=p,t[43]=l,t[44]=A):A=t[44];let j;return t[45]!==k||t[46]!==A||t[47]!==g?(j=(0,$.jsxs)(`div`,{className:`px-3 py-2`,"data-testid":g,children:[k,A]}),t[45]=k,t[46]=A,t[47]=g,t[48]=j):j=t[48],j}function Ti(){let e=(0,Z.c)(99),{_:t}=s(),{contentRules:n,bindingReady:r,write:i}=ci(),{data:a}=mn(),{schemas:c}=vn(),l;e[0]===n?.frontmatter?.schemas?l=e[1]:(l=n?.frontmatter?.schemas??[],e[0]=n?.frontmatter?.schemas,e[1]=l);let u=l,[h,_]=(0,Q.useState)(``),[v,y]=(0,Q.useState)(!1),[b,S]=(0,Q.useState)(``),[C,w]=(0,Q.useState)(null),[T,E]=(0,Q.useState)(!1),D,O,k,A,j,M,N,P;if(e[2]!==t||e[3]!==r||e[4]!==v||e[5]!==a?.configProblems||e[6]!==c||e[7]!==u||e[8]!==b||e[9]!==h||e[10]!==i){let n=new Set(u.map(ki)),s=(a?.configProblems??[]).filter(e=>e.startsWith(`frontmatter schema `)?[...n].some(t=>e.startsWith(`frontmatter schema ${t}:`)):e.startsWith(`invalid appliesTo glob`)||e.startsWith(`suspicious appliesTo glob`)||e.startsWith(`unmatched appliesTo glob`)?[...n].some(t=>e.endsWith(`(frontmatter mapping for ${t})`)):!1),l;e[19]===i?l=e[20]:(l=function(e){i({frontmatter:{schemas:e}})&&gn()},e[19]=i,e[20]=l);let g=l,C=[...new Set([...c,...u.map(Oi)])].sort(Di),T=h.trim().toLowerCase(),F=C.filter(e=>T===``||e.toLowerCase().includes(T)),I=ii(s),L;e[21]===u?L=e[22]:(L=e=>{let t=ri(e);if(t===null)return!0;let n=u.find(e=>e.file===t.file),r=n!==void 0&&Ci(n)&&vi(n.appliesTo).includes(t.pattern),i=u.some(e=>e.file===t.file&&vi(e.appliesTo).includes(t.pattern));return!r&&i},e[21]=u,e[22]=L);let R=s.filter(L),z;e[23]!==u||e[24]!==g?(z=function(e,t){if(!u.some(t=>t.file===e)){t&&g([...u,{file:e,enabled:!0}]);return}g(u.map(n=>n.file===e?{...n,enabled:t}:n))},e[23]=u,e[24]=g,e[25]=z):z=e[25];let B=z,H;e[26]!==u||e[27]!==g?(H=function(e,t){g(u.map(n=>{if(n.file!==e)return n;if(t.length===0){let{appliesTo:e,...t}=n;return t}return{...n,appliesTo:t}}))},e[26]=u,e[27]=g,e[28]=H):H=e[28];let ee=H,U;e[29]!==t||e[30]!==u||e[31]!==g?(U=async function(e){E(!0);let n=await hn(e);if(E(!1),!n.ok){X.error(n.errorDetail??t({id:`hgtsat`,values:{file:e}}));return}u.some(t=>t.file===e)&&g(u.filter(t=>t.file!==e)),w(null),X.success(t({id:`v_2_3v`,values:{file:e}}))},e[29]=t,e[30]=u,e[31]=g,e[32]=U):U=e[32],D=U;let te;e[33]!==t||e[34]!==u||e[35]!==b||e[36]!==g?(te=async function(){let e=b.trim();if(e===``||e.includes(`/`)||e.includes(`\\`))return;let n=`.ok/schemas/${e.endsWith(`.json`)?e:`${e}.schema.json`}`,r=await _n(n);if(!r.ok){X.error(r.errorDetail??t({id:`U88xbi`}));return}g([...u,{file:n,enabled:!0}]),y(!1),S(``)},e[33]=t,e[34]=u,e[35]=b,e[36]=g,e[37]=te):te=e[37];let ne=te;O=`settings-plugin-frontmatter-title`,k=`space-y-4`,A=`settings-plugin-frontmatter`;let re;e[38]===t?re=e[39]:(re=t({id:`PVggyD`}),e[38]=t,e[39]=re);let W,ie;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(W=mi(`frontmatter`),ie=(0,$.jsx)(o,{id:`V3iDh1`}),e[40]=W,e[41]=ie):(W=e[40],ie=e[41]),e[42]===re?j=e[43]:(j=(0,$.jsx)(pi,{titleId:`settings-plugin-frontmatter-title`,title:re,beta:!0,docUrl:W,children:ie}),e[42]=re,e[43]=j),M=R.length>0&&(0,$.jsxs)(`div`,{className:`space-y-1 rounded-md border border-amber-500/50 bg-amber-500/10 p-3 text-sm`,"data-testid":`frontmatter-config-problems`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:(0,$.jsx)(o,{id:`3BLniE`})}),(0,$.jsx)(`ul`,{className:`list-disc pl-5 text-muted-foreground`,children:R.map(Ei)})]});let G;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(G=e=>_(e.target.value),e[44]=G):G=e[44];let K;e[45]===t?K=e[46]:(K=t({id:`37P2BJ`}),e[45]=t,e[46]=K);let q;e[47]===t?q=e[48]:(q=t({id:`_NWEid`}),e[47]=t,e[48]=q);let ae;e[49]!==h||e[50]!==K||e[51]!==q?(ae=(0,$.jsx)(Vt,{value:h,onChange:G,placeholder:K,"aria-label":q,className:`h-8`,"data-testid":`frontmatter-schema-search`}),e[49]=h,e[50]=K,e[51]=q,e[52]=ae):ae=e[52];let J;e[53]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,$.jsx)(f,{asChild:!0,children:(0,$.jsxs)(x,{variant:`outline`,size:`sm`,className:`shrink-0`,"data-testid":`frontmatter-create-schema`,children:[(0,$.jsx)(m,{"aria-hidden":!0,className:`size-4`}),(0,$.jsx)(o,{id:`LQdLio`})]})}),e[53]=J):J=e[53];let oe;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(V,{htmlFor:`frontmatter-create-schema-name`,className:`text-xs`,children:(0,$.jsx)(o,{id:`PijLsG`})}),e[54]=oe):oe=e[54];let se;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(se=e=>S(e.target.value),e[55]=se):se=e[55];let Y;e[56]===ne?Y=e[57]:(Y=e=>{e.key===`Enter`&&ne()},e[56]=ne,e[57]=Y);let ce;e[58]!==b||e[59]!==Y?(ce=(0,$.jsx)(Vt,{id:`frontmatter-create-schema-name`,value:b,onChange:se,onKeyDown:Y,placeholder:`doc`,"data-testid":`frontmatter-create-schema-name`}),e[58]=b,e[59]=Y,e[60]=ce):ce=e[60];let le;e[61]!==r||e[62]!==b?(le=!r||b.trim()===``,e[61]=r,e[62]=b,e[63]=le):le=e[63];let ue;e[64]===ne?ue=e[65]:(ue=()=>void ne(),e[64]=ne,e[65]=ue);let de;e[66]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsx)(o,{id:`hYgDIe`}),e[66]=de):de=e[66];let fe;e[67]!==le||e[68]!==ue?(fe=(0,$.jsx)(x,{size:`sm`,disabled:le,onClick:ue,"data-testid":`frontmatter-create-schema-save`,children:de}),e[67]=le,e[68]=ue,e[69]=fe):fe=e[69];let pe;e[70]!==ce||e[71]!==fe?(pe=(0,$.jsxs)(p,{align:`end`,className:`w-72 space-y-2`,children:[oe,ce,fe]}),e[70]=ce,e[71]=fe,e[72]=pe):pe=e[72];let me;e[73]!==v||e[74]!==pe?(me=(0,$.jsxs)(d,{open:v,onOpenChange:y,children:[J,pe]}),e[73]=v,e[74]=pe,e[75]=me):me=e[75],e[76]!==ae||e[77]!==me?(N=(0,$.jsxs)(`div`,{className:`flex items-center gap-4`,children:[ae,me]}),e[76]=ae,e[77]=me,e[78]=N):N=e[78],P=F.length===0?(0,$.jsx)(`p`,{className:`rounded-md border border-dashed p-3 text-sm text-muted-foreground`,"data-testid":`frontmatter-schemas-empty`,children:C.length===0?(0,$.jsx)(o,{id:`cRm498`}):(0,$.jsx)(o,{id:`3HAPpl`})}):(0,$.jsx)(`div`,{className:`divide-y rounded-md border`,"data-testid":`frontmatter-schemas-list`,children:F.map(e=>(0,$.jsx)(wi,{file:e,mapping:u.find(t=>t.file===e),disabled:!r,globProblems:I.get(e),onToggle:t=>B(e,t),onAppliesToChange:t=>ee(e,t),onDelete:Ge(e)?()=>w(e):null},e))}),e[2]=t,e[3]=r,e[4]=v,e[5]=a?.configProblems,e[6]=c,e[7]=u,e[8]=b,e[9]=h,e[10]=i,e[11]=D,e[12]=O,e[13]=k,e[14]=A,e[15]=j,e[16]=M,e[17]=N,e[18]=P}else D=e[11],O=e[12],k=e[13],A=e[14],j=e[15],M=e[16],N=e[17],P=e[18];let I=C!==null,L;e[79]===T?L=e[80]:(L=e=>{!e&&!T&&w(null)},e[79]=T,e[80]=L);let R;e[81]!==t||e[82]!==D||e[83]!==C||e[84]!==T?(R=C===null?null:(0,$.jsx)(g,{itemName:t({id:`qribBG`,values:{deleteTarget:C}}),isSubmitting:T,onDelete:()=>void D(C),customDescription:t({id:`NzPihF`,values:{deleteTarget:C}})}),e[81]=t,e[82]=D,e[83]=C,e[84]=T,e[85]=R):R=e[85];let z;e[86]!==R||e[87]!==I||e[88]!==L?(z=(0,$.jsx)(F,{open:I,onOpenChange:L,children:R}),e[86]=R,e[87]=I,e[88]=L,e[89]=z):z=e[89];let B;return e[90]!==O||e[91]!==z||e[92]!==k||e[93]!==A||e[94]!==j||e[95]!==M||e[96]!==N||e[97]!==P?(B=(0,$.jsxs)(`section`,{"aria-labelledby":O,className:k,"data-testid":A,children:[j,M,N,P,z]}),e[90]=O,e[91]=z,e[92]=k,e[93]=A,e[94]=j,e[95]=M,e[96]=N,e[97]=P,e[98]=B):B=e[98],B}function Ei(e){return(0,$.jsx)(`li`,{children:e},e)}function Di(e,t){return e.localeCompare(t)}function Oi(e){return e.file}function ki(e){return e.file}var Ai={markdownlint:hi,frontmatter:Ti},ji=fn.map(e=>({...e,Section:Ai[e.id]})),Mi=e(t(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}var r=``,i=` `,a=`\\`,o=/^\s+$/,s=/(?:[^\\]|^)\\$/,c=/^\\!/,l=/^\\#/,u=/\r?\n/g,d=/^\.*\/|^\.+$/,f=`/`,p=`node-ignore`;typeof Symbol<`u`&&(p=Symbol.for(`node-ignore`));var m=p,h=(e,t,n)=>Object.defineProperty(e,t,{value:n}),g=/([0-z])-([0-z])/g,_=()=>!1,v=e=>e.replace(g,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:r),y=e=>{let{length:t}=e;return e.slice(0,t-t%2)},b=[[/^\uFEFF/,()=>r],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?i:r)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+i}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>a],[/\\\\/g,()=>a],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===a?`\\[${n}${y(r)}${i}`:i===`]`&&r.length%2==0?`[${v(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`]],x=Object.create(null),S=(e,t)=>{let n=x[e];return n||(n=b.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),x[e]=n),t?new RegExp(n,`i`):new RegExp(n)},C=e=>typeof e==`string`,w=e=>e&&C(e)&&!o.test(e)&&!s.test(e)&&e.indexOf(`#`)!==0,T=e=>e.split(u),E=class{constructor(e,t,n,r){this.origin=e,this.pattern=t,this.negative=n,this.regex=r}},D=(e,t)=>{let n=e,r=!1;e.indexOf(`!`)===0&&(r=!0,e=e.substr(1)),e=e.replace(c,`!`).replace(l,`#`);let i=S(e,t);return new E(n,e,r,i)},O=(e,t)=>{throw new t(e)},k=(e,t,n)=>C(e)?e?k.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),A=e=>d.test(e);k.isNotRelative=A,k.convert=e=>e;var j=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){h(this,m,!0),this._rules=[],this._ignoreCase=t,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[m]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(w(e)){let t=D(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(C(e)?T(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let n=!1,r=!1;return this._rules.forEach(i=>{let{negative:a}=i;r===a&&n!==r||a&&!n&&!r&&!t||i.regex.test(e)&&(n=!a,r=a)}),{ignored:n,unignored:r}}_test(e,t,n,r){let i=e&&k.convert(e);return k(i,e,this._allowRelativePaths?_:O),this._t(i,t,n,r)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(f),r.pop(),!r.length)return t[e]=this._testOne(e,n);let i=this._t(r.join(f)+f,t,n,r);return t[e]=i.ignored?i:this._testOne(e,n)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},M=e=>new j(e);if(M.isPathValid=e=>k(e&&k.convert(e),e,_),M.default=M,t.exports=M,typeof process<`u`&&({}.IGNORE_TEST_WIN32||process.platform===`win32`)){k.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;k.isNotRelative=t=>e.test(t)||A(t)}}))(),1),Ni=new Map;function Pi(e){let t=Ni.get(e);if(t)return Ni.delete(e),Ni.set(e,t),t;let n=(0,Mi.default)();if(n.add(e),Ni.set(e,n),Ni.size>256){let e=Ni.keys().next().value;e!==void 0&&Ni.delete(e)}return n}function Fi(e,t){let n=e.trim();if(n.length===0||n.startsWith(`#`))return 0;let r=Pi(n),i=0;for(let e of t)e.length!==0&&r.ignores(e)&&(i+=1);return i}var Ii={"trailing-backslash":`Trailing backslash — line continuation isn't supported.`,"unmatched-bracket":`Unmatched [ — character class is open.`,"lone-bang":`Lone ! — negation needs a pattern after it.`,"leading-whitespace":`Leading whitespace — the rule may not match as expected.`,"embedded-newline":`Embedded line break — the row spans multiple lines.`};function Li(e){let t=[];if(e.length===0||e.trimStart().startsWith(`#`))return t;/[\r\n]/.test(e)&&t.push({code:`embedded-newline`,message:Ii[`embedded-newline`]}),/^\s/.test(e)&&t.push({code:`leading-whitespace`,message:Ii[`leading-whitespace`]});let n=e.trim();return n===`!`&&t.push({code:`lone-bang`,message:Ii[`lone-bang`]}),n.endsWith(`\\`)&&t.push({code:`trailing-backslash`,message:Ii[`trailing-backslash`]}),Ri(n,`[`)>Ri(n,`]`)&&t.push({code:`unmatched-bracket`,message:Ii[`unmatched-bracket`]}),t}function Ri(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}var zi=`https://openknowledge.ai/docs/features/ignore-patterns`,Bi=1200,Vi=150,Hi=150,Ui=5e3,Wi=600,Gi=400,Ki=`okignore-show-advanced`;function qi(e){let t=(0,Z.c)(3),{binding:n,synced:r}=e;if(n===null||!r){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Ji,{}),t[0]=e):e=t[0],e}let i;return t[1]===n?i=t[2]:(i=(0,$.jsx)(Yi,{binding:n}),t[1]=n,t[2]=i),i}function Ji(){let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-okignore-title`,className:`space-y-3`,"data-testid":`settings-okignore-skeleton`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`h3`,{id:`settings-okignore-title`,className:`text-base font-semibold`,children:(0,$.jsx)(o,{id:`3zyg_A`})}),(0,$.jsx)(pn,{className:`h-4 w-72`})]}),(0,$.jsx)(pn,{className:`h-20 w-full`})]}),e[0]=t):t=e[0],t}function Yi(e){let t=(0,Z.c)(72),{binding:n}=e,{_:r}=s(),i;t[0]===n?i=t[1]:(i=()=>n.current(),t[0]=n,t[1]=i);let[a,c]=(0,Q.useState)(i),l,u;t[2]===n?(l=t[3],u=t[4]):(l=()=>n.subscribe(e=>{c(e)}),u=[n],t[2]=n,t[3]=l,t[4]=u),(0,Q.useEffect)(l,u);let{pages:d,pageMeta:f,assetPaths:p}=it(),m;t[5]!==p||t[6]!==f||t[7]!==d?(m=ga(d,f,p),t[5]=p,t[6]=f,t[7]=d,t[8]=m):m=t[8];let h=m,g,_;t[9]===a?(g=t[10],_=t[11]):(g=yt(a),_=vt(g),t[9]=a,t[10]=g,t[11]=_);let v=_,y=v.length===0,[b,x]=(0,Q.useState)(null),S=(0,Q.useRef)(null),C,w;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>()=>{S.current&&clearTimeout(S.current)},w=[],t[12]=C,t[13]=w):(C=t[12],w=t[13]),(0,Q.useEffect)(C,w);let T;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{x({key:e,ts:Date.now()}),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>x(null),Bi)},t[14]=T):T=t[14];let E=T,[D,O]=(0,Q.useState)(null),k=(0,Q.useRef)(null),A,j;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>()=>{k.current&&clearTimeout(k.current)},A=[],t[15]=A,t[16]=j):(A=t[15],j=t[16]),(0,Q.useEffect)(j,A);let M,N;t[17]===n?(M=t[18],N=t[19]):(M=()=>xt(e=>{e.docName===`__config__/okignore`&&n.notifyRejection(e.error)}),N=[n],t[17]=n,t[18]=M,t[19]=N),(0,Q.useEffect)(M,N);let P,F;t[20]===n?(P=t[21],F=t[22]):(P=()=>n.subscribeRejection(e=>{let{error:t}=e,n=fa(t);O({message:n?.detail??qe(t),lineNumber:n?.lineNumber,ts:Date.now()}),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>O(null),Ui)}),F=[n],t[20]=n,t[21]=P,t[22]=F),(0,Q.useEffect)(P,F);let I,L;t[23]===r?(I=t[24],L=t[25]):(I=()=>Et(e=>{let{path:t}=e;X.error(r({id:`3oh0nQ`,values:{path:t}}),{description:e.error,id:`okignore-nested-error:${e.path}`,duration:8e3})}),L=[r],t[23]=r,t[24]=I,t[25]=L),(0,Q.useEffect)(I,L);let R;t[26]===n?R=t[27]:(R=e=>{n.patch(e)},t[26]=n,t[27]=R);let z=R,B;t[28]!==z||t[29]!==g||t[30]!==v?(B=(e,t)=>{let n=t.trim(),r=v[e];if(r&&n!==r.text){if(n.length===0){z(bt(Dt(g,e)));return}z(bt(Ct(g,e,n))),E(da(n,e))}},t[28]=z,t[29]=g,t[30]=v,t[31]=B):B=t[31];let V=B,H;t[32]!==z||t[33]!==g?(H=e=>{z(bt(Dt(g,e)))},t[32]=z,t[33]=g,t[34]=H):H=t[34];let ee=H,U;t[35]!==z||t[36]!==g||t[37]!==v.length?(U=e=>{let t=e.trim();if(t.length===0)return;let n=Ot(g,t);if(n>=0){E(da(t,n));return}z(bt(_t(g,t))),E(da(t,v.length))},t[35]=z,t[36]=g,t[37]=v.length,t[38]=U):U=t[38];let te=U,ne;t[39]!==z||t[40]!==g?(ne=e=>{let t=String(e.active.id),n=e.over?String(e.over.id):null;if(!n||t===n)return;let r=ua(t),i=ua(n);r<0||i<0||r===i||z(bt(wt(g,r,i)))},t[39]=z,t[40]=g,t[41]=ne):ne=t[41];let re=ne,W;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(W={activationConstraint:{distance:4}},t[42]=W):W=t[42];let ie;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ie={coordinateGetter:Sn},t[43]=ie):ie=t[43];let G=En(xn(kn,W),xn(Cn,ie)),K=D===null?null:`rejection-${D.ts}`,[q,ae]=ya(),J;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,$.jsx)(`h3`,{id:`settings-okignore-title`,className:`text-base font-semibold`,children:(0,$.jsx)(o,{id:`3zyg_A`})}),t[44]=J):J=t[44];let oe;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[J,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`Z5h97D`,components:{0:(0,$.jsx)(`a`,{href:zi,target:`_blank`,rel:`noreferrer noopener`,className:`text-primary underline-offset-2 hover:underline`,"data-testid":`settings-okignore-primer`})}})})]}),t[45]=oe):oe=t[45];let se;t[46]===D?se=t[47]:(se=D===null?null:(0,$.jsx)(Qi,{rejection:D}),t[46]=D,t[47]=se);let Y;t[48]!==n||t[49]!==h||t[50]!==te||t[51]!==re||t[52]!==V||t[53]!==ee||t[54]!==y||t[55]!==v||t[56]!==K||t[57]!==b||t[58]!==G||t[59]!==q||t[60]!==a?(Y=q?(0,$.jsx)(Xi,{binding:n,text:a}):y?(0,$.jsx)($i,{onAdd:te,rejectionFlashKey:K,filePaths:h}):(0,$.jsx)(ea,{patterns:v,sensors:G,onDragEnd:re,onEdit:V,onRemove:ee,onAdd:te,savedFlash:b,rejectionFlashKey:K,filePaths:h}),t[48]=n,t[49]=h,t[50]=te,t[51]=re,t[52]=V,t[53]=ee,t[54]=y,t[55]=v,t[56]=K,t[57]=b,t[58]=G,t[59]=q,t[60]=a,t[61]=Y):Y=t[61];let ce;t[62]!==ae||t[63]!==q?(ce=()=>ae(!q),t[62]=ae,t[63]=q,t[64]=ce):ce=t[64];let le;t[65]!==q||t[66]!==ce?(le=(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(Zi,{enabled:q,onToggle:ce})}),t[65]=q,t[66]=ce,t[67]=le):le=t[67];let ue;return t[68]!==se||t[69]!==Y||t[70]!==le?(ue=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-okignore-title`,className:`space-y-3`,"data-testid":`settings-okignore-section`,children:[oe,se,Y,le]}),t[68]=se,t[69]=Y,t[70]=le,t[71]=ue):ue=t[71],ue}function Xi(e){let t=(0,Z.c)(31),{binding:n,text:r}=e,{_:i}=s(),[a,o]=(0,Q.useState)(r),c=(0,Q.useRef)(r),l=(0,Q.useRef)(!1),u=(0,Q.useRef)(r),d=(0,Q.useRef)(null),f,p;t[0]===r?(f=t[1],p=t[2]):(f=()=>{l.current||r!==c.current&&(o(r),u.current=r,c.current=r)},p=[r],t[0]=r,t[1]=f,t[2]=p),(0,Q.useEffect)(f,p);let m,h;t[3]===a?(m=t[4],h=t[5]):(m=()=>{u.current=a},h=[a],t[3]=a,t[4]=m,t[5]=h),(0,Q.useEffect)(m,h);let g,_;t[6]===n?(g=t[7],_=t[8]):(g=()=>()=>{d.current&&(clearTimeout(d.current),d.current=null,u.current!==c.current&&(n.patch(u.current),c.current=u.current))},_=[n],t[6]=n,t[7]=g,t[8]=_),(0,Q.useEffect)(g,_);let v;t[9]===n?v=t[10]:(v=e=>{d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{d.current=null,e!==c.current&&(c.current=e,n.patch(e))},Gi)},t[9]=n,t[10]=v);let y=v,b;t[11]===n?b=t[12]:(b=()=>{d.current&&=(clearTimeout(d.current),null),u.current!==c.current&&(c.current=u.current,n.patch(u.current))},t[11]=n,t[12]=b);let x=b,S;t[13]===y?S=t[14]:(S=e=>{o(e.target.value),y(e.target.value)},t[13]=y,t[14]=S);let C;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>{l.current=!0},t[15]=C):C=t[15];let w;t[16]===x?w=t[17]:(w=()=>{l.current=!1,x()},t[16]=x,t[17]=w);let T;t[18]===a?T=t[19]:(T=a.split(`
7
+ `),t[18]=a,t[19]=T);let E=Math.max(6,Math.min(20,T.length+1)),D;t[20]===i?D=t[21]:(D=i({id:`rssK8c`}),t[20]=i,t[21]=D);let O;t[22]===i?O=t[23]:(O=i({id:`AeHuzT`}),t[22]=i,t[23]=O);let k;return t[24]!==a||t[25]!==w||t[26]!==E||t[27]!==D||t[28]!==O||t[29]!==S?(k=(0,$.jsx)(`textarea`,{value:a,onChange:S,onFocus:C,onBlur:w,spellCheck:!1,rows:E,"aria-label":D,placeholder:O,className:`min-h-32 w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-xs outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,"data-testid":`settings-okignore-advanced-textarea`}),t[24]=a,t[25]=w,t[26]=E,t[27]=D,t[28]=O,t[29]=S,t[30]=k):k=t[30],k}function Zi(e){let t=(0,Z.c)(6),{enabled:n,onToggle:r}=e,i;t[0]===n?i=t[1]:(i=n?(0,$.jsx)(o,{id:`9PQysm`}):(0,$.jsx)(o,{id:`Nv3mUj`}),t[0]=n,t[1]=i);let a;return t[2]!==n||t[3]!==r||t[4]!==i?(a=(0,$.jsx)(x,{type:`button`,variant:`ghost`,size:`sm`,onClick:r,"aria-pressed":n,className:`h-7 px-2 text-xs text-muted-foreground hover:text-foreground`,"data-testid":`settings-okignore-show-advanced-toggle`,children:i}),t[2]=n,t[3]=r,t[4]=i,t[5]=a):a=t[5],a}function Qi(e){let t=(0,Z.c)(7),{rejection:n}=e,{_:r}=s(),{lineNumber:i,message:a}=n,o;t[0]!==r||t[1]!==i||t[2]!==a?(o=r(i===void 0?{id:`G7-rf8`,values:{message:a}}:{id:`P3NS4G`,values:{lineNumber:i,message:a}}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):o=t[3];let c=o,l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(Rt,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0`}),t[4]=l):l=t[4];let u;return t[5]===c?u=t[6]:(u=(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":`settings-okignore-rejection-banner`,className:`flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive animate-in fade-in`,children:[l,(0,$.jsx)(`span`,{children:c})]}),t[5]=c,t[6]=u),u}function $i(e){let t=(0,Z.c)(8),{onAdd:n,rejectionFlashKey:r,filePaths:i}=e,{_:a}=s(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`makN88`})}),t[0]=c):c=t[0];let l;t[1]===a?l=t[2]:(l=a({id:`Gx0VS1`}),t[1]=a,t[2]=l);let u;return t[3]!==i||t[4]!==n||t[5]!==r||t[6]!==l?(u=(0,$.jsxs)(`div`,{className:`space-y-3 rounded-md border border-dashed p-4`,"data-testid":`settings-okignore-empty`,children:[c,(0,$.jsx)(ia,{onAdd:n,placeholder:l,rejectionFlashKey:r,filePaths:i})]}),t[3]=i,t[4]=n,t[5]=r,t[6]=l,t[7]=u):u=t[7],u}function ea(e){let t=(0,Z.c)(35),{patterns:n,sensors:r,onDragEnd:i,onEdit:a,onRemove:o,onAdd:c,savedFlash:l,rejectionFlashKey:u,filePaths:d}=e,{_:f}=s(),p;t[0]===n?p=t[1]:(p=n.map(ta),t[0]=n,t[1]=p);let m=p,h;t[2]===f?h=t[3]:(h=f({id:`3zyg_A`}),t[2]=f,t[3]=h);let g;if(t[4]!==d||t[5]!==a||t[6]!==o||t[7]!==n||t[8]!==l){let e;t[10]!==d||t[11]!==a||t[12]!==o||t[13]!==l?(e=(e,t)=>{let n=da(e.text,t),r=l!==null&&l.key===n;return(0,$.jsx)(na,{sortableId:la(t),patternIndex:t,pattern:e,onEdit:a,onRemove:o,flashActive:r,filePaths:d},la(t))},t[10]=d,t[11]=a,t[12]=o,t[13]=l,t[14]=e):e=t[14],g=n.map(e),t[4]=d,t[5]=a,t[6]=o,t[7]=n,t[8]=l,t[9]=g}else g=t[9];let _;t[15]!==h||t[16]!==g?(_=(0,$.jsx)(`ul`,{"aria-label":h,className:`divide-y rounded-md border`,"data-testid":`settings-okignore-list`,children:g}),t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]!==m||t[19]!==_?(v=(0,$.jsx)(On,{items:m,strategy:Tn,children:_}),t[18]=m,t[19]=_,t[20]=v):v=t[20];let y;t[21]!==i||t[22]!==r||t[23]!==v?(y=(0,$.jsx)(Dn,{sensors:r,collisionDetection:bn,onDragEnd:i,children:v}),t[21]=i,t[22]=r,t[23]=v,t[24]=y):y=t[24];let b;t[25]===f?b=t[26]:(b=f({id:`cZGNlb`}),t[25]=f,t[26]=b);let x;t[27]!==d||t[28]!==c||t[29]!==u||t[30]!==b?(x=(0,$.jsx)(ia,{onAdd:c,placeholder:b,rejectionFlashKey:u,filePaths:d}),t[27]=d,t[28]=c,t[29]=u,t[30]=b,t[31]=x):x=t[31];let S;return t[32]!==y||t[33]!==x?(S=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[y,x]}),t[32]=y,t[33]=x,t[34]=S):S=t[34],S}function ta(e,t){return la(t)}function na(e){let t=(0,Z.c)(47),{sortableId:n,patternIndex:r,pattern:i,onEdit:a,onRemove:o,flashActive:c,filePaths:l}=e,{_:u}=s(),d;t[0]===n?d=t[1]:(d={id:n},t[0]=n,t[1]=d);let{attributes:f,listeners:p,setNodeRef:m,transform:h,transition:g,isDragging:_}=yn(d),v=i.text,y;t[2]===h?y=t[3]:(y=wn.Transform.toString(h),t[2]=h,t[3]=y);let b=_?.5:void 0,S=_?1:void 0,C;t[4]!==y||t[5]!==b||t[6]!==S||t[7]!==g?(C={transform:y,transition:g,opacity:b,zIndex:S},t[4]=y,t[5]=b,t[6]=S,t[7]=g,t[8]=C):C=t[8];let w=C,T;t[9]!==u||t[10]!==v?(T=u({id:`7_bFEL`,values:{patternText:v}}),t[9]=u,t[10]=v,t[11]=T):T=t[11];let E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(jt,{className:`size-3.5`}),t[12]=E):E=t[12];let D;t[13]!==f||t[14]!==p||t[15]!==T?(D=(0,$.jsx)(x,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-testid":`settings-okignore-drag-handle`,"aria-label":T,...f,...p,className:`h-7 w-4 shrink-0 cursor-grab touch-none px-0 text-muted-foreground/40 hover:text-foreground focus-visible:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring active:cursor-grabbing`,children:E}),t[13]=f,t[14]=p,t[15]=T,t[16]=D):D=t[16];let O;t[17]!==a||t[18]!==r?(O=e=>a(r,e),t[17]=a,t[18]=r,t[19]=O):O=t[19];let k;t[20]!==l||t[21]!==i.text||t[22]!==r||t[23]!==O?(k=(0,$.jsx)(ra,{patternIndex:r,initialText:i.text,onCommit:O,filePaths:l}),t[20]=l,t[21]=i.text,t[22]=r,t[23]=O,t[24]=k):k=t[24];let A;t[25]===c?A=t[26]:(A=(0,$.jsx)(ca,{visible:c}),t[25]=c,t[26]=A);let j;t[27]!==u||t[28]!==v?(j=u({id:`S9Vnum`,values:{patternText:v}}),t[27]=u,t[28]=v,t[29]=j):j=t[29];let M;t[30]!==o||t[31]!==r?(M=()=>o(r),t[30]=o,t[31]=r,t[32]=M):M=t[32];let N;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(zt,{className:`size-3.5`}),t[33]=N):N=t[33];let P;t[34]!==j||t[35]!==M?(P=(0,$.jsx)(x,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-testid":`settings-okignore-remove`,"aria-label":j,onClick:M,className:`h-7 w-7 shrink-0 text-muted-foreground hover:text-destructive`,children:N}),t[34]=j,t[35]=M,t[36]=P):P=t[36];let F;t[37]!==k||t[38]!==A||t[39]!==P||t[40]!==D?(F=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[D,k,A,P]}),t[37]=k,t[38]=A,t[39]=P,t[40]=D,t[41]=F):F=t[41];let I;return t[42]!==r||t[43]!==m||t[44]!==w||t[45]!==F?(I=(0,$.jsx)(`li`,{ref:m,style:w,className:`flex flex-col gap-0.5 px-2 py-1.5`,"data-testid":`settings-okignore-row`,"data-pattern-index":r,children:F}),t[42]=r,t[43]=m,t[44]=w,t[45]=F,t[46]=I):I=t[46],I}function ra(e){let t=(0,Z.c)(31),{patternIndex:n,initialText:r,onCommit:i,filePaths:a}=e,{_:o}=s(),[c,l]=(0,Q.useState)(r),u=(0,Q.useRef)(r),d=(0,Q.useRef)(!1),f,p;t[0]===r?(f=t[1],p=t[2]):(f=()=>{d.current||r!==u.current&&(l(r),u.current=r)},p=[r],t[0]=r,t[1]=f,t[2]=p),(0,Q.useEffect)(f,p);let m=pa(c),g=ma(c,a),_=n+1,v;t[3]!==c||t[4]!==i?(v=()=>{c!==u.current&&(u.current=c,i(c))},t[3]=c,t[4]=i,t[5]=v):v=t[5];let y=v,b,x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>l(e.target.value),x=()=>{d.current=!0},t[6]=b,t[7]=x):(b=t[6],x=t[7]);let S;t[8]===y?S=t[9]:(S=()=>{d.current=!1,y()},t[8]=y,t[9]=S);let C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>{e.key===`Enter`?(e.preventDefault(),e.currentTarget.blur()):e.key===`Escape`&&(e.preventDefault(),l(u.current),e.currentTarget.blur())},t[10]=C):C=t[10];let w;t[11]!==o||t[12]!==_?(w=o({id:`-YV1Uo`,values:{patternNumber:_}}),t[11]=o,t[12]=_,t[13]=w):w=t[13];let T=m.length>0?`border-amber-500/60 focus-visible:ring-amber-500/40`:``,E;t[14]===T?E=t[15]:(E=h(`h-7 flex-1 font-mono text-xs`,T),t[14]=T,t[15]=E);let D;t[16]!==c||t[17]!==E||t[18]!==S||t[19]!==w?(D=(0,$.jsx)(Vt,{value:c,onChange:b,onFocus:x,onBlur:S,onKeyDown:C,"aria-label":w,className:E,"data-testid":`settings-okignore-row-input`}),t[16]=c,t[17]=E,t[18]=S,t[19]=w,t[20]=D):D=t[20];let O;t[21]===m?O=t[22]:(O=(0,$.jsx)(aa,{warnings:m}),t[21]=m,t[22]=O);let k;t[23]!==D||t[24]!==O?(k=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[D,O]}),t[23]=D,t[24]=O,t[25]=k):k=t[25];let A;t[26]===g?A=t[27]:(A=(0,$.jsx)(ha,{count:g}),t[26]=g,t[27]=A);let j;return t[28]!==k||t[29]!==A?(j=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[k,A]}),t[28]=k,t[29]=A,t[30]=j):j=t[30],j}function ia(e){let t=(0,Z.c)(34),{onAdd:n,placeholder:r,rejectionFlashKey:i,filePaths:a}=e,{_:c}=s(),[l,u]=(0,Q.useState)(``),d=pa(l),f=ma(l,a),p=xa(i),m;t[0]!==n||t[1]!==l?(m=()=>{let e=l.trim();e.length!==0&&(n(e),u(``))},t[0]=n,t[1]=l,t[2]=m):m=t[2];let g=m,_;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>u(e.target.value),t[3]=_):_=t[3];let v;t[4]===g?v=t[5]:(v=e=>{e.key===`Enter`&&(e.preventDefault(),g())},t[4]=g,t[5]=v);let y;t[6]===c?y=t[7]:(y=c({id:`p9sdCy`}),t[6]=c,t[7]=y);let b=p?`border-destructive ring-2 ring-destructive/30 focus-visible:ring-destructive/50`:d.length>0?`border-amber-500/60 focus-visible:ring-amber-500/40`:``,S;t[8]===b?S=t[9]:(S=h(`h-8 text-sm`,b),t[8]=b,t[9]=S);let C=p?`true`:void 0,w;t[10]!==l||t[11]!==r||t[12]!==v||t[13]!==y||t[14]!==S||t[15]!==C?(w=(0,$.jsx)(Vt,{value:l,onChange:_,onKeyDown:v,placeholder:r,"aria-label":y,className:S,"data-testid":`settings-okignore-add-input`,"data-rejection-flashing":C}),t[10]=l,t[11]=r,t[12]=v,t[13]=y,t[14]=S,t[15]=C,t[16]=w):w=t[16];let T;t[17]===d?T=t[18]:(T=(0,$.jsx)(aa,{warnings:d}),t[17]=d,t[18]=T);let E;t[19]===l?E=t[20]:(E=l.trim(),t[19]=l,t[20]=E);let D=E.length===0,O;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(o,{id:`BY-g4_`}),t[21]=O):O=t[21];let k;t[22]!==g||t[23]!==D?(k=(0,$.jsx)(x,{size:`sm`,onClick:g,disabled:D,"data-testid":`settings-okignore-add-button`,children:O}),t[22]=g,t[23]=D,t[24]=k):k=t[24];let A;t[25]!==k||t[26]!==w||t[27]!==T?(A=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[w,T,k]}),t[25]=k,t[26]=w,t[27]=T,t[28]=A):A=t[28];let j;t[29]===f?j=t[30]:(j=(0,$.jsx)(ha,{count:f}),t[29]=f,t[30]=j);let M;return t[31]!==A||t[32]!==j?(M=(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,"data-testid":`settings-okignore-add`,children:[A,j]}),t[31]=A,t[32]=j,t[33]=M):M=t[33],M}function aa(e){let t=(0,Z.c)(31),{warnings:n}=e,{_:r}=s();if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`flex w-4 shrink-0 justify-center`,"data-testid":`settings-okignore-warning-indicator`,"data-warnings":`0`}),t[0]=e):e=t[0],e}let i,a,o,c,l,u,d;t[1]!==r||t[2]!==n?(o=n.map(sa).join(` `),a=w,i=S,d=!0,c=`status`,l=`polite`,u=r({id:`NORKZU`,values:{summary:o}}),t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=c,t[7]=l,t[8]=u,t[9]=d):(i=t[3],a=t[4],o=t[5],c=t[6],l=t[7],u=t[8],d=t[9]);let f=String(n.length),p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(Rt,{"aria-hidden":`true`,className:`size-3.5`}),t[10]=p):p=t[10];let m;t[11]===o?m=t[12]:(m=(0,$.jsx)(`span`,{className:`sr-only`,children:o}),t[11]=o,t[12]=m);let h;t[13]!==c||t[14]!==l||t[15]!==u||t[16]!==f||t[17]!==m?(h=(0,$.jsxs)(`span`,{role:c,"aria-live":l,"aria-label":u,className:`flex w-4 shrink-0 cursor-help justify-center text-amber-500`,"data-testid":`settings-okignore-warning-indicator`,"data-warnings":f,children:[p,m]}),t[13]=c,t[14]=l,t[15]=u,t[16]=f,t[17]=m,t[18]=h):h=t[18];let g;t[19]!==i||t[20]!==d||t[21]!==h?(g=(0,$.jsx)(i,{asChild:d,children:h}),t[19]=i,t[20]=d,t[21]=h,t[22]=g):g=t[22];let _;t[23]===n?_=t[24]:(_=n.map(oa),t[23]=n,t[24]=_);let v;t[25]===_?v=t[26]:(v=(0,$.jsx)(C,{side:`top`,className:`max-w-xs`,children:(0,$.jsx)(`ul`,{className:`list-disc space-y-1 pl-4`,children:_})}),t[25]=_,t[26]=v);let y;return t[27]!==a||t[28]!==v||t[29]!==g?(y=(0,$.jsxs)(a,{children:[g,v]}),t[27]=a,t[28]=v,t[29]=g,t[30]=y):y=t[30],y}function oa(e){return(0,$.jsx)(`li`,{children:e.message},e.code)}function sa(e){return e.message}function ca(e){let t=(0,Z.c)(4),{visible:n}=e,r;t[0]===n?r=t[1]:(r=n?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(nt,{"aria-hidden":`true`,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(o,{id:`idD8Ev`})})]}):null,t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`flex w-4 shrink-0 justify-center text-emerald-600`,"data-testid":`settings-okignore-saved-indicator`,children:r}),t[2]=r,t[3]=i),i}function la(e){return`okignore-pattern-${e}`}function ua(e){let t=e.match(/^okignore-pattern-(\d+)$/);if(!t)return-1;let n=Number.parseInt(t[1]??``,10);return Number.isNaN(n)?-1:n}function da(e,t){return`${t}::${e}`}function fa(e){return!ke(e)||e.code!==`OKIGNORE_INVALID`?null:{detail:e.detail,lineNumber:e.lineNumber}}function pa(e){let t=(0,Z.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.length===0?[]:Li(e),t[0]=e,t[1]=n);let[r,i]=(0,Q.useState)(n),a,o;return t[2]===e?(a=t[3],o=t[4]):(a=()=>{if(e.length===0){i([]);return}let t=setTimeout(()=>{i(Li(e))},Vi);return()=>clearTimeout(t)},o=[e],t[2]=e,t[3]=a,t[4]=o),(0,Q.useEffect)(a,o),r}function ma(e,t){let n=(0,Z.c)(9),r;n[0]===e?r=n[1]:(r=e.trim(),n[0]=e,n[1]=r);let i=r,a;n[2]!==t||n[3]!==i?(a=()=>i.length===0?null:Fi(i,t),n[2]=t,n[3]=i,n[4]=a):a=n[4];let[o,s]=(0,Q.useState)(a),c,l;return n[5]!==t||n[6]!==i?(c=()=>{if(i.length===0){s(null);return}let e=setTimeout(()=>{s(Fi(i,t))},Hi);return()=>clearTimeout(e)},l=[i,t],n[5]=t,n[6]=i,n[7]=c,n[8]=l):(c=n[7],l=n[8]),(0,Q.useEffect)(c,l),o}function ha(e){let t=(0,Z.c)(12),{count:n}=e;if(n===null){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`block h-3.5`,"data-testid":`settings-okignore-preview`,"data-preview-state":`hidden`}),t[0]=e):e=t[0],e}let r=n===0,i=String(n),a=r?`text-muted-foreground/70`:`text-muted-foreground`,s;t[1]===a?s=t[2]:(s=h(`block text-xs`,a),t[1]=a,t[2]=s);let c;t[3]===n?c=t[4]:(c=(0,$.jsx)(o,{id:`-3Qbv7`,values:{count:n}}),t[3]=n,t[4]=c);let l;t[5]===r?l=t[6]:(l=r?(0,$.jsx)(`span`,{className:`ml-1 text-muted-foreground/60`,children:(0,$.jsx)(o,{id:`5kWklo`})}):null,t[5]=r,t[6]=l);let u;return t[7]!==i||t[8]!==s||t[9]!==c||t[10]!==l?(u=(0,$.jsxs)(`span`,{role:`status`,"aria-live":`polite`,"data-testid":`settings-okignore-preview`,"data-preview-state":`visible`,"data-preview-count":i,className:s,children:[c,l]}),t[7]=i,t[8]=s,t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function ga(e,t,n){let r=[];for(let n of e){let e=t.get(n)?.docExt??`.md`;r.push(n+e)}for(let e of n)r.push(e);return r}function _a(){try{return globalThis.localStorage?.getItem(Ki)===`true`}catch{return!1}}function va(e){try{globalThis.localStorage?.setItem(Ki,e?`true`:`false`)}catch(e){console.debug(`[OkignoreSection] localStorage unavailable; advanced toggle will not persist:`,e)}}function ya(){let e=(0,Z.c)(3),[t,n]=(0,Q.useState)(ba),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=e=>{n(e),va(e)},e[0]=r):r=e[0];let i=r,a;return e[1]===t?a=e[2]:(a=[t,i],e[1]=t,e[2]=a),a}function ba(){return _a()}function xa(e){let t=(0,Z.c)(3),[n,r]=(0,Q.useState)(!1),i,a;return t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(e===null)return;r(!0);let t=setTimeout(()=>r(!1),Wi);return()=>clearTimeout(t)},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,Q.useEffect)(i,a),n}function Sa(e){return`editor:${e}`}var Ca=`skill`;function wa(e){let t=(0,Z.c)(11),{testId:n,children:r}=e,{_:i}=s(),a;t[0]===i?a=t[1]:(a=i({id:`2B6eYX`}),t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(Mt,{className:`size-3.5`}),t[2]=o):o=t[2];let c;t[3]!==a||t[4]!==n?(c=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(x,{variant:`ghost`,size:`icon`,className:`mt-1.5 mr-1.5 h-6 w-6 shrink-0 text-muted-foreground opacity-60 hover:opacity-100`,"aria-label":a,"data-testid":n,children:o})}),t[3]=a,t[4]=n,t[5]=c):c=t[5];let l;t[6]===r?l=t[7]:(l=(0,$.jsx)(C,{side:`left`,className:`max-w-sm text-left`,children:(0,$.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:r})}),t[6]=r,t[7]=l);let u;return t[8]!==c||t[9]!==l?(u=(0,$.jsxs)(w,{children:[c,l]}),t[8]=c,t[9]=l,t[10]=u):u=t[10],u}function Ta(e){let t=(0,Z.c)(5),{followUp:n,testId:r}=e;if(n===`none`)return null;let i;t[0]===n?i=t[1]:(i=n===`approve-once`?(0,$.jsx)(o,{id:`HTW0Zw`,components:{0:(0,$.jsx)(`code`,{className:`inline-code`})}}):n===`enable-manually`?(0,$.jsx)(o,{id:`NNJsn7`}):(0,$.jsx)(o,{id:`n8DwqQ`}),t[0]=n,t[1]=i);let a;return t[2]!==i||t[3]!==r?(a=(0,$.jsx)(`span`,{role:`status`,className:`text-xs text-amber-600 dark:text-amber-400`,"data-testid":r,children:i}),t[2]=i,t[3]=r,t[4]=a):a=t[4],a}function Ea(){let e=(0,Z.c)(29),{_:t}=s(),n=typeof window<`u`?window.okDesktop??null:null,[r,i]=(0,Q.useState)(null),[a,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(null),d,f;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{if(!n)return;let e=!1;return n.projectIntegrations.status().then(t=>{e||i(t)}).catch(()=>{e||c(!0)}),()=>{e=!0}},f=[n],e[0]=d,e[1]=f):(d=e[0],f=e[1]),(0,Q.useEffect)(d,f);let p;e[2]===t?p=e[3]:(p=async function(e,r){if(n){u(e.kind===`editor`?Sa(e.id):Ca);try{let t=await n.projectIntegrations.setComponent({component:e,enabled:r});i(t.status),t.ok||X.error(t.error)}catch(e){let n=e;X.error(t({id:`gfdqcY`,values:{0:n instanceof Error?n.message:String(n)}}))}u(null)}},e[2]=t,e[3]=p);let m=p,h;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(`h3`,{id:`settings-project-ai-tools-title`,className:`text-base font-semibold`,children:(0,$.jsx)(o,{id:`crqzW5`})}),e[4]=h):h=e[4];let g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[h,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`ZYtq3m`})})]}),e[5]=g):g=e[5];let _=g;if(!n||a){let t;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-project-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`project-ai-tools-unavailable`,children:(0,$.jsx)(o,{id:`g4WlQK`})})]}),e[6]=t):t=e[6],t}if(r===null){let t;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-project-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsxs)(`div`,{className:`space-y-2`,"data-testid":`project-ai-tools-loading`,children:[(0,$.jsx)(pn,{className:`h-10 w-full`}),(0,$.jsx)(pn,{className:`h-10 w-full`})]})]}),e[7]=t):t=e[7],t}if(!r.hasProject){let t;return e[8]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-project-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`project-ai-tools-no-project`,children:(0,$.jsx)(o,{id:`yaPGPa`})})]}),e[8]=t):t=e[8],t}let v=l!==null||!r.available,y;e[9]===r.available?y=e[10]:(y=!r.available&&(0,$.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,"data-testid":`project-ai-tools-read-only`,children:(0,$.jsx)(o,{id:`_NX6gG`})}),e[9]=r.available,e[10]=y);let b;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(o,{id:`psfGPX`})}),e[11]=b):b=e[11];let x;if(e[12]!==m||e[13]!==v||e[14]!==r.editors){let t;e[16]!==m||e[17]!==v?(t=e=>(0,$.jsx)(Oa,{editor:e,busy:v,onToggle:t=>void m({kind:`editor`,id:e.id},t)},e.id),e[16]=m,e[17]=v,e[18]=t):t=e[18],x=r.editors.map(t),e[12]=m,e[13]=v,e[14]=r.editors,e[15]=x}else x=e[15];let S;e[19]===x?S=e[20]:(S=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[b,(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:x})]}),e[19]=x,e[20]=S);let C;e[21]!==m||e[22]!==v||e[23]!==r.skill?(C=r.skill!==null&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(o,{id:`LtiJ5c`})}),(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 overflow-hidden`,children:(0,$.jsxs)(`li`,{className:`flex items-start hover:bg-accent`,children:[(0,$.jsxs)(V,{htmlFor:`project-ai-tools-skill`,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(I,{id:`project-ai-tools-skill`,checked:r.skill.installed,disabled:v,onCheckedChange:()=>void m({kind:`skill`},!r.skill?.installed),className:`mt-0.5`,"data-testid":`project-ai-tools-skill-checkbox`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(`code`,{children:`open-knowledge`})}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(o,{id:`khCa4M`})})]})]}),(0,$.jsxs)(wa,{testId:`project-ai-tools-skill-info`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(o,{id:`HSh8u_`})}),r.skill.paths.map(Da)]})]})})]}),e[21]=m,e[22]=v,e[23]=r.skill,e[24]=C):C=e[24];let w;return e[25]!==y||e[26]!==S||e[27]!==C?(w=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-project-ai-tools-title`,className:`space-y-4`,children:[_,y,S,C]}),e[25]=y,e[26]=S,e[27]=C,e[28]=w):w=e[28],w}function Da(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}function Oa(e){let t=(0,Z.c)(45),{editor:n,busy:r,onToggle:i}=e,{_:a}=s(),c=n.state===`installed`||n.state===`foreign`,l=r||n.state===`unmanageable`,u;t[0]!==a||t[1]!==n.state?(u=n.state===`installed`?a({id:`eQkgKV`}):n.state===`foreign`?a({id:`AczYxH`}):n.state===`unmanageable`?a({id:`CXTwen`}):null,t[0]=a,t[1]=n.state,t[2]=u):u=t[2];let d=u,f=n.state===`foreign`||n.state===`unmanageable`?`text-xs text-amber-600 dark:text-amber-400`:`text-xs text-muted-foreground`,p=l?`flex items-start`:`flex items-start hover:bg-accent`,m=`project-ai-tools-editor-${n.id}`,h=l?`flex flex-1 items-start gap-2.5 px-3 py-2.5 font-normal`:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,g=`project-ai-tools-editor-${n.id}`,_;t[3]!==c||t[4]!==i?(_=()=>i(!c),t[3]=c,t[4]=i,t[5]=_):_=t[5];let v=`project-ai-tools-editor-checkbox-${n.id}`,y;t[6]!==c||t[7]!==l||t[8]!==g||t[9]!==_||t[10]!==v?(y=(0,$.jsx)(I,{id:g,checked:c,disabled:l,onCheckedChange:_,className:`mt-0.5`,"data-testid":v}),t[6]=c,t[7]=l,t[8]=g,t[9]=_,t[10]=v,t[11]=y):y=t[11];let b;t[12]===n.label?b=t[13]:(b=(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:n.label}),t[12]=n.label,t[13]=b);let x;t[14]!==n.id||t[15]!==f||t[16]!==d?(x=d!==null&&(0,$.jsx)(`span`,{className:f,"data-testid":`project-ai-tools-editor-status-${n.id}`,children:d}),t[14]=n.id,t[15]=f,t[16]=d,t[17]=x):x=t[17];let S;t[18]!==c||t[19]!==n.followUp||t[20]!==n.id?(S=c&&(0,$.jsx)(Ta,{followUp:n.followUp,testId:`project-ai-tools-editor-followup-${n.id}`}),t[18]=c,t[19]=n.followUp,t[20]=n.id,t[21]=S):S=t[21];let C;t[22]!==x||t[23]!==S||t[24]!==b?(C=(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[b,x,S]}),t[22]=x,t[23]=S,t[24]=b,t[25]=C):C=t[25];let w;t[26]!==C||t[27]!==m||t[28]!==h||t[29]!==y?(w=(0,$.jsxs)(V,{htmlFor:m,className:h,children:[y,C]}),t[26]=C,t[27]=m,t[28]=h,t[29]=y,t[30]=w):w=t[30];let T=`project-ai-tools-editor-info-${n.id}`,E;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(o,{id:`J2eKUI`})}),t[31]=E):E=t[31];let D;t[32]===n.configPath?D=t[33]:(D=(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:n.configPath})}),t[32]=n.configPath,t[33]=D);let O;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(`p`,{className:`pt-1 opacity-70`,children:(0,$.jsx)(o,{id:`VIwCaD`})}),t[34]=O):O=t[34];let k;t[35]===n.entryLocator?k=t[36]:(k=(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:n.entryLocator})}),t[35]=n.entryLocator,t[36]=k);let A;t[37]!==T||t[38]!==D||t[39]!==k?(A=(0,$.jsxs)(wa,{testId:T,children:[E,D,O,k]}),t[37]=T,t[38]=D,t[39]=k,t[40]=A):A=t[40];let j;return t[41]!==w||t[42]!==A||t[43]!==p?(j=(0,$.jsxs)(`li`,{className:p,children:[w,A]}),t[41]=w,t[42]=A,t[43]=p,t[44]=j):j=t[44],j}function ka(e){let t=(0,Z.c)(68),{config:n}=e,{state:r,refresh:i}=lt(``),[a,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(!1),u=Gt(),d;t[0]===u?d=t[1]:(d=function(e,t){An(Zt(e,t)),u.close()},t[0]=u,t[1]=d);let f=d,p,m,h,g,_,v,y,b,x;if(t[2]!==n||t[3]!==c||t[4]!==f||t[5]!==i||t[6]!==r){x=Symbol.for(`react.early_return_sentinel`);bb0:{let e=r.status===`ready`?(r.data.folder.templates_available??[]).filter(e=>e.scope===n.scope).sort(ja):[];if(r.status===`error`){let{loadErrorTitle:e}=n,{message:a}=r,s=`settings-${n.testIdPrefix}-section`,u;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>l(!0),t[16]=u):u=t[16];let d;t[17]===n?d=t[18]:(d=(0,$.jsx)(Ma,{config:n,onNewClick:u}),t[17]=n,t[18]=d);let p;t[19]!==e||t[20]!==a?(p=(0,$.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:(0,$.jsx)(o,{id:`uH_S-u`,values:{loadErrorTitle:e,message:a}})}),t[19]=e,t[20]=a,t[21]=p):p=t[21];let m;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(m=new Set,t[22]=m):m=t[22];let h;t[23]!==f||t[24]!==i?(h=e=>{i(),f(``,e)},t[23]=f,t[24]=i,t[25]=h):h=t[25];let g;t[26]!==c||t[27]!==h?(g=(0,$.jsx)(pt,{folderPath:``,existingNames:m,open:c,onOpenChange:l,onCreated:h}),t[26]=c,t[27]=h,t[28]=g):g=t[28];let _;t[29]!==n.settingsId||t[30]!==s||t[31]!==d||t[32]!==p||t[33]!==g?(_=(0,$.jsxs)(`section`,{className:`space-y-3`,"aria-labelledby":n.settingsId,"data-testid":s,children:[d,p,g]}),t[29]=n.settingsId,t[30]=s,t[31]=d,t[32]=p,t[33]=g,t[34]=_):_=t[34],x=_;break bb0}if(r.status===`idle`||r.status===`loading`){let e=`settings-${n.testIdPrefix}-section`,r;t[35]===n?r=t[36]:(r=(0,$.jsx)(Ma,{config:n}),t[35]=n,t[36]=r);let i;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`rounded-lg border bg-card p-3 space-y-2`,children:[(0,$.jsx)(pn,{className:`h-12 w-full`}),(0,$.jsx)(pn,{className:`h-12 w-full`})]}),t[37]=i):i=t[37];let a;t[38]!==n.settingsId||t[39]!==e||t[40]!==r?(a=(0,$.jsxs)(`section`,{className:`space-y-3`,"aria-labelledby":n.settingsId,"data-testid":e,children:[r,i]}),t[38]=n.settingsId,t[39]=e,t[40]=r,t[41]=a):a=t[41],x=a;break bb0}g=`space-y-3`,_=n.settingsId,v=`settings-${n.testIdPrefix}-section`;let a;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>l(!0),t[42]=a):a=t[42],t[43]===n?y=t[44]:(y=(0,$.jsx)(Ma,{config:n,onNewClick:a}),t[43]=n,t[44]=y);let u=e.length===0?(0,$.jsx)(`p`,{className:`px-3 py-4 text-sm text-muted-foreground`,"data-testid":`settings-${n.testIdPrefix}-empty`,children:n.emptyMessage}):(0,$.jsx)(`ul`,{className:`space-y-1 p-2`,"data-testid":`settings-${n.testIdPrefix}-list`,children:e.map(e=>(0,$.jsx)(ut,{template:e,onEdit:()=>f(e.source_folder,e.name),onDelete:()=>s(e),badge:(0,$.jsx)(Qt,{variant:n.badge.variant,className:`text-2xs`,children:n.badge.label})},e.name))});t[45]===u?b=t[46]:(b=(0,$.jsx)(`div`,{className:`rounded-lg border bg-card`,children:u}),t[45]=u,t[46]=b),p=pt,m=``,h=new Set(e.map(Aa))}t[2]=n,t[3]=c,t[4]=f,t[5]=i,t[6]=r,t[7]=p,t[8]=m,t[9]=h,t[10]=g,t[11]=_,t[12]=v,t[13]=y,t[14]=b,t[15]=x}else p=t[7],m=t[8],h=t[9],g=t[10],_=t[11],v=t[12],y=t[13],b=t[14],x=t[15];if(x!==Symbol.for(`react.early_return_sentinel`))return x;let S;t[47]!==f||t[48]!==i?(S=e=>{i(),f(``,e)},t[47]=f,t[48]=i,t[49]=S):S=t[49];let C;t[50]!==p||t[51]!==c||t[52]!==S||t[53]!==m||t[54]!==h?(C=(0,$.jsx)(p,{folderPath:m,existingNames:h,open:c,onOpenChange:l,onCreated:S}),t[50]=p,t[51]=c,t[52]=S,t[53]=m,t[54]=h,t[55]=C):C=t[55];let w;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{e||s(null)},t[56]=w):w=t[56];let T;t[57]!==a||t[58]!==i?(T=(0,$.jsx)(dt,{template:a,onOpenChange:w,onDeleted:i}),t[57]=a,t[58]=i,t[59]=T):T=t[59];let E;return t[60]!==C||t[61]!==T||t[62]!==g||t[63]!==_||t[64]!==v||t[65]!==y||t[66]!==b?(E=(0,$.jsxs)(`section`,{className:g,"aria-labelledby":_,"data-testid":v,children:[y,b,C,T]}),t[60]=C,t[61]=T,t[62]=g,t[63]=_,t[64]=v,t[65]=y,t[66]=b,t[67]=E):E=t[67],E}function Aa(e){return e.name}function ja(e,t){return(e.title??e.name).toLowerCase().localeCompare((t.title??t.name).toLowerCase())}function Ma(e){let t=(0,Z.c)(14),{config:n,onNewClick:r}=e,i;t[0]!==n.settingsId||t[1]!==n.title?(i=(0,$.jsx)(`h3`,{id:n.settingsId,className:`text-base font-semibold`,children:n.title}),t[0]=n.settingsId,t[1]=n.title,t[2]=i):i=t[2];let a;t[3]===n.description?a=t[4]:(a=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n.description}),t[3]=n.description,t[4]=a);let s;t[5]!==i||t[6]!==a?(s=(0,$.jsxs)(`div`,{children:[i,a]}),t[5]=i,t[6]=a,t[7]=s):s=t[7];let c;t[8]!==n.testIdPrefix||t[9]!==r?(c=r?(0,$.jsxs)(x,{variant:`outline`,size:`sm`,className:`font-mono uppercase shrink-0`,onClick:r,"data-testid":`settings-${n.testIdPrefix}-new-button`,children:[(0,$.jsx)(m,{className:`size-3.5`,"aria-hidden":!0}),(0,$.jsx)(o,{id:`G1Gw0v`})]}):null,t[8]=n.testIdPrefix,t[9]=r,t[10]=c):c=t[10];let l;return t[11]!==s||t[12]!==c?(l=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[s,c]}),t[11]=s,t[12]=c,t[13]=l):l=t[13],l}function Na(){let e=(0,Z.c)(16),{_:t}=s(),n;e[0]===t?n=e[1]:(n=t({id:`hBMK4W`}),e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(o,{id:`nft48x`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}}),e[2]=r):r=e[2];let i;e[3]===t?i=e[4]:(i=t({id:`6Pxqwv`}),e[3]=t,e[4]=i);let a;e[5]===t?a=e[6]:(a=t({id:`BD0XSC`}),e[5]=t,e[6]=a);let c;e[7]===t?c=e[8]:(c=t({id:`ysxgu8`}),e[7]=t,e[8]=c);let l;e[9]===c?l=e[10]:(l={label:c,variant:`gray`},e[9]=c,e[10]=l);let u;return e[11]!==n||e[12]!==i||e[13]!==a||e[14]!==l?(u=(0,$.jsx)(ka,{config:{scope:`local`,title:n,description:r,emptyMessage:i,loadErrorTitle:a,badge:l,settingsId:`settings-project-templates-title`,testIdPrefix:`project-templates`}}),e[11]=n,e[12]=i,e[13]=a,e[14]=l,e[15]=u):u=e[15],u}async function Pa(e){try{let t=He.safeParse(await e.json());if(t.success)return t.data.title}catch{}}async function Fa(e,t){try{let n=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});return n.ok?{ok:!0}:{ok:!1,error:await Pa(n)}}catch{return{ok:!1}}}function Ia(){return{setKey:e=>Fa(`/api/local-op/embeddings/set-key`,{key:e}),clearKey:()=>Fa(`/api/local-op/embeddings/clear-key`,{}),async testConnection(){try{let e=await fetch(`/api/local-op/embeddings/test`,{method:`POST`,headers:{"content-type":`application/json`},body:`{}`});if(!e.ok)return null;let t=be.safeParse(await e.json());return t.success?t.data:null}catch{return null}}}}var La=[2500,5e3];function Ra(e){let t=(0,Z.c)(160),{transport:n}=e,{_:r}=s(),{projectLocalConfig:i,projectLocalSynced:a,projectLocalBinding:c}=an(),{status:l,refresh:u}=ot(),d;t[0]===n?d=t[1]:(d=n??Ia(),t[0]=n,t[1]=d);let f=d,[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(null),[_,v]=(0,Q.useState)(!1),y;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=[],t[2]=y):y=t[2];let b=(0,Q.useRef)(y),S,C;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>()=>{for(let e of b.current)clearTimeout(e)},C=[],t[3]=S,t[4]=C):(S=t[3],C=t[4]),(0,Q.useEffect)(S,C);let w=i?.search?.semantic?.baseUrl??`https://api.openai.com/v1`,O=i?.search?.semantic?.model??`text-embedding-3-small`,[k,A]=(0,Q.useState)(w),[j,M]=(0,Q.useState)(O),[N,P]=(0,Q.useState)(null),[F,I]=(0,Q.useState)(null),[L,R]=(0,Q.useState)(!1),[z,B]=(0,Q.useState)(null),V;t[5]!==w||t[6]!==O?(V={baseUrl:w,model:O},t[5]=w,t[6]=O,t[7]=V):V=t[7];let[H,ee]=(0,Q.useState)(V);(w!==H.baseUrl||O!==H.model)&&(ee({baseUrl:w,model:O}),A(w),M(O),v(!1),g(null),B(null));let U=i?.search?.semantic?.enabled??!1,te=a&&c!==null,ne=F??(w!==`https://api.openai.com/v1`||O!==`text-embedding-3-small`),re;t[8]===u?re=t[9]:(re=function(){for(let e of b.current)clearTimeout(e);b.current=La.map(e=>setTimeout(u,e))},t[8]=u,t[9]=re);let W=re,ie;t[10]!==r||t[11]!==c||t[12]!==u||t[13]!==W?(ie=function(e){if(c===null)return X.error(r({id:`YW7Q86`})),!1;let t=c.patch({search:{semantic:{enabled:e}}});if(!t.ok){let n=qe(t.error);return X.error(r(e?{id:`LYufDw`,values:{detail:n}}:{id:`5mksg0`,values:{detail:n}})),!1}return u(),W(),!0},t[10]=r,t[11]=c,t[12]=u,t[13]=W,t[14]=ie):ie=t[14];let G=ie,q;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(q=function(e){return e.trim()||`https://api.openai.com/v1`},t[15]=q):q=t[15];let ae=q,J;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(J=function(e){return e.trim()||`text-embedding-3-small`},t[16]=J):J=t[16];let oe=J,se;t[17]!==r||t[18]!==c||t[19]!==u||t[20]!==W?(se=function(e){if(c===null)return X.error(r({id:`YW7Q86`})),!1;let t=c.patch({search:{semantic:{baseUrl:e.baseUrl,model:e.model}}});if(!t.ok){let e=qe(t.error);return X.error(r({id:`aQD_86`,values:{detail:e}})),!1}return B(null),u(),W(),!0},t[17]=r,t[18]=c,t[19]=u,t[20]=W,t[21]=se):se=t[21];let Y=se,ce;t[22]!==w||t[23]!==O?(ce=function(e){e.baseUrl===w&&e.model===O||P(e)},t[22]=w,t[23]=O,t[24]=ce):ce=t[24];let le=ce,ue;t[25]!==N||t[26]!==Y?(ue=function(){N&&Y(N)&&P(null)},t[25]=N,t[26]=Y,t[27]=ue):ue=t[27];let de=ue,fe;t[28]!==w||t[29]!==O?(fe=function(){P(null),A(w),M(O),g(null)},t[28]=w,t[29]=O,t[30]=fe):fe=t[30];let pe=fe,me;t[31]!==f||t[32]!==L?(me=async function(){if(L)return;R(!0),B(null);let e;try{e=await f.testConnection()}catch{e=null}R(!1),B({response:e})},t[31]=f,t[32]=L,t[33]=me):me=t[33];let he=me,ge;t[34]===G?ge=t[35]:(ge=function(e){if(e){m(!0);return}G(!1)},t[34]=G,t[35]=ge);let _e=ge,ve;t[36]===G?ve=t[37]:(ve=function(){G(!0)&&m(!1)},t[36]=G,t[37]=ve);let ye=ve,be;t[38]===r?be=t[39]:(be=function(e){let t=e.trim();if(!t)return null;let n=We(t);return n===null?null:r(n===`invalid-url`?{id:`2j1kfc`}:{id:`JM_aq-`})},t[38]=r,t[39]=be);let xe=be,Se;t[40]!==xe||t[41]!==_?(Se=function(e){A(e),_&&g(xe(e))},t[40]=xe,t[41]=_,t[42]=Se):Se=t[42];let Ce=Se,we;t[43]!==k||t[44]!==xe||t[45]!==j||t[46]!==le?(we=function(){v(!0);let e=xe(k);g(e),e===null&&le({baseUrl:ae(k),model:oe(j)})},t[43]=k,t[44]=xe,t[45]=j,t[46]=le,t[47]=we):we=t[47];let Te=we,Ee=l?.enabled??!1,De=l?.keyPresent??!1,Oe=l?.keyNotRequired??!1,ke=l?.keyHint??null,Ae=l?.keySource??null,je=l?.ready??!1,Me=l?.capable??!1,Ne=l?.embedded??0,Pe=l?.total??0,Fe;t[48]===w?Fe=t[49]:(Fe=Ga(w)??w,t[48]=w,t[49]=Fe);let Ie=Fe,Le;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,$.jsx)(`h3`,{id:`settings-search-title`,className:`text-base font-semibold`,children:(0,$.jsx)(o,{id:`3y6XTb`})}),t[50]=Le):Le=t[50];let Re;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[Le,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`dUQ7_J`})})]}),t[51]=Re):Re=t[51];let ze;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,$.jsx)(`label`,{htmlFor:`settings-search-semantic-toggle`,className:`text-sm font-medium`,children:(0,$.jsx)(o,{id:`3y6XTb`})}),t[52]=ze):ze=t[52];let Be;t[53]===U?Be=t[54]:(Be=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[ze,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,"data-testid":`settings-search-body`,children:U?(0,$.jsx)(o,{id:`stlgky`}):(0,$.jsx)(o,{id:`kdzzOK`})})]}),t[53]=U,t[54]=Be);let Ve=!te,He;t[55]!==r||t[56]!==U?(He=r(U?{id:`fNr-MX`}:{id:`Aif3E7`}),t[55]=r,t[56]=U,t[57]=He):He=t[57];let Ge;t[58]!==U||t[59]!==_e||t[60]!==Ve||t[61]!==He?(Ge=(0,$.jsx)(K,{id:`settings-search-semantic-toggle`,checked:U,disabled:Ve,onCheckedChange:_e,"aria-label":He,"data-testid":`settings-search-semantic-toggle`}),t[58]=U,t[59]=_e,t[60]=Ve,t[61]=He,t[62]=Ge):Ge=t[62];let Je;t[63]!==Be||t[64]!==Ge?(Je=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[Be,Ge]}),t[63]=Be,t[64]=Ge,t[65]=Je):Je=t[65];let Ye;t[66]!==Me||t[67]!==Ne||t[68]!==U||t[69]!==Oe||t[70]!==De||t[71]!==je||t[72]!==Ee||t[73]!==l||t[74]!==Pe?(Ye=U?(0,$.jsx)(Ba,{loaded:l!==null,serverEnabled:Ee,keyPresent:De,keyNotRequired:Oe,ready:je,capable:Me,embedded:Ne,total:Pe}):null,t[66]=Me,t[67]=Ne,t[68]=U,t[69]=Oe,t[70]=De,t[71]=je,t[72]=Ee,t[73]=l,t[74]=Pe,t[75]=Ye):Ye=t[75];let Xe;t[76]!==Je||t[77]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`rounded-md border p-3`,children:[Je,Ye]}),t[76]=Je,t[77]=Ye,t[78]=Xe):Xe=t[78];let Ze=l!==null,Qe;t[79]!==Ie||t[80]!==ke||t[81]!==Oe||t[82]!==De||t[83]!==Ae||t[84]!==u||t[85]!==f||t[86]!==Ze?(Qe=(0,$.jsx)(za,{transport:f,refresh:u,endpointHost:Ie,keyPresent:De,keyHint:ke,keySource:Ae,keyNotRequired:Oe,loaded:Ze}),t[79]=Ie,t[80]=ke,t[81]=Oe,t[82]=De,t[83]=Ae,t[84]=u,t[85]=f,t[86]=Ze,t[87]=Qe):Qe=t[87];let $e;t[88]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,$.jsxs)(E,{className:`group flex w-full items-center justify-between gap-2 px-3 py-2 text-sm font-medium hover:bg-muted/50`,"data-testid":`settings-search-custom-endpoint-trigger`,children:[(0,$.jsx)(o,{id:`Hp4rRh`}),(0,$.jsx)(rt,{className:`size-4 transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`,"aria-hidden":!0})]}),t[88]=$e):$e=t[88];let et;t[89]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(o,{id:`kRTXGw`})}),t[89]=et):et=t[89];let tt;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,$.jsx)(`label`,{htmlFor:`settings-search-base-url`,className:`block text-sm font-medium`,children:(0,$.jsx)(o,{id:`FCKppt`})}),t[90]=tt):tt=t[90];let nt;t[91]===Ce?nt=t[92]:(nt=e=>Ce(e.currentTarget.value),t[91]=Ce,t[92]=nt);let it;t[93]===Te?it=t[94]:(it=e=>{e.key===`Enter`&&(e.preventDefault(),Te())},t[93]=Te,t[94]=it);let at=!te,st=h!==null,ct;t[95]!==k||t[96]!==Te||t[97]!==nt||t[98]!==it||t[99]!==at||t[100]!==st?(ct=(0,$.jsx)(Vt,{id:`settings-search-base-url`,value:k,onChange:nt,onBlur:Te,onKeyDown:it,placeholder:Ke,disabled:at,spellCheck:!1,autoComplete:`off`,"aria-invalid":st,"aria-describedby":`settings-search-base-url-message`,"data-testid":`settings-search-base-url`,className:`h-8 font-mono text-sm`}),t[95]=k,t[96]=Te,t[97]=nt,t[98]=it,t[99]=at,t[100]=st,t[101]=ct):ct=t[101];let lt=h?`text-1sm text-destructive`:`text-muted-foreground text-1sm`,ut=h?`settings-search-base-url-error`:`settings-search-base-url-help`,dt;t[102]===h?dt=t[103]:(dt=h??(0,$.jsx)(o,{id:`lHCR4I`}),t[102]=h,t[103]=dt);let ft;t[104]!==lt||t[105]!==ut||t[106]!==dt?(ft=(0,$.jsx)(`p`,{id:`settings-search-base-url-message`,"aria-live":`polite`,className:lt,"data-testid":ut,children:dt}),t[104]=lt,t[105]=ut,t[106]=dt,t[107]=ft):ft=t[107];let pt;t[108]!==ct||t[109]!==ft?(pt=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[tt,ct,ft]}),t[108]=ct,t[109]=ft,t[110]=pt):pt=t[110];let mt;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(mt=(0,$.jsx)(`label`,{htmlFor:`settings-search-model`,className:`block text-sm font-medium`,children:(0,$.jsx)(o,{id:`scu3wk`})}),t[111]=mt):mt=t[111];let ht;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(ht=e=>M(e.currentTarget.value),t[112]=ht):ht=t[112];let gt;t[113]===Te?gt=t[114]:(gt=e=>{e.key===`Enter`&&(e.preventDefault(),Te())},t[113]=Te,t[114]=gt);let _t=!te,vt;t[115]!==Te||t[116]!==j||t[117]!==gt||t[118]!==_t?(vt=(0,$.jsx)(Vt,{id:`settings-search-model`,value:j,onChange:ht,onBlur:Te,onKeyDown:gt,placeholder:Ue,disabled:_t,spellCheck:!1,autoComplete:`off`,"aria-describedby":`settings-search-model-help`,"data-testid":`settings-search-model`,className:`h-8 font-mono text-sm`}),t[115]=Te,t[116]=j,t[117]=gt,t[118]=_t,t[119]=vt):vt=t[119];let yt;t[120]===Symbol.for(`react.memo_cache_sentinel`)?(yt=(0,$.jsx)(`p`,{id:`settings-search-model-help`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-search-model-help`,children:(0,$.jsx)(o,{id:`C-mmmK`,values:{DEFAULT_EMBEDDINGS_MODEL:Ue}})}),t[120]=yt):yt=t[120];let bt;t[121]===vt?bt=t[122]:(bt=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[mt,vt,yt]}),t[121]=vt,t[122]=bt);let xt;t[123]===he?xt=t[124]:(xt=()=>void he(),t[123]=he,t[124]=xt);let St=L||!te,Ct;t[125]===L?Ct=t[126]:(Ct=L?(0,$.jsx)(o,{id:`qIJIrD`}):(0,$.jsx)(o,{id:`e2zZ3E`}),t[125]=L,t[126]=Ct);let wt;t[127]!==xt||t[128]!==St||t[129]!==Ct?(wt=(0,$.jsx)(x,{variant:`outline`,onClick:xt,disabled:St,"data-testid":`settings-search-test-connection`,children:Ct}),t[127]=xt,t[128]=St,t[129]=Ct,t[130]=wt):wt=t[130];let Tt;t[131]!==w||t[132]!==O||t[133]!==z||t[134]!==L?(Tt=(0,$.jsx)(Va,{result:z,testing:L,configuredBaseUrl:w,configuredModel:O}),t[131]=w,t[132]=O,t[133]=z,t[134]=L,t[135]=Tt):Tt=t[135];let Et;t[136]!==wt||t[137]!==Tt?(Et=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[wt,Tt]}),t[136]=wt,t[137]=Tt,t[138]=Et):Et=t[138];let Dt;t[139]!==pt||t[140]!==bt||t[141]!==Et?(Dt=(0,$.jsxs)(T,{className:`space-y-4 border-t px-3 py-3`,children:[et,pt,bt,Et]}),t[139]=pt,t[140]=bt,t[141]=Et,t[142]=Dt):Dt=t[142];let Ot;t[143]!==ne||t[144]!==Dt?(Ot=(0,$.jsxs)(D,{open:ne,onOpenChange:I,className:`rounded-md border`,"data-testid":`settings-search-custom-endpoint`,children:[$e,Dt]}),t[143]=ne,t[144]=Dt,t[145]=Ot):Ot=t[145];let kt;t[146]!==p||t[147]!==ye?(kt=(0,$.jsx)(Ka,{open:p,onOpenChange:m,onConfirm:ye}),t[146]=p,t[147]=ye,t[148]=kt):kt=t[148];let At;t[149]!==pe||t[150]!==de||t[151]!==N||t[152]!==Pe?(At=(0,$.jsx)(Wa,{pending:N,pageCount:Pe,onCancel:pe,onConfirm:de}),t[149]=pe,t[150]=de,t[151]=N,t[152]=Pe,t[153]=At):At=t[153];let jt;return t[154]!==Xe||t[155]!==Qe||t[156]!==Ot||t[157]!==kt||t[158]!==At?(jt=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-search-title`,className:`space-y-3`,"data-testid":`settings-search`,children:[Re,Xe,Qe,Ot,kt,At]}),t[154]=Xe,t[155]=Qe,t[156]=Ot,t[157]=kt,t[158]=At,t[159]=jt):jt=t[159],jt}function za(e){let t=(0,Z.c)(31),{transport:n,refresh:r,endpointHost:i,keyPresent:a,keyHint:c,keySource:l,keyNotRequired:u,loaded:d}=e,{_:f}=s(),[p,m]=(0,Q.useState)(``),[h,g]=(0,Q.useState)(!1),[_,v]=(0,Q.useState)(null),y;t[0]!==f||t[1]!==h||t[2]!==p||t[3]!==r||t[4]!==n?(y=async function(){let e=p.trim();if(!e||h)return;g(!0),v(null);let t=await n.setKey(e);g(!1),t.ok?(m(``),r()):v(t.error??f({id:`Ck9XRt`}))},t[0]=f,t[1]=h,t[2]=p,t[3]=r,t[4]=n,t[5]=y):y=t[5];let b=y,S;t[6]!==f||t[7]!==h||t[8]!==r||t[9]!==n?(S=async function(){if(h)return;g(!0),v(null);let e=await n.clearKey();g(!1),e.ok?r():v(e.error??f({id:`CSL0l1`}))},t[6]=f,t[7]=h,t[8]=r,t[9]=n,t[10]=S):S=t[10];let C=S,w;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(`h4`,{className:`text-sm font-medium`,children:(0,$.jsx)(o,{id:`2pR7ad`})}),t[11]=w):w=t[11];let T;t[12]!==i||t[13]!==u?(T=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[w,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:u?(0,$.jsx)(o,{id:`k8xtrB`,values:{endpointHost:i},components:{0:(0,$.jsx)(`span`,{className:`font-medium`})}}):(0,$.jsx)(o,{id:`RhX_1U`,values:{endpointHost:i},components:{0:(0,$.jsx)(`span`,{className:`font-medium`}),1:(0,$.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})})]}),t[12]=i,t[13]=u,t[14]=T):T=t[14];let E;t[15]!==f||t[16]!==h||t[17]!==c||t[18]!==p||t[19]!==a||t[20]!==l||t[21]!==d||t[22]!==C||t[23]!==b?(E=l===`env`?(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,"data-testid":`settings-search-key-env`,children:(0,$.jsx)(o,{id:`KH5bQi`,components:{0:(0,$.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})}):(0,$.jsxs)($.Fragment,{children:[a?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,"data-testid":`settings-search-key-set`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:`mb-1.5 text-sm font-medium`,children:(0,$.jsx)(o,{id:`AqnqMJ`})}),c?(0,$.jsxs)(`p`,{className:`truncate font-mono text-muted-foreground text-xs`,title:f({id:`qEIFZu`,values:{keyHint:c}}),"data-testid":`settings-search-key-hint`,children:[(0,$.jsx)(`span`,{"aria-hidden":`true`,children:`••••••••`}),c]}):null]}),(0,$.jsx)(x,{variant:`outline`,onClick:()=>void C(),disabled:h,"data-testid":`settings-search-key-clear`,children:(0,$.jsx)(o,{id:`xCJdfg`})})]}):null,(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`label`,{htmlFor:`settings-search-key-input`,className:`mb-2 block text-sm font-medium`,children:a?(0,$.jsx)(o,{id:`UW93oq`}):(0,$.jsx)(o,{id:`K6jxcj`})}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Vt,{id:`settings-search-key-input`,type:`password`,value:p,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),b())},placeholder:f({id:`tsiTqO`}),autoComplete:`off`,spellCheck:!1,disabled:h||!d,"data-testid":`settings-search-key-input`,className:`h-8 font-mono text-sm`}),(0,$.jsx)(x,{onClick:()=>void b(),disabled:h||p.trim().length===0,"data-testid":`settings-search-key-save`,children:h?(0,$.jsx)(o,{id:`uF9ruK`}):(0,$.jsx)(o,{id:`tfDRzk`})})]})]})]}),t[15]=f,t[16]=h,t[17]=c,t[18]=p,t[19]=a,t[20]=l,t[21]=d,t[22]=C,t[23]=b,t[24]=E):E=t[24];let D;t[25]===_?D=t[26]:(D=_?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-search-key-error`,children:_}):null,t[25]=_,t[26]=D);let O;return t[27]!==T||t[28]!==E||t[29]!==D?(O=(0,$.jsxs)(`section`,{className:`space-y-3 rounded-md border p-3`,"data-testid":`settings-search-key`,children:[T,E,D]}),t[27]=T,t[28]=E,t[29]=D,t[30]=O):O=t[30],O}function Ba(e){let t=(0,Z.c)(12),{loaded:n,serverEnabled:r,keyPresent:i,keyNotRequired:a,ready:s,capable:c,embedded:l,total:u}=e;if(!n||!r){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-1sm mt-2`,"data-testid":`settings-search-settling`,children:(0,$.jsx)(o,{id:`AdcGcG`})}),t[0]=e):e=t[0],e}if(!i&&!a){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{role:`alert`,className:`mt-2 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-1sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,"data-testid":`settings-search-needs-key`,children:(0,$.jsx)(o,{id:`x4pGVR`})}),t[1]=e):e=t[1],e}if(s&&!c){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{role:`alert`,className:`mt-2 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-1sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,"data-testid":`settings-search-provider-error`,children:(0,$.jsx)(o,{id:`Oj-JV8`,components:{0:(0,$.jsx)(`span`,{className:`font-medium`})}})}),t[2]=e):e=t[2],e}if(!s){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{role:`status`,className:`text-muted-foreground text-1sm mt-2`,"data-testid":`settings-search-pending`,children:(0,$.jsx)(o,{id:`VZSBXL`})}),t[3]=e):e=t[3],e}let d;t[4]!==l||t[5]!==u?(d=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(o,{id:`lVWEIL`,values:{embedded:l,total:u}})}),t[4]=l,t[5]=u,t[6]=d):d=t[6];let f;t[7]===l?f=t[8]:(f=l===0?(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(o,{id:`ku0yLQ`})}):null,t[7]=l,t[8]=f);let p;return t[9]!==d||t[10]!==f?(p=(0,$.jsxs)(`div`,{className:`mt-2 space-y-0.5`,"data-testid":`settings-search-coverage`,children:[d,f]}),t[9]=d,t[10]=f,t[11]=p):p=t[11],p}function Va(e){let t=(0,Z.c)(6),{result:n,testing:r,configuredBaseUrl:i,configuredModel:a}=e;if(r||n===null)return null;let{response:s}=n;if(s===null){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Ua,{tone:`error`,testId:`settings-search-test-unreachable`,children:(0,$.jsx)(o,{id:`uNGmQn`})}),t[0]=e):e=t[0],e}if(s.endpoint!==i||s.model!==a){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Ua,{tone:`warn`,testId:`settings-search-test-stale`,children:(0,$.jsx)(o,{id:`psl2Sj`})}),t[1]=e):e=t[1],e}if(s.ok){let e;return t[2]===s.dimensions?e=t[3]:(e=(0,$.jsx)(Ua,{tone:`ok`,testId:`settings-search-test-ok`,children:(0,$.jsx)(o,{id:`D-_B7l`,values:{0:s.dimensions}})}),t[2]=s.dimensions,t[3]=e),e}let c;return t[4]===s?c=t[5]:(c=(0,$.jsx)(Ua,{tone:`error`,testId:`settings-search-test-error`,children:(0,$.jsx)(Ha,{response:s})}),t[4]=s,t[5]=c),c}function Ha(e){let t=(0,Z.c)(9),{response:n}=e;switch(n.reason){case`no_key`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(o,{id:`7cAW1G`}),t[0]=e):e=t[0],e}case`invalid_endpoint`:{let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(o,{id:`PhLu69`}),t[1]=e):e=t[1],e}case`rate_limit`:{let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(o,{id:`xDEcka`}),t[2]=e):e=t[2],e}case`timeout`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(o,{id:`PpJy-V`}),t[3]=e):e=t[3],e}case`network`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(o,{id:`yFr-5x`}),t[4]=e):e=t[4],e}case`dims_mismatch`:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(o,{id:`5Szq6N`,components:{0:(0,$.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}}),t[5]=e):e=t[5],e}case`malformed_response`:{let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(o,{id:`AwLCZA`}),t[6]=e):e=t[6],e}default:{let e;return t[7]===n.status?e=t[8]:(e=n.status===void 0?(0,$.jsx)(o,{id:`tN5WTS`}):(0,$.jsx)(o,{id:`v_cQn_`,values:{0:n.status}}),t[7]=n.status,t[8]=e),e}}}function Ua(e){let t=(0,Z.c)(7),{tone:n,testId:r,children:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={ok:`border-emerald-300 bg-emerald-50 text-emerald-900 dark:border-emerald-700 dark:bg-emerald-950 dark:text-emerald-200`,warn:`border-amber-300 bg-amber-50 text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,error:`border-destructive/50 bg-destructive/10 text-destructive`},t[0]=a):a=t[0];let o=a[n],s=n===`error`?`alert`:`status`,c=n===`error`?`assertive`:`polite`,l=`rounded-md border px-3 py-2 text-1sm ${o}`,u;return t[1]!==i||t[2]!==s||t[3]!==c||t[4]!==l||t[5]!==r?(u=(0,$.jsx)(`p`,{role:s,"aria-live":c,className:l,"data-testid":r,children:i}),t[1]=i,t[2]=s,t[3]=c,t[4]=l,t[5]=r,t[6]=u):u=t[6],u}function Wa(e){let t=(0,Z.c)(32),{pending:n,pageCount:r,onCancel:i,onConfirm:a}=e,s;t[0]===n?s=t[1]:(s=n?Ga(n.baseUrl)??n.baseUrl:``,t[0]=n,t[1]=s);let c=s,l=n!==null,u;t[2]===i?u=t[3]:(u=e=>{e||i()},t[2]=i,t[3]=u);let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(k,{children:(0,$.jsx)(o,{id:`_GRWOJ`})}),t[4]=d):d=t[4];let f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(P,{children:[d,(0,$.jsx)(O,{children:(0,$.jsx)(o,{id:`EKwNEe`})})]}),t[5]=f):f=t[5];let p;t[6]!==c||t[7]!==r?(p={pageCount:r,host:c},t[6]=c,t[7]=r,t[8]=p):p=t[8];let m;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(m={0:(0,$.jsx)(`span`,{className:`font-medium`}),1:(0,$.jsx)(`span`,{className:`font-medium`})},t[9]=m):m=t[9];let h;t[10]===p?h=t[11]:(h=(0,$.jsx)(`li`,{children:(0,$.jsx)(o,{id:`darW93`,values:p,components:m})}),t[10]=p,t[11]=h);let g=n?.model,_;t[12]===g?_=t[13]:(_={0:g},t[12]=g,t[13]=_);let v;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(v={0:(0,$.jsx)(`span`,{className:`font-mono`})},t[14]=v):v=t[14];let y;t[15]===_?y=t[16]:(y=(0,$.jsx)(`li`,{children:(0,$.jsx)(o,{id:`sweBEk`,values:_,components:v})}),t[15]=_,t[16]=y);let b;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(`li`,{children:(0,$.jsx)(o,{id:`cD3aew`})}),t[17]=b):b=t[17];let S;t[18]!==y||t[19]!==h?(S=(0,$.jsx)(j,{children:(0,$.jsx)(`div`,{role:`alert`,className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2.5 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,children:(0,$.jsxs)(`ul`,{className:`list-disc space-y-1.5 pl-5`,children:[h,y,b]})})}),t[18]=y,t[19]=h,t[20]=S):S=t[20];let C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(N,{asChild:!0,children:(0,$.jsx)(x,{variant:`outline`,children:(0,$.jsx)(o,{id:`dEgA5A`})})}),t[21]=C):C=t[21];let w;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(o,{id:`9aVlF2`}),t[22]=w):w=t[22];let T;t[23]===a?T=t[24]:(T=(0,$.jsxs)(M,{children:[C,(0,$.jsx)(x,{onClick:a,"data-testid":`settings-search-provider-confirm-apply`,children:w})]}),t[23]=a,t[24]=T);let E;t[25]!==S||t[26]!==T?(E=(0,$.jsxs)(A,{className:`sm:max-w-lg`,"data-testid":`settings-search-provider-confirm`,children:[f,S,T]}),t[25]=S,t[26]=T,t[27]=E):E=t[27];let D;return t[28]!==E||t[29]!==l||t[30]!==u?(D=(0,$.jsx)(F,{open:l,onOpenChange:u,children:E}),t[28]=E,t[29]=l,t[30]=u,t[31]=D):D=t[31],D}function Ga(e){try{return new URL(e).host}catch{return null}}function Ka(e){let t=(0,Z.c)(13),{open:n,onOpenChange:r,onConfirm:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(k,{children:(0,$.jsx)(o,{id:`vhAnzJ`})}),t[0]=a):a=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsxs)(P,{children:[a,(0,$.jsx)(O,{children:(0,$.jsx)(o,{id:`aENGMB`})})]}),t[1]=s):s=t[1];let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(`p`,{className:`mb-2 font-medium`,children:(0,$.jsx)(o,{id:`7PNNNs`})}),t[2]=c):c=t[2];let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(`li`,{children:(0,$.jsx)(o,{id:`UfW9Kr`})}),t[3]=l):l=t[3];let u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(j,{children:(0,$.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2.5 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,children:[c,(0,$.jsxs)(`ul`,{className:`list-disc space-y-1.5 pl-5`,children:[l,(0,$.jsx)(`li`,{children:(0,$.jsx)(o,{id:`Emz5BG`,components:{0:(0,$.jsx)(`code`,{className:`rounded bg-amber-100 px-1 py-0.5 font-mono text-xs dark:bg-amber-900`})}})}),(0,$.jsx)(`li`,{children:(0,$.jsx)(o,{id:`DKYW1G`})})]})]})}),t[4]=u):u=t[4];let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(N,{asChild:!0,children:(0,$.jsx)(x,{variant:`outline`,children:(0,$.jsx)(o,{id:`dEgA5A`})})}),t[5]=d):d=t[5];let f;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(o,{id:`iMkWoF`}),t[6]=f):f=t[6];let p;t[7]===i?p=t[8]:(p=(0,$.jsxs)(A,{className:`sm:max-w-lg`,"data-testid":`settings-search-confirm`,children:[s,u,(0,$.jsxs)(M,{children:[d,(0,$.jsx)(x,{onClick:i,"data-testid":`settings-search-confirm-enable`,children:f})]})]}),t[7]=i,t[8]=p);let m;return t[9]!==r||t[10]!==n||t[11]!==p?(m=(0,$.jsx)(F,{open:n,onOpenChange:r,children:p}),t[9]=r,t[10]=n,t[11]=p,t[12]=m):m=t[12],m}function qa(e){let t=(0,Z.c)(46),{scope:n}=e,{_:r}=s(),{state:i,saving:a,folderAction:c}=St(),[l,u]=(0,Q.useState)(``),d,f,p,m;if(t[0]!==r||t[1]!==c||t[2]!==a||t[3]!==n||t[4]!==i.data||t[5]!==i.message||t[6]!==i.status){let e=i.status===`ready`?(i.data.folders??[]).filter(e=>e.scope===n):[],s=new Map(e.map(Xa)),l=e=>(e.state===`linked`||e.state===`linked-parent`)&&typeof e.target==`string`&&s.has(e.target),u=new Map;for(let t of e){if(!l(t))continue;let e=t.target;u.set(e,[...u.get(e)??[],t])}let h;t[11]===l?h=t[12]:(h=e=>!l(e),t[11]=l,t[12]=h);let g=e.filter(h),v;t[13]!==c||t[14]!==n?(v=(e,t,r)=>{c({scope:n,root:e,action:t,...r===void 0?{}:{target:r}}).catch(Ya)},t[13]=c,t[14]=n,t[15]=v):v=t[15];let y=v;d=`space-y-2 rounded-lg border bg-card p-3`,f=`settings-skill-folders`;let S;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(`h4`,{className:`text-sm font-medium`,children:(0,$.jsx)(o,{id:`HSh8u_`})}),t[16]=S):S=t[16],t[17]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsxs)(`div`,{children:[S,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`sLcbHt`})})]}),t[17]=p):p=t[17],m=i.status===`error`?(0,$.jsx)(`div`,{className:`text-1sm text-destructive`,role:`alert`,"data-testid":`skill-targets-error`,children:(0,$.jsx)(o,{id:`ACKMCN`,values:{0:i.message}})}):i.status===`ready`?(0,$.jsx)(`ul`,{className:`space-y-1 pt-1`,children:g.map(t=>{let i=n===`global`?`~/${t.root}`:t.root,s=u.get(t.root)??[],c=e.filter(e=>e.root!==t.root&&(e.state===`own`||e.state===`absent`));return(0,$.jsxs)(`li`,{className:`text-sm`,"data-testid":`skill-folder-row-${t.host}`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(_,{host:t.host,"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,children:[i,t.state===`linked`||t.state===`linked-parent`?(0,$.jsxs)(`span`,{className:`text-muted-foreground`,children:[` → `,t.target??`?`]}):null]}),t.drift?(0,$.jsx)(b,{testId:`skill-folder-drift-${t.host}`,title:r({id:`p3m_Gk`,values:{0:t.expected??``}})}):null,t.state===`absent`?(0,$.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground uppercase tracking-wide`,children:(0,$.jsx)(o,{id:`KFd4xz`})}):null,t.state===`linked-parent`?(0,$.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground uppercase tracking-wide`,title:r({id:`yLwx9e`}),children:(0,$.jsx)(o,{id:`nf0wk0`})}):null,(t.state===`own`||t.state===`absent`)&&c.length>0?(0,$.jsxs)(B,{children:[(0,$.jsx)(R,{asChild:!0,children:(0,$.jsx)(x,{size:`sm`,variant:`ghost`,disabled:a,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] uppercase tracking-wide text-muted-foreground hover:text-foreground`,title:r({id:`g5w1sF`,values:{display:i}}),"data-testid":`skill-folder-link-${t.host}`,children:(0,$.jsx)(o,{id:`uUCrBv`})})}),(0,$.jsx)(z,{align:`end`,className:`w-auto`,children:c.map(e=>(0,$.jsxs)(L,{onSelect:()=>y(e.root,`link`,t.root),"data-testid":`skill-folder-link-${t.host}-to-${e.root}`,children:[(0,$.jsx)(_,{host:e.host,"aria-hidden":!0,className:`size-4`}),(0,$.jsx)(`span`,{className:`font-mono text-xs`,children:n===`global`?`~/${e.root}`:e.root})]},e.root))})]}):null,t.state===`linked`?(0,$.jsx)(x,{size:`sm`,variant:`ghost`,disabled:a,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] uppercase tracking-wide text-muted-foreground hover:text-foreground`,title:r({id:`MQ5LOx`,values:{display:i}}),onClick:()=>y(t.root,`unlink`),"data-testid":`skill-folder-unlink-${t.host}`,children:(0,$.jsx)(o,{id:`ptQ3_N`})}):null]}),s.length>0?(0,$.jsx)(`ul`,{className:`mt-1 ml-2 space-y-1 border-border/60 border-l pl-3`,"data-testid":`skill-folder-followers-${t.host}`,children:s.map(e=>(0,$.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(_,{host:e.host,"aria-hidden":!0,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-muted-foreground text-xs`,children:n===`global`?`~/${e.root}`:e.root}),e.drift?(0,$.jsx)(b,{testId:`skill-folder-drift-${e.host}`,title:r({id:`p3m_Gk`,values:{0:e.expected??``}})}):null,e.state===`linked-parent`?(0,$.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground uppercase tracking-wide`,title:r({id:`yLwx9e`}),children:(0,$.jsx)(o,{id:`Ef6ukL`})}):(0,$.jsx)(x,{size:`sm`,variant:`ghost`,disabled:a,className:`h-5 shrink-0 rounded border border-border/60 px-1 font-normal text-[10px] text-muted-foreground uppercase tracking-wide hover:text-foreground`,title:r({id:`9_2oe6`,values:{0:n===`global`?`~/${e.root}`:e.root}}),onClick:()=>y(e.root,`unlink`),"data-testid":`skill-folder-unlink-${e.host}`,children:(0,$.jsx)(o,{id:`ptQ3_N`})})]},e.host))}):null]},t.host)})}):(0,$.jsxs)(`div`,{className:`space-y-2 pt-1`,children:[(0,$.jsx)(pn,{className:`h-5 w-56`}),(0,$.jsx)(pn,{className:`h-5 w-56`})]}),t[0]=r,t[1]=c,t[2]=a,t[3]=n,t[4]=i.data,t[5]=i.message,t[6]=i.status,t[7]=d,t[8]=f,t[9]=p,t[10]=m}else d=t[7],f=t[8],p=t[9],m=t[10];let h;t[18]!==c||t[19]!==l||t[20]!==n?(h=e=>{e.preventDefault();let t=l.trim().replace(/^~\//,``);t!==``&&c({scope:n,root:t,action:`add-root`}).then(()=>u(``)).catch(Ja)},t[18]=c,t[19]=l,t[20]=n,t[21]=h):h=t[21];let g;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>u(e.target.value),t[22]=g):g=t[22];let v;t[23]!==r||t[24]!==n?(v=r(n===`global`?{id:`Wboy1j`}:{id:`jpoCue`}),t[23]=r,t[24]=n,t[25]=v):v=t[25];let y;t[26]!==l||t[27]!==a||t[28]!==v?(y=(0,$.jsx)(Vt,{value:l,onChange:g,placeholder:v,className:`h-7 flex-1 font-mono text-xs`,disabled:a,"data-testid":`skill-folders-add-root-input`}),t[26]=l,t[27]=a,t[28]=v,t[29]=y):y=t[29];let S;t[30]!==l||t[31]!==a?(S=a||l.trim()===``,t[30]=l,t[31]=a,t[32]=S):S=t[32];let C;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(o,{id:`ZW2yR_`}),t[33]=C):C=t[33];let w;t[34]===S?w=t[35]:(w=(0,$.jsx)(x,{type:`submit`,size:`sm`,variant:`secondary`,disabled:S,className:`h-7 px-2 font-normal text-xs`,children:C}),t[34]=S,t[35]=w);let T;t[36]!==w||t[37]!==h||t[38]!==y?(T=(0,$.jsxs)(`form`,{className:`flex items-center gap-2 pt-1`,onSubmit:h,"data-testid":`skill-folders-add-root`,children:[y,w]}),t[36]=w,t[37]=h,t[38]=y,t[39]=T):T=t[39];let E;return t[40]!==d||t[41]!==T||t[42]!==f||t[43]!==p||t[44]!==m?(E=(0,$.jsxs)(`section`,{className:d,"data-testid":f,children:[p,m,T]}),t[40]=d,t[41]=T,t[42]=f,t[43]=p,t[44]=m,t[45]=E):E=t[45],E}function Ja(e){return X.error(e instanceof Error?e.message:String(e))}function Ya(e){return X.error(e instanceof Error?e.message:String(e))}function Xa(e){return[e.root,e]}function Za(e){let t=(0,Z.c)(14),{scope:n}=e,r=`settings-skills-title-${n}`,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(o,{id:`PCSkw2`}),t[0]=i):i=t[0];let a;t[1]===r?a=t[2]:(a=(0,$.jsx)(`h3`,{id:r,className:`text-base font-semibold`,children:i}),t[1]=r,t[2]=a);let s;t[3]===n?s=t[4]:(s=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n===`project`?(0,$.jsx)(o,{id:`NCmYhK`}):(0,$.jsx)(o,{id:`67TEhP`})}),t[3]=n,t[4]=s);let c;t[5]!==a||t[6]!==s?(c=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[a,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7];let l;t[8]===n?l=t[9]:(l=(0,$.jsx)(qa,{scope:n}),t[8]=n,t[9]=l);let u;return t[10]!==c||t[11]!==l||t[12]!==r?(u=(0,$.jsxs)(`section`,{"aria-labelledby":r,className:`space-y-4`,"data-testid":`settings-skills-section`,children:[c,l]}),t[10]=c,t[11]=l,t[12]=r,t[13]=u):u=t[13],u}var Qa=`data-[state=on]:border-primary data-[state=on]:bg-primary data-[state=on]:text-primary-foreground data-[state=on]:hover:bg-primary/90`;function $a(){let e=(0,Z.c)(93),{_:t}=s(),n=Ze(),{projectConfig:r,projectLocalConfig:i,projectLocalSynced:a,projectSynced:c}=an(),l=Xe(),u=Ye(),d;e[0]===i?.autoSync?d=e[1]:(d=Ce(i?.autoSync)??`off`,e[0]=i?.autoSync,e[1]=d);let f=d,{confirmOpen:p,setConfirmOpen:m,pendingMode:h,onModeSelect:g,onConfirm:_}=Qe(l,f),[v,y]=(0,Q.useState)(!1),[b,O]=(0,Q.useState)(!1);if(n&&!n.hasRemote&&n.state===`dormant`){let t;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`h3`,{id:`settings-sync-title`,className:`text-base font-semibold`,children:(0,$.jsx)(o,{id:`Nu4DdT`})}),e[2]=t):t=e[2];let n;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[t,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`AiNMQ7`})})]}),e[3]=n):n=e[3];let r;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(o,{id:`3_6U6f`})}),e[4]=r):r=e[4];let i;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(o,{id:`i92eAT`})})]}),e[5]=i):i=e[5];let a;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>y(!0),e[6]=a):a=e[6];let s;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border p-3`,children:[i,(0,$.jsx)(x,{onClick:a,"data-testid":`settings-sync-setup`,children:(0,$.jsx)(o,{id:`zkz0Fg`})})]}),e[7]=s):s=e[7];let c;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(E,{asChild:!0,children:(0,$.jsxs)(x,{variant:`ghost`,size:`sm`,className:`group gap-1 px-1.5 text-muted-foreground`,children:[(0,$.jsx)(rt,{className:`size-3.5 transition-transform group-data-[state=open]:rotate-90`,"aria-hidden":!0}),(0,$.jsx)(o,{id:`6caB2T`})]})}),e[8]=c):c=e[8];let l;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsxs)(D,{children:[c,(0,$.jsx)(T,{className:`px-1.5 pt-2 text-sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`44DSl0`,components:{0:(0,$.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})})]}),e[9]=l):l=e[9];let u;return e[10]===v?u=e[11]:(u=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-sync-title`,className:`space-y-4`,"data-testid":`settings-sync-empty`,children:[n,s,l,(0,$.jsx)(gt,{open:v,onOpenChange:y})]}),e[10]=v,e[11]=u),u}let k=!a,A=n?.pushPermission?.checkStatus===`denied`||n?.pausedReason===`no-push-permission`,j=n?.pushPermission,M;e[12]===j?M=e[13]:(M=kt(j),e[12]=j,e[13]=M);let N=M,P=f===`full`&&A&&N,F=f===`full`&&A&&!N,I=n?.pushPermission?.checkStatus===`denied`&&n.pushPermission.deniedReason!==`not-authenticated`,L;e[14]!==A||e[15]!==F||e[16]!==n?(L=F||A||!n?.pausedReason?null:ht(n.pausedReason),e[14]=A,e[15]=F,e[16]=n,e[17]=L):L=e[17];let R=L,z;e[18]===g?z=e[19]:(z=function(e){Ae(e)&&g(e)},e[18]=g,e[19]=z);let B=z,V;e[20]===r?.autoSync?.default?V=e[21]:(V=Be(r?.autoSync?.default)??`ask`,e[20]=r?.autoSync?.default,e[21]=V);let H=V,ee;e[22]!==t||e[23]!==u?(ee=function(e){if(e!==`ask`&&!Ae(e))return;if(u===null){X.error(t({id:`fiMNLl`}));return}let n;bb110:switch(e){case`ask`:n=null;break bb110;case`off`:n=!1;break bb110;case`full`:n=!0;break bb110;case`follow`:n=`follow`;break bb110;default:throw Error(`unhandled committed default: ${String(e)}`)}let r=u(n);if(!r.ok){let e=r.error;X.error(t({id:`oAFVKX`,values:{detail:e}}))}},e[22]=t,e[23]=u,e[24]=ee):ee=e[24];let U=ee,te;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)(`h3`,{id:`settings-sync-title`,className:`text-base font-semibold`,children:(0,$.jsx)(o,{id:`Nu4DdT`})}),e[25]=te):te=e[25];let ne;e[26]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[te,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(o,{id:`-f2Ogn`})})]}),e[26]=ne):ne=e[26];let re;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsx)(`div`,{id:`settings-sync-mode-label`,className:`text-sm font-medium`,children:(0,$.jsx)(o,{id:`yZepkk`})}),e[27]=re):re=e[27];let W;e[28]===f?W=e[29]:(W=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,"data-testid":`settings-sync-body`,children:f===`full`?(0,$.jsx)(o,{id:`hxYFzm`}):f===`follow`?(0,$.jsx)(o,{id:`-imiMK`}):(0,$.jsx)(o,{id:`UVDasf`})}),e[28]=f,e[29]=W);let ie;e[30]!==t||e[31]!==n?(ie=n?.remote?(0,$.jsxs)(`p`,{className:`text-muted-foreground text-1sm truncate`,"data-testid":`settings-sync-remote`,children:[(0,$.jsx)(o,{id:`Q8A-U_`}),` `,n.remote.webUrl?(0,$.jsxs)(`a`,{href:n.remote.webUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-foreground hover:text-primary hover:underline inline-flex items-center gap-0.5`,"aria-label":t({id:`1nke1r`,values:{0:n.remote.label}}),"data-testid":`settings-sync-remote-link`,children:[(0,$.jsx)(`span`,{children:n.remote.label}),(0,$.jsx)(et,{className:`inline size-3.5`,"aria-hidden":!0})]}):(0,$.jsx)(`span`,{className:`font-medium text-foreground`,"data-testid":`settings-sync-remote-label`,children:n.remote.label})]}):null,e[30]=t,e[31]=n,e[32]=ie):ie=e[32];let G;e[33]!==W||e[34]!==ie?(G=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[re,W,ie]}),e[33]=W,e[34]=ie,e[35]=G):G=e[35];let K;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,$.jsx)(q,{value:`off`,className:Qa,"data-testid":`settings-sync-mode-off`,children:(0,$.jsx)(o,{id:`az8lvo`})}),e[36]=K):K=e[36];let J;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,$.jsx)(q,{value:`follow`,className:Qa,"data-testid":`settings-sync-mode-follow`,children:(0,$.jsx)(o,{id:`MKEPCY`})}),e[37]=J):J=e[37];let oe;e[38]===I?oe=e[39]:(oe=I?(0,$.jsxs)(w,{children:[(0,$.jsx)(S,{asChild:!0,children:(0,$.jsx)(`span`,{className:`inline-flex`,children:(0,$.jsx)(q,{value:`full`,className:Qa,disabled:!0,"data-testid":`settings-sync-mode-full`,children:(0,$.jsx)(o,{id:`g2Tj8R`})})})}),(0,$.jsx)(C,{"data-testid":`settings-sync-mode-full-tip`,children:(0,$.jsx)(o,{id:`ChAtFg`})})]}):(0,$.jsx)(q,{value:`full`,className:Qa,"data-testid":`settings-sync-mode-full`,children:(0,$.jsx)(o,{id:`g2Tj8R`})}),e[38]=I,e[39]=oe);let se;e[40]!==f||e[41]!==k||e[42]!==B||e[43]!==oe?(se=(0,$.jsxs)(ae,{type:`single`,variant:`outline`,spacing:2,value:f,onValueChange:B,disabled:k,"aria-labelledby":`settings-sync-mode-label`,"data-testid":`settings-sync-mode-toggle`,children:[K,J,oe]}),e[40]=f,e[41]=k,e[42]=B,e[43]=oe,e[44]=se):se=e[44];let Y;e[45]!==G||e[46]!==se?(Y=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[G,se]}),e[45]=G,e[46]=se,e[47]=Y):Y=e[47];let ce;e[48]===P?ce=e[49]:(ce=P&&(0,$.jsxs)(`div`,{className:`mt-2 flex items-start gap-2`,"data-testid":`settings-sync-reconnect`,children:[(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground flex-1 min-w-0`,children:(0,$.jsx)(o,{id:`tnG-m6`})}),(0,$.jsx)(x,{variant:`outline`,size:`xs`,className:`self-start`,onClick:()=>O(!0),children:(0,$.jsx)(o,{id:`5lWFkC`})})]}),e[48]=P,e[49]=ce);let le;e[50]!==g||e[51]!==F?(le=F&&(0,$.jsxs)(`div`,{className:`mt-2 flex items-start gap-2`,"data-testid":`settings-sync-switch-follow`,children:[(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground flex-1 min-w-0`,children:(0,$.jsx)(o,{id:`ajHi4O`})}),(0,$.jsx)(x,{variant:`outline`,size:`xs`,className:`self-start`,onClick:()=>g(`follow`),"data-testid":`settings-sync-switch-follow-action`,children:(0,$.jsx)(o,{id:`i6ng22`})})]}),e[50]=g,e[51]=F,e[52]=le):le=e[52];let ue;e[53]!==A||e[54]!==f||e[55]!==P||e[56]!==F?(ue=!F&&!P&&A&&f!==`follow`&&(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground mt-2`,"data-testid":`settings-sync-denied-hint`,children:(0,$.jsx)(o,{id:`uUiiyC`})}),e[53]=A,e[54]=f,e[55]=P,e[56]=F,e[57]=ue):ue=e[57];let de;e[58]===R?de=e[59]:(de=R!==null&&(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground mt-2`,"data-testid":`settings-sync-reason`,children:R}),e[58]=R,e[59]=de);let fe;e[60]===n?.pushPermission?fe=e[61]:(fe=At(n?.pushPermission)&&(0,$.jsxs)(`div`,{className:`mt-2 flex items-start gap-2`,"data-testid":`settings-sync-signin-again`,children:[(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground flex-1 min-w-0`,children:(0,$.jsx)(o,{id:`C_cPoW`})}),(0,$.jsx)(x,{variant:`outline`,size:`xs`,className:`self-start`,onClick:()=>O(!0),children:(0,$.jsx)(o,{id:`5lWFkC`})})]}),e[60]=n?.pushPermission,e[61]=fe);let pe;e[62]!==Y||e[63]!==ce||e[64]!==le||e[65]!==ue||e[66]!==de||e[67]!==fe?(pe=(0,$.jsxs)(`div`,{className:`rounded-md border p-3`,children:[Y,ce,le,ue,de,fe]}),e[62]=Y,e[63]=ce,e[64]=le,e[65]=ue,e[66]=de,e[67]=fe,e[68]=pe):pe=e[68];let me;e[69]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,$.jsx)(`div`,{id:`settings-sync-default-label`,className:`text-sm font-medium`,children:(0,$.jsx)(o,{id:`j_Z6g7`})}),e[69]=me):me=e[69];let he;e[70]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[me,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(o,{id:`msuDyW`})})]}),e[70]=he):he=e[70];let ge=!c,_e;e[71]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,$.jsx)(q,{value:`ask`,className:Qa,"data-testid":`settings-sync-default-ask`,children:(0,$.jsx)(o,{id:`EdQY6l`})}),e[71]=_e):_e=e[71];let ve;e[72]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,$.jsx)(q,{value:`off`,className:Qa,"data-testid":`settings-sync-default-off`,children:(0,$.jsx)(o,{id:`az8lvo`})}),e[72]=ve):ve=e[72];let ye;e[73]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,$.jsx)(q,{value:`follow`,className:Qa,"data-testid":`settings-sync-default-follow`,children:(0,$.jsx)(o,{id:`MKEPCY`})}),e[73]=ye):ye=e[73];let be;e[74]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,$.jsx)(q,{value:`full`,className:Qa,"data-testid":`settings-sync-default-full`,children:(0,$.jsx)(o,{id:`g2Tj8R`})}),e[74]=be):be=e[74];let xe;e[75]!==H||e[76]!==U||e[77]!==ge?(xe=(0,$.jsxs)(`div`,{className:`rounded-md border p-3 space-y-2`,"data-testid":`settings-sync-default`,children:[he,(0,$.jsxs)(ae,{type:`single`,variant:`outline`,spacing:2,value:H,onValueChange:U,disabled:ge,"aria-labelledby":`settings-sync-default-label`,"data-testid":`settings-sync-default-toggle`,children:[_e,ve,ye,be]})]}),e[75]=H,e[76]=U,e[77]=ge,e[78]=xe):xe=e[78];let Se=h??`full`,we=h===`follow`?n?.ahead??0:0,Te;e[79]!==p||e[80]!==_||e[81]!==m||e[82]!==Se||e[83]!==we?(Te=(0,$.jsx)($e,{open:p,onOpenChange:m,onConfirm:_,variant:Se,strandedCommitCount:we}),e[79]=p,e[80]=_,e[81]=m,e[82]=Se,e[83]=we,e[84]=Te):Te=e[84];let Ee;e[85]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=()=>O(!1),e[85]=Ee):Ee=e[85];let De;e[86]===b?De=e[87]:(De=(0,$.jsx)(ct,{open:b,onOpenChange:O,onSuccess:Ee,reauth:!0}),e[86]=b,e[87]=De);let Oe;return e[88]!==pe||e[89]!==xe||e[90]!==Te||e[91]!==De?(Oe=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-sync-title`,className:`space-y-3`,children:[ne,pe,xe,Te,De]}),e[88]=pe,e[89]=xe,e[90]=Te,e[91]=De,e[92]=Oe):Oe=e[92],Oe}function eo(e){let t=(0,Z.c)(15),{title:n,description:r,scope:i,binding:a,fields:o,scopeBadge:s}=e,{form:c,commitField:l}=Tr(a),[u,d]=(0,Q.useState)(null),f=(0,Q.useRef)(null),p,m;t[0]!==c||t[1]!==i?(p=()=>{let e=i===`project`?Ie:Ve,t=xt(t=>{if(t.docName!==e)return;X.error(qe(t.error),{duration:8e3});let n=_r(t.error);n&&(c.setError(n,{type:`config-validation-rejected`,message:Or(t.error,n)}),c.setFocus(n),d(n),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{d(null),c.clearErrors(n)},600))});return()=>{t(),f.current&&clearTimeout(f.current)}},m=[i,c],t[0]=c,t[1]=i,t[2]=p,t[3]=m):(p=t[2],m=t[3]),(0,Q.useEffect)(p,m);let h;t[4]!==l||t[5]!==r||t[6]!==o||t[7]!==u||t[8]!==i||t[9]!==s||t[10]!==n?(h=(0,$.jsx)(to,{title:n,description:r,scope:i,scopeBadge:s,fields:o,commitField:l,flashedPath:u}),t[4]=l,t[5]=r,t[6]=o,t[7]=u,t[8]=i,t[9]=s,t[10]=n,t[11]=h):h=t[11];let g;return t[12]!==c||t[13]!==h?(g=(0,$.jsx)(zn,{...c,children:h}),t[12]=c,t[13]=h,t[14]=g):g=t[14],g}function to(e){let t=(0,Z.c)(28),{title:n,description:r,scope:i,scopeBadge:a,fields:o,commitField:s,flashedPath:c}=e,l=`settings-section-${i}-title`,u;t[0]!==n||t[1]!==l?(u=(0,$.jsx)(`h3`,{id:l,className:`text-base font-semibold`,children:n}),t[0]=n,t[1]=l,t[2]=u):u=t[2];let d;t[3]===a?d=t[4]:(d=a?(0,$.jsx)(si,{scope:a}):null,t[3]=a,t[4]=d);let f;t[5]!==u||t[6]!==d?(f=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[u,d]}),t[5]=u,t[6]=d,t[7]=f):f=t[7];let p;t[8]===r?p=t[9]:(p=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r}),t[8]=r,t[9]=p);let m;t[10]!==f||t[11]!==p?(m=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[f,p]}),t[10]=f,t[11]=p,t[12]=m):m=t[12];let h;if(t[13]!==s||t[14]!==o||t[15]!==c||t[16]!==i){let e;t[18]!==s||t[19]!==c||t[20]!==i?(e=e=>(0,$.jsx)(yr,{field:e,scope:i,commitField:s,isFlashed:c===e.path.join(`.`)},e.path.join(`.`)),t[18]=s,t[19]=c,t[20]=i,t[21]=e):e=t[21],h=o.map(e),t[13]=s,t[14]=o,t[15]=c,t[16]=i,t[17]=h}else h=t[17];let g;t[22]===h?g=t[23]:(g=(0,$.jsx)(`div`,{className:`space-y-10`,children:h}),t[22]=h,t[23]=g);let _;return t[24]!==m||t[25]!==g||t[26]!==l?(_=(0,$.jsxs)(`section`,{"aria-labelledby":l,className:`space-y-3`,children:[m,g]}),t[24]=m,t[25]=g,t[26]=l,t[27]=_):_=t[27],_}function no(){let e=(0,Z.c)(71),{_:t}=s(),{enabled:n,synced:r}=Gn(),i=Wn(),a=n!==!1,{userConfig:o,userBinding:c,userSynced:l}=an(),u=o?.agents?.autoApproveOkTools!==!1,[d,f]=(0,Q.useState)(!1),p,m;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>{let e=window.okDesktop;if(!e)return;let t=!1;return e.terminal.cliPreflight(`codex`).then(e=>{t||f(e.onPath===`present`&&e.okServerConfigured!==!0)}).catch(ro),()=>{t=!0}},m=[],e[0]=p,e[1]=m):(p=e[0],m=e[1]),(0,Q.useEffect)(p,m);let h;e[2]!==t||e[3]!==i?(h=function(e){if(i===null){X.error(t({id:`w6sBjd`}));return}let n=i(e);n.ok||X.error(t(e?{id:`jKd3AP`,values:{0:n.error}}:{id:`pajIrl`,values:{0:n.error}}))},e[2]=t,e[3]=i,e[4]=h):h=e[4];let g=h,_;e[5]!==t||e[6]!==c?(_=function(e){if(c===null){X.error(t({id:`fnlBN4`}));return}let n=c.patch({agents:{autoApproveOkTools:e}});if(!n.ok){let e=qe(n.error);X.error(t({id:`habOU_`,values:{detail:e}}))}},e[5]=t,e[6]=c,e[7]=_):_=e[7];let v=_,y;e[8]===t?y=e[9]:(y=t({id:`ALhMYW`}),e[8]=t,e[9]=y);let b;e[10]===y?b=e[11]:(b=(0,$.jsx)(`h3`,{id:`settings-terminal-title`,className:`text-base font-semibold`,children:y}),e[10]=y,e[11]=b);let x;e[12]===t?x=e[13]:(x=t({id:`FCAcjR`}),e[12]=t,e[13]=x);let S;e[14]===x?S=e[15]:(S=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:x}),e[14]=x,e[15]=S);let C;e[16]!==b||e[17]!==S?(C=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[b,S]}),e[16]=b,e[17]=S,e[18]=C):C=e[18];let w;e[19]===t?w=e[20]:(w=t({id:`E4XYYH`}),e[19]=t,e[20]=w);let T;e[21]===w?T=e[22]:(T=(0,$.jsx)(`label`,{htmlFor:`settings-terminal-toggle`,className:`text-sm font-medium`,children:w}),e[21]=w,e[22]=T);let E;e[23]!==t||e[24]!==a?(E=t(a?{id:`AQGtjK`}:{id:`R65q-K`}),e[23]=t,e[24]=a,e[25]=E):E=e[25];let D;e[26]===E?D=e[27]:(D=(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-terminal-body`,children:E}),e[26]=E,e[27]=D);let O;e[28]!==T||e[29]!==D?(O=(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[T,D]}),e[28]=T,e[29]=D,e[30]=O):O=e[30];let k=!r||i===null,A;e[31]===t?A=e[32]:(A=t({id:`E4XYYH`}),e[31]=t,e[32]=A);let j;e[33]!==g||e[34]!==a||e[35]!==k||e[36]!==A?(j=(0,$.jsx)(K,{id:`settings-terminal-toggle`,checked:a,onCheckedChange:g,disabled:k,"aria-label":A,"data-testid":`settings-terminal-toggle`}),e[33]=g,e[34]=a,e[35]=k,e[36]=A,e[37]=j):j=e[37];let M;e[38]!==O||e[39]!==j?(M=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border p-3`,children:[O,j]}),e[38]=O,e[39]=j,e[40]=M):M=e[40];let N;e[41]===t?N=e[42]:(N=t({id:`ilodsp`}),e[41]=t,e[42]=N);let P;e[43]===N?P=e[44]:(P=(0,$.jsx)(`label`,{htmlFor:`settings-terminal-autoapprove-toggle`,className:`text-sm font-medium`,children:N}),e[43]=N,e[44]=P);let F;e[45]===t?F=e[46]:(F=t({id:`jENU1Q`}),e[45]=t,e[46]=F);let I;e[47]===F?I=e[48]:(I=(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-terminal-autoapprove-body`,children:F}),e[47]=F,e[48]=I);let L;e[49]!==t||e[50]!==u||e[51]!==d?(L=u&&d?(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-terminal-autoapprove-codex-note`,children:t({id:`Kr3VPS`})}):null,e[49]=t,e[50]=u,e[51]=d,e[52]=L):L=e[52];let R;e[53]!==P||e[54]!==I||e[55]!==L?(R=(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[P,I,L]}),e[53]=P,e[54]=I,e[55]=L,e[56]=R):R=e[56];let z=!l||c===null,B;e[57]===t?B=e[58]:(B=t({id:`ilodsp`}),e[57]=t,e[58]=B);let V;e[59]!==v||e[60]!==u||e[61]!==z||e[62]!==B?(V=(0,$.jsx)(K,{id:`settings-terminal-autoapprove-toggle`,checked:u,onCheckedChange:v,disabled:z,"aria-label":B,"data-testid":`settings-terminal-autoapprove-toggle`}),e[59]=v,e[60]=u,e[61]=z,e[62]=B,e[63]=V):V=e[63];let H;e[64]!==R||e[65]!==V?(H=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border p-3`,children:[R,V]}),e[64]=R,e[65]=V,e[66]=H):H=e[66];let ee;return e[67]!==M||e[68]!==H||e[69]!==C?(ee=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-terminal-title`,className:`space-y-3`,children:[C,M,H]}),e[67]=M,e[68]=H,e[69]=C,e[70]=ee):ee=e[70],ee}function ro(){}function io(e){let t=(0,Z.c)(14),{slot:n,active:r,className:i,style:a,children:o}=e,s=r===n,c=s?`true`:void 0,l=s&&`ring-2 ring-offset-1`,u;t[0]!==i||t[1]!==l?(u=h(`rounded-[2px] transition-shadow`,l,i),t[0]=i,t[1]=l,t[2]=u):u=t[2];let d;t[3]===s?d=t[4]:(d=s?{boxShadow:`0 0 0 2px currentColor`}:null,t[3]=s,t[4]=d);let f;t[5]!==a||t[6]!==d?(f={...a,...d},t[5]=a,t[6]=d,t[7]=f):f=t[7];let p;return t[8]!==o||t[9]!==n||t[10]!==c||t[11]!==u||t[12]!==f?(p=(0,$.jsx)(`span`,{"data-slot":n,"data-lit":c,className:u,style:f,children:o}),t[8]=o,t[9]=n,t[10]=c,t[11]=u,t[12]=f,t[13]=p):p=t[13],p}function ao(e){let t=(0,Z.c)(198),{scheme:n,highlightSlot:r,className:i}=e,{_:a}=s(),o=n.palette,c;t[0]===n?c=t[1]:(c=Fe(n),t[0]=n,t[1]=c);let l=c,u=r??null,d;t[2]===a?d=t[3]:(d=a({id:`V6e25h`}),t[2]=a,t[3]=d);let f;t[4]===i?f=t[5]:(f=h(`overflow-hidden rounded-lg border text-[9px] leading-[1.5] select-none`,i),t[4]=i,t[5]=f);let p;t[6]!==o.base00||t[7]!==o.base02||t[8]!==o.base05?(p={backgroundColor:o.base00,color:o.base05,borderColor:o.base02},t[6]=o.base00,t[7]=o.base02,t[8]=o.base05,t[9]=p):p=t[9];let m=`1px solid ${o.base02}`,g;t[10]!==o.base01||t[11]!==m?(g={backgroundColor:o.base01,borderBottom:m},t[10]=o.base01,t[11]=m,t[12]=g):g=t[12];let _;t[13]!==o.base00||t[14]!==o.base0D?(_={backgroundColor:o.base0D,color:o.base00},t[13]=o.base00,t[14]=o.base0D,t[15]=_):_=t[15];let v;t[16]===a?v=t[17]:(v=a({id:`tfDRzk`}),t[16]=a,t[17]=v);let y;t[18]!==_||t[19]!==v?(y=(0,$.jsx)(`span`,{className:`inline-block rounded-full px-1.5 py-[1px] font-medium`,style:_,children:v}),t[18]=_,t[19]=v,t[20]=y):y=t[20];let b;t[21]!==u||t[22]!==y?(b=(0,$.jsx)(io,{slot:`base0D`,active:u,children:y}),t[21]=u,t[22]=y,t[23]=b):b=t[23];let x;t[24]===o.base04?x=t[25]:(x=(0,$.jsx)(`span`,{style:{color:o.base04},children:`notes / release-plan.md`}),t[24]=o.base04,t[25]=x);let S;t[26]!==u||t[27]!==x?(S=(0,$.jsx)(io,{slot:`base04`,active:u,className:`flex-1 truncate`,children:x}),t[26]=u,t[27]=x,t[28]=S):S=t[28];let C;t[29]!==b||t[30]!==S||t[31]!==g?(C=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-1.5`,style:g,children:[b,S]}),t[29]=b,t[30]=S,t[31]=g,t[32]=C):C=t[32];let w=`1px solid ${o.base02}`,T;t[33]!==o.base01||t[34]!==w?(T={backgroundColor:o.base01,borderRight:w},t[33]=o.base01,t[34]=w,t[35]=T):T=t[35];let E;t[36]===o.base02?E=t[37]:(E={backgroundColor:o.base02},t[36]=o.base02,t[37]=E);let D;t[38]===o.base05?D=t[39]:(D=(0,$.jsx)(`span`,{style:{color:o.base05},children:`release-plan`}),t[38]=o.base05,t[39]=D);let O;t[40]!==u||t[41]!==E||t[42]!==D?(O=(0,$.jsx)(io,{slot:`base02`,active:u,className:`block rounded px-1 py-[1px]`,style:E,children:D}),t[40]=u,t[41]=E,t[42]=D,t[43]=O):O=t[43];let k;t[44]===o.base04?k=t[45]:(k=(0,$.jsx)(`span`,{style:{color:o.base04},children:`backlog`}),t[44]=o.base04,t[45]=k);let A;t[46]!==u||t[47]!==k?(A=(0,$.jsx)(io,{slot:`base04`,active:u,className:`block px-1`,children:k}),t[46]=u,t[47]=k,t[48]=A):A=t[48];let j;t[49]===o.base04?j=t[50]:(j=(0,$.jsx)(`span`,{style:{color:o.base04},children:`archive`}),t[49]=o.base04,t[50]=j);let M;t[51]!==u||t[52]!==j?(M=(0,$.jsx)(io,{slot:`base04`,active:u,className:`block px-1`,children:j}),t[51]=u,t[52]=j,t[53]=M):M=t[53];let N;t[54]!==T||t[55]!==O||t[56]!==A||t[57]!==M?(N=(0,$.jsxs)(`div`,{className:`w-[26%] shrink-0 space-y-[3px] p-1.5`,style:T,children:[O,A,M]}),t[54]=T,t[55]=O,t[56]=A,t[57]=M,t[58]=N):N=t[58];let P=l[`syntax-func`],F;t[59]===P?F=t[60]:(F={color:P},t[59]=P,t[60]=F);let I;t[61]===a?I=t[62]:(I=a({id:`gayL_Q`}),t[61]=a,t[62]=I);let L;t[63]!==F||t[64]!==I?(L=(0,$.jsx)(`span`,{style:F,children:I}),t[63]=F,t[64]=I,t[65]=L):L=t[65];let R;t[66]!==u||t[67]!==L?(R=(0,$.jsx)(io,{slot:`base0D`,active:u,className:`block font-semibold`,children:L}),t[66]=u,t[67]=L,t[68]=R):R=t[68];let z;t[69]===o.base05?z=t[70]:(z={color:o.base05},t[69]=o.base05,t[70]=z);let B;t[71]===a?B=t[72]:(B=a({id:`um-es7`}),t[71]=a,t[72]=B);let V;t[73]!==z||t[74]!==B?(V=(0,$.jsxs)(`span`,{style:z,children:[B,` `]}),t[73]=z,t[74]=B,t[75]=V):V=t[75];let H=l[`link-color`],ee;t[76]===H?ee=t[77]:(ee={color:H,textDecoration:`underline`},t[76]=H,t[77]=ee);let U;t[78]===a?U=t[79]:(U=a({id:`4sUdTJ`}),t[78]=a,t[79]=U);let te;t[80]!==ee||t[81]!==U?(te=(0,$.jsx)(`span`,{style:ee,children:U}),t[80]=ee,t[81]=U,t[82]=te):te=t[82];let ne;t[83]!==u||t[84]!==te?(ne=(0,$.jsx)(io,{slot:`base0D`,active:u,children:te}),t[83]=u,t[84]=te,t[85]=ne):ne=t[85];let re;t[86]===o.base05?re=t[87]:(re=(0,$.jsx)(`span`,{style:{color:o.base05},children:`.`}),t[86]=o.base05,t[87]=re);let W;t[88]!==V||t[89]!==ne||t[90]!==re?(W=(0,$.jsxs)(`div`,{className:`space-y-[2px]`,children:[V,ne,re]}),t[88]=V,t[89]=ne,t[90]=re,t[91]=W):W=t[91];let ie=`2px solid ${l[`callout-warning-color`]}`,G;t[92]!==o.base01||t[93]!==ie?(G={backgroundColor:o.base01,borderLeft:ie},t[92]=o.base01,t[93]=ie,t[94]=G):G=t[94];let K=l[`callout-warning-color`],q;t[95]===K?q=t[96]:(q={color:K},t[95]=K,t[96]=q);let ae;t[97]===a?ae=t[98]:(ae=a({id:`r6y-jM`}),t[97]=a,t[98]=ae);let J;t[99]!==q||t[100]!==ae?(J=(0,$.jsx)(`span`,{style:q,className:`font-medium`,children:ae}),t[99]=q,t[100]=ae,t[101]=J):J=t[101];let oe;t[102]!==u||t[103]!==G||t[104]!==J?(oe=(0,$.jsx)(io,{slot:`base0A`,active:u,className:`block rounded px-1.5 py-1`,style:G,children:J}),t[102]=u,t[103]=G,t[104]=J,t[105]=oe):oe=t[105];let se=l[`syntax-bg`],Y;t[106]===se?Y=t[107]:(Y={backgroundColor:se},t[106]=se,t[107]=Y);let ce=l[`syntax-keyword`],le;t[108]===ce?le=t[109]:(le=(0,$.jsx)(`span`,{style:{color:ce},children:`const`}),t[108]=ce,t[109]=le);let ue;t[110]!==u||t[111]!==le?(ue=(0,$.jsx)(io,{slot:`base0E`,active:u,children:le}),t[110]=u,t[111]=le,t[112]=ue):ue=t[112];let de=l[`syntax-var`],fe;t[113]===de?fe=t[114]:(fe=(0,$.jsx)(`span`,{style:{color:de},children:`retries`}),t[113]=de,t[114]=fe);let pe;t[115]!==u||t[116]!==fe?(pe=(0,$.jsx)(io,{slot:`base08`,active:u,children:fe}),t[115]=u,t[116]=fe,t[117]=pe):pe=t[117];let me=l[`syntax-operator`],he;t[118]===me?he=t[119]:(he=(0,$.jsx)(`span`,{style:{color:me},children:` = `}),t[118]=me,t[119]=he);let ge=l[`syntax-number`],_e;t[120]===ge?_e=t[121]:(_e=(0,$.jsx)(`span`,{style:{color:ge},children:`3`}),t[120]=ge,t[121]=_e);let ve;t[122]!==u||t[123]!==_e?(ve=(0,$.jsx)(io,{slot:`base09`,active:u,children:_e}),t[122]=u,t[123]=_e,t[124]=ve):ve=t[124];let ye;t[125]!==ue||t[126]!==pe||t[127]!==he||t[128]!==ve?(ye=(0,$.jsxs)(`div`,{children:[ue,` `,pe,he,ve]}),t[125]=ue,t[126]=pe,t[127]=he,t[128]=ve,t[129]=ye):ye=t[129];let be=l[`syntax-string`],xe;t[130]===be?xe=t[131]:(xe=(0,$.jsx)(`span`,{style:{color:be},children:`"ready"`}),t[130]=be,t[131]=xe);let Se;t[132]!==u||t[133]!==xe?(Se=(0,$.jsx)(io,{slot:`base0B`,active:u,children:xe}),t[132]=u,t[133]=xe,t[134]=Se):Se=t[134];let Ce=l[`syntax-comment`],we;t[135]===Ce?we=t[136]:(we={color:Ce,fontStyle:`italic`},t[135]=Ce,t[136]=we);let Te;t[137]===a?Te=t[138]:(Te=a({id:`g9Nj4l`}),t[137]=a,t[138]=Te);let Ee;t[139]!==we||t[140]!==Te?(Ee=(0,$.jsx)(`span`,{style:we,children:Te}),t[139]=we,t[140]=Te,t[141]=Ee):Ee=t[141];let De;t[142]!==u||t[143]!==Ee?(De=(0,$.jsx)(io,{slot:`base03`,active:u,children:Ee}),t[142]=u,t[143]=Ee,t[144]=De):De=t[144];let Oe;t[145]!==Se||t[146]!==De?(Oe=(0,$.jsxs)(`div`,{children:[Se,` `,De]}),t[145]=Se,t[146]=De,t[147]=Oe):Oe=t[147];let ke;t[148]!==Y||t[149]!==ye||t[150]!==Oe?(ke=(0,$.jsxs)(`div`,{className:`rounded px-1.5 py-1 font-mono`,style:Y,children:[ye,Oe]}),t[148]=Y,t[149]=ye,t[150]=Oe,t[151]=ke):ke=t[151];let Ae=`1px solid ${o.base02}`,je;t[152]!==o.base00||t[153]!==Ae?(je={backgroundColor:o.base00,border:Ae},t[152]=o.base00,t[153]=Ae,t[154]=je):je=t[154];let Me;t[155]===o.base04?Me=t[156]:(Me=(0,$.jsx)(`span`,{style:{color:o.base04},children:`$`}),t[155]=o.base04,t[156]=Me);let Ne=l[`ansi-red`],Pe;t[157]===Ne?Pe=t[158]:(Pe=[`base08`,Ne],t[157]=Ne,t[158]=Pe);let Ie=l[`ansi-yellow`],Le;t[159]===Ie?Le=t[160]:(Le=[`base0A`,Ie],t[159]=Ie,t[160]=Le);let Re=l[`ansi-green`],ze;t[161]===Re?ze=t[162]:(ze=[`base0B`,Re],t[161]=Re,t[162]=ze);let Be=l[`ansi-cyan`],Ve;t[163]===Be?Ve=t[164]:(Ve=[`base0C`,Be],t[163]=Be,t[164]=Ve);let He=l[`ansi-blue`],Ue;t[165]===He?Ue=t[166]:(Ue=[`base0D`,He],t[165]=He,t[166]=Ue);let We=l[`ansi-magenta`],Ge;t[167]===We?Ge=t[168]:(Ge=[`base0E`,We],t[167]=We,t[168]=Ge);let Ke;t[169]!==Pe||t[170]!==Le||t[171]!==ze||t[172]!==Ve||t[173]!==Ue||t[174]!==Ge?(Ke=[Pe,Le,ze,Ve,Ue,Ge],t[169]=Pe,t[170]=Le,t[171]=ze,t[172]=Ve,t[173]=Ue,t[174]=Ge,t[175]=Ke):Ke=t[175];let qe=Ke,Je;t[176]!==u||t[177]!==qe?(Je=qe.map(e=>{let[t,n]=e;return(0,$.jsx)(io,{slot:t,active:u,children:(0,$.jsx)(`span`,{className:`inline-block size-1.5 rounded-[1px]`,style:{backgroundColor:n}})},t)}),t[176]=u,t[177]=qe,t[178]=Je):Je=t[178];let Ye;t[179]!==je||t[180]!==Me||t[181]!==Je?(Ye=(0,$.jsxs)(`div`,{className:`flex items-center gap-1 rounded px-1.5 py-1 font-mono`,style:je,children:[Me,Je]}),t[179]=je,t[180]=Me,t[181]=Je,t[182]=Ye):Ye=t[182];let Xe;t[183]!==R||t[184]!==W||t[185]!==oe||t[186]!==ke||t[187]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5 p-2`,children:[R,W,oe,ke,Ye]}),t[183]=R,t[184]=W,t[185]=oe,t[186]=ke,t[187]=Ye,t[188]=Xe):Xe=t[188];let Ze;t[189]!==N||t[190]!==Xe?(Ze=(0,$.jsxs)(`div`,{className:`flex`,children:[N,Xe]}),t[189]=N,t[190]=Xe,t[191]=Ze):Ze=t[191];let Qe;return t[192]!==C||t[193]!==d||t[194]!==f||t[195]!==p||t[196]!==Ze?(Qe=(0,$.jsxs)(`div`,{"aria-label":d,role:`img`,className:f,style:p,children:[C,Ze]}),t[192]=C,t[193]=d,t[194]=f,t[195]=p,t[196]=Ze,t[197]=Qe):Qe=t[197],Qe}var oo=je.slice(0,8),so=je.slice(8),co=`https://github.com/tinted-theming/schemes`;function lo(e){let t=(0,Z.c)(133),{userBinding:n}=e,{_:r}=s(),{setTheme:i}=l(),a=sn()?.merged??null,o=a?.appearance?.customTheme,c;t[0]===o?c=t[1]:(c=on(o),t[0]=o,t[1]=c);let u=c,d=a?.appearance?.colorTheme===`custom`,[f,p]=(0,Q.useState)(u),m;t[2]===u?m=t[3]:(m=JSON.stringify(u),t[2]=u,t[3]=m);let h=m,g;t[4]===u?g=t[5]:(g=()=>{p(u)},t[4]=u,t[5]=g);let _;t[6]===h?_=t[7]:(_=[h],t[6]=h,t[7]=_),(0,Q.useEffect)(g,_);let[v,y]=(0,Q.useState)(``),[b,S]=(0,Q.useState)(null),[C,w]=(0,Q.useState)(null),T=a?.appearance?.customTheme,E;t[8]===T?E=t[9]:(E=tn(T),t[8]=T,t[9]=E);let D=E,O;t[10]!==d||t[11]!==i?(O=function(e){d&&($t(`custom`,rn(e)),i(en(e)===`dark`?`dark`:`light`))},t[10]=d,t[11]=i,t[12]=O):O=t[12];let k=O,A;t[13]!==k||t[14]!==f?(A=function(e,t){let n={...f,palette:{...f.palette,[e]:t}};p(n),nn(t)&&k(n)},t[13]=k,t[14]=f,t[15]=A):A=t[15];let j=A,M;t[16]!==D||t[17]!==f||t[18]!==n?(M=function(e,t){if(nn(t)){if(D){let r={...f,palette:{...f.palette,[e]:t}};n.patch({appearance:{customTheme:rn(r)}});return}n.patch({appearance:{customTheme:{[e]:t}}})}},t[16]=D,t[17]=f,t[18]=n,t[19]=M):M=t[19];let N=M,P;t[20]!==r||t[21]!==v||t[22]!==k||t[23]!==n?(P=function(){let e=ze(v);if(!e.ok){S(mo(e.error,r));return}S(null),y(``),p(e.scheme),k(e.scheme),n.patch({appearance:{customTheme:rn(e.scheme)}})},t[20]=r,t[21]=v,t[22]=k,t[23]=n,t[24]=P):P=t[24];let F=P,I;t[25]!==r||t[26]!==f?(I=async function(){let e=Le(f),t=navigator.clipboard?.writeText?.bind(navigator.clipboard);if(t)try{await t(e),X.success(r({id:`bD2SLZ`}));return}catch{}y(e),S(null),X.error(r({id:`9j1tqo`}))},t[25]=r,t[26]=f,t[27]=I):I=t[27];let L=I,R;t[28]!==k||t[29]!==n?(R=function(){p(cn),S(null),k(cn),n.patch({appearance:{customTheme:rn(cn)}})},t[28]=k,t[29]=n,t[30]=R):R=t[30];let z=R,B;t[31]===r?B=t[32]:(B=r({id:`DcLaew`}),t[31]=r,t[32]=B);let H;t[33]===B?H=t[34]:(H=(0,$.jsx)(`h3`,{id:`settings-custom-theme-title`,className:`font-medium text-sm`,children:B}),t[33]=B,t[34]=H);let ee;t[35]!==r||t[36]!==d?(ee=r(d?{id:`Quz_Qu`}:{id:`h-Y9pw`}),t[35]=r,t[36]=d,t[37]=ee):ee=t[37];let U;t[38]===ee?U=t[39]:(U=(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:ee}),t[38]=ee,t[39]=U);let te;t[40]!==H||t[41]!==U?(te=(0,$.jsxs)(`div`,{children:[H,U]}),t[40]=H,t[41]=U,t[42]=te):te=t[42];let ne;t[43]===r?ne=t[44]:(ne=r({id:`aNb3JH`}),t[43]=r,t[44]=ne);let re;t[45]!==L||t[46]!==ne?(re=(0,$.jsx)(x,{variant:`outline`,size:`sm`,onClick:L,children:ne}),t[45]=L,t[46]=ne,t[47]=re):re=t[47];let W;t[48]===r?W=t[49]:(W=r({id:`OfhWJH`}),t[48]=r,t[49]=W);let ie;t[50]!==z||t[51]!==W?(ie=(0,$.jsx)(x,{variant:`ghost`,size:`sm`,onClick:z,className:`text-muted-foreground`,children:W}),t[50]=z,t[51]=W,t[52]=ie):ie=t[52];let G;t[53]!==re||t[54]!==ie?(G=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[re,ie]}),t[53]=re,t[54]=ie,t[55]=G):G=t[55];let K;t[56]!==te||t[57]!==G?(K=(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[te,G]}),t[56]=te,t[57]=G,t[58]=K):K=t[58];let q;t[59]!==C||t[60]!==f?(q=(0,$.jsx)(ao,{scheme:f,highlightSlot:C,className:`w-full`}),t[59]=C,t[60]=f,t[61]=q):q=t[61];let ae;t[62]===r?ae=t[63]:(ae=r({id:`sKMhJz`}),t[62]=r,t[63]=ae);let J,oe;t[64]===r?(J=t[65],oe=t[66]):(J=e=>r({id:`CMyafZ`,values:{slot:e}}),oe=r({id:`yR5LHI`}),t[64]=r,t[65]=J,t[66]=oe);let se;t[67]!==N||t[68]!==j||t[69]!==f||t[70]!==ae||t[71]!==J||t[72]!==oe?(se=(0,$.jsx)(po,{label:ae,slots:oo,scheme:f,onPick:j,commit:N,onSlotFocus:w,hexLabel:J,invalidHint:oe}),t[67]=N,t[68]=j,t[69]=f,t[70]=ae,t[71]=J,t[72]=oe,t[73]=se):se=t[73];let Y;t[74]===r?Y=t[75]:(Y=r({id:`gyWc8_`}),t[74]=r,t[75]=Y);let ce,le;t[76]===r?(ce=t[77],le=t[78]):(ce=e=>r({id:`CMyafZ`,values:{slot:e}}),le=r({id:`yR5LHI`}),t[76]=r,t[77]=ce,t[78]=le);let ue;t[79]!==N||t[80]!==j||t[81]!==f||t[82]!==Y||t[83]!==ce||t[84]!==le?(ue=(0,$.jsx)(po,{label:Y,slots:so,scheme:f,onPick:j,commit:N,onSlotFocus:w,hexLabel:ce,invalidHint:le}),t[79]=N,t[80]=j,t[81]=f,t[82]=Y,t[83]=ce,t[84]=le,t[85]=ue):ue=t[85];let de;t[86]!==se||t[87]!==ue?(de=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[se,ue]}),t[86]=se,t[87]=ue,t[88]=de):de=t[88];let fe;t[89]===r?fe=t[90]:(fe=r({id:`IbTC7z`}),t[89]=r,t[90]=fe);let pe;t[91]===fe?pe=t[92]:(pe=(0,$.jsx)(V,{htmlFor:`custom-theme-import`,className:`text-1sm text-muted-foreground`,children:fe}),t[91]=fe,t[92]=pe);let me=b!==null,he=b?`custom-theme-import-error`:void 0,ge;t[93]===b?ge=t[94]:(ge=e=>{y(e.target.value),b&&S(null)},t[93]=b,t[94]=ge);let _e;t[95]!==v||t[96]!==me||t[97]!==he||t[98]!==ge?(_e=(0,$.jsx)(dn,{id:`custom-theme-import`,value:v,spellCheck:!1,rows:3,placeholder:`system: "base16"
8
+ name: "Ayu Dark"
9
+ variant: "dark"
10
+ palette:
11
+ base00: "#0f1419"
12
+ base01: "#131721"`,"aria-invalid":me,"aria-describedby":he,onChange:ge,className:`font-mono text-1sm`,"data-testid":`custom-theme-import`}),t[95]=v,t[96]=me,t[97]=he,t[98]=ge,t[99]=_e):_e=t[99];let ve;t[100]===b?ve=t[101]:(ve=b?(0,$.jsx)(Ft,{id:`custom-theme-import-error`,"data-testid":`custom-theme-import-error`,children:b}):null,t[100]=b,t[101]=ve);let ye;t[102]===v?ye=t[103]:(ye=v.trim(),t[102]=v,t[103]=ye);let be=!ye,xe;t[104]===r?xe=t[105]:(xe=r({id:`7EmDc7`}),t[104]=r,t[105]=xe);let Se;t[106]!==F||t[107]!==be||t[108]!==xe?(Se=(0,$.jsx)(x,{variant:`outline`,size:`sm`,disabled:be,onClick:F,children:xe}),t[106]=F,t[107]=be,t[108]=xe,t[109]=Se):Se=t[109];let Ce;t[110]===r?Ce=t[111]:(Ce=r({id:`pfkaJ2`}),t[110]=r,t[111]=Ce);let we;t[112]===r?we=t[113]:(we=r({id:`UeQEbk`}),t[112]=r,t[113]=we);let Te;t[114]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,$.jsx)(et,{"aria-hidden":!0,className:`size-3`}),t[114]=Te):Te=t[114];let Ee;t[115]===we?Ee=t[116]:(Ee=(0,$.jsxs)(`a`,{href:co,target:`_blank`,rel:`noopener noreferrer`,onClick:fo,onAuxClick:uo,className:`inline-flex items-center gap-0.5 underline-offset-2 hover:text-foreground hover:underline`,children:[we,Te]}),t[115]=we,t[116]=Ee);let De;t[117]!==Ce||t[118]!==Ee?(De=(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[Ce,` `,Ee]}),t[117]=Ce,t[118]=Ee,t[119]=De):De=t[119];let Oe;t[120]!==Se||t[121]!==De?(Oe=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[Se,De]}),t[120]=Se,t[121]=De,t[122]=Oe):Oe=t[122];let ke;t[123]!==pe||t[124]!==_e||t[125]!==ve||t[126]!==Oe?(ke=(0,$.jsxs)(`div`,{className:`space-y-1.5 border-t pt-3`,children:[pe,_e,ve,Oe]}),t[123]=pe,t[124]=_e,t[125]=ve,t[126]=Oe,t[127]=ke):ke=t[127];let Ae;return t[128]!==K||t[129]!==q||t[130]!==de||t[131]!==ke?(Ae=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-custom-theme-title`,className:`space-y-3`,"data-section":`custom-theme`,children:[K,q,de,ke]}),t[128]=K,t[129]=q,t[130]=de,t[131]=ke,t[132]=Ae):Ae=t[132],Ae}function uo(e){return un(e,co)}function fo(e){return un(e,co)}function po(e){let t=(0,Z.c)(22),{label:n,slots:r,scheme:i,onPick:a,commit:o,hexLabel:s,invalidHint:c,onSlotFocus:l}=e,u;t[0]===n?u=t[1]:(u=(0,$.jsx)(`span`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:n}),t[0]=n,t[1]=u);let d;if(t[2]!==o||t[3]!==s||t[4]!==c||t[5]!==a||t[6]!==l||t[7]!==i||t[8]!==r){let e;t[10]!==o||t[11]!==s||t[12]!==c||t[13]!==a||t[14]!==l||t[15]!==i?(e=e=>{let t=i.palette[e],n=nn(t),r={onMouseEnter:()=>l(e),onMouseLeave:()=>l(null),onFocus:()=>l(e)};return(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded px-1 py-0.5`,children:[(0,$.jsx)(Vt,{type:`color`,"aria-label":`${e} — ${De[e]}`,value:n?t:`#000000`,onChange:t=>a(e,t.target.value),onBlur:t=>{l(null),o(e,t.target.value)},...r,className:`h-7 w-8 shrink-0 cursor-pointer rounded-md p-1`}),(0,$.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,$.jsxs)(V,{className:`block truncate text-[10px] leading-tight text-muted-foreground`,children:[(0,$.jsx)(`span`,{className:`font-mono`,children:e}),` `,(0,$.jsx)(`span`,{className:`opacity-80`,children:De[e]})]}),(0,$.jsx)(Vt,{value:t,spellCheck:!1,"aria-label":s(e),"aria-invalid":!n,"aria-describedby":n?void 0:`custom-theme-hex-error-${e}`,onChange:t=>a(e,t.target.value),onBlur:t=>{l(null),o(e,t.target.value)},onKeyDown:t=>{t.key===`Enter`&&o(e,t.target.value)},...r,className:`h-6 font-mono text-[11px] uppercase`}),n?null:(0,$.jsx)(Ft,{id:`custom-theme-hex-error-${e}`,className:`absolute top-full left-0 mt-0.5 text-xs leading-tight`,"data-testid":`custom-theme-hex-error-${e}`,children:c})]})]},e)},t[10]=o,t[11]=s,t[12]=c,t[13]=a,t[14]=l,t[15]=i,t[16]=e):e=t[16],d=r.map(e),t[2]=o,t[3]=s,t[4]=c,t[5]=a,t[6]=l,t[7]=i,t[8]=r,t[9]=d}else d=t[9];let f;t[17]===d?f=t[18]:(f=(0,$.jsx)(`div`,{className:`grid grid-cols-1 gap-x-3 gap-y-2 sm:grid-cols-2`,children:d}),t[17]=d,t[18]=f);let p;return t[19]!==u||t[20]!==f?(p=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[u,f]}),t[19]=u,t[20]=f,t[21]=p):p=t[21],p}function mo(e,t){switch(e.kind){case`unparseable`:return e.line===void 0?t`That doesn’t parse as YAML or JSON.`:t`That doesn’t parse as YAML or JSON — check line ${e.line}.`;case`not-a-scheme`:return t`That parsed, but it isn’t a base16 scheme.`;case`missing-slots`:return t`Missing ${e.slots.length} slot(s): ${e.slots.join(`, `)}`;case`bad-hex`:return t`Not a hex color: ${e.slots.join(`, `)}`}}function ho(e){let t=(0,Z.c)(13),{userBinding:n}=e,{_:r}=s(),i;t[0]===r?i=t[1]:(i=r({id:`fJ3EbT`}),t[0]=r,t[1]=i);let a;t[2]===r?a=t[3]:(a=r({id:`J_bJiH`}),t[2]=r,t[3]=a);let o;t[4]!==i||t[5]!==a||t[6]!==n?(o=(0,$.jsx)(eo,{title:i,description:a,scope:`user`,scopeBadge:`user`,binding:n,fields:st}),t[4]=i,t[5]=a,t[6]=n,t[7]=o):o=t[7];let c;t[8]===n?c=t[9]:(c=(0,$.jsx)(lo,{userBinding:n}),t[8]=n,t[9]=c);let l;return t[10]!==o||t[11]!==c?(l=(0,$.jsxs)(`div`,{className:`space-y-6`,children:[o,c]}),t[10]=o,t[11]=c,t[12]=l):l=t[12],l}function go(e){let t=(0,Z.c)(38),{activeId:n,userBinding:r,okignoreBinding:i,okignoreSynced:a,markdownlintRuleQuery:o}=e,{_:c}=s();if(n===`preferences`){let e;t[0]!==c||t[1]!==r?(e=r?(0,$.jsx)(eo,{title:c({id:`Q6hhn8`}),description:c({id:`Y_kL7X`}),scope:`user`,binding:r,fields:ft}):(0,$.jsx)(vr,{}),t[0]=c,t[1]=r,t[2]=e):e=t[2];let n;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(Lr,{}),t[3]=n):n=t[3];let i;return t[4]===e?i=t[5]:(i=(0,$.jsxs)(`div`,{className:`space-y-8`,children:[e,n]}),t[4]=e,t[5]=i),i}if(n===`configure-agents`){let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Vr,{}),t[6]=e):e=t[6],e}if(n===`hotkeys`){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(qr,{}),t[7]=e):e=t[7],e}if(n===`account`){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)($n,{}),t[8]=e):e=t[8],e}if(n===`sync`){let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)($a,{}),t[9]=e):e=t[9],e}if(n===`search`){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Ra,{}),t[10]=e):e=t[10],e}if(n===`plugins-manage`){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(di,{}),t[11]=e):e=t[11],e}if(n===`content-rules`){let e;return t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Gr,{}),t[12]=e):e=t[12],e}if(n===`user-plugins-manage`){let e;return t[13]===r?e=t[14]:(e=(0,$.jsx)(fi,{userBinding:r}),t[13]=r,t[14]=e),e}if(n===`plugin:theme`){let e;return t[15]===r?e=t[16]:(e=r?(0,$.jsx)(ho,{userBinding:r}):(0,$.jsx)(vr,{}),t[15]=r,t[16]=e),e}if(n===`plugin:markdownlint`){let e=o??null,n;return t[17]===e?n=t[18]:(n=(0,$.jsx)(hi,{initialRuleQuery:e}),t[17]=e,t[18]=n),n}if(n.startsWith(`plugin:`)){let e;t[19]===n?e=t[20]:(e=n.slice(7),t[19]=n,t[20]=e);let r=e,i;t[21]===r?i=t[22]:(i=ji.find(e=>e.id===r),t[21]=r,t[22]=i);let a=i;if(!a)return null;let o=a.Section,s;return t[23]!==o||t[24]!==n?(s=(0,$.jsx)(o,{},n),t[23]=o,t[24]=n,t[25]=s):s=t[25],s}if(n===`link-previews`){let e;return t[26]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Xr,{}),t[26]=e):e=t[26],e}if(n===`terminal`){let e;return t[27]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(no,{}),t[27]=e):e=t[27],e}if(n===`project-templates`){let e;return t[28]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Na,{}),t[28]=e):e=t[28],e}if(n===`skills`){let e;return t[29]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Za,{scope:`project`}),t[29]=e):e=t[29],e}if(n===`user-skills`){let e;return t[30]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Za,{scope:`global`}),t[30]=e):e=t[30],e}if(n===`sharing`){let e;return t[31]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Jn,{}),t[31]=e):e=t[31],e}if(n===`okignore`){let e;return t[32]!==i||t[33]!==a?(e=(0,$.jsx)(qi,{binding:i,synced:a}),t[32]=i,t[33]=a,t[34]=e):e=t[34],e}if(n===`ai-tools`){let e;return t[35]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(ar,{}),t[35]=e):e=t[35],e}if(n===`project-ai-tools`){let e;return t[36]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Ea,{}),t[36]=e):e=t[36],e}if(n===`claude-desktop`){let e;return t[37]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Yr,{}),t[37]=e):e=t[37],e}return null}export{go as SettingsDialogBody};
@@ -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"./button-RQ5o7P7w.js";import{a as ee,c as te,i as ne,n as re,o as ie,s as ae,t as oe}from"./dialog-FGMqkFjm.js";import{n as se,t as s}from"./git-branch-le6ClqcQ.js";import{t as c}from"./loader-circle-DJ1nzSAL.js";import{n as ce,t as le}from"./miss-dialog-store-BGDBpPYJ.js";import{n as l}from"./dist-uN7pEWl0.js";import{t as u}from"./desktop-bridge-types-FXg4M54A.js";import{r as d,t as f}from"./auth-prompt-store-CeUwLE3s.js";import{a as p,n as m}from"./receive-store-Cv1sOLk9.js";import{t as ue}from"./share-metadata-rows-CuFlpaJB.js";var h=e(n(),1),de=a();function fe(e){let t=e.shareTargetExists,n=e.dirtyConflicts.conflicts,r=e.dirtyConflicts.files;return t&&!n?{kind:`A`,openCurrentEnabled:!0,switchEnabled:!0,conflictingFiles:r}:!t&&!n?{kind:`B`,openCurrentEnabled:!1,switchEnabled:!0,conflictingFiles:r}:t&&n?{kind:`C`,openCurrentEnabled:!0,switchEnabled:!1,conflictingFiles:r}:{kind:`D`,openCurrentEnabled:!1,switchEnabled:!1,conflictingFiles:r}}function pe(e){return e.detached?e.currentHeadSha:e.currentBranch??`HEAD`}function g(e){if(e.ok)return{action:`await-cc1`};switch(e.reason){case`dirty-conflict`:return{action:`rerender-conflict`,files:e.files??[]};case`branch-not-found`:return{action:`dismiss-with-toast`,reason:`branch-not-found`};case`fetch-failed`:case`checkout-failed`:return{action:`stay-with-toast`,reason:e.reason};case`branch-in-other-worktree`:{let t=e.otherWorktreePath;return t===void 0||t.length===0?{action:`stay-with-toast`,reason:`checkout-failed`}:{action:`pivot-to-other-worktree`,otherWorktreePath:t}}case`ff-diverged`:return{action:`branch-diverged`};default:{let t=e.reason;throw Error(`Unhandled CheckoutFailureReason: ${String(t)}`)}}}var me={phase:`loading`};function he(e,t){return e.phase===`loading`?t===null?{phase:`error`}:{phase:`ready`,info:t}:e}function ge(e,t){return e.phase!==`ready`&&e.phase!==`verdict`?e:{phase:`switching`,info:e.info,pendingDoc:t}}function _e(e){return e.phase===`ready`?{phase:`creating-worktree`,info:e.info}:e}function ve(e){return fe(e).kind===`B`&&e.shareTargetOnOriginBranch===!1}function ye(e){return e.phase===`ready`?{phase:`verdict-pending`,info:e.info}:e}function be(e,t){if(e.phase!==`verdict-pending`)return e;if(t===null||t.verdict===`unknown`||t.verdict===`changed-locally`)return{phase:`ready`,info:e.info};let n=t.verdict===`renamed`?{kind:`renamed`,renamedTo:t.renamedTo}:{kind:t.verdict};return{phase:`verdict`,info:e.info,resolution:n}}function xe(e,t){if(e.phase!==`switching`)return{state:e};if(t===null)return{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}};let n=g(t);return n.action===`await-cc1`?{state:{phase:`awaiting-cc1-recycle`,pendingDoc:e.pendingDoc}}:n.action===`rerender-conflict`?{state:{phase:`ready`,info:{...e.info,dirtyConflicts:{conflicts:!0,files:n.files.slice()}}}}:n.action===`pivot-to-other-worktree`?{state:{phase:`branch-in-other-worktree`,info:e.info,otherWorktreePath:n.otherWorktreePath,pendingDoc:e.pendingDoc}}:n.action===`dismiss-with-toast`?{state:{phase:`dismissed`,reason:n.reason},sideEffect:{kind:`toast`,reason:n.reason}}:n.action===`branch-diverged`?{state:{phase:`verdict`,info:e.info,resolution:{kind:`diverged`}}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:n.reason}}}function Se(e,t){return e.phase===`creating-worktree`?t===null?{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}}:t.ok?{state:{phase:`opening-worktree`,path:t.path}}:t.reason===`branch-not-found`?{state:{phase:`dismissed`,reason:`branch-not-found`},sideEffect:{kind:`toast`,reason:`branch-not-found`}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:t.reason,helper:t.helper,authFailed:t.reason===`fetch-failed`?t.authFailed:void 0}}:{state:e}}var _=t();function Ce(e){return e!==null&&e.kind===`project-branch-switch`}function v(e){let t=(0,de.c)(217),{bridge:n,store:a}=e,f=a===void 0?m:a,{_:g}=i(),v=(0,h.useSyncExternalStore)(f.subscribe,f.getSnapshot,je),[y,b]=(0,h.useState)(me),Me=(0,h.useRef)(!1),Ne=(0,h.useRef)(!1),Pe=(0,h.useRef)(!1),Fe=(0,h.useRef)(null),Ie;t[0]===v?Ie=t[1]:(Ie=Ce(v)?v:null,t[0]=v,t[1]=Ie);let x=Ie,Le;t[2]!==g||t[3]!==x?.share.target.kind?(Le=x?.share.target.kind===`folder`?g({id:`ugoTXs`}):g({id:`XH30C4`}),t[2]=g,t[3]=x?.share.target.kind,t[4]=Le):Le=t[4];let S=Le,Re;t[5]===x?Re=t[6]:(Re=()=>{b(me),Me.current=!1,Ne.current=!1,Pe.current=!1,Fe.current=x},t[5]=x,t[6]=Re);let ze;t[7]===v?ze=t[8]:(ze=[v],t[7]=v,t[8]=ze),(0,h.useEffect)(Re,ze);let Be;t[9]!==x||t[10]!==n?(Be=()=>{if(!x||Me.current)return;Me.current=!0;let e=!1;return n.project.fetchBranchInfo({projectPath:x.projectPath,branch:x.share.branch,kind:x.share.target.kind,path:u(x.share.target)}).then(t=>{e||b(e=>he(e,t))}).catch(t=>{e||(console.warn(`[receive] branch-info-fetch-failed`,t instanceof Error?t.message:t),b(Ae))}),()=>{e=!0}},t[9]=x,t[10]=n,t[11]=Be):Be=t[11];let Ve;t[12]===x?Ve=t[13]:(Ve=[x],t[12]=x,t[13]=Ve),(0,h.useEffect)(Be,Ve);let He;t[14]!==x||t[15]!==y.info||t[16]!==y.phase||t[17]!==n?(He=()=>{if(!x||y.phase!==`ready`||Pe.current||!ve(y.info))return;Pe.current=!0,b(ye);let e=x;n.project.fetchTargetStatus({projectPath:x.projectPath,branch:x.share.branch,kind:x.share.target.kind,path:u(x.share.target)}).then(t=>{Fe.current===e&&b(e=>be(e,t))}).catch(t=>{Fe.current===e&&(console.warn(`[receive] target-status-fetch-failed`,t instanceof Error?t.message:t),b(ke))})},t[14]=x,t[15]=y.info,t[16]=y.phase,t[17]=n,t[18]=He):He=t[18];let Ue;t[19]!==x||t[20]!==y.phase?(Ue=[y.phase,x],t[19]=x,t[20]=y.phase,t[21]=Ue):Ue=t[21],(0,h.useEffect)(He,Ue);let We;t[22]!==x||t[23]!==y.phase||t[24]!==y.resolution||t[25]!==f?(We=()=>{if(y.phase!==`verdict`)return;let{kind:e}=y.resolution;e!==`deleted`&&e!==`never-on-branch`||x&&(le.arm({kind:x.share.target.kind,path:u(x.share.target),branch:x.share.branch}),f.dismiss())},t[22]=x,t[23]=y.phase,t[24]=y.resolution,t[25]=f,t[26]=We):We=t[26];let Ge;t[27]!==x||t[28]!==y||t[29]!==f?(Ge=[y,x,f],t[27]=x,t[28]=y,t[29]=f,t[30]=Ge):Ge=t[30],(0,h.useEffect)(We,Ge);let Ke;t[31]!==y.phase||t[32]!==y.resolution?(Ke=()=>{y.phase===`verdict`&&console.log(p({verdict_cell:y.resolution.kind}))},t[31]=y.phase,t[32]=y.resolution,t[33]=Ke):Ke=t[33];let qe;t[34]===y?qe=t[35]:(qe=[y],t[34]=y,t[35]=qe),(0,h.useEffect)(Ke,qe);let Je;t[36]!==g||t[37]!==x||t[38]!==y.pendingDoc||t[39]!==y.phase||t[40]!==n||t[41]!==f||t[42]!==S?(Je=()=>{if(y.phase!==`awaiting-cc1-recycle`||!x)return;let e=x.share.branch,t=y.pendingDoc;if(!e){f.dismiss();return}if(Ne.current)return;Ne.current=!0;let r=!1;return n.project.awaitBranchSwitched({projectPath:x.projectPath,branch:e,timeoutMs:3e4}).then(i=>{if(!r){if(i.ok){console.log(p({branch_dialog_action:`branch-switch-complete`,branch:e})),n.project.open({path:x.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:x.share.target.kind,path:t},pendingBranch:e}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=switch`,e instanceof Error?e.message:e),l.error(g({id:`gQV-9w`,values:{targetNoun:S}}))}),f.dismiss();return}console.log(p({branch_dialog_action:`branch-switch-timeout`,branch:e})),l.error(g({id:`LBwUR6`,values:{targetNoun:S}})),f.dismiss()}}).catch(e=>{r||(console.warn(`[receive] awaitBranchSwitched rejected`,e instanceof Error?e.message:e),l.error(g({id:`Jw6EC4`,values:{targetNoun:S}})),f.dismiss())}),()=>{r=!0}},t[36]=g,t[37]=x,t[38]=y.pendingDoc,t[39]=y.phase,t[40]=n,t[41]=f,t[42]=S,t[43]=Je):Je=t[43];let Ye;if(t[44]!==x||t[45]!==y.phase?(Ye=[y.phase,x],t[44]=x,t[45]=y.phase,t[46]=Ye):Ye=t[46],(0,h.useEffect)(Je,Ye),!x)return null;let{share:C,projectPath:w,currentBranch:Xe}=x,T=C.branch,Ze;t[47]!==g||t[48]!==n.project||t[49]!==w||t[50]!==T||t[51]!==f?(Ze=function(e,t,r){console.log(p({branch_dialog_action:`switch`,branch_action:`switch`,branch:T,verdict_cell:r})),b(t=>ge(t,e)),n.project.runCheckout(t?{projectPath:w,branch:T,fastForward:!0}:{projectPath:w,branch:T}).then(e=>{let t=null,n=!1;b(r=>{let{state:i,sideEffect:a}=xe(r,e);return a&&(t=a.reason,n=i.phase===`dismissed`),i}),t===`branch-not-found`?l.error(g({id:`NJyQi_`,values:{shareBranch:T}})):t===`fetch-failed`?l.error(g({id:`bWLmRK`})):(t===`checkout-failed`||t===`proxy-null`)&&l.error(g({id:`c863eW`,values:{shareBranch:T}})),n&&f.dismiss()}).catch(e=>{console.warn(`[receive] runCheckout rejected branch_action=switch`,e instanceof Error?e.message:e),b(Oe),l.error(g({id:`c863eW`,values:{shareBranch:T}}))})},t[47]=g,t[48]=n.project,t[49]=w,t[50]=T,t[51]=f,t[52]=Ze):Ze=t[52];let E=Ze,Qe;t[53]!==y.info||t[54]!==y.phase||t[55]!==E||t[56]!==C.target?(Qe=function(){y.phase===`ready`&&fe(y.info).switchEnabled&&E(u(C.target),!1)},t[53]=y.info,t[54]=y.phase,t[55]=E,t[56]=C.target,t[57]=Qe):Qe=t[57];let $e=Qe,et;t[58]!==y.phase||t[59]!==y.resolution||t[60]!==E||t[61]!==C.target?(et=function(){y.phase===`verdict`&&E(u(C.target),!0,y.resolution.kind)},t[58]=y.phase,t[59]=y.resolution,t[60]=E,t[61]=C.target,t[62]=et):et=t[62];let tt=et,nt;t[63]!==y.phase||t[64]!==y.resolution||t[65]!==E?(nt=function(){y.phase===`verdict`&&y.resolution.kind===`renamed`&&E(y.resolution.renamedTo,!0,y.resolution.kind)},t[63]=y.phase,t[64]=y.resolution,t[65]=E,t[66]=nt):nt=t[66];let rt=nt,it;t[67]!==y.phase||t[68]!==y.resolution||t[69]!==E||t[70]!==C.target?(it=function(){y.phase===`verdict`&&E(u(C.target),!1,y.resolution.kind)},t[67]=y.phase,t[68]=y.resolution,t[69]=E,t[70]=C.target,t[71]=it):it=t[71];let at=it,ot;t[72]!==g||t[73]!==n.project||t[74]!==w||t[75]!==C.target||t[76]!==T||t[77]!==f||t[78]!==S?(ot=function(){console.log(p({branch_dialog_action:`open-current`,branch:T})),n.project.open({path:w,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:C.target.kind,path:u(C.target)}}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=open-current`,e instanceof Error?e.message:e),l.error(g({id:`b5aNbi`,values:{targetNoun:S}}))}),f.dismiss()},t[72]=g,t[73]=n.project,t[74]=w,t[75]=C.target,t[76]=T,t[77]=f,t[78]=S,t[79]=ot):ot=t[79];let st=ot,ct;t[80]!==g||t[81]!==T?(ct=function(e,t,n){if(e===`fetch-failed`&&n){l.error(g({id:`gfb-CM`}),{action:{label:g({id:`5lWFkC`}),onClick:De}});return}switch(e){case`helper-not-found`:{let e=t??g({id:`cHhH3i`});l.error(g({id:`Z7x_Zh`,values:{tool:e}}));return}case`branch-not-found`:l.error(g({id:`NJyQi_`,values:{shareBranch:T}}));return;case`fetch-failed`:l.error(g({id:`bWLmRK`}));return;case`already-checked-out`:l.error(g({id:`ljHjfg`}));return;case`branch-exists`:l.error(g({id:`h3QZcB`,values:{shareBranch:T}}));return;case`path-exists`:l.error(g({id:`cN1Gcp`,values:{shareBranch:T}}));return;case`no-git`:l.error(g({id:`CFnavk`}));return;case`invalid-branch`:l.error(g({id:`JfPuv7`,values:{shareBranch:T}}));return;case`proxy-null`:case`error`:l.error(g({id:`e8zYa8`,values:{shareBranch:T}}));return;default:throw Error(`Unhandled worktree failure reason: ${String(e)}`)}},t[80]=g,t[81]=T,t[82]=ct):ct=t[82];let lt=ct,ut;t[83]!==g||t[84]!==n.project||t[85]!==C.target||t[86]!==T||t[87]!==lt||t[88]!==f?(ut=function(e){let t=null,r,i,a=!1,o=null;if(b(n=>{let{state:ee,sideEffect:te}=Se(n,e);return te&&(t=te.reason,r=te.helper,i=te.authFailed,a=ee.phase===`dismissed`),ee.phase===`opening-worktree`&&(o=ee.path),ee}),t!==null&&(console.log(p({branch_dialog_action:`open-worktree-failed:${t}`,branch:T})),lt(t,r,i)),o!==null){d();let e=o;n.project.open({path:e,target:`new-window`,entryPoint:`worktree`,pendingDeepLinkTarget:{kind:C.target.kind,path:u(C.target)},pendingBranch:T}).catch(t=>{console.warn(`[receive] worktree-open-failed branch_dialog_action=open-worktree`,t instanceof Error?t.message:t),l.error(g({id:`LdABLa`,values:{target:e}}))}),f.dismiss()}a&&f.dismiss()},t[83]=g,t[84]=n.project,t[85]=C.target,t[86]=T,t[87]=lt,t[88]=f,t[89]=ut):ut=t[89];let dt=ut,ft;t[90]!==dt||t[91]!==y.phase||t[92]!==n.worktree||t[93]!==T?(ft=function(){y.phase===`ready`&&(console.log(p({branch_dialog_action:`open-worktree`,branch:T})),b(_e),n.worktree.checkout({branch:T}).then(e=>{dt(e)}).catch(e=>{console.warn(`[receive] worktree-checkout rejected branch_dialog_action=open-worktree`,e instanceof Error?e.message:e),dt(null)}))},t[90]=dt,t[91]=y.phase,t[92]=n.worktree,t[93]=T,t[94]=ft):ft=t[94];let pt=ft,mt;t[95]!==g||t[96]!==y.otherWorktreePath||t[97]!==y.phase||t[98]!==n.project||t[99]!==C.target||t[100]!==T||t[101]!==f?(mt=function(){if(y.phase!==`branch-in-other-worktree`)return;let e=y.otherWorktreePath;console.log(p({branch_dialog_action:`pivot-to-other-worktree`,branch:T})),n.project.open({path:e,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:C.target.kind,path:u(C.target)},pendingBranch:T}).catch(t=>{console.warn(`[receive] pivot-open-failed branch_action=pivot-to-other-worktree`,t instanceof Error?t.message:t),l.error(g({id:`LdABLa`,values:{target:e}}))}),f.dismiss()},t[95]=g,t[96]=y.otherWorktreePath,t[97]=y.phase,t[98]=n.project,t[99]=C.target,t[100]=T,t[101]=f,t[102]=mt):mt=t[102];let ht=mt,gt;t[103]!==y.phase||t[104]!==y.resolution||t[105]!==f?(gt=function(){console.log(p({branch_dialog_action:`cancel`,verdict_cell:y.phase===`verdict`?y.resolution.kind:void 0})),f.dismiss()},t[103]=y.phase,t[104]=y.resolution,t[105]=f,t[106]=gt):gt=t[106];let D=gt,O,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G,K;if(t[107]!==g||t[108]!==y.info||t[109]!==y.otherWorktreePath||t[110]!==y.phase||t[111]!==y.resolution||t[112]!==D||t[113]!==Xe||t[114]!==C.branch||t[115]!==C.owner||t[116]!==C.repo||t[117]!==C.target||t[118]!==T||t[119]!==S){G=y.phase===`ready`||y.phase===`switching`||y.phase===`creating-worktree`?fe(y.info):null;let e;t[139]!==y.info||t[140]!==y.phase||t[141]!==Xe?(e=y.phase===`ready`||y.phase===`switching`||y.phase===`creating-worktree`?pe(y.info):Xe??`HEAD`,t[139]=y.info,t[140]=y.phase,t[141]=Xe,t[142]=e):e=t[142];let n=e;P=y.phase===`switching`||y.phase===`awaiting-cc1-recycle`,j=y.phase===`creating-worktree`;let i;t[143]===g?i=t[144]:(i=g({id:`OuY8t9`}),t[143]=g,t[144]=i),M=i;let a;t[145]===g?a=t[146]:(a=g({id:`XZkdtg`}),t[145]=g,t[146]=a),N=a;let o;t[147]===g?o=t[148]:(o=g({id:`VTulZj`}),t[147]=g,t[148]=o),K=o;let ie=y.phase===`loading`,se=y.phase===`error`;A=oe,U=!0,t[149]===D?W=t[150]:(W=e=>{e||D()},t[149]=D,t[150]=W),k=ne,R=`sm:max-w-xl`,z=`share-branch-switch-dialog`,B=Ee,V=Te;let s;t[151]===S?s=t[152]:(s=(0,_.jsx)(te,{children:(0,_.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:S}})}),t[151]=S,t[152]=s);let ce=C.owner,le=C.repo,l;t[153]===C.target?l=t[154]:(l=u(C.target),t[153]=C.target,t[154]=l);let d;t[155]!==C.owner||t[156]!==C.repo||t[157]!==l?(d=(0,_.jsx)(ee,{className:`sr-only`,children:(0,_.jsx)(r,{id:`f8jU-L`,values:{0:ce,1:le,2:l}})}),t[155]=C.owner,t[156]=C.repo,t[157]=l,t[158]=d):d=t[158],t[159]!==s||t[160]!==d?(H=(0,_.jsxs)(ae,{children:[s,d]}),t[159]=s,t[160]=d,t[161]=H):H=t[161],O=re;let f=C.owner,p=C.repo,m;t[162]===C.target?m=t[163]:(m=u(C.target),t[162]=C.target,t[163]=m),t[164]!==C.branch||t[165]!==C.owner||t[166]!==C.repo||t[167]!==C.target.kind||t[168]!==m?(F=(0,_.jsx)(`div`,{className:`mb-4`,children:(0,_.jsx)(ue,{owner:f,repo:p,path:m,kind:C.target.kind,branch:C.branch,testId:`share-branch-switch-metadata`,branchTestId:`share-branch-switch-metadata-branch`})}),t[164]=C.branch,t[165]=C.owner,t[166]=C.repo,t[167]=C.target.kind,t[168]=m,t[169]=F):F=t[169],I=y.phase===`branch-in-other-worktree`?(0,_.jsxs)(`div`,{className:`text-sm text-muted-foreground`,"data-testid":`share-branch-switch-in-other-worktree`,children:[(0,_.jsx)(`p`,{className:`leading-6`,children:(0,_.jsx)(r,{id:`yjExfe`,values:{shareBranch:T},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),(0,_.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-branch-switch-in-other-worktree-path`,children:y.otherWorktreePath})]}):y.phase===`verdict-pending`?(0,_.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-pending`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`c8jBgX`})]}):y.phase===`verdict`?y.resolution.kind===`on-origin`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-on-origin`,children:(0,_.jsx)(r,{id:`Uay5NL`,values:{targetNoun:S,shareBranch:T},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):y.resolution.kind===`renamed`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-renamed`,children:(0,_.jsx)(r,{id:`P0HC30`,values:{0:y.resolution.renamedTo,targetNoun:S},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):y.resolution.kind===`diverged`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-diverged`,children:(0,_.jsx)(r,{id:`kLv8d3`,values:{shareBranch:T,targetNoun:S},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,_.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-handoff`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`c8jBgX`})]}):ie?(0,_.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-loading`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`jerqF0`})]}):se?(0,_.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,_.jsx)(r,{id:`w4hMYl`})}):G?.kind===`D`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,_.jsx)(r,{id:`DTI-fp`,values:{targetNoun:S,shareBranch:T},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):G?.kind===`B`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,_.jsx)(r,{id:`sZ2IOu`,values:{targetNoun:S,shareBranch:T,currentLabel:n},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,_.jsx)(r,{id:`_902BE`,values:{targetNoun:S,shareBranch:T,currentLabel:n},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),L=G&&!G.switchEnabled&&G.conflictingFiles.length>0?(0,_.jsxs)(`div`,{className:`mt-3 rounded-md border border-border bg-muted/30 p-3 text-1sm`,"data-testid":`share-branch-switch-conflict`,children:[(0,_.jsx)(`p`,{className:`font-medium text-foreground/90`,children:(0,_.jsx)(r,{id:`n2lRue`})}),(0,_.jsx)(`ul`,{id:`share-receive-branch-conflict-files`,className:`mt-1 list-disc space-y-0.5 pl-5 text-muted-foreground`,children:G.conflictingFiles.map(we)})]}):null,t[107]=g,t[108]=y.info,t[109]=y.otherWorktreePath,t[110]=y.phase,t[111]=y.resolution,t[112]=D,t[113]=Xe,t[114]=C.branch,t[115]=C.owner,t[116]=C.repo,t[117]=C.target,t[118]=T,t[119]=S,t[120]=O,t[121]=k,t[122]=A,t[123]=j,t[124]=M,t[125]=N,t[126]=P,t[127]=F,t[128]=I,t[129]=L,t[130]=R,t[131]=z,t[132]=B,t[133]=V,t[134]=H,t[135]=U,t[136]=W,t[137]=G,t[138]=K}else O=t[120],k=t[121],A=t[122],j=t[123],M=t[124],N=t[125],P=t[126],F=t[127],I=t[128],L=t[129],R=t[130],z=t[131],B=t[132],V=t[133],H=t[134],U=t[135],W=t[136],G=t[137],K=t[138];let q;t[170]===P?q=t[171]:(q=P?(0,_.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-switching`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`CU3AiE`})]}):null,t[170]=P,t[171]=q);let J;t[172]===j?J=t[173]:(J=j?(0,_.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-creating-worktree`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`PZtgO0`})]}):null,t[172]=j,t[173]=J);let Y;t[174]!==O||t[175]!==F||t[176]!==I||t[177]!==L||t[178]!==q||t[179]!==J?(Y=(0,_.jsxs)(O,{children:[F,I,L,q,J]}),t[174]=O,t[175]=F,t[176]=I,t[177]=L,t[178]=q,t[179]=J,t[180]=Y):Y=t[180];let _t;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(_t=(0,_.jsx)(r,{id:`dEgA5A`}),t[181]=_t):_t=t[181];let X;t[182]===D?X=t[183]:(X=(0,_.jsx)(o,{variant:`ghost`,className:`font-mono uppercase`,onClick:D,"data-testid":`share-branch-switch-cancel`,children:_t}),t[182]=D,t[183]=X);let Z;t[184]!==y.phase||t[185]!==y.resolution||t[186]!==j||t[187]!==st||t[188]!==rt||t[189]!==pt||t[190]!==ht||t[191]!==at||t[192]!==$e||t[193]!==tt||t[194]!==M||t[195]!==N||t[196]!==P||t[197]!==G||t[198]!==K?(Z=y.phase===`branch-in-other-worktree`?(0,_.jsx)(o,{onClick:ht,"data-testid":`share-branch-switch-in-other-worktree-pivot`,children:(0,_.jsx)(r,{id:`hyCxJY`})}):y.phase===`verdict`?y.resolution.kind===`on-origin`?(0,_.jsxs)(o,{onClick:tt,"data-testid":`share-branch-switch-verdict-switch-update`,children:[(0,_.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),(0,_.jsx)(r,{id:`uA_jXp`})]}):y.resolution.kind===`renamed`?(0,_.jsxs)(o,{onClick:rt,"data-testid":`share-branch-switch-verdict-open-renamed`,children:[(0,_.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),(0,_.jsx)(r,{id:`AItsE5`})]}):y.resolution.kind===`diverged`?(0,_.jsxs)(o,{onClick:at,"data-testid":`share-branch-switch-verdict-plain-switch`,children:[(0,_.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),N]}):null:(0,_.jsxs)(`div`,{className:`flex min-w-0 flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end sm:gap-2`,children:[G?.openCurrentEnabled?(0,_.jsxs)(o,{variant:`outline`,className:`font-mono uppercase`,onClick:st,disabled:P||j,"data-testid":`share-branch-switch-open-current`,children:[(0,_.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),M]}):null,(0,_.jsx)(o,{variant:`outline`,onClick:$e,disabled:!G?.switchEnabled||P||j,"aria-disabled":!G?.switchEnabled||P||j,"aria-describedby":G&&!G.switchEnabled&&G.conflictingFiles.length>0?`share-receive-branch-conflict-files`:void 0,"data-testid":`share-branch-switch-switch`,children:P?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(c,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),N]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),N]})}),(0,_.jsx)(o,{onClick:pt,disabled:!G||P||j,"data-testid":`share-branch-switch-worktree`,children:j?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(c,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),K]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(se,{className:`size-3.5`,"aria-hidden":!0}),K]})})]}),t[184]=y.phase,t[185]=y.resolution,t[186]=j,t[187]=st,t[188]=rt,t[189]=pt,t[190]=ht,t[191]=at,t[192]=$e,t[193]=tt,t[194]=M,t[195]=N,t[196]=P,t[197]=G,t[198]=K,t[199]=Z):Z=t[199];let Q;t[200]!==X||t[201]!==Z?(Q=(0,_.jsxs)(ie,{className:`sm:justify-between`,children:[X,Z]}),t[200]=X,t[201]=Z,t[202]=Q):Q=t[202];let $;t[203]!==k||t[204]!==R||t[205]!==z||t[206]!==B||t[207]!==V||t[208]!==H||t[209]!==Y||t[210]!==Q?($=(0,_.jsxs)(k,{className:R,"data-testid":z,onInteractOutside:B,onPointerDownOutside:V,children:[H,Y,Q]}),t[203]=k,t[204]=R,t[205]=z,t[206]=B,t[207]=V,t[208]=H,t[209]=Y,t[210]=Q,t[211]=$):$=t[211];let vt;return t[212]!==A||t[213]!==U||t[214]!==W||t[215]!==$?(vt=(0,_.jsx)(A,{open:U,onOpenChange:W,children:$}),t[212]=A,t[213]=U,t[214]=W,t[215]=$,t[216]=vt):vt=t[216],vt}function we(e){return(0,_.jsx)(`li`,{children:(0,_.jsx)(`code`,{className:`text-foreground/80`,children:e})},e)}function Te(e){e.preventDefault()}function Ee(e){e.preventDefault()}function De(){return f.request()}function Oe(e){return xe(e,null).state}function ke(e){return be(e,null)}function Ae(e){return he(e,null)}function je(){return null}export{v as ShareBranchSwitchDialog};
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"./button-RQ5o7P7w.js";import{a as ee,c as te,i as ne,n as re,o as ie,s as ae,t as oe}from"./dialog-FGMqkFjm.js";import{n as se,t as s}from"./git-branch-le6ClqcQ.js";import{t as c}from"./loader-circle-DJ1nzSAL.js";import{n as ce,t as le}from"./miss-dialog-store-BGDBpPYJ.js";import{n as l}from"./dist-uN7pEWl0.js";import{t as u}from"./desktop-bridge-types-FXg4M54A.js";import{r as d,t as f}from"./auth-prompt-store-CeUwLE3s.js";import{a as p,n as m}from"./receive-store-CTNYU3q-.js";import{t as ue}from"./share-metadata-rows-CuFlpaJB.js";var h=e(n(),1),de=a();function fe(e){let t=e.shareTargetExists,n=e.dirtyConflicts.conflicts,r=e.dirtyConflicts.files;return t&&!n?{kind:`A`,openCurrentEnabled:!0,switchEnabled:!0,conflictingFiles:r}:!t&&!n?{kind:`B`,openCurrentEnabled:!1,switchEnabled:!0,conflictingFiles:r}:t&&n?{kind:`C`,openCurrentEnabled:!0,switchEnabled:!1,conflictingFiles:r}:{kind:`D`,openCurrentEnabled:!1,switchEnabled:!1,conflictingFiles:r}}function pe(e){return e.detached?e.currentHeadSha:e.currentBranch??`HEAD`}function g(e){if(e.ok)return{action:`await-cc1`};switch(e.reason){case`dirty-conflict`:return{action:`rerender-conflict`,files:e.files??[]};case`branch-not-found`:return{action:`dismiss-with-toast`,reason:`branch-not-found`};case`fetch-failed`:case`checkout-failed`:return{action:`stay-with-toast`,reason:e.reason};case`branch-in-other-worktree`:{let t=e.otherWorktreePath;return t===void 0||t.length===0?{action:`stay-with-toast`,reason:`checkout-failed`}:{action:`pivot-to-other-worktree`,otherWorktreePath:t}}case`ff-diverged`:return{action:`branch-diverged`};default:{let t=e.reason;throw Error(`Unhandled CheckoutFailureReason: ${String(t)}`)}}}var me={phase:`loading`};function he(e,t){return e.phase===`loading`?t===null?{phase:`error`}:{phase:`ready`,info:t}:e}function ge(e,t){return e.phase!==`ready`&&e.phase!==`verdict`?e:{phase:`switching`,info:e.info,pendingDoc:t}}function _e(e){return e.phase===`ready`?{phase:`creating-worktree`,info:e.info}:e}function ve(e){return fe(e).kind===`B`&&e.shareTargetOnOriginBranch===!1}function ye(e){return e.phase===`ready`?{phase:`verdict-pending`,info:e.info}:e}function be(e,t){if(e.phase!==`verdict-pending`)return e;if(t===null||t.verdict===`unknown`||t.verdict===`changed-locally`)return{phase:`ready`,info:e.info};let n=t.verdict===`renamed`?{kind:`renamed`,renamedTo:t.renamedTo}:{kind:t.verdict};return{phase:`verdict`,info:e.info,resolution:n}}function xe(e,t){if(e.phase!==`switching`)return{state:e};if(t===null)return{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}};let n=g(t);return n.action===`await-cc1`?{state:{phase:`awaiting-cc1-recycle`,pendingDoc:e.pendingDoc}}:n.action===`rerender-conflict`?{state:{phase:`ready`,info:{...e.info,dirtyConflicts:{conflicts:!0,files:n.files.slice()}}}}:n.action===`pivot-to-other-worktree`?{state:{phase:`branch-in-other-worktree`,info:e.info,otherWorktreePath:n.otherWorktreePath,pendingDoc:e.pendingDoc}}:n.action===`dismiss-with-toast`?{state:{phase:`dismissed`,reason:n.reason},sideEffect:{kind:`toast`,reason:n.reason}}:n.action===`branch-diverged`?{state:{phase:`verdict`,info:e.info,resolution:{kind:`diverged`}}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:n.reason}}}function Se(e,t){return e.phase===`creating-worktree`?t===null?{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:`proxy-null`}}:t.ok?{state:{phase:`opening-worktree`,path:t.path}}:t.reason===`branch-not-found`?{state:{phase:`dismissed`,reason:`branch-not-found`},sideEffect:{kind:`toast`,reason:`branch-not-found`}}:{state:{phase:`ready`,info:e.info},sideEffect:{kind:`toast`,reason:t.reason,helper:t.helper,authFailed:t.reason===`fetch-failed`?t.authFailed:void 0}}:{state:e}}var _=t();function Ce(e){return e!==null&&e.kind===`project-branch-switch`}function v(e){let t=(0,de.c)(217),{bridge:n,store:a}=e,f=a===void 0?m:a,{_:g}=i(),v=(0,h.useSyncExternalStore)(f.subscribe,f.getSnapshot,je),[y,b]=(0,h.useState)(me),Me=(0,h.useRef)(!1),Ne=(0,h.useRef)(!1),Pe=(0,h.useRef)(!1),Fe=(0,h.useRef)(null),Ie;t[0]===v?Ie=t[1]:(Ie=Ce(v)?v:null,t[0]=v,t[1]=Ie);let x=Ie,Le;t[2]!==g||t[3]!==x?.share.target.kind?(Le=x?.share.target.kind===`folder`?g({id:`ugoTXs`}):g({id:`XH30C4`}),t[2]=g,t[3]=x?.share.target.kind,t[4]=Le):Le=t[4];let S=Le,Re;t[5]===x?Re=t[6]:(Re=()=>{b(me),Me.current=!1,Ne.current=!1,Pe.current=!1,Fe.current=x},t[5]=x,t[6]=Re);let ze;t[7]===v?ze=t[8]:(ze=[v],t[7]=v,t[8]=ze),(0,h.useEffect)(Re,ze);let Be;t[9]!==x||t[10]!==n?(Be=()=>{if(!x||Me.current)return;Me.current=!0;let e=!1;return n.project.fetchBranchInfo({projectPath:x.projectPath,branch:x.share.branch,kind:x.share.target.kind,path:u(x.share.target)}).then(t=>{e||b(e=>he(e,t))}).catch(t=>{e||(console.warn(`[receive] branch-info-fetch-failed`,t instanceof Error?t.message:t),b(Ae))}),()=>{e=!0}},t[9]=x,t[10]=n,t[11]=Be):Be=t[11];let Ve;t[12]===x?Ve=t[13]:(Ve=[x],t[12]=x,t[13]=Ve),(0,h.useEffect)(Be,Ve);let He;t[14]!==x||t[15]!==y.info||t[16]!==y.phase||t[17]!==n?(He=()=>{if(!x||y.phase!==`ready`||Pe.current||!ve(y.info))return;Pe.current=!0,b(ye);let e=x;n.project.fetchTargetStatus({projectPath:x.projectPath,branch:x.share.branch,kind:x.share.target.kind,path:u(x.share.target)}).then(t=>{Fe.current===e&&b(e=>be(e,t))}).catch(t=>{Fe.current===e&&(console.warn(`[receive] target-status-fetch-failed`,t instanceof Error?t.message:t),b(ke))})},t[14]=x,t[15]=y.info,t[16]=y.phase,t[17]=n,t[18]=He):He=t[18];let Ue;t[19]!==x||t[20]!==y.phase?(Ue=[y.phase,x],t[19]=x,t[20]=y.phase,t[21]=Ue):Ue=t[21],(0,h.useEffect)(He,Ue);let We;t[22]!==x||t[23]!==y.phase||t[24]!==y.resolution||t[25]!==f?(We=()=>{if(y.phase!==`verdict`)return;let{kind:e}=y.resolution;e!==`deleted`&&e!==`never-on-branch`||x&&(le.arm({kind:x.share.target.kind,path:u(x.share.target),branch:x.share.branch}),f.dismiss())},t[22]=x,t[23]=y.phase,t[24]=y.resolution,t[25]=f,t[26]=We):We=t[26];let Ge;t[27]!==x||t[28]!==y||t[29]!==f?(Ge=[y,x,f],t[27]=x,t[28]=y,t[29]=f,t[30]=Ge):Ge=t[30],(0,h.useEffect)(We,Ge);let Ke;t[31]!==y.phase||t[32]!==y.resolution?(Ke=()=>{y.phase===`verdict`&&console.log(p({verdict_cell:y.resolution.kind}))},t[31]=y.phase,t[32]=y.resolution,t[33]=Ke):Ke=t[33];let qe;t[34]===y?qe=t[35]:(qe=[y],t[34]=y,t[35]=qe),(0,h.useEffect)(Ke,qe);let Je;t[36]!==g||t[37]!==x||t[38]!==y.pendingDoc||t[39]!==y.phase||t[40]!==n||t[41]!==f||t[42]!==S?(Je=()=>{if(y.phase!==`awaiting-cc1-recycle`||!x)return;let e=x.share.branch,t=y.pendingDoc;if(!e){f.dismiss();return}if(Ne.current)return;Ne.current=!0;let r=!1;return n.project.awaitBranchSwitched({projectPath:x.projectPath,branch:e,timeoutMs:3e4}).then(i=>{if(!r){if(i.ok){console.log(p({branch_dialog_action:`branch-switch-complete`,branch:e})),n.project.open({path:x.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:x.share.target.kind,path:t},pendingBranch:e}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=switch`,e instanceof Error?e.message:e),l.error(g({id:`gQV-9w`,values:{targetNoun:S}}))}),f.dismiss();return}console.log(p({branch_dialog_action:`branch-switch-timeout`,branch:e})),l.error(g({id:`LBwUR6`,values:{targetNoun:S}})),f.dismiss()}}).catch(e=>{r||(console.warn(`[receive] awaitBranchSwitched rejected`,e instanceof Error?e.message:e),l.error(g({id:`Jw6EC4`,values:{targetNoun:S}})),f.dismiss())}),()=>{r=!0}},t[36]=g,t[37]=x,t[38]=y.pendingDoc,t[39]=y.phase,t[40]=n,t[41]=f,t[42]=S,t[43]=Je):Je=t[43];let Ye;if(t[44]!==x||t[45]!==y.phase?(Ye=[y.phase,x],t[44]=x,t[45]=y.phase,t[46]=Ye):Ye=t[46],(0,h.useEffect)(Je,Ye),!x)return null;let{share:C,projectPath:w,currentBranch:Xe}=x,T=C.branch,Ze;t[47]!==g||t[48]!==n.project||t[49]!==w||t[50]!==T||t[51]!==f?(Ze=function(e,t,r){console.log(p({branch_dialog_action:`switch`,branch_action:`switch`,branch:T,verdict_cell:r})),b(t=>ge(t,e)),n.project.runCheckout(t?{projectPath:w,branch:T,fastForward:!0}:{projectPath:w,branch:T}).then(e=>{let t=null,n=!1;b(r=>{let{state:i,sideEffect:a}=xe(r,e);return a&&(t=a.reason,n=i.phase===`dismissed`),i}),t===`branch-not-found`?l.error(g({id:`NJyQi_`,values:{shareBranch:T}})):t===`fetch-failed`?l.error(g({id:`bWLmRK`})):(t===`checkout-failed`||t===`proxy-null`)&&l.error(g({id:`c863eW`,values:{shareBranch:T}})),n&&f.dismiss()}).catch(e=>{console.warn(`[receive] runCheckout rejected branch_action=switch`,e instanceof Error?e.message:e),b(Oe),l.error(g({id:`c863eW`,values:{shareBranch:T}}))})},t[47]=g,t[48]=n.project,t[49]=w,t[50]=T,t[51]=f,t[52]=Ze):Ze=t[52];let E=Ze,Qe;t[53]!==y.info||t[54]!==y.phase||t[55]!==E||t[56]!==C.target?(Qe=function(){y.phase===`ready`&&fe(y.info).switchEnabled&&E(u(C.target),!1)},t[53]=y.info,t[54]=y.phase,t[55]=E,t[56]=C.target,t[57]=Qe):Qe=t[57];let $e=Qe,et;t[58]!==y.phase||t[59]!==y.resolution||t[60]!==E||t[61]!==C.target?(et=function(){y.phase===`verdict`&&E(u(C.target),!0,y.resolution.kind)},t[58]=y.phase,t[59]=y.resolution,t[60]=E,t[61]=C.target,t[62]=et):et=t[62];let tt=et,nt;t[63]!==y.phase||t[64]!==y.resolution||t[65]!==E?(nt=function(){y.phase===`verdict`&&y.resolution.kind===`renamed`&&E(y.resolution.renamedTo,!0,y.resolution.kind)},t[63]=y.phase,t[64]=y.resolution,t[65]=E,t[66]=nt):nt=t[66];let rt=nt,it;t[67]!==y.phase||t[68]!==y.resolution||t[69]!==E||t[70]!==C.target?(it=function(){y.phase===`verdict`&&E(u(C.target),!1,y.resolution.kind)},t[67]=y.phase,t[68]=y.resolution,t[69]=E,t[70]=C.target,t[71]=it):it=t[71];let at=it,ot;t[72]!==g||t[73]!==n.project||t[74]!==w||t[75]!==C.target||t[76]!==T||t[77]!==f||t[78]!==S?(ot=function(){console.log(p({branch_dialog_action:`open-current`,branch:T})),n.project.open({path:w,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:C.target.kind,path:u(C.target)}}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=open-current`,e instanceof Error?e.message:e),l.error(g({id:`b5aNbi`,values:{targetNoun:S}}))}),f.dismiss()},t[72]=g,t[73]=n.project,t[74]=w,t[75]=C.target,t[76]=T,t[77]=f,t[78]=S,t[79]=ot):ot=t[79];let st=ot,ct;t[80]!==g||t[81]!==T?(ct=function(e,t,n){if(e===`fetch-failed`&&n){l.error(g({id:`gfb-CM`}),{action:{label:g({id:`5lWFkC`}),onClick:De}});return}switch(e){case`helper-not-found`:{let e=t??g({id:`cHhH3i`});l.error(g({id:`Z7x_Zh`,values:{tool:e}}));return}case`branch-not-found`:l.error(g({id:`NJyQi_`,values:{shareBranch:T}}));return;case`fetch-failed`:l.error(g({id:`bWLmRK`}));return;case`already-checked-out`:l.error(g({id:`ljHjfg`}));return;case`branch-exists`:l.error(g({id:`h3QZcB`,values:{shareBranch:T}}));return;case`path-exists`:l.error(g({id:`cN1Gcp`,values:{shareBranch:T}}));return;case`no-git`:l.error(g({id:`CFnavk`}));return;case`invalid-branch`:l.error(g({id:`JfPuv7`,values:{shareBranch:T}}));return;case`proxy-null`:case`error`:l.error(g({id:`e8zYa8`,values:{shareBranch:T}}));return;default:throw Error(`Unhandled worktree failure reason: ${String(e)}`)}},t[80]=g,t[81]=T,t[82]=ct):ct=t[82];let lt=ct,ut;t[83]!==g||t[84]!==n.project||t[85]!==C.target||t[86]!==T||t[87]!==lt||t[88]!==f?(ut=function(e){let t=null,r,i,a=!1,o=null;if(b(n=>{let{state:ee,sideEffect:te}=Se(n,e);return te&&(t=te.reason,r=te.helper,i=te.authFailed,a=ee.phase===`dismissed`),ee.phase===`opening-worktree`&&(o=ee.path),ee}),t!==null&&(console.log(p({branch_dialog_action:`open-worktree-failed:${t}`,branch:T})),lt(t,r,i)),o!==null){d();let e=o;n.project.open({path:e,target:`new-window`,entryPoint:`worktree`,pendingDeepLinkTarget:{kind:C.target.kind,path:u(C.target)},pendingBranch:T}).catch(t=>{console.warn(`[receive] worktree-open-failed branch_dialog_action=open-worktree`,t instanceof Error?t.message:t),l.error(g({id:`LdABLa`,values:{target:e}}))}),f.dismiss()}a&&f.dismiss()},t[83]=g,t[84]=n.project,t[85]=C.target,t[86]=T,t[87]=lt,t[88]=f,t[89]=ut):ut=t[89];let dt=ut,ft;t[90]!==dt||t[91]!==y.phase||t[92]!==n.worktree||t[93]!==T?(ft=function(){y.phase===`ready`&&(console.log(p({branch_dialog_action:`open-worktree`,branch:T})),b(_e),n.worktree.checkout({branch:T}).then(e=>{dt(e)}).catch(e=>{console.warn(`[receive] worktree-checkout rejected branch_dialog_action=open-worktree`,e instanceof Error?e.message:e),dt(null)}))},t[90]=dt,t[91]=y.phase,t[92]=n.worktree,t[93]=T,t[94]=ft):ft=t[94];let pt=ft,mt;t[95]!==g||t[96]!==y.otherWorktreePath||t[97]!==y.phase||t[98]!==n.project||t[99]!==C.target||t[100]!==T||t[101]!==f?(mt=function(){if(y.phase!==`branch-in-other-worktree`)return;let e=y.otherWorktreePath;console.log(p({branch_dialog_action:`pivot-to-other-worktree`,branch:T})),n.project.open({path:e,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:C.target.kind,path:u(C.target)},pendingBranch:T}).catch(t=>{console.warn(`[receive] pivot-open-failed branch_action=pivot-to-other-worktree`,t instanceof Error?t.message:t),l.error(g({id:`LdABLa`,values:{target:e}}))}),f.dismiss()},t[95]=g,t[96]=y.otherWorktreePath,t[97]=y.phase,t[98]=n.project,t[99]=C.target,t[100]=T,t[101]=f,t[102]=mt):mt=t[102];let ht=mt,gt;t[103]!==y.phase||t[104]!==y.resolution||t[105]!==f?(gt=function(){console.log(p({branch_dialog_action:`cancel`,verdict_cell:y.phase===`verdict`?y.resolution.kind:void 0})),f.dismiss()},t[103]=y.phase,t[104]=y.resolution,t[105]=f,t[106]=gt):gt=t[106];let D=gt,O,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G,K;if(t[107]!==g||t[108]!==y.info||t[109]!==y.otherWorktreePath||t[110]!==y.phase||t[111]!==y.resolution||t[112]!==D||t[113]!==Xe||t[114]!==C.branch||t[115]!==C.owner||t[116]!==C.repo||t[117]!==C.target||t[118]!==T||t[119]!==S){G=y.phase===`ready`||y.phase===`switching`||y.phase===`creating-worktree`?fe(y.info):null;let e;t[139]!==y.info||t[140]!==y.phase||t[141]!==Xe?(e=y.phase===`ready`||y.phase===`switching`||y.phase===`creating-worktree`?pe(y.info):Xe??`HEAD`,t[139]=y.info,t[140]=y.phase,t[141]=Xe,t[142]=e):e=t[142];let n=e;P=y.phase===`switching`||y.phase===`awaiting-cc1-recycle`,j=y.phase===`creating-worktree`;let i;t[143]===g?i=t[144]:(i=g({id:`OuY8t9`}),t[143]=g,t[144]=i),M=i;let a;t[145]===g?a=t[146]:(a=g({id:`XZkdtg`}),t[145]=g,t[146]=a),N=a;let o;t[147]===g?o=t[148]:(o=g({id:`VTulZj`}),t[147]=g,t[148]=o),K=o;let ie=y.phase===`loading`,se=y.phase===`error`;A=oe,U=!0,t[149]===D?W=t[150]:(W=e=>{e||D()},t[149]=D,t[150]=W),k=ne,R=`sm:max-w-xl`,z=`share-branch-switch-dialog`,B=Ee,V=Te;let s;t[151]===S?s=t[152]:(s=(0,_.jsx)(te,{children:(0,_.jsx)(r,{id:`RY6Bq1`,values:{targetNoun:S}})}),t[151]=S,t[152]=s);let ce=C.owner,le=C.repo,l;t[153]===C.target?l=t[154]:(l=u(C.target),t[153]=C.target,t[154]=l);let d;t[155]!==C.owner||t[156]!==C.repo||t[157]!==l?(d=(0,_.jsx)(ee,{className:`sr-only`,children:(0,_.jsx)(r,{id:`f8jU-L`,values:{0:ce,1:le,2:l}})}),t[155]=C.owner,t[156]=C.repo,t[157]=l,t[158]=d):d=t[158],t[159]!==s||t[160]!==d?(H=(0,_.jsxs)(ae,{children:[s,d]}),t[159]=s,t[160]=d,t[161]=H):H=t[161],O=re;let f=C.owner,p=C.repo,m;t[162]===C.target?m=t[163]:(m=u(C.target),t[162]=C.target,t[163]=m),t[164]!==C.branch||t[165]!==C.owner||t[166]!==C.repo||t[167]!==C.target.kind||t[168]!==m?(F=(0,_.jsx)(`div`,{className:`mb-4`,children:(0,_.jsx)(ue,{owner:f,repo:p,path:m,kind:C.target.kind,branch:C.branch,testId:`share-branch-switch-metadata`,branchTestId:`share-branch-switch-metadata-branch`})}),t[164]=C.branch,t[165]=C.owner,t[166]=C.repo,t[167]=C.target.kind,t[168]=m,t[169]=F):F=t[169],I=y.phase===`branch-in-other-worktree`?(0,_.jsxs)(`div`,{className:`text-sm text-muted-foreground`,"data-testid":`share-branch-switch-in-other-worktree`,children:[(0,_.jsx)(`p`,{className:`leading-6`,children:(0,_.jsx)(r,{id:`yjExfe`,values:{shareBranch:T},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),(0,_.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-branch-switch-in-other-worktree-path`,children:y.otherWorktreePath})]}):y.phase===`verdict-pending`?(0,_.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-pending`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`c8jBgX`})]}):y.phase===`verdict`?y.resolution.kind===`on-origin`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-on-origin`,children:(0,_.jsx)(r,{id:`Uay5NL`,values:{targetNoun:S,shareBranch:T},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):y.resolution.kind===`renamed`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-renamed`,children:(0,_.jsx)(r,{id:`P0HC30`,values:{0:y.resolution.renamedTo,targetNoun:S},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):y.resolution.kind===`diverged`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-diverged`,children:(0,_.jsx)(r,{id:`kLv8d3`,values:{shareBranch:T,targetNoun:S},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,_.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-verdict-handoff`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`c8jBgX`})]}):ie?(0,_.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-loading`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`jerqF0`})]}):se?(0,_.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,_.jsx)(r,{id:`w4hMYl`})}):G?.kind===`D`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,_.jsx)(r,{id:`DTI-fp`,values:{targetNoun:S,shareBranch:T},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):G?.kind===`B`?(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,_.jsx)(r,{id:`sZ2IOu`,values:{targetNoun:S,shareBranch:T,currentLabel:n},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,_.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,_.jsx)(r,{id:`_902BE`,values:{targetNoun:S,shareBranch:T,currentLabel:n},components:{0:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,_.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),L=G&&!G.switchEnabled&&G.conflictingFiles.length>0?(0,_.jsxs)(`div`,{className:`mt-3 rounded-md border border-border bg-muted/30 p-3 text-1sm`,"data-testid":`share-branch-switch-conflict`,children:[(0,_.jsx)(`p`,{className:`font-medium text-foreground/90`,children:(0,_.jsx)(r,{id:`n2lRue`})}),(0,_.jsx)(`ul`,{id:`share-receive-branch-conflict-files`,className:`mt-1 list-disc space-y-0.5 pl-5 text-muted-foreground`,children:G.conflictingFiles.map(we)})]}):null,t[107]=g,t[108]=y.info,t[109]=y.otherWorktreePath,t[110]=y.phase,t[111]=y.resolution,t[112]=D,t[113]=Xe,t[114]=C.branch,t[115]=C.owner,t[116]=C.repo,t[117]=C.target,t[118]=T,t[119]=S,t[120]=O,t[121]=k,t[122]=A,t[123]=j,t[124]=M,t[125]=N,t[126]=P,t[127]=F,t[128]=I,t[129]=L,t[130]=R,t[131]=z,t[132]=B,t[133]=V,t[134]=H,t[135]=U,t[136]=W,t[137]=G,t[138]=K}else O=t[120],k=t[121],A=t[122],j=t[123],M=t[124],N=t[125],P=t[126],F=t[127],I=t[128],L=t[129],R=t[130],z=t[131],B=t[132],V=t[133],H=t[134],U=t[135],W=t[136],G=t[137],K=t[138];let q;t[170]===P?q=t[171]:(q=P?(0,_.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-switching`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`CU3AiE`})]}):null,t[170]=P,t[171]=q);let J;t[172]===j?J=t[173]:(J=j?(0,_.jsxs)(`p`,{className:`mt-3 flex items-center gap-2 text-sm text-muted-foreground`,"data-testid":`share-branch-switch-creating-worktree`,role:`status`,"aria-live":`polite`,children:[(0,_.jsx)(c,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,_.jsx)(r,{id:`PZtgO0`})]}):null,t[172]=j,t[173]=J);let Y;t[174]!==O||t[175]!==F||t[176]!==I||t[177]!==L||t[178]!==q||t[179]!==J?(Y=(0,_.jsxs)(O,{children:[F,I,L,q,J]}),t[174]=O,t[175]=F,t[176]=I,t[177]=L,t[178]=q,t[179]=J,t[180]=Y):Y=t[180];let _t;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(_t=(0,_.jsx)(r,{id:`dEgA5A`}),t[181]=_t):_t=t[181];let X;t[182]===D?X=t[183]:(X=(0,_.jsx)(o,{variant:`ghost`,className:`font-mono uppercase`,onClick:D,"data-testid":`share-branch-switch-cancel`,children:_t}),t[182]=D,t[183]=X);let Z;t[184]!==y.phase||t[185]!==y.resolution||t[186]!==j||t[187]!==st||t[188]!==rt||t[189]!==pt||t[190]!==ht||t[191]!==at||t[192]!==$e||t[193]!==tt||t[194]!==M||t[195]!==N||t[196]!==P||t[197]!==G||t[198]!==K?(Z=y.phase===`branch-in-other-worktree`?(0,_.jsx)(o,{onClick:ht,"data-testid":`share-branch-switch-in-other-worktree-pivot`,children:(0,_.jsx)(r,{id:`hyCxJY`})}):y.phase===`verdict`?y.resolution.kind===`on-origin`?(0,_.jsxs)(o,{onClick:tt,"data-testid":`share-branch-switch-verdict-switch-update`,children:[(0,_.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),(0,_.jsx)(r,{id:`uA_jXp`})]}):y.resolution.kind===`renamed`?(0,_.jsxs)(o,{onClick:rt,"data-testid":`share-branch-switch-verdict-open-renamed`,children:[(0,_.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),(0,_.jsx)(r,{id:`AItsE5`})]}):y.resolution.kind===`diverged`?(0,_.jsxs)(o,{onClick:at,"data-testid":`share-branch-switch-verdict-plain-switch`,children:[(0,_.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),N]}):null:(0,_.jsxs)(`div`,{className:`flex min-w-0 flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end sm:gap-2`,children:[G?.openCurrentEnabled?(0,_.jsxs)(o,{variant:`outline`,className:`font-mono uppercase`,onClick:st,disabled:P||j,"data-testid":`share-branch-switch-open-current`,children:[(0,_.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),M]}):null,(0,_.jsx)(o,{variant:`outline`,onClick:$e,disabled:!G?.switchEnabled||P||j,"aria-disabled":!G?.switchEnabled||P||j,"aria-describedby":G&&!G.switchEnabled&&G.conflictingFiles.length>0?`share-receive-branch-conflict-files`:void 0,"data-testid":`share-branch-switch-switch`,children:P?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(c,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),N]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),N]})}),(0,_.jsx)(o,{onClick:pt,disabled:!G||P||j,"data-testid":`share-branch-switch-worktree`,children:j?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(c,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),K]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(se,{className:`size-3.5`,"aria-hidden":!0}),K]})})]}),t[184]=y.phase,t[185]=y.resolution,t[186]=j,t[187]=st,t[188]=rt,t[189]=pt,t[190]=ht,t[191]=at,t[192]=$e,t[193]=tt,t[194]=M,t[195]=N,t[196]=P,t[197]=G,t[198]=K,t[199]=Z):Z=t[199];let Q;t[200]!==X||t[201]!==Z?(Q=(0,_.jsxs)(ie,{className:`sm:justify-between`,children:[X,Z]}),t[200]=X,t[201]=Z,t[202]=Q):Q=t[202];let $;t[203]!==k||t[204]!==R||t[205]!==z||t[206]!==B||t[207]!==V||t[208]!==H||t[209]!==Y||t[210]!==Q?($=(0,_.jsxs)(k,{className:R,"data-testid":z,onInteractOutside:B,onPointerDownOutside:V,children:[H,Y,Q]}),t[203]=k,t[204]=R,t[205]=z,t[206]=B,t[207]=V,t[208]=H,t[209]=Y,t[210]=Q,t[211]=$):$=t[211];let vt;return t[212]!==A||t[213]!==U||t[214]!==W||t[215]!==$?(vt=(0,_.jsx)(A,{open:U,onOpenChange:W,children:$}),t[212]=A,t[213]=U,t[214]=W,t[215]=$,t[216]=vt):vt=t[216],vt}function we(e){return(0,_.jsx)(`li`,{children:(0,_.jsx)(`code`,{className:`text-foreground/80`,children:e})},e)}function Te(e){e.preventDefault()}function Ee(e){e.preventDefault()}function De(){return f.request()}function Oe(e){return xe(e,null).state}function ke(e){return be(e,null)}function Ae(e){return he(e,null)}function je(){return null}export{v as ShareBranchSwitchDialog};