@inkeep/open-knowledge 0.30.0-beta.1 → 0.30.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (434) hide show
  1. package/dist/{_baseFor-m0TxKeb9.mjs → _baseFor-DZZBdGCl.mjs} +1 -1
  2. package/dist/alias-JE7RI5QX-DCQQF1DX.mjs +1 -0
  3. package/dist/{arc-Doj9VrmJ.mjs → arc-ZIh9aOme.mjs} +2 -2
  4. package/dist/architecture-YZFGNWBL-BjBc8yjs.mjs +1 -0
  5. package/dist/{architectureDiagram-Q4EWVU46-Dwlx8W7J.mjs → architectureDiagram-Q4EWVU46-B9_FLf6A.mjs} +2 -2
  6. package/dist/{array-1jkOhClC.mjs → array-DzQVq_wL.mjs} +1 -1
  7. package/dist/assets/skills/discovery/SKILL.md +3 -8
  8. package/dist/assets/skills/project/SKILL.md +2 -2
  9. package/dist/assets/skills/project/references/anti-patterns.md +2 -2
  10. package/dist/assets/skills/project/references/preview.md +6 -7
  11. package/dist/{awk2-BBAGSFUB-Clvg_OoV.mjs → awk2-BBAGSFUB-J2xHCDg9.mjs} +1 -1
  12. package/dist/{banner-BxCFCyu8.mjs → banner-BLebOalA.mjs} +1 -1
  13. package/dist/{base64-4YMZCVJ5-bqN_UBX0.mjs → base64-4YMZCVJ5-7sdZaIym.mjs} +1 -1
  14. package/dist/{basename-AA2KJYZQ-GWPOMupJ.mjs → basename-AA2KJYZQ-2wWbuvGo.mjs} +1 -1
  15. package/dist/bash-IJWYRKFO-DZw47AKL.mjs +1 -0
  16. package/dist/{blockDiagram-DXYQGD6D-D_l7RLVS.mjs → blockDiagram-DXYQGD6D-CDF9Ye8Y.mjs} +2 -2
  17. package/dist/{c4Diagram-AHTNJAMY-QadWjRVL.mjs → c4Diagram-AHTNJAMY-Bckbt7OJ.mjs} +2 -2
  18. package/dist/{cat-RDUMLXKC-Cqi4_PjZ.mjs → cat-RDUMLXKC-CokinDWR.mjs} +1 -1
  19. package/dist/channel-DR5xnYq9.mjs +2 -0
  20. package/dist/{chmod-SYMGL4JA-C_dD-tNl.mjs → chmod-SYMGL4JA-BgW31dpi.mjs} +1 -1
  21. package/dist/{chokidar-D1eNAlbX.mjs → chokidar-987bEGiR.mjs} +1 -1
  22. package/dist/{chunk-2KRD3SAO-BXl7sX-7.mjs → chunk-2KRD3SAO-CS4H0Mr8.mjs} +2 -2
  23. package/dist/{chunk-2TRDZQLB-C2G-sahM.mjs → chunk-2TRDZQLB-FBZrMh7I.mjs} +1 -1
  24. package/dist/{chunk-336JU56O-5giJrfiv.mjs → chunk-336JU56O-41A5UOXQ.mjs} +2 -2
  25. package/dist/{chunk-3BS5SKQH-HZ1-1bfb.mjs → chunk-3BS5SKQH-BgobawvM.mjs} +3 -3
  26. package/dist/{chunk-3H6UQG3A-DdNaIxPm.mjs → chunk-3H6UQG3A-81boVLpx.mjs} +2 -2
  27. package/dist/{chunk-3ZUFRYJ4-Bv1jGN68.mjs → chunk-3ZUFRYJ4-BvA54ZND.mjs} +1 -1
  28. package/dist/chunk-426QAEUC-BMDn-Km8.mjs +2 -0
  29. package/dist/{chunk-4BX2VUAB-DM-mXRDw.mjs → chunk-4BX2VUAB-qQBUBIK0.mjs} +2 -2
  30. package/dist/{chunk-4GTNDTRF-DLnFbNSw.mjs → chunk-4GTNDTRF-l-JvU_6a.mjs} +2 -2
  31. package/dist/{chunk-4HHKTUW3-Ct4ue15f.mjs → chunk-4HHKTUW3-B-MXADMt.mjs} +1 -1
  32. package/dist/{chunk-4Q4SM6WR-CAvCnPq5.mjs → chunk-4Q4SM6WR-Dgi6n3oq.mjs} +2 -2
  33. package/dist/{chunk-4TB4RGXK-DWREoP49.mjs → chunk-4TB4RGXK-EuzZYGK6.mjs} +2 -2
  34. package/dist/{chunk-55IACEB6-Cmyc0XwJ.mjs → chunk-55IACEB6-BWXxTtYm.mjs} +2 -2
  35. package/dist/{chunk-55VFSPNA-RFvY6zq0.mjs → chunk-55VFSPNA-Bi0b3AwI.mjs} +2 -2
  36. package/dist/{chunk-5FUZZQ4R-DFR5eSi-.mjs → chunk-5FUZZQ4R-BQ_uOgdA.mjs} +2 -2
  37. package/dist/{chunk-5PVQY5BW-C5V4E1lO.mjs → chunk-5PVQY5BW-Bv35hkyA.mjs} +2 -2
  38. package/dist/{chunk-5QVNJEHU-BV0xuiYW.mjs → chunk-5QVNJEHU-HZCmTBXX.mjs} +2 -2
  39. package/dist/{chunk-5V6VZH6T-ByuVaPWr.mjs → chunk-5V6VZH6T-DtvstltO.mjs} +2 -2
  40. package/dist/{chunk-62RKD26F-K5NW6_Si.mjs → chunk-62RKD26F-BCWvPKD3.mjs} +2 -2
  41. package/dist/{chunk-64BAICW3-BlirlXmE.mjs → chunk-64BAICW3-ldBoH9M8.mjs} +2 -2
  42. package/dist/{chunk-67CJDMHE-C58W8DAL.mjs → chunk-67CJDMHE-DDQINw-J.mjs} +2 -2
  43. package/dist/{chunk-6Z5SFZXK-C3WlMqq-.mjs → chunk-6Z5SFZXK-DHOjsS81.mjs} +2 -2
  44. package/dist/{chunk-74CEPOFO-V0JXh91S.mjs → chunk-74CEPOFO-BnsihHv5.mjs} +1 -1
  45. package/dist/{chunk-7L36YK2X-B3QRwLbB.mjs → chunk-7L36YK2X-B6FqeSqt.mjs} +1 -1
  46. package/dist/{chunk-7N4EOEYR-DzEIb3Sc.mjs → chunk-7N4EOEYR-BzlThL0w.mjs} +2 -2
  47. package/dist/{chunk-7TSDKFEO-CMVuiOdP.mjs → chunk-7TSDKFEO-toaIg90F.mjs} +1 -1
  48. package/dist/{chunk-A4HU7SVR-Bjuqsbev.mjs → chunk-A4HU7SVR-hpfRmc5Q.mjs} +1 -1
  49. package/dist/{chunk-A4JSPFCI-BA544Kdp.mjs → chunk-A4JSPFCI-DiA7Hz_1.mjs} +2 -2
  50. package/dist/{chunk-A65PWWJC-GGt9898w.mjs → chunk-A65PWWJC-BZ0ifC4p.mjs} +2 -2
  51. package/dist/{chunk-A7A2DBEE-BqvlRSRw.mjs → chunk-A7A2DBEE-CTyGeCV-.mjs} +1 -1
  52. package/dist/{chunk-A7ICOL4V-D5TsVU6v.mjs → chunk-A7ICOL4V-Mvr5jw7a.mjs} +2 -2
  53. package/dist/{chunk-AA7GKIK3-DKgpQZxa.mjs → chunk-AA7GKIK3-CIHY93mN.mjs} +2 -2
  54. package/dist/{chunk-ALLTKNUZ-4H3OLfNN.mjs → chunk-ALLTKNUZ-_L2HGfkh.mjs} +2 -2
  55. package/dist/{chunk-APT7OOP2-DnIeUlVe.mjs → chunk-APT7OOP2-Dtyp8EZq.mjs} +2 -2
  56. package/dist/{chunk-BSJP7CBP-BG3yJGkJ.mjs → chunk-BSJP7CBP-DLDhpSB6.mjs} +2 -2
  57. package/dist/{chunk-CIAEETIT-CH33zQ9L.mjs → chunk-CIAEETIT-CFi4NG_D.mjs} +2 -2
  58. package/dist/{chunk-D4J545R4-KlK3EOFl.mjs → chunk-D4J545R4-BtxtW2-r.mjs} +2 -2
  59. package/dist/{chunk-D6CWQ5DW-CaV8X9is.mjs → chunk-D6CWQ5DW-Cv88ySaX.mjs} +2 -2
  60. package/dist/{chunk-D7MEQ3VN-BM_kIbvf.mjs → chunk-D7MEQ3VN-s3ii1vV3.mjs} +2 -2
  61. package/dist/{chunk-DBKNVD4L-BVx-WyDG.mjs → chunk-DBKNVD4L-CXGQWbr1.mjs} +2 -2
  62. package/dist/{chunk-DCAAORBQ-BUMlCZ4-.mjs → chunk-DCAAORBQ-Cwpta7jB.mjs} +2 -2
  63. package/dist/{chunk-EDXVE4YY-B_wA-KGy.mjs → chunk-EDXVE4YY-CypRnEuH.mjs} +2 -2
  64. package/dist/{chunk-EEXR5ZDP-CvpAxUxM.mjs → chunk-EEXR5ZDP-Cg_MqHXw.mjs} +1 -1
  65. package/dist/{chunk-EIZGF4BS-C8wRSfCC.mjs → chunk-EIZGF4BS-BcAccPFl.mjs} +2 -2
  66. package/dist/{chunk-ENJZ2VHE-DwiyImt2.mjs → chunk-ENJZ2VHE-dY0aiIZS.mjs} +2 -2
  67. package/dist/{chunk-F23WWYKW-DLeNVzzD.mjs → chunk-F23WWYKW-hlCDVuyH.mjs} +2 -2
  68. package/dist/{chunk-FMBD7UC4-CAloFUY3.mjs → chunk-FMBD7UC4-DWi7gSvW.mjs} +2 -2
  69. package/dist/{chunk-FOC6F5B3-Cv5O0Fxp.mjs → chunk-FOC6F5B3-DWNL6Y45.mjs} +2 -2
  70. package/dist/{chunk-GCTKCWKD-D3J1Ev9z.mjs → chunk-GCTKCWKD-Ca87JXBd.mjs} +1 -1
  71. package/dist/{chunk-GOV5EKKI-x0jEbztj.mjs → chunk-GOV5EKKI-B5v6YeVX.mjs} +2 -2
  72. package/dist/{chunk-GXVXFKBA-D0BDCtkE.mjs → chunk-GXVXFKBA-CtGvxFMt.mjs} +2 -2
  73. package/dist/{chunk-HDQ56CKY-DZc2LbWr.mjs → chunk-HDQ56CKY-Dw8W-PIc.mjs} +2 -2
  74. package/dist/{chunk-HJQJAYMS-BS_JF11O.mjs → chunk-HJQJAYMS-QHp_mUpd.mjs} +1 -1
  75. package/dist/{chunk-HJWBQKYG-DknkBuxy.mjs → chunk-HJWBQKYG-pJ7ff6Os.mjs} +2 -2
  76. package/dist/{chunk-HKLCLINH-DwmCAW4U.mjs → chunk-HKLCLINH-FUIlJZ9Y.mjs} +3 -3
  77. package/dist/{chunk-HL6NGDO2-978327U5.mjs → chunk-HL6NGDO2-CONVsScQ.mjs} +2 -2
  78. package/dist/{chunk-HWKDQ44K-BJxdK4fT.mjs → chunk-HWKDQ44K-1iwkoMQO.mjs} +2 -2
  79. package/dist/{chunk-I57KEIP3-DpiJySG6.mjs → chunk-I57KEIP3-ok19Mtn9.mjs} +1 -1
  80. package/dist/{chunk-ICPOFSXX-D0MVsm4H.mjs → chunk-ICPOFSXX-d7VyKeM8.mjs} +2 -2
  81. package/dist/{chunk-JVPRLUMK-D6CRdXSO.mjs → chunk-JVPRLUMK-cjhtQJTo.mjs} +2 -2
  82. package/dist/{chunk-K5T4RW27-BPgPjo39.mjs → chunk-K5T4RW27-CkUFJKhh.mjs} +2 -2
  83. package/dist/{chunk-K6LIBGJA-DpjaSGfc.mjs → chunk-K6LIBGJA-RtZC97IJ.mjs} +2 -2
  84. package/dist/{chunk-KGLVRYIC-CmkADDeV.mjs → chunk-KGLVRYIC-CBBBeMsl.mjs} +2 -2
  85. package/dist/{chunk-KMEYNNUA-Qk0eg7gN.mjs → chunk-KMEYNNUA-DG96DsNs.mjs} +2 -2
  86. package/dist/{chunk-KRBPSX3W-nYEMVABW.mjs → chunk-KRBPSX3W-plcpns8G.mjs} +2 -2
  87. package/dist/{chunk-LIHQZDEY-Fy8O-IVI.mjs → chunk-LIHQZDEY-clY2P5Xu.mjs} +2 -2
  88. package/dist/{chunk-LL3S3NLB-CH16p_-s.mjs → chunk-LL3S3NLB-YW2mgOlX.mjs} +2 -2
  89. package/dist/{chunk-LTZRCH7N-BfgCUlp9.mjs → chunk-LTZRCH7N-CyLjQtsr.mjs} +2 -2
  90. package/dist/{chunk-LWEGUNWT-DhbhFY11.mjs → chunk-LWEGUNWT-CXnfCeY3.mjs} +2 -2
  91. package/dist/{chunk-MDDMCKUK-CuQlmIio.mjs → chunk-MDDMCKUK-xLFNbrrZ.mjs} +2 -2
  92. package/dist/{chunk-MDLLFABN-UsHGHHoh.mjs → chunk-MDLLFABN-Dp0zh05T.mjs} +2 -2
  93. package/dist/{chunk-MHTUABJP-Dk5ocjFo.mjs → chunk-MHTUABJP-hQBYMJwY.mjs} +1 -1
  94. package/dist/{chunk-MIZPJHVH-Bo1j-3C3.mjs → chunk-MIZPJHVH-CxUaLYah.mjs} +2 -2
  95. package/dist/{chunk-MLXIYONF-DRuy-_4a.mjs → chunk-MLXIYONF-Bt-276H_.mjs} +1 -1
  96. package/dist/{chunk-MYE6AGBJ-DwzjGrc0.mjs → chunk-MYE6AGBJ-DmBUXN6H.mjs} +2 -2
  97. package/dist/{chunk-NAERJDUW-0UrOIQ6q.mjs → chunk-NAERJDUW-Cav--2Fy.mjs} +2 -2
  98. package/dist/{chunk-NCNPKYJZ-Ct0_l0YT.mjs → chunk-NCNPKYJZ-LS-Ky-i5.mjs} +2 -2
  99. package/dist/{chunk-NUYSJFDK-BvwS54ju.mjs → chunk-NUYSJFDK-D6pqIPwG.mjs} +2 -2
  100. package/dist/{chunk-OCLXQMOG-CCPg8vjW.mjs → chunk-OCLXQMOG-Dd0G6A5F.mjs} +2 -2
  101. package/dist/{chunk-OCS6LSEM-DkbaohJu.mjs → chunk-OCS6LSEM-CALXGrIt.mjs} +2 -2
  102. package/dist/{chunk-ORNJ4GCN-R_gUIosC.mjs → chunk-ORNJ4GCN-CqFReEiX.mjs} +2 -2
  103. package/dist/{chunk-OYMX7WX6-BrOfVMt8.mjs → chunk-OYMX7WX6-CQi5rS4T.mjs} +2 -2
  104. package/dist/{chunk-PBXLG62G-C7MEQojr.mjs → chunk-PBXLG62G-BaQR-Pos.mjs} +2 -2
  105. package/dist/{chunk-PP6PSHAB-DQ3LPONR.mjs → chunk-PP6PSHAB-DAEjIF1x.mjs} +1 -1
  106. package/dist/{chunk-PXTK5WE2-B17f9YTq.mjs → chunk-PXTK5WE2-DtNgPWAM.mjs} +1 -1
  107. package/dist/{chunk-PYSFUGCK-B_Gv8rUn.mjs → chunk-PYSFUGCK-Dy_8qlqA.mjs} +2 -2
  108. package/dist/{chunk-QCDB2VPH-Bays5mAr.mjs → chunk-QCDB2VPH-XUYEp26q.mjs} +2 -2
  109. package/dist/{chunk-QJ7O6ZN3-BCF2wp2J.mjs → chunk-QJ7O6ZN3-jw3_Ap-D.mjs} +2 -2
  110. package/dist/{chunk-QZHKN3VN-D0OJ2eQ1.mjs → chunk-QZHKN3VN-drjmYlbU.mjs} +2 -2
  111. package/dist/{chunk-R6QSAL5T-RaNW7MSS.mjs → chunk-R6QSAL5T-ChOEHgTM.mjs} +1 -1
  112. package/dist/{chunk-RPNGRAAP-yHFoBjjv.mjs → chunk-RPNGRAAP-CihnEKHU.mjs} +2 -2
  113. package/dist/{chunk-SDNKECQQ-BsAYzqU5.mjs → chunk-SDNKECQQ-CD_0Ct0o.mjs} +2 -2
  114. package/dist/{chunk-SNN4IESC-C-P75V1I.mjs → chunk-SNN4IESC-Io5Uw9il.mjs} +1 -1
  115. package/dist/{chunk-T56QNPHK-B6DfVzfs.mjs → chunk-T56QNPHK-CBaNulWg.mjs} +2 -2
  116. package/dist/{chunk-TLSUDHID-SuIGgADo.mjs → chunk-TLSUDHID-B89Qk3Em.mjs} +2 -2
  117. package/dist/{chunk-TOMNU26N-Dw9Enq1O.mjs → chunk-TOMNU26N-C1sG6Msz.mjs} +2 -2
  118. package/dist/{chunk-TP4BZANS-eJW0TOjs.mjs → chunk-TP4BZANS-CTpZAzJp.mjs} +2 -2
  119. package/dist/{chunk-TXBZCHCQ-BxbbtyNr.mjs → chunk-TXBZCHCQ-DVmekj_k.mjs} +2 -2
  120. package/dist/{chunk-U2HBQHQK-DB1SzWgs.mjs → chunk-U2HBQHQK-C6hC2wN2.mjs} +2 -2
  121. package/dist/{chunk-V5MWI2OL-CDEVEp7K.mjs → chunk-V5MWI2OL-DHeEw-Bw.mjs} +1 -1
  122. package/dist/{chunk-V7TAPXDL-CKif4_mH.mjs → chunk-V7TAPXDL-C2zCZaaT.mjs} +2 -2
  123. package/dist/{chunk-VJFXDYWH-CWlZv59U.mjs → chunk-VJFXDYWH-CMil6w7F.mjs} +2 -2
  124. package/dist/{chunk-VOBGTVA6-D6fSjWnx.mjs → chunk-VOBGTVA6-DUmK2uFM.mjs} +2 -2
  125. package/dist/{chunk-VYOJP4TV-DN1CSkP5.mjs → chunk-VYOJP4TV-NY3mkQfC.mjs} +2 -2
  126. package/dist/{chunk-WKFATFPP-CoPg2OGf.mjs → chunk-WKFATFPP-CCzbk9l_.mjs} +2 -2
  127. package/dist/{chunk-X2AJGDEF-ClcErtij.mjs → chunk-X2AJGDEF-B2IEuWMO.mjs} +1 -1
  128. package/dist/{chunk-X2U36JSP-CqOGcGN3.mjs → chunk-X2U36JSP-DUT3KN7v.mjs} +2 -2
  129. package/dist/{chunk-XKQRETAK-BC2HZ_y9.mjs → chunk-XKQRETAK-DBH8-r13.mjs} +2 -2
  130. package/dist/{chunk-XKWWSDBF-XuPgN5BP.mjs → chunk-XKWWSDBF-CkT22GKu.mjs} +2 -2
  131. package/dist/{chunk-XPW4576I-BkucPPwf.mjs → chunk-XPW4576I-BUNNk3WJ.mjs} +2 -2
  132. package/dist/{chunk-XVDPCNWR-CkzIJQaO.mjs → chunk-XVDPCNWR-Dpmdq7tW.mjs} +2 -2
  133. package/dist/{chunk-YMMW5UAP-uYgeXT56.mjs → chunk-YMMW5UAP-x2y4_E_a.mjs} +2 -2
  134. package/dist/{chunk-YTNYSM6T-DcovOiF_.mjs → chunk-YTNYSM6T-B7Pxr8mf.mjs} +2 -2
  135. package/dist/{chunk-YULBWSET-BYBVdNmi.mjs → chunk-YULBWSET-DXl2KqKD.mjs} +2 -2
  136. package/dist/{chunk-YZCP3GAM-CkC6DoBJ.mjs → chunk-YZCP3GAM-DyF0VN0o.mjs} +2 -2
  137. package/dist/{chunk-Z6LRHWXI-BLaYoFnT.mjs → chunk-Z6LRHWXI-cYQeZ0uN.mjs} +1 -1
  138. package/dist/{chunk-Z7JVV2SM-BtFBVQEW.mjs → chunk-Z7JVV2SM-Bx_fzdEl.mjs} +2 -2
  139. package/dist/{chunk-ZZ45TVLE-CXznFlWR.mjs → chunk-ZZ45TVLE-CHtfsZGo.mjs} +2 -2
  140. package/dist/{chunk-ZZO3UDB3-CdVtmXn4.mjs → chunk-ZZO3UDB3-CLOJXZMQ.mjs} +2 -2
  141. package/dist/classDiagram-6PBFFD2Q-B7c1vwT5.mjs +2 -0
  142. package/dist/classDiagram-v2-HSJHXN6E-B6n2AR2x.mjs +2 -0
  143. package/dist/{clear-5CZ5X4YR-C4DTv-gF.mjs → clear-5CZ5X4YR-CvTPqJ5U.mjs} +1 -1
  144. package/dist/cli.mjs +67 -66
  145. package/dist/clone-BftAxCKp.mjs +2 -0
  146. package/dist/{column-WLPMMSTS-Bg1ZsVDm.mjs → column-WLPMMSTS-D4CsWORw.mjs} +1 -1
  147. package/dist/{comm-5SLSESQG-CTh1BUfn.mjs → comm-5SLSESQG-CHmFSxue.mjs} +1 -1
  148. package/dist/constants-CgHcIqh6.mjs +2 -0
  149. package/dist/{cose-bilkent-S5V4N54A-E5vxHQ63.mjs → cose-bilkent-S5V4N54A-C3h1ARwX.mjs} +2 -2
  150. package/dist/{du-WO2ENHXQ-Cq3dzRFU.mjs → cp-XOYR4ABJ-DiV6v-rq.mjs} +1 -1
  151. package/dist/{curl-47BFPSFW-ClMENMWY.mjs → curl-47BFPSFW-C96qO4u5.mjs} +2 -2
  152. package/dist/{cut-OPC3VAGB-BDAM8WY8.mjs → cut-OPC3VAGB-Dh_rqL_i.mjs} +1 -1
  153. package/dist/{cytoscape.esm-BNCKY88j.mjs → cytoscape.esm-oBubee51.mjs} +1 -1
  154. package/dist/{dagre-LJG-5J7U.mjs → dagre-DxZjUi2H.mjs} +2 -2
  155. package/dist/{dagre-KV5264BT-C5SrnhX7.mjs → dagre-KV5264BT-JumxHSx7.mjs} +2 -2
  156. package/dist/{head-HT2B6D2J-DSAed845.mjs → date-DD7FVA2V-BUi7854q.mjs} +1 -1
  157. package/dist/{defaultLocale-BljHASC9.mjs → defaultLocale-BoxjDp6q.mjs} +1 -1
  158. package/dist/{diagram-5BDNPKRD-biBuhEzo.mjs → diagram-5BDNPKRD-BKDmayAE.mjs} +2 -2
  159. package/dist/{diagram-G4DWMVQ6-CHhS5h96.mjs → diagram-G4DWMVQ6-BBJ-sDt9.mjs} +2 -2
  160. package/dist/{diagram-MMDJMWI5-BgulNwvp.mjs → diagram-MMDJMWI5-i6W6mBce.mjs} +2 -2
  161. package/dist/{diagram-TYMM5635-DpmgERPD.mjs → diagram-TYMM5635-DkpztQam.mjs} +2 -2
  162. package/dist/diff-HJF2MPDN-Be83Imv3.mjs +1 -0
  163. package/dist/{dirname-LEMTZZFS-VsUIxZwx.mjs → dirname-LEMTZZFS-COuSzSN5.mjs} +1 -1
  164. package/dist/{dist-BbS1zQiy.mjs → dist-DAVo_TRx.mjs} +20 -20
  165. package/dist/dist-DJ0wJimx.mjs +1 -0
  166. package/dist/{dist-DZb_HoiN.mjs → dist-DpbxhJFx.mjs} +1 -1
  167. package/dist/{cp-XOYR4ABJ-VqiK1WcH.mjs → du-WO2ENHXQ-BrzeR0-x.mjs} +1 -1
  168. package/dist/echo-O45JWWI2-WsFSMrjp.mjs +1 -0
  169. package/dist/env-5EPCWSXR-BJC9qdBG.mjs +1 -0
  170. package/dist/{erDiagram-SMLLAGMA-BNISHenz.mjs → erDiagram-SMLLAGMA-B3ODWJAo.mjs} +2 -2
  171. package/dist/{execAsync-B4xEJACY.mjs → execAsync-03jh9_uL.mjs} +1 -1
  172. package/dist/{execAsync-Chx_LJuI.mjs → execAsync-BCYkb_Yo.mjs} +1 -1
  173. package/dist/{execAsync-DunQtInX.mjs → execAsync-bfdilfbQ.mjs} +1 -1
  174. package/dist/{expand-DTNXU4LQ-Bp3M0RnL.mjs → expand-DTNXU4LQ-BSxRnNK8.mjs} +1 -1
  175. package/dist/expr-YYCVMXE3-DEtS2Bb0.mjs +1 -0
  176. package/dist/{date-DD7FVA2V-nDqDn5ZQ.mjs → file-IGDTDPLG-DlvUkVAa.mjs} +1 -1
  177. package/dist/find-DH2ALKQS-DSbKkobO.mjs +1 -0
  178. package/dist/flag-coverage-6JEX67RU-BpprwupD.mjs +2 -0
  179. package/dist/{flatten-CX5MwHL4.mjs → flatten-DN9kjoEG.mjs} +2 -2
  180. package/dist/{flowDiagram-DWJPFMVM-CFu645eN.mjs → flowDiagram-DWJPFMVM-IgVXZy1K.mjs} +2 -2
  181. package/dist/{fold-LDSORVYE-Bx5XDGgK.mjs → fold-LDSORVYE-Cgx6V7hj.mjs} +1 -1
  182. package/dist/{ganttDiagram-T4ZO3ILL-DhKUbpmR.mjs → ganttDiagram-T4ZO3ILL-2GQbgjw4.mjs} +2 -2
  183. package/dist/{getMachineId-bsd-Bt-frlcx.mjs → getMachineId-bsd-CZV52euR.mjs} +2 -2
  184. package/dist/{getMachineId-bsd-DC8LkcdK.mjs → getMachineId-bsd-CiJGYKVm.mjs} +2 -2
  185. package/dist/{getMachineId-bsd-DFsE-K5i.mjs → getMachineId-bsd-rBzlEMXn.mjs} +2 -2
  186. package/dist/{getMachineId-darwin-B9GQUU0e.mjs → getMachineId-darwin-CBVWH2ev.mjs} +2 -2
  187. package/dist/{getMachineId-darwin-DMNBrKWp.mjs → getMachineId-darwin-DZ2QXoUt.mjs} +2 -2
  188. package/dist/{getMachineId-darwin-DRxpszyZ.mjs → getMachineId-darwin-ZfRSQhwf.mjs} +2 -2
  189. package/dist/{getMachineId-linux-D9dNX75P.mjs → getMachineId-linux-CRpWR2Xf.mjs} +1 -1
  190. package/dist/{getMachineId-linux-DOv7iOg-.mjs → getMachineId-linux-DwNbOq4U.mjs} +1 -1
  191. package/dist/{getMachineId-linux-B5vQV4C7.mjs → getMachineId-linux-myvu2F75.mjs} +1 -1
  192. package/dist/{getMachineId-unsupported-D6sWFm_K.mjs → getMachineId-unsupported-BUNmL05z.mjs} +1 -1
  193. package/dist/{getMachineId-unsupported-DdAD6gRb.mjs → getMachineId-unsupported-BoA-zzsf.mjs} +1 -1
  194. package/dist/{getMachineId-unsupported-BQ6KY9w-.mjs → getMachineId-unsupported-DnLw1pHF.mjs} +1 -1
  195. package/dist/{getMachineId-win-BZsHRo32.mjs → getMachineId-win-BykI_KPM.mjs} +2 -2
  196. package/dist/{getMachineId-win-CpDtoa22.mjs → getMachineId-win-C_OepWkK.mjs} +2 -2
  197. package/dist/{getMachineId-win-BMQSc3Xj.mjs → getMachineId-win-DdqXbGCa.mjs} +2 -2
  198. package/dist/{gh-detect-Co-jRtcQ.mjs → gh-detect-BxDh8M_E.mjs} +2 -2
  199. package/dist/gitGraph-7Q5UKJZL-BHgBQaev.mjs +1 -0
  200. package/dist/{gitGraphDiagram-UUTBAWPF-Cwemn6Ch.mjs → gitGraphDiagram-UUTBAWPF-WoVzHmmn.mjs} +2 -2
  201. package/dist/{graphlib-5CpUx0Yq.mjs → graphlib-CnQJqmVu.mjs} +2 -2
  202. package/dist/grep-2HUTXO5U-C40o2gtS.mjs +1 -0
  203. package/dist/gzip-AQXSGOVS-D7nHvr3D.mjs +1 -0
  204. package/dist/{file-IGDTDPLG-DQaFkvTu.mjs → head-HT2B6D2J-CQ8o4Vkb.mjs} +1 -1
  205. package/dist/help-VVWX7SA5-CiA7qg3p.mjs +1 -0
  206. package/dist/history-J4QRNGRO-CW1hmcPP.mjs +1 -0
  207. package/dist/{hostname-BK6HG2DE-_qJ9gN13.mjs → hostname-BK6HG2DE-BeHMNLVT.mjs} +1 -1
  208. package/dist/html-to-markdown-TFCECAGV-DxAcnDx-.mjs +1 -0
  209. package/dist/index.d.mts +1 -58
  210. package/dist/index.mjs +1 -1
  211. package/dist/info-OMHHGYJF-DFOa7qkq.mjs +1 -0
  212. package/dist/{infoDiagram-42DDH7IO-D0XeM9Mm.mjs → infoDiagram-42DDH7IO-DMFBf33Y.mjs} +2 -2
  213. package/dist/{init-L1KCVOHH.mjs → init-BL40T-Vz.mjs} +1 -1
  214. package/dist/init-CNK7GfhY.mjs +1 -0
  215. package/dist/init-Cj3rYYNW.mjs +653 -0
  216. package/dist/{isEmpty-CaTO-fHo.mjs → isEmpty-CNxsONwW.mjs} +2 -2
  217. package/dist/{ishikawaDiagram-UXIWVN3A-vTBTHzHj.mjs → ishikawaDiagram-UXIWVN3A-CJ8lY0Nl.mjs} +2 -2
  218. package/dist/{join-GG2LDHE5-BMnXfCXQ.mjs → join-GG2LDHE5-DWqB9tv7.mjs} +1 -1
  219. package/dist/{journeyDiagram-VCZTEJTY-Dq1fLo6N.mjs → journeyDiagram-VCZTEJTY-IdyKUh_g.mjs} +2 -2
  220. package/dist/jq-LYZFFBZB-Bq_F0mxX.mjs +1 -0
  221. package/dist/{js-exec-VXN6TZ7U-fCXuAS2-.mjs → js-exec-VXN6TZ7U-DRTFMoYG.mjs} +2 -2
  222. package/dist/{kanban-definition-6JOO6SKY-B03_bODj.mjs → kanban-definition-6JOO6SKY-C1sB4ii4.mjs} +2 -2
  223. package/dist/launch-json-removal-Bsd2If9V.mjs +2 -0
  224. package/dist/{lib-CCQO9uWA.mjs → lib-BLR9KuxL.mjs} +1 -1
  225. package/dist/{lib-BbNAtG4h.mjs → lib-De0kNlJU.mjs} +1 -1
  226. package/dist/{line-C62ka-l9.mjs → line-T8d2uu7j.mjs} +2 -2
  227. package/dist/{linear-gA98NGf7.mjs → linear-BVIeiSZs.mjs} +2 -2
  228. package/dist/{ln-4TRFBYAT-Byit-TLI.mjs → ln-4TRFBYAT-CpScyeFk.mjs} +1 -1
  229. package/dist/loader-BkadQueQ.mjs +1 -0
  230. package/dist/{loader-B0Twaq2k.mjs → loader-DBQRSW23.mjs} +2 -2
  231. package/dist/ls-KSXFZCWH-BMq2C6AP.mjs +1 -0
  232. package/dist/{lzma-BSEvzrCT.mjs → lzma-6vaD4w9R.mjs} +1 -1
  233. package/dist/{mcp-migrate-event-D0NrGjvc.mjs → mcp-migrate-event-CyH1VVyy.mjs} +1 -1
  234. package/dist/md5sum-INMIK4DX-BbHBkH1A.mjs +1 -0
  235. package/dist/{mermaid-parser.core-Cx4njenA.mjs → mermaid-parser.core-DjFy6YnS.mjs} +2 -2
  236. package/dist/{mermaid.core-LrO0u_wA.mjs → mermaid.core-DyEIpJO9.mjs} +3 -3
  237. package/dist/{mindmap-definition-QFDTVHPH-b0aFdJAS.mjs → mindmap-definition-QFDTVHPH-BdMSEWgq.mjs} +2 -2
  238. package/dist/mkdir-TDEMSB6C-9ppkyu1-.mjs +1 -0
  239. package/dist/mv-Z6MORUFL-CZIq395W.mjs +1 -0
  240. package/dist/{nl-U5YJDM32-Bs_nMrMg.mjs → nl-U5YJDM32-DdxB9n-y.mjs} +1 -1
  241. package/dist/{od-VJEF2UR5-DwpkPMHp.mjs → od-VJEF2UR5-DIQMQQUN.mjs} +1 -1
  242. package/dist/{open-browser-DMRT-DpW.mjs → open-browser-6ztGUs93.mjs} +2 -2
  243. package/dist/{ordinal-BCuCMCHk.mjs → ordinal-DNNCjWTJ.mjs} +2 -2
  244. package/dist/packet-4T2RLAQJ-CdySh7r7.mjs +1 -0
  245. package/dist/paste-7N6AFSDS-D89jcQ7Z.mjs +1 -0
  246. package/dist/{path-C9DYqGo_.mjs → path-oDLMmjI_.mjs} +1 -1
  247. package/dist/pie-ZZUOXDRM-BSuHluiX.mjs +1 -0
  248. package/dist/{pieDiagram-DEJITSTG-C77h8TOO.mjs → pieDiagram-DEJITSTG-2VW9qBbL.mjs} +2 -2
  249. package/dist/{preview-CNYn-min.mjs → preview-4_TQ2eLW.mjs} +2 -2
  250. package/dist/preview-4uaPC3tK.mjs +1 -0
  251. package/dist/printf-CX64KX2P-m6K8MBPi.mjs +1 -0
  252. package/dist/public/assets/{ActivityModeContent-mVRGV66w.js → ActivityModeContent-gJPRToqC.js} +1 -1
  253. package/dist/public/assets/{CodeMirrorPropInput-D5H6xSL_.js → CodeMirrorPropInput-A-b7Ox39.js} +1 -1
  254. package/dist/public/assets/{ConsentDialogBody-DpW_fWHO.js → ConsentDialogBody-BuKqWdML.js} +2 -2
  255. package/dist/public/assets/{DocumentContext-CKEIVeX1.js → DocumentContext-Cf3xyIUc.js} +7 -7
  256. package/dist/public/assets/{EnableSyncConfirmDialog-BLuCj6gn.js → EnableSyncConfirmDialog-Ds9VzFz7.js} +1 -1
  257. package/dist/public/assets/{GraphPanel-B4d24Bm9.js → GraphPanel-DticGDW4.js} +1 -1
  258. package/dist/public/assets/{ManagedArtifactProperties-D-LbzNYB.js → ManagedArtifactProperties-BG7ax3pN.js} +1 -1
  259. package/dist/public/assets/{McpConsentDialogBody-IQQRiBVd.js → McpConsentDialogBody-jKfEiUIH.js} +1 -1
  260. package/dist/public/assets/{MermaidDocEditor-CdV2PRKa.js → MermaidDocEditor-B_WSq6De.js} +1 -1
  261. package/dist/public/assets/{PropertyPanel-B7eV5Tcu.js → PropertyPanel-JSTiSMvX.js} +1 -1
  262. package/dist/public/assets/SettingsDialogBody-C4mvHDJH.js +7 -0
  263. package/dist/public/assets/{ShareBranchSwitchDialog-BJmWeDPf.js → ShareBranchSwitchDialog-2z9NWmqe.js} +1 -1
  264. package/dist/public/assets/{ShareReceiveDialog-BVOJDKXk.js → ShareReceiveDialog-CGSDsgBh.js} +1 -1
  265. package/dist/public/assets/{ShareReceiveMissDialog-CH6uraGh.js → ShareReceiveMissDialog-D7zjXalK.js} +1 -1
  266. package/dist/public/assets/{SkillEditorActions-1SA0Sfoq.js → SkillEditorActions-CxGse8tc.js} +1 -1
  267. package/dist/public/assets/{SourceEditor-BA4ZZSKZ.js → SourceEditor-B4hGDoTR.js} +1 -1
  268. package/dist/public/assets/{TerminalPanel-Cvai8HvA.js → TerminalPanel-B3CcTB8S.js} +1 -1
  269. package/dist/public/assets/{agent-presence-CWtl35ms.js → agent-presence-DJQje6SV.js} +1 -1
  270. package/dist/public/assets/{auth-state-cache-ROXaeSig.js → auth-state-cache-DyKWS3xm.js} +3 -3
  271. package/dist/public/assets/{config-provider-C7vWo2tJ.js → config-provider-D0CfBIwU.js} +1 -1
  272. package/dist/public/assets/{dist-DN4vicwQ.js → dist-CJc7OX7s.js} +2 -2
  273. package/dist/public/assets/{dist-C-f1kbPA.js → dist-DoFKRM_F.js} +1 -1
  274. package/dist/public/assets/{doc-hash-BRcc1l8V.js → doc-hash-B7rSgZqz.js} +1 -1
  275. package/dist/public/assets/{documents-events-Z18kbrmq.js → documents-events-Bit0pJeY.js} +1 -1
  276. package/dist/public/assets/{file-tree-adapter-DJIk8Mtr.js → file-tree-adapter--v55j77z.js} +1 -1
  277. package/dist/public/assets/{index-DrjcjzLS.js → index--kgVY3Zd.js} +9 -9
  278. package/dist/public/assets/{keyboard-shortcuts-DVv_UWZp.js → keyboard-shortcuts-CvYXgqK4.js} +1 -1
  279. package/dist/public/assets/{navigation-targets-2KIKb2N7.js → navigation-targets-D-taKoGj.js} +1 -1
  280. package/dist/public/assets/{open-managed-artifact-tab-BYHLuUIG.js → open-managed-artifact-tab-Da7L5wL4.js} +1 -1
  281. package/dist/public/assets/{pending-receive-nav-store-DynS4M_y.js → pending-receive-nav-store-CAm5nHeI.js} +1 -1
  282. package/dist/public/assets/{project-paths-Cv9JzTbQ.js → project-paths-Bdm7wr4i.js} +1 -1
  283. package/dist/public/assets/{prop-types-CdM6RVrV.js → prop-types-BwJNmxtq.js} +1 -1
  284. package/dist/public/assets/{radio-group-CXUz67M8.js → radio-group-B0RG5um-.js} +1 -1
  285. package/dist/public/assets/{receive-store-BBXikFBW.js → receive-store-C72xSCDE.js} +1 -1
  286. package/dist/public/assets/{selection-context-DM7dh9w8.js → selection-context-JPA-xW1g.js} +1 -1
  287. package/dist/public/assets/{skill-actions-BGFjwgz8.js → skill-actions-CMd77Yt2.js} +1 -1
  288. package/dist/public/assets/{skills-api-BOT-8Fw4.js → skills-api-UoasHTUi.js} +1 -1
  289. package/dist/public/assets/{src-D2FMxg7w.js → src-CXdmKAqZ.js} +1 -1
  290. package/dist/public/assets/{target-navigation-intent-OcEXysbL.js → target-navigation-intent-C_Y-i35d.js} +1 -1
  291. package/dist/public/assets/{typing-burst-detector-BFnDTZhU.js → typing-burst-detector-DLup_S3P.js} +1 -1
  292. package/dist/public/assets/{workspace-paths-DAj8e6IA.js → workspace-paths-CYa5l8eZ.js} +1 -1
  293. package/dist/public/index.html +27 -27
  294. package/dist/pwd-D4OZ7N27-DTcVtxaf.mjs +1 -0
  295. package/dist/{python3-DNGS4G3E-bGzU9nm-.mjs → python3-DNGS4G3E-7DCL_jPA.mjs} +2 -2
  296. package/dist/{quadrantDiagram-34T5L4WZ-CLL-GTlz.mjs → quadrantDiagram-34T5L4WZ-CZz9f0uY.mjs} +2 -2
  297. package/dist/radar-PYXPWWZC-F8ZyHWJj.mjs +1 -0
  298. package/dist/readlink-MI4GCHJF-BaR3b_s7.mjs +1 -0
  299. package/dist/{reduce-V0ODtSr4.mjs → reduce-Liz4w9mV.mjs} +2 -2
  300. package/dist/repair-launch-json-CtA3dzno.mjs +2 -0
  301. package/dist/{repair-mcp-configs-CHisR-P4.mjs → repair-mcp-configs-DP4ZjS6O.mjs} +2 -2
  302. package/dist/repair-skills-B0TdudPZ.mjs +1 -0
  303. package/dist/{repair-skills-B_uZNXYU.mjs → repair-skills-zutt1is6.mjs} +2 -2
  304. package/dist/{requirementDiagram-MS252O5E-JIzm76n0.mjs → requirementDiagram-MS252O5E-BKR-IjfU.mjs} +2 -2
  305. package/dist/{rev-XOSYPP45-4azlKYu4.mjs → rev-XOSYPP45-CiowreCc.mjs} +1 -1
  306. package/dist/rg-XNF3R3II-BK6WaEMK.mjs +1 -0
  307. package/dist/rm-RTZG23RL-kkSjZLZ9.mjs +1 -0
  308. package/dist/rmdir-XTQXT7RK-BcuPRlwS.mjs +1 -0
  309. package/dist/{rough.cjs-C-63phNL.mjs → rough.cjs-C4mRMCLz.mjs} +1 -1
  310. package/dist/{sankeyDiagram-XADWPNL6-Bpk8eTPe.mjs → sankeyDiagram-XADWPNL6-BQFoQHCj.mjs} +2 -2
  311. package/dist/{sed-JAPPVBEU-BvDbOHs0.mjs → sed-JAPPVBEU-BGk7n3so.mjs} +1 -1
  312. package/dist/seq-RN5ZUASB-HvlCfepP.mjs +1 -0
  313. package/dist/{sequenceDiagram-FGHM5R23-CHCigzvZ.mjs → sequenceDiagram-FGHM5R23-D2GOGb_q.mjs} +2 -2
  314. package/dist/server-lock-GuuouVft-CCnjEa8y.mjs +1 -0
  315. package/dist/{server-lock-iLcBw_q0-i_GNVPAP.mjs → server-lock-iLcBw_q0-RDMfTH6b.mjs} +2 -2
  316. package/dist/sha1sum-VJPNLNU6-DIj6JJG_.mjs +1 -0
  317. package/dist/sha256sum-PI32XWXY-DDy3JdOM.mjs +1 -0
  318. package/dist/{sleep-VZFPZFWA-BgSOeH2N.mjs → sleep-VZFPZFWA-CrstvTLq.mjs} +1 -1
  319. package/dist/sort-DCNRDA7U-g5MLXkqb.mjs +1 -0
  320. package/dist/{split-SITCSYCZ-DqhMcIGL.mjs → split-SITCSYCZ-DgZtYh2-.mjs} +1 -1
  321. package/dist/{sqlite3-TE5AIOTF-DW7pT7NE.mjs → sqlite3-TE5AIOTF-Dj7QrkUm.mjs} +1 -1
  322. package/dist/{src-BkCVz_TJ.mjs → src-DBL0Mxlv.mjs} +1 -1
  323. package/dist/src-Z7vZvOn3.mjs +11 -0
  324. package/dist/{start-DIaR6Cov.mjs → start-B1VS-wwf.mjs} +2 -2
  325. package/dist/start-DGO0EIO_.mjs +1 -0
  326. package/dist/stat-BT5A227F-CN4E-TuS.mjs +1 -0
  327. package/dist/{stateDiagram-FHFEXIEX-CiIJxbDV.mjs → stateDiagram-FHFEXIEX-BXMAtbov.mjs} +2 -2
  328. package/dist/stateDiagram-v2-QKLJ7IA2-BtFX1akc.mjs +2 -0
  329. package/dist/strings-7PLOGTPD-CbCHpRt7.mjs +1 -0
  330. package/dist/{tac-SJGXQ4T2-DMDGVNTy.mjs → tac-SJGXQ4T2-BGgbS4Fn.mjs} +1 -1
  331. package/dist/tail-S5ULNTJU-mZjo68yb.mjs +1 -0
  332. package/dist/{tar-MZQD7NO4-46pC0DHj.mjs → tar-MZQD7NO4-CsVdP0sN.mjs} +1 -1
  333. package/dist/tee-O7VXZDCO-BKm8apzS.mjs +1 -0
  334. package/dist/time-DEUO3QV2-BOZv1JPT.mjs +1 -0
  335. package/dist/{timeline-definition-GMOUNBTQ-BBhlpYO9.mjs → timeline-definition-GMOUNBTQ-qIdeCiEK.mjs} +2 -2
  336. package/dist/{timeout-VRKMCG72-aaC7r4sX.mjs → timeout-VRKMCG72-CEWGEjty.mjs} +1 -1
  337. package/dist/touch-DX2IJOQ4-CjAZX3M6.mjs +1 -0
  338. package/dist/tr-2HXZRDSW-CehGhb2g.mjs +1 -0
  339. package/dist/tree-LYXBS7DC-CwBffKRV.mjs +1 -0
  340. package/dist/treeView-SZITEDCU-DkCY1vEP.mjs +1 -0
  341. package/dist/treemap-W4RFUUIX-CqZE2-qw.mjs +1 -0
  342. package/dist/true-WHJNXCHG-Uj-a5-Dz.mjs +1 -0
  343. package/dist/unexpand-RGTMIGZM-DfngOCy5.mjs +1 -0
  344. package/dist/uniq-SUNANL47-CEP8kP6J.mjs +1 -0
  345. package/dist/{vennDiagram-DHZGUBPP-CATweP9B.mjs → vennDiagram-DHZGUBPP-B0wW_yMZ.mjs} +2 -2
  346. package/dist/wardley-RL74JXVD-Lx0wZS2z.mjs +1 -0
  347. package/dist/{wardleyDiagram-NUSXRM2D-3qxY3I6a.mjs → wardleyDiagram-NUSXRM2D-C9FhrgKS.mjs} +2 -2
  348. package/dist/wc-TQB3VNOX-bJMe7ljH.mjs +1 -0
  349. package/dist/which-XZHEH76L-sa5veBMg.mjs +1 -0
  350. package/dist/whoami-DGKU3D2X-BbTFjdCR.mjs +1 -0
  351. package/dist/write-project-skill-BzVHToYO.mjs +36 -0
  352. package/dist/xan-UD7JYIL2-2nWetB-o.mjs +1 -0
  353. package/dist/xan-view-OW2TB7Z3-Oo5v6Y-1.mjs +1 -0
  354. package/dist/xargs-I6EZUCYF-Bp4XAy4N.mjs +1 -0
  355. package/dist/{xychartDiagram-5P7HB3ND-BAWpa2N2.mjs → xychartDiagram-5P7HB3ND-DNlCf9Gt.mjs} +2 -2
  356. package/dist/yq-OAKYHSXH-tZjjvK0i.mjs +1 -0
  357. package/package.json +1 -1
  358. package/dist/alias-JE7RI5QX-DxvTrQH3.mjs +0 -1
  359. package/dist/architecture-YZFGNWBL-YPACCZ88.mjs +0 -1
  360. package/dist/bash-IJWYRKFO-C7Yi9aK0.mjs +0 -1
  361. package/dist/channel-Dq8ADXfq.mjs +0 -2
  362. package/dist/chunk-426QAEUC-BGn1TCpd.mjs +0 -2
  363. package/dist/classDiagram-6PBFFD2Q-cIblqhKe.mjs +0 -2
  364. package/dist/classDiagram-v2-HSJHXN6E-CnZ_g-6O.mjs +0 -2
  365. package/dist/clone-s6xjJkoz.mjs +0 -2
  366. package/dist/constants-ruS6yqIq.mjs +0 -2
  367. package/dist/diff-HJF2MPDN-DSY9AfjL.mjs +0 -1
  368. package/dist/dist-ClIxicL4.mjs +0 -1
  369. package/dist/echo-O45JWWI2-B99ElfBo.mjs +0 -1
  370. package/dist/env-5EPCWSXR-CsaomJHQ.mjs +0 -1
  371. package/dist/expr-YYCVMXE3-CHnBeIXW.mjs +0 -1
  372. package/dist/find-DH2ALKQS-6y8KktlA.mjs +0 -1
  373. package/dist/flag-coverage-6JEX67RU-BqC6mFKB.mjs +0 -2
  374. package/dist/gitGraph-7Q5UKJZL-ClGjTWw6.mjs +0 -1
  375. package/dist/grep-2HUTXO5U-Dbnjl3Iq.mjs +0 -1
  376. package/dist/gzip-AQXSGOVS-BtiMTiZG.mjs +0 -1
  377. package/dist/help-VVWX7SA5-DCBusWam.mjs +0 -1
  378. package/dist/history-J4QRNGRO-BwBOMO5i.mjs +0 -1
  379. package/dist/html-to-markdown-TFCECAGV-D7XdAo13.mjs +0 -1
  380. package/dist/info-OMHHGYJF-11Qh6VJr.mjs +0 -1
  381. package/dist/init-CZ1SNbzi.mjs +0 -695
  382. package/dist/init-YPWG3akm.mjs +0 -1
  383. package/dist/jq-LYZFFBZB-CSF_TJhe.mjs +0 -1
  384. package/dist/loader-_YxuPUFp.mjs +0 -1
  385. package/dist/ls-KSXFZCWH-CNZ_hN8P.mjs +0 -1
  386. package/dist/md5sum-INMIK4DX-pTX2tfQd.mjs +0 -1
  387. package/dist/mkdir-TDEMSB6C-Bl16kSBR.mjs +0 -1
  388. package/dist/mv-Z6MORUFL-D9pw6nb9.mjs +0 -1
  389. package/dist/packet-4T2RLAQJ-jzF54bgp.mjs +0 -1
  390. package/dist/paste-7N6AFSDS-C8EyimeA.mjs +0 -1
  391. package/dist/pie-ZZUOXDRM-x8WFG16Q.mjs +0 -1
  392. package/dist/preview-Nr0DWwkh.mjs +0 -1
  393. package/dist/printf-CX64KX2P-2Mks7IIT.mjs +0 -1
  394. package/dist/public/assets/SettingsDialogBody-DACGgbgK.js +0 -7
  395. package/dist/pwd-D4OZ7N27-m5fzqroZ.mjs +0 -1
  396. package/dist/radar-PYXPWWZC-C-wbHKao.mjs +0 -1
  397. package/dist/readlink-MI4GCHJF-BMheCA1U.mjs +0 -1
  398. package/dist/repair-launch-json-CERDu05c.mjs +0 -2
  399. package/dist/repair-skills-DzXDE27i.mjs +0 -1
  400. package/dist/rg-XNF3R3II-ivb6d3Sm.mjs +0 -1
  401. package/dist/rm-RTZG23RL-F9g7gQHU.mjs +0 -1
  402. package/dist/rmdir-XTQXT7RK-CFMuhNvO.mjs +0 -1
  403. package/dist/seq-RN5ZUASB-BaUQfYSh.mjs +0 -1
  404. package/dist/server-lock-GuuouVft-DP6WTOjI.mjs +0 -1
  405. package/dist/sha1sum-VJPNLNU6-NRAU83Yg.mjs +0 -1
  406. package/dist/sha256sum-PI32XWXY-Cfe-w5CY.mjs +0 -1
  407. package/dist/sort-DCNRDA7U-DqMg1dll.mjs +0 -1
  408. package/dist/src-DZiSWqgp.mjs +0 -11
  409. package/dist/start-PB9hDssp.mjs +0 -1
  410. package/dist/stat-BT5A227F-DOG39Ce5.mjs +0 -1
  411. package/dist/stateDiagram-v2-QKLJ7IA2-CTdt2FVd.mjs +0 -2
  412. package/dist/strings-7PLOGTPD-l9kho9ff.mjs +0 -1
  413. package/dist/tail-S5ULNTJU-knoYRbXD.mjs +0 -1
  414. package/dist/tee-O7VXZDCO-BgHEibOy.mjs +0 -1
  415. package/dist/time-DEUO3QV2-CXWA3kJ0.mjs +0 -1
  416. package/dist/touch-DX2IJOQ4-DGiKr2c0.mjs +0 -1
  417. package/dist/tr-2HXZRDSW-BDNDgux2.mjs +0 -1
  418. package/dist/tree-LYXBS7DC-BK2c44-E.mjs +0 -1
  419. package/dist/treeView-SZITEDCU-DXyZ3zQc.mjs +0 -1
  420. package/dist/treemap-W4RFUUIX-CZRYHpYU.mjs +0 -1
  421. package/dist/true-WHJNXCHG-B6CZ-ZF1.mjs +0 -1
  422. package/dist/unexpand-RGTMIGZM-BWFllY1p.mjs +0 -1
  423. package/dist/uniq-SUNANL47-CiXMC2Qh.mjs +0 -1
  424. package/dist/wardley-RL74JXVD-UKzwcBOa.mjs +0 -1
  425. package/dist/wc-TQB3VNOX-Bof613yN.mjs +0 -1
  426. package/dist/which-XZHEH76L-DfnqWxtA.mjs +0 -1
  427. package/dist/whoami-DGKU3D2X-DhtD1OhF.mjs +0 -1
  428. package/dist/write-project-skill-DXeyiTpq.mjs +0 -36
  429. package/dist/xan-UD7JYIL2-DnWVVFeC.mjs +0 -1
  430. package/dist/xan-view-OW2TB7Z3-DBl8NjSB.mjs +0 -1
  431. package/dist/xargs-I6EZUCYF-CdKFilDT.mjs +0 -1
  432. package/dist/yq-OAKYHSXH-CpYttz-E.mjs +0 -1
  433. /package/dist/{expansion-VBDYWVZR-k3W3Rc7R.mjs → expansion-VBDYWVZR-1XLTRUEG.mjs} +0 -0
  434. /package/dist/{git-handle-BMLM1Bxa-Dc3Lq9P5.mjs → git-handle-BMLM1Bxa-C8CZ9W34.mjs} +0 -0
@@ -0,0 +1,7 @@
1
+ import{o as e,t}from"./chunk-CFjPhJqf.js";import{n,r,t as i}from"./compiler-runtime-CVnuRdak.js";import{$t as a,C as o,E as s,M as c,S as l,T as u,Ut as d,Vt as f,Wt as p,pn as m,ut as h,w as g,x as _}from"./DocumentContext-Cf3xyIUc.js";import{n as v,r as y}from"./dist-CQw2y-s3.js";import{n as b}from"./dist-BVOt51sU.js";import{A as x,Bi as S,Gi as C,Hi as w,Ki as T,Ni as E,Sr as D,Vi as O,_ as k,et as A,h as j,it as M,ji as N,k as P,wt as F,xt as I}from"./dist-CJc7OX7s.js";import{a as L,i as R,t as z,u as B}from"./button-cneJOVxD.js";import{a as ee,c as V,i as H,r as U,t as te}from"./EnableSyncConfirmDialog-Ds9VzFz7.js";import{t as ne}from"./arrow-up-right-Crm0Btez.js";import{t as W}from"./check-DRRCCRSs.js";import{t as re}from"./chevron-right-DSNnH-Vb.js";import{i as ie}from"./prop-types-BwJNmxtq.js";import{D as G,E as ae,T as oe,b as K,c as q,d as se,i as J,m as ce,r as le,s as ue,t as de,u as fe,w as pe}from"./skill-actions-CMd77Yt2.js";import{$ as me,A as he,B as ge,C as _e,E as ve,H as ye,M as be,Q as xe,S as Se,T as Ce,U as Y,V as we,W as Te,_ as Ee,at as De,c as Oe,d as ke,f as Ae,g as je,h as Me,i as Ne,j as Pe,l as Fe,lt as Ie,m as Le,n as Re,o as ze,p as Be,q as Ve,st as He,u as Ue,v as We,w as Ge,x as Ke,y as qe,z as Je}from"./auth-state-cache-DyKWS3xm.js";import{i as Ye,l as Xe,r as Ze,s as Qe}from"./workspace-paths-CYa5l8eZ.js";import{_ as $e,b as et,d as tt,f as nt,g as rt,h as it,l as at,m as ot,o as st,t as ct,u as lt,v as ut,y as dt}from"./open-managed-artifact-tab-Da7L5wL4.js";import{t as ft}from"./info-BlYnsVoP.js";import{t as pt}from"./triangle-alert-c3yCucJv.js";import{n as X,r as mt}from"./dist-CoyydoqN.js";import{i as ht,n as gt,t as _t}from"./tooltip-FFg0kVkD.js";import{n as vt,r as yt,t as bt}from"./collapsible-mJvufeMs.js";import{a as xt,c as St,i as Ct,n as wt,o as Tt,r as Et,s as Dt,t as Ot}from"./dialog-DdHaoAGK.js";import{t as kt}from"./checkbox-DurEHAAx.js";import{E as At,h as jt,p as Mt}from"./skills-api-UoasHTUi.js";import{t as Nt}from"./label-DPn_C7ZD.js";import{n as Pt,r as Ft,t as It}from"./radio-group-B0RG5um-.js";import{n as Lt,t as Rt}from"./toggle-group-CXHn0FKi.js";import{t as zt}from"./input-tW78aNaR.js";import{t as Bt}from"./parse-api-error-CqtA8BcL.js";import{r as Vt}from"./documents-events-Bit0pJeY.js";import{a as Ht,n as Ut,r as Wt,s as Gt,t as Kt}from"./keyboard-shortcuts-CvYXgqK4.js";import"./config-provider-D0CfBIwU.js";import{n as qt}from"./config-context-CE3SCVYc.js";import{t as Jt}from"./external-link-BjECE2gH.js";var Yt=B(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Z=i(),Q=e(n(),1),$=r(),Xt=`settings-sharing-title`;function Zt(){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)(Qt,{}):(0,$.jsx)($t,{}),e[0]=n):n=e[0],n}function Qt(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`h3`,{id:Xt,className:`text-base font-semibold`,children:(0,$.jsx)(v,{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":Xt,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)(v,{id:`7YRrJ9`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})}})})]})}),e[1]=n):n=e[1],n}function $t(){let e=(0,Z.c)(28),{_:t}=y(),[n,r]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(null),c;e[0]===t?c=e[1]:(c=async function(){let e=window.okDesktop?.sharing;if(e)try{r(await e.status())}catch(e){let n=e;X.error(n instanceof Error?n.message:t({id:`K0N7zS`})),r(tn)}},e[0]=t,e[1]=c);let l=c,u;e[2]===l?u=e[3]:(u=()=>{l()},e[2]=l,e[3]=u);let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[],e[4]=d):d=e[4],(0,Q.useEffect)(u,d);let f;e[5]!==t||e[6]!==i||e[7]!==l||e[8]!==n?(f=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||i||n.mode===e)return;a(!0),s(null);let o=null,c=null;try{o=await r.setMode(e)}catch(e){c=e}if(a(!1),c!==null){X.error(c instanceof Error?c.message:t({id:`qZv5ZR`}));return}o!==null&&(o.kind===`refused-tracked`?(s({tracked:o.tracked,remediation:o.remediation}),X.error(t({id:`z2JdQ-`}),{duration:5e3})):o.kind===`no-exclude`?X.warning(o.reason===`no-git`?t({id:`YSFv5w`}):t({id:`8cS0nH`,values:{0:o.reason}})):X.success(t(e===`local-only`?{id:`VvS_k_`}:{id:`k_pade`})),await l())},e[5]=t,e[6]=i,e[7]=l,e[8]=n,e[9]=f):f=e[9];let p=f;if(n===null){let t;return e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":Xt,className:`space-y-3`,children:[(0,$.jsx)(`h3`,{id:Xt,className:`text-base font-semibold`,children:(0,$.jsx)(v,{id:`cs4mps`})}),(0,$.jsx)(Y,{className:`h-24`})]}),e[10]=t):t=e[10],t}let m=n.mode===`no-git`,h;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`h3`,{id:Xt,className:`text-base font-semibold`,children:(0,$.jsx)(v,{id:`cs4mps`})}),(0,$.jsx)(Ft,{})]}),e[11]=h):h=e[11];let g;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[h,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(v,{id:`N55YNr`})})]}),e[12]=g):g=e[12];let _;e[13]!==i||e[14]!==m||e[15]!==p||e[16]!==n.mode?(_=m?(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)(v,{id:`ju38ms`})}):(0,$.jsxs)(It,{value:n.mode,onValueChange:e=>void p(e),disabled:i,className:`gap-2`,"aria-labelledby":Xt,"data-testid":`settings-sharing-radiogroup`,children:[(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(Pt,{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)(v,{id:`0Gd0NU`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(v,{id:`dJw2_7`})})]})]}),(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(Pt,{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)(v,{id:`OgyJSr`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(v,{id:`cZ_8zB`})})]})]})]}),e[13]=i,e[14]=m,e[15]=p,e[16]=n.mode,e[17]=_):_=e[17];let b;e[18]===o?b=e[19]:(b=o===null?null:(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm`,role:`alert`,"data-testid":`settings-sharing-refusal`,children:[(0,$.jsx)(`p`,{className:`font-semibold`,children:(0,$.jsx)(v,{id:`Kgdbkt`})}),(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:o.remediation}),(0,$.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>s(null),children:(0,$.jsx)(v,{id:`1QfxQT`})})]}),e[18]=o,e[19]=b);let x;e[20]!==o||e[21]!==n.mode||e[22]!==n.trackedUpstream?(x=n.trackedUpstream.length>0&&n.mode!==`no-git`&&o===null?(0,$.jsxs)(`div`,{className:`space-y-1 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-tracked-info`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:(0,$.jsx)(v,{id:`LhWYpm`})}),(0,$.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(en)}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(v,{id:`1XSMhZ`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]}):null,e[20]=o,e[21]=n.mode,e[22]=n.trackedUpstream,e[23]=x):x=e[23];let S;return e[24]!==_||e[25]!==b||e[26]!==x?(S=(0,$.jsxs)(`section`,{"aria-labelledby":Xt,className:`space-y-4`,"data-testid":`settings-sharing`,children:[g,_,b,x]}),e[24]=_,e[25]=b,e[26]=x,e[27]=S):S=e[27],S}function en(e){return(0,$.jsx)(`li`,{children:e},e)}function tn(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[]}}var nn=ve,rn=Q.createContext({}),an=e=>{let t=(0,Z.c)(9),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;t[2]===n.name?r=t[3]:(r={name:n.name},t[2]=n.name,t[3]=r);let i;t[4]===n?i=t[5]:(i=(0,$.jsx)(Ce,{...n}),t[4]=n,t[5]=i);let a;return t[6]!==r||t[7]!==i?(a=(0,$.jsx)(rn.Provider,{value:r,children:i}),t[6]=r,t[7]=i,t[8]=a):a=t[8],a},on=()=>{let e=(0,Z.c)(13),t=Q.use(rn),n=Q.use(sn),{getFieldState:r}=Pe(),i;e[0]===t.name?i=e[1]:(i={name:t.name},e[0]=t.name,e[1]=i);let a=be(i),o;e[2]!==t.name||e[3]!==a||e[4]!==r?(o=r(t.name,a),e[2]=t.name,e[3]=a,e[4]=r,e[5]=o):o=e[5];let s=o;if(!t)throw Error(`useFormField should be used within <FormField>`);let{id:c}=n,l=`${c}-form-item`,u=`${c}-form-item-description`,d=`${c}-form-item-message`,f;return e[6]!==t.name||e[7]!==s||e[8]!==c||e[9]!==l||e[10]!==u||e[11]!==d?(f={id:c,name:t.name,formItemId:l,formDescriptionId:u,formMessageId:d,...s},e[6]=t.name,e[7]=s,e[8]=c,e[9]=l,e[10]=u,e[11]=d,e[12]=f):f=e[12],f},sn=Q.createContext({});function cn(e){let t=(0,Z.c)(13),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i=Q.useId(),a;t[3]===i?a=t[4]:(a={id:i},t[3]=i,t[4]=a);let o;t[5]===n?o=t[6]:(o=R(`grid gap-2`,n),t[5]=n,t[6]=o);let s;t[7]!==r||t[8]!==o?(s=(0,$.jsx)(`div`,{"data-slot":`form-item`,className:o,...r}),t[7]=r,t[8]=o,t[9]=s):s=t[9];let c;return t[10]!==a||t[11]!==s?(c=(0,$.jsx)(sn.Provider,{value:a,children:s}),t[10]=a,t[11]=s,t[12]=c):c=t[12],c}function ln(e){let t=(0,Z.c)(10),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let{error:i,formItemId:a}=on(),o=!!i,s;t[3]===n?s=t[4]:(s=R(`data-[error=true]:text-destructive`,n),t[3]=n,t[4]=s);let c;return t[5]!==a||t[6]!==r||t[7]!==o||t[8]!==s?(c=(0,$.jsx)(Nt,{"data-slot":`form-label`,"data-error":o,className:s,htmlFor:a,...r}),t[5]=a,t[6]=r,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function un(e){let t=(0,Z.c)(7),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let{error:r,formItemId:i,formDescriptionId:a,formMessageId:o}=on(),s=r?`${a} ${o}`:`${a}`,c=!!r,l;return t[2]!==i||t[3]!==n||t[4]!==s||t[5]!==c?(l=(0,$.jsx)(L,{"data-slot":`form-control`,id:i,"aria-describedby":s,"aria-invalid":c,...n}),t[2]=i,t[3]=n,t[4]=s,t[5]=c,t[6]=l):l=t[6],l}function dn(e){let t=(0,Z.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let{formDescriptionId:i}=on(),a;t[3]===n?a=t[4]:(a=R(`text-1sm text-muted-foreground`,n),t[3]=n,t[4]=a);let o;return t[5]!==i||t[6]!==r||t[7]!==a?(o=(0,$.jsx)(`p`,{"data-slot":`form-description`,id:i,className:a,...r}),t[5]=i,t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function fn(e){let t=(0,Z.c)(11),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let{error:i,formMessageId:a}=on(),o=i?String(i?.message??``):r.children;if(!o)return null;let s=i?`alert`:void 0,c;t[3]===n?c=t[4]:(c=R(`text-sm text-destructive`,n),t[3]=n,t[4]=c);let l;return t[5]!==o||t[6]!==a||t[7]!==r||t[8]!==s||t[9]!==c?(l=(0,$.jsx)(`p`,{"data-slot":`form-message`,id:a,role:s,className:c,...r,children:o}),t[5]=o,t[6]=a,t[7]=r,t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function pn(e){let t=(0,Z.c)(30),{authQueryTransport:n,authTransport:r}=e,{_:i}=y(),a;t[0]===n?a=t[1]:(a=n??Ve(),t[0]=n,t[1]=a);let o=a,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s={phase:`loading`},t[2]=s):s=t[2];let[c,l]=(0,Q.useState)(s),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(null),g=(0,Q.useRef)(!1),_;t[3]===o?_=t[4]:(_=async function(){l({phase:`loading`});try{let e=await o.status();l({phase:`loaded`,result:e}),Re(e.authenticated)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),l({phase:`check-failed`})}},t[3]=o,t[4]=_);let b=_,x;t[5]===b?x=t[6]:(x=()=>{b()},t[5]=b,t[6]=x);let S;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(S=[],t[7]=S):S=t[7],(0,Q.useEffect)(x,S);let C;t[8]!==i||t[9]!==b||t[10]!==o?(C=async function(){if(g.current)return;g.current=!0,d(!1),p(!0),h(null);let e=null;try{let t=o.signout?await o.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&&h(e),p(!1),g.current=!1},t[8]=i,t[9]=b,t[10]=o,t[11]=C):C=t[11];let w=C,T;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(`h3`,{id:`settings-account-title`,className:`text-base font-semibold`,children:(0,$.jsx)(v,{id:`AeXO77`})}),t[12]=T):T=t[12];let E;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[T,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(v,{id:`E6lrpp`})})]}),t[13]=E):E=t[13];let D;t[14]!==m||t[15]!==f||t[16]!==w||t[17]!==b||t[18]!==c.phase||t[19]!==c.result?(D=c.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)(v,{id:`IWGfGF`})}),(0,$.jsx)(Y,{className:`h-4 w-40`}),(0,$.jsx)(Y,{className:`h-8 w-32`})]}):c.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)(v,{id:`T_wG4n`})}),(0,$.jsx)(z,{variant:`outline`,size:`sm`,onClick:()=>void b(),children:(0,$.jsx)(v,{id:`KDw4GX`})})]}):c.result.authenticated?c.result.tier===`A`?(0,$.jsx)(hn,{login:c.result.login}):(0,$.jsx)(mn,{login:c.result.login,disconnecting:f,error:m,onDisconnect:()=>void w()}):(0,$.jsx)(gn,{onConnect:()=>d(!0)}),t[14]=m,t[15]=f,t[16]=w,t[17]=b,t[18]=c.phase,t[19]=c.result,t[20]=D):D=t[20];let O;t[21]===b?O=t[22]:(O=()=>{b()},t[21]=b,t[22]=O);let k;t[23]!==u||t[24]!==r||t[25]!==O?(k=(0,$.jsx)(Te,{open:u,onOpenChange:d,transport:r,onSuccess:O}),t[23]=u,t[24]=r,t[25]=O,t[26]=k):k=t[26];let A;return t[27]!==k||t[28]!==D?(A=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[E,D,k]}),t[27]=k,t[28]=D,t[29]=A):A=t[29],A}function mn(e){let t=(0,Z.c)(20),{login:n,disconnecting:r,error:i,onDisconnect:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(v,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(v,{id:`nxlOpL`})}),t[2]=s):s=t[2];let c;t[3]===o?c=t[4]:(c=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[3]=o,t[4]=c);let l;t[5]===r?l=t[6]:(l=r?(0,$.jsx)(v,{id:`rppgXF`}):(0,$.jsx)(v,{id:`-K0AvT`}),t[5]=r,t[6]=l);let u;t[7]!==r||t[8]!==a||t[9]!==l?(u=(0,$.jsx)(z,{variant:`outline`,onClick:a,disabled:r,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:l}),t[7]=r,t[8]=a,t[9]=l,t[10]=u):u=t[10];let d;t[11]!==c||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[c,u]}),t[11]=c,t[12]=u,t[13]=d):d=t[13];let f;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,$.jsx)(v,{id:`msOK6I`})}),t[14]=f):f=t[14];let p;t[15]===i?p=t[16]:(p=i?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-disconnect-error`,children:i}):null,t[15]=i,t[16]=p);let m;return t[17]!==d||t[18]!==p?(m=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[d,f,p]}),t[17]=d,t[18]=p,t[19]=m):m=t[19],m}function hn(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)(v,{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)(v,{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 gn(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)(v,{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)(v,{id:`EJuO7B`})})]}),t[1]=i):i=t[1];let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(v,{id:`3jod3l`}),t[2]=a):a=t[2];let o;return t[3]===n?o=t[4]:(o=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-disconnected`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[i,(0,$.jsx)(z,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=o),o}function _n(e){return e.kind===`editor`?`editor:${e.id}`:e.kind===`skill`?`skill:${e.id}`:`path`}function vn(e){let t=(0,Z.c)(11),{testId:n,children:r}=e,{_:i}=y(),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)(ft,{className:`size-3.5`}),t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==n?(s=(0,$.jsx)(ht,{asChild:!0,children:(0,$.jsx)(z,{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]=s):s=t[5];let c;t[6]===r?c=t[7]:(c=(0,$.jsx)(gt,{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]=c);let l;return t[8]!==s||t[9]!==c?(l=(0,$.jsxs)(_t,{children:[s,c]}),t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function yn(){let e=(0,Z.c)(38),{_:t}=y(),n=typeof window<`u`?window.okDesktop??null:null,[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(null),l,u;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{if(!n)return;let e=!1;return n.integrations.status().then(t=>{e||i(t)}).catch(()=>{e||o(!0)}),()=>{e=!0}},u=[n],e[0]=l,e[1]=u):(l=e[0],u=e[1]),(0,Q.useEffect)(l,u);let d;e[2]===t?d=e[3]:(d=async function(e,r){if(n){c(_n(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)}}))}c(null)}},e[2]=t,e[3]=d);let f=d,p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`h3`,{id:`settings-ai-tools-title`,className:`text-base font-semibold`,children:(0,$.jsx)(v,{id:`_5qBNl`})}),e[4]=p):p=e[4];let m;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[p,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(v,{id:`mLAjyL`})})]}),e[5]=m):m=e[5];let h=m;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:[h,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`ai-tools-unavailable`,children:(0,$.jsx)(v,{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:[h,(0,$.jsxs)(`div`,{className:`space-y-2`,"data-testid":`ai-tools-loading`,children:[(0,$.jsx)(Y,{className:`h-10 w-full`}),(0,$.jsx)(Y,{className:`h-10 w-full`}),(0,$.jsx)(Y,{className:`h-10 w-full`})]})]}),e[7]=t):t=e[7],t}let g=s!==null||!r.available,_=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)(v,{id:`OplnBG`})}),e[8]=r.available,e[9]=b);let S;e[10]!==t||e[11]!==f||e[12]!==g||e[13]!==_||e[14]!==r.path.installed||e[15]!==r.path.rcFilesToTouch?(S=_&&(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)(v,{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)(Nt,{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)(kt,{id:`ai-tools-path`,checked:r.path.installed,disabled:g,onCheckedChange:()=>void f({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)(v,{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)(vn,{testId:`ai-tools-path-info`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(v,{id:`f9lQNJ`})}),r.path.rcFilesToTouch.map(xn),(0,$.jsx)(`p`,{className:`pt-1`,children:(0,$.jsx)(v,{id:`CWzc2T`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]})]})]}),e[10]=t,e[11]=f,e[12]=g,e[13]=_,e[14]=r.path.installed,e[15]=r.path.rcFilesToTouch,e[16]=S):S=e[16];let C;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(v,{id:`psfGPX`})}),e[17]=C):C=e[17];let w;if(e[18]!==t||e[19]!==f||e[20]!==g||e[21]!==r.editors){let n;e[23]!==t||e[24]!==f||e[25]!==g?(n=e=>{let n=e.state===`installed`||e.state===`foreign`,r=g||e.state===`unmanageable`,i=e.state===`not-installed`&&!e.detected,a=`https://openknowledge.ai/docs/integrations/${x[e.id]}`,o=e.state===`installed`?t({id:`eQkgKV`}):e.state===`foreign`?t({id:`AczYxH`}):e.state===`unmanageable`?t({id:`LbmLyU`}):e.detected?t({id:`bBE5tC`}):null,s=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)(Nt,{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)(kt,{id:`ai-tools-editor-${e.id}`,checked:n,disabled:r,onCheckedChange:()=>void f({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}),o!==null&&(0,$.jsx)(`span`,{className:s,"data-testid":`ai-tools-editor-status-${e.id}`,children:o})]})]}),i&&(0,$.jsxs)(`a`,{href:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>Jt(e,a),onAuxClick:e=>Jt(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)(v,{id:`P_bX4O`}),(0,$.jsx)(ne,{className:`size-3`,"aria-hidden":!0})]}),(0,$.jsxs)(vn,{testId:`ai-tools-editor-info-${e.id}`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(v,{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)(v,{id:`VIwCaD`})}),(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e.entryLocator})})]})]},e.id)},e[23]=t,e[24]=f,e[25]=g,e[26]=n):n=e[26],w=r.editors.map(n),e[18]=t,e[19]=f,e[20]=g,e[21]=r.editors,e[22]=w}else w=e[22];let T;e[27]===w?T=e[28]:(T=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[C,(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:w})]}),e[27]=w,e[28]=T);let E;e[29]!==f||e[30]!==g||e[31]!==r.skills?(E=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)(v,{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)(Nt,{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)(kt,{id:`ai-tools-skill-${e.id}`,checked:e.installed,disabled:g,onCheckedChange:()=>void f({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)(v,{id:`0inVGS`}):(0,$.jsx)(v,{id:`FXk_zY`})})]})]}),(0,$.jsxs)(vn,{testId:`ai-tools-skill-info-${e.id}`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(v,{id:`HSh8u_`})}),e.paths.map(bn)]})]},e.id))})]}),e[29]=f,e[30]=g,e[31]=r.skills,e[32]=E):E=e[32];let D;return e[33]!==E||e[34]!==b||e[35]!==S||e[36]!==T?(D=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[h,b,S,T,E]}),e[33]=E,e[34]=b,e[35]=S,e[36]=T,e[37]=D):D=e[37],D}function bn(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}function xn(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}async function Sn(e){try{let t=M.safeParse(await e.json());if(t.success)return t.data.title}catch{}}async function Cn(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 Sn(n)}}catch{return{ok:!1}}}function wn(){return{setKey:e=>Cn(`/api/local-op/embeddings/set-key`,{key:e}),clearKey:()=>Cn(`/api/local-op/embeddings/clear-key`,{})}}function Tn(e){let t=(0,Z.c)(29),{transport:n}=e,{_:r}=y(),i;t[0]===n?i=t[1]:(i=n??wn(),t[0]=n,t[1]=i);let a=i,{status:o,refresh:s}=me(),[c,l]=(0,Q.useState)(``),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(null),m=o?.keyPresent??!1,h=o?.keySource??null,g=o?.keyHint??null,_;t[2]!==r||t[3]!==u||t[4]!==c||t[5]!==s||t[6]!==a?(_=async function(){let e=c.trim();if(!e||u)return;d(!0),p(null);let t=await a.setKey(e);d(!1),t.ok?(l(``),s()):p(t.error??r({id:`Ck9XRt`}))},t[2]=r,t[3]=u,t[4]=c,t[5]=s,t[6]=a,t[7]=_):_=t[7];let b=_,x;t[8]!==r||t[9]!==u||t[10]!==s||t[11]!==a?(x=async function(){if(u)return;d(!0),p(null);let e=await a.clearKey();d(!1),e.ok?s():p(e.error??r({id:`CSL0l1`}))},t[8]=r,t[9]=u,t[10]=s,t[11]=a,t[12]=x):x=t[12];let S=x,C;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(`h3`,{id:`settings-embeddings-key-title`,className:`text-base font-semibold`,children:(0,$.jsx)(v,{id:`nh3wwx`})}),t[13]=C):C=t[13];let w;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[C,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(v,{id:`wccmX0`,components:{0:(0,$.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})})]}),t[14]=w):w=t[14];let T;t[15]!==r||t[16]!==u||t[17]!==g||t[18]!==c||t[19]!==m||t[20]!==h||t[21]!==S||t[22]!==b?(T=h===`env`?(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,"data-testid":`settings-embeddings-key-env`,children:(0,$.jsx)(v,{id:`KH5bQi`,components:{0:(0,$.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})}):(0,$.jsxs)($.Fragment,{children:[m?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,"data-testid":`settings-embeddings-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)(v,{id:`AqnqMJ`})}),g?(0,$.jsxs)(`p`,{className:`truncate font-mono text-muted-foreground text-xs`,title:r({id:`qEIFZu`,values:{keyHint:g}}),"data-testid":`settings-embeddings-key-hint`,children:[(0,$.jsx)(`span`,{"aria-hidden":`true`,children:`••••••••`}),g]}):null,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(v,{id:`3TCafD`})})]}),(0,$.jsx)(z,{variant:`outline`,onClick:()=>void S(),disabled:u,"data-testid":`settings-embeddings-key-clear`,children:(0,$.jsx)(v,{id:`xCJdfg`})})]}):null,(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`label`,{htmlFor:`settings-embeddings-key-input`,className:`mb-2 block text-sm font-medium`,children:m?(0,$.jsx)(v,{id:`UW93oq`}):(0,$.jsx)(v,{id:`K6jxcj`})}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(zt,{id:`settings-embeddings-key-input`,type:`password`,value:c,onChange:e=>l(e.target.value),placeholder:r({id:`tsiTqO`}),autoComplete:`off`,spellCheck:!1,disabled:u,"data-testid":`settings-embeddings-key-input`,className:`h-8 font-mono text-sm`}),(0,$.jsx)(z,{onClick:()=>void b(),disabled:u||c.trim().length===0,"data-testid":`settings-embeddings-key-save`,children:u?(0,$.jsx)(v,{id:`uF9ruK`}):(0,$.jsx)(v,{id:`tfDRzk`})})]})]})]}),t[15]=r,t[16]=u,t[17]=g,t[18]=c,t[19]=m,t[20]=h,t[21]=S,t[22]=b,t[23]=T):T=t[23];let E;t[24]===f?E=t[25]:(E=f?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-embeddings-key-error`,children:f}):null,t[24]=f,t[25]=E);let D;return t[26]!==T||t[27]!==E?(D=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-embeddings-key-title`,className:`space-y-3`,"data-testid":`settings-embeddings-key`,children:[w,(0,$.jsxs)(`div`,{className:`space-y-3 rounded-md border p-3`,children:[T,E]})]}),t[26]=T,t[27]=E,t[28]=D):D=t[28],D}var En=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),Dn=new Map;function On(e){let t=Dn.get(e);if(t)return Dn.delete(e),Dn.set(e,t),t;let n=(0,En.default)();if(n.add(e),Dn.set(e,n),Dn.size>256){let e=Dn.keys().next().value;e!==void 0&&Dn.delete(e)}return n}function kn(e,t){let n=e.trim();if(n.length===0||n.startsWith(`#`))return 0;let r=On(n),i=0;for(let e of t)e.length!==0&&r.ignores(e)&&(i+=1);return i}var An={"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 jn(e){let t=[];if(e.length===0||e.trimStart().startsWith(`#`))return t;/[\r\n]/.test(e)&&t.push({code:`embedded-newline`,message:An[`embedded-newline`]}),/^\s/.test(e)&&t.push({code:`leading-whitespace`,message:An[`leading-whitespace`]});let n=e.trim();return n===`!`&&t.push({code:`lone-bang`,message:An[`lone-bang`]}),n.endsWith(`\\`)&&t.push({code:`trailing-backslash`,message:An[`trailing-backslash`]}),Mn(n,`[`)>Mn(n,`]`)&&t.push({code:`unmatched-bracket`,message:An[`unmatched-bracket`]}),t}function Mn(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}var Nn=`https://openknowledge.ai/docs/features/ignore-patterns`,Pn=1200,Fn=150,In=150,Ln=5e3,Rn=600,zn=400,Bn=`okignore-show-advanced`;function Vn(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)(Hn,{}),t[0]=e):e=t[0],e}let i;return t[1]===n?i=t[2]:(i=(0,$.jsx)(Un,{binding:n}),t[1]=n,t[2]=i),i}function Hn(){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)(v,{id:`3zyg_A`})}),(0,$.jsx)(Y,{className:`h-4 w-72`})]}),(0,$.jsx)(Y,{className:`h-20 w-full`})]}),e[0]=t):t=e[0],t}function Un(e){let t=(0,Z.c)(72),{binding:n}=e,{_:r}=y(),i;t[0]===n?i=t[1]:(i=()=>n.current(),t[0]=n,t[1]=i);let[a,o]=(0,Q.useState)(i),s,c;t[2]===n?(s=t[3],c=t[4]):(s=()=>n.subscribe(e=>{o(e)}),c=[n],t[2]=n,t[3]=s,t[4]=c),(0,Q.useEffect)(s,c);let{pages:l,pageMeta:u,assetPaths:d}=ie(),f;t[5]!==d||t[6]!==u||t[7]!==l?(f=ur(l,u,d),t[5]=d,t[6]=u,t[7]=l,t[8]=f):f=t[8];let p=f,m,h;t[9]===a?(m=t[10],h=t[11]):(m=Le(a),h=Be(m),t[9]=a,t[10]=m,t[11]=h);let g=h,_=g.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),Pn)},t[14]=T):T=t[14];let E=T,[D,k]=(0,Q.useState)(null),A=(0,Q.useRef)(null),j,M;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>()=>{A.current&&clearTimeout(A.current)},j=[],t[15]=j,t[16]=M):(j=t[15],M=t[16]),(0,Q.useEffect)(M,j);let N,P;t[17]===n?(N=t[18],P=t[19]):(N=()=>Ne(e=>{e.docName===`__config__/okignore`&&n.notifyRejection(e.error)}),P=[n],t[17]=n,t[18]=N,t[19]=P),(0,Q.useEffect)(N,P);let F,I;t[20]===n?(F=t[21],I=t[22]):(F=()=>n.subscribeRejection(e=>{let{error:t}=e,n=or(t);k({message:n?.detail??O(t),lineNumber:n?.lineNumber,ts:Date.now()}),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>k(null),Ln)}),I=[n],t[20]=n,t[21]=F,t[22]=I),(0,Q.useEffect)(F,I);let L,R;t[23]===r?(L=t[24],R=t[25]):(L=()=>ze(e=>{let{path:t}=e;X.error(r({id:`3oh0nQ`,values:{path:t}}),{description:e.error,id:`okignore-nested-error:${e.path}`,duration:8e3})}),R=[r],t[23]=r,t[24]=L,t[25]=R),(0,Q.useEffect)(L,R);let z;t[26]===n?z=t[27]:(z=e=>{n.patch(e)},t[26]=n,t[27]=z);let B=z,ee;t[28]!==B||t[29]!==m||t[30]!==g?(ee=(e,t)=>{let n=t.trim(),r=g[e];if(r&&n!==r.text){if(n.length===0){B(Ee(Me(m,e)));return}B(Ee(ke(m,e,n))),E(ar(n,e))}},t[28]=B,t[29]=m,t[30]=g,t[31]=ee):ee=t[31];let V=ee,H;t[32]!==B||t[33]!==m?(H=e=>{B(Ee(Me(m,e)))},t[32]=B,t[33]=m,t[34]=H):H=t[34];let U=H,te;t[35]!==B||t[36]!==m||t[37]!==g.length?(te=e=>{let t=e.trim();if(t.length===0)return;let n=Ae(m,t);if(n>=0){E(ar(t,n));return}B(Ee(Ue(m,t))),E(ar(t,g.length))},t[35]=B,t[36]=m,t[37]=g.length,t[38]=te):te=t[38];let ne=te,W;t[39]!==B||t[40]!==m?(W=e=>{let t=String(e.active.id),n=e.over?String(e.over.id):null;if(!n||t===n)return;let r=ir(t),i=ir(n);r<0||i<0||r===i||B(Ee(je(m,r,i)))},t[39]=B,t[40]=m,t[41]=W):W=t[41];let re=W,G;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(G={activationConstraint:{distance:4}},t[42]=G):G=t[42];let ae;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ae={coordinateGetter:at},t[43]=ae):ae=t[43];let oe=ut($e(it,G),$e(ot,ae)),K=D===null?null:`rejection-${D.ts}`,[q,se]=pr(),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)(v,{id:`3zyg_A`})}),t[44]=J):J=t[44];let ce;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[J,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(v,{id:`Z5h97D`,components:{0:(0,$.jsx)(`a`,{href:Nn,target:`_blank`,rel:`noreferrer noopener`,className:`text-primary underline-offset-2 hover:underline`,"data-testid":`settings-okignore-primer`})}})})]}),t[45]=ce):ce=t[45];let le;t[46]===D?le=t[47]:(le=D===null?null:(0,$.jsx)(Kn,{rejection:D}),t[46]=D,t[47]=le);let ue;t[48]!==n||t[49]!==p||t[50]!==ne||t[51]!==re||t[52]!==V||t[53]!==U||t[54]!==_||t[55]!==g||t[56]!==K||t[57]!==b||t[58]!==oe||t[59]!==q||t[60]!==a?(ue=q?(0,$.jsx)(Wn,{binding:n,text:a}):_?(0,$.jsx)(qn,{onAdd:ne,rejectionFlashKey:K,filePaths:p}):(0,$.jsx)(Jn,{patterns:g,sensors:oe,onDragEnd:re,onEdit:V,onRemove:U,onAdd:ne,savedFlash:b,rejectionFlashKey:K,filePaths:p}),t[48]=n,t[49]=p,t[50]=ne,t[51]=re,t[52]=V,t[53]=U,t[54]=_,t[55]=g,t[56]=K,t[57]=b,t[58]=oe,t[59]=q,t[60]=a,t[61]=ue):ue=t[61];let de;t[62]!==se||t[63]!==q?(de=()=>se(!q),t[62]=se,t[63]=q,t[64]=de):de=t[64];let fe;t[65]!==q||t[66]!==de?(fe=(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(Gn,{enabled:q,onToggle:de})}),t[65]=q,t[66]=de,t[67]=fe):fe=t[67];let pe;return t[68]!==le||t[69]!==ue||t[70]!==fe?(pe=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-okignore-title`,className:`space-y-3`,"data-testid":`settings-okignore-section`,children:[ce,le,ue,fe]}),t[68]=le,t[69]=ue,t[70]=fe,t[71]=pe):pe=t[71],pe}function Wn(e){let t=(0,Z.c)(31),{binding:n,text:r}=e,{_:i}=y(),[a,o]=(0,Q.useState)(r),s=(0,Q.useRef)(r),c=(0,Q.useRef)(!1),l=(0,Q.useRef)(r),u=(0,Q.useRef)(null),d,f;t[0]===r?(d=t[1],f=t[2]):(d=()=>{c.current||r!==s.current&&(o(r),l.current=r,s.current=r)},f=[r],t[0]=r,t[1]=d,t[2]=f),(0,Q.useEffect)(d,f);let p,m;t[3]===a?(p=t[4],m=t[5]):(p=()=>{l.current=a},m=[a],t[3]=a,t[4]=p,t[5]=m),(0,Q.useEffect)(p,m);let h,g;t[6]===n?(h=t[7],g=t[8]):(h=()=>()=>{u.current&&(clearTimeout(u.current),u.current=null,l.current!==s.current&&(n.patch(l.current),s.current=l.current))},g=[n],t[6]=n,t[7]=h,t[8]=g),(0,Q.useEffect)(h,g);let _;t[9]===n?_=t[10]:(_=e=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{u.current=null,e!==s.current&&(s.current=e,n.patch(e))},zn)},t[9]=n,t[10]=_);let v=_,b;t[11]===n?b=t[12]:(b=()=>{u.current&&=(clearTimeout(u.current),null),l.current!==s.current&&(s.current=l.current,n.patch(l.current))},t[11]=n,t[12]=b);let x=b,S;t[13]===v?S=t[14]:(S=e=>{o(e.target.value),v(e.target.value)},t[13]=v,t[14]=S);let C;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>{c.current=!0},t[15]=C):C=t[15];let w;t[16]===x?w=t[17]:(w=()=>{c.current=!1,x()},t[16]=x,t[17]=w);let T;t[18]===a?T=t[19]:(T=a.split(`
2
+ `),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 Gn(e){let t=(0,Z.c)(6),{enabled:n,onToggle:r}=e,i;t[0]===n?i=t[1]:(i=n?(0,$.jsx)(v,{id:`9PQysm`}):(0,$.jsx)(v,{id:`Nv3mUj`}),t[0]=n,t[1]=i);let a;return t[2]!==n||t[3]!==r||t[4]!==i?(a=(0,$.jsx)(z,{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 Kn(e){let t=(0,Z.c)(7),{rejection:n}=e,{_:r}=y(),{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 s=o,c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(pt,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0`}),t[4]=c):c=t[4];let l;return t[5]===s?l=t[6]:(l=(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:[c,(0,$.jsx)(`span`,{children:s})]}),t[5]=s,t[6]=l),l}function qn(e){let t=(0,Z.c)(8),{onAdd:n,rejectionFlashKey:r,filePaths:i}=e,{_:a}=y(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(v,{id:`makN88`})}),t[0]=o):o=t[0];let s;t[1]===a?s=t[2]:(s=a({id:`Gx0VS1`}),t[1]=a,t[2]=s);let c;return t[3]!==i||t[4]!==n||t[5]!==r||t[6]!==s?(c=(0,$.jsxs)(`div`,{className:`space-y-3 rounded-md border border-dashed p-4`,"data-testid":`settings-okignore-empty`,children:[o,(0,$.jsx)(Qn,{onAdd:n,placeholder:s,rejectionFlashKey:r,filePaths:i})]}),t[3]=i,t[4]=n,t[5]=r,t[6]=s,t[7]=c):c=t[7],c}function Jn(e){let t=(0,Z.c)(35),{patterns:n,sensors:r,onDragEnd:i,onEdit:a,onRemove:o,onAdd:s,savedFlash:c,rejectionFlashKey:l,filePaths:u}=e,{_:d}=y(),f;t[0]===n?f=t[1]:(f=n.map(Yn),t[0]=n,t[1]=f);let p=f,m;t[2]===d?m=t[3]:(m=d({id:`3zyg_A`}),t[2]=d,t[3]=m);let h;if(t[4]!==u||t[5]!==a||t[6]!==o||t[7]!==n||t[8]!==c){let e;t[10]!==u||t[11]!==a||t[12]!==o||t[13]!==c?(e=(e,t)=>{let n=ar(e.text,t),r=c!==null&&c.key===n;return(0,$.jsx)(Xn,{sortableId:rr(t),patternIndex:t,pattern:e,onEdit:a,onRemove:o,flashActive:r,filePaths:u},rr(t))},t[10]=u,t[11]=a,t[12]=o,t[13]=c,t[14]=e):e=t[14],h=n.map(e),t[4]=u,t[5]=a,t[6]=o,t[7]=n,t[8]=c,t[9]=h}else h=t[9];let g;t[15]!==m||t[16]!==h?(g=(0,$.jsx)(`ul`,{"aria-label":m,className:`divide-y rounded-md border`,"data-testid":`settings-okignore-list`,children:h}),t[15]=m,t[16]=h,t[17]=g):g=t[17];let _;t[18]!==p||t[19]!==g?(_=(0,$.jsx)(st,{items:p,strategy:tt,children:g}),t[18]=p,t[19]=g,t[20]=_):_=t[20];let v;t[21]!==i||t[22]!==r||t[23]!==_?(v=(0,$.jsx)(nt,{sensors:r,collisionDetection:rt,onDragEnd:i,children:_}),t[21]=i,t[22]=r,t[23]=_,t[24]=v):v=t[24];let b;t[25]===d?b=t[26]:(b=d({id:`cZGNlb`}),t[25]=d,t[26]=b);let x;t[27]!==u||t[28]!==s||t[29]!==l||t[30]!==b?(x=(0,$.jsx)(Qn,{onAdd:s,placeholder:b,rejectionFlashKey:l,filePaths:u}),t[27]=u,t[28]=s,t[29]=l,t[30]=b,t[31]=x):x=t[31];let S;return t[32]!==v||t[33]!==x?(S=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[v,x]}),t[32]=v,t[33]=x,t[34]=S):S=t[34],S}function Yn(e,t){return rr(t)}function Xn(e){let t=(0,Z.c)(47),{sortableId:n,patternIndex:r,pattern:i,onEdit:a,onRemove:o,flashActive:s,filePaths:c}=e,{_:l}=y(),u;t[0]===n?u=t[1]:(u={id:n},t[0]=n,t[1]=u);let{attributes:d,listeners:f,setNodeRef:p,transform:m,transition:h,isDragging:g}=lt(u),_=i.text,v;t[2]===m?v=t[3]:(v=dt.Transform.toString(m),t[2]=m,t[3]=v);let b=g?.5:void 0,x=g?1:void 0,S;t[4]!==v||t[5]!==b||t[6]!==x||t[7]!==h?(S={transform:v,transition:h,opacity:b,zIndex:x},t[4]=v,t[5]=b,t[6]=x,t[7]=h,t[8]=S):S=t[8];let C=S,w;t[9]!==l||t[10]!==_?(w=l({id:`7_bFEL`,values:{patternText:_}}),t[9]=l,t[10]=_,t[11]=w):w=t[11];let T;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(et,{className:`size-3.5`}),t[12]=T):T=t[12];let E;t[13]!==d||t[14]!==f||t[15]!==w?(E=(0,$.jsx)(z,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-testid":`settings-okignore-drag-handle`,"aria-label":w,...d,...f,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:T}),t[13]=d,t[14]=f,t[15]=w,t[16]=E):E=t[16];let D;t[17]!==a||t[18]!==r?(D=e=>a(r,e),t[17]=a,t[18]=r,t[19]=D):D=t[19];let O;t[20]!==c||t[21]!==i.text||t[22]!==r||t[23]!==D?(O=(0,$.jsx)(Zn,{patternIndex:r,initialText:i.text,onCommit:D,filePaths:c}),t[20]=c,t[21]=i.text,t[22]=r,t[23]=D,t[24]=O):O=t[24];let k;t[25]===s?k=t[26]:(k=(0,$.jsx)(nr,{visible:s}),t[25]=s,t[26]=k);let A;t[27]!==l||t[28]!==_?(A=l({id:`S9Vnum`,values:{patternText:_}}),t[27]=l,t[28]=_,t[29]=A):A=t[29];let j;t[30]!==o||t[31]!==r?(j=()=>o(r),t[30]=o,t[31]=r,t[32]=j):j=t[32];let M;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(mt,{className:`size-3.5`}),t[33]=M):M=t[33];let N;t[34]!==A||t[35]!==j?(N=(0,$.jsx)(z,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-testid":`settings-okignore-remove`,"aria-label":A,onClick:j,className:`h-7 w-7 shrink-0 text-muted-foreground hover:text-destructive`,children:M}),t[34]=A,t[35]=j,t[36]=N):N=t[36];let P;t[37]!==O||t[38]!==k||t[39]!==N||t[40]!==E?(P=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[E,O,k,N]}),t[37]=O,t[38]=k,t[39]=N,t[40]=E,t[41]=P):P=t[41];let F;return t[42]!==r||t[43]!==p||t[44]!==C||t[45]!==P?(F=(0,$.jsx)(`li`,{ref:p,style:C,className:`flex flex-col gap-0.5 px-2 py-1.5`,"data-testid":`settings-okignore-row`,"data-pattern-index":r,children:P}),t[42]=r,t[43]=p,t[44]=C,t[45]=P,t[46]=F):F=t[46],F}function Zn(e){let t=(0,Z.c)(31),{patternIndex:n,initialText:r,onCommit:i,filePaths:a}=e,{_:o}=y(),[s,c]=(0,Q.useState)(r),l=(0,Q.useRef)(r),u=(0,Q.useRef)(!1),d,f;t[0]===r?(d=t[1],f=t[2]):(d=()=>{u.current||r!==l.current&&(c(r),l.current=r)},f=[r],t[0]=r,t[1]=d,t[2]=f),(0,Q.useEffect)(d,f);let p=sr(s),m=cr(s,a),h=n+1,g;t[3]!==s||t[4]!==i?(g=()=>{s!==l.current&&(l.current=s,i(s))},t[3]=s,t[4]=i,t[5]=g):g=t[5];let _=g,v,b;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>c(e.target.value),b=()=>{u.current=!0},t[6]=v,t[7]=b):(v=t[6],b=t[7]);let x;t[8]===_?x=t[9]:(x=()=>{u.current=!1,_()},t[8]=_,t[9]=x);let S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{e.key===`Enter`?(e.preventDefault(),e.currentTarget.blur()):e.key===`Escape`&&(e.preventDefault(),c(l.current),e.currentTarget.blur())},t[10]=S):S=t[10];let C;t[11]!==o||t[12]!==h?(C=o({id:`-YV1Uo`,values:{patternNumber:h}}),t[11]=o,t[12]=h,t[13]=C):C=t[13];let w=p.length>0?`border-amber-500/60 focus-visible:ring-amber-500/40`:``,T;t[14]===w?T=t[15]:(T=R(`h-7 flex-1 font-mono text-xs`,w),t[14]=w,t[15]=T);let E;t[16]!==s||t[17]!==T||t[18]!==x||t[19]!==C?(E=(0,$.jsx)(zt,{value:s,onChange:v,onFocus:b,onBlur:x,onKeyDown:S,"aria-label":C,className:T,"data-testid":`settings-okignore-row-input`}),t[16]=s,t[17]=T,t[18]=x,t[19]=C,t[20]=E):E=t[20];let D;t[21]===p?D=t[22]:(D=(0,$.jsx)($n,{warnings:p}),t[21]=p,t[22]=D);let O;t[23]!==E||t[24]!==D?(O=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[E,D]}),t[23]=E,t[24]=D,t[25]=O):O=t[25];let k;t[26]===m?k=t[27]:(k=(0,$.jsx)(lr,{count:m}),t[26]=m,t[27]=k);let A;return t[28]!==O||t[29]!==k?(A=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[O,k]}),t[28]=O,t[29]=k,t[30]=A):A=t[30],A}function Qn(e){let t=(0,Z.c)(34),{onAdd:n,placeholder:r,rejectionFlashKey:i,filePaths:a}=e,{_:o}=y(),[s,c]=(0,Q.useState)(``),l=sr(s),u=cr(s,a),d=hr(i),f;t[0]!==n||t[1]!==s?(f=()=>{let e=s.trim();e.length!==0&&(n(e),c(``))},t[0]=n,t[1]=s,t[2]=f):f=t[2];let p=f,m;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(m=e=>c(e.target.value),t[3]=m):m=t[3];let h;t[4]===p?h=t[5]:(h=e=>{e.key===`Enter`&&(e.preventDefault(),p())},t[4]=p,t[5]=h);let g;t[6]===o?g=t[7]:(g=o({id:`p9sdCy`}),t[6]=o,t[7]=g);let _=d?`border-destructive ring-2 ring-destructive/30 focus-visible:ring-destructive/50`:l.length>0?`border-amber-500/60 focus-visible:ring-amber-500/40`:``,b;t[8]===_?b=t[9]:(b=R(`h-8 text-sm`,_),t[8]=_,t[9]=b);let x=d?`true`:void 0,S;t[10]!==s||t[11]!==r||t[12]!==h||t[13]!==g||t[14]!==b||t[15]!==x?(S=(0,$.jsx)(zt,{value:s,onChange:m,onKeyDown:h,placeholder:r,"aria-label":g,className:b,"data-testid":`settings-okignore-add-input`,"data-rejection-flashing":x}),t[10]=s,t[11]=r,t[12]=h,t[13]=g,t[14]=b,t[15]=x,t[16]=S):S=t[16];let C;t[17]===l?C=t[18]:(C=(0,$.jsx)($n,{warnings:l}),t[17]=l,t[18]=C);let w;t[19]===s?w=t[20]:(w=s.trim(),t[19]=s,t[20]=w);let T=w.length===0,E;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(v,{id:`BY-g4_`}),t[21]=E):E=t[21];let D;t[22]!==p||t[23]!==T?(D=(0,$.jsx)(z,{size:`sm`,onClick:p,disabled:T,"data-testid":`settings-okignore-add-button`,children:E}),t[22]=p,t[23]=T,t[24]=D):D=t[24];let O;t[25]!==D||t[26]!==S||t[27]!==C?(O=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[S,C,D]}),t[25]=D,t[26]=S,t[27]=C,t[28]=O):O=t[28];let k;t[29]===u?k=t[30]:(k=(0,$.jsx)(lr,{count:u}),t[29]=u,t[30]=k);let A;return t[31]!==O||t[32]!==k?(A=(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,"data-testid":`settings-okignore-add`,children:[O,k]}),t[31]=O,t[32]=k,t[33]=A):A=t[33],A}function $n(e){let t=(0,Z.c)(31),{warnings:n}=e,{_:r}=y();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,s,c,l,u;t[1]!==r||t[2]!==n?(o=n.map(tr).join(` `),a=_t,i=ht,u=!0,s=`status`,c=`polite`,l=r({id:`NORKZU`,values:{summary:o}}),t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u):(i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9]);let d=String(n.length),f;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(pt,{"aria-hidden":`true`,className:`size-3.5`}),t[10]=f):f=t[10];let p;t[11]===o?p=t[12]:(p=(0,$.jsx)(`span`,{className:`sr-only`,children:o}),t[11]=o,t[12]=p);let m;t[13]!==s||t[14]!==c||t[15]!==l||t[16]!==d||t[17]!==p?(m=(0,$.jsxs)(`span`,{role:s,"aria-live":c,"aria-label":l,className:`flex w-4 shrink-0 cursor-help justify-center text-amber-500`,"data-testid":`settings-okignore-warning-indicator`,"data-warnings":d,children:[f,p]}),t[13]=s,t[14]=c,t[15]=l,t[16]=d,t[17]=p,t[18]=m):m=t[18];let h;t[19]!==i||t[20]!==u||t[21]!==m?(h=(0,$.jsx)(i,{asChild:u,children:m}),t[19]=i,t[20]=u,t[21]=m,t[22]=h):h=t[22];let g;t[23]===n?g=t[24]:(g=n.map(er),t[23]=n,t[24]=g);let _;t[25]===g?_=t[26]:(_=(0,$.jsx)(gt,{side:`top`,className:`max-w-xs`,children:(0,$.jsx)(`ul`,{className:`list-disc space-y-1 pl-4`,children:g})}),t[25]=g,t[26]=_);let v;return t[27]!==a||t[28]!==_||t[29]!==h?(v=(0,$.jsxs)(a,{children:[h,_]}),t[27]=a,t[28]=_,t[29]=h,t[30]=v):v=t[30],v}function er(e){return(0,$.jsx)(`li`,{children:e.message},e.code)}function tr(e){return e.message}function nr(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)(W,{"aria-hidden":`true`,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(v,{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 rr(e){return`okignore-pattern-${e}`}function ir(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 ar(e,t){return`${t}::${e}`}function or(e){return!w(e)||e.code!==`OKIGNORE_INVALID`?null:{detail:e.detail,lineNumber:e.lineNumber}}function sr(e){let t=(0,Z.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.length===0?[]:jn(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(jn(e))},Fn);return()=>clearTimeout(t)},o=[e],t[2]=e,t[3]=a,t[4]=o),(0,Q.useEffect)(a,o),r}function cr(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:kn(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(kn(i,t))},In);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 lr(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`,o;t[1]===a?o=t[2]:(o=R(`block text-xs`,a),t[1]=a,t[2]=o);let s;t[3]===n?s=t[4]:(s=(0,$.jsx)(v,{id:`-3Qbv7`,values:{count:n}}),t[3]=n,t[4]=s);let c;t[5]===r?c=t[6]:(c=r?(0,$.jsx)(`span`,{className:`ml-1 text-muted-foreground/60`,children:(0,$.jsx)(v,{id:`5kWklo`})}):null,t[5]=r,t[6]=c);let l;return t[7]!==i||t[8]!==o||t[9]!==s||t[10]!==c?(l=(0,$.jsxs)(`span`,{role:`status`,"aria-live":`polite`,"data-testid":`settings-okignore-preview`,"data-preview-state":`visible`,"data-preview-count":i,className:o,children:[s,c]}),t[7]=i,t[8]=o,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function ur(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 dr(){try{return globalThis.localStorage?.getItem(Bn)===`true`}catch{return!1}}function fr(e){try{globalThis.localStorage?.setItem(Bn,e?`true`:`false`)}catch(e){console.debug(`[OkignoreSection] localStorage unavailable; advanced toggle will not persist:`,e)}}function pr(){let e=(0,Z.c)(3),[t,n]=(0,Q.useState)(mr),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=e=>{n(e),fr(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 mr(){return dr()}function hr(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),Rn);return()=>clearTimeout(t)},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,Q.useEffect)(i,a),n}function gr(e){return`editor:${e}`}var _r=`skill`;function vr(e){let t=(0,Z.c)(11),{testId:n,children:r}=e,{_:i}=y(),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)(ft,{className:`size-3.5`}),t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==n?(s=(0,$.jsx)(ht,{asChild:!0,children:(0,$.jsx)(z,{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]=s):s=t[5];let c;t[6]===r?c=t[7]:(c=(0,$.jsx)(gt,{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]=c);let l;return t[8]!==s||t[9]!==c?(l=(0,$.jsxs)(_t,{children:[s,c]}),t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function yr(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)(v,{id:`HTW0Zw`,components:{0:(0,$.jsx)(`code`,{className:`inline-code`})}}):n===`enable-manually`?(0,$.jsx)(v,{id:`NNJsn7`}):(0,$.jsx)(v,{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 br(){let e=(0,Z.c)(29),{_:t}=y(),n=typeof window<`u`?window.okDesktop??null:null,[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(null),l,u;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{if(!n)return;let e=!1;return n.projectIntegrations.status().then(t=>{e||i(t)}).catch(()=>{e||o(!0)}),()=>{e=!0}},u=[n],e[0]=l,e[1]=u):(l=e[0],u=e[1]),(0,Q.useEffect)(l,u);let d;e[2]===t?d=e[3]:(d=async function(e,r){if(n){c(e.kind===`editor`?gr(e.id):_r);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)}}))}c(null)}},e[2]=t,e[3]=d);let f=d,p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`h3`,{id:`settings-project-ai-tools-title`,className:`text-base font-semibold`,children:(0,$.jsx)(v,{id:`crqzW5`})}),e[4]=p):p=e[4];let m;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[p,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(v,{id:`ZYtq3m`})})]}),e[5]=m):m=e[5];let h=m;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:[h,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`project-ai-tools-unavailable`,children:(0,$.jsx)(v,{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:[h,(0,$.jsxs)(`div`,{className:`space-y-2`,"data-testid":`project-ai-tools-loading`,children:[(0,$.jsx)(Y,{className:`h-10 w-full`}),(0,$.jsx)(Y,{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:[h,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`project-ai-tools-no-project`,children:(0,$.jsx)(v,{id:`yaPGPa`})})]}),e[8]=t):t=e[8],t}let g=s!==null||!r.available,_;e[9]===r.available?_=e[10]:(_=!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)(v,{id:`_NX6gG`})}),e[9]=r.available,e[10]=_);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)(v,{id:`psfGPX`})}),e[11]=b):b=e[11];let x;if(e[12]!==f||e[13]!==g||e[14]!==r.editors){let t;e[16]!==f||e[17]!==g?(t=e=>(0,$.jsx)(Sr,{editor:e,busy:g,onToggle:t=>void f({kind:`editor`,id:e.id},t)},e.id),e[16]=f,e[17]=g,e[18]=t):t=e[18],x=r.editors.map(t),e[12]=f,e[13]=g,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]!==f||e[22]!==g||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)(v,{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)(Nt,{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)(kt,{id:`project-ai-tools-skill`,checked:r.skill.installed,disabled:g,onCheckedChange:()=>void f({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)(v,{id:`khCa4M`})})]})]}),(0,$.jsxs)(vr,{testId:`project-ai-tools-skill-info`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(v,{id:`HSh8u_`})}),r.skill.paths.map(xr)]})]})})]}),e[21]=f,e[22]=g,e[23]=r.skill,e[24]=C):C=e[24];let w;return e[25]!==_||e[26]!==S||e[27]!==C?(w=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-project-ai-tools-title`,className:`space-y-4`,children:[h,_,S,C]}),e[25]=_,e[26]=S,e[27]=C,e[28]=w):w=e[28],w}function xr(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}function Sr(e){let t=(0,Z.c)(45),{editor:n,busy:r,onToggle:i}=e,{_:a}=y(),o=n.state===`installed`||n.state===`foreign`,s=r||n.state===`unmanageable`,c;t[0]!==a||t[1]!==n.state?(c=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]=c):c=t[2];let l=c,u=n.state===`foreign`||n.state===`unmanageable`?`text-xs text-amber-600 dark:text-amber-400`:`text-xs text-muted-foreground`,d=s?`flex items-start`:`flex items-start hover:bg-accent`,f=`project-ai-tools-editor-${n.id}`,p=s?`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`,m=`project-ai-tools-editor-${n.id}`,h;t[3]!==o||t[4]!==i?(h=()=>i(!o),t[3]=o,t[4]=i,t[5]=h):h=t[5];let g=`project-ai-tools-editor-checkbox-${n.id}`,_;t[6]!==o||t[7]!==s||t[8]!==m||t[9]!==h||t[10]!==g?(_=(0,$.jsx)(kt,{id:m,checked:o,disabled:s,onCheckedChange:h,className:`mt-0.5`,"data-testid":g}),t[6]=o,t[7]=s,t[8]=m,t[9]=h,t[10]=g,t[11]=_):_=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]!==u||t[16]!==l?(x=l!==null&&(0,$.jsx)(`span`,{className:u,"data-testid":`project-ai-tools-editor-status-${n.id}`,children:l}),t[14]=n.id,t[15]=u,t[16]=l,t[17]=x):x=t[17];let S;t[18]!==o||t[19]!==n.followUp||t[20]!==n.id?(S=o&&(0,$.jsx)(yr,{followUp:n.followUp,testId:`project-ai-tools-editor-followup-${n.id}`}),t[18]=o,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]!==f||t[28]!==p||t[29]!==_?(w=(0,$.jsxs)(Nt,{htmlFor:f,className:p,children:[_,C]}),t[26]=C,t[27]=f,t[28]=p,t[29]=_,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)(v,{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)(v,{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)(vr,{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]!==d?(j=(0,$.jsxs)(`li`,{className:d,children:[w,A]}),t[41]=w,t[42]=A,t[43]=d,t[44]=j):j=t[44],j}function Cr(e){let t=(0,Z.c)(68),{config:n}=e,{state:r,refresh:i}=He(``),[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(!1),u=xe(),d;t[0]===u?d=t[1]:(d=function(e,t){ct(h(e,t)),u.close()},t[0]=u,t[1]=d);let f=d,p,m,g,_,y,b,x,S,C;if(t[2]!==n||t[3]!==c||t[4]!==f||t[5]!==i||t[6]!==r){C=Symbol.for(`react.early_return_sentinel`);bb0:{let e=r.status===`ready`?(r.data.folder.templates_available??[]).filter(e=>e.scope===n.scope).sort(Tr):[];if(r.status===`error`){let{loadErrorTitle:e}=n,{message:a}=r,o=`settings-${n.testIdPrefix}-section`,s;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>l(!0),t[16]=s):s=t[16];let u;t[17]===n?u=t[18]:(u=(0,$.jsx)(Er,{config:n,onNewClick:s}),t[17]=n,t[18]=u);let d;t[19]!==e||t[20]!==a?(d=(0,$.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:(0,$.jsx)(v,{id:`uH_S-u`,values:{loadErrorTitle:e,message:a}})}),t[19]=e,t[20]=a,t[21]=d):d=t[21];let p;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(p=new Set,t[22]=p):p=t[22];let m;t[23]!==f||t[24]!==i?(m=e=>{i(),f(``,e)},t[23]=f,t[24]=i,t[25]=m):m=t[25];let h;t[26]!==c||t[27]!==m?(h=(0,$.jsx)(ye,{folderPath:``,existingNames:p,open:c,onOpenChange:l,onCreated:m}),t[26]=c,t[27]=m,t[28]=h):h=t[28];let g;t[29]!==n.settingsId||t[30]!==o||t[31]!==u||t[32]!==d||t[33]!==h?(g=(0,$.jsxs)(`section`,{className:`space-y-3`,"aria-labelledby":n.settingsId,"data-testid":o,children:[u,d,h]}),t[29]=n.settingsId,t[30]=o,t[31]=u,t[32]=d,t[33]=h,t[34]=g):g=t[34],C=g;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)(Er,{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)(Y,{className:`h-12 w-full`}),(0,$.jsx)(Y,{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],C=a;break bb0}_=`space-y-3`,y=n.settingsId,b=`settings-${n.testIdPrefix}-section`;let o;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>l(!0),t[42]=o):o=t[42],t[43]===n?x=t[44]:(x=(0,$.jsx)(Er,{config:n,onNewClick:o}),t[43]=n,t[44]=x);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)(ge,{template:e,onEdit:()=>f(e.source_folder,e.name),onDelete:()=>s(e),badge:(0,$.jsx)(a,{variant:n.badge.variant,className:`text-2xs`,children:n.badge.label})},e.name))});t[45]===u?S=t[46]:(S=(0,$.jsx)(`div`,{className:`rounded-lg border bg-card`,children:u}),t[45]=u,t[46]=S),p=ye,m=``,g=new Set(e.map(wr))}t[2]=n,t[3]=c,t[4]=f,t[5]=i,t[6]=r,t[7]=p,t[8]=m,t[9]=g,t[10]=_,t[11]=y,t[12]=b,t[13]=x,t[14]=S,t[15]=C}else p=t[7],m=t[8],g=t[9],_=t[10],y=t[11],b=t[12],x=t[13],S=t[14],C=t[15];if(C!==Symbol.for(`react.early_return_sentinel`))return C;let w;t[47]!==f||t[48]!==i?(w=e=>{i(),f(``,e)},t[47]=f,t[48]=i,t[49]=w):w=t[49];let T;t[50]!==p||t[51]!==c||t[52]!==w||t[53]!==m||t[54]!==g?(T=(0,$.jsx)(p,{folderPath:m,existingNames:g,open:c,onOpenChange:l,onCreated:w}),t[50]=p,t[51]=c,t[52]=w,t[53]=m,t[54]=g,t[55]=T):T=t[55];let E;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{e||s(null)},t[56]=E):E=t[56];let D;t[57]!==o||t[58]!==i?(D=(0,$.jsx)(we,{template:o,onOpenChange:E,onDeleted:i}),t[57]=o,t[58]=i,t[59]=D):D=t[59];let O;return t[60]!==T||t[61]!==D||t[62]!==_||t[63]!==y||t[64]!==b||t[65]!==x||t[66]!==S?(O=(0,$.jsxs)(`section`,{className:_,"aria-labelledby":y,"data-testid":b,children:[x,S,T,D]}),t[60]=T,t[61]=D,t[62]=_,t[63]=y,t[64]=b,t[65]=x,t[66]=S,t[67]=O):O=t[67],O}function wr(e){return e.name}function Tr(e,t){return(e.title??e.name).toLowerCase().localeCompare((t.title??t.name).toLowerCase())}function Er(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 o;t[5]!==i||t[6]!==a?(o=(0,$.jsxs)(`div`,{children:[i,a]}),t[5]=i,t[6]=a,t[7]=o):o=t[7];let s;t[8]!==n.testIdPrefix||t[9]!==r?(s=r?(0,$.jsxs)(z,{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)(v,{id:`G1Gw0v`})]}):null,t[8]=n.testIdPrefix,t[9]=r,t[10]=s):s=t[10];let c;return t[11]!==o||t[12]!==s?(c=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[o,s]}),t[11]=o,t[12]=s,t[13]=c):c=t[13],c}function Dr(){let e=(0,Z.c)(16),{_:t}=y(),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)(v,{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 o;e[7]===t?o=e[8]:(o=t({id:`ysxgu8`}),e[7]=t,e[8]=o);let s;e[9]===o?s=e[10]:(s={label:o,variant:`gray`},e[9]=o,e[10]=s);let c;return e[11]!==n||e[12]!==i||e[13]!==a||e[14]!==s?(c=(0,$.jsx)(Cr,{config:{scope:`local`,title:n,description:r,emptyMessage:i,loadErrorTitle:a,badge:s,settingsId:`settings-project-templates-title`,testIdPrefix:`project-templates`}}),e[11]=n,e[12]=i,e[13]=a,e[14]=s,e[15]=c):c=e[15],c}var Or=[2500,5e3];function kr(){let e=(0,Z.c)(71),{_:t}=y(),{projectLocalConfig:n,projectLocalSynced:r,projectLocalBinding:i}=qt(),{status:a,refresh:o}=me(),[s,c]=(0,Q.useState)(!1),l;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=[],e[0]=l):l=e[0];let u=(0,Q.useRef)(l),d,f;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>()=>{for(let e of u.current)clearTimeout(e)},f=[],e[1]=d,e[2]=f):(d=e[1],f=e[2]),(0,Q.useEffect)(d,f);let p=n?.search?.semantic?.baseUrl??`https://api.openai.com/v1`,m=n?.search?.semantic?.enabled??!1,h=r&&i!==null,g;e[3]===o?g=e[4]:(g=function(){for(let e of u.current)clearTimeout(e);u.current=Or.map(e=>setTimeout(o,e))},e[3]=o,e[4]=g);let b=g,x;e[5]!==t||e[6]!==i||e[7]!==o||e[8]!==b?(x=function(e){if(i===null)return X.error(t({id:`YW7Q86`})),!1;let n=i.patch({search:{semantic:{enabled:e}}});if(!n.ok){let r=O(n.error);return X.error(t(e?{id:`LYufDw`,values:{detail:r}}:{id:`5mksg0`,values:{detail:r}})),!1}return o(),b(),!0},e[5]=t,e[6]=i,e[7]=o,e[8]=b,e[9]=x):x=e[9];let S=x,C;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=function(e){return e.trim()||`https://api.openai.com/v1`},e[10]=C):C=e[10];let w=C,T;e[11]!==t||e[12]!==p||e[13]!==i||e[14]!==o||e[15]!==b?(T=function(e){if(i===null)return X.error(t({id:`YW7Q86`})),!1;let n=w(e);if(n===p)return!0;let r=i.patch({search:{semantic:{baseUrl:n}}});if(!r.ok){let e=O(r.error);return X.error(t({id:`eLl1VX`,values:{detail:e}})),!1}return o(),b(),!0},e[11]=t,e[12]=p,e[13]=i,e[14]=o,e[15]=b,e[16]=T):T=e[16];let D=T,k;e[17]===S?k=e[18]:(k=function(e){if(e){c(!0);return}S(!1)},e[17]=S,e[18]=k);let A=k,j;e[19]===S?j=e[20]:(j=function(){S(!0)&&c(!1)},e[19]=S,e[20]=j);let M=j,N;e[21]===D?N=e[22]:(N=function(e){let t=w(e.value);D(e.value)&&(e.value=t)},e[21]=D,e[22]=N);let P=N,F=a?.enabled??!1,I=a?.keyPresent??!1,L=a?.ready??!1,R=a?.capable??!1,z=a?.embedded??0,B=a?.total??0,ee;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(`h3`,{id:`settings-search-title`,className:`text-base font-semibold`,children:(0,$.jsx)(v,{id:`3y6XTb`})}),e[23]=ee):ee=e[23];let V;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[ee,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(v,{id:`dUQ7_J`})})]}),e[24]=V):V=e[24];let H;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(`label`,{htmlFor:`settings-search-semantic-toggle`,className:`text-sm font-medium`,children:(0,$.jsx)(v,{id:`3y6XTb`})}),e[25]=H):H=e[25];let U;e[26]===m?U=e[27]:(U=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[H,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,"data-testid":`settings-search-body`,children:m?(0,$.jsx)(v,{id:`stlgky`}):(0,$.jsx)(v,{id:`kdzzOK`})})]}),e[26]=m,e[27]=U);let te=!h,ne;e[28]!==t||e[29]!==m?(ne=t(m?{id:`fNr-MX`}:{id:`Aif3E7`}),e[28]=t,e[29]=m,e[30]=ne):ne=e[30];let W;e[31]!==m||e[32]!==A||e[33]!==te||e[34]!==ne?(W=(0,$.jsx)(_,{id:`settings-search-semantic-toggle`,checked:m,disabled:te,onCheckedChange:A,"aria-label":ne,"data-testid":`settings-search-semantic-toggle`}),e[31]=m,e[32]=A,e[33]=te,e[34]=ne,e[35]=W):W=e[35];let re;e[36]!==U||e[37]!==W?(re=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[U,W]}),e[36]=U,e[37]=W,e[38]=re):re=e[38];let ie;e[39]!==R||e[40]!==z||e[41]!==m||e[42]!==I||e[43]!==L||e[44]!==F||e[45]!==a||e[46]!==B?(ie=m?(0,$.jsx)(Ar,{loaded:a!==null,serverEnabled:F,keyPresent:I,ready:L,capable:R,embedded:z,total:B}):null,e[39]=R,e[40]=z,e[41]=m,e[42]=I,e[43]=L,e[44]=F,e[45]=a,e[46]=B,e[47]=ie):ie=e[47];let G;e[48]!==re||e[49]!==ie?(G=(0,$.jsxs)(`div`,{className:`rounded-md border p-3`,children:[re,ie]}),e[48]=re,e[49]=ie,e[50]=G):G=e[50];let ae;e[51]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(`label`,{htmlFor:`settings-search-base-url`,className:`text-sm font-medium`,children:(0,$.jsx)(v,{id:`L1rRuU`})}),e[51]=ae):ae=e[51];let oe;e[52]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[ae,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(v,{id:`pmOGtg`})})]}),e[52]=oe):oe=e[52];let K,q;e[53]===P?(K=e[54],q=e[55]):(K=e=>P(e.currentTarget),q=e=>{e.key===`Enter`&&(e.preventDefault(),P(e.currentTarget))},e[53]=P,e[54]=K,e[55]=q);let se=!h,J;e[56]!==p||e[57]!==K||e[58]!==q||e[59]!==se?(J=(0,$.jsx)(zt,{id:`settings-search-base-url`,defaultValue:p,onBlur:K,onKeyDown:q,placeholder:E,disabled:se,spellCheck:!1,autoComplete:`off`,"data-testid":`settings-search-base-url`,className:`h-8 font-mono text-sm`},p),e[56]=p,e[57]=K,e[58]=q,e[59]=se,e[60]=J):J=e[60];let ce;e[61]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,"data-testid":`settings-search-base-url-help`,children:(0,$.jsx)(v,{id:`lHCR4I`})}),e[61]=ce):ce=e[61];let le;e[62]===J?le=e[63]:(le=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,children:[oe,J,ce]}),e[62]=J,e[63]=le);let ue;e[64]!==s||e[65]!==M?(ue=(0,$.jsx)(jr,{open:s,onOpenChange:c,onConfirm:M}),e[64]=s,e[65]=M,e[66]=ue):ue=e[66];let de;return e[67]!==G||e[68]!==le||e[69]!==ue?(de=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-search-title`,className:`space-y-3`,"data-testid":`settings-search`,children:[V,G,le,ue]}),e[67]=G,e[68]=le,e[69]=ue,e[70]=de):de=e[70],de}function Ar(e){let t=(0,Z.c)(12),{loaded:n,serverEnabled:r,keyPresent:i,ready:a,capable:o,embedded:s,total:c}=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)(v,{id:`AdcGcG`})}),t[0]=e):e=t[0],e}if(!i){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)(v,{id:`dN20LW`,components:{0:(0,$.jsx)(`span`,{className:`font-medium`})}})}),t[1]=e):e=t[1],e}if(a&&!o){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)(v,{id:`oEgEn_`,components:{0:(0,$.jsx)(`span`,{className:`font-medium`})}})}),t[2]=e):e=t[2],e}if(!a){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)(v,{id:`VZSBXL`})}),t[3]=e):e=t[3],e}let l;t[4]!==s||t[5]!==c?(l=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(v,{id:`lVWEIL`,values:{embedded:s,total:c}})}),t[4]=s,t[5]=c,t[6]=l):l=t[6];let u;t[7]===s?u=t[8]:(u=s===0?(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(v,{id:`ku0yLQ`})}):null,t[7]=s,t[8]=u);let d;return t[9]!==l||t[10]!==u?(d=(0,$.jsxs)(`div`,{className:`mt-2 space-y-0.5`,"data-testid":`settings-search-coverage`,children:[l,u]}),t[9]=l,t[10]=u,t[11]=d):d=t[11],d}function jr(e){let t=(0,Z.c)(14),{open:n,onOpenChange:r,onConfirm:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(St,{children:(0,$.jsx)(v,{id:`vhAnzJ`})}),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsxs)(Dt,{children:[a,(0,$.jsx)(xt,{children:(0,$.jsx)(v,{id:`aENGMB`})})]}),t[1]=o):o=t[1];let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(`p`,{className:`mb-2 font-medium`,children:(0,$.jsx)(v,{id:`7PNNNs`})}),t[2]=s):s=t[2];let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(`li`,{children:(0,$.jsx)(v,{id:`UfW9Kr`})}),t[3]=c):c=t[3];let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(`li`,{children:(0,$.jsx)(v,{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`})}})}),t[4]=l):l=t[4];let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(wt,{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:[s,(0,$.jsxs)(`ul`,{className:`list-disc space-y-1.5 pl-5`,children:[c,l,(0,$.jsx)(`li`,{children:(0,$.jsx)(v,{id:`o5gfs1`,components:{0:(0,$.jsx)(`code`,{className:`rounded bg-amber-100 px-1 py-0.5 font-mono text-xs dark:bg-amber-900`})}})})]})]})}),t[5]=u):u=t[5];let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(Et,{asChild:!0,children:(0,$.jsx)(z,{variant:`outline`,children:(0,$.jsx)(v,{id:`dEgA5A`})})}),t[6]=d):d=t[6];let f;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(v,{id:`iMkWoF`}),t[7]=f):f=t[7];let p;t[8]===i?p=t[9]:(p=(0,$.jsxs)(Ct,{className:`sm:max-w-lg`,"data-testid":`settings-search-confirm`,children:[o,u,(0,$.jsxs)(Tt,{children:[d,(0,$.jsx)(z,{onClick:i,"data-testid":`settings-search-confirm-enable`,children:f})]})]}),t[8]=i,t[9]=p);let m;return t[10]!==r||t[11]!==n||t[12]!==p?(m=(0,$.jsx)(Ot,{open:n,onOpenChange:r,children:p}),t[10]=r,t[11]=n,t[12]=p,t[13]=m):m=t[13],m}function Mr(e){let t=(0,Z.c)(19),{installStates:n,terminalLaunch:r,disabled:i,onPick:a,onLaunchTerminal:o}=e,{_:s}=y(),[c,l]=(0,Q.useState)(``),u;if(t[0]!==s||t[1]!==i||t[2]!==n||t[3]!==c||t[4]!==o||t[5]!==a||t[6]!==r){let e;t[8]===n?e=t[9]:(e=e=>n[e.id]?.installed===!0,t[8]=n,t[9]=e);let d=ae.filter(e),f=ae.some(e=>n[e.id]?.installed==null),p=d.length>0,m=r!==null,h=p||m,g;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>l(e.target.value),t[10]=g):g=t[10];let _;t[11]===s?_=t[12]:(_=s({id:`Rah7yq`}),t[11]=s,t[12]=_);let y;t[13]===s?y=t[14]:(y=s({id:`ZBt4rI`}),t[13]=s,t[14]=y);let b;t[15]!==c||t[16]!==_||t[17]!==y?(b=(0,$.jsx)(`div`,{className:`px-2 pt-2 pb-1.5`,children:(0,$.jsx)(zt,{value:c,onChange:g,placeholder:_,"aria-label":y,"data-testid":`open-in-agent-instruction`})}),t[15]=c,t[16]=_,t[17]=y,t[18]=b):b=t[18],u=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[b,h?(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[m?(0,$.jsxs)(`fieldset`,{className:`m-0 flex min-w-0 flex-col gap-0.5 border-0 p-0`,children:[(0,$.jsx)(`legend`,{className:`px-1.5 py-1 font-medium text-muted-foreground text-xs`,"data-testid":`open-in-agent-terminal-label`,children:(0,$.jsx)(v,{id:`ALhMYW`})}),ue.map(e=>{let{displayName:t}=F[e];return(0,$.jsxs)(z,{type:`button`,variant:`ghost`,className:`h-auto w-full justify-start gap-1.5 rounded-md px-1.5 py-1 font-normal text-foreground`,disabled:i,"data-testid":`open-in-agent-terminal-${e}`,"aria-label":s({id:`QYfQdv`,values:{displayName:t}}),onClick:()=>o(e,c),children:[(0,$.jsx)(se,{id:q(e),"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:t})]},e)})]}):null,p?(0,$.jsxs)($.Fragment,{children:[m?(0,$.jsx)(De,{className:`my-1`}):null,(0,$.jsxs)(`fieldset`,{className:`m-0 flex min-w-0 flex-col gap-0.5 border-0 p-0`,children:[(0,$.jsx)(`legend`,{className:`px-1.5 py-1 font-medium text-muted-foreground text-xs`,"data-testid":`open-in-agent-desktop-label`,children:(0,$.jsx)(v,{id:`BBqGS9`})}),d.map(e=>{let{displayName:t}=e;return(0,$.jsxs)(z,{type:`button`,variant:`ghost`,className:`h-auto w-full justify-start gap-1.5 rounded-md px-1.5 py-1 font-normal text-foreground`,disabled:i,"data-testid":`open-in-agent-item-${e.id}`,"aria-label":s({id:`WqLq6M`,values:{displayName:t}}),onClick:()=>a(e,c),children:[(0,$.jsx)(se,{id:e.id,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:t})]},e.id)})]})]}):null]}):(0,$.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`open-in-agent-empty`,"aria-live":`polite`,children:f?(0,$.jsx)(v,{id:`EcR0fl`}):(0,$.jsx)(v,{id:`l6OXqI`})})]}),t[0]=s,t[1]=i,t[2]=n,t[3]=c,t[4]=o,t[5]=a,t[6]=r,t[7]=u}else u=t[7];return u}function Nr(e){let t=(0,Z.c)(44),{input:n,open:r,onOpenChange:i}=e,{_:a}=y(),{states:o,refresh:s}=ce(),{dispatch:c}=pe(),l=fe(),[u,m]=(0,Q.useState)(!1),h=(0,Q.useRef)(!1),g=Ze(),_=r??u,b;t[0]===s?b=t[1]:(b=()=>{s()},t[0]=s,t[1]=b);let x=(0,Q.useEffectEvent)(b),S;t[2]!==_||t[3]!==x?(S=()=>{_&&x()},t[2]=_,t[3]=x,t[4]=S):S=t[4];let C;if(t[5]===_?C=t[6]:(C=[_],t[5]=_,t[6]=C),(0,Q.useEffect)(S,C),g)return null;let w=typeof window<`u`&&window.okDesktop!=null,T;t[7]!==i||t[8]!==r?(T=e=>{r===void 0&&m(e),i?.(e)},t[7]=i,t[8]=r,t[9]=T):T=t[9];let E=T,D=n===null,O;t[10]===n?O=t[11]:(O=e=>{if(n===null)return null;let t=e.trim();return t?{...n,instruction:t}:n},t[10]=n,t[11]=O);let k=O,A;t[12]!==c||t[13]!==E||t[14]!==k?(A=(e,t)=>{let n=k(t);n!==null&&(c(e.id,n),E(!1))},t[12]=c,t[13]=E,t[14]=k,t[15]=A):A=t[15];let j=A,M;t[16]!==E||t[17]!==k||t[18]!==l?(M=(e,t)=>{let n=k(t);n===null||l===null||(l.launchInTerminal(n,e),E(!1))},t[16]=E,t[17]=k,t[18]=l,t[19]=M):M=t[19];let N=M,P;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(P=w?()=>{h.current=!0}:void 0,t[20]=P):P=t[20];let F;t[21]===E?F=t[22]:(F=w?()=>{if(h.current){h.current=!1;return}E(!0)}:void 0,t[21]=E,t[22]=F);let I,L;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(Xe,{className:`size-3.5`,"aria-hidden":`true`}),L=(0,$.jsx)(v,{id:`O7_W_a`}),t[23]=I,t[24]=L):(I=t[23],L=t[24]);let R;t[25]!==F||t[26]!==D?(R=(0,$.jsx)(p,{asChild:!0,children:(0,$.jsxs)(z,{variant:`ghost`,size:`sm`,disabled:D,className:`gap-1.5 text-muted-foreground px-1.5`,"data-testid":`open-in-agent-trigger`,onPointerDown:P,onClick:F,children:[I,L]})}),t[25]=F,t[26]=D,t[27]=R):R=t[27];let B;t[28]===a?B=t[29]:(B=a({id:`O7_W_a`}),t[28]=a,t[29]=B);let ee=n===null,V;t[30]!==N||t[31]!==j||t[32]!==o||t[33]!==ee||t[34]!==l?(V=(0,$.jsx)(Mr,{installStates:o,terminalLaunch:l,disabled:ee,onPick:j,onLaunchTerminal:N}),t[30]=N,t[31]=j,t[32]=o,t[33]=ee,t[34]=l,t[35]=V):V=t[35];let H;t[36]!==B||t[37]!==V?(H=(0,$.jsx)(d,{align:`end`,className:`p-1`,"aria-label":B,"data-testid":`open-in-agent-menu`,children:V}),t[36]=B,t[37]=V,t[38]=H):H=t[38];let U;return t[39]!==E||t[40]!==_||t[41]!==R||t[42]!==H?(U=(0,$.jsxs)(f,{open:_,onOpenChange:E,children:[R,H]}),t[39]=E,t[40]=_,t[41]=R,t[42]=H,t[43]=U):U=t[43],U}function Pr(e){let t=(0,Z.c)(50),{skill:n,onEdit:r,onDelete:i,onInstall:a,onUninstall:o,installing:s}=e,{_:c}=y(),l=oe(),u;t[0]!==n.name||t[1]!==n.scope||t[2]!==l?(u=K({skillName:n.name,scope:n.scope,workspace:l}),t[0]=n.name,t[1]=n.scope,t[2]=l,t[3]=u):u=t[3];let d=u,f=`skill-row-${n.name}`,p;t[4]===n.name?p=t[5]:(p=(0,$.jsx)(`code`,{className:`truncate font-mono font-medium`,children:n.name}),t[4]=n.name,t[5]=p);let m;t[6]===n.installed?m=t[7]:(m=(0,$.jsx)(Oe,{installed:n.installed,className:`text-2xs`}),t[6]=n.installed,t[7]=m);let h;t[8]!==p||t[9]!==m?(h=(0,$.jsxs)(`span`,{className:`flex w-full items-center gap-2`,children:[p,m]}),t[8]=p,t[9]=m,t[10]=h):h=t[10];let g;t[11]===n.description?g=t[12]:(g=n.description?(0,$.jsx)(`span`,{className:`block w-full truncate text-sm text-muted-foreground`,children:n.description}):(0,$.jsx)(`span`,{className:`block w-full truncate text-sm italic text-muted-foreground`,children:(0,$.jsx)(v,{id:`xnP32l`})}),t[11]=n.description,t[12]=g);let _;t[13]===n.hosts?_=t[14]:(_=n.hosts.length>0?(0,$.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1 pt-0.5`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(v,{id:`G_efLf`})}),n.hosts.map(Fr)]}):null,t[13]=n.hosts,t[14]=_);let b;t[15]!==r||t[16]!==h||t[17]!==g||t[18]!==_?(b=(0,$.jsxs)(z,{type:`button`,variant:`ghost`,onClick:r,className:`h-auto min-w-0 flex-1 flex-col items-start gap-0.5 px-1.5 py-1 text-left font-normal hover:bg-transparent`,children:[h,g,_]}),t[15]=r,t[16]=h,t[17]=g,t[18]=_,t[19]=b):b=t[19];let x;t[20]===d?x=t[21]:(x=(0,$.jsx)(`span`,{className:`shrink-0 self-center opacity-0 group-hover:opacity-100 focus-within:opacity-100 data-[state=open]:opacity-100`,children:(0,$.jsx)(Nr,{input:d})}),t[20]=d,t[21]=x);let S=`skill-install-${n.name}`,C;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(G,{className:`size-3.5`,"aria-hidden":!0}),t[22]=C):C=t[22];let w;t[23]===n.installed?w=t[24]:(w=n.installed?(0,$.jsx)(v,{id:`eQkgKV`}):(0,$.jsx)(v,{id:`TKQ7K-`}),t[23]=n.installed,t[24]=w);let T;t[25]!==s||t[26]!==a||t[27]!==S||t[28]!==w?(T=(0,$.jsxs)(z,{type:`button`,variant:`ghost`,size:`sm`,className:`shrink-0 self-center font-mono uppercase opacity-0 group-hover:opacity-100 focus-visible:opacity-100`,onClick:a,disabled:s,"data-testid":S,children:[C,w]}),t[25]=s,t[26]=a,t[27]=S,t[28]=w,t[29]=T):T=t[29];let E;t[30]!==c||t[31]!==n.name?(E=c({id:`RlLl3G`,values:{0:n.name}}),t[30]=c,t[31]=n.name,t[32]=E):E=t[32];let D;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(Ie,{className:`size-4`,"aria-hidden":!0}),t[33]=D):D=t[33];let O;t[34]===E?O=t[35]:(O=(0,$.jsx)(At,{asChild:!0,children:(0,$.jsx)(z,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 self-center opacity-0 group-hover:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100`,"aria-label":E,children:D})}),t[34]=E,t[35]=O);let k;t[36]!==i||t[37]!==r||t[38]!==o||t[39]!==n?(k=(0,$.jsx)(jt,{align:`end`,className:`min-w-52`,children:(0,$.jsx)(de,{skill:n,onEdit:r,onUninstall:o,onDelete:i})}),t[36]=i,t[37]=r,t[38]=o,t[39]=n,t[40]=k):k=t[40];let A;t[41]!==O||t[42]!==k?(A=(0,$.jsxs)(Mt,{children:[O,k]}),t[41]=O,t[42]=k,t[43]=A):A=t[43];let j;return t[44]!==T||t[45]!==A||t[46]!==f||t[47]!==b||t[48]!==x?(j=(0,$.jsxs)(`li`,{className:`group flex items-start gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-muted/50`,"data-testid":f,children:[b,x,T,A]}),t[44]=T,t[45]=A,t[46]=f,t[47]=b,t[48]=x,t[49]=j):j=t[49],j}function Fr(e){return(0,$.jsx)(a,{variant:`gray`,className:`text-2xs`,children:e},e)}function Ir(){let e=(0,Z.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`idle`},e[0]=t):t=e[0];let[n,r]=(0,Q.useState)(t),[i,a]=(0,Q.useState)(0),[o,s]=(0,Q.useState)(!1),c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1;return r({status:`loading`}),fetch(`/api/skill-targets`).then(Br).then(t=>{if(e)return;let n=I.safeParse(t);if(!n.success){console.error(`[ok-skills] /api/skill-targets response failed schema validation:`,n.error.issues),r({status:`error`,message:`Server returned an incomplete skill-targets response.`});return}r({status:`ready`,data:n.data})}).catch(t=>{e||r({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},e[1]=c):c=e[1];let l;e[2]===i?l=e[3]:(l=[i],e[2]=i,e[3]=l),(0,Q.useEffect)(c,l);let u;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=async e=>{s(!0);let t=await fetch(`/api/skill-targets`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({targets:e})}).catch(zr);if(!t?.ok){s(!1);let e=t?await t.json().catch(Rr):null;throw Error(Bt(e)??(t?`HTTP ${t.status}`:`Request failed`))}Vt(),a(Lr),s(!1)},e[4]=u):u=e[4];let d=u,f;return e[5]!==o||e[6]!==n?(f={state:n,save:d,saving:o},e[5]=o,e[6]=n,e[7]=f):f=e[7],f}function Lr(e){return e+1}function Rr(){return null}function zr(){return null}async function Br(e){if(!e.ok){let t=await e.json().catch(Vr);throw Error(Bt(t)??`HTTP ${e.status}`)}return e.json()}function Vr(){return null}function Hr(){let e=(0,Z.c)(21),{_:t}=y(),{state:n,save:r,saving:i}=Ir(),a=A,o;e[0]!==n.data||e[1]!==n.status?(o=n.status===`ready`?new Set(n.data.targets):new Set,e[0]=n.data,e[1]=n.status,e[2]=o):o=e[2];let s=o,c;e[3]!==t||e[4]!==r||e[5]!==n.data||e[6]!==n.status?(c=async(e,i)=>{if(n.status!==`ready`)return;let a=new Set(n.data.targets);i?a.add(e):a.delete(e);try{await r([...a])}catch(e){let n=e;X.error(t({id:`XqNHcm`,values:{0:n instanceof Error?n.message:String(n)}}))}},e[3]=t,e[4]=r,e[5]=n.data,e[6]=n.status,e[7]=c):c=e[7];let l=c,u;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(`h4`,{id:`settings-skill-targets-heading`,className:`text-sm font-medium`,children:(0,$.jsx)(v,{id:`el312q`})}),e[8]=u):u=e[8];let d;e[9]!==n.data||e[10]!==n.status?(d=(0,$.jsxs)(`div`,{children:[u,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:n.status===`ready`&&!n.data.configured?(0,$.jsx)(v,{id:`4XL6N4`}):(0,$.jsx)(v,{id:`Ea1prf`})})]}),e[9]=n.data,e[10]=n.status,e[11]=d):d=e[11];let f;e[12]!==i||e[13]!==s||e[14]!==n.message||e[15]!==n.status||e[16]!==l?(f=n.status===`error`?(0,$.jsx)(`div`,{className:`text-1sm text-destructive`,role:`alert`,"data-testid":`skill-targets-error`,children:(0,$.jsx)(v,{id:`yitgD9`,values:{0:n.message}})}):n.status===`idle`||n.status===`loading`?(0,$.jsxs)(`div`,{className:`space-y-2 pt-1`,children:[(0,$.jsx)(Y,{className:`h-5 w-40`}),(0,$.jsx)(Y,{className:`h-5 w-40`})]}):(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2 pt-1`,disabled:i,children:[(0,$.jsx)(`legend`,{className:`sr-only`,children:(0,$.jsx)(v,{id:`Sq8lf2`})}),a.map(e=>{let t=`skill-target-${e}`;return(0,$.jsxs)(Nt,{htmlFor:t,className:`text-sm font-normal`,children:[(0,$.jsx)(kt,{id:t,checked:s.has(e),onCheckedChange:t=>l(e,t===!0),disabled:i,"data-testid":`skill-target-${e}`}),(0,$.jsx)(`span`,{children:P[e]})]},e)})]}),e[12]=i,e[13]=s,e[14]=n.message,e[15]=n.status,e[16]=l,e[17]=f):f=e[17];let p;return e[18]!==d||e[19]!==f?(p=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-skill-targets-heading`,className:`space-y-2 rounded-lg border bg-card p-3`,"data-testid":`settings-skill-targets`,children:[d,f]}),e[18]=d,e[19]=f,e[20]=p):p=e[20],p}function Ur(){let e=(0,Z.c)(19),{_:t}=y(),n=Qe(),r=n.global,i;e[0]===t?i=e[1]:(i=t({id:`2bVHbB`}),e[0]=t,e[1]=i);let a;e[2]===t?a=e[3]:(a=t({id:`MmqnGI`}),e[2]=t,e[3]=a);let o;e[4]!==n.global||e[5]!==i||e[6]!==a?(o={title:r,blurb:i,empty:a},e[4]=n.global,e[5]=i,e[6]=a,e[7]=o):o=e[7];let s=n.project,c;e[8]===t?c=e[9]:(c=t({id:`RXNu_r`}),e[8]=t,e[9]=c);let l;e[10]===t?l=e[11]:(l=t({id:`uFOL2y`}),e[10]=t,e[11]=l);let u;e[12]!==n.project||e[13]!==c||e[14]!==l?(u={title:s,blurb:c,empty:l},e[12]=n.project,e[13]=c,e[14]=l,e[15]=u):u=e[15];let d;return e[16]!==o||e[17]!==u?(d={global:o,project:u},e[16]=o,e[17]=u,e[18]=d):d=e[18],d}function Wr(){let e=(0,Z.c)(26),t=J(),n=Ur(),r=xe(),[i,a]=(0,Q.useState)(!1),o;e[0]===r?o=e[1]:(o=function(e,t){ct(D(e,t)),r.close()},e[0]=r,e[1]=o);let s=o,c=le(),l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(`h3`,{id:`settings-skills-title`,className:`text-base font-semibold`,children:(0,$.jsx)(v,{id:`PCSkw2`})}),e[2]=l):l=e[2];let u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[l,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(v,{id:`wn8EJi`})})]}),e[3]=u):u=e[3];let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>a(!0),e[4]=d):d=e[4];let f,p;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[u,(0,$.jsxs)(z,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:d,"data-testid":`settings-skills-new-button`,children:[(0,$.jsx)(m,{className:`size-3.5`,"aria-hidden":!0}),(0,$.jsx)(v,{id:`MdpSC1`})]})]}),p=(0,$.jsx)(Hr,{}),e[5]=f,e[6]=p):(f=e[5],p=e[6]);let h;e[7]!==c.install||e[8]!==c.installingName||e[9]!==c.requestDelete||e[10]!==c.uninstall||e[11]!==n||e[12]!==s||e[13]!==t.data||e[14]!==t.message||e[15]!==t.status?(h=t.status===`error`?(0,$.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,"data-testid":`settings-skills-error`,children:(0,$.jsx)(v,{id:`OEu_0l`,values:{0:t.message}})}):t.status===`idle`||t.status===`loading`?(0,$.jsxs)(`div`,{className:`rounded-lg border bg-card p-3 space-y-2`,children:[(0,$.jsx)(Y,{className:`h-12 w-full`}),(0,$.jsx)(Y,{className:`h-12 w-full`})]}):Ye.map(e=>{let r=t.data.filter(t=>t.scope===e).sort(Gr);return e===`global`&&r.length===0?null:(0,$.jsx)(Kr,{chrome:n[e],scope:e,skills:r,installingName:c.installingName,onEdit:e=>s(e.scope,e.name),onDelete:c.requestDelete,onInstall:c.install,onUninstall:c.uninstall},e)}),e[7]=c.install,e[8]=c.installingName,e[9]=c.requestDelete,e[10]=c.uninstall,e[11]=n,e[12]=s,e[13]=t.data,e[14]=t.message,e[15]=t.status,e[16]=h):h=e[16];let g;e[17]===s?g=e[18]:(g=e=>{let{scope:t,name:n}=e;return s(t,n)},e[17]=s,e[18]=g);let _;e[19]!==i||e[20]!==g?(_=(0,$.jsx)(Fe,{defaultScope:`project`,open:i,onOpenChange:a,onCreated:g}),e[19]=i,e[20]=g,e[21]=_):_=e[21];let y;return e[22]!==c.dialogs||e[23]!==h||e[24]!==_?(y=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-skills-title`,className:`space-y-4`,"data-testid":`settings-skills-section`,children:[f,p,h,c.dialogs,_]}),e[22]=c.dialogs,e[23]=h,e[24]=_,e[25]=y):y=e[25],y}function Gr(e,t){return e.name.toLowerCase().localeCompare(t.name.toLowerCase())}function Kr(e){let t=(0,Z.c)(22),{chrome:n,scope:r,skills:i,installingName:a,onEdit:o,onDelete:s,onInstall:c,onUninstall:l}=e,u=`settings-skills-${r}-heading`,d=`skills-group-${r}`,f;t[0]!==n.title||t[1]!==u?(f=(0,$.jsx)(`h4`,{id:u,className:`text-sm font-medium`,children:n.title}),t[0]=n.title,t[1]=u,t[2]=f):f=t[2];let p;t[3]===n.blurb?p=t[4]:(p=(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:n.blurb}),t[3]=n.blurb,t[4]=p);let m;t[5]!==f||t[6]!==p?(m=(0,$.jsxs)(`div`,{children:[f,p]}),t[5]=f,t[6]=p,t[7]=m):m=t[7];let h;t[8]!==n.empty||t[9]!==a||t[10]!==s||t[11]!==o||t[12]!==c||t[13]!==l||t[14]!==r||t[15]!==i?(h=(0,$.jsx)(`div`,{className:`rounded-lg border bg-card`,children:i.length===0?(0,$.jsx)(`p`,{className:`px-3 py-4 text-sm text-muted-foreground`,"data-testid":`skills-group-${r}-empty`,children:n.empty}):(0,$.jsx)(`ul`,{className:`space-y-1 p-2`,"data-testid":`skills-group-${r}-list`,children:i.map(e=>(0,$.jsx)(Pr,{skill:e,installing:a===e.name,onEdit:()=>o(e),onDelete:()=>s(e),onInstall:()=>c(e),onUninstall:()=>l(e)},e.name))})}),t[8]=n.empty,t[9]=a,t[10]=s,t[11]=o,t[12]=c,t[13]=l,t[14]=r,t[15]=i,t[16]=h):h=t[16];let g;return t[17]!==u||t[18]!==d||t[19]!==m||t[20]!==h?(g=(0,$.jsxs)(`section`,{"aria-labelledby":u,className:`space-y-2`,"data-testid":d,children:[m,h]}),t[17]=u,t[18]=d,t[19]=m,t[20]=h,t[21]=g):g=t[21],g}function qr(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)]:qr(r,t)}}function Jr(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 Yr(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 Xr(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 Zr(){let e=(0,Z.c)(71),{_:t}=y(),{enabled:n,synced:r}=We(),i=qe(),a=n!==!1,{userConfig:o,userBinding:s,userSynced:c}=qt(),l=o?.agents?.autoApproveOkTools!==!1,[u,d]=(0,Q.useState)(!1),f,p;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{let e=window.okDesktop;if(!e)return;let t=!1;return e.terminal.cliPreflight(`codex`).then(e=>{t||d(e.onPath===`present`&&e.okServerConfigured!==!0)}).catch(Qr),()=>{t=!0}},p=[],e[0]=f,e[1]=p):(f=e[0],p=e[1]),(0,Q.useEffect)(f,p);let m;e[2]!==t||e[3]!==i?(m=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]=m):m=e[4];let h=m,g;e[5]!==t||e[6]!==s?(g=function(e){if(s===null){X.error(t({id:`fnlBN4`}));return}let n=s.patch({agents:{autoApproveOkTools:e}});if(!n.ok){let e=O(n.error);X.error(t({id:`habOU_`,values:{detail:e}}))}},e[5]=t,e[6]=s,e[7]=g):g=e[7];let v=g,b;e[8]===t?b=e[9]:(b=t({id:`ALhMYW`}),e[8]=t,e[9]=b);let x;e[10]===b?x=e[11]:(x=(0,$.jsx)(`h3`,{id:`settings-terminal-title`,className:`text-base font-semibold`,children:b}),e[10]=b,e[11]=x);let S;e[12]===t?S=e[13]:(S=t({id:`FCAcjR`}),e[12]=t,e[13]=S);let C;e[14]===S?C=e[15]:(C=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:S}),e[14]=S,e[15]=C);let w;e[16]!==x||e[17]!==C?(w=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[x,C]}),e[16]=x,e[17]=C,e[18]=w):w=e[18];let T;e[19]===t?T=e[20]:(T=t({id:`E4XYYH`}),e[19]=t,e[20]=T);let E;e[21]===T?E=e[22]:(E=(0,$.jsx)(`label`,{htmlFor:`settings-terminal-toggle`,className:`text-sm font-medium`,children:T}),e[21]=T,e[22]=E);let D;e[23]!==t||e[24]!==a?(D=t(a?{id:`AQGtjK`}:{id:`R65q-K`}),e[23]=t,e[24]=a,e[25]=D):D=e[25];let k;e[26]===D?k=e[27]:(k=(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-terminal-body`,children:D}),e[26]=D,e[27]=k);let A;e[28]!==E||e[29]!==k?(A=(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[E,k]}),e[28]=E,e[29]=k,e[30]=A):A=e[30];let j=!r||i===null,M;e[31]===t?M=e[32]:(M=t({id:`E4XYYH`}),e[31]=t,e[32]=M);let N;e[33]!==h||e[34]!==a||e[35]!==j||e[36]!==M?(N=(0,$.jsx)(_,{id:`settings-terminal-toggle`,checked:a,onCheckedChange:h,disabled:j,"aria-label":M,"data-testid":`settings-terminal-toggle`}),e[33]=h,e[34]=a,e[35]=j,e[36]=M,e[37]=N):N=e[37];let P;e[38]!==A||e[39]!==N?(P=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border p-3`,children:[A,N]}),e[38]=A,e[39]=N,e[40]=P):P=e[40];let F;e[41]===t?F=e[42]:(F=t({id:`ilodsp`}),e[41]=t,e[42]=F);let I;e[43]===F?I=e[44]:(I=(0,$.jsx)(`label`,{htmlFor:`settings-terminal-autoapprove-toggle`,className:`text-sm font-medium`,children:F}),e[43]=F,e[44]=I);let L;e[45]===t?L=e[46]:(L=t({id:`nP76lk`}),e[45]=t,e[46]=L);let R;e[47]===L?R=e[48]:(R=(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-terminal-autoapprove-body`,children:L}),e[47]=L,e[48]=R);let z;e[49]!==t||e[50]!==l||e[51]!==u?(z=l&&u?(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]=l,e[51]=u,e[52]=z):z=e[52];let B;e[53]!==I||e[54]!==R||e[55]!==z?(B=(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[I,R,z]}),e[53]=I,e[54]=R,e[55]=z,e[56]=B):B=e[56];let ee=!c||s===null,V;e[57]===t?V=e[58]:(V=t({id:`ilodsp`}),e[57]=t,e[58]=V);let H;e[59]!==v||e[60]!==l||e[61]!==ee||e[62]!==V?(H=(0,$.jsx)(_,{id:`settings-terminal-autoapprove-toggle`,checked:l,onCheckedChange:v,disabled:ee,"aria-label":V,"data-testid":`settings-terminal-autoapprove-toggle`}),e[59]=v,e[60]=l,e[61]=ee,e[62]=V,e[63]=H):H=e[63];let U;e[64]!==B||e[65]!==H?(U=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border p-3`,children:[B,H]}),e[64]=B,e[65]=H,e[66]=U):U=e[66];let te;return e[67]!==P||e[68]!==U||e[69]!==w?(te=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-terminal-title`,className:`space-y-3`,children:[w,P,U]}),e[67]=P,e[68]=U,e[69]=w,e[70]=te):te=e[70],te}function Qr(){}function $r(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=he(i),o,s;t[4]!==e||t[5]!==a?(o=()=>e.subscribe(e=>{ei(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=>ti(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 ei(e,t){e.reset(t,{keepDirtyValues:!0,keepDirty:!0,keepTouched:!0})}function ti(e,t,n){let r=e.getValues(n),i=qr(ii(n),r),a=t.patch(i);if(a.ok)return e.clearErrors(n),e.resetField(n,{defaultValue:r,keepError:!1}),!0;if(w(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:ni(a.error,n)});return!1}function ni(e,t){if(w(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>ri(e,t));if(n)return n.message}return O(e)}function ri(e,t){return e.path.map(String).join(`.`)===t}function ii(e){return e.split(`.`)}var ai=[{path:[`appearance`,`theme`],label:{id:`FEr96N`},description:{id:`JZ8cO6`},control:`enum-toggle`},{path:[`editor`,`wordWrap`],label:{id:`iKSP5j`},description:{id:`mmpzAq`}},{path:[`appearance`,`preview`,`autoOpen`],label:{id:`2XQ8Ww`},description:{id:`bultyE`}}],oi=`data-[state=on]:border-primary data-[state=on]:bg-primary data-[state=on]:text-primary-foreground data-[state=on]:hover:bg-primary/90`;function si(e){let t=(0,Z.c)(20),{activeId:n,userBinding:r,okignoreBinding:i,okignoreSynced:a}=e,{_:o}=y();if(n===`preferences`){let e;t[0]!==o||t[1]!==r?(e=r?(0,$.jsx)(pi,{title:o({id:`Q6hhn8`}),description:o({id:`Y_kL7X`}),scope:`user`,binding:r,fields:ai}):(0,$.jsx)(li,{}),t[0]=o,t[1]=r,t[2]=e):e=t[2];let n;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(xi,{}),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===`hotkeys`){let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(di,{}),t[6]=e):e=t[6],e}if(n===`account`){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(`div`,{className:`space-y-8`,children:[(0,$.jsx)(pn,{}),(0,$.jsx)(Tn,{})]}),t[7]=e):e=t[7],e}if(n===`sync`){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Ci,{}),t[8]=e):e=t[8],e}if(n===`search`){let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(kr,{}),t[9]=e):e=t[9],e}if(n===`terminal`){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Zr,{}),t[10]=e):e=t[10],e}if(n===`project-templates`){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Dr,{}),t[11]=e):e=t[11],e}if(n===`skills`){let e;return t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Wr,{}),t[12]=e):e=t[12],e}if(n===`sharing`){let e;return t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Zt,{}),t[13]=e):e=t[13],e}if(n===`okignore`){let e;return t[14]!==i||t[15]!==a?(e=(0,$.jsx)(Vn,{binding:i,synced:a}),t[14]=i,t[15]=a,t[16]=e):e=t[16],e}if(n===`ai-tools`){let e;return t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(yn,{}),t[17]=e):e=t[17],e}if(n===`project-ai-tools`){let e;return t[18]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(br,{}),t[18]=e):e=t[18],e}if(n===`claude-desktop`){let e;return t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Ai,{}),t[19]=e):e=t[19],e}return null}function ci(e){if(!w(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 li(){let e=(0,Z.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Y,{className:`h-5 w-32`}),n=(0,$.jsx)(Y,{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)(Y,{className:`h-9 w-full`}),(0,$.jsx)(Y,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function ui({binding:e}){return Ht(e).split(` / `).map((e,t)=>t===0?(0,$.jsx)(c,{"aria-label":Gt(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)(v,{id:`qEue6Q`})}),(0,$.jsx)(`span`,{"aria-hidden":`true`,children:` / `}),(0,$.jsx)(c,{"aria-label":Gt(e),children:e})]},`or-${e}`))}function di(){let e=(0,Z.c)(6),{_:t}=y(),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)(v,{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)(v,{id:`RaPMZv`})})]}),e[1]=r):r=e[1];let i;e[2]===t?i=e[3]:(i=Wt.map(e=>{let n=Kt.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(Ut[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(fi,0)>4;return(0,$.jsxs)(`li`,{"aria-describedby":r,"aria-labelledby":n,className:R(`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)(a,{variant:`gray`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(v,{id:`iXTp5j`})}),t(e.scope)]})]}),(0,$.jsx)(`p`,{className:`text-muted-foreground text-sm`,id:r,children:t(e.description)})]}),(0,$.jsx)(`div`,{className:R(`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)(ui,{binding:t},`${e.id}-${t.mac}-${t.windowsLinux}`))})]},e.id)})})]},e)}),e[2]=t,e[3]=i);let o;return e[4]===i?o=e[5]:(o=(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]=o),o}function fi(e,t){return e+Ht(t).split(` / `).length}function pi(e){let t=(0,Z.c)(14),{title:n,description:r,scope:i,binding:a,fields:o}=e,{form:s,commitField:c}=$r(a),[l,u]=(0,Q.useState)(null),d=(0,Q.useRef)(null),f,p;t[0]!==s||t[1]!==i?(f=()=>{let e=i===`project`?j:k,t=Ne(t=>{if(t.docName!==e)return;X.error(O(t.error),{duration:8e3});let n=ci(t.error);n&&(s.setError(n,{type:`config-validation-rejected`,message:ni(t.error,n)}),s.setFocus(n),u(n),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{u(null),s.clearErrors(n)},600))});return()=>{t(),d.current&&clearTimeout(d.current)}},p=[i,s],t[0]=s,t[1]=i,t[2]=f,t[3]=p):(f=t[2],p=t[3]),(0,Q.useEffect)(f,p);let m;t[4]!==c||t[5]!==r||t[6]!==o||t[7]!==l||t[8]!==i||t[9]!==n?(m=(0,$.jsx)(mi,{title:n,description:r,scope:i,fields:o,commitField:c,flashedPath:l}),t[4]=c,t[5]=r,t[6]=o,t[7]=l,t[8]=i,t[9]=n,t[10]=m):m=t[10];let h;return t[11]!==s||t[12]!==m?(h=(0,$.jsx)(nn,{...s,children:m}),t[11]=s,t[12]=m,t[13]=h):h=t[13],h}function mi(e){let t=(0,Z.c)(23),{title:n,description:r,scope:i,fields:a,commitField:o,flashedPath:s}=e,c=`settings-section-${i}-title`,l;t[0]!==n||t[1]!==c?(l=(0,$.jsx)(`h3`,{id:c,className:`text-base font-semibold`,children:n}),t[0]=n,t[1]=c,t[2]=l):l=t[2];let u;t[3]===r?u=t[4]:(u=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r}),t[3]=r,t[4]=u);let d;t[5]!==l||t[6]!==u?(d=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[l,u]}),t[5]=l,t[6]=u,t[7]=d):d=t[7];let f;if(t[8]!==o||t[9]!==a||t[10]!==s||t[11]!==i){let e;t[13]!==o||t[14]!==s||t[15]!==i?(e=e=>(0,$.jsx)(wi,{field:e,scope:i,commitField:o,isFlashed:s===e.path.join(`.`)},e.path.join(`.`)),t[13]=o,t[14]=s,t[15]=i,t[16]=e):e=t[16],f=a.map(e),t[8]=o,t[9]=a,t[10]=s,t[11]=i,t[12]=f}else f=t[12];let p;t[17]===f?p=t[18]:(p=(0,$.jsx)(`div`,{className:`space-y-10`,children:f}),t[17]=f,t[18]=p);let m;return t[19]!==d||t[20]!==p||t[21]!==c?(m=(0,$.jsxs)(`section`,{"aria-labelledby":c,className:`space-y-3`,children:[d,p]}),t[19]=d,t[20]=p,t[21]=c,t[22]=m):m=t[22],m}var hi=`content.attachmentFolderPath`,gi=`attachments`;function _i(e){let t=C(e);return t===`./`?`same-folder`:t===`/`?`content-root`:t.startsWith(`./`)?`current-folder-subfolder`:`content-root-folder`}function vi(e){let t=C(e);return t===`./`||t===`/`?gi:t.startsWith(`./`)?t.slice(2)||gi:t}function yi(e){return e.trim().replace(/^(?:\.\/)+/,``).replace(/\/{2,}/g,`/`).replace(/\/+$/g,``)}function bi(e,t){let n=yi(t)||gi;return e===`same-folder`?`./`:e===`content-root`?`/`:e===`current-folder-subfolder`?`./${n}`:n}function xi(){let e=(0,Z.c)(4),{projectBinding:t,projectConfig:n,projectSynced:r}=qt();if(!t||!r||!n){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(li,{}),e[0]=t):t=e[0],t}let i=n.content.attachmentFolderPath??`./`,a;return e[1]!==i||e[2]!==t?(a=(0,$.jsx)(Si,{binding:t,value:i},i),e[1]=i,e[2]=t,e[3]=a):a=e[3],a}function Si(e){let t=(0,Z.c)(50),{binding:n,value:r}=e,{_:i}=y(),a;t[0]===r?a=t[1]:(a=()=>_i(r),t[0]=r,t[1]=a);let[c,d]=(0,Q.useState)(a),f;t[2]===r?f=t[3]:(f=()=>vi(r),t[2]=r,t[3]=f);let[p,m]=(0,Q.useState)(f),[h,_]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(!1),[S,C]=(0,Q.useState)(!1),w=(0,Q.useRef)(null),T=(0,Q.useRef)(null),E,D;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>()=>{w.current&&clearTimeout(w.current),T.current&&clearTimeout(T.current)},D=[],t[4]=E,t[5]=D):(E=t[4],D=t[5]),(0,Q.useEffect)(E,D);let k,A;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>Ne(e=>{if(e.docName!==`__config__/project`||ci(e.error)!==hi)return;let t=ni(e.error,hi);X.error(O(e.error),{duration:8e3}),_(t),C(!0),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{C(!1),_(null)},600)}),A=[],t[6]=k,t[7]=A):(k=t[6],A=t[7]),(0,Q.useEffect)(k,A);let j;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>{x(!0),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>x(!1),1200)},t[8]=j):j=t[8];let M=j,N;t[9]!==i||t[10]!==n?(N=e=>{let t=n.patch({content:{attachmentFolderPath:e}});if(t.ok){_(null),M();return}let r=ni(t.error,hi);_(r),X.error(i({id:`eQxm13`,values:{detail:r}}))},t[9]=i,t[10]=n,t[11]=N):N=t[11];let P=N,F;t[12]!==P||t[13]!==p?(F=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`?p||gi:p;d(t),m(n),P(bi(t,n))},t[12]=P,t[13]=p,t[14]=F):F=t[14];let I=F,L;t[15]!==P||t[16]!==p||t[17]!==c?(L=()=>{let e=bi(c,p);m(vi(e)),P(e)},t[15]=P,t[16]=p,t[17]=c,t[18]=L):L=t[18];let z=L,B=c===`current-folder-subfolder`||c===`content-root-folder`,ee;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(`h3`,{id:`settings-attachments-title`,className:`text-base font-semibold`,children:(0,$.jsx)(v,{id:`w_Sphq`})}),t[19]=ee):ee=t[19];let V;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[ee,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(v,{id:`Hnl9nT`})})]}),t[20]=V):V=t[20];let H=S&&`animate-settings-flash`,U;t[21]===H?U=t[22]:(U=R(`rounded-md border p-3`,H),t[21]=H,t[22]=U);let te;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)(`div`,{className:`text-sm font-medium`,id:`settings-attachments-location-label`,children:(0,$.jsx)(v,{id:`AsqRE_`})}),t[23]=te):te=t[23];let ne;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[te,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(v,{id:`vppAju`})})]}),t[24]=ne):ne=t[24];let W;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(u,{"aria-labelledby":`settings-attachments-location-label`,"data-testid":`settings-attachments-mode`,size:`sm`,children:(0,$.jsx)(s,{})}),t[25]=W):W=t[25];let re;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsx)(g,{value:`same-folder`,children:(0,$.jsx)(v,{id:`Q7W-mC`})}),t[26]=re):re=t[26];let ie;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(g,{value:`content-root`,children:(0,$.jsx)(v,{id:`yWSvcf`})}),t[27]=ie):ie=t[27];let G;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsx)(g,{value:`current-folder-subfolder`,children:(0,$.jsx)(v,{id:`0YUS3Q`})}),t[28]=G):G=t[28];let ae;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsxs)(o,{children:[re,ie,G,(0,$.jsx)(g,{value:`content-root-folder`,children:(0,$.jsx)(v,{id:`qAx7xG`})})]}),t[29]=ae):ae=t[29];let oe;t[30]!==c||t[31]!==I?(oe=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(16rem,18rem)] sm:items-start`,children:[ne,(0,$.jsxs)(l,{value:c,onValueChange:I,children:[W,ae]})]}),t[30]=c,t[31]=I,t[32]=oe):oe=t[32];let K;t[33]!==i||t[34]!==z||t[35]!==p||t[36]!==B?(K=B?(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)(v,{id:`kNqMMd`})}),(0,$.jsx)(zt,{id:`settings-attachments-folder-input`,value:p,placeholder:i({id:`OeAl1e`}),onChange:e=>m(e.target.value),onBlur:z,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),z())},className:`h-8 text-sm`,"data-testid":`settings-attachments-folder`})]}):null,t[33]=i,t[34]=z,t[35]=p,t[36]=B,t[37]=K):K=t[37];let q;t[38]===h?q=t[39]:(q=h?(0,$.jsx)(`p`,{className:`text-1sm text-destructive`,"data-field-error":hi,role:`alert`,children:h}):null,t[38]=h,t[39]=q);let se;t[40]===b?se=t[41]:(se=(0,$.jsx)(ki,{visible:b}),t[40]=b,t[41]=se);let J;t[42]!==q||t[43]!==se?(J=(0,$.jsxs)(`div`,{className:`mt-2 flex min-h-5 items-center gap-2`,children:[q,se]}),t[42]=q,t[43]=se,t[44]=J):J=t[44];let ce;return t[45]!==U||t[46]!==oe||t[47]!==K||t[48]!==J?(ce=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-attachments-title`,className:`space-y-3`,"data-testid":`settings-attachments`,children:[V,(0,$.jsxs)(`div`,{className:U,"data-field":hi,"data-scope":`project`,children:[oe,K,J]})]}),t[45]=U,t[46]=oe,t[47]=K,t[48]=J,t[49]=ce):ce=t[49],ce}function Ci(){let e=(0,Z.c)(75),{_:t}=y(),n=V(),{projectConfig:r,projectLocalConfig:i,projectLocalSynced:a,projectSynced:o}=qt(),s=ee(),c=H(),{confirmOpen:l,setConfirmOpen:u,onToggleRequest:d,onConfirm:f}=U(s),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(!1);if(n&&!n.hasRemote&&n.state===`dormant`){let t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`h3`,{id:`settings-sync-title`,className:`text-base font-semibold`,children:(0,$.jsx)(v,{id:`Nu4DdT`})}),e[0]=t):t=e[0];let n;e[1]===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)(v,{id:`AiNMQ7`})})]}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(v,{id:`3_6U6f`})}),e[2]=r):r=e[2];let i;e[3]===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)(v,{id:`i92eAT`})})]}),e[3]=i):i=e[3];let a;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>m(!0),e[4]=a):a=e[4];let o;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border p-3`,children:[i,(0,$.jsx)(z,{onClick:a,"data-testid":`settings-sync-setup`,children:(0,$.jsx)(v,{id:`zkz0Fg`})})]}),e[5]=o):o=e[5];let s;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(yt,{asChild:!0,children:(0,$.jsxs)(z,{variant:`ghost`,size:`sm`,className:`group gap-1 px-1.5 text-muted-foreground`,children:[(0,$.jsx)(re,{className:`size-3.5 transition-transform group-data-[state=open]:rotate-90`,"aria-hidden":!0}),(0,$.jsx)(v,{id:`6caB2T`})]})}),e[6]=s):s=e[6];let c;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsxs)(bt,{children:[s,(0,$.jsx)(vt,{className:`px-1.5 pt-2 text-sm text-muted-foreground`,children:(0,$.jsx)(v,{id:`44DSl0`,components:{0:(0,$.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})})]}),e[7]=c):c=e[7];let l;return e[8]===p?l=e[9]:(l=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-sync-title`,className:`space-y-4`,"data-testid":`settings-sync-empty`,children:[n,o,c,(0,$.jsx)(Ge,{open:p,onOpenChange:m})]}),e[8]=p,e[9]=l),l}let b=i?.autoSync?.enabled??!1,x=n?.pushPermission?.checkStatus,S;e[10]!==a||e[11]!==x?(S=Se(a,x),e[10]=a,e[11]=x,e[12]=S):S=e[12];let C=S,w=n?.pushPermission?.checkStatus===`denied`||n?.pausedReason===`no-push-permission`,T;e[13]!==w||e[14]!==n?(T=w||!n?.pausedReason?null:Ke(n.pausedReason),e[13]=w,e[14]=n,e[15]=T):T=e[15];let E=T,D=r?.autoSync?.default??null,O=D===!0?`on`:D===!1?`off`:`ask`,k;e[16]!==t||e[17]!==c?(k=function(e){if(e!==`ask`&&e!==`on`&&e!==`off`)return;if(c===null){X.error(t({id:`fiMNLl`}));return}let n=c(e===`on`?!0:e===`off`?!1:null);if(!n.ok){let e=n.error;X.error(t({id:`oAFVKX`,values:{detail:e}}))}},e[16]=t,e[17]=c,e[18]=k):k=e[18];let A=k,j;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(`h3`,{id:`settings-sync-title`,className:`text-base font-semibold`,children:(0,$.jsx)(v,{id:`Nu4DdT`})}),e[19]=j):j=e[19];let M;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[j,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(v,{id:`T67A0Y`})})]}),e[20]=M):M=e[20];let N;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(`label`,{htmlFor:`settings-sync-toggle`,className:`text-sm font-medium`,children:(0,$.jsx)(v,{id:`Nx7BWE`})}),e[21]=N):N=e[21];let P;e[22]!==b||e[23]!==w?(P=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,"data-testid":`settings-sync-body`,children:w?(0,$.jsx)(v,{id:`l8G3S9`}):b?(0,$.jsx)(v,{id:`-gdcIo`}):(0,$.jsx)(v,{id:`qUB_o_`})}),e[22]=b,e[23]=w,e[24]=P):P=e[24];let F;e[25]!==t||e[26]!==n?(F=n?.remote?(0,$.jsxs)(`p`,{className:`text-muted-foreground text-1sm truncate`,"data-testid":`settings-sync-remote`,children:[(0,$.jsx)(v,{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)(ne,{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[25]=t,e[26]=n,e[27]=F):F=e[27];let I;e[28]!==P||e[29]!==F?(I=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[N,P,F]}),e[28]=P,e[29]=F,e[30]=I):I=e[30];let L;e[31]!==t||e[32]!==b||e[33]!==n?.pushPermission?.checkStatus?(L=n?.pushPermission?.checkStatus===`denied`?t({id:`FnMkli`}):t(b?{id:`OmHTGj`}:{id:`MKOVhz`}),e[31]=t,e[32]=b,e[33]=n?.pushPermission?.checkStatus,e[34]=L):L=e[34];let R;e[35]!==C||e[36]!==b||e[37]!==d||e[38]!==L?(R=(0,$.jsx)(_,{id:`settings-sync-toggle`,checked:b,disabled:C,onCheckedChange:d,"aria-label":L,"data-testid":`settings-sync-toggle`}),e[35]=C,e[36]=b,e[37]=d,e[38]=L,e[39]=R):R=e[39];let B;e[40]!==R||e[41]!==I?(B=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[I,R]}),e[40]=R,e[41]=I,e[42]=B):B=e[42];let W;e[43]===E?W=e[44]:(W=E!==null&&(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground mt-2`,"data-testid":`settings-sync-reason`,children:E}),e[43]=E,e[44]=W);let ie;e[45]===n?.pushPermission?ie=e[46]:(ie=_e(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)(v,{id:`C_cPoW`})}),(0,$.jsx)(z,{variant:`outline`,size:`xs`,className:`self-start`,onClick:()=>g(!0),children:(0,$.jsx)(v,{id:`5lWFkC`})})]}),e[45]=n?.pushPermission,e[46]=ie);let G;e[47]!==B||e[48]!==W||e[49]!==ie?(G=(0,$.jsxs)(`div`,{className:`rounded-md border p-3`,children:[B,W,ie]}),e[47]=B,e[48]=W,e[49]=ie,e[50]=G):G=e[50];let ae;e[51]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(v,{id:`j_Z6g7`})}),e[51]=ae):ae=e[51];let oe;e[52]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[ae,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(v,{id:`W3Xlpc`})})]}),e[52]=oe):oe=e[52];let K=!o,q;e[53]===t?q=e[54]:(q=t({id:`dvGKu2`}),e[53]=t,e[54]=q);let se;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,$.jsx)(Lt,{value:`ask`,className:oi,"data-testid":`settings-sync-default-ask`,children:(0,$.jsx)(v,{id:`EdQY6l`})}),e[55]=se):se=e[55];let J;e[56]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,$.jsx)(Lt,{value:`on`,className:oi,"data-testid":`settings-sync-default-on`,children:(0,$.jsx)(v,{id:`Z5HWHd`})}),e[56]=J):J=e[56];let ce;e[57]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsx)(Lt,{value:`off`,className:oi,"data-testid":`settings-sync-default-off`,children:(0,$.jsx)(v,{id:`az8lvo`})}),e[57]=ce):ce=e[57];let le;e[58]!==O||e[59]!==A||e[60]!==K||e[61]!==q?(le=(0,$.jsxs)(`div`,{className:`rounded-md border p-3 space-y-2`,"data-testid":`settings-sync-default`,children:[oe,(0,$.jsxs)(Rt,{type:`single`,variant:`outline`,spacing:2,value:O,onValueChange:A,disabled:K,"aria-label":q,"data-testid":`settings-sync-default-toggle`,children:[se,J,ce]})]}),e[58]=O,e[59]=A,e[60]=K,e[61]=q,e[62]=le):le=e[62];let ue;e[63]!==l||e[64]!==f||e[65]!==u?(ue=(0,$.jsx)(te,{open:l,onOpenChange:u,onConfirm:f}),e[63]=l,e[64]=f,e[65]=u,e[66]=ue):ue=e[66];let de;e[67]===Symbol.for(`react.memo_cache_sentinel`)?(de=()=>g(!1),e[67]=de):de=e[67];let fe;e[68]===h?fe=e[69]:(fe=(0,$.jsx)(Te,{open:h,onOpenChange:g,onSuccess:de}),e[68]=h,e[69]=fe);let pe;return e[70]!==G||e[71]!==le||e[72]!==ue||e[73]!==fe?(pe=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-sync-title`,className:`space-y-3`,children:[M,G,le,ue,fe]}),e[70]=G,e[71]=le,e[72]=ue,e[73]=fe,e[74]=pe):pe=e[74],pe}function wi({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=y(),a=Pe(),o=T(N,e.path),s=o?Yr(o):void 0,c=o?Jr(o):void 0,l=o?Xr(o):void 0,u=o?S(o):void 0,d=u?.scope===`project`&&t!==`project`||u?.scope===`user`&&t!==`user`,f=e.path.join(`.`),p=i(e.label),[m,h]=(0,Q.useState)(!1),g=(0,Q.useRef)(null);(0,Q.useEffect)(()=>()=>{g.current&&clearTimeout(g.current)},[]);let _=()=>{h(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>h(!1),1200)},b=()=>{let e=n(f);return e&&_(),e},x=()=>a.getFieldState(f).isDirty?b():!0,C=()=>{let e=c===void 0?null:c;a.setValue(f,e,{shouldDirty:!1}),b()},w=R(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(an,{control:a.control,name:f,render:({field:n})=>{let r=!d&&(c!==void 0||n.value!==void 0);return(0,$.jsxs)(cn,{className:w,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(ln,{className:`text-sm font-medium`,children:p}),r?(0,$.jsxs)(_t,{children:[(0,$.jsx)(ht,{asChild:!0,children:(0,$.jsx)(z,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:C,"aria-label":i({id:`lhjq3G`,values:{labelText:p}}),children:(0,$.jsx)(Yt,{className:`size-3.5`})})}),(0,$.jsx)(gt,{children:(0,$.jsx)(v,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)(dn,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(un,{children:(0,$.jsx)(Ti,{field:e,ctl:n,typeTag:s,enumOptions:l,onCommit:x})}),(0,$.jsx)(ki,{visible:m})]}),(0,$.jsx)(fn,{"data-field-error":e.path.join(`.`)})]})}})}function Ti({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:i,...a}){"use no memo";let{_:o}=y(),{setTheme:s}=b();if(n===`boolean`)return(0,$.jsx)(_,{...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,...c}=a,l=e.path[0]===`appearance`&&e.path[1]===`theme`;return(0,$.jsx)(Rt,{...c,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(l&&s(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)(Lt,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,$.jsx)(Di,{ctl:t,onCommit:i,...a}):n===`array`?(0,$.jsx)(Oi,{ctl:t,onCommit:i,...a}):(0,$.jsx)(Ei,{ctl:t,onCommit:i,...a})}function Ei({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(zt,{...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 Di({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)(zt,{...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 Oi({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
3
+ `):``,[i,a]=(0,Q.useState)(r),o=(0,Q.useRef)(r);(0,Q.useEffect)(()=>{let t=Array.isArray(e.value)?e.value.join(`
4
+ `):``;t!==o.current&&(a(t),o.current=t)},[e.value]);let s=()=>{let n=i.split(`
5
+ `).map(e=>e.trim()).filter(e=>e.length>0);e.onChange(n),t(),o.current=n.join(`
6
+ `)};return(0,$.jsx)(`textarea`,{...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(`
7
+ `).length)),className:`min-h-16 w-full rounded-md border border-input bg-background px-3 py-1.5 font-mono text-xs outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`})}function ki(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)(W,{"aria-hidden":`true`,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(v,{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:`text-emerald-600`,children:r}),t[2]=r,t[3]=i),i}function Ai(){(0,Z.c)(16);let[e,t]=(0,Q.useState)(!1),{skillInstalled:n,refresh:r}=Je();return null}export{si as SettingsDialogBody};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{n as i,r as a}from"./dist-CQw2y-s3.js";import{t as o}from"./button-cneJOVxD.js";import{t as ee}from"./git-branch-q0qWPEwd.js";import{t as s}from"./loader-circle-B7Gv_Djz.js";import{n as c,t as te}from"./miss-dialog-store-PJQ_kr0I.js";import{n as l}from"./dist-CoyydoqN.js";import{a as ne,c as re,i as ie,n as ae,o as u,s as oe,t as se}from"./dialog-DdHaoAGK.js";import{t as d}from"./desktop-bridge-types-NXCK8Pd7.js";import{a as f,n as ce}from"./receive-store-BBXikFBW.js";import{t as le}from"./share-metadata-rows-BttnPmuW.js";var p=e(t(),1),m=r();function ue(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 de(e){return e.detached?e.currentHeadSha:e.currentBranch??`HEAD`}function h(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 fe={phase:`loading`};function pe(e,t){return e.phase===`loading`?t===null?{phase:`error`}:{phase:`ready`,info:t}:e}function me(e,t){return e.phase!==`ready`&&e.phase!==`verdict`?e:{phase:`switching`,info:e.info,pendingDoc:t}}function he(e){return ue(e).kind===`B`&&e.shareTargetOnOriginBranch===!1}function ge(e){return e.phase===`ready`?{phase:`verdict-pending`,info:e.info}:e}function _e(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 ve(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=h(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}}}var g=n();function ye(e){return e!==null&&e.kind===`project-branch-switch`}function _(e){let t=(0,m.c)(184),{bridge:n,store:r}=e,h=r===void 0?ce:r,{_}=a(),v=(0,p.useSyncExternalStore)(h.subscribe,h.getSnapshot,Ee),[y,b]=(0,p.useState)(fe),De=(0,p.useRef)(!1),Oe=(0,p.useRef)(!1),ke=(0,p.useRef)(!1),Ae=(0,p.useRef)(null),je;t[0]===v?je=t[1]:(je=ye(v)?v:null,t[0]=v,t[1]=je);let x=je,Me;t[2]!==_||t[3]!==x?.share.target.kind?(Me=x?.share.target.kind===`folder`?_({id:`ugoTXs`}):_({id:`XH30C4`}),t[2]=_,t[3]=x?.share.target.kind,t[4]=Me):Me=t[4];let S=Me,C;t[5]===x?C=t[6]:(C=()=>{b(fe),De.current=!1,Oe.current=!1,ke.current=!1,Ae.current=x},t[5]=x,t[6]=C);let Ne;t[7]===v?Ne=t[8]:(Ne=[v],t[7]=v,t[8]=Ne),(0,p.useEffect)(C,Ne);let Pe;t[9]!==x||t[10]!==n?(Pe=()=>{if(!x||De.current)return;De.current=!0;let e=!1;return n.project.fetchBranchInfo({projectPath:x.projectPath,branch:x.share.branch,kind:x.share.target.kind,path:d(x.share.target)}).then(t=>{e||b(e=>pe(e,t))}).catch(t=>{e||(console.warn(`[receive] branch-info-fetch-failed`,t instanceof Error?t.message:t),b(Te))}),()=>{e=!0}},t[9]=x,t[10]=n,t[11]=Pe):Pe=t[11];let Fe;t[12]===x?Fe=t[13]:(Fe=[x],t[12]=x,t[13]=Fe),(0,p.useEffect)(Pe,Fe);let Ie;t[14]!==x||t[15]!==y.info||t[16]!==y.phase||t[17]!==n?(Ie=()=>{if(!x||y.phase!==`ready`||ke.current||!he(y.info))return;ke.current=!0,b(ge);let e=x;n.project.fetchTargetStatus({projectPath:x.projectPath,branch:x.share.branch,kind:x.share.target.kind,path:d(x.share.target)}).then(t=>{Ae.current===e&&b(e=>_e(e,t))}).catch(t=>{Ae.current===e&&(console.warn(`[receive] target-status-fetch-failed`,t instanceof Error?t.message:t),b(we))})},t[14]=x,t[15]=y.info,t[16]=y.phase,t[17]=n,t[18]=Ie):Ie=t[18];let Le;t[19]!==x||t[20]!==y.phase?(Le=[y.phase,x],t[19]=x,t[20]=y.phase,t[21]=Le):Le=t[21],(0,p.useEffect)(Ie,Le);let Re;t[22]!==x||t[23]!==y.phase||t[24]!==y.resolution||t[25]!==h?(Re=()=>{if(y.phase!==`verdict`)return;let{kind:e}=y.resolution;e!==`deleted`&&e!==`never-on-branch`||x&&(te.arm({kind:x.share.target.kind,path:d(x.share.target),branch:x.share.branch}),h.dismiss())},t[22]=x,t[23]=y.phase,t[24]=y.resolution,t[25]=h,t[26]=Re):Re=t[26];let ze;t[27]!==x||t[28]!==y||t[29]!==h?(ze=[y,x,h],t[27]=x,t[28]=y,t[29]=h,t[30]=ze):ze=t[30],(0,p.useEffect)(Re,ze);let Be;t[31]!==_||t[32]!==x||t[33]!==y.pendingDoc||t[34]!==y.phase||t[35]!==n||t[36]!==h||t[37]!==S?(Be=()=>{if(y.phase!==`awaiting-cc1-recycle`||!x)return;let e=x.share.branch,t=y.pendingDoc;if(!e){h.dismiss();return}if(Oe.current)return;Oe.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(f({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(_({id:`gQV-9w`,values:{targetNoun:S}}))}),h.dismiss();return}console.log(f({branch_dialog_action:`branch-switch-timeout`,branch:e})),l.error(_({id:`LBwUR6`,values:{targetNoun:S}})),h.dismiss()}}).catch(e=>{r||(console.warn(`[receive] awaitBranchSwitched rejected`,e instanceof Error?e.message:e),l.error(_({id:`Jw6EC4`,values:{targetNoun:S}})),h.dismiss())}),()=>{r=!0}},t[31]=_,t[32]=x,t[33]=y.pendingDoc,t[34]=y.phase,t[35]=n,t[36]=h,t[37]=S,t[38]=Be):Be=t[38];let Ve;if(t[39]!==x||t[40]!==y.phase?(Ve=[y.phase,x],t[39]=x,t[40]=y.phase,t[41]=Ve):Ve=t[41],(0,p.useEffect)(Be,Ve),!x)return null;let{share:w,projectPath:T,currentBranch:E}=x,D=w.branch,O;t[42]!==_||t[43]!==n.project||t[44]!==T||t[45]!==D||t[46]!==h?(O=function(e,t){console.log(f({branch_dialog_action:`switch`,branch_action:`switch`,branch:D})),b(t=>me(t,e)),n.project.runCheckout(t?{projectPath:T,branch:D,fastForward:!0}:{projectPath:T,branch:D}).then(e=>{let t=null,n=!1;b(r=>{let{state:i,sideEffect:a}=ve(r,e);return a&&(t=a.reason,n=i.phase===`dismissed`),i}),t===`branch-not-found`?l.error(_({id:`NJyQi_`,values:{shareBranch:D}})):t===`fetch-failed`?l.error(_({id:`bWLmRK`})):(t===`checkout-failed`||t===`proxy-null`)&&l.error(_({id:`c863eW`,values:{shareBranch:D}})),n&&h.dismiss()}).catch(e=>{console.warn(`[receive] runCheckout rejected branch_action=switch`,e instanceof Error?e.message:e),b(Ce),l.error(_({id:`c863eW`,values:{shareBranch:D}}))})},t[42]=_,t[43]=n.project,t[44]=T,t[45]=D,t[46]=h,t[47]=O):O=t[47];let k=O,He;t[48]!==y.info||t[49]!==y.phase||t[50]!==k||t[51]!==w.target?(He=function(){y.phase===`ready`&&ue(y.info).switchEnabled&&k(d(w.target),!1)},t[48]=y.info,t[49]=y.phase,t[50]=k,t[51]=w.target,t[52]=He):He=t[52];let Ue=He,We;t[53]!==y.phase||t[54]!==k||t[55]!==w.target?(We=function(){y.phase===`verdict`&&k(d(w.target),!0)},t[53]=y.phase,t[54]=k,t[55]=w.target,t[56]=We):We=t[56];let Ge=We,Ke;t[57]!==y.phase||t[58]!==y.resolution||t[59]!==k?(Ke=function(){y.phase===`verdict`&&y.resolution.kind===`renamed`&&k(y.resolution.renamedTo,!0)},t[57]=y.phase,t[58]=y.resolution,t[59]=k,t[60]=Ke):Ke=t[60];let qe=Ke,Je;t[61]!==y.phase||t[62]!==k||t[63]!==w.target?(Je=function(){y.phase===`verdict`&&k(d(w.target),!1)},t[61]=y.phase,t[62]=k,t[63]=w.target,t[64]=Je):Je=t[64];let Ye=Je,Xe;t[65]!==_||t[66]!==n.project||t[67]!==T||t[68]!==w.target||t[69]!==D||t[70]!==h||t[71]!==S?(Xe=function(){console.log(f({branch_dialog_action:`open-current`,branch:D})),n.project.open({path:T,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:w.target.kind,path:d(w.target)}}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=open-current`,e instanceof Error?e.message:e),l.error(_({id:`b5aNbi`,values:{targetNoun:S}}))}),h.dismiss()},t[65]=_,t[66]=n.project,t[67]=T,t[68]=w.target,t[69]=D,t[70]=h,t[71]=S,t[72]=Xe):Xe=t[72];let Ze=Xe,Qe;t[73]!==_||t[74]!==y.otherWorktreePath||t[75]!==y.phase||t[76]!==n.project||t[77]!==w.target||t[78]!==D||t[79]!==h?(Qe=function(){if(y.phase!==`branch-in-other-worktree`)return;let e=y.otherWorktreePath;console.log(f({branch_dialog_action:`pivot-to-other-worktree`,branch:D})),n.project.open({path:e,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:w.target.kind,path:d(w.target)},pendingBranch:D}).catch(t=>{console.warn(`[receive] pivot-open-failed branch_action=pivot-to-other-worktree`,t instanceof Error?t.message:t),l.error(_({id:`LdABLa`,values:{target:e}}))}),h.dismiss()},t[73]=_,t[74]=y.otherWorktreePath,t[75]=y.phase,t[76]=n.project,t[77]=w.target,t[78]=D,t[79]=h,t[80]=Qe):Qe=t[80];let $e=Qe,et;t[81]===h?et=t[82]:(et=function(){console.log(f({branch_dialog_action:`cancel`})),h.dismiss()},t[81]=h,t[82]=et);let A=et,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G,K,q;if(t[83]!==_||t[84]!==y.info||t[85]!==y.otherWorktreePath||t[86]!==y.phase||t[87]!==y.resolution||t[88]!==A||t[89]!==E||t[90]!==w.branch||t[91]!==w.owner||t[92]!==w.repo||t[93]!==w.target||t[94]!==D||t[95]!==S){q=y.phase===`ready`||y.phase===`switching`?ue(y.info):null;let e;t[113]!==y.info||t[114]!==y.phase||t[115]!==E?(e=y.phase===`ready`||y.phase===`switching`?de(y.info):E??`HEAD`,t[113]=y.info,t[114]=y.phase,t[115]=E,t[116]=e):e=t[116];let n=e;I=y.phase===`switching`||y.phase===`awaiting-cc1-recycle`;let r;t[117]===_?r=t[118]:(r=_({id:`OuY8t9`}),t[117]=_,t[118]=r),P=r;let a;t[119]!==_||t[120]!==D?(a=_({id:`_BthEY`,values:{shareBranch:D}}),t[119]=_,t[120]=D,t[121]=a):a=t[121],F=a;let o=y.phase===`loading`,ee=y.phase===`error`;N=se,G=!0,t[122]===A?K=t[123]:(K=e=>{e||A()},t[122]=A,t[123]=K),M=ie,B=`sm:max-w-xl`,V=`share-branch-switch-dialog`,H=Se,U=xe;let c;t[124]===S?c=t[125]:(c=(0,g.jsx)(re,{children:(0,g.jsx)(i,{id:`RY6Bq1`,values:{targetNoun:S}})}),t[124]=S,t[125]=c);let te=w.owner,l=w.repo,u;t[126]===w.target?u=t[127]:(u=d(w.target),t[126]=w.target,t[127]=u);let f;t[128]!==w.owner||t[129]!==w.repo||t[130]!==u?(f=(0,g.jsx)(ne,{className:`sr-only`,children:(0,g.jsx)(i,{id:`f8jU-L`,values:{0:te,1:l,2:u}})}),t[128]=w.owner,t[129]=w.repo,t[130]=u,t[131]=f):f=t[131],t[132]!==c||t[133]!==f?(W=(0,g.jsxs)(oe,{children:[c,f]}),t[132]=c,t[133]=f,t[134]=W):W=t[134],j=ae;let ce=w.owner,p=w.repo,m;t[135]===w.target?m=t[136]:(m=d(w.target),t[135]=w.target,t[136]=m),t[137]!==w.branch||t[138]!==w.owner||t[139]!==w.repo||t[140]!==w.target.kind||t[141]!==m?(L=(0,g.jsx)(`div`,{className:`mb-4`,children:(0,g.jsx)(le,{owner:ce,repo:p,path:m,kind:w.target.kind,branch:w.branch,testId:`share-branch-switch-metadata`,branchTestId:`share-branch-switch-metadata-branch`})}),t[137]=w.branch,t[138]=w.owner,t[139]=w.repo,t[140]=w.target.kind,t[141]=m,t[142]=L):L=t[142],R=y.phase===`branch-in-other-worktree`?(0,g.jsxs)(`div`,{className:`text-sm text-muted-foreground`,"data-testid":`share-branch-switch-in-other-worktree`,children:[(0,g.jsx)(`p`,{className:`leading-6`,children:(0,g.jsx)(i,{id:`yjExfe`,values:{shareBranch:D},components:{0:(0,g.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),(0,g.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,g.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,g.jsx)(s,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,g.jsx)(i,{id:`c8jBgX`})]}):y.phase===`verdict`?y.resolution.kind===`on-origin`?(0,g.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-on-origin`,children:(0,g.jsx)(i,{id:`Uay5NL`,values:{targetNoun:S,shareBranch:D},components:{0:(0,g.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):y.resolution.kind===`renamed`?(0,g.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-renamed`,children:(0,g.jsx)(i,{id:`P0HC30`,values:{0:y.resolution.renamedTo,targetNoun:S},components:{0:(0,g.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):y.resolution.kind===`diverged`?(0,g.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-diverged`,children:(0,g.jsx)(i,{id:`kLv8d3`,values:{shareBranch:D,targetNoun:S},components:{0:(0,g.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,g.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,g.jsx)(s,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,g.jsx)(i,{id:`c8jBgX`})]}):o?(0,g.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,g.jsx)(s,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,g.jsx)(i,{id:`jerqF0`})]}):ee?(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,g.jsx)(i,{id:`w4hMYl`})}):q?.kind===`D`?(0,g.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,g.jsx)(i,{id:`XnoA1k`,values:{targetNoun:S,shareBranch:D},components:{0:(0,g.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):q?.kind===`B`?(0,g.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,g.jsx)(i,{id:`sZ2IOu`,values:{targetNoun:S,shareBranch:D,currentLabel:n},components:{0:(0,g.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,g.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,g.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,g.jsx)(i,{id:`_902BE`,values:{targetNoun:S,shareBranch:D,currentLabel:n},components:{0:(0,g.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,g.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),z=q&&!q.switchEnabled&&q.conflictingFiles.length>0?(0,g.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,g.jsx)(`p`,{className:`font-medium text-foreground/90`,children:(0,g.jsx)(i,{id:`n2lRue`})}),(0,g.jsx)(`ul`,{id:`share-receive-branch-conflict-files`,className:`mt-1 list-disc space-y-0.5 pl-5 text-muted-foreground`,children:q.conflictingFiles.map(be)})]}):null,t[83]=_,t[84]=y.info,t[85]=y.otherWorktreePath,t[86]=y.phase,t[87]=y.resolution,t[88]=A,t[89]=E,t[90]=w.branch,t[91]=w.owner,t[92]=w.repo,t[93]=w.target,t[94]=D,t[95]=S,t[96]=j,t[97]=M,t[98]=N,t[99]=P,t[100]=F,t[101]=I,t[102]=L,t[103]=R,t[104]=z,t[105]=B,t[106]=V,t[107]=H,t[108]=U,t[109]=W,t[110]=G,t[111]=K,t[112]=q}else j=t[96],M=t[97],N=t[98],P=t[99],F=t[100],I=t[101],L=t[102],R=t[103],z=t[104],B=t[105],V=t[106],H=t[107],U=t[108],W=t[109],G=t[110],K=t[111],q=t[112];let J;t[143]===I?J=t[144]:(J=I?(0,g.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,g.jsx)(s,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,g.jsx)(i,{id:`CU3AiE`})]}):null,t[143]=I,t[144]=J);let Y;t[145]!==j||t[146]!==L||t[147]!==R||t[148]!==z||t[149]!==J?(Y=(0,g.jsxs)(j,{children:[L,R,z,J]}),t[145]=j,t[146]=L,t[147]=R,t[148]=z,t[149]=J,t[150]=Y):Y=t[150];let tt;t[151]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,g.jsx)(i,{id:`dEgA5A`}),t[151]=tt):tt=t[151];let X;t[152]===A?X=t[153]:(X=(0,g.jsx)(o,{variant:`ghost`,className:`font-mono uppercase`,onClick:A,"data-testid":`share-branch-switch-cancel`,children:tt}),t[152]=A,t[153]=X);let Z;t[154]!==y.phase||t[155]!==y.resolution||t[156]!==Ze||t[157]!==qe||t[158]!==$e||t[159]!==Ye||t[160]!==Ue||t[161]!==Ge||t[162]!==P||t[163]!==F||t[164]!==I||t[165]!==q?(Z=y.phase===`branch-in-other-worktree`?(0,g.jsx)(o,{onClick:$e,"data-testid":`share-branch-switch-in-other-worktree-pivot`,children:(0,g.jsx)(i,{id:`hyCxJY`})}):y.phase===`verdict`?y.resolution.kind===`on-origin`?(0,g.jsxs)(o,{onClick:Ge,"data-testid":`share-branch-switch-verdict-switch-update`,children:[(0,g.jsx)(ee,{className:`size-3.5`,"aria-hidden":!0}),(0,g.jsx)(i,{id:`uA_jXp`})]}):y.resolution.kind===`renamed`?(0,g.jsxs)(o,{onClick:qe,"data-testid":`share-branch-switch-verdict-open-renamed`,children:[(0,g.jsx)(c,{className:`size-3.5`,"aria-hidden":!0}),(0,g.jsx)(i,{id:`AItsE5`})]}):y.resolution.kind===`diverged`?(0,g.jsxs)(o,{onClick:Ye,"data-testid":`share-branch-switch-verdict-plain-switch`,children:[(0,g.jsx)(ee,{className:`size-3.5`,"aria-hidden":!0}),F]}):null:(0,g.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row sm:gap-2`,children:[q?.openCurrentEnabled?(0,g.jsxs)(o,{variant:`outline`,className:`font-mono uppercase`,onClick:Ze,disabled:I,"data-testid":`share-branch-switch-open-current`,children:[(0,g.jsx)(c,{className:`size-3.5`,"aria-hidden":!0}),P]}):null,(0,g.jsx)(o,{onClick:Ue,disabled:!q?.switchEnabled||I,"aria-disabled":!q?.switchEnabled||I,"aria-describedby":q&&!q.switchEnabled&&q.conflictingFiles.length>0?`share-receive-branch-conflict-files`:void 0,"data-testid":`share-branch-switch-switch`,children:I?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(s,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),F]}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(ee,{className:`size-3.5`,"aria-hidden":!0}),F]})})]}),t[154]=y.phase,t[155]=y.resolution,t[156]=Ze,t[157]=qe,t[158]=$e,t[159]=Ye,t[160]=Ue,t[161]=Ge,t[162]=P,t[163]=F,t[164]=I,t[165]=q,t[166]=Z):Z=t[166];let Q;t[167]!==X||t[168]!==Z?(Q=(0,g.jsxs)(u,{className:`sm:justify-between`,children:[X,Z]}),t[167]=X,t[168]=Z,t[169]=Q):Q=t[169];let $;t[170]!==M||t[171]!==B||t[172]!==V||t[173]!==H||t[174]!==U||t[175]!==W||t[176]!==Y||t[177]!==Q?($=(0,g.jsxs)(M,{className:B,"data-testid":V,onInteractOutside:H,onPointerDownOutside:U,children:[W,Y,Q]}),t[170]=M,t[171]=B,t[172]=V,t[173]=H,t[174]=U,t[175]=W,t[176]=Y,t[177]=Q,t[178]=$):$=t[178];let nt;return t[179]!==N||t[180]!==G||t[181]!==K||t[182]!==$?(nt=(0,g.jsx)(N,{open:G,onOpenChange:K,children:$}),t[179]=N,t[180]=G,t[181]=K,t[182]=$,t[183]=nt):nt=t[183],nt}function be(e){return(0,g.jsx)(`li`,{children:(0,g.jsx)(`code`,{className:`text-foreground/80`,children:e})},e)}function xe(e){e.preventDefault()}function Se(e){e.preventDefault()}function Ce(e){return ve(e,null).state}function we(e){return _e(e,null)}function Te(e){return pe(e,null)}function Ee(){return null}export{_ as ShareBranchSwitchDialog};
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{n as i,r as a}from"./dist-CQw2y-s3.js";import{t as o}from"./button-cneJOVxD.js";import{t as ee}from"./git-branch-q0qWPEwd.js";import{t as s}from"./loader-circle-B7Gv_Djz.js";import{n as c,t as te}from"./miss-dialog-store-PJQ_kr0I.js";import{n as l}from"./dist-CoyydoqN.js";import{a as ne,c as re,i as ie,n as ae,o as u,s as oe,t as se}from"./dialog-DdHaoAGK.js";import{t as d}from"./desktop-bridge-types-NXCK8Pd7.js";import{a as f,n as ce}from"./receive-store-C72xSCDE.js";import{t as le}from"./share-metadata-rows-BttnPmuW.js";var p=e(t(),1),m=r();function ue(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 de(e){return e.detached?e.currentHeadSha:e.currentBranch??`HEAD`}function h(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 fe={phase:`loading`};function pe(e,t){return e.phase===`loading`?t===null?{phase:`error`}:{phase:`ready`,info:t}:e}function me(e,t){return e.phase!==`ready`&&e.phase!==`verdict`?e:{phase:`switching`,info:e.info,pendingDoc:t}}function he(e){return ue(e).kind===`B`&&e.shareTargetOnOriginBranch===!1}function ge(e){return e.phase===`ready`?{phase:`verdict-pending`,info:e.info}:e}function _e(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 ve(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=h(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}}}var g=n();function ye(e){return e!==null&&e.kind===`project-branch-switch`}function _(e){let t=(0,m.c)(184),{bridge:n,store:r}=e,h=r===void 0?ce:r,{_}=a(),v=(0,p.useSyncExternalStore)(h.subscribe,h.getSnapshot,Ee),[y,b]=(0,p.useState)(fe),De=(0,p.useRef)(!1),Oe=(0,p.useRef)(!1),ke=(0,p.useRef)(!1),Ae=(0,p.useRef)(null),je;t[0]===v?je=t[1]:(je=ye(v)?v:null,t[0]=v,t[1]=je);let x=je,Me;t[2]!==_||t[3]!==x?.share.target.kind?(Me=x?.share.target.kind===`folder`?_({id:`ugoTXs`}):_({id:`XH30C4`}),t[2]=_,t[3]=x?.share.target.kind,t[4]=Me):Me=t[4];let S=Me,C;t[5]===x?C=t[6]:(C=()=>{b(fe),De.current=!1,Oe.current=!1,ke.current=!1,Ae.current=x},t[5]=x,t[6]=C);let Ne;t[7]===v?Ne=t[8]:(Ne=[v],t[7]=v,t[8]=Ne),(0,p.useEffect)(C,Ne);let Pe;t[9]!==x||t[10]!==n?(Pe=()=>{if(!x||De.current)return;De.current=!0;let e=!1;return n.project.fetchBranchInfo({projectPath:x.projectPath,branch:x.share.branch,kind:x.share.target.kind,path:d(x.share.target)}).then(t=>{e||b(e=>pe(e,t))}).catch(t=>{e||(console.warn(`[receive] branch-info-fetch-failed`,t instanceof Error?t.message:t),b(Te))}),()=>{e=!0}},t[9]=x,t[10]=n,t[11]=Pe):Pe=t[11];let Fe;t[12]===x?Fe=t[13]:(Fe=[x],t[12]=x,t[13]=Fe),(0,p.useEffect)(Pe,Fe);let Ie;t[14]!==x||t[15]!==y.info||t[16]!==y.phase||t[17]!==n?(Ie=()=>{if(!x||y.phase!==`ready`||ke.current||!he(y.info))return;ke.current=!0,b(ge);let e=x;n.project.fetchTargetStatus({projectPath:x.projectPath,branch:x.share.branch,kind:x.share.target.kind,path:d(x.share.target)}).then(t=>{Ae.current===e&&b(e=>_e(e,t))}).catch(t=>{Ae.current===e&&(console.warn(`[receive] target-status-fetch-failed`,t instanceof Error?t.message:t),b(we))})},t[14]=x,t[15]=y.info,t[16]=y.phase,t[17]=n,t[18]=Ie):Ie=t[18];let Le;t[19]!==x||t[20]!==y.phase?(Le=[y.phase,x],t[19]=x,t[20]=y.phase,t[21]=Le):Le=t[21],(0,p.useEffect)(Ie,Le);let Re;t[22]!==x||t[23]!==y.phase||t[24]!==y.resolution||t[25]!==h?(Re=()=>{if(y.phase!==`verdict`)return;let{kind:e}=y.resolution;e!==`deleted`&&e!==`never-on-branch`||x&&(te.arm({kind:x.share.target.kind,path:d(x.share.target),branch:x.share.branch}),h.dismiss())},t[22]=x,t[23]=y.phase,t[24]=y.resolution,t[25]=h,t[26]=Re):Re=t[26];let ze;t[27]!==x||t[28]!==y||t[29]!==h?(ze=[y,x,h],t[27]=x,t[28]=y,t[29]=h,t[30]=ze):ze=t[30],(0,p.useEffect)(Re,ze);let Be;t[31]!==_||t[32]!==x||t[33]!==y.pendingDoc||t[34]!==y.phase||t[35]!==n||t[36]!==h||t[37]!==S?(Be=()=>{if(y.phase!==`awaiting-cc1-recycle`||!x)return;let e=x.share.branch,t=y.pendingDoc;if(!e){h.dismiss();return}if(Oe.current)return;Oe.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(f({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(_({id:`gQV-9w`,values:{targetNoun:S}}))}),h.dismiss();return}console.log(f({branch_dialog_action:`branch-switch-timeout`,branch:e})),l.error(_({id:`LBwUR6`,values:{targetNoun:S}})),h.dismiss()}}).catch(e=>{r||(console.warn(`[receive] awaitBranchSwitched rejected`,e instanceof Error?e.message:e),l.error(_({id:`Jw6EC4`,values:{targetNoun:S}})),h.dismiss())}),()=>{r=!0}},t[31]=_,t[32]=x,t[33]=y.pendingDoc,t[34]=y.phase,t[35]=n,t[36]=h,t[37]=S,t[38]=Be):Be=t[38];let Ve;if(t[39]!==x||t[40]!==y.phase?(Ve=[y.phase,x],t[39]=x,t[40]=y.phase,t[41]=Ve):Ve=t[41],(0,p.useEffect)(Be,Ve),!x)return null;let{share:w,projectPath:T,currentBranch:E}=x,D=w.branch,O;t[42]!==_||t[43]!==n.project||t[44]!==T||t[45]!==D||t[46]!==h?(O=function(e,t){console.log(f({branch_dialog_action:`switch`,branch_action:`switch`,branch:D})),b(t=>me(t,e)),n.project.runCheckout(t?{projectPath:T,branch:D,fastForward:!0}:{projectPath:T,branch:D}).then(e=>{let t=null,n=!1;b(r=>{let{state:i,sideEffect:a}=ve(r,e);return a&&(t=a.reason,n=i.phase===`dismissed`),i}),t===`branch-not-found`?l.error(_({id:`NJyQi_`,values:{shareBranch:D}})):t===`fetch-failed`?l.error(_({id:`bWLmRK`})):(t===`checkout-failed`||t===`proxy-null`)&&l.error(_({id:`c863eW`,values:{shareBranch:D}})),n&&h.dismiss()}).catch(e=>{console.warn(`[receive] runCheckout rejected branch_action=switch`,e instanceof Error?e.message:e),b(Ce),l.error(_({id:`c863eW`,values:{shareBranch:D}}))})},t[42]=_,t[43]=n.project,t[44]=T,t[45]=D,t[46]=h,t[47]=O):O=t[47];let k=O,He;t[48]!==y.info||t[49]!==y.phase||t[50]!==k||t[51]!==w.target?(He=function(){y.phase===`ready`&&ue(y.info).switchEnabled&&k(d(w.target),!1)},t[48]=y.info,t[49]=y.phase,t[50]=k,t[51]=w.target,t[52]=He):He=t[52];let Ue=He,We;t[53]!==y.phase||t[54]!==k||t[55]!==w.target?(We=function(){y.phase===`verdict`&&k(d(w.target),!0)},t[53]=y.phase,t[54]=k,t[55]=w.target,t[56]=We):We=t[56];let Ge=We,Ke;t[57]!==y.phase||t[58]!==y.resolution||t[59]!==k?(Ke=function(){y.phase===`verdict`&&y.resolution.kind===`renamed`&&k(y.resolution.renamedTo,!0)},t[57]=y.phase,t[58]=y.resolution,t[59]=k,t[60]=Ke):Ke=t[60];let qe=Ke,Je;t[61]!==y.phase||t[62]!==k||t[63]!==w.target?(Je=function(){y.phase===`verdict`&&k(d(w.target),!1)},t[61]=y.phase,t[62]=k,t[63]=w.target,t[64]=Je):Je=t[64];let Ye=Je,Xe;t[65]!==_||t[66]!==n.project||t[67]!==T||t[68]!==w.target||t[69]!==D||t[70]!==h||t[71]!==S?(Xe=function(){console.log(f({branch_dialog_action:`open-current`,branch:D})),n.project.open({path:T,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:w.target.kind,path:d(w.target)}}).catch(e=>{console.warn(`[receive] warm-focus-dispatch-failed branch_action=open-current`,e instanceof Error?e.message:e),l.error(_({id:`b5aNbi`,values:{targetNoun:S}}))}),h.dismiss()},t[65]=_,t[66]=n.project,t[67]=T,t[68]=w.target,t[69]=D,t[70]=h,t[71]=S,t[72]=Xe):Xe=t[72];let Ze=Xe,Qe;t[73]!==_||t[74]!==y.otherWorktreePath||t[75]!==y.phase||t[76]!==n.project||t[77]!==w.target||t[78]!==D||t[79]!==h?(Qe=function(){if(y.phase!==`branch-in-other-worktree`)return;let e=y.otherWorktreePath;console.log(f({branch_dialog_action:`pivot-to-other-worktree`,branch:D})),n.project.open({path:e,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:w.target.kind,path:d(w.target)},pendingBranch:D}).catch(t=>{console.warn(`[receive] pivot-open-failed branch_action=pivot-to-other-worktree`,t instanceof Error?t.message:t),l.error(_({id:`LdABLa`,values:{target:e}}))}),h.dismiss()},t[73]=_,t[74]=y.otherWorktreePath,t[75]=y.phase,t[76]=n.project,t[77]=w.target,t[78]=D,t[79]=h,t[80]=Qe):Qe=t[80];let $e=Qe,et;t[81]===h?et=t[82]:(et=function(){console.log(f({branch_dialog_action:`cancel`})),h.dismiss()},t[81]=h,t[82]=et);let A=et,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G,K,q;if(t[83]!==_||t[84]!==y.info||t[85]!==y.otherWorktreePath||t[86]!==y.phase||t[87]!==y.resolution||t[88]!==A||t[89]!==E||t[90]!==w.branch||t[91]!==w.owner||t[92]!==w.repo||t[93]!==w.target||t[94]!==D||t[95]!==S){q=y.phase===`ready`||y.phase===`switching`?ue(y.info):null;let e;t[113]!==y.info||t[114]!==y.phase||t[115]!==E?(e=y.phase===`ready`||y.phase===`switching`?de(y.info):E??`HEAD`,t[113]=y.info,t[114]=y.phase,t[115]=E,t[116]=e):e=t[116];let n=e;I=y.phase===`switching`||y.phase===`awaiting-cc1-recycle`;let r;t[117]===_?r=t[118]:(r=_({id:`OuY8t9`}),t[117]=_,t[118]=r),P=r;let a;t[119]!==_||t[120]!==D?(a=_({id:`_BthEY`,values:{shareBranch:D}}),t[119]=_,t[120]=D,t[121]=a):a=t[121],F=a;let o=y.phase===`loading`,ee=y.phase===`error`;N=se,G=!0,t[122]===A?K=t[123]:(K=e=>{e||A()},t[122]=A,t[123]=K),M=ie,B=`sm:max-w-xl`,V=`share-branch-switch-dialog`,H=Se,U=xe;let c;t[124]===S?c=t[125]:(c=(0,g.jsx)(re,{children:(0,g.jsx)(i,{id:`RY6Bq1`,values:{targetNoun:S}})}),t[124]=S,t[125]=c);let te=w.owner,l=w.repo,u;t[126]===w.target?u=t[127]:(u=d(w.target),t[126]=w.target,t[127]=u);let f;t[128]!==w.owner||t[129]!==w.repo||t[130]!==u?(f=(0,g.jsx)(ne,{className:`sr-only`,children:(0,g.jsx)(i,{id:`f8jU-L`,values:{0:te,1:l,2:u}})}),t[128]=w.owner,t[129]=w.repo,t[130]=u,t[131]=f):f=t[131],t[132]!==c||t[133]!==f?(W=(0,g.jsxs)(oe,{children:[c,f]}),t[132]=c,t[133]=f,t[134]=W):W=t[134],j=ae;let ce=w.owner,p=w.repo,m;t[135]===w.target?m=t[136]:(m=d(w.target),t[135]=w.target,t[136]=m),t[137]!==w.branch||t[138]!==w.owner||t[139]!==w.repo||t[140]!==w.target.kind||t[141]!==m?(L=(0,g.jsx)(`div`,{className:`mb-4`,children:(0,g.jsx)(le,{owner:ce,repo:p,path:m,kind:w.target.kind,branch:w.branch,testId:`share-branch-switch-metadata`,branchTestId:`share-branch-switch-metadata-branch`})}),t[137]=w.branch,t[138]=w.owner,t[139]=w.repo,t[140]=w.target.kind,t[141]=m,t[142]=L):L=t[142],R=y.phase===`branch-in-other-worktree`?(0,g.jsxs)(`div`,{className:`text-sm text-muted-foreground`,"data-testid":`share-branch-switch-in-other-worktree`,children:[(0,g.jsx)(`p`,{className:`leading-6`,children:(0,g.jsx)(i,{id:`yjExfe`,values:{shareBranch:D},components:{0:(0,g.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),(0,g.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,g.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,g.jsx)(s,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,g.jsx)(i,{id:`c8jBgX`})]}):y.phase===`verdict`?y.resolution.kind===`on-origin`?(0,g.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-on-origin`,children:(0,g.jsx)(i,{id:`Uay5NL`,values:{targetNoun:S,shareBranch:D},components:{0:(0,g.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):y.resolution.kind===`renamed`?(0,g.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-renamed`,children:(0,g.jsx)(i,{id:`P0HC30`,values:{0:y.resolution.renamedTo,targetNoun:S},components:{0:(0,g.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):y.resolution.kind===`diverged`?(0,g.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,"data-testid":`share-branch-switch-verdict-diverged`,children:(0,g.jsx)(i,{id:`kLv8d3`,values:{shareBranch:D,targetNoun:S},components:{0:(0,g.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,g.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,g.jsx)(s,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,g.jsx)(i,{id:`c8jBgX`})]}):o?(0,g.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,g.jsx)(s,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,g.jsx)(i,{id:`jerqF0`})]}):ee?(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,g.jsx)(i,{id:`w4hMYl`})}):q?.kind===`D`?(0,g.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,g.jsx)(i,{id:`XnoA1k`,values:{targetNoun:S,shareBranch:D},components:{0:(0,g.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):q?.kind===`B`?(0,g.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,g.jsx)(i,{id:`sZ2IOu`,values:{targetNoun:S,shareBranch:D,currentLabel:n},components:{0:(0,g.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,g.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}):(0,g.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:(0,g.jsx)(i,{id:`_902BE`,values:{targetNoun:S,shareBranch:D,currentLabel:n},components:{0:(0,g.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`}),1:(0,g.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),z=q&&!q.switchEnabled&&q.conflictingFiles.length>0?(0,g.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,g.jsx)(`p`,{className:`font-medium text-foreground/90`,children:(0,g.jsx)(i,{id:`n2lRue`})}),(0,g.jsx)(`ul`,{id:`share-receive-branch-conflict-files`,className:`mt-1 list-disc space-y-0.5 pl-5 text-muted-foreground`,children:q.conflictingFiles.map(be)})]}):null,t[83]=_,t[84]=y.info,t[85]=y.otherWorktreePath,t[86]=y.phase,t[87]=y.resolution,t[88]=A,t[89]=E,t[90]=w.branch,t[91]=w.owner,t[92]=w.repo,t[93]=w.target,t[94]=D,t[95]=S,t[96]=j,t[97]=M,t[98]=N,t[99]=P,t[100]=F,t[101]=I,t[102]=L,t[103]=R,t[104]=z,t[105]=B,t[106]=V,t[107]=H,t[108]=U,t[109]=W,t[110]=G,t[111]=K,t[112]=q}else j=t[96],M=t[97],N=t[98],P=t[99],F=t[100],I=t[101],L=t[102],R=t[103],z=t[104],B=t[105],V=t[106],H=t[107],U=t[108],W=t[109],G=t[110],K=t[111],q=t[112];let J;t[143]===I?J=t[144]:(J=I?(0,g.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,g.jsx)(s,{className:`h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,g.jsx)(i,{id:`CU3AiE`})]}):null,t[143]=I,t[144]=J);let Y;t[145]!==j||t[146]!==L||t[147]!==R||t[148]!==z||t[149]!==J?(Y=(0,g.jsxs)(j,{children:[L,R,z,J]}),t[145]=j,t[146]=L,t[147]=R,t[148]=z,t[149]=J,t[150]=Y):Y=t[150];let tt;t[151]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,g.jsx)(i,{id:`dEgA5A`}),t[151]=tt):tt=t[151];let X;t[152]===A?X=t[153]:(X=(0,g.jsx)(o,{variant:`ghost`,className:`font-mono uppercase`,onClick:A,"data-testid":`share-branch-switch-cancel`,children:tt}),t[152]=A,t[153]=X);let Z;t[154]!==y.phase||t[155]!==y.resolution||t[156]!==Ze||t[157]!==qe||t[158]!==$e||t[159]!==Ye||t[160]!==Ue||t[161]!==Ge||t[162]!==P||t[163]!==F||t[164]!==I||t[165]!==q?(Z=y.phase===`branch-in-other-worktree`?(0,g.jsx)(o,{onClick:$e,"data-testid":`share-branch-switch-in-other-worktree-pivot`,children:(0,g.jsx)(i,{id:`hyCxJY`})}):y.phase===`verdict`?y.resolution.kind===`on-origin`?(0,g.jsxs)(o,{onClick:Ge,"data-testid":`share-branch-switch-verdict-switch-update`,children:[(0,g.jsx)(ee,{className:`size-3.5`,"aria-hidden":!0}),(0,g.jsx)(i,{id:`uA_jXp`})]}):y.resolution.kind===`renamed`?(0,g.jsxs)(o,{onClick:qe,"data-testid":`share-branch-switch-verdict-open-renamed`,children:[(0,g.jsx)(c,{className:`size-3.5`,"aria-hidden":!0}),(0,g.jsx)(i,{id:`AItsE5`})]}):y.resolution.kind===`diverged`?(0,g.jsxs)(o,{onClick:Ye,"data-testid":`share-branch-switch-verdict-plain-switch`,children:[(0,g.jsx)(ee,{className:`size-3.5`,"aria-hidden":!0}),F]}):null:(0,g.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row sm:gap-2`,children:[q?.openCurrentEnabled?(0,g.jsxs)(o,{variant:`outline`,className:`font-mono uppercase`,onClick:Ze,disabled:I,"data-testid":`share-branch-switch-open-current`,children:[(0,g.jsx)(c,{className:`size-3.5`,"aria-hidden":!0}),P]}):null,(0,g.jsx)(o,{onClick:Ue,disabled:!q?.switchEnabled||I,"aria-disabled":!q?.switchEnabled||I,"aria-describedby":q&&!q.switchEnabled&&q.conflictingFiles.length>0?`share-receive-branch-conflict-files`:void 0,"data-testid":`share-branch-switch-switch`,children:I?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(s,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),F]}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(ee,{className:`size-3.5`,"aria-hidden":!0}),F]})})]}),t[154]=y.phase,t[155]=y.resolution,t[156]=Ze,t[157]=qe,t[158]=$e,t[159]=Ye,t[160]=Ue,t[161]=Ge,t[162]=P,t[163]=F,t[164]=I,t[165]=q,t[166]=Z):Z=t[166];let Q;t[167]!==X||t[168]!==Z?(Q=(0,g.jsxs)(u,{className:`sm:justify-between`,children:[X,Z]}),t[167]=X,t[168]=Z,t[169]=Q):Q=t[169];let $;t[170]!==M||t[171]!==B||t[172]!==V||t[173]!==H||t[174]!==U||t[175]!==W||t[176]!==Y||t[177]!==Q?($=(0,g.jsxs)(M,{className:B,"data-testid":V,onInteractOutside:H,onPointerDownOutside:U,children:[W,Y,Q]}),t[170]=M,t[171]=B,t[172]=V,t[173]=H,t[174]=U,t[175]=W,t[176]=Y,t[177]=Q,t[178]=$):$=t[178];let nt;return t[179]!==N||t[180]!==G||t[181]!==K||t[182]!==$?(nt=(0,g.jsx)(N,{open:G,onOpenChange:K,children:$}),t[179]=N,t[180]=G,t[181]=K,t[182]=$,t[183]=nt):nt=t[183],nt}function be(e){return(0,g.jsx)(`li`,{children:(0,g.jsx)(`code`,{className:`text-foreground/80`,children:e})},e)}function xe(e){e.preventDefault()}function Se(e){e.preventDefault()}function Ce(e){return ve(e,null).state}function we(e){return _e(e,null)}function Te(e){return pe(e,null)}function Ee(){return null}export{_ as ShareBranchSwitchDialog};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{n as i,r as a}from"./dist-CQw2y-s3.js";import{Gt as o,Ut as s}from"./dist-DN4vicwQ.js";import{t as c}from"./button-cneJOVxD.js";import{t as ee}from"./loader-circle-B7Gv_Djz.js";import{n as l}from"./dist-CoyydoqN.js";import{a as te,c as u,i as d,n as f,o as ne,s as p,t as m}from"./dialog-DdHaoAGK.js";import{t as h}from"./desktop-bridge-types-NXCK8Pd7.js";import{a as re,i as g,n as _,o as v,r as ie,s as y}from"./receive-store-BBXikFBW.js";import{t as ae}from"./share-metadata-rows-BttnPmuW.js";var b=e(t(),1),x=r(),S=e=>({phase:`ready`,seed:e});function C(e){return e.phase===`ready`?{phase:`initializing`,seed:e.seed}:e}function w(e,t){return e.phase===`initializing`?t.ok?{phase:`opening`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:t.reason,message:t.message}:e}function T(e,t){return e.phase===`opening`?t.ok?{phase:`done`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:`network-error`,message:t.message}:e}function E(e){return e.phase===`done`||e.phase===`cancelled`||e.phase===`error`?e:{phase:`cancelled`,seed:e.seed}}var D=n();function O(e){return e!==null&&e.kind===`launcher-consent`}function k(e){return e!==null&&e.kind===`launcher-miss`}function A(e){let t=(0,x.c)(14),{bridge:n,cloneController:r,store:i}=e,a=i===void 0?_:i,o=(0,b.useSyncExternalStore)(a.subscribe,a.getSnapshot,M),[s,c]=(0,b.useState)(0),[ee,te]=(0,b.useState)(o);o!==ee&&(te(o),c(j));let u,d;t[0]!==o||t[1]!==a?(u=()=>{if(!o)return;let e=y(o);e&&(l.error(e.message),a.dismiss())},d=[o,a],t[0]=o,t[1]=a,t[2]=u,t[3]=d):(u=t[2],d=t[3]),(0,b.useEffect)(u,d);let f;t[4]===o?f=t[5]:(f=k(o)?o:null,t[4]=o,t[5]=f);let ne=f,p;t[6]===o?p=t[7]:(p=O(o)?o:null,t[6]=o,t[7]=p);let m=p??ne;if(!m)return null;let h;return t[8]!==m||t[9]!==n||t[10]!==r||t[11]!==s||t[12]!==a?(h=(0,D.jsx)(N,{payload:m,bridge:n,cloneController:r,store:a},s),t[8]=m,t[9]=n,t[10]=r,t[11]=s,t[12]=a,t[13]=h):h=t[13],h}function j(e){return e+1}function M(){return null}function N(e){let t=(0,x.c)(165),{payload:n,bridge:r,cloneController:_,store:y}=e,{_:C}=a(),[E,A]=(0,b.useState)(!1),[j,M]=(0,b.useState)(null),[N,ue]=(0,b.useState)(!1),[F,de]=(0,b.useState)(!1),[I,fe]=(0,b.useState)(null),[L,R]=(0,b.useState)(null),pe=(0,b.useRef)(!1),me=(0,b.useRef)(null),he,ge;t[0]===I?(he=t[1],ge=t[2]):(he=()=>{I&&me.current?.focus()},ge=[I],t[0]=I,t[1]=he,t[2]=ge),(0,b.useEffect)(he,ge);let _e;t[3]!==L||t[4]!==n?(_e=()=>{O(n)&&L===null&&(console.warn(`[receive] q1_hit=true selection=branch_match_non_ok candidate=${n.candidatePath}`),R(S({candidatePath:n.candidatePath,branch:n.share.branch,targetPath:h(n.share.target),targetKind:n.share.target.kind,parentProjectName:n.parentProjectName})))},t[3]=L,t[4]=n,t[5]=_e):_e=t[5];let ve;t[6]===n?ve=t[7]:(ve=[n],t[6]=n,t[7]=ve),(0,b.useEffect)(_e,ve);let ye;t[8]!==j||t[9]!==_||t[10]!==n?(ye=()=>{_&&k(n)&&j===null&&(pe.current||(pe.current=!0,ue(!0),_.getAuthStatus().then(e=>{M(e)}).catch(e=>{console.warn(`[receive] auth pre-flight probe failed`,e instanceof Error?e.message:e),M({authenticated:!1,host:`github.com`})}).finally(()=>{ue(!1)})))},t[8]=j,t[9]=_,t[10]=n,t[11]=ye):ye=t[11];let be;t[12]!==j||t[13]!==n?(be=[n,j],t[12]=j,t[13]=n,t[14]=be):be=t[14],(0,b.useEffect)(ye,be);let z=k(n)?n:null,xe=O(n)?n:null,B=z?.share??xe?.share??null,V,H,U,W,G,Se,K,q;if(t[15]!==C||t[16]!==N||t[17]!==r||t[18]!==_||t[19]!==F||t[20]!==L||t[21]!==z||t[22]!==E||t[23]!==B||t[24]!==y){K=Symbol.for(`react.early_return_sentinel`);bb0:{let e=B?{owner:B.owner,repo:B.repo}:null,n;t[33]!==C||t[34]!==B?.target.kind?(n=B?.target.kind===`folder`?C({id:`ugoTXs`}):C({id:`XH30C4`}),t[33]=C,t[34]=B?.target.kind,t[35]=n):n=t[35],q=n,U=async function(){if(!z||!e)return;if(console.log(re({q2_path:`clone`})),!_){l.info(C({id:`27XW26`}),{action:{label:C({id:`B3NAZC`}),onClick:()=>{r.navigator.open()}},duration:8e3});return}if(F)return;fe(null),de(!0);let t=ie(e),n;try{n=await _.runClone({url:t,branch:z.share.branch})}catch(e){let t=e;console.warn(`[receive] runClone threw unexpectedly`,t),de(!1),fe({detail:t instanceof Error?t.message:String(t)});return}if(de(!1),n.kind===`error`){fe({detail:n.detail??null});return}if(n.kind===`ok`){try{await r.project.open({path:n.dir,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:z.share.target.kind,path:h(z.share.target)}}),y.dismiss()}catch(e){let t=e;console.warn(`[receive] project open after clone failed`,t instanceof Error?t.message:t),l.error(C({id:`438Fca`}))}return}};let a;t[36]!==C||t[37]!==N||t[38]!==_?(a=async function(){if(!(!_||N)){ue(!0);try{let e=await _.startSignIn();ue(!1),e!==null&&M(e)}catch(e){let t=e;ue(!1),console.warn(`[receive] startSignIn failed`,t instanceof Error?t.message:t),l.error(C({id:`lzwo7p`}))}}},t[36]=C,t[37]=N,t[38]=_,t[39]=a):a=t[39],G=a,W=async function(){if(!(!z||!e||E)){fe(null),A(!0),console.log(re({q2_path:`local`}));try{for(;;){let t=await r.dialog.openFolder();if(!t)break;let n=await r.share.validateLocalFolder({folderPath:t,owner:e.owner,repo:e.repo});if(console.log(re({folder_validate:n.kind})),n.kind===`ok`){let e=z.share.branch,n={currentBranch:null,headSha:null,detached:!1};try{n=await r.project.readHeadBranch(t)}catch(e){let t=e;console.warn(`[receive] local-folder readHeadBranch failed`,t instanceof Error?t.message:t)}let i=o(e,n)!==`true`;try{await r.project.open({path:t,target:`new-window`,entryPoint:`share-receive`,...i?{pendingShareBranchSwitch:{share:z.share,projectPath:t,currentBranch:n.currentBranch}}:{pendingDeepLinkTarget:{kind:z.share.target.kind,path:h(z.share.target)}}}),y.dismiss()}catch(e){let t=e;console.warn(`[receive] local-folder-open failed`,t instanceof Error?t.message:t),l.error(C({id:`phM8Kh`}))}break}let i=v(n,e);i&&l.error(i)}}catch(e){let t=e;console.warn(`[receive] local-folder-validate failed`,t instanceof Error?t.message:t),l.error(C({id:`rlUzXK`}))}A(!1)}};let g;t[40]!==C||t[41]!==r||t[42]!==L||t[43]!==y?(g=function(){if(L===null||L.phase!==`ready`)return;let e=L.seed;console.warn(`[receive] consent_dialog action=initialize worktree=${e.candidatePath}`),R(le),r.project.okInit({projectPath:e.candidatePath}).then(async t=>{if(t.ok===!0){R(e=>e===null?e:w(e,{ok:!0,projectPath:t.projectPath}));try{await r.project.open({path:t.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:e.targetKind,path:e.targetPath},pendingBranch:e.branch}),R(ce),y.dismiss()}catch(t){let n=t,r=n instanceof Error?n.message:String(n);R(e=>e===null?e:T(e,{ok:!1,message:r})),l.error(C({id:`nDT8qt`,values:{0:e.candidatePath}}))}return}let n=t.reason,i=t.message||`Initialization failed.`;R(e=>e===null?e:w(e,{ok:!1,reason:n,message:i})),l.error(i)}).catch(t=>{let n=t instanceof Error?t.message:String(t);R(e=>e===null?e:w(e,{ok:!1,reason:`network-error`,message:n})),l.error(C({id:`3Mwaly`,values:{0:e.candidatePath}}))})},t[40]=C,t[41]=r,t[42]=L,t[43]=y,t[44]=g):g=t[44];let b=g,x;t[45]!==L||t[46]!==y?(x=function(){L!==null&&console.warn(`[receive] consent_dialog action=cancel worktree=${L.seed.candidatePath}`),R(P),y.dismiss()},t[45]=L,t[46]=y,t[47]=x):x=t[47];let S=x;if(L!==null&&L.phase!==`cancelled`&&L.phase!==`done`&&B!==null){let e=L.seed,n=L.phase===`initializing`||L.phase===`opening`,r;t[48]===S?r=t[49]:(r=e=>{e||S()},t[48]=S,t[49]=r);let a;t[50]===q?a=t[51]:(a=(0,D.jsx)(u,{children:(0,D.jsx)(i,{id:`RY6Bq1`,values:{targetNoun:q}})}),t[50]=q,t[51]=a);let o;t[52]===B.target?o=t[53]:(o=h(B.target)?`— ${h(B.target)}`:``,t[52]=B.target,t[53]=o);let s;t[54]!==B.owner||t[55]!==B.repo||t[56]!==o?(s=(0,D.jsx)(te,{className:`sr-only`,children:(0,D.jsx)(i,{id:`pgq_xf`,values:{0:B.owner,1:B.repo,2:o}})}),t[54]=B.owner,t[55]=B.repo,t[56]=o,t[57]=s):s=t[57];let l=B.owner,re=B.repo,g;t[58]===B.target?g=t[59]:(g=h(B.target),t[58]=B.target,t[59]=g);let _;t[60]!==B.branch||t[61]!==B.owner||t[62]!==B.repo||t[63]!==B.target.kind||t[64]!==g?(_=(0,D.jsx)(ae,{owner:l,repo:re,path:g,kind:B.target.kind,branch:B.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[60]=B.branch,t[61]=B.owner,t[62]=B.repo,t[63]=B.target.kind,t[64]=g,t[65]=_):_=t[65];let v;t[66]!==a||t[67]!==s||t[68]!==_?(v=(0,D.jsxs)(p,{children:[a,s,_]}),t[66]=a,t[67]=s,t[68]=_,t[69]=v):v=t[69];let ie;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,D.jsx)(i,{id:`KsAPaB`})}),t[70]=ie):ie=t[70];let y;t[71]===e.candidatePath?y=t[72]:(y=(0,D.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-receive-consent-path`,children:e.candidatePath}),t[71]=e.candidatePath,t[72]=y);let x;t[73]===e.parentProjectName?x=t[74]:(x=e.parentProjectName===null?null:(0,D.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,"data-testid":`share-receive-consent-parent`,children:(0,D.jsx)(i,{id:`JmfgFc`,values:{0:e.parentProjectName}})}),t[73]=e.parentProjectName,t[74]=x);let C;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,D.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,D.jsx)(i,{id:`w7SsvI`})}),t[75]=C):C=t[75];let w;t[76]!==L.message||t[77]!==L.phase?(w=L.phase===`error`?(0,D.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,"data-testid":`share-receive-consent-error`,role:`alert`,children:L.message}):null,t[76]=L.message,t[77]=L.phase,t[78]=w):w=t[78];let T;t[79]!==y||t[80]!==x||t[81]!==w?(T=(0,D.jsxs)(f,{children:[ie,y,x,C,w]}),t[79]=y,t[80]=x,t[81]=w,t[82]=T):T=t[82];let E;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,D.jsx)(i,{id:`dEgA5A`}),t[83]=E):E=t[83];let O;t[84]===S?O=t[85]:(O=(0,D.jsx)(c,{variant:`ghost`,onClick:S,"data-testid":`share-receive-consent-cancel`,children:E}),t[84]=S,t[85]=O);let k=n||L.phase===`error`,A=n||L.phase===`error`,j;t[86]===n?j=t[87]:(j=n?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(ee,{className:`mr-2 h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,D.jsx)(i,{id:`NKkZXl`})]}):(0,D.jsx)(i,{id:`NKkZXl`}),t[86]=n,t[87]=j);let M;t[88]!==b||t[89]!==k||t[90]!==A||t[91]!==j?(M=(0,D.jsx)(c,{onClick:b,disabled:k,"aria-disabled":A,"data-testid":`share-receive-consent-initialize`,children:j}),t[88]=b,t[89]=k,t[90]=A,t[91]=j,t[92]=M):M=t[92];let N;t[93]!==O||t[94]!==M?(N=(0,D.jsxs)(ne,{children:[O,M]}),t[93]=O,t[94]=M,t[95]=N):N=t[95];let P;t[96]!==v||t[97]!==T||t[98]!==N?(P=(0,D.jsxs)(d,{className:`sm:max-w-xl`,"data-testid":`share-receive-consent-dialog`,onInteractOutside:se,onPointerDownOutside:oe,children:[v,T,N]}),t[96]=v,t[97]=T,t[98]=N,t[99]=P):P=t[99];let ce;t[100]!==r||t[101]!==P?(ce=(0,D.jsx)(m,{open:!0,onOpenChange:r,children:P}),t[100]=r,t[101]=P,t[102]=ce):ce=t[102],K=ce;break bb0}if(!z||!B||!e){K=null;break bb0}V=_!==void 0&&!F;let O;t[103]!==C||t[104]!==F?(O=C(F?{id:`YjhKI5`}:{id:`LE7t79`}),t[103]=C,t[104]=F,t[105]=O):O=t[105],H=O,Se=s(e)}t[15]=C,t[16]=N,t[17]=r,t[18]=_,t[19]=F,t[20]=L,t[21]=z,t[22]=E,t[23]=B,t[24]=y,t[25]=V,t[26]=H,t[27]=U,t[28]=W,t[29]=G,t[30]=Se,t[31]=K,t[32]=q}else V=t[25],H=t[26],U=t[27],W=t[28],G=t[29],Se=t[30],K=t[31],q=t[32];if(K!==Symbol.for(`react.early_return_sentinel`))return K;let Ce=Se,we=j?.authenticated?j.login:void 0,Te;t[106]===I?Te=t[107]:(Te=I?.detail?g(I.detail):``,t[106]=I,t[107]=Te);let Ee=Te,J;t[108]===y?J=t[109]:(J=e=>{e||y.dismiss()},t[108]=y,t[109]=J);let Y;t[110]===q?Y=t[111]:(Y=(0,D.jsx)(u,{children:(0,D.jsx)(i,{id:`RY6Bq1`,values:{targetNoun:q}})}),t[110]=q,t[111]=Y);let X;t[112]===B.target?X=t[113]:(X=h(B.target)?` — ${h(B.target)}`:null,t[112]=B.target,t[113]=X);let Z;t[114]!==B.owner||t[115]!==B.repo||t[116]!==X?(Z=(0,D.jsxs)(te,{className:`sr-only`,children:[B.owner,`/`,B.repo,X]}),t[114]=B.owner,t[115]=B.repo,t[116]=X,t[117]=Z):Z=t[117];let De=B.owner,Oe=B.repo,Q;t[118]===B.target?Q=t[119]:(Q=h(B.target),t[118]=B.target,t[119]=Q);let ke;t[120]!==B.branch||t[121]!==B.owner||t[122]!==B.repo||t[123]!==B.target.kind||t[124]!==Q?(ke=(0,D.jsx)(ae,{owner:De,repo:Oe,path:Q,kind:B.target.kind,branch:B.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[120]=B.branch,t[121]=B.owner,t[122]=B.repo,t[123]=B.target.kind,t[124]=Q,t[125]=ke):ke=t[125];let Ae;t[126]!==Y||t[127]!==Z||t[128]!==ke?(Ae=(0,D.jsxs)(p,{children:[Y,Z,ke]}),t[126]=Y,t[127]=Z,t[128]=ke,t[129]=Ae):Ae=t[129];let $;t[130]!==_||t[131]!==V||t[132]!==I||t[133]!==Ee||t[134]!==H||t[135]!==F||t[136]!==U||t[137]!==W||t[138]!==E?($=I?(0,D.jsxs)(`div`,{ref:me,tabIndex:-1,className:`rounded-lg border border-destructive/40 bg-destructive/5 p-4 outline-none`,"data-testid":`share-receive-clone-error`,children:[(0,D.jsx)(`p`,{className:`text-sm font-semibold text-foreground`,role:`alert`,children:(0,D.jsx)(i,{id:`aiArms`})}),Ee?(0,D.jsxs)(`p`,{className:`mt-2 break-words text-xs text-destructive`,"data-testid":`share-receive-clone-error-message`,children:[(0,D.jsx)(i,{id:`4BITzH`}),` `,(0,D.jsxs)(`span`,{className:`font-mono text-foreground/80`,children:[`"`,Ee,`"`]})]}):null,(0,D.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,D.jsx)(i,{id:`Llyqvo`})}),(0,D.jsxs)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5 text-sm text-muted-foreground`,"data-testid":`share-receive-clone-error-reasons`,children:[(0,D.jsx)(`li`,{children:(0,D.jsx)(i,{id:`6LbUG7`})}),(0,D.jsx)(`li`,{children:(0,D.jsx)(i,{id:`_pY_Vq`})}),(0,D.jsx)(`li`,{children:(0,D.jsx)(i,{id:`J6mxC1`})})]}),(0,D.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,D.jsx)(c,{onClick:()=>{U()},"data-testid":`share-receive-clone-retry`,children:(0,D.jsx)(i,{id:`KDw4GX`})}),(0,D.jsx)(c,{variant:`outline`,onClick:()=>{W()},disabled:E||F,"data-testid":`share-receive-error-local`,children:(0,D.jsx)(i,{id:`xFQRu4`})})]})]}):(0,D.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,D.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-clone`,className:`flex flex-col items-start gap-2 rounded-lg border border-primary/50 bg-primary/5 p-4 text-left transition hover:border-primary hover:bg-primary/10 focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-primary/50 disabled:hover:bg-primary/5`,onClick:()=>{U()},disabled:_!==void 0&&!V,"aria-disabled":_!==void 0&&!V,children:[(0,D.jsx)(`span`,{className:`text-sm font-semibold`,children:H}),(0,D.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,D.jsx)(i,{id:`fj5YiP`})})]}),(0,D.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-local`,className:`flex flex-col items-start gap-2 rounded-lg border border-border bg-card p-4 text-left transition hover:border-foreground/50 hover:bg-accent focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,onClick:()=>{W()},disabled:E||F,children:[(0,D.jsx)(`span`,{className:`text-sm font-semibold`,children:(0,D.jsx)(i,{id:`HfI1dR`})}),(0,D.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,D.jsx)(i,{id:`_qD6mn`})})]})]}),t[130]=_,t[131]=V,t[132]=I,t[133]=Ee,t[134]=H,t[135]=F,t[136]=U,t[137]=W,t[138]=E,t[139]=$):$=t[139];let je;t[140]!==N||t[141]!==j||t[142]!==_||t[143]!==G||t[144]!==we?(je=_?(0,D.jsx)(`div`,{className:`mt-3 flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-xs`,"data-testid":`share-receive-auth-banner`,role:`status`,"aria-live":`polite`,children:j===null?(0,D.jsx)(`span`,{className:`text-muted-foreground`,children:(0,D.jsx)(i,{id:`UDFrWm`})}):j.authenticated?(0,D.jsx)(`span`,{className:`text-muted-foreground`,children:(0,D.jsx)(i,{id:`VAHWL_`,values:{signedInLogin:we},components:{0:(0,D.jsx)(`span`,{className:`font-medium text-foreground/90`})}})}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{className:`text-muted-foreground`,children:(0,D.jsx)(i,{id:`SgKLfA`})}),(0,D.jsx)(`button`,{type:`button`,"data-testid":`share-receive-signin`,className:`font-medium text-primary underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded`,onClick:()=>{G()},disabled:N,children:N?(0,D.jsx)(i,{id:`PKLY-1`}):(0,D.jsx)(i,{id:`3jod3l`})})]})}):null,t[140]=N,t[141]=j,t[142]=_,t[143]=G,t[144]=we,t[145]=je):je=t[145];let Me;t[146]!==I||t[147]!==Ce?(Me=I?null:(0,D.jsx)(`p`,{className:`mt-3 text-1sm text-muted-foreground`,children:(0,D.jsx)(i,{id:`RJ3a8Z`,values:{lookingForUrl:Ce},components:{0:(0,D.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),t[146]=I,t[147]=Ce,t[148]=Me):Me=t[148];let Ne;t[149]!==$||t[150]!==je||t[151]!==Me?(Ne=(0,D.jsxs)(f,{children:[$,je,Me]}),t[149]=$,t[150]=je,t[151]=Me,t[152]=Ne):Ne=t[152];let Pe;t[153]===y?Pe=t[154]:(Pe=()=>y.dismiss(),t[153]=y,t[154]=Pe);let Fe;t[155]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,D.jsx)(i,{id:`dEgA5A`}),t[155]=Fe):Fe=t[155];let Ie;t[156]===Pe?Ie=t[157]:(Ie=(0,D.jsx)(ne,{children:(0,D.jsx)(c,{variant:`outline`,className:`font-mono uppercase`,onClick:Pe,children:Fe})}),t[156]=Pe,t[157]=Ie);let Le;t[158]!==Ae||t[159]!==Ne||t[160]!==Ie?(Le=(0,D.jsxs)(d,{className:`sm:max-w-xl`,"data-testid":`share-receive-dialog`,children:[Ae,Ne,Ie]}),t[158]=Ae,t[159]=Ne,t[160]=Ie,t[161]=Le):Le=t[161];let Re;return t[162]!==J||t[163]!==Le?(Re=(0,D.jsx)(m,{open:!0,onOpenChange:J,children:Le}),t[162]=J,t[163]=Le,t[164]=Re):Re=t[164],Re}function oe(e){return e.preventDefault()}function se(e){return e.preventDefault()}function P(e){return e===null?e:E(e)}function ce(e){return e===null?e:T(e,{ok:!0})}function le(e){return e===null?e:C(e)}export{A as ShareReceiveDialog};
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{n as i,r as a}from"./dist-CQw2y-s3.js";import{Gt as o,Ut as s}from"./dist-CJc7OX7s.js";import{t as c}from"./button-cneJOVxD.js";import{t as ee}from"./loader-circle-B7Gv_Djz.js";import{n as l}from"./dist-CoyydoqN.js";import{a as te,c as u,i as d,n as f,o as ne,s as p,t as m}from"./dialog-DdHaoAGK.js";import{t as h}from"./desktop-bridge-types-NXCK8Pd7.js";import{a as re,i as g,n as _,o as v,r as ie,s as y}from"./receive-store-C72xSCDE.js";import{t as ae}from"./share-metadata-rows-BttnPmuW.js";var b=e(t(),1),x=r(),S=e=>({phase:`ready`,seed:e});function C(e){return e.phase===`ready`?{phase:`initializing`,seed:e.seed}:e}function w(e,t){return e.phase===`initializing`?t.ok?{phase:`opening`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:t.reason,message:t.message}:e}function T(e,t){return e.phase===`opening`?t.ok?{phase:`done`,seed:e.seed}:{phase:`error`,seed:e.seed,reason:`network-error`,message:t.message}:e}function E(e){return e.phase===`done`||e.phase===`cancelled`||e.phase===`error`?e:{phase:`cancelled`,seed:e.seed}}var D=n();function O(e){return e!==null&&e.kind===`launcher-consent`}function k(e){return e!==null&&e.kind===`launcher-miss`}function A(e){let t=(0,x.c)(14),{bridge:n,cloneController:r,store:i}=e,a=i===void 0?_:i,o=(0,b.useSyncExternalStore)(a.subscribe,a.getSnapshot,M),[s,c]=(0,b.useState)(0),[ee,te]=(0,b.useState)(o);o!==ee&&(te(o),c(j));let u,d;t[0]!==o||t[1]!==a?(u=()=>{if(!o)return;let e=y(o);e&&(l.error(e.message),a.dismiss())},d=[o,a],t[0]=o,t[1]=a,t[2]=u,t[3]=d):(u=t[2],d=t[3]),(0,b.useEffect)(u,d);let f;t[4]===o?f=t[5]:(f=k(o)?o:null,t[4]=o,t[5]=f);let ne=f,p;t[6]===o?p=t[7]:(p=O(o)?o:null,t[6]=o,t[7]=p);let m=p??ne;if(!m)return null;let h;return t[8]!==m||t[9]!==n||t[10]!==r||t[11]!==s||t[12]!==a?(h=(0,D.jsx)(N,{payload:m,bridge:n,cloneController:r,store:a},s),t[8]=m,t[9]=n,t[10]=r,t[11]=s,t[12]=a,t[13]=h):h=t[13],h}function j(e){return e+1}function M(){return null}function N(e){let t=(0,x.c)(165),{payload:n,bridge:r,cloneController:_,store:y}=e,{_:C}=a(),[E,A]=(0,b.useState)(!1),[j,M]=(0,b.useState)(null),[N,ue]=(0,b.useState)(!1),[F,de]=(0,b.useState)(!1),[I,fe]=(0,b.useState)(null),[L,R]=(0,b.useState)(null),pe=(0,b.useRef)(!1),me=(0,b.useRef)(null),he,ge;t[0]===I?(he=t[1],ge=t[2]):(he=()=>{I&&me.current?.focus()},ge=[I],t[0]=I,t[1]=he,t[2]=ge),(0,b.useEffect)(he,ge);let _e;t[3]!==L||t[4]!==n?(_e=()=>{O(n)&&L===null&&(console.warn(`[receive] q1_hit=true selection=branch_match_non_ok candidate=${n.candidatePath}`),R(S({candidatePath:n.candidatePath,branch:n.share.branch,targetPath:h(n.share.target),targetKind:n.share.target.kind,parentProjectName:n.parentProjectName})))},t[3]=L,t[4]=n,t[5]=_e):_e=t[5];let ve;t[6]===n?ve=t[7]:(ve=[n],t[6]=n,t[7]=ve),(0,b.useEffect)(_e,ve);let ye;t[8]!==j||t[9]!==_||t[10]!==n?(ye=()=>{_&&k(n)&&j===null&&(pe.current||(pe.current=!0,ue(!0),_.getAuthStatus().then(e=>{M(e)}).catch(e=>{console.warn(`[receive] auth pre-flight probe failed`,e instanceof Error?e.message:e),M({authenticated:!1,host:`github.com`})}).finally(()=>{ue(!1)})))},t[8]=j,t[9]=_,t[10]=n,t[11]=ye):ye=t[11];let be;t[12]!==j||t[13]!==n?(be=[n,j],t[12]=j,t[13]=n,t[14]=be):be=t[14],(0,b.useEffect)(ye,be);let z=k(n)?n:null,xe=O(n)?n:null,B=z?.share??xe?.share??null,V,H,U,W,G,Se,K,q;if(t[15]!==C||t[16]!==N||t[17]!==r||t[18]!==_||t[19]!==F||t[20]!==L||t[21]!==z||t[22]!==E||t[23]!==B||t[24]!==y){K=Symbol.for(`react.early_return_sentinel`);bb0:{let e=B?{owner:B.owner,repo:B.repo}:null,n;t[33]!==C||t[34]!==B?.target.kind?(n=B?.target.kind===`folder`?C({id:`ugoTXs`}):C({id:`XH30C4`}),t[33]=C,t[34]=B?.target.kind,t[35]=n):n=t[35],q=n,U=async function(){if(!z||!e)return;if(console.log(re({q2_path:`clone`})),!_){l.info(C({id:`27XW26`}),{action:{label:C({id:`B3NAZC`}),onClick:()=>{r.navigator.open()}},duration:8e3});return}if(F)return;fe(null),de(!0);let t=ie(e),n;try{n=await _.runClone({url:t,branch:z.share.branch})}catch(e){let t=e;console.warn(`[receive] runClone threw unexpectedly`,t),de(!1),fe({detail:t instanceof Error?t.message:String(t)});return}if(de(!1),n.kind===`error`){fe({detail:n.detail??null});return}if(n.kind===`ok`){try{await r.project.open({path:n.dir,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:z.share.target.kind,path:h(z.share.target)}}),y.dismiss()}catch(e){let t=e;console.warn(`[receive] project open after clone failed`,t instanceof Error?t.message:t),l.error(C({id:`438Fca`}))}return}};let a;t[36]!==C||t[37]!==N||t[38]!==_?(a=async function(){if(!(!_||N)){ue(!0);try{let e=await _.startSignIn();ue(!1),e!==null&&M(e)}catch(e){let t=e;ue(!1),console.warn(`[receive] startSignIn failed`,t instanceof Error?t.message:t),l.error(C({id:`lzwo7p`}))}}},t[36]=C,t[37]=N,t[38]=_,t[39]=a):a=t[39],G=a,W=async function(){if(!(!z||!e||E)){fe(null),A(!0),console.log(re({q2_path:`local`}));try{for(;;){let t=await r.dialog.openFolder();if(!t)break;let n=await r.share.validateLocalFolder({folderPath:t,owner:e.owner,repo:e.repo});if(console.log(re({folder_validate:n.kind})),n.kind===`ok`){let e=z.share.branch,n={currentBranch:null,headSha:null,detached:!1};try{n=await r.project.readHeadBranch(t)}catch(e){let t=e;console.warn(`[receive] local-folder readHeadBranch failed`,t instanceof Error?t.message:t)}let i=o(e,n)!==`true`;try{await r.project.open({path:t,target:`new-window`,entryPoint:`share-receive`,...i?{pendingShareBranchSwitch:{share:z.share,projectPath:t,currentBranch:n.currentBranch}}:{pendingDeepLinkTarget:{kind:z.share.target.kind,path:h(z.share.target)}}}),y.dismiss()}catch(e){let t=e;console.warn(`[receive] local-folder-open failed`,t instanceof Error?t.message:t),l.error(C({id:`phM8Kh`}))}break}let i=v(n,e);i&&l.error(i)}}catch(e){let t=e;console.warn(`[receive] local-folder-validate failed`,t instanceof Error?t.message:t),l.error(C({id:`rlUzXK`}))}A(!1)}};let g;t[40]!==C||t[41]!==r||t[42]!==L||t[43]!==y?(g=function(){if(L===null||L.phase!==`ready`)return;let e=L.seed;console.warn(`[receive] consent_dialog action=initialize worktree=${e.candidatePath}`),R(le),r.project.okInit({projectPath:e.candidatePath}).then(async t=>{if(t.ok===!0){R(e=>e===null?e:w(e,{ok:!0,projectPath:t.projectPath}));try{await r.project.open({path:t.projectPath,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkTarget:{kind:e.targetKind,path:e.targetPath},pendingBranch:e.branch}),R(ce),y.dismiss()}catch(t){let n=t,r=n instanceof Error?n.message:String(n);R(e=>e===null?e:T(e,{ok:!1,message:r})),l.error(C({id:`nDT8qt`,values:{0:e.candidatePath}}))}return}let n=t.reason,i=t.message||`Initialization failed.`;R(e=>e===null?e:w(e,{ok:!1,reason:n,message:i})),l.error(i)}).catch(t=>{let n=t instanceof Error?t.message:String(t);R(e=>e===null?e:w(e,{ok:!1,reason:`network-error`,message:n})),l.error(C({id:`3Mwaly`,values:{0:e.candidatePath}}))})},t[40]=C,t[41]=r,t[42]=L,t[43]=y,t[44]=g):g=t[44];let b=g,x;t[45]!==L||t[46]!==y?(x=function(){L!==null&&console.warn(`[receive] consent_dialog action=cancel worktree=${L.seed.candidatePath}`),R(P),y.dismiss()},t[45]=L,t[46]=y,t[47]=x):x=t[47];let S=x;if(L!==null&&L.phase!==`cancelled`&&L.phase!==`done`&&B!==null){let e=L.seed,n=L.phase===`initializing`||L.phase===`opening`,r;t[48]===S?r=t[49]:(r=e=>{e||S()},t[48]=S,t[49]=r);let a;t[50]===q?a=t[51]:(a=(0,D.jsx)(u,{children:(0,D.jsx)(i,{id:`RY6Bq1`,values:{targetNoun:q}})}),t[50]=q,t[51]=a);let o;t[52]===B.target?o=t[53]:(o=h(B.target)?`— ${h(B.target)}`:``,t[52]=B.target,t[53]=o);let s;t[54]!==B.owner||t[55]!==B.repo||t[56]!==o?(s=(0,D.jsx)(te,{className:`sr-only`,children:(0,D.jsx)(i,{id:`pgq_xf`,values:{0:B.owner,1:B.repo,2:o}})}),t[54]=B.owner,t[55]=B.repo,t[56]=o,t[57]=s):s=t[57];let l=B.owner,re=B.repo,g;t[58]===B.target?g=t[59]:(g=h(B.target),t[58]=B.target,t[59]=g);let _;t[60]!==B.branch||t[61]!==B.owner||t[62]!==B.repo||t[63]!==B.target.kind||t[64]!==g?(_=(0,D.jsx)(ae,{owner:l,repo:re,path:g,kind:B.target.kind,branch:B.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[60]=B.branch,t[61]=B.owner,t[62]=B.repo,t[63]=B.target.kind,t[64]=g,t[65]=_):_=t[65];let v;t[66]!==a||t[67]!==s||t[68]!==_?(v=(0,D.jsxs)(p,{children:[a,s,_]}),t[66]=a,t[67]=s,t[68]=_,t[69]=v):v=t[69];let ie;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,D.jsx)(i,{id:`KsAPaB`})}),t[70]=ie):ie=t[70];let y;t[71]===e.candidatePath?y=t[72]:(y=(0,D.jsx)(`p`,{className:`mt-2 break-all rounded bg-muted px-2 py-1 font-mono text-xs text-foreground/80`,"data-testid":`share-receive-consent-path`,children:e.candidatePath}),t[71]=e.candidatePath,t[72]=y);let x;t[73]===e.parentProjectName?x=t[74]:(x=e.parentProjectName===null?null:(0,D.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,"data-testid":`share-receive-consent-parent`,children:(0,D.jsx)(i,{id:`JmfgFc`,values:{0:e.parentProjectName}})}),t[73]=e.parentProjectName,t[74]=x);let C;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,D.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,D.jsx)(i,{id:`w7SsvI`})}),t[75]=C):C=t[75];let w;t[76]!==L.message||t[77]!==L.phase?(w=L.phase===`error`?(0,D.jsx)(`p`,{className:`mt-3 text-sm text-destructive`,"data-testid":`share-receive-consent-error`,role:`alert`,children:L.message}):null,t[76]=L.message,t[77]=L.phase,t[78]=w):w=t[78];let T;t[79]!==y||t[80]!==x||t[81]!==w?(T=(0,D.jsxs)(f,{children:[ie,y,x,C,w]}),t[79]=y,t[80]=x,t[81]=w,t[82]=T):T=t[82];let E;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,D.jsx)(i,{id:`dEgA5A`}),t[83]=E):E=t[83];let O;t[84]===S?O=t[85]:(O=(0,D.jsx)(c,{variant:`ghost`,onClick:S,"data-testid":`share-receive-consent-cancel`,children:E}),t[84]=S,t[85]=O);let k=n||L.phase===`error`,A=n||L.phase===`error`,j;t[86]===n?j=t[87]:(j=n?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(ee,{className:`mr-2 h-4 w-4 animate-spin`,"aria-hidden":`true`}),(0,D.jsx)(i,{id:`NKkZXl`})]}):(0,D.jsx)(i,{id:`NKkZXl`}),t[86]=n,t[87]=j);let M;t[88]!==b||t[89]!==k||t[90]!==A||t[91]!==j?(M=(0,D.jsx)(c,{onClick:b,disabled:k,"aria-disabled":A,"data-testid":`share-receive-consent-initialize`,children:j}),t[88]=b,t[89]=k,t[90]=A,t[91]=j,t[92]=M):M=t[92];let N;t[93]!==O||t[94]!==M?(N=(0,D.jsxs)(ne,{children:[O,M]}),t[93]=O,t[94]=M,t[95]=N):N=t[95];let P;t[96]!==v||t[97]!==T||t[98]!==N?(P=(0,D.jsxs)(d,{className:`sm:max-w-xl`,"data-testid":`share-receive-consent-dialog`,onInteractOutside:se,onPointerDownOutside:oe,children:[v,T,N]}),t[96]=v,t[97]=T,t[98]=N,t[99]=P):P=t[99];let ce;t[100]!==r||t[101]!==P?(ce=(0,D.jsx)(m,{open:!0,onOpenChange:r,children:P}),t[100]=r,t[101]=P,t[102]=ce):ce=t[102],K=ce;break bb0}if(!z||!B||!e){K=null;break bb0}V=_!==void 0&&!F;let O;t[103]!==C||t[104]!==F?(O=C(F?{id:`YjhKI5`}:{id:`LE7t79`}),t[103]=C,t[104]=F,t[105]=O):O=t[105],H=O,Se=s(e)}t[15]=C,t[16]=N,t[17]=r,t[18]=_,t[19]=F,t[20]=L,t[21]=z,t[22]=E,t[23]=B,t[24]=y,t[25]=V,t[26]=H,t[27]=U,t[28]=W,t[29]=G,t[30]=Se,t[31]=K,t[32]=q}else V=t[25],H=t[26],U=t[27],W=t[28],G=t[29],Se=t[30],K=t[31],q=t[32];if(K!==Symbol.for(`react.early_return_sentinel`))return K;let Ce=Se,we=j?.authenticated?j.login:void 0,Te;t[106]===I?Te=t[107]:(Te=I?.detail?g(I.detail):``,t[106]=I,t[107]=Te);let Ee=Te,J;t[108]===y?J=t[109]:(J=e=>{e||y.dismiss()},t[108]=y,t[109]=J);let Y;t[110]===q?Y=t[111]:(Y=(0,D.jsx)(u,{children:(0,D.jsx)(i,{id:`RY6Bq1`,values:{targetNoun:q}})}),t[110]=q,t[111]=Y);let X;t[112]===B.target?X=t[113]:(X=h(B.target)?` — ${h(B.target)}`:null,t[112]=B.target,t[113]=X);let Z;t[114]!==B.owner||t[115]!==B.repo||t[116]!==X?(Z=(0,D.jsxs)(te,{className:`sr-only`,children:[B.owner,`/`,B.repo,X]}),t[114]=B.owner,t[115]=B.repo,t[116]=X,t[117]=Z):Z=t[117];let De=B.owner,Oe=B.repo,Q;t[118]===B.target?Q=t[119]:(Q=h(B.target),t[118]=B.target,t[119]=Q);let ke;t[120]!==B.branch||t[121]!==B.owner||t[122]!==B.repo||t[123]!==B.target.kind||t[124]!==Q?(ke=(0,D.jsx)(ae,{owner:De,repo:Oe,path:Q,kind:B.target.kind,branch:B.branch,testId:`share-receive-metadata`,branchTestId:`share-receive-metadata-branch`}),t[120]=B.branch,t[121]=B.owner,t[122]=B.repo,t[123]=B.target.kind,t[124]=Q,t[125]=ke):ke=t[125];let Ae;t[126]!==Y||t[127]!==Z||t[128]!==ke?(Ae=(0,D.jsxs)(p,{children:[Y,Z,ke]}),t[126]=Y,t[127]=Z,t[128]=ke,t[129]=Ae):Ae=t[129];let $;t[130]!==_||t[131]!==V||t[132]!==I||t[133]!==Ee||t[134]!==H||t[135]!==F||t[136]!==U||t[137]!==W||t[138]!==E?($=I?(0,D.jsxs)(`div`,{ref:me,tabIndex:-1,className:`rounded-lg border border-destructive/40 bg-destructive/5 p-4 outline-none`,"data-testid":`share-receive-clone-error`,children:[(0,D.jsx)(`p`,{className:`text-sm font-semibold text-foreground`,role:`alert`,children:(0,D.jsx)(i,{id:`aiArms`})}),Ee?(0,D.jsxs)(`p`,{className:`mt-2 break-words text-xs text-destructive`,"data-testid":`share-receive-clone-error-message`,children:[(0,D.jsx)(i,{id:`4BITzH`}),` `,(0,D.jsxs)(`span`,{className:`font-mono text-foreground/80`,children:[`"`,Ee,`"`]})]}):null,(0,D.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:(0,D.jsx)(i,{id:`Llyqvo`})}),(0,D.jsxs)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5 text-sm text-muted-foreground`,"data-testid":`share-receive-clone-error-reasons`,children:[(0,D.jsx)(`li`,{children:(0,D.jsx)(i,{id:`6LbUG7`})}),(0,D.jsx)(`li`,{children:(0,D.jsx)(i,{id:`_pY_Vq`})}),(0,D.jsx)(`li`,{children:(0,D.jsx)(i,{id:`J6mxC1`})})]}),(0,D.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,D.jsx)(c,{onClick:()=>{U()},"data-testid":`share-receive-clone-retry`,children:(0,D.jsx)(i,{id:`KDw4GX`})}),(0,D.jsx)(c,{variant:`outline`,onClick:()=>{W()},disabled:E||F,"data-testid":`share-receive-error-local`,children:(0,D.jsx)(i,{id:`xFQRu4`})})]})]}):(0,D.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,D.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-clone`,className:`flex flex-col items-start gap-2 rounded-lg border border-primary/50 bg-primary/5 p-4 text-left transition hover:border-primary hover:bg-primary/10 focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-primary/50 disabled:hover:bg-primary/5`,onClick:()=>{U()},disabled:_!==void 0&&!V,"aria-disabled":_!==void 0&&!V,children:[(0,D.jsx)(`span`,{className:`text-sm font-semibold`,children:H}),(0,D.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,D.jsx)(i,{id:`fj5YiP`})})]}),(0,D.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-local`,className:`flex flex-col items-start gap-2 rounded-lg border border-border bg-card p-4 text-left transition hover:border-foreground/50 hover:bg-accent focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,onClick:()=>{W()},disabled:E||F,children:[(0,D.jsx)(`span`,{className:`text-sm font-semibold`,children:(0,D.jsx)(i,{id:`HfI1dR`})}),(0,D.jsx)(`span`,{className:`line-clamp-2 text-1sm text-muted-foreground`,children:(0,D.jsx)(i,{id:`_qD6mn`})})]})]}),t[130]=_,t[131]=V,t[132]=I,t[133]=Ee,t[134]=H,t[135]=F,t[136]=U,t[137]=W,t[138]=E,t[139]=$):$=t[139];let je;t[140]!==N||t[141]!==j||t[142]!==_||t[143]!==G||t[144]!==we?(je=_?(0,D.jsx)(`div`,{className:`mt-3 flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-xs`,"data-testid":`share-receive-auth-banner`,role:`status`,"aria-live":`polite`,children:j===null?(0,D.jsx)(`span`,{className:`text-muted-foreground`,children:(0,D.jsx)(i,{id:`UDFrWm`})}):j.authenticated?(0,D.jsx)(`span`,{className:`text-muted-foreground`,children:(0,D.jsx)(i,{id:`VAHWL_`,values:{signedInLogin:we},components:{0:(0,D.jsx)(`span`,{className:`font-medium text-foreground/90`})}})}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{className:`text-muted-foreground`,children:(0,D.jsx)(i,{id:`SgKLfA`})}),(0,D.jsx)(`button`,{type:`button`,"data-testid":`share-receive-signin`,className:`font-medium text-primary underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded`,onClick:()=>{G()},disabled:N,children:N?(0,D.jsx)(i,{id:`PKLY-1`}):(0,D.jsx)(i,{id:`3jod3l`})})]})}):null,t[140]=N,t[141]=j,t[142]=_,t[143]=G,t[144]=we,t[145]=je):je=t[145];let Me;t[146]!==I||t[147]!==Ce?(Me=I?null:(0,D.jsx)(`p`,{className:`mt-3 text-1sm text-muted-foreground`,children:(0,D.jsx)(i,{id:`RJ3a8Z`,values:{lookingForUrl:Ce},components:{0:(0,D.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 text-foreground/80`})}})}),t[146]=I,t[147]=Ce,t[148]=Me):Me=t[148];let Ne;t[149]!==$||t[150]!==je||t[151]!==Me?(Ne=(0,D.jsxs)(f,{children:[$,je,Me]}),t[149]=$,t[150]=je,t[151]=Me,t[152]=Ne):Ne=t[152];let Pe;t[153]===y?Pe=t[154]:(Pe=()=>y.dismiss(),t[153]=y,t[154]=Pe);let Fe;t[155]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,D.jsx)(i,{id:`dEgA5A`}),t[155]=Fe):Fe=t[155];let Ie;t[156]===Pe?Ie=t[157]:(Ie=(0,D.jsx)(ne,{children:(0,D.jsx)(c,{variant:`outline`,className:`font-mono uppercase`,onClick:Pe,children:Fe})}),t[156]=Pe,t[157]=Ie);let Le;t[158]!==Ae||t[159]!==Ne||t[160]!==Ie?(Le=(0,D.jsxs)(d,{className:`sm:max-w-xl`,"data-testid":`share-receive-dialog`,children:[Ae,Ne,Ie]}),t[158]=Ae,t[159]=Ne,t[160]=Ie,t[161]=Le):Le=t[161];let Re;return t[162]!==J||t[163]!==Le?(Re=(0,D.jsx)(m,{open:!0,onOpenChange:J,children:Le}),t[162]=J,t[163]=Le,t[164]=Re):Re=t[164],Re}function oe(e){return e.preventDefault()}function se(e){return e.preventDefault()}function P(e){return e===null?e:E(e)}function ce(e){return e===null?e:T(e,{ok:!0})}function le(e){return e===null?e:C(e)}export{A as ShareReceiveDialog};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{a as i,i as a,n as o,r as s}from"./pending-receive-nav-store-DynS4M_y.js";import{t as c}from"./miss-dialog-store-PJQ_kr0I.js";import{c as l,i as u,n as d,s as f,t as p}from"./dialog-DdHaoAGK.js";import{c as m,s as h}from"./doc-hash-BRcc1l8V.js";var g=r(),_=e(t(),1),v=n();function y(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function b(){let e=(0,g.c)(2),t=(0,_.useSyncExternalStore)(c.subscribe,c.getSnapshot,x);if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=(0,v.jsx)(S,{nav:t},t.path),e[0]=t,e[1]=n),n}function x(){return null}function S(e){let t=(0,g.c)(25),{nav:n}=e,{state:r,refetch:_}=i(n),b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(){c.dismiss()},t[0]=b):b=t[0];let x=b,S;t[1]===n.path?S=t[2]:(S=function(){window.location.hash=m(a(n.path)),x()},t[1]=n.path,t[2]=S);let C=S,w;t[3]!==n.branch||t[4]!==n.kind?(w=function(e){o.arm({kind:n.kind,path:e,branch:n.branch}),window.location.hash=n.kind===`folder`?m(e):h(e),x()},t[3]=n.branch,t[4]=n.kind,t[5]=w):w=t[5];let T=w,E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{e||x()},t[6]=E):E=t[6];let D=r.phase,O=r.phase===`resolved`?r.resolution.verdict:void 0,k;t[7]===n.path?k=t[8]:(k=y(n.path),t[7]=n.path,t[8]=k);let A;t[9]===k?A=t[10]:(A=(0,v.jsx)(f,{children:(0,v.jsx)(l,{className:`truncate`,children:k})}),t[9]=k,t[10]=A);let j=r.phase===`pending`?`flex flex-col items-center justify-center gap-3 py-6 text-center text-sm text-muted-foreground`:`flex flex-col items-center justify-center gap-6 py-2 text-center`,M;t[11]!==C||t[12]!==n||t[13]!==T||t[14]!==_||t[15]!==r?(M=(0,v.jsx)(s,{nav:n,state:r,onBrowseFolder:C,onOpenRenamed:T,onEnableAutoSync:x,onSyncCompleted:_}),t[11]=C,t[12]=n,t[13]=T,t[14]=_,t[15]=r,t[16]=M):M=t[16];let N;t[17]!==M||t[18]!==j?(N=(0,v.jsx)(d,{className:j,children:M}),t[17]=M,t[18]=j,t[19]=N):N=t[19];let P;return t[20]!==r.phase||t[21]!==N||t[22]!==O||t[23]!==A?(P=(0,v.jsx)(p,{open:!0,onOpenChange:E,children:(0,v.jsxs)(u,{className:`sm:max-w-md`,"data-testid":`share-receive-miss-dialog`,"data-phase":D,"data-verdict":O,children:[A,N]})}),t[20]=r.phase,t[21]=N,t[22]=O,t[23]=A,t[24]=P):P=t[24],P}export{b as ShareReceiveMissDialog};
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{a as i,i as a,n as o,r as s}from"./pending-receive-nav-store-CAm5nHeI.js";import{t as c}from"./miss-dialog-store-PJQ_kr0I.js";import{c as l,i as u,n as d,s as f,t as p}from"./dialog-DdHaoAGK.js";import{c as m,s as h}from"./doc-hash-B7rSgZqz.js";var g=r(),_=e(t(),1),v=n();function y(e){let t=e.split(`/`).filter(Boolean);return t.length>0?t[t.length-1]:e}function b(){let e=(0,g.c)(2),t=(0,_.useSyncExternalStore)(c.subscribe,c.getSnapshot,x);if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=(0,v.jsx)(S,{nav:t},t.path),e[0]=t,e[1]=n),n}function x(){return null}function S(e){let t=(0,g.c)(25),{nav:n}=e,{state:r,refetch:_}=i(n),b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(){c.dismiss()},t[0]=b):b=t[0];let x=b,S;t[1]===n.path?S=t[2]:(S=function(){window.location.hash=m(a(n.path)),x()},t[1]=n.path,t[2]=S);let C=S,w;t[3]!==n.branch||t[4]!==n.kind?(w=function(e){o.arm({kind:n.kind,path:e,branch:n.branch}),window.location.hash=n.kind===`folder`?m(e):h(e),x()},t[3]=n.branch,t[4]=n.kind,t[5]=w):w=t[5];let T=w,E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{e||x()},t[6]=E):E=t[6];let D=r.phase,O=r.phase===`resolved`?r.resolution.verdict:void 0,k;t[7]===n.path?k=t[8]:(k=y(n.path),t[7]=n.path,t[8]=k);let A;t[9]===k?A=t[10]:(A=(0,v.jsx)(f,{children:(0,v.jsx)(l,{className:`truncate`,children:k})}),t[9]=k,t[10]=A);let j=r.phase===`pending`?`flex flex-col items-center justify-center gap-3 py-6 text-center text-sm text-muted-foreground`:`flex flex-col items-center justify-center gap-6 py-2 text-center`,M;t[11]!==C||t[12]!==n||t[13]!==T||t[14]!==_||t[15]!==r?(M=(0,v.jsx)(s,{nav:n,state:r,onBrowseFolder:C,onOpenRenamed:T,onEnableAutoSync:x,onSyncCompleted:_}),t[11]=C,t[12]=n,t[13]=T,t[14]=_,t[15]=r,t[16]=M):M=t[16];let N;t[17]!==M||t[18]!==j?(N=(0,v.jsx)(d,{className:j,children:M}),t[17]=M,t[18]=j,t[19]=N):N=t[19];let P;return t[20]!==r.phase||t[21]!==N||t[22]!==O||t[23]!==A?(P=(0,v.jsx)(p,{open:!0,onOpenChange:E,children:(0,v.jsxs)(u,{className:`sm:max-w-md`,"data-testid":`share-receive-miss-dialog`,"data-phase":D,"data-verdict":O,children:[A,N]})}),t[20]=r.phase,t[21]=N,t[22]=O,t[23]=A,t[24]=P):P=t[24],P}export{b as ShareReceiveMissDialog};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{n as i}from"./dist-CQw2y-s3.js";import{bt as a,k as ee}from"./dist-DN4vicwQ.js";import{i as te,t as ne}from"./button-cneJOVxD.js";import{t as o}from"./chevron-down-BvNcCN1f.js";import{i as s,r as c}from"./skill-actions-BGFjwgz8.js";import{E as re,S as ie,_ as l,h as ae,m as oe,p as se,v as u}from"./skills-api-BOT-8Fw4.js";var d=r(),f=e(t(),1),p=n(),m=a.options;function h(e){let t=(0,d.c)(74),{scope:n,name:r}=e,a=s(),h=c(),g;t[0]!==r||t[1]!==n||t[2]!==a.data||t[3]!==a.status?(g=a.status===`ready`?a.data.find(e=>e.scope===n&&e.name===r):void 0,t[0]=r,t[1]=n,t[2]=a.data,t[3]=a.status,t[4]=g):g=t[4];let _=g,v;t[5]!==_||t[6]!==r||t[7]!==n?(v=_??{scope:n,name:r,path:r,description:``,installed:!1,hosts:[]},t[5]=_,t[6]=r,t[7]=n,t[8]=v):v=t[8];let y=v,b=h.installingName===r,[x,S]=(0,f.useState)(null),C=x??y.hosts,w;t[9]===C?w=t[10]:(w=new Set(C),t[9]=C,t[10]=w);let T=w,E=x?x.length>0:y.installed,D=(0,f.useRef)(y.hosts),O,k;t[11]!==x||t[12]!==y.hosts?(O=()=>{x===null&&(D.current=y.hosts)},k=[x,y.hosts],t[11]=x,t[12]=y.hosts,t[13]=O,t[14]=k):(O=t[13],k=t[14]),(0,f.useEffect)(O,k);let A;t[15]===y.hosts?A=t[16]:(A=[...y.hosts].sort().join(`,`),t[15]=y.hosts,t[16]=A);let j=A,M,N;t[17]===j?(M=t[18],N=t[19]):(M=()=>{S(e=>e&&[...e].sort().join(`,`)===j?null:e)},N=[j],t[17]=j,t[18]=M,t[19]=N),(0,f.useEffect)(M,N);let P=(0,f.useRef)(null),F,I;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{P.current&&clearTimeout(P.current)},F=[],t[20]=F,t[21]=I):(F=t[20],I=t[21]),(0,f.useEffect)(I,F);let L,R,z,B,V,H,U,W,G;if(t[22]!==h||t[23]!==T||t[24]!==E||t[25]!==b||t[26]!==y){z=function(e,t){D.current=e,S(e),P.current&&clearTimeout(P.current);let n=async()=>{(await h.install(y,e)).ok||S(null)};t?P.current=setTimeout(()=>void n(),350):n()};let e=function(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),z([...n],!0)};G=`flex items-center gap-1.5`,R=se;let n=E?`installed`:`draft`,r=E?`border-primary/50 bg-primary/5 text-primary hover:bg-primary/10 hover:text-primary`:`border-yellow-500/40 bg-yellow-500/10 text-yellow-600 hover:bg-yellow-500/20 hover:text-yellow-600`,a;t[36]===r?a=t[37]:(a=te(`h-6 gap-1 rounded-sm border px-1.5 font-mono text-xs uppercase shadow-none`,r),t[36]=r,t[37]=a);let s;t[38]!==E||t[39]!==b?(s=b?(0,p.jsx)(i,{id:`b4itZn`}):E?(0,p.jsx)(i,{id:`eQkgKV`}):(0,p.jsx)(i,{id:`eneWvv`}),t[38]=E,t[39]=b,t[40]=s):s=t[40];let c;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,p.jsx)(o,{"aria-hidden":!0}),t[41]=c):c=t[41],t[42]!==b||t[43]!==n||t[44]!==a||t[45]!==s?(W=(0,p.jsx)(re,{asChild:!0,children:(0,p.jsxs)(ne,{variant:`outline`,size:`sm`,disabled:b,"data-testid":`skill-install-menu-trigger`,"data-state":n,className:a,children:[s,c]})}),t[42]=b,t[43]=n,t[44]=a,t[45]=s,t[46]=W):W=t[46],L=ae,B=`end`,V=`min-w-52`,t[47]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,p.jsx)(u,{children:(0,p.jsx)(i,{id:`npcziF`})}),t[47]=H):H=t[47],U=m.map(t=>(0,p.jsx)(oe,{checked:T.has(t),onCheckedChange:n=>e(t,n===!0),"data-testid":`skill-install-editor-${t}`,children:ee[t]},t)),t[22]=h,t[23]=T,t[24]=E,t[25]=b,t[26]=y,t[27]=L,t[28]=R,t[29]=z,t[30]=B,t[31]=V,t[32]=H,t[33]=U,t[34]=W,t[35]=G}else L=t[27],R=t[28],z=t[29],B=t[30],V=t[31],H=t[32],U=t[33],W=t[34],G=t[35];let K;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,p.jsx)(ie,{}),t[48]=K):K=t[48];let q;t[49]===z?q=t[50]:(q=()=>z([...m],!1),t[49]=z,t[50]=q);let J;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,p.jsx)(i,{id:`x-5mJ1`}),t[51]=J):J=t[51];let Y;t[52]===q?Y=t[53]:(Y=(0,p.jsx)(l,{"data-testid":`skill-install-all`,onSelect:q,children:J}),t[52]=q,t[53]=Y);let X;t[54]!==h||t[55]!==E||t[56]!==y?(X=E?(0,p.jsx)(l,{"data-testid":`skill-uninstall`,onSelect:()=>{P.current&&clearTimeout(P.current),D.current=[],S([]),(async()=>{(await h.uninstall(y)).ok||S(null)})()},children:(0,p.jsx)(i,{id:`t422_7`})}):null,t[54]=h,t[55]=E,t[56]=y,t[57]=X):X=t[57];let Z;t[58]!==L||t[59]!==B||t[60]!==V||t[61]!==H||t[62]!==U||t[63]!==Y||t[64]!==X?(Z=(0,p.jsxs)(L,{align:B,className:V,children:[H,U,K,Y,X]}),t[58]=L,t[59]=B,t[60]=V,t[61]=H,t[62]=U,t[63]=Y,t[64]=X,t[65]=Z):Z=t[65];let Q;t[66]!==R||t[67]!==W||t[68]!==Z?(Q=(0,p.jsxs)(R,{children:[W,Z]}),t[66]=R,t[67]=W,t[68]=Z,t[69]=Q):Q=t[69];let $;return t[70]!==h.dialogs||t[71]!==G||t[72]!==Q?($=(0,p.jsxs)(`div`,{className:G,children:[Q,h.dialogs]}),t[70]=h.dialogs,t[71]=G,t[72]=Q,t[73]=$):$=t[73],$}export{h as SkillEditorActions};
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{n as i}from"./dist-CQw2y-s3.js";import{bt as a,k as ee}from"./dist-CJc7OX7s.js";import{i as te,t as ne}from"./button-cneJOVxD.js";import{t as o}from"./chevron-down-BvNcCN1f.js";import{i as s,r as c}from"./skill-actions-CMd77Yt2.js";import{E as re,S as ie,_ as l,h as ae,m as oe,p as se,v as u}from"./skills-api-UoasHTUi.js";var d=r(),f=e(t(),1),p=n(),m=a.options;function h(e){let t=(0,d.c)(74),{scope:n,name:r}=e,a=s(),h=c(),g;t[0]!==r||t[1]!==n||t[2]!==a.data||t[3]!==a.status?(g=a.status===`ready`?a.data.find(e=>e.scope===n&&e.name===r):void 0,t[0]=r,t[1]=n,t[2]=a.data,t[3]=a.status,t[4]=g):g=t[4];let _=g,v;t[5]!==_||t[6]!==r||t[7]!==n?(v=_??{scope:n,name:r,path:r,description:``,installed:!1,hosts:[]},t[5]=_,t[6]=r,t[7]=n,t[8]=v):v=t[8];let y=v,b=h.installingName===r,[x,S]=(0,f.useState)(null),C=x??y.hosts,w;t[9]===C?w=t[10]:(w=new Set(C),t[9]=C,t[10]=w);let T=w,E=x?x.length>0:y.installed,D=(0,f.useRef)(y.hosts),O,k;t[11]!==x||t[12]!==y.hosts?(O=()=>{x===null&&(D.current=y.hosts)},k=[x,y.hosts],t[11]=x,t[12]=y.hosts,t[13]=O,t[14]=k):(O=t[13],k=t[14]),(0,f.useEffect)(O,k);let A;t[15]===y.hosts?A=t[16]:(A=[...y.hosts].sort().join(`,`),t[15]=y.hosts,t[16]=A);let j=A,M,N;t[17]===j?(M=t[18],N=t[19]):(M=()=>{S(e=>e&&[...e].sort().join(`,`)===j?null:e)},N=[j],t[17]=j,t[18]=M,t[19]=N),(0,f.useEffect)(M,N);let P=(0,f.useRef)(null),F,I;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{P.current&&clearTimeout(P.current)},F=[],t[20]=F,t[21]=I):(F=t[20],I=t[21]),(0,f.useEffect)(I,F);let L,R,z,B,V,H,U,W,G;if(t[22]!==h||t[23]!==T||t[24]!==E||t[25]!==b||t[26]!==y){z=function(e,t){D.current=e,S(e),P.current&&clearTimeout(P.current);let n=async()=>{(await h.install(y,e)).ok||S(null)};t?P.current=setTimeout(()=>void n(),350):n()};let e=function(e,t){let n=new Set(D.current);t?n.add(e):n.delete(e),z([...n],!0)};G=`flex items-center gap-1.5`,R=se;let n=E?`installed`:`draft`,r=E?`border-primary/50 bg-primary/5 text-primary hover:bg-primary/10 hover:text-primary`:`border-yellow-500/40 bg-yellow-500/10 text-yellow-600 hover:bg-yellow-500/20 hover:text-yellow-600`,a;t[36]===r?a=t[37]:(a=te(`h-6 gap-1 rounded-sm border px-1.5 font-mono text-xs uppercase shadow-none`,r),t[36]=r,t[37]=a);let s;t[38]!==E||t[39]!==b?(s=b?(0,p.jsx)(i,{id:`b4itZn`}):E?(0,p.jsx)(i,{id:`eQkgKV`}):(0,p.jsx)(i,{id:`eneWvv`}),t[38]=E,t[39]=b,t[40]=s):s=t[40];let c;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,p.jsx)(o,{"aria-hidden":!0}),t[41]=c):c=t[41],t[42]!==b||t[43]!==n||t[44]!==a||t[45]!==s?(W=(0,p.jsx)(re,{asChild:!0,children:(0,p.jsxs)(ne,{variant:`outline`,size:`sm`,disabled:b,"data-testid":`skill-install-menu-trigger`,"data-state":n,className:a,children:[s,c]})}),t[42]=b,t[43]=n,t[44]=a,t[45]=s,t[46]=W):W=t[46],L=ae,B=`end`,V=`min-w-52`,t[47]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,p.jsx)(u,{children:(0,p.jsx)(i,{id:`npcziF`})}),t[47]=H):H=t[47],U=m.map(t=>(0,p.jsx)(oe,{checked:T.has(t),onCheckedChange:n=>e(t,n===!0),"data-testid":`skill-install-editor-${t}`,children:ee[t]},t)),t[22]=h,t[23]=T,t[24]=E,t[25]=b,t[26]=y,t[27]=L,t[28]=R,t[29]=z,t[30]=B,t[31]=V,t[32]=H,t[33]=U,t[34]=W,t[35]=G}else L=t[27],R=t[28],z=t[29],B=t[30],V=t[31],H=t[32],U=t[33],W=t[34],G=t[35];let K;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,p.jsx)(ie,{}),t[48]=K):K=t[48];let q;t[49]===z?q=t[50]:(q=()=>z([...m],!1),t[49]=z,t[50]=q);let J;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,p.jsx)(i,{id:`x-5mJ1`}),t[51]=J):J=t[51];let Y;t[52]===q?Y=t[53]:(Y=(0,p.jsx)(l,{"data-testid":`skill-install-all`,onSelect:q,children:J}),t[52]=q,t[53]=Y);let X;t[54]!==h||t[55]!==E||t[56]!==y?(X=E?(0,p.jsx)(l,{"data-testid":`skill-uninstall`,onSelect:()=>{P.current&&clearTimeout(P.current),D.current=[],S([]),(async()=>{(await h.uninstall(y)).ok||S(null)})()},children:(0,p.jsx)(i,{id:`t422_7`})}):null,t[54]=h,t[55]=E,t[56]=y,t[57]=X):X=t[57];let Z;t[58]!==L||t[59]!==B||t[60]!==V||t[61]!==H||t[62]!==U||t[63]!==Y||t[64]!==X?(Z=(0,p.jsxs)(L,{align:B,className:V,children:[H,U,K,Y,X]}),t[58]=L,t[59]=B,t[60]=V,t[61]=H,t[62]=U,t[63]=Y,t[64]=X,t[65]=Z):Z=t[65];let Q;t[66]!==R||t[67]!==W||t[68]!==Z?(Q=(0,p.jsxs)(R,{children:[W,Z]}),t[66]=R,t[67]=W,t[68]=Z,t[69]=Q):Q=t[69];let $;return t[70]!==h.dialogs||t[71]!==G||t[72]!==Q?($=(0,p.jsxs)(`div`,{className:G,children:[Q,h.dialogs]}),t[70]=h.dialogs,t[71]=G,t[72]=Q,t[73]=$):$=t[73],$}export{h as SkillEditorActions};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{H as i,N as a,mt as o,pt as s}from"./DocumentContext-CKEIVeX1.js";import{n as c}from"./dist-BVOt51sU.js";import{M as l,si as ee,sn as u}from"./dist-DN4vicwQ.js";import{O as d,P as te,a as f,i as p,o as m}from"./CodeMirrorPropInput-D5H6xSL_.js";import{l as ne}from"./keyboard-shortcuts-DVv_UWZp.js";import"./config-provider-C7vWo2tJ.js";import{Dt as re,Et as h,Ft as g,J as _,P as v,Q as y,Tt as b,X as x,pt as S,ut as ie}from"./dist-Dot7Y1W_.js";import{n as ae}from"./config-context-CE3SCVYc.js";import{o as C,r as w}from"./selection-context-DM7dh9w8.js";import{c as T,d as E,n as D,r as O,u as oe}from"./typing-burst-detector-BFnDTZhU.js";import{n as se,t as ce}from"./dist-C-f1kbPA.js";import{t as le}from"./src-D2FMxg7w.js";var k=e(t(),1),A=r(),j=_.mark({class:`cm-link-ref-broken`}),M=/^\s{0,3}\[([^\]]+)\]:\s/,N=/\[([^\]]*)\]\[([^\]]*)\]/g,P=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function F(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i];if(e<a.from)r=i-1;else if(e>=a.to)n=i+1;else return!0}return!1}function I(e){let t=[];return v(e).iterate({enter(e){if(P.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function L(e){let t=new Set,n=[],r=e.doc,i=I(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(F(n.from,i))continue;let a=M.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!F(t.from,i)&&!M.test(t.text))for(N.lastIndex=0;;){let e=N.exec(t.text);if(!e)break;let r=t.from+e.index;if(F(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(j.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),_.set(a)}var R=g.define({create(e){return L(e)},update(e,t){return t.docChanged?L(t.state):e},provide:e=>x.decorations.from(e)}),z=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,B=_.mark({class:`cm-del`}),V=_.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),H=_.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function U(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function W(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(!l.test(t.text))return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(l.test(r.text))return{from:t.from,to:r.to}}return null}function G(e,t){let n=[],r=v(e),i=W(e),a=e=>i!==null&&e>=i.from&&e<=i.to;for(let{from:i,to:o}of t)r.iterate({from:i,to:o,enter(t){if(!a(t.from)){if(t.name===`Strikethrough`){let e=t.from,r=t.to,i=t.node.cursor();if(i.firstChild())do i.name===`StrikethroughMark`&&(i.from===t.from?e=i.to:r=i.from);while(i.nextSibling());return e<r&&n.push(B.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=z.exec(r.text),a=i?i[1].length:2,o=_.line({class:`cm-list-item`,attributes:{style:`--list-hang: ${a}ch`}});n.push(o.range(r.from));return}if(t.name===`FencedCode`){let r=e.doc.lineAt(t.from),i=e.doc.lineAt(t.to);for(let t=r.number+1;t<i.number;t++){let r=e.doc.line(t),i=U(r.text),a=_.line({class:`cm-fenced-code-line`,attributes:{style:`--line-indent: ${i}`}});n.push(a.range(r.from))}return!1}if(t.name===`TableHeader`){let r=e.doc.lineAt(t.from);return n.push(V.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(H.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(H.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),_.set(n)}var K=class{decorations;constructor(e){this.decorations=G(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||v(e.startState)!==v(e.state))&&(this.decorations=G(e.view.state,e.view.visibleRanges))}},q=y.fromClass(K,{decorations:e=>e.decorations});function J(){return[q,R]}var ue=n(),Y=56;function X(e,t){let n=e.state.doc,r=1;if(n.lines>=1&&l.test(n.line(1).text)){for(let e=2;e<=n.lines;e++)if(l.test(n.line(e).text)){r=e+1;break}}let i=u(),a=0;for(let o=r;o<=n.lines;o++){let r=n.line(o);if(!i(r.text)&&/^#{1,6}\s/.test(r.text)){if(a===t.index){e.dispatch({selection:h.cursor(r.from),effects:x.scrollIntoView(r.from,{y:`start`})}),e.focus();return}a++}}}function de(e,t){requestAnimationFrame(()=>{let n=e.state.doc,r=Math.min(t.offset,n.length);e.dispatch({selection:h.cursor(r),effects:x.scrollIntoView(r,{y:`center`})}),e.focus()})}function Z(e){let t=(0,A.c)(33),{docName:n,ytext:r,provider:l,placeholder:u,isSourceModeActive:d}=e,h=(0,k.useRef)(null),g=(0,k.useRef)(null),[_,v]=(0,k.useState)(null);if(_)throw _;let{resolvedTheme:y}=c(),{merged:j}=ae(),M=(0,k.useRef)(d),N=j?.editor?.wordWrap??!0,P,F;t[0]===d?(P=t[1],F=t[2]):(P=()=>{M.current=d},F=[d],t[0]=d,t[1]=P,t[2]=F),(0,k.useEffect)(P,F);let I=(0,k.useRef)(null),L;t[3]!==u||t[4]!==l||t[5]!==y||t[6]!==N||t[7]!==r?(L=()=>{let e=h.current;if(!e)return;let t=l.configuration.name??``,n,c=me;try{n=s({docName:t,container:e,sizeStats:{viewCount:0,bytes:r.length},factory:e=>{let n=null,o=a({ydoc:l.document,ytext:r}),s=new b,d=new b,f=new b,m=new x({state:re.create({doc:r.toString(),extensions:[ce,se({scrollToMatch:pe}),ie.of([te]),le(r,l.awareness),...p({themeCompartment:s,resolvedTheme:y,ydoc:l.document,wordWrapCompartment:d,wordWrap:N,currentDocName:t}),J(),o,x.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(n!==null&&clearTimeout(n),n=setTimeout(()=>{n=null,D(t,`source`,O(e.view)),w(t,`source`,C(e.view,t))},120))}),x.domEventHandlers({keydown:(e,t)=>!M.current||!ee()||!ne(e,`edit-with-ai`)?!1:(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),i(),!0)}),f.of(S(u??``)),x.theme({"&":{height:`100%`}}),x.scrollMargins.of(fe)]}),parent:e});D(t,`source`,O(m)),w(t,`source`,C(m,t));let h=m.contentDOM;return h.addEventListener(`keydown`,c),h.addEventListener(`paste`,c),h.addEventListener(`drop`,c),h.addEventListener(`cut`,c),{view:m,ydoc:l.document,ytext:r,provider:l,themeCompartment:s,wordWrapCompartment:d,placeholderCompartment:f}}}),I.current=n,g.current=n.view}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),I.current=null,g.current=null,v(t instanceof Error?t:Error(String(t)))}return()=>{let e=I.current;e&&o(e),I.current=null,g.current=null}},t[3]=u,t[4]=l,t[5]=y,t[6]=N,t[7]=r,t[8]=L):L=t[8];let R;t[9]!==l||t[10]!==r?(R=[r,l],t[9]=l,t[10]=r,t[11]=R):R=t[11],(0,k.useEffect)(L,R);let z,B;t[12]===n?(z=t[13],B=t[14]):(z=()=>{},B=[n],t[12]=n,t[13]=z,t[14]=B),(0,k.useEffect)(z,B);let V,H;t[15]===y?(V=t[16],H=t[17]):(V=()=>{let e=I.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(y===`dark`?f:m)})},H=[y],t[15]=y,t[16]=V,t[17]=H),(0,k.useEffect)(V,H);let U,W;t[18]===N?(U=t[19],W=t[20]):(W=()=>{let e=I.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(N?x.lineWrapping:[])})},U=[N],t[18]=N,t[19]=U,t[20]=W),(0,k.useEffect)(W,U);let G,K;t[21]===u?(G=t[22],K=t[23]):(G=()=>{let e=I.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(S(u??``))})},K=[u],t[21]=u,t[22]=G,t[23]=K),(0,k.useEffect)(G,K);let q,Y;t[24]!==n||t[25]!==d?(q=()=>{let e=function(e){let t=e.detail;if(!t||t.mode!==`source`||!d)return;let r=g.current;r&&(X(r,t),oe(n))};return window.addEventListener(T,e),()=>window.removeEventListener(T,e)},Y=[n,d],t[24]=n,t[25]=d,t[26]=q,t[27]=Y):(q=t[26],Y=t[27]),(0,k.useEffect)(q,Y);let Z,Q;t[28]!==n||t[29]!==d?(Z=()=>{if(!d)return;let e=g.current;if(!e)return;let t=E(n);if(t){if(t.kind===`outline`){X(e,t.detail);return}de(e,t.detail)}},Q=[n,d],t[28]=n,t[29]=d,t[30]=Z,t[31]=Q):(Z=t[30],Q=t[31]),(0,k.useEffect)(Z,Q);let $;return t[32]===Symbol.for(`react.memo_cache_sentinel`)?($=(0,ue.jsx)(`div`,{ref:h,className:`source-editor h-full pb-3`}),t[32]=$):$=t[32],$}function fe(){return{top:Y}}function pe(e){return x.scrollIntoView(e,{y:`start`})}function me(){return d()}export{Z as SourceEditor};
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{H as i,N as a,mt as o,pt as s}from"./DocumentContext-Cf3xyIUc.js";import{n as c}from"./dist-BVOt51sU.js";import{M as l,si as ee,sn as u}from"./dist-CJc7OX7s.js";import{O as d,P as te,a as f,i as p,o as m}from"./CodeMirrorPropInput-A-b7Ox39.js";import{l as ne}from"./keyboard-shortcuts-CvYXgqK4.js";import"./config-provider-D0CfBIwU.js";import{Dt as re,Et as h,Ft as g,J as _,P as v,Q as y,Tt as b,X as x,pt as S,ut as ie}from"./dist-Dot7Y1W_.js";import{n as ae}from"./config-context-CE3SCVYc.js";import{o as C,r as w}from"./selection-context-JPA-xW1g.js";import{c as T,d as E,n as D,r as O,u as oe}from"./typing-burst-detector-DLup_S3P.js";import{n as se,t as ce}from"./dist-DoFKRM_F.js";import{t as le}from"./src-CXdmKAqZ.js";var k=e(t(),1),A=r(),j=_.mark({class:`cm-link-ref-broken`}),M=/^\s{0,3}\[([^\]]+)\]:\s/,N=/\[([^\]]*)\]\[([^\]]*)\]/g,P=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function F(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i];if(e<a.from)r=i-1;else if(e>=a.to)n=i+1;else return!0}return!1}function I(e){let t=[];return v(e).iterate({enter(e){if(P.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function L(e){let t=new Set,n=[],r=e.doc,i=I(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if(F(n.from,i))continue;let a=M.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!F(t.from,i)&&!M.test(t.text))for(N.lastIndex=0;;){let e=N.exec(t.text);if(!e)break;let r=t.from+e.index;if(F(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(j.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),_.set(a)}var R=g.define({create(e){return L(e)},update(e,t){return t.docChanged?L(t.state):e},provide:e=>x.decorations.from(e)}),z=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,B=_.mark({class:`cm-del`}),V=_.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),H=_.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function U(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function W(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(!l.test(t.text))return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(l.test(r.text))return{from:t.from,to:r.to}}return null}function G(e,t){let n=[],r=v(e),i=W(e),a=e=>i!==null&&e>=i.from&&e<=i.to;for(let{from:i,to:o}of t)r.iterate({from:i,to:o,enter(t){if(!a(t.from)){if(t.name===`Strikethrough`){let e=t.from,r=t.to,i=t.node.cursor();if(i.firstChild())do i.name===`StrikethroughMark`&&(i.from===t.from?e=i.to:r=i.from);while(i.nextSibling());return e<r&&n.push(B.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=z.exec(r.text),a=i?i[1].length:2,o=_.line({class:`cm-list-item`,attributes:{style:`--list-hang: ${a}ch`}});n.push(o.range(r.from));return}if(t.name===`FencedCode`){let r=e.doc.lineAt(t.from),i=e.doc.lineAt(t.to);for(let t=r.number+1;t<i.number;t++){let r=e.doc.line(t),i=U(r.text),a=_.line({class:`cm-fenced-code-line`,attributes:{style:`--line-indent: ${i}`}});n.push(a.range(r.from))}return!1}if(t.name===`TableHeader`){let r=e.doc.lineAt(t.from);return n.push(V.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(H.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(H.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),_.set(n)}var K=class{decorations;constructor(e){this.decorations=G(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||v(e.startState)!==v(e.state))&&(this.decorations=G(e.view.state,e.view.visibleRanges))}},q=y.fromClass(K,{decorations:e=>e.decorations});function J(){return[q,R]}var ue=n(),Y=56;function X(e,t){let n=e.state.doc,r=1;if(n.lines>=1&&l.test(n.line(1).text)){for(let e=2;e<=n.lines;e++)if(l.test(n.line(e).text)){r=e+1;break}}let i=u(),a=0;for(let o=r;o<=n.lines;o++){let r=n.line(o);if(!i(r.text)&&/^#{1,6}\s/.test(r.text)){if(a===t.index){e.dispatch({selection:h.cursor(r.from),effects:x.scrollIntoView(r.from,{y:`start`})}),e.focus();return}a++}}}function de(e,t){requestAnimationFrame(()=>{let n=e.state.doc,r=Math.min(t.offset,n.length);e.dispatch({selection:h.cursor(r),effects:x.scrollIntoView(r,{y:`center`})}),e.focus()})}function Z(e){let t=(0,A.c)(33),{docName:n,ytext:r,provider:l,placeholder:u,isSourceModeActive:d}=e,h=(0,k.useRef)(null),g=(0,k.useRef)(null),[_,v]=(0,k.useState)(null);if(_)throw _;let{resolvedTheme:y}=c(),{merged:j}=ae(),M=(0,k.useRef)(d),N=j?.editor?.wordWrap??!0,P,F;t[0]===d?(P=t[1],F=t[2]):(P=()=>{M.current=d},F=[d],t[0]=d,t[1]=P,t[2]=F),(0,k.useEffect)(P,F);let I=(0,k.useRef)(null),L;t[3]!==u||t[4]!==l||t[5]!==y||t[6]!==N||t[7]!==r?(L=()=>{let e=h.current;if(!e)return;let t=l.configuration.name??``,n,c=me;try{n=s({docName:t,container:e,sizeStats:{viewCount:0,bytes:r.length},factory:e=>{let n=null,o=a({ydoc:l.document,ytext:r}),s=new b,d=new b,f=new b,m=new x({state:re.create({doc:r.toString(),extensions:[ce,se({scrollToMatch:pe}),ie.of([te]),le(r,l.awareness),...p({themeCompartment:s,resolvedTheme:y,ydoc:l.document,wordWrapCompartment:d,wordWrap:N,currentDocName:t}),J(),o,x.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(n!==null&&clearTimeout(n),n=setTimeout(()=>{n=null,D(t,`source`,O(e.view)),w(t,`source`,C(e.view,t))},120))}),x.domEventHandlers({keydown:(e,t)=>!M.current||!ee()||!ne(e,`edit-with-ai`)?!1:(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),i(),!0)}),f.of(S(u??``)),x.theme({"&":{height:`100%`}}),x.scrollMargins.of(fe)]}),parent:e});D(t,`source`,O(m)),w(t,`source`,C(m,t));let h=m.contentDOM;return h.addEventListener(`keydown`,c),h.addEventListener(`paste`,c),h.addEventListener(`drop`,c),h.addEventListener(`cut`,c),{view:m,ydoc:l.document,ytext:r,provider:l,themeCompartment:s,wordWrapCompartment:d,placeholderCompartment:f}}}),I.current=n,g.current=n.view}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),I.current=null,g.current=null,v(t instanceof Error?t:Error(String(t)))}return()=>{let e=I.current;e&&o(e),I.current=null,g.current=null}},t[3]=u,t[4]=l,t[5]=y,t[6]=N,t[7]=r,t[8]=L):L=t[8];let R;t[9]!==l||t[10]!==r?(R=[r,l],t[9]=l,t[10]=r,t[11]=R):R=t[11],(0,k.useEffect)(L,R);let z,B;t[12]===n?(z=t[13],B=t[14]):(z=()=>{},B=[n],t[12]=n,t[13]=z,t[14]=B),(0,k.useEffect)(z,B);let V,H;t[15]===y?(V=t[16],H=t[17]):(V=()=>{let e=I.current;e&&e.view.dispatch({effects:e.themeCompartment.reconfigure(y===`dark`?f:m)})},H=[y],t[15]=y,t[16]=V,t[17]=H),(0,k.useEffect)(V,H);let U,W;t[18]===N?(U=t[19],W=t[20]):(W=()=>{let e=I.current;e&&e.view.dispatch({effects:e.wordWrapCompartment.reconfigure(N?x.lineWrapping:[])})},U=[N],t[18]=N,t[19]=U,t[20]=W),(0,k.useEffect)(W,U);let G,K;t[21]===u?(G=t[22],K=t[23]):(G=()=>{let e=I.current;e&&e.view.dispatch({effects:e.placeholderCompartment.reconfigure(S(u??``))})},K=[u],t[21]=u,t[22]=G,t[23]=K),(0,k.useEffect)(G,K);let q,Y;t[24]!==n||t[25]!==d?(q=()=>{let e=function(e){let t=e.detail;if(!t||t.mode!==`source`||!d)return;let r=g.current;r&&(X(r,t),oe(n))};return window.addEventListener(T,e),()=>window.removeEventListener(T,e)},Y=[n,d],t[24]=n,t[25]=d,t[26]=q,t[27]=Y):(q=t[26],Y=t[27]),(0,k.useEffect)(q,Y);let Z,Q;t[28]!==n||t[29]!==d?(Z=()=>{if(!d)return;let e=g.current;if(!e)return;let t=E(n);if(t){if(t.kind===`outline`){X(e,t.detail);return}de(e,t.detail)}},Q=[n,d],t[28]=n,t[29]=d,t[30]=Z,t[31]=Q):(Z=t[30],Q=t[31]),(0,k.useEffect)(Z,Q);let $;return t[32]===Symbol.for(`react.memo_cache_sentinel`)?($=(0,ue.jsx)(`div`,{ref:h,className:`source-editor h-full pb-3`}),t[32]=$):$=t[32],$}function fe(){return{top:Y}}function pe(e){return x.scrollIntoView(e,{y:`start`})}function me(){return d()}export{Z as SourceEditor};