@inkeep/open-knowledge 0.12.0-beta.13 → 0.12.0-beta.14

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 (455) hide show
  1. package/dist/THIRD_PARTY_NOTICES.md +35 -0
  2. package/dist/_baseFor-m0TxKeb9.mjs +2 -0
  3. package/dist/alias-JE7RI5QX-DmHh8yog.mjs +1 -0
  4. package/dist/arc-Doj9VrmJ.mjs +2 -0
  5. package/dist/architecture-YZFGNWBL-YPACCZ88.mjs +1 -0
  6. package/dist/architectureDiagram-Q4EWVU46-C9cSuC8m.mjs +37 -0
  7. package/dist/array-1jkOhClC.mjs +2 -0
  8. package/dist/assets/skills/discovery/SKILL.md +1 -1
  9. package/dist/assets/skills/project/SKILL.md +3 -3
  10. package/dist/awk2-POPGKRAI-C7696e-z.mjs +1 -0
  11. package/dist/{banner-BeneQTB4.mjs → banner-BxCFCyu8.mjs} +2 -2
  12. package/dist/base64-4YMZCVJ5-BIHNwDj2.mjs +1 -0
  13. package/dist/basename-AA2KJYZQ-Dcz4Ls85.mjs +1 -0
  14. package/dist/bash-IJWYRKFO-DgruzS3i.mjs +1 -0
  15. package/dist/blockDiagram-DXYQGD6D-Dr7L7QsL.mjs +133 -0
  16. package/dist/build-CCDQyip-.mjs +1 -0
  17. package/dist/{build-CJEQ0nGy.mjs → build-DCHzh6iE.mjs} +1 -1
  18. package/dist/c4Diagram-AHTNJAMY-CPm6kKNR.mjs +11 -0
  19. package/dist/cat-RDUMLXKC-BJJIS9lB.mjs +1 -0
  20. package/dist/channel-DE79NHCf.mjs +2 -0
  21. package/dist/chmod-SYMGL4JA-C1Ie7s0s.mjs +1 -0
  22. package/dist/{chokidar-BDjANGpQ.mjs → chokidar-Bu9Rdqzq.mjs} +1 -1
  23. package/dist/{chunk-24IMIIXA-C-Zyd2K_.mjs → chunk-24IMIIXA-DaS5XS55.mjs} +2 -2
  24. package/dist/chunk-2KRD3SAO-BXl7sX-7.mjs +2 -0
  25. package/dist/chunk-336JU56O-KTMEs5Wk.mjs +2 -0
  26. package/dist/{chunk-3THT3N7L-Ce6LrnIA.mjs → chunk-3THT3N7L-B1WzJUh4.mjs} +1 -1
  27. package/dist/{chunk-3ZUFRYJ4-C93H8j0V.mjs → chunk-3ZUFRYJ4-Bv1jGN68.mjs} +1 -1
  28. package/dist/chunk-426QAEUC-DUpKwtVu.mjs +2 -0
  29. package/dist/{chunk-44UOCSGV-uErOrz7G.mjs → chunk-44UOCSGV-BZ6LfyW2.mjs} +1 -1
  30. package/dist/chunk-4BX2VUAB-DM-mXRDw.mjs +2 -0
  31. package/dist/{chunk-4GTNDTRF-_OVmXcJ-.mjs → chunk-4GTNDTRF-DLnFbNSw.mjs} +2 -2
  32. package/dist/{chunk-4HHKTUW3-Dm69hDaZ.mjs → chunk-4HHKTUW3-Ct4ue15f.mjs} +1 -1
  33. package/dist/{chunk-4Q4SM6WR-DDQRsilN.mjs → chunk-4Q4SM6WR-CAvCnPq5.mjs} +2 -2
  34. package/dist/chunk-4TB4RGXK-Ct6WjPoY.mjs +207 -0
  35. package/dist/chunk-55IACEB6-Cmyc0XwJ.mjs +2 -0
  36. package/dist/{chunk-55VFSPNA-DVZfQAzN.mjs → chunk-55VFSPNA-RFvY6zq0.mjs} +2 -2
  37. package/dist/chunk-5FUZZQ4R-Bf6nbyQG.mjs +63 -0
  38. package/dist/chunk-5PVQY5BW-DUXm3tDu.mjs +3 -0
  39. package/dist/{chunk-5QMZ5MUS-BfIuRNkK.mjs → chunk-5QMZ5MUS-BwpNU33k.mjs} +2 -2
  40. package/dist/{chunk-5QVNJEHU-BvsipSFW.mjs → chunk-5QVNJEHU-BV0xuiYW.mjs} +2 -2
  41. package/dist/{chunk-5V6VZH6T-BCr5_GDF.mjs → chunk-5V6VZH6T-ByuVaPWr.mjs} +2 -2
  42. package/dist/{chunk-62RKD26F-CvuML91F.mjs → chunk-62RKD26F-DebCAz0V.mjs} +2 -2
  43. package/dist/{chunk-64BAICW3-CTJNEx4Q.mjs → chunk-64BAICW3-BlirlXmE.mjs} +2 -2
  44. package/dist/chunk-67CJDMHE-C58W8DAL.mjs +2 -0
  45. package/dist/{chunk-74CEPOFO-D1bzz49u.mjs → chunk-74CEPOFO-V0JXh91S.mjs} +1 -1
  46. package/dist/{chunk-7L36YK2X-RiPZFKaV.mjs → chunk-7L36YK2X-B3QRwLbB.mjs} +1 -1
  47. package/dist/chunk-7N4EOEYR-DzEIb3Sc.mjs +2 -0
  48. package/dist/{chunk-7TSDKFEO-a-GUGBTu.mjs → chunk-7TSDKFEO-CMVuiOdP.mjs} +1 -1
  49. package/dist/{chunk-A4HU7SVR-hefV_YmW.mjs → chunk-A4HU7SVR-Bjuqsbev.mjs} +1 -1
  50. package/dist/{chunk-A4JSPFCI-k-tJSZgB.mjs → chunk-A4JSPFCI-CQJoYugB.mjs} +2 -2
  51. package/dist/{chunk-A5O5YHGN-C6ngIqYR.mjs → chunk-A5O5YHGN-DApqA6Ow.mjs} +2 -2
  52. package/dist/{chunk-A65PWWJC-D7J5l9eq.mjs → chunk-A65PWWJC-GGt9898w.mjs} +2 -2
  53. package/dist/{chunk-A7A2DBEE-PLfkXLI4.mjs → chunk-A7A2DBEE-BqvlRSRw.mjs} +1 -1
  54. package/dist/{chunk-A7ICOL4V-Drb3XsEL.mjs → chunk-A7ICOL4V-D5TsVU6v.mjs} +2 -2
  55. package/dist/chunk-AA7GKIK3-DKgpQZxa.mjs +2 -0
  56. package/dist/{chunk-ALLTKNUZ-BMiTDN50.mjs → chunk-ALLTKNUZ-4H3OLfNN.mjs} +2 -2
  57. package/dist/{chunk-APT7OOP2-CXHnSuct.mjs → chunk-APT7OOP2-DnIeUlVe.mjs} +2 -2
  58. package/dist/{chunk-BBXLRYSX-Oks1GMhO.mjs → chunk-BBXLRYSX-XWD4jM9A.mjs} +2 -2
  59. package/dist/{chunk-BRGMQKJV-CHO764qS.mjs → chunk-BRGMQKJV-CHbk2NqS.mjs} +3 -3
  60. package/dist/chunk-BSJP7CBP-BG3yJGkJ.mjs +2 -0
  61. package/dist/{chunk-FK9Q3tQk.mjs → chunk-C94x7I9S.mjs} +1 -1
  62. package/dist/chunk-CIAEETIT-CH33zQ9L.mjs +2 -0
  63. package/dist/{chunk-CR5AFCPT-CH8ZGz3B.mjs → chunk-CR5AFCPT-DN7EAdus.mjs} +2 -2
  64. package/dist/{chunk-CWQS3NFK-BP3kiNgH.mjs → chunk-CWQS3NFK-BkE4vqrf.mjs} +1 -1
  65. package/dist/{chunk-D4J545R4-C8nMOauR.mjs → chunk-D4J545R4-KlK3EOFl.mjs} +2 -2
  66. package/dist/{chunk-D6CWQ5DW-BgQGt8eQ.mjs → chunk-D6CWQ5DW-CF9bBHyK.mjs} +2 -2
  67. package/dist/{chunk-D7MEQ3VN-Csvth_Ss.mjs → chunk-D7MEQ3VN-BM_kIbvf.mjs} +2 -2
  68. package/dist/{chunk-DCAAORBQ-BdrR5ttw.mjs → chunk-DCAAORBQ-BUMlCZ4-.mjs} +2 -2
  69. package/dist/{chunk-DXB73IDG-C2RuFAAY.mjs → chunk-DXB73IDG-F_tmy-Lz.mjs} +2 -2
  70. package/dist/chunk-EDXVE4YY-CI4s3JHP.mjs +2 -0
  71. package/dist/{chunk-EEXR5ZDP-C5AJH114.mjs → chunk-EEXR5ZDP-CvpAxUxM.mjs} +1 -1
  72. package/dist/{chunk-EIZGF4BS-8bsVXqW0.mjs → chunk-EIZGF4BS-C8wRSfCC.mjs} +2 -2
  73. package/dist/chunk-ENJZ2VHE-CQwjtY5A.mjs +11 -0
  74. package/dist/{chunk-F23WWYKW-DST0dB7V.mjs → chunk-F23WWYKW-DLeNVzzD.mjs} +2 -2
  75. package/dist/{chunk-F55TLFGB-Bkfd8ak_.mjs → chunk-F55TLFGB-BZSRX-Vi.mjs} +2 -2
  76. package/dist/{chunk-FEIOJCZD-DmvuPNqm.mjs → chunk-FEIOJCZD-NzTooVTc.mjs} +2 -2
  77. package/dist/chunk-FMBD7UC4-CAloFUY3.mjs +16 -0
  78. package/dist/chunk-FOC6F5B3-Cv5O0Fxp.mjs +2 -0
  79. package/dist/{chunk-GCTKCWKD-Deqi1D_N.mjs → chunk-GCTKCWKD-D3J1Ev9z.mjs} +1 -1
  80. package/dist/{chunk-GFQRA5P5-ePq2jelx.mjs → chunk-GFQRA5P5-DbAN9IDm.mjs} +1 -1
  81. package/dist/{chunk-GOV5EKKI-CyL1eJ32.mjs → chunk-GOV5EKKI-CDGzZWfT.mjs} +2 -2
  82. package/dist/{chunk-GXVXFKBA-993FoPmq.mjs → chunk-GXVXFKBA-D0BDCtkE.mjs} +2 -2
  83. package/dist/{chunk-HDQ56CKY-pGV4pOJA.mjs → chunk-HDQ56CKY-DZc2LbWr.mjs} +2 -2
  84. package/dist/{chunk-HJQJAYMS-Ci3vsKQW.mjs → chunk-HJQJAYMS-BS_JF11O.mjs} +1 -1
  85. package/dist/{chunk-HJWBQKYG-UZig4wUt.mjs → chunk-HJWBQKYG-DknkBuxy.mjs} +2 -2
  86. package/dist/{chunk-HWBSOZZR-BeVrNfQw.mjs → chunk-HWBSOZZR-5PJ_z6D6.mjs} +2 -2
  87. package/dist/{chunk-HWKDQ44K-CPSjqtR_.mjs → chunk-HWKDQ44K-BJxdK4fT.mjs} +2 -2
  88. package/dist/{chunk-I57KEIP3-5RFY25TO.mjs → chunk-I57KEIP3-DSoF8c_0.mjs} +2 -2
  89. package/dist/chunk-ICPOFSXX-C--tVIY5.mjs +123 -0
  90. package/dist/{chunk-IPJHKYVM-D6H6ZTtk.mjs → chunk-IPJHKYVM-CUKythEA.mjs} +1 -1
  91. package/dist/{chunk-J642UCRS-D87gHOLP.mjs → chunk-J642UCRS-HjD8qpZD.mjs} +2 -2
  92. package/dist/{chunk-JVPRLUMK-DnQCNjpq.mjs → chunk-JVPRLUMK-D6CRdXSO.mjs} +2 -2
  93. package/dist/chunk-K5T4RW27-BPgPjo39.mjs +98 -0
  94. package/dist/chunk-KGLVRYIC-CmkADDeV.mjs +2 -0
  95. package/dist/{chunk-KMEYNNUA-DfdK88O_.mjs → chunk-KMEYNNUA-Qk0eg7gN.mjs} +2 -2
  96. package/dist/chunk-LIHQZDEY-Fy8O-IVI.mjs +2 -0
  97. package/dist/{chunk-LL3S3NLB-DxXgE3kY.mjs → chunk-LL3S3NLB-CH16p_-s.mjs} +2 -2
  98. package/dist/{chunk-LPQPILI2-DyyhWSR7.mjs → chunk-LPQPILI2-OoVL_l9j.mjs} +2 -2
  99. package/dist/{chunk-LTZRCH7N-GAjTFNwG.mjs → chunk-LTZRCH7N-BfgCUlp9.mjs} +2 -2
  100. package/dist/{chunk-LWEGUNWT-BALY4RLC.mjs → chunk-LWEGUNWT-DhbhFY11.mjs} +2 -2
  101. package/dist/{chunk-MDDMCKUK-poQ25EjI.mjs → chunk-MDDMCKUK-ChL1CU4m.mjs} +2 -2
  102. package/dist/{chunk-MDLLFABN-oBQf6bGE.mjs → chunk-MDLLFABN-UsHGHHoh.mjs} +2 -2
  103. package/dist/{chunk-MHTUABJP-dKmK6Hw7.mjs → chunk-MHTUABJP-Dk5ocjFo.mjs} +1 -1
  104. package/dist/{chunk-MIZPJHVH-BdoPqh_Y.mjs → chunk-MIZPJHVH-BD7tHmLL.mjs} +2 -2
  105. package/dist/{chunk-MLXIYONF-DwewZM3r.mjs → chunk-MLXIYONF-CV7WHBm-.mjs} +2 -2
  106. package/dist/{chunk-MYE6AGBJ-B4pRo9ma.mjs → chunk-MYE6AGBJ-DwzjGrc0.mjs} +2 -2
  107. package/dist/{chunk-NAERJDUW-BFcmkHme.mjs → chunk-NAERJDUW-Cyg2DAzO.mjs} +2 -2
  108. package/dist/{chunk-NCNPKYJZ-BFGan4lR.mjs → chunk-NCNPKYJZ-Ct0_l0YT.mjs} +2 -2
  109. package/dist/{chunk-NUYSJFDK-DAvAseHr.mjs → chunk-NUYSJFDK-BH2DjyxF.mjs} +2 -2
  110. package/dist/{chunk-NYQYO467-_2947cgi.mjs → chunk-NYQYO467-CY88QCuT.mjs} +2 -2
  111. package/dist/{chunk-OARHFVLG-vxL5zuWx.mjs → chunk-OARHFVLG-dXiYYC4o.mjs} +2 -2
  112. package/dist/{chunk-OCLXQMOG-C7k2qEN6.mjs → chunk-OCLXQMOG-DOkdFgyf.mjs} +2 -2
  113. package/dist/{chunk-OCS6LSEM-Lh1p0H-V.mjs → chunk-OCS6LSEM-Bcx6uxmm.mjs} +2 -2
  114. package/dist/{chunk-OJDRYQWQ-DWhg7YHU.mjs → chunk-OJDRYQWQ-CmrD0Dg2.mjs} +1 -1
  115. package/dist/{chunk-OL3S66CO-B3hSNlNP.mjs → chunk-OL3S66CO-CWEDi2F_.mjs} +2 -2
  116. package/dist/chunk-ORNJ4GCN-R_gUIosC.mjs +2 -0
  117. package/dist/chunk-OYMX7WX6-Dvg98Zb-.mjs +232 -0
  118. package/dist/{chunk-PBXLG62G-MmAqjdXR.mjs → chunk-PBXLG62G-CpvczNyQ.mjs} +2 -2
  119. package/dist/{chunk-PP6PSHAB-DMC_XCfO.mjs → chunk-PP6PSHAB-DQ3LPONR.mjs} +1 -1
  120. package/dist/{chunk-PYSFUGCK-CY7pclEB.mjs → chunk-PYSFUGCK-B_Gv8rUn.mjs} +2 -2
  121. package/dist/{chunk-QCDB2VPH-D1RuXtOm.mjs → chunk-QCDB2VPH-Bays5mAr.mjs} +2 -2
  122. package/dist/{chunk-QJ7O6ZN3-BH67tCjg.mjs → chunk-QJ7O6ZN3-BCF2wp2J.mjs} +2 -2
  123. package/dist/chunk-QZHKN3VN-D0OJ2eQ1.mjs +2 -0
  124. package/dist/{chunk-R6QSAL5T-CtbJTvt9.mjs → chunk-R6QSAL5T-RaNW7MSS.mjs} +1 -1
  125. package/dist/{chunk-R6VWJ2ZL-D1Ufj9fh.mjs → chunk-R6VWJ2ZL-BVeTwIsz.mjs} +1 -1
  126. package/dist/{chunk-RPNGRAAP-BughPjdR.mjs → chunk-RPNGRAAP-yHFoBjjv.mjs} +2 -2
  127. package/dist/{chunk-SDNKECQQ-C3GEf3VZ.mjs → chunk-SDNKECQQ-BsAYzqU5.mjs} +2 -2
  128. package/dist/{chunk-SYMJJMQ4-DLPoQaug.mjs → chunk-SYMJJMQ4-jdmKoBFb.mjs} +2 -2
  129. package/dist/{chunk-T56QNPHK-TppyesRp.mjs → chunk-T56QNPHK-DmDxJbbD.mjs} +2 -2
  130. package/dist/{chunk-TLSUDHID-B2VV2ufQ.mjs → chunk-TLSUDHID-CSDR438C.mjs} +2 -2
  131. package/dist/{chunk-TOMNU26N-DfLjxpHW.mjs → chunk-TOMNU26N-CrDa7MpH.mjs} +2 -2
  132. package/dist/{chunk-TXBZCHCQ-l48TczF5.mjs → chunk-TXBZCHCQ-BxbbtyNr.mjs} +2 -2
  133. package/dist/chunk-U2HBQHQK-C1Q2DiEX.mjs +71 -0
  134. package/dist/{chunk-UNYNJIFU--HT-3lrq.mjs → chunk-UNYNJIFU-CZ2Mla0s.mjs} +3 -3
  135. package/dist/{chunk-V7TAPXDL-CnKUp2df.mjs → chunk-V7TAPXDL-CKif4_mH.mjs} +2 -2
  136. package/dist/{chunk-VJFXDYWH-IiUXkKX0.mjs → chunk-VJFXDYWH-CWlZv59U.mjs} +2 -2
  137. package/dist/{chunk-VLGZJRPG-DbWYxLfI.mjs → chunk-VLGZJRPG-DpYP_EVp.mjs} +2 -2
  138. package/dist/{chunk-VOBGTVA6-BT7gUxqf.mjs → chunk-VOBGTVA6-D6fSjWnx.mjs} +2 -2
  139. package/dist/{chunk-VYOJP4TV-BvibOnKG.mjs → chunk-VYOJP4TV-DN1CSkP5.mjs} +2 -2
  140. package/dist/{chunk-WKFATFPP-DCZdrA8x.mjs → chunk-WKFATFPP-CoPg2OGf.mjs} +2 -2
  141. package/dist/{chunk-X2AJGDEF-BaH6i1Rq.mjs → chunk-X2AJGDEF-ClcErtij.mjs} +1 -1
  142. package/dist/chunk-X2U36JSP-BiF0R9ys.mjs +2 -0
  143. package/dist/{chunk-XHM67O4N-BWGDFyz_.mjs → chunk-XHM67O4N-C_wCK9HT.mjs} +1 -1
  144. package/dist/{chunk-XKQRETAK-cVWA9gEB.mjs → chunk-XKQRETAK-BC2HZ_y9.mjs} +2 -2
  145. package/dist/{chunk-XORM457F-D-QrjagQ.mjs → chunk-XORM457F-BuPOSqOe.mjs} +2 -2
  146. package/dist/chunk-XPW4576I-BkucPPwf.mjs +39 -0
  147. package/dist/{chunk-XVDPCNWR-CtK-Xs2O.mjs → chunk-XVDPCNWR-CkzIJQaO.mjs} +2 -2
  148. package/dist/{chunk-YCFVLTST-CFJxSbsH.mjs → chunk-YCFVLTST-DsF45PbT.mjs} +2 -2
  149. package/dist/{chunk-YFG2CMIF-DkT4NiqV.mjs → chunk-YFG2CMIF-DjdwxBNc.mjs} +2 -2
  150. package/dist/{chunk-YNYSPYQ5-iQGTFdx0.mjs → chunk-YNYSPYQ5-gU4-j5DO.mjs} +1 -1
  151. package/dist/{chunk-YS3AZT3J-w6Dw8reo.mjs → chunk-YS3AZT3J-CB0wWPLc.mjs} +2 -2
  152. package/dist/{chunk-YTNYSM6T-Cz_dxkBy.mjs → chunk-YTNYSM6T-DpkSVTln.mjs} +2 -2
  153. package/dist/chunk-YZCP3GAM-DRdMIQsB.mjs +2 -0
  154. package/dist/{chunk-Z6LRHWXI-BcgkPhhu.mjs → chunk-Z6LRHWXI-EsbeaQ3V.mjs} +2 -2
  155. package/dist/{chunk-Z7JVV2SM-BzR-yvwK.mjs → chunk-Z7JVV2SM-BtFBVQEW.mjs} +2 -2
  156. package/dist/chunk-ZZ45TVLE-DwKS4e_N.mjs +2 -0
  157. package/dist/classDiagram-6PBFFD2Q-BrpY9pLd.mjs +2 -0
  158. package/dist/classDiagram-v2-HSJHXN6E-DDV6mz7Y.mjs +2 -0
  159. package/dist/clear-5CZ5X4YR-CHSnzs8i.mjs +1 -0
  160. package/dist/cli.mjs +48 -48
  161. package/dist/clone-BD_JFVST.mjs +2 -0
  162. package/dist/{colors-BtKMHmBX.mjs → colors-8SzMRIVy.mjs} +2 -2
  163. package/dist/colors-CkPULM8m.mjs +1 -0
  164. package/dist/column-WLPMMSTS-DTBoovzp.mjs +1 -0
  165. package/dist/comm-5SLSESQG-DT3SY7zS.mjs +1 -0
  166. package/dist/constants-BkXmZuXM.mjs +2 -0
  167. package/dist/cose-bilkent-S5V4N54A-E5vxHQ63.mjs +2 -0
  168. package/dist/cp-XOYR4ABJ-Bs6Rpbb2.mjs +1 -0
  169. package/dist/{curl-47BFPSFW-CdMFK7aW.mjs → curl-47BFPSFW-xgS5bDTx.mjs} +2 -2
  170. package/dist/cut-OPC3VAGB-Bm1HBn07.mjs +1 -0
  171. package/dist/cytoscape.esm-BNCKY88j.mjs +332 -0
  172. package/dist/dagre-KV5264BT-Ci7CcQr4.mjs +5 -0
  173. package/dist/dagre-L3rg9n9q.mjs +2 -0
  174. package/dist/date-DD7FVA2V-Dv3os04S.mjs +1 -0
  175. package/dist/defaultLocale-BljHASC9.mjs +2 -0
  176. package/dist/diagram-5BDNPKRD-BM3C88Zx.mjs +11 -0
  177. package/dist/diagram-G4DWMVQ6-Dt1Kt-mj.mjs +25 -0
  178. package/dist/diagram-MMDJMWI5-DomPsk0L.mjs +44 -0
  179. package/dist/diagram-TYMM5635-eOfCqwhs.mjs +25 -0
  180. package/dist/diff-HJF2MPDN-Di-oK2tx.mjs +1 -0
  181. package/dist/dirname-LEMTZZFS-D-u8wJ0b.mjs +1 -0
  182. package/dist/dist-DZb_HoiN.mjs +2 -0
  183. package/dist/{dist-Cq3lpa-J.mjs → dist-DtdRtabl.mjs} +46 -46
  184. package/dist/dist-bundle-BnlRWriT.mjs +1 -0
  185. package/dist/{dist-bundle-B3l-HkEL.mjs → dist-bundle-D75dREX-.mjs} +2 -2
  186. package/dist/{dist-DB_zTxUW.mjs → dist-kEYk7308.mjs} +1 -1
  187. package/dist/du-WO2ENHXQ-CO_jR0w6.mjs +1 -0
  188. package/dist/echo-O45JWWI2-RBT2dq5Y.mjs +1 -0
  189. package/dist/env-5EPCWSXR-DSwwgRF5.mjs +1 -0
  190. package/dist/erDiagram-SMLLAGMA-CPcwhEue.mjs +86 -0
  191. package/dist/{esm-CEs3LWY3.mjs → esm-BLMtE3s6.mjs} +2 -2
  192. package/dist/{esm-k1YlZnpm.mjs → esm-BS2W3Uzl.mjs} +2 -2
  193. package/dist/{execAsync-0jii24p9.mjs → execAsync-B4xEJACY.mjs} +2 -2
  194. package/dist/{execAsync-Czqc-yAz.mjs → execAsync-Chx_LJuI.mjs} +2 -2
  195. package/dist/{execAsync-DgmLXmTx.mjs → execAsync-DunQtInX.mjs} +2 -2
  196. package/dist/expand-DTNXU4LQ-CtzV8vlq.mjs +1 -0
  197. package/dist/expansion-ENLSRCXJ-CNi8PTVy.mjs +1 -0
  198. package/dist/expr-5T3UU5KE-BOXtVHu2.mjs +1 -0
  199. package/dist/file-ZIGAJ4YS-Bt-1Wusv.mjs +1 -0
  200. package/dist/find-TPUOAIUQ-CJd25AiD.mjs +1 -0
  201. package/dist/flag-coverage-QT4N2Z44-DJYVWsW6.mjs +2 -0
  202. package/dist/flatten-CX5MwHL4.mjs +2 -0
  203. package/dist/flowDiagram-DWJPFMVM-WnIxEgSt.mjs +163 -0
  204. package/dist/fold-LDSORVYE-DZ2L21IZ.mjs +1 -0
  205. package/dist/ganttDiagram-T4ZO3ILL-BJEuIZ2X.mjs +293 -0
  206. package/dist/getMachineId-bsd-B7ue3N1o.mjs +2 -0
  207. package/dist/getMachineId-bsd-DYQqYqxN.mjs +2 -0
  208. package/dist/getMachineId-bsd-ucL-2FoT.mjs +2 -0
  209. package/dist/{getMachineId-darwin-C4PiguA-.mjs → getMachineId-darwin-BNCkZc-0.mjs} +2 -2
  210. package/dist/{getMachineId-darwin-COcA_c6l.mjs → getMachineId-darwin-CSTYV_Bd.mjs} +2 -2
  211. package/dist/{getMachineId-darwin-CywdnyvB.mjs → getMachineId-darwin-DWmBOUuk.mjs} +2 -2
  212. package/dist/getMachineId-linux-BaNp1ZEm.mjs +2 -0
  213. package/dist/getMachineId-linux-Bv6oOXxT.mjs +2 -0
  214. package/dist/getMachineId-linux-tTgUzx-Z.mjs +2 -0
  215. package/dist/getMachineId-unsupported-Kf9p6LJQ.mjs +2 -0
  216. package/dist/getMachineId-unsupported-fh_7WYkB.mjs +2 -0
  217. package/dist/getMachineId-unsupported-iDvWGFBk.mjs +2 -0
  218. package/dist/{getMachineId-win-B20yaCSB.mjs → getMachineId-win-Bo1_B38N.mjs} +2 -2
  219. package/dist/{getMachineId-win-BXWDfxLS.mjs → getMachineId-win-DHmdubaR.mjs} +2 -2
  220. package/dist/{getMachineId-win-BfSvDvM7.mjs → getMachineId-win-DQ2s9Z1n.mjs} +2 -2
  221. package/dist/{gh-detect-DW_FsIun.mjs → gh-detect-CNO7EkgF.mjs} +2 -2
  222. package/dist/{git-handle--dq7Gq14-C8bnaqHA.mjs → git-handle--dq7Gq14-BpH0pmv5.mjs} +2 -2
  223. package/dist/git-handle-BaZ9y3AC-CCCU9J5d.mjs +1 -0
  224. package/dist/gitGraph-7Q5UKJZL-ClGjTWw6.mjs +1 -0
  225. package/dist/gitGraphDiagram-UUTBAWPF-BqA8KMTw.mjs +107 -0
  226. package/dist/graphlib-BI4uS4Lx.mjs +2 -0
  227. package/dist/grep-3AIAIJVR-CzG01gPs.mjs +1 -0
  228. package/dist/gzip-AQXSGOVS-B_BV2fa3.mjs +1 -0
  229. package/dist/head-HT2B6D2J-CjBr6WQ1.mjs +1 -0
  230. package/dist/help-VVWX7SA5-C4HsVKec.mjs +1 -0
  231. package/dist/history-J4QRNGRO-1CYG7cs0.mjs +1 -0
  232. package/dist/hostname-BK6HG2DE-BLS00ZWn.mjs +1 -0
  233. package/dist/html-to-markdown-TFCECAGV-5Fopg2Q5.mjs +1 -0
  234. package/dist/index.mjs +1 -1
  235. package/dist/info-OMHHGYJF-11Qh6VJr.mjs +1 -0
  236. package/dist/infoDiagram-42DDH7IO-0lM1lRCH.mjs +3 -0
  237. package/dist/{init-OLCCUCLO.mjs → init-DAuset3t.mjs} +5 -5
  238. package/dist/init-L1KCVOHH.mjs +2 -0
  239. package/dist/init-TKxHSMWv.mjs +1 -0
  240. package/dist/{is-object-C-4FJ0rP.mjs → is-object-Cie0xXKD.mjs} +1 -1
  241. package/dist/isEmpty-CaTO-fHo.mjs +2 -0
  242. package/dist/ishikawaDiagram-UXIWVN3A-j-jlqjJX.mjs +71 -0
  243. package/dist/join-GG2LDHE5-C_A2RnwJ.mjs +1 -0
  244. package/dist/journeyDiagram-VCZTEJTY-BDX_OcrR.mjs +140 -0
  245. package/dist/jq-ODXZBPLY-hdWY1RUY.mjs +1 -0
  246. package/dist/{js-exec-M6UR76J5-Bo7dCQVP.mjs → js-exec-M6UR76J5-Cu6NIWHE.mjs} +2 -2
  247. package/dist/kanban-definition-6JOO6SKY-C5XJUD3U.mjs +90 -0
  248. package/dist/katex-DEJL_MaU.mjs +258 -0
  249. package/dist/{lib-Dl2j2VNl.mjs → lib-BbNAtG4h.mjs} +2 -2
  250. package/dist/lib-CItGM3rN.mjs +195 -0
  251. package/dist/{libesm-D3nlnq5U.mjs → libesm-Ob3yvbRV.mjs} +1 -1
  252. package/dist/line-C6RZPh4T.mjs +2 -0
  253. package/dist/linear-gA98NGf7.mjs +2 -0
  254. package/dist/ln-4TRFBYAT-CMm4PFgi.mjs +1 -0
  255. package/dist/loader-B0LEWbj7.mjs +1 -0
  256. package/dist/{loader-BEE6_Oez.mjs → loader-CaLEJbcQ.mjs} +2 -2
  257. package/dist/ls-KSXFZCWH-Beyjypib.mjs +1 -0
  258. package/dist/{lzma-DMoteSiK.mjs → lzma-D4yjI8KW.mjs} +1 -1
  259. package/dist/{mcp-migrate-event-BF8ILHwp.mjs → mcp-migrate-event-D0NrGjvc.mjs} +1 -1
  260. package/dist/md5sum-INMIK4DX-C2RH1Ljb.mjs +1 -0
  261. package/dist/mermaid-parser.core-Cx4njenA.mjs +4 -0
  262. package/dist/mermaid.core-CcmmzbTt.mjs +16 -0
  263. package/dist/mindmap-definition-QFDTVHPH-WLdthwDy.mjs +97 -0
  264. package/dist/mkdir-TDEMSB6C-BeLs_C7x.mjs +1 -0
  265. package/dist/mv-Z6MORUFL-BDAoI0Wd.mjs +1 -0
  266. package/dist/nl-U5YJDM32-SP99R3HJ.mjs +1 -0
  267. package/dist/od-VJEF2UR5-BR0Ho1t5.mjs +1 -0
  268. package/dist/{open-browser-C6LU_1mt.mjs → open-browser-DHTbHSqx.mjs} +1 -1
  269. package/dist/ordinal-BCuCMCHk.mjs +2 -0
  270. package/dist/packet-4T2RLAQJ-jzF54bgp.mjs +1 -0
  271. package/dist/paste-7N6AFSDS-Bz3kd4hU.mjs +1 -0
  272. package/dist/path-C9DYqGo_.mjs +2 -0
  273. package/dist/pie-ZZUOXDRM-x8WFG16Q.mjs +1 -0
  274. package/dist/pieDiagram-DEJITSTG-7oeIAT-R.mjs +31 -0
  275. package/dist/preview-CWoKWF6e.mjs +1 -0
  276. package/dist/{preview-BBVzMIZ1.mjs → preview-b2rfnpjL.mjs} +2 -2
  277. package/dist/printf-CX64KX2P-GrZNCK4M.mjs +1 -0
  278. package/dist/public/assets/{ActivityModeContent-Zo-ELIQV.js → ActivityModeContent-BWmb9zCZ.js} +1 -1
  279. package/dist/public/assets/{DocumentContext-k2DjymG3.js → DocumentContext-9Sn6Kq-o.js} +1 -1
  280. package/dist/public/assets/{GraphPanel-D8NK8BUZ.js → GraphPanel-PYMXWVsg.js} +1 -1
  281. package/dist/public/assets/{SettingsDialogBody-C-vY1kWI.js → SettingsDialogBody-YOvgrn38.js} +1 -1
  282. package/dist/public/assets/{SourceEditor-CleGALgO.js → SourceEditor-D1zhJS8f.js} +1 -1
  283. package/dist/public/assets/{config-validation-events-2oi_K0gL.js → config-validation-events-BUyp1R_U.js} +1 -1
  284. package/dist/public/assets/{index-OM_9JG_q.js → index-BxMKAgUQ.js} +4 -4
  285. package/dist/public/assets/{keyboard-shortcuts-B_OdnEM8.js → keyboard-shortcuts-CNJfczoS.js} +1 -1
  286. package/dist/public/assets/{prop-types-B5unaqIG.js → prop-types-COA7UVY9.js} +153 -153
  287. package/dist/public/assets/{target-navigation-intent-B9alFb27.js → target-navigation-intent-Cp-mOxXo.js} +1 -1
  288. package/dist/public/assets/{typing-burst-detector-B34EwapS.js → typing-burst-detector-DWg86xJw.js} +1 -1
  289. package/dist/public/index.html +7 -7
  290. package/dist/pwd-D4OZ7N27-DDRhZsId.mjs +1 -0
  291. package/dist/{python3-AUFTPCU6-1PPUn2I7.mjs → python3-AUFTPCU6-DmPp1QHj.mjs} +2 -2
  292. package/dist/quadrantDiagram-34T5L4WZ-DWVBhb1E.mjs +8 -0
  293. package/dist/radar-PYXPWWZC-C-wbHKao.mjs +1 -0
  294. package/dist/readlink-MI4GCHJF-mNeJ3km7.mjs +1 -0
  295. package/dist/reduce-V0ODtSr4.mjs +2 -0
  296. package/dist/{repair-launch-json-DgZxaWnG.mjs → repair-launch-json-Bisx03pf.mjs} +2 -2
  297. package/dist/{repair-mcp-configs-vSrhkJ_f.mjs → repair-mcp-configs-3etDglgV.mjs} +2 -2
  298. package/dist/{repair-skills-CTGljUDo.mjs → repair-skills-BCUJOnkF.mjs} +2 -2
  299. package/dist/repair-skills-BOGjGitt.mjs +1 -0
  300. package/dist/requirementDiagram-MS252O5E-Bneel37I.mjs +85 -0
  301. package/dist/rev-XOSYPP45-KAKdorsx.mjs +1 -0
  302. package/dist/rg-FOQSCCX3-BWOdKDEd.mjs +1 -0
  303. package/dist/rm-RTZG23RL-D4Xj3X_m.mjs +1 -0
  304. package/dist/rmdir-XTQXT7RK-Bx-u3U5l.mjs +1 -0
  305. package/dist/rough.cjs-C-63phNL.mjs +2 -0
  306. package/dist/sankeyDiagram-XADWPNL6-4f2f9-uf.mjs +11 -0
  307. package/dist/sed-VFTTATXJ-DmL_7Y-J.mjs +1 -0
  308. package/dist/seq-RN5ZUASB-DeaNEJEM.mjs +1 -0
  309. package/dist/sequenceDiagram-FGHM5R23-B1K4VtLp.mjs +158 -0
  310. package/dist/{server-lock-BpjJj3OD-D_v2bsKE.mjs → server-lock-BpjJj3OD-CUhVvie4.mjs} +8 -8
  311. package/dist/server-lock-CyhBidkz-D41BTXw5.mjs +1 -0
  312. package/dist/sha1sum-VJPNLNU6-DYUNX0rt.mjs +1 -0
  313. package/dist/sha256sum-PI32XWXY-BwDMGEnF.mjs +1 -0
  314. package/dist/sleep-VZFPZFWA-D3IG7CwN.mjs +1 -0
  315. package/dist/sort-DCNRDA7U-BfL8J8kf.mjs +1 -0
  316. package/dist/split-SITCSYCZ-Q5NIWguo.mjs +1 -0
  317. package/dist/sqlite3-56UMWEY3-B4_LAdBq.mjs +1 -0
  318. package/dist/src-BkCVz_TJ.mjs +2 -0
  319. package/dist/{src-Ca1ztIww.mjs → src-CmFWAq4o.mjs} +2 -2
  320. package/dist/start-DiBErYZV.mjs +1 -0
  321. package/dist/{start-C4nqviIE.mjs → start-MXkiMrR1.mjs} +2 -2
  322. package/dist/stat-BT5A227F-CYFqsI8W.mjs +1 -0
  323. package/dist/stateDiagram-FHFEXIEX-BREbMXiC.mjs +2 -0
  324. package/dist/stateDiagram-v2-QKLJ7IA2-DQeH2s3K.mjs +2 -0
  325. package/dist/strings-7PLOGTPD-BLW4mXRs.mjs +1 -0
  326. package/dist/tac-SJGXQ4T2-BGR2Dq7O.mjs +1 -0
  327. package/dist/tail-S5ULNTJU-BOBd42y5.mjs +1 -0
  328. package/dist/tar-ANUBEFJY-GYQ0YvKO.mjs +1 -0
  329. package/dist/tee-O7VXZDCO-Bg8MXC_K.mjs +1 -0
  330. package/dist/time-DEUO3QV2-CxVP9vXG.mjs +1 -0
  331. package/dist/timeline-definition-GMOUNBTQ-Bd7XEw7o.mjs +121 -0
  332. package/dist/timeout-VRKMCG72-CVG2Q30a.mjs +1 -0
  333. package/dist/touch-DX2IJOQ4-DmEja_Fu.mjs +1 -0
  334. package/dist/tr-2HXZRDSW-DWcyuCoi.mjs +1 -0
  335. package/dist/tree-LYXBS7DC-CFaeUWGI.mjs +1 -0
  336. package/dist/treeView-SZITEDCU-DXyZ3zQc.mjs +1 -0
  337. package/dist/treemap-W4RFUUIX-CZRYHpYU.mjs +1 -0
  338. package/dist/true-WHJNXCHG-CJH22fVg.mjs +1 -0
  339. package/dist/unexpand-RGTMIGZM-Uj1QzdPV.mjs +1 -0
  340. package/dist/uniq-SUNANL47-MRCnRrGo.mjs +1 -0
  341. package/dist/vennDiagram-DHZGUBPP-Bk-INjRY.mjs +35 -0
  342. package/dist/wardley-RL74JXVD-UKzwcBOa.mjs +1 -0
  343. package/dist/wardleyDiagram-NUSXRM2D-DOD6wQla.mjs +21 -0
  344. package/dist/wc-TQB3VNOX-JPk1lni-.mjs +1 -0
  345. package/dist/which-XZHEH76L-Cl63MOrV.mjs +1 -0
  346. package/dist/whoami-DGKU3D2X-CB3itqHE.mjs +1 -0
  347. package/dist/wrapper-BZO_sIci.mjs +7 -0
  348. package/dist/{write-project-skill-Q0CHx78L.mjs → write-project-skill-BOmI_IcM.mjs} +2 -2
  349. package/dist/xan-BXDXYEIB-ZPqGVO90.mjs +1 -0
  350. package/dist/xan-view-ECQUO7AJ-C-WHEJiv.mjs +1 -0
  351. package/dist/xargs-I6EZUCYF-BvcSF5Y7.mjs +1 -0
  352. package/dist/xychartDiagram-5P7HB3ND-B4AGYFQs.mjs +8 -0
  353. package/dist/yazl-CQSNnbvt.mjs +1 -0
  354. package/dist/{yazl-CB0sfSbo.mjs → yazl-Docqgl6q.mjs} +2 -2
  355. package/dist/yq-MJMAR36V-_D_zdU3z.mjs +1 -0
  356. package/package.json +1 -1
  357. package/dist/alias-JE7RI5QX-oTDRHt3W.mjs +0 -1
  358. package/dist/awk2-POPGKRAI-BZ_7e8H1.mjs +0 -1
  359. package/dist/base64-4YMZCVJ5-BhIrz6He.mjs +0 -1
  360. package/dist/basename-AA2KJYZQ-C5R0pcfV.mjs +0 -1
  361. package/dist/bash-IJWYRKFO-DywpGlyx.mjs +0 -1
  362. package/dist/build-CZpdADQB.mjs +0 -1
  363. package/dist/cat-RDUMLXKC-BNwer8pK.mjs +0 -1
  364. package/dist/chmod-SYMGL4JA-BN-B1xmG.mjs +0 -1
  365. package/dist/clear-5CZ5X4YR-B6kVcfOw.mjs +0 -1
  366. package/dist/colors-gw_5YWUu.mjs +0 -1
  367. package/dist/column-WLPMMSTS-CEev_e2R.mjs +0 -1
  368. package/dist/comm-5SLSESQG-BXsiD7To.mjs +0 -1
  369. package/dist/constants-szne1IVT.mjs +0 -2
  370. package/dist/cp-XOYR4ABJ-Dy5aHk72.mjs +0 -1
  371. package/dist/cut-OPC3VAGB-GohHdbJ4.mjs +0 -1
  372. package/dist/date-DD7FVA2V-RM_vdvCh.mjs +0 -1
  373. package/dist/diff-HJF2MPDN-DTuHZGVW.mjs +0 -1
  374. package/dist/dirname-LEMTZZFS-C6aDcxLl.mjs +0 -1
  375. package/dist/dist-bundle-XlngXUNr.mjs +0 -1
  376. package/dist/du-WO2ENHXQ-Da1HuQkH.mjs +0 -1
  377. package/dist/echo-O45JWWI2-Cr9jHdYm.mjs +0 -1
  378. package/dist/env-5EPCWSXR-6RSqo9Bn.mjs +0 -1
  379. package/dist/expand-DTNXU4LQ-D4dbwBrD.mjs +0 -1
  380. package/dist/expansion-ENLSRCXJ-Bv6RV19y.mjs +0 -1
  381. package/dist/expr-5T3UU5KE-D7ekHiOy.mjs +0 -1
  382. package/dist/file-ZIGAJ4YS-DzKHvjCj.mjs +0 -1
  383. package/dist/find-TPUOAIUQ-DuBwOGWI.mjs +0 -1
  384. package/dist/flag-coverage-QT4N2Z44-DmAL_7h5.mjs +0 -2
  385. package/dist/fold-LDSORVYE-BQyKAmCr.mjs +0 -1
  386. package/dist/getMachineId-bsd-CzP05Ffc.mjs +0 -2
  387. package/dist/getMachineId-bsd-D0erQsHH.mjs +0 -2
  388. package/dist/getMachineId-bsd-Dp2q7huT.mjs +0 -2
  389. package/dist/getMachineId-linux-BRPjBsHg.mjs +0 -2
  390. package/dist/getMachineId-linux-CQZJR55S.mjs +0 -2
  391. package/dist/getMachineId-linux-DcN5tfI_.mjs +0 -2
  392. package/dist/getMachineId-unsupported-BokXsjFr.mjs +0 -2
  393. package/dist/getMachineId-unsupported-DZAxq-oW.mjs +0 -2
  394. package/dist/getMachineId-unsupported-GPbM_evk.mjs +0 -2
  395. package/dist/git-handle-BaZ9y3AC-B05Md-6F.mjs +0 -1
  396. package/dist/grep-3AIAIJVR-DhLMPK9o.mjs +0 -1
  397. package/dist/gzip-AQXSGOVS-kzAFjO_Y.mjs +0 -1
  398. package/dist/head-HT2B6D2J-BR-dv_ar.mjs +0 -1
  399. package/dist/help-VVWX7SA5-jdvqGfQj.mjs +0 -1
  400. package/dist/history-J4QRNGRO-jb5B-tWQ.mjs +0 -1
  401. package/dist/hostname-BK6HG2DE-CVVAGatl.mjs +0 -1
  402. package/dist/html-to-markdown-TFCECAGV-B5yiu2Qr.mjs +0 -1
  403. package/dist/init-Cwlj7SOE.mjs +0 -1
  404. package/dist/join-GG2LDHE5-BLgXAHZ_.mjs +0 -1
  405. package/dist/jq-ODXZBPLY-JpgGenzN.mjs +0 -1
  406. package/dist/ln-4TRFBYAT-C7xn5Rqr.mjs +0 -1
  407. package/dist/loader-CQXANk9h.mjs +0 -1
  408. package/dist/ls-KSXFZCWH-BFVVAoBi.mjs +0 -1
  409. package/dist/md5sum-INMIK4DX-0GZIz1Ci.mjs +0 -1
  410. package/dist/mkdir-TDEMSB6C-DTyG__G-.mjs +0 -1
  411. package/dist/mv-Z6MORUFL-CmjBk72Q.mjs +0 -1
  412. package/dist/nl-U5YJDM32-5XaxKjVN.mjs +0 -1
  413. package/dist/od-VJEF2UR5-BYZOEzSd.mjs +0 -1
  414. package/dist/paste-7N6AFSDS-BnDgUhuq.mjs +0 -1
  415. package/dist/preview-as-l5GvS.mjs +0 -1
  416. package/dist/printf-CX64KX2P-0abCeF-D.mjs +0 -1
  417. package/dist/pwd-D4OZ7N27-AYS4A9o1.mjs +0 -1
  418. package/dist/readlink-MI4GCHJF-BvzND_DT.mjs +0 -1
  419. package/dist/repair-skills-DYWZx8WB.mjs +0 -1
  420. package/dist/rev-XOSYPP45-Bqdhxuez.mjs +0 -1
  421. package/dist/rg-FOQSCCX3-CrVzsut-.mjs +0 -1
  422. package/dist/rm-RTZG23RL-DVQCHLUL.mjs +0 -1
  423. package/dist/rmdir-XTQXT7RK-DrUUkxCF.mjs +0 -1
  424. package/dist/sed-VFTTATXJ-QHemmbCP.mjs +0 -1
  425. package/dist/seq-RN5ZUASB-BBSGpJq5.mjs +0 -1
  426. package/dist/server-lock-CyhBidkz-CEUtTbEY.mjs +0 -1
  427. package/dist/sha1sum-VJPNLNU6-D6-7B21n.mjs +0 -1
  428. package/dist/sha256sum-PI32XWXY-BYVtIJOS.mjs +0 -1
  429. package/dist/sleep-VZFPZFWA-C-x_VGtG.mjs +0 -1
  430. package/dist/sort-DCNRDA7U-BTlvuG7X.mjs +0 -1
  431. package/dist/split-SITCSYCZ-BmGbaiMe.mjs +0 -1
  432. package/dist/sqlite3-56UMWEY3-Cjvsy5Oo.mjs +0 -1
  433. package/dist/start-DGxPYzt3.mjs +0 -1
  434. package/dist/stat-BT5A227F-BjNsVAze.mjs +0 -1
  435. package/dist/strings-7PLOGTPD-B6_kjNM-.mjs +0 -1
  436. package/dist/tac-SJGXQ4T2-BEQ9sZmi.mjs +0 -1
  437. package/dist/tail-S5ULNTJU-DSe2aEO8.mjs +0 -1
  438. package/dist/tar-ANUBEFJY-HbwMpE1g.mjs +0 -1
  439. package/dist/tee-O7VXZDCO-BD6QXg_b.mjs +0 -1
  440. package/dist/time-DEUO3QV2-CRnH51wk.mjs +0 -1
  441. package/dist/timeout-VRKMCG72-D_oS0IDg.mjs +0 -1
  442. package/dist/touch-DX2IJOQ4-4yR1M9Nd.mjs +0 -1
  443. package/dist/tr-2HXZRDSW-Ca-NmLk7.mjs +0 -1
  444. package/dist/tree-LYXBS7DC-CR3kfmh6.mjs +0 -1
  445. package/dist/true-WHJNXCHG-x85l8vsW.mjs +0 -1
  446. package/dist/unexpand-RGTMIGZM-D-1EwjbB.mjs +0 -1
  447. package/dist/uniq-SUNANL47-DtBj3lmA.mjs +0 -1
  448. package/dist/wc-TQB3VNOX-Qw6WjSl1.mjs +0 -1
  449. package/dist/which-XZHEH76L-B-Xo178d.mjs +0 -1
  450. package/dist/whoami-DGKU3D2X-_Mgzu6ty.mjs +0 -1
  451. package/dist/xan-BXDXYEIB-qijhj_cA.mjs +0 -1
  452. package/dist/xan-view-ECQUO7AJ-BfZejrY6.mjs +0 -1
  453. package/dist/xargs-I6EZUCYF-aS184J1w.mjs +0 -1
  454. package/dist/yazl-Dqnhfxk7.mjs +0 -1
  455. package/dist/yq-MJMAR36V-Cgql6fKu.mjs +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./telemetry-impl-l-VsaBiG.js","./chunk-CFjPhJqf.js","./preload-helper-2ej06EnG.js","./trace-api-CiCjX4Sz.js","./propagation-api-3kmMXRwS.js","./ConsentDialogBody-Bd3NDbzN.js","./compiler-runtime-Cs91PcD2.js","./button-B_6r-4tt.js","./checkbox-qnHi6HI6.js","./dialog-uNuZn7gJ.js","./collapsible-DC_eQWsn.js","./textarea-CaVb3JmO.js","./dist-q8_YTqei.js","./dist-D6g7y0kn.js","./project-paths-CsGHlmFh.js","./McpConsentDialogBody-pUjQ4lzI.js","./label-DLO_wxY0.js","./mcp-consent-store-CijO54Jd.js","./ActivityPanelDiffView-DgtknSgX.js","./ActivityPanelDiffView-legcy4jI.css","./GraphPanel-D8NK8BUZ.js","./prop-types-B5unaqIG.js","./w3c-keyname-B5t0fahT.js","./toggle-group-sKkFFfhD.js","./panel-DDVLqW48.js","./min-BiwsSkbB.js","./src-L3wpjxBL.js","./colors-D6LRuSY-.js","./ordinal-BLFwWMHf.js","./init-8GNx5phc.js","./isObjectLike-DFnkciUU.js","./now-D_m-3Vjm.js","./isSymbol-D0ur5y-p.js","./target-navigation-intent-B9alFb27.js","./ActivityModeContent-Zo-ELIQV.js","./DocumentContext-k2DjymG3.js","./dist-BrsSsfiw.js","./dist-Du-s1q8P.js","./dist-DsbVHLNy.js","./dist-BYGzJeLM.js","./dist-Cq1LYbUj.js","./stex-CzCFWeB9.js","./DocumentContext-B0sQn39F.css","./agent-presence-B_GJzt87.js","./SettingsDialogBody-C-vY1kWI.js","./config-validation-events-2oi_K0gL.js","./keyboard-shortcuts-B_OdnEM8.js","./SourceEditor-CleGALgO.js","./typing-burst-detector-B34EwapS.js"])))=>i.map(i=>d[i]);
2
- import{o as e,t}from"./chunk-CFjPhJqf.js";import{t as n}from"./preload-helper-2ej06EnG.js";import{a as r,i,n as a,o,r as s,t as c}from"./compiler-runtime-Cs91PcD2.js";import{$ as l,$n as u,$t as d,A as f,An as p,At as m,B as h,Bn as g,Bt as _,Cr as v,Ct as y,Dn as b,En as x,Er as S,Et as C,F as w,Fn as T,Ft as E,G as D,Gn as O,Gt as k,H as A,Hn as j,Ht as M,I as N,In as P,It as F,Jn as I,Jt as L,K as R,Kn as z,Kt as B,L as V,Ln as H,Lt as U,Mn as ee,Mt as te,Nn as W,Nt as ne,O as re,On as G,Pn as ie,Pt as K,Qn as q,Qt as ae,R as oe,Rn as se,Rt as ce,Sr as le,St as ue,Tn as de,Tr as fe,Tt as pe,U as me,Un as he,Ut as ge,V as _e,Vn as ve,Vt as ye,W as be,Wn as xe,Wt as Se,Xn as Ce,Xt as we,Yn as Te,Yt as Ee,Z as De,Zn as Oe,Zt as ke,_r as Ae,_t as je,a as Me,an as Ne,ar as Pe,at as Fe,b as Ie,bt as Le,c as Re,cn as ze,cr as Be,ct as Ve,d as He,dr as Ue,dt as We,en as Ge,er as Ke,et as qe,f as Je,fn as Ye,ft as Xe,g as Ze,gr as Qe,gt as $e,h as et,hr as tt,ht as nt,i as rt,in as it,ir as at,it as J,j as ot,jn as st,jt as ct,k as lt,kn as ut,kt as dt,l as ft,ln as pt,lr as mt,lt as ht,m as gt,mr as _t,mt as vt,n as yt,nn as bt,nr as xt,nt as St,o as Ct,on as wt,or as Tt,ot as Et,p as Dt,pr as Ot,pt as kt,qn as At,qt as jt,r as Mt,rn as Nt,rr as Pt,rt as Ft,s as It,sn as Lt,sr as Rt,st as zt,t as Bt,tn as Vt,tr as Ht,tt as Ut,u as Wt,un as Gt,ur as Kt,ut as qt,v as Jt,vt as Yt,wn as Xt,wr as Zt,wt as Qt,xr as $t,xt as en,y as tn,yr as nn,yt as rn,z as an,zt as on}from"./DocumentContext-k2DjymG3.js";import{A as sn,C as cn,D as ln,E as un,O as dn,S as fn,T as pn,_ as mn,a as hn,b as gn,c as _n,d as vn,f as yn,g as bn,h as xn,i as Sn,k as Cn,l as wn,m as Tn,n as En,o as Dn,p as On,r as kn,s as An,t as jn,u as Mn,v as Nn,w as Pn,x as Fn,y as In}from"./panel-DDVLqW48.js";import{$ as Ln,$n as Rn,$r as zn,A as Bn,Ai as Vn,An as Hn,Ar as Un,At as Wn,B as Gn,Br as Kn,Bt as qn,C as Jn,Ci as Yn,D as Xn,Di as Zn,Dn as Qn,Dr as $n,E as er,Et as tr,F as nr,Fi as rr,Fn as ir,Ft as ar,Gn as or,Hr as sr,I as cr,J as lr,Jn as ur,K as dr,Kn as fr,L as pr,Li as mr,Ln as hr,M as gr,Mn as _r,Mt as vr,N as yr,Nn as br,Nt as xr,O as Sr,Oi as Cr,Or as wr,P as Tr,Pn as Er,Q as Dr,Qn as Or,Qr as kr,R as Ar,Ri as jr,S as Mr,St as Nr,T as Pr,Tt as Fr,Un as Ir,Wn as Lr,X as Rr,Xi as zr,Xr as Br,Xt as Vr,Y as Hr,Yn as Ur,Yr as Wr,Z as Gr,_ as Kr,a as qr,aa as Jr,an as Yr,ar as Xr,c as Zr,ci as Qr,cr as $r,dr as ei,ei as ti,er as ni,et as ri,g as ii,hi as ai,hr as oi,i as si,ia as ci,ii as li,it as ui,j as di,jt as fi,k as pi,kt as mi,l as hi,li as gi,lr as _i,m as vi,mi as yi,mn as bi,n as xi,na as Y,ni as Si,nr as Ci,o as wi,oa as Ti,oi as Ei,or as Di,ot as Oi,pn as ki,pr as Ai,q as ji,qn as Mi,qr as Ni,ra as Pi,rt as Fi,s as Ii,sa as Li,sr as Ri,ti as zi,tr as Bi,tt as Vi,un as Hi,ut as Ui,v as Wi,w as Gi,wi as Ki,wr as qi,x as Ji,xn as Yi,z as Xi,zi as Zi,zt as Qi}from"./prop-types-B5unaqIG.js";import{C as $i,S as ea,d as ta,g as na,l as ra,m as ia,o as aa,p as oa,t as sa,w as ca,x as la}from"./button-B_6r-4tt.js";import{a as ua,c as da,d as fa,f as pa,i as ma,l as ha,m as ga,n as _a,o as va,p as ya,r as ba,s as xa,t as Sa,u as Ca}from"./agent-presence-B_GJzt87.js";import{$ as wa,A as Ta,At as Ea,B as Da,Bt as Oa,C as ka,Ct as Aa,D as ja,Dt as Ma,E as Na,Et as Pa,F as Fa,Ft as Ia,G as La,Gt as Ra,H as za,Ht as Ba,I as Va,It as Ha,J as Ua,Jt as Wa,K as Ga,Kt as Ka,L as qa,Lt as Ja,M as Ya,Mt as Xa,N as Za,Nt as Qa,O as $a,Ot as eo,P as to,Pt as no,Q as ro,Qt as io,R as ao,Rt as oo,S as so,St as co,T as lo,Tt as uo,U as fo,Ut as po,V as mo,Vt as ho,W as go,Wt as _o,X as vo,Xt as yo,Y as bo,Yt as xo,Z as So,Zt as Co,_t as wo,at as To,b as Eo,bt as Do,ct as Oo,dt as ko,en as Ao,et as jo,ft as Mo,gt as No,ht as Po,it as Fo,j as Io,jt as Lo,k as Ro,kt as zo,lt as Bo,m as Vo,mt as Ho,nn as Uo,nt as Wo,o as Go,ot as Ko,p as qo,pt as Jo,q as Yo,qt as Xo,r as Zo,rn as Qo,rt as $o,st as es,t as ts,tn as ns,tt as rs,u as is,vt as as,w as os,wt as ss,x as cs,xt as ls,y as us,yt as ds,z as fs,zt as ps}from"./config-validation-events-2oi_K0gL.js";import{i as ms,n as hs,r as gs,t as _s}from"./toggle-group-sKkFFfhD.js";import{a as vs,b as ys,c as bs,i as xs,n as Ss,o as Cs,s as ws,t as Ts,v as Es,x as Ds,y as X}from"./dialog-uNuZn7gJ.js";import{a as Os,i as ks,n as As,r as js,t as Ms}from"./collapsible-DC_eQWsn.js";import{t as Ns}from"./checkbox-qnHi6HI6.js";import{t as Ps}from"./label-DLO_wxY0.js";import{n as Fs,r as Is}from"./textarea-CaVb3JmO.js";import{i as Ls,n as Rs,r as zs}from"./project-paths-CsGHlmFh.js";import{n as Bs,t as Vs}from"./mcp-consent-store-CijO54Jd.js";import{c as Hs,i as Us,l as Ws,o as Gs}from"./keyboard-shortcuts-B_OdnEM8.js";import{$ as Ks,At as qs,Ct as Js,Dt as Ys,Ft as Xs,I as Zs,It as Qs,J as $s,Mt as ec,Ot as tc,Pt as nc,Q as rc,Tt as ic,X as ac,Z as oc,at as sc,bt as cc,c as lc,jt as uc,k as dc,w as fc}from"./dist-Du-s1q8P.js";import{n as pc}from"./dist-DsbVHLNy.js";import{c as mc,d as hc,f as gc,h as _c,i as vc,l as yc,n as bc,o as xc,r as Sc,s as Cc,t as wc,u as Tc}from"./typing-burst-detector-B34EwapS.js";import{t as Ec}from"./target-navigation-intent-B9alFb27.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function Dc(){({BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.11.0`})?.VITE_OTEL_ENABLED===`true`&&n(()=>import(`./telemetry-impl-l-VsaBiG.js`).then(e=>e.install()),__vite__mapDeps([0,1,2,3,4]),import.meta.url)}function Oc(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{bn(e,()=>t.signal,()=>n=!0)},u=In(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?Nn:mn;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Ac:kc,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:kc(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function kc(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ac(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var jc=class extends yn{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Mc(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=On({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),xn.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Mc(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Nc=class extends sn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new jc({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Pc(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Pc(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Pc(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Pc(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){xn.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>cn(t,e))}findAll(e={}){return this.getAll().filter(t=>cn(e,t))}notify(e){xn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return xn.batch(()=>Promise.all(e.map(e=>e.continue().catch(pn))))}};function Pc(e){return e.options.scope?.id}var Fc=class extends sn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??fn(r,t),a=this.get(i);return a||(a=new vn({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){xn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Pn(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Pn(e,t)):t}notify(e){xn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){xn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){xn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ic=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Fc,this.#t=e.mutationCache||new Nc,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Cn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Tn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ln(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=gn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return xn.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;xn.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return xn.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=xn.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(pn).catch(pn)}invalidateQueries(e,t={}){return xn.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=xn.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(pn)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(pn)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(ln(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(pn).catch(pn)}fetchInfiniteQuery(e){return e.behavior=Oc(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(pn).catch(pn)}ensureInfiniteQueryData(e){return e.behavior=Oc(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Tn.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Fn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{un(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Fn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{un(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=fn(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===dn&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Lc=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Rc=t(((e,t)=>{t.exports=Lc()})),zc=t((e=>{var t=Rc(),n=r(),i=ca();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var N=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},L=[],R=-1;function z(e){return{current:e}}function B(e){0>R||(e.current=L[R],L[R]=null,R--)}function V(e,t){R++,L[R]=e.current,e.current=t}var H=z(null),U=z(null),ee=z(null),te=z(null);function W(e,t){switch(V(ee,t),V(U,e),V(H,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}B(H),V(H,e)}function ne(){B(H),B(U),B(ee)}function re(e){e.memoizedState!==null&&V(te,e);var t=H.current,n=Hd(t,e.type);t!==n&&(V(U,e),V(H,n))}function G(e){U.current===e&&(B(H),B(U)),te.current===e&&(B(te),Qf._currentValue=I)}var ie,K;function q(e){if(ie===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ie=t&&t[1]||``,K=-1<e.stack.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./telemetry-impl-l-VsaBiG.js","./chunk-CFjPhJqf.js","./preload-helper-2ej06EnG.js","./trace-api-CiCjX4Sz.js","./propagation-api-3kmMXRwS.js","./ConsentDialogBody-Bd3NDbzN.js","./compiler-runtime-Cs91PcD2.js","./button-B_6r-4tt.js","./checkbox-qnHi6HI6.js","./dialog-uNuZn7gJ.js","./collapsible-DC_eQWsn.js","./textarea-CaVb3JmO.js","./dist-q8_YTqei.js","./dist-D6g7y0kn.js","./project-paths-CsGHlmFh.js","./McpConsentDialogBody-pUjQ4lzI.js","./label-DLO_wxY0.js","./mcp-consent-store-CijO54Jd.js","./ActivityPanelDiffView-DgtknSgX.js","./ActivityPanelDiffView-legcy4jI.css","./GraphPanel-PYMXWVsg.js","./prop-types-COA7UVY9.js","./w3c-keyname-B5t0fahT.js","./toggle-group-sKkFFfhD.js","./panel-DDVLqW48.js","./min-BiwsSkbB.js","./src-L3wpjxBL.js","./colors-D6LRuSY-.js","./ordinal-BLFwWMHf.js","./init-8GNx5phc.js","./isObjectLike-DFnkciUU.js","./now-D_m-3Vjm.js","./isSymbol-D0ur5y-p.js","./target-navigation-intent-Cp-mOxXo.js","./ActivityModeContent-BWmb9zCZ.js","./DocumentContext-9Sn6Kq-o.js","./dist-BrsSsfiw.js","./dist-Du-s1q8P.js","./dist-DsbVHLNy.js","./dist-BYGzJeLM.js","./dist-Cq1LYbUj.js","./stex-CzCFWeB9.js","./DocumentContext-B0sQn39F.css","./agent-presence-B_GJzt87.js","./SettingsDialogBody-YOvgrn38.js","./config-validation-events-BUyp1R_U.js","./keyboard-shortcuts-CNJfczoS.js","./SourceEditor-D1zhJS8f.js","./typing-burst-detector-DWg86xJw.js"])))=>i.map(i=>d[i]);
2
+ import{o as e,t}from"./chunk-CFjPhJqf.js";import{t as n}from"./preload-helper-2ej06EnG.js";import{a as r,i,n as a,o,r as s,t as c}from"./compiler-runtime-Cs91PcD2.js";import{$ as l,$n as u,$t as d,A as f,An as p,At as m,B as h,Bn as g,Bt as _,Cr as v,Ct as y,Dn as b,En as x,Er as S,Et as C,F as w,Fn as T,Ft as E,G as D,Gn as O,Gt as k,H as A,Hn as j,Ht as M,I as N,In as P,It as F,Jn as I,Jt as L,K as R,Kn as z,Kt as B,L as V,Ln as H,Lt as U,Mn as ee,Mt as te,Nn as W,Nt as ne,O as re,On as G,Pn as ie,Pt as K,Qn as q,Qt as ae,R as oe,Rn as se,Rt as ce,Sr as le,St as ue,Tn as de,Tr as fe,Tt as pe,U as me,Un as he,Ut as ge,V as _e,Vn as ve,Vt as ye,W as be,Wn as xe,Wt as Se,Xn as Ce,Xt as we,Yn as Te,Yt as Ee,Z as De,Zn as Oe,Zt as ke,_r as Ae,_t as je,a as Me,an as Ne,ar as Pe,at as Fe,b as Ie,bt as Le,c as Re,cn as ze,cr as Be,ct as Ve,d as He,dr as Ue,dt as We,en as Ge,er as Ke,et as qe,f as Je,fn as Ye,ft as Xe,g as Ze,gr as Qe,gt as $e,h as et,hr as tt,ht as nt,i as rt,in as it,ir as at,it as J,j as ot,jn as st,jt as ct,k as lt,kn as ut,kt as dt,l as ft,ln as pt,lr as mt,lt as ht,m as gt,mr as _t,mt as vt,n as yt,nn as bt,nr as xt,nt as St,o as Ct,on as wt,or as Tt,ot as Et,p as Dt,pr as Ot,pt as kt,qn as At,qt as jt,r as Mt,rn as Nt,rr as Pt,rt as Ft,s as It,sn as Lt,sr as Rt,st as zt,t as Bt,tn as Vt,tr as Ht,tt as Ut,u as Wt,un as Gt,ur as Kt,ut as qt,v as Jt,vt as Yt,wn as Xt,wr as Zt,wt as Qt,xr as $t,xt as en,y as tn,yr as nn,yt as rn,z as an,zt as on}from"./DocumentContext-9Sn6Kq-o.js";import{A as sn,C as cn,D as ln,E as un,O as dn,S as fn,T as pn,_ as mn,a as hn,b as gn,c as _n,d as vn,f as yn,g as bn,h as xn,i as Sn,k as Cn,l as wn,m as Tn,n as En,o as Dn,p as On,r as kn,s as An,t as jn,u as Mn,v as Nn,w as Pn,x as Fn,y as In}from"./panel-DDVLqW48.js";import{$ as Ln,$n as Rn,$r as zn,A as Bn,Ai as Vn,An as Hn,Ar as Un,At as Wn,B as Gn,Br as Kn,Bt as qn,C as Jn,Ci as Yn,D as Xn,Di as Zn,Dn as Qn,Dr as $n,E as er,Et as tr,F as nr,Fi as rr,Fn as ir,Ft as ar,Gn as or,Hr as sr,I as cr,J as lr,Jn as ur,K as dr,Kn as fr,L as pr,Li as mr,Ln as hr,M as gr,Mn as _r,Mt as vr,N as yr,Nn as br,Nt as xr,O as Sr,Oi as Cr,Or as wr,P as Tr,Pn as Er,Q as Dr,Qn as Or,Qr as kr,R as Ar,Ri as jr,S as Mr,St as Nr,T as Pr,Tt as Fr,Un as Ir,Wn as Lr,X as Rr,Xi as zr,Xr as Br,Xt as Vr,Y as Hr,Yn as Ur,Yr as Wr,Z as Gr,_ as Kr,a as qr,aa as Jr,an as Yr,ar as Xr,c as Zr,ci as Qr,cr as $r,dr as ei,ei as ti,er as ni,et as ri,g as ii,hi as ai,hr as oi,i as si,ia as ci,ii as li,it as ui,j as di,jt as fi,k as pi,kt as mi,l as hi,li as gi,lr as _i,m as vi,mi as yi,mn as bi,n as xi,na as Y,ni as Si,nr as Ci,o as wi,oa as Ti,oi as Ei,or as Di,ot as Oi,pn as ki,pr as Ai,q as ji,qn as Mi,qr as Ni,ra as Pi,rt as Fi,s as Ii,sa as Li,sr as Ri,ti as zi,tr as Bi,tt as Vi,un as Hi,ut as Ui,v as Wi,w as Gi,wi as Ki,wr as qi,x as Ji,xn as Yi,z as Xi,zi as Zi,zt as Qi}from"./prop-types-COA7UVY9.js";import{C as $i,S as ea,d as ta,g as na,l as ra,m as ia,o as aa,p as oa,t as sa,w as ca,x as la}from"./button-B_6r-4tt.js";import{a as ua,c as da,d as fa,f as pa,i as ma,l as ha,m as ga,n as _a,o as va,p as ya,r as ba,s as xa,t as Sa,u as Ca}from"./agent-presence-B_GJzt87.js";import{$ as wa,A as Ta,At as Ea,B as Da,Bt as Oa,C as ka,Ct as Aa,D as ja,Dt as Ma,E as Na,Et as Pa,F as Fa,Ft as Ia,G as La,Gt as Ra,H as za,Ht as Ba,I as Va,It as Ha,J as Ua,Jt as Wa,K as Ga,Kt as Ka,L as qa,Lt as Ja,M as Ya,Mt as Xa,N as Za,Nt as Qa,O as $a,Ot as eo,P as to,Pt as no,Q as ro,Qt as io,R as ao,Rt as oo,S as so,St as co,T as lo,Tt as uo,U as fo,Ut as po,V as mo,Vt as ho,W as go,Wt as _o,X as vo,Xt as yo,Y as bo,Yt as xo,Z as So,Zt as Co,_t as wo,at as To,b as Eo,bt as Do,ct as Oo,dt as ko,en as Ao,et as jo,ft as Mo,gt as No,ht as Po,it as Fo,j as Io,jt as Lo,k as Ro,kt as zo,lt as Bo,m as Vo,mt as Ho,nn as Uo,nt as Wo,o as Go,ot as Ko,p as qo,pt as Jo,q as Yo,qt as Xo,r as Zo,rn as Qo,rt as $o,st as es,t as ts,tn as ns,tt as rs,u as is,vt as as,w as os,wt as ss,x as cs,xt as ls,y as us,yt as ds,z as fs,zt as ps}from"./config-validation-events-BUyp1R_U.js";import{i as ms,n as hs,r as gs,t as _s}from"./toggle-group-sKkFFfhD.js";import{a as vs,b as ys,c as bs,i as xs,n as Ss,o as Cs,s as ws,t as Ts,v as Es,x as Ds,y as X}from"./dialog-uNuZn7gJ.js";import{a as Os,i as ks,n as As,r as js,t as Ms}from"./collapsible-DC_eQWsn.js";import{t as Ns}from"./checkbox-qnHi6HI6.js";import{t as Ps}from"./label-DLO_wxY0.js";import{n as Fs,r as Is}from"./textarea-CaVb3JmO.js";import{i as Ls,n as Rs,r as zs}from"./project-paths-CsGHlmFh.js";import{n as Bs,t as Vs}from"./mcp-consent-store-CijO54Jd.js";import{c as Hs,i as Us,l as Ws,o as Gs}from"./keyboard-shortcuts-CNJfczoS.js";import{$ as Ks,At as qs,Ct as Js,Dt as Ys,Ft as Xs,I as Zs,It as Qs,J as $s,Mt as ec,Ot as tc,Pt as nc,Q as rc,Tt as ic,X as ac,Z as oc,at as sc,bt as cc,c as lc,jt as uc,k as dc,w as fc}from"./dist-Du-s1q8P.js";import{n as pc}from"./dist-DsbVHLNy.js";import{c as mc,d as hc,f as gc,h as _c,i as vc,l as yc,n as bc,o as xc,r as Sc,s as Cc,t as wc,u as Tc}from"./typing-burst-detector-DWg86xJw.js";import{t as Ec}from"./target-navigation-intent-Cp-mOxXo.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function Dc(){({BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.11.0`})?.VITE_OTEL_ENABLED===`true`&&n(()=>import(`./telemetry-impl-l-VsaBiG.js`).then(e=>e.install()),__vite__mapDeps([0,1,2,3,4]),import.meta.url)}function Oc(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{bn(e,()=>t.signal,()=>n=!0)},u=In(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?Nn:mn;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Ac:kc,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:kc(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function kc(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ac(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var jc=class extends yn{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Mc(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=On({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),xn.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Mc(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Nc=class extends sn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new jc({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Pc(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Pc(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Pc(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Pc(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){xn.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>cn(t,e))}findAll(e={}){return this.getAll().filter(t=>cn(e,t))}notify(e){xn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return xn.batch(()=>Promise.all(e.map(e=>e.continue().catch(pn))))}};function Pc(e){return e.options.scope?.id}var Fc=class extends sn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??fn(r,t),a=this.get(i);return a||(a=new vn({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){xn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Pn(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Pn(e,t)):t}notify(e){xn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){xn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){xn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ic=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Fc,this.#t=e.mutationCache||new Nc,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Cn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Tn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ln(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=gn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return xn.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;xn.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return xn.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=xn.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(pn).catch(pn)}invalidateQueries(e,t={}){return xn.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=xn.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(pn)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(pn)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(ln(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(pn).catch(pn)}fetchInfiniteQuery(e){return e.behavior=Oc(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(pn).catch(pn)}ensureInfiniteQueryData(e){return e.behavior=Oc(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Tn.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Fn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{un(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Fn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{un(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=fn(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===dn&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Lc=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Rc=t(((e,t)=>{t.exports=Lc()})),zc=t((e=>{var t=Rc(),n=r(),i=ca();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var N=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},L=[],R=-1;function z(e){return{current:e}}function B(e){0>R||(e.current=L[R],L[R]=null,R--)}function V(e,t){R++,L[R]=e.current,e.current=t}var H=z(null),U=z(null),ee=z(null),te=z(null);function W(e,t){switch(V(ee,t),V(U,e),V(H,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}B(H),V(H,e)}function ne(){B(H),B(U),B(ee)}function re(e){e.memoizedState!==null&&V(te,e);var t=H.current,n=Hd(t,e.type);t!==n&&(V(U,e),V(H,n))}function G(e){U.current===e&&(B(H),B(U)),te.current===e&&(B(te),Qf._currentValue=I)}var ie,K;function q(e){if(ie===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ie=t&&t[1]||``,K=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+ie+e+K}var ae=!1;function oe(e,t){if(!e||ae)return``;ae=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
5
  `),l=s.split(`
@@ -20,12 +20,12 @@ Error generating stack: `+e.message+`
20
20
  `}function Z_(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;Y_(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?X_(e,o.headerOptions):void 0)}}))}else{let s=Y_(e,t,n,r,i,a,o);return s?X_(s,o?.headerOptions):void 0}}function Q_(e,t,n,r,i,a){return Z_(e,e,t,n,r,i,a)}function $_(e){let t=e.endsWith(`
21
21
  `),n=e.split(`
22
22
  `).map(e=>e+`
23
- `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function ev(e,t){return`${e}\u0000${t}`}function tv(e,t,n){let r=zi(e).body,i=zi(t).body;return r===i?``:Q_(n,r,i,``,``,{context:3})}function nv(e,t,n){let r=(0,$.c)(8),{activeProvider:i}=yt(),a;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={status:`idle`,diff:null},r[0]=a):a=r[0];let[o,s]=(0,Q.useState)(a),c=(0,Q.useRef)(i),l;r[1]===i?l=r[2]:(l=()=>{c.current=i},r[1]=i,r[2]=l),(0,Q.useEffect)(l);let u,d;return r[3]!==n||r[4]!==t||r[5]!==e?(u=()=>{if(!e){s({status:`idle`,diff:null});return}let r=e,i=!1;return s({status:`loading`,diff:null}),(async function(){try{let e=ev(t,r),a=n.get(e);if(a===void 0){let o=await fetch(`/api/history/${r}?docName=${encodeURIComponent(t)}`);if(i)return;if(!o.ok){s({status:`error`,diff:null});return}let c=await o.json();if(i)return;a=c.content??``,n.set(e,a)}if(i)return;let o=c.current?.document.getText(`source`).toString()??``,l=tv(a,o,t);if(i)return;s({status:`ready`,diff:l})}catch(e){i||(console.error(`[timeline-diff] failed to load entry diff`,{sha:r,docName:t,err:e}),s({status:`error`,diff:null}))}})(),()=>{i=!0}},d=[e,t,n],r[3]=n,r[4]=t,r[5]=e,r[6]=u,r[7]=d):(u=r[6],d=r[7]),(0,Q.useEffect)(u,d),o}var rv=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityPanelDiffView-DgtknSgX.js`),__vite__mapDeps([18,1,6,19]),import.meta.url)).ActivityPanelDiffView}));function iv(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3);if(r<60)return Y._({id:`xOTzt5`});if(r<3600){let e=Math.floor(r/60);return Y._({id:`UyROxs`,values:{mins:e}})}if(r<86400){let e=Math.floor(r/3600);return Y._({id:`wXO4Tg`,values:{hrs:e}})}if(r<86400*2)return Y._({id:`rQRrkB`});let i=Math.floor(r/86400);return i<7?Y._({id:`6u9LvN`,values:{days:i}}):t.toLocaleDateString()}function av(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function ov(e){return e.slice(0,7)}function sv(e){return e.type===`upstream`?Y._({id:`K_vT1F`}):e.contributors.length===1?e.contributors[0].name:e.contributors.length>1?e.contributors.map(e=>e.name).join(`, `):e.author===`openknowledge-server`||e.author===`server`?Y._({id:`B2DrPb`}):e.author}function cv(e){let t=(0,$.c)(17),n,r;if(t[0]===e?(n=t[1],r=t[2]):({icon:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),n===`claude`){let e;return t[3]===r?e=t[4]:(e=(0,Z.jsx)(fa,{...r}),t[3]=r,t[4]=e),e}if(n===`cursor`){let e;return t[5]===r?e=t[6]:(e=(0,Z.jsx)(va,{...r}),t[5]=r,t[6]=e),e}if(n===`windsurf`){let e;return t[7]===r?e=t[8]:(e=(0,Z.jsx)(ua,{...r}),t[7]=r,t[8]=e),e}if(n===`openai`){let e;return t[9]===r?e=t[10]:(e=(0,Z.jsx)(ha,{...r}),t[9]=r,t[10]=e),e}if(n===`cline`){let e;return t[11]===r?e=t[12]:(e=(0,Z.jsx)(Ca,{...r}),t[11]=r,t[12]=e),e}if(n===`github`){let e;return t[13]===r?e=t[14]:(e=(0,Z.jsx)(xa,{...r}),t[13]=r,t[14]=e),e}let i=r,a;return t[15]===i?a=t[16]:(a=(0,Z.jsx)(ya,{strokeWidth:1.5,...i}),t[15]=i,t[16]=a),a}function lv(e){let t=(0,$.c)(17),{entry:n,isDark:r}=e;if(n.type===`upstream`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Be,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[0]=e):e=t[0],e}if(n.contributors.length>0){let e=n.contributors[0],i=e.colorSeed??e.name,a;t[1]===i?a=t[2]:(a=oi(i),t[1]=i,t[2]=a);let o=a,s=r?ui[o]??Fi[o]:Fi[o],c;t[3]!==s||t[4]!==i?(c=s??Lr(i),t[3]=s,t[4]=i,t[5]=c):c=t[5];let l=c;if(o!==`bot`){let e;t[6]===l?e=t[7]:(e={color:l},t[6]=l,t[7]=e);let n;return t[8]!==o||t[9]!==e?(n=(0,Z.jsx)(cv,{icon:o,width:14,height:14,className:`shrink-0`,style:e}),t[8]=o,t[9]=e,t[10]=n):n=t[10],n}if(e.name===`File System`){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(hl,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[11]=e):e=t[11],e}if(e.name===`Open Knowledge (service)`||e.name===`Git (upstream)`){let e;return t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Vc,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[12]=e):e=t[12],e}let u;return t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(tu,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[13]=u):u=t[13],u}if(n.authorEmail.includes(`agent`)||n.author.includes(`agent`)||n.authorEmail.includes(`cursor`)||n.authorEmail.includes(`claude`)){let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(ya,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[14]=e):e=t[14],e}if(n.author===`openknowledge-server`||n.author===`server`){let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Vc,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[15]=e):e=t[15],e}let i;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(tu,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[16]=i):i=t[16],i}function uv(e){let t=(0,$.c)(23),{entries:n,defaultExpanded:r,isDark:i,diffLayout:a,cache:o,docName:s,expandedShas:c,onToggleExpanded:l,onRestoreSuccess:u}=e,[d,f]=(0,Q.useState)(r),p=n.length;if(n.length===0)return null;let m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>f(dv),t[0]=m):m=t[0];let h;t[1]===d?h=t[2]:(h=d?(0,Z.jsx)(le,{className:`size-3`}):(0,Z.jsx)(Os,{className:`size-3`}),t[1]=d,t[2]=h);let g;t[3]!==p||t[4]!==d?(g=d?Y._({id:`OKQe56`,values:{entryCount:p}}):Y._({id:`k9jDvw`,values:{entryCount:p}}),t[3]=p,t[4]=d,t[5]=g):g=t[5];let _;t[6]!==d||t[7]!==h||t[8]!==g?(_=(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":d,className:`flex items-center gap-1.5 rounded-lg px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors text-left`,onClick:m,children:[h,g]}),t[6]=d,t[7]=h,t[8]=g,t[9]=_):_=t[9];let v;t[10]!==o||t[11]!==a||t[12]!==s||t[13]!==n||t[14]!==d||t[15]!==c||t[16]!==i||t[17]!==u||t[18]!==l?(v=d&&n.map(e=>(0,Z.jsx)(Cv,{entry:e,isDark:i,diffLayout:a,cache:o,docName:s,expanded:c.has(e.sha),onToggleExpanded:l,onRestoreSuccess:u},e.sha)),t[10]=o,t[11]=a,t[12]=s,t[13]=n,t[14]=d,t[15]=c,t[16]=i,t[17]=u,t[18]=l,t[19]=v):v=t[19];let y;return t[20]!==_||t[21]!==v?(y=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[_,v]}),t[20]=_,t[21]=v,t[22]=y):y=t[22],y}function dv(e){return!e}function fv(e){return e.checkpoint?e.checkpoint.kind:`save`}function pv(e){let t=fv(e);if(t===`save`)return Y._({id:`gsePqm`});let n=e.checkpoint?.size??null,r=n!=null&&n>0?` (${mv(n)})`:``;return t===`bridge-merge-loss`?Y._({id:`uZAG7T`,values:{sizeSuffix:r}}):Y._({id:`_4rAQI`,values:{sizeSuffix:r}})}function mv(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/102.4)/10} KB`:`${Math.round(e/104857.6)/10} MB`}function hv(e){return e.type===`checkpoint`?fv(e)===`save`?`version`:`auto-save`:`wip`}function gv(e){let t=hv(e);return t===`version`?Y._({id:`RFQ1Yx`}):t===`auto-save`?Y._({id:`9Uv1CD`}):Y._({id:`Yea-K5`})}function _v(e){let t=hv(e);return t===`version`?Y._({id:`gg3Rpy`}):t===`auto-save`?Y._({id:`PXXeW8`}):Y._({id:`Pyp1NA`})}function vv(e){let t=[];for(let n of e.contributors)if(n.summaries)for(let e of n.summaries)t.push(e);return t}function yv(e){let t=(0,$.c)(21),{summaries:n}=e,[r,i]=(0,Q.useState)(!1),a=(0,Q.useId)();if(n.length===0)return null;let o,c;t[0]===n?(o=t[1],c=t[2]):([o,...c]=n,t[0]=n,t[1]=o,t[2]=c);let l=c.length,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),t[3]=u):u=t[3];let d;t[4]===o?d=t[5]:(d=(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[u,o]}),t[4]=o,t[5]=d);let f;t[6]!==r||t[7]!==c?(f=r&&c.map(xv),t[6]=r,t[7]=c,t[8]=f):f=t[8];let p;t[9]!==a||t[10]!==d||t[11]!==f?(p=(0,Z.jsxs)(`ul`,{id:a,className:`list-none`,children:[d,f]}),t[9]=a,t[10]=d,t[11]=f,t[12]=p):p=t[12];let m;t[13]!==r||t[14]!==l||t[15]!==a||t[16]!==c.length?(m=c.length>0&&(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":r,"aria-controls":a,className:`inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,onClick:e=>{e.stopPropagation(),i(bv)},children:[r?(0,Z.jsx)(le,{className:`size-3`}):(0,Z.jsx)(Os,{className:`size-3`}),r?(0,Z.jsx)(s,{id:`vLyv1R`}):(0,Z.jsx)(s,{id:`ZptNUh`,values:{hidden:l}})]}),t[13]=r,t[14]=l,t[15]=a,t[16]=c.length,t[17]=m):m=t[17];let h;return t[18]!==p||t[19]!==m?(h=(0,Z.jsxs)(`div`,{className:`mt-0.5`,children:[p,m]}),t[18]=p,t[19]=m,t[20]=h):h=t[20],h}function bv(e){return!e}function xv(e,t){return(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),e]},`${t}-${e}`)}function Sv(e){let t=(0,$.c)(13),{sha:n,docName:r,cache:i,diffLayout:a,panelId:o}=e,c=nv(n,r,i),l;t[0]===c.status?l=t[1]:(l=c.status===`loading`&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)(Ce,{className:`size-3 animate-spin`}),(0,Z.jsx)(s,{id:`38foVZ`})]}),t[0]=c.status,t[1]=l);let u;t[2]===c.status?u=t[3]:(u=c.status===`error`&&(0,Z.jsx)(`p`,{className:`py-2 text-xs text-destructive`,children:(0,Z.jsx)(s,{id:`vvWZnu`})}),t[2]=c.status,t[3]=u);let d;t[4]!==a||t[5]!==c.diff||t[6]!==c.status?(d=c.status===`ready`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)(Ce,{className:`size-3 animate-spin`}),(0,Z.jsx)(s,{id:`EDm3wJ`})]}),children:(0,Z.jsx)(rv,{diff:c.diff,viewType:a})}),t[4]=a,t[5]=c.diff,t[6]=c.status,t[7]=d):d=t[7];let f;return t[8]!==o||t[9]!==l||t[10]!==u||t[11]!==d?(f=(0,Z.jsxs)(`div`,{id:o,className:`px-3 pb-2`,"data-testid":`timeline-entry-diff`,children:[l,u,d]}),t[8]=o,t[9]=l,t[10]=u,t[11]=d,t[12]=f):f=t[12],f}function Cv(e){let t=(0,$.c)(130),{entry:n,prominent:r,isDark:a,diffLayout:o,cache:c,docName:l,expanded:u,onToggleExpanded:d,onRestoreSuccess:f}=e,p=r===void 0?!1:r,{_:m}=i(),h;t[0]===n.timestamp?h=t[1]:(h=iv(n.timestamp),t[0]=n.timestamp,t[1]=h);let g=h,_;t[2]===n?_=t[3]:(_=sv(n),t[2]=n,t[3]=_);let v=_,y;t[4]===n.timestamp?y=t[5]:(y=av(n.timestamp),t[4]=n.timestamp,t[5]=y);let b=y,x;t[6]===n.sha?x=t[7]:(x=ov(n.sha),t[6]=n.sha,t[7]=x);let S=x,C=n.contributors.flatMap(wv),w;t[8]===n?w=t[9]:(w=vv(n),t[8]=n,t[9]=w);let T=w,[E,D]=(0,Q.useState)(!1),[O,k]=(0,Q.useState)(!1),A=(0,Q.useRef)(null),j=(0,Q.useId)(),M,N;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>()=>A.current?.abort(),N=[],t[10]=M,t[11]=N):(M=t[10],N=t[11]),(0,Q.useEffect)(M,N);let P;t[12]!==n.sha||t[13]!==d?(P=()=>d(n.sha),t[12]=n.sha,t[13]=d,t[14]=P):P=t[14];let F=P,I;t[15]===D?I=t[16]:(I=function(){A.current?.abort(),A.current=null,k(!1),D(!1)},t[15]=D,t[16]=I);let L=I,R;t[17]!==m||t[18]!==l||t[19]!==n.sha||t[20]!==f||t[21]!==D?(R=async function(){k(!0);let e=new AbortController;A.current=e;let t=function(){e.signal.aborted||k(!1),A.current===e&&(A.current=null)},r;try{r=await fetch(`/api/rollback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({docName:l,commitSha:n.sha}),signal:e.signal})}catch(r){let i=r;!e.signal.aborted&&!(i instanceof DOMException&&i.name===`AbortError`)&&(console.error(`[timeline] rollback fetch failed`,{docName:l,sha:n.sha,err:i}),X.error(m({id:`NkXEFS`}),{duration:4e3})),t();return}if(e.signal.aborted){t();return}if(r.ok)D(!1),f();else{let e=`HTTP ${r.status}`;try{let t=Yr.safeParse(await r.json());t.success&&(e=t.data.title)}catch{}console.error(`[timeline] rollback failed`,{docName:l,sha:n.sha,status:r.status,detail:e}),X.error(m({id:`uM6jnS`}),{description:e,duration:6e3})}t()},t[17]=m,t[18]=l,t[19]=n.sha,t[20]=f,t[21]=D,t[22]=R):R=t[22];let z=R,B;t[23]!==n||t[24]!==a||t[25]!==p?(B=p?(()=>{let e=fv(n);return e===`bridge-merge-loss`?(0,Z.jsx)(Pi,{className:`size-3.5 shrink-0 text-amber-600 dark:text-amber-400`,"aria-hidden":`true`}):e===`external-change-rescue`?(0,Z.jsx)(ol,{className:`size-3.5 shrink-0 text-sky-600 dark:text-sky-400`,"aria-hidden":`true`}):(0,Z.jsx)(rl,{className:`size-3.5 shrink-0 text-muted-foreground`})})():(0,Z.jsx)(lv,{entry:n,isDark:a}),t[23]=n,t[24]=a,t[25]=p,t[26]=B):B=t[26];let V=B,H=u?j:void 0,U=u?`bg-muted`:`hover:bg-muted/80`,ee;t[27]===U?ee=t[28]:(ee=[`group flex w-full items-start gap-2.5 rounded-lg px-3 py-2.5 text-left transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring`,U],t[27]=U,t[28]=ee);let te=ee.join(` `),W;t[29]===F?W=t[30]:(W=e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),F())},t[29]=F,t[30]=W);let ne;t[31]===V?ne=t[32]:(ne=(0,Z.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:V}),t[31]=V,t[32]=ne);let re;t[33]!==v||t[34]!==n||t[35]!==p?(re=p?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`text-xs text-foreground truncate`,children:pv(n)}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground/50`,children:`·`}),(0,Z.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:v})]}):(0,Z.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:v}),t[33]=v,t[34]=n,t[35]=p,t[36]=re):re=t[36];let G;t[37]!==n.timestamp||t[38]!==g?(G=(0,Z.jsx)(`time`,{className:`ml-auto shrink-0 text-xs text-muted-foreground/80`,dateTime:n.timestamp,title:n.timestamp,children:g}),t[37]=n.timestamp,t[38]=g,t[39]=G):G=t[39];let ie;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`h-3 w-px shrink-0 bg-border`}),t[40]=ie):ie=t[40];let K;t[41]===n?K=t[42]:(K=gv(n),t[41]=n,t[42]=K);let q;t[43]===D?q=t[44]:(q=e=>{e.stopPropagation(),D(!0)},t[43]=D,t[44]=q);let ae;t[45]===O?ae=t[46]:(ae=O?(0,Z.jsx)(Ce,{className:`size-3 animate-spin`}):(0,Z.jsx)(pa,{className:`size-3`}),t[45]=O,t[46]=ae);let oe;t[47]!==O||t[48]!==K||t[49]!==q||t[50]!==ae?(oe=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`timeline-entry-restore`,"aria-label":K,disabled:O,onClick:q,children:ae})}),t[47]=O,t[48]=K,t[49]=q,t[50]=ae,t[51]=oe):oe=t[51];let se;t[52]===n?se=t[53]:(se=gv(n),t[52]=n,t[53]=se);let ce;t[54]===se?ce=t[55]:(ce=(0,Z.jsx)(Ar,{side:`top`,children:se}),t[54]=se,t[55]=ce);let le;t[56]!==oe||t[57]!==ce?(le=(0,Z.jsxs)(pr,{children:[oe,ce]}),t[56]=oe,t[57]=ce,t[58]=le):le=t[58];let ue;t[59]!==re||t[60]!==G||t[61]!==le?(ue=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[re,G,ie,le]}),t[59]=re,t[60]=G,t[61]=le,t[62]=ue):ue=t[62];let de;t[63]===T?de=t[64]:(de=T.length>0&&(0,Z.jsx)(yv,{summaries:T}),t[63]=T,t[64]=de);let fe=C.length>0?(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:C.join(`, `),children:C.join(`, `)}):(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:n.message,children:n.message}),pe;t[65]!==ue||t[66]!==de||t[67]!==fe?(pe=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[ue,de,fe]}),t[65]=ue,t[66]=de,t[67]=fe,t[68]=pe):pe=t[68];let me;t[69]!==u||t[70]!==F||t[71]!==H||t[72]!==te||t[73]!==W||t[74]!==ne||t[75]!==pe?(me=(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-expanded":u,"aria-controls":H,"data-testid":`timeline-entry-expand`,className:te,onClick:F,onKeyDown:W,children:[ne,pe]}),t[69]=u,t[70]=F,t[71]=H,t[72]=te,t[73]=W,t[74]=ne,t[75]=pe,t[76]=me):me=t[76];let he;t[77]!==c||t[78]!==o||t[79]!==j||t[80]!==l||t[81]!==n.sha||t[82]!==u?(he=u&&(0,Z.jsx)(Sv,{sha:n.sha,docName:l,cache:c,diffLayout:o,panelId:j}),t[77]=c,t[78]=o,t[79]=j,t[80]=l,t[81]=n.sha,t[82]=u,t[83]=he):he=t[83];let ge;t[84]!==me||t[85]!==he?(ge=(0,Z.jsxs)(`div`,{className:`flex flex-col rounded-lg`,children:[me,he]}),t[84]=me,t[85]=he,t[86]=ge):ge=t[86];let _e;t[87]!==L||t[88]!==D?(_e=e=>{e?D(!0):L()},t[87]=L,t[88]=D,t[89]=_e):_e=t[89];let ve;t[90]===n?ve=t[91]:(ve=_v(n),t[90]=n,t[91]=ve);let ye;t[92]===ve?ye=t[93]:(ye=(0,Z.jsx)(bs,{children:ve}),t[92]=ve,t[93]=ye);let be;t[94]!==b||t[95]!==v||t[96]!==S||t[97]!==g?(be={relative:g,absoluteTime:b,entrySha:S,authorName:v},t[94]=b,t[95]=v,t[96]=S,t[97]=g,t[98]=be):be=t[98];let xe;t[99]===Symbol.for(`react.memo_cache_sentinel`)?(xe={0:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`}),1:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`})},t[99]=xe):xe=t[99];let Se;t[100]===be?Se=t[101]:(Se=(0,Z.jsx)(vs,{children:(0,Z.jsx)(s,{id:`h6EvY-`,values:be,components:xe})}),t[100]=be,t[101]=Se);let we;t[102]!==ye||t[103]!==Se?(we=(0,Z.jsxs)(ws,{children:[ye,Se]}),t[102]=ye,t[103]=Se,t[104]=we):we=t[104];let Te;t[105]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,Z.jsx)(s,{id:`dEgA5A`}),t[105]=Te):Te=t[105];let Ee;t[106]===L?Ee=t[107]:(Ee=(0,Z.jsx)(sa,{variant:`outline`,"data-testid":`timeline-entry-restore-cancel`,onClick:L,children:Te}),t[106]=L,t[107]=Ee);let De;t[108]===z?De=t[109]:(De=()=>z(),t[108]=z,t[109]=De);let Oe;t[110]===O?Oe=t[111]:(Oe=O?(0,Z.jsx)(Ce,{className:`mr-2 size-4 animate-spin`}):null,t[110]=O,t[111]=Oe);let ke;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,Z.jsx)(s,{id:`yKu_3Y`}),t[112]=ke):ke=t[112];let Ae;t[113]!==O||t[114]!==De||t[115]!==Oe?(Ae=(0,Z.jsxs)(sa,{variant:`destructive`,"data-testid":`timeline-entry-restore-confirm`,disabled:O,onClick:De,children:[Oe,ke]}),t[113]=O,t[114]=De,t[115]=Oe,t[116]=Ae):Ae=t[116];let je;t[117]!==Ee||t[118]!==Ae?(je=(0,Z.jsxs)(Cs,{children:[Ee,Ae]}),t[117]=Ee,t[118]=Ae,t[119]=je):je=t[119];let Me;t[120]!==we||t[121]!==je?(Me=(0,Z.jsxs)(xs,{children:[we,je]}),t[120]=we,t[121]=je,t[122]=Me):Me=t[122];let Ne;t[123]!==E||t[124]!==_e||t[125]!==Me?(Ne=(0,Z.jsx)(Ts,{open:E,onOpenChange:_e,children:Me}),t[123]=E,t[124]=_e,t[125]=Me,t[126]=Ne):Ne=t[126];let Pe;return t[127]!==ge||t[128]!==Ne?(Pe=(0,Z.jsxs)(Z.Fragment,{children:[ge,Ne]}),t[127]=ge,t[128]=Ne,t[129]=Pe):Pe=t[129],Pe}function wv(e){return e.docs}function Tv(e){let t=(0,$.c)(87),{docName:n,diffLayout:r,onDiffLayoutChange:a,onSaveVersion:o,saving:c}=e,{_:l}=i(),{resolvedTheme:u}=Li(),d=u===`dark`,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=[],t[0]=f):f=t[0];let[p,m]=(0,Q.useState)(f),[h,g]=(0,Q.useState)(!1),[_,v]=(0,Q.useState)(null),y=(0,Q.useRef)(null),[b]=(0,Q.useState)(kv),[x,S]=(0,Q.useState)(Ov),C;t[1]===b?C=t[2]:(C=()=>{S(new Set),b.clear()},t[1]=b,t[2]=C);let w;t[3]===n?w=t[4]:(w=[n],t[3]=n,t[4]=w),(0,Q.useEffect)(C,w);let T;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(T=function(e){S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[5]=T):T=t[5];let E=T,D;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(D=function(){S(new Set)},t[6]=D):D=t[6];let O=D,k,A;t[7]!==l||t[8]!==n?(k=()=>{if(!n){m([]);return}let e=!1,t=async function(){if(n)try{let t=await fetch(`/api/history?docName=${encodeURIComponent(n)}&limit=100`);if(e)return;if(!t.ok){v(l({id:`brCtGB`}));return}let r=await t.json();if(e)return;m(r.entries??[]),v(null)}catch(t){let n=t;if(e)return;v(l({id:`brCtGB`})),console.error(`[timeline]`,n)}};return g(!0),t().finally(()=>{e||g(!1)}),y.current=setInterval(t,1e4),()=>{e=!0,y.current&&clearInterval(y.current)}},A=[n,l],t[7]=l,t[8]=n,t[9]=k,t[10]=A):(k=t[9],A=t[10]),(0,Q.useEffect)(k,A);let j,M,N,P,F,I,L,R;if(t[11]!==l||t[12]!==b||t[13]!==r||t[14]!==n||t[15]!==p||t[16]!==_||t[17]!==x||t[18]!==d||t[19]!==h||t[20]!==a||t[21]!==o||t[22]!==c){let e=[],i=[],u=!1;for(let t of p)t.type===`checkpoint`?(i.length>0&&(e.push({kind:`wip-group`,entries:i,isPreCheckpoint:!u}),i=[]),e.push({kind:`checkpoint`,entry:t}),u=!0):i.push(t);i.length>0&&e.push({kind:`wip-group`,entries:i,isPreCheckpoint:!u});let f;t[31]===p?f=t[32]:(f=p.some(Dv),t[31]=p,t[32]=f);let m=!f,g=!h&&!_&&p.length>0;F=`flex h-full flex-col`;let v;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(An,{children:(0,Z.jsx)(s,{id:`cklVjM`})}),t[33]=v):v=t[33];let y;t[34]!==l||t[35]!==r||t[36]!==g||t[37]!==a?(y=g&&(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsxs)(_s,{type:`single`,value:r,onValueChange:e=>{e&&a(e)},"aria-label":l({id:`XvPJaT`}),variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-md shrink-0`,children:[(0,Z.jsx)(hs,{value:`unified`,"aria-label":l({id:`379t2h`}),className:`size-6 px-0`,children:(0,Z.jsx)(zl,{className:`size-3.5`})}),(0,Z.jsx)(hs,{value:`split`,"aria-label":l({id:`HXFyWD`}),className:`size-6 px-0`,children:(0,Z.jsx)($c,{className:`size-3.5`})})]})}),(0,Z.jsx)(Ar,{children:r===`unified`?(0,Z.jsx)(s,{id:`379t2h`}):(0,Z.jsx)(s,{id:`HXFyWD`})})]}),t[34]=l,t[35]=r,t[36]=g,t[37]=a,t[38]=y):y=t[38];let S;t[39]===l?S=t[40]:(S=l({id:`IrYrzq`}),t[39]=l,t[40]=S);let C;t[41]===c?C=t[42]:(C=c?(0,Z.jsx)(Ce,{className:`size-4 animate-spin`}):(0,Z.jsx)(Bl,{className:`size-4`}),t[41]=c,t[42]=C);let w;t[43]!==o||t[44]!==c||t[45]!==S||t[46]!==C?(w=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{variant:`ghost`,size:`icon-sm`,onClick:o,disabled:c,"aria-label":S,className:`text-muted-foreground`,"data-testid":`timeline-save-version`,children:C})}),t[43]=o,t[44]=c,t[45]=S,t[46]=C,t[47]=w):w=t[47];let T;t[48]===c?T=t[49]:(T=(0,Z.jsx)(Ar,{children:c?(0,Z.jsx)(s,{id:`uF9ruK`}):(0,Z.jsx)(s,{id:`IrYrzq`})}),t[48]=c,t[49]=T);let D;t[50]!==w||t[51]!==T?(D=(0,Z.jsxs)(pr,{children:[w,T]}),t[50]=w,t[51]=T,t[52]=D):D=t[52],t[53]!==y||t[54]!==D?(I=(0,Z.jsxs)(Dn,{children:[v,(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[y,D]})]}),t[53]=y,t[54]=D,t[55]=I):I=t[55],L=`flex-1 overflow-y-auto subtle-scrollbar scroll-fade-mask`,t[56]!==l||t[57]!==h?(R=h&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,role:`status`,"aria-busy":`true`,"aria-label":l({id:`o49mDZ`}),children:[1,2,3].map(Ev)}),t[56]=l,t[57]=h,t[58]=R):R=t[58],t[59]!==_||t[60]!==h?(j=!h&&_&&(0,Z.jsx)(`div`,{className:`px-4 py-3`,children:(0,Z.jsx)(`p`,{className:`text-xs text-destructive`,children:_})}),t[59]=_,t[60]=h,t[61]=j):j=t[61],t[62]!==p.length||t[63]!==_||t[64]!==h?(M=!h&&!_&&p.length===0&&(0,Z.jsx)(`div`,{className:`px-4 py-8 text-center`,children:(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(s,{id:`Ta25TG`})})}),t[62]=p.length,t[63]=_,t[64]=h,t[65]=M):M=t[65],t[66]!==b||t[67]!==r||t[68]!==n||t[69]!==p||t[70]!==_||t[71]!==x||t[72]!==m||t[73]!==d||t[74]!==h?(N=!h&&!_&&m&&p.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,children:p.map(e=>(0,Z.jsx)(Cv,{entry:e,isDark:d,diffLayout:r,cache:b,docName:n,expanded:x.has(e.sha),onToggleExpanded:E,onRestoreSuccess:O},e.sha))}),t[66]=b,t[67]=r,t[68]=n,t[69]=p,t[70]=_,t[71]=x,t[72]=m,t[73]=d,t[74]=h,t[75]=N):N=t[75],P=!h&&!_&&!m&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,children:e.map((e,t)=>e.kind===`checkpoint`?(0,Z.jsx)(Cv,{entry:e.entry,prominent:!0,isDark:d,diffLayout:r,cache:b,docName:n,expanded:x.has(e.entry.sha),onToggleExpanded:E,onRestoreSuccess:O},e.entry.sha):(0,Z.jsx)(uv,{entries:e.entries,defaultExpanded:e.isPreCheckpoint,isDark:d,diffLayout:r,cache:b,docName:n,expandedShas:x,onToggleExpanded:E,onRestoreSuccess:O},e.entries[0]?.sha??`wip-${t}`))}),t[11]=l,t[12]=b,t[13]=r,t[14]=n,t[15]=p,t[16]=_,t[17]=x,t[18]=d,t[19]=h,t[20]=a,t[21]=o,t[22]=c,t[23]=j,t[24]=M,t[25]=N,t[26]=P,t[27]=F,t[28]=I,t[29]=L,t[30]=R}else j=t[23],M=t[24],N=t[25],P=t[26],F=t[27],I=t[28],L=t[29],R=t[30];let z;t[76]!==j||t[77]!==M||t[78]!==N||t[79]!==P||t[80]!==L||t[81]!==R?(z=(0,Z.jsxs)(`div`,{className:L,children:[R,j,M,N,P]}),t[76]=j,t[77]=M,t[78]=N,t[79]=P,t[80]=L,t[81]=R,t[82]=z):z=t[82];let B;return t[83]!==F||t[84]!==I||t[85]!==z?(B=(0,Z.jsxs)(`div`,{className:F,children:[I,z]}),t[83]=F,t[84]=I,t[85]=z,t[86]=B):B=t[86],B}function Ev(e){return(0,Z.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg px-3 py-2.5`,children:[(0,Z.jsx)(Pa,{className:`size-3.5 rounded mt-0.5 shrink-0`}),(0,Z.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Z.jsx)(Pa,{className:`h-3 w-28`}),(0,Z.jsx)(Pa,{className:`h-3 w-40`})]})]},e)}function Dv(e){return e.type===`checkpoint`}function Ov(){return new Set}function kv(){return new ma(32)}var Av=[{id:`outline`,icon:Cl},{id:`links`,icon:Ke},{id:`graph`,icon:El},{id:`timeline`,icon:Qc}];function jv(e){return e===`outline`?Y._({id:`dD7NPy`}):e===`links`?Y._({id:`Rj01Fz`}):e===`graph`?Y._({id:`x2fr_j`}):Y._({id:`cklVjM`})}function Mv(){return n(()=>import(`./GraphPanel-D8NK8BUZ.js`),__vite__mapDeps([20,1,21,6,3,7,22,23,12,13,24,25,26,27,28,29,30,31,32,33]),import.meta.url)}var Nv=(0,Q.lazy)(async()=>({default:(await Mv()).GraphPanel})),Pv=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityModeContent-Zo-ELIQV.js`),__vite__mapDeps([34,1,2,35,36,37,22,38,39,40,41,21,6,3,7,4,10,12,9,42,43]),import.meta.url)).ActivityModeContent}));function Fv(e){let t=(0,$.c)(20),{docName:n,isSourceMode:r,activeTab:a,onActiveTabChange:o,mode:c,onSaveVersion:l,saving:u}=e,{_:d}=i(),[f,p]=(0,Q.useState)(`unified`),m=Oh(),h,g,_;if(t[0]!==d||t[1]!==a||t[2]!==c||t[3]!==o||t[4]!==m){let e=m?Av.filter(Lv):Av;h=e.some(e=>e.id===a)?a:`outline`,g=c===`doc`&&e.length>1,_=g?(0,Z.jsx)(`div`,{className:`flex flex-row items-center justify-center gap-3 p-2`,children:(0,Z.jsx)(_s,{type:`single`,variant:`outline`,value:h,onValueChange:e=>{e&&o(e)},"aria-label":d({id:`SrOuyg`}),children:e.map(Iv)})}):null,t[0]=d,t[1]=a,t[2]=c,t[3]=o,t[4]=m,t[5]=h,t[6]=g,t[7]=_}else h=t[5],g=t[6],_=t[7];let v;t[8]!==f||t[9]!==n||t[10]!==h||t[11]!==r||t[12]!==c||t[13]!==l||t[14]!==u||t[15]!==g?(v=c===`doc`?(0,Z.jsxs)(`div`,{...g?{role:`tabpanel`,id:`panel-${h}`,"aria-labelledby":`tab-${h}`}:{},className:`min-h-0 flex-1`,children:[h===`outline`&&(0,Z.jsx)(gc,{docName:n,isSourceMode:r}),h===`links`&&(0,Z.jsx)(E_,{docName:n}),h===`graph`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`-lCAuQ`})}),children:(0,Z.jsx)(Nv,{activeDocName:n})}),h===`timeline`&&(0,Z.jsx)(Tv,{docName:n,diffLayout:f,onDiffLayoutChange:p,onSaveVersion:l,saving:u})]}):(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{role:`status`,"aria-busy":`true`,className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`ONPvOb`})}),children:(0,Z.jsx)(Pv,{})})}),t[8]=f,t[9]=n,t[10]=h,t[11]=r,t[12]=c,t[13]=l,t[14]=u,t[15]=g,t[16]=v):v=t[16];let y;return t[17]!==_||t[18]!==v?(y=(0,Z.jsxs)(Z.Fragment,{children:[_,v]}),t[17]=_,t[18]=v,t[19]=y):y=t[19],y}function Iv(e){let{id:t,icon:n}=e,r=jv(t);return(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(hs,{value:t,role:`tab`,id:`tab-${t}`,"aria-controls":`panel-${t}`,"aria-label":r,asChild:!0,children:(0,Z.jsx)(Gn,{children:(0,Z.jsx)(n,{})})}),(0,Z.jsx)(Ar,{side:`bottom`,children:r})]},t)}function Lv(e){return e.id===`outline`}function Rv(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function zv(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function Bv(e){return e/100*window.innerHeight}function Vv(e){return e/100*window.innerWidth}function Hv(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function Uv({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=Hv(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=zv(t,i);break;case`em`:r=Rv(t,i);break;case`vh`:r=Bv(i);break;case`vw`:r=Vv(i);break}return r}function Wv(e){return parseFloat(e.toFixed(3))}function Gv({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function Kv(e){let{panels:t}=e,n=Gv({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=Wv(Uv({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=Wv(Uv({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=Wv(Uv({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=Wv(Uv({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function qv(e,t=`Assertion error`){if(!e)throw Error(t)}function Jv(e,t){return Array.from(t).sort(e===`horizontal`?Yv:Xv)}function Yv(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function Xv(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function Zv(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function Qv(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function $v({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=Qv(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return qv(i,`No rect found`),i}var ey;function ty(){return ey===void 0&&(ey=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),ey}function ny(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=Jv(n,Array.from(t.children).filter(Zv).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,$v({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=ty()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:Gv({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var ry=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},iy=new Map,ay=new ry;function oy(e){iy=new Map(iy),iy.delete(e)}function sy(e,t){for(let[t]of iy)if(t.id===e)return t}function cy(e,t){for(let[t,n]of iy)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function ly(){return iy}function uy(e,t){return ay.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function dy(e,t){let n=iy.get(e);iy=new Map(iy),iy.set(e,t),ay.emit(`groupChange`,{group:e,prev:n,next:t})}function fy(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=Qv(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function py(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function my(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:by(e),b:by(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();qv(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:yy(vy(n.a)),b:yy(vy(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var hy=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function gy(e){let t=getComputedStyle(xy(e)??e).display;return t===`flex`||t===`inline-flex`}function _y(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||gy(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||hy.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function vy(e){let t=e.length;for(;t--;){let n=e[t];if(qv(n,`Missing node`),_y(n))return n}return null}function yy(e){return e&&Number(getComputedStyle(e).zIndex)||0}function by(e){let t=[];for(;e;)t.push(e),e=xy(e);return t}function xy(e){let{parentNode:t}=e;return py(t)?t.host:t}function Sy(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Cy({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!Zv(n)||n.contains(e)||e.contains(n))return!0;if(my(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(Sy(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function wy(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=ny(r),a=fy(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&Cy({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function Ty(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Ey(e,t,n=0){return Math.abs(Wv(e)-Wv(t))<=n}function Dy(e,t){return Ey(e,t)?0:e>t?1:-1}function Oy({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(Dy(r,c)<0)if(a){let e=(i+c)/2;r=Dy(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=Wv(r),r}function ky({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(Ey(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;qv(u!=null,`Invalid first pivot index`),qv(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];qv(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(qv(n!=null,`Previous layout not found for panel index ${t}`),Ey(n,i)){let t=o-n;Dy(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];qv(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(qv(n!=null,`Previous layout not found for panel index ${t}`),Ey(n,o)){let t=n-i;Dy(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];qv(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&Dy(i,c)<0)if(e>0){let t=c-o,n=t/2;Dy(i+e,c)<0&&(e=Dy(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;Dy(i-e,c)<0&&(e=Dy(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];qv(e!=null,`Previous layout not found for panel index ${r}`);let a=Oy({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];qv(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=Oy({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!Ey(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(Ty(c,l))return i;{let t=e<0?d:u,r=s[t];qv(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=Oy({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!Ey(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];qv(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=Oy({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(Ey(i,s)||(t-=s-i,l[r]=s),Ey(t,0))break;e>0?r--:r++}}}if(!Ey(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function Ay(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||Dy(e[n],t[n])!==0)return!1;return!0}function jy({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!Ey(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];qv(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];qv(i!=null,`No layout data found for index ${e}`);let o=r[e];qv(o!=null,`No layout data found for index ${e}`);let s=Oy({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!Ey(a,0))for(let e=0;e<t.length;e++){let n=r[e];qv(n!=null,`No layout data found for index ${e}`);let i=n+a,o=Oy({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,Ey(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function My({groupId:e,panelId:t}){let n=()=>{let t=ly();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=e=>{let r=a();if(e===r)return;let{defaultLayoutDeferred:i,derivedPanelConstraints:o,group:s,groupSize:c,layout:l,separatorToPanels:u}=n(),d=s.panels.findIndex(e=>e.id===t),f=d===s.panels.length-1,p=jy({layout:ky({delta:f?r-e:e-r,initialLayout:l,panelConstraints:o,pivotIndices:f?[d-1,d]:[d,d+1],prevLayout:l,trigger:`imperative-api`}),panelConstraints:o});Ay(l,p)||dy(s,{defaultLayoutDeferred:i,derivedPanelConstraints:o,groupSize:c,layout:p,separatorToPanels:u})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),s=a();e&&s!==t&&(n.expandToSize=s,o(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:s}=i(),c=a();if(e&&c===t){let e=s.expandToSize??n;e===0&&(e=1),o(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&Ey(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=Gv({group:t});o(Wv(Uv({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function Ny(e){e.defaultPrevented||wy(e,ly()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=My({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function Py(e){let t=ly();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function Fy({groupId:e}){let t=()=>{let t=ly();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=jy({layout:e,panelConstraints:r});return n?o:(Ay(o,c)||dy(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function Iy(e,t){let n=Py(e),r=cy(n.id,!0),i=n.separators.find(t=>t.element===e);qv(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);qv(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=Fy({groupId:n.id}).getLayout(),c=jy({layout:ky({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});Ay(s,c)||dy(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function Ly(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=Py(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&Iy(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&Iy(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&Iy(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&Iy(t,-5);break;case`End`:e.preventDefault(),Iy(t,100);break;case`Enter`:{e.preventDefault();let n=Py(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=cy(n.id,!0),o=n.separators.find(e=>e.element===t);qv(o,`Matching separator not found`);let s=a.get(o);qv(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(qv(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];Iy(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=Py(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);qv(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),Iy(t,-100);break}}var Ry={cursorFlags:0,state:`inactive`},zy=new ry;function By(){return Ry}function Vy(e){return zy.addListener(`change`,e)}function Hy(e){let t=Ry,n={...Ry};n.cursorFlags=e,Ry=n,zy.emit(`change`,{prev:t,next:n})}function Uy(e){let t=Ry;Ry=e,zy.emit(`change`,{prev:t,next:e})}function Wy(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=ly(),n=wy(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),Uy({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}var Gy=e=>e,Ky=()=>{},qy=1,Jy=2,Yy=4,Xy=8,Zy=3,Qy=12,$y;function eb(){return $y===void 0&&($y=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&($y=!0)),$y}function tb({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&eb()){let t=(e&qy)!==0,n=(e&Jy)!==0,r=(e&Yy)!==0,i=(e&Xy)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return eb()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var nb=new WeakMap;function rb(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=nb.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));let r=By();switch(r.state){case`active`:case`hover`:{let e=tb({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}nb.set(e,{prevStyle:t,styleSheet:n})}function ib({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=ky({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(Ay(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?qy:Jy;break;case`vertical`:s|=d<0?Yy:Xy;break}}else dy(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&Zy:c|=s&Zy,t.movementY===0?c|=o&Qy:c|=s&Qy,Hy(c),rb(e)}function ab(e){let t=ly(),n=By();switch(n.state){case`active`:ib({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function ob(e){if(e.defaultPrevented)return;let t=By(),n=ly();switch(t.state){case`active`:if(e.buttons===0){Uy({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=cy(e.group.id,!0);dy(e.group,t)});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}ib({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=wy(e,n);r.length===0?t.state!==`inactive`&&Uy({cursorFlags:0,state:`inactive`}):Uy({cursorFlags:0,hitRegions:r,state:`hover`}),rb(e.currentTarget);break}}}function sb(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(By().state){case`hover`:Uy({cursorFlags:0,state:`inactive`})}}function cb(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=By();switch(t.state){case`active`:Uy({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(rb(e.currentTarget),t.hitRegions.forEach(e=>{let t=cy(e.group.id,!0);dy(e.group,t)}),e.preventDefault())}}function lb(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=Wv(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=Wv((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function ub(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=Gv({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:Wv(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function db(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function fb({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=Wv(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=Wv((r[e]??0)/a*l);else{let e=Wv(l/c.length);for(let t of c)u[t]=e}return u}function pb(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var mb=new Map;function hb(e){let t=!0;qv(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=Gv({group:e});if(t===0)return;let n=cy(e.id);if(!n)return;let r=Kv(e),i=n.defaultLayoutDeferred?lb(r):n.layout,a=jy({layout:fb({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&Ay(n.layout,a)&&db(n.derivedPanelConstraints,r)&&n.groupSize===t)return;dy(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else ub(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{qv(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=Gv({group:e}),s=Kv(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(pb(e.panels,l)||(l=void 0));let u=jy({layout:e.mutableState.layouts[c]??l??lb(s),panelConstraints:s}),d=e.element.ownerDocument;mb.set(d,(mb.get(d)??0)+1);let f=new Map;return ny(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),dy(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{qv(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,Ly)}),mb.get(d)===1&&(d.addEventListener(`dblclick`,Ny,!0),d.addEventListener(`pointerdown`,Wy,!0),d.addEventListener(`pointerleave`,ab),d.addEventListener(`pointermove`,ob),d.addEventListener(`pointerout`,sb),d.addEventListener(`pointerup`,cb,!0)),function(){t=!1,mb.set(d,Math.max(0,(mb.get(d)??0)-1)),oy(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,Ly)}),mb.get(d)||(d.removeEventListener(`dblclick`,Ny,!0),d.removeEventListener(`pointerdown`,Wy,!0),d.removeEventListener(`pointerleave`,ab),d.removeEventListener(`pointermove`,ob),d.removeEventListener(`pointerout`,sb),d.removeEventListener(`pointerup`,cb,!0)),a.disconnect()}}function gb(){let[e,t]=(0,Q.useState)({});return[e,(0,Q.useCallback)(()=>t({}),[])]}function _b(e){let t=(0,Q.useId)();return`${e??t}`}var vb=typeof window<`u`?Q.useLayoutEffect:Q.useEffect;function yb(e){let t=(0,Q.useRef)(e);return vb(()=>{t.current=e},[e]),(0,Q.useCallback)((...e)=>t.current?.(...e),[t])}function bb(...e){return yb(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function xb(e){let t=(0,Q.useRef)({...e});return vb(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var Sb=(0,Q.createContext)(null);function Cb(e,t){let n=(0,Q.useRef)({getLayout:()=>({}),setLayout:Gy});(0,Q.useImperativeHandle)(t,()=>n.current,[]),vb(()=>{Object.assign(n.current,Fy({groupId:e}))})}function wb({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,Q.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=yb(e=>{Ay(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=yb(e=>{Ay(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e))}),_=_b(s),v=(0,Q.useRef)(null),[y,b]=gb(),x=(0,Q.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=bb(v,a);Cb(_,o);let C=yb((e,t)=>{let r=By(),i=sy(e),a=cy(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),w=xb({defaultLayout:n,disableCursor:r}),T=(0,Q.useMemo)(()=>({get disableCursor(){return!!w.disableCursor},getPanelStyles:C,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=Jv(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=Jv(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},updatePanelProps:(e,{disabled:t})=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=sy(_),i=cy(_);r&&i&&dy(r,{...i,derivedPanelConstraints:Kv(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=x.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[C,_,b,u,w]),E=(0,Q.useRef)(null);return vb(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(w.defaultLayout!==void 0&&Object.keys(w.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=w.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!w.disableCursor,expandedPanelSizes:x.current.lastExpandedPanelSizes,layouts:x.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};E.current=r;let a=hb(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=cy(r.id,!0);!o&&s.length>0&&(h(c),g(c));let l=uy(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=Ey(t.collapsedSize,i[t.panelId]),a=Ey(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=By().state!==`active`;h(i),o&&g(i)});return()=>{E.current=null,a(),l()}},[i,_,g,h,u,y,w]),(0,Q.useEffect)(()=>{let e=E.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,Z.jsx)(Sb.Provider,{value:T,children:(0,Z.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:S,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}wb.displayName=`Group`;function Tb(){let e=(0,Q.useContext)(Sb);return qv(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function Eb(e,t){let{id:n}=Tb(),r=(0,Q.useRef)({collapse:Ky,expand:Ky,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Ky});(0,Q.useImperativeHandle)(t,()=>r.current,[]),vb(()=>{Object.assign(r.current,My({groupId:n,panelId:e}))})}function Db({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=_b(c),_=xb({disabled:a}),v=(0,Q.useRef)(null),y=bb(v,o),{getPanelStyles:b,id:x,orientation:S,registerPanel:C,updatePanelProps:w}=Tb(),T=d!==null,E=yb((e,t,n)=>{d?.(e,c,n)});vb(()=>{let e=v.current;if(e!==null)return C({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:T?E:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}})},[s,n,r,i,T,g,h,l,u,E,C,_]),(0,Q.useEffect)(()=>{w(g,{disabled:a})},[a,g,w]),Eb(g,f);let D=()=>{let e=b(x,g);if(e)return JSON.stringify(e)},O=(0,Q.useSyncExternalStore)(e=>uy(x,e),D,D),k;return k=O?JSON.parse(O):i?{flexGrow:void 0,flexShrink:void 0,flexBasis:i}:{flexGrow:1},(0,Z.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...Ob,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...k},children:(0,Z.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:S===`horizontal`?`pan-y`:`pan-x`},children:e})})}Db.displayName=`Panel`;var Ob={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function kb(){return(0,Q.useRef)(null)}function Ab({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=jy({layout:ky({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=jy({layout:ky({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function jb({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=_b(a),l=xb({disabled:n,disableDoubleClick:r}),[u,d]=(0,Q.useState)({}),[f,p]=(0,Q.useState)(`inactive`),m=(0,Q.useRef)(null),h=bb(m,i),{disableCursor:g,id:_,orientation:v,registerSeparator:y,updateSeparatorProps:b}=Tb(),x=v===`horizontal`?`vertical`:`horizontal`;vb(()=>{let e=m.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=y(t),r=Vy(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=uy(_,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(Ab({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[_,c,y,l]),(0,Q.useEffect)(()=>{b(c,{disabled:n,disableDoubleClick:r})},[n,r,c,b]);let S;return n&&!g&&(S=`not-allowed`),(0,Z.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":x,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":n?`disabled`:f,"data-testid":c,id:c,ref:h,role:`separator`,style:{flexBasis:`auto`,cursor:S,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}jb.displayName=`Separator`;var Mb={name:`toml`,startState:function(){return{inString:!1,stringType:``,lhs:!0,inArray:0}},token:function(e,t){let n;if(!t.inString&&(n=e.match(/^('''|"""|'|")/))&&(t.stringType=n[0],t.inString=!0),e.sol()&&!t.inString&&t.inArray===0&&(t.lhs=!0),t.inString){for(;t.inString;)if(e.match(t.stringType))t.inString=!1;else if(e.peek()===`\\`)e.next(),e.next();else if(e.eol())break;else e.match(/^.[^\\\"\']*/);return t.lhs?`property`:`string`}else if(t.inArray&&e.peek()===`]`)return e.next(),t.inArray--,`bracket`;else if(t.lhs&&e.peek()===`[`&&e.skipTo(`]`))return e.next(),e.peek()===`]`&&e.next(),`atom`;else if(e.peek()===`#`)return e.skipToEnd(),`comment`;else if(e.eatSpace())return null;else if(t.lhs&&e.eatWhile(function(e){return e!=`=`&&e!=` `}))return`property`;else if(t.lhs&&e.peek()===`=`)return e.next(),t.lhs=!1,null;else if(!t.lhs&&e.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return`atom`;else if(!t.lhs&&(e.match(`true`)||e.match(`false`)))return`atom`;else if(!t.lhs&&e.peek()===`[`)return t.inArray++,e.next(),`bracket`;else if(!t.lhs&&e.match(/^\-?\d+(?:\.\d+)?/))return`number`;else e.eatSpace()||e.next();return null},languageData:{commentTokens:{line:`#`}}},Nb=h({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),Pb=an({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}});function Fb(e){switch(e.toLowerCase()){case`json`:case`canvas`:return pc().language;case`toml`:return lc.define(Mb);default:return null}}function Ib(e){let t=(0,$.c)(5),{_:n}=i(),r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={status:`loading`},t[0]=r):r=t[0];let[a,o]=(0,Q.useState)(r),s,c;return t[1]!==n||t[2]!==e?(s=()=>{let t=!1,r=new AbortController;return o({status:`loading`}),fetch(e,{credentials:`same-origin`,signal:r.signal}).then(async e=>{if(!e.ok){let t=e.status;throw Error(n(t===413?{id:`C_WGy8`}:t===404?{id:`s0IDhW`}:t===400?{id:`N1mdmS`}:{id:`96w9hU`,values:{status:t}}))}return e.text()}).then(e=>{t||o({status:`loaded`,content:e})}).catch(e=>{t||e instanceof Error&&e.name===`AbortError`||o({status:`error`,message:e instanceof Error?e.message:n({id:`ig5vUe`})})}),()=>{t=!0,r.abort()}},c=[e,n],t[1]=n,t[2]=e,t[3]=s,t[4]=c):(s=t[3],c=t[4]),(0,Q.useEffect)(s,c),a}function Lb(e){let t=(0,$.c)(28),{src:n,fileName:r,extension:i}=e,a=(0,Q.useRef)(null),o=(0,Q.useRef)(null),{resolvedTheme:c}=Li(),l=Ib(n),u=l.status===`loaded`?l.content:null,d,f;if(t[0]!==i||t[1]!==u||t[2]!==c?(d=()=>{if(!a.current||u===null)return;let e=Fb(i),t=c===`dark`?Nb:Pb,n=[Tc,...e?[e]:[],ac.editable.of(!0),Ys.readOnly.of(!0),ac.lineWrapping,t],r=new ac({state:Ys.create({doc:u,extensions:n}),parent:a.current});return o.current=r,()=>{r.destroy(),o.current=null}},f=[u,i,c],t[0]=i,t[1]=u,t[2]=c,t[3]=d,t[4]=f):(d=t[3],f=t[4]),(0,Q.useEffect)(d,f),l.status===`loading`){let e;t[5]===r?e=t[6]:(e=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`Md709y`,values:{fileName:r}})}),t[5]=r,t[6]=e);let n;return t[7]!==i||t[8]!==r||t[9]!==e?(n=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center bg-background text-muted-foreground text-sm`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`loading`,"data-text-viewer-extension":i,children:e}),t[7]=i,t[8]=r,t[9]=e,t[10]=n):n=t[10],n}if(l.status===`error`){let e;t[11]===r?e=t[12]:(e=(0,Z.jsx)(`div`,{className:`font-medium text-sm`,children:(0,Z.jsx)(s,{id:`qdBUHP`,values:{fileName:r}})}),t[11]=r,t[12]=e);let a;t[13]===l.message?a=t[14]:(a=(0,Z.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:l.message}),t[13]=l.message,t[14]=a);let o;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(s,{id:`9npOH9`}),t[15]=o):o=t[15];let c;t[16]===n?c=t[17]:(c=(0,Z.jsx)(`a`,{href:n,className:`mt-2 rounded-md border px-3 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground`,children:o}),t[16]=n,t[17]=c);let u;return t[18]!==i||t[19]!==r||t[20]!==e||t[21]!==a||t[22]!==c?(u=(0,Z.jsxs)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center gap-2 bg-background p-4 text-center`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`error`,"data-text-viewer-extension":i,children:[e,a,c]}),t[18]=i,t[19]=r,t[20]=e,t[21]=a,t[22]=c,t[23]=u):u=t[23],u}let p;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(`div`,{ref:a,className:`min-h-0 flex-1 overflow-auto`}),t[24]=p):p=t[24];let m;return t[25]!==i||t[26]!==r?(m=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`loaded`,"data-text-viewer-extension":i,children:p}),t[25]=i,t[26]=r,t[27]=m):m=t[27],m}function Rb(e){return Si(`/api/asset?path=${encodeURIComponent(e)}`)}function zb(e){return`/api/asset-text?path=${encodeURIComponent(e)}`}function Bb(e){let t=(0,$.c)(31),{assetPath:n,mediaKind:r}=e,[i,a]=(0,Q.useState)(!1),o;t[0]===n?o=t[1]:(o=Rb(n),t[0]=n,t[1]=o);let c=o,l;t[2]===n?l=t[3]:(l=n.split(`/`).pop()??n,t[2]=n,t[3]=l);let u=l,d,f,p,m;if(t[4]!==n||t[5]!==u||t[6]!==i||t[7]!==r||t[8]!==c){m=Symbol.for(`react.early_return_sentinel`);bb0:{if(p=u.includes(`.`)?u.split(`.`).pop()??``:``,f=p.length>0?p.toUpperCase():`FILE`,d=i?`text`:r,d===`pdf`){let e;t[13]!==u||t[14]!==c?(e=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,Z.jsx)(Fe,{src:c,title:u,fillContainer:!0})}),t[13]=u,t[14]=c,t[15]=e):e=t[15];let n;t[16]!==u||t[17]!==e?(n=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":u,children:e}),t[16]=u,t[17]=e,t[18]=n):n=t[18],m=n;break bb0}if(d===`text`){let e;t[19]===n?e=t[20]:(e=zb(n),t[19]=n,t[20]=e),m=(0,Z.jsx)(Lb,{src:e,fileName:u,extension:p.toLowerCase()},n);break bb0}}t[4]=n,t[5]=u,t[6]=i,t[7]=r,t[8]=c,t[9]=d,t[10]=f,t[11]=p,t[12]=m}else d=t[9],f=t[10],p=t[11],m=t[12];if(m!==Symbol.for(`react.early_return_sentinel`))return m;let h;t[21]!==n||t[22]!==d||t[23]!==f||t[24]!==u||t[25]!==p||t[26]!==c?(h=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:d===`image`?(0,Z.jsx)(zt,{src:c,alt:u,draggable:!1,slotClassName:`flex h-full w-full items-center justify-center`,className:`max-h-full max-w-full`}):d===`video`?(0,Z.jsx)(`video`,{src:c,controls:!0,className:`max-h-full max-w-full`}):d===`audio`?(0,Z.jsx)(`audio`,{src:c,controls:!0,className:`w-full max-w-md`}):(0,Z.jsxs)(`div`,{className:`flex max-w-sm flex-col items-center gap-3 text-center`,children:[(0,Z.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-md border bg-muted font-medium text-muted-foreground text-sm`,children:f}),(0,Z.jsx)(`div`,{className:`max-w-full break-words font-medium text-sm`,children:u}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[(0,Z.jsx)(sa,{variant:`outline`,size:`sm`,onClick:()=>{V({url:c,projectRelPath:n,ext:p.toLowerCase(),title:u,forceOsDelegation:!1})},children:(0,Z.jsx)(s,{id:`9npOH9`})}),(0,Z.jsx)(sa,{variant:`outline`,size:`sm`,onClick:()=>a(!0),"data-testid":`asset-preview-open-as-text`,children:(0,Z.jsx)(s,{id:`Ruuu3v`})})]})]})}),t[21]=n,t[22]=d,t[23]=f,t[24]=u,t[25]=p,t[26]=c,t[27]=h):h=t[27];let g;return t[28]!==u||t[29]!==h?(g=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":u,children:h}),t[28]=u,t[29]=h,t[30]=g):g=t[30],g}function Vb(){let e=(0,$.c)(5),{_:t}=i(),n;e[0]===t?n=e[1]:(n=t({id:`3VsNTI`}),e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(Pa,{className:`h-9 w-2/5 mt-6 mb-5`}),(0,Z.jsx)(Pa,{className:`h-4 w-full`}),(0,Z.jsx)(Pa,{className:`h-4 w-3/4`})]}),e[2]=r):r=e[2];let a;return e[3]===n?a=e[4]:(a=(0,Z.jsx)(`div`,{className:`tiptap-editor pt-10`,role:`status`,"aria-busy":`true`,"aria-label":n,children:r}),e[3]=n,e[4]=a),a}var Hb={"claude-cowork":`claude`,"claude-code":`claude`,codex:`openai`,cursor:`cursor`};function Ub(e){let t=(0,$.c)(23),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({id:r,style:a,className:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let{resolvedTheme:o}=Li(),s=Hb[r],c=s?(o===`dark`?ui[s]:void 0)??Fi[s]:void 0,l;t[5]!==c||t[6]!==a?(l=c?{...a,"--ok-brand-color":c}:a,t[5]=c,t[6]=a,t[7]=l):l=t[7];let u=l,d=c&&`[&_*]:![color:var(--ok-brand-color)]`,f;t[8]!==n||t[9]!==d?(f=ea(d,n),t[8]=n,t[9]=d,t[10]=f):f=t[10];let p=f;if(r===`claude-cowork`||r===`claude-code`){let e;return t[11]!==p||t[12]!==u||t[13]!==i?(e=(0,Z.jsx)(fa,{style:u,className:p,...i}),t[11]=p,t[12]=u,t[13]=i,t[14]=e):e=t[14],e}if(r===`codex`){let e;return t[15]!==p||t[16]!==u||t[17]!==i?(e=(0,Z.jsx)(da,{style:u,className:p,...i}),t[15]=p,t[16]=u,t[17]=i,t[18]=e):e=t[18],e}if(r===`cursor`){let e;return t[19]!==p||t[20]!==u||t[21]!==i?(e=(0,Z.jsx)(va,{style:u,className:p,...i}),t[19]=p,t[20]=u,t[21]=i,t[22]=e):e=t[22],e}return null}function Wb(e){let{installState:t}=e;return t.installed===null?Y._({id:`IA6JW2`}):t.installed===!1?Y._({id:`5SwVv1`}):null}function Gb(e){let{target:t,installState:n}=e;if(n.installed===null)return{enabled:!1,tooltip:null};if(n.installed===!1){let e=t.appBrandName??t.displayName;return{enabled:!1,tooltip:{message:Y._({id:`OJTOUj`,values:{brand:e}}),installAction:{label:Y._({id:`fG0X0e`,values:{brand:e}}),url:t.installUrl},...t.hasWebFallback?{webFallback:{label:Y._({id:`0S9PW_`}),url:``}}:{}}}}return{enabled:!0,tooltip:null}}function Kb(e){return _r(e)}function qb(e){return Y._({id:`h_HYHD`,values:{displayName:e}})}var Jb=`claude.ai`;async function Yb(e,t=tg){(await t(_r(e))).ok?X.success(qb(Jb)):X.error(Y._({id:`9NC_MT`,values:{CLAUDE_WEB_FALLBACK_LABEL:Jb}}))}function Xb(e){let t=(0,$.c)(68),{_:n}=i(),{target:r,installState:a,isElectronHost:o,prompt:s,onSelect:c}=e,l=e.openExternal??tg,u=e.onWebFallbackSuccess??Qb,d=e.onWebFallbackError??Zb,{displayName:f}=r,p,m,h,g,_,v,y,b,x,S;if(t[0]!==n||t[1]!==a||t[2]!==o||t[3]!==c||t[4]!==d||t[5]!==u||t[6]!==l||t[7]!==s||t[8]!==r||t[9]!==f){S=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Gb({target:r,installState:a,isElectronHost:o}),i=Wb({target:r,installState:a,isElectronHost:o}),C=()=>{e.tooltip&&l(e.tooltip.installAction.url)},w;t[20]!==d||t[21]!==u||t[22]!==l||t[23]!==s||t[24]!==r?(w=()=>{(async()=>{let e=await l(Kb(s));e.ok?u(r):d(r,e.detail??e.reason)})()},t[20]=d,t[21]=u,t[22]=l,t[23]=s,t[24]=r,t[25]=w):w=t[25];let T=w;if(e.enabled){let e=`open-in-agent-item-${r.id}`,i;t[26]!==n||t[27]!==f?(i=n({id:`NnQapF`,values:{targetDisplayName:f}}),t[26]=n,t[27]=f,t[28]=i):i=t[28];let a;t[29]===r.id?a=t[30]:(a=(0,Z.jsx)(Ub,{id:r.id,"aria-hidden":`true`}),t[29]=r.id,t[30]=a);let o;t[31]===r.displayName?o=t[32]:(o=(0,Z.jsx)(`span`,{children:r.displayName}),t[31]=r.displayName,t[32]=o);let s;t[33]!==c||t[34]!==i||t[35]!==a||t[36]!==o||t[37]!==e?(s=(0,Z.jsxs)($o,{onSelect:c,"data-testid":e,"aria-label":i,children:[a,o]}),t[33]=c,t[34]=i,t[35]=a,t[36]=o,t[37]=e,t[38]=s):s=t[38],S=s;break bb0}if(!e.tooltip){let e=n(i?{id:`If0crP`,values:{targetDisplayName:f,hint:i}}:{id:`NnQapF`,values:{targetDisplayName:f}}),a;t[39]===r.id?a=t[40]:(a=(0,Z.jsx)(Ub,{id:r.id,"aria-hidden":`true`}),t[39]=r.id,t[40]=a);let o;t[41]===r.displayName?o=t[42]:(o=(0,Z.jsx)(`span`,{className:`flex-1`,children:r.displayName}),t[41]=r.displayName,t[42]=o),S=(0,Z.jsxs)($o,{disabled:!0,"data-testid":`open-in-agent-item-${r.id}`,"aria-label":e,children:[a,o,i?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:i}):null]});break bb0}let E=n(i?{id:`If0crP`,values:{targetDisplayName:f,hint:i}}:{id:`NnQapF`,values:{targetDisplayName:f}}),D=e.tooltip.webFallback?.label??``;m=Ko;let O=`open-in-agent-item-${r.id}`,k;t[43]===r.id?k=t[44]:(k=(0,Z.jsx)(Ub,{id:r.id,"aria-hidden":`true`,className:`mr-2`}),t[43]=r.id,t[44]=k);let A;t[45]===r.displayName?A=t[46]:(A=(0,Z.jsx)(`span`,{className:`flex-1`,children:r.displayName}),t[45]=r.displayName,t[46]=A);let j;t[47]===i?j=t[48]:(j=i?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:i}):null,t[47]=i,t[48]=j),t[49]!==E||t[50]!==k||t[51]!==A||t[52]!==j||t[53]!==O?(x=(0,Z.jsxs)(Oo,{"data-testid":O,"data-row-disabled":``,"aria-label":E,children:[k,A,j]}),t[49]=E,t[50]=k,t[51]=A,t[52]=j,t[53]=O,t[54]=x):x=t[54],p=es,h=`min-w-[260px]`,g=`open-in-agent-submenu-${r.id}`,_=(0,Z.jsx)(Fo,{className:`font-normal text-muted-foreground text-xs`,"data-testid":`open-in-agent-message-${r.id}`,children:e.tooltip.message}),t[55]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(To,{}),t[55]=v):v=t[55],y=(0,Z.jsx)($o,{onSelect:C,"data-testid":`open-in-agent-install-${r.id}`,children:(0,Z.jsx)(`span`,{children:e.tooltip.installAction.label})}),b=e.tooltip.webFallback?(0,Z.jsxs)($o,{onSelect:T,"data-testid":`open-in-agent-web-fallback-${r.id}`,"aria-label":n({id:`lsOFZR`,values:{webFallbackLabel:D}}),children:[(0,Z.jsx)(`span`,{className:`flex-1`,children:e.tooltip.webFallback.label}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:n({id:`Z9BoIy`})})]}):null}t[0]=n,t[1]=a,t[2]=o,t[3]=c,t[4]=d,t[5]=u,t[6]=l,t[7]=s,t[8]=r,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_,t[15]=v,t[16]=y,t[17]=b,t[18]=x,t[19]=S}else p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=t[16],b=t[17],x=t[18],S=t[19];if(S!==Symbol.for(`react.early_return_sentinel`))return S;let C;t[56]!==p||t[57]!==h||t[58]!==g||t[59]!==_||t[60]!==v||t[61]!==y||t[62]!==b?(C=(0,Z.jsxs)(p,{className:h,"data-testid":g,children:[_,v,y,b]}),t[56]=p,t[57]=h,t[58]=g,t[59]=_,t[60]=v,t[61]=y,t[62]=b,t[63]=C):C=t[63];let w;return t[64]!==m||t[65]!==x||t[66]!==C?(w=(0,Z.jsxs)(m,{children:[x,C]}),t[64]=m,t[65]=x,t[66]=C,t[67]=w):w=t[67],w}function Zb(){}function Qb(){}function $b(e){let t=(0,$.c)(12),{className:n}=e,{states:r,refresh:i}=jg(),{dispatch:a}=bg(),o=No(),s,c;if(t[0]!==n||t[1]!==a||t[2]!==i||t[3]!==r||t[4]!==o){let e=sg({workspace:o});t[7]===n?s=t[8]:(s=ea(`grid w-full max-w-5xl gap-4 sm:grid-cols-3`,n),t[7]=n,t[8]=s),c=Ch.map(t=>{let n=r[t.id]?.installed,o=n===!0?`installed`:n===!1?`missing`:`pending`;return(0,Z.jsx)(ex,{target:t,status:o,onOpen:o===`installed`&&e!==null?()=>{a(t.id,e)}:void 0,onInstall:()=>{ug(t),i()}},t.id)}),t[0]=n,t[1]=a,t[2]=i,t[3]=r,t[4]=o,t[5]=s,t[6]=c}else s=t[5],c=t[6];let l;return t[9]!==s||t[10]!==c?(l=(0,Z.jsx)(`div`,{className:s,children:c}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function ex(e){let t=(0,$.c)(17),{target:n,status:r,onOpen:i,onInstall:a}=e,o=r===`installed`?i:r===`missing`?a:void 0,s=r===`pending`||r===`installed`&&i===void 0,c=r===`installed`?`Open`:r===`missing`?`Install`:`Checking`,l;t[0]===n.id?l=t[1]:(l=(0,Z.jsx)(Ub,{id:n.id,"aria-hidden":`true`,className:`size-4`}),t[0]=n.id,t[1]=l);let u;t[2]===n.displayName?u=t[3]:(u=(0,Z.jsx)(`h3`,{className:`text-sm font-medium leading-tight`,children:n.displayName}),t[2]=n.displayName,t[3]=u);let d;t[4]!==l||t[5]!==u?(d=(0,Z.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center gap-2`,children:[l,u]}),t[4]=l,t[5]=u,t[6]=d):d=t[6];let f;t[7]===r?f=t[8]:(f=r===`missing`?(0,Z.jsx)(ms,{"aria-hidden":`true`,className:`size-3`}):null,t[7]=r,t[8]=f);let p;t[9]!==c||t[10]!==f?(p=(0,Z.jsxs)(`p`,{className:`inline-flex items-center gap-1 font-mono text-2xs uppercase tracking-wider text-muted-foreground`,children:[c,f]}),t[9]=c,t[10]=f,t[11]=p):p=t[11];let m;return t[12]!==s||t[13]!==o||t[14]!==d||t[15]!==p?(m=(0,Z.jsxs)(`button`,{type:`button`,onClick:o,disabled:s,className:`group flex h-full flex-row items-center justify-between gap-4 rounded-xl border border-border/60 bg-card p-4 text-left transition-[border-color,box-shadow,transform] hover:border-border hover:shadow-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:cursor-not-allowed disabled:opacity-60`,children:[d,p]}),t[12]=s,t[13]=o,t[14]=d,t[15]=p,t[16]=m):m=t[16],m}var tx=3100,nx=3;function rx(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??nx;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var ix={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:500,durationMin:1100,durationMax:2400}},ax=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function ox(e,t={}){let n=t.rng??Math.random,r=t.colors??ax,i=ix[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var sx=1.8,cx=90,lx=16,ux=380,dx=.025,fx=.1,px=.18,mx=400,hx=9.2736,gx=18.1799,_x=14.5244,vx={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function yx(e,t){let{halfWidth:n,apexLift:r}=vx[t];return`M${e-n} ${_x+.3} Q${e} ${_x-r}, ${e+n} ${_x+.3}`}function bx(e){let t=1.5,n=.3;return`M${e-t} ${_x-n} Q${e} ${_x+1.4}, ${e+t} ${_x-n}`}var xx=15,Sx=15;function Cx(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function wx(e){let t=(0,$.c)(71),{size:n,className:r,trackMouse:i,variant:a,celebrateSignal:o}=e,s=n===void 0?48:n,c=i===void 0?!0:i,l=a===void 0?`default`:a,u=o===void 0?0:o,d=(0,Q.useRef)(null),f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={x:0,y:0},t[0]=m):m=t[0];let h=(0,Q.useRef)(m),[g,_]=(0,Q.useState)(0),[v,y]=(0,Q.useState)(0),b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[1]=b):b=t[1];let[x,S]=(0,Q.useState)(b),C=(0,Q.useRef)(0),w=(0,Q.useRef)(void 0),T=l===`sleeping`,E;t[2]!==g||t[3]!==T?(E=function(){if(T)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=C.current===0?1/0:e-C.current;C.current=e;let n=rx(g,t);_(n),y(Ox),S(ox(n)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},tx)},t[2]=g,t[3]=T,t[4]=E):E=t[4];let D=E,O,k;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>()=>clearTimeout(w.current),k=[],t[5]=O,t[6]=k):(O=t[5],k=t[6]),(0,Q.useEffect)(O,k);let A,j;t[7]!==u||t[8]!==T?(A=()=>{u===0||T||(_(3),y(Dx),S(ox(3)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},tx))},j=[u,T],t[7]=u,t[8]=T,t[9]=A,t[10]=j):(A=t[9],j=t[10]),(0,Q.useEffect)(A,j);let M,N;t[11]!==T||t[12]!==c?(M=()=>{if(!c||T||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,l=function(){s===0&&(s=requestAnimationFrame(m))},u=function(r){e=r.clientX,t=r.clientY,n=!0,l()};function m(){s=0;let c=f.current,u=d.current;if(!c||!u){l();return}let m=n;n=!1;let g=c.getBoundingClientRect(),_=g.left+g.width/2,v=g.top+g.height*.48,y=e-_,b=t-v,x=Math.hypot(y,b),S=Math.max(-1,Math.min(1,y/ux)),C=Math.max(-1,Math.min(1,b/ux)),w=S*lx,T=-C*lx,E=0,D=0;if(x>=1){let e=Math.min(x/cx,1)*sx;E=y/x*e,D=b/x*e}let O=Math.abs(T-r)<.01&&Math.abs(w-i)<.01&&Math.abs(E-a)<.01&&Math.abs(D-o)<.01;if(!m&&O)return;l(),r+=(T-r)*fx,i+=(w-i)*fx,u.style.transform=`perspective(${mx}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(E-a)*px,o+=(D-o)*px;let k=i*dx,A=-r*dx,j=a+k,M=o+A;h.current.x=j,h.current.y=M,p.current?.setAttribute(`transform`,`translate(${j.toFixed(3)} ${M.toFixed(3)})`)}return document.addEventListener(`mousemove`,u,{passive:!0}),l(),()=>{document.removeEventListener(`mousemove`,u),s!==0&&cancelAnimationFrame(s),s=0,d.current&&(d.current.style.transform=``),h.current={x:0,y:0},p.current?.removeAttribute(`transform`)}},N=[c,T],t[11]=T,t[12]=c,t[13]=M,t[14]=N):(M=t[13],N=t[14]),(0,Q.useEffect)(M,N);let P;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>{let e=p.current;if(!e)return;let{x:t,y:n}=h.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[15]=P):P=t[15],(0,Q.useLayoutEffect)(P);let F=g>0,I=F?g:1,L=F?`ok-blob-clicked-${g}`:null,R;t[16]===r?R=t[17]:(R=ea(`ok-blob-3d-wrapper`,r),t[16]=r,t[17]=R);let z=T?`cursor-default`:`cursor-pointer`,B=`body-${v}`,V=T&&`ok-blob-sleeping`,H;t[18]!==L||t[19]!==V?(H=ea(`ok-blob-group`,V,L),t[18]=L,t[19]=V,t[20]=H):H=t[20];let U;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(`path`,{d:`M25.2339 6.78134C25.5199 7.35734 25.8179 8.47234 26.0179 9.07834C26.0189 9.08234 26.0209 9.08634 26.0219 9.09134C26.0229 9.09534 26.0249 9.10034 26.0259 9.10434C26.0539 9.19734 26.0949 9.29533 26.1519 9.41633C26.2919 9.71133 26.5269 10.1173 27.1299 11.1683C27.3259 11.4643 27.5209 11.7693 27.7119 12.0903C29.9739 15.1623 29.3259 20.1913 27.0469 22.9153C26.7779 23.2953 26.4869 23.6043 26.1889 23.8863C26.1519 23.9253 26.1129 23.9643 26.0729 24.0033C25.3159 24.7543 24.2949 25.4673 23.6129 25.8323C22.7469 26.2983 22.1349 26.5483 21.6299 26.7463C20.3649 27.3063 19.0609 27.7733 17.6569 28.0423C15.9649 28.3513 14.1939 28.4433 12.4569 28.1373C11.4779 27.9663 10.5119 27.6663 9.60891 27.2493C8.77491 26.8663 7.99192 26.3853 7.26992 25.8403C6.83592 25.5393 6.43893 25.2343 6.08093 24.9383C5.57893 24.5223 5.15993 24.1263 4.83493 23.7793C4.04993 22.9443 3.31593 21.8893 2.80893 21.0953C2.72593 20.9663 2.64792 20.8433 2.57592 20.7293C2.56192 20.7093 2.54793 20.6893 2.53393 20.6703C2.08593 20.0263 1.71892 19.3293 1.43792 18.5993C1.42892 18.5453 1.42093 18.4903 1.41293 18.4353C1.32093 17.7443 1.08292 16.9423 1.01092 15.6333C0.984921 15.0653 0.998928 14.4013 1.12393 13.6353C1.20693 13.1413 1.31993 12.9023 1.40893 12.7113C1.43593 12.6543 1.46193 12.6023 1.48593 12.5483C1.56793 12.3653 1.59392 12.1563 1.63592 11.9083C1.68992 11.5883 1.76992 11.1943 2.04592 10.7553C2.94392 9.37934 3.36792 8.81934 3.66592 8.33934C3.75592 8.20334 3.84292 8.08134 3.94192 7.96634C4.21592 7.64634 4.67693 7.29534 5.10293 7.05734C5.16693 7.02234 5.23093 6.98834 5.29193 6.95534C5.62993 6.77834 6.22592 6.30135 6.66992 5.92035C6.83692 5.77635 7.08193 5.60735 7.37393 5.40935C7.67393 5.20535 8.02593 4.96934 8.39193 4.70234C9.32093 4.02634 9.84091 3.69134 10.2599 3.42334C10.3799 3.34734 10.4919 3.27734 10.6049 3.20834C10.9609 2.98834 11.4149 2.73034 11.8869 2.48634C12.4519 2.19334 13.0469 1.92133 13.5089 1.72233C14.7399 1.30233 16.0539 1.01333 17.4169 1.00033C18.1169 0.991333 18.7939 1.16534 19.2389 1.43034C19.6869 1.69534 19.8689 2.00335 19.8039 2.23935C19.7379 2.47835 19.4399 2.63634 19.0109 2.74734C18.5789 2.85634 18.0469 2.92035 17.4889 2.96135C16.3639 3.04235 15.2399 3.36435 14.1499 3.80835C12.8199 4.35135 11.5379 5.07133 10.2719 5.84733C9.38691 6.39133 8.51192 6.97334 7.63592 7.56834C7.54492 7.63034 7.45492 7.69135 7.36492 7.75235C6.97392 8.06635 6.58293 8.38134 6.22293 8.66334C5.97893 8.85734 5.76793 9.04834 5.59393 9.21434C5.26893 9.52334 5.02393 9.74334 4.81893 9.93934C4.67793 10.0753 4.55793 10.2013 4.45593 10.3443C4.40093 10.4213 4.32992 10.5273 4.24792 10.6593C3.90492 11.1933 3.44493 12.1693 3.15393 13.1173C3.01893 13.5363 2.87991 14.0343 2.79391 14.5253C2.66591 15.2253 2.65594 15.9053 2.71994 16.2373C2.82794 16.8193 2.95593 17.4833 3.14093 18.0553C3.31293 18.6003 3.52991 19.0583 3.70791 19.2823C3.81591 19.4183 3.90394 19.5473 3.99594 19.6913C4.09394 19.8413 4.19191 20.0073 4.31091 20.2033C4.47891 20.4803 4.68592 20.8163 5.00192 21.2493C5.36492 21.7463 5.61793 22.1043 5.83493 22.4023C6.14493 22.8243 6.38591 23.1343 6.83691 23.5033C7.33891 23.9113 7.86593 24.3113 8.26693 24.6393C8.44893 24.7883 8.66993 24.9443 8.90493 25.0963C9.21593 25.2963 9.55192 25.4893 9.85592 25.6703C10.1059 25.8203 10.3059 25.9633 10.4869 26.0863C10.5429 26.1243 10.5979 26.1603 10.6519 26.1943C10.8699 26.2803 11.0929 26.3593 11.3159 26.4283C11.3539 26.4323 11.3949 26.4353 11.4369 26.4393C11.6509 26.4573 11.9089 26.4733 12.2209 26.5133C12.7169 26.5753 13.1399 26.6603 13.6019 26.7243C13.9589 26.7733 14.3409 26.8083 14.7729 26.7893C15.0729 26.7753 15.4069 26.7353 15.7389 26.6813C16.2349 26.6023 16.7179 26.4943 17.0569 26.4473C17.1499 26.4343 17.2359 26.4343 17.3209 26.4373C17.3489 26.4393 17.3799 26.4413 17.4109 26.4433C17.4119 26.4433 17.4119 26.4433 17.4129 26.4433C17.4199 26.4433 17.4279 26.4443 17.4349 26.4443C18.2329 26.2413 19.0259 25.9433 19.7959 25.5983C19.8609 25.5633 19.9259 25.5273 19.9899 25.4913C20.3059 25.3173 20.6049 25.1383 20.7869 24.9943C20.9829 24.8393 21.5189 24.5373 22.0579 24.1853C22.4109 23.9553 22.7649 23.7053 23.0369 23.4833C23.1949 23.3553 23.3689 23.2693 23.5479 23.1773C23.7129 23.0923 23.8809 23.0013 24.0349 22.8653C24.1109 22.7983 24.1869 22.7173 24.2639 22.6303C24.3309 22.5563 24.4039 22.4723 24.4759 22.3923C24.5459 22.3153 24.7199 22.1723 24.9139 21.9793C25.0079 21.8863 25.1059 21.7783 25.1909 21.6713C25.2199 21.6323 25.2489 21.5943 25.2769 21.5553C25.5919 21.0403 25.8779 20.5003 26.1019 19.9653C26.1299 19.8403 26.1379 19.7293 26.1279 19.6373C26.1199 19.5703 26.1029 19.5113 26.0839 19.4503C26.0599 19.3643 26.0329 19.2773 26.0239 19.1723C26.0169 19.0893 26.0309 19.0043 26.0629 18.9543C26.0779 18.9323 26.0969 18.9143 26.1129 18.8993C26.1329 18.8823 26.1499 18.8673 26.1569 18.8443C26.1609 18.8273 26.1579 18.8073 26.1529 18.7833C26.1459 18.7443 26.1369 18.6943 26.1539 18.6293C26.2189 18.3853 26.2869 18.1103 26.3319 17.8383C26.3829 17.5393 26.4049 17.2433 26.3949 17.0123C26.3849 16.7493 26.3909 16.3823 26.3469 16.0003C26.3179 15.7343 26.2659 15.4663 26.1979 15.2383C26.1319 15.0143 26.0219 14.7913 25.9039 14.5783C25.7629 14.3223 25.6119 14.0783 25.5169 13.8453C25.4969 13.7983 25.4999 13.7263 25.4999 13.6323C25.5009 13.5673 25.4999 13.4913 25.4919 13.4083C25.3239 13.1243 25.1459 12.8423 24.9589 12.5483C24.9479 12.5413 24.9369 12.5333 24.9249 12.5263C24.6689 12.3503 24.3139 12.1173 24.0769 11.5503C24.0179 11.4063 24.0069 11.2983 23.9969 11.1993C23.9859 11.1013 23.9799 11.0183 23.9289 10.9093C23.8709 10.7853 23.7759 10.6583 23.6709 10.4993C23.5849 10.3703 23.4899 10.2133 23.4199 10.0423C23.3819 9.95134 23.3509 9.85734 23.3329 9.75934C23.3299 9.74334 23.3269 9.72534 23.3229 9.70634C23.2899 9.52734 23.2439 9.26534 23.2409 8.98634C23.0209 8.24434 22.8339 7.48833 22.6519 6.77633C22.3429 5.57133 22.0519 4.54234 21.3329 3.95434C20.9839 3.65334 20.5689 3.35433 20.2459 3.05433C19.9259 2.75633 19.7449 2.47534 19.8019 2.23834C19.8639 2.00634 20.1589 1.82934 20.6659 1.80534C21.1699 1.78334 21.8699 1.93235 22.5209 2.39235C23.6159 3.14235 24.2029 4.38334 24.5599 5.35734C24.5829 5.40834 24.6049 5.46034 24.6259 5.51234C24.7849 5.89434 24.9529 6.22834 25.1199 6.55534C25.1579 6.63034 25.1969 6.70834 25.2339 6.78134Z`,className:`ok-blob-body`}),t[21]=U):U=t[21];let ee=(F||T)&&`ok-blob-eye-hidden`,te;t[22]===ee?te=t[23]:(te=ea(`ok-blob-eye`,ee),t[22]=ee,t[23]=te);let W;t[24]===te?W=t[25]:(W=(0,Z.jsx)(`ellipse`,{cx:hx,cy:_x,rx:1.2722,ry:1.9083,className:te}),t[24]=te,t[25]=W);let ne=(F||T)&&`ok-blob-eye-hidden`,re;t[26]===ne?re=t[27]:(re=ea(`ok-blob-eye ok-blob-eye-right`,ne),t[26]=ne,t[27]=re);let G;t[28]===re?G=t[29]:(G=(0,Z.jsx)(`ellipse`,{cx:gx,cy:_x,rx:1.2722,ry:1.9083,className:re}),t[28]=re,t[29]=G);let ie;t[30]===I?ie=t[31]:(ie=yx(hx,I),t[30]=I,t[31]=ie);let K=(!F||T)&&`ok-blob-eye-hidden`,q;t[32]===K?q=t[33]:(q=ea(`ok-blob-happy-eye`,K),t[32]=K,t[33]=q);let ae;t[34]!==ie||t[35]!==q?(ae=(0,Z.jsx)(`path`,{d:ie,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:q}),t[34]=ie,t[35]=q,t[36]=ae):ae=t[36];let oe;t[37]===I?oe=t[38]:(oe=yx(gx,I),t[37]=I,t[38]=oe);let se=(!F||T)&&`ok-blob-eye-hidden`,ce;t[39]===se?ce=t[40]:(ce=ea(`ok-blob-happy-eye`,se),t[39]=se,t[40]=ce);let le;t[41]!==oe||t[42]!==ce?(le=(0,Z.jsx)(`path`,{d:oe,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ce}),t[41]=oe,t[42]=ce,t[43]=le):le=t[43];let ue;t[44]===T?ue=t[45]:(ue=T?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`path`,{d:bx(hx),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,Z.jsx)(`path`,{d:bx(gx),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[44]=T,t[45]=ue);let de;t[46]!==W||t[47]!==G||t[48]!==ae||t[49]!==le||t[50]!==ue?(de=(0,Z.jsxs)(`g`,{ref:p,children:[W,G,ae,le,ue]}),t[46]=W,t[47]=G,t[48]=ae,t[49]=le,t[50]=ue,t[51]=de):de=t[51];let fe;t[52]!==B||t[53]!==H||t[54]!==de?(fe=(0,Z.jsxs)(`g`,{className:H,children:[U,de]},B),t[52]=B,t[53]=H,t[54]=de,t[55]=fe):fe=t[55];let pe;t[56]===T?pe=t[57]:(pe=T?(0,Z.jsxs)(`g`,{children:[(0,Z.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,Z.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[56]=T,t[57]=pe);let me;t[58]!==v||t[59]!==x?(me=x.length>0&&(0,Z.jsx)(`g`,{children:x.map(Tx)},`firework-${v}`),t[58]=v,t[59]=x,t[60]=me):me=t[60];let he;t[61]!==D||t[62]!==s||t[63]!==z||t[64]!==fe||t[65]!==pe||t[66]!==me?(he=(0,Z.jsxs)(`svg`,{ref:f,width:s,height:s,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:z,"aria-hidden":`true`,onClick:D,onMouseDown:Ex,children:[fe,pe,me]}),t[61]=D,t[62]=s,t[63]=z,t[64]=fe,t[65]=pe,t[66]=me,t[67]=he):he=t[67];let ge;return t[68]!==R||t[69]!==he?(ge=(0,Z.jsx)(`span`,{ref:d,className:R,children:he}),t[68]=R,t[69]=he,t[70]=ge):ge=t[70],ge}function Tx(e){return(0,Z.jsx)(`circle`,{cx:xx+e.originDx,cy:Sx+e.originDy,r:e.size,className:`ok-blob-firework`,style:Cx(e)},e.id)}function Ex(e){return e.preventDefault()}function Dx(e){return e+1}function Ox(e){return e+1}function kx(e){let t=(0,$.c)(12),{title:n,subtitle:r,celebrateSignal:i}=e,a;t[0]===i?a=t[1]:(a=(0,Z.jsx)(wx,{size:64,celebrateSignal:i}),t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,Z.jsx)(`h2`,{className:`text-2xl font-light tracking-tighter text-balance`,children:n}),t[2]=n,t[3]=o);let s;t[4]===r?s=t[5]:(s=r?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r}):null,t[4]=r,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex items-center gap-4`,children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function Ax(){let e=(0,$.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=Us(`command-palette`),e[0]=t):t=e[0];let n=t,r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(D,{children:n}),e[1]=r):r=e[1];let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`p`,{className:`text-1sm text-muted-foreground`,children:[r,` `,(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`A1taO8`})})]}),e[2]=i):i=e[2],i}var jx=`open-knowledge:create-top-level-file`;function Mx(e={}){window.dispatchEvent(new CustomEvent(jx,{detail:e}))}function Nx(e){let t=t=>{let n=t.detail;e(n??{})};return window.addEventListener(jx,t),()=>window.removeEventListener(jx,t)}function Px(e){let t=(0,$.c)(33),{celebrateSignal:n,onAddStarterPack:r}=e,{_:a}=i(),o=bh(),c=ss(),l;t[0]!==c.data||t[1]!==c.status?(l=c.status===`ready`?c.data:[],t[0]=c.data,t[1]=c.status,t[2]=l):l=t[2];let u=l,d=c.status===`loading`||c.status===`idle`,f=c.status===`error`,p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=Us(`new-item`),t[3]=p):p=t[3];let m=p,h;t[4]===a?h=t[5]:(h=a({id:`FOGD7m`}),t[4]=a,t[5]=h);let g;t[6]===a?g=t[7]:(g=a({id:`LMbgDK`}),t[6]=a,t[7]=g);let _;t[8]!==n||t[9]!==h||t[10]!==g?(_=(0,Z.jsx)(kx,{title:h,subtitle:g,celebrateSignal:n}),t[8]=n,t[9]=h,t[10]=g,t[11]=_):_=t[11];let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(Lx,{shortcutLabel:m,onClick:Ix}),t[12]=v):v=t[12];let y;t[13]!==u||t[14]!==f||t[15]!==d?(y=d||f||u.length>0?(0,Z.jsx)(Rx,{templates:u,loading:d,error:f,onSelect:Fx}):null,t[13]=u,t[14]=f,t[15]=d,t[16]=y):y=t[16];let b;t[17]===o?b=t[18]:(b=o?null:(0,Z.jsx)(Bx,{}),t[17]=o,t[18]=b);let x,S;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(At,{"aria-hidden":`true`,className:`size-3`}),x=(0,Z.jsx)(s,{id:`IajAbS`}),t[19]=x,t[20]=S):(x=t[19],S=t[20]);let C;t[21]===r?C=t[22]:(C=(0,Z.jsxs)(sa,{onClick:r,variant:`link`,size:`xs`,className:`font-mono text-xs uppercase tracking-wider text-muted-foreground font-normal hover:text-foreground hover:no-underline`,children:[S,x]}),t[21]=r,t[22]=C);let w;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(Ax,{}),t[23]=w):w=t[23];let T;t[24]===C?T=t[25]:(T=(0,Z.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-4`,children:[C,w]}),t[24]=C,t[25]=T);let E;t[26]!==T||t[27]!==y||t[28]!==b?(E=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-8`,children:[v,y,b,T]}),t[26]=T,t[27]=y,t[28]=b,t[29]=E):E=t[29];let D;return t[30]!==E||t[31]!==_?(D=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-10 py-12 max-w-5xl my-auto`,children:[_,E]}),t[30]=E,t[31]=_,t[32]=D):D=t[32],D}function Fx(e,t){return Mx({template:{folder:e,name:t}})}function Ix(){return Mx({initialDir:``})}function Lx(e){let t=(0,$.c)(7),{shortcutLabel:n,onClick:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(cl,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[i,(0,Z.jsx)(`span`,{className:`text-sm font-medium leading-tight text-foreground`,children:(0,Z.jsx)(s,{id:`HdkSiO`})})]}),t[1]=a):a=t[1];let o;t[2]===n?o=t[3]:(o=(0,Z.jsx)(D,{children:n}),t[2]=n,t[3]=o);let c;return t[4]!==r||t[5]!==o?(c=(0,Z.jsxs)(sa,{type:`button`,variant:`ghost`,onClick:r,className:`group flex h-auto w-full items-center justify-between gap-4 rounded-xl border border-border/60 bg-card p-4 text-left transition-colors hover:bg-muted/50 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,children:[a,o]}),t[4]=r,t[5]=o,t[6]=c):c=t[6],c}function Rx(e){let t=(0,$.c)(25),{templates:n,loading:r,error:a,onSelect:o}=e,{_:c}=i(),l;t[0]===c?l=t[1]:(l=c({id:`_8quCH`}),t[0]=c,t[1]=l);let u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`_8quCH`})}),t[2]=u):u=t[2];let d;t[3]!==c||t[4]!==a||t[5]!==r||t[6]!==n?(d=r||a?null:(0,Z.jsx)(P,{className:`text-2xs`,variant:`gray`,"aria-label":c({id:`X7u0xR`,values:{0:n.length}}),children:n.length}),t[3]=c,t[4]=a,t[5]=r,t[6]=n,t[7]=d):d=t[7];let f;t[8]===d?f=t[9]:(f=(0,Z.jsxs)(`header`,{className:`flex items-center gap-2 font-mono text-2xs uppercase tracking-wider text-muted-foreground`,children:[u,d]}),t[8]=d,t[9]=f);let p;t[10]===c?p=t[11]:(p=c({id:`irFGwu`}),t[10]=c,t[11]=p);let m;t[12]!==a||t[13]!==r||t[14]!==o||t[15]!==n?(m=r?(0,Z.jsx)(`p`,{className:`p-4 text-1sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`Hl89Qd`})}):a?(0,Z.jsx)(`p`,{role:`alert`,className:`p-4 text-1sm text-destructive`,children:(0,Z.jsx)(s,{id:`54Y6Fg`})}):n.map(e=>(0,Z.jsx)(zx,{template:e,targetLabel:e.source_folder===``?`/`:`${e.source_folder}/`,onClick:()=>o(e.source_folder,e.name)},`${e.source_folder}/${e.name}`)),t[12]=a,t[13]=r,t[14]=o,t[15]=n,t[16]=m):m=t[16];let h;t[17]!==r||t[18]!==p||t[19]!==m?(h=(0,Z.jsx)(`div`,{className:`w-full overflow-hidden rounded-xl border border-border/60 bg-card`,children:(0,Z.jsx)(`section`,{"aria-busy":r,"aria-label":p,tabIndex:0,className:`subtle-scrollbar scroll-fade-mask flex max-h-[260px] w-full flex-col overflow-y-auto overscroll-contain focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:m})}),t[17]=r,t[18]=p,t[19]=m,t[20]=h):h=t[20];let g;return t[21]!==l||t[22]!==f||t[23]!==h?(g=(0,Z.jsxs)(`section`,{"aria-label":l,className:`flex w-full flex-col gap-3`,children:[f,h]}),t[21]=l,t[22]=f,t[23]=h,t[24]=g):g=t[24],g}function zx(e){let t=(0,$.c)(24),{template:n,targetLabel:r,onClick:a}=e,{_:o}=i(),s;t[0]!==n.name||t[1]!==n.title?(s=n.title?.trim()||n.name,t[0]=n.name,t[1]=n.title,t[2]=s):s=t[2];let c=s,l=`${n.name}.md`,u=n.source_folder===``,d;t[3]!==o||t[4]!==c||t[5]!==l||t[6]!==u||t[7]!==r?(d=o(u?{id:`89TtiD`,values:{displayTitle:c,fileName:l}}:{id:`0_J12R`,values:{displayTitle:c,fileName:l,targetLabel:r}}),t[3]=o,t[4]=c,t[5]=l,t[6]=u,t[7]=r,t[8]=d):d=t[8];let f=d,p;t[9]===c?p=t[10]:(p=(0,Z.jsx)(`span`,{className:`truncate text-sm font-medium leading-tight text-foreground/80`,children:c}),t[9]=c,t[10]=p);let m;t[11]===l?m=t[12]:(m=(0,Z.jsx)(`span`,{className:`truncate font-mono text-1sm font-normal text-muted-foreground`,children:l}),t[11]=l,t[12]=m);let h;t[13]!==p||t[14]!==m?(h=(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[p,m]}),t[13]=p,t[14]=m,t[15]=h):h=t[15];let g=`shrink-0 font-mono text-1sm ${u?`text-muted-foreground/70`:`text-muted-foreground`}`,_;t[16]!==g||t[17]!==r?(_=(0,Z.jsx)(`span`,{className:g,children:r}),t[16]=g,t[17]=r,t[18]=_):_=t[18];let v;return t[19]!==f||t[20]!==a||t[21]!==h||t[22]!==_?(v=(0,Z.jsxs)(sa,{type:`button`,variant:`ghost`,onClick:a,"aria-label":f,className:`group flex h-auto w-full items-center justify-between gap-4 rounded-none p-4 text-left transition-colors hover:bg-muted/50 focus-visible:bg-muted/50`,children:[h,_]}),t[19]=f,t[20]=a,t[21]=h,t[22]=_,t[23]=v):v=t[23],v}function Bx(){let e=(0,$.c)(6),{_:t}=i(),n;e[0]===t?n=e[1]:(n=t({id:`27ANM6`}),e[0]=t,e[1]=n);let r,a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(`header`,{className:`font-mono text-2xs uppercase tracking-wider text-muted-foreground`,children:(0,Z.jsx)(s,{id:`27ANM6`})}),a=(0,Z.jsx)($b,{}),e[2]=r,e[3]=a):(r=e[2],a=e[3]);let o;return e[4]===n?o=e[5]:(o=(0,Z.jsxs)(`section`,{"aria-label":n,className:`flex w-full flex-col gap-3`,children:[r,a]}),e[4]=n,e[5]=o),o}function Vx(){let e=(0,$.c)(14),[t,n]=(0,Q.useState)(!1),[r,i]=(0,Q.useState)(void 0),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(0),l=(0,Q.useRef)(!1),u=(0,Q.useRef)(void 0),d,f;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{let e=!1,t=async function(){try{let t=await fetch(`/api/documents`),n=await t.json().catch(Gx);if(e)return;let r=t.ok?fi.safeParse(n):null;r?.success?(o(Kx(r.data.documents)),l.current=!0):l.current||=(o(1),!0)}catch{!e&&!l.current&&(o(1),l.current=!0)}};t();let n=Kr(e=>{e.includes(`files`)&&t()});return()=>{e=!0,n(),clearTimeout(u.current)}},f=[],e[0]=d,e[1]=f):(d=e[0],f=e[1]),(0,Q.useEffect)(d,f);let p;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=function(){clearTimeout(u.current),u.current=setTimeout(()=>c(Wx),500),fetch(`/api/documents`).then(async e=>{let t=await e.json().catch(Ux);if(!e.ok)return;let n=fi.safeParse(t);n.success&&o(Kx(n.data.documents))}).catch(Hx)},e[2]=p):p=e[2];let m=p,h=a!==null,g=a===0,_;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=function(e){n(e),e||i(void 0)},e[3]=_):_=e[3];let v=_,y;e[4]!==s||e[5]!==g||e[6]!==h?(y=h?g?(0,Z.jsx)(qx,{celebrateSignal:s,onPackSelect:e=>{i(e),n(!0)}}):(0,Z.jsx)(Px,{celebrateSignal:s,onAddStarterPack:()=>{n(!0)}}):null,e[4]=s,e[5]=g,e[6]=h,e[7]=y):y=e[7];let b;e[8]!==r||e[9]!==t?(b=(0,Z.jsx)(hh,{open:t,onOpenChange:v,onSeedApplied:m,initialPackId:r}),e[8]=r,e[9]=t,e[10]=b):b=e[10];let x;return e[11]!==y||e[12]!==b?(x=(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center overflow-y-auto px-6 sm:px-12 md:px-16 subtle-scrollbar`,children:[y,b]}),e[11]=y,e[12]=b,e[13]=x):x=e[13],x}function Hx(){}function Ux(){return null}function Wx(e){return e+1}function Gx(){return null}function Kx(e){return Mr(e).filter(e=>e.kind===`document`||e.kind===`folder`).length}function qx(e){let t=(0,$.c)(16),{celebrateSignal:n,onPackSelect:r}=e,{_:a}=i(),o;t[0]===a?o=t[1]:(o=a({id:`ZmGmNh`}),t[0]=a,t[1]=o);let c;t[2]===a?c=t[3]:(c=a({id:`W8uemY`}),t[2]=a,t[3]=c);let l;t[4]!==n||t[5]!==o||t[6]!==c?(l=(0,Z.jsx)(kx,{title:o,subtitle:c,celebrateSignal:n}),t[4]=n,t[5]=o,t[6]=c,t[7]=l):l=t[7];let u;t[8]===r?u=t[9]:(u=(0,Z.jsx)(ch,{onPackSelect:r}),t[8]=r,t[9]=u);let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(sa,{variant:`link`,className:`text-muted-foreground font-normal justify-end`,size:`sm`,onClick:Jx,children:(0,Z.jsx)(s,{id:`ensWZc`,components:{0:(0,Z.jsx)(Qo,{"aria-hidden":`true`,className:`size-3`})}})}),t[10]=d):d=t[10];let f;t[11]===u?f=t[12]:(f=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-3`,children:[u,d]}),t[11]=u,t[12]=f);let p;return t[13]!==l||t[14]!==f?(p=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-10 py-12 max-w-5xl my-auto`,children:[l,f]}),t[13]=l,t[14]=f,t[15]=p):p=t[15],p}function Jx(){return Mx()}function Yx(e){return e===``?`.ok/frontmatter.yml`:`${e}/.ok/frontmatter.yml`}function Xx(e){let t=(0,$.c)(70),{folderPath:n,state:r,onChange:a}=e,{_:o}=i(),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)(null);if(r.status===`idle`||r.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card p-4 space-y-3`,children:[(0,Z.jsx)(Qx,{}),(0,Z.jsx)(Pa,{className:`h-7 w-full`}),(0,Z.jsx)(Pa,{className:`h-7 w-full`}),(0,Z.jsx)(Pa,{className:`h-7 w-full`})]}),t[0]=e):e=t[0],e}if(r.status===`error`){let{message:e}=r,n;return t[1]===e?n=t[2]:(n=(0,Z.jsx)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:(0,Z.jsx)(s,{id:`lzmtKp`,values:{message:e}})}),t[1]=e,t[2]=n),n}let m;t[3]===r.data.frontmatterLocal?m=t[4]:(m=r.data.frontmatterLocal??{},t[3]=r.data.frontmatterLocal,t[4]=m);let h=m,g;t[5]===r.data.folder.path?g=t[6]:(g=Yx(r.data.folder.path),t[5]=r.data.folder.path,t[6]=g);let _=g,v;t[7]===h?v=t[8]:(v=Object.keys(h),t[7]=h,t[8]=v);let y=v,b;t[9]!==o||t[10]!==n||t[11]!==a?(b=async function(e,t){let r=await Ya(n,{[e]:t});if(!r.ok){let{error:e}=r;X.error(o({id:`xXo8FT`,values:{error:e}}));return}a()},t[9]=o,t[10]=n,t[11]=a,t[12]=b):b=t[12];let x=b,S;t[13]!==o||t[14]!==n||t[15]!==a?(S=async function(e){let t=await Ya(n,{[e]:null});if(!t.ok){let{error:e}=t;X.error(o({id:`ZU8VV_`,values:{error:e}}));return}a()},t[13]=o,t[14]=n,t[15]=a,t[16]=S):S=t[16];let C=S,w;t[17]!==x||t[18]!==h?(w=function(e,t){let n=h[e];x(e,qa(n,t))},t[17]=x,t[18]=h,t[19]=w):w=t[19];let T=w,E;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(E=function(){d({name:``,type:`text`,value:``,error:null}),l(!1)},t[20]=E):E=t[20];let D=E,O;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(O=function(e){d(t=>{if(!t)return t;let n=e===`date`?new Date().toISOString().slice(0,10):Va[e];return{...t,type:e,value:n,error:null}})},t[21]=O):O=t[21];let k=O,A;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(e){d(t=>t&&{...t,value:e})},t[22]=A):A=t[22];let j=A,M;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(M=function(e){d(t=>t&&{...t,name:e,error:null})},t[23]=M):M=t[23];let N=M,P;t[24]!==o||t[25]!==u||t[26]!==n||t[27]!==a||t[28]!==h?(P=async function(){if(!u)return;let e=u.name.trim();if(!e){d({...u,error:o({id:`8_brI5`})});return}if(Un(u.value)){d({...u,error:o({id:`hXUWyd`})});return}if(Object.hasOwn(h,e)){d({...u,error:o({id:`CTJLpz`,values:{trimmed:e}})});return}let t=await Ya(n,{[e]:u.value});if(!t.ok){d({...u,error:t.error});return}d(null),a()},t[24]=o,t[25]=u,t[26]=n,t[27]=a,t[28]=h,t[29]=P):P=t[29];let F=P,I;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(I=function(e){p({key:e,draft:e,error:null})},t[30]=I):I=t[30];let L=I,R;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(R=function(e){p(t=>t&&{...t,draft:e,error:null})},t[31]=R):R=t[31];let z=R,B;t[32]!==o||t[33]!==n||t[34]!==a||t[35]!==h||t[36]!==f?(B=async function(){if(!f)return;let e=f.draft.trim();if(!e){p({...f,error:o({id:`8_brI5`})});return}if(e===f.key){p(null);return}if(Object.hasOwn(h,e)){p({...f,error:o({id:`CTJLpz`,values:{trimmed:e}})});return}let t=h[f.key],r=await Ya(n,{[f.key]:null,[e]:t});if(!r.ok){p({...f,error:r.error});return}p(null),a()},t[32]=o,t[33]=n,t[34]=a,t[35]=h,t[36]=f,t[37]=B):B=t[37];let V=B,H;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(H=function(){p(null)},t[38]=H):H=t[38];let U=H,ee=!c,te;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(te=e=>l(!e),t[39]=te):te=t[39];let W=`size-3 transition-transform ${c?``:`rotate-90`}`,ne;t[40]===W?ne=t[41]:(ne=(0,Z.jsx)(Os,{className:W,"aria-hidden":!0}),t[40]=W,t[41]=ne);let re;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`vQIVHc`})}),t[42]=re):re=t[42];let G;t[43]===ne?G=t[44]:(G=(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:[ne,re]}),t[43]=ne,t[44]=G);let ie;t[45]===_?ie=t[46]:(ie=(0,Z.jsx)(`code`,{className:`text-xs text-muted-foreground font-mono cursor-text select-text`,onClick:Zx,children:_}),t[45]=_,t[46]=ie);let K;t[47]!==G||t[48]!==ie?(K=(0,Z.jsxs)(js,{className:`flex w-full cursor-pointer items-center justify-between gap-2 px-3 py-2.5 data-[state=open]:border-b border-border`,children:[G,ie]}),t[47]=G,t[48]=ie,t[49]=K):K=t[49];let q;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,Z.jsx)(`p`,{className:`px-1 pb-2 text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`hSBIG-`})}),t[50]=q):q=t[50];let ae;t[51]!==u||t[52]!==x||t[53]!==V||t[54]!==y||t[55]!==h||t[56]!==C||t[57]!==f||t[58]!==T?(ae=y.length===0&&!u?(0,Z.jsx)(`p`,{className:`px-1 py-1 text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`4c_a6S`})}):y.map(e=>{let t=h[e];return(0,Z.jsx)(to,{keyName:e,value:t,declared:ao(t,$n(t)),rename:{state:f?.key===e?f:null,onBegin:()=>L(e),onChangeDraft:z,onCommit:V,onCancel:U},badge:null,onCommit:t=>void x(e,t),onChangeType:t=>T(e,t),onRemove:()=>void C(e)},e)}),t[51]=u,t[52]=x,t[53]=V,t[54]=y,t[55]=h,t[56]=C,t[57]=f,t[58]=T,t[59]=ae):ae=t[59];let oe;t[60]!==u||t[61]!==F?(oe=u?(0,Z.jsx)(Za,{draft:u,onChangeName:N,onChangeType:k,onChangeValue:j,onCommit:()=>void F(),onCancel:()=>d(null)}):(0,Z.jsx)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1`,children:(0,Z.jsxs)(sa,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`add-property-trigger`,onClick:()=>D(),className:`flex items-center gap-1.5 rounded px-2 py-1 font-medium text-sm hover:bg-muted/50 hover:text-foreground`,children:[(0,Z.jsx)(At,{className:`size-3.5`}),(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`G8t9NN`})})]})}),t[60]=u,t[61]=F,t[62]=oe):oe=t[62];let se;t[63]!==ae||t[64]!==oe?(se=(0,Z.jsx)(As,{children:(0,Z.jsxs)(`div`,{className:`px-2 py-2`,children:[q,ae,oe]})}),t[63]=ae,t[64]=oe,t[65]=se):se=t[65];let ce;return t[66]!==ee||t[67]!==K||t[68]!==se?(ce=(0,Z.jsx)(`section`,{className:`rounded-lg border bg-card`,children:(0,Z.jsxs)(Ms,{open:ee,onOpenChange:te,children:[K,se]})}),t[66]=ee,t[67]=K,t[68]=se,t[69]=ce):ce=t[69],ce}function Zx(e){return e.stopPropagation()}function Qx(){let e=(0,$.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(dl,{className:`size-4 text-muted-foreground`,"aria-hidden":!0}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t,(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(s,{id:`vQIVHc`})})]}),e[1]=n):n=e[1],n}function $x(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);return t<60?Y._({id:`xOTzt5`}):t<3600?Y._({id:`zbymaY`,values:{0:Math.floor(t/60)}}):t<86400?Y._({id:`optX0N`,values:{0:Math.floor(t/3600)}}):t<86400*7?Y._({id:`l1l8sj`,values:{0:Math.floor(t/86400)}}):new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function eS(e){return(e.split(`/`).pop()??e).replace(/\.md$/,``)}function tS(e){let t=e.message,n=t.indexOf(`: `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+2);switch(r){case`template-create`:return{Icon:Ao,label:Y._({id:`QR5SP1`}),detail:eS(i)};case`template-edit`:return{Icon:I,label:Y._({id:`-LHLx7`}),detail:eS(i)};case`template-delete`:return{Icon:g,label:Y._({id:`_gkGSK`}),detail:eS(i)};case`template-rename`:case`template-move`:{let[e,t]=i.split(` -> `);return{Icon:Hc,label:Y._({id:`KPW5WC`}),detail:`${eS(e??``)} → ${eS(t??i)}`}}case`folder-frontmatter-edit`:return{Icon:dl,label:Y._({id:`_tekeB`}),detail:``};case`folder-frontmatter-delete`:return{Icon:dl,label:Y._({id:`ZWxfrc`}),detail:``};case`folder-create`:return{Icon:dl,label:Y._({id:`ZQLDTl`}),detail:``};default:return{Icon:_l,label:r.replace(/-/g,` `),detail:eS(i)}}}function nS(e){return e.contributors.length>0?e.contributors[0].name:e.author===`openknowledge-service`||e.author===`server`?Y._({id:`B2DrPb`}):e.author||Y._({id:`Ef7StM`})}function rS(e){let t=(0,$.c)(15),{folderPath:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),[o,c]=(0,Q.useState)(!0),[l,u]=(0,Q.useState)(!1),d,f;if(t[1]===n?(d=t[2],f=t[3]):(d=()=>{let e=!1,t=async function(){try{let t=await fetch(`/api/history?folder=${encodeURIComponent(n)}&limit=50`);if(e)return;if(!t.ok){u(!0),c(!1);return}let r=await t.json();if(e)return;a(r.entries??[]),u(!1),c(!1)}catch(t){e||(console.warn(`[FolderTimelineCard] failed to load folder timeline:`,t),u(!0),c(!1))}};c(!0),t();let r=Wi(t);return()=>{e=!0,r()}},f=[n],t[1]=n,t[2]=d,t[3]=f),(0,Q.useEffect)(d,f),l||!o&&i.length===0)return null;let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(s,{id:`XJOV1Y`})}),t[4]=p):p=t[4];let m;t[5]===i.length?m=t[6]:(m=i.length>0?(0,Z.jsx)(P,{className:`text-xs`,variant:`secondary`,children:i.length}):null,t[5]=i.length,t[6]=m);let h;t[7]===m?h=t[8]:(h=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-1`,children:[p,m]}),t[7]=m,t[8]=h);let g;t[9]!==i||t[10]!==o?(g=(0,Z.jsx)(`div`,{className:`px-3 py-2.5`,children:o?(0,Z.jsxs)(`div`,{className:`space-y-2`,role:`status`,"aria-busy":`true`,children:[(0,Z.jsx)(Pa,{className:`h-8 w-full`}),(0,Z.jsx)(Pa,{className:`h-8 w-full`})]}):(0,Z.jsx)(`ul`,{className:`space-y-1`,children:i.map(iS)})}),t[9]=i,t[10]=o,t[11]=g):g=t[11];let _;return t[12]!==h||t[13]!==g?(_=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card`,"data-testid":`folder-timeline-card`,children:[h,g]}),t[12]=h,t[13]=g,t[14]=_):_=t[14],_}function iS(e){let{Icon:t,label:n,detail:r}=tS(e);return(0,Z.jsxs)(`li`,{className:`flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm`,children:[(0,Z.jsx)(t,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,Z.jsx)(`span`,{className:`text-foreground`,children:n}),r?(0,Z.jsx)(`code`,{className:`ml-1.5 font-mono text-xs text-muted-foreground`,children:r}):null]}),(0,Z.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,children:[(0,Z.jsx)(tu,{className:`size-3`,"aria-hidden":!0}),nS(e)]}),(0,Z.jsx)(`time`,{className:`shrink-0 text-xs text-muted-foreground/80`,dateTime:e.timestamp,title:new Date(e.timestamp).toLocaleString(),children:$x(e.timestamp)})]},e.sha)}function aS(e){let t=e.split(`/`).pop();return t?`${e}/${t}`:null}function oS(e,t){let n=t.get(`${e}/index`);if(n)return n;let r=aS(e);if(r){let e=t.get(r);if(e)return e}return e.split(`/`).pop()??e}function sS(e,t,n){let r=n.get(e);return r&&r!==e?r:t}function cS(e,t){let n=e===``?``:`${e}/`,r=[...t.folderPaths].filter(e=>e.startsWith(n)).map(e=>({path:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({path:e,rel:n})=>({kind:`folder`,path:e,name:n,title:oS(e,t.pageTitles)})),i=[...t.pages].filter(e=>e.startsWith(n)).map(e=>({docName:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({docName:e,rel:n})=>{let r=t.pageMeta.get(e);return{kind:`file`,path:e,name:n,title:sS(e,n,t.pageTitles),size:r?.size??0,modified:r?.modified??``}}),a=[...r,...i].sort((e,t)=>e.kind===t.kind?e.title.localeCompare(t.title)||e.name.localeCompare(t.name):e.kind===`folder`?-1:1);return{title:oS(e,t.pageTitles),children:a}}function lS(e){let t=(0,$.c)(44),{folderPath:n,state:r,onChange:i,folderConfigHandle:a}=e,[o,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(null),[d,f]=(0,Q.useState)(null),[p,m]=(0,Q.useState)(!1);if(r.status===`idle`||r.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card px-3 py-2.5 space-y-3`,children:[(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(s,{id:`-QCLWk`})})}),(0,Z.jsx)(Pa,{className:`h-12 w-full`}),(0,Z.jsx)(Pa,{className:`h-12 w-full`})]}),t[0]=e):e=t[0],e}if(r.status===`error`){let{message:e}=r,n;return t[1]===e?n=t[2]:(n=(0,Z.jsx)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:(0,Z.jsx)(s,{id:`iDZtvM`,values:{message:e}})}),t[1]=e,t[2]=n),n}let h;t[3]===r.data.folder.templates_available?h=t[4]:(h=r.data.folder.templates_available??[],t[3]=r.data.folder.templates_available,t[4]=h);let g=h,_;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(s,{id:`-QCLWk`})}),t[5]=_):_=t[5];let v;t[6]===g.length?v=t[7]:(v=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,(0,Z.jsx)(P,{className:`text-xs`,variant:`secondary`,children:g.length})]}),t[6]=g.length,t[7]=v);let y;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsxs)(sa,{variant:`ghost`,className:`font-mono uppercase`,size:`sm`,onClick:()=>m(!0),children:[(0,Z.jsx)(At,{className:`size-3.5`,"aria-hidden":!0}),(0,Z.jsx)(s,{id:`G1Gw0v`})]}),t[8]=y):y=t[8];let b;t[9]===v?b=t[10]:(b=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-1`,children:[v,y]}),t[9]=v,t[10]=b);let x;t[11]===g?x=t[12]:(x=(0,Z.jsx)(`div`,{className:`px-3 py-2.5`,children:g.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`MZSBsh`})}):(0,Z.jsx)(`ul`,{className:`space-y-1`,children:g.map(e=>(0,Z.jsx)(ja,{template:e,onCreate:()=>f(e.name),onEdit:()=>c(e),onDelete:()=>u(e),badge:e.scope===`inherited`?(0,Z.jsx)(Fa,{source:e.source_folder,target:`templates/${e.name}.md`}):void 0},e.path))})}),t[11]=g,t[12]=x);let S;t[13]!==b||t[14]!==x?(S=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card`,children:[b,x]}),t[13]=b,t[14]=x,t[15]=S):S=t[15];let C;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>{e||c(null)},t[16]=C):C=t[16];let w;t[17]!==o||t[18]!==n||t[19]!==i?(w=(0,Z.jsx)($a,{folderPath:n,template:o,onOpenChange:C,onSaved:i}),t[17]=o,t[18]=n,t[19]=i,t[20]=w):w=t[20];let T;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{e||u(null)},t[21]=T):T=t[21];let E;t[22]!==l||t[23]!==i?(E=(0,Z.jsx)(Ro,{template:l,onOpenChange:T,onDeleted:i}),t[22]=l,t[23]=i,t[24]=E):E=t[24];let D;t[25]===g?D=t[26]:(D=new Set(g.map(uS)),t[25]=g,t[26]=D);let O;t[27]!==n||t[28]!==p||t[29]!==i||t[30]!==D?(O=(0,Z.jsx)(Io,{folderPath:n,existingNames:D,open:p,onOpenChange:m,onCreated:i}),t[27]=n,t[28]=p,t[29]=i,t[30]=D,t[31]=O):O=t[31];let k=d!==null,A;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(A=e=>{e||f(null)},t[32]=A):A=t[32];let j=d??void 0,M;t[33]!==a||t[34]!==n||t[35]!==k||t[36]!==j?(M=(0,Z.jsx)(Gm,{open:k,onOpenChange:A,kind:`file`,initialDir:n,initialTemplate:j,folderConfig:a}),t[33]=a,t[34]=n,t[35]=k,t[36]=j,t[37]=M):M=t[37];let N;return t[38]!==E||t[39]!==O||t[40]!==M||t[41]!==S||t[42]!==w?(N=(0,Z.jsxs)(Z.Fragment,{children:[S,w,E,O,M]}),t[38]=E,t[39]=O,t[40]=M,t[41]=S,t[42]=w,t[43]=N):N=t[43],N}function uS(e){return e.name}function dS(e){let t=(0,$.c)(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,containerClassName:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=ea(`relative w-full overflow-x-auto subtle-scrollbar`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=ea(`w-full caption-bottom text-sm`,n),t[6]=n,t[7]=o);let s;t[8]!==i||t[9]!==o?(s=(0,Z.jsx)(`table`,{"data-slot":`table`,className:o,...i}),t[8]=i,t[9]=o,t[10]=s):s=t[10];let c;return t[11]!==a||t[12]!==s?(c=(0,Z.jsx)(`div`,{"data-slot":`table-container`,className:a,children:s}),t[11]=a,t[12]=s,t[13]=c):c=t[13],c}function fS(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`[&_tr]:border-b`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`thead`,{"data-slot":`table-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function pS(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`[&_tr:last-child]:border-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`tbody`,{"data-slot":`table-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function mS(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,noHover:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=(i===void 0?!1:i)&&`hover:bg-transparent`,o;t[4]!==n||t[5]!==a?(o=ea(`hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors`,a,n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o?(s=(0,Z.jsx)(`tr`,{"data-slot":`table-row`,className:o,...r}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function hS(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,scope:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`col`:i,o;t[4]===n?o=t[5]:(o=ea(`font-mono uppercase text-xs text-muted-foreground h-10 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(`th`,{"data-slot":`table-head`,scope:a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function gS(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`py-3 px-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`td`,{"data-slot":`table-cell`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function _S(e){if(!e)return`—`;let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return Y._({id:`xOTzt5`});if(r<60)return Y._({id:`NRSLBe`,values:{diffMin:r}});let i=Math.floor(r/60);if(i<24)return Y._({id:`hDKtoF`,values:{diffHrs:i}});let a=Math.floor(i/24);return a<30?Y._({id:`QDZbvN`,values:{diffDays:a}}):t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function vS(e,t,n){return[...e].sort((e,r)=>{if(e.kind!==r.kind)return e.kind===`folder`?-1:1;let i=0;switch(t){case`name`:i=e.title.localeCompare(r.title)||e.name.localeCompare(r.name);break;case`modified`:{let t=e.kind===`file`?e.modified:``,n=r.kind===`file`?r.modified:``;i=t.localeCompare(n);break}}return n===`asc`?i:-i})}function yS(e){let t=(0,$.c)(10),{label:n,sortKey:r,activeKey:i,activeDir:a,onSort:o}=e,s=i===r,c;t[0]!==o||t[1]!==r?(c=()=>o(r),t[0]=o,t[1]=r,t[2]=c):c=t[2];let l;t[3]!==a||t[4]!==s?(l=s?a===`asc`?(0,Z.jsx)(fe,{className:`ml-1 size-3`}):(0,Z.jsx)(S,{className:`ml-1 size-3`}):(0,Z.jsx)(Uc,{className:`ml-1 size-3 text-muted-foreground/50`}),t[3]=a,t[4]=s,t[5]=l):l=t[5];let u;return t[6]!==n||t[7]!==c||t[8]!==l?(u=(0,Z.jsxs)(sa,{variant:`ghost`,size:`sm`,className:`-ml-3 h-8 uppercase font-mono`,onClick:c,children:[n,l]}),t[6]=n,t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function bS(e){let t=(0,$.c)(96),{folderPath:n}=e,{_:r}=i(),{folderPaths:a,loading:o,pages:c,pageTitles:l,pageMeta:u}=si(),d=uo(n),{state:f,refresh:p}=d,[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(`name`),[v,y]=(0,Q.useState)(`asc`);if(o){let e;t[0]===r?e=t[1]:(e=r({id:`X9VpsP`}),t[0]=r,t[1]=e);let n;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Pa,{className:`size-5 rounded`}),(0,Z.jsx)(Pa,{className:`h-7 w-48`})]}),(0,Z.jsx)(Pa,{className:`h-9 w-20 rounded-md`})]}),t[2]=n):n=t[2];let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(Pa,{className:`h-4 w-16`}),t[3]=i):i=t[3];let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(`div`,{className:`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`,children:[n,(0,Z.jsxs)(`div`,{className:`rounded-lg border`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-4 border-b px-4 py-3`,children:[i,(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(Pa,{className:`h-4 w-20`})})]}),[`a`,`b`,`c`,`d`].map(CS)]})]}),t[4]=a):a=t[4];let o;return t[5]===e?o=t[6]:(o=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,role:`status`,"aria-busy":`true`,"aria-label":e,children:a}),t[5]=e,t[6]=o),o}let b,x,S,C,w,T,E,D,O,k,A;if(t[7]!==r||t[8]!==f||t[9]!==d||t[10]!==n||t[11]!==a||t[12]!==u||t[13]!==l||t[14]!==c||t[15]!==p||t[16]!==v||t[17]!==g){let e=cS(n,{pages:c,pageTitles:l,pageMeta:u,folderPaths:a}),i=vS(e.children,g,v),o=e.title||(n===``?r({id:`3aeN7X`}):e.title),m;t[29]===g?m=t[30]:(m=function(e){e===g?y(SS):(_(e),y(`asc`))},t[29]=g,t[30]=m);let j=m;A=`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,T=`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`;let M;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsx)(mt,{className:`size-5 text-muted-foreground`}),t[31]=M):M=t[31];let N=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[M,(0,Z.jsx)(`h1`,{className:`text-2xl font-light tracking-tight`,children:o})]}),P;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsxs)(sa,{onClick:()=>h(!0),children:[(0,Z.jsx)(At,{className:`size-4`}),(0,Z.jsx)(s,{id:`isRobC`})]}),t[32]=P):P=t[32],t[33]===N?E=t[34]:(E=(0,Z.jsx)(`div`,{className:`flex flex-col gap-6`,children:(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[N,P]})}),t[33]=N,t[34]=E),t[35]!==f||t[36]!==n||t[37]!==p?(D=(0,Z.jsx)(Xx,{folderPath:n,state:f,onChange:p}),t[35]=f,t[36]=n,t[37]=p,t[38]=D):D=t[38],t[39]!==f||t[40]!==d||t[41]!==n||t[42]!==p?(O=(0,Z.jsx)(lS,{folderPath:n,state:f,onChange:p,folderConfigHandle:d}),t[39]=f,t[40]=d,t[41]=n,t[42]=p,t[43]=O):O=t[43],t[44]===n?k=t[45]:(k=(0,Z.jsx)(rS,{folderPath:n}),t[44]=n,t[45]=k),w=`rounded-lg border`,x=dS;let F=g===`name`?v===`asc`?`ascending`:`descending`:`none`,I;t[46]===r?I=t[47]:(I=r({id:`6YtxFj`}),t[46]=r,t[47]=I);let L;t[48]!==j||t[49]!==v||t[50]!==g||t[51]!==I?(L=(0,Z.jsx)(yS,{label:I,sortKey:`name`,activeKey:g,activeDir:v,onSort:j}),t[48]=j,t[49]=v,t[50]=g,t[51]=I,t[52]=L):L=t[52];let R;t[53]!==F||t[54]!==L?(R=(0,Z.jsx)(hS,{"aria-sort":F,children:L}),t[53]=F,t[54]=L,t[55]=R):R=t[55];let z=g===`modified`?v===`asc`?`ascending`:`descending`:`none`,B;t[56]===r?B=t[57]:(B=r({id:`tgWuMB`}),t[56]=r,t[57]=B);let V;t[58]!==j||t[59]!==v||t[60]!==g||t[61]!==B?(V=(0,Z.jsx)(yS,{label:B,sortKey:`modified`,activeKey:g,activeDir:v,onSort:j}),t[58]=j,t[59]=v,t[60]=g,t[61]=B,t[62]=V):V=t[62];let H;t[63]!==z||t[64]!==V?(H=(0,Z.jsx)(hS,{className:`w-32`,"aria-sort":z,children:V}),t[63]=z,t[64]=V,t[65]=H):H=t[65],t[66]!==R||t[67]!==H?(C=(0,Z.jsx)(fS,{children:(0,Z.jsxs)(mS,{children:[R,H]})}),t[66]=R,t[67]=H,t[68]=C):C=t[68],b=pS,S=i.length?i.map(xS):(0,Z.jsx)(mS,{children:(0,Z.jsx)(gS,{colSpan:2,className:`h-24 text-center text-muted-foreground`,children:(0,Z.jsx)(s,{id:`Pkw7J9`})})}),t[7]=r,t[8]=f,t[9]=d,t[10]=n,t[11]=a,t[12]=u,t[13]=l,t[14]=c,t[15]=p,t[16]=v,t[17]=g,t[18]=b,t[19]=x,t[20]=S,t[21]=C,t[22]=w,t[23]=T,t[24]=E,t[25]=D,t[26]=O,t[27]=k,t[28]=A}else b=t[18],x=t[19],S=t[20],C=t[21],w=t[22],T=t[23],E=t[24],D=t[25],O=t[26],k=t[27],A=t[28];let j;t[69]!==b||t[70]!==S?(j=(0,Z.jsx)(b,{children:S}),t[69]=b,t[70]=S,t[71]=j):j=t[71];let M;t[72]!==x||t[73]!==j||t[74]!==C?(M=(0,Z.jsxs)(x,{children:[C,j]}),t[72]=x,t[73]=j,t[74]=C,t[75]=M):M=t[75];let N;t[76]!==M||t[77]!==w?(N=(0,Z.jsx)(`div`,{className:w,children:M}),t[76]=M,t[77]=w,t[78]=N):N=t[78];let P;t[79]!==N||t[80]!==T||t[81]!==E||t[82]!==D||t[83]!==O||t[84]!==k?(P=(0,Z.jsxs)(`div`,{className:T,children:[E,D,O,k,N]}),t[79]=N,t[80]=T,t[81]=E,t[82]=D,t[83]=O,t[84]=k,t[85]=P):P=t[85];let F;t[86]!==P||t[87]!==A?(F=(0,Z.jsx)(`div`,{className:A,children:P}),t[86]=P,t[87]=A,t[88]=F):F=t[88];let I;t[89]!==m||t[90]!==d||t[91]!==n?(I=(0,Z.jsx)(Gm,{open:m,onOpenChange:h,kind:`file`,initialDir:n,folderConfig:d,suggestedName:`index`}),t[89]=m,t[90]=d,t[91]=n,t[92]=I):I=t[92];let L;return t[93]!==F||t[94]!==I?(L=(0,Z.jsxs)(Z.Fragment,{children:[F,I]}),t[93]=F,t[94]=I,t[95]=L):L=t[95],L}function xS(e){return(0,Z.jsxs)(mS,{children:[(0,Z.jsx)(gS,{children:(0,Z.jsxs)(`a`,{href:yr(e.path),className:`flex items-center gap-2 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[e.kind===`folder`?(0,Z.jsx)(pl,{className:`size-4 shrink-0 text-muted-foreground`}):(0,Z.jsx)(Kt,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.title})]})}),(0,Z.jsx)(gS,{className:`text-muted-foreground`,children:e.kind===`file`?_S(e.modified):`—`})]},e.path)}function SS(e){return e===`asc`?`desc`:`asc`}function CS(e){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 border-b px-4 py-3 last:border-b-0`,children:[(0,Z.jsx)(Pa,{className:`size-4 rounded`}),(0,Z.jsx)(Pa,{className:`h-4 w-40`}),(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(Pa,{className:`h-4 w-16`})})]},e)}function wS(e){let t=(0,$.c)(24),{docName:n,size:r,limit:i,backNav:a}=e,o=a!==void 0,c=(0,Q.useRef)(null),l=(0,Q.useRef)(null),u,d;t[0]===o?(u=t[1],d=t[2]):(u=()=>{o?c.current?.focus():l.current?.focus()},d=[o],t[0]=o,t[1]=u,t[2]=d),(0,Q.useEffect)(u,d);let f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-full border bg-muted/40 text-muted-foreground`,children:(0,Z.jsx)(sl,{className:`size-9`,"aria-hidden":`true`})}),t[3]=f):f=t[3];let p=o?void 0:-1,m;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(s,{id:`P3hnm0`}),t[4]=m):m=t[4];let h;t[5]===p?h=t[6]:(h=(0,Z.jsx)(`h2`,{ref:l,id:`large-file-title`,tabIndex:p,className:`text-2xl font-light text-balance outline-none`,children:m}),t[5]=p,t[6]=h);let g;t[7]===r?g=t[8]:(g=Ri(r),t[7]=r,t[8]=g);let _;t[9]===i?_=t[10]:(_=Ri(i),t[9]=i,t[10]=_);let v;t[11]!==n||t[12]!==g||t[13]!==_?(v=(0,Z.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`_GBioJ`,values:{0:g,1:_,docName:n}})}),t[11]=n,t[12]=g,t[13]=_,t[14]=v):v=t[14];let y;t[15]!==h||t[16]!==v?(y=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[h,v]}),t[15]=h,t[16]=v,t[17]=y):y=t[17];let b;t[18]!==a||t[19]!==o?(b=o?(0,Z.jsxs)(sa,{ref:c,variant:`default`,onClick:()=>a.onNavigateBack(a.previousDocName),children:[(0,Z.jsx)(ga,{className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(s,{id:`CKyk7Q`})]}):null,t[18]=a,t[19]=o,t[20]=b):b=t[20];let x;return t[21]!==y||t[22]!==b?(x=(0,Z.jsxs)(`div`,{role:`status`,"aria-labelledby":`large-file-title`,"data-slot":`large-file-editor-state`,className:`flex h-full flex-col items-center justify-center gap-8 p-8 text-center`,children:[f,y,b]}),t[21]=y,t[22]=b,t[23]=x):x=t[23],x}function TS(e){let t=(0,$.c)(8),{docName:n}=e,[r,i]=(0,Q.useState)(ES),a,o;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>F(e=>{i(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})}),o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),(0,Q.useEffect)(a,o),!r.has(n))return null;let c;t[2]===n?c=t[3]:(c=function(){ne(n)?.abort(),i(e=>{if(!e.has(n))return e;let t=new Set(e);return t.delete(n),t})},t[2]=n,t[3]=c);let l=c,u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`A67Uwj`})}),t[4]=u):u=t[4];let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(s,{id:`dEgA5A`}),t[5]=d):d=t[5];let f;return t[6]===l?f=t[7]:(f=(0,Z.jsxs)(`div`,{className:`absolute inset-x-0 bottom-8 z-20 flex justify-center text-xs text-muted-foreground`,children:[u,(0,Z.jsx)(sa,{variant:`link`,size:`sm`,className:`h-auto px-2 py-0 text-xs`,onClick:l,children:d})]}),t[6]=l,t[7]=f),f}function ES(){return new Set}var DS=(0,Q.createContext)(null);function OS(e){let t=(0,$.c)(7),{children:n}=e,[r,i]=(0,Q.useState)(kS),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>{i(t=>{let n=new Map(t);return n.set(e,(t.get(e)??0)+1),n})},t[0]=a):a=t[0];let o=a,s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>{i(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},t[1]=s):s=t[1];let c=s,l;t[2]===r?l=t[3]:(l={addPropertySignal:r,requestAddProperty:o,clearAddProperty:c},t[2]=r,t[3]=l);let u=l,d;return t[4]!==n||t[5]!==u?(d=(0,Z.jsx)(DS,{value:u,children:n}),t[4]=n,t[5]=u,t[6]=d):d=t[6],d}function kS(){return new Map}function AS(){let e=(0,Q.use)(DS);if(e===null)throw Error(`useProperties must be used within <PropertyProvider />`);return e}function jS(e){let t=null,n=()=>(t===null&&(t=e(),t.catch(()=>{})),t),r=(0,Q.lazy)(n);return r.preload=n,r}var MS=jS(()=>n(()=>import(`./SettingsDialogBody-C-vY1kWI.js`).then(e=>({default:e.SettingsDialogBody})),__vite__mapDeps([44,1,35,2,36,37,22,38,39,40,41,21,6,3,7,4,10,12,9,42,45,8,16,11,13,23,46]),import.meta.url));function NS(e){let t=(0,$.c)(9),{error:n}=e,{_:r}=i(),a;t[0]!==r||t[1]!==n?(a=n instanceof Error&&/dynamically imported module|Failed to fetch/i.test(n.message)?r({id:`Y8ViJx`}):r({id:`3h5zMp`}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o=a,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(`h3`,{id:`settings-body-error-title`,className:`font-heading text-base leading-none font-medium`,children:(0,Z.jsx)(s,{id:`hwFOFD`})}),t[3]=c):c=t[3];let l;t[4]===o?l=t[5]:(l=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[c,(0,Z.jsx)(`p`,{className:`max-w-xs text-sm text-muted-foreground`,children:o})]}),t[4]=o,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(sa,{variant:`default`,onClick:PS,children:(0,Z.jsx)(s,{id:`HpK_8d`})}),t[6]=u):u=t[6];let d;return t[7]===l?d=t[8]:(d=(0,Z.jsxs)(`div`,{role:`alert`,"aria-labelledby":`settings-body-error-title`,"data-slot":`settings-body-error-boundary`,className:`flex h-full flex-col items-center justify-center gap-5 p-8 text-center`,children:[l,u]}),t[7]=l,t[8]=d),d}function PS(){return window.location.reload()}function FS(e){let t=(0,$.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(re,{fallbackRender:LS,onError:IS,children:n}),t[0]=n,t[1]=r),r}function IS(e,t){console.error(`[SettingsDialogErrorBoundary] rendered fallback for Settings body`,e,t.componentStack)}function LS(e){return(0,Z.jsx)(NS,{...e})}function RS(e){return`https://github.com/inkeep/open-knowledge/releases/tag/v${encodeURIComponent(e)}`}function zS(e){let t=(0,$.c)(86),{open:n,onOpenChange:r}=e,{_:a}=i(),{collabUrl:o}=yt(),{userBinding:c,userSynced:l,okignoreBinding:u,okignoreSynced:d}=be(),{desktopPresent:f}=Na(),[p,m]=(0,Q.useState)(`preferences`),h,g;t[0]===n?(h=t[1],g=t[2]):(h=()=>{n&&m(`preferences`)},g=[n],t[0]=n,t[1]=h,t[2]=g),(0,Q.useEffect)(h,g);let _=o!==null,v;t[3]===a?v=t[4]:(v=a({id:`7PzzBU`}),t[3]=a,t[4]=v);let y;t[5]===a?y=t[6]:(y=a({id:`Q6hhn8`}),t[5]=a,t[6]=y);let b;t[7]===y?b=t[8]:(b={id:`preferences`,label:y},t[7]=y,t[8]=b);let x;t[9]===a?x=t[10]:(x=a({id:`4KmEoC`}),t[9]=a,t[10]=x);let S;t[11]===x?S=t[12]:(S={id:`hotkeys`,label:x},t[11]=x,t[12]=S);let C;t[13]===a?C=t[14]:(C=a({id:`AeXO77`}),t[13]=a,t[14]=C);let w;t[15]===C?w=t[16]:(w={id:`account`,label:C},t[15]=C,t[16]=w);let T;t[17]!==b||t[18]!==S||t[19]!==w?(T=[b,S,w],t[17]=b,t[18]=S,t[19]=w,t[20]=T):T=t[20];let E;t[21]!==T||t[22]!==v?(E={id:`user`,label:v,enabled:!0,items:T},t[21]=T,t[22]=v,t[23]=E):E=t[23];let D;t[24]===a?D=t[25]:(D=a({id:`ZWyHmq`}),t[24]=a,t[25]=D);let O;t[26]===a?O=t[27]:(O=a({id:`Nu4DdT`}),t[26]=a,t[27]=O);let k;t[28]===O?k=t[29]:(k={id:`sync`,label:O},t[28]=O,t[29]=k);let A;t[30]===a?A=t[31]:(A=a({id:`A1taO8`}),t[30]=a,t[31]=A);let j;t[32]===A?j=t[33]:(j={id:`search`,label:A},t[32]=A,t[33]=j);let M;t[34]===a?M=t[35]:(M=a({id:`iTylMl`}),t[34]=a,t[35]=M);let N;t[36]===M?N=t[37]:(N={id:`project-templates`,label:M},t[36]=M,t[37]=N);let P;t[38]===a?P=t[39]:(P=a({id:`3zyg_A`}),t[38]=a,t[39]=P);let F;t[40]===P?F=t[41]:(F={id:`okignore`,label:P},t[40]=P,t[41]=F);let I;t[42]===a?I=t[43]:(I=a({id:`cs4mps`}),t[42]=a,t[43]=I);let L;t[44]===I?L=t[45]:(L={id:`sharing`,label:I},t[44]=I,t[45]=L);let R;t[46]!==k||t[47]!==j||t[48]!==N||t[49]!==F||t[50]!==L?(R=[k,j,N,F,L],t[46]=k,t[47]=j,t[48]=N,t[49]=F,t[50]=L,t[51]=R):R=t[51];let z;t[52]!==_||t[53]!==D||t[54]!==R?(z={id:`project`,label:D,enabled:_,items:R},t[52]=_,t[53]=D,t[54]=R,t[55]=z):z=t[55];let B;t[56]===a?B=t[57]:(B=a({id:`nbfdhU`}),t[56]=a,t[57]=B);let V;t[58]!==a||t[59]!==f?(V=[],t[58]=a,t[59]=f,t[60]=V):V=t[60];let H;t[61]!==B||t[62]!==V?(H={id:`integrations`,label:B,enabled:!0,items:V},t[61]=B,t[62]=V,t[63]=H):H=t[63];let U;t[64]!==E||t[65]!==z||t[66]!==H?(U=[E,z,H],t[64]=E,t[65]=z,t[66]=H,t[67]=U):U=t[67];let ee=U,te;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Z.jsx)(bs,{className:`sr-only`,id:`settings-dialog-title`,children:(0,Z.jsx)(s,{id:`Tz0i8g`})}),t[68]=te):te=t[68];let W;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Z.jsx)(vs,{className:`sr-only`,children:(0,Z.jsx)(s,{id:`RDrXh4`})}),t[69]=W):W=t[69];let ne;t[70]!==p||t[71]!==ee?(ne=(0,Z.jsx)(BS,{groups:ee,activeId:p,onSelect:m}),t[70]=p,t[71]=ee,t[72]=ne):ne=t[72];let re;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsx)(US,{}),t[73]=re):re=t[73];let G=l?c:null,ie;t[74]!==p||t[75]!==u||t[76]!==d||t[77]!==G?(ie=(0,Z.jsx)(`section`,{"aria-labelledby":`settings-dialog-title`,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain subtle-scrollbar p-6`,tabIndex:0,children:(0,Z.jsx)(FS,{children:(0,Z.jsx)(Q.Suspense,{fallback:re,children:(0,Z.jsx)(MS,{activeId:p,userBinding:G,okignoreBinding:u,okignoreSynced:d})})})}),t[74]=p,t[75]=u,t[76]=d,t[77]=G,t[78]=ie):ie=t[78];let K;t[79]!==ne||t[80]!==ie?(K=(0,Z.jsxs)(xs,{className:`flex h-[700px] max-h-[calc(100dvh-4rem)] w-[900px] max-w-[calc(100%-2rem)] flex-col gap-0 overflow-hidden p-0 sm:grid sm:grid-cols-[220px_1fr] sm:max-w-[min(900px,calc(100%-2rem))]`,"data-testid":`settings-dialog`,children:[te,W,ne,ie]}),t[79]=ne,t[80]=ie,t[81]=K):K=t[81];let q;return t[82]!==r||t[83]!==n||t[84]!==K?(q=(0,Z.jsx)(Ts,{open:n,onOpenChange:r,children:K}),t[82]=r,t[83]=n,t[84]=K,t[85]=q):q=t[85],q}function BS(e){let t=(0,$.c)(13),{groups:n,activeId:r,onSelect:a}=e,{_:o}=i(),s;t[0]===o?s=t[1]:(s=o({id:`y1t8bQ`}),t[0]=o,t[1]=s);let c;if(t[2]!==r||t[3]!==n||t[4]!==a){let e;t[6]!==r||t[7]!==a?(e=e=>(0,Z.jsx)(HS,{group:e,activeId:r,onSelect:a},e.id),t[6]=r,t[7]=a,t[8]=e):e=t[8],c=n.map(e),t[2]=r,t[3]=n,t[4]=a,t[5]=c}else c=t[5];let l;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(VS,{}),t[9]=l):l=t[9];let u;return t[10]!==s||t[11]!==c?(u=(0,Z.jsxs)(`nav`,{"aria-label":s,className:`flex shrink-0 gap-x-3 overflow-x-auto overscroll-contain subtle-scrollbar scroll-fade-mask-x-max-sm border-b bg-muted/30 px-3 py-2 max-sm:pt-10 sm:h-full sm:flex-col sm:gap-0 sm:overflow-x-visible sm:overflow-y-auto sm:border-r sm:border-b-0 sm:py-4`,children:[c,l]}),t[10]=s,t[11]=c,t[12]=u):u=t[12],u}function VS(){let e=(0,$.c)(4),t=typeof window<`u`?window.okDesktop??null:null,n=t?.appVersion;if(!t||!n)return null;let r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=RS(n),e[0]=r):r=e[0];let i=r,a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(`p`,{className:`whitespace-nowrap font-mono text-xs text-muted-foreground/70`,"data-testid":`settings-sidebar-version`,children:[`v`,n]}),e[1]=a):a=e[1];let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{t.shell.openExternal(i)},e[2]=o):o=e[2];let c;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsxs)(`div`,{className:`ml-auto shrink-0 px-2 sm:ml-0 sm:mt-auto sm:pt-3`,children:[a,(0,Z.jsxs)(`button`,{type:`button`,onClick:o,"data-testid":`settings-sidebar-release-notes`,className:ea(`mt-0.5 inline-flex items-center gap-1 whitespace-nowrap rounded text-xs text-muted-foreground transition-colors hover:text-foreground`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`),children:[(0,Z.jsx)(s,{id:`_PACVa`}),(0,Z.jsx)(ms,{className:`size-3`,"aria-hidden":`true`})]})]}),e[3]=c):c=e[3],c}function HS(e){let t=(0,$.c)(28),{group:n,activeId:r,onSelect:i}=e;if(n.items.length===0)return null;let a=`settings-group-${n.id}`,o=`${a}-caption`,c=n.enabled?void 0:o,l=n.enabled?`text-muted-foreground/80`:`text-muted-foreground/50`,u;t[0]===l?u=t[1]:(u=ea(`shrink-0 whitespace-nowrap px-2 text-xs font-semibold uppercase tracking-wide font-mono sm:mb-1`,l),t[0]=l,t[1]=u);let d;t[2]!==n.label||t[3]!==a||t[4]!==c||t[5]!==u?(d=(0,Z.jsx)(`h3`,{id:a,"aria-describedby":c,className:u,children:n.label}),t[2]=n.label,t[3]=a,t[4]=c,t[5]=u,t[6]=d):d=t[6];let f;t[7]!==o||t[8]!==n.enabled?(f=n.enabled?null:(0,Z.jsx)(`p`,{id:o,className:`px-2 text-xs italic text-muted-foreground/60 sm:mb-1`,children:(0,Z.jsx)(s,{id:`JWsZlx`})}),t[7]=o,t[8]=n.enabled,t[9]=f):f=t[9];let p;if(t[10]!==r||t[11]!==o||t[12]!==n.enabled||t[13]!==n.items||t[14]!==i){let e;t[16]!==r||t[17]!==o||t[18]!==n.enabled||t[19]!==i?(e=e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`button`,{type:`button`,"aria-current":r===e.id?`page`:void 0,"aria-disabled":n.enabled?void 0:!0,"aria-describedby":n.enabled?void 0:o,tabIndex:n.enabled?0:-1,disabled:!n.enabled,onClick:()=>n.enabled&&i(e.id),"data-testid":`settings-sidebar-item-${e.id}`,className:ea(`w-auto whitespace-nowrap rounded px-2 py-1.5 text-left text-sm transition-colors sm:w-full`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,r===e.id&&n.enabled?`bg-accent text-accent-foreground`:`hover:bg-accent/50`),children:e.label})},e.id),t[16]=r,t[17]=o,t[18]=n.enabled,t[19]=i,t[20]=e):e=t[20],p=n.items.map(e),t[10]=r,t[11]=o,t[12]=n.enabled,t[13]=n.items,t[14]=i,t[15]=p}else p=t[15];let m;t[21]!==a||t[22]!==p?(m=(0,Z.jsx)(`ul`,{"aria-labelledby":a,className:`flex gap-1 sm:block sm:space-y-0.5`,children:p}),t[21]=a,t[22]=p,t[23]=m):m=t[23];let h;return t[24]!==d||t[25]!==f||t[26]!==m?(h=(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 sm:mb-4 sm:block`,children:[d,f,m]}),t[24]=d,t[25]=f,t[26]=m,t[27]=h):h=t[27],h}function US(){let e=(0,$.c)(4),t,n,r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(s,{id:`GsBUCk`})}),n=(0,Z.jsx)(Pa,{className:`h-5 w-32`}),r=(0,Z.jsx)(Pa,{className:`h-4 w-64`}),e[0]=t,e[1]=n,e[2]=r):(t=e[0],n=e[1],r=e[2]);let i;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-3`,"data-testid":`settings-content-skeleton`,children:[t,n,r,(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Pa,{className:`h-9 w-full`}),(0,Z.jsx)(Pa,{className:`h-9 w-full`})]})]}),e[3]=i):i=e[3],i}function WS(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`flex h-full w-full aria-[orientation=vertical]:flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(wb,{"data-slot":`resizable-panel-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function GS(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(Db,{"data-slot":`resizable-panel`,...n}),t[2]=n,t[3]=r),r}function KS(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({withHandle:i,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=ea(`relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),t[4]=n,t[5]=a);let o;t[6]===i?o=t[7]:(o=i&&(0,Z.jsx)(`div`,{className:`z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border`}),t[6]=i,t[7]=o);let s;return t[8]!==r||t[9]!==a||t[10]!==o?(s=(0,Z.jsx)(jb,{"data-slot":`resizable-handle`,className:a,...r,children:o}),t[8]=r,t[9]=a,t[10]=o,t[11]=s):s=t[11],s}function qS(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`input-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var JS=la(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function YS(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=ea(JS({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,Z.jsx)(`div`,{"data-slot":`input-group-addon`,"data-align":a,className:o,onMouseDown:XS,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function XS(e){e.target.closest(`button`)||(e.preventDefault(),e.currentTarget.parentElement?.querySelector(`input`)?.focus())}la(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function ZS(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`span`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function QS(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(ks,{"data-slot":`input-group-control`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $S(e){let t=(0,$.c)(119),{findInputRef:n,query:r,replacement:a,replaceOpen:o,caseSensitive:c,wholeWord:l,current:u,total:d,onQueryChange:f,onReplacementChange:p,onReplaceOpenChange:m,onCaseSensitiveChange:h,onWholeWordChange:g,onNext:_,onPrevious:v,onReplaceCurrent:y,onReplaceAll:b,onClose:x}=e,{_:S}=i(),C=r.length>0,w=d>0,T;t[0]!==S||t[1]!==u||t[2]!==w||t[3]!==C||t[4]!==d?(T=C?w?`${u} / ${d}`:S({id:`Ev2r9A`}):``,t[0]=S,t[1]=u,t[2]=w,t[3]=C,t[4]=d,t[5]=T):T=t[5];let E=T,D;t[6]!==x||t[7]!==_||t[8]!==v?(D=function(e){e.key===`Enter`?(e.preventDefault(),e.shiftKey?v():_()):e.key===`Escape`&&(e.preventDefault(),x())},t[6]=x,t[7]=_,t[8]=v,t[9]=D):D=t[9];let O=D,k;t[10]!==x||t[11]!==y?(k=function(e){e.key===`Enter`?(e.preventDefault(),y()):e.key===`Escape`&&(e.preventDefault(),x())},t[10]=x,t[11]=y,t[12]=k):k=t[12];let A=k,j;t[13]===S?j=t[14]:(j=S({id:`MVxpbf`}),t[13]=S,t[14]=j);let M;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsx)(`label`,{className:`sr-only`,htmlFor:`ok-find-input`,children:(0,Z.jsx)(s,{id:`KujtjC`})}),t[15]=M):M=t[15];let N;t[16]===f?N=t[17]:(N=e=>f(e.target.value),t[16]=f,t[17]=N);let P;t[18]===S?P=t[19]:(P=S({id:`KujtjC`}),t[18]=S,t[19]=P);let F;t[20]!==n||t[21]!==O||t[22]!==r||t[23]!==N||t[24]!==P?(F=(0,Z.jsx)(QS,{ref:n,id:`ok-find-input`,value:r,onChange:N,onKeyDown:O,placeholder:P,autoComplete:`off`,spellCheck:!1,className:`h-7 px-2 text-sm`}),t[20]=n,t[21]=O,t[22]=r,t[23]=N,t[24]=P,t[25]=F):F=t[25];let I;t[26]===S?I=t[27]:(I=S({id:`-8PP0T`}),t[26]=S,t[27]=I);let L;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(Yc,{"aria-hidden":`true`}),t[28]=L):L=t[28];let R;t[29]!==c||t[30]!==h||t[31]!==I?(R=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(gs,{type:`button`,variant:`segmented`,size:`sm`,"aria-label":I,pressed:c,onPressedChange:h,className:`size-6 min-w-6 px-0`,children:L})}),t[29]=c,t[30]=h,t[31]=I,t[32]=R):R=t[32];let z;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsx)(Ar,{side:`bottom`,children:(0,Z.jsx)(s,{id:`-8PP0T`})}),t[33]=z):z=t[33];let B;t[34]===R?B=t[35]:(B=(0,Z.jsxs)(pr,{children:[R,z]}),t[34]=R,t[35]=B);let V;t[36]===S?V=t[37]:(V=S({id:`_7UQ7y`}),t[36]=S,t[37]=V);let H;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Z.jsx)(nu,{"aria-hidden":`true`}),t[38]=H):H=t[38];let U;t[39]!==g||t[40]!==V||t[41]!==l?(U=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(gs,{type:`button`,variant:`segmented`,size:`sm`,"aria-label":V,pressed:l,onPressedChange:g,className:`size-6 min-w-6 px-0`,children:H})}),t[39]=g,t[40]=V,t[41]=l,t[42]=U):U=t[42];let ee;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Z.jsx)(Ar,{side:`bottom`,children:(0,Z.jsx)(s,{id:`_7UQ7y`})}),t[43]=ee):ee=t[43];let te;t[44]===U?te=t[45]:(te=(0,Z.jsxs)(pr,{children:[U,ee]}),t[44]=U,t[45]=te);let W;t[46]!==B||t[47]!==te?(W=(0,Z.jsxs)(YS,{align:`inline-end`,className:`gap-0.5`,children:[B,te]}),t[46]=B,t[47]=te,t[48]=W):W=t[48];let ne;t[49]!==W||t[50]!==F?(ne=(0,Z.jsxs)(qS,{className:`h-7 w-56 rounded-[min(var(--radius-md),12px)]`,children:[F,W]}),t[49]=W,t[50]=F,t[51]=ne):ne=t[51];let re;t[52]===E?re=t[53]:(re=(0,Z.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`min-w-14 px-1 text-right text-muted-foreground text-xs tabular-nums shrink-0`,children:E}),t[52]=E,t[53]=re);let G;t[54]===S?G=t[55]:(G=S({id:`oqB2ez`}),t[54]=S,t[55]=G);let ie=!w,K;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Z.jsx)($t,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[56]=K):K=t[56];let q;t[57]!==v||t[58]!==G||t[59]!==ie?(q=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":G,disabled:ie,onClick:v,children:K})}),t[57]=v,t[58]=G,t[59]=ie,t[60]=q):q=t[60];let ae;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,Z.jsx)(Ar,{side:`bottom`,children:(0,Z.jsx)(s,{id:`oqB2ez`})}),t[61]=ae):ae=t[61];let oe;t[62]===q?oe=t[63]:(oe=(0,Z.jsxs)(pr,{children:[q,ae]}),t[62]=q,t[63]=oe);let se;t[64]===S?se=t[65]:(se=S({id:`SiUUCS`}),t[64]=S,t[65]=se);let ce=!w,ue;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,Z.jsx)(le,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[66]=ue):ue=t[66];let de;t[67]!==_||t[68]!==se||t[69]!==ce?(de=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":se,disabled:ce,onClick:_,children:ue})}),t[67]=_,t[68]=se,t[69]=ce,t[70]=de):de=t[70];let fe;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,Z.jsx)(Ar,{side:`bottom`,children:(0,Z.jsx)(s,{id:`SiUUCS`})}),t[71]=fe):fe=t[71];let pe;t[72]===de?pe=t[73]:(pe=(0,Z.jsxs)(pr,{children:[de,fe]}),t[72]=de,t[73]=pe);let me=o?`secondary`:`ghost`,he;t[74]!==S||t[75]!==o?(he=S(o?{id:`UkQGhd`}:{id:`1RluQD`}),t[74]=S,t[75]=o,t[76]=he):he=t[76];let ge=o?`ok-replace-input`:void 0,_e;t[77]!==m||t[78]!==o?(_e=()=>m(!o),t[77]=m,t[78]=o,t[79]=_e):_e=t[79];let ve;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,Z.jsx)(Rl,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[80]=ve):ve=t[80];let ye;t[81]!==o||t[82]!==me||t[83]!==he||t[84]!==ge||t[85]!==_e?(ye=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{type:`button`,variant:me,size:`icon-sm`,"aria-label":he,"aria-expanded":o,"aria-controls":ge,onClick:_e,children:ve})}),t[81]=o,t[82]=me,t[83]=he,t[84]=ge,t[85]=_e,t[86]=ye):ye=t[86];let be;t[87]===o?be=t[88]:(be=(0,Z.jsx)(Ar,{side:`bottom`,children:o?(0,Z.jsx)(s,{id:`UkQGhd`}):(0,Z.jsx)(s,{id:`1RluQD`})}),t[87]=o,t[88]=be);let xe;t[89]!==ye||t[90]!==be?(xe=(0,Z.jsxs)(pr,{children:[ye,be]}),t[89]=ye,t[90]=be,t[91]=xe):xe=t[91];let Se;t[92]!==S||t[93]!==A||t[94]!==w||t[95]!==b||t[96]!==y||t[97]!==p||t[98]!==o||t[99]!==a?(Se=o?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`label`,{className:`sr-only`,htmlFor:`ok-replace-input`,children:(0,Z.jsx)(s,{id:`fqSfXY`})}),(0,Z.jsx)(ks,{id:`ok-replace-input`,value:a,onChange:e=>p(e.target.value),onKeyDown:A,placeholder:S({id:`fqSfXY`}),autoComplete:`off`,spellCheck:!1,className:`h-7 w-48 rounded-[min(var(--radius-md),12px)] px-2 text-sm shadow-none focus-visible:ring-2`}),(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":S({id:`bS_boY`}),disabled:!w,onClick:y,children:(0,Z.jsx)(Rl,{"data-icon":`inline-start`,"aria-hidden":`true`})})}),(0,Z.jsx)(Ar,{side:`bottom`,children:(0,Z.jsx)(s,{id:`bS_boY`})})]}),(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":S({id:`dr1vFs`}),disabled:!w,onClick:b,children:(0,Z.jsx)(Ll,{"data-icon":`inline-start`,"aria-hidden":`true`})})}),(0,Z.jsx)(Ar,{side:`bottom`,children:(0,Z.jsx)(s,{id:`dr1vFs`})})]})]}):null,t[92]=S,t[93]=A,t[94]=w,t[95]=b,t[96]=y,t[97]=p,t[98]=o,t[99]=a,t[100]=Se):Se=t[100];let Ce;t[101]===S?Ce=t[102]:(Ce=S({id:`wJo9oS`}),t[101]=S,t[102]=Ce);let we;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,Z.jsx)(ys,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[103]=we):we=t[103];let Te;t[104]!==x||t[105]!==Ce?(Te=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":Ce,onClick:x,children:we})}),t[104]=x,t[105]=Ce,t[106]=Te):Te=t[106];let Ee;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,Z.jsx)(Ar,{side:`bottom`,children:(0,Z.jsx)(s,{id:`yz7wBu`})}),t[107]=Ee):Ee=t[107];let De;t[108]===Te?De=t[109]:(De=(0,Z.jsxs)(pr,{children:[Te,Ee]}),t[108]=Te,t[109]=De);let Oe;return t[110]!==ne||t[111]!==re||t[112]!==oe||t[113]!==pe||t[114]!==j||t[115]!==xe||t[116]!==Se||t[117]!==De?(Oe=(0,Z.jsxs)(`search`,{"data-testid":`find-replace-bar`,"aria-label":j,className:`pointer-events-auto flex max-w-[min(calc(100vw-1rem),720px)] touch-manipulation items-center gap-1 rounded-[calc(var(--radius)+2px)] border border-input bg-popover/95 p-1 text-popover-foreground shadow-md shadow-black/10 backdrop-blur`,children:[M,ne,re,oe,pe,xe,Se,De]}),t[110]=ne,t[111]=re,t[112]=oe,t[113]=pe,t[114]=j,t[115]=xe,t[116]=Se,t[117]=De,t[118]=Oe):Oe=t[118],Oe}var eC={current:0,total:0},tC=120,nC=100;function rC(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=()=>e?_(e):null,t[0]=e,t[1]=n),(0,Q.useSyncExternalStore)(M,n,iC)}function iC(){return null}function aC(e){if(!e||e.isDestroyed)return null;let{from:t,to:n,empty:r}=e.state.selection;if(r)return null;let i=e.state.doc.textBetween(t,n,`
23
+ `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function ev(e,t){return`${e}\u0000${t}`}function tv(e,t,n){let r=zi(e).body,i=zi(t).body;return r===i?``:Q_(n,r,i,``,``,{context:3})}function nv(e,t,n){let r=(0,$.c)(8),{activeProvider:i}=yt(),a;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={status:`idle`,diff:null},r[0]=a):a=r[0];let[o,s]=(0,Q.useState)(a),c=(0,Q.useRef)(i),l;r[1]===i?l=r[2]:(l=()=>{c.current=i},r[1]=i,r[2]=l),(0,Q.useEffect)(l);let u,d;return r[3]!==n||r[4]!==t||r[5]!==e?(u=()=>{if(!e){s({status:`idle`,diff:null});return}let r=e,i=!1;return s({status:`loading`,diff:null}),(async function(){try{let e=ev(t,r),a=n.get(e);if(a===void 0){let o=await fetch(`/api/history/${r}?docName=${encodeURIComponent(t)}`);if(i)return;if(!o.ok){s({status:`error`,diff:null});return}let c=await o.json();if(i)return;a=c.content??``,n.set(e,a)}if(i)return;let o=c.current?.document.getText(`source`).toString()??``,l=tv(a,o,t);if(i)return;s({status:`ready`,diff:l})}catch(e){i||(console.error(`[timeline-diff] failed to load entry diff`,{sha:r,docName:t,err:e}),s({status:`error`,diff:null}))}})(),()=>{i=!0}},d=[e,t,n],r[3]=n,r[4]=t,r[5]=e,r[6]=u,r[7]=d):(u=r[6],d=r[7]),(0,Q.useEffect)(u,d),o}var rv=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityPanelDiffView-DgtknSgX.js`),__vite__mapDeps([18,1,6,19]),import.meta.url)).ActivityPanelDiffView}));function iv(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3);if(r<60)return Y._({id:`xOTzt5`});if(r<3600){let e=Math.floor(r/60);return Y._({id:`UyROxs`,values:{mins:e}})}if(r<86400){let e=Math.floor(r/3600);return Y._({id:`wXO4Tg`,values:{hrs:e}})}if(r<86400*2)return Y._({id:`rQRrkB`});let i=Math.floor(r/86400);return i<7?Y._({id:`6u9LvN`,values:{days:i}}):t.toLocaleDateString()}function av(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function ov(e){return e.slice(0,7)}function sv(e){return e.type===`upstream`?Y._({id:`K_vT1F`}):e.contributors.length===1?e.contributors[0].name:e.contributors.length>1?e.contributors.map(e=>e.name).join(`, `):e.author===`openknowledge-server`||e.author===`server`?Y._({id:`B2DrPb`}):e.author}function cv(e){let t=(0,$.c)(17),n,r;if(t[0]===e?(n=t[1],r=t[2]):({icon:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),n===`claude`){let e;return t[3]===r?e=t[4]:(e=(0,Z.jsx)(fa,{...r}),t[3]=r,t[4]=e),e}if(n===`cursor`){let e;return t[5]===r?e=t[6]:(e=(0,Z.jsx)(va,{...r}),t[5]=r,t[6]=e),e}if(n===`windsurf`){let e;return t[7]===r?e=t[8]:(e=(0,Z.jsx)(ua,{...r}),t[7]=r,t[8]=e),e}if(n===`openai`){let e;return t[9]===r?e=t[10]:(e=(0,Z.jsx)(ha,{...r}),t[9]=r,t[10]=e),e}if(n===`cline`){let e;return t[11]===r?e=t[12]:(e=(0,Z.jsx)(Ca,{...r}),t[11]=r,t[12]=e),e}if(n===`github`){let e;return t[13]===r?e=t[14]:(e=(0,Z.jsx)(xa,{...r}),t[13]=r,t[14]=e),e}let i=r,a;return t[15]===i?a=t[16]:(a=(0,Z.jsx)(ya,{strokeWidth:1.5,...i}),t[15]=i,t[16]=a),a}function lv(e){let t=(0,$.c)(17),{entry:n,isDark:r}=e;if(n.type===`upstream`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Be,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[0]=e):e=t[0],e}if(n.contributors.length>0){let e=n.contributors[0],i=e.colorSeed??e.name,a;t[1]===i?a=t[2]:(a=oi(i),t[1]=i,t[2]=a);let o=a,s=r?ui[o]??Fi[o]:Fi[o],c;t[3]!==s||t[4]!==i?(c=s??Lr(i),t[3]=s,t[4]=i,t[5]=c):c=t[5];let l=c;if(o!==`bot`){let e;t[6]===l?e=t[7]:(e={color:l},t[6]=l,t[7]=e);let n;return t[8]!==o||t[9]!==e?(n=(0,Z.jsx)(cv,{icon:o,width:14,height:14,className:`shrink-0`,style:e}),t[8]=o,t[9]=e,t[10]=n):n=t[10],n}if(e.name===`File System`){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(hl,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[11]=e):e=t[11],e}if(e.name===`Open Knowledge (service)`||e.name===`Git (upstream)`){let e;return t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Vc,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[12]=e):e=t[12],e}let u;return t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(tu,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[13]=u):u=t[13],u}if(n.authorEmail.includes(`agent`)||n.author.includes(`agent`)||n.authorEmail.includes(`cursor`)||n.authorEmail.includes(`claude`)){let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(ya,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[14]=e):e=t[14],e}if(n.author===`openknowledge-server`||n.author===`server`){let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Vc,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[15]=e):e=t[15],e}let i;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(tu,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[16]=i):i=t[16],i}function uv(e){let t=(0,$.c)(23),{entries:n,defaultExpanded:r,isDark:i,diffLayout:a,cache:o,docName:s,expandedShas:c,onToggleExpanded:l,onRestoreSuccess:u}=e,[d,f]=(0,Q.useState)(r),p=n.length;if(n.length===0)return null;let m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>f(dv),t[0]=m):m=t[0];let h;t[1]===d?h=t[2]:(h=d?(0,Z.jsx)(le,{className:`size-3`}):(0,Z.jsx)(Os,{className:`size-3`}),t[1]=d,t[2]=h);let g;t[3]!==p||t[4]!==d?(g=d?Y._({id:`OKQe56`,values:{entryCount:p}}):Y._({id:`k9jDvw`,values:{entryCount:p}}),t[3]=p,t[4]=d,t[5]=g):g=t[5];let _;t[6]!==d||t[7]!==h||t[8]!==g?(_=(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":d,className:`flex items-center gap-1.5 rounded-lg px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors text-left`,onClick:m,children:[h,g]}),t[6]=d,t[7]=h,t[8]=g,t[9]=_):_=t[9];let v;t[10]!==o||t[11]!==a||t[12]!==s||t[13]!==n||t[14]!==d||t[15]!==c||t[16]!==i||t[17]!==u||t[18]!==l?(v=d&&n.map(e=>(0,Z.jsx)(Cv,{entry:e,isDark:i,diffLayout:a,cache:o,docName:s,expanded:c.has(e.sha),onToggleExpanded:l,onRestoreSuccess:u},e.sha)),t[10]=o,t[11]=a,t[12]=s,t[13]=n,t[14]=d,t[15]=c,t[16]=i,t[17]=u,t[18]=l,t[19]=v):v=t[19];let y;return t[20]!==_||t[21]!==v?(y=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[_,v]}),t[20]=_,t[21]=v,t[22]=y):y=t[22],y}function dv(e){return!e}function fv(e){return e.checkpoint?e.checkpoint.kind:`save`}function pv(e){let t=fv(e);if(t===`save`)return Y._({id:`gsePqm`});let n=e.checkpoint?.size??null,r=n!=null&&n>0?` (${mv(n)})`:``;return t===`bridge-merge-loss`?Y._({id:`uZAG7T`,values:{sizeSuffix:r}}):Y._({id:`_4rAQI`,values:{sizeSuffix:r}})}function mv(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/102.4)/10} KB`:`${Math.round(e/104857.6)/10} MB`}function hv(e){return e.type===`checkpoint`?fv(e)===`save`?`version`:`auto-save`:`wip`}function gv(e){let t=hv(e);return t===`version`?Y._({id:`RFQ1Yx`}):t===`auto-save`?Y._({id:`9Uv1CD`}):Y._({id:`Yea-K5`})}function _v(e){let t=hv(e);return t===`version`?Y._({id:`gg3Rpy`}):t===`auto-save`?Y._({id:`PXXeW8`}):Y._({id:`Pyp1NA`})}function vv(e){let t=[];for(let n of e.contributors)if(n.summaries)for(let e of n.summaries)t.push(e);return t}function yv(e){let t=(0,$.c)(21),{summaries:n}=e,[r,i]=(0,Q.useState)(!1),a=(0,Q.useId)();if(n.length===0)return null;let o,c;t[0]===n?(o=t[1],c=t[2]):([o,...c]=n,t[0]=n,t[1]=o,t[2]=c);let l=c.length,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),t[3]=u):u=t[3];let d;t[4]===o?d=t[5]:(d=(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[u,o]}),t[4]=o,t[5]=d);let f;t[6]!==r||t[7]!==c?(f=r&&c.map(xv),t[6]=r,t[7]=c,t[8]=f):f=t[8];let p;t[9]!==a||t[10]!==d||t[11]!==f?(p=(0,Z.jsxs)(`ul`,{id:a,className:`list-none`,children:[d,f]}),t[9]=a,t[10]=d,t[11]=f,t[12]=p):p=t[12];let m;t[13]!==r||t[14]!==l||t[15]!==a||t[16]!==c.length?(m=c.length>0&&(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":r,"aria-controls":a,className:`inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,onClick:e=>{e.stopPropagation(),i(bv)},children:[r?(0,Z.jsx)(le,{className:`size-3`}):(0,Z.jsx)(Os,{className:`size-3`}),r?(0,Z.jsx)(s,{id:`vLyv1R`}):(0,Z.jsx)(s,{id:`ZptNUh`,values:{hidden:l}})]}),t[13]=r,t[14]=l,t[15]=a,t[16]=c.length,t[17]=m):m=t[17];let h;return t[18]!==p||t[19]!==m?(h=(0,Z.jsxs)(`div`,{className:`mt-0.5`,children:[p,m]}),t[18]=p,t[19]=m,t[20]=h):h=t[20],h}function bv(e){return!e}function xv(e,t){return(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),e]},`${t}-${e}`)}function Sv(e){let t=(0,$.c)(13),{sha:n,docName:r,cache:i,diffLayout:a,panelId:o}=e,c=nv(n,r,i),l;t[0]===c.status?l=t[1]:(l=c.status===`loading`&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)(Ce,{className:`size-3 animate-spin`}),(0,Z.jsx)(s,{id:`38foVZ`})]}),t[0]=c.status,t[1]=l);let u;t[2]===c.status?u=t[3]:(u=c.status===`error`&&(0,Z.jsx)(`p`,{className:`py-2 text-xs text-destructive`,children:(0,Z.jsx)(s,{id:`vvWZnu`})}),t[2]=c.status,t[3]=u);let d;t[4]!==a||t[5]!==c.diff||t[6]!==c.status?(d=c.status===`ready`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)(Ce,{className:`size-3 animate-spin`}),(0,Z.jsx)(s,{id:`EDm3wJ`})]}),children:(0,Z.jsx)(rv,{diff:c.diff,viewType:a})}),t[4]=a,t[5]=c.diff,t[6]=c.status,t[7]=d):d=t[7];let f;return t[8]!==o||t[9]!==l||t[10]!==u||t[11]!==d?(f=(0,Z.jsxs)(`div`,{id:o,className:`px-3 pb-2`,"data-testid":`timeline-entry-diff`,children:[l,u,d]}),t[8]=o,t[9]=l,t[10]=u,t[11]=d,t[12]=f):f=t[12],f}function Cv(e){let t=(0,$.c)(130),{entry:n,prominent:r,isDark:a,diffLayout:o,cache:c,docName:l,expanded:u,onToggleExpanded:d,onRestoreSuccess:f}=e,p=r===void 0?!1:r,{_:m}=i(),h;t[0]===n.timestamp?h=t[1]:(h=iv(n.timestamp),t[0]=n.timestamp,t[1]=h);let g=h,_;t[2]===n?_=t[3]:(_=sv(n),t[2]=n,t[3]=_);let v=_,y;t[4]===n.timestamp?y=t[5]:(y=av(n.timestamp),t[4]=n.timestamp,t[5]=y);let b=y,x;t[6]===n.sha?x=t[7]:(x=ov(n.sha),t[6]=n.sha,t[7]=x);let S=x,C=n.contributors.flatMap(wv),w;t[8]===n?w=t[9]:(w=vv(n),t[8]=n,t[9]=w);let T=w,[E,D]=(0,Q.useState)(!1),[O,k]=(0,Q.useState)(!1),A=(0,Q.useRef)(null),j=(0,Q.useId)(),M,N;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>()=>A.current?.abort(),N=[],t[10]=M,t[11]=N):(M=t[10],N=t[11]),(0,Q.useEffect)(M,N);let P;t[12]!==n.sha||t[13]!==d?(P=()=>d(n.sha),t[12]=n.sha,t[13]=d,t[14]=P):P=t[14];let F=P,I;t[15]===D?I=t[16]:(I=function(){A.current?.abort(),A.current=null,k(!1),D(!1)},t[15]=D,t[16]=I);let L=I,R;t[17]!==m||t[18]!==l||t[19]!==n.sha||t[20]!==f||t[21]!==D?(R=async function(){k(!0);let e=new AbortController;A.current=e;let t=function(){e.signal.aborted||k(!1),A.current===e&&(A.current=null)},r;try{r=await fetch(`/api/rollback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({docName:l,commitSha:n.sha}),signal:e.signal})}catch(r){let i=r;!e.signal.aborted&&!(i instanceof DOMException&&i.name===`AbortError`)&&(console.error(`[timeline] rollback fetch failed`,{docName:l,sha:n.sha,err:i}),X.error(m({id:`NkXEFS`}),{duration:4e3})),t();return}if(e.signal.aborted){t();return}if(r.ok)D(!1),f();else{let e=`HTTP ${r.status}`;try{let t=Yr.safeParse(await r.json());t.success&&(e=t.data.title)}catch{}console.error(`[timeline] rollback failed`,{docName:l,sha:n.sha,status:r.status,detail:e}),X.error(m({id:`uM6jnS`}),{description:e,duration:6e3})}t()},t[17]=m,t[18]=l,t[19]=n.sha,t[20]=f,t[21]=D,t[22]=R):R=t[22];let z=R,B;t[23]!==n||t[24]!==a||t[25]!==p?(B=p?(()=>{let e=fv(n);return e===`bridge-merge-loss`?(0,Z.jsx)(Pi,{className:`size-3.5 shrink-0 text-amber-600 dark:text-amber-400`,"aria-hidden":`true`}):e===`external-change-rescue`?(0,Z.jsx)(ol,{className:`size-3.5 shrink-0 text-sky-600 dark:text-sky-400`,"aria-hidden":`true`}):(0,Z.jsx)(rl,{className:`size-3.5 shrink-0 text-muted-foreground`})})():(0,Z.jsx)(lv,{entry:n,isDark:a}),t[23]=n,t[24]=a,t[25]=p,t[26]=B):B=t[26];let V=B,H=u?j:void 0,U=u?`bg-muted`:`hover:bg-muted/80`,ee;t[27]===U?ee=t[28]:(ee=[`group flex w-full items-start gap-2.5 rounded-lg px-3 py-2.5 text-left transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring`,U],t[27]=U,t[28]=ee);let te=ee.join(` `),W;t[29]===F?W=t[30]:(W=e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),F())},t[29]=F,t[30]=W);let ne;t[31]===V?ne=t[32]:(ne=(0,Z.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:V}),t[31]=V,t[32]=ne);let re;t[33]!==v||t[34]!==n||t[35]!==p?(re=p?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`text-xs text-foreground truncate`,children:pv(n)}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground/50`,children:`·`}),(0,Z.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:v})]}):(0,Z.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:v}),t[33]=v,t[34]=n,t[35]=p,t[36]=re):re=t[36];let G;t[37]!==n.timestamp||t[38]!==g?(G=(0,Z.jsx)(`time`,{className:`ml-auto shrink-0 text-xs text-muted-foreground/80`,dateTime:n.timestamp,title:n.timestamp,children:g}),t[37]=n.timestamp,t[38]=g,t[39]=G):G=t[39];let ie;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`h-3 w-px shrink-0 bg-border`}),t[40]=ie):ie=t[40];let K;t[41]===n?K=t[42]:(K=gv(n),t[41]=n,t[42]=K);let q;t[43]===D?q=t[44]:(q=e=>{e.stopPropagation(),D(!0)},t[43]=D,t[44]=q);let ae;t[45]===O?ae=t[46]:(ae=O?(0,Z.jsx)(Ce,{className:`size-3 animate-spin`}):(0,Z.jsx)(pa,{className:`size-3`}),t[45]=O,t[46]=ae);let oe;t[47]!==O||t[48]!==K||t[49]!==q||t[50]!==ae?(oe=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`timeline-entry-restore`,"aria-label":K,disabled:O,onClick:q,children:ae})}),t[47]=O,t[48]=K,t[49]=q,t[50]=ae,t[51]=oe):oe=t[51];let se;t[52]===n?se=t[53]:(se=gv(n),t[52]=n,t[53]=se);let ce;t[54]===se?ce=t[55]:(ce=(0,Z.jsx)(Ar,{side:`top`,children:se}),t[54]=se,t[55]=ce);let le;t[56]!==oe||t[57]!==ce?(le=(0,Z.jsxs)(pr,{children:[oe,ce]}),t[56]=oe,t[57]=ce,t[58]=le):le=t[58];let ue;t[59]!==re||t[60]!==G||t[61]!==le?(ue=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[re,G,ie,le]}),t[59]=re,t[60]=G,t[61]=le,t[62]=ue):ue=t[62];let de;t[63]===T?de=t[64]:(de=T.length>0&&(0,Z.jsx)(yv,{summaries:T}),t[63]=T,t[64]=de);let fe=C.length>0?(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:C.join(`, `),children:C.join(`, `)}):(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:n.message,children:n.message}),pe;t[65]!==ue||t[66]!==de||t[67]!==fe?(pe=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[ue,de,fe]}),t[65]=ue,t[66]=de,t[67]=fe,t[68]=pe):pe=t[68];let me;t[69]!==u||t[70]!==F||t[71]!==H||t[72]!==te||t[73]!==W||t[74]!==ne||t[75]!==pe?(me=(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-expanded":u,"aria-controls":H,"data-testid":`timeline-entry-expand`,className:te,onClick:F,onKeyDown:W,children:[ne,pe]}),t[69]=u,t[70]=F,t[71]=H,t[72]=te,t[73]=W,t[74]=ne,t[75]=pe,t[76]=me):me=t[76];let he;t[77]!==c||t[78]!==o||t[79]!==j||t[80]!==l||t[81]!==n.sha||t[82]!==u?(he=u&&(0,Z.jsx)(Sv,{sha:n.sha,docName:l,cache:c,diffLayout:o,panelId:j}),t[77]=c,t[78]=o,t[79]=j,t[80]=l,t[81]=n.sha,t[82]=u,t[83]=he):he=t[83];let ge;t[84]!==me||t[85]!==he?(ge=(0,Z.jsxs)(`div`,{className:`flex flex-col rounded-lg`,children:[me,he]}),t[84]=me,t[85]=he,t[86]=ge):ge=t[86];let _e;t[87]!==L||t[88]!==D?(_e=e=>{e?D(!0):L()},t[87]=L,t[88]=D,t[89]=_e):_e=t[89];let ve;t[90]===n?ve=t[91]:(ve=_v(n),t[90]=n,t[91]=ve);let ye;t[92]===ve?ye=t[93]:(ye=(0,Z.jsx)(bs,{children:ve}),t[92]=ve,t[93]=ye);let be;t[94]!==b||t[95]!==v||t[96]!==S||t[97]!==g?(be={relative:g,absoluteTime:b,entrySha:S,authorName:v},t[94]=b,t[95]=v,t[96]=S,t[97]=g,t[98]=be):be=t[98];let xe;t[99]===Symbol.for(`react.memo_cache_sentinel`)?(xe={0:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`}),1:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`})},t[99]=xe):xe=t[99];let Se;t[100]===be?Se=t[101]:(Se=(0,Z.jsx)(vs,{children:(0,Z.jsx)(s,{id:`h6EvY-`,values:be,components:xe})}),t[100]=be,t[101]=Se);let we;t[102]!==ye||t[103]!==Se?(we=(0,Z.jsxs)(ws,{children:[ye,Se]}),t[102]=ye,t[103]=Se,t[104]=we):we=t[104];let Te;t[105]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,Z.jsx)(s,{id:`dEgA5A`}),t[105]=Te):Te=t[105];let Ee;t[106]===L?Ee=t[107]:(Ee=(0,Z.jsx)(sa,{variant:`outline`,"data-testid":`timeline-entry-restore-cancel`,onClick:L,children:Te}),t[106]=L,t[107]=Ee);let De;t[108]===z?De=t[109]:(De=()=>z(),t[108]=z,t[109]=De);let Oe;t[110]===O?Oe=t[111]:(Oe=O?(0,Z.jsx)(Ce,{className:`mr-2 size-4 animate-spin`}):null,t[110]=O,t[111]=Oe);let ke;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,Z.jsx)(s,{id:`yKu_3Y`}),t[112]=ke):ke=t[112];let Ae;t[113]!==O||t[114]!==De||t[115]!==Oe?(Ae=(0,Z.jsxs)(sa,{variant:`destructive`,"data-testid":`timeline-entry-restore-confirm`,disabled:O,onClick:De,children:[Oe,ke]}),t[113]=O,t[114]=De,t[115]=Oe,t[116]=Ae):Ae=t[116];let je;t[117]!==Ee||t[118]!==Ae?(je=(0,Z.jsxs)(Cs,{children:[Ee,Ae]}),t[117]=Ee,t[118]=Ae,t[119]=je):je=t[119];let Me;t[120]!==we||t[121]!==je?(Me=(0,Z.jsxs)(xs,{children:[we,je]}),t[120]=we,t[121]=je,t[122]=Me):Me=t[122];let Ne;t[123]!==E||t[124]!==_e||t[125]!==Me?(Ne=(0,Z.jsx)(Ts,{open:E,onOpenChange:_e,children:Me}),t[123]=E,t[124]=_e,t[125]=Me,t[126]=Ne):Ne=t[126];let Pe;return t[127]!==ge||t[128]!==Ne?(Pe=(0,Z.jsxs)(Z.Fragment,{children:[ge,Ne]}),t[127]=ge,t[128]=Ne,t[129]=Pe):Pe=t[129],Pe}function wv(e){return e.docs}function Tv(e){let t=(0,$.c)(87),{docName:n,diffLayout:r,onDiffLayoutChange:a,onSaveVersion:o,saving:c}=e,{_:l}=i(),{resolvedTheme:u}=Li(),d=u===`dark`,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=[],t[0]=f):f=t[0];let[p,m]=(0,Q.useState)(f),[h,g]=(0,Q.useState)(!1),[_,v]=(0,Q.useState)(null),y=(0,Q.useRef)(null),[b]=(0,Q.useState)(kv),[x,S]=(0,Q.useState)(Ov),C;t[1]===b?C=t[2]:(C=()=>{S(new Set),b.clear()},t[1]=b,t[2]=C);let w;t[3]===n?w=t[4]:(w=[n],t[3]=n,t[4]=w),(0,Q.useEffect)(C,w);let T;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(T=function(e){S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[5]=T):T=t[5];let E=T,D;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(D=function(){S(new Set)},t[6]=D):D=t[6];let O=D,k,A;t[7]!==l||t[8]!==n?(k=()=>{if(!n){m([]);return}let e=!1,t=async function(){if(n)try{let t=await fetch(`/api/history?docName=${encodeURIComponent(n)}&limit=100`);if(e)return;if(!t.ok){v(l({id:`brCtGB`}));return}let r=await t.json();if(e)return;m(r.entries??[]),v(null)}catch(t){let n=t;if(e)return;v(l({id:`brCtGB`})),console.error(`[timeline]`,n)}};return g(!0),t().finally(()=>{e||g(!1)}),y.current=setInterval(t,1e4),()=>{e=!0,y.current&&clearInterval(y.current)}},A=[n,l],t[7]=l,t[8]=n,t[9]=k,t[10]=A):(k=t[9],A=t[10]),(0,Q.useEffect)(k,A);let j,M,N,P,F,I,L,R;if(t[11]!==l||t[12]!==b||t[13]!==r||t[14]!==n||t[15]!==p||t[16]!==_||t[17]!==x||t[18]!==d||t[19]!==h||t[20]!==a||t[21]!==o||t[22]!==c){let e=[],i=[],u=!1;for(let t of p)t.type===`checkpoint`?(i.length>0&&(e.push({kind:`wip-group`,entries:i,isPreCheckpoint:!u}),i=[]),e.push({kind:`checkpoint`,entry:t}),u=!0):i.push(t);i.length>0&&e.push({kind:`wip-group`,entries:i,isPreCheckpoint:!u});let f;t[31]===p?f=t[32]:(f=p.some(Dv),t[31]=p,t[32]=f);let m=!f,g=!h&&!_&&p.length>0;F=`flex h-full flex-col`;let v;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(An,{children:(0,Z.jsx)(s,{id:`cklVjM`})}),t[33]=v):v=t[33];let y;t[34]!==l||t[35]!==r||t[36]!==g||t[37]!==a?(y=g&&(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsxs)(_s,{type:`single`,value:r,onValueChange:e=>{e&&a(e)},"aria-label":l({id:`XvPJaT`}),variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-md shrink-0`,children:[(0,Z.jsx)(hs,{value:`unified`,"aria-label":l({id:`379t2h`}),className:`size-6 px-0`,children:(0,Z.jsx)(zl,{className:`size-3.5`})}),(0,Z.jsx)(hs,{value:`split`,"aria-label":l({id:`HXFyWD`}),className:`size-6 px-0`,children:(0,Z.jsx)($c,{className:`size-3.5`})})]})}),(0,Z.jsx)(Ar,{children:r===`unified`?(0,Z.jsx)(s,{id:`379t2h`}):(0,Z.jsx)(s,{id:`HXFyWD`})})]}),t[34]=l,t[35]=r,t[36]=g,t[37]=a,t[38]=y):y=t[38];let S;t[39]===l?S=t[40]:(S=l({id:`IrYrzq`}),t[39]=l,t[40]=S);let C;t[41]===c?C=t[42]:(C=c?(0,Z.jsx)(Ce,{className:`size-4 animate-spin`}):(0,Z.jsx)(Bl,{className:`size-4`}),t[41]=c,t[42]=C);let w;t[43]!==o||t[44]!==c||t[45]!==S||t[46]!==C?(w=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{variant:`ghost`,size:`icon-sm`,onClick:o,disabled:c,"aria-label":S,className:`text-muted-foreground`,"data-testid":`timeline-save-version`,children:C})}),t[43]=o,t[44]=c,t[45]=S,t[46]=C,t[47]=w):w=t[47];let T;t[48]===c?T=t[49]:(T=(0,Z.jsx)(Ar,{children:c?(0,Z.jsx)(s,{id:`uF9ruK`}):(0,Z.jsx)(s,{id:`IrYrzq`})}),t[48]=c,t[49]=T);let D;t[50]!==w||t[51]!==T?(D=(0,Z.jsxs)(pr,{children:[w,T]}),t[50]=w,t[51]=T,t[52]=D):D=t[52],t[53]!==y||t[54]!==D?(I=(0,Z.jsxs)(Dn,{children:[v,(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[y,D]})]}),t[53]=y,t[54]=D,t[55]=I):I=t[55],L=`flex-1 overflow-y-auto subtle-scrollbar scroll-fade-mask`,t[56]!==l||t[57]!==h?(R=h&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,role:`status`,"aria-busy":`true`,"aria-label":l({id:`o49mDZ`}),children:[1,2,3].map(Ev)}),t[56]=l,t[57]=h,t[58]=R):R=t[58],t[59]!==_||t[60]!==h?(j=!h&&_&&(0,Z.jsx)(`div`,{className:`px-4 py-3`,children:(0,Z.jsx)(`p`,{className:`text-xs text-destructive`,children:_})}),t[59]=_,t[60]=h,t[61]=j):j=t[61],t[62]!==p.length||t[63]!==_||t[64]!==h?(M=!h&&!_&&p.length===0&&(0,Z.jsx)(`div`,{className:`px-4 py-8 text-center`,children:(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(s,{id:`Ta25TG`})})}),t[62]=p.length,t[63]=_,t[64]=h,t[65]=M):M=t[65],t[66]!==b||t[67]!==r||t[68]!==n||t[69]!==p||t[70]!==_||t[71]!==x||t[72]!==m||t[73]!==d||t[74]!==h?(N=!h&&!_&&m&&p.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,children:p.map(e=>(0,Z.jsx)(Cv,{entry:e,isDark:d,diffLayout:r,cache:b,docName:n,expanded:x.has(e.sha),onToggleExpanded:E,onRestoreSuccess:O},e.sha))}),t[66]=b,t[67]=r,t[68]=n,t[69]=p,t[70]=_,t[71]=x,t[72]=m,t[73]=d,t[74]=h,t[75]=N):N=t[75],P=!h&&!_&&!m&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,children:e.map((e,t)=>e.kind===`checkpoint`?(0,Z.jsx)(Cv,{entry:e.entry,prominent:!0,isDark:d,diffLayout:r,cache:b,docName:n,expanded:x.has(e.entry.sha),onToggleExpanded:E,onRestoreSuccess:O},e.entry.sha):(0,Z.jsx)(uv,{entries:e.entries,defaultExpanded:e.isPreCheckpoint,isDark:d,diffLayout:r,cache:b,docName:n,expandedShas:x,onToggleExpanded:E,onRestoreSuccess:O},e.entries[0]?.sha??`wip-${t}`))}),t[11]=l,t[12]=b,t[13]=r,t[14]=n,t[15]=p,t[16]=_,t[17]=x,t[18]=d,t[19]=h,t[20]=a,t[21]=o,t[22]=c,t[23]=j,t[24]=M,t[25]=N,t[26]=P,t[27]=F,t[28]=I,t[29]=L,t[30]=R}else j=t[23],M=t[24],N=t[25],P=t[26],F=t[27],I=t[28],L=t[29],R=t[30];let z;t[76]!==j||t[77]!==M||t[78]!==N||t[79]!==P||t[80]!==L||t[81]!==R?(z=(0,Z.jsxs)(`div`,{className:L,children:[R,j,M,N,P]}),t[76]=j,t[77]=M,t[78]=N,t[79]=P,t[80]=L,t[81]=R,t[82]=z):z=t[82];let B;return t[83]!==F||t[84]!==I||t[85]!==z?(B=(0,Z.jsxs)(`div`,{className:F,children:[I,z]}),t[83]=F,t[84]=I,t[85]=z,t[86]=B):B=t[86],B}function Ev(e){return(0,Z.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg px-3 py-2.5`,children:[(0,Z.jsx)(Pa,{className:`size-3.5 rounded mt-0.5 shrink-0`}),(0,Z.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Z.jsx)(Pa,{className:`h-3 w-28`}),(0,Z.jsx)(Pa,{className:`h-3 w-40`})]})]},e)}function Dv(e){return e.type===`checkpoint`}function Ov(){return new Set}function kv(){return new ma(32)}var Av=[{id:`outline`,icon:Cl},{id:`links`,icon:Ke},{id:`graph`,icon:El},{id:`timeline`,icon:Qc}];function jv(e){return e===`outline`?Y._({id:`dD7NPy`}):e===`links`?Y._({id:`Rj01Fz`}):e===`graph`?Y._({id:`x2fr_j`}):Y._({id:`cklVjM`})}function Mv(){return n(()=>import(`./GraphPanel-PYMXWVsg.js`),__vite__mapDeps([20,1,21,6,3,7,22,23,12,13,24,25,26,27,28,29,30,31,32,33]),import.meta.url)}var Nv=(0,Q.lazy)(async()=>({default:(await Mv()).GraphPanel})),Pv=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityModeContent-BWmb9zCZ.js`),__vite__mapDeps([34,1,2,35,36,37,22,38,39,40,41,21,6,3,7,4,10,12,9,42,43]),import.meta.url)).ActivityModeContent}));function Fv(e){let t=(0,$.c)(20),{docName:n,isSourceMode:r,activeTab:a,onActiveTabChange:o,mode:c,onSaveVersion:l,saving:u}=e,{_:d}=i(),[f,p]=(0,Q.useState)(`unified`),m=Oh(),h,g,_;if(t[0]!==d||t[1]!==a||t[2]!==c||t[3]!==o||t[4]!==m){let e=m?Av.filter(Lv):Av;h=e.some(e=>e.id===a)?a:`outline`,g=c===`doc`&&e.length>1,_=g?(0,Z.jsx)(`div`,{className:`flex flex-row items-center justify-center gap-3 p-2`,children:(0,Z.jsx)(_s,{type:`single`,variant:`outline`,value:h,onValueChange:e=>{e&&o(e)},"aria-label":d({id:`SrOuyg`}),children:e.map(Iv)})}):null,t[0]=d,t[1]=a,t[2]=c,t[3]=o,t[4]=m,t[5]=h,t[6]=g,t[7]=_}else h=t[5],g=t[6],_=t[7];let v;t[8]!==f||t[9]!==n||t[10]!==h||t[11]!==r||t[12]!==c||t[13]!==l||t[14]!==u||t[15]!==g?(v=c===`doc`?(0,Z.jsxs)(`div`,{...g?{role:`tabpanel`,id:`panel-${h}`,"aria-labelledby":`tab-${h}`}:{},className:`min-h-0 flex-1`,children:[h===`outline`&&(0,Z.jsx)(gc,{docName:n,isSourceMode:r}),h===`links`&&(0,Z.jsx)(E_,{docName:n}),h===`graph`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`-lCAuQ`})}),children:(0,Z.jsx)(Nv,{activeDocName:n})}),h===`timeline`&&(0,Z.jsx)(Tv,{docName:n,diffLayout:f,onDiffLayoutChange:p,onSaveVersion:l,saving:u})]}):(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{role:`status`,"aria-busy":`true`,className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`ONPvOb`})}),children:(0,Z.jsx)(Pv,{})})}),t[8]=f,t[9]=n,t[10]=h,t[11]=r,t[12]=c,t[13]=l,t[14]=u,t[15]=g,t[16]=v):v=t[16];let y;return t[17]!==_||t[18]!==v?(y=(0,Z.jsxs)(Z.Fragment,{children:[_,v]}),t[17]=_,t[18]=v,t[19]=y):y=t[19],y}function Iv(e){let{id:t,icon:n}=e,r=jv(t);return(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(hs,{value:t,role:`tab`,id:`tab-${t}`,"aria-controls":`panel-${t}`,"aria-label":r,asChild:!0,children:(0,Z.jsx)(Gn,{children:(0,Z.jsx)(n,{})})}),(0,Z.jsx)(Ar,{side:`bottom`,children:r})]},t)}function Lv(e){return e.id===`outline`}function Rv(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function zv(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function Bv(e){return e/100*window.innerHeight}function Vv(e){return e/100*window.innerWidth}function Hv(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function Uv({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=Hv(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=zv(t,i);break;case`em`:r=Rv(t,i);break;case`vh`:r=Bv(i);break;case`vw`:r=Vv(i);break}return r}function Wv(e){return parseFloat(e.toFixed(3))}function Gv({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function Kv(e){let{panels:t}=e,n=Gv({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=Wv(Uv({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=Wv(Uv({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=Wv(Uv({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=Wv(Uv({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function qv(e,t=`Assertion error`){if(!e)throw Error(t)}function Jv(e,t){return Array.from(t).sort(e===`horizontal`?Yv:Xv)}function Yv(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function Xv(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function Zv(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function Qv(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function $v({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=Qv(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return qv(i,`No rect found`),i}var ey;function ty(){return ey===void 0&&(ey=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),ey}function ny(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=Jv(n,Array.from(t.children).filter(Zv).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,$v({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=ty()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:Gv({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var ry=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},iy=new Map,ay=new ry;function oy(e){iy=new Map(iy),iy.delete(e)}function sy(e,t){for(let[t]of iy)if(t.id===e)return t}function cy(e,t){for(let[t,n]of iy)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function ly(){return iy}function uy(e,t){return ay.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function dy(e,t){let n=iy.get(e);iy=new Map(iy),iy.set(e,t),ay.emit(`groupChange`,{group:e,prev:n,next:t})}function fy(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=Qv(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function py(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function my(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:by(e),b:by(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();qv(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:yy(vy(n.a)),b:yy(vy(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var hy=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function gy(e){let t=getComputedStyle(xy(e)??e).display;return t===`flex`||t===`inline-flex`}function _y(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||gy(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||hy.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function vy(e){let t=e.length;for(;t--;){let n=e[t];if(qv(n,`Missing node`),_y(n))return n}return null}function yy(e){return e&&Number(getComputedStyle(e).zIndex)||0}function by(e){let t=[];for(;e;)t.push(e),e=xy(e);return t}function xy(e){let{parentNode:t}=e;return py(t)?t.host:t}function Sy(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Cy({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!Zv(n)||n.contains(e)||e.contains(n))return!0;if(my(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(Sy(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function wy(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=ny(r),a=fy(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&Cy({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function Ty(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Ey(e,t,n=0){return Math.abs(Wv(e)-Wv(t))<=n}function Dy(e,t){return Ey(e,t)?0:e>t?1:-1}function Oy({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(Dy(r,c)<0)if(a){let e=(i+c)/2;r=Dy(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=Wv(r),r}function ky({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(Ey(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;qv(u!=null,`Invalid first pivot index`),qv(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];qv(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(qv(n!=null,`Previous layout not found for panel index ${t}`),Ey(n,i)){let t=o-n;Dy(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];qv(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(qv(n!=null,`Previous layout not found for panel index ${t}`),Ey(n,o)){let t=n-i;Dy(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];qv(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&Dy(i,c)<0)if(e>0){let t=c-o,n=t/2;Dy(i+e,c)<0&&(e=Dy(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;Dy(i-e,c)<0&&(e=Dy(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];qv(e!=null,`Previous layout not found for panel index ${r}`);let a=Oy({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];qv(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=Oy({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!Ey(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(Ty(c,l))return i;{let t=e<0?d:u,r=s[t];qv(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=Oy({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!Ey(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];qv(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=Oy({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(Ey(i,s)||(t-=s-i,l[r]=s),Ey(t,0))break;e>0?r--:r++}}}if(!Ey(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function Ay(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||Dy(e[n],t[n])!==0)return!1;return!0}function jy({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!Ey(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];qv(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];qv(i!=null,`No layout data found for index ${e}`);let o=r[e];qv(o!=null,`No layout data found for index ${e}`);let s=Oy({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!Ey(a,0))for(let e=0;e<t.length;e++){let n=r[e];qv(n!=null,`No layout data found for index ${e}`);let i=n+a,o=Oy({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,Ey(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function My({groupId:e,panelId:t}){let n=()=>{let t=ly();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=e=>{let r=a();if(e===r)return;let{defaultLayoutDeferred:i,derivedPanelConstraints:o,group:s,groupSize:c,layout:l,separatorToPanels:u}=n(),d=s.panels.findIndex(e=>e.id===t),f=d===s.panels.length-1,p=jy({layout:ky({delta:f?r-e:e-r,initialLayout:l,panelConstraints:o,pivotIndices:f?[d-1,d]:[d,d+1],prevLayout:l,trigger:`imperative-api`}),panelConstraints:o});Ay(l,p)||dy(s,{defaultLayoutDeferred:i,derivedPanelConstraints:o,groupSize:c,layout:p,separatorToPanels:u})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),s=a();e&&s!==t&&(n.expandToSize=s,o(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:s}=i(),c=a();if(e&&c===t){let e=s.expandToSize??n;e===0&&(e=1),o(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&Ey(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=Gv({group:t});o(Wv(Uv({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function Ny(e){e.defaultPrevented||wy(e,ly()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=My({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function Py(e){let t=ly();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function Fy({groupId:e}){let t=()=>{let t=ly();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=jy({layout:e,panelConstraints:r});return n?o:(Ay(o,c)||dy(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function Iy(e,t){let n=Py(e),r=cy(n.id,!0),i=n.separators.find(t=>t.element===e);qv(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);qv(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=Fy({groupId:n.id}).getLayout(),c=jy({layout:ky({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});Ay(s,c)||dy(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function Ly(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=Py(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&Iy(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&Iy(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&Iy(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&Iy(t,-5);break;case`End`:e.preventDefault(),Iy(t,100);break;case`Enter`:{e.preventDefault();let n=Py(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=cy(n.id,!0),o=n.separators.find(e=>e.element===t);qv(o,`Matching separator not found`);let s=a.get(o);qv(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(qv(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];Iy(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=Py(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);qv(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),Iy(t,-100);break}}var Ry={cursorFlags:0,state:`inactive`},zy=new ry;function By(){return Ry}function Vy(e){return zy.addListener(`change`,e)}function Hy(e){let t=Ry,n={...Ry};n.cursorFlags=e,Ry=n,zy.emit(`change`,{prev:t,next:n})}function Uy(e){let t=Ry;Ry=e,zy.emit(`change`,{prev:t,next:e})}function Wy(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=ly(),n=wy(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),Uy({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}var Gy=e=>e,Ky=()=>{},qy=1,Jy=2,Yy=4,Xy=8,Zy=3,Qy=12,$y;function eb(){return $y===void 0&&($y=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&($y=!0)),$y}function tb({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&eb()){let t=(e&qy)!==0,n=(e&Jy)!==0,r=(e&Yy)!==0,i=(e&Xy)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return eb()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var nb=new WeakMap;function rb(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=nb.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));let r=By();switch(r.state){case`active`:case`hover`:{let e=tb({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}nb.set(e,{prevStyle:t,styleSheet:n})}function ib({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=ky({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(Ay(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?qy:Jy;break;case`vertical`:s|=d<0?Yy:Xy;break}}else dy(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&Zy:c|=s&Zy,t.movementY===0?c|=o&Qy:c|=s&Qy,Hy(c),rb(e)}function ab(e){let t=ly(),n=By();switch(n.state){case`active`:ib({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function ob(e){if(e.defaultPrevented)return;let t=By(),n=ly();switch(t.state){case`active`:if(e.buttons===0){Uy({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=cy(e.group.id,!0);dy(e.group,t)});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}ib({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=wy(e,n);r.length===0?t.state!==`inactive`&&Uy({cursorFlags:0,state:`inactive`}):Uy({cursorFlags:0,hitRegions:r,state:`hover`}),rb(e.currentTarget);break}}}function sb(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(By().state){case`hover`:Uy({cursorFlags:0,state:`inactive`})}}function cb(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=By();switch(t.state){case`active`:Uy({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(rb(e.currentTarget),t.hitRegions.forEach(e=>{let t=cy(e.group.id,!0);dy(e.group,t)}),e.preventDefault())}}function lb(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=Wv(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=Wv((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function ub(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=Gv({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:Wv(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function db(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function fb({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=Wv(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=Wv((r[e]??0)/a*l);else{let e=Wv(l/c.length);for(let t of c)u[t]=e}return u}function pb(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var mb=new Map;function hb(e){let t=!0;qv(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=Gv({group:e});if(t===0)return;let n=cy(e.id);if(!n)return;let r=Kv(e),i=n.defaultLayoutDeferred?lb(r):n.layout,a=jy({layout:fb({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&Ay(n.layout,a)&&db(n.derivedPanelConstraints,r)&&n.groupSize===t)return;dy(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else ub(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{qv(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=Gv({group:e}),s=Kv(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(pb(e.panels,l)||(l=void 0));let u=jy({layout:e.mutableState.layouts[c]??l??lb(s),panelConstraints:s}),d=e.element.ownerDocument;mb.set(d,(mb.get(d)??0)+1);let f=new Map;return ny(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),dy(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{qv(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,Ly)}),mb.get(d)===1&&(d.addEventListener(`dblclick`,Ny,!0),d.addEventListener(`pointerdown`,Wy,!0),d.addEventListener(`pointerleave`,ab),d.addEventListener(`pointermove`,ob),d.addEventListener(`pointerout`,sb),d.addEventListener(`pointerup`,cb,!0)),function(){t=!1,mb.set(d,Math.max(0,(mb.get(d)??0)-1)),oy(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,Ly)}),mb.get(d)||(d.removeEventListener(`dblclick`,Ny,!0),d.removeEventListener(`pointerdown`,Wy,!0),d.removeEventListener(`pointerleave`,ab),d.removeEventListener(`pointermove`,ob),d.removeEventListener(`pointerout`,sb),d.removeEventListener(`pointerup`,cb,!0)),a.disconnect()}}function gb(){let[e,t]=(0,Q.useState)({});return[e,(0,Q.useCallback)(()=>t({}),[])]}function _b(e){let t=(0,Q.useId)();return`${e??t}`}var vb=typeof window<`u`?Q.useLayoutEffect:Q.useEffect;function yb(e){let t=(0,Q.useRef)(e);return vb(()=>{t.current=e},[e]),(0,Q.useCallback)((...e)=>t.current?.(...e),[t])}function bb(...e){return yb(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function xb(e){let t=(0,Q.useRef)({...e});return vb(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var Sb=(0,Q.createContext)(null);function Cb(e,t){let n=(0,Q.useRef)({getLayout:()=>({}),setLayout:Gy});(0,Q.useImperativeHandle)(t,()=>n.current,[]),vb(()=>{Object.assign(n.current,Fy({groupId:e}))})}function wb({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,Q.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=yb(e=>{Ay(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=yb(e=>{Ay(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e))}),_=_b(s),v=(0,Q.useRef)(null),[y,b]=gb(),x=(0,Q.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=bb(v,a);Cb(_,o);let C=yb((e,t)=>{let r=By(),i=sy(e),a=cy(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),w=xb({defaultLayout:n,disableCursor:r}),T=(0,Q.useMemo)(()=>({get disableCursor(){return!!w.disableCursor},getPanelStyles:C,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=Jv(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=Jv(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},updatePanelProps:(e,{disabled:t})=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=sy(_),i=cy(_);r&&i&&dy(r,{...i,derivedPanelConstraints:Kv(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=x.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[C,_,b,u,w]),E=(0,Q.useRef)(null);return vb(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(w.defaultLayout!==void 0&&Object.keys(w.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=w.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!w.disableCursor,expandedPanelSizes:x.current.lastExpandedPanelSizes,layouts:x.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};E.current=r;let a=hb(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=cy(r.id,!0);!o&&s.length>0&&(h(c),g(c));let l=uy(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=Ey(t.collapsedSize,i[t.panelId]),a=Ey(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=By().state!==`active`;h(i),o&&g(i)});return()=>{E.current=null,a(),l()}},[i,_,g,h,u,y,w]),(0,Q.useEffect)(()=>{let e=E.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,Z.jsx)(Sb.Provider,{value:T,children:(0,Z.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:S,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}wb.displayName=`Group`;function Tb(){let e=(0,Q.useContext)(Sb);return qv(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function Eb(e,t){let{id:n}=Tb(),r=(0,Q.useRef)({collapse:Ky,expand:Ky,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Ky});(0,Q.useImperativeHandle)(t,()=>r.current,[]),vb(()=>{Object.assign(r.current,My({groupId:n,panelId:e}))})}function Db({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=_b(c),_=xb({disabled:a}),v=(0,Q.useRef)(null),y=bb(v,o),{getPanelStyles:b,id:x,orientation:S,registerPanel:C,updatePanelProps:w}=Tb(),T=d!==null,E=yb((e,t,n)=>{d?.(e,c,n)});vb(()=>{let e=v.current;if(e!==null)return C({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:T?E:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}})},[s,n,r,i,T,g,h,l,u,E,C,_]),(0,Q.useEffect)(()=>{w(g,{disabled:a})},[a,g,w]),Eb(g,f);let D=()=>{let e=b(x,g);if(e)return JSON.stringify(e)},O=(0,Q.useSyncExternalStore)(e=>uy(x,e),D,D),k;return k=O?JSON.parse(O):i?{flexGrow:void 0,flexShrink:void 0,flexBasis:i}:{flexGrow:1},(0,Z.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...Ob,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...k},children:(0,Z.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:S===`horizontal`?`pan-y`:`pan-x`},children:e})})}Db.displayName=`Panel`;var Ob={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function kb(){return(0,Q.useRef)(null)}function Ab({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=jy({layout:ky({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=jy({layout:ky({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function jb({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=_b(a),l=xb({disabled:n,disableDoubleClick:r}),[u,d]=(0,Q.useState)({}),[f,p]=(0,Q.useState)(`inactive`),m=(0,Q.useRef)(null),h=bb(m,i),{disableCursor:g,id:_,orientation:v,registerSeparator:y,updateSeparatorProps:b}=Tb(),x=v===`horizontal`?`vertical`:`horizontal`;vb(()=>{let e=m.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=y(t),r=Vy(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=uy(_,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(Ab({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[_,c,y,l]),(0,Q.useEffect)(()=>{b(c,{disabled:n,disableDoubleClick:r})},[n,r,c,b]);let S;return n&&!g&&(S=`not-allowed`),(0,Z.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":x,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":n?`disabled`:f,"data-testid":c,id:c,ref:h,role:`separator`,style:{flexBasis:`auto`,cursor:S,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}jb.displayName=`Separator`;var Mb={name:`toml`,startState:function(){return{inString:!1,stringType:``,lhs:!0,inArray:0}},token:function(e,t){let n;if(!t.inString&&(n=e.match(/^('''|"""|'|")/))&&(t.stringType=n[0],t.inString=!0),e.sol()&&!t.inString&&t.inArray===0&&(t.lhs=!0),t.inString){for(;t.inString;)if(e.match(t.stringType))t.inString=!1;else if(e.peek()===`\\`)e.next(),e.next();else if(e.eol())break;else e.match(/^.[^\\\"\']*/);return t.lhs?`property`:`string`}else if(t.inArray&&e.peek()===`]`)return e.next(),t.inArray--,`bracket`;else if(t.lhs&&e.peek()===`[`&&e.skipTo(`]`))return e.next(),e.peek()===`]`&&e.next(),`atom`;else if(e.peek()===`#`)return e.skipToEnd(),`comment`;else if(e.eatSpace())return null;else if(t.lhs&&e.eatWhile(function(e){return e!=`=`&&e!=` `}))return`property`;else if(t.lhs&&e.peek()===`=`)return e.next(),t.lhs=!1,null;else if(!t.lhs&&e.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return`atom`;else if(!t.lhs&&(e.match(`true`)||e.match(`false`)))return`atom`;else if(!t.lhs&&e.peek()===`[`)return t.inArray++,e.next(),`bracket`;else if(!t.lhs&&e.match(/^\-?\d+(?:\.\d+)?/))return`number`;else e.eatSpace()||e.next();return null},languageData:{commentTokens:{line:`#`}}},Nb=h({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),Pb=an({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}});function Fb(e){switch(e.toLowerCase()){case`json`:case`canvas`:return pc().language;case`toml`:return lc.define(Mb);default:return null}}function Ib(e){let t=(0,$.c)(5),{_:n}=i(),r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={status:`loading`},t[0]=r):r=t[0];let[a,o]=(0,Q.useState)(r),s,c;return t[1]!==n||t[2]!==e?(s=()=>{let t=!1,r=new AbortController;return o({status:`loading`}),fetch(e,{credentials:`same-origin`,signal:r.signal}).then(async e=>{if(!e.ok){let t=e.status;throw Error(n(t===413?{id:`C_WGy8`}:t===404?{id:`s0IDhW`}:t===400?{id:`N1mdmS`}:{id:`96w9hU`,values:{status:t}}))}return e.text()}).then(e=>{t||o({status:`loaded`,content:e})}).catch(e=>{t||e instanceof Error&&e.name===`AbortError`||o({status:`error`,message:e instanceof Error?e.message:n({id:`ig5vUe`})})}),()=>{t=!0,r.abort()}},c=[e,n],t[1]=n,t[2]=e,t[3]=s,t[4]=c):(s=t[3],c=t[4]),(0,Q.useEffect)(s,c),a}function Lb(e){let t=(0,$.c)(28),{src:n,fileName:r,extension:i}=e,a=(0,Q.useRef)(null),o=(0,Q.useRef)(null),{resolvedTheme:c}=Li(),l=Ib(n),u=l.status===`loaded`?l.content:null,d,f;if(t[0]!==i||t[1]!==u||t[2]!==c?(d=()=>{if(!a.current||u===null)return;let e=Fb(i),t=c===`dark`?Nb:Pb,n=[Tc,...e?[e]:[],ac.editable.of(!0),Ys.readOnly.of(!0),ac.lineWrapping,t],r=new ac({state:Ys.create({doc:u,extensions:n}),parent:a.current});return o.current=r,()=>{r.destroy(),o.current=null}},f=[u,i,c],t[0]=i,t[1]=u,t[2]=c,t[3]=d,t[4]=f):(d=t[3],f=t[4]),(0,Q.useEffect)(d,f),l.status===`loading`){let e;t[5]===r?e=t[6]:(e=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`Md709y`,values:{fileName:r}})}),t[5]=r,t[6]=e);let n;return t[7]!==i||t[8]!==r||t[9]!==e?(n=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center bg-background text-muted-foreground text-sm`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`loading`,"data-text-viewer-extension":i,children:e}),t[7]=i,t[8]=r,t[9]=e,t[10]=n):n=t[10],n}if(l.status===`error`){let e;t[11]===r?e=t[12]:(e=(0,Z.jsx)(`div`,{className:`font-medium text-sm`,children:(0,Z.jsx)(s,{id:`qdBUHP`,values:{fileName:r}})}),t[11]=r,t[12]=e);let a;t[13]===l.message?a=t[14]:(a=(0,Z.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:l.message}),t[13]=l.message,t[14]=a);let o;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(s,{id:`9npOH9`}),t[15]=o):o=t[15];let c;t[16]===n?c=t[17]:(c=(0,Z.jsx)(`a`,{href:n,className:`mt-2 rounded-md border px-3 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground`,children:o}),t[16]=n,t[17]=c);let u;return t[18]!==i||t[19]!==r||t[20]!==e||t[21]!==a||t[22]!==c?(u=(0,Z.jsxs)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center gap-2 bg-background p-4 text-center`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`error`,"data-text-viewer-extension":i,children:[e,a,c]}),t[18]=i,t[19]=r,t[20]=e,t[21]=a,t[22]=c,t[23]=u):u=t[23],u}let p;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(`div`,{ref:a,className:`min-h-0 flex-1 overflow-auto`}),t[24]=p):p=t[24];let m;return t[25]!==i||t[26]!==r?(m=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`loaded`,"data-text-viewer-extension":i,children:p}),t[25]=i,t[26]=r,t[27]=m):m=t[27],m}function Rb(e){return Si(`/api/asset?path=${encodeURIComponent(e)}`)}function zb(e){return`/api/asset-text?path=${encodeURIComponent(e)}`}function Bb(e){let t=(0,$.c)(31),{assetPath:n,mediaKind:r}=e,[i,a]=(0,Q.useState)(!1),o;t[0]===n?o=t[1]:(o=Rb(n),t[0]=n,t[1]=o);let c=o,l;t[2]===n?l=t[3]:(l=n.split(`/`).pop()??n,t[2]=n,t[3]=l);let u=l,d,f,p,m;if(t[4]!==n||t[5]!==u||t[6]!==i||t[7]!==r||t[8]!==c){m=Symbol.for(`react.early_return_sentinel`);bb0:{if(p=u.includes(`.`)?u.split(`.`).pop()??``:``,f=p.length>0?p.toUpperCase():`FILE`,d=i?`text`:r,d===`pdf`){let e;t[13]!==u||t[14]!==c?(e=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,Z.jsx)(Fe,{src:c,title:u,fillContainer:!0})}),t[13]=u,t[14]=c,t[15]=e):e=t[15];let n;t[16]!==u||t[17]!==e?(n=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":u,children:e}),t[16]=u,t[17]=e,t[18]=n):n=t[18],m=n;break bb0}if(d===`text`){let e;t[19]===n?e=t[20]:(e=zb(n),t[19]=n,t[20]=e),m=(0,Z.jsx)(Lb,{src:e,fileName:u,extension:p.toLowerCase()},n);break bb0}}t[4]=n,t[5]=u,t[6]=i,t[7]=r,t[8]=c,t[9]=d,t[10]=f,t[11]=p,t[12]=m}else d=t[9],f=t[10],p=t[11],m=t[12];if(m!==Symbol.for(`react.early_return_sentinel`))return m;let h;t[21]!==n||t[22]!==d||t[23]!==f||t[24]!==u||t[25]!==p||t[26]!==c?(h=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:d===`image`?(0,Z.jsx)(zt,{src:c,alt:u,draggable:!1,slotClassName:`flex h-full w-full items-center justify-center`,className:`max-h-full max-w-full`}):d===`video`?(0,Z.jsx)(`video`,{src:c,controls:!0,className:`max-h-full max-w-full`}):d===`audio`?(0,Z.jsx)(`audio`,{src:c,controls:!0,className:`w-full max-w-md`}):(0,Z.jsxs)(`div`,{className:`flex max-w-sm flex-col items-center gap-3 text-center`,children:[(0,Z.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-md border bg-muted font-medium text-muted-foreground text-sm`,children:f}),(0,Z.jsx)(`div`,{className:`max-w-full break-words font-medium text-sm`,children:u}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[(0,Z.jsx)(sa,{variant:`outline`,size:`sm`,onClick:()=>{V({url:c,projectRelPath:n,ext:p.toLowerCase(),title:u,forceOsDelegation:!1})},children:(0,Z.jsx)(s,{id:`9npOH9`})}),(0,Z.jsx)(sa,{variant:`outline`,size:`sm`,onClick:()=>a(!0),"data-testid":`asset-preview-open-as-text`,children:(0,Z.jsx)(s,{id:`Ruuu3v`})})]})]})}),t[21]=n,t[22]=d,t[23]=f,t[24]=u,t[25]=p,t[26]=c,t[27]=h):h=t[27];let g;return t[28]!==u||t[29]!==h?(g=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":u,children:h}),t[28]=u,t[29]=h,t[30]=g):g=t[30],g}function Vb(){let e=(0,$.c)(5),{_:t}=i(),n;e[0]===t?n=e[1]:(n=t({id:`3VsNTI`}),e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(Pa,{className:`h-9 w-2/5 mt-6 mb-5`}),(0,Z.jsx)(Pa,{className:`h-4 w-full`}),(0,Z.jsx)(Pa,{className:`h-4 w-3/4`})]}),e[2]=r):r=e[2];let a;return e[3]===n?a=e[4]:(a=(0,Z.jsx)(`div`,{className:`tiptap-editor pt-10`,role:`status`,"aria-busy":`true`,"aria-label":n,children:r}),e[3]=n,e[4]=a),a}var Hb={"claude-cowork":`claude`,"claude-code":`claude`,codex:`openai`,cursor:`cursor`};function Ub(e){let t=(0,$.c)(23),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({id:r,style:a,className:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let{resolvedTheme:o}=Li(),s=Hb[r],c=s?(o===`dark`?ui[s]:void 0)??Fi[s]:void 0,l;t[5]!==c||t[6]!==a?(l=c?{...a,"--ok-brand-color":c}:a,t[5]=c,t[6]=a,t[7]=l):l=t[7];let u=l,d=c&&`[&_*]:![color:var(--ok-brand-color)]`,f;t[8]!==n||t[9]!==d?(f=ea(d,n),t[8]=n,t[9]=d,t[10]=f):f=t[10];let p=f;if(r===`claude-cowork`||r===`claude-code`){let e;return t[11]!==p||t[12]!==u||t[13]!==i?(e=(0,Z.jsx)(fa,{style:u,className:p,...i}),t[11]=p,t[12]=u,t[13]=i,t[14]=e):e=t[14],e}if(r===`codex`){let e;return t[15]!==p||t[16]!==u||t[17]!==i?(e=(0,Z.jsx)(da,{style:u,className:p,...i}),t[15]=p,t[16]=u,t[17]=i,t[18]=e):e=t[18],e}if(r===`cursor`){let e;return t[19]!==p||t[20]!==u||t[21]!==i?(e=(0,Z.jsx)(va,{style:u,className:p,...i}),t[19]=p,t[20]=u,t[21]=i,t[22]=e):e=t[22],e}return null}function Wb(e){let{installState:t}=e;return t.installed===null?Y._({id:`IA6JW2`}):t.installed===!1?Y._({id:`5SwVv1`}):null}function Gb(e){let{target:t,installState:n}=e;if(n.installed===null)return{enabled:!1,tooltip:null};if(n.installed===!1){let e=t.appBrandName??t.displayName;return{enabled:!1,tooltip:{message:Y._({id:`OJTOUj`,values:{brand:e}}),installAction:{label:Y._({id:`fG0X0e`,values:{brand:e}}),url:t.installUrl},...t.hasWebFallback?{webFallback:{label:Y._({id:`0S9PW_`}),url:``}}:{}}}}return{enabled:!0,tooltip:null}}function Kb(e){return _r(e)}function qb(e){return Y._({id:`h_HYHD`,values:{displayName:e}})}var Jb=`claude.ai`;async function Yb(e,t=tg){(await t(_r(e))).ok?X.success(qb(Jb)):X.error(Y._({id:`9NC_MT`,values:{CLAUDE_WEB_FALLBACK_LABEL:Jb}}))}function Xb(e){let t=(0,$.c)(68),{_:n}=i(),{target:r,installState:a,isElectronHost:o,prompt:s,onSelect:c}=e,l=e.openExternal??tg,u=e.onWebFallbackSuccess??Qb,d=e.onWebFallbackError??Zb,{displayName:f}=r,p,m,h,g,_,v,y,b,x,S;if(t[0]!==n||t[1]!==a||t[2]!==o||t[3]!==c||t[4]!==d||t[5]!==u||t[6]!==l||t[7]!==s||t[8]!==r||t[9]!==f){S=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Gb({target:r,installState:a,isElectronHost:o}),i=Wb({target:r,installState:a,isElectronHost:o}),C=()=>{e.tooltip&&l(e.tooltip.installAction.url)},w;t[20]!==d||t[21]!==u||t[22]!==l||t[23]!==s||t[24]!==r?(w=()=>{(async()=>{let e=await l(Kb(s));e.ok?u(r):d(r,e.detail??e.reason)})()},t[20]=d,t[21]=u,t[22]=l,t[23]=s,t[24]=r,t[25]=w):w=t[25];let T=w;if(e.enabled){let e=`open-in-agent-item-${r.id}`,i;t[26]!==n||t[27]!==f?(i=n({id:`NnQapF`,values:{targetDisplayName:f}}),t[26]=n,t[27]=f,t[28]=i):i=t[28];let a;t[29]===r.id?a=t[30]:(a=(0,Z.jsx)(Ub,{id:r.id,"aria-hidden":`true`}),t[29]=r.id,t[30]=a);let o;t[31]===r.displayName?o=t[32]:(o=(0,Z.jsx)(`span`,{children:r.displayName}),t[31]=r.displayName,t[32]=o);let s;t[33]!==c||t[34]!==i||t[35]!==a||t[36]!==o||t[37]!==e?(s=(0,Z.jsxs)($o,{onSelect:c,"data-testid":e,"aria-label":i,children:[a,o]}),t[33]=c,t[34]=i,t[35]=a,t[36]=o,t[37]=e,t[38]=s):s=t[38],S=s;break bb0}if(!e.tooltip){let e=n(i?{id:`If0crP`,values:{targetDisplayName:f,hint:i}}:{id:`NnQapF`,values:{targetDisplayName:f}}),a;t[39]===r.id?a=t[40]:(a=(0,Z.jsx)(Ub,{id:r.id,"aria-hidden":`true`}),t[39]=r.id,t[40]=a);let o;t[41]===r.displayName?o=t[42]:(o=(0,Z.jsx)(`span`,{className:`flex-1`,children:r.displayName}),t[41]=r.displayName,t[42]=o),S=(0,Z.jsxs)($o,{disabled:!0,"data-testid":`open-in-agent-item-${r.id}`,"aria-label":e,children:[a,o,i?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:i}):null]});break bb0}let E=n(i?{id:`If0crP`,values:{targetDisplayName:f,hint:i}}:{id:`NnQapF`,values:{targetDisplayName:f}}),D=e.tooltip.webFallback?.label??``;m=Ko;let O=`open-in-agent-item-${r.id}`,k;t[43]===r.id?k=t[44]:(k=(0,Z.jsx)(Ub,{id:r.id,"aria-hidden":`true`,className:`mr-2`}),t[43]=r.id,t[44]=k);let A;t[45]===r.displayName?A=t[46]:(A=(0,Z.jsx)(`span`,{className:`flex-1`,children:r.displayName}),t[45]=r.displayName,t[46]=A);let j;t[47]===i?j=t[48]:(j=i?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:i}):null,t[47]=i,t[48]=j),t[49]!==E||t[50]!==k||t[51]!==A||t[52]!==j||t[53]!==O?(x=(0,Z.jsxs)(Oo,{"data-testid":O,"data-row-disabled":``,"aria-label":E,children:[k,A,j]}),t[49]=E,t[50]=k,t[51]=A,t[52]=j,t[53]=O,t[54]=x):x=t[54],p=es,h=`min-w-[260px]`,g=`open-in-agent-submenu-${r.id}`,_=(0,Z.jsx)(Fo,{className:`font-normal text-muted-foreground text-xs`,"data-testid":`open-in-agent-message-${r.id}`,children:e.tooltip.message}),t[55]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(To,{}),t[55]=v):v=t[55],y=(0,Z.jsx)($o,{onSelect:C,"data-testid":`open-in-agent-install-${r.id}`,children:(0,Z.jsx)(`span`,{children:e.tooltip.installAction.label})}),b=e.tooltip.webFallback?(0,Z.jsxs)($o,{onSelect:T,"data-testid":`open-in-agent-web-fallback-${r.id}`,"aria-label":n({id:`lsOFZR`,values:{webFallbackLabel:D}}),children:[(0,Z.jsx)(`span`,{className:`flex-1`,children:e.tooltip.webFallback.label}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:n({id:`Z9BoIy`})})]}):null}t[0]=n,t[1]=a,t[2]=o,t[3]=c,t[4]=d,t[5]=u,t[6]=l,t[7]=s,t[8]=r,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_,t[15]=v,t[16]=y,t[17]=b,t[18]=x,t[19]=S}else p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=t[16],b=t[17],x=t[18],S=t[19];if(S!==Symbol.for(`react.early_return_sentinel`))return S;let C;t[56]!==p||t[57]!==h||t[58]!==g||t[59]!==_||t[60]!==v||t[61]!==y||t[62]!==b?(C=(0,Z.jsxs)(p,{className:h,"data-testid":g,children:[_,v,y,b]}),t[56]=p,t[57]=h,t[58]=g,t[59]=_,t[60]=v,t[61]=y,t[62]=b,t[63]=C):C=t[63];let w;return t[64]!==m||t[65]!==x||t[66]!==C?(w=(0,Z.jsxs)(m,{children:[x,C]}),t[64]=m,t[65]=x,t[66]=C,t[67]=w):w=t[67],w}function Zb(){}function Qb(){}function $b(e){let t=(0,$.c)(12),{className:n}=e,{states:r,refresh:i}=jg(),{dispatch:a}=bg(),o=No(),s,c;if(t[0]!==n||t[1]!==a||t[2]!==i||t[3]!==r||t[4]!==o){let e=sg({workspace:o});t[7]===n?s=t[8]:(s=ea(`grid w-full max-w-5xl gap-4 sm:grid-cols-3`,n),t[7]=n,t[8]=s),c=Ch.map(t=>{let n=r[t.id]?.installed,o=n===!0?`installed`:n===!1?`missing`:`pending`;return(0,Z.jsx)(ex,{target:t,status:o,onOpen:o===`installed`&&e!==null?()=>{a(t.id,e)}:void 0,onInstall:()=>{ug(t),i()}},t.id)}),t[0]=n,t[1]=a,t[2]=i,t[3]=r,t[4]=o,t[5]=s,t[6]=c}else s=t[5],c=t[6];let l;return t[9]!==s||t[10]!==c?(l=(0,Z.jsx)(`div`,{className:s,children:c}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function ex(e){let t=(0,$.c)(17),{target:n,status:r,onOpen:i,onInstall:a}=e,o=r===`installed`?i:r===`missing`?a:void 0,s=r===`pending`||r===`installed`&&i===void 0,c=r===`installed`?`Open`:r===`missing`?`Install`:`Checking`,l;t[0]===n.id?l=t[1]:(l=(0,Z.jsx)(Ub,{id:n.id,"aria-hidden":`true`,className:`size-4`}),t[0]=n.id,t[1]=l);let u;t[2]===n.displayName?u=t[3]:(u=(0,Z.jsx)(`h3`,{className:`text-sm font-medium leading-tight`,children:n.displayName}),t[2]=n.displayName,t[3]=u);let d;t[4]!==l||t[5]!==u?(d=(0,Z.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center gap-2`,children:[l,u]}),t[4]=l,t[5]=u,t[6]=d):d=t[6];let f;t[7]===r?f=t[8]:(f=r===`missing`?(0,Z.jsx)(ms,{"aria-hidden":`true`,className:`size-3`}):null,t[7]=r,t[8]=f);let p;t[9]!==c||t[10]!==f?(p=(0,Z.jsxs)(`p`,{className:`inline-flex items-center gap-1 font-mono text-2xs uppercase tracking-wider text-muted-foreground`,children:[c,f]}),t[9]=c,t[10]=f,t[11]=p):p=t[11];let m;return t[12]!==s||t[13]!==o||t[14]!==d||t[15]!==p?(m=(0,Z.jsxs)(`button`,{type:`button`,onClick:o,disabled:s,className:`group flex h-full flex-row items-center justify-between gap-4 rounded-xl border border-border/60 bg-card p-4 text-left transition-[border-color,box-shadow,transform] hover:border-border hover:shadow-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:cursor-not-allowed disabled:opacity-60`,children:[d,p]}),t[12]=s,t[13]=o,t[14]=d,t[15]=p,t[16]=m):m=t[16],m}var tx=3100,nx=3;function rx(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??nx;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var ix={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:500,durationMin:1100,durationMax:2400}},ax=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function ox(e,t={}){let n=t.rng??Math.random,r=t.colors??ax,i=ix[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var sx=1.8,cx=90,lx=16,ux=380,dx=.025,fx=.1,px=.18,mx=400,hx=9.2736,gx=18.1799,_x=14.5244,vx={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function yx(e,t){let{halfWidth:n,apexLift:r}=vx[t];return`M${e-n} ${_x+.3} Q${e} ${_x-r}, ${e+n} ${_x+.3}`}function bx(e){let t=1.5,n=.3;return`M${e-t} ${_x-n} Q${e} ${_x+1.4}, ${e+t} ${_x-n}`}var xx=15,Sx=15;function Cx(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function wx(e){let t=(0,$.c)(71),{size:n,className:r,trackMouse:i,variant:a,celebrateSignal:o}=e,s=n===void 0?48:n,c=i===void 0?!0:i,l=a===void 0?`default`:a,u=o===void 0?0:o,d=(0,Q.useRef)(null),f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={x:0,y:0},t[0]=m):m=t[0];let h=(0,Q.useRef)(m),[g,_]=(0,Q.useState)(0),[v,y]=(0,Q.useState)(0),b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[1]=b):b=t[1];let[x,S]=(0,Q.useState)(b),C=(0,Q.useRef)(0),w=(0,Q.useRef)(void 0),T=l===`sleeping`,E;t[2]!==g||t[3]!==T?(E=function(){if(T)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=C.current===0?1/0:e-C.current;C.current=e;let n=rx(g,t);_(n),y(Ox),S(ox(n)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},tx)},t[2]=g,t[3]=T,t[4]=E):E=t[4];let D=E,O,k;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>()=>clearTimeout(w.current),k=[],t[5]=O,t[6]=k):(O=t[5],k=t[6]),(0,Q.useEffect)(O,k);let A,j;t[7]!==u||t[8]!==T?(A=()=>{u===0||T||(_(3),y(Dx),S(ox(3)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},tx))},j=[u,T],t[7]=u,t[8]=T,t[9]=A,t[10]=j):(A=t[9],j=t[10]),(0,Q.useEffect)(A,j);let M,N;t[11]!==T||t[12]!==c?(M=()=>{if(!c||T||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,l=function(){s===0&&(s=requestAnimationFrame(m))},u=function(r){e=r.clientX,t=r.clientY,n=!0,l()};function m(){s=0;let c=f.current,u=d.current;if(!c||!u){l();return}let m=n;n=!1;let g=c.getBoundingClientRect(),_=g.left+g.width/2,v=g.top+g.height*.48,y=e-_,b=t-v,x=Math.hypot(y,b),S=Math.max(-1,Math.min(1,y/ux)),C=Math.max(-1,Math.min(1,b/ux)),w=S*lx,T=-C*lx,E=0,D=0;if(x>=1){let e=Math.min(x/cx,1)*sx;E=y/x*e,D=b/x*e}let O=Math.abs(T-r)<.01&&Math.abs(w-i)<.01&&Math.abs(E-a)<.01&&Math.abs(D-o)<.01;if(!m&&O)return;l(),r+=(T-r)*fx,i+=(w-i)*fx,u.style.transform=`perspective(${mx}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(E-a)*px,o+=(D-o)*px;let k=i*dx,A=-r*dx,j=a+k,M=o+A;h.current.x=j,h.current.y=M,p.current?.setAttribute(`transform`,`translate(${j.toFixed(3)} ${M.toFixed(3)})`)}return document.addEventListener(`mousemove`,u,{passive:!0}),l(),()=>{document.removeEventListener(`mousemove`,u),s!==0&&cancelAnimationFrame(s),s=0,d.current&&(d.current.style.transform=``),h.current={x:0,y:0},p.current?.removeAttribute(`transform`)}},N=[c,T],t[11]=T,t[12]=c,t[13]=M,t[14]=N):(M=t[13],N=t[14]),(0,Q.useEffect)(M,N);let P;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>{let e=p.current;if(!e)return;let{x:t,y:n}=h.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[15]=P):P=t[15],(0,Q.useLayoutEffect)(P);let F=g>0,I=F?g:1,L=F?`ok-blob-clicked-${g}`:null,R;t[16]===r?R=t[17]:(R=ea(`ok-blob-3d-wrapper`,r),t[16]=r,t[17]=R);let z=T?`cursor-default`:`cursor-pointer`,B=`body-${v}`,V=T&&`ok-blob-sleeping`,H;t[18]!==L||t[19]!==V?(H=ea(`ok-blob-group`,V,L),t[18]=L,t[19]=V,t[20]=H):H=t[20];let U;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(`path`,{d:`M25.2339 6.78134C25.5199 7.35734 25.8179 8.47234 26.0179 9.07834C26.0189 9.08234 26.0209 9.08634 26.0219 9.09134C26.0229 9.09534 26.0249 9.10034 26.0259 9.10434C26.0539 9.19734 26.0949 9.29533 26.1519 9.41633C26.2919 9.71133 26.5269 10.1173 27.1299 11.1683C27.3259 11.4643 27.5209 11.7693 27.7119 12.0903C29.9739 15.1623 29.3259 20.1913 27.0469 22.9153C26.7779 23.2953 26.4869 23.6043 26.1889 23.8863C26.1519 23.9253 26.1129 23.9643 26.0729 24.0033C25.3159 24.7543 24.2949 25.4673 23.6129 25.8323C22.7469 26.2983 22.1349 26.5483 21.6299 26.7463C20.3649 27.3063 19.0609 27.7733 17.6569 28.0423C15.9649 28.3513 14.1939 28.4433 12.4569 28.1373C11.4779 27.9663 10.5119 27.6663 9.60891 27.2493C8.77491 26.8663 7.99192 26.3853 7.26992 25.8403C6.83592 25.5393 6.43893 25.2343 6.08093 24.9383C5.57893 24.5223 5.15993 24.1263 4.83493 23.7793C4.04993 22.9443 3.31593 21.8893 2.80893 21.0953C2.72593 20.9663 2.64792 20.8433 2.57592 20.7293C2.56192 20.7093 2.54793 20.6893 2.53393 20.6703C2.08593 20.0263 1.71892 19.3293 1.43792 18.5993C1.42892 18.5453 1.42093 18.4903 1.41293 18.4353C1.32093 17.7443 1.08292 16.9423 1.01092 15.6333C0.984921 15.0653 0.998928 14.4013 1.12393 13.6353C1.20693 13.1413 1.31993 12.9023 1.40893 12.7113C1.43593 12.6543 1.46193 12.6023 1.48593 12.5483C1.56793 12.3653 1.59392 12.1563 1.63592 11.9083C1.68992 11.5883 1.76992 11.1943 2.04592 10.7553C2.94392 9.37934 3.36792 8.81934 3.66592 8.33934C3.75592 8.20334 3.84292 8.08134 3.94192 7.96634C4.21592 7.64634 4.67693 7.29534 5.10293 7.05734C5.16693 7.02234 5.23093 6.98834 5.29193 6.95534C5.62993 6.77834 6.22592 6.30135 6.66992 5.92035C6.83692 5.77635 7.08193 5.60735 7.37393 5.40935C7.67393 5.20535 8.02593 4.96934 8.39193 4.70234C9.32093 4.02634 9.84091 3.69134 10.2599 3.42334C10.3799 3.34734 10.4919 3.27734 10.6049 3.20834C10.9609 2.98834 11.4149 2.73034 11.8869 2.48634C12.4519 2.19334 13.0469 1.92133 13.5089 1.72233C14.7399 1.30233 16.0539 1.01333 17.4169 1.00033C18.1169 0.991333 18.7939 1.16534 19.2389 1.43034C19.6869 1.69534 19.8689 2.00335 19.8039 2.23935C19.7379 2.47835 19.4399 2.63634 19.0109 2.74734C18.5789 2.85634 18.0469 2.92035 17.4889 2.96135C16.3639 3.04235 15.2399 3.36435 14.1499 3.80835C12.8199 4.35135 11.5379 5.07133 10.2719 5.84733C9.38691 6.39133 8.51192 6.97334 7.63592 7.56834C7.54492 7.63034 7.45492 7.69135 7.36492 7.75235C6.97392 8.06635 6.58293 8.38134 6.22293 8.66334C5.97893 8.85734 5.76793 9.04834 5.59393 9.21434C5.26893 9.52334 5.02393 9.74334 4.81893 9.93934C4.67793 10.0753 4.55793 10.2013 4.45593 10.3443C4.40093 10.4213 4.32992 10.5273 4.24792 10.6593C3.90492 11.1933 3.44493 12.1693 3.15393 13.1173C3.01893 13.5363 2.87991 14.0343 2.79391 14.5253C2.66591 15.2253 2.65594 15.9053 2.71994 16.2373C2.82794 16.8193 2.95593 17.4833 3.14093 18.0553C3.31293 18.6003 3.52991 19.0583 3.70791 19.2823C3.81591 19.4183 3.90394 19.5473 3.99594 19.6913C4.09394 19.8413 4.19191 20.0073 4.31091 20.2033C4.47891 20.4803 4.68592 20.8163 5.00192 21.2493C5.36492 21.7463 5.61793 22.1043 5.83493 22.4023C6.14493 22.8243 6.38591 23.1343 6.83691 23.5033C7.33891 23.9113 7.86593 24.3113 8.26693 24.6393C8.44893 24.7883 8.66993 24.9443 8.90493 25.0963C9.21593 25.2963 9.55192 25.4893 9.85592 25.6703C10.1059 25.8203 10.3059 25.9633 10.4869 26.0863C10.5429 26.1243 10.5979 26.1603 10.6519 26.1943C10.8699 26.2803 11.0929 26.3593 11.3159 26.4283C11.3539 26.4323 11.3949 26.4353 11.4369 26.4393C11.6509 26.4573 11.9089 26.4733 12.2209 26.5133C12.7169 26.5753 13.1399 26.6603 13.6019 26.7243C13.9589 26.7733 14.3409 26.8083 14.7729 26.7893C15.0729 26.7753 15.4069 26.7353 15.7389 26.6813C16.2349 26.6023 16.7179 26.4943 17.0569 26.4473C17.1499 26.4343 17.2359 26.4343 17.3209 26.4373C17.3489 26.4393 17.3799 26.4413 17.4109 26.4433C17.4119 26.4433 17.4119 26.4433 17.4129 26.4433C17.4199 26.4433 17.4279 26.4443 17.4349 26.4443C18.2329 26.2413 19.0259 25.9433 19.7959 25.5983C19.8609 25.5633 19.9259 25.5273 19.9899 25.4913C20.3059 25.3173 20.6049 25.1383 20.7869 24.9943C20.9829 24.8393 21.5189 24.5373 22.0579 24.1853C22.4109 23.9553 22.7649 23.7053 23.0369 23.4833C23.1949 23.3553 23.3689 23.2693 23.5479 23.1773C23.7129 23.0923 23.8809 23.0013 24.0349 22.8653C24.1109 22.7983 24.1869 22.7173 24.2639 22.6303C24.3309 22.5563 24.4039 22.4723 24.4759 22.3923C24.5459 22.3153 24.7199 22.1723 24.9139 21.9793C25.0079 21.8863 25.1059 21.7783 25.1909 21.6713C25.2199 21.6323 25.2489 21.5943 25.2769 21.5553C25.5919 21.0403 25.8779 20.5003 26.1019 19.9653C26.1299 19.8403 26.1379 19.7293 26.1279 19.6373C26.1199 19.5703 26.1029 19.5113 26.0839 19.4503C26.0599 19.3643 26.0329 19.2773 26.0239 19.1723C26.0169 19.0893 26.0309 19.0043 26.0629 18.9543C26.0779 18.9323 26.0969 18.9143 26.1129 18.8993C26.1329 18.8823 26.1499 18.8673 26.1569 18.8443C26.1609 18.8273 26.1579 18.8073 26.1529 18.7833C26.1459 18.7443 26.1369 18.6943 26.1539 18.6293C26.2189 18.3853 26.2869 18.1103 26.3319 17.8383C26.3829 17.5393 26.4049 17.2433 26.3949 17.0123C26.3849 16.7493 26.3909 16.3823 26.3469 16.0003C26.3179 15.7343 26.2659 15.4663 26.1979 15.2383C26.1319 15.0143 26.0219 14.7913 25.9039 14.5783C25.7629 14.3223 25.6119 14.0783 25.5169 13.8453C25.4969 13.7983 25.4999 13.7263 25.4999 13.6323C25.5009 13.5673 25.4999 13.4913 25.4919 13.4083C25.3239 13.1243 25.1459 12.8423 24.9589 12.5483C24.9479 12.5413 24.9369 12.5333 24.9249 12.5263C24.6689 12.3503 24.3139 12.1173 24.0769 11.5503C24.0179 11.4063 24.0069 11.2983 23.9969 11.1993C23.9859 11.1013 23.9799 11.0183 23.9289 10.9093C23.8709 10.7853 23.7759 10.6583 23.6709 10.4993C23.5849 10.3703 23.4899 10.2133 23.4199 10.0423C23.3819 9.95134 23.3509 9.85734 23.3329 9.75934C23.3299 9.74334 23.3269 9.72534 23.3229 9.70634C23.2899 9.52734 23.2439 9.26534 23.2409 8.98634C23.0209 8.24434 22.8339 7.48833 22.6519 6.77633C22.3429 5.57133 22.0519 4.54234 21.3329 3.95434C20.9839 3.65334 20.5689 3.35433 20.2459 3.05433C19.9259 2.75633 19.7449 2.47534 19.8019 2.23834C19.8639 2.00634 20.1589 1.82934 20.6659 1.80534C21.1699 1.78334 21.8699 1.93235 22.5209 2.39235C23.6159 3.14235 24.2029 4.38334 24.5599 5.35734C24.5829 5.40834 24.6049 5.46034 24.6259 5.51234C24.7849 5.89434 24.9529 6.22834 25.1199 6.55534C25.1579 6.63034 25.1969 6.70834 25.2339 6.78134Z`,className:`ok-blob-body`}),t[21]=U):U=t[21];let ee=(F||T)&&`ok-blob-eye-hidden`,te;t[22]===ee?te=t[23]:(te=ea(`ok-blob-eye`,ee),t[22]=ee,t[23]=te);let W;t[24]===te?W=t[25]:(W=(0,Z.jsx)(`ellipse`,{cx:hx,cy:_x,rx:1.2722,ry:1.9083,className:te}),t[24]=te,t[25]=W);let ne=(F||T)&&`ok-blob-eye-hidden`,re;t[26]===ne?re=t[27]:(re=ea(`ok-blob-eye ok-blob-eye-right`,ne),t[26]=ne,t[27]=re);let G;t[28]===re?G=t[29]:(G=(0,Z.jsx)(`ellipse`,{cx:gx,cy:_x,rx:1.2722,ry:1.9083,className:re}),t[28]=re,t[29]=G);let ie;t[30]===I?ie=t[31]:(ie=yx(hx,I),t[30]=I,t[31]=ie);let K=(!F||T)&&`ok-blob-eye-hidden`,q;t[32]===K?q=t[33]:(q=ea(`ok-blob-happy-eye`,K),t[32]=K,t[33]=q);let ae;t[34]!==ie||t[35]!==q?(ae=(0,Z.jsx)(`path`,{d:ie,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:q}),t[34]=ie,t[35]=q,t[36]=ae):ae=t[36];let oe;t[37]===I?oe=t[38]:(oe=yx(gx,I),t[37]=I,t[38]=oe);let se=(!F||T)&&`ok-blob-eye-hidden`,ce;t[39]===se?ce=t[40]:(ce=ea(`ok-blob-happy-eye`,se),t[39]=se,t[40]=ce);let le;t[41]!==oe||t[42]!==ce?(le=(0,Z.jsx)(`path`,{d:oe,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ce}),t[41]=oe,t[42]=ce,t[43]=le):le=t[43];let ue;t[44]===T?ue=t[45]:(ue=T?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`path`,{d:bx(hx),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,Z.jsx)(`path`,{d:bx(gx),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[44]=T,t[45]=ue);let de;t[46]!==W||t[47]!==G||t[48]!==ae||t[49]!==le||t[50]!==ue?(de=(0,Z.jsxs)(`g`,{ref:p,children:[W,G,ae,le,ue]}),t[46]=W,t[47]=G,t[48]=ae,t[49]=le,t[50]=ue,t[51]=de):de=t[51];let fe;t[52]!==B||t[53]!==H||t[54]!==de?(fe=(0,Z.jsxs)(`g`,{className:H,children:[U,de]},B),t[52]=B,t[53]=H,t[54]=de,t[55]=fe):fe=t[55];let pe;t[56]===T?pe=t[57]:(pe=T?(0,Z.jsxs)(`g`,{children:[(0,Z.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,Z.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[56]=T,t[57]=pe);let me;t[58]!==v||t[59]!==x?(me=x.length>0&&(0,Z.jsx)(`g`,{children:x.map(Tx)},`firework-${v}`),t[58]=v,t[59]=x,t[60]=me):me=t[60];let he;t[61]!==D||t[62]!==s||t[63]!==z||t[64]!==fe||t[65]!==pe||t[66]!==me?(he=(0,Z.jsxs)(`svg`,{ref:f,width:s,height:s,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:z,"aria-hidden":`true`,onClick:D,onMouseDown:Ex,children:[fe,pe,me]}),t[61]=D,t[62]=s,t[63]=z,t[64]=fe,t[65]=pe,t[66]=me,t[67]=he):he=t[67];let ge;return t[68]!==R||t[69]!==he?(ge=(0,Z.jsx)(`span`,{ref:d,className:R,children:he}),t[68]=R,t[69]=he,t[70]=ge):ge=t[70],ge}function Tx(e){return(0,Z.jsx)(`circle`,{cx:xx+e.originDx,cy:Sx+e.originDy,r:e.size,className:`ok-blob-firework`,style:Cx(e)},e.id)}function Ex(e){return e.preventDefault()}function Dx(e){return e+1}function Ox(e){return e+1}function kx(e){let t=(0,$.c)(12),{title:n,subtitle:r,celebrateSignal:i}=e,a;t[0]===i?a=t[1]:(a=(0,Z.jsx)(wx,{size:64,celebrateSignal:i}),t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,Z.jsx)(`h2`,{className:`text-2xl font-light tracking-tighter text-balance`,children:n}),t[2]=n,t[3]=o);let s;t[4]===r?s=t[5]:(s=r?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r}):null,t[4]=r,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex items-center gap-4`,children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function Ax(){let e=(0,$.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=Us(`command-palette`),e[0]=t):t=e[0];let n=t,r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(D,{children:n}),e[1]=r):r=e[1];let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`p`,{className:`text-1sm text-muted-foreground`,children:[r,` `,(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`A1taO8`})})]}),e[2]=i):i=e[2],i}var jx=`open-knowledge:create-top-level-file`;function Mx(e={}){window.dispatchEvent(new CustomEvent(jx,{detail:e}))}function Nx(e){let t=t=>{let n=t.detail;e(n??{})};return window.addEventListener(jx,t),()=>window.removeEventListener(jx,t)}function Px(e){let t=(0,$.c)(33),{celebrateSignal:n,onAddStarterPack:r}=e,{_:a}=i(),o=bh(),c=ss(),l;t[0]!==c.data||t[1]!==c.status?(l=c.status===`ready`?c.data:[],t[0]=c.data,t[1]=c.status,t[2]=l):l=t[2];let u=l,d=c.status===`loading`||c.status===`idle`,f=c.status===`error`,p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=Us(`new-item`),t[3]=p):p=t[3];let m=p,h;t[4]===a?h=t[5]:(h=a({id:`FOGD7m`}),t[4]=a,t[5]=h);let g;t[6]===a?g=t[7]:(g=a({id:`LMbgDK`}),t[6]=a,t[7]=g);let _;t[8]!==n||t[9]!==h||t[10]!==g?(_=(0,Z.jsx)(kx,{title:h,subtitle:g,celebrateSignal:n}),t[8]=n,t[9]=h,t[10]=g,t[11]=_):_=t[11];let v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(Lx,{shortcutLabel:m,onClick:Ix}),t[12]=v):v=t[12];let y;t[13]!==u||t[14]!==f||t[15]!==d?(y=d||f||u.length>0?(0,Z.jsx)(Rx,{templates:u,loading:d,error:f,onSelect:Fx}):null,t[13]=u,t[14]=f,t[15]=d,t[16]=y):y=t[16];let b;t[17]===o?b=t[18]:(b=o?null:(0,Z.jsx)(Bx,{}),t[17]=o,t[18]=b);let x,S;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(At,{"aria-hidden":`true`,className:`size-3`}),x=(0,Z.jsx)(s,{id:`IajAbS`}),t[19]=x,t[20]=S):(x=t[19],S=t[20]);let C;t[21]===r?C=t[22]:(C=(0,Z.jsxs)(sa,{onClick:r,variant:`link`,size:`xs`,className:`font-mono text-xs uppercase tracking-wider text-muted-foreground font-normal hover:text-foreground hover:no-underline`,children:[S,x]}),t[21]=r,t[22]=C);let w;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(Ax,{}),t[23]=w):w=t[23];let T;t[24]===C?T=t[25]:(T=(0,Z.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-4`,children:[C,w]}),t[24]=C,t[25]=T);let E;t[26]!==T||t[27]!==y||t[28]!==b?(E=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-8`,children:[v,y,b,T]}),t[26]=T,t[27]=y,t[28]=b,t[29]=E):E=t[29];let D;return t[30]!==E||t[31]!==_?(D=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-10 py-12 max-w-5xl my-auto`,children:[_,E]}),t[30]=E,t[31]=_,t[32]=D):D=t[32],D}function Fx(e,t){return Mx({template:{folder:e,name:t}})}function Ix(){return Mx({initialDir:``})}function Lx(e){let t=(0,$.c)(7),{shortcutLabel:n,onClick:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(cl,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[i,(0,Z.jsx)(`span`,{className:`text-sm font-medium leading-tight text-foreground`,children:(0,Z.jsx)(s,{id:`HdkSiO`})})]}),t[1]=a):a=t[1];let o;t[2]===n?o=t[3]:(o=(0,Z.jsx)(D,{children:n}),t[2]=n,t[3]=o);let c;return t[4]!==r||t[5]!==o?(c=(0,Z.jsxs)(sa,{type:`button`,variant:`ghost`,onClick:r,className:`group flex h-auto w-full items-center justify-between gap-4 rounded-xl border border-border/60 bg-card p-4 text-left transition-colors hover:bg-muted/50 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,children:[a,o]}),t[4]=r,t[5]=o,t[6]=c):c=t[6],c}function Rx(e){let t=(0,$.c)(25),{templates:n,loading:r,error:a,onSelect:o}=e,{_:c}=i(),l;t[0]===c?l=t[1]:(l=c({id:`_8quCH`}),t[0]=c,t[1]=l);let u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`_8quCH`})}),t[2]=u):u=t[2];let d;t[3]!==c||t[4]!==a||t[5]!==r||t[6]!==n?(d=r||a?null:(0,Z.jsx)(P,{className:`text-2xs`,variant:`gray`,"aria-label":c({id:`X7u0xR`,values:{0:n.length}}),children:n.length}),t[3]=c,t[4]=a,t[5]=r,t[6]=n,t[7]=d):d=t[7];let f;t[8]===d?f=t[9]:(f=(0,Z.jsxs)(`header`,{className:`flex items-center gap-2 font-mono text-2xs uppercase tracking-wider text-muted-foreground`,children:[u,d]}),t[8]=d,t[9]=f);let p;t[10]===c?p=t[11]:(p=c({id:`irFGwu`}),t[10]=c,t[11]=p);let m;t[12]!==a||t[13]!==r||t[14]!==o||t[15]!==n?(m=r?(0,Z.jsx)(`p`,{className:`p-4 text-1sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`Hl89Qd`})}):a?(0,Z.jsx)(`p`,{role:`alert`,className:`p-4 text-1sm text-destructive`,children:(0,Z.jsx)(s,{id:`54Y6Fg`})}):n.map(e=>(0,Z.jsx)(zx,{template:e,targetLabel:e.source_folder===``?`/`:`${e.source_folder}/`,onClick:()=>o(e.source_folder,e.name)},`${e.source_folder}/${e.name}`)),t[12]=a,t[13]=r,t[14]=o,t[15]=n,t[16]=m):m=t[16];let h;t[17]!==r||t[18]!==p||t[19]!==m?(h=(0,Z.jsx)(`div`,{className:`w-full overflow-hidden rounded-xl border border-border/60 bg-card`,children:(0,Z.jsx)(`section`,{"aria-busy":r,"aria-label":p,tabIndex:0,className:`subtle-scrollbar scroll-fade-mask flex max-h-[260px] w-full flex-col overflow-y-auto overscroll-contain focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:m})}),t[17]=r,t[18]=p,t[19]=m,t[20]=h):h=t[20];let g;return t[21]!==l||t[22]!==f||t[23]!==h?(g=(0,Z.jsxs)(`section`,{"aria-label":l,className:`flex w-full flex-col gap-3`,children:[f,h]}),t[21]=l,t[22]=f,t[23]=h,t[24]=g):g=t[24],g}function zx(e){let t=(0,$.c)(24),{template:n,targetLabel:r,onClick:a}=e,{_:o}=i(),s;t[0]!==n.name||t[1]!==n.title?(s=n.title?.trim()||n.name,t[0]=n.name,t[1]=n.title,t[2]=s):s=t[2];let c=s,l=`${n.name}.md`,u=n.source_folder===``,d;t[3]!==o||t[4]!==c||t[5]!==l||t[6]!==u||t[7]!==r?(d=o(u?{id:`89TtiD`,values:{displayTitle:c,fileName:l}}:{id:`0_J12R`,values:{displayTitle:c,fileName:l,targetLabel:r}}),t[3]=o,t[4]=c,t[5]=l,t[6]=u,t[7]=r,t[8]=d):d=t[8];let f=d,p;t[9]===c?p=t[10]:(p=(0,Z.jsx)(`span`,{className:`truncate text-sm font-medium leading-tight text-foreground/80`,children:c}),t[9]=c,t[10]=p);let m;t[11]===l?m=t[12]:(m=(0,Z.jsx)(`span`,{className:`truncate font-mono text-1sm font-normal text-muted-foreground`,children:l}),t[11]=l,t[12]=m);let h;t[13]!==p||t[14]!==m?(h=(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[p,m]}),t[13]=p,t[14]=m,t[15]=h):h=t[15];let g=`shrink-0 font-mono text-1sm ${u?`text-muted-foreground/70`:`text-muted-foreground`}`,_;t[16]!==g||t[17]!==r?(_=(0,Z.jsx)(`span`,{className:g,children:r}),t[16]=g,t[17]=r,t[18]=_):_=t[18];let v;return t[19]!==f||t[20]!==a||t[21]!==h||t[22]!==_?(v=(0,Z.jsxs)(sa,{type:`button`,variant:`ghost`,onClick:a,"aria-label":f,className:`group flex h-auto w-full items-center justify-between gap-4 rounded-none p-4 text-left transition-colors hover:bg-muted/50 focus-visible:bg-muted/50`,children:[h,_]}),t[19]=f,t[20]=a,t[21]=h,t[22]=_,t[23]=v):v=t[23],v}function Bx(){let e=(0,$.c)(6),{_:t}=i(),n;e[0]===t?n=e[1]:(n=t({id:`27ANM6`}),e[0]=t,e[1]=n);let r,a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(`header`,{className:`font-mono text-2xs uppercase tracking-wider text-muted-foreground`,children:(0,Z.jsx)(s,{id:`27ANM6`})}),a=(0,Z.jsx)($b,{}),e[2]=r,e[3]=a):(r=e[2],a=e[3]);let o;return e[4]===n?o=e[5]:(o=(0,Z.jsxs)(`section`,{"aria-label":n,className:`flex w-full flex-col gap-3`,children:[r,a]}),e[4]=n,e[5]=o),o}function Vx(){let e=(0,$.c)(14),[t,n]=(0,Q.useState)(!1),[r,i]=(0,Q.useState)(void 0),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(0),l=(0,Q.useRef)(!1),u=(0,Q.useRef)(void 0),d,f;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{let e=!1,t=async function(){try{let t=await fetch(`/api/documents`),n=await t.json().catch(Gx);if(e)return;let r=t.ok?fi.safeParse(n):null;r?.success?(o(Kx(r.data.documents)),l.current=!0):l.current||=(o(1),!0)}catch{!e&&!l.current&&(o(1),l.current=!0)}};t();let n=Kr(e=>{e.includes(`files`)&&t()});return()=>{e=!0,n(),clearTimeout(u.current)}},f=[],e[0]=d,e[1]=f):(d=e[0],f=e[1]),(0,Q.useEffect)(d,f);let p;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=function(){clearTimeout(u.current),u.current=setTimeout(()=>c(Wx),500),fetch(`/api/documents`).then(async e=>{let t=await e.json().catch(Ux);if(!e.ok)return;let n=fi.safeParse(t);n.success&&o(Kx(n.data.documents))}).catch(Hx)},e[2]=p):p=e[2];let m=p,h=a!==null,g=a===0,_;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=function(e){n(e),e||i(void 0)},e[3]=_):_=e[3];let v=_,y;e[4]!==s||e[5]!==g||e[6]!==h?(y=h?g?(0,Z.jsx)(qx,{celebrateSignal:s,onPackSelect:e=>{i(e),n(!0)}}):(0,Z.jsx)(Px,{celebrateSignal:s,onAddStarterPack:()=>{n(!0)}}):null,e[4]=s,e[5]=g,e[6]=h,e[7]=y):y=e[7];let b;e[8]!==r||e[9]!==t?(b=(0,Z.jsx)(hh,{open:t,onOpenChange:v,onSeedApplied:m,initialPackId:r}),e[8]=r,e[9]=t,e[10]=b):b=e[10];let x;return e[11]!==y||e[12]!==b?(x=(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center overflow-y-auto px-6 sm:px-12 md:px-16 subtle-scrollbar`,children:[y,b]}),e[11]=y,e[12]=b,e[13]=x):x=e[13],x}function Hx(){}function Ux(){return null}function Wx(e){return e+1}function Gx(){return null}function Kx(e){return Mr(e).filter(e=>e.kind===`document`||e.kind===`folder`).length}function qx(e){let t=(0,$.c)(16),{celebrateSignal:n,onPackSelect:r}=e,{_:a}=i(),o;t[0]===a?o=t[1]:(o=a({id:`ZmGmNh`}),t[0]=a,t[1]=o);let c;t[2]===a?c=t[3]:(c=a({id:`W8uemY`}),t[2]=a,t[3]=c);let l;t[4]!==n||t[5]!==o||t[6]!==c?(l=(0,Z.jsx)(kx,{title:o,subtitle:c,celebrateSignal:n}),t[4]=n,t[5]=o,t[6]=c,t[7]=l):l=t[7];let u;t[8]===r?u=t[9]:(u=(0,Z.jsx)(ch,{onPackSelect:r}),t[8]=r,t[9]=u);let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(sa,{variant:`link`,className:`text-muted-foreground font-normal justify-end`,size:`sm`,onClick:Jx,children:(0,Z.jsx)(s,{id:`ensWZc`,components:{0:(0,Z.jsx)(Qo,{"aria-hidden":`true`,className:`size-3`})}})}),t[10]=d):d=t[10];let f;t[11]===u?f=t[12]:(f=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-3`,children:[u,d]}),t[11]=u,t[12]=f);let p;return t[13]!==l||t[14]!==f?(p=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-10 py-12 max-w-5xl my-auto`,children:[l,f]}),t[13]=l,t[14]=f,t[15]=p):p=t[15],p}function Jx(){return Mx()}function Yx(e){return e===``?`.ok/frontmatter.yml`:`${e}/.ok/frontmatter.yml`}function Xx(e){let t=(0,$.c)(70),{folderPath:n,state:r,onChange:a}=e,{_:o}=i(),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)(null);if(r.status===`idle`||r.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card p-4 space-y-3`,children:[(0,Z.jsx)(Qx,{}),(0,Z.jsx)(Pa,{className:`h-7 w-full`}),(0,Z.jsx)(Pa,{className:`h-7 w-full`}),(0,Z.jsx)(Pa,{className:`h-7 w-full`})]}),t[0]=e):e=t[0],e}if(r.status===`error`){let{message:e}=r,n;return t[1]===e?n=t[2]:(n=(0,Z.jsx)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:(0,Z.jsx)(s,{id:`lzmtKp`,values:{message:e}})}),t[1]=e,t[2]=n),n}let m;t[3]===r.data.frontmatterLocal?m=t[4]:(m=r.data.frontmatterLocal??{},t[3]=r.data.frontmatterLocal,t[4]=m);let h=m,g;t[5]===r.data.folder.path?g=t[6]:(g=Yx(r.data.folder.path),t[5]=r.data.folder.path,t[6]=g);let _=g,v;t[7]===h?v=t[8]:(v=Object.keys(h),t[7]=h,t[8]=v);let y=v,b;t[9]!==o||t[10]!==n||t[11]!==a?(b=async function(e,t){let r=await Ya(n,{[e]:t});if(!r.ok){let{error:e}=r;X.error(o({id:`xXo8FT`,values:{error:e}}));return}a()},t[9]=o,t[10]=n,t[11]=a,t[12]=b):b=t[12];let x=b,S;t[13]!==o||t[14]!==n||t[15]!==a?(S=async function(e){let t=await Ya(n,{[e]:null});if(!t.ok){let{error:e}=t;X.error(o({id:`ZU8VV_`,values:{error:e}}));return}a()},t[13]=o,t[14]=n,t[15]=a,t[16]=S):S=t[16];let C=S,w;t[17]!==x||t[18]!==h?(w=function(e,t){let n=h[e];x(e,qa(n,t))},t[17]=x,t[18]=h,t[19]=w):w=t[19];let T=w,E;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(E=function(){d({name:``,type:`text`,value:``,error:null}),l(!1)},t[20]=E):E=t[20];let D=E,O;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(O=function(e){d(t=>{if(!t)return t;let n=e===`date`?new Date().toISOString().slice(0,10):Va[e];return{...t,type:e,value:n,error:null}})},t[21]=O):O=t[21];let k=O,A;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(e){d(t=>t&&{...t,value:e})},t[22]=A):A=t[22];let j=A,M;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(M=function(e){d(t=>t&&{...t,name:e,error:null})},t[23]=M):M=t[23];let N=M,P;t[24]!==o||t[25]!==u||t[26]!==n||t[27]!==a||t[28]!==h?(P=async function(){if(!u)return;let e=u.name.trim();if(!e){d({...u,error:o({id:`8_brI5`})});return}if(Un(u.value)){d({...u,error:o({id:`hXUWyd`})});return}if(Object.hasOwn(h,e)){d({...u,error:o({id:`CTJLpz`,values:{trimmed:e}})});return}let t=await Ya(n,{[e]:u.value});if(!t.ok){d({...u,error:t.error});return}d(null),a()},t[24]=o,t[25]=u,t[26]=n,t[27]=a,t[28]=h,t[29]=P):P=t[29];let F=P,I;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(I=function(e){p({key:e,draft:e,error:null})},t[30]=I):I=t[30];let L=I,R;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(R=function(e){p(t=>t&&{...t,draft:e,error:null})},t[31]=R):R=t[31];let z=R,B;t[32]!==o||t[33]!==n||t[34]!==a||t[35]!==h||t[36]!==f?(B=async function(){if(!f)return;let e=f.draft.trim();if(!e){p({...f,error:o({id:`8_brI5`})});return}if(e===f.key){p(null);return}if(Object.hasOwn(h,e)){p({...f,error:o({id:`CTJLpz`,values:{trimmed:e}})});return}let t=h[f.key],r=await Ya(n,{[f.key]:null,[e]:t});if(!r.ok){p({...f,error:r.error});return}p(null),a()},t[32]=o,t[33]=n,t[34]=a,t[35]=h,t[36]=f,t[37]=B):B=t[37];let V=B,H;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(H=function(){p(null)},t[38]=H):H=t[38];let U=H,ee=!c,te;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(te=e=>l(!e),t[39]=te):te=t[39];let W=`size-3 transition-transform ${c?``:`rotate-90`}`,ne;t[40]===W?ne=t[41]:(ne=(0,Z.jsx)(Os,{className:W,"aria-hidden":!0}),t[40]=W,t[41]=ne);let re;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`vQIVHc`})}),t[42]=re):re=t[42];let G;t[43]===ne?G=t[44]:(G=(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:[ne,re]}),t[43]=ne,t[44]=G);let ie;t[45]===_?ie=t[46]:(ie=(0,Z.jsx)(`code`,{className:`text-xs text-muted-foreground font-mono cursor-text select-text`,onClick:Zx,children:_}),t[45]=_,t[46]=ie);let K;t[47]!==G||t[48]!==ie?(K=(0,Z.jsxs)(js,{className:`flex w-full cursor-pointer items-center justify-between gap-2 px-3 py-2.5 data-[state=open]:border-b border-border`,children:[G,ie]}),t[47]=G,t[48]=ie,t[49]=K):K=t[49];let q;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,Z.jsx)(`p`,{className:`px-1 pb-2 text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`hSBIG-`})}),t[50]=q):q=t[50];let ae;t[51]!==u||t[52]!==x||t[53]!==V||t[54]!==y||t[55]!==h||t[56]!==C||t[57]!==f||t[58]!==T?(ae=y.length===0&&!u?(0,Z.jsx)(`p`,{className:`px-1 py-1 text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`4c_a6S`})}):y.map(e=>{let t=h[e];return(0,Z.jsx)(to,{keyName:e,value:t,declared:ao(t,$n(t)),rename:{state:f?.key===e?f:null,onBegin:()=>L(e),onChangeDraft:z,onCommit:V,onCancel:U},badge:null,onCommit:t=>void x(e,t),onChangeType:t=>T(e,t),onRemove:()=>void C(e)},e)}),t[51]=u,t[52]=x,t[53]=V,t[54]=y,t[55]=h,t[56]=C,t[57]=f,t[58]=T,t[59]=ae):ae=t[59];let oe;t[60]!==u||t[61]!==F?(oe=u?(0,Z.jsx)(Za,{draft:u,onChangeName:N,onChangeType:k,onChangeValue:j,onCommit:()=>void F(),onCancel:()=>d(null)}):(0,Z.jsx)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1`,children:(0,Z.jsxs)(sa,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`add-property-trigger`,onClick:()=>D(),className:`flex items-center gap-1.5 rounded px-2 py-1 font-medium text-sm hover:bg-muted/50 hover:text-foreground`,children:[(0,Z.jsx)(At,{className:`size-3.5`}),(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`G8t9NN`})})]})}),t[60]=u,t[61]=F,t[62]=oe):oe=t[62];let se;t[63]!==ae||t[64]!==oe?(se=(0,Z.jsx)(As,{children:(0,Z.jsxs)(`div`,{className:`px-2 py-2`,children:[q,ae,oe]})}),t[63]=ae,t[64]=oe,t[65]=se):se=t[65];let ce;return t[66]!==ee||t[67]!==K||t[68]!==se?(ce=(0,Z.jsx)(`section`,{className:`rounded-lg border bg-card`,children:(0,Z.jsxs)(Ms,{open:ee,onOpenChange:te,children:[K,se]})}),t[66]=ee,t[67]=K,t[68]=se,t[69]=ce):ce=t[69],ce}function Zx(e){return e.stopPropagation()}function Qx(){let e=(0,$.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(dl,{className:`size-4 text-muted-foreground`,"aria-hidden":!0}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t,(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(s,{id:`vQIVHc`})})]}),e[1]=n):n=e[1],n}function $x(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);return t<60?Y._({id:`xOTzt5`}):t<3600?Y._({id:`zbymaY`,values:{0:Math.floor(t/60)}}):t<86400?Y._({id:`optX0N`,values:{0:Math.floor(t/3600)}}):t<86400*7?Y._({id:`l1l8sj`,values:{0:Math.floor(t/86400)}}):new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function eS(e){return(e.split(`/`).pop()??e).replace(/\.md$/,``)}function tS(e){let t=e.message,n=t.indexOf(`: `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+2);switch(r){case`template-create`:return{Icon:Ao,label:Y._({id:`QR5SP1`}),detail:eS(i)};case`template-edit`:return{Icon:I,label:Y._({id:`-LHLx7`}),detail:eS(i)};case`template-delete`:return{Icon:g,label:Y._({id:`_gkGSK`}),detail:eS(i)};case`template-rename`:case`template-move`:{let[e,t]=i.split(` -> `);return{Icon:Hc,label:Y._({id:`KPW5WC`}),detail:`${eS(e??``)} → ${eS(t??i)}`}}case`folder-frontmatter-edit`:return{Icon:dl,label:Y._({id:`_tekeB`}),detail:``};case`folder-frontmatter-delete`:return{Icon:dl,label:Y._({id:`ZWxfrc`}),detail:``};case`folder-create`:return{Icon:dl,label:Y._({id:`ZQLDTl`}),detail:``};default:return{Icon:_l,label:r.replace(/-/g,` `),detail:eS(i)}}}function nS(e){return e.contributors.length>0?e.contributors[0].name:e.author===`openknowledge-service`||e.author===`server`?Y._({id:`B2DrPb`}):e.author||Y._({id:`Ef7StM`})}function rS(e){let t=(0,$.c)(15),{folderPath:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),[o,c]=(0,Q.useState)(!0),[l,u]=(0,Q.useState)(!1),d,f;if(t[1]===n?(d=t[2],f=t[3]):(d=()=>{let e=!1,t=async function(){try{let t=await fetch(`/api/history?folder=${encodeURIComponent(n)}&limit=50`);if(e)return;if(!t.ok){u(!0),c(!1);return}let r=await t.json();if(e)return;a(r.entries??[]),u(!1),c(!1)}catch(t){e||(console.warn(`[FolderTimelineCard] failed to load folder timeline:`,t),u(!0),c(!1))}};c(!0),t();let r=Wi(t);return()=>{e=!0,r()}},f=[n],t[1]=n,t[2]=d,t[3]=f),(0,Q.useEffect)(d,f),l||!o&&i.length===0)return null;let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(s,{id:`XJOV1Y`})}),t[4]=p):p=t[4];let m;t[5]===i.length?m=t[6]:(m=i.length>0?(0,Z.jsx)(P,{className:`text-xs`,variant:`secondary`,children:i.length}):null,t[5]=i.length,t[6]=m);let h;t[7]===m?h=t[8]:(h=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-1`,children:[p,m]}),t[7]=m,t[8]=h);let g;t[9]!==i||t[10]!==o?(g=(0,Z.jsx)(`div`,{className:`px-3 py-2.5`,children:o?(0,Z.jsxs)(`div`,{className:`space-y-2`,role:`status`,"aria-busy":`true`,children:[(0,Z.jsx)(Pa,{className:`h-8 w-full`}),(0,Z.jsx)(Pa,{className:`h-8 w-full`})]}):(0,Z.jsx)(`ul`,{className:`space-y-1`,children:i.map(iS)})}),t[9]=i,t[10]=o,t[11]=g):g=t[11];let _;return t[12]!==h||t[13]!==g?(_=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card`,"data-testid":`folder-timeline-card`,children:[h,g]}),t[12]=h,t[13]=g,t[14]=_):_=t[14],_}function iS(e){let{Icon:t,label:n,detail:r}=tS(e);return(0,Z.jsxs)(`li`,{className:`flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm`,children:[(0,Z.jsx)(t,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,Z.jsx)(`span`,{className:`text-foreground`,children:n}),r?(0,Z.jsx)(`code`,{className:`ml-1.5 font-mono text-xs text-muted-foreground`,children:r}):null]}),(0,Z.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,children:[(0,Z.jsx)(tu,{className:`size-3`,"aria-hidden":!0}),nS(e)]}),(0,Z.jsx)(`time`,{className:`shrink-0 text-xs text-muted-foreground/80`,dateTime:e.timestamp,title:new Date(e.timestamp).toLocaleString(),children:$x(e.timestamp)})]},e.sha)}function aS(e){let t=e.split(`/`).pop();return t?`${e}/${t}`:null}function oS(e,t){let n=t.get(`${e}/index`);if(n)return n;let r=aS(e);if(r){let e=t.get(r);if(e)return e}return e.split(`/`).pop()??e}function sS(e,t,n){let r=n.get(e);return r&&r!==e?r:t}function cS(e,t){let n=e===``?``:`${e}/`,r=[...t.folderPaths].filter(e=>e.startsWith(n)).map(e=>({path:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({path:e,rel:n})=>({kind:`folder`,path:e,name:n,title:oS(e,t.pageTitles)})),i=[...t.pages].filter(e=>e.startsWith(n)).map(e=>({docName:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({docName:e,rel:n})=>{let r=t.pageMeta.get(e);return{kind:`file`,path:e,name:n,title:sS(e,n,t.pageTitles),size:r?.size??0,modified:r?.modified??``}}),a=[...r,...i].sort((e,t)=>e.kind===t.kind?e.title.localeCompare(t.title)||e.name.localeCompare(t.name):e.kind===`folder`?-1:1);return{title:oS(e,t.pageTitles),children:a}}function lS(e){let t=(0,$.c)(44),{folderPath:n,state:r,onChange:i,folderConfigHandle:a}=e,[o,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(null),[d,f]=(0,Q.useState)(null),[p,m]=(0,Q.useState)(!1);if(r.status===`idle`||r.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card px-3 py-2.5 space-y-3`,children:[(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(s,{id:`-QCLWk`})})}),(0,Z.jsx)(Pa,{className:`h-12 w-full`}),(0,Z.jsx)(Pa,{className:`h-12 w-full`})]}),t[0]=e):e=t[0],e}if(r.status===`error`){let{message:e}=r,n;return t[1]===e?n=t[2]:(n=(0,Z.jsx)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:(0,Z.jsx)(s,{id:`iDZtvM`,values:{message:e}})}),t[1]=e,t[2]=n),n}let h;t[3]===r.data.folder.templates_available?h=t[4]:(h=r.data.folder.templates_available??[],t[3]=r.data.folder.templates_available,t[4]=h);let g=h,_;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(s,{id:`-QCLWk`})}),t[5]=_):_=t[5];let v;t[6]===g.length?v=t[7]:(v=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,(0,Z.jsx)(P,{className:`text-xs`,variant:`secondary`,children:g.length})]}),t[6]=g.length,t[7]=v);let y;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsxs)(sa,{variant:`ghost`,className:`font-mono uppercase`,size:`sm`,onClick:()=>m(!0),children:[(0,Z.jsx)(At,{className:`size-3.5`,"aria-hidden":!0}),(0,Z.jsx)(s,{id:`G1Gw0v`})]}),t[8]=y):y=t[8];let b;t[9]===v?b=t[10]:(b=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-1`,children:[v,y]}),t[9]=v,t[10]=b);let x;t[11]===g?x=t[12]:(x=(0,Z.jsx)(`div`,{className:`px-3 py-2.5`,children:g.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`MZSBsh`})}):(0,Z.jsx)(`ul`,{className:`space-y-1`,children:g.map(e=>(0,Z.jsx)(ja,{template:e,onCreate:()=>f(e.name),onEdit:()=>c(e),onDelete:()=>u(e),badge:e.scope===`inherited`?(0,Z.jsx)(Fa,{source:e.source_folder,target:`templates/${e.name}.md`}):void 0},e.path))})}),t[11]=g,t[12]=x);let S;t[13]!==b||t[14]!==x?(S=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card`,children:[b,x]}),t[13]=b,t[14]=x,t[15]=S):S=t[15];let C;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>{e||c(null)},t[16]=C):C=t[16];let w;t[17]!==o||t[18]!==n||t[19]!==i?(w=(0,Z.jsx)($a,{folderPath:n,template:o,onOpenChange:C,onSaved:i}),t[17]=o,t[18]=n,t[19]=i,t[20]=w):w=t[20];let T;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{e||u(null)},t[21]=T):T=t[21];let E;t[22]!==l||t[23]!==i?(E=(0,Z.jsx)(Ro,{template:l,onOpenChange:T,onDeleted:i}),t[22]=l,t[23]=i,t[24]=E):E=t[24];let D;t[25]===g?D=t[26]:(D=new Set(g.map(uS)),t[25]=g,t[26]=D);let O;t[27]!==n||t[28]!==p||t[29]!==i||t[30]!==D?(O=(0,Z.jsx)(Io,{folderPath:n,existingNames:D,open:p,onOpenChange:m,onCreated:i}),t[27]=n,t[28]=p,t[29]=i,t[30]=D,t[31]=O):O=t[31];let k=d!==null,A;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(A=e=>{e||f(null)},t[32]=A):A=t[32];let j=d??void 0,M;t[33]!==a||t[34]!==n||t[35]!==k||t[36]!==j?(M=(0,Z.jsx)(Gm,{open:k,onOpenChange:A,kind:`file`,initialDir:n,initialTemplate:j,folderConfig:a}),t[33]=a,t[34]=n,t[35]=k,t[36]=j,t[37]=M):M=t[37];let N;return t[38]!==E||t[39]!==O||t[40]!==M||t[41]!==S||t[42]!==w?(N=(0,Z.jsxs)(Z.Fragment,{children:[S,w,E,O,M]}),t[38]=E,t[39]=O,t[40]=M,t[41]=S,t[42]=w,t[43]=N):N=t[43],N}function uS(e){return e.name}function dS(e){let t=(0,$.c)(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,containerClassName:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=ea(`relative w-full overflow-x-auto subtle-scrollbar`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=ea(`w-full caption-bottom text-sm`,n),t[6]=n,t[7]=o);let s;t[8]!==i||t[9]!==o?(s=(0,Z.jsx)(`table`,{"data-slot":`table`,className:o,...i}),t[8]=i,t[9]=o,t[10]=s):s=t[10];let c;return t[11]!==a||t[12]!==s?(c=(0,Z.jsx)(`div`,{"data-slot":`table-container`,className:a,children:s}),t[11]=a,t[12]=s,t[13]=c):c=t[13],c}function fS(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`[&_tr]:border-b`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`thead`,{"data-slot":`table-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function pS(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`[&_tr:last-child]:border-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`tbody`,{"data-slot":`table-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function mS(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,noHover:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=(i===void 0?!1:i)&&`hover:bg-transparent`,o;t[4]!==n||t[5]!==a?(o=ea(`hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors`,a,n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o?(s=(0,Z.jsx)(`tr`,{"data-slot":`table-row`,className:o,...r}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function hS(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,scope:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`col`:i,o;t[4]===n?o=t[5]:(o=ea(`font-mono uppercase text-xs text-muted-foreground h-10 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(`th`,{"data-slot":`table-head`,scope:a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function gS(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`py-3 px-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`td`,{"data-slot":`table-cell`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function _S(e){if(!e)return`—`;let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return Y._({id:`xOTzt5`});if(r<60)return Y._({id:`NRSLBe`,values:{diffMin:r}});let i=Math.floor(r/60);if(i<24)return Y._({id:`hDKtoF`,values:{diffHrs:i}});let a=Math.floor(i/24);return a<30?Y._({id:`QDZbvN`,values:{diffDays:a}}):t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function vS(e,t,n){return[...e].sort((e,r)=>{if(e.kind!==r.kind)return e.kind===`folder`?-1:1;let i=0;switch(t){case`name`:i=e.title.localeCompare(r.title)||e.name.localeCompare(r.name);break;case`modified`:{let t=e.kind===`file`?e.modified:``,n=r.kind===`file`?r.modified:``;i=t.localeCompare(n);break}}return n===`asc`?i:-i})}function yS(e){let t=(0,$.c)(10),{label:n,sortKey:r,activeKey:i,activeDir:a,onSort:o}=e,s=i===r,c;t[0]!==o||t[1]!==r?(c=()=>o(r),t[0]=o,t[1]=r,t[2]=c):c=t[2];let l;t[3]!==a||t[4]!==s?(l=s?a===`asc`?(0,Z.jsx)(fe,{className:`ml-1 size-3`}):(0,Z.jsx)(S,{className:`ml-1 size-3`}):(0,Z.jsx)(Uc,{className:`ml-1 size-3 text-muted-foreground/50`}),t[3]=a,t[4]=s,t[5]=l):l=t[5];let u;return t[6]!==n||t[7]!==c||t[8]!==l?(u=(0,Z.jsxs)(sa,{variant:`ghost`,size:`sm`,className:`-ml-3 h-8 uppercase font-mono`,onClick:c,children:[n,l]}),t[6]=n,t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function bS(e){let t=(0,$.c)(96),{folderPath:n}=e,{_:r}=i(),{folderPaths:a,loading:o,pages:c,pageTitles:l,pageMeta:u}=si(),d=uo(n),{state:f,refresh:p}=d,[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(`name`),[v,y]=(0,Q.useState)(`asc`);if(o){let e;t[0]===r?e=t[1]:(e=r({id:`X9VpsP`}),t[0]=r,t[1]=e);let n;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Pa,{className:`size-5 rounded`}),(0,Z.jsx)(Pa,{className:`h-7 w-48`})]}),(0,Z.jsx)(Pa,{className:`h-9 w-20 rounded-md`})]}),t[2]=n):n=t[2];let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(Pa,{className:`h-4 w-16`}),t[3]=i):i=t[3];let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(`div`,{className:`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`,children:[n,(0,Z.jsxs)(`div`,{className:`rounded-lg border`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-4 border-b px-4 py-3`,children:[i,(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(Pa,{className:`h-4 w-20`})})]}),[`a`,`b`,`c`,`d`].map(CS)]})]}),t[4]=a):a=t[4];let o;return t[5]===e?o=t[6]:(o=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,role:`status`,"aria-busy":`true`,"aria-label":e,children:a}),t[5]=e,t[6]=o),o}let b,x,S,C,w,T,E,D,O,k,A;if(t[7]!==r||t[8]!==f||t[9]!==d||t[10]!==n||t[11]!==a||t[12]!==u||t[13]!==l||t[14]!==c||t[15]!==p||t[16]!==v||t[17]!==g){let e=cS(n,{pages:c,pageTitles:l,pageMeta:u,folderPaths:a}),i=vS(e.children,g,v),o=e.title||(n===``?r({id:`3aeN7X`}):e.title),m;t[29]===g?m=t[30]:(m=function(e){e===g?y(SS):(_(e),y(`asc`))},t[29]=g,t[30]=m);let j=m;A=`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,T=`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`;let M;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsx)(mt,{className:`size-5 text-muted-foreground`}),t[31]=M):M=t[31];let N=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[M,(0,Z.jsx)(`h1`,{className:`text-2xl font-light tracking-tight`,children:o})]}),P;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsxs)(sa,{onClick:()=>h(!0),children:[(0,Z.jsx)(At,{className:`size-4`}),(0,Z.jsx)(s,{id:`isRobC`})]}),t[32]=P):P=t[32],t[33]===N?E=t[34]:(E=(0,Z.jsx)(`div`,{className:`flex flex-col gap-6`,children:(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[N,P]})}),t[33]=N,t[34]=E),t[35]!==f||t[36]!==n||t[37]!==p?(D=(0,Z.jsx)(Xx,{folderPath:n,state:f,onChange:p}),t[35]=f,t[36]=n,t[37]=p,t[38]=D):D=t[38],t[39]!==f||t[40]!==d||t[41]!==n||t[42]!==p?(O=(0,Z.jsx)(lS,{folderPath:n,state:f,onChange:p,folderConfigHandle:d}),t[39]=f,t[40]=d,t[41]=n,t[42]=p,t[43]=O):O=t[43],t[44]===n?k=t[45]:(k=(0,Z.jsx)(rS,{folderPath:n}),t[44]=n,t[45]=k),w=`rounded-lg border`,x=dS;let F=g===`name`?v===`asc`?`ascending`:`descending`:`none`,I;t[46]===r?I=t[47]:(I=r({id:`6YtxFj`}),t[46]=r,t[47]=I);let L;t[48]!==j||t[49]!==v||t[50]!==g||t[51]!==I?(L=(0,Z.jsx)(yS,{label:I,sortKey:`name`,activeKey:g,activeDir:v,onSort:j}),t[48]=j,t[49]=v,t[50]=g,t[51]=I,t[52]=L):L=t[52];let R;t[53]!==F||t[54]!==L?(R=(0,Z.jsx)(hS,{"aria-sort":F,children:L}),t[53]=F,t[54]=L,t[55]=R):R=t[55];let z=g===`modified`?v===`asc`?`ascending`:`descending`:`none`,B;t[56]===r?B=t[57]:(B=r({id:`tgWuMB`}),t[56]=r,t[57]=B);let V;t[58]!==j||t[59]!==v||t[60]!==g||t[61]!==B?(V=(0,Z.jsx)(yS,{label:B,sortKey:`modified`,activeKey:g,activeDir:v,onSort:j}),t[58]=j,t[59]=v,t[60]=g,t[61]=B,t[62]=V):V=t[62];let H;t[63]!==z||t[64]!==V?(H=(0,Z.jsx)(hS,{className:`w-32`,"aria-sort":z,children:V}),t[63]=z,t[64]=V,t[65]=H):H=t[65],t[66]!==R||t[67]!==H?(C=(0,Z.jsx)(fS,{children:(0,Z.jsxs)(mS,{children:[R,H]})}),t[66]=R,t[67]=H,t[68]=C):C=t[68],b=pS,S=i.length?i.map(xS):(0,Z.jsx)(mS,{children:(0,Z.jsx)(gS,{colSpan:2,className:`h-24 text-center text-muted-foreground`,children:(0,Z.jsx)(s,{id:`Pkw7J9`})})}),t[7]=r,t[8]=f,t[9]=d,t[10]=n,t[11]=a,t[12]=u,t[13]=l,t[14]=c,t[15]=p,t[16]=v,t[17]=g,t[18]=b,t[19]=x,t[20]=S,t[21]=C,t[22]=w,t[23]=T,t[24]=E,t[25]=D,t[26]=O,t[27]=k,t[28]=A}else b=t[18],x=t[19],S=t[20],C=t[21],w=t[22],T=t[23],E=t[24],D=t[25],O=t[26],k=t[27],A=t[28];let j;t[69]!==b||t[70]!==S?(j=(0,Z.jsx)(b,{children:S}),t[69]=b,t[70]=S,t[71]=j):j=t[71];let M;t[72]!==x||t[73]!==j||t[74]!==C?(M=(0,Z.jsxs)(x,{children:[C,j]}),t[72]=x,t[73]=j,t[74]=C,t[75]=M):M=t[75];let N;t[76]!==M||t[77]!==w?(N=(0,Z.jsx)(`div`,{className:w,children:M}),t[76]=M,t[77]=w,t[78]=N):N=t[78];let P;t[79]!==N||t[80]!==T||t[81]!==E||t[82]!==D||t[83]!==O||t[84]!==k?(P=(0,Z.jsxs)(`div`,{className:T,children:[E,D,O,k,N]}),t[79]=N,t[80]=T,t[81]=E,t[82]=D,t[83]=O,t[84]=k,t[85]=P):P=t[85];let F;t[86]!==P||t[87]!==A?(F=(0,Z.jsx)(`div`,{className:A,children:P}),t[86]=P,t[87]=A,t[88]=F):F=t[88];let I;t[89]!==m||t[90]!==d||t[91]!==n?(I=(0,Z.jsx)(Gm,{open:m,onOpenChange:h,kind:`file`,initialDir:n,folderConfig:d,suggestedName:`index`}),t[89]=m,t[90]=d,t[91]=n,t[92]=I):I=t[92];let L;return t[93]!==F||t[94]!==I?(L=(0,Z.jsxs)(Z.Fragment,{children:[F,I]}),t[93]=F,t[94]=I,t[95]=L):L=t[95],L}function xS(e){return(0,Z.jsxs)(mS,{children:[(0,Z.jsx)(gS,{children:(0,Z.jsxs)(`a`,{href:yr(e.path),className:`flex items-center gap-2 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[e.kind===`folder`?(0,Z.jsx)(pl,{className:`size-4 shrink-0 text-muted-foreground`}):(0,Z.jsx)(Kt,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.title})]})}),(0,Z.jsx)(gS,{className:`text-muted-foreground`,children:e.kind===`file`?_S(e.modified):`—`})]},e.path)}function SS(e){return e===`asc`?`desc`:`asc`}function CS(e){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 border-b px-4 py-3 last:border-b-0`,children:[(0,Z.jsx)(Pa,{className:`size-4 rounded`}),(0,Z.jsx)(Pa,{className:`h-4 w-40`}),(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(Pa,{className:`h-4 w-16`})})]},e)}function wS(e){let t=(0,$.c)(24),{docName:n,size:r,limit:i,backNav:a}=e,o=a!==void 0,c=(0,Q.useRef)(null),l=(0,Q.useRef)(null),u,d;t[0]===o?(u=t[1],d=t[2]):(u=()=>{o?c.current?.focus():l.current?.focus()},d=[o],t[0]=o,t[1]=u,t[2]=d),(0,Q.useEffect)(u,d);let f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-full border bg-muted/40 text-muted-foreground`,children:(0,Z.jsx)(sl,{className:`size-9`,"aria-hidden":`true`})}),t[3]=f):f=t[3];let p=o?void 0:-1,m;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(s,{id:`P3hnm0`}),t[4]=m):m=t[4];let h;t[5]===p?h=t[6]:(h=(0,Z.jsx)(`h2`,{ref:l,id:`large-file-title`,tabIndex:p,className:`text-2xl font-light text-balance outline-none`,children:m}),t[5]=p,t[6]=h);let g;t[7]===r?g=t[8]:(g=Ri(r),t[7]=r,t[8]=g);let _;t[9]===i?_=t[10]:(_=Ri(i),t[9]=i,t[10]=_);let v;t[11]!==n||t[12]!==g||t[13]!==_?(v=(0,Z.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`_GBioJ`,values:{0:g,1:_,docName:n}})}),t[11]=n,t[12]=g,t[13]=_,t[14]=v):v=t[14];let y;t[15]!==h||t[16]!==v?(y=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[h,v]}),t[15]=h,t[16]=v,t[17]=y):y=t[17];let b;t[18]!==a||t[19]!==o?(b=o?(0,Z.jsxs)(sa,{ref:c,variant:`default`,onClick:()=>a.onNavigateBack(a.previousDocName),children:[(0,Z.jsx)(ga,{className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(s,{id:`CKyk7Q`})]}):null,t[18]=a,t[19]=o,t[20]=b):b=t[20];let x;return t[21]!==y||t[22]!==b?(x=(0,Z.jsxs)(`div`,{role:`status`,"aria-labelledby":`large-file-title`,"data-slot":`large-file-editor-state`,className:`flex h-full flex-col items-center justify-center gap-8 p-8 text-center`,children:[f,y,b]}),t[21]=y,t[22]=b,t[23]=x):x=t[23],x}function TS(e){let t=(0,$.c)(8),{docName:n}=e,[r,i]=(0,Q.useState)(ES),a,o;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>F(e=>{i(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})}),o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),(0,Q.useEffect)(a,o),!r.has(n))return null;let c;t[2]===n?c=t[3]:(c=function(){ne(n)?.abort(),i(e=>{if(!e.has(n))return e;let t=new Set(e);return t.delete(n),t})},t[2]=n,t[3]=c);let l=c,u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`A67Uwj`})}),t[4]=u):u=t[4];let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(s,{id:`dEgA5A`}),t[5]=d):d=t[5];let f;return t[6]===l?f=t[7]:(f=(0,Z.jsxs)(`div`,{className:`absolute inset-x-0 bottom-8 z-20 flex justify-center text-xs text-muted-foreground`,children:[u,(0,Z.jsx)(sa,{variant:`link`,size:`sm`,className:`h-auto px-2 py-0 text-xs`,onClick:l,children:d})]}),t[6]=l,t[7]=f),f}function ES(){return new Set}var DS=(0,Q.createContext)(null);function OS(e){let t=(0,$.c)(7),{children:n}=e,[r,i]=(0,Q.useState)(kS),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>{i(t=>{let n=new Map(t);return n.set(e,(t.get(e)??0)+1),n})},t[0]=a):a=t[0];let o=a,s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>{i(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},t[1]=s):s=t[1];let c=s,l;t[2]===r?l=t[3]:(l={addPropertySignal:r,requestAddProperty:o,clearAddProperty:c},t[2]=r,t[3]=l);let u=l,d;return t[4]!==n||t[5]!==u?(d=(0,Z.jsx)(DS,{value:u,children:n}),t[4]=n,t[5]=u,t[6]=d):d=t[6],d}function kS(){return new Map}function AS(){let e=(0,Q.use)(DS);if(e===null)throw Error(`useProperties must be used within <PropertyProvider />`);return e}function jS(e){let t=null,n=()=>(t===null&&(t=e(),t.catch(()=>{})),t),r=(0,Q.lazy)(n);return r.preload=n,r}var MS=jS(()=>n(()=>import(`./SettingsDialogBody-YOvgrn38.js`).then(e=>({default:e.SettingsDialogBody})),__vite__mapDeps([44,1,35,2,36,37,22,38,39,40,41,21,6,3,7,4,10,12,9,42,45,8,16,11,13,23,46]),import.meta.url));function NS(e){let t=(0,$.c)(9),{error:n}=e,{_:r}=i(),a;t[0]!==r||t[1]!==n?(a=n instanceof Error&&/dynamically imported module|Failed to fetch/i.test(n.message)?r({id:`Y8ViJx`}):r({id:`3h5zMp`}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o=a,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(`h3`,{id:`settings-body-error-title`,className:`font-heading text-base leading-none font-medium`,children:(0,Z.jsx)(s,{id:`hwFOFD`})}),t[3]=c):c=t[3];let l;t[4]===o?l=t[5]:(l=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[c,(0,Z.jsx)(`p`,{className:`max-w-xs text-sm text-muted-foreground`,children:o})]}),t[4]=o,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(sa,{variant:`default`,onClick:PS,children:(0,Z.jsx)(s,{id:`HpK_8d`})}),t[6]=u):u=t[6];let d;return t[7]===l?d=t[8]:(d=(0,Z.jsxs)(`div`,{role:`alert`,"aria-labelledby":`settings-body-error-title`,"data-slot":`settings-body-error-boundary`,className:`flex h-full flex-col items-center justify-center gap-5 p-8 text-center`,children:[l,u]}),t[7]=l,t[8]=d),d}function PS(){return window.location.reload()}function FS(e){let t=(0,$.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(re,{fallbackRender:LS,onError:IS,children:n}),t[0]=n,t[1]=r),r}function IS(e,t){console.error(`[SettingsDialogErrorBoundary] rendered fallback for Settings body`,e,t.componentStack)}function LS(e){return(0,Z.jsx)(NS,{...e})}function RS(e){return`https://github.com/inkeep/open-knowledge/releases/tag/v${encodeURIComponent(e)}`}function zS(e){let t=(0,$.c)(86),{open:n,onOpenChange:r}=e,{_:a}=i(),{collabUrl:o}=yt(),{userBinding:c,userSynced:l,okignoreBinding:u,okignoreSynced:d}=be(),{desktopPresent:f}=Na(),[p,m]=(0,Q.useState)(`preferences`),h,g;t[0]===n?(h=t[1],g=t[2]):(h=()=>{n&&m(`preferences`)},g=[n],t[0]=n,t[1]=h,t[2]=g),(0,Q.useEffect)(h,g);let _=o!==null,v;t[3]===a?v=t[4]:(v=a({id:`7PzzBU`}),t[3]=a,t[4]=v);let y;t[5]===a?y=t[6]:(y=a({id:`Q6hhn8`}),t[5]=a,t[6]=y);let b;t[7]===y?b=t[8]:(b={id:`preferences`,label:y},t[7]=y,t[8]=b);let x;t[9]===a?x=t[10]:(x=a({id:`4KmEoC`}),t[9]=a,t[10]=x);let S;t[11]===x?S=t[12]:(S={id:`hotkeys`,label:x},t[11]=x,t[12]=S);let C;t[13]===a?C=t[14]:(C=a({id:`AeXO77`}),t[13]=a,t[14]=C);let w;t[15]===C?w=t[16]:(w={id:`account`,label:C},t[15]=C,t[16]=w);let T;t[17]!==b||t[18]!==S||t[19]!==w?(T=[b,S,w],t[17]=b,t[18]=S,t[19]=w,t[20]=T):T=t[20];let E;t[21]!==T||t[22]!==v?(E={id:`user`,label:v,enabled:!0,items:T},t[21]=T,t[22]=v,t[23]=E):E=t[23];let D;t[24]===a?D=t[25]:(D=a({id:`ZWyHmq`}),t[24]=a,t[25]=D);let O;t[26]===a?O=t[27]:(O=a({id:`Nu4DdT`}),t[26]=a,t[27]=O);let k;t[28]===O?k=t[29]:(k={id:`sync`,label:O},t[28]=O,t[29]=k);let A;t[30]===a?A=t[31]:(A=a({id:`A1taO8`}),t[30]=a,t[31]=A);let j;t[32]===A?j=t[33]:(j={id:`search`,label:A},t[32]=A,t[33]=j);let M;t[34]===a?M=t[35]:(M=a({id:`iTylMl`}),t[34]=a,t[35]=M);let N;t[36]===M?N=t[37]:(N={id:`project-templates`,label:M},t[36]=M,t[37]=N);let P;t[38]===a?P=t[39]:(P=a({id:`3zyg_A`}),t[38]=a,t[39]=P);let F;t[40]===P?F=t[41]:(F={id:`okignore`,label:P},t[40]=P,t[41]=F);let I;t[42]===a?I=t[43]:(I=a({id:`cs4mps`}),t[42]=a,t[43]=I);let L;t[44]===I?L=t[45]:(L={id:`sharing`,label:I},t[44]=I,t[45]=L);let R;t[46]!==k||t[47]!==j||t[48]!==N||t[49]!==F||t[50]!==L?(R=[k,j,N,F,L],t[46]=k,t[47]=j,t[48]=N,t[49]=F,t[50]=L,t[51]=R):R=t[51];let z;t[52]!==_||t[53]!==D||t[54]!==R?(z={id:`project`,label:D,enabled:_,items:R},t[52]=_,t[53]=D,t[54]=R,t[55]=z):z=t[55];let B;t[56]===a?B=t[57]:(B=a({id:`nbfdhU`}),t[56]=a,t[57]=B);let V;t[58]!==a||t[59]!==f?(V=[],t[58]=a,t[59]=f,t[60]=V):V=t[60];let H;t[61]!==B||t[62]!==V?(H={id:`integrations`,label:B,enabled:!0,items:V},t[61]=B,t[62]=V,t[63]=H):H=t[63];let U;t[64]!==E||t[65]!==z||t[66]!==H?(U=[E,z,H],t[64]=E,t[65]=z,t[66]=H,t[67]=U):U=t[67];let ee=U,te;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Z.jsx)(bs,{className:`sr-only`,id:`settings-dialog-title`,children:(0,Z.jsx)(s,{id:`Tz0i8g`})}),t[68]=te):te=t[68];let W;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Z.jsx)(vs,{className:`sr-only`,children:(0,Z.jsx)(s,{id:`RDrXh4`})}),t[69]=W):W=t[69];let ne;t[70]!==p||t[71]!==ee?(ne=(0,Z.jsx)(BS,{groups:ee,activeId:p,onSelect:m}),t[70]=p,t[71]=ee,t[72]=ne):ne=t[72];let re;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsx)(US,{}),t[73]=re):re=t[73];let G=l?c:null,ie;t[74]!==p||t[75]!==u||t[76]!==d||t[77]!==G?(ie=(0,Z.jsx)(`section`,{"aria-labelledby":`settings-dialog-title`,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain subtle-scrollbar p-6`,tabIndex:0,children:(0,Z.jsx)(FS,{children:(0,Z.jsx)(Q.Suspense,{fallback:re,children:(0,Z.jsx)(MS,{activeId:p,userBinding:G,okignoreBinding:u,okignoreSynced:d})})})}),t[74]=p,t[75]=u,t[76]=d,t[77]=G,t[78]=ie):ie=t[78];let K;t[79]!==ne||t[80]!==ie?(K=(0,Z.jsxs)(xs,{className:`flex h-[700px] max-h-[calc(100dvh-4rem)] w-[900px] max-w-[calc(100%-2rem)] flex-col gap-0 overflow-hidden p-0 sm:grid sm:grid-cols-[220px_1fr] sm:max-w-[min(900px,calc(100%-2rem))]`,"data-testid":`settings-dialog`,children:[te,W,ne,ie]}),t[79]=ne,t[80]=ie,t[81]=K):K=t[81];let q;return t[82]!==r||t[83]!==n||t[84]!==K?(q=(0,Z.jsx)(Ts,{open:n,onOpenChange:r,children:K}),t[82]=r,t[83]=n,t[84]=K,t[85]=q):q=t[85],q}function BS(e){let t=(0,$.c)(13),{groups:n,activeId:r,onSelect:a}=e,{_:o}=i(),s;t[0]===o?s=t[1]:(s=o({id:`y1t8bQ`}),t[0]=o,t[1]=s);let c;if(t[2]!==r||t[3]!==n||t[4]!==a){let e;t[6]!==r||t[7]!==a?(e=e=>(0,Z.jsx)(HS,{group:e,activeId:r,onSelect:a},e.id),t[6]=r,t[7]=a,t[8]=e):e=t[8],c=n.map(e),t[2]=r,t[3]=n,t[4]=a,t[5]=c}else c=t[5];let l;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(VS,{}),t[9]=l):l=t[9];let u;return t[10]!==s||t[11]!==c?(u=(0,Z.jsxs)(`nav`,{"aria-label":s,className:`flex shrink-0 gap-x-3 overflow-x-auto overscroll-contain subtle-scrollbar scroll-fade-mask-x-max-sm border-b bg-muted/30 px-3 py-2 max-sm:pt-10 sm:h-full sm:flex-col sm:gap-0 sm:overflow-x-visible sm:overflow-y-auto sm:border-r sm:border-b-0 sm:py-4`,children:[c,l]}),t[10]=s,t[11]=c,t[12]=u):u=t[12],u}function VS(){let e=(0,$.c)(4),t=typeof window<`u`?window.okDesktop??null:null,n=t?.appVersion;if(!t||!n)return null;let r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=RS(n),e[0]=r):r=e[0];let i=r,a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(`p`,{className:`whitespace-nowrap font-mono text-xs text-muted-foreground/70`,"data-testid":`settings-sidebar-version`,children:[`v`,n]}),e[1]=a):a=e[1];let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{t.shell.openExternal(i)},e[2]=o):o=e[2];let c;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsxs)(`div`,{className:`ml-auto shrink-0 px-2 sm:ml-0 sm:mt-auto sm:pt-3`,children:[a,(0,Z.jsxs)(`button`,{type:`button`,onClick:o,"data-testid":`settings-sidebar-release-notes`,className:ea(`mt-0.5 inline-flex items-center gap-1 whitespace-nowrap rounded text-xs text-muted-foreground transition-colors hover:text-foreground`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`),children:[(0,Z.jsx)(s,{id:`_PACVa`}),(0,Z.jsx)(ms,{className:`size-3`,"aria-hidden":`true`})]})]}),e[3]=c):c=e[3],c}function HS(e){let t=(0,$.c)(28),{group:n,activeId:r,onSelect:i}=e;if(n.items.length===0)return null;let a=`settings-group-${n.id}`,o=`${a}-caption`,c=n.enabled?void 0:o,l=n.enabled?`text-muted-foreground/80`:`text-muted-foreground/50`,u;t[0]===l?u=t[1]:(u=ea(`shrink-0 whitespace-nowrap px-2 text-xs font-semibold uppercase tracking-wide font-mono sm:mb-1`,l),t[0]=l,t[1]=u);let d;t[2]!==n.label||t[3]!==a||t[4]!==c||t[5]!==u?(d=(0,Z.jsx)(`h3`,{id:a,"aria-describedby":c,className:u,children:n.label}),t[2]=n.label,t[3]=a,t[4]=c,t[5]=u,t[6]=d):d=t[6];let f;t[7]!==o||t[8]!==n.enabled?(f=n.enabled?null:(0,Z.jsx)(`p`,{id:o,className:`px-2 text-xs italic text-muted-foreground/60 sm:mb-1`,children:(0,Z.jsx)(s,{id:`JWsZlx`})}),t[7]=o,t[8]=n.enabled,t[9]=f):f=t[9];let p;if(t[10]!==r||t[11]!==o||t[12]!==n.enabled||t[13]!==n.items||t[14]!==i){let e;t[16]!==r||t[17]!==o||t[18]!==n.enabled||t[19]!==i?(e=e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`button`,{type:`button`,"aria-current":r===e.id?`page`:void 0,"aria-disabled":n.enabled?void 0:!0,"aria-describedby":n.enabled?void 0:o,tabIndex:n.enabled?0:-1,disabled:!n.enabled,onClick:()=>n.enabled&&i(e.id),"data-testid":`settings-sidebar-item-${e.id}`,className:ea(`w-auto whitespace-nowrap rounded px-2 py-1.5 text-left text-sm transition-colors sm:w-full`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,r===e.id&&n.enabled?`bg-accent text-accent-foreground`:`hover:bg-accent/50`),children:e.label})},e.id),t[16]=r,t[17]=o,t[18]=n.enabled,t[19]=i,t[20]=e):e=t[20],p=n.items.map(e),t[10]=r,t[11]=o,t[12]=n.enabled,t[13]=n.items,t[14]=i,t[15]=p}else p=t[15];let m;t[21]!==a||t[22]!==p?(m=(0,Z.jsx)(`ul`,{"aria-labelledby":a,className:`flex gap-1 sm:block sm:space-y-0.5`,children:p}),t[21]=a,t[22]=p,t[23]=m):m=t[23];let h;return t[24]!==d||t[25]!==f||t[26]!==m?(h=(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 sm:mb-4 sm:block`,children:[d,f,m]}),t[24]=d,t[25]=f,t[26]=m,t[27]=h):h=t[27],h}function US(){let e=(0,$.c)(4),t,n,r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(s,{id:`GsBUCk`})}),n=(0,Z.jsx)(Pa,{className:`h-5 w-32`}),r=(0,Z.jsx)(Pa,{className:`h-4 w-64`}),e[0]=t,e[1]=n,e[2]=r):(t=e[0],n=e[1],r=e[2]);let i;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-3`,"data-testid":`settings-content-skeleton`,children:[t,n,r,(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Pa,{className:`h-9 w-full`}),(0,Z.jsx)(Pa,{className:`h-9 w-full`})]})]}),e[3]=i):i=e[3],i}function WS(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`flex h-full w-full aria-[orientation=vertical]:flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(wb,{"data-slot":`resizable-panel-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function GS(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(Db,{"data-slot":`resizable-panel`,...n}),t[2]=n,t[3]=r),r}function KS(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({withHandle:i,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=ea(`relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),t[4]=n,t[5]=a);let o;t[6]===i?o=t[7]:(o=i&&(0,Z.jsx)(`div`,{className:`z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border`}),t[6]=i,t[7]=o);let s;return t[8]!==r||t[9]!==a||t[10]!==o?(s=(0,Z.jsx)(jb,{"data-slot":`resizable-handle`,className:a,...r,children:o}),t[8]=r,t[9]=a,t[10]=o,t[11]=s):s=t[11],s}function qS(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`input-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var JS=la(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function YS(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=ea(JS({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,Z.jsx)(`div`,{"data-slot":`input-group-addon`,"data-align":a,className:o,onMouseDown:XS,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function XS(e){e.target.closest(`button`)||(e.preventDefault(),e.currentTarget.parentElement?.querySelector(`input`)?.focus())}la(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function ZS(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`span`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function QS(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(ks,{"data-slot":`input-group-control`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $S(e){let t=(0,$.c)(119),{findInputRef:n,query:r,replacement:a,replaceOpen:o,caseSensitive:c,wholeWord:l,current:u,total:d,onQueryChange:f,onReplacementChange:p,onReplaceOpenChange:m,onCaseSensitiveChange:h,onWholeWordChange:g,onNext:_,onPrevious:v,onReplaceCurrent:y,onReplaceAll:b,onClose:x}=e,{_:S}=i(),C=r.length>0,w=d>0,T;t[0]!==S||t[1]!==u||t[2]!==w||t[3]!==C||t[4]!==d?(T=C?w?`${u} / ${d}`:S({id:`Ev2r9A`}):``,t[0]=S,t[1]=u,t[2]=w,t[3]=C,t[4]=d,t[5]=T):T=t[5];let E=T,D;t[6]!==x||t[7]!==_||t[8]!==v?(D=function(e){e.key===`Enter`?(e.preventDefault(),e.shiftKey?v():_()):e.key===`Escape`&&(e.preventDefault(),x())},t[6]=x,t[7]=_,t[8]=v,t[9]=D):D=t[9];let O=D,k;t[10]!==x||t[11]!==y?(k=function(e){e.key===`Enter`?(e.preventDefault(),y()):e.key===`Escape`&&(e.preventDefault(),x())},t[10]=x,t[11]=y,t[12]=k):k=t[12];let A=k,j;t[13]===S?j=t[14]:(j=S({id:`MVxpbf`}),t[13]=S,t[14]=j);let M;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsx)(`label`,{className:`sr-only`,htmlFor:`ok-find-input`,children:(0,Z.jsx)(s,{id:`KujtjC`})}),t[15]=M):M=t[15];let N;t[16]===f?N=t[17]:(N=e=>f(e.target.value),t[16]=f,t[17]=N);let P;t[18]===S?P=t[19]:(P=S({id:`KujtjC`}),t[18]=S,t[19]=P);let F;t[20]!==n||t[21]!==O||t[22]!==r||t[23]!==N||t[24]!==P?(F=(0,Z.jsx)(QS,{ref:n,id:`ok-find-input`,value:r,onChange:N,onKeyDown:O,placeholder:P,autoComplete:`off`,spellCheck:!1,className:`h-7 px-2 text-sm`}),t[20]=n,t[21]=O,t[22]=r,t[23]=N,t[24]=P,t[25]=F):F=t[25];let I;t[26]===S?I=t[27]:(I=S({id:`-8PP0T`}),t[26]=S,t[27]=I);let L;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(Yc,{"aria-hidden":`true`}),t[28]=L):L=t[28];let R;t[29]!==c||t[30]!==h||t[31]!==I?(R=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(gs,{type:`button`,variant:`segmented`,size:`sm`,"aria-label":I,pressed:c,onPressedChange:h,className:`size-6 min-w-6 px-0`,children:L})}),t[29]=c,t[30]=h,t[31]=I,t[32]=R):R=t[32];let z;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsx)(Ar,{side:`bottom`,children:(0,Z.jsx)(s,{id:`-8PP0T`})}),t[33]=z):z=t[33];let B;t[34]===R?B=t[35]:(B=(0,Z.jsxs)(pr,{children:[R,z]}),t[34]=R,t[35]=B);let V;t[36]===S?V=t[37]:(V=S({id:`_7UQ7y`}),t[36]=S,t[37]=V);let H;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Z.jsx)(nu,{"aria-hidden":`true`}),t[38]=H):H=t[38];let U;t[39]!==g||t[40]!==V||t[41]!==l?(U=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(gs,{type:`button`,variant:`segmented`,size:`sm`,"aria-label":V,pressed:l,onPressedChange:g,className:`size-6 min-w-6 px-0`,children:H})}),t[39]=g,t[40]=V,t[41]=l,t[42]=U):U=t[42];let ee;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Z.jsx)(Ar,{side:`bottom`,children:(0,Z.jsx)(s,{id:`_7UQ7y`})}),t[43]=ee):ee=t[43];let te;t[44]===U?te=t[45]:(te=(0,Z.jsxs)(pr,{children:[U,ee]}),t[44]=U,t[45]=te);let W;t[46]!==B||t[47]!==te?(W=(0,Z.jsxs)(YS,{align:`inline-end`,className:`gap-0.5`,children:[B,te]}),t[46]=B,t[47]=te,t[48]=W):W=t[48];let ne;t[49]!==W||t[50]!==F?(ne=(0,Z.jsxs)(qS,{className:`h-7 w-56 rounded-[min(var(--radius-md),12px)]`,children:[F,W]}),t[49]=W,t[50]=F,t[51]=ne):ne=t[51];let re;t[52]===E?re=t[53]:(re=(0,Z.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`min-w-14 px-1 text-right text-muted-foreground text-xs tabular-nums shrink-0`,children:E}),t[52]=E,t[53]=re);let G;t[54]===S?G=t[55]:(G=S({id:`oqB2ez`}),t[54]=S,t[55]=G);let ie=!w,K;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Z.jsx)($t,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[56]=K):K=t[56];let q;t[57]!==v||t[58]!==G||t[59]!==ie?(q=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":G,disabled:ie,onClick:v,children:K})}),t[57]=v,t[58]=G,t[59]=ie,t[60]=q):q=t[60];let ae;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,Z.jsx)(Ar,{side:`bottom`,children:(0,Z.jsx)(s,{id:`oqB2ez`})}),t[61]=ae):ae=t[61];let oe;t[62]===q?oe=t[63]:(oe=(0,Z.jsxs)(pr,{children:[q,ae]}),t[62]=q,t[63]=oe);let se;t[64]===S?se=t[65]:(se=S({id:`SiUUCS`}),t[64]=S,t[65]=se);let ce=!w,ue;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,Z.jsx)(le,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[66]=ue):ue=t[66];let de;t[67]!==_||t[68]!==se||t[69]!==ce?(de=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":se,disabled:ce,onClick:_,children:ue})}),t[67]=_,t[68]=se,t[69]=ce,t[70]=de):de=t[70];let fe;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,Z.jsx)(Ar,{side:`bottom`,children:(0,Z.jsx)(s,{id:`SiUUCS`})}),t[71]=fe):fe=t[71];let pe;t[72]===de?pe=t[73]:(pe=(0,Z.jsxs)(pr,{children:[de,fe]}),t[72]=de,t[73]=pe);let me=o?`secondary`:`ghost`,he;t[74]!==S||t[75]!==o?(he=S(o?{id:`UkQGhd`}:{id:`1RluQD`}),t[74]=S,t[75]=o,t[76]=he):he=t[76];let ge=o?`ok-replace-input`:void 0,_e;t[77]!==m||t[78]!==o?(_e=()=>m(!o),t[77]=m,t[78]=o,t[79]=_e):_e=t[79];let ve;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,Z.jsx)(Rl,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[80]=ve):ve=t[80];let ye;t[81]!==o||t[82]!==me||t[83]!==he||t[84]!==ge||t[85]!==_e?(ye=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{type:`button`,variant:me,size:`icon-sm`,"aria-label":he,"aria-expanded":o,"aria-controls":ge,onClick:_e,children:ve})}),t[81]=o,t[82]=me,t[83]=he,t[84]=ge,t[85]=_e,t[86]=ye):ye=t[86];let be;t[87]===o?be=t[88]:(be=(0,Z.jsx)(Ar,{side:`bottom`,children:o?(0,Z.jsx)(s,{id:`UkQGhd`}):(0,Z.jsx)(s,{id:`1RluQD`})}),t[87]=o,t[88]=be);let xe;t[89]!==ye||t[90]!==be?(xe=(0,Z.jsxs)(pr,{children:[ye,be]}),t[89]=ye,t[90]=be,t[91]=xe):xe=t[91];let Se;t[92]!==S||t[93]!==A||t[94]!==w||t[95]!==b||t[96]!==y||t[97]!==p||t[98]!==o||t[99]!==a?(Se=o?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`label`,{className:`sr-only`,htmlFor:`ok-replace-input`,children:(0,Z.jsx)(s,{id:`fqSfXY`})}),(0,Z.jsx)(ks,{id:`ok-replace-input`,value:a,onChange:e=>p(e.target.value),onKeyDown:A,placeholder:S({id:`fqSfXY`}),autoComplete:`off`,spellCheck:!1,className:`h-7 w-48 rounded-[min(var(--radius-md),12px)] px-2 text-sm shadow-none focus-visible:ring-2`}),(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":S({id:`bS_boY`}),disabled:!w,onClick:y,children:(0,Z.jsx)(Rl,{"data-icon":`inline-start`,"aria-hidden":`true`})})}),(0,Z.jsx)(Ar,{side:`bottom`,children:(0,Z.jsx)(s,{id:`bS_boY`})})]}),(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":S({id:`dr1vFs`}),disabled:!w,onClick:b,children:(0,Z.jsx)(Ll,{"data-icon":`inline-start`,"aria-hidden":`true`})})}),(0,Z.jsx)(Ar,{side:`bottom`,children:(0,Z.jsx)(s,{id:`dr1vFs`})})]})]}):null,t[92]=S,t[93]=A,t[94]=w,t[95]=b,t[96]=y,t[97]=p,t[98]=o,t[99]=a,t[100]=Se):Se=t[100];let Ce;t[101]===S?Ce=t[102]:(Ce=S({id:`wJo9oS`}),t[101]=S,t[102]=Ce);let we;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,Z.jsx)(ys,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[103]=we):we=t[103];let Te;t[104]!==x||t[105]!==Ce?(Te=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":Ce,onClick:x,children:we})}),t[104]=x,t[105]=Ce,t[106]=Te):Te=t[106];let Ee;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,Z.jsx)(Ar,{side:`bottom`,children:(0,Z.jsx)(s,{id:`yz7wBu`})}),t[107]=Ee):Ee=t[107];let De;t[108]===Te?De=t[109]:(De=(0,Z.jsxs)(pr,{children:[Te,Ee]}),t[108]=Te,t[109]=De);let Oe;return t[110]!==ne||t[111]!==re||t[112]!==oe||t[113]!==pe||t[114]!==j||t[115]!==xe||t[116]!==Se||t[117]!==De?(Oe=(0,Z.jsxs)(`search`,{"data-testid":`find-replace-bar`,"aria-label":j,className:`pointer-events-auto flex max-w-[min(calc(100vw-1rem),720px)] touch-manipulation items-center gap-1 rounded-[calc(var(--radius)+2px)] border border-input bg-popover/95 p-1 text-popover-foreground shadow-md shadow-black/10 backdrop-blur`,children:[M,ne,re,oe,pe,xe,Se,De]}),t[110]=ne,t[111]=re,t[112]=oe,t[113]=pe,t[114]=j,t[115]=xe,t[116]=Se,t[117]=De,t[118]=Oe):Oe=t[118],Oe}var eC={current:0,total:0},tC=120,nC=100;function rC(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=()=>e?_(e):null,t[0]=e,t[1]=n),(0,Q.useSyncExternalStore)(M,n,iC)}function iC(){return null}function aC(e){if(!e||e.isDestroyed)return null;let{from:t,to:n,empty:r}=e.state.selection;if(r)return null;let i=e.state.doc.textBetween(t,n,`
24
24
  `,`
25
25
  `).trim();return i.length===0||i.length>tC||i.includes(`
26
26
  `)?null:i}function oC(e){let t=nt(e.state);return{current:t.matches.length===0?0:t.activeIndex+1,total:t.matches.length}}function sC(e,t){return e.current===t.current&&e.total===t.total}function cC(e,t,n){e&&!e.isDestroyed&&(e.commands.clearFindMatches(),e.commands.focus()),t(e=>({...e,open:!1,activeIndex:0})),n(eC)}function lC(e){!e||e.isDestroyed||typeof window>`u`||window.requestAnimationFrame(()=>{if(e.isDestroyed)return;let t=_e(e);if(!t)return;let n=t.dom.querySelector(`.ok-find-match-active`);n instanceof HTMLElement&&n.scrollIntoView({block:`center`,inline:`nearest`,behavior:`auto`})})}function uC(e){let t=(0,$.c)(81),{activeDocName:n,isSourceMode:r}=e,i=rC(n),a=(0,Q.useRef)(null),o=(0,Q.useRef)(null),s=(0,Q.useRef)(n),c=(0,Q.useRef)(0),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={open:!1,replaceOpen:!1,query:``,replacement:``,caseSensitive:!1,wholeWord:!1,activeIndex:0},t[0]=l):l=t[0];let[u,d]=(0,Q.useState)(l),[f,p]=(0,Q.useState)(eC),m,h;t[1]===n?(m=t[2],h=t[3]):(m=()=>{s.current!==n&&(s.current=n,d(fC))},h=[n],t[1]=n,t[2]=m,t[3]=h),(0,Q.useEffect)(m,h);let g,_;t[4]===u.activeIndex?(g=t[5],_=t[6]):(g=()=>{c.current=u.activeIndex},_=[u.activeIndex],t[4]=u.activeIndex,t[5]=g,t[6]=_),(0,Q.useEffect)(g,_);let v,y;t[7]===i?(v=t[8],y=t[9]):(v=()=>{let e=o.current;e&&e!==i&&!e.isDestroyed&&e.commands.clearFindMatches(),o.current=i},y=[i],t[7]=i,t[8]=v,t[9]=y),(0,Q.useEffect)(v,y);let b,x;t[10]===u.open?(b=t[11],x=t[12]):(b=()=>{if(!u.open||!a.current)return;let e=requestAnimationFrame(()=>{a.current?.focus(),a.current?.select()});return()=>cancelAnimationFrame(e)},x=[u.open],t[10]=u.open,t[11]=b,t[12]=x),(0,Q.useEffect)(b,x);let S,C;t[13]!==u.open||t[14]!==r?(S=()=>{!u.open||!r||d(dC)},C=[u.open,r],t[13]=u.open,t[14]=r,t[15]=S,t[16]=C):(S=t[15],C=t[16]),(0,Q.useEffect)(S,C);let w,T;t[17]!==i||t[18]!==u.caseSensitive||t[19]!==u.open||t[20]!==u.query||t[21]!==u.wholeWord||t[22]!==r?(w=()=>{if(!i||i.isDestroyed){p(eC);return}if(!u.open||r){i.commands.clearFindMatches(),p(eC);return}let e=window.setTimeout(()=>{if(i.isDestroyed)return;i.commands.setFindQuery(u.query,{options:{caseSensitive:u.caseSensitive,wholeWord:u.wholeWord},activeIndex:c.current});let e=oC(i);p(t=>sC(t,e)?t:e)},nC);return()=>window.clearTimeout(e)},T=[i,u.open,u.query,u.caseSensitive,u.wholeWord,r],t[17]=i,t[18]=u.caseSensitive,t[19]=u.open,t[20]=u.query,t[21]=u.wholeWord,t[22]=r,t[23]=w,t[24]=T):(w=t[23],T=t[24]),(0,Q.useEffect)(w,T);let E,D;t[25]!==i||t[26]!==u.open||t[27]!==r?(E=()=>{if(!i||i.isDestroyed||!u.open||r)return;let e=()=>{let e=nt(i.state),t=oC(i);p(e=>sC(e,t)?e:t),d(t=>t.activeIndex===e.activeIndex?t:{...t,activeIndex:e.activeIndex})};return i.on(`transaction`,e),()=>{i.off(`transaction`,e)}},D=[i,u.open,r],t[25]=i,t[26]=u.open,t[27]=r,t[28]=E,t[29]=D):(E=t[28],D=t[29]),(0,Q.useEffect)(E,D);let O,k;t[30]!==n||t[31]!==i||t[32]!==u.open||t[33]!==r?(O=()=>{let e=function(e){let t=aC(i);d(n=>({...n,open:!0,replaceOpen:e,query:t??n.query,activeIndex:0}))},t=function(t){if(!(!n||r||t.defaultPrevented)){if(Ws(t,`find`)){t.preventDefault(),u.open?cC(i,d,p):e(!1);return}if(Ws(t,`replace`)){t.preventDefault(),e(!0);return}if(u.open){let e=Ws(t,`find-next`),n=Ws(t,`find-previous`);if(e||n){t.preventDefault(),(n?i?.commands.selectPreviousFindMatch():i?.commands.selectNextFindMatch())&&lC(i);return}}t.key===`Escape`&&u.open&&(t.preventDefault(),cC(i,d,p))}};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},k=[n,i,u.open,r],t[30]=n,t[31]=i,t[32]=u.open,t[33]=r,t[34]=O,t[35]=k):(O=t[34],k=t[35]),(0,Q.useEffect)(O,k);let A;t[36]!==i||t[37]!==u.caseSensitive||t[38]!==u.query||t[39]!==u.wholeWord?(A=function(){return!i||i.isDestroyed?!1:(i.commands.setFindQuery(u.query,{options:{caseSensitive:u.caseSensitive,wholeWord:u.wholeWord},activeIndex:c.current}),!0)},t[36]=i,t[37]=u.caseSensitive,t[38]=u.query,t[39]=u.wholeWord,t[40]=A):A=t[40];let j=A,M;t[41]===i?M=t[42]:(M=function(){if(!i||i.isDestroyed)return;let e=nt(i.state),t=oC(i);p(e=>sC(e,t)?e:t),d(t=>t.activeIndex===e.activeIndex?t:{...t,activeIndex:e.activeIndex})},t[41]=i,t[42]=M);let N=M,P;t[43]===i?P=t[44]:(P=function(){cC(i,d,p)},t[43]=i,t[44]=P);let F=P,I;t[45]!==j||t[46]!==i||t[47]!==N?(I=function(){!i||i.isDestroyed||(j(),i.commands.selectNextFindMatch()&&lC(i),N())},t[45]=j,t[46]=i,t[47]=N,t[48]=I):I=t[48];let L=I,R;t[49]!==j||t[50]!==i||t[51]!==N?(R=function(){!i||i.isDestroyed||(j(),i.commands.selectPreviousFindMatch()&&lC(i),N())},t[49]=j,t[50]=i,t[51]=N,t[52]=R):R=t[52];let z=R,B;t[53]!==j||t[54]!==i||t[55]!==u.replacement||t[56]!==N?(B=function(){!i||i.isDestroyed||(j(),i.commands.replaceCurrentFindMatch(u.replacement)&&lC(i),N())},t[53]=j,t[54]=i,t[55]=u.replacement,t[56]=N,t[57]=B):B=t[57];let V=B,H;t[58]!==j||t[59]!==i||t[60]!==u.replacement||t[61]!==N?(H=function(){!i||i.isDestroyed||(j(),i.commands.replaceAllFindMatches(u.replacement)&&lC(i),N())},t[58]=j,t[59]=i,t[60]=u.replacement,t[61]=N,t[62]=H):H=t[62];let U=H;if(!u.open||!n||r)return null;let ee,te,W,ne,re;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(ee=e=>d(t=>({...t,query:e,activeIndex:0})),te=e=>d(t=>({...t,replacement:e})),W=e=>d(t=>({...t,replaceOpen:e})),ne=e=>d(t=>({...t,caseSensitive:e})),re=e=>d(t=>({...t,wholeWord:e})),t[63]=ee,t[64]=te,t[65]=W,t[66]=ne,t[67]=re):(ee=t[63],te=t[64],W=t[65],ne=t[66],re=t[67]);let G;return t[68]!==F||t[69]!==u.caseSensitive||t[70]!==u.query||t[71]!==u.replaceOpen||t[72]!==u.replacement||t[73]!==u.wholeWord||t[74]!==f.current||t[75]!==f.total||t[76]!==U||t[77]!==V||t[78]!==L||t[79]!==z?(G=(0,Z.jsx)(`div`,{className:`editor-content-aligned pointer-events-none absolute inset-x-0 top-2 z-30 px-2`,children:(0,Z.jsx)(`div`,{className:`flex justify-end`,children:(0,Z.jsx)($S,{findInputRef:a,query:u.query,replacement:u.replacement,replaceOpen:u.replaceOpen,caseSensitive:u.caseSensitive,wholeWord:u.wholeWord,current:f.current,total:f.total,onQueryChange:ee,onReplacementChange:te,onReplaceOpenChange:W,onCaseSensitiveChange:ne,onWholeWordChange:re,onNext:L,onPrevious:z,onReplaceCurrent:V,onReplaceAll:U,onClose:F})})}),t[68]=F,t[69]=u.caseSensitive,t[70]=u.query,t[71]=u.replaceOpen,t[72]=u.replacement,t[73]=u.wholeWord,t[74]=f.current,t[75]=f.total,t[76]=U,t[77]=V,t[78]=L,t[79]=z,t[80]=G):G=t[80],G}function dC(e){return{...e,open:!1,activeIndex:0}}function fC(e){return{...e,activeIndex:0}}var pC=300;function mC(e,t){let n=(0,$.c)(4),[r,i]=(0,Q.useState)(mc),a,o;return n[0]!==t||n[1]!==e?(a=()=>{if(!e||!t){i(mc);return}let n=e.document.getText(`source`),r=!1,a=null,o=function(){r||i(yc(n.toString()))};o();let s=function(){a&&clearTimeout(a),a=setTimeout(o,pC)};return n.observe(s),()=>{r=!0,n.unobserve(s),a&&clearTimeout(a)}},o=[e,t],n[0]=t,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,Q.useEffect)(a,o),r}function hC(e){return e&&e.document.getMap(`lifecycle`).get(`status`)===`conflict`?`conflict`:null}function gC(e){let t=(0,$.c)(8),{poolEntries:n}=yt(),r;t[0]!==e||t[1]!==n?(r=e?n.find(t=>t.docName===e)??null:null,t[0]=e,t[1]=n,t[2]=r):r=t[2];let i=r?.provider??null,a;t[3]===i?a=t[4]:(a=()=>hC(i),t[3]=i,t[4]=a);let[o,s]=(0,Q.useState)(a),c,l;return t[5]===i?(c=t[6],l=t[7]):(c=()=>{if(!i){s(null);return}let e=i.document.getMap(`lifecycle`);s(hC(i));let t=()=>s(hC(i));return e.observe(t),()=>{e.unobserve(t)}},l=[i],t[5]=i,t[6]=c,t[7]=l),(0,Q.useEffect)(c,l),o}function _C(e,t){let n=(0,$.c)(3),r;return n[0]!==e||n[1]!==t?(r=()=>Sc(e,t),n[0]=e,n[1]=t,n[2]=r):r=n[2],(0,Q.useSyncExternalStore)(Cc,r)}var vC=`ok-doc-panel-width-v1`;function yC(e){return Number.isFinite(e)?e<300?300:e>600?600:Math.round(e):320}function bC(e){try{let t=(e??localStorage).getItem(vC);if(t==null)return 320;let n=Number.parseInt(t,10);return Number.isFinite(n)?yC(n):320}catch{return 320}}function xC(e,t){try{(t??localStorage).setItem(vC,String(yC(e)))}catch{}}function SC(){try{return typeof localStorage>`u`?320:bC()}catch{return 320}}var CC=1024,wC=1280,TC={left:CC,right:wC};function EC(e,t,n){return e==null?t>=TC[n]?`above`:`below`:`embedded`}function DC(e){return e===`above`?`open`:`collapsed`}var OC=`ok-sidebar-pins-v2`;function kC(e){return e===`open`||e===`collapsed`}function AC(e){return e===`above`||e===`below`||e===`embedded`}function jC(e){if(typeof e!=`object`||!e)return!1;let t=e;for(let e of Object.keys(t))if(!AC(e)||!kC(t[e]))return!1;return!0}function MC(e){let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n=t,r={};return jC(n.left)&&(r.left=n.left),jC(n.right)&&(r.right=n.right),r}function NC(e){try{let t=(e??localStorage).getItem(OC);return t==null?{}:MC(t)}catch{return{}}}function PC(e,t){try{t.setItem(OC,JSON.stringify(e))}catch{}}function FC(e,t,n){return n[e]?.[t]??DC(t)}function IC(e,t,n,r){let i=r??localStorage,a=NC(i);return a[e]={...a[e],[t]:n},PC(a,i),a}function LC(e){let t=(0,$.c)(3),[n,r]=(0,Q.useState)(`connecting`),i,a;return t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e){r(`connecting`);return}let t=e.configuration.websocketProvider.status;e.isSynced?r(`synced`):r(t===`connected`?`connected`:t===`disconnected`?`disconnected`:`connecting`);let n=e=>{let{status:t}=e;r(t===`connected`?RC:t===`disconnected`?`disconnected`:`connecting`)},i=e=>{let{state:t}=e;r(t?`synced`:`connected`)},a=()=>r(`disconnected`);return e.on(`status`,n),e.on(`synced`,i),e.on(`disconnect`,a),()=>{e.off(`status`,n),e.off(`synced`,i),e.off(`disconnect`,a)}},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,Q.useEffect)(i,a),n}function RC(e){return e===`synced`?`synced`:`connected`}var zC=Qr;function BC(e,t={}){let n=J(e.componentName);return n.name===`*`?t.unregisteredSuffix?`${e.componentName} (unregistered)`:e.componentName:n.displayName??n.name}var VC=200,HC=`Outside any block`;function UC(e){let t=(0,$.c)(5),{editor:n}=e,r=Ie(n),i=(0,Q.useRef)(null),a=(0,Q.useRef)(null),o=(0,Q.useRef)(!1),s,c;t[0]!==r||t[1]!==n?(s=()=>{if(a.current!==null&&(window.clearTimeout(a.current),a.current=null),!n||!i.current)return;let e=r!==null&&r.ancestorChain.length>0,t;return t=e?WC(n,r):o.current?HC:``,a.current=window.setTimeout(()=>{i.current&&(i.current.textContent=``,i.current.textContent=t),o.current=e,a.current=null},VC),()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null)}},c=[n,r],t[0]=r,t[1]=n,t[2]=s,t[3]=c):(s=t[2],c=t[3]),(0,Q.useEffect)(s,c);let l;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`div`,{ref:i,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`sr-only`}),t[4]=l):l=t[4],l}function WC(e,t){if(!t||t.ancestorChain.length===0)return``;let n=t.ancestorChain,r=n[n.length-1],i=BC(r,{unregisteredSuffix:!0});if(n.length===1)return`Selected: ${i}`;let a=n[n.length-2],o=BC(a);try{let t=e.state.doc.resolve(r.pos),n=t.index(t.depth),a=t.parent.childCount;return`Selected: ${i}, ${n+1} of ${a} in ${o}`}catch{return`Selected: ${i} in ${o}`}}function GC(){let[e]=(0,Q.useState)(ei);return e}function KC({principal:e,identity:t}){return e&&e.source===`git-config`?{type:`human`,name:$r(e.display_name),color:Lr(e.id,qn),coeditor:t.coeditor,tabId:t.tabId,principalId:e.id}:e&&e.source===`synthesized`?{type:`human`,name:t.name,color:Lr(e.id,qn),coeditor:t.coeditor,tabId:t.tabId}:{type:`human`,name:t.name,color:t.color,coeditor:t.coeditor,tabId:t.tabId}}function qC(e,t){return e>t}function JC(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.isChangeOrigin===!0?!0:`snapshot`in t&&`prevSnapshot`in t&&t.snapshot===null&&t.prevSnapshot===null}var YC=3,XC=6e4;function ZC(e,t){let n=0;for(let r of e)t-r<XC&&(n+=1);return n<YC}var QC=new Map;function $C(e,t){for(let n of e.changed.keys()){let e=n;for(;e!=null;){if(e===t)return!0;let n=e._item;e=n==null?null:n.parent}}return!1}function ew(e){let t=Gt.getState(e);return t?.snapshot!=null||t?.prevSnapshot!=null}function tw(e){let{fragment:t,docName:n,onWedged:r}=e,i=0,a=0,o=!1,s=!1,c=!1,l=null,u=new WeakSet,d=e=>{let t=Gt.getState(e)?.binding;if(!t)return;if(typeof t._prosemirrorChanged!=`function`){ut.count(`ok/editor/binding-guard-disarmed`,{docName:n,reason:`no-prosemirror-changed`}),console.warn(`[binding-staleness-guard] ySync binding on "${n}" exposes no _prosemirrorChanged — write-back gate disarmed (vendored y-tiptap contract change?)`);return}if(u.has(t))return;u.add(t);let r=t._prosemirrorChanged.bind(t);t._prosemirrorChanged=e=>{qC(i,a)||r(e)}},f=()=>{if(c=!1,!s||o||!qC(i,a)||l!==null&&ew(l.state))return;o=!0;let e=Date.now();for(let[t,n]of QC)n.every(t=>e-t>=XC)&&QC.delete(t);let t=(QC.get(n)??[]).filter(t=>e-t<XC);if(!ZC(t,e)){QC.set(n,t),ut.count(`ok/editor/binding-wedge-rate-capped`,{docName:n}),console.warn(`[binding-staleness-guard] wedge on "${n}" rate-capped (externalSeq=${i}, appliedSeq=${a}) — publication gate stays closed, no further recycle`);return}t.push(e),QC.set(n,t),console.warn(`[binding-staleness-guard] wedged binding on "${n}" — Y→PM apply missing (externalSeq=${i}, appliedSeq=${a})`);try{r({externalSeq:i,appliedSeq:a})}catch(e){o=!1,ut.count(`ok/editor/binding-wedge-recovery-error`,{docName:n}),console.error(`[binding-staleness-guard] wedge recovery threw for "${n}":`,e)}},p=e=>{e.origin!==Gt&&$C(e,t)&&(i+=1,c||(c=!0,queueMicrotask(f)))};return new jr({state:{init:()=>null,apply:e=>(JC(e.getMeta(Gt))&&(a=i,o&&ut.count(`ok/editor/binding-wedge-recovered`,{docName:n}),o=!1),null)},filterTransaction:(e,t)=>!qC(i,a)||ew(t)?!0:e.getMeta(Gt)!==void 0,view:e=>{let r=t.doc;return r==null?(ut.count(`ok/editor/binding-guard-disarmed`,{docName:n,reason:`no-ydoc`}),console.error(`[binding-staleness-guard] fragment has no Y.Doc for "${n}" — staleness guard disarmed`),{}):(s=!0,l=e,d(e.state),r.off(`beforeObserverCalls`,p),r.on(`beforeObserverCalls`,p),{destroy:()=>{s=!1,l=null,r.off(`beforeObserverCalls`,p)}})}})}function nw(e,t){let n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,o=r-n;return new DOMRect(i,n,a,o)}var rw=class{constructor({editor:e,element:t,view:n,pluginKey:r=`bubbleMenu`,updateDelay:i=250,resizeDelay:a=60,shouldShow:o,appendTo:s,getReferencedVirtualElement:c,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:`absolute`,placement:`top`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&Cr(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);!n&&!r||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=l?.scrollTarget??window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener(`dragstart`,this.dragstartHandler),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(Rr(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(ri(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(Ln(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(dr(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Vi(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(ji(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(Gr(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(Dr(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}get virtualElement(){let{selection:e}=this.editor.state,t=this.getReferencedVirtualElement?.call(this);if(t)return t;if(!this.view?.dom?.parentNode)return;let n=Vn(this.view,e.from,e.to),r={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof mr){let t=this.view.nodeDOM(e.from),n=t.dataset.nodeViewWrapper?t:t.querySelector(`[data-node-view-wrapper]`);n&&(t=n),t&&(r={getBoundingClientRect:()=>t.getBoundingClientRect(),getClientRects:()=>[t.getBoundingClientRect()]})}if(e instanceof gi){let{$anchorCell:t,$headCell:n}=e,i=t?t.pos:n.pos,a=n?n.pos:t.pos,o=this.view.nodeDOM(i),s=this.view.nodeDOM(a);if(!o||!s)return;let c=o===s?o.getBoundingClientRect():nw(o.getBoundingClientRect(),s.getBoundingClientRect());r={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return r}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&Hr(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:e,from:i,to:a})||!1}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener(`dragstart`,this.dragstartHandler),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},iw=e=>new jr({key:typeof e.pluginKey==`string`?new Zi(e.pluginKey):e.pluginKey,view:t=>new rw({view:t,...e})});ai.create({name:`bubbleMenu`,addOptions(){return{element:null,pluginKey:`bubbleMenu`,updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[iw({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var aw=class{constructor({editor:e,element:t,view:n,pluginKey:r=`floatingMenu`,updateDelay:i=250,resizeDelay:a=60,options:o,appendTo:s,shouldShow:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!this.editor.isEditable)},this.floatingUIOptions={strategy:`absolute`,placement:`right`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=o?.scrollTarget??window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,c&&(this.shouldShow=c),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(e){return Yn(e,{textSerializers:Ki(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(Rr(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(ri(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(Ln(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(dr(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Vi(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(ji(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(Gr(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(Dr(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,view:this.view,state:t,oldState:e,from:i,to:a})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){let{selection:e}=this.editor.state,t=Vn(this.view,e.from,e.to);Hr({getBoundingClientRect:()=>t,getClientRects:()=>[t]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},ow=e=>new jr({key:typeof e.pluginKey==`string`?new Zi(e.pluginKey):e.pluginKey,view:t=>new aw({view:t,...e})});ai.create({name:`floatingMenu`,addOptions(){return{element:null,options:{},pluginKey:`floatingMenu`,updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,`updatePosition`),!0)}},addProseMirrorPlugins(){return this.options.element?[ow({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function sw(e,t){return e??new Zi(t)}var cw=typeof window<`u`?Q.useLayoutEffect:Q.useEffect,lw=new Set([`left`,`opacity`,`position`,`top`,`visibility`,`width`]),uw=new Set(`animationIterationCount.aspectRatio.borderImageOutset.borderImageSlice.borderImageWidth.columnCount.columns.fillOpacity.flex.flexGrow.flexShrink.fontWeight.gridArea.gridColumn.gridColumnEnd.gridColumnStart.gridRow.gridRowEnd.gridRowStart.lineClamp.lineHeight.opacity.order.orphans.scale.stopOpacity.strokeDasharray.strokeDashoffset.strokeMiterlimit.strokeOpacity.strokeWidth.tabSize.widows.zIndex.zoom`.split(`.`)),dw=new Set([`children`,`className`,`style`]),fw=new Set([`tabIndex`]),pw=new Set([`accessKey`,`autoCapitalize`,`contentEditable`,`contextMenu`,`dir`,`draggable`,`enterKeyHint`,`hidden`,`id`,`lang`,`nonce`,`role`,`slot`,`spellCheck`,`tabIndex`,`title`,`translate`]),mw={Blur:`focusout`,DoubleClick:`dblclick`,Focus:`focusin`,MouseEnter:`mouseenter`,MouseLeave:`mouseleave`};function hw(e,t){return/^on[A-Z]/.test(e)&&typeof t==`function`}function gw(e){return e.startsWith(`aria-`)||e.startsWith(`data-`),e}function _w(e){return e.startsWith(`aria-`)||e.startsWith(`data-`)||pw.has(e)}function vw(e){return e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function yw(e){let t=e.endsWith(`Capture`),n=(t?e.slice(0,-7):e).slice(2);return{eventName:mw[n]??n.toLowerCase(),options:t?{capture:!0}:void 0}}function bw(e,t){let n=t.defaultPrevented,r=!1,i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>void 0},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>r},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{r=!0,t.stopPropagation()}}}),i}function xw(e){return fw.has(e)}function Sw(e,t,n){if(t===`tabIndex`){e.tabIndex=Number(n);return}e[t]=n}function Cw(e,t){if(t===`tabIndex`){e.removeAttribute(`tabindex`);return}let n=e[t];if(typeof n==`boolean`){e[t]=!1;return}if(typeof n==`number`){e[t]=0;return}e[t]=``}function ww(e,t){return typeof t!=`number`||t===0||e.startsWith(`--`)||uw.has(e)?String(t):`${t}px`}function Tw(e,t){lw.has(t)||e.style.removeProperty(vw(t))}function Ew(e,t,n){lw.has(t)||e.style.setProperty(vw(t),ww(t,n))}function Dw(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(r=>{if(dw.has(r)||!_w(r)||hw(r,t[r])||hw(r,n[r]))return;let i=t[r],a=n[r];if(i===a)return;let o=gw(r);if(a==null||a===!1){xw(r)&&Cw(e,r),e.removeAttribute(o);return}if(a===!0){xw(r)&&Sw(e,r,!0),e.setAttribute(o,``);return}if(xw(r)){Sw(e,r,a);return}e.setAttribute(o,String(a))})}function Ow(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute(`class`)}}function kw(e,t,n){let r=t??{},i=n??{};new Set([...Object.keys(r),...Object.keys(i)]).forEach(t=>{let n=r[t],a=i[t];if(n!==a){if(a==null){Tw(e,t);return}Ew(e,t,a)}})}function Aw(e,t,n){t.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)});let r=[];return Object.entries(n).forEach(([t,n])=>{if(!hw(t,n))return;let{eventName:i,options:a}=yw(t),o=t=>{n(bw(e,t))};e.addEventListener(i,o,a),r.push({eventName:i,listener:o,options:a})}),r}function jw(e,t){let n=(0,Q.useRef)({}),r=(0,Q.useRef)([]);cw(()=>{let i=n.current;return Ow(e,i.className,t.className),kw(e,i.style,t.style),Dw(e,i,t),r.current=Aw(e,r.current,t),n.current=t,()=>{r.current.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)}),r.current=[]}},[e,t])}var Mw=Q.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,getReferencedVirtualElement:o,options:s,children:c,...l},u)=>{let d=(0,Q.useRef)(document.createElement(`div`)),f=(0,Q.useRef)(sw(e,`bubbleMenu`)).current;jw(d.current,l),typeof u==`function`?u(d.current):u&&(u.current=d.current);let{editor:p}=x(),m=t||p,h={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:f,shouldShow:a,getReferencedVirtualElement:o,options:s},g=(0,Q.useRef)(h);g.current=h;let[_,v]=(0,Q.useState)(!1),y=(0,Q.useRef)(!0);return(0,Q.useEffect)(()=>{if(m?.isDestroyed)return;if(!m){console.warn(`BubbleMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=d.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=iw({...g.current,editor:m,element:e});m.registerPlugin(t);let n=g.current.pluginKey;return y.current=!0,v(!0),()=>{v(!1),m.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[m]),(0,Q.useEffect)(()=>{if(!(!_||!m||m.isDestroyed)){if(y.current){y.current=!1;return}m.view.dispatch(m.state.tr.setMeta(f,{type:`updateOptions`,options:g.current}))}},[_,m,n,r,a,s,i,o,f]),(0,Kc.createPortal)(c,d.current)});Q.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,options:o,children:s,...c},l)=>{let u=(0,Q.useRef)(document.createElement(`div`)),d=(0,Q.useRef)(sw(e,`floatingMenu`)).current;jw(u.current,c),typeof l==`function`?l(u.current):l&&(l.current=u.current);let{editor:f}=x(),p=t||f,m={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:d,shouldShow:a,options:o},h=(0,Q.useRef)(m);h.current=m;let[g,_]=(0,Q.useState)(!1),v=(0,Q.useRef)(!0);return(0,Q.useEffect)(()=>{if(p?.isDestroyed)return;if(!p){console.warn(`FloatingMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=u.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=ow({...h.current,editor:p,element:e});p.registerPlugin(t);let n=h.current.pluginKey;return v.current=!0,_(!0),()=>{_(!1),p.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[p]),(0,Q.useEffect)(()=>{if(!(!g||!p||p.isDestroyed)){if(v.current){v.current=!1;return}p.view.dispatch(p.state.tr.setMeta(d,{type:`updateOptions`,options:h.current}))}},[g,p,n,r,a,o,i,d]),(0,Kc.createPortal)(s,u.current)});var Nw=[{name:`paragraph`,label:`Text`,icon:Nl,isActive:e=>e.isActive(`paragraph`)&&!e.isActive(`list`),command:e=>e.chain().focus().setParagraph().run()},{name:`heading1`,label:`Heading 1`,icon:Tt,isActive:e=>e.isActive(`heading`,{level:1}),command:e=>e.chain().focus().toggleHeading({level:1}).run()},{name:`heading2`,label:`Heading 2`,icon:Pe,isActive:e=>e.isActive(`heading`,{level:2}),command:e=>e.chain().focus().toggleHeading({level:2}).run()},{name:`heading3`,label:`Heading 3`,icon:at,isActive:e=>e.isActive(`heading`,{level:3}),command:e=>e.chain().focus().toggleHeading({level:3}).run()},{name:`bulletList`,label:`Bullet List`,icon:Oe,isActive:e=>e.isActive(`list`,{ordered:!1})&&!e.isActive(`listItem`,{checked:!0})&&!e.isActive(`listItem`,{checked:!1}),command:e=>e.chain().focus().toggleBulletList().run()},{name:`orderedList`,label:`Ordered List`,icon:u,isActive:e=>e.isActive(`list`,{ordered:!0}),command:e=>e.chain().focus().toggleOrderedList().run()},{name:`taskList`,label:`Task List`,icon:q,isActive:e=>e.isActive(`listItem`,{checked:!0})||e.isActive(`listItem`,{checked:!1}),command:e=>e.chain().focus().toggleTaskList().run()},{name:`blockquote`,label:`Quote`,icon:z,isActive:e=>e.isActive(`blockquote`),command:e=>e.chain().focus().toggleBlockquote().run()},{name:`codeBlock`,label:`Code Block`,icon:Gl,isActive:e=>e.isActive(`codeBlock`),command:e=>e.chain().focus().toggleCodeBlock({language:`js`}).run()}];function Pw(e){let t=(0,$.c)(18),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:Fw},t[0]=n,t[1]=r);let{current:i,activeStates:a}=b(r),o=i.icon,s;t[2]===o?s=t[3]:(s=(0,Z.jsx)(o,{className:`size-3.5`}),t[2]=o,t[3]=s);let c;t[4]===i.label?c=t[5]:(c=(0,Z.jsx)(`span`,{children:i.label}),t[4]=i.label,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(le,{className:`size-3 opacity-50`}),t[6]=l):l=t[6];let u;t[7]!==s||t[8]!==c?(u=(0,Z.jsx)(Bo,{asChild:!0,children:(0,Z.jsxs)(sa,{variant:`ghost`,size:`sm`,className:`gap-1 px-2 text-sm font-medium text-accent-foreground/80`,children:[s,c,l]})}),t[7]=s,t[8]=c,t[9]=u):u=t[9];let d;t[10]!==a||t[11]!==n?(d=Nw.map(e=>{let t=e.icon,r=a[e.name];return(0,Z.jsxs)($o,{className:r?`bg-accent text-accent-foreground`:``,onSelect:()=>{e.command(n)},children:[(0,Z.jsx)(t,{className:`size-4`}),(0,Z.jsx)(`span`,{children:e.label})]},e.name)}),t[10]=a,t[11]=n,t[12]=d):d=t[12];let f;t[13]===d?f=t[14]:(f=(0,Z.jsx)(Wo,{align:`start`,sideOffset:8,className:`w-44 max-h-(--radix-dropdown-menu-content-available-height) overflow-y-auto subtle-scrollbar`,children:d}),t[13]=d,t[14]=f);let p;return t[15]!==u||t[16]!==f?(p=(0,Z.jsxs)(jo,{children:[u,f]}),t[15]=u,t[16]=f,t[17]=p):p=t[17],p}function Fw(e){let t=Object.fromEntries(Nw.map(t=>[t.name,t.isActive(e.editor)]));return{current:Nw.find(e=>t[e.name])??Nw[0],activeStates:t}}function Iw(e){let t=Ut(e.state.selection.content(),e.state.schema);return Et().serialize(t).trim()}function Lw(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName.toUpperCase();return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`}function Rw(e){let t=(0,$.c)(15),{editor:n,shortcutEnabled:r}=e,a=r===void 0?!1:r,{_:o}=i(),{openSelection:c}=bc(),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=Zn(),t[0]=l):l=t[0];let u=l,d=bh(),f;t[1]!==o||t[2]!==n||t[3]!==c?(f=()=>{let e;try{e=Iw(n)}catch(e){console.error(`Edit with AI: could not read the selection`,e),X.error(o({id:`-RXIMO`}));return}c({docName:kt(n),instruction:``,selectionMarkdown:e})},t[1]=o,t[2]=n,t[3]=c,t[4]=f):f=t[4];let p=f,m,h;if(t[5]!==d||t[6]!==p||t[7]!==a?(m=()=>{if(!u||d)return;let e=e=>{a&&Ws(e,`edit-with-ai`)&&(Lw(e.target)||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),p()))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},h=[u,d,a,p],t[5]=d,t[6]=p,t[7]=a,t[8]=m,t[9]=h):(m=t[8],h=t[9]),(0,Q.useEffect)(m,h),!u||d)return null;let g;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(Aa,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),t[10]=g):g=t[10];let _,v;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(ya,{className:`size-3.5`,"aria-hidden":`true`}),v=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`EVnzPs`})}),t[11]=_,t[12]=v):(_=t[11],v=t[12]);let y;return t[13]===p?y=t[14]:(y=(0,Z.jsxs)(Z.Fragment,{children:[g,(0,Z.jsxs)(sa,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`edit-with-ai-bubble-button`,className:`gap-1 px-2 text-sm font-medium text-accent-foreground/80`,onClick:p,children:[_,v]})]}),t[13]=p,t[14]=y),y}function zw(e){let t=e.state.selection.node;if(!t||t.type.name!==`jsxComponent`)return null;let n=t.attrs.componentName;if(n!==`File`&&n!==`WikiEmbedFile`)return null;let r=(t.attrs.props??{}).src;return typeof r!=`string`||r.length===0?null:r}function Bw(e){let t=e.state.selection.node;if(!t)return``;let n=t.attrs.props??{},r=typeof n.alias==`string`?n.alias:``;if(r.length>0)return r;let i=typeof n.name==`string`?n.name:``;return i.length>0?i:Ve(typeof n.src==`string`?n.src:``)}function Vw(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,n.rel=`noopener noreferrer`,n.style.display=`none`,document.body.appendChild(n),n.click(),n.remove()}function Hw(e){let t=(0,$.c)(13),{editor:n}=e,{_:r}=i(),a;if(t[0]===n?a=t[1]:(a={editor:n,selector:Uw},t[0]=n,t[1]=a),b(a)===null)return null;let o;t[2]===r?o=t[3]:(o=r({id:`WcWS__`}),t[2]=r,t[3]=o);let c;t[4]===n?c=t[5]:(c=e=>{e.preventDefault();let t=zw(n);t&&Vw(t,Bw(n))},t[4]=n,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(Uo,{className:`size-3.5`}),t[6]=l):l=t[6];let u;t[7]!==o||t[8]!==c?(u=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{variant:`ghost`,size:`icon-xs`,"aria-label":o,className:`text-accent-foreground`,onMouseDown:c,children:l})}),t[7]=o,t[8]=c,t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(Ar,{side:`bottom`,sideOffset:8,children:(0,Z.jsx)(s,{id:`WcWS__`})}),t[10]=d):d=t[10];let f;return t[11]===u?f=t[12]:(f=(0,Z.jsx)(`div`,{className:`flex items-center gap-0.5`,children:(0,Z.jsxs)(pr,{children:[u,d]})}),t[11]=u,t[12]=f),f}function Uw(e){return zw(e.editor)}function Ww(e){return zw(e)!==null}function Gw(e){let t=e.schema.nodes;return!!(t.footnoteReference&&t.footnoteDefinition)}function Kw(e){let{from:t,to:n}=e.state.selection,r=!1;return e.state.doc.nodesBetween(t,n,e=>e.type.name===`footnoteReference`?(r=!0,!1):!0),r}function qw(e){let{$from:t,$to:n}=e.state.selection;return!t.sameParent(n)}function Jw(e){let t=(0,$.c)(21),{editor:n}=e,{_:r}=i(),a;t[0]===n?a=t[1]:(a={editor:n,selector:Yw},t[0]=n,t[1]=a);let o=b(a),s;t[2]!==o||t[3]!==n?(s=()=>{if(o||!Gw(n)||n.state.selection.empty||qw(n)||Kw(n))return;let{from:e,to:t}=n.state.selection,r=n.state.doc.textBetween(e,t,` `);if(!r.trim())return;let i=sr(Ir(n.state.doc)),a=Di(n.state.doc)+1-(t-e);n.chain().focus().deleteSelection().insertFootnoteReference(i).insertContentAt(a,{type:`footnoteDefinition`,attrs:{identifier:i,label:i},content:[{type:`paragraph`,content:[{type:`text`,text:r}]}]}).run()},t[2]=o,t[3]=n,t[4]=s):s=t[4];let c=s,l;t[5]===r?l=t[6]:(l=r({id:`sIGbBZ`}),t[5]=r,t[6]=l);let u;t[7]===c?u=t[8]:(u=e=>{e.preventDefault(),c()},t[7]=c,t[8]=u);let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(xe,{className:`size-3.5`,"aria-hidden":`true`}),t[9]=d):d=t[9];let f;t[10]!==o||t[11]!==l||t[12]!==u?(f=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{type:`button`,variant:`ghost`,size:`icon-xs`,"data-testid":`footnote-bubble-button`,className:`text-accent-foreground/80`,"aria-label":l,onMouseDown:u,disabled:o,children:d})}),t[10]=o,t[11]=l,t[12]=u,t[13]=f):f=t[13];let p;t[14]===r?p=t[15]:(p=r({id:`sIGbBZ`}),t[14]=r,t[15]=p);let m;t[16]===p?m=t[17]:(m=(0,Z.jsx)(Ar,{side:`bottom`,sideOffset:8,children:p}),t[16]=p,t[17]=m);let h;return t[18]!==f||t[19]!==m?(h=(0,Z.jsxs)(pr,{children:[f,m]}),t[18]=f,t[19]=m,t[20]=h):h=t[20],h}function Yw(e){let t=e.editor;return!!(!Gw(t)||t.state.selection.empty||qw(t)||Kw(t))}var Xw=[{value:`left`,label:`Align left`,icon:ve},{value:`center`,label:`Align center`,icon:he},{value:`right`,label:`Align right`,icon:j}];function Zw(e){let t=e.state.selection.node;if(!t||t.type.name!==`jsxComponent`)return null;let n=t.attrs.componentName;if(!tn.has(String(n)))return null;let r=(t.attrs.props??{}).align;return r===`left`||r===`right`||r===`center`?r:`center`}function Qw(e){let t=(0,$.c)(7),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:$w},t[0]=n,t[1]=r);let i=b(r);if(i===null)return null;let a;t[2]!==i||t[3]!==n?(a=Xw.map(e=>{let{value:t,label:r,icon:a}=e,o=i===t;return(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{variant:`ghost`,size:`icon-xs`,"aria-label":r,"aria-pressed":o,className:o?`bg-accent text-primary`:`text-accent-foreground`,onMouseDown:e=>{e.preventDefault();let r=n.state.selection,i=r.node;if(!i||i.type.name!==`jsxComponent`)return;let a=String(i.attrs.componentName??``);if(!tn.has(a)||i.attrs.kind!==`element`)return;let o=a===`CommonMarkImage`,s=r.from,c={...i.attrs.props??{},align:t},l=o?{...i.attrs,componentName:`img`,props:c,sourceDirty:!0}:{...i.attrs,props:c,sourceDirty:!0},u=n.state.tr.setNodeMarkup(s,null,l);u.setSelection(mr.create(u.doc,s)),Jt(n.view.nodeDOM(s),()=>{n.view.dispatch(u)})},children:(0,Z.jsx)(a,{className:`size-3.5`})})}),(0,Z.jsx)(Ar,{side:`bottom`,sideOffset:8,children:r})]},t)}),t[2]=i,t[3]=n,t[4]=a):a=t[4];let o;return t[5]===a?o=t[6]:(o=(0,Z.jsx)(`div`,{className:`flex items-center gap-0.5`,children:a}),t[5]=a,t[6]=o),o}function $w(e){return Zw(e.editor)}function eT(e){return Zw(e)!==null}var tT=[{name:`bold`,icon:Gc,command:e=>e.chain().focus().toggleBold().run(),isActive:e=>e.isActive(`strong`),shortcutId:`format-bold`},{name:`italic`,icon:vl,command:e=>e.chain().focus().toggleItalic().run(),isActive:e=>e.isActive(`emphasis`),shortcutId:`format-italic`},{name:`underline`,icon:$l,command:e=>e.chain().focus().toggleUnderline().run(),isActive:e=>e.isActive(`underline`),shortcutId:`format-underline`},{name:`strikethrough`,icon:Yl,command:e=>e.chain().focus().toggleStrike().run(),isActive:e=>e.isActive(`strike`),shortcutId:`format-strike`},{name:`code`,icon:Ae,command:e=>e.chain().focus().toggleCode().run(),isActive:e=>e.isActive(`code`),shortcutId:`format-inline-code`},{name:`highlight`,icon:gl,command:e=>e.chain().focus().toggleHighlight().run(),isActive:e=>e.isActive(`highlight`),shortcutId:`format-highlight`}];function nT(e){let t=(0,$.c)(7),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:rT},t[0]=n,t[1]=r);let i=b(r),a;t[2]!==i||t[3]!==n?(a=tT.map(e=>{let t=e.icon,r=i[e.name];return(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{variant:`ghost`,size:`icon-xs`,"aria-label":e.name,className:r?`bg-accent text-primary`:`text-accent-foreground`,onMouseDown:t=>{t.preventDefault(),e.command(n)},children:(0,Z.jsx)(t,{className:`size-3.5`})})}),(0,Z.jsxs)(Ar,{side:`bottom`,sideOffset:8,children:[(0,Z.jsx)(`span`,{className:`capitalize`,children:e.name}),(0,Z.jsx)(D,{"aria-label":Gs(e.shortcutId),children:Us(e.shortcutId)})]})]},e.name)}),t[2]=i,t[3]=n,t[4]=a):a=t[4];let o;return t[5]===a?o=t[6]:(o=(0,Z.jsx)(`div`,{className:`flex items-center gap-0.5`,children:a}),t[5]=a,t[6]=o),o}function rT(e){return Object.fromEntries(tT.map(t=>[t.name,t.isActive(e.editor)]))}function iT(e){let t=(0,$.c)(66),{editor:n}=e,{_:r}=i(),[a,o]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(``),u=(0,Q.useRef)(null),{folderPaths:d,loading:f,pages:p}=si(),m;t[0]===n?m=t[1]:(m=n.state.selection.empty&&n.isActive(`link`),t[0]=n,t[1]=m);let h=m,_;t[2]===n?_=t[3]:(_=n.getAttributes(`link`).href??``,t[2]=n,t[3]=_);let v=_,y;t[4]===n?y=t[5]:(y=function(){return n.state.selection.empty&&n.isActive(`link`)?n.getAttributes(`link`).href??``:``},t[4]=n,t[5]=y);let b=y,x,S;t[6]===n?(x=t[7],S=t[8]):(x=()=>{let e=function(){n.state.selection.empty&&o(!1)};return n.on(`selectionUpdate`,e),()=>{n.off(`selectionUpdate`,e)}},S=[n],t[6]=n,t[7]=x,t[8]=S),(0,Q.useEffect)(x,S);let C,T;t[9]===a?(C=t[10],T=t[11]):(C=()=>{a&&requestAnimationFrame(()=>u.current?.focus())},T=[a],t[9]=a,t[10]=C,t[11]=T),(0,Q.useEffect)(C,T);let E;t[12]!==n||t[13]!==h||t[14]!==c?(E=function(){c.trim()?n.chain().focus().setLink({href:c.trim()}).run():h&&n.chain().focus().unsetLink().run(),o(!1)},t[12]=n,t[13]=h,t[14]=c,t[15]=E):E=t[15];let O=E,k;t[16]===n?k=t[17]:(k=function(){n.chain().focus().unsetLink().run(),o(!1)},t[16]=n,t[17]=k);let A=k,j;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(j=function(e){l(w(e.path,null))},t[18]=j):j=t[18];let M=j,P;t[19]!==O||t[20]!==n?(P=function(e){e.key===`Enter`&&(e.preventDefault(),O()),e.key===`Escape`&&(e.preventDefault(),o(!1),n.chain().focus().run())},t[19]=O,t[20]=n,t[21]=P):P=t[21];let F=P;if(a){let e;t[22]===r?e=t[23]:(e=r({id:`ZsGpr_`}),t[22]=r,t[23]=e);let n;t[24]===r?n=t[25]:(n=r({id:`roAe2K`}),t[24]=r,t[25]=n);let i;t[26]!==d||t[27]!==F||t[28]!==f||t[29]!==p||t[30]!==e||t[31]!==n||t[32]!==c?(i=(0,Z.jsx)(lt,{ref:u,type:`text`,placeholder:e,value:c,pages:p,folderPaths:d,loading:f,onValueChange:l,onSuggestionSelect:M,onKeyDown:F,"aria-label":n,className:`h-5 w-44 rounded-none border-none bg-transparent px-0 py-0 text-sm placeholder:text-muted-foreground focus-visible:border-transparent focus-visible:ring-0 dark:bg-transparent`}),t[26]=d,t[27]=F,t[28]=f,t[29]=p,t[30]=e,t[31]=n,t[32]=c,t[33]=i):i=t[33];let a;t[34]===r?a=t[35]:(a=r({id:`tP5DDk`}),t[34]=r,t[35]=a);let o;t[36]===O?o=t[37]:(o=()=>{O()},t[36]=O,t[37]=o);let m;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(nl,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[38]=m):m=t[38];let _;t[39]!==a||t[40]!==o?(_=(0,Z.jsx)(sa,{variant:`ghost`,size:`icon-xs`,"aria-label":a,onClick:o,children:m}),t[39]=a,t[40]=o,t[41]=_):_=t[41];let y;t[42]!==i||t[43]!==_?(y=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border bg-background px-2 py-1 focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50`,children:[i,_]}),t[42]=i,t[43]=_,t[44]=y):y=t[44];let b;t[45]!==r||t[46]!==v||t[47]!==h||t[48]!==A?(b=h&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{variant:`ghost`,size:`icon-xs`,"aria-label":r({id:`2vIPtm`}),onMouseDown:e=>{e.preventDefault(),N(v)},children:(0,Z.jsx)(ms,{className:`size-3.5`})})}),(0,Z.jsx)(Ar,{side:`bottom`,sideOffset:8,children:(0,Z.jsx)(s,{id:`2vIPtm`})})]}),(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{variant:`ghost`,size:`icon-xs`,"aria-label":r({id:`484LKL`}),onMouseDown:e=>{e.preventDefault(),A()},children:(0,Z.jsx)(g,{className:`size-3.5`})})}),(0,Z.jsx)(Ar,{side:`bottom`,sideOffset:8,children:(0,Z.jsx)(s,{id:`484LKL`})})]})]}),t[45]=r,t[46]=v,t[47]=h,t[48]=A,t[49]=b):b=t[49];let x;return t[50]!==y||t[51]!==b?(x=(0,Z.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[y,b]}),t[50]=y,t[51]=b,t[52]=x):x=t[52],x}let I;t[53]===r?I=t[54]:(I=r({id:`p0Iq25`}),t[53]=r,t[54]=I);let L=h?`bg-accent text-primary`:`text-accent-foreground`,R;t[55]===b?R=t[56]:(R=e=>{e.preventDefault(),l(b()),o(!0)},t[55]=b,t[56]=R);let z;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsx)(bl,{className:`size-3.5`}),t[57]=z):z=t[57];let B;t[58]!==I||t[59]!==L||t[60]!==R?(B=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{variant:`ghost`,size:`icon-xs`,"aria-label":I,className:L,onMouseDown:R,children:z})}),t[58]=I,t[59]=L,t[60]=R,t[61]=B):B=t[61];let V;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsx)(s,{id:`yzF66j`}),t[62]=V):V=t[62];let H;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Z.jsxs)(Ar,{side:`bottom`,sideOffset:8,children:[V,(0,Z.jsx)(D,{children:Us(`command-palette`)})]}),t[63]=H):H=t[63];let U;return t[64]===B?U=t[65]:(U=(0,Z.jsxs)(pr,{children:[B,H]}),t[64]=B,t[65]=U),U}function aT({editor:e}){if(nt(e.state).query||e.isActive(`codeBlock`))return!1;if(eT(e)||Ww(e))return!0;if(e.state.selection.empty)return!1;let{from:t,to:n}=e.state.selection;return!!e.state.doc.textBetween(t,n,` `).trim()}function oT(e){let t=(0,$.c)(23),{editor:n,shortcutEnabled:r}=e,i=r===void 0?!0:r,a=(0,Q.useRef)(null),[o,s]=(0,Q.useState)(0),c=(0,Q.useRef)(null),l;t[0]===n?l=t[1]:(l={editor:n,selector:dT},t[0]=n,t[1]=l);let u=b(l),d;t[2]===n?d=t[3]:(d={editor:n,selector:uT},t[2]=n,t[3]=d);let f=b(d),p;t[4]!==n.state||t[5]!==n.view?(p=()=>{try{let{from:e,to:t}=n.state.selection;return Vn(n.view,e,t)}catch{return new DOMRect}},t[4]=n.state,t[5]=n.view,t[6]=p):p=t[6];let m;if(t[7]!==n.view.dom||t[8]!==p){let e={getBoundingClientRect:p,contextElement:n.view.dom};m=()=>{let t=a.current;t&&(c.current?.(),c.current=lr(e,t,()=>{Hr(e,t,{placement:`top`,strategy:`fixed`,middleware:[Ln(8),Rr(),ri({padding:8})]}).then(e=>{let{x:n,y:r}=e;t.isConnected&&(t.style.position=`fixed`,t.style.left=`${n}px`,t.style.top=`${r}px`)}).catch(lT)}))},t[7]=n.view.dom,t[8]=p,t[9]=m}else m=t[9];let h=m,g;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{c.current?.(),c.current=null,s(cT)},t[10]=g):g=t[10];let _=g,v;t[11]===h?v=t[12]:(v={onShow:h,onHide:_,strategy:`fixed`},t[11]=h,t[12]=v);let y;t[13]!==n||t[14]!==f||t[15]!==u||t[16]!==i||t[17]!==o?(y=u?(0,Z.jsx)(Qw,{editor:n},`${o}-img-align`):f?(0,Z.jsx)(Hw,{editor:n},`${o}-file`):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Pw,{editor:n}),(0,Z.jsx)(Aa,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),(0,Z.jsx)(nT,{editor:n},o),(0,Z.jsx)(Aa,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),(0,Z.jsx)(iT,{editor:n},`${o}-link`),(0,Z.jsx)(Jw,{editor:n},`${o}-footnote`),(0,Z.jsx)(Rw,{editor:n,shortcutEnabled:i},`${o}-edit-ai`)]}),t[13]=n,t[14]=f,t[15]=u,t[16]=i,t[17]=o,t[18]=y):y=t[18];let x;return t[19]!==n||t[20]!==v||t[21]!==y?(x=(0,Z.jsx)(Mw,{ref:a,editor:n,"data-testid":`bubble-menu-bar`,appendTo:sT,shouldShow:aT,updateDelay:250,options:v,className:`z-50 flex items-center gap-0.5 rounded-lg border bg-background p-1 shadow-md`,children:y}),t[19]=n,t[20]=v,t[21]=y,t[22]=x):x=t[22],x}function sT(){return document.body}function cT(e){return e+1}function lT(){}function uT(e){return Ww(e.editor)}function dT(e){return eT(e.editor)}var fT=`application/x-open-knowledge-sidebar-item+json`,pT={image:!0,video:!0,audio:!0,pdf:!0,text:!0};function mT(e){return JSON.stringify(e)}function hT(e){return e.kind===`folder`?{target:{kind:`folder`,target:e.folderPath,folderPath:e.folderPath},hash:Tr(e.folderPath)}:e.kind===`asset`?{target:{kind:`asset`,target:e.assetPath,assetPath:e.assetPath,mediaKind:e.mediaKind},hash:gr(e.assetPath)}:{target:Ii(e.docName,e.size)??{kind:`doc`,target:e.docName,docName:e.docName},hash:yr(e.docName)}}function gT(e){if(!e||!Array.from(e.types).includes(`application/x-open-knowledge-sidebar-item+json`))return null;let t=e.getData(fT);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!_T(n)||n.v!==1||typeof n.kind!=`string`)return null;if(n.kind===`doc`){if(typeof n.docName!=`string`||n.docName.length===0)return null;let e=n.size;return e!==null&&typeof e!=`number`?null:{v:1,kind:`doc`,docName:n.docName,size:e}}if(n.kind===`folder`)return typeof n.folderPath==`string`?{v:1,kind:`folder`,folderPath:n.folderPath}:null;if(n.kind===`asset`){if(typeof n.assetPath!=`string`||n.assetPath.length===0)return null;let e=n.mediaKind;return e!==null&&!vT(e)?null:{v:1,kind:`asset`,assetPath:n.assetPath,mediaKind:e}}return null}function _T(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function vT(e){return typeof e==`string`&&Object.hasOwn(pT,e)}function yT(e,t){return(n,r)=>{let i=r,a=gT(i.dataTransfer);return a?(i.preventDefault(),t?.(a),!0):e(n,i)}}function bT(e,t){let n=hT(e);t(n.target,{tabBehavior:`append`}),cr(n.hash)}function xT(e){return[...e?[{label:`Toggle header column`,icon:el,run:e=>e.chain().focus().toggleHeaderColumn().run()}]:[],{label:`Insert column left`,icon:ga,run:e=>e.chain().focus().addColumnBefore().run()},{label:`Insert column right`,icon:Qo,run:e=>e.chain().focus().addColumnAfter().run()},{label:`Delete column`,icon:g,separatorBefore:!0,run:e=>e.chain().focus().deleteColumn().run()},{label:`Delete table`,icon:ml,run:e=>e.chain().focus().deleteTable().run()}]}function ST(e){return[...e?[{label:`Toggle header row`,icon:Xl,run:e=>e.chain().focus().toggleHeaderRow().run()}]:[],{label:`Insert row above`,icon:fe,run:e=>e.chain().focus().addRowBefore().run()},{label:`Insert row below`,icon:S,run:e=>e.chain().focus().addRowAfter().run()},{label:`Delete row`,icon:g,separatorBefore:!0,run:e=>e.chain().focus().deleteRow().run()},{label:`Delete table`,icon:ml,run:e=>e.chain().focus().deleteTable().run()}]}function CT(e){if(!e.isEditable||nt(e.state).query)return null;let{state:t,view:n}=e,r=t.selection.$from,i=-1;for(let e=r.depth;e>0;e--){let t=r.node(e).type.spec.tableRole;if(t===`cell`||t===`header_cell`){i=r.before(e);break}}if(i<0)return null;let a=n.nodeDOM(i);if(!(a instanceof HTMLTableCellElement))return null;let o=a.closest(`table`),s=a.closest(`tr`),c=a.closest(`.ProseMirror`);if(!o||!s||!c)return null;let l=Array.prototype.indexOf.call(o.rows,s),u=a.cellIndex,d=o.rows[0]?.cells[u],f=o.rows[l]?.cells[0];return!d||!f?null:{columnAnchor:d,rowAnchor:f,isFirstColumn:u===0,isFirstRow:l===0}}function wT(e){let t=(0,$.c)(22),{editor:n,anchor:r,axis:i,items:a}=e,o=(0,Q.useRef)(null),s,c;t[0]!==r||t[1]!==i?(s=()=>{let e=o.current;if(!e)return;let t=i===`column`?`top`:`left`,n=i===`column`?-14:-6;return lr(r,e,()=>{Hr(r,e,{strategy:`absolute`,placement:t,middleware:[Ln(n)]}).then(t=>{let{x:n,y:r}=t;e.style.left=`${n}px`,e.style.top=`${r}px`,e.style.opacity=`1`}).catch(TT)})},c=[r,i],t[0]=r,t[1]=i,t[2]=s,t[3]=c):(s=t[2],c=t[3]),(0,Q.useEffect)(s,c);let l=i===`column`?al:ns,u=i===`column`?`h-3 w-7 rounded-full p-0 text-gray-700 dark:text-muted-foreground bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 hover:text-foreground dark:hover:bg-gray-600 dark:hover:text-gray-100 relative before:absolute before:-inset-[6px] before:content-[""]`:`h-7 w-3 rounded-full p-0 text-gray-700 dark:text-muted-foreground bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 hover:text-foreground dark:hover:bg-gray-600 dark:hover:text-gray-100 relative before:absolute before:-inset-[6px] before:content-[""]`,d=i===`column`?`Column options`:`Row options`,f;t[4]===l?f=t[5]:(f=(0,Z.jsx)(l,{className:`size-3.5`,"aria-hidden":!0}),t[4]=l,t[5]=f);let p;t[6]!==u||t[7]!==d||t[8]!==f?(p=(0,Z.jsx)(Bo,{asChild:!0,children:(0,Z.jsx)(sa,{variant:`secondary`,className:u,"aria-label":d,children:f})}),t[6]=u,t[7]=d,t[8]=f,t[9]=p):p=t[9];let m=i===`column`?`center`:`start`,h=i===`column`?`bottom`:`right`,g;if(t[10]!==n||t[11]!==a){let e;t[13]===n?e=t[14]:(e=e=>(0,Z.jsxs)(Q.Fragment,{children:[e.separatorBefore&&(0,Z.jsx)(To,{}),(0,Z.jsxs)($o,{onSelect:()=>e.run(n),children:[(0,Z.jsx)(e.icon,{"aria-hidden":!0}),e.label]})]},e.label),t[13]=n,t[14]=e),g=a.map(e),t[10]=n,t[11]=a,t[12]=g}else g=t[12];let _;t[15]!==m||t[16]!==h||t[17]!==g?(_=(0,Z.jsx)(Wo,{align:m,side:h,className:`w-auto min-w-44 whitespace-nowrap`,children:g}),t[15]=m,t[16]=h,t[17]=g,t[18]=_):_=t[18];let v;return t[19]!==_||t[20]!==p?(v=(0,Z.jsx)(`div`,{ref:o,"data-testid":`table-cell-handle`,className:`absolute left-0 top-0 z-10 opacity-0`,children:(0,Z.jsxs)(jo,{children:[p,_]})}),t[19]=_,t[20]=p,t[21]=v):v=t[21],v}function TT(){}function ET(e){let t=(0,$.c)(18),{editor:n}=e,[r,i]=(0,Q.useState)(null),a,o;if(t[0]===n?(a=t[1],o=t[2]):(a=()=>{let e=()=>i(e=>{let t=CT(n);return e&&t&&e.columnAnchor===t.columnAnchor&&e.rowAnchor===t.rowAnchor?e:t});return e(),n.on(`selectionUpdate`,e),n.on(`update`,e),()=>{n.off(`selectionUpdate`,e),n.off(`update`,e)}},o=[n],t[0]=n,t[1]=a,t[2]=o),(0,Q.useEffect)(a,o),!r)return null;let s=r.columnAnchor,c;t[3]===r.isFirstColumn?c=t[4]:(c=xT(r.isFirstColumn),t[3]=r.isFirstColumn,t[4]=c);let l;t[5]!==r.columnAnchor||t[6]!==n||t[7]!==c?(l=(0,Z.jsx)(wT,{editor:n,anchor:s,axis:`column`,items:c}),t[5]=r.columnAnchor,t[6]=n,t[7]=c,t[8]=l):l=t[8];let u=r.rowAnchor,d;t[9]===r.isFirstRow?d=t[10]:(d=ST(r.isFirstRow),t[9]=r.isFirstRow,t[10]=d);let f;t[11]!==r.rowAnchor||t[12]!==n||t[13]!==d?(f=(0,Z.jsx)(wT,{editor:n,anchor:u,axis:`row`,items:d}),t[11]=r.rowAnchor,t[12]=n,t[13]=d,t[14]=f):f=t[14];let p;return t[15]!==l||t[16]!==f?(p=(0,Z.jsxs)(`div`,{className:`ok-table-cell-handle-layer`,children:[l,f]}),t[15]=l,t[16]=f,t[17]=p):p=t[17],p}function DT(e){let{fragment:t,docName:n}=e,r=!1,i=!1,a=!1,o=()=>{r=!0},s=e=>{console.warn(`[walk-currency] ${e} at view init — stale pre-warm cannot be invalidated: a remote edit that landed in the construct→mount gap will not render, and the first local transaction may silently erase it from the CRDT for every peer and disk (vendored y-tiptap contract change? re-verify y-tiptap.cjs:263-268)`)},c=()=>{i&&(i=!1,t.unobserveDeep(o))},l=e=>{let t=Gt.getState(e.state)?.binding;if(!t){ut.count(`ok/editor/walk-currency-disarmed`,{docName:n,reason:`no-binding`}),s(`no ySync binding on "${n}"`);return}if(typeof t._forceRerender!=`function`){ut.count(`ok/editor/walk-currency-disarmed`,{docName:n,reason:`no-force-rerender`}),s(`ySync binding on "${n}" exposes no _forceRerender`);return}ut.count(`ok/editor/pattern-d-stale-prewarm`,{docName:n}),t._forceRerender()};return ai.create({name:`walkCurrency`,onBeforeCreate(){t.observeDeep(o),i=!0},onDestroy(){c()},addProseMirrorPlugins(){return[new jr({view:e=>(a||(a=!0,c(),r&&l(e)),{})})]}})}var OT=new WeakMap;function kT(e){let t=document.createElement(`span`);t.classList.add(`collaboration-cursor__caret`),t.style.borderColor=e.color;let n=document.createElement(`div`);return n.classList.add(`collaboration-cursor__label`),n.style.backgroundColor=e.color,n.style.color=ni(e.color),n.textContent=e.name,t.append(n),t}var AT={state:`idle`,count:0,lastFiredAt:null,position:`append`,lastAgentId:null},jT=100,MT=100,NT=3,PT=250;function FT(){let e=new Vr({extensions:ti});return{mdManager:e,text:qe({mdManager:e}),html:l({mdManager:e}),paste:Ft({mdManager:e}),drop:St({mdManager:e})}}function IT(e,t){return t?{collaboration:ot.configure({document:e.document,ySyncOptions:{mapping:t}}),guard:[DT({fragment:e.document.getXmlFragment(`default`),docName:e.configuration.name??``})]}:{collaboration:ot.configure({document:e.document}),guard:[]}}function LT(e){let{provider:t,placeholder:n,prebuiltMapping:r,onWedged:i}=e,{collaboration:a,guard:o}=IT(t,r);return[...Dt.map(e=>e.name===`link`||e.name===`wikiLink`||e.name===`jsxComponent`?e.configure({docName:t.configuration.name??``}):e),zC.configure({placeholder:n??`Type '/' for commands`,showOnlyCurrent:!0}),a,ai.create({name:`imageUploadDecoration`,addProseMirrorPlugins(){return[We]}}),ai.create({name:`collaborationCursor`,addProseMirrorPlugins(){let e=t.awareness;if(!e)throw Error(`[TiptapEditor] HocuspocusProvider has no awareness instance — cursor plugin cannot initialize`);return[pt(e,{cursorBuilder:kT})]}}),ai.create({name:`bindingStalenessGuard`,addProseMirrorPlugins(){return[tw({fragment:t.document.getXmlFragment(`default`),docName:t.configuration.name??``,onWedged:i??(()=>{})})]}}),...o]}function RT(e){let{provider:t,clipboard:n,ctorStart:r}=e;return{onBeforeCreate:({editor:e})=>{OT.set(e,r)},onCreate:({editor:e})=>{n.html.setView(e.view);let r=OT.get(e);if(OT.delete(e),r==null)return;let i=performance.now();ut(`ok/editor/create-tiptap`,{docName:t.configuration.name??`unknown`,ytextLength:t.document.getText(`source`).length},{startTime:r,duration:Math.max(0,i-r)})},editorProps:{attributes:{class:`pt-4 pb-4 h-full`},clipboardTextParser:(e,t,r,i)=>{let a=n.mdManager.parse(e);return i.state.schema.nodeFromJSON(a).content},clipboardTextSerializer:(e,t)=>n.text(e,t),clipboardSerializer:n.html.serializer,handlePaste:(e,t)=>n.paste(e,t),handleDrop:yT(n.drop,e.onSidebarDrop)},extensions:vp(LT(e))}}function zT(e){let{provider:t,placeholder:n,clipboard:r,ctorStart:i,onWedged:a,onSidebarDrop:o}=e,s=t.document.getXmlFragment(`default`),c=new Map,l=RT({provider:t,placeholder:n,clipboard:r,ctorStart:i,prebuiltMapping:c,onWedged:a,onSidebarDrop:o}),u=l.onBeforeCreate;return{...l,onBeforeCreate:e=>{u?.(e);let{editor:t}=e,{doc:n,mapping:r}=ze(s,t.schema);r.forEach((e,t)=>{c.set(t,e)}),t.options.content=n.toJSON()},element:null}}var BT=e=>{let t=(0,$.c)(24),{provider:n,placeholder:r,isSourceMode:i,portalTarget:a}=e,o=(0,Q.useRef)(null),s=(0,Q.useRef)(AT),c=GC(),{principal:l,activeDocName:u,recycleDocument:d,openTarget:f}=yt(),p=n.configuration.name??``,[m]=(0,Q.useState)(FT),h;t[0]!==m||t[1]!==p||t[2]!==f||t[3]!==r||t[4]!==n||t[5]!==d?(h=()=>()=>({editor:new yi(zT({provider:n,placeholder:r,clipboard:m,ctorStart:performance.now(),onWedged:e=>{let{externalSeq:t,appliedSeq:n}=e;ut(`ok/editor/binding-wedge-recycle`,{docName:p,externalSeq:t,appliedSeq:n}),d(p)},onSidebarDrop:e=>{bT(e,f)}})),ydoc:n.document,ytext:n.document.getText(`source`),provider:n}),t[0]=m,t[1]=p,t[2]=f,t[3]=r,t[4]=n,t[5]=d,t[6]=h):h=t[6];let[g]=(0,Q.useState)(h),_,v;if(t[7]!==g||t[8]!==p||t[9]!==n.document){let e={viewCount:0,bytes:n.document.getText(`source`).length},r=ce(p)??crypto.randomUUID();_=Q.use,v=E({docName:p,mountId:r,construct:g,sizeStats:e}),t[7]=g,t[8]=p,t[9]=n.document,t[10]=_,t[11]=v}else _=t[10],v=t[11];let y=_(v),b=y.editor,x,S;t[12]===y?(x=t[13],S=t[14]):(x=()=>()=>{dt(y)},S=[y],t[12]=y,t[13]=x,t[14]=S),(0,Q.useEffect)(x,S);let C;return t[15]!==u||t[16]!==p||t[17]!==b||t[18]!==c||t[19]!==i||t[20]!==a||t[21]!==l||t[22]!==n?(C=(0,Z.jsx)(VT,{provider:n,isSourceMode:i,docName:p,activeDocName:u,identity:c,principal:l,editor:b,wrapperRef:o,flashStateRef:s,portalTarget:a}),t[15]=u,t[16]=p,t[17]=b,t[18]=c,t[19]=i,t[20]=a,t[21]=l,t[22]=n,t[23]=C):C=t[23],C},VT=e=>{let t=(0,$.c)(93),{provider:n,isSourceMode:r,docName:i,activeDocName:a,identity:o,principal:s,editor:c,wrapperRef:l,flashStateRef:u,portalTarget:d}=e,f=(0,Q.useRef)(null),p,h;t[0]===d?(p=t[1],h=t[2]):(p=()=>{let e=f.current;if(e)return e.appendChild(d),()=>{d.parentNode===e&&e.removeChild(d)}},h=[d],t[0]=d,t[1]=p,t[2]=h),(0,Q.useLayoutEffect)(p,h);let g;t[3]!==c||t[4]!==n.configuration.name?(g=()=>(vt(c,n.configuration.name??null),()=>{vt(c,null)}),t[3]=c,t[4]=n.configuration.name,t[5]=g):g=t[5];let _;t[6]!==c||t[7]!==n?(_=[c,n],t[6]=c,t[7]=n,t[8]=_):_=t[8],(0,Q.useEffect)(g,_);let v;t[9]!==c||t[10]!==n.configuration.name?(v=()=>{let e=n.configuration.name;if(e)return ye(e,c),()=>ge(e,c)},t[9]=c,t[10]=n.configuration.name,t[11]=v):v=t[11];let y;t[12]!==c||t[13]!==n?(y=[c,n],t[12]=c,t[13]=n,t[14]=y):y=t[14],(0,Q.useEffect)(v,y);let b;t[15]!==c||t[16]!==n.configuration.name?(b=()=>{let e=n.configuration.name;if(!e)return;let t=null,r=()=>{t=null,vc(e,`wysiwyg`,xc(c))},i=()=>{t&&clearTimeout(t),t=setTimeout(r,120)};return r(),c.on(`selectionUpdate`,i),c.on(`update`,i),()=>{t&&clearTimeout(t),c.off(`selectionUpdate`,i),c.off(`update`,i),vc(e,`wysiwyg`,null)}},t[15]=c,t[16]=n.configuration.name,t[17]=b):b=t[17];let x;t[18]!==c||t[19]!==n?(x=[c,n],t[18]=c,t[19]=n,t[20]=x):x=t[20],(0,Q.useEffect)(b,x);let S;t[21]!==c||t[22]!==n.configuration.name?(S=()=>{},t[21]=c,t[22]=n.configuration.name,t[23]=S):S=t[23];let w;t[24]!==c||t[25]!==n?(w=[c,n],t[24]=c,t[25]=n,t[26]=w):w=t[26],(0,Q.useEffect)(S,w);let T,E;t[27]===c?(T=t[28],E=t[29]):(T=()=>{let e=HT,t=null,n=()=>{if(t||c.isDestroyed)return;let n=_e(c);n&&(t=n.dom,t.addEventListener(`keydown`,e),t.addEventListener(`paste`,e),t.addEventListener(`drop`,e),t.addEventListener(`cut`,e))},r=()=>{t&&=(t.removeEventListener(`keydown`,e),t.removeEventListener(`paste`,e),t.removeEventListener(`drop`,e),t.removeEventListener(`cut`,e),null)};return _e(c)?n():c.on(`create`,n),()=>{c.off(`create`,n),r()}},E=[c],t[27]=c,t[28]=T,t[29]=E),(0,Q.useEffect)(T,E);let D,O;t[30]!==i||t[31]!==c?(D=()=>{let e=!1,t=()=>{if(e||c.isDestroyed||!_e(c))return;e=!0;let t=m(i)?.selection??null;if(t)try{let e=c.state.doc.content.size;if(t.type===`text`){let n=Math.max(0,Math.min(t.anchor,e)),r=Math.max(0,Math.min(t.head,e));c.commands.setTextSelection({from:n,to:r})}else{let n=Math.max(0,Math.min(t.from,e));c.commands.setNodeSelection(n)}}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(JSON.stringify({event:`ok-editor-selection-restore-failed`,docName:i,message:n})),ut(`ok/editor/selection-restore-failed`,{docName:i,message:n})}C(i)};if(_e(c)){t();return}return c.on(`create`,t),()=>{c.off(`create`,t)}},O=[c,i],t[30]=i,t[31]=c,t[32]=D,t[33]=O):(D=t[32],O=t[33]),(0,Q.useEffect)(D,O);let k,A;t[34]!==u||t[35]!==n.document||t[36]!==l?(k=()=>{let e=n.document.getMap(`agent-flash`),t=Date.now(),r=0,i=null,a=null,o=null,s=()=>{let t=null;for(let[,n]of e.entries()){let e=n;e.timestamp&&(!t||e.timestamp>t.timestamp)&&(t={agentId:e.agentId??`unknown`,timestamp:e.timestamp,type:e.type??`insert`,description:e.description})}return t},c=e=>{u.current=e;let t=l.current;t&&(t.setAttribute(`data-agent-flash-state`,e.state),t.setAttribute(`data-agent-flash-count`,String(e.count)),t.setAttribute(`data-agent-flash-position`,e.position),t.setAttribute(`data-agent-flash-agent-id`,e.lastAgentId??``))},d=()=>{let e=s(),t=e?.description?.toLowerCase().includes(`prepend`)?`prepend`:`append`,n={state:`editing`,count:(u.current?.count??0)+1,lastFiredAt:Date.now(),position:t,lastAgentId:e?.agentId??null};c(n),document.dispatchEvent(new CustomEvent(`agent-flash`,{detail:n})),a&&clearTimeout(a),o&&clearTimeout(o),a=window.setTimeout(()=>{let e={...n,state:`settled`};c(e),document.dispatchEvent(new CustomEvent(`agent-flash-end`,{detail:e})),o=window.setTimeout(()=>{c({...e,state:`idle`})},300)},ar)};c(AT);let f=()=>{if(Ci(e),!Ai(e,t)||document.visibilityState!==`visible`)return;let n=Date.now();if(t=n,n-r<500){if(!i){let e=500-(n-r);i=window.setTimeout(()=>{i=null,r=Date.now(),d()},e)}return}r=n,d()};e.observe(f);let p=()=>{document.visibilityState===`visible`?Ai(e,t)&&(t=Date.now(),r=Date.now(),d()):t=Date.now()};return document.addEventListener(`visibilitychange`,p),()=>{e.unobserve(f),document.removeEventListener(`visibilitychange`,p),i&&clearTimeout(i),a&&clearTimeout(a),o&&clearTimeout(o)}},A=[n.document,u,l],t[34]=u,t[35]=n.document,t[36]=l,t[37]=k,t[38]=A):(k=t[37],A=t[38]),(0,Q.useEffect)(k,A);let j,M;t[39]!==a||t[40]!==i||t[41]!==c||t[42]!==n?(j=()=>{let e=0,t,r=null,o=null,s=null,l=function(){if(e<jT){e+=1,t=window.setTimeout(p,MT);return}r=null,o=null,e=0},u=function(e){let t=_e(c);if(!t)return null;let n=CSS.escape(e);return t.dom.querySelector(`#${n}`)??t.dom.querySelector(`[data-mirror-source-id="${n}"]`)},d=function(e){let t=u(e);return t?(t.scrollIntoView({behavior:`smooth`,block:`start`}),!0):!1},f=function(e,n){let r=NT,o=()=>{t=void 0,!(i!==a||window.location.hash!==n)&&(d(e),--r,r>0&&(t=window.setTimeout(o,PT)))};t=window.setTimeout(o,PT)};function p(){if(!r||i!==a)return;let t=r,n=o;if(!n){l();return}d(t)?(s=n,r=null,o=null,e=0,f(t,n)):l()}let m=function(){if(i!==a)return;let n=window.location.hash;if(!r&&s===n)return;let c=Xn(n);if(!c){s=n;return}r=c,o=n,e=0,t!==void 0&&(clearTimeout(t),t=void 0),p()},h=function(){if(i===a){if(r){p();return}m()}};return m(),n.on(`synced`,h),c.on(`transaction`,h),window.addEventListener(`hashchange`,m),()=>{t!==void 0&&clearTimeout(t),n.off(`synced`,h),c.off(`transaction`,h),window.removeEventListener(`hashchange`,m)}},M=[n,c,i,a],t[39]=a,t[40]=i,t[41]=c,t[42]=n,t[43]=j,t[44]=M):(j=t[43],M=t[44]),(0,Q.useEffect)(j,M);let N,P;t[45]===c?(N=t[46],P=t[47]):(N=()=>{let e=function(e){let t=e.detail;if(!t||t.mode!==`wysiwyg`||c.isDestroyed)return;let n=_e(c);if(!n)return;let r=n.dom.querySelectorAll(`h1, h2, h3, h4, h5, h6`)[t.index];r&&r.scrollIntoView({behavior:`smooth`,block:`start`})};return window.addEventListener(hc,e),()=>window.removeEventListener(hc,e)},P=[c],t[45]=c,t[46]=N,t[47]=P),(0,Q.useEffect)(N,P);let F;t[48]!==a||t[49]!==i||t[50]!==o||t[51]!==r||t[52]!==s||t[53]!==n.awareness?(F=()=>{let e=n.awareness;if(e){if(i!==a){e.setLocalState(null);return}e.setLocalState({user:KC({principal:s,identity:o}),mode:r?`source`:`wysiwyg`})}},t[48]=a,t[49]=i,t[50]=o,t[51]=r,t[52]=s,t[53]=n.awareness,t[54]=F):F=t[54];let I;t[55]!==a||t[56]!==i||t[57]!==o||t[58]!==r||t[59]!==s||t[60]!==n?(I=[n,i,a,o,s,r],t[55]=a,t[56]=i,t[57]=o,t[58]=r,t[59]=s,t[60]=n,t[61]=I):I=t[61],(0,Q.useEffect)(F,I);let L,R;t[62]!==c||t[63]!==r?(L=()=>(wt(c,r),()=>{wt(c,!1)}),R=[c,r],t[62]=c,t[63]=r,t[64]=L,t[65]=R):(L=t[64],R=t[65]),(0,Q.useEffect)(L,R);let z;t[66]!==a||t[67]!==i||t[68]!==c||t[69]!==r?(z=!r&&(0,Z.jsx)(oT,{editor:c,shortcutEnabled:i===a}),t[66]=a,t[67]=i,t[68]=c,t[69]=r,t[70]=z):z=t[70];let B;t[71]!==c||t[72]!==r?(B=!r&&(0,Z.jsx)(ET,{editor:c}),t[71]=c,t[72]=r,t[73]=B):B=t[73];let V;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsx)(`div`,{ref:f,style:{display:`contents`}}),t[74]=V):V=t[74];let H;t[75]===c?H=t[76]:(H=(0,Z.jsx)(Xt,{editor:c,className:`tiptap-editor-portal-content h-full`}),t[75]=c,t[76]=H);let U;t[77]!==d||t[78]!==H?(U=(0,Kc.createPortal)(H,d),t[77]=d,t[78]=H,t[79]=U):U=t[79];let ee;t[80]===c?ee=t[81]:(ee=(0,Z.jsx)(UC,{editor:c}),t[80]=c,t[81]=ee);let te;t[82]===c?te=t[83]:(te=ht(c),t[82]=c,t[83]=te);let W;t[84]===te.store?W=t[85]:(W=(0,Z.jsx)(qt,{store:te.store}),t[84]=te.store,t[85]=W);let ne;return t[86]!==z||t[87]!==B||t[88]!==U||t[89]!==ee||t[90]!==W||t[91]!==l?(ne=(0,Z.jsxs)(`div`,{ref:l,className:`tiptap-editor h-full`,"data-agent-flash-state":`idle`,"data-agent-flash-count":`0`,"data-agent-flash-position":`append`,"data-agent-flash-agent-id":``,children:[z,B,V,U,ee,W]}),t[86]=z,t[87]=B,t[88]=U,t[89]=ee,t[90]=W,t[91]=l,t[92]=ne):ne=t[92],ne};function HT(){return A()}var UT=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}offset(t,n=t){return new e(this.fromA+t,this.toA+t,this.fromB+n,this.toB+n)}};function WT(e,t,n,r,i,a){if(e==r)return[];let o=eE(e,t,n,r,i,a),s=tE(e,t+o,n,r,i+o,a);t+=o,n-=s,i+=o,a-=s;let c=n-t,l=a-i;if(!c||!l)return[new UT(t,n,i,a)];if(c>l){let o=e.slice(t,n).indexOf(r.slice(i,a));if(o>-1)return[new UT(t,t+o,i,i),new UT(t+o+l,n,a,a)]}else if(l>c){let o=r.slice(i,a).indexOf(e.slice(t,n));if(o>-1)return[new UT(t,t,i,i+o),new UT(n,n,i+o+c,a)]}if(c==1||l==1)return[new UT(t,n,i,a)];let u=rE(e,t,n,r,i,a);if(u){let[o,s,c]=u;return WT(e,t,o,r,i,s).concat(WT(e,o+c,n,r,s+c,a))}return JT(e,t,n,r,i,a)}var GT=1e9,KT=0,qT=!1;function JT(e,t,n,r,i,a){let o=n-t,s=a-i;if(GT<1e9&&Math.min(o,s)>GT*16||KT>0&&Date.now()>KT)return Math.min(o,s)>GT*64?[new UT(t,n,i,a)]:iE(e,t,n,r,i,a);let c=Math.ceil((o+s)/2);XT.reset(c),ZT.reset(c);let l=(n,a)=>e.charCodeAt(t+n)==r.charCodeAt(i+a),u=(t,i)=>e.charCodeAt(n-t-1)==r.charCodeAt(a-i-1),d=(o-s)%2==0?null:ZT,f=d?null:XT;for(let p=0;p<c;p++){if(p>GT||KT>0&&!(p&63)&&Date.now()>KT)return iE(e,t,n,r,i,a);let m=XT.advance(p,o,s,c,d,!1,l)||ZT.advance(p,o,s,c,f,!0,u);if(m)return QT(e,t,n,t+m[0],r,i,a,i+m[1])}return[new UT(t,n,i,a)]}var YT=class{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let e=0;e<this.len;e++)this.vec[e]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,t,n,r,i,a,o){for(let s=-e+this.start;s<=e-this.end;s+=2){let c=r+s,l=s==-e||s!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,u=l-s;for(;l<t&&u<n&&o(l,u);)l++,u++;if(this.vec[c]=l,l>t)this.end+=2;else if(u>n)this.start+=2;else if(i){let e=r+(t-n)-s;if(e>=0&&e<this.len&&i.vec[e]!=-1)if(a){let n=i.vec[e];if(n>=t-l)return[n,r+n-e]}else{let n=t-i.vec[e];if(l>=n)return[l,u]}}}return null}},XT=new YT,ZT=new YT;function QT(e,t,n,r,i,a,o,s){let c=!1;return!yE(e,r)&&++r==n&&(c=!0),!yE(i,s)&&++s==o&&(c=!0),c?[new UT(t,n,a,o)]:WT(e,t,r,i,a,s).concat(WT(e,r,n,i,s,o))}function $T(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n<<=1;return n}function eE(e,t,n,r,i,a){if(t==n||t==a||e.charCodeAt(t)!=r.charCodeAt(i))return 0;let o=$T(n-t,a-i);for(let s=t,c=i;;){let i=s+o,l=c+o;if(i>n||l>a||e.slice(s,i)!=r.slice(c,l)){if(o==1)return s-t-+!yE(e,s);o>>=1}else if(i==n||l==a)return i-t;else s=i,c=l}}function tE(e,t,n,r,i,a){if(t==n||i==a||e.charCodeAt(n-1)!=r.charCodeAt(a-1))return 0;let o=$T(n-t,a-i);for(let s=n,c=a;;){let a=s-o,l=c-o;if(a<t||l<i||e.slice(a,s)!=r.slice(l,c)){if(o==1)return n-s-+!yE(e,s);o>>=1}else if(a==t||l==i)return n-a;else s=a,c=l}}function nE(e,t,n,r,i,a,o,s){let c=r.slice(i,a),l=null;for(;;){if(l||o<s)return l;for(let s=t+o;;){yE(e,s)||s++;let u=s+o;if(yE(e,u)||(u+=u==s+1?1:-1),u>=n)break;let d=e.slice(s,u),f=-1;for(;(f=c.indexOf(d,f+1))!=-1;){let o=eE(e,u,n,r,i+f+d.length,a),c=tE(e,t,s,r,i,i+f),p=d.length+o+c;(!l||l[2]<p)&&(l=[s-c,i+f-c,p])}s=u}if(s<0)return l;o>>=1}}function rE(e,t,n,r,i,a){let o=n-t,s=a-i;if(o<s){let o=rE(r,i,a,e,t,n);return o&&[o[1],o[0],o[2]]}return o<4||s*2<o?null:nE(e,t,n,r,i,a,Math.floor(o/4),-1)}function iE(e,t,n,r,i,a){qT=!0;let o=n-t,s=a-i,c;if(o<s){let s=nE(r,i,a,e,t,n,Math.floor(o/6),50);c=s&&[s[1],s[0],s[2]]}else c=nE(e,t,n,r,i,a,Math.floor(s/6),50);if(!c)return[new UT(t,n,i,a)];let[l,u,d]=c;return WT(e,t,l,r,i,u).concat(WT(e,l+d,n,r,u+d,a))}function aE(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n];r.toA>i.fromA-t&&r.toB>i.fromB-t&&(e[n-1]=new UT(r.fromA,i.toA,r.fromB,i.toB),e.splice(n--,1))}}function oE(e,t,n){for(;;){aE(n,1);let r=!1;for(let i=0;i<n.length;i++){let a=n[i],o,s;(o=eE(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new UT(a.fromA+o,a.toA,a.fromB+o,a.toB)),(s=tE(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new UT(a.fromA,a.toA-s,a.fromB,a.toB-s));let c=a.toA-a.fromA,l=a.toB-a.fromB;if(c&&l)continue;let u=a.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:e.length)-a.toA;if(!u||!d)continue;let f=c?e.slice(a.fromA,a.toA):t.slice(a.fromB,a.toB);u<=f.length&&e.slice(a.fromA-u,a.fromA)==f.slice(f.length-u)?(n[i]=new UT(a.fromA-u,a.toA-u,a.fromB-u,a.toB-u),r=!0):d<=f.length&&e.slice(a.toA,a.toA+d)==f.slice(0,d)&&(n[i]=new UT(a.fromA+d,a.toA+d,a.fromB+d,a.toB+d),r=!0)}if(!r)break}return n}function sE(e,t,n){for(let r=0,i=0;i<e.length;i++){let a=e[i],o=a.toA-a.fromA,s=a.toB-a.fromB;if(o&&s||o>3||s>3){let c=i==e.length-1?t.length:e[i+1].fromA,l=a.fromA-r,u=c-a.toA,d=mE(t,a.fromA,l),f=pE(t,a.toA,u),p=a.fromA-d,m=f-a.toA;if((!o||!s)&&p&&m){let l=Math.max(o,s),[u,h,g]=o?[t,a.fromA,a.toA]:[n,a.fromB,a.toB];l>p&&t.slice(d,a.fromA)==u.slice(g-p,g)?(a=e[i]=new UT(d,d+o,a.fromB-p,a.toB-p),d=a.fromA,f=pE(t,a.toA,c-a.toA)):l>m&&t.slice(a.toA,f)==u.slice(h,h+m)&&(a=e[i]=new UT(f-o,f,a.fromB+m,a.toB+m),f=a.toA,d=mE(t,a.fromA,a.fromA-r)),p=a.fromA-d,m=f-a.toA}if(p||m)a=e[i]=new UT(a.fromA-p,a.toA+m,a.fromB-p,a.toB+m);else if(!o){let t=gE(n,a.fromB,a.toB),r,o=t<0?-1:hE(n,a.toB,a.fromB);t>-1&&(r=t-a.fromB)<=u&&n.slice(a.fromB,t)==n.slice(a.toB,a.toB+r)?a=e[i]=a.offset(r):o>-1&&(r=a.toB-o)<=l&&n.slice(a.fromB-r,a.fromB)==n.slice(o,a.toB)&&(a=e[i]=a.offset(-r))}else if(!s){let n=gE(t,a.fromA,a.toA),r,o=n<0?-1:hE(t,a.toA,a.fromA);n>-1&&(r=n-a.fromA)<=u&&t.slice(a.fromA,n)==t.slice(a.toA,a.toA+r)?a=e[i]=a.offset(r):o>-1&&(r=a.toA-o)<=l&&t.slice(a.fromA-r,a.fromA)==t.slice(o,a.toA)&&(a=e[i]=a.offset(-r))}}r=a.toA}return aE(e,3),e}var cE;try{cE=RegExp(`[\\p{Alphabetic}\\p{Number}]`,`u`)}catch{}function lE(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function uE(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?+!!lE(n):cE?!_E(n)||t==e.length-1?+!!cE.test(String.fromCharCode(n)):cE.test(e.slice(t,t+2))?2:0:0}function dE(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?+!!lE(n):cE?!vE(n)||t==1?+!!cE.test(String.fromCharCode(n)):cE.test(e.slice(t-2,t))?2:0:0}var fE=8;function pE(e,t,n){if(t==e.length||!dE(e,t))return t;for(let r=t,i=t+n,a=0;a<fE;a++){let t=uE(e,r);if(!t||r+t>i)return r;r+=t}return t}function mE(e,t,n){if(!t||!uE(e,t))return t;for(let r=t,i=t-n,a=0;a<fE;a++){let t=dE(e,r);if(!t||r-t<i)return r;r-=t}return t}function hE(e,t,n){for(;t!=n;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function gE(e,t,n){for(;t!=n;t++)if(e.charCodeAt(t)==10)return t;return-1}var _E=e=>e>=55296&&e<=56319,vE=e=>e>=56320&&e<=57343;function yE(e,t){return!t||t==e.length||!_E(e.charCodeAt(t-1))||!vE(e.charCodeAt(t))}function bE(e,t,n){let r=n?.override;return r?r(e,t):(GT=(n?.scanLimit??1e9)>>1,KT=n?.timeout?Date.now()+n.timeout:0,qT=!1,oE(e,t,WT(e,0,e.length,t,0,t.length)))}function xE(){return!qT}function SE(e,t,n){return sE(bE(e,t,n),e,t)}var CE=tc.define({combine:e=>e[0]}),wE=nc.define(),TE=tc.define(),EE=Xs.define({create(e){return null},update(e,t){for(let n of t.effects)n.is(wE)&&(e=n.value);for(let n of t.state.facet(TE))e=n(e,t);return e}});function DE(e){let t=e.field(EE,!1);if(!t)return null;let n=e.facet(CE);return{chunks:t,side:n?n.side:null}}var OE=class e{constructor(e,t,n,r,i,a=!0){this.changes=e,this.fromA=t,this.toA=n,this.fromB=r,this.toB=i,this.precise=a}offset(t,n){return t||n?new e(this.changes,this.fromA+t,this.toA+t,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,t,n){return jE(SE(e.toString(),t.toString(),n),e,t,0,0,xE())}static updateA(e,t,n,r,i){return FE(PE(e,r,!0,n.length),e,t,n,i)}static updateB(e,t,n,r,i){return FE(PE(e,r,!1,t.length),e,t,n,i)}};function kE(e,t,n,r){let i=n.lineAt(e),a=r.lineAt(t);return i.to==e&&a.to==t&&e<n.length&&t<r.length?[e+1,t+1]:[i.from,a.from]}function AE(e,t,n,r){let i=n.lineAt(e),a=r.lineAt(t);return i.from==e&&a.from==t?[e,t]:[i.to+1,a.to+1]}function jE(e,t,n,r,i,a){let o=[];for(let s=0;s<e.length;s++){let c=e[s],[l,u]=kE(c.fromA+r,c.fromB+i,t,n),[d,f]=AE(c.toA+r,c.toB+i,t,n),p=[c.offset(-l+r,-u+i)];for(;s<e.length-1;){let a=e[s+1],[o,c]=kE(a.fromA+r,a.fromB+i,t,n);if(o>d+1&&c>f+1)break;p.push(a.offset(-l+r,-u+i)),[d,f]=AE(a.toA+r,a.toB+i,t,n),s++}o.push(new OE(p,l,Math.max(l,d),u,Math.max(u,f),a))}return o}var ME=1e3;function NE(e,t,n,r){let i=0,a=e.length;for(;;){if(i==a){let r=0,a=0;i&&({toA:r,toB:a}=e[i-1]);let o=t-(n?r:a);return[r+o,a+o]}let o=i+a>>1,s=e[o],[c,l]=n?[s.fromA,s.toA]:[s.fromB,s.toB];if(c>t)a=o;else if(l<=t)i=o+1;else return r?[s.fromA,s.fromB]:[s.toA,s.toB]}}function PE(e,t,n,r){let i=[];return t.iterChangedRanges((a,o,s,c)=>{let l=0,u=n?t.length:r,d=0,f=n?r:t.length;a>ME&&([l,d]=NE(e,a-ME,n,!0)),o<t.length-ME&&([u,f]=NE(e,o+ME,n,!1));let p=c-s-(o-a),m,[h,g]=n?[p,0]:[0,p];i.length&&(m=i[i.length-1]).toA>=l?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:u,toB:f,diffA:m.diffA+h,diffB:m.diffB+g}:i.push({fromA:l,toA:u,fromB:d,toB:f,diffA:h,diffB:g})}),i}function FE(e,t,n,r,i){if(!e.length)return t;let a=[];for(let o=0,s=0,c=0,l=0;;o++){let u=o==e.length?null:e[o],d=u?u.fromA+s:n.length,f=u?u.fromB+c:r.length;for(;l<t.length;){let e=t[l];if(u&&(e.toA+s>d||e.toB+c>f))break;a.push(e.offset(s,c)),l++}if(!u)break;let p=u.toA+s+u.diffA,m=u.toB+c+u.diffB,h=SE(n.sliceString(d,p),r.sliceString(f,m),i);for(let e of jE(h,n,r,d,f,xE()))a.push(e);for(s+=u.diffA,c+=u.diffB;l<t.length;){let e=t[l];if(e.fromA+s>p&&e.fromB+c>m)break;l++}}return a}var IE={scanLimit:500},LE=rc.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=qE(e))}update(e){(e.docChanged||e.viewportChanged||zE(e.startState,e.state)||BE(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=qE(e.view))}},{decorations:e=>e.deco}),RE=qs.low(sc({class:`cm-changeGutter`,markers:e=>e.plugin(LE)?.gutter||uc.empty}));function zE(e,t){return e.field(EE,!1)!=t.field(EE,!1)}function BE(e,t){return e.facet(CE)!=t.facet(CE)}var VE=$s.line({class:`cm-changedLine`}),HE=$s.mark({class:`cm-changedText`}),UE=$s.mark({tagName:`ins`,class:`cm-insertedLine`}),WE=$s.mark({tagName:`del`,class:`cm-deletedLine`}),GE=new class extends oc{constructor(){super(...arguments),this.elementClass=`cm-changedLineGutter`}};function KE(e,t,n,r,i,a){let o=n?e.fromA:e.fromB,s=n?e.toA:e.toB,c=0;if(o!=s){i.add(o,o,VE),i.add(o,s,n?WE:UE),a&&a.add(o,o,GE);for(let l=t.iterRange(o,s-1),u=o;!l.next().done;){if(l.lineBreak){u++,i.add(u,u,VE),a&&a.add(u,u,GE);continue}let t=u+l.value.length;if(r)for(;c<e.changes.length;){let r=e.changes[c],a=o+(n?r.fromA:r.fromB),s=o+(n?r.toA:r.toB),l=Math.max(u,a),d=Math.min(t,s);if(l<d&&i.add(l,d,HE),s<t)c++;else break}u=t}}}function qE(e){let t=e.state.field(EE),{side:n,highlightChanges:r,markGutter:i,overrideChunk:a}=e.state.facet(CE),o=n==`a`,s=new ec,c=i?new ec:null,{from:l,to:u}=e.viewport;for(let n of t){if((o?n.fromA:n.fromB)>=u)break;(o?n.toA:n.toB)>l&&(!a||!a(e.state,n,s,c))&&KE(n,e.state.doc,o,r,s,c)}return{deco:s.finish(),gutter:c&&c.finish()}}var JE=class extends Ks{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement(`div`);return e.className=`cm-mergeSpacer`,e.style.height=this.height+`px`,e}updateDOM(e){return e.style.height=this.height+`px`,!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},YE=nc.define({map:(e,t)=>e.map(t)}),XE=Xs.define({create:()=>$s.none,update:(e,t)=>{for(let e of t.effects)if(e.is(YE))return e.value;return e.map(t.changes)},provide:e=>ac.decorations.from(e)}),ZE=.01;function QE(e,t){if(e.size!=t.size)return!1;let n=e.iter(),r=t.iter();for(;n.value;){if(n.from!=r.from||Math.abs(n.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;n.next(),r.next()}return!0}function $E(e,t,n){let r=new ec,i=new ec,a=e.state.field(XE).iter(),o=t.state.field(XE).iter(),s=0,c=0,l=0,u=0,d=e.viewport,f=t.viewport;for(let p=0;;p++){let m=p<n.length?n[p]:null,h=m?m.fromA:e.state.doc.length,g=m?m.fromB:t.state.doc.length;if(s<h){let n=e.lineBlockAt(s).top+l-(t.lineBlockAt(c).top+u);n<-ZE?(l-=n,r.add(s,s,$s.widget({widget:new JE(-n),block:!0,side:-1}))):n>ZE&&(u+=n,i.add(c,c,$s.widget({widget:new JE(n),block:!0,side:-1})))}if(h>s+1e3&&s<d.from&&h>d.from&&c<f.from&&g>f.from){let e=Math.min(d.from-s,f.from-c);s+=e,c+=e,p--}else if(m)s=m.toA,c=m.toB;else break;for(;a.value&&a.from<s;)l-=a.value.spec.widget.height,a.next();for(;o.value&&o.from<c;)u-=o.value.spec.widget.height,o.next()}for(;a.value;)l-=a.value.spec.widget.height,a.next();for(;o.value;)u-=o.value.spec.widget.height,o.next();let p=e.contentHeight+l-(t.contentHeight+u);p<ZE?r.add(e.state.doc.length,e.state.doc.length,$s.widget({widget:new JE(-p),block:!0,side:1})):p>ZE&&i.add(t.state.doc.length,t.state.doc.length,$s.widget({widget:new JE(p),block:!0,side:1}));let m=r.finish(),h=i.finish();QE(m,e.state.field(XE))||e.dispatch({effects:YE.of(m)}),QE(h,t.state.field(XE))||t.dispatch({effects:YE.of(h)})}var eD=nc.define({map:(e,t)=>t.mapPos(e)}),tD=class extends Ks{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let t=document.createElement(`div`);return t.className=`cm-collapsedLines`,t.textContent=e.state.phrase(`$ unchanged lines`,this.lines),t.addEventListener(`click`,t=>{let n=e.posAtDOM(t.target);e.dispatch({effects:eD.of(n)});let{side:r,sibling:i}=e.state.facet(CE);i&&i().dispatch({effects:eD.of(nD(n,e.state.field(EE),r==`a`))})}),t}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return`collapsed-unchanged-code`}};function nD(e,t,n){let r=0,i=0;for(let a=0;;a++){let o=a<t.length?t[a]:null;if(!o||(n?o.fromA:o.fromB)>=e)return i+(e-r);[r,i]=n?[o.toA,o.toB]:[o.toB,o.toA]}}var rD=Xs.define({create(e){return $s.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(eD)&&(e=e.update({filter:e=>e!=n.value}));return e},provide:e=>ac.decorations.from(e)});function iD({margin:e=3,minSize:t=4}){return rD.init(n=>aD(n,e,t))}function aD(e,t,n){let r=new ec,i=e.facet(CE).side==`a`,a=e.field(EE),o=1;for(let s=0;;s++){let c=s<a.length?a[s]:null,l=s?o+t:1,u=c?e.doc.lineAt(i?c.fromA:c.fromB).number-1-t:e.doc.lines,d=u-l+1;if(d>=n&&r.add(e.doc.line(l).from,e.doc.line(u).to,$s.replace({widget:new tD(d),block:!0})),!c)break;o=e.doc.lineAt(Math.min(e.doc.length,i?c.toA:c.toB)).number}return r.finish()}var oD=ac.styleModule.of(new cc({".cm-mergeView":{overflowY:`auto`},".cm-mergeViewEditors":{display:`flex`,alignItems:`stretch`},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:`hidden`},".cm-merge-revert":{width:`1.6em`,flexGrow:0,flexShrink:0,position:`relative`},".cm-merge-revert button":{position:`absolute`,display:`block`,width:`100%`,boxSizing:`border-box`,textAlign:`center`,background:`none`,border:`none`,font:`inherit`,cursor:`pointer`}})),sD=ac.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:`auto !important`,overflowY:`visible !important`},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:`rgba(160, 128, 100, .08)`},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:`rgba(100, 160, 128, .08)`},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:`linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat`},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:`linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat`},"&light.cm-merge-b .cm-changedText":{background:`linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat`},"&dark.cm-merge-b .cm-changedText":{background:`linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat`},"&.cm-merge-b .cm-deletedText":{background:`#ff000033`},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:`none`},".cm-deletedChunk":{paddingLeft:`6px`,"& .cm-chunkButtons":{position:`absolute`,insetInlineEnd:`5px`},"& button":{border:`none`,cursor:`pointer`,color:`white`,margin:`0 2px`,borderRadius:`3px`,"&[name=accept]":{background:`#2a2`},"&[name=reject]":{background:`#d43`}}},".cm-collapsedLines":{padding:`5px 5px 5px 10px`,cursor:`pointer`,"&:before":{content:`"⦚"`,marginInlineEnd:`7px`},"&:after":{content:`"⦚"`,marginInlineStart:`7px`}},"&light .cm-collapsedLines":{color:`#444`,background:`linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)`},"&dark .cm-collapsedLines":{color:`#ddd`,background:`linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)`},".cm-changeGutter":{width:`3px`,paddingLeft:`1px`},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:`#e43`},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:`#fa9`},"&light.cm-merge-b .cm-changedLineGutter":{background:`#2b2`},"&dark.cm-merge-b .cm-changedLineGutter":{background:`#8f8`},".cm-inlineChangedLineGutter":{background:`#75d`}}),cD=new ic,lD=new ic,uD=class{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||IE;let t=[qs.low(LE),sD,oD,XE,ac.updateListener.of(e=>{this.measuring<0&&(e.heightChanged||e.viewportChanged)&&!e.transactions.some(e=>e.effects.some(e=>e.is(YE)))&&this.measure()})],n=[CE.of({side:`a`,sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&n.push(RE);let r=Ys.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],ac.editorAttributes.of({class:`cm-merge-a`}),lD.of(n),t]}),i=[CE.of({side:`b`,sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(RE);let a=Ys.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],ac.editorAttributes.of({class:`cm-merge-b`}),lD.of(i),t]});this.chunks=OE.build(r.doc,a.doc,this.diffConf);let o=[EE.init(()=>this.chunks),cD.of(e.collapseUnchanged?iD(e.collapseUnchanged):[])];r=r.update({effects:nc.appendConfig.of(o)}).state,a=a.update({effects:nc.appendConfig.of(o)}).state,this.dom=document.createElement(`div`),this.dom.className=`cm-mergeView`,this.editorDOM=this.dom.appendChild(document.createElement(`div`)),this.editorDOM.className=`cm-mergeViewEditors`;let s=e.orientation||`a-b`,c=document.createElement(`div`);c.className=`cm-mergeViewEditor`;let l=document.createElement(`div`);l.className=`cm-mergeViewEditor`,this.editorDOM.appendChild(s==`a-b`?c:l),this.editorDOM.appendChild(s==`a-b`?l:c),this.a=new ac({state:r,parent:c,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.a)}),this.b=new ac({state:a,parent:l,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls==`b-to-a`,e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,t){if(e.some(e=>e.docChanged)){let n=e[e.length-1],r=e.reduce((e,t)=>e.compose(t.changes),Js.empty(e[0].startState.doc.length));this.chunks=t==this.a?OE.updateA(this.chunks,n.newDoc,this.b.state.doc,r,this.diffConf):OE.updateB(this.chunks,this.a.state.doc,n.newDoc,r,this.diffConf),t.update([...e,n.state.update({effects:wE.of(this.chunks)})]);let i=t==this.a?this.b:this.a;i.update([i.state.update({effects:wE.of(this.chunks)})]),this.scheduleMeasure()}else t.update(e)}reconfigure(e){if(`diffConfig`in e&&(this.diffConf=e.diffConfig),`orientation`in e){let t=e.orientation!=`b-a`;if(t!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let e=this.a.dom.parentNode,n=this.b.dom.parentNode;e.remove(),n.remove(),this.editorDOM.insertBefore(t?e:n,this.editorDOM.firstChild),this.editorDOM.appendChild(t?n:e),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent=``)}}if(`revertControls`in e||`renderRevertControl`in e){let t=!!this.revertDOM,n=this.revertToA,r=this.renderRevert;`revertControls`in e&&(t=!!e.revertControls,n=e.revertControls==`b-to-a`),`renderRevertControl`in e&&(r=e.renderRevertControl),this.setupRevertControls(t,n,r)}let t=`highlightChanges`in e,n=`gutter`in e,r=`collapseUnchanged`in e;if(t||n||r){let i=[],a=[];if(t||n){let r=this.a.state.facet(CE),o=n?e.gutter!==!1:r.markGutter,s=t?e.highlightChanges!==!1:r.highlightChanges;i.push(lD.reconfigure([CE.of({side:`a`,sibling:()=>this.b,highlightChanges:s,markGutter:o}),o?RE:[]])),a.push(lD.reconfigure([CE.of({side:`b`,sibling:()=>this.a,highlightChanges:s,markGutter:o}),o?RE:[]]))}if(r){let t=cD.reconfigure(e.collapseUnchanged?iD(e.collapseUnchanged):[]);i.push(t),a.push(t)}this.a.dispatch({effects:i}),this.b.dispatch({effects:a})}this.scheduleMeasure()}setupRevertControls(e,t,n){this.revertToA=t,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=n,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement(`div`),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener(`mousedown`,e=>this.revertClicked(e)),this.revertDOM.className=`cm-merge-revert`):this.revertDOM&&(this.revertDOM.textContent=``)}scheduleMeasure(){this.measuring<0&&(this.measuring=(this.dom.ownerDocument.defaultView||window).requestAnimationFrame(()=>{this.measuring=-1,this.measure()}))}measure(){$E(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,t=e.firstChild,n=this.a.viewport,r=this.b.viewport;for(let i=0;i<this.chunks.length;i++){let a=this.chunks[i];if(a.fromA>n.to||a.fromB>r.to)break;if(a.fromA<n.from||a.fromB<r.from)continue;let o=this.a.lineBlockAt(a.fromA).top+`px`;for(;t&&+t.dataset.chunk<i;)t=dD(t);t&&t.dataset.chunk==String(i)?(t.style.top!=o&&(t.style.top=o),t=t.nextSibling):e.insertBefore(this.renderRevertButton(o,i),t)}for(;t;)t=dD(t)}renderRevertButton(e,t){let n;if(this.renderRevert)n=this.renderRevert();else{n=document.createElement(`button`);let e=this.a.state.phrase(`Revert this chunk`);n.setAttribute(`aria-label`,e),n.setAttribute(`title`,e),n.textContent=this.revertToLeft?`⇜`:`⇝`}return n.style.top=e,n.setAttribute(`data-chunk`,String(t)),n}revertClicked(e){let t=e.target,n;for(;t&&t.parentNode!=this.revertDOM;)t=t.parentNode;if(t&&(n=this.chunks[t.dataset.chunk])){let[t,r,i,a,o,s]=this.revertToA?[this.b,this.a,n.fromB,n.toB,n.fromA,n.toA]:[this.a,this.b,n.fromA,n.toA,n.fromB,n.toB],c=t.state.sliceDoc(i,Math.max(i,a-1));i!=a&&s<=r.state.doc.length&&(c+=t.state.lineBreak),r.dispatch({changes:{from:o,to:Math.min(r.state.doc.length,s),insert:c},userEvent:`revert`}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}};function dD(e){let t=e.nextSibling;return e.remove(),t}var fD=new class extends oc{constructor(){super(...arguments),this.elementClass=`cm-deletedLineGutter`}},pD=qs.low(sc({class:`cm-changeGutter`,markers:e=>e.plugin(LE)?.gutter||uc.empty,widgetMarker:(e,t)=>t instanceof vD?fD:null}));function mD(e){let t=typeof e.original==`string`?Qs.of(e.original.split(/\r?\n/)):e.original,n=e.diffConfig||IE;return[qs.low(LE),CD,sD,ac.editorAttributes.of({class:`cm-merge-b`}),TE.of((e,t)=>{let r=t.effects.find(e=>e.is(hD));return r&&(e=OE.updateA(e,r.value.doc,t.startState.doc,r.value.changes,n)),t.docChanged&&(e=OE.updateB(e,t.state.field(gD),t.newDoc,t.changes,n)),e}),CE.of({highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1,syntaxHighlightDeletions:e.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:e.mergeControls??!0,overrideChunk:e.allowInlineDiffs?kD:void 0,side:`b`}),gD.init(()=>t),e.gutter===!1?[]:pD,e.collapseUnchanged?iD(e.collapseUnchanged):[],EE.init(e=>OE.build(t,e.doc,n))]}var hD=nc.define(),gD=Xs.define({create:()=>Qs.empty,update(e,t){for(let n of t.effects)n.is(hD)&&(e=n.value.doc);return e}}),_D=new WeakMap,vD=class extends Ks{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||=this.buildDOM(e)}};function yD(e,t,n){let r=_D.get(t.changes);if(r)return r;let i=$s.widget({block:!0,side:-1,widget:new vD(r=>{let{highlightChanges:i,syntaxHighlightDeletions:a,syntaxHighlightDeletionsMaxLength:o,mergeControls:s}=e.facet(CE),c=document.createElement(`div`);if(c.className=`cm-deletedChunk`,s){let t=c.appendChild(document.createElement(`div`));t.className=`cm-chunkButtons`;let n=e=>{e.preventDefault(),bD(r,r.posAtDOM(c))},i=e=>{e.preventDefault(),xD(r,r.posAtDOM(c))};if(typeof s==`function`)t.appendChild(s(`accept`,n)),t.appendChild(s(`reject`,i));else{let r=t.appendChild(document.createElement(`button`));r.name=`accept`,r.textContent=e.phrase(`Accept`),r.onmousedown=n;let a=t.appendChild(document.createElement(`button`));a.name=`reject`,a.textContent=e.phrase(`Reject`),a.onmousedown=i}}if(n||t.fromA>=t.toA)return c;let l=r.state.field(gD).sliceString(t.fromA,t.endA),u=a&&e.facet(dc),d=h(),f=t.changes,p=0,m=!1;function h(){let e=c.appendChild(document.createElement(`div`));return e.className=`cm-deletedLine`,e.appendChild(document.createElement(`del`))}function g(e,t,n){for(let r=e;r<t;){if(l.charAt(r)==`
27
27
  `){d.firstChild||d.appendChild(document.createElement(`br`)),d=h(),r++;continue}let e=t,a=n+(m?` cm-deletedText`:``),o=!1,s=l.indexOf(`
28
- `,r);if(s>-1&&s<t&&(e=s),i&&p<f.length){let t=Math.max(0,m?f[p].toA:f[p].fromA);t<=e&&(e=t,m&&p++,o=!0)}if(e>r){let t=document.createTextNode(l.slice(r,e));if(a){let e=d.appendChild(document.createElement(`span`));e.className=a,e.appendChild(t)}else d.appendChild(t);r=e}o&&(m=!m)}}if(u&&t.toA-t.fromA<=o){let t=u.parser.parse(l),n=0;Zs(t,{style:t=>fc(e,t)},(e,t,r)=>{e>n&&g(n,e,``),g(e,t,r),n=t}),g(n,l.length,``)}else g(0,l.length,``);return d.firstChild||d.appendChild(document.createElement(`br`)),c})});return _D.set(t.changes,i),i}function bD(e,t){let{state:n}=e,r=t??n.selection.main.head,i=e.state.field(EE).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=e.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),o=e.state.field(gD);i.fromB!=i.toB&&i.toA<=o.length&&(a+=e.state.lineBreak);let s=Js.of({from:i.fromA,to:Math.min(o.length,i.toA),insert:a},o.length);return e.dispatch({effects:hD.of({doc:s.apply(o),changes:s}),userEvent:`accept`}),!0}function xD(e,t){let{state:n}=e,r=t??n.selection.main.head,i=n.field(EE).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=n.field(gD).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=n.doc.length&&(a+=n.lineBreak),e.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:a},userEvent:`revert`}),!0}function SD(e){let t=new ec;for(let n of e.field(EE)){let r=e.facet(CE).overrideChunk&&TD(e,n);t.add(n.fromB,n.fromB,yD(e,n,!!r))}return t.finish()}var CD=Xs.define({create:e=>SD(e),update(e,t){return t.state.field(EE,!1)==t.startState.field(EE,!1)?e:SD(t.state)},provide:e=>ac.decorations.from(e)}),wD=new WeakMap;function TD(e,t){let n=wD.get(t);if(n!==void 0)return n;n=null;let r=e.field(gD),i=e.doc,a=r.lineAt(t.endA).number-r.lineAt(t.fromA).number+1,o=i.lineAt(t.endB).number-i.lineAt(t.fromB).number+1;abort:if(a==o&&a<10){let e=[],i=0,o=t.fromA,s=t.fromB;for(let n of t.changes){if(n.fromA<n.toA){i+=n.toA-n.fromA;let t=r.sliceString(o+n.fromA,o+n.toA);if(/\n/.test(t))break abort;e.push($s.widget({widget:new ED(t),side:-1}).range(s+n.fromB))}n.fromB<n.toB&&e.push(HE.range(s+n.fromB,s+n.toB))}i<t.endA-t.fromA-a*2&&(n=e)}return wD.set(t,n),n}var ED=class extends Ks{constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let t=document.createElement(`del`);return t.className=`cm-deletedText`,t.textContent=this.text,t}},DD=new class extends oc{constructor(){super(...arguments),this.elementClass=`cm-inlineChangedLineGutter`}},OD=$s.line({class:`cm-inlineChangedLine`});function kD(e,t,n,r){let i=TD(e,t),a=0;if(!i)return!1;for(let o=e.doc.lineAt(t.fromB);;){for(r&&r.add(o.from,o.from,DD),n.add(o.from,o.from,OD);a<i.length&&i[a].to<=o.to;){let e=i[a++];n.add(e.from,e.to,e.value)}if(o.to>=t.endB)break;o=e.doc.lineAt(o.to+1)}return!0}var AD=h({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),jD=an({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),MD=ac.theme({".cm-deletedChunk .cm-chunkButtons":{display:`flex`,gap:`0.25rem`},".cm-deletedChunk .cm-chunkButtons button[data-slot='button']":{margin:`0`,border:`1px solid transparent`,borderRadius:`min(var(--radius-md), 10px)`,color:`var(--primary-foreground)`},".cm-deletedChunk .cm-chunkButtons button[data-slot='button'][data-variant='destructive']":{color:`var(--destructive)`}});function ND({addControl:e,nextId:t,removeControl:n,root:r}){return(i,a)=>{let o=document.createElement(`span`);o.className=`inline-flex`;let s=t();return e({id:s,host:o,type:i,action:a}),queueMicrotask(()=>{r.contains(o)||n(s)}),o}}function PD(e){let t=(0,$.c)(32),{oldContent:n,newContent:r,layout:a,conflictMode:o,previewMode:c,oursOverride:l,onResolve:u,onAbort:d}=e,{_:f}=i(),p=l??r,m=(0,Q.useRef)(null),h=(0,Q.useRef)(null),g=(0,Q.useRef)(0),{resolvedTheme:_}=Li(),v=(0,Q.useRef)(u),y=(0,Q.useRef)(d),[b,x]=(0,Q.useState)(null),S;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(S=[],t[0]=S):S=t[0];let[C,w]=(0,Q.useState)(S),T;t[1]!==d||t[2]!==u?(T=()=>{v.current=u,y.current=d},t[1]=d,t[2]=u,t[3]=T):T=t[3],(0,Q.useEffect)(T);let E,D;t[4]!==o||t[5]!==p||t[6]!==a||t[7]!==n||t[8]!==c||t[9]!==_?(E=()=>{let e=m.current;if(!e)return;w([]);let t=new Map,r=!1,i=e=>{r||!t.delete(e)||w(t=>t.filter(t=>t.id!==e))},s=new MutationObserver(()=>{for(let[n,r]of t)e.contains(r)||i(n)});s.observe(e,{childList:!0,subtree:!0});let l=_===`dark`?AD:jD,u=[ac.editable.of(!1),Ys.readOnly.of(!0)],d=[Tc,R(),...u,l,ac.lineWrapping];if(h.current&&=(h.current.destroy(),null),c)h.current=new ac({doc:p,extensions:d,parent:e}),x(null);else if(o){let a=ND({addControl:e=>{r||(t.set(e.id,e.host),w(t=>[...t,e]))},nextId:()=>(g.current+=1,g.current),removeControl:i,root:e}),o=new ac({doc:p,extensions:[Tc,R(),ac.editable.of(!1),l,MD,ac.lineWrapping,mD({original:n,highlightChanges:!0,gutter:!0,mergeControls:a,collapseUnchanged:{margin:3,minSize:4}}),ac.updateListener.of(e=>{let t=DE(e.state);x(t?t.chunks.length:0)})],parent:e});h.current=o;let s=DE(o.state);x(s?s.chunks.length:0)}else a===`split`?h.current=new uD({a:{doc:n,extensions:d},b:{doc:p,extensions:d},parent:e,highlightChanges:!0,gutter:!0,collapseUnchanged:{margin:3,minSize:4}}):h.current=new ac({doc:p,extensions:[...d,mD({original:n,highlightChanges:!0,gutter:!0,mergeControls:!1,collapseUnchanged:{margin:3,minSize:4}})],parent:e});return()=>{r=!0,s.disconnect(),h.current&&=(h.current.destroy(),null)}},D=[n,p,a,_,o,c],t[4]=o,t[5]=p,t[6]=a,t[7]=n,t[8]=c,t[9]=_,t[10]=E,t[11]=D):(E=t[10],D=t[11]),(0,Q.useEffect)(E,D);let O;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(O=function(){let e=h.current;!e||!(e instanceof ac)||v.current?.(e.state.doc.toString())},t[12]=O):O=t[12];let k=O,A;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(){let e=h.current;!e||!(e instanceof ac)||De(e)},t[13]=A):A=t[13];let j=A,M=b===0,N;t[14]!==f||t[15]!==b?(N=b===null?``:b===0?f({id:`lPzyrU`}):Y._({id:`8FqTCr`,values:{chunksRemaining:b}}),t[14]=f,t[15]=b,t[16]=N):N=t[16];let P=N,F;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(`div`,{ref:m,className:`diff-view min-h-0 flex-1 overflow-y-auto subtle-scrollbar`}),t[17]=F):F=t[17];let I;if(t[18]!==f||t[19]!==C){let e;t[21]===f?e=t[22]:(e=e=>(0,Kc.createPortal)((0,Z.jsx)(sa,{type:`button`,variant:e.type===`accept`?`default`:`destructive`,size:`xs`,onClick:t=>{e.action(t.nativeEvent)},children:e.type===`accept`?f({id:`g3UF2V`}):f({id:`1t_NnN`})}),e.host,e.id),t[21]=f,t[22]=e),I=C.map(e),t[18]=f,t[19]=C,t[20]=I}else I=t[20];let L;t[23]!==M||t[24]!==o||t[25]!==P||t[26]!==d||t[27]!==u?(L=o&&(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-2 border-t shrink-0`,children:[(0,Z.jsx)(`span`,{className:`text-xs ${M?`text-emerald-600 dark:text-emerald-400`:`text-muted-foreground`}`,children:P}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[d&&(0,Z.jsx)(sa,{className:`uppercase font-mono`,variant:`ghost`,size:`sm`,onClick:d,children:(0,Z.jsx)(s,{id:`XyOUTJ`})}),(0,Z.jsx)(sa,{className:`uppercase font-mono`,variant:`outline`,size:`sm`,onClick:j,children:`Undo`}),u&&(0,Z.jsx)(sa,{variant:`default`,size:`sm`,disabled:!M,onClick:k,children:(0,Z.jsx)(s,{id:`Lcehxn`})})]})]}),t[23]=M,t[24]=o,t[25]=P,t[26]=d,t[27]=u,t[28]=L):L=t[28];let z;return t[29]!==L||t[30]!==I?(z=(0,Z.jsxs)(`div`,{className:`flex flex-col h-full`,children:[F,I,L]}),t[29]=L,t[30]=I,t[31]=z):z=t[31],z}async function FD(e,t,n){try{let r={file:e,strategy:t};n!==void 0&&(r.content=n);let i=await fetch(`/api/sync/resolve-conflict`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)});if(i.ok)return{ok:!0};let a;try{let e=await i.json();typeof e.detail==`string`?a=e.detail:typeof e.title==`string`&&(a=e.title)}catch{}return{ok:!1,detail:a}}catch(n){let r=n instanceof Error?n.message:String(n);return console.warn(JSON.stringify({event:`conflict-resolve-dispatch-failed`,file:e,strategy:t,detail:r})),{ok:!1,detail:r}}}async function ID(e,t){return FD(e,`content`,t)}async function LD(e){return FD(e,`mine`)}async function RD(e){return FD(e,`theirs`)}async function zD(e){return FD(e,`delete`)}async function BD(e){try{let t=await fetch(`/api/sync/conflict-content?file=${encodeURIComponent(e)}&source=ytext`);if(!t.ok){let n;try{let e=await t.json();typeof e.detail==`string`?n=e.detail:typeof e.title==`string`&&(n=e.title)}catch{}return console.warn(JSON.stringify({event:`conflict-content-fetch-failed`,file:e,status:t.status,detail:n})),null}let n=await t.json(),r=n.kind===`delete-modify`||n.kind===`modify-delete`||n.kind===`both-modified`?n.kind:`both-modified`;return n.kind!==r&&console.warn(JSON.stringify({event:`conflict-kind-missing-fallback`,file:e,receivedKind:n.kind??null})),{base:n.base??``,ours:n.ours??``,theirs:n.theirs??``,kind:r}}catch(t){return console.warn(JSON.stringify({event:`conflict-content-fetch-failed`,file:e,status:null,detail:t instanceof Error?t.message:String(t)})),null}}function VD(e){let t=(0,$.c)(84),{docName:n}=e,{_:r}=i(),{conflicts:a,loading:o}=lo(),c;if(t[0]!==a||t[1]!==n){let e;t[3]===n?e=t[4]:(e=e=>di(e.file)===n,t[3]=n,t[4]=e),c=a.find(e),t[0]=a,t[1]=n,t[2]=c}else c=t[2];let l=c,u=l?.file??`${n}.md`,[d,f]=(0,Q.useState)(null),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(!1),_,v;t[5]===n?(_=t[6],v=t[7]):(_=()=>(console.warn(JSON.stringify({event:`editor-area-swap-to-diffview`,"doc.name":n})),()=>{console.warn(JSON.stringify({event:`editor-area-swap-from-diffview`,"doc.name":n}))}),v=[n],t[5]=n,t[6]=_,t[7]=v),(0,Q.useEffect)(_,v);let y=o||l===void 0,b,x;t[8]!==y||t[9]!==u?(b=()=>{if(y)return;let e=!1;return f(null),m(!1),BD(u).then(t=>{e||(t===null?m(!0):f(t))}),()=>{e=!0}},x=[u,y],t[8]=y,t[9]=u,t[10]=b,t[11]=x):(b=t[10],x=t[11]),(0,Q.useEffect)(b,x);let S;t[12]!==r||t[13]!==u?(S=async function(e){let t=await ID(u,e);t.ok||X.error(r({id:`K-h9cT`,values:{filePath:u}}),{description:t.detail})},t[12]=r,t[13]=u,t[14]=S):S=t[14];let C=S,w;t[15]!==r||t[16]!==u?(w=async function(e){g(!0);let t=await e(u);t.ok||(g(!1),X.error(r({id:`jPUPvG`,values:{filePath:u}}),{description:t.detail}))},t[15]=r,t[16]=u,t[17]=w):w=t[17];let T=w;if(p){let e;return t[18]===u?e=t[19]:(e=(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`ajz9F8`,values:{filePath:u}})}),t[18]=u,t[19]=e),e}if(d===null){let e;return t[20]===u?e=t[21]:(e=(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`DF1MtZ`,values:{filePath:u}})}),t[20]=u,t[21]=e),e}if(d.kind===`delete-modify`){let e;t[22]===d.theirs?e=t[23]:(e=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(PD,{oldContent:``,newContent:d.theirs,layout:`unified`,previewMode:!0})}),t[22]=d.theirs,t[23]=e);let n;t[24]===u?n=t[25]:(n={filePath:u},t[24]=u,t[25]=n);let r;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`})},t[26]=r):r=t[26];let i;t[27]===n?i=t[28]:(i=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`V48OUT`,values:n,components:r})}),t[27]=n,t[28]=i);let a;t[29]===T?a=t[30]:(a=()=>void T(zD),t[29]=T,t[30]=a);let o;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(s,{id:`Vlc75q`}),t[31]=o):o=t[31];let c;t[32]!==h||t[33]!==a?(c=(0,Z.jsx)(sa,{type:`button`,variant:`destructive`,disabled:h,onClick:a,children:o}),t[32]=h,t[33]=a,t[34]=c):c=t[34];let l;t[35]===T?l=t[36]:(l=()=>void T(RD),t[35]=T,t[36]=l);let f;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(s,{id:`3mFsc3`}),t[37]=f):f=t[37];let p;t[38]!==h||t[39]!==l?(p=(0,Z.jsx)(sa,{type:`button`,variant:`default`,disabled:h,onClick:l,children:f}),t[38]=h,t[39]=l,t[40]=p):p=t[40];let m;t[41]!==c||t[42]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex shrink-0 gap-3`,children:[c,p]}),t[41]=c,t[42]=p,t[43]=m):m=t[43];let g;t[44]!==i||t[45]!==m?(g=(0,Z.jsxs)(`div`,{className:`flex flex-shrink-0 flex-wrap items-center justify-between gap-x-6 gap-y-3 border-t px-6 py-4`,children:[i,m]}),t[44]=i,t[45]=m,t[46]=g):g=t[46];let _;return t[47]!==g||t[48]!==e?(_=(0,Z.jsxs)(`div`,{className:`flex h-full flex-col bg-background`,children:[e,g]}),t[47]=g,t[48]=e,t[49]=_):_=t[49],_}if(d.kind===`modify-delete`){let e;t[50]===d.ours?e=t[51]:(e=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(PD,{oldContent:``,newContent:d.ours,layout:`unified`,previewMode:!0})}),t[50]=d.ours,t[51]=e);let n;t[52]===u?n=t[53]:(n={filePath:u},t[52]=u,t[53]=n);let r;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`})},t[54]=r):r=t[54];let i;t[55]===n?i=t[56]:(i=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`EhDLBx`,values:n,components:r})}),t[55]=n,t[56]=i);let a;t[57]===T?a=t[58]:(a=()=>void T(LD),t[57]=T,t[58]=a);let o;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(s,{id:`0NA4b3`}),t[59]=o):o=t[59];let c;t[60]!==h||t[61]!==a?(c=(0,Z.jsx)(sa,{type:`button`,variant:`default`,disabled:h,onClick:a,children:o}),t[60]=h,t[61]=a,t[62]=c):c=t[62];let l;t[63]===T?l=t[64]:(l=()=>void T(zD),t[63]=T,t[64]=l);let f;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(s,{id:`qSxaOz`}),t[65]=f):f=t[65];let p;t[66]!==h||t[67]!==l?(p=(0,Z.jsx)(sa,{type:`button`,variant:`destructive`,disabled:h,onClick:l,children:f}),t[66]=h,t[67]=l,t[68]=p):p=t[68];let m;t[69]!==c||t[70]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex shrink-0 gap-3`,children:[c,p]}),t[69]=c,t[70]=p,t[71]=m):m=t[71];let g;t[72]!==i||t[73]!==m?(g=(0,Z.jsxs)(`div`,{className:`flex flex-shrink-0 flex-wrap items-center justify-between gap-x-6 gap-y-3 border-t px-6 py-4`,children:[i,m]}),t[72]=i,t[73]=m,t[74]=g):g=t[74];let _;return t[75]!==g||t[76]!==e?(_=(0,Z.jsxs)(`div`,{className:`flex h-full flex-col bg-background`,children:[e,g]}),t[75]=g,t[76]=e,t[77]=_):_=t[77],_}let E;t[78]===C?E=t[79]:(E=e=>void C(e),t[78]=C,t[79]=E);let D;return t[80]!==d.ours||t[81]!==d.theirs||t[82]!==E?(D=(0,Z.jsx)(PD,{oldContent:d.theirs,newContent:d.ours,layout:`unified`,conflictMode:!0,onResolve:E}),t[80]=d.ours,t[81]=d.theirs,t[82]=E,t[83]=D):D=t[83],D}function HD(e){let t=(0,$.c)(2),{docName:n,provider:r,children:i}=e;(0,Q.use)(Wt(n,r));let a;return t[0]===i?a=t[1]:(a=(0,Z.jsx)(Z.Fragment,{children:i}),t[0]=i,t[1]=a),a}var UD=`__back-nav__`;function WD(e){return e instanceof Re||e instanceof Ct||e instanceof Me||e instanceof rt||e instanceof It||e instanceof te?e.docName:null}function GD(e){if(e instanceof Re){let t=e.docName;return{title:Y._({id:`Jejur6`}),summary:Y._({id:`jSY41h`,values:{docName:t}})}}if(e instanceof Ct){let t=e.docName;return{title:Y._({id:`V7QxyT`}),summary:Y._({id:`xG4tb6`,values:{docName:t}})}}if(e instanceof Me){let t=e.docName;return{title:Y._({id:`1di5fu`}),summary:Y._({id:`PQCdtv`,values:{docName:t}})}}if(e instanceof rt){let t=e.docName;return{title:Y._({id:`wvbc1r`}),summary:Y._({id:`IX7-sq`,values:{docName:t}})}}if(e instanceof It)return{title:Y._({id:`Gfr4fu`}),summary:Y._({id:`j6LB7S`})};if(e instanceof te){let t=e.docName;return{title:Y._({id:`vv7kpg`}),summary:Y._({id:`mdKFEy`,values:{docName:t}})}}let t=e instanceof Error&&e.message?e.message:Y._({id:`W5A0Ly`});return{title:Y._({id:`29VNqC`}),summary:t}}function KD(e){let t=(0,$.c)(28),{error:n,resetErrorBoundary:r,activeDocName:i,previousDocName:a,onNavigateBack:o}=e,c;t[0]===n?c=t[1]:(c=GD(n),t[0]=n,t[1]=c);let{title:l,summary:u}=c,d=!!a&&!!o,f=(0,Q.useRef)(null),p,m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>{f.current?.focus()},m=[],t[2]=p,t[3]=m):(p=t[2],m=t[3]),(0,Q.useEffect)(p,m);let h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(wx,{size:80,variant:`sleeping`}),t[4]=h):h=t[4];let g;t[5]===l?g=t[6]:(g=(0,Z.jsx)(`h2`,{id:`document-error-title`,className:`text-2xl font-light tracking-tighter text-balance`,children:l}),t[5]=l,t[6]=g);let _;t[7]===u?_=t[8]:(_=(0,Z.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:u}),t[7]=u,t[8]=_);let v;t[9]!==g||t[10]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[g,_]}),t[9]=g,t[10]=_,t[11]=v):v=t[11];let y;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(s,{id:`KDw4GX`}),t[12]=y):y=t[12];let b;t[13]===r?b=t[14]:(b=(0,Z.jsx)(sa,{ref:f,variant:`default`,onClick:r,children:y}),t[13]=r,t[14]=b);let x;t[15]!==i||t[16]!==d||t[17]!==n||t[18]!==o||t[19]!==a||t[20]!==r?(x=d?(0,Z.jsx)(sa,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>{!a||!o||(ft(WD(n)??i),o(a),r(UD))},children:(0,Z.jsx)(s,{id:`CKyk7Q`})}):null,t[15]=i,t[16]=d,t[17]=n,t[18]=o,t[19]=a,t[20]=r,t[21]=x):x=t[21];let S;t[22]!==x||t[23]!==b?(S=(0,Z.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[b,x]}),t[22]=x,t[23]=b,t[24]=S):S=t[24];let C;return t[25]!==S||t[26]!==v?(C=(0,Z.jsxs)(`div`,{role:`alert`,"aria-labelledby":`document-error-title`,"data-slot":`document-error-boundary`,className:`flex h-full flex-col items-center justify-center gap-8 p-8 text-center`,children:[h,v,S]}),t[25]=S,t[26]=v,t[27]=C):C=t[27],C}function qD(e){let t=(0,$.c)(17),{activeDocName:n,previousDocName:r,onNavigateBack:i,onRecycle:a,children:o}=e,s;t[0]!==n||t[1]!==i||t[2]!==r?(s=e=>(0,Z.jsx)(KD,{...e,activeDocName:n,previousDocName:r,onNavigateBack:i}),t[0]=n,t[1]=i,t[2]=r,t[3]=s):s=t[3];let c;t[4]===n?c=t[5]:(c=[n],t[4]=n,t[5]=c);let l;t[6]!==n||t[7]!==a?(l=e=>{if(e.reason===`imperative-api`){if(Array.isArray(e.args)&&e.args[0]===UD){console.warn(`[DocumentErrorBoundary] back-nav reset (no recycle)`);return}a(n),console.warn(`[DocumentErrorBoundary] retry recycled ${n}`)}else console.warn(`[DocumentErrorBoundary] reset by key change (${e.prev?.[0]} → ${e.next?.[0]})`)},t[6]=n,t[7]=a,t[8]=l):l=t[8];let u;t[9]===n?u=t[10]:(u=e=>{console.error(`[DocumentErrorBoundary] rendered fallback for ${n}: ${GD(e).title}`,e)},t[9]=n,t[10]=u);let d;return t[11]!==o||t[12]!==s||t[13]!==c||t[14]!==l||t[15]!==u?(d=(0,Z.jsx)(re,{fallbackRender:s,resetKeys:c,onReset:l,onError:u,children:o}),t[11]=o,t[12]=s,t[13]=c,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function JD(e){let t=e.document.getText(`source`).toString(),{map:n,parseError:r}=Br(t);return{map:n,keys:Wr(t),parseError:r}}function YD(e){let t=(0,$.c)(21),{provider:n}=e,r;t[0]===n?r=t[1]:(r=()=>JD(n),t[0]=n,t[1]=r);let[i,a]=(0,Q.useState)(r),o,s;t[2]===n?(o=t[3],s=t[4]):(o=()=>{let e=Hn(n);a(e.current());let t=e.subscribe(e=>{a(e)});return()=>{t(),e.dispose()}},s=[n],t[2]=n,t[3]=o,t[4]=s),(0,Q.useEffect)(o,s);let c;t[5]===i.map.icon?c=t[6]:(c=et(i.map.icon),t[5]=i.map.icon,t[6]=c);let l=c,u;t[7]===i.map.cover?u=t[8]:(u=gt(i.map.cover),t[7]=i.map.cover,t[8]=u);let d=u,f=d.kind===`url`||d.kind===`path`,p=l.kind!==`unsupported`;if(!f&&!p)return null;let m=f?`true`:`false`,h=p?`true`:`false`,g;t[9]!==d||t[10]!==f?(g=f?(0,Z.jsx)(XD,{cover:d}):null,t[9]=d,t[10]=f,t[11]=g):g=t[11];let _;t[12]!==f||t[13]!==p||t[14]!==l?(_=p?(0,Z.jsx)(ZD,{icon:l,hasCover:f}):null,t[12]=f,t[13]=p,t[14]=l,t[15]=_):_=t[15];let v;return t[16]!==m||t[17]!==h||t[18]!==g||t[19]!==_?(v=(0,Z.jsxs)(`div`,{className:`page-header editor-content-aligned`,"data-has-cover":m,"data-has-icon":h,"aria-hidden":`true`,"data-testid":`page-header`,children:[g,_]}),t[16]=m,t[17]=h,t[18]=g,t[19]=_,t[20]=v):v=t[20],v}function XD(e){let t=(0,$.c)(2),{cover:n}=e,r;return t[0]===n.value?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`page-header-cover`,"data-testid":`page-header-cover`,children:(0,Z.jsx)(`img`,{src:n.value,alt:``,draggable:!1,loading:`lazy`,referrerPolicy:`no-referrer`,className:`page-header-cover-img`})}),t[0]=n.value,t[1]=r),r}function ZD(e){let t=(0,$.c)(9),{icon:n,hasCover:r}=e,i=r?`page-header-icon page-header-icon--with-cover`:`page-header-icon`;if(n.kind===`emoji`){let e;return t[0]!==n.value||t[1]!==i?(e=(0,Z.jsx)(`span`,{className:i,"data-testid":`page-header-icon`,"data-kind":`emoji`,children:n.value}),t[0]=n.value,t[1]=i,t[2]=e):e=t[2],e}let a;t[3]===n.value?a=t[4]:(a=(0,Z.jsx)(`img`,{src:n.value,alt:``,draggable:!1,referrerPolicy:`no-referrer`,className:`page-header-icon-img`}),t[3]=n.value,t[4]=a);let o;return t[5]!==n.kind||t[6]!==i||t[7]!==a?(o=(0,Z.jsx)(`span`,{className:i,"data-testid":`page-header-icon`,"data-kind":n.kind,children:a}),t[5]=n.kind,t[6]=i,t[7]=a,t[8]=o):o=t[8],o}function QD(e){let t=e.document.getText(`source`).toString(),{map:n,parseError:r}=Br(t);return{map:n,keys:Wr(t),parseError:r}}function $D(e){let t=(0,$.c)(127),{provider:n}=e,{_:r}=i(),[a,o]=(0,Q.useState)(null),c;t[0]===n?c=t[1]:(c=()=>QD(n),t[0]=n,t[1]=c);let[l,u]=(0,Q.useState)(c),d,f;t[2]===n?(d=t[3],f=t[4]):(d=()=>{let e=Hn(n);o(e),u(e.current());let t=e.subscribe(e=>{u(e)});return()=>{t(),e.dispose(),o(t=>t===e?null:t)}},f=[n],t[2]=n,t[3]=d,t[4]=f),(0,Q.useEffect)(d,f);let p=l.map,m=l.keys,h=l.parseError,[g,_]=(0,Q.useState)(!1),v;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v={},t[5]=v):v=t[5];let[y,b]=(0,Q.useState)(v),[x,S]=(0,Q.useState)(null),[C,w]=(0,Q.useState)(null),T;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(T={},t[6]=T):T=t[6];let[E,D]=(0,Q.useState)(T),O;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(O={},t[7]=O):O=t[7];let[k,A]=(0,Q.useState)(O),j=n.configuration.name??``,M;t[8]!==r||t[9]!==a?(M=function(e){if(!a)return{ok:!1,error:r({id:`9zb2WA`})};let t=a.patch(e);if(t.ok)return{ok:!0};if(t.error.code===`WRITE_ERROR`)return console.warn(`[PropertyPanel] binding write error:`,t.error.detail),{ok:!1,error:t.error.detail};let n=Xr(t.error);return{ok:!1,error:t.error.issues[0]?.message??r({id:`8fRyLo`}),fieldErrors:Object.keys(n).length>0?n:void 0}},t[8]=r,t[9]=a,t[10]=M):M=t[10];let N=M,P;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(e){D(t=>{if(!Object.hasOwn(t,e))return t;let n={...t};return delete n[e],n})},t[11]=P):P=t[11];let F=P,I;t[12]===r?I=t[13]:(I=function(e,t){if(e.ok)return;let n=e.error??r({id:`4g19V6`}),i=e.fieldErrors??{};D(e=>{let r={...e};for(let e of t)r[e]=i[e]??n;return r}),A(e=>{let n={...e};for(let e of t)n[e]=(n[e]??0)+1;return n})},t[12]=r,t[13]=I);let L=I,R;t[14]!==N||t[15]!==L?(R=function(e,t){F(e),L(N({[e]:t}),[e])},t[14]=N,t[15]=L,t[16]=R):R=t[16];let z=R,B;t[17]!==N||t[18]!==L?(B=function(e){F(e),L(N({[e]:null}),[e])},t[17]=N,t[18]=L,t[19]=B):B=t[19];let V=B,H;t[20]!==r||t[21]!==a?(H=function(e,t){if(!a)return{ok:!1,error:r({id:`9zb2WA`})};if(e===t)return{ok:!0};let n=a.rename(e,t);if(n.ok)return{ok:!0};if(n.error.code===`WRITE_ERROR`)return{ok:!1,error:n.error.detail};let i=Xr(n.error);return{ok:!1,error:n.error.issues[0]?.message??r({id:`I1gRhX`}),fieldErrors:Object.keys(i).length>0?i:void 0}},t[20]=r,t[21]=a,t[22]=H):H=t[22];let U=H,ee;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(ee=function(e,t){return`${e} ${t}`},t[23]=ee):ee=t[23];let te=ee,W;t[24]!==a||t[25]!==m?(W=function(e){if(!a)return;let t=String(e.active.id),n=e.over?String(e.over.id):null;if(!n||t===n)return;let r=m.map((e,t)=>te(e,t)),i=r.indexOf(t),o=r.indexOf(n);if(i<0||o<0)return;let s=m.slice(),[c]=s.splice(i,1);if(!c)return;s.splice(o,0,c);let l=a.reorder(s);l.ok||console.warn(`[PropertyPanel] reorder failed:`,l.error)},t[24]=a,t[25]=m,t[26]=W):W=t[26];let ne=W,re;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(re={activationConstraint:{distance:4}},t[27]=re):re=t[27];let G;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(G={coordinateGetter:fo},t[28]=G):G=t[28];let ie=ro(So(bo,re),So(Ua,G)),K;t[29]!==z||t[30]!==p?(K=function(e,t){let n=p[e];if(n===void 0)return;b(n=>({...n,[e]:t}));let r=qa(n,t);(!Object.hasOwn(p,e)||!_i(n,r))&&z(e,r)},t[29]=z,t[30]=p,t[31]=K):K=t[31];let q=K,ae;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(ae=function(){S({name:``,type:`text`,value:``,error:null}),_(!1)},t[32]=ae):ae=t[32];let oe=ae,{addPropertySignal:se,clearAddProperty:ce}=AS(),le;t[33]!==se||t[34]!==j?(le=se.get(j)??0,t[33]=se,t[34]=j,t[35]=le):le=t[35];let ue=le,de,fe;t[36]===ue?(de=t[37],fe=t[38]):(de=()=>{ue>0&&(S({name:``,type:`text`,value:``,error:null}),_(!1))},fe=[ue],t[36]=ue,t[37]=de,t[38]=fe),(0,Q.useEffect)(de,fe);let pe,me;t[39]!==ce||t[40]!==j?(pe=()=>()=>ce(j),me=[j,ce],t[39]=ce,t[40]=j,t[41]=pe,t[42]=me):(pe=t[41],me=t[42]),(0,Q.useEffect)(pe,me);let he;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(he=function(e){S(t=>{if(!t)return t;let n=e===`date`?new Date().toISOString().slice(0,10):Va[e];return{...t,type:e,value:n,error:null}})},t[43]=he):he=t[43];let ge=he,_e;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(_e=function(e){S(t=>t&&{...t,value:e})},t[44]=_e):_e=t[44];let ve=_e,ye;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(ye=function(e){S(t=>t&&{...t,name:e,error:null})},t[45]=ye):ye=t[45];let be=ye,xe;t[46]!==r||t[47]!==x||t[48]!==N||t[49]!==p?(xe=function(){if(!x)return;let e=x.name.trim();if(!e){S({...x,error:r({id:`8_brI5`})});return}if(e===`frontmatter`){S({...x,error:r({id:`dURmlQ`})});return}if(Object.hasOwn(p,e)){S({...x,error:r({id:`njU86j`,values:{trimmed:e}})});return}let t=N({[e]:x.value});if(t.ok){S(null);return}let n=t.fieldErrors?.[e],i=t.error??r({id:`OJeiSH`});S({...x,error:n??i})},t[46]=r,t[47]=x,t[48]=N,t[49]=p,t[50]=xe):xe=t[50];let Se=xe,Ce;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=function(){S(null)},t[51]=Ce):Ce=t[51];let we=Ce,Te;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(Te=function(e){w({key:e,draft:e,error:null})},t[52]=Te):Te=t[52];let Ee=Te,De;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(De=function(e){w(t=>t&&{...t,draft:e,error:null})},t[53]=De):De=t[53];let Oe=De,ke;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(ke=function(){w(null)},t[54]=ke):ke=t[54];let Ae=ke,je;t[55]!==r||t[56]!==p||t[57]!==U||t[58]!==C?(je=function(){if(!C)return;let e=C.draft.trim();if(!e){w(null);return}if(e===C.key){w(null);return}if(e===`frontmatter`){w({...C,error:r({id:`dURmlQ`})});return}if(Object.hasOwn(p,e)){w({...C,error:r({id:`njU86j`,values:{trimmed:e}})});return}let t=U(C.key,e);if(t.ok){b(t=>{if(!Object.hasOwn(t,C.key))return t;let n={...t};return n[e]=n[C.key],delete n[C.key],n}),F(C.key),w(null);return}let n=t.fieldErrors?.[e]??t.fieldErrors?.[C.key]??t.error??r({id:`2ryd91`});w({...C,error:n})},t[55]=r,t[56]=p,t[57]=U,t[58]=C,t[59]=je):je=t[59];let Me=je,Ne;t[60]!==p||t[61]!==m?(Ne=m.length>0?m:Object.keys(p),t[60]=p,t[61]=m,t[62]=Ne):Ne=t[62];let Pe=Ne,Fe;if(t[63]!==Pe){Fe=new Map;for(let e of Pe)Fe.set(e,(Fe.get(e)??0)+1);t[63]=Pe,t[64]=Fe}else Fe=t[64];if(Pe.length===0&&!x&&!h)return null;let Ie=!g,Le;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(Le=e=>_(!e),t[65]=Le):Le=t[65];let Re=!g,ze;t[66]===Re?ze=t[67]:(ze=(0,Z.jsx)(Os,{"data-expanded":Re,className:`size-3.5 shrink-0 text-muted-foreground transition-transform duration-150 ease-out data-[expanded=true]:rotate-90`}),t[66]=Re,t[67]=ze);let Be;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`l_UFPv`})}),t[68]=Be):Be=t[68];let Ve;t[69]===ze?Ve=t[70]:(Ve=(0,Z.jsx)(js,{asChild:!0,children:(0,Z.jsxs)(sa,{type:`button`,variant:`ghost`,className:`mb-1.5 flex h-auto w-fit bg-transparent! items-center gap-1 px-1 py-0.5 text-base font-medium text-foreground hover:bg-transparent hover:text-foreground`,children:[ze,Be]})}),t[69]=ze,t[70]=Ve);let He;t[71]===h?He=t[72]:(He=h?(0,Z.jsxs)(`div`,{role:`alert`,"data-testid":`property-panel-yaml-error`,className:`mb-1 flex items-start gap-1.5 rounded border border-destructive/30 bg-destructive/5 px-2 py-1.5 text-[11px] text-destructive`,children:[(0,Z.jsx)(Pi,{className:`size-3.5 shrink-0 mt-0.5`}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(s,{id:`zaXlhf`}),(0,Z.jsx)(`span`,{className:`block text-[10px] opacity-80`,children:h})]})]}):null,t[71]=h,t[72]=He);let Ue;if(t[73]!==Pe){let e;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(e=(e,t)=>te(e,t),t[75]=e):e=t[75],Ue=Pe.map(e),t[73]=Pe,t[74]=Ue}else Ue=t[74];let We;if(t[76]!==z||t[77]!==Me||t[78]!==Fe||t[79]!==E||t[80]!==p||t[81]!==y||t[82]!==V||t[83]!==C||t[84]!==Pe||t[85]!==k||t[86]!==q){let e;t[88]!==z||t[89]!==Me||t[90]!==Fe||t[91]!==E||t[92]!==p||t[93]!==y||t[94]!==V||t[95]!==C||t[96]!==k||t[97]!==q?(e=(e,t)=>{let n=p[e];if(n===void 0)return null;let r=y[e]??$n(n),i=C?.key===e?C:null,a=(Fe.get(e)??0)>1;return(0,Z.jsx)(to,{sortableId:te(e,t),keyName:e,value:n,declared:r,error:E[e]??null,resetCounter:k[e]??0,isDuplicate:a,rename:{state:i,onBegin:()=>Ee(e),onChangeDraft:Oe,onCommit:Me,onCancel:Ae},onCommit:t=>z(e,t),onChangeType:t=>q(e,t),onRemove:()=>V(e)},`${e}-${t}`)},t[88]=z,t[89]=Me,t[90]=Fe,t[91]=E,t[92]=p,t[93]=y,t[94]=V,t[95]=C,t[96]=k,t[97]=q,t[98]=e):e=t[98],We=Pe.map(e),t[76]=z,t[77]=Me,t[78]=Fe,t[79]=E,t[80]=p,t[81]=y,t[82]=V,t[83]=C,t[84]=Pe,t[85]=k,t[86]=q,t[87]=We}else We=t[87];let Ge;t[99]!==Ue||t[100]!==We?(Ge=(0,Z.jsx)(Da,{items:Ue,strategy:La,children:We}),t[99]=Ue,t[100]=We,t[101]=Ge):Ge=t[101];let Ke;t[102]!==ne||t[103]!==ie||t[104]!==Ge?(Ke=(0,Z.jsx)(Ga,{sensors:ie,collisionDetection:vo,onDragEnd:ne,children:Ge}),t[102]=ne,t[103]=ie,t[104]=Ge,t[105]=Ke):Ke=t[105];let qe;t[106]!==z||t[107]!==E||t[108]!==p||t[109]!==k?(qe=Object.hasOwn(p,`tags`)?null:(0,Z.jsx)(to,{keyName:`tags`,value:[],declared:`list`,error:E.tags??null,resetCounter:k.tags??0,isPlaceholder:!0,onCommit:e=>z(`tags`,e),onChangeType:eO},`virtual-tags`),t[106]=z,t[107]=E,t[108]=p,t[109]=k,t[110]=qe):qe=t[110];let Je;t[111]!==r||t[112]!==x||t[113]!==Se?(Je=x?(0,Z.jsx)(Za,{draft:x,onChangeName:be,onChangeType:ge,onChangeValue:ve,onCommit:Se,onCancel:we}):(0,Z.jsxs)(`div`,{className:`mt-1 flex items-center gap-1`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`h-7 w-4 shrink-0`}),(0,Z.jsxs)(sa,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`add-property-trigger`,onClick:oe,"aria-label":r({id:`F-NRCj`}),className:`flex items-center gap-1.5 rounded px-2 py-1 font-medium text-sm hover:bg-muted/50 hover:text-foreground`,children:[(0,Z.jsx)(At,{className:`size-3.5`}),(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`m16xKo`})})]})]}),t[111]=r,t[112]=x,t[113]=Se,t[114]=Je):Je=t[114];let Ye;t[115]!==He||t[116]!==Ke||t[117]!==qe||t[118]!==Je?(Ye=(0,Z.jsxs)(As,{className:`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in]`,children:[He,Ke,qe,Je]}),t[115]=He,t[116]=Ke,t[117]=qe,t[118]=Je,t[119]=Ye):Ye=t[119];let Xe;t[120]!==Ie||t[121]!==Ve||t[122]!==Ye?(Xe=(0,Z.jsx)(`div`,{className:`property-panel editor-content-aligned pt-4 pb-4 text-sm`,"data-testid":`property-panel`,children:(0,Z.jsxs)(Ms,{open:Ie,onOpenChange:Le,children:[Ve,Ye]})}),t[120]=Ie,t[121]=Ve,t[122]=Ye,t[123]=Xe):Xe=t[123];let Ze;return t[124]!==a||t[125]!==Xe?(Ze=(0,Z.jsx)(fs,{binding:a,children:Xe}),t[124]=a,t[125]=Xe,t[126]=Ze):Ze=t[126],Ze}function eO(){}var tO=p(`LARGE_DOC_CHAR_THRESHOLD`,5e5);function nO(e){let t=e.threshold??tO;return e.ytextLength>t?{renderSource:e.isSourceMode||e.visitedSource,renderVisual:!e.isSourceMode||e.visitedVisual,isLarge:!0}:{renderSource:!0,renderVisual:!0,isLarge:!1}}function rO(e){return e.hasEmittedFirstToggle||!e.isLarge?!1:e.renderSource&&e.renderVisual}var iO=p(`ACTIVITY_MOUNT_LIMIT`,3);function aO(){return n(()=>import(`./SourceEditor-CleGALgO.js`),__vite__mapDeps([47,1,35,2,36,37,22,38,39,40,41,21,6,3,7,4,10,12,9,42,48,24,46]),import.meta.url)}var oO=(0,Q.lazy)(async()=>({default:(await aO()).SourceEditor}));function sO(e,t,n){if(n<=0)return[];let r=e.filter(e=>!Je(e.docName)),i=[...r].sort((e,t)=>t.lastAccessedAt-e.lastAccessedAt).slice(0,n);if(t===null||i.some(e=>e.docName===t))return i;let a=r.find(e=>e.docName===t);return a?[...i.slice(0,n-1),a]:i}function cO(e,t){return t.kind===`idle`?null:t.kind===`failed`&&t.failedDocNames.includes(e)?{kind:`failed`,title:Y._({id:`MTs6g3`}),summary:t.reason===`clear-data-timeout`?Y._({id:`Sc1bKE`,values:{docName:e}}):Y._({id:`ovIGrT`,values:{docName:e}}),actionLabel:Y._({id:`HpK_8d`})}:t.kind===`recovering`&&t.docNames.includes(e)?{kind:`recovering`,title:Y._({id:`cF9DyA`}),summary:t.phase===`clearing-local-cache`?Y._({id:`bmC18N`,values:{docName:e}}):Y._({id:`pAgkuZ`,values:{docName:e}})}:null}function lO(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(G,{name:`activity-pool`,children:(0,Z.jsx)(uO,{...e})}),t[0]=e,t[1]=n),n}function uO(e){let t=(0,$.c)(15),{activeDocName:n,isSourceMode:r,editorPlaceholder:i,previousDocName:a,onNavigateBack:o,onRecycle:s}=e,{poolEntries:c,serverRestartRecovery:l}=yt(),{pages:u,loading:d}=si(),f=sO(c,n,iO),p=(0,Q.useRef)(``),m=f.map(dO).join(`,`),h=(0,Q.useRef)(c),g,_;t[0]===c?(g=t[1],_=t[2]):(g=()=>{h.current=c},_=[c],t[0]=c,t[1]=g,t[2]=_),(0,Q.useLayoutEffect)(g,_),(0,Q.useLayoutEffect)(()=>{if(p.current===m)return;let e=p.current?p.current.split(`,`):[],t=m?m.split(`,`):[],r=e.filter(e=>!t.includes(e)),i=t.filter(t=>!e.includes(t));for(let e of r)U(e);for(let e of i){let t=h.current.find(t=>t.docName===e)?.poolEventId;on(e,t&&t.length>0?t:crypto.randomUUID())}ut(`ok/activity/mount-list-change`,{active:n,mounted:t,evicted:r}),p.current=m,ct(t)},[m,n]);let v;t[3]!==n||t[4]!==i||t[5]!==r||t[6]!==d||t[7]!==o||t[8]!==s||t[9]!==u||t[10]!==a||t[11]!==l?(v=e=>(0,Z.jsx)(_O,{entry:e,isActive:e.docName===n,isSourceMode:r,editorPlaceholder:i,isNewDoc:!d&&!u.has(e.docName),previousDocName:a,onNavigateBack:o,onRecycle:s,serverRestartRecovery:l},e.docName),t[3]=n,t[4]=i,t[5]=r,t[6]=d,t[7]=o,t[8]=s,t[9]=u,t[10]=a,t[11]=l,t[12]=v):v=t[12];let y=f.map(v),b;return t[13]===y?b=t[14]:(b=(0,Z.jsx)(Z.Fragment,{children:y}),t[13]=y,t[14]=b),b}function dO(e){return e.docName}function fO(e){let t=(0,$.c)(8),{isActive:n,initialScrollTop:r,children:i}=e,a=(0,Q.useRef)(null),o=(0,Q.useRef)(r??0),s,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=a.current;if(!e)return;let t=()=>{e.scrollTop>0&&(o.current=e.scrollTop)};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},c=[],t[0]=s,t[1]=c):(s=t[0],c=t[1]),(0,Q.useEffect)(s,c);let l,u;t[2]===n?(l=t[3],u=t[4]):(l=()=>{if(!n)return;let e=a.current;if(!e)return;let t=o.current;if(t===0)return;let r=performance.now(),i=!1;e.scrollTop=t,e.scrollTop===t&&e.scrollHeight>t&&ut(`ok/scroll-restore/phase1-success`,{target:t,elapsedMs:performance.now()-r});let s=!1,c=0,l=()=>{s||(s=!0,cancelAnimationFrame(c),clearTimeout(f),e.removeEventListener(`wheel`,u),e.removeEventListener(`touchstart`,u))},u=()=>l();e.addEventListener(`wheel`,u,{passive:!0}),e.addEventListener(`touchstart`,u,{passive:!0});let d=()=>{s||(e.scrollTop!==t&&e.scrollHeight>t&&(e.scrollTop=t,e.scrollTop===t&&!i&&(ut(`ok/scroll-restore/phase2-success`,{target:t,elapsedMs:performance.now()-r}),i=!0)),c=requestAnimationFrame(d))};c=requestAnimationFrame(d);let f=setTimeout(()=>{s||(e.scrollTop!==t&&e.scrollHeight>t&&ut(`ok/scroll-restore/abandoned`,{target:t,elapsedMs:performance.now()-r,scrollHeight:e.scrollHeight,finalScrollTop:e.scrollTop}),l())},2e3);return l},u=[n],t[2]=n,t[3]=l,t[4]=u),(0,Q.useLayoutEffect)(l,u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={overflowAnchor:`auto`},t[5]=d):d=t[5];let f;return t[6]===i?f=t[7]:(f=(0,Z.jsx)(`div`,{ref:a,"data-testid":`editor-scroll-container`,className:`subtle-scrollbar h-full overflow-y-auto pt-14 scroll-pt-14`,style:d,children:i}),t[6]=i,t[7]=f),f}function pO(e){let t=(0,$.c)(12),{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a}=e,o=r&&i,[s,c]=(0,Q.useState)(o),l,u;if(t[0]===o?(l=t[1],u=t[2]):(l=()=>{o&&c(!0)},u=[o],t[0]=o,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u),!s&&!o)return null;let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(Vb,{}),t[3]=d):d=t[3];let f=n.docName,p;t[4]===n.provider.document?p=t[5]:(p=n.provider.document.getText(`source`),t[4]=n.provider.document,t[5]=p);let m;return t[6]!==a||t[7]!==n.docName||t[8]!==n.provider||t[9]!==o||t[10]!==p?(m=(0,Z.jsx)(Q.Suspense,{fallback:d,children:(0,Z.jsx)(oO,{docName:f,ytext:p,provider:n.provider,placeholder:a,isSourceModeActive:o})}),t[6]=a,t[7]=n.docName,t[8]=n.provider,t[9]=o,t[10]=p,t[11]=m):m=t[11],m}function mO(e){let t=(0,$.c)(18),{view:n}=e,r=n.kind===`failed`,i=r?`alert`:`status`,a=!r,o;t[0]===r?o=t[1]:(o=(0,Z.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-full border bg-muted text-muted-foreground`,children:r?(0,Z.jsx)(io,{className:`size-5`,"aria-hidden":`true`}):(0,Z.jsx)(Ce,{className:`size-5 animate-spin`,"aria-hidden":`true`})}),t[0]=r,t[1]=o);let s;t[2]===n.title?s=t[3]:(s=(0,Z.jsx)(`h2`,{className:`text-lg font-medium`,children:n.title}),t[2]=n.title,t[3]=s);let c;t[4]===n.summary?c=t[5]:(c=(0,Z.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:n.summary}),t[4]=n.summary,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==r||t[10]!==n.actionLabel?(u=r?(0,Z.jsxs)(sa,{type:`button`,onClick:hO,children:[(0,Z.jsx)(io,{className:`size-4`,"aria-hidden":`true`}),n.actionLabel]}):null,t[9]=r,t[10]=n.actionLabel,t[11]=u):u=t[11];let d;return t[12]!==i||t[13]!==a||t[14]!==o||t[15]!==l||t[16]!==u?(d=(0,Z.jsxs)(`div`,{"data-slot":`server-restart-recovery`,role:i,"aria-busy":a,className:`flex h-full flex-col items-center justify-center gap-6 p-8 text-center`,children:[o,l,u]}),t[12]=i,t[13]=a,t[14]=o,t[15]=l,t[16]=u,t[17]=d):d=t[17],d}function hO(){return window.location.reload()}function gO(e){let t=(0,$.c)(2),{html:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`tiptap-editor h-full pointer-events-none`,"aria-hidden":`true`,children:(0,Z.jsx)(`div`,{className:`tiptap ProseMirror tiptap-editor-portal-content`,dangerouslySetInnerHTML:{__html:n}})}),t[0]=n,t[1]=r),r}function _O(e){let t=(0,$.c)(53),{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a,isNewDoc:o,previousDocName:s,onNavigateBack:c,onRecycle:l,serverRestartRecovery:u}=e,d;t[0]!==n.docName||t[1]!==u?(d=cO(n.docName,u),t[0]=n.docName,t[1]=u,t[2]=d):d=t[2];let f=d,p=gC(n.docName)===`conflict`,h;t[3]===n.docName?h=t[4]:(h=()=>{let e=document.createElement(`div`);return e.setAttribute(`data-ok-editor-portal`,n.docName),e.style.display=`contents`,e},t[3]=n.docName,t[4]=h);let[g]=(0,Q.useState)(h),_=n.provider.document.getText(`source`).length,[v,y]=(0,Q.useState)(i),[b,x]=(0,Q.useState)(!i),S,C;t[5]!==i||t[6]!==v||t[7]!==b?(S=()=>{i&&!v?y(!0):!i&&!b&&x(!0)},C=[i,v,b],t[5]=i,t[6]=v,t[7]=b,t[8]=S,t[9]=C):(S=t[8],C=t[9]),(0,Q.useEffect)(S,C);let w=nO({ytextLength:_,isSourceMode:i,visitedSource:v,visitedVisual:b}),T=(0,Q.useRef)(``),E=`${w.isLarge}-${w.renderSource}-${w.renderVisual}`,D,O;t[10]!==n.docName||t[11]!==w.isLarge||t[12]!==w.renderSource||t[13]!==w.renderVisual||t[14]!==E||t[15]!==i||t[16]!==_?(D=()=>{T.current!==E&&(T.current=E,w.isLarge&&ut(`ok/activity/defer-mount`,{docName:n.docName,ytextLength:_,isSourceMode:i,renderSource:w.renderSource,renderVisual:w.renderVisual}))},O=[E,w.isLarge,w.renderSource,w.renderVisual,n.docName,_,i],t[10]=n.docName,t[11]=w.isLarge,t[12]=w.renderSource,t[13]=w.renderVisual,t[14]=E,t[15]=i,t[16]=_,t[17]=D,t[18]=O):(D=t[17],O=t[18]),(0,Q.useEffect)(D,O);let k;t[19]===n.docName?k=t[20]:(k=()=>m(n.docName),t[19]=n.docName,t[20]=k);let[A]=(0,Q.useState)(k),j=A?.html??null,[M,N]=(0,Q.useState)(!1),P,F;t[21]!==n.docName||t[22]!==w.isLarge||t[23]!==w.renderSource||t[24]!==w.renderVisual||t[25]!==M||t[26]!==i||t[27]!==_?(P=()=>{rO({isLarge:w.isLarge,renderSource:w.renderSource,renderVisual:w.renderVisual,hasEmittedFirstToggle:M})&&(ut(`ok/cold/first-toggle`,{docName:n.docName,mountId:ce(n.docName),ytextLength:_,modeEnteredFirst:i?`source`:`visual`}),N(!0))},F=[M,w.isLarge,w.renderSource,w.renderVisual,n.docName,_,i],t[21]=n.docName,t[22]=w.isLarge,t[23]=w.renderSource,t[24]=w.renderVisual,t[25]=M,t[26]=i,t[27]=_,t[28]=P,t[29]=F):(P=t[28],F=t[29]),(0,Q.useEffect)(P,F);let I=r?`visible`:`hidden`,L=`editor:${n.docName}`,R=A?.scrollTop,z;t[30]!==a||t[31]!==n||t[32]!==w.renderSource||t[33]!==w.renderVisual||t[34]!==r||t[35]!==p||t[36]!==o||t[37]!==i||t[38]!==c||t[39]!==l||t[40]!==g||t[41]!==s||t[42]!==f||t[43]!==j?(z=f?(0,Z.jsx)(mO,{view:f}):(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsx)(qD,{activeDocName:n.docName,previousDocName:s,onNavigateBack:c,onRecycle:l,children:(0,Z.jsx)(Q.Suspense,{fallback:j?(0,Z.jsx)(gO,{html:j}):(0,Z.jsx)(Vb,{}),children:(0,Z.jsx)(HD,{docName:n.docName,provider:n.provider,children:p?(0,Z.jsx)(VD,{docName:n.docName,provider:n.provider}):(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[!i&&(0,Z.jsx)(YD,{provider:n.provider}),!i&&(0,Z.jsx)($D,{provider:n.provider}),(0,Z.jsxs)(`div`,{className:`relative flex-1`,children:[w.renderSource?(0,Z.jsx)(`div`,{className:i?`h-full`:`ok-mode-hidden h-full`,children:(0,Z.jsx)(pO,{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a})}):null,w.renderVisual?(0,Z.jsx)(`div`,{className:i?`ok-mode-hidden h-full`:`h-full`,children:(0,Z.jsx)(BT,{provider:n.provider,placeholder:a,isSourceMode:i,portalTarget:g},`${n.docName}-${String(o)}-${n.poolEventId}`)}):null]})]})})})})}),t[30]=a,t[31]=n,t[32]=w.renderSource,t[33]=w.renderVisual,t[34]=r,t[35]=p,t[36]=o,t[37]=i,t[38]=c,t[39]=l,t[40]=g,t[41]=s,t[42]=f,t[43]=j,t[44]=z):z=t[44];let B;t[45]!==r||t[46]!==R||t[47]!==z?(B=(0,Z.jsx)(fO,{isActive:r,initialScrollTop:R,children:z}),t[45]=r,t[46]=R,t[47]=z,t[48]=B):B=t[48];let V;return t[49]!==I||t[50]!==L||t[51]!==B?(V=(0,Z.jsx)(Q.Activity,{mode:I,name:L,children:B}),t[49]=I,t[50]=L,t[51]=B,t[52]=V):V=t[52],V}function vO(e){let t=e.endsWith(`rem`)?`rem`:`px`;return{value:Number.parseFloat(e),unit:t}}function yO(e){let{value:t,unit:n}=vO(e);return n===`rem`?t*16:t}function bO(e,t){return`${t===`rem`?e.toFixed(1):Math.round(e)}${t}`}var xO=3600*24*7;function SO(e){let t=(0,$.c)(28),{direction:n,currentWidth:r,onResize:i,onToggle:a,isCollapsed:o,minResizeWidth:s,maxResizeWidth:c,enableToggle:l,enableAutoCollapse:u,autoCollapseThreshold:d,expandThreshold:f,enableDrag:p,setIsDraggingRail:m,widthCookieName:h,widthCookieMaxAge:g,isNested:_}=e,v=n===void 0?`right`:n,y=o===void 0?!1:o,b=s===void 0?`14rem`:s,x=c===void 0?`24rem`:c,S=l===void 0?!0:l,C=u===void 0?!0:u,w=d===void 0?1.5:d,T=f===void 0?.2:f,E=p===void 0?!0:p,D=m===void 0?CO:m,O=g===void 0?xO:g,k=_===void 0?!1:_,A=(0,Q.useRef)(null),j=(0,Q.useRef)(0),M=(0,Q.useRef)(0),N=(0,Q.useRef)(!1),P=(0,Q.useRef)(!1),F=(0,Q.useRef)(null),I=(0,Q.useRef)(0),L=(0,Q.useRef)(!1),R=(0,Q.useRef)(0),z=(0,Q.useRef)(0),B=(0,Q.useRef)(null),V=(0,Q.useRef)(r),H=(0,Q.useRef)(y),U,ee;t[0]===r?(U=t[1],ee=t[2]):(U=()=>{V.current=r},ee=[r],t[0]=r,t[1]=U,t[2]=ee),(0,Q.useEffect)(U,ee);let te,W;t[3]===y?(te=t[4],W=t[5]):(te=()=>{H.current=y},W=[y],t[3]=y,t[4]=te,t[5]=W),(0,Q.useEffect)(te,W);let ne=yO(b),re;t[6]===x?re=t[7]:(re=yO(x),t[6]=x,t[7]=re);let G=re,ie;t[8]!==E||t[9]!==k?(ie=function(e){E&&(P.current=!0,j.current=H.current?0:yO(V.current),M.current=e.clientX,I.current=e.clientX,F.current=null,L.current=!1,R.current=0,z.current=0,B.current=k&&A.current?A.current.getBoundingClientRect():null,e.preventDefault())},t[8]=E,t[9]=k,t[10]=ie):ie=t[10];let K=ie,q,ae;t[11]!==w||t[12]!==v||t[13]!==C||t[14]!==S||t[15]!==T||t[16]!==k||t[17]!==G||t[18]!==ne||t[19]!==i||t[20]!==a||t[21]!==D||t[22]!==O||t[23]!==h?(q=()=>{let e=function(e){h&&(document.cookie=`${h}=${e}; path=/; max-age=${O}`)},t=function(e,t){return v===`left`?e<t:e>t},n=function(e,t,n,r){if(k&&r){let r=e.clientX-t;return v===`left`?n-r:n+r}return v===`left`?window.innerWidth-e.clientX:e.clientX},r=function(r){if(!P.current)return;let o=Math.abs(r.clientX-M.current);if(!N.current&&o>5&&(N.current=!0,D(!0)),N.current){let{unit:o}=vO(V.current),s=B.current;k&&A.current&&(s=A.current.getBoundingClientRect());let c=t(r.clientX,I.current)?`expand`:`collapse`;F.current!==c&&(F.current=c),z.current=Math.abs(r.clientX-I.current);let l=Date.now();if(L.current&&l-R.current>200&&(L.current=!1),!L.current){if(C&&a&&!H.current){let e=n(r,M.current,j.current,s),t=!1;if(w<=1)t=e<=ne*w;else if(e<=ne){let n=ne*(w-1);t=ne-e>=n}if(c===`collapse`&&t){a(),I.current=r.clientX,L.current=!0,R.current=l;return}}if(a&&H.current&&c===`expand`&&z.current>ne*T){a();let t=n(r,M.current,j.current,s),c=Math.max(ne,Math.min(G,t)),u=bO(o===`rem`?c/16:c,o);i(u),e(u),I.current=r.clientX,L.current=!0,R.current=l;return}}if(H.current)return;let u=n(r,M.current,j.current,s),d=Math.max(ne,Math.min(G,u)),f=bO(o===`rem`?d/16:d,o);i(f),e(f)}},o=function(){P.current&&(!N.current&&a&&S&&a(),N.current=!1,P.current=!1,F.current=null,I.current=0,L.current=!1,R.current=0,z.current=0,B.current=null,D(!1))};return document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,o),()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,o)}},ae=[i,a,D,ne,G,k,C,w,T,S,h,O,v],t[11]=w,t[12]=v,t[13]=C,t[14]=S,t[15]=T,t[16]=k,t[17]=G,t[18]=ne,t[19]=i,t[20]=a,t[21]=D,t[22]=O,t[23]=h,t[24]=q,t[25]=ae):(q=t[24],ae=t[25]),(0,Q.useEffect)(q,ae);let oe;return t[26]===K?oe=t[27]:(oe={dragRef:A,isDragging:N,handleMouseDown:K},t[26]=K,t[27]=oe),oe}function CO(){}var wO=3600*24*7,TO=`18rem`,EO=`3rem`,DO=`app-file-sidebar`,OO=`14.625rem`,kO=`32rem`,AO=`sidebar_width`,jO=/^\d+(?:\.\d+)?(?:rem|px)$/,MO=Q.createContext(null);function NO(e){if(typeof document>`u`)return e;let t=document.cookie.split(`; `).find(e=>e.startsWith(`${AO}=`))?.split(`=`)[1];if(!t)return e;let n;try{n=decodeURIComponent(t)}catch{return e}return jO.test(n)?n:e}function PO(){let e=Q.use(MO);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function FO(e){let t=(0,$.c)(58),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({open:i,onOpenChange:o,className:r,style:s,children:n,defaultWidth:c,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=c===void 0?TO:c,[u]=Q.useState(LO),d;t[8]===u?d=t[9]:(d=()=>EC(u,window.innerWidth,`left`),t[8]=u,t[9]=d);let[f,p]=Q.useState(d),m;t[10]===l?m=t[11]:(m=()=>NO(l),t[10]=l,t[11]=m);let[h,g]=Q.useState(m),[_,v]=Q.useState(!1),[y,b]=Q.useState(!1),x;t[12]===u?x=t[13]:(x=()=>{let e=NC();return FC(`left`,EC(u,window.innerWidth,`left`),e)===`open`},t[12]=u,t[13]=x);let[S,C]=Q.useState(x),w=i??S,T;t[14]!==w||t[15]!==f||t[16]!==o?(T=e=>{let t=typeof e==`function`?e(w):e;o?o(t):C(t),IC(`left`,f,t?`open`:`collapsed`)},t[14]=w,t[15]=f,t[16]=o,t[17]=T):T=t[17];let E=T,D;t[18]===E?D=t[19]:(D=function(){E(IO)},t[18]=E,t[19]=D);let O=D,k=Q.useRef(w),A;t[20]===w?A=t[21]:(A=()=>{k.current=w},t[20]=w,t[21]=A),Q.useLayoutEffect(A);let j;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(j=function(){window.innerWidth>=1024||k.current&&(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||b(!0))},t[22]=j):j=t[22];let M=j,N,P;t[23]===u?(N=t[24],P=t[25]):(P=()=>{let e=window.matchMedia(`(min-width: ${CC}px)`),t=()=>{let e=EC(u,window.innerWidth,`left`);p(e),C(FC(`left`,e,NC())===`open`)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},N=[u],t[23]=u,t[24]=N,t[25]=P),Q.useEffect(P,N);let F,I;t[26]===w?(F=t[27],I=t[28]):(F=()=>{w||document.getElementById(DO)?.contains(document.activeElement)&&document.querySelector(`[data-sidebar="trigger"]`)?.focus()},I=[w],t[26]=w,t[27]=F,t[28]=I),Q.useLayoutEffect(F,I);let L,R;t[29]!==w||t[30]!==f||t[31]!==E?(L=()=>{if(f===`above`||!w)return;let e=e=>{e.key===`Escape`&&(document.querySelector(`[data-state="open"][role="dialog"], [data-state="open"][role="alertdialog"], [data-state="open"][role="menu"], [data-state="open"][role="listbox"], [data-radix-popper-content-wrapper] [data-state="open"]`)||E(!1))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},R=[f,w,E],t[29]=w,t[30]=f,t[31]=E,t[32]=L,t[33]=R):(L=t[32],R=t[33]),Q.useEffect(L,R);let z,B;t[34]===O?(z=t[35],B=t[36]):(z=()=>{if(typeof window<`u`&&window.okDesktop!=null)return;let e=e=>{Ws(e,`toggle-files-sidebar`)&&(e.preventDefault(),O())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},B=[O],t[34]=O,t[35]=z,t[36]=B),Q.useEffect(z,B);let V=w?`expanded`:`collapsed`,H;t[37]!==_||t[38]!==w||t[39]!==E||t[40]!==y||t[41]!==V||t[42]!==O||t[43]!==h?(H={state:V,open:w,setOpen:E,toggleSidebar:O,width:h,setWidth:g,isDraggingRail:_,setIsDraggingRail:v,showPushPulse:y,setShowPushPulse:b,notifySidebarFileSelected:M},t[37]=_,t[38]=w,t[39]=E,t[40]=y,t[41]=V,t[42]=O,t[43]=h,t[44]=H):H=t[44];let U;t[45]!==s||t[46]!==h?(U={"--sidebar-width":h,"--sidebar-width-icon":EO,...s},t[45]=s,t[46]=h,t[47]=U):U=t[47];let ee=U,te;t[48]===r?te=t[49]:(te=ea(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),t[48]=r,t[49]=te);let W;t[50]!==n||t[51]!==a||t[52]!==ee||t[53]!==te?(W=(0,Z.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:ee,className:te,...a,children:n}),t[50]=n,t[51]=a,t[52]=ee,t[53]=te,t[54]=W):W=t[54];let ne;return t[55]!==H||t[56]!==W?(ne=(0,Z.jsx)(MO.Provider,{value:H,children:W}),t[55]=H,t[56]=W,t[57]=ne):ne=t[57],ne}function IO(e){return!e}function LO(){return Bi()}function RO(e){let t=(0,$.c)(39),n,r,a,o,s,c;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],c=t[6]):({side:o,variant:s,collapsible:c,className:r,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=s,t[6]=c);let l=o===void 0?`left`:o,u=s===void 0?`sidebar`:s,d=c===void 0?`offcanvas`:c,{_:f}=i(),{state:p,isDraggingRail:m}=PO();if(d===`none`){let e;t[7]===r?e=t[8]:(e=ea(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),t[7]=r,t[8]=e);let i;return t[9]!==n||t[10]!==a||t[11]!==e||t[12]!==u?(i=(0,Z.jsx)(`div`,{"data-slot":`sidebar`,"data-variant":u,className:e,...a,children:n}),t[9]=n,t[10]=a,t[11]=e,t[12]=u,t[13]=i):i=t[13],i}let h=p===`collapsed`?d:``,g=u===`floating`||u===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,_;t[14]===g?_=t[15]:(_=ea(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,g,`group-data-[dragging=true]:duration-0! group-data-[dragging=true]_*:!duration-0`),t[14]=g,t[15]=_);let v;t[16]===_?v=t[17]:(v=(0,Z.jsx)(`div`,{"data-slot":`sidebar-gap`,className:_}),t[16]=_,t[17]=v);let y;t[18]===f?y=t[19]:(y=f({id:`07q4Qk`}),t[18]=f,t[19]=y);let b=u===`floating`||u===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,x;t[20]!==r||t[21]!==b?(x=ea(`fixed inset-y-0 z-10 flex h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear motion-reduce:transition-none motion-reduce:duration-0 data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,b,`group-data-[dragging=true]:duration-0! group-data-[dragging=true]_*:!duration-0`,r),t[20]=r,t[21]=b,t[22]=x):x=t[22];let S;t[23]===n?S=t[24]:(S=(0,Z.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:n}),t[23]=n,t[24]=S);let C;t[25]!==a||t[26]!==l||t[27]!==x||t[28]!==S||t[29]!==y?(C=(0,Z.jsx)(`nav`,{id:DO,"aria-label":y,"data-slot":`sidebar-container`,"data-side":l,className:x,...a,children:S}),t[25]=a,t[26]=l,t[27]=x,t[28]=S,t[29]=y,t[30]=C):C=t[30];let w;return t[31]!==m||t[32]!==l||t[33]!==p||t[34]!==C||t[35]!==h||t[36]!==v||t[37]!==u?(w=(0,Z.jsxs)(`div`,{className:`group peer text-sidebar-foreground`,"data-state":p,"data-collapsible":h,"data-variant":u,"data-side":l,"data-slot":`sidebar`,"data-dragging":m,children:[v,C]}),t[31]=m,t[32]=l,t[33]=p,t[34]=C,t[35]=h,t[36]=v,t[37]=u,t[38]=w):w=t[38],w}function zO(e){let t=(0,$.c)(34),n,r,a;t[0]===e?(n=t[1],r=t[2],a=t[3]):({className:n,onClick:r,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a);let{_:o}=i(),{toggleSidebar:s,state:c}=PO(),l,u,d,f,p,m,h,g;if(t[4]!==o||t[5]!==c){let e=Gs(`toggle-files-sidebar`);l=sa,u=`trigger`,d=`sidebar-trigger`,f=`ghost`,p=`icon-sm`,m=c===`expanded`,h=DO,g=o(c===`expanded`?{id:`4PYsOz`,values:{sidebarShortcutLabel:e}}:{id:`jbSG8V`,values:{sidebarShortcutLabel:e}}),t[4]=o,t[5]=c,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g}else l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13];let _;t[14]===n?_=t[15]:(_=ea(n),t[14]=n,t[15]=_);let v;t[16]!==r||t[17]!==s?(v=e=>{r?.(e),s()},t[16]=r,t[17]=s,t[18]=v):v=t[18];let y;t[19]===c?y=t[20]:(y=c===`expanded`?(0,Z.jsx)(Te,{}):(0,Z.jsx)(kl,{}),t[19]=c,t[20]=y);let b;return t[21]!==l||t[22]!==a||t[23]!==u||t[24]!==y||t[25]!==d||t[26]!==f||t[27]!==p||t[28]!==m||t[29]!==h||t[30]!==g||t[31]!==_||t[32]!==v?(b=(0,Z.jsx)(l,{"data-sidebar":u,"data-slot":d,variant:f,size:p,"aria-expanded":m,"aria-controls":h,"aria-label":g,className:_,onClick:v,...a,children:y}),t[21]=l,t[22]=a,t[23]=u,t[24]=y,t[25]=d,t[26]=f,t[27]=p,t[28]=m,t[29]=h,t[30]=g,t[31]=_,t[32]=v,t[33]=b):b=t[33],b}function BO(e){let t=(0,$.c)(32),n,r,a,o,s;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4],s=t[5]):({className:n,enableDrag:o,enableToggle:s,onMouseDown:r,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=s);let c=o===void 0?!0:o,l=s===void 0?!0:s,{_:u}=i(),{toggleSidebar:d,setWidth:f,state:p,width:m,setIsDraggingRail:h}=PO(),g=p===`collapsed`,_;t[6]!==c||t[7]!==l||t[8]!==h||t[9]!==f||t[10]!==g||t[11]!==d||t[12]!==m?(_={direction:`right`,enableDrag:c,enableToggle:l,onResize:f,onToggle:d,currentWidth:m,isCollapsed:g,minResizeWidth:OO,maxResizeWidth:kO,setIsDraggingRail:h,widthCookieName:AO,widthCookieMaxAge:wO},t[6]=c,t[7]=l,t[8]=h,t[9]=f,t[10]=g,t[11]=d,t[12]=m,t[13]=_):_=t[13];let{dragRef:v,handleMouseDown:y}=SO(_),b;t[14]!==u||t[15]!==p?(b=u(p===`expanded`?{id:`w3vFfL`}:{id:`e8zRrb`}),t[14]=u,t[15]=p,t[16]=b):b=t[16];let x;t[17]!==y||t[18]!==r?(x=e=>{r?.(e),e.defaultPrevented||y(e)},t[17]=y,t[18]=r,t[19]=x):x=t[19];let S;t[20]!==u||t[21]!==p?(S=u(p===`expanded`?{id:`w3vFfL`}:{id:`e8zRrb`}),t[20]=u,t[21]=p,t[22]=S):S=t[22];let C;t[23]===n?C=t[24]:(C=ea(`absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2`,`in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,`md:group-data-[variant=inset]:after:inset-y-5`,n),t[23]=n,t[24]=C);let w;return t[25]!==v||t[26]!==a||t[27]!==b||t[28]!==x||t[29]!==S||t[30]!==C?(w=(0,Z.jsx)(`button`,{ref:v,"data-sidebar":`rail`,"data-slot":`sidebar-rail`,"aria-label":b,tabIndex:-1,onMouseDown:x,title:S,className:C,...a}),t[25]=v,t[26]=a,t[27]=b,t[28]=x,t[29]=S,t[30]=C,t[31]=w):w=t[31],w}function VO(e){let t=(0,$.c)(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onAnimationEnd:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{showPushPulse:a,setShowPushPulse:o}=PO(),s;t[4]!==r||t[5]!==o?(s=e=>{r?.(e),e.animationName===`sidebar-push-pulse`&&o(!1)},t[4]=r,t[5]=o,t[6]=s):s=t[6];let c=s,l=a?``:void 0,u;t[7]===n?u=t[8]:(u=ea(`relative flex w-full flex-1 flex-col bg-background peer-data-[variant=inset]:m-2 peer-data-[variant=inset]:ml-0 peer-data-[variant=inset]:rounded-xl peer-data-[variant=inset]:shadow-sm peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,n),t[7]=n,t[8]=u);let d;return t[9]!==c||t[10]!==i||t[11]!==l||t[12]!==u?(d=(0,Z.jsx)(`main`,{"data-slot":`sidebar-inset`,"data-push-pulse":l,onAnimationEnd:c,className:u,...i}),t[9]=c,t[10]=i,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function HO(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function UO(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function WO(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function GO(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`flex w-full min-w-0 flex-col gap-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function KO(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`group/menu-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var qO=la(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-hover hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-hover active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-hover data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground data-active:hover:bg-sidebar-accent [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-hover hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-hover hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function JO(e){let t=(0,$.c)(28),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({asChild:i,isActive:a,variant:o,size:s,tooltip:c,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=i===void 0?!1:i,u=a===void 0?!1:a,d=o===void 0?`default`:o,f=s===void 0?`default`:s,p=l?na:`button`,{state:m}=PO(),h;t[8]!==n||t[9]!==f||t[10]!==d?(h=ea(qO({variant:d,size:f}),n),t[8]=n,t[9]=f,t[10]=d,t[11]=h):h=t[11];let g;t[12]!==p||t[13]!==u||t[14]!==r||t[15]!==f||t[16]!==h?(g=(0,Z.jsx)(p,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":f,"data-active":u,className:h,...r}),t[12]=p,t[13]=u,t[14]=r,t[15]=f,t[16]=h,t[17]=g):g=t[17];let _=g;if(!c)return _;if(typeof c==`string`){let e;t[18]===c?e=t[19]:(e={children:c},t[18]=c,t[19]=e),c=e}let v;t[20]===_?v=t[21]:(v=(0,Z.jsx)(Gn,{asChild:!0,children:_}),t[20]=_,t[21]=v);let y=m!==`collapsed`,b;t[22]!==y||t[23]!==c?(b=(0,Z.jsx)(Ar,{side:`right`,align:`center`,hidden:y,...c}),t[22]=y,t[23]=c,t[24]=b):b=t[24];let x;return t[25]!==v||t[26]!==b?(x=(0,Z.jsxs)(pr,{children:[v,b]}),t[25]=v,t[26]=b,t[27]=x):x=t[27],x}function YO(e){let t=null,n=!1,r=new Set;function i(e){if(e!==t){t=e;for(let e of r)e()}}e.subscribeToEvent(i);async function a(){if(!n){n=!0;try{i(await e.fetchBranch())}catch{}}}return{getSnapshot:()=>t,subscribe(e){return r.add(e),a(),()=>{r.delete(e)}}}}async function XO(){let e=await fetch(`/api/server-info`,{signal:AbortSignal.timeout(5e3)});if(!e.ok)return null;let t=await e.json(),n=bi.safeParse(t);return n.success?n.data.currentBranch??null:null}var ZO=typeof window>`u`?{getSnapshot:()=>null,subscribe:()=>()=>{}}:YO({fetchBranch:XO,subscribeToEvent:ii}),QO=ZO.subscribe,$O=ZO.getSnapshot;function ek(){return(0,Q.useSyncExternalStore)(QO,$O,$O)}function tk(){let e=(0,$.c)(6),t=ek(),n=No(),{state:r}=PO(),i=typeof window<`u`?window.okDesktop:void 0;if(i&&r===`expanded`)return null;let a;e[0]===n?a=e[1]:(a=i?.config.projectName??(n&&os(n.contentDir)||null),e[0]=n,e[1]=a);let o=a,s=i?.config.projectPath??n?.contentDir??null;if(o===null&&t===null)return null;let c;return e[2]!==t||e[3]!==o||e[4]!==s?(c={projectName:o,projectPath:s,branch:t},e[2]=t,e[3]=o,e[4]=s,e[5]=c):c=e[5],c}function nk(e){let t=(0,$.c)(23),{stats:n,selectionStats:r,showStats:a}=e,o=a===void 0?!0:a,{_:c}=i(),l=tk();if(!o&&l===null)return null;let u=r??n,d=r!=null,{words:f,chars:p,tokens:m}=u,h;t[0]!==c||t[1]!==d||t[2]!==o?(h=c(o?d?{id:`Bv5a9_`}:{id:`L1ZE3M`}:{id:`goO4Ll`}),t[0]=c,t[1]=d,t[2]=o,t[3]=h):h=t[3];let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 bottom-full h-2 bg-linear-to-t from-background to-transparent`}),t[4]=g):g=t[4];let _;t[5]===l?_=t[6]:(_=l===null?null:(0,Z.jsx)(rk,{identity:l}),t[5]=l,t[6]=_);let v;t[7]===_?v=t[8]:(v=(0,Z.jsx)(`span`,{className:`flex min-w-0 items-center gap-3`,children:_}),t[7]=_,t[8]=v);let y;t[9]!==c||t[10]!==u.chars||t[11]!==u.tokens||t[12]!==u.words||t[13]!==p||t[14]!==d||t[15]!==o||t[16]!==m||t[17]!==f?(y=o?(0,Z.jsxs)(`span`,{className:`flex items-center shrink-0 gap-3`,children:[d?(0,Z.jsx)(`span`,{className:`font-medium text-foreground/70`,"data-testid":`editor-footer-selected-label`,children:c({id:`ylXj1N`})}):null,(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`tabular-nums`,children:u.words.toLocaleString()}),` `,(0,Z.jsx)(s,{id:`gljvbT`,values:{words:f}})]}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`tabular-nums`,children:u.chars.toLocaleString()}),` `,(0,Z.jsx)(s,{id:`d5rK4X`,values:{chars:p}})]}),(0,Z.jsxs)(`span`,{children:[u.tokens>0?`~`:``,(0,Z.jsx)(`span`,{className:`tabular-nums`,children:u.tokens.toLocaleString()}),` `,(0,Z.jsx)(s,{id:`uynXup`,values:{tokens:m}})]})]}):null,t[9]=c,t[10]=u.chars,t[11]=u.tokens,t[12]=u.words,t[13]=p,t[14]=d,t[15]=o,t[16]=m,t[17]=f,t[18]=y):y=t[18];let b;return t[19]!==h||t[20]!==v||t[21]!==y?(b=(0,Z.jsxs)(`section`,{"aria-label":h,className:`relative flex h-6 shrink-0 items-center justify-between gap-3 bg-background px-3 text-2xs text-muted-foreground`,children:[g,v,y]}),t[19]=h,t[20]=v,t[21]=y,t[22]=b):b=t[22],b}function rk(e){let t=(0,$.c)(8),{identity:n}=e,{projectName:r,projectPath:i,branch:a}=n,o;t[0]!==r||t[1]!==i?(o=r===null?null:i?(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(`span`,{tabIndex:0,className:`truncate`,"data-testid":`editor-footer-project-name`,children:r})}),(0,Z.jsx)(Ar,{side:`top`,className:`max-w-xs break-all`,children:i})]}):(0,Z.jsx)(`span`,{className:`truncate`,"data-testid":`editor-footer-project-name`,children:r}),t[0]=r,t[1]=i,t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=a===null?null:(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,"data-testid":`editor-footer-branch`,children:[(0,Z.jsx)(Be,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:a})]}),t[3]=a,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,Z.jsxs)(Z.Fragment,{children:[o,s]}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function ik(e){let t=(0,$.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{_:a}=i(),o;t[3]===a?o=t[4]:(o=a({id:`3__SjS`}),t[3]=a,t[4]=o);let s;t[5]===n?s=t[6]:(s=ea(n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==o||t[9]!==s?(c=(0,Z.jsx)(`nav`,{"aria-label":o,"data-slot":`breadcrumb`,className:s,...r}),t[7]=r,t[8]=o,t[9]=s,t[10]=c):c=t[10],c}function ak(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`ol`,{"data-slot":`breadcrumb-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ok(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`inline-flex items-center gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`li`,{"data-slot":`breadcrumb-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function sk(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({current:i,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0||i?`page`:void 0,o;t[4]===n?o=t[5]:(o=ea(`font-normal text-foreground`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(`span`,{"data-slot":`breadcrumb-page`,"aria-current":a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function ck(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,className:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=ea(`[&>svg]:size-3.5`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=n??(0,Z.jsx)(Os,{}),t[6]=n,t[7]=o);let s;return t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,Z.jsx)(`li`,{"data-slot":`breadcrumb-separator`,role:`presentation`,"aria-hidden":`true`,className:a,...i,children:o}),t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s}var lk=1,uk=2,dk=4;function fk(e){let t=(0,$.c)(18),{docName:n,className:r}=e;if(!n)return null;let i,a,o,s,c,l;if(t[0]!==r||t[1]!==n){l=Symbol.for(`react.early_return_sentinel`);bb0:{let{prefix:e}=Qt(n,``);if(!e){l=null;break bb0}let u=e.replace(/\/$/,``).split(`/`).filter(Boolean);if(u.length===0){l=null;break bb0}let d=(e,t)=>({kind:`segment`,value:e,key:u.slice(0,t+1).join(`/`)}),f=u.length>dk?[...u.slice(0,lk).map((e,t)=>d(e,t)),{kind:`ellipsis`,hidden:u.slice(lk,-uk)},...u.slice(-uk).map((e,t)=>d(e,u.length-uk+t))]:u.map((e,t)=>d(e,t));a=ik,t[8]===r?c=t[9]:(c=ea(`flex min-w-0 items-center`,r),t[8]=r,t[9]=c),i=ak,o=`min-w-0 flex-nowrap gap-1 overflow-hidden text-muted-foreground/70 text-xs`,s=f.map(pk)}t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7];if(l!==Symbol.for(`react.early_return_sentinel`))return l;let u;t[10]!==i||t[11]!==o||t[12]!==s?(u=(0,Z.jsx)(i,{className:o,children:s}),t[10]=i,t[11]=o,t[12]=s,t[13]=u):u=t[13];let d;return t[14]!==a||t[15]!==c||t[16]!==u?(d=(0,Z.jsx)(a,{className:c,children:u}),t[14]=a,t[15]=c,t[16]=u,t[17]=d):d=t[17],d}function pk(e,t){let n=e.kind===`segment`?e.key:`ellipsis`;return(0,Z.jsxs)(Q.Fragment,{children:[t>0&&(0,Z.jsx)(ck,{className:`shrink-0 text-muted-foreground/70 [&>svg]:size-3`}),e.kind===`ellipsis`?(0,Z.jsxs)(ok,{className:`shrink-0`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,title:e.hidden.join(` / `),className:`flex size-4 items-center justify-center text-muted-foreground/70`,children:(0,Z.jsx)(al,{className:`size-3.5`})}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.hidden.join(` / `)})]}):(0,Z.jsx)(ok,{className:`min-w-0`,children:(0,Z.jsx)(sk,{current:!1,className:`min-w-0 truncate font-normal text-muted-foreground/70`,title:e.value,children:e.value})})]},n)}var mk={fill:`none`,height:24,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`},hk=e=>{let t=(0,$.c)(15),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({color:a,size:o,strokeWidth:s,absoluteStrokeWidth:n,className:c,children:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`currentColor`:a,u=o===void 0?24:o,d=s===void 0?2:s,f=c===void 0?``:c,p=n?Number(d)*24/Number(u):d,m;return t[8]!==r||t[9]!==f||t[10]!==l||t[11]!==i||t[12]!==u||t[13]!==p?(m=(0,Z.jsx)(`svg`,{"aria-hidden":`true`,...mk,className:f,height:u,stroke:l,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:p,width:u,...i,children:r}),t[8]=r,t[9]=f,t[10]=l,t[11]=i,t[12]=u,t[13]=p,t[14]=m):m=t[14],m},gk=e=>{let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Markdown`}),r=(0,Z.jsx)(`path`,{d:`M232,48H24A16,16,0,0,0,8,64V192a16,16,0,0,0,16,16H232a16,16,0,0,0,16-16V64A16,16,0,0,0,232,48Zm0,144H24V64H232V192ZM128,104v48a8,8,0,0,1-16,0V123.31L93.66,141.66a8,8,0,0,1-11.32,0L64,123.31V152a8,8,0,0,1-16,0V104a8,8,0,0,1,13.66-5.66L88,124.69l26.34-26.35A8,8,0,0,1,128,104Zm77.66,18.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L168,132.69V104a8,8,0,0,1,16,0v28.69l10.34-10.35A8,8,0,0,1,205.66,122.34Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(hk,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i},_k=e=>{let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Textbox`}),r=(0,Z.jsx)(`path`,{d:`M112,40a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80v96a16,16,0,0,0,16,16h80v16a8,8,0,0,0,16,0V48A8,8,0,0,0,112,40ZM24,176V80h80v96ZM248,80v96a16,16,0,0,1-16,16H144a8,8,0,0,1,0-16h88V80H144a8,8,0,0,1,0-16h88A16,16,0,0,1,248,80ZM88,112a8,8,0,0,1-8,8H72v24a8,8,0,0,1-16,0V120H48a8,8,0,0,1,0-16H80A8,8,0,0,1,88,112Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(hk,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i};function vk(e){let t=(0,$.c)(90),{activeDocName:n,isSourceMode:r,sourceDisabled:a,onModeChange:o,showAddPropertyButton:c,onAddProperty:l,isPanelCollapsed:u,onTogglePanel:d}=e,{_:f}=i(),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=Us(`toggle-document-panel`),t[0]=p):p=t[0];let m=p,h,g,_,v,y,b,x,S,C,w,T,E,D,O;if(t[1]!==f||t[2]!==n||t[3]!==u||t[4]!==r||t[5]!==l||t[6]!==o||t[7]!==d||t[8]!==c||t[9]!==a){let e=Gs(`toggle-document-panel`);v=`editor-toolbar`,y=`pointer-events-none absolute inset-x-0 top-0 z-10`;let i;t[24]===n?i=t[25]:(i=(0,Z.jsx)(`div`,{className:`pointer-events-auto flex min-w-0 items-center`,children:(0,Z.jsx)(fk,{docName:n})}),t[24]=n,t[25]=i);let p=r?`source`:`wysiwyg`,m;t[26]===o?m=t[27]:(m=e=>{e&&o(e)},t[26]=o,t[27]=m);let k;t[28]===f?k=t[29]:(k=f({id:`n7aopT`}),t[28]=f,t[29]=k);let A;t[30]===f?A=t[31]:(A=f({id:`ur2XSb`}),t[30]=f,t[31]=A);let j;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Z.jsx)(Gn,{children:(0,Z.jsx)(_k,{className:`size-4`})}),t[32]=j):j=t[32];let M;t[33]===A?M=t[34]:(M=(0,Z.jsx)(hs,{value:`wysiwyg`,"aria-label":A,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,asChild:!0,children:j}),t[33]=A,t[34]=M);let N;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Z.jsx)(Ar,{side:`bottom`,children:(0,Z.jsx)(s,{id:`Mb_20S`})}),t[35]=N):N=t[35];let P;t[36]===M?P=t[37]:(P=(0,Z.jsxs)(pr,{children:[M,N]}),t[36]=M,t[37]=P);let F;t[38]===f?F=t[39]:(F=f({id:`xbdtfY`}),t[38]=f,t[39]=F);let I;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(gk,{className:`size-4`}),t[40]=I):I=t[40];let L;t[41]!==a||t[42]!==F?(L=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(`div`,{children:(0,Z.jsx)(hs,{value:`source`,"aria-label":F,disabled:a,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,children:I})})}),t[41]=a,t[42]=F,t[43]=L):L=t[43];let R;t[44]===a?R=t[45]:(R=(0,Z.jsx)(Ar,{side:`bottom`,children:a?(0,Z.jsx)(s,{id:`G-JBA1`}):(0,Z.jsx)(s,{id:`u6Hp4N`})}),t[44]=a,t[45]=R);let z;t[46]!==L||t[47]!==R?(z=(0,Z.jsxs)(pr,{children:[L,R]}),t[46]=L,t[47]=R,t[48]=z):z=t[48];let B;t[49]!==p||t[50]!==m||t[51]!==k||t[52]!==P||t[53]!==z?(B=(0,Z.jsx)(`div`,{className:`pointer-events-auto flex justify-center`,children:(0,Z.jsxs)(_s,{type:`single`,value:p,onValueChange:m,"aria-label":k,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 data-[size=sm]:rounded-[10px] bg-muted p-0.5`,children:[P,z]})}),t[49]=p,t[50]=m,t[51]=k,t[52]=P,t[53]=z,t[54]=B):B=t[54],t[55]!==i||t[56]!==B?(b=(0,Z.jsx)(`div`,{className:`editor-content-aligned bg-background py-2`,children:(0,Z.jsxs)(`div`,{className:`grid grid-cols-3 items-center`,children:[i,B]})}),t[55]=i,t[56]=B,t[57]=b):b=t[57],O=`pointer-events-auto absolute top-0 right-0 flex items-center justify-end gap-1 py-2 pr-2`,t[58]!==f||t[59]!==l||t[60]!==c?(_=c&&(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(sa,{variant:`ghost`,size:`icon`,"aria-label":f({id:`81H_23`}),onClick:l,"data-testid":`add-properties-button`,asChild:!0,children:(0,Z.jsx)(Gn,{children:(0,Z.jsx)(Sl,{})})}),(0,Z.jsx)(Ar,{side:`bottom`,children:(0,Z.jsx)(s,{id:`81H_23`})})]}),t[58]=f,t[59]=l,t[60]=c,t[61]=_):_=t[61],g=pr,h=sa,x=``,S=`ghost`,C=`icon`,w=d,T=!u,E=`doc-panel`,D=f(u?{id:`u7H-Wn`,values:{panelShortcutLabel:e}}:{id:`2hpdRq`,values:{panelShortcutLabel:e}}),t[1]=f,t[2]=n,t[3]=u,t[4]=r,t[5]=l,t[6]=o,t[7]=d,t[8]=c,t[9]=a,t[10]=h,t[11]=g,t[12]=_,t[13]=v,t[14]=y,t[15]=b,t[16]=x,t[17]=S,t[18]=C,t[19]=w,t[20]=T,t[21]=E,t[22]=D,t[23]=O}else h=t[10],g=t[11],_=t[12],v=t[13],y=t[14],b=t[15],x=t[16],S=t[17],C=t[18],w=t[19],T=t[20],E=t[21],D=t[22],O=t[23];let k;t[62]===u?k=t[63]:(k=(0,Z.jsx)(Gn,{children:u?(0,Z.jsx)(jl,{}):(0,Z.jsx)(Al,{})}),t[62]=u,t[63]=k);let A;t[64]!==h||t[65]!==k||t[66]!==x||t[67]!==S||t[68]!==C||t[69]!==w||t[70]!==T||t[71]!==E||t[72]!==D?(A=(0,Z.jsx)(h,{"data-doc-panel-toggle":x,variant:S,size:C,onClick:w,"aria-expanded":T,"aria-controls":E,"aria-label":D,asChild:!0,children:k}),t[64]=h,t[65]=k,t[66]=x,t[67]=S,t[68]=C,t[69]=w,t[70]=T,t[71]=E,t[72]=D,t[73]=A):A=t[73];let j;t[74]===u?j=t[75]:(j=(0,Z.jsx)(Ar,{side:`bottom`,children:u?(0,Z.jsx)(s,{id:`KFdXwz`,values:{panelShortcut:m}}):(0,Z.jsx)(s,{id:`MsuXaI`,values:{panelShortcut:m}})}),t[74]=u,t[75]=j);let M;t[76]!==g||t[77]!==A||t[78]!==j?(M=(0,Z.jsxs)(g,{children:[A,j]}),t[76]=g,t[77]=A,t[78]=j,t[79]=M):M=t[79];let N;t[80]!==_||t[81]!==M||t[82]!==O?(N=(0,Z.jsxs)(`div`,{className:O,children:[_,M]}),t[80]=_,t[81]=M,t[82]=O,t[83]=N):N=t[83];let P;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none h-2 bg-linear-to-b from-background to-transparent`}),t[84]=P):P=t[84];let F;return t[85]!==v||t[86]!==y||t[87]!==b||t[88]!==N?(F=(0,Z.jsxs)(`div`,{"data-testid":v,className:y,children:[b,N,P]}),t[85]=v,t[86]=y,t[87]=b,t[88]=N,t[89]=F):F=t[89],F}function yk(e){let{activeDocName:t,deferredActiveDocName:n,mountResolved:r,syncResolved:i}=e;return t===null||t===n?!1:!(r&&i)}var bk=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityModeContent-Zo-ELIQV.js`),__vite__mapDeps([34,1,2,35,36,37,22,38,39,40,41,21,6,3,7,4,10,12,9,42,43]),import.meta.url)).ActivityModeContent}));function xk(e){let t=(0,$.c)(5),n;t[0]===e?n=t[1]:(n=(0,Z.jsx)(Ck,{...e}),t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(Sk,{}),t[2]=r):r=t[2];let i;return t[3]===n?i=t[4]:(i=(0,Z.jsx)(G,{name:`editor-area`,children:(0,Z.jsxs)(OS,{children:[n,r]})}),t[3]=n,t[4]=i),i}function Sk(){let e=(0,$.c)(5),t=Nh(),n;e[0]===t?n=e[1]:(n=e=>{e||t.close()},e[0]=t,e[1]=n);let r;return e[2]!==t.open||e[3]!==n?(r=(0,Z.jsx)(zS,{open:t.open,onOpenChange:n}),e[2]=t.open,e[3]=n,e[4]=r):r=e[4],r}function Ck(e){let t=(0,$.c)(144),{editorMode:n,onModeChange:r,activeTab:a,onActiveTabChange:o,onSaveVersion:c,saving:l}=e,{_:u}=i(),{activeDocName:d,activeProvider:f,activeTarget:p,recycleDocument:m,docPanelMode:h,docPanelAgentId:g,docPanelExpandSignal:_}=yt(),{openDocumentTransition:v}=Mt(),{requestAddProperty:y}=AS(),b=mC(f,d),x=_C(d,n===`source`?`source`:`wysiwyg`),S=LC(f),C=S===`connected`||S===`synced`,w=gC(d)===`conflict`,T=(0,Q.useDeferredValue)(d),E=p?.kind===`missing`,D=!!d&&p?.kind!==`folder`,O;t[0]!==u||t[1]!==E?(O=E?u({id:`K-a33w`}):void 0,t[0]=u,t[1]=E,t[2]=O):O=t[2];let k=O,[A]=(0,Q.useState)(Tk),j=A!==null,M;t[3]===A?M=t[4]:(M=()=>EC(A,window.innerWidth,`right`),t[3]=A,t[4]=M);let[N,P]=(0,Q.useState)(M),F=(0,Q.useRef)(N),I,L;t[5]===N?(I=t[6],L=t[7]):(I=()=>{F.current=N},L=[N],t[5]=N,t[6]=I,t[7]=L),(0,Q.useEffect)(I,L);let R=kb(),z;t[8]===N?z=t[9]:(z=()=>FC(`right`,N,NC())===`collapsed`,t[8]=N,t[9]=z);let[B]=(0,Q.useState)(z),[V,H]=(0,Q.useState)(B),U=(0,Q.useRef)(V),ee,te;t[10]===V?(ee=t[11],te=t[12]):(ee=()=>{U.current=V},te=[V],t[10]=V,t[11]=ee,t[12]=te),(0,Q.useEffect)(ee,te);let[W,ne]=(0,Q.useState)(!1),re=(0,Q.useRef)(!1),[G]=(0,Q.useState)(wk),ie=(0,Q.useRef)(G),q=(0,Q.useRef)(null),ae;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(ae=function(e){q.current!=null&&clearTimeout(q.current),q.current=setTimeout(()=>{xC(e),q.current=null},100)},t[13]=ae):ae=t[13];let oe=ae,se,ce;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(ce=()=>()=>{q.current!=null&&clearTimeout(q.current)},se=[],t[14]=se,t[15]=ce):(se=t[14],ce=t[15]),(0,Q.useEffect)(ce,se);let[le,ue]=(0,Q.useState)(null),de;t[16]!==V||t[17]!==R?(de=function(){if(R.current==null)return;let e=F.current;V?(IC(`right`,e,`open`),R.current?.expand()):(IC(`right`,e,`collapsed`),R.current?.collapse())},t[16]=V,t[17]=R,t[18]=de):de=t[18];let fe=de,pe,me;t[19]!==A||t[20]!==R?(pe=()=>{let e=window.matchMedia(`(min-width: ${wC}px)`),t=()=>{let e=EC(A,window.innerWidth,`right`);P(e);let t=FC(`right`,e,NC())===`collapsed`;H(t),t?R.current?.collapse():R.current?.expand()};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},me=[A,R],t[19]=A,t[20]=R,t[21]=pe,t[22]=me):(pe=t[21],me=t[22]),(0,Q.useEffect)(pe,me);let he,ge;t[23]!==le||t[24]!==j||t[25]!==R?(he=()=>{if(le==null||j)return;let e=new ResizeObserver(()=>{U.current||re.current||R.current?.resize(`${ie.current}px`)});return e.observe(le),()=>e.disconnect()},ge=[le,j,R],t[23]=le,t[24]=j,t[25]=R,t[26]=he,t[27]=ge):(he=t[26],ge=t[27]),(0,Q.useEffect)(he,ge);let _e,ve;t[28]!==o||t[29]!==R?(_e=()=>{let e=e=>{o(e),R.current?.expand()},t=Mm();return t&&e(t),Pm(t=>{Mm(),e(t)})},ve=[o,R],t[28]=o,t[29]=R,t[30]=_e,t[31]=ve):(_e=t[30],ve=t[31]),(0,Q.useEffect)(_e,ve);let ye,be;t[32]!==_||t[33]!==R?(ye=()=>{_!==0&&R.current?.expand()},be=[_,R],t[32]=_,t[33]=R,t[34]=ye,t[35]=be):(ye=t[34],be=t[35]),(0,Q.useEffect)(ye,be);let xe,Se;t[36]===V?(xe=t[37],Se=t[38]):(xe=()=>{if(!V||!document.getElementById(`doc-panel`)?.contains(document.activeElement))return;let e=document.querySelector(`[data-doc-panel-toggle]`);if(e){e.focus();return}document.querySelector(`[data-sidebar="trigger"]`)?.focus()},Se=[V],t[36]=V,t[37]=xe,t[38]=Se),(0,Q.useLayoutEffect)(xe,Se);let Ce,we;t[39]===V?(Ce=t[40],we=t[41]):(Ce=()=>{window.okDesktop!=null&&window.okDesktop.editor.notifyViewMenuStateChanged({docPanelVisible:!V})},we=[V],t[39]=V,t[40]=Ce,t[41]=we),(0,Q.useEffect)(Ce,we);let Te,Ee;t[42]===fe?(Te=t[43],Ee=t[44]):(Te=()=>{if(window.okDesktop!=null)return window.okDesktop.onMenuAction(e=>{e===`toggle-doc-panel`&&fe()})},Ee=[fe],t[42]=fe,t[43]=Te,t[44]=Ee),(0,Q.useEffect)(Te,Ee);let De,Oe;t[45]===fe?(De=t[46],Oe=t[47]):(De=()=>{if(window.okDesktop!=null)return;let e=e=>{Ws(e,`toggle-document-panel`)&&(e.preventDefault(),fe())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},Oe=[fe],t[45]=fe,t[46]=De,t[47]=Oe),(0,Q.useEffect)(De,Oe);let ke=(0,Q.useRef)(null),[Ae,je]=(0,Q.useState)(null),Me=p?.kind===`large-file`?p.docName:d,Ne,Pe;t[48]===Me?(Ne=t[49],Pe=t[50]):(Ne=()=>{if(Me&&Me!==ke.current){let e=ke.current;ke.current=Me,je(e)}},Pe=[Me],t[48]=Me,t[49]=Ne,t[50]=Pe),(0,Q.useEffect)(Ne,Pe);let Fe;t[51]===v?Fe=t[52]:(Fe=function(e){let t=yr(e);window.location.hash===t?v(e):window.location.hash=t},t[51]=v,t[52]=Fe);let Ie=Fe;if(p?.kind===`large-file`){let e;t[53]!==Ie||t[54]!==Ae?(e=Ae?{previousDocName:Ae,onNavigateBack:Ie}:void 0,t[53]=Ie,t[54]=Ae,t[55]=e):e=t[55];let n;return t[56]!==p.docName||t[57]!==p.limit||t[58]!==p.size||t[59]!==e?(n=(0,Z.jsx)(wS,{docName:p.docName,size:p.size,limit:p.limit,backNav:e}),t[56]=p.docName,t[57]=p.limit,t[58]=p.size,t[59]=e,t[60]=n):n=t[60],n}if(p?.kind===`folder`){if(!(h===`agent`&&g!==null)){let e;return t[61]===p.folderPath?e=t[62]:(e=(0,Z.jsx)(bS,{folderPath:p.folderPath}),t[61]=p.folderPath,t[62]=e),e}let e;t[63]===p.folderPath?e=t[64]:(e=(0,Z.jsx)(GS,{minSize:`30%`,defaultSize:`75%`,children:(0,Z.jsx)(bS,{folderPath:p.folderPath})}),t[63]=p.folderPath,t[64]=e);let n;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(KS,{withHandle:!0}),t[65]=n):n=t[65];let r;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(GS,{defaultSize:`25%`,minSize:`300px`,maxSize:`40%`,className:`flex flex-col bg-muted/20`,children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{role:`status`,"aria-busy":`true`,className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`ONPvOb`})}),children:(0,Z.jsx)(bk,{showBackButton:!1})})}),t[66]=r):r=t[66];let i;return t[67]===e?i=t[68]:(i=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1`,children:(0,Z.jsxs)(WS,{orientation:`horizontal`,children:[e,n,r]})}),t[67]=e,t[68]=i),i}if(p?.kind===`asset`){let e;return t[69]!==p.assetPath||t[70]!==p.mediaKind?(e=(0,Z.jsx)(Bb,{assetPath:p.assetPath,mediaKind:p.mediaKind},p.assetPath),t[69]=p.assetPath,t[70]=p.mediaKind,t[71]=e):e=t[71],e}if(!f||!d){if((typeof window<`u`?pi(window.location.hash):null)!==null){let e;return t[72]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Vb,{}),t[72]=e):e=t[72],e}let e;return t[73]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Vx,{}),t[73]=e):e=t[73],e}let Le=n===`source`,Re=!C,ze=V,Be;t[74]!==d||t[75]!==y?(Be=function(){d&&y(d)},t[74]=d,t[75]=y,t[76]=Be):Be=t[76];let Ve=Be,Ue=T??d,We=Ae??void 0,Ge;t[77]!==k||t[78]!==Le||t[79]!==Ie||t[80]!==m||t[81]!==Ue||t[82]!==We?(Ge=(0,Z.jsx)(lO,{activeDocName:Ue,isSourceMode:Le,editorPlaceholder:k,previousDocName:We,onNavigateBack:Ie,onRecycle:m}),t[77]=k,t[78]=Le,t[79]=Ie,t[80]=m,t[81]=Ue,t[82]=We,t[83]=Ge):Ge=t[83];let Ke;t[84]!==d||t[85]!==Le?(Ke=(0,Z.jsx)(uC,{activeDocName:d,isSourceMode:Le}),t[84]=d,t[85]=Le,t[86]=Ke):Ke=t[86];let qe;t[87]!==d||t[88]!==T?(qe=yk({activeDocName:d,deferredActiveDocName:T,mountResolved:d!==null&&K(d),syncResolved:d!==null&&He(d)})?(0,Z.jsxs)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:[(0,Z.jsx)(Vb,{}),d===null?null:(0,Z.jsx)(TS,{docName:d})]}):null,t[87]=d,t[88]=T,t[89]=qe):qe=t[89];let Je;t[90]!==Ge||t[91]!==Ke||t[92]!==qe?(Je=(0,Z.jsxs)(`div`,{className:`relative h-full`,children:[Ge,Ke,qe]}),t[90]=Ge,t[91]=Ke,t[92]=qe,t[93]=Je):Je=t[93];let Ye;t[94]!==d||t[95]!==w||t[96]!==ze||t[97]!==Le||t[98]!==r||t[99]!==Ve||t[100]!==Re||t[101]!==fe?(Ye=!w&&(0,Z.jsx)(vk,{activeDocName:d,isSourceMode:Le,sourceDisabled:Re,onModeChange:r,showAddPropertyButton:!Le,onAddProperty:Ve,isPanelCollapsed:ze,onTogglePanel:fe}),t[94]=d,t[95]=w,t[96]=ze,t[97]=Le,t[98]=r,t[99]=Ve,t[100]=Re,t[101]=fe,t[102]=Ye):Ye=t[102];let Xe;t[103]!==Je||t[104]!==Ye?(Xe=(0,Z.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[Je,Ye]}),t[103]=Je,t[104]=Ye,t[105]=Xe):Xe=t[105];let Ze;t[106]!==x||t[107]!==D||t[108]!==b?(Ze=(0,Z.jsx)(nk,{stats:b,selectionStats:x,showStats:D}),t[106]=x,t[107]=D,t[108]=b,t[109]=Ze):Ze=t[109];let Qe;t[110]!==Xe||t[111]!==Ze?(Qe=(0,Z.jsxs)(`div`,{className:`relative flex h-full flex-col`,children:[Xe,Ze]}),t[110]=Xe,t[111]=Ze,t[112]=Qe):Qe=t[112];let $e=Qe,et=W||void 0,tt;t[113]===B?tt=t[114]:(tt=B?{defaultSize:`100%`}:{},t[113]=B,t[114]=tt);let nt=W?void 0:`transition-[flex-grow] duration-200 ease-out motion-reduce:transition-none motion-reduce:duration-0`,rt;t[115]!==$e||t[116]!==tt||t[117]!==nt?(rt=(0,Z.jsx)(GS,{minSize:`30%`,...tt,className:nt,children:$e}),t[115]=$e,t[116]=tt,t[117]=nt,t[118]=rt):rt=t[118];let it=j&&V,at;t[119]===Symbol.for(`react.memo_cache_sentinel`)?(at=()=>{ne(!0),re.current=!0;let e=()=>{ne(!1),re.current=!1,window.removeEventListener(`pointerup`,e)};window.addEventListener(`pointerup`,e)},t[119]=at):at=t[119];let J;t[120]===it?J=t[121]:(J=(0,Z.jsx)(KS,{withHandle:!0,disabled:it,onPointerDown:at}),t[120]=it,t[121]=J);let ot=B?0:`${G}px`,st;t[122]===Symbol.for(`react.memo_cache_sentinel`)?(st=e=>{H(e.asPercentage===0),e.inPixels>0&&re.current&&(ie.current=e.inPixels,oe(e.inPixels))},t[122]=st):st=t[122];let ct=!W&&`transition-[flex-grow] duration-200 ease-out motion-reduce:transition-none motion-reduce:duration-0`,lt;t[123]===ct?lt=t[124]:(lt=ea(`flex flex-col bg-muted/20`,ct),t[123]=ct,t[124]=lt);let ut;t[125]!==d||t[126]!==a||t[127]!==h||t[128]!==Le||t[129]!==o||t[130]!==c||t[131]!==l?(ut=(0,Z.jsx)(Fv,{docName:d,isSourceMode:Le,activeTab:a,onActiveTabChange:o,mode:h,onSaveVersion:c,saving:l}),t[125]=d,t[126]=a,t[127]=h,t[128]=Le,t[129]=o,t[130]=c,t[131]=l,t[132]=ut):ut=t[132];let dt;t[133]!==V||t[134]!==R||t[135]!==ot||t[136]!==lt||t[137]!==ut?(dt=(0,Z.jsx)(GS,{id:`doc-panel`,panelRef:R,defaultSize:ot,minSize:`300px`,maxSize:`600px`,collapsible:!0,collapsedSize:0,onResize:st,inert:V,className:lt,children:ut}),t[133]=V,t[134]=R,t[135]=ot,t[136]=lt,t[137]=ut,t[138]=dt):dt=t[138];let ft;return t[139]!==et||t[140]!==rt||t[141]!==J||t[142]!==dt?(ft=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1`,ref:ue,children:(0,Z.jsxs)(WS,{orientation:`horizontal`,"data-dragging":et,children:[rt,J,dt]})}),t[139]=et,t[140]=rt,t[141]=J,t[142]=dt,t[143]=ft):ft=t[143],ft}function wk(){return SC()}function Tk(){return Bi()}function Ek(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.kind!==i.kind)return!1;if(r.kind===`human`&&i.kind===`human`){if(r.clientId!==i.clientId||r.mode!==i.mode||r.tabCount!==i.tabCount)return!1;let e=r.user,t=i.user;if(e.name!==t.name||e.color!==t.color||e.icon!==t.icon)return!1}else if(r.kind===`agent`&&i.kind===`agent`){if(r.agentId!==i.agentId)return!1;let e=r.presence,t=i.presence;if(e.displayName!==t.displayName||e.icon!==t.icon||e.color!==t.color||e.currentDoc!==t.currentDoc||e.mode!==t.mode)return!1}}return!0}function Dk(e){let t=new Map;for(let n of e){let e=n.user.principalId;if(typeof e==`string`&&e.length>0){let r=t.get(e);r?r.push(n):t.set(e,[n])}}let n=new Map;for(let[e,r]of t){let t=r.reduce((e,t)=>Math.min(e,t.clientId),1/0);n.set(e,{repClientId:t,count:r.length})}let r=[];for(let t of e){let e=t.user.principalId;if(typeof e==`string`&&e.length>0){let i=n.get(e);i&&i.repClientId===t.clientId&&r.push({...t,tabCount:i.count})}else r.push({...t,tabCount:1})}return r}var Ok=1e3,kk=!1;function Ak(e){return!!(e.localPrincipalId&&e.entryPrincipalId===e.localPrincipalId||!e.localPrincipalId&&e.entryClientId===e.localClientId)}function jk(e,t,n){let r=(0,$.c)(9),i;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={current:[],crossDoc:[]},r[0]=i):i=r[0];let[a,o]=(0,Q.useState)(i),s;r[1]!==n||r[2]!==e?.awareness||r[3]!==t?.awareness?(s=()=>{let r=e?.awareness,i=t?.awareness,a;i==null?a=void 0:Sa(i)?a=i:(a=void 0,kk||(kk=!0,console.warn(`[agent-presence] __system__ provider awareness missing getStates() — presence bar will render without agent peers`)));let s=()=>{let e=(r?.getLocalState())?.user?.principalId??null,t=r?.clientID??null,i=[];if(r)for(let[n,a]of r.getStates().entries()){let r=a;if(!r.user||typeof r.user!=`object`)continue;let o=r.user;o.type===`human`&&(Ak({entryPrincipalId:o.principalId,entryClientId:n,localPrincipalId:e,localClientId:t})||i.push({kind:`human`,clientId:n,user:o,mode:r.mode??`wysiwyg`,tabCount:1}))}let s=Dk(i),{current:c,crossDoc:l}=a?_a(a,n,Date.now()):{current:[],crossDoc:[]},u=Mk,d=c.map(u),f=l.map(u),p=[...s,...d],m=f;o(e=>Ek(e.current,p)&&Ek(e.crossDoc,m)?e:{current:p,crossDoc:m})};s();let c=()=>s(),l=()=>s();r?.on(`change`,c),t?.awareness?.on(`change`,l);let u=setInterval(s,Ok);return()=>{r?.off(`change`,c),t?.awareness?.off(`change`,l),clearInterval(u)}},r[1]=n,r[2]=e?.awareness,r[3]=t?.awareness,r[4]=s):s=r[4];let c;return r[5]!==n||r[6]!==e||r[7]!==t?(c=[e,t,n],r[5]=n,r[6]=e,r[7]=t,r[8]=c):c=r[8],(0,Q.useEffect)(s,c),a}function Mk(e){let{agentId:t,entry:n}=e;return{kind:`agent`,agentId:t,presence:n}}var Nk=`sync-status`;function Pk(e,t){let n=(0,$.c)(5),{_:r}=i(),a=(0,Q.useRef)(!1),o=(0,Q.useRef)(!1),s=(0,Q.useRef)(t),c,l;n[0]!==r||n[1]!==t||n[2]!==e?(c=()=>{s.current!==t&&(s.current=t,a.current=!1,o.current=!1),t&&(e===`synced`&&(a.current=!0),e===`disconnected`&&a.current?(o.current=!0,X.warning(r({id:`HGNCsl`}),{id:Nk,duration:1/0})):o.current&&e===`synced`&&(o.current=!1,X.success(r({id:`GhjUB_`}),{id:Nk,duration:3e3})))},l=[e,t,r],n[0]=r,n[1]=t,n[2]=e,n[3]=c,n[4]=l):(c=n[3],l=n[4]),(0,Q.useEffect)(c,l)}var Fk=4,Ik=3,Lk={Bird:Wc,Cat:Xc,Dog:il,Fish:ll,Mouse:Il,Rabbit:Fl,Shrimp:Ul,Snail:Wl,Squirrel:ql,Turtle:Ql};Object.freeze(Object.keys(Lk));function Rk(e){if(typeof e.principalId==`string`&&e.principalId.length>0)return{kind:`initials`};let t=e.name.split(` `)[1];return t&&Object.hasOwn(Lk,t)?{kind:`animal`,animal:t}:{kind:`initials`}}var zk={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`,bot:`Agent`};function Bk(e){let t=(0,$.c)(28),{user:n,mode:r,tabCount:a}=e,{_:o}=i(),s=Rk(n),c=s.kind===`animal`?Lk[s.animal]:void 0,l;t[0]===n.name?l=t[1]:(l=Ur(n.name),t[0]=n.name,t[1]=l);let u=l,d;t[2]===n.color?d=t[3]:(d=ni(n.color),t[2]=n.color,t[3]=d);let f=d,p=n.name,m;t[4]!==o||t[5]!==a||t[6]!==p?(m=a>1?o({id:`qAhFeg`,values:{userName:p,tabCount:a}}):p,t[4]=o,t[5]=a,t[6]=p,t[7]=m):m=t[7];let h=m,g;t[8]!==o||t[9]!==a||t[10]!==p?(g=a>1?o({id:`BEkF-P`,values:{userName:p,tabCount:a}}):p,t[8]=o,t[9]=a,t[10]=p,t[11]=g):g=t[11];let _=g,v;t[12]===n.color?v=t[13]:(v={backgroundColor:n.color},t[12]=n.color,t[13]=v);let y;t[14]!==c||t[15]!==f||t[16]!==u?(y=c?(0,Z.jsx)(c,{size:18,color:f,strokeWidth:1.5}):(0,Z.jsx)(`span`,{className:`font-mono text-2xs font-semibold leading-none`,style:{color:f},children:u}),t[14]=c,t[15]=f,t[16]=u,t[17]=y):y=t[17];let b;t[18]!==_||t[19]!==r||t[20]!==v||t[21]!==y?(b=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(`div`,{"data-presence-badge":`human`,"data-presence-mode":r,role:`img`,"aria-label":_,className:`inline-flex size-7 shrink-0 cursor-default items-center justify-center rounded-full ring-2 ring-background`,style:v,children:y})}),t[18]=_,t[19]=r,t[20]=v,t[21]=y,t[22]=b):b=t[22];let x;t[23]===h?x=t[24]:(x=(0,Z.jsx)(Ar,{children:h}),t[23]=h,t[24]=x);let S;return t[25]!==b||t[26]!==x?(S=(0,Z.jsxs)(pr,{children:[b,x]}),t[25]=b,t[26]=x,t[27]=S):S=t[27],S}function Vk(e){let t=zk[e.icon];return e.displayName||t||Y._({id:`iEQQyu`})}function Hk(e){let t=(0,$.c)(3),[n,r]=(0,Q.useState)(e===`writing`),i=(0,Q.useRef)(null),a,o;return t[0]===e?(a=t[1],o=t[2]):(a=()=>{if(e===`writing`){i.current!==null&&(clearTimeout(i.current),i.current=null),r(!0);return}return i.current!==null&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,r(!1)},600),()=>{i.current!==null&&(clearTimeout(i.current),i.current=null)}},o=[e],t[0]=e,t[1]=a,t[2]=o),(0,Q.useEffect)(a,o),n}function Uk(e){let t=(0,$.c)(33),{participant:n,crossDoc:r,scoped:a,onClickAgent:o}=e,{_:c}=i(),{activeDocName:l}=yt(),{presence:u,agentId:d}=n,f=Vk(u),p=Hk(u.mode),m=!r&&p,h=u.currentDoc&&u.currentDoc!==`(connected)`?u.currentDoc:null,g=l!==null||h!==null,_=g?`cursor-pointer`:`cursor-default opacity-50`,v=a?`ring-primary ring-offset-2 ring-offset-background`:`ring-background`,y=m&&!a?`ring-primary/40 animate-pulse`:``,b;t[0]!==_||t[1]!==v||t[2]!==y?(b=[`inline-flex size-7 shrink-0 items-center justify-center rounded-full ring-2`,_,v,y].filter(Boolean),t[0]=_,t[1]=v,t[2]=y,t[3]=b):b=t[3];let x=b.join(` `),S=r?`true`:void 0,C=a?`true`:void 0,w=g?void 0:`true`,T;t[4]!==u.mode||t[5]!==S||t[6]!==C||t[7]!==w?(T={"data-presence-badge":`agent`,"data-presence-mode":u.mode,"data-presence-crossdoc":S,"data-presence-scoped":C,"data-presence-inert":w},t[4]=u.mode,t[5]=S,t[6]=C,t[7]=w,t[8]=T):T=t[8];let E=T,D=c(r&&h?{id:`b4AQFK`,values:{tooltipName:f,realCurrentDoc:h}}:{id:`RfHNf8`,values:{tooltipName:f}}),O;t[9]!==d||t[10]!==D||t[11]!==E||t[12]!==g||t[13]!==o||t[14]!==u.color||t[15]!==u.icon||t[16]!==h||t[17]!==x||t[18]!==f?(O=g?(0,Z.jsx)(`button`,{type:`button`,...E,"aria-label":D,className:x,style:{backgroundColor:u.color},onClick:()=>o(d,h),children:(0,Z.jsx)(ba,{icon:u.icon,width:16,height:16,className:`text-white`,"aria-hidden":!0})}):(0,Z.jsx)(`div`,{...E,role:`img`,"aria-label":f,className:x,style:{backgroundColor:u.color},children:(0,Z.jsx)(ba,{icon:u.icon,width:16,height:16,className:`text-white`,"aria-hidden":!0})}),t[9]=d,t[10]=D,t[11]=E,t[12]=g,t[13]=o,t[14]=u.color,t[15]=u.icon,t[16]=h,t[17]=x,t[18]=f,t[19]=O):O=t[19];let k=O,A;t[20]===k?A=t[21]:(A=(0,Z.jsx)(Gn,{asChild:!0,children:k}),t[20]=k,t[21]=A);let j;t[22]===f?j=t[23]:(j=(0,Z.jsx)(`span`,{className:`font-medium`,children:f}),t[22]=f,t[23]=j);let M;t[24]!==r||t[25]!==h?(M=r&&h?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(s,{id:`Wh0im4`,values:{realCurrentDoc:h}})}):null,t[24]=r,t[25]=h,t[26]=M):M=t[26];let N;t[27]!==j||t[28]!==M?(N=(0,Z.jsxs)(Ar,{className:`flex flex-col gap-0.5`,children:[j,M]}),t[27]=j,t[28]=M,t[29]=N):N=t[29];let P;return t[30]!==A||t[31]!==N?(P=(0,Z.jsxs)(pr,{children:[A,N]}),t[30]=A,t[31]=N,t[32]=P):P=t[32],P}function Wk(e){let t=(0,$.c)(21),{count:n,remainder:r,crossDoc:i,scopedAgentId:a,onClickAgent:o}=e,s;t[0]!==n||t[1]!==i?(s=i?Y._({id:`9euN0m`,values:{count:n}}):Y._({id:`uhJEA2`,values:{count:n}}),t[0]=n,t[1]=i,t[2]=s):s=t[2];let c=s,l=i?`true`:void 0,u;t[3]!==n||t[4]!==c||t[5]!==l?(u=(0,Z.jsx)(T,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`presence-overflow`,"data-presence-crossdoc":l,className:`inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full bg-muted font-medium text-muted-foreground text-xs ring-2 ring-background hover:bg-muted/80`,"aria-label":c,children:[`+`,n]})}),t[3]=n,t[4]=c,t[5]=l,t[6]=u):u=t[6];let d;if(t[7]!==i||t[8]!==o||t[9]!==r||t[10]!==a){let e;t[12]!==i||t[13]!==o||t[14]!==a?(e=e=>e.kind===`human`?(0,Z.jsx)(Bk,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(Uk,{participant:e,crossDoc:i,scoped:a===e.agentId,onClickAgent:o},e.agentId),t[12]=i,t[13]=o,t[14]=a,t[15]=e):e=t[15],d=r.map(e),t[7]=i,t[8]=o,t[9]=r,t[10]=a,t[11]=d}else d=t[11];let f;t[16]===d?f=t[17]:(f=(0,Z.jsx)(ie,{align:`end`,className:`w-auto max-w-xs p-2`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:d})}),t[16]=d,t[17]=f);let p;return t[18]!==u||t[19]!==f?(p=(0,Z.jsxs)(ee,{children:[u,f]}),t[18]=u,t[19]=f,t[20]=p):p=t[20],p}function Gk(e,t,n,r){return e.kind===`human`?(0,Z.jsx)(Bk,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(Uk,{participant:e,crossDoc:n,scoped:r===e.agentId,onClickAgent:t},e.agentId)}function Kk(){let e=(0,$.c)(20),{activeProvider:t,activeDocName:n,systemProvider:r,openActivityPanel:i,docPanelMode:a,docPanelAgentId:o}=yt(),{current:s,crossDoc:c}=jk(t,r,n);if(Pk(LC(t),n),s.length===0&&c.length===0)return null;let l;if(e[0]!==c||e[1]!==s||e[2]!==o||e[3]!==a||e[4]!==i){let t=s.slice(0,Fk),n;e[6]===s?n=e[7]:(n=s.slice(Fk),e[6]=s,e[7]=n);let r=n,u=c.slice(0,Ik),d;e[8]===c?d=e[9]:(d=c.slice(Ik),e[8]=c,e[9]=d);let f=d,p=i,m=a===`agent`?o:null,h;e[10]!==p||e[11]!==m?(h=e=>Gk(e,p,!1,m),e[10]=p,e[11]=m,e[12]=h):h=e[12];let g=t.map(h),_;e[13]!==r||e[14]!==p||e[15]!==m?(_=r.length>0?(0,Z.jsx)(Wk,{count:r.length,remainder:r,crossDoc:!1,scopedAgentId:m,onClickAgent:p}):null,e[13]=r,e[14]=p,e[15]=m,e[16]=_):_=e[16];let v;e[17]!==g||e[18]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,"data-presence-section":`current`,children:[g,_]}),e[17]=g,e[18]=_,e[19]=v):v=e[19],l=(0,Z.jsxs)(`div`,{"data-slot":`presence-bar`,className:`flex items-center px-1 py-1.5`,children:[v,c.length>0?(0,Z.jsxs)(`div`,{className:`ml-1.5 flex items-center gap-1.5`,"data-presence-section":`crossdoc`,children:[u.map(e=>Gk(e,p,!0,m)),f.length>0?(0,Z.jsx)(Wk,{count:f.length,remainder:f,crossDoc:!0,scopedAgentId:m,onClickAgent:p}):null]}):null]}),e[0]=c,e[1]=s,e[2]=o,e[3]=a,e[4]=i,e[5]=l}else l=e[5];return l}var qk=`.md`,Jk=/\.(md|mdx)$/i;function Yk(e,t=qk){return`${e}${t}`}function Xk(e){return _A(e).replace(Jk,``)}function Zk(e){return Pr(e)?eA(e.path):Jn(e)?e.path:Yk(e.docName,e.docExt)}function Qk(e){let t=_A(e).match(Jk);return t?`.${t[1].toLowerCase()}`:void 0}function $k(e){return _A(e)}function eA(e){let t=_A(e.trim());return t?`${t}/`:``}function tA(e){return e.endsWith(`/`)?$k(e):Xk(e)}function nA(e){return e.map(Zk)}function rA(e){return[...e].sort().join(`\0`)}function iA(e){return rA(nA(e))}function aA(e){let t=new Set;for(let n of e){if(Pr(n)){let e=eA(n.path);e&&t.add(e)}let e=(Pr(n)||Jn(n)?n.path:n.docName).split(`/`).filter(Boolean),r=Pr(n)?e.length:e.length-1;for(let n=1;n<=r;n++)t.add(`${e.slice(0,n).join(`/`)}/`)}return[...t].sort()}function oA(e){if(!e)return[];let t=_A(e.replace(Jk,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function sA(e,t,n){let r=Qk(e);if(r)return r;let i=n.find(e=>Gi(e)&&e.docName===t);return i?i.docExt??qk:gA(e).includes(`.`)?void 0:qk}function cA(e,t){let n=e.lastIndexOf(`/`),r=n===-1?``:e.slice(0,n+1),i=n===-1?e:e.slice(n+1),a=t.filter(e=>{if(!Jn(e)||!e.path.startsWith(r))return!1;let t=e.path.slice(r.length);return!t.includes(`/`)&&t.startsWith(`${i}.`)});return a.length===1?a[0].path:null}function lA(e,t,n){if(Qk(e))return null;let r=n.find(e=>Jn(e)&&e.path===t);return r?r.path:gA(e).includes(`.`)?t:cA(t,n)}function uA(e,t){let n=e.kind===`directory`,r=n?$k(e.path):Xk(e.path);if(n)return{kind:`folder`,name:_A(gA(e.path)).replace(Jk,``),path:r,treePath:fA(e.path,!0)};let i=lA(e.path,r,t);if(i)return{kind:`asset`,name:_A(gA(i)),path:i,treePath:i};let a=sA(e.path,r,t);return{kind:`file`,name:_A(gA(e.path)).replace(Jk,``),path:r,treePath:fA(e.path,!1),docExt:a}}function dA(e){return e.kind===`directory`?$k(e.path):e.path}function fA(e,t){return t?eA(e):Jk.test(e)?e:`${e}${qk}`}function pA(e,t,n){let r=eA(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${qk}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function mA(e,t){return e===`file`?fA(t,!1):`${$k(t)}/index${qk}`}function hA(e,t){return t.kind===`root`||t.directoryPath==null?gA(e):`${t.directoryPath}${gA(e)}`}function gA(e){let t=_A(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function _A(e){return e.endsWith(`/`)?e.slice(0,-1):e}function vA(e,t){return t.trim()}function yA(e){return![``,`.`,`..`].includes(e)&&!e.includes(`/`)&&!e.includes(`\\`)&&!e.includes(`\0`)}function bA(e,t){let n=vA(e.kind,t),r=e.path.split(`/`);return r[r.length-1]=n,r.join(`/`)}function xA(e,t,n=[],r=[]){if(t.length===0&&n.length===0&&r.length===0)return e;let i=new Map(t.map(e=>[e.fromDocName,e.toDocName])),a=new Map(r.map(e=>[e.fromPath,e.toPath]));return e.map(e=>Gi(e)?{...e,docName:i.get(e.docName)??e.docName}:Pr(e)?{...e,path:OA(e.path,n)}:Jn(e)?{...e,path:a.get(e.path)??OA(e.path,n)}:e)}function SA(e,t,n,r=[]){if(t.length===0&&!n&&r.length===0)return e;let i=new Set(t),a=new Set(r);return e.filter(e=>Gi(e)?!i.has(e.docName)&&!MA(e.docName,n):Pr(e)?!MA(e.path,n):Jn(e)?!a.has(e.path)&&!MA(e.path,n):!0)}function CA(e,t){if(e.kind!==`asset`||t.some(t=>Jn(t)&&t.path===e.path))return e;let n=cA(e.path,t);return n?{...e,path:n,name:n.split(`/`).pop()??n}:e}function wA(e,t,n,r=new Date().toISOString()){let i=!1,a=[...e],o=e=>{a.some(t=>kA(t,e))||(a.push(e),i=!0)};if(n.kind===`file`){let s=e.find(e=>Gi(e)&&e.docName===t.path);return o({kind:`document`,docName:n.path,docExt:s?.docExt??t.docExt,size:s?.size??0,modified:r}),i?a:e}let s=e.find(e=>Pr(e)&&e.path===t.path);o({kind:`folder`,path:n.path,size:s?.size??0,modified:r});let c=new Set(n.duplicatedDocNames);for(let i of e){if(Gi(i)){let e=jA(i.docName,t.path,n.path);e&&c.has(e)&&o({...i,docName:e,modified:r});continue}if(Pr(i)){let e=AA(i.path,t.path,n.path);e&&o({...i,path:e,modified:r})}}return i?a:e}function TA(e,t){return e?t.find(t=>t.fromDocName===e)?.toDocName??e:null}function EA(e,t,n){return e.flatMap(e=>t===e.toDocName||!n(e.toDocName)?[e.fromDocName]:[e.fromDocName,e.toDocName])}function DA(e,t){let n=e.kind===`file`?Yk(e.path,e.docExt):e.path;return ig(t.contentDir,n,t.pathSeparator)}function OA(e,t){for(let{fromPath:n,toPath:r}of t){if(e===n)return r;if(e.startsWith(`${n}/`))return`${r}${e.slice(n.length)}`}return e}function kA(e,t){return Gi(e)&&Gi(t)?e.docName===t.docName:Pr(e)&&Pr(t)||Jn(e)&&Jn(t)?e.path===t.path:!1}function AA(e,t,n){return e===t?n:jA(e,t,n)}function jA(e,t,n){return e.startsWith(`${t}/`)?`${n}${e.slice(t.length)}`:null}function MA(e,t){return!!t&&(e===t||e.startsWith(`${t}/`))}function NA(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(Qu,{"data-slot":`context-menu`,...n}),t[2]=n,t[3]=r),r}function PA(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`select-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)($u,{"data-slot":`context-menu-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function FA(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(od,{"data-slot":`context-menu-sub`,...n}),t[2]=n,t[3]=r),r}function IA(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(ed,{children:(0,Z.jsx)(td,{"data-slot":`context-menu-content`,className:i,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function LA(e){let t=(0,$.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=ea(`group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,Z.jsx)(nd,{"data-slot":`context-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function RA(e){let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,inset:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=ea(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(Os,{className:`ml-auto`}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,Z.jsxs)(sd,{"data-slot":`context-menu-sub-trigger`,"data-inset":i,className:o,...a,children:[n,s]}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function zA(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg data-[state=closed]:overflow-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0 subtle-scrollbar`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(cd,{"data-slot":`context-menu-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function BA(e){let t=(0,$.c)(15),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:i,children:r,checked:n,inset:a,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===i?s=t[7]:(s=ea(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,i),t[6]=i,t[7]=s);let c;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(`span`,{className:`pointer-events-none absolute right-2`,children:(0,Z.jsx)(id,{children:(0,Z.jsx)(Ds,{})})}),t[8]=c):c=t[8];let l;return t[9]!==n||t[10]!==r||t[11]!==a||t[12]!==o||t[13]!==s?(l=(0,Z.jsxs)(rd,{"data-slot":`context-menu-checkbox-item`,"data-inset":a,className:s,checked:n,...o,children:[c,r]}),t[9]=n,t[10]=r,t[11]=a,t[12]=o,t[13]=s,t[14]=l):l=t[14],l}function VA(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(ad,{"data-slot":`context-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var HA=`mr-1.5 flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground outline-none transition hover:bg-foreground/10 hover:text-foreground hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/50`,UA=`border-border bg-background text-foreground hover:bg-background focus-visible:bg-background`,WA={start:[Yo.Space],cancel:[Yo.Esc],end:[Yo.Space,Yo.Enter]};function GA(e){return ea(HA,e?`opacity-100`:`pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100`)}function KA(e){return e?void 0:-1}function qA({className:e,isDragging:t}){return ea(e,t&&UA)}function JA(e){return e.code===Yo.Enter&&e.target===e.currentTarget}function YA({event:e,hasKeyboardActivation:t,isDragging:n}){return e.defaultPrevented?`ignore`:!n&&t&&JA(e)?`activate-tab`:`delegate-sortable`}function XA({activeWidth:e,isDragging:t,outerStyle:n,transform:r,transition:i}){let a=t&&e?e:void 0;return{...n,transform:wa.Transform.toString(r?{...r,scaleX:1,scaleY:1}:null),transition:i,flexBasis:a??n?.flexBasis,maxWidth:a??n?.maxWidth,minWidth:a??n?.minWidth,opacity:n?.opacity,width:a??n?.width,zIndex:t?20:n?.zIndex}}function ZA(e){let t=e?.querySelectorAll(`[data-editor-tab-sortable]`)??[],n=1/0,r=-1/0;for(let e of t){let t=e.getBoundingClientRect();n=Math.min(n,t.left),r=Math.max(r,t.right)}return Number.isFinite(n)&&Number.isFinite(r)?{left:n,right:r}:null}function QA(e){return({activeNodeRect:t,transform:n})=>{let r={...n,y:0};if(!e||!t)return r;let i=e.left-t.left,a=e.right-t.right;return r.x=Math.min(Math.max(r.x,i),a),r}}var $A=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(r){let e=1/0,i=-1/0,a=null,o=null;for(let r of t){let t=n.get(r.id);t&&(t.left<e&&(e=t.left,a=r),t.right>i&&(i=t.right,o=r))}if(!Number.isFinite(e)||!Number.isFinite(i))return[];let s=r.x<e?a:r.x>i?o:null;if(s)return[{id:s.id,data:{droppableContainer:s,value:0}}]}return vo(e)},ej=[`.md`,`.mdx`],tj=`group relative -mb-px flex h-10 min-w-28 max-w-64 shrink-0 cursor-pointer items-center overflow-hidden border border-transparent font-medium transition-colors`,nj=`z-10 rounded-t-lg rounded-b-none border-border border-b-0 bg-background text-foreground`,rj=ea(nj,`bg-transparent hover:bg-muted focus-visible:bg-muted border-transparent hover:border-border focus-visible:border-border`),ij=`flex h-full min-w-0 flex-1 cursor-pointer items-center overflow-hidden px-3 text-left text-[13px]`;function aj(e){return e.replace(/[^A-Za-z0-9_-]/g,`-`)}function oj(e){let t=yr(e);window.location.hash!==t&&(window.location.hash=t)}function sj(e){Math.abs(e.deltaX)>=Math.abs(e.deltaY)||e.currentTarget.scrollWidth<=e.currentTarget.clientWidth||(e.preventDefault(),e.currentTarget.scrollLeft+=e.deltaY)}function cj(e,t){let n=[t,...ej].filter((e,t,n)=>e&&n.indexOf(e)===t),r=e.toLowerCase(),i=n.find(t=>e.length>t.length&&r.endsWith(t.toLowerCase()));return i?e.slice(0,-i.length):e}function lj(e){let t=(0,$.c)(37),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({activateFromKeyboard:n,className:r,tabId:l,disabled:i,onKeyDown:a,ref:o,style:s,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u;t[9]!==i||t[10]!==l?(u={id:l,disabled:i},t[9]=i,t[10]=l,t[11]=u):u=t[11];let{attributes:d,listeners:f,rect:p,setNodeRef:m,transform:h,transition:g,isDragging:_}=go(u),v=p.current?.width,y;t[12]!==_||t[13]!==s||t[14]!==v||t[15]!==h||t[16]!==g?(y=XA({activeWidth:v,isDragging:_,outerStyle:s,transform:h,transition:g}),t[12]=_,t[13]=s,t[14]=v,t[15]=h,t[16]=g,t[17]=y):y=t[17];let b=y,x;t[18]!==o||t[19]!==m?(x=function(e){m(e),typeof o==`function`?o(e):o&&`current`in o&&(o.current=e)},t[18]=o,t[19]=m,t[20]=x):x=t[20];let S=x,C=f?.onKeyDown,w;t[21]!==n||t[22]!==_||t[23]!==a||t[24]!==C?(w=function(e){a?.(e);let t=YA({event:e,hasKeyboardActivation:!!n,isDragging:_});if(t!==`ignore`){if(t===`activate-tab`&&n){e.preventDefault(),n();return}C?.(e)}},t[21]=n,t[22]=_,t[23]=a,t[24]=C,t[25]=w):w=t[25];let T=w,E;t[26]!==r||t[27]!==_?(E=qA({className:r,isDragging:_}),t[26]=r,t[27]=_,t[28]=E):E=t[28];let D;return t[29]!==d||t[30]!==S||t[31]!==T||t[32]!==f||t[33]!==c||t[34]!==b||t[35]!==E?(D=(0,Z.jsx)(`div`,{ref:S,"data-editor-tab-sortable":``,className:E,style:b,...c,...d,...f,onKeyDown:T}),t[29]=d,t[30]=S,t[31]=T,t[32]=f,t[33]=c,t[34]=b,t[35]=E,t[36]=D):D=t[36],D}function uj(e){let t=(0,$.c)(52),{children:n,closeTab:r,closeTabs:i,canPin:a,disabled:o,openTabs:c,pinTab:l,pinnedTabIds:u,tabId:d,unpinTab:f}=e,p=a===void 0?!0:a;if(o!==void 0&&o)return n;let m;t[0]!==p||t[1]!==u||t[2]!==d?(m=p&&u.includes(d),t[0]=p,t[1]=u,t[2]=d,t[3]=m):m=t[3];let h=m,g;if(t[4]!==c||t[5]!==u||t[6]!==d){let e;t[8]===d?e=t[9]:(e=e=>e!==d,t[8]=d,t[9]=e),g=rn(c.filter(e),u),t[4]=c,t[5]=u,t[6]=d,t[7]=g}else g=t[7];let _=g,v;t[10]!==c||t[11]!==u?(v=rn(c,u),t[10]=c,t[11]=u,t[12]=v):v=t[12];let y=v,b;t[13]===n?b=t[14]:(b=(0,Z.jsx)(PA,{asChild:!0,children:n}),t[13]=n,t[14]=b);let x;t[15]!==r||t[16]!==d?(x=()=>r(d),t[15]=r,t[16]=d,t[17]=x):x=t[17];let S;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(s,{id:`yz7wBu`}),t[18]=S):S=t[18];let C;t[19]!==h||t[20]!==x?(C=(0,Z.jsx)(LA,{disabled:h,onSelect:x,children:S}),t[19]=h,t[20]=x,t[21]=C):C=t[21];let w=_.length===0,T;t[22]!==i||t[23]!==_?(T=()=>{i(_)},t[22]=i,t[23]=_,t[24]=T):T=t[24];let E;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsx)(s,{id:`omXJcU`}),t[25]=E):E=t[25];let D;t[26]!==w||t[27]!==T?(D=(0,Z.jsx)(LA,{disabled:w,onSelect:T,children:E}),t[26]=w,t[27]=T,t[28]=D):D=t[28];let O=y.length===0,k;t[29]!==y||t[30]!==i?(k=()=>{i(y)},t[29]=y,t[30]=i,t[31]=k):k=t[31];let A;t[32]===u.length?A=t[33]:(A=u.length?(0,Z.jsx)(s,{id:`U2Kx6T`}):(0,Z.jsx)(s,{id:`WyXG7w`}),t[32]=u.length,t[33]=A);let j;t[34]!==O||t[35]!==k||t[36]!==A?(j=(0,Z.jsx)(LA,{disabled:O,"data-testid":`editor-tab-context-close-all`,onSelect:k,children:A}),t[34]=O,t[35]=k,t[36]=A,t[37]=j):j=t[37];let M;t[38]!==p||t[39]!==h||t[40]!==l||t[41]!==d||t[42]!==f?(M=p&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(VA,{}),(0,Z.jsx)(LA,{"data-testid":`editor-tab-context-pin-toggle`,onSelect:()=>h?f(d):l(d),children:h?(0,Z.jsx)(s,{id:`SYfHmN`}):(0,Z.jsx)(s,{id:`3pU8e-`})})]}),t[38]=p,t[39]=h,t[40]=l,t[41]=d,t[42]=f,t[43]=M):M=t[43];let N;t[44]!==D||t[45]!==j||t[46]!==M||t[47]!==C?(N=(0,Z.jsxs)(IA,{className:`min-w-40`,children:[C,D,j,M]}),t[44]=D,t[45]=j,t[46]=M,t[47]=C,t[48]=N):N=t[48];let P;return t[49]!==N||t[50]!==b?(P=(0,Z.jsxs)(NA,{children:[b,N]}),t[49]=N,t[50]=b,t[51]=P):P=t[51],P}function dj(e){let t=(0,$.c)(26),{accessibleLabel:n,closeTab:r,isActive:a,isPinned:o,tabId:s,unpinTab:c}=e,{_:l}=i();if(o){let e;t[0]!==l||t[1]!==n?(e=l({id:`t18QYR`,values:{accessibleLabel:n}}),t[0]=l,t[1]=n,t[2]=e):e=t[2];let r;t[3]!==s||t[4]!==c?(r=e=>{e.stopPropagation(),c(s)},t[3]=s,t[4]=c,t[5]=r):r=t[5];let i;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(Pl,{"aria-hidden":`true`}),t[6]=i):i=t[6];let a;return t[7]!==e||t[8]!==r?(a=(0,Z.jsx)(sa,{variant:`ghost`,size:`icon-xs`,type:`button`,"aria-label":e,"data-testid":`editor-tab-unpin-button`,className:`mr-1.5 text-primary! hover:bg-primary/10!`,onClick:r,children:i}),t[7]=e,t[8]=r,t[9]=a):a=t[9],a}let u;t[10]!==l||t[11]!==n?(u=l({id:`JLzQi_`,values:{accessibleLabel:n}}),t[10]=l,t[11]=n,t[12]=u):u=t[12];let d;t[13]===a?d=t[14]:(d=GA(a),t[13]=a,t[14]=d);let f;t[15]===a?f=t[16]:(f=KA(a),t[15]=a,t[16]=f);let p;t[17]!==r||t[18]!==s?(p=e=>{e.stopPropagation(),r(s)},t[17]=r,t[18]=s,t[19]=p):p=t[19];let m;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(ys,{"aria-hidden":`true`}),t[20]=m):m=t[20];let h;return t[21]!==u||t[22]!==d||t[23]!==f||t[24]!==p?(h=(0,Z.jsx)(sa,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":u,"data-testid":`editor-tab-close-button`,className:d,tabIndex:f,onClick:p,children:m}),t[21]=u,t[22]=d,t[23]=f,t[24]=p,t[25]=h):h=t[25],h}function fj(e){let t=(0,$.c)(1),{docName:n}=e;if(gC(n)!==`conflict`)return null;let r;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(Pi,{"aria-label":`Conflict`,"data-testid":`editor-tab-conflict-badge`,className:`mr-1 size-3.5 shrink-0 text-amber-500`}),t[0]=r):r=t[0],r}function pj(){let e=(0,$.c)(80),{activeDocName:t,activeTabId:n,activeNewTabId:r,activeTarget:a,activateTab:o,activateNewTab:c,closeAndClearForRename:l,closeNewTab:u,closeTab:d,closeTabs:f,getPoolActiveDocName:p,poolHas:m,isNewTabActive:h,newTabIds:g,openNewTab:_,openTabs:v,pinTab:b,pinnedTabIds:x,remapTabsForRename:S,reorderTabs:C,unpinTab:w,visibleTabIds:T}=yt(),{_:E}=i(),{pageMeta:D}=si(),O=(0,Q.useRef)(null),[k,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(null),[N,P]=(0,Q.useState)(``),[F,I]=(0,Q.useState)(null),[R,z]=(0,Q.useState)(!1),B=(0,Q.useRef)(null),V=(0,Q.useRef)(!1),H=(0,Q.useRef)(!1),U=(0,Q.useRef)(null),ee=(0,Q.useRef)(t),te;e[0]!==n||e[1]!==t||e[2]!==a?(te=n??(a?y(a):t?Yt(t):null),e[0]=n,e[1]=t,e[2]=a,e[3]=te):te=e[3];let W=te,ne;e[4]!==r||e[5]!==W||e[6]!==h||e[7]!==g||e[8]!==v?(ne=h?`${r??`__new-tab__`}\u0000${v.join(`\0`)}\u0000${g.join(`\0`)}`:W?`${W}\u0000${v.join(`\0`)}`:``,e[4]=r,e[5]=W,e[6]=h,e[7]=g,e[8]=v,e[9]=ne):ne=e[9];let re=ne,G,ie;e[10]===t?(G=e[11],ie=e[12]):(G=()=>{ee.current=t},ie=[t],e[10]=t,e[11]=G,e[12]=ie),(0,Q.useEffect)(G,ie);let K,q;e[13]===re?(K=e[14],q=e[15]):(K=()=>{re&&(O.current?.querySelector(`[data-active-tab="true"]`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},q=[re],e[13]=re,e[14]=K,e[15]=q),(0,Q.useEffect)(K,q);let ae,oe;e[16]===j?(ae=e[17],oe=e[18]):(ae=()=>{j&&(B.current?.focus(),B.current?.select())},oe=[j],e[16]=j,e[17]=ae,e[18]=oe),(0,Q.useEffect)(ae,oe);let se,ce;e[19]!==v||e[20]!==j?(se=()=>{!j||v.includes(j.tabId)||(H.current=!0,U.current=null,M(null),P(``),I(null),z(!1))},ce=[v,j],e[19]=v,e[20]=j,e[21]=se,e[22]=ce):(se=e[21],ce=e[22]),(0,Q.useEffect)(se,ce);let le=function(e,t){let n=t.split(`/`);H.current=!1,U.current=null,M({docName:t,tabId:e}),P(n[n.length-1]),I(null)},ue=function(){H.current=!0,U.current=null,M(null),P(``),I(null),z(!1)},de=async function(){if(H.current){H.current=!1;return}if(V.current)return;let e=j?.docName;if(!e){ue();return}let t=vA(`file`,cj(N,D.get(e)?.docExt??`.md`)),n=e.split(`/`),r=n[n.length-1];if(t===r){ue();return}if(t===U.current){B.current?.focus();return}if(!yA(t)){I(E({id:`P8yDjG`})),B.current?.focus();return}let i=bA({kind:`file`,path:e,name:r},t);V.current=!0,z(!0),I(null);try{let n=await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:`file`,fromPath:e,toPath:i})});if(H.current){z(!1),V.current=!1;return}let r=await L(n,`Server error (HTTP ${n.status})`);if(!r.ok){I(r.title),z(!1),V.current=!1,U.current=t,B.current?.focus();return}let a=Ee(Hi,r.body,`rename-path:tab`,{renamed:[],renamedAssets:[]}).renamed,o=ee.current,s=TA(o,a);pe(a);let c=!0;try{let e=EA(a,p(),m);await Promise.all(e.map(e=>l(e))),S(a),vi([`files`,`backlinks`,`graph`])}catch(n){let r=n;c=!1,console.warn(`[EditorTabs] post-rename reconciliation failed`,{err:r,docName:e,newDocName:i,normalized:t}),X.error(E({id:`MUBR8r`}))}H.current=!0,M(null),P(``),I(null),z(!1),V.current=!1,U.current=null,c&&s&&s!==o&&oj(s)}catch(n){console.warn(`[EditorTabs] rename failed`,{err:n,docName:e,newDocName:i,normalized:t}),I(E({id:`HIb0vl`})),z(!1),V.current=!1,U.current=t,B.current?.focus()}},fe=typeof window<`u`&&window.okDesktop!=null,me;e[23]===g?me=e[24]:(me=new Set(g),e[23]=g,e[24]=me);let he=me,ge;e[25]===k?ge=e[26]:(ge=QA(k),e[25]=k,e[26]=ge);let _e;e[27]===ge?_e=e[28]:(_e=[ge],e[27]=ge,e[28]=_e);let ve=_e,ye;e[29]!==u||e[30]!==f||e[31]!==he?(ye=function(e){let t=[],n=[];for(let r of e)he.has(r)?n.push(r):t.push(r);t.length>0&&f(t);for(let e of n)u(e)},e[29]=u,e[30]=f,e[31]=he,e[32]=ye):ye=e[32];let be=ye,xe;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(xe={activationConstraint:{distance:8}},e[33]=xe):xe=e[33];let Se;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(Se={coordinateGetter:fo,keyboardCodes:WA},e[34]=Se):Se=e[34];let Ce=ro(So(bo,xe),So(Ua,Se)),we;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(we=function(){A(ZA(O.current))},e[35]=we):we=e[35];let Te=we,De;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(De=function(){A(null)},e[36]=De):De=e[36];let Oe=De,ke;e[37]!==Oe||e[38]!==C||e[39]!==T?(ke=function(e){Oe();let t=String(e.active.id),n=e.over?String(e.over.id):null;if(!n||t===n)return;let r=T.indexOf(t),i=T.indexOf(n);r<0||i<0||r===i||C(mo([...T],r,i),t)},e[37]=Oe,e[38]=C,e[39]=T,e[40]=ke):ke=e[40];let Ae=ke,je=fe?``:void 0,Me;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(Me=ea(`pl-2 flex h-12 min-w-0 touch-manipulation flex-1 items-end overflow-x-auto overflow-y-hidden overscroll-x-contain scroll-fade-mask-x [scrollbar-width:none]`,fe&&`[-webkit-app-region:drag]`),e[41]=Me):Me=e[41];let Ne=sj,Pe;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=ea(`flex items-end gap-1`,fe&&`[-webkit-app-region:no-drag]`),e[42]=Pe):Pe=e[42];let Fe=Ga,Ie=$A,Le;e[43]===Symbol.for(`react.memo_cache_sentinel`)?(Le={container:typeof document<`u`?document.body:void 0},e[43]=Le):Le=e[43];let Re=Da,ze;e[44]===T?ze=e[45]:(ze=[...T],e[44]=T,e[45]=ze);let Be=za,Ve=T.map(e=>{if(he.has(e)){let t=e===r;return(0,Z.jsx)(uj,{tabId:e,canPin:!1,openTabs:T,closeTab:u,closeTabs:be,pinTab:b,pinnedTabIds:x,unpinTab:w,children:(0,Z.jsxs)(lj,{tabId:e,activateFromKeyboard:()=>c(e),"aria-current":t?`page`:void 0,"data-active-tab":t?`true`:void 0,className:ea(tj,t?nj:rj),onAuxClick:t=>{t.button===1&&(t.preventDefault(),u(e))},onClick:t=>{t.target===t.currentTarget&&c(e)},children:[(0,Z.jsx)(`button`,{type:`button`,"aria-label":E({id:`zLak8b`}),"data-testid":`editor-new-tab-placeholder-button`,className:ij,onClick:()=>c(e),tabIndex:-1,children:(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:(0,Z.jsx)(s,{id:`3YvS-c`})})}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":E({id:`xCdTnb`}),"data-testid":`editor-new-tab-placeholder-close`,className:GA(t),tabIndex:KA(t),onClick:t=>{t.stopPropagation(),u(e)},children:(0,Z.jsx)(ys,{"aria-hidden":`true`,className:`size-3.5`})})]})},e)}let t=en(e),n=e===W,i=x.includes(e);if(t.kind===`folder`){let{baseName:r,label:a,prefix:s}=Qt(t.folderPath,`/`),c=`${s}${a}`;return(0,Z.jsx)(uj,{tabId:e,openTabs:T,closeTab:d,closeTabs:be,pinTab:b,pinnedTabIds:x,unpinTab:w,children:(0,Z.jsxs)(lj,{tabId:e,activateFromKeyboard:()=>o(e),"aria-current":n?`page`:void 0,"data-active-tab":n?`true`:void 0,className:ea(tj,n?nj:rj),onAuxClick:t=>{t.button===1&&(t.preventDefault(),!i&&d(e))},onClick:t=>{t.target===t.currentTarget&&o(e)},children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":c,title:c,className:ij,onClick:()=>{o(e)},tabIndex:-1,children:[s&&(0,Z.jsx)(`span`,{className:ea(`min-w-0 flex-1 truncate`,n&&`text-muted-foreground`),children:s}),(0,Z.jsxs)(`span`,{className:ea(`flex min-w-0 items-center`,s?`max-w-[70%] shrink-0`:`flex-1`),children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:r}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:`/`})]})]}),(0,Z.jsx)(dj,{accessibleLabel:c,closeTab:d,isActive:n,isPinned:i,tabId:e,unpinTab:w})]})},e)}if(t.kind===`asset`){let{baseName:r,label:a,prefix:s}=Qt(t.assetPath,``),c=`${s}${a}`;return(0,Z.jsx)(uj,{tabId:e,openTabs:T,closeTab:d,closeTabs:be,pinTab:b,pinnedTabIds:x,unpinTab:w,children:(0,Z.jsxs)(lj,{tabId:e,activateFromKeyboard:()=>o(e),"aria-current":n?`page`:void 0,"data-active-tab":n?`true`:void 0,className:ea(tj,n?nj:rj),onAuxClick:t=>{t.button===1&&(t.preventDefault(),!i&&d(e))},onClick:t=>{t.target===t.currentTarget&&o(e)},children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":c,className:ij,onClick:()=>{o(e)},tabIndex:-1,children:[s?(0,Z.jsx)(`span`,{className:ea(`min-w-0 flex-1 truncate text-muted-foreground/60`,n&&`text-muted-foreground`),children:s}):null,(0,Z.jsx)(`span`,{className:ea(`min-w-0 truncate`,s?`max-w-[70%] shrink-0`:`flex-1`),children:r})]}),(0,Z.jsx)(dj,{accessibleLabel:c,closeTab:d,isActive:n,isPinned:i,tabId:e,unpinTab:w})]})},e)}let a=t.docName,l=D.get(a)?.docExt??`.md`,{baseName:f,extension:p,label:m,prefix:h}=Qt(a,l),g=`${h}${m}`,_=l===`.md`||l===`.mdx`,v=j?.tabId===e,y=`editor-tab-rename-error-${aj(a)}`;return(0,Z.jsx)(uj,{disabled:v,tabId:e,openTabs:T,closeTab:d,closeTabs:be,pinTab:b,pinnedTabIds:x,unpinTab:w,children:(0,Z.jsx)(lj,{tabId:e,activateFromKeyboard:()=>o(e),disabled:v,"aria-current":n?`page`:void 0,"data-active-tab":n?`true`:void 0,className:ea(tj,n?nj:rj,v&&F&&`border-destructive`),onAuxClick:t=>{t.button===1&&(t.preventDefault(),!i&&d(e))},onClick:t=>{t.target===t.currentTarget&&o(e)},children:v?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(qS,{className:`h-full min-w-0 flex-1 rounded-none border-0 bg-transparent dark:bg-transparent`,children:[(0,Z.jsx)(QS,{ref:B,value:N,disabled:R,"aria-label":E({id:`Dw1T_W`,values:{label:m}}),"data-testid":`editor-tab-rename-input`,"aria-invalid":F?!0:void 0,"aria-describedby":F?y:void 0,"aria-busy":R||void 0,title:F??a,className:`h-full min-w-0 px-2 py-0 font-medium text-foreground text-xs selection:bg-primary selection:text-primary-foreground`,onChange:e=>{P(cj(e.target.value,l)),I(null),U.current=null},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),de()):e.key===`Escape`&&(e.preventDefault(),ue())},onBlur:de}),(0,Z.jsx)(YS,{align:`inline-end`,"aria-hidden":`true`,className:`pr-2 text-xs`,children:(0,Z.jsx)(ZS,{className:`text-muted-foreground/60 text-xs`,children:l})})]}),F?(0,Z.jsx)(`span`,{id:y,role:`alert`,className:`sr-only`,children:F}):null]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":g,title:g,className:ij,onClick:()=>{o(e)},onDoubleClick:t=>{t.preventDefault(),t.stopPropagation(),le(e,a)},tabIndex:-1,children:[(0,Z.jsx)(fj,{docName:a}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:f}),!_&&(0,Z.jsx)(`span`,{className:`shrink-0`,children:p})]})]}),(0,Z.jsx)(dj,{accessibleLabel:g,closeTab:d,isActive:n,isPinned:i,tabId:e,unpinTab:w})]})})},e)}),He;e[46]!==Re||e[47]!==ze||e[48]!==Be||e[49]!==Ve?(He=(0,Z.jsx)(Re,{items:ze,strategy:Be,children:Ve}),e[46]=Re,e[47]=ze,e[48]=Be,e[49]=Ve,e[50]=He):He=e[50];let Ue;e[51]!==Fe||e[52]!==Oe||e[53]!==Ae||e[54]!==Te||e[55]!==Ce||e[56]!==!1||e[57]!==Ie||e[58]!==Le||e[59]!==He||e[60]!==ve?(Ue=(0,Z.jsx)(Fe,{sensors:Ce,autoScroll:!1,collisionDetection:Ie,modifiers:ve,onDragStart:Te,onDragEnd:Ae,onDragCancel:Oe,accessibility:Le,children:He}),e[51]=Fe,e[52]=Oe,e[53]=Ae,e[54]=Te,e[55]=Ce,e[56]=!1,e[57]=Ie,e[58]=Le,e[59]=He,e[60]=ve,e[61]=Ue):Ue=e[61];let We;e[62]===E?We=e[63]:(We=E({id:`3YvS-c`}),e[62]=E,e[63]=We);let Ge;e[64]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,Z.jsx)(At,{"aria-hidden":`true`}),e[64]=Ge):Ge=e[64];let Ke;e[65]!==_||e[66]!==We?(Ke=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":We,"data-testid":`editor-new-tab-button`,className:`first:mb-3 mb-1.5`,onClick:_,children:Ge})}),e[65]=_,e[66]=We,e[67]=Ke):Ke=e[67];let qe;e[68]===Symbol.for(`react.memo_cache_sentinel`)?(qe=(0,Z.jsx)(Ar,{children:(0,Z.jsx)(s,{id:`3YvS-c`})}),e[68]=qe):qe=e[68];let Je;e[69]===Ke?Je=e[70]:(Je=(0,Z.jsxs)(pr,{children:[Ke,qe]}),e[69]=Ke,e[70]=Je);let Ye;e[71]!==Pe||e[72]!==Ue||e[73]!==Je?(Ye=(0,Z.jsxs)(`div`,{className:Pe,children:[Ue,Je]}),e[71]=Pe,e[72]=Ue,e[73]=Je,e[74]=Ye):Ye=e[74];let Xe;return e[75]!==je||e[76]!==Me||e[77]!==Ne||e[78]!==Ye?(Xe=(0,Z.jsx)(`div`,{ref:O,"data-electron-drag":je,className:Me,onWheel:Ne,children:Ye}),e[75]=je,e[76]=Me,e[77]=Ne,e[78]=Ye,e[79]=Xe):Xe=e[79],Xe}function mj(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Discord`}),r=(0,Z.jsx)(`path`,{d:`M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9554 2.4189-2.1568 2.4189Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function hj(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`X (Twitter)`}),r=(0,Z.jsx)(`path`,{d:`M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}var gj=[{label:{id:`TvY_XA`},href:`https://openknowledge.ai/docs`,icon:Zt},{label:`GitHub`,href:`https://github.com/inkeep/open-knowledge`,icon:Hd},{label:{id:`On0aF2`},href:`https://openknowledge.ai/`,icon:ci},{label:`Discord`,href:`https://discord.com/invite/YujKpFN49`,icon:mj},{label:`Twitter`,href:`https://x.com/inkeep`,icon:hj}],_j=()=>{let e=(0,$.c)(16),{_:t}=i(),[n,r]=(0,Q.useState)(!1),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(nn,{className:`size-4`}),e[0]=a):a=e[0];let o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(T,{asChild:!0,children:(0,Z.jsxs)(sa,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,children:[a,(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(s,{id:`s-MGs7`})})]})})}),e[1]=o):o=e[1];let c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsxs)(pr,{children:[o,(0,Z.jsx)(Ar,{children:(0,Z.jsx)(s,{id:`s-MGs7`})})]}),e[2]=c):c=e[2];let l;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`p`,{className:`font-mono tracking-wide uppercase text-muted-foreground text-xs mb-1`,children:(0,Z.jsx)(s,{id:`s-MGs7`})}),e[3]=l):l=e[3];let u;e[4]===t?u=e[5]:(u=t({id:`s-MGs7`}),e[4]=t,e[5]=u);let d;e[6]===t?d=e[7]:(d=gj.map(e=>{let{label:n,href:r,icon:i}=e;return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>Xo(e,r),onAuxClick:e=>Xo(e,r),className:`flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-azure-900/5 dark:hover:bg-white/20 hover:text-primary`,children:[(0,Z.jsx)(i,{"aria-hidden":`true`,className:`size-4 shrink-0`}),typeof n==`string`?n:t(n)]})},r)}),e[6]=t,e[7]=d);let f;e[8]===d?f=e[9]:(f=(0,Z.jsx)(`ul`,{className:`space-y-0.5`,children:d}),e[8]=d,e[9]=f);let p;e[10]!==u||e[11]!==f?(p=(0,Z.jsxs)(ie,{align:`end`,className:`w-64 p-3`,children:[l,(0,Z.jsx)(`nav`,{"aria-label":u,children:f})]}),e[10]=u,e[11]=f,e[12]=p):p=e[12];let m;return e[13]!==n||e[14]!==p?(m=(0,Z.jsxs)(ee,{open:n,onOpenChange:r,children:[c,p]}),e[13]=n,e[14]=p,e[15]=m):m=e[15],m};function vj(e){let t=(0,$.c)(75),{input:n,open:r,onOpenChange:a}=e,{_:o}=i(),{states:c,refresh:l}=jg(),{dispatch:u}=bg(),{merged:d}=be(),f=d?.appearance?.preview?.autoOpen??!0,[p,m]=(0,Q.useState)(!1),h=(0,Q.useRef)(!1);if(bh())return null;let g=typeof window<`u`&&window.okDesktop!=null,_=r??p,v;t[0]!==a||t[1]!==r||t[2]!==l?(v=e=>{r===void 0&&m(e),a?.(e),e&&l()},t[0]=a,t[1]=r,t[2]=l,t[3]=v):v=t[3];let y=v,b=n===null,x=!!n?.selection,S;t[4]!==f||t[5]!==n?(S=n!==null&&n.docContext!==null?fr(n.docContext.relativePath,f):``,t[4]=f,t[5]=n,t[6]=S):S=t[6];let C=S,w;t[7]!==u||t[8]!==n?(w=e=>{n!==null&&u(e.id,n)},t[7]=u,t[8]=n,t[9]=w):w=t[9];let T=w,E,D,O,k,A,j,M,N,P,F,I,L,R,z;if(t[10]!==y||t[11]!==T||t[12]!==n||t[13]!==_||t[14]!==C||t[15]!==c||t[16]!==b){let e;t[31]===c?e=t[32]:(e=e=>c[e.id]?.installed===!0,t[31]=c,t[32]=e),A=Ch.filter(e);let r;t[33]===c?r=t[34]:(r=Ch.some(e=>c[e.id]?.installed==null),t[33]=c,t[34]=r),j=r,O=c[`claude-code`]?.installed===!0;let i;t[35]!==n||t[36]!==C?(i=()=>{n!==null&&Yb(C)},t[35]=n,t[36]=C,t[37]=i):i=t[37],k=i,D=jo,R=_,z=y,M=!1;let a;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(a=g?()=>{h.current=!0}:void 0,t[38]=a):a=t[38];let o;t[39]===y?o=t[40]:(o=g?()=>{if(h.current){h.current=!1;return}y(!0)}:void 0,t[39]=y,t[40]=o);let l,u;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(ya,{className:`size-3.5`,"aria-hidden":`true`}),u=(0,Z.jsx)(s,{id:`O7_W_a`}),t[41]=l,t[42]=u):(l=t[41],u=t[42]),t[43]!==o||t[44]!==b?(N=(0,Z.jsx)(Bo,{asChild:!0,children:(0,Z.jsxs)(sa,{variant:`ghost`,size:`sm`,disabled:b,className:`gap-1.5 text-muted-foreground px-1.5`,"data-testid":`open-in-agent-trigger`,onPointerDown:a,onClick:o,children:[l,u]})}),t[43]=o,t[44]=b,t[45]=N):N=t[45],E=Wo,P=`end`,F=`min-w-[220px]`,I=`open-in-agent-menu`;let d;t[46]!==T||t[47]!==C||t[48]!==c?(d=e=>{let t=c[e.id];return(0,Z.jsx)(Xb,{target:e,installState:t,isElectronHost:g,prompt:C,onSelect:()=>T(e)},e.id)},t[46]=T,t[47]=C,t[48]=c,t[49]=d):d=t[49],L=A.map(d),t[10]=y,t[11]=T,t[12]=n,t[13]=_,t[14]=C,t[15]=c,t[16]=b,t[17]=E,t[18]=D,t[19]=O,t[20]=k,t[21]=A,t[22]=j,t[23]=M,t[24]=N,t[25]=P,t[26]=F,t[27]=I,t[28]=L,t[29]=R,t[30]=z}else E=t[17],D=t[18],O=t[19],k=t[20],A=t[21],j=t[22],M=t[23],N=t[24],P=t[25],F=t[26],I=t[27],L=t[28],R=t[29],z=t[30];let B;t[50]!==A||t[51]!==x||t[52]!==j?(B=x&&A.length===0?(0,Z.jsx)($o,{disabled:!0,"data-testid":`open-in-agent-selection-empty`,children:j?(0,Z.jsx)(s,{id:`EcR0fl`}):(0,Z.jsx)(s,{id:`l6OXqI`})}):null,t[50]=A,t[51]=x,t[52]=j,t[53]=B):B=t[53];let V;t[54]!==o||t[55]!==O||t[56]!==k||t[57]!==n||t[58]!==x?(V=!O&&!x?(0,Z.jsxs)($o,{onSelect:k,disabled:n===null,"data-testid":`open-in-agent-claude-web-fallback`,"aria-label":o({id:`aA51jP`}),children:[(0,Z.jsx)(_t,{className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(s,{id:`0S9PW_`})}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:(0,Z.jsx)(s,{id:`pcfY8r`})})]}):null,t[54]=o,t[55]=O,t[56]=k,t[57]=n,t[58]=x,t[59]=V):V=t[59];let H;t[60]!==E||t[61]!==B||t[62]!==V||t[63]!==P||t[64]!==F||t[65]!==I||t[66]!==L?(H=(0,Z.jsxs)(E,{align:P,className:F,"data-testid":I,children:[L,B,V]}),t[60]=E,t[61]=B,t[62]=V,t[63]=P,t[64]=F,t[65]=I,t[66]=L,t[67]=H):H=t[67];let U;return t[68]!==D||t[69]!==M||t[70]!==N||t[71]!==H||t[72]!==R||t[73]!==z?(U=(0,Z.jsxs)(D,{open:R,onOpenChange:z,modal:M,children:[N,H]}),t[68]=D,t[69]=M,t[70]=N,t[71]=H,t[72]=R,t[73]=z,t[74]=U):U=t[74],U}var yj=50,bj=()=>{let e=(0,$.c)(8),t=(0,Q.useRef)(null),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=()=>{t.current===null&&(t.current=setTimeout(()=>{t.current=null,MS.preload()},yj))},e[0]=n):n=e[0];let r=n,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{t.current!==null&&(clearTimeout(t.current),t.current=null)},e[1]=i):i=e[1];let a=i,o,c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>()=>{t.current!==null&&clearTimeout(t.current)},c=[],e[2]=o,e[3]=c):(o=e[2],c=e[3]),(0,Q.useEffect)(o,c);let l,u;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{a(),window.location.hash!==`#settings`&&(window.location.hash=kh)},u=(0,Z.jsx)(Vl,{className:`size-4`}),e[4]=l,e[5]=u):(l=e[4],u=e[5]);let d;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsxs)(sa,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,"data-testid":`header-settings-button`,onMouseEnter:r,onMouseLeave:a,onFocus:r,onBlur:a,onClick:l,children:[u,(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(s,{id:`Tz0i8g`})})]})}),e[6]=d):d=e[6];let f;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsxs)(pr,{children:[d,(0,Z.jsx)(Ar,{children:(0,Z.jsx)(s,{id:`Tz0i8g`})})]}),e[7]=f):f=e[7],f};function xj(e){let t=(0,$.c)(30),{input:n,onClickWhenNoRemote:r}=e,{_:a}=i(),{status:o}=Po(),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(null),f=(0,Q.useRef)(null),p,m;t[0]===u?(p=t[1],m=t[2]):(p=()=>{!u||!f.current||(f.current.focus(),f.current.select())},m=[u],t[0]=u,t[1]=p,t[2]=m),(0,Q.useEffect)(p,m);let h=o?.hasRemote===!0,g=n===null,_;t[3]!==a||t[4]!==c||t[5]!==h||t[6]!==n||t[7]!==r?(_=async function(){if(!c&&n!==null){l(!0),d(null);try{let e=await ka({...n,hasRemote:h,onClickWhenNoRemote:r},{clipboardWrite:Eo,toastSuccess:Ej,toastError:Tj,logEvent:wj});e.kind===`clipboard-failed`&&d(e.shareUrl)}catch{X.error(a({id:`u3YnKw`}))}l(!1)}},t[3]=a,t[4]=c,t[5]=h,t[6]=n,t[7]=r,t[8]=_):_=t[8];let v=_,y=u!==null,b;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>{e||d(null)},t[9]=b):b=t[9];let x;t[10]!==a||t[11]!==n?.kind?(x=n?.kind===`folder`?a({id:`WR0y2O`}):a({id:`F4IYWe`}),t[10]=a,t[11]=n?.kind,t[12]=x):x=t[12];let S=c||g,C,w;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(Hl,{className:`size-3.5`,"aria-hidden":!0}),w=(0,Z.jsx)(s,{id:`Z8lGw6`}),t[13]=C,t[14]=w):(C=t[13],w=t[14]);let T;t[15]!==v||t[16]!==x||t[17]!==S?(T=(0,Z.jsx)(W,{asChild:!0,children:(0,Z.jsxs)(sa,{variant:`ghost`,size:`sm`,"aria-label":x,onClick:v,disabled:S,className:`gap-1.5 text-muted-foreground px-1.5`,"data-testid":`share-button`,children:[C,w]})}),t[15]=v,t[16]=x,t[17]=S,t[18]=T):T=t[18];let E;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:(0,Z.jsx)(s,{id:`I1m158`})}),t[19]=E):E=t[19];let D;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(s,{id:`ndeI89`})}),t[20]=D):D=t[20];let O=u??``,k;t[21]===a?k=t[22]:(k=a({id:`5-FeN2`}),t[21]=a,t[22]=k);let A;t[23]!==O||t[24]!==k?(A=(0,Z.jsxs)(ie,{className:`flex w-80 flex-col gap-2`,"data-testid":`share-button-fallback-popover`,children:[E,D,(0,Z.jsx)(ks,{ref:f,readOnly:!0,value:O,onFocus:Cj,onClick:Sj,className:`font-mono text-xs`,"data-testid":`share-button-fallback-url`,"aria-label":k})]}),t[23]=O,t[24]=k,t[25]=A):A=t[25];let j;return t[26]!==T||t[27]!==A||t[28]!==y?(j=(0,Z.jsxs)(ee,{open:y,onOpenChange:b,children:[T,A]}),t[26]=T,t[27]=A,t[28]=y,t[29]=j):j=t[29],j}function Sj(e){return e.currentTarget.select()}function Cj(e){return e.currentTarget.select()}function wj(e){return console.log(e)}function Tj(e){e!==`Link ready but could not copy to clipboard.`&&X.error(e)}function Ej(e){return X.success(e)}function Dj(e){let t=(0,$.c)(44),{onSignIn:n,onSetIdentity:r,onOpenSearch:a,openInAgentMenuOpen:o,openInAgentMenuInput:c,onOpenInAgentMenuOpenChange:l}=e,{_:u}=i(),{activeDocName:d,activeTarget:f}=yt(),{state:p}=PO(),m=Oh(),h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=Us(`toggle-files-sidebar`),t[0]=h):h=t[0];let g=h,_=Us(`command-palette`),v=No(),[y,b]=(0,Q.useState)(!1),x;bb0:{if(f===null){let e;t[1]===v?e=t[2]:(e=sg({workspace:v}),t[1]=v,t[2]=e),x=e;break bb0}if(f.kind===`folder`){if(!v){x=null;break bb0}let e;t[3]!==f.folderPath||t[4]!==v?(e=cg({folderRelativePath:f.folderPath,workspace:v}),t[3]=f.folderPath,t[4]=v,t[5]=e):e=t[5],x=e;break bb0}let e;t[6]!==d||t[7]!==v?(e=og({docName:d,workspace:v}),t[6]=d,t[7]=v,t[8]=e):e=t[8],x=e}let S=c??x,C;bb1:{if(f?.kind===`folder`){let e;t[9]===f.folderPath?e=t[10]:(e=so(f.folderPath),t[9]=f.folderPath,t[10]=e),C=e;break bb1}if(d){let e;t[11]===d?e=t[12]:(e=cs(d),t[11]=d,t[12]=e),C=e;break bb1}C=null}let w=C,T=typeof window<`u`&&window.okDesktop!=null,E=p===`collapsed`,D=T?``:void 0,k=T&&E&&`pl-[78px]`,A;t[13]===k?A=t[14]:(A=ea(`flex h-12 shrink-0 items-center bg-muted/35 shadow-[inset_0_-1px_0_var(--border)]`,T&&`[-webkit-app-region:drag]`,k,T&&`motion-safe:transition-[padding] motion-safe:duration-200 motion-safe:ease-linear`),t[13]=k,t[14]=A);let j=!m&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(zO,{className:ea(`-ml-1 shrink-0 text-muted-foreground`,T&&`[-webkit-app-region:no-drag]`)})}),(0,Z.jsx)(Ar,{children:p===`expanded`?(0,Z.jsx)(s,{id:`ZxXhLY`,values:{sidebarShortcut:g}}):(0,Z.jsx)(s,{id:`Zz25kq`,values:{sidebarShortcut:g}})})]}),E&&a&&(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{variant:`ghost`,size:`icon-sm`,onClick:a,"aria-label":u({id:`IN4UX8`,values:{searchShortcut:_}}),"data-telemetry-event":`ok.editor_header.search.click`,className:ea(`shrink-0 text-muted-foreground`,T&&`[-webkit-app-region:no-drag]`),children:(0,Z.jsx)(O,{"aria-hidden":`true`})})}),(0,Z.jsx)(Ar,{children:(0,Z.jsx)(s,{id:`IN4UX8`,values:{searchShortcut:_}})})]}),(0,Z.jsx)(Aa,{orientation:`vertical`,className:`mr-1 h-4 shrink-0 data-vertical:self-center`}),(0,Z.jsx)(pj,{})]}),M;t[15]===j?M=t[16]:(M=(0,Z.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 px-3`,children:j}),t[15]=j,t[16]=M);let N;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(N=ea(`flex shrink-0 items-center justify-end gap-2 px-3`,T&&`[&>*]:[-webkit-app-region:no-drag]`),t[17]=N):N=t[17];let P;t[18]!==S||t[19]!==l||t[20]!==o||t[21]!==y||t[22]!==b||t[23]!==w||t[24]!==m?(P=!m&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(vj,{input:S,open:o,onOpenChange:l}),(0,Z.jsx)(xj,{input:w,onClickWhenNoRemote:()=>b(!0)}),(0,Z.jsx)(us,{open:y,onOpenChange:b})]}),t[18]=S,t[19]=l,t[20]=o,t[21]=y,t[22]=b,t[23]=w,t[24]=m,t[25]=P):P=t[25];let F;t[26]!==r||t[27]!==n?(F=(0,Z.jsx)(Vo,{onSignIn:n,onSetIdentity:r}),t[26]=r,t[27]=n,t[28]=F):F=t[28];let I,L,R;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(Kk,{}),L=(0,Z.jsx)(Aa,{orientation:`vertical`,className:`h-4 shrink-0 data-vertical:self-center`}),R=(0,Z.jsx)(dd,{}),t[29]=I,t[30]=L,t[31]=R):(I=t[29],L=t[30],R=t[31]);let z;t[32]===m?z=t[33]:(z=!m&&(0,Z.jsx)(bj,{}),t[32]=m,t[33]=z);let B;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Z.jsx)(_j,{}),t[34]=B):B=t[34];let V;t[35]!==P||t[36]!==F||t[37]!==z?(V=(0,Z.jsxs)(`div`,{className:N,children:[P,F,I,L,R,z,B]}),t[35]=P,t[36]=F,t[37]=z,t[38]=V):V=t[38];let H;return t[39]!==V||t[40]!==D||t[41]!==A||t[42]!==M?(H=(0,Z.jsxs)(`header`,{"data-electron-drag":D,className:A,children:[M,V]}),t[39]=V,t[40]=D,t[41]=A,t[42]=M,t[43]=H):H=t[43],H}function Oj(e){let t=(0,$.c)(48),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{onOpenSearch:r}=n,{_:a}=i(),[o,s]=l_(),[c,l]=(0,Q.useState)(o),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(`auth`),[m,h]=(0,Q.useState)(Av[0].id),[g,_]=(0,Q.useState)(!1),[v,y]=(0,Q.useState)(!1),[b,x]=(0,Q.useState)(!1),[S,C]=(0,Q.useState)(null),w=Ho(),{projectLocalConfig:T,projectLocalSynced:E}=be(),D=No(),{activeDocName:O}=yt(),k=w?.hasRemote,A=w?.pushPermission?.checkStatus,j;t[2]!==v||t[3]!==T||t[4]!==E||t[5]!==k||t[6]!==A?(j=p_({autoSyncOnboardingDismissed:v,hasRemote:k,projectLocalSynced:E,projectLocalConfig:T,pushPermissionCheckStatus:A}),t[2]=v,t[3]=T,t[4]=E,t[5]=k,t[6]=A,t[7]=j):j=t[7];let M=j,N,P;t[8]===O?(N=t[9],P=t[10]):(N=()=>{let e=function(e){let t=e.detail;t&&O&&_c(O,{kind:`raw-mdx`,detail:t}),l(`source`)};return window.addEventListener(t_,e),()=>window.removeEventListener(t_,e)},P=[O],t[8]=O,t[9]=N,t[10]=P),(0,Q.useEffect)(N,P),u_(w?.pausedReason);let F;t[11]===s?F=t[12]:(F=function(e){l(e),s(e)},t[11]=s,t[12]=F);let I=F,L;t[13]===a?L=t[14]:(L=async function(){_(!0);try{let e=await fetch(`/api/save-version`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})});e.ok?X.success(a({id:`rdE6_3`})):(console.error(`[save-version] failed:`,await e.text()),X.error(a({id:`q7zsRM`})))}catch(e){console.error(`[save-version] failed:`,e),X.error(a({id:`q7zsRM`}))}_(!1)},t[13]=a,t[14]=L);let R=L,z;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(z=function(e){x(e),e||C(null)},t[15]=z):z=t[15];let B=z,V;t[16]!==a||t[17]!==O||t[18]!==D?(V={openSelection(e){let t=lg({docName:e.docName,workspace:D,instruction:e.instruction,selectionMarkdown:e.selectionMarkdown})??og({docName:O,workspace:D});return t===null?(X.error(a({id:`_VRtd7`})),!1):(C(t),x(!0),!0)}},t[16]=a,t[17]=O,t[18]=D,t[19]=V):V=t[19];let H,U;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>{p(`auth`),d(!0)},U=()=>{p(`identity`),d(!0)},t[20]=H,t[21]=U):(H=t[20],U=t[21]);let ee;t[22]!==r||t[23]!==S||t[24]!==b?(ee=(0,Z.jsx)(Dj,{onSignIn:H,onSetIdentity:U,onOpenSearch:r,openInAgentMenuOpen:b,openInAgentMenuInput:S,onOpenInAgentMenuOpenChange:B}),t[22]=r,t[23]=S,t[24]=b,t[25]=ee):ee=t[25];let te;t[26]!==m||t[27]!==c||t[28]!==I||t[29]!==R||t[30]!==g?(te=(0,Z.jsx)(xk,{editorMode:c,onModeChange:I,activeTab:m,onActiveTabChange:h,onSaveVersion:R,saving:g}),t[26]=m,t[27]=c,t[28]=I,t[29]=R,t[30]=g,t[31]=te):te=t[31];let W;t[32]!==V||t[33]!==ee||t[34]!==te?(W=(0,Z.jsxs)(wc,{value:V,children:[ee,te]}),t[32]=V,t[33]=ee,t[34]=te,t[35]=W):W=t[35];let ne=f===`identity`,re;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(re=()=>{d(!1)},t[36]=re):re=t[36];let G;t[37]!==u||t[38]!==ne?(G=(0,Z.jsx)(zo,{open:u,onOpenChange:d,identityPrompt:ne,onSuccess:re}),t[37]=u,t[38]=ne,t[39]=G):G=t[39];let ie;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(ie=()=>y(!0),t[40]=ie):ie=t[40];let K;t[41]===M?K=t[42]:(K=(0,Z.jsx)(d_,{open:M,onResolved:ie}),t[41]=M,t[42]=K);let q;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,Z.jsx)(Qg,{}),t[43]=q):q=t[43];let ae;return t[44]!==W||t[45]!==G||t[46]!==K?(ae=(0,Z.jsxs)(Z.Fragment,{children:[W,G,K,q]}),t[44]=W,t[45]=G,t[46]=K,t[47]=ae):ae=t[47],ae}function kj(e){let t=yr(di(e));typeof window>`u`||window.location.hash!==t&&(window.location.hash=t)}function Aj(){let e=(0,$.c)(11),{conflicts:t,loading:n,error:r}=lo();if(n)return null;if(r===`server`){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`section`,{"data-testid":`conflicts-section`,"aria-label":`Conflicted files`,className:`border-b border-amber-200/60 bg-amber-50/40 px-2 py-2 dark:border-amber-900/40 dark:bg-amber-950/20`,children:(0,Z.jsxs)(`p`,{"data-testid":`conflicts-section-error`,className:`px-2 py-1.5 text-[12px] text-amber-700 dark:text-amber-400`,children:[(0,Z.jsx)(Pi,{"aria-hidden":`true`,className:`mr-1.5 inline size-3`}),`Couldn't load conflicts — reload to retry.`]})}),e[0]=t):t=e[0],t}if(t.length===0)return null;let i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 font-mono text-[11px] uppercase tracking-wider text-amber-700 dark:text-amber-400`,children:[(0,Z.jsx)(Pi,{"aria-hidden":`true`,className:`size-3`}),`Conflicts`]}),e[1]=i):i=e[1];let a;e[2]===t.length?a=e[3]:(a=(0,Z.jsxs)(`header`,{className:`flex items-center justify-between px-2 pb-1.5`,children:[i,(0,Z.jsx)(`span`,{"data-testid":`conflicts-section-count`,className:`rounded-full bg-amber-500 px-1.5 py-0.5 font-mono text-[10px] font-medium leading-none text-white`,children:t.length})]}),e[2]=t.length,e[3]=a);let o;e[4]===t?o=e[5]:(o=t.map(jj),e[4]=t,e[5]=o);let s;e[6]===o?s=e[7]:(s=(0,Z.jsx)(`ul`,{className:`flex flex-col gap-px`,children:o}),e[6]=o,e[7]=s);let c;return e[8]!==a||e[9]!==s?(c=(0,Z.jsxs)(`section`,{"data-testid":`conflicts-section`,"aria-label":`Conflicted files`,className:`border-b border-amber-200/60 bg-amber-50/40 px-2 py-2 dark:border-amber-900/40 dark:bg-amber-950/20`,children:[a,s]}),e[8]=a,e[9]=s,e[10]=c):c=e[10],c}function jj(e){return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(sa,{variant:`ghost`,size:`sm`,"data-testid":`conflicts-section-row`,"data-file":e.file,title:e.file,className:`h-7 w-full justify-start gap-1.5 px-2 font-normal text-[13px] text-amber-800 hover:bg-amber-100/60 hover:text-amber-900 dark:text-amber-300 dark:hover:bg-amber-900/30 dark:hover:text-amber-200`,onClick:()=>kj(e.file),children:[(0,Z.jsx)(Pi,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:e.file})]})},e.file)}var Mj=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
28
+ `,r);if(s>-1&&s<t&&(e=s),i&&p<f.length){let t=Math.max(0,m?f[p].toA:f[p].fromA);t<=e&&(e=t,m&&p++,o=!0)}if(e>r){let t=document.createTextNode(l.slice(r,e));if(a){let e=d.appendChild(document.createElement(`span`));e.className=a,e.appendChild(t)}else d.appendChild(t);r=e}o&&(m=!m)}}if(u&&t.toA-t.fromA<=o){let t=u.parser.parse(l),n=0;Zs(t,{style:t=>fc(e,t)},(e,t,r)=>{e>n&&g(n,e,``),g(e,t,r),n=t}),g(n,l.length,``)}else g(0,l.length,``);return d.firstChild||d.appendChild(document.createElement(`br`)),c})});return _D.set(t.changes,i),i}function bD(e,t){let{state:n}=e,r=t??n.selection.main.head,i=e.state.field(EE).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=e.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),o=e.state.field(gD);i.fromB!=i.toB&&i.toA<=o.length&&(a+=e.state.lineBreak);let s=Js.of({from:i.fromA,to:Math.min(o.length,i.toA),insert:a},o.length);return e.dispatch({effects:hD.of({doc:s.apply(o),changes:s}),userEvent:`accept`}),!0}function xD(e,t){let{state:n}=e,r=t??n.selection.main.head,i=n.field(EE).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=n.field(gD).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=n.doc.length&&(a+=n.lineBreak),e.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:a},userEvent:`revert`}),!0}function SD(e){let t=new ec;for(let n of e.field(EE)){let r=e.facet(CE).overrideChunk&&TD(e,n);t.add(n.fromB,n.fromB,yD(e,n,!!r))}return t.finish()}var CD=Xs.define({create:e=>SD(e),update(e,t){return t.state.field(EE,!1)==t.startState.field(EE,!1)?e:SD(t.state)},provide:e=>ac.decorations.from(e)}),wD=new WeakMap;function TD(e,t){let n=wD.get(t);if(n!==void 0)return n;n=null;let r=e.field(gD),i=e.doc,a=r.lineAt(t.endA).number-r.lineAt(t.fromA).number+1,o=i.lineAt(t.endB).number-i.lineAt(t.fromB).number+1;abort:if(a==o&&a<10){let e=[],i=0,o=t.fromA,s=t.fromB;for(let n of t.changes){if(n.fromA<n.toA){i+=n.toA-n.fromA;let t=r.sliceString(o+n.fromA,o+n.toA);if(/\n/.test(t))break abort;e.push($s.widget({widget:new ED(t),side:-1}).range(s+n.fromB))}n.fromB<n.toB&&e.push(HE.range(s+n.fromB,s+n.toB))}i<t.endA-t.fromA-a*2&&(n=e)}return wD.set(t,n),n}var ED=class extends Ks{constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let t=document.createElement(`del`);return t.className=`cm-deletedText`,t.textContent=this.text,t}},DD=new class extends oc{constructor(){super(...arguments),this.elementClass=`cm-inlineChangedLineGutter`}},OD=$s.line({class:`cm-inlineChangedLine`});function kD(e,t,n,r){let i=TD(e,t),a=0;if(!i)return!1;for(let o=e.doc.lineAt(t.fromB);;){for(r&&r.add(o.from,o.from,DD),n.add(o.from,o.from,OD);a<i.length&&i[a].to<=o.to;){let e=i[a++];n.add(e.from,e.to,e.value)}if(o.to>=t.endB)break;o=e.doc.lineAt(o.to+1)}return!0}var AD=h({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),jD=an({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),MD=ac.theme({".cm-deletedChunk .cm-chunkButtons":{display:`flex`,gap:`0.25rem`},".cm-deletedChunk .cm-chunkButtons button[data-slot='button']":{margin:`0`,border:`1px solid transparent`,borderRadius:`min(var(--radius-md), 10px)`,color:`var(--primary-foreground)`},".cm-deletedChunk .cm-chunkButtons button[data-slot='button'][data-variant='destructive']":{color:`var(--destructive)`}});function ND({addControl:e,nextId:t,removeControl:n,root:r}){return(i,a)=>{let o=document.createElement(`span`);o.className=`inline-flex`;let s=t();return e({id:s,host:o,type:i,action:a}),queueMicrotask(()=>{r.contains(o)||n(s)}),o}}function PD(e){let t=(0,$.c)(32),{oldContent:n,newContent:r,layout:a,conflictMode:o,previewMode:c,oursOverride:l,onResolve:u,onAbort:d}=e,{_:f}=i(),p=l??r,m=(0,Q.useRef)(null),h=(0,Q.useRef)(null),g=(0,Q.useRef)(0),{resolvedTheme:_}=Li(),v=(0,Q.useRef)(u),y=(0,Q.useRef)(d),[b,x]=(0,Q.useState)(null),S;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(S=[],t[0]=S):S=t[0];let[C,w]=(0,Q.useState)(S),T;t[1]!==d||t[2]!==u?(T=()=>{v.current=u,y.current=d},t[1]=d,t[2]=u,t[3]=T):T=t[3],(0,Q.useEffect)(T);let E,D;t[4]!==o||t[5]!==p||t[6]!==a||t[7]!==n||t[8]!==c||t[9]!==_?(E=()=>{let e=m.current;if(!e)return;w([]);let t=new Map,r=!1,i=e=>{r||!t.delete(e)||w(t=>t.filter(t=>t.id!==e))},s=new MutationObserver(()=>{for(let[n,r]of t)e.contains(r)||i(n)});s.observe(e,{childList:!0,subtree:!0});let l=_===`dark`?AD:jD,u=[ac.editable.of(!1),Ys.readOnly.of(!0)],d=[Tc,R(),...u,l,ac.lineWrapping];if(h.current&&=(h.current.destroy(),null),c)h.current=new ac({doc:p,extensions:d,parent:e}),x(null);else if(o){let a=ND({addControl:e=>{r||(t.set(e.id,e.host),w(t=>[...t,e]))},nextId:()=>(g.current+=1,g.current),removeControl:i,root:e}),o=new ac({doc:p,extensions:[Tc,R(),ac.editable.of(!1),l,MD,ac.lineWrapping,mD({original:n,highlightChanges:!0,gutter:!0,mergeControls:a,collapseUnchanged:{margin:3,minSize:4}}),ac.updateListener.of(e=>{let t=DE(e.state);x(t?t.chunks.length:0)})],parent:e});h.current=o;let s=DE(o.state);x(s?s.chunks.length:0)}else a===`split`?h.current=new uD({a:{doc:n,extensions:d},b:{doc:p,extensions:d},parent:e,highlightChanges:!0,gutter:!0,collapseUnchanged:{margin:3,minSize:4}}):h.current=new ac({doc:p,extensions:[...d,mD({original:n,highlightChanges:!0,gutter:!0,mergeControls:!1,collapseUnchanged:{margin:3,minSize:4}})],parent:e});return()=>{r=!0,s.disconnect(),h.current&&=(h.current.destroy(),null)}},D=[n,p,a,_,o,c],t[4]=o,t[5]=p,t[6]=a,t[7]=n,t[8]=c,t[9]=_,t[10]=E,t[11]=D):(E=t[10],D=t[11]),(0,Q.useEffect)(E,D);let O;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(O=function(){let e=h.current;!e||!(e instanceof ac)||v.current?.(e.state.doc.toString())},t[12]=O):O=t[12];let k=O,A;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(){let e=h.current;!e||!(e instanceof ac)||De(e)},t[13]=A):A=t[13];let j=A,M=b===0,N;t[14]!==f||t[15]!==b?(N=b===null?``:b===0?f({id:`lPzyrU`}):Y._({id:`8FqTCr`,values:{chunksRemaining:b}}),t[14]=f,t[15]=b,t[16]=N):N=t[16];let P=N,F;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(`div`,{ref:m,className:`diff-view min-h-0 flex-1 overflow-y-auto subtle-scrollbar`}),t[17]=F):F=t[17];let I;if(t[18]!==f||t[19]!==C){let e;t[21]===f?e=t[22]:(e=e=>(0,Kc.createPortal)((0,Z.jsx)(sa,{type:`button`,variant:e.type===`accept`?`default`:`destructive`,size:`xs`,onClick:t=>{e.action(t.nativeEvent)},children:e.type===`accept`?f({id:`g3UF2V`}):f({id:`1t_NnN`})}),e.host,e.id),t[21]=f,t[22]=e),I=C.map(e),t[18]=f,t[19]=C,t[20]=I}else I=t[20];let L;t[23]!==M||t[24]!==o||t[25]!==P||t[26]!==d||t[27]!==u?(L=o&&(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-2 border-t shrink-0`,children:[(0,Z.jsx)(`span`,{className:`text-xs ${M?`text-emerald-600 dark:text-emerald-400`:`text-muted-foreground`}`,children:P}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[d&&(0,Z.jsx)(sa,{className:`uppercase font-mono`,variant:`ghost`,size:`sm`,onClick:d,children:(0,Z.jsx)(s,{id:`XyOUTJ`})}),(0,Z.jsx)(sa,{className:`uppercase font-mono`,variant:`outline`,size:`sm`,onClick:j,children:`Undo`}),u&&(0,Z.jsx)(sa,{variant:`default`,size:`sm`,disabled:!M,onClick:k,children:(0,Z.jsx)(s,{id:`Lcehxn`})})]})]}),t[23]=M,t[24]=o,t[25]=P,t[26]=d,t[27]=u,t[28]=L):L=t[28];let z;return t[29]!==L||t[30]!==I?(z=(0,Z.jsxs)(`div`,{className:`flex flex-col h-full`,children:[F,I,L]}),t[29]=L,t[30]=I,t[31]=z):z=t[31],z}async function FD(e,t,n){try{let r={file:e,strategy:t};n!==void 0&&(r.content=n);let i=await fetch(`/api/sync/resolve-conflict`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)});if(i.ok)return{ok:!0};let a;try{let e=await i.json();typeof e.detail==`string`?a=e.detail:typeof e.title==`string`&&(a=e.title)}catch{}return{ok:!1,detail:a}}catch(n){let r=n instanceof Error?n.message:String(n);return console.warn(JSON.stringify({event:`conflict-resolve-dispatch-failed`,file:e,strategy:t,detail:r})),{ok:!1,detail:r}}}async function ID(e,t){return FD(e,`content`,t)}async function LD(e){return FD(e,`mine`)}async function RD(e){return FD(e,`theirs`)}async function zD(e){return FD(e,`delete`)}async function BD(e){try{let t=await fetch(`/api/sync/conflict-content?file=${encodeURIComponent(e)}&source=ytext`);if(!t.ok){let n;try{let e=await t.json();typeof e.detail==`string`?n=e.detail:typeof e.title==`string`&&(n=e.title)}catch{}return console.warn(JSON.stringify({event:`conflict-content-fetch-failed`,file:e,status:t.status,detail:n})),null}let n=await t.json(),r=n.kind===`delete-modify`||n.kind===`modify-delete`||n.kind===`both-modified`?n.kind:`both-modified`;return n.kind!==r&&console.warn(JSON.stringify({event:`conflict-kind-missing-fallback`,file:e,receivedKind:n.kind??null})),{base:n.base??``,ours:n.ours??``,theirs:n.theirs??``,kind:r}}catch(t){return console.warn(JSON.stringify({event:`conflict-content-fetch-failed`,file:e,status:null,detail:t instanceof Error?t.message:String(t)})),null}}function VD(e){let t=(0,$.c)(84),{docName:n}=e,{_:r}=i(),{conflicts:a,loading:o}=lo(),c;if(t[0]!==a||t[1]!==n){let e;t[3]===n?e=t[4]:(e=e=>di(e.file)===n,t[3]=n,t[4]=e),c=a.find(e),t[0]=a,t[1]=n,t[2]=c}else c=t[2];let l=c,u=l?.file??`${n}.md`,[d,f]=(0,Q.useState)(null),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(!1),_,v;t[5]===n?(_=t[6],v=t[7]):(_=()=>(console.warn(JSON.stringify({event:`editor-area-swap-to-diffview`,"doc.name":n})),()=>{console.warn(JSON.stringify({event:`editor-area-swap-from-diffview`,"doc.name":n}))}),v=[n],t[5]=n,t[6]=_,t[7]=v),(0,Q.useEffect)(_,v);let y=o||l===void 0,b,x;t[8]!==y||t[9]!==u?(b=()=>{if(y)return;let e=!1;return f(null),m(!1),BD(u).then(t=>{e||(t===null?m(!0):f(t))}),()=>{e=!0}},x=[u,y],t[8]=y,t[9]=u,t[10]=b,t[11]=x):(b=t[10],x=t[11]),(0,Q.useEffect)(b,x);let S;t[12]!==r||t[13]!==u?(S=async function(e){let t=await ID(u,e);t.ok||X.error(r({id:`K-h9cT`,values:{filePath:u}}),{description:t.detail})},t[12]=r,t[13]=u,t[14]=S):S=t[14];let C=S,w;t[15]!==r||t[16]!==u?(w=async function(e){g(!0);let t=await e(u);t.ok||(g(!1),X.error(r({id:`jPUPvG`,values:{filePath:u}}),{description:t.detail}))},t[15]=r,t[16]=u,t[17]=w):w=t[17];let T=w;if(p){let e;return t[18]===u?e=t[19]:(e=(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`ajz9F8`,values:{filePath:u}})}),t[18]=u,t[19]=e),e}if(d===null){let e;return t[20]===u?e=t[21]:(e=(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`DF1MtZ`,values:{filePath:u}})}),t[20]=u,t[21]=e),e}if(d.kind===`delete-modify`){let e;t[22]===d.theirs?e=t[23]:(e=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(PD,{oldContent:``,newContent:d.theirs,layout:`unified`,previewMode:!0})}),t[22]=d.theirs,t[23]=e);let n;t[24]===u?n=t[25]:(n={filePath:u},t[24]=u,t[25]=n);let r;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`})},t[26]=r):r=t[26];let i;t[27]===n?i=t[28]:(i=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`V48OUT`,values:n,components:r})}),t[27]=n,t[28]=i);let a;t[29]===T?a=t[30]:(a=()=>void T(zD),t[29]=T,t[30]=a);let o;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(s,{id:`Vlc75q`}),t[31]=o):o=t[31];let c;t[32]!==h||t[33]!==a?(c=(0,Z.jsx)(sa,{type:`button`,variant:`destructive`,disabled:h,onClick:a,children:o}),t[32]=h,t[33]=a,t[34]=c):c=t[34];let l;t[35]===T?l=t[36]:(l=()=>void T(RD),t[35]=T,t[36]=l);let f;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(s,{id:`3mFsc3`}),t[37]=f):f=t[37];let p;t[38]!==h||t[39]!==l?(p=(0,Z.jsx)(sa,{type:`button`,variant:`default`,disabled:h,onClick:l,children:f}),t[38]=h,t[39]=l,t[40]=p):p=t[40];let m;t[41]!==c||t[42]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex shrink-0 gap-3`,children:[c,p]}),t[41]=c,t[42]=p,t[43]=m):m=t[43];let g;t[44]!==i||t[45]!==m?(g=(0,Z.jsxs)(`div`,{className:`flex flex-shrink-0 flex-wrap items-center justify-between gap-x-6 gap-y-3 border-t px-6 py-4`,children:[i,m]}),t[44]=i,t[45]=m,t[46]=g):g=t[46];let _;return t[47]!==g||t[48]!==e?(_=(0,Z.jsxs)(`div`,{className:`flex h-full flex-col bg-background`,children:[e,g]}),t[47]=g,t[48]=e,t[49]=_):_=t[49],_}if(d.kind===`modify-delete`){let e;t[50]===d.ours?e=t[51]:(e=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(PD,{oldContent:``,newContent:d.ours,layout:`unified`,previewMode:!0})}),t[50]=d.ours,t[51]=e);let n;t[52]===u?n=t[53]:(n={filePath:u},t[52]=u,t[53]=n);let r;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`})},t[54]=r):r=t[54];let i;t[55]===n?i=t[56]:(i=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`EhDLBx`,values:n,components:r})}),t[55]=n,t[56]=i);let a;t[57]===T?a=t[58]:(a=()=>void T(LD),t[57]=T,t[58]=a);let o;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(s,{id:`0NA4b3`}),t[59]=o):o=t[59];let c;t[60]!==h||t[61]!==a?(c=(0,Z.jsx)(sa,{type:`button`,variant:`default`,disabled:h,onClick:a,children:o}),t[60]=h,t[61]=a,t[62]=c):c=t[62];let l;t[63]===T?l=t[64]:(l=()=>void T(zD),t[63]=T,t[64]=l);let f;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(s,{id:`qSxaOz`}),t[65]=f):f=t[65];let p;t[66]!==h||t[67]!==l?(p=(0,Z.jsx)(sa,{type:`button`,variant:`destructive`,disabled:h,onClick:l,children:f}),t[66]=h,t[67]=l,t[68]=p):p=t[68];let m;t[69]!==c||t[70]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex shrink-0 gap-3`,children:[c,p]}),t[69]=c,t[70]=p,t[71]=m):m=t[71];let g;t[72]!==i||t[73]!==m?(g=(0,Z.jsxs)(`div`,{className:`flex flex-shrink-0 flex-wrap items-center justify-between gap-x-6 gap-y-3 border-t px-6 py-4`,children:[i,m]}),t[72]=i,t[73]=m,t[74]=g):g=t[74];let _;return t[75]!==g||t[76]!==e?(_=(0,Z.jsxs)(`div`,{className:`flex h-full flex-col bg-background`,children:[e,g]}),t[75]=g,t[76]=e,t[77]=_):_=t[77],_}let E;t[78]===C?E=t[79]:(E=e=>void C(e),t[78]=C,t[79]=E);let D;return t[80]!==d.ours||t[81]!==d.theirs||t[82]!==E?(D=(0,Z.jsx)(PD,{oldContent:d.theirs,newContent:d.ours,layout:`unified`,conflictMode:!0,onResolve:E}),t[80]=d.ours,t[81]=d.theirs,t[82]=E,t[83]=D):D=t[83],D}function HD(e){let t=(0,$.c)(2),{docName:n,provider:r,children:i}=e;(0,Q.use)(Wt(n,r));let a;return t[0]===i?a=t[1]:(a=(0,Z.jsx)(Z.Fragment,{children:i}),t[0]=i,t[1]=a),a}var UD=`__back-nav__`;function WD(e){return e instanceof Re||e instanceof Ct||e instanceof Me||e instanceof rt||e instanceof It||e instanceof te?e.docName:null}function GD(e){if(e instanceof Re){let t=e.docName;return{title:Y._({id:`Jejur6`}),summary:Y._({id:`jSY41h`,values:{docName:t}})}}if(e instanceof Ct){let t=e.docName;return{title:Y._({id:`V7QxyT`}),summary:Y._({id:`xG4tb6`,values:{docName:t}})}}if(e instanceof Me){let t=e.docName;return{title:Y._({id:`1di5fu`}),summary:Y._({id:`PQCdtv`,values:{docName:t}})}}if(e instanceof rt){let t=e.docName;return{title:Y._({id:`wvbc1r`}),summary:Y._({id:`IX7-sq`,values:{docName:t}})}}if(e instanceof It)return{title:Y._({id:`Gfr4fu`}),summary:Y._({id:`j6LB7S`})};if(e instanceof te){let t=e.docName;return{title:Y._({id:`vv7kpg`}),summary:Y._({id:`mdKFEy`,values:{docName:t}})}}let t=e instanceof Error&&e.message?e.message:Y._({id:`W5A0Ly`});return{title:Y._({id:`29VNqC`}),summary:t}}function KD(e){let t=(0,$.c)(28),{error:n,resetErrorBoundary:r,activeDocName:i,previousDocName:a,onNavigateBack:o}=e,c;t[0]===n?c=t[1]:(c=GD(n),t[0]=n,t[1]=c);let{title:l,summary:u}=c,d=!!a&&!!o,f=(0,Q.useRef)(null),p,m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>{f.current?.focus()},m=[],t[2]=p,t[3]=m):(p=t[2],m=t[3]),(0,Q.useEffect)(p,m);let h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(wx,{size:80,variant:`sleeping`}),t[4]=h):h=t[4];let g;t[5]===l?g=t[6]:(g=(0,Z.jsx)(`h2`,{id:`document-error-title`,className:`text-2xl font-light tracking-tighter text-balance`,children:l}),t[5]=l,t[6]=g);let _;t[7]===u?_=t[8]:(_=(0,Z.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:u}),t[7]=u,t[8]=_);let v;t[9]!==g||t[10]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[g,_]}),t[9]=g,t[10]=_,t[11]=v):v=t[11];let y;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(s,{id:`KDw4GX`}),t[12]=y):y=t[12];let b;t[13]===r?b=t[14]:(b=(0,Z.jsx)(sa,{ref:f,variant:`default`,onClick:r,children:y}),t[13]=r,t[14]=b);let x;t[15]!==i||t[16]!==d||t[17]!==n||t[18]!==o||t[19]!==a||t[20]!==r?(x=d?(0,Z.jsx)(sa,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>{!a||!o||(ft(WD(n)??i),o(a),r(UD))},children:(0,Z.jsx)(s,{id:`CKyk7Q`})}):null,t[15]=i,t[16]=d,t[17]=n,t[18]=o,t[19]=a,t[20]=r,t[21]=x):x=t[21];let S;t[22]!==x||t[23]!==b?(S=(0,Z.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[b,x]}),t[22]=x,t[23]=b,t[24]=S):S=t[24];let C;return t[25]!==S||t[26]!==v?(C=(0,Z.jsxs)(`div`,{role:`alert`,"aria-labelledby":`document-error-title`,"data-slot":`document-error-boundary`,className:`flex h-full flex-col items-center justify-center gap-8 p-8 text-center`,children:[h,v,S]}),t[25]=S,t[26]=v,t[27]=C):C=t[27],C}function qD(e){let t=(0,$.c)(17),{activeDocName:n,previousDocName:r,onNavigateBack:i,onRecycle:a,children:o}=e,s;t[0]!==n||t[1]!==i||t[2]!==r?(s=e=>(0,Z.jsx)(KD,{...e,activeDocName:n,previousDocName:r,onNavigateBack:i}),t[0]=n,t[1]=i,t[2]=r,t[3]=s):s=t[3];let c;t[4]===n?c=t[5]:(c=[n],t[4]=n,t[5]=c);let l;t[6]!==n||t[7]!==a?(l=e=>{if(e.reason===`imperative-api`){if(Array.isArray(e.args)&&e.args[0]===UD){console.warn(`[DocumentErrorBoundary] back-nav reset (no recycle)`);return}a(n),console.warn(`[DocumentErrorBoundary] retry recycled ${n}`)}else console.warn(`[DocumentErrorBoundary] reset by key change (${e.prev?.[0]} → ${e.next?.[0]})`)},t[6]=n,t[7]=a,t[8]=l):l=t[8];let u;t[9]===n?u=t[10]:(u=e=>{console.error(`[DocumentErrorBoundary] rendered fallback for ${n}: ${GD(e).title}`,e)},t[9]=n,t[10]=u);let d;return t[11]!==o||t[12]!==s||t[13]!==c||t[14]!==l||t[15]!==u?(d=(0,Z.jsx)(re,{fallbackRender:s,resetKeys:c,onReset:l,onError:u,children:o}),t[11]=o,t[12]=s,t[13]=c,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function JD(e){let t=e.document.getText(`source`).toString(),{map:n,parseError:r}=Br(t);return{map:n,keys:Wr(t),parseError:r}}function YD(e){let t=(0,$.c)(21),{provider:n}=e,r;t[0]===n?r=t[1]:(r=()=>JD(n),t[0]=n,t[1]=r);let[i,a]=(0,Q.useState)(r),o,s;t[2]===n?(o=t[3],s=t[4]):(o=()=>{let e=Hn(n);a(e.current());let t=e.subscribe(e=>{a(e)});return()=>{t(),e.dispose()}},s=[n],t[2]=n,t[3]=o,t[4]=s),(0,Q.useEffect)(o,s);let c;t[5]===i.map.icon?c=t[6]:(c=et(i.map.icon),t[5]=i.map.icon,t[6]=c);let l=c,u;t[7]===i.map.cover?u=t[8]:(u=gt(i.map.cover),t[7]=i.map.cover,t[8]=u);let d=u,f=d.kind===`url`||d.kind===`path`,p=l.kind!==`unsupported`;if(!f&&!p)return null;let m=f?`true`:`false`,h=p?`true`:`false`,g;t[9]!==d||t[10]!==f?(g=f?(0,Z.jsx)(XD,{cover:d}):null,t[9]=d,t[10]=f,t[11]=g):g=t[11];let _;t[12]!==f||t[13]!==p||t[14]!==l?(_=p?(0,Z.jsx)(ZD,{icon:l,hasCover:f}):null,t[12]=f,t[13]=p,t[14]=l,t[15]=_):_=t[15];let v;return t[16]!==m||t[17]!==h||t[18]!==g||t[19]!==_?(v=(0,Z.jsxs)(`div`,{className:`page-header editor-content-aligned`,"data-has-cover":m,"data-has-icon":h,"aria-hidden":`true`,"data-testid":`page-header`,children:[g,_]}),t[16]=m,t[17]=h,t[18]=g,t[19]=_,t[20]=v):v=t[20],v}function XD(e){let t=(0,$.c)(2),{cover:n}=e,r;return t[0]===n.value?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`page-header-cover`,"data-testid":`page-header-cover`,children:(0,Z.jsx)(`img`,{src:n.value,alt:``,draggable:!1,loading:`lazy`,referrerPolicy:`no-referrer`,className:`page-header-cover-img`})}),t[0]=n.value,t[1]=r),r}function ZD(e){let t=(0,$.c)(9),{icon:n,hasCover:r}=e,i=r?`page-header-icon page-header-icon--with-cover`:`page-header-icon`;if(n.kind===`emoji`){let e;return t[0]!==n.value||t[1]!==i?(e=(0,Z.jsx)(`span`,{className:i,"data-testid":`page-header-icon`,"data-kind":`emoji`,children:n.value}),t[0]=n.value,t[1]=i,t[2]=e):e=t[2],e}let a;t[3]===n.value?a=t[4]:(a=(0,Z.jsx)(`img`,{src:n.value,alt:``,draggable:!1,referrerPolicy:`no-referrer`,className:`page-header-icon-img`}),t[3]=n.value,t[4]=a);let o;return t[5]!==n.kind||t[6]!==i||t[7]!==a?(o=(0,Z.jsx)(`span`,{className:i,"data-testid":`page-header-icon`,"data-kind":n.kind,children:a}),t[5]=n.kind,t[6]=i,t[7]=a,t[8]=o):o=t[8],o}function QD(e){let t=e.document.getText(`source`).toString(),{map:n,parseError:r}=Br(t);return{map:n,keys:Wr(t),parseError:r}}function $D(e){let t=(0,$.c)(127),{provider:n}=e,{_:r}=i(),[a,o]=(0,Q.useState)(null),c;t[0]===n?c=t[1]:(c=()=>QD(n),t[0]=n,t[1]=c);let[l,u]=(0,Q.useState)(c),d,f;t[2]===n?(d=t[3],f=t[4]):(d=()=>{let e=Hn(n);o(e),u(e.current());let t=e.subscribe(e=>{u(e)});return()=>{t(),e.dispose(),o(t=>t===e?null:t)}},f=[n],t[2]=n,t[3]=d,t[4]=f),(0,Q.useEffect)(d,f);let p=l.map,m=l.keys,h=l.parseError,[g,_]=(0,Q.useState)(!1),v;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v={},t[5]=v):v=t[5];let[y,b]=(0,Q.useState)(v),[x,S]=(0,Q.useState)(null),[C,w]=(0,Q.useState)(null),T;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(T={},t[6]=T):T=t[6];let[E,D]=(0,Q.useState)(T),O;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(O={},t[7]=O):O=t[7];let[k,A]=(0,Q.useState)(O),j=n.configuration.name??``,M;t[8]!==r||t[9]!==a?(M=function(e){if(!a)return{ok:!1,error:r({id:`9zb2WA`})};let t=a.patch(e);if(t.ok)return{ok:!0};if(t.error.code===`WRITE_ERROR`)return console.warn(`[PropertyPanel] binding write error:`,t.error.detail),{ok:!1,error:t.error.detail};let n=Xr(t.error);return{ok:!1,error:t.error.issues[0]?.message??r({id:`8fRyLo`}),fieldErrors:Object.keys(n).length>0?n:void 0}},t[8]=r,t[9]=a,t[10]=M):M=t[10];let N=M,P;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(e){D(t=>{if(!Object.hasOwn(t,e))return t;let n={...t};return delete n[e],n})},t[11]=P):P=t[11];let F=P,I;t[12]===r?I=t[13]:(I=function(e,t){if(e.ok)return;let n=e.error??r({id:`4g19V6`}),i=e.fieldErrors??{};D(e=>{let r={...e};for(let e of t)r[e]=i[e]??n;return r}),A(e=>{let n={...e};for(let e of t)n[e]=(n[e]??0)+1;return n})},t[12]=r,t[13]=I);let L=I,R;t[14]!==N||t[15]!==L?(R=function(e,t){F(e),L(N({[e]:t}),[e])},t[14]=N,t[15]=L,t[16]=R):R=t[16];let z=R,B;t[17]!==N||t[18]!==L?(B=function(e){F(e),L(N({[e]:null}),[e])},t[17]=N,t[18]=L,t[19]=B):B=t[19];let V=B,H;t[20]!==r||t[21]!==a?(H=function(e,t){if(!a)return{ok:!1,error:r({id:`9zb2WA`})};if(e===t)return{ok:!0};let n=a.rename(e,t);if(n.ok)return{ok:!0};if(n.error.code===`WRITE_ERROR`)return{ok:!1,error:n.error.detail};let i=Xr(n.error);return{ok:!1,error:n.error.issues[0]?.message??r({id:`I1gRhX`}),fieldErrors:Object.keys(i).length>0?i:void 0}},t[20]=r,t[21]=a,t[22]=H):H=t[22];let U=H,ee;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(ee=function(e,t){return`${e} ${t}`},t[23]=ee):ee=t[23];let te=ee,W;t[24]!==a||t[25]!==m?(W=function(e){if(!a)return;let t=String(e.active.id),n=e.over?String(e.over.id):null;if(!n||t===n)return;let r=m.map((e,t)=>te(e,t)),i=r.indexOf(t),o=r.indexOf(n);if(i<0||o<0)return;let s=m.slice(),[c]=s.splice(i,1);if(!c)return;s.splice(o,0,c);let l=a.reorder(s);l.ok||console.warn(`[PropertyPanel] reorder failed:`,l.error)},t[24]=a,t[25]=m,t[26]=W):W=t[26];let ne=W,re;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(re={activationConstraint:{distance:4}},t[27]=re):re=t[27];let G;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(G={coordinateGetter:fo},t[28]=G):G=t[28];let ie=ro(So(bo,re),So(Ua,G)),K;t[29]!==z||t[30]!==p?(K=function(e,t){let n=p[e];if(n===void 0)return;b(n=>({...n,[e]:t}));let r=qa(n,t);(!Object.hasOwn(p,e)||!_i(n,r))&&z(e,r)},t[29]=z,t[30]=p,t[31]=K):K=t[31];let q=K,ae;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(ae=function(){S({name:``,type:`text`,value:``,error:null}),_(!1)},t[32]=ae):ae=t[32];let oe=ae,{addPropertySignal:se,clearAddProperty:ce}=AS(),le;t[33]!==se||t[34]!==j?(le=se.get(j)??0,t[33]=se,t[34]=j,t[35]=le):le=t[35];let ue=le,de,fe;t[36]===ue?(de=t[37],fe=t[38]):(de=()=>{ue>0&&(S({name:``,type:`text`,value:``,error:null}),_(!1))},fe=[ue],t[36]=ue,t[37]=de,t[38]=fe),(0,Q.useEffect)(de,fe);let pe,me;t[39]!==ce||t[40]!==j?(pe=()=>()=>ce(j),me=[j,ce],t[39]=ce,t[40]=j,t[41]=pe,t[42]=me):(pe=t[41],me=t[42]),(0,Q.useEffect)(pe,me);let he;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(he=function(e){S(t=>{if(!t)return t;let n=e===`date`?new Date().toISOString().slice(0,10):Va[e];return{...t,type:e,value:n,error:null}})},t[43]=he):he=t[43];let ge=he,_e;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(_e=function(e){S(t=>t&&{...t,value:e})},t[44]=_e):_e=t[44];let ve=_e,ye;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(ye=function(e){S(t=>t&&{...t,name:e,error:null})},t[45]=ye):ye=t[45];let be=ye,xe;t[46]!==r||t[47]!==x||t[48]!==N||t[49]!==p?(xe=function(){if(!x)return;let e=x.name.trim();if(!e){S({...x,error:r({id:`8_brI5`})});return}if(e===`frontmatter`){S({...x,error:r({id:`dURmlQ`})});return}if(Object.hasOwn(p,e)){S({...x,error:r({id:`njU86j`,values:{trimmed:e}})});return}let t=N({[e]:x.value});if(t.ok){S(null);return}let n=t.fieldErrors?.[e],i=t.error??r({id:`OJeiSH`});S({...x,error:n??i})},t[46]=r,t[47]=x,t[48]=N,t[49]=p,t[50]=xe):xe=t[50];let Se=xe,Ce;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=function(){S(null)},t[51]=Ce):Ce=t[51];let we=Ce,Te;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(Te=function(e){w({key:e,draft:e,error:null})},t[52]=Te):Te=t[52];let Ee=Te,De;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(De=function(e){w(t=>t&&{...t,draft:e,error:null})},t[53]=De):De=t[53];let Oe=De,ke;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(ke=function(){w(null)},t[54]=ke):ke=t[54];let Ae=ke,je;t[55]!==r||t[56]!==p||t[57]!==U||t[58]!==C?(je=function(){if(!C)return;let e=C.draft.trim();if(!e){w(null);return}if(e===C.key){w(null);return}if(e===`frontmatter`){w({...C,error:r({id:`dURmlQ`})});return}if(Object.hasOwn(p,e)){w({...C,error:r({id:`njU86j`,values:{trimmed:e}})});return}let t=U(C.key,e);if(t.ok){b(t=>{if(!Object.hasOwn(t,C.key))return t;let n={...t};return n[e]=n[C.key],delete n[C.key],n}),F(C.key),w(null);return}let n=t.fieldErrors?.[e]??t.fieldErrors?.[C.key]??t.error??r({id:`2ryd91`});w({...C,error:n})},t[55]=r,t[56]=p,t[57]=U,t[58]=C,t[59]=je):je=t[59];let Me=je,Ne;t[60]!==p||t[61]!==m?(Ne=m.length>0?m:Object.keys(p),t[60]=p,t[61]=m,t[62]=Ne):Ne=t[62];let Pe=Ne,Fe;if(t[63]!==Pe){Fe=new Map;for(let e of Pe)Fe.set(e,(Fe.get(e)??0)+1);t[63]=Pe,t[64]=Fe}else Fe=t[64];if(Pe.length===0&&!x&&!h)return null;let Ie=!g,Le;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(Le=e=>_(!e),t[65]=Le):Le=t[65];let Re=!g,ze;t[66]===Re?ze=t[67]:(ze=(0,Z.jsx)(Os,{"data-expanded":Re,className:`size-3.5 shrink-0 text-muted-foreground transition-transform duration-150 ease-out data-[expanded=true]:rotate-90`}),t[66]=Re,t[67]=ze);let Be;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`l_UFPv`})}),t[68]=Be):Be=t[68];let Ve;t[69]===ze?Ve=t[70]:(Ve=(0,Z.jsx)(js,{asChild:!0,children:(0,Z.jsxs)(sa,{type:`button`,variant:`ghost`,className:`mb-1.5 flex h-auto w-fit bg-transparent! items-center gap-1 px-1 py-0.5 text-base font-medium text-foreground hover:bg-transparent hover:text-foreground`,children:[ze,Be]})}),t[69]=ze,t[70]=Ve);let He;t[71]===h?He=t[72]:(He=h?(0,Z.jsxs)(`div`,{role:`alert`,"data-testid":`property-panel-yaml-error`,className:`mb-1 flex items-start gap-1.5 rounded border border-destructive/30 bg-destructive/5 px-2 py-1.5 text-[11px] text-destructive`,children:[(0,Z.jsx)(Pi,{className:`size-3.5 shrink-0 mt-0.5`}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(s,{id:`zaXlhf`}),(0,Z.jsx)(`span`,{className:`block text-[10px] opacity-80`,children:h})]})]}):null,t[71]=h,t[72]=He);let Ue;if(t[73]!==Pe){let e;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(e=(e,t)=>te(e,t),t[75]=e):e=t[75],Ue=Pe.map(e),t[73]=Pe,t[74]=Ue}else Ue=t[74];let We;if(t[76]!==z||t[77]!==Me||t[78]!==Fe||t[79]!==E||t[80]!==p||t[81]!==y||t[82]!==V||t[83]!==C||t[84]!==Pe||t[85]!==k||t[86]!==q){let e;t[88]!==z||t[89]!==Me||t[90]!==Fe||t[91]!==E||t[92]!==p||t[93]!==y||t[94]!==V||t[95]!==C||t[96]!==k||t[97]!==q?(e=(e,t)=>{let n=p[e];if(n===void 0)return null;let r=y[e]??$n(n),i=C?.key===e?C:null,a=(Fe.get(e)??0)>1;return(0,Z.jsx)(to,{sortableId:te(e,t),keyName:e,value:n,declared:r,error:E[e]??null,resetCounter:k[e]??0,isDuplicate:a,rename:{state:i,onBegin:()=>Ee(e),onChangeDraft:Oe,onCommit:Me,onCancel:Ae},onCommit:t=>z(e,t),onChangeType:t=>q(e,t),onRemove:()=>V(e)},`${e}-${t}`)},t[88]=z,t[89]=Me,t[90]=Fe,t[91]=E,t[92]=p,t[93]=y,t[94]=V,t[95]=C,t[96]=k,t[97]=q,t[98]=e):e=t[98],We=Pe.map(e),t[76]=z,t[77]=Me,t[78]=Fe,t[79]=E,t[80]=p,t[81]=y,t[82]=V,t[83]=C,t[84]=Pe,t[85]=k,t[86]=q,t[87]=We}else We=t[87];let Ge;t[99]!==Ue||t[100]!==We?(Ge=(0,Z.jsx)(Da,{items:Ue,strategy:La,children:We}),t[99]=Ue,t[100]=We,t[101]=Ge):Ge=t[101];let Ke;t[102]!==ne||t[103]!==ie||t[104]!==Ge?(Ke=(0,Z.jsx)(Ga,{sensors:ie,collisionDetection:vo,onDragEnd:ne,children:Ge}),t[102]=ne,t[103]=ie,t[104]=Ge,t[105]=Ke):Ke=t[105];let qe;t[106]!==z||t[107]!==E||t[108]!==p||t[109]!==k?(qe=Object.hasOwn(p,`tags`)?null:(0,Z.jsx)(to,{keyName:`tags`,value:[],declared:`list`,error:E.tags??null,resetCounter:k.tags??0,isPlaceholder:!0,onCommit:e=>z(`tags`,e),onChangeType:eO},`virtual-tags`),t[106]=z,t[107]=E,t[108]=p,t[109]=k,t[110]=qe):qe=t[110];let Je;t[111]!==r||t[112]!==x||t[113]!==Se?(Je=x?(0,Z.jsx)(Za,{draft:x,onChangeName:be,onChangeType:ge,onChangeValue:ve,onCommit:Se,onCancel:we}):(0,Z.jsxs)(`div`,{className:`mt-1 flex items-center gap-1`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`h-7 w-4 shrink-0`}),(0,Z.jsxs)(sa,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`add-property-trigger`,onClick:oe,"aria-label":r({id:`F-NRCj`}),className:`flex items-center gap-1.5 rounded px-2 py-1 font-medium text-sm hover:bg-muted/50 hover:text-foreground`,children:[(0,Z.jsx)(At,{className:`size-3.5`}),(0,Z.jsx)(`span`,{children:(0,Z.jsx)(s,{id:`m16xKo`})})]})]}),t[111]=r,t[112]=x,t[113]=Se,t[114]=Je):Je=t[114];let Ye;t[115]!==He||t[116]!==Ke||t[117]!==qe||t[118]!==Je?(Ye=(0,Z.jsxs)(As,{className:`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in]`,children:[He,Ke,qe,Je]}),t[115]=He,t[116]=Ke,t[117]=qe,t[118]=Je,t[119]=Ye):Ye=t[119];let Xe;t[120]!==Ie||t[121]!==Ve||t[122]!==Ye?(Xe=(0,Z.jsx)(`div`,{className:`property-panel editor-content-aligned pt-4 pb-4 text-sm`,"data-testid":`property-panel`,children:(0,Z.jsxs)(Ms,{open:Ie,onOpenChange:Le,children:[Ve,Ye]})}),t[120]=Ie,t[121]=Ve,t[122]=Ye,t[123]=Xe):Xe=t[123];let Ze;return t[124]!==a||t[125]!==Xe?(Ze=(0,Z.jsx)(fs,{binding:a,children:Xe}),t[124]=a,t[125]=Xe,t[126]=Ze):Ze=t[126],Ze}function eO(){}var tO=p(`LARGE_DOC_CHAR_THRESHOLD`,5e5);function nO(e){let t=e.threshold??tO;return e.ytextLength>t?{renderSource:e.isSourceMode||e.visitedSource,renderVisual:!e.isSourceMode||e.visitedVisual,isLarge:!0}:{renderSource:!0,renderVisual:!0,isLarge:!1}}function rO(e){return e.hasEmittedFirstToggle||!e.isLarge?!1:e.renderSource&&e.renderVisual}var iO=p(`ACTIVITY_MOUNT_LIMIT`,3);function aO(){return n(()=>import(`./SourceEditor-D1zhJS8f.js`),__vite__mapDeps([47,1,35,2,36,37,22,38,39,40,41,21,6,3,7,4,10,12,9,42,48,24,46]),import.meta.url)}var oO=(0,Q.lazy)(async()=>({default:(await aO()).SourceEditor}));function sO(e,t,n){if(n<=0)return[];let r=e.filter(e=>!Je(e.docName)),i=[...r].sort((e,t)=>t.lastAccessedAt-e.lastAccessedAt).slice(0,n);if(t===null||i.some(e=>e.docName===t))return i;let a=r.find(e=>e.docName===t);return a?[...i.slice(0,n-1),a]:i}function cO(e,t){return t.kind===`idle`?null:t.kind===`failed`&&t.failedDocNames.includes(e)?{kind:`failed`,title:Y._({id:`MTs6g3`}),summary:t.reason===`clear-data-timeout`?Y._({id:`Sc1bKE`,values:{docName:e}}):Y._({id:`ovIGrT`,values:{docName:e}}),actionLabel:Y._({id:`HpK_8d`})}:t.kind===`recovering`&&t.docNames.includes(e)?{kind:`recovering`,title:Y._({id:`cF9DyA`}),summary:t.phase===`clearing-local-cache`?Y._({id:`bmC18N`,values:{docName:e}}):Y._({id:`pAgkuZ`,values:{docName:e}})}:null}function lO(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(G,{name:`activity-pool`,children:(0,Z.jsx)(uO,{...e})}),t[0]=e,t[1]=n),n}function uO(e){let t=(0,$.c)(15),{activeDocName:n,isSourceMode:r,editorPlaceholder:i,previousDocName:a,onNavigateBack:o,onRecycle:s}=e,{poolEntries:c,serverRestartRecovery:l}=yt(),{pages:u,loading:d}=si(),f=sO(c,n,iO),p=(0,Q.useRef)(``),m=f.map(dO).join(`,`),h=(0,Q.useRef)(c),g,_;t[0]===c?(g=t[1],_=t[2]):(g=()=>{h.current=c},_=[c],t[0]=c,t[1]=g,t[2]=_),(0,Q.useLayoutEffect)(g,_),(0,Q.useLayoutEffect)(()=>{if(p.current===m)return;let e=p.current?p.current.split(`,`):[],t=m?m.split(`,`):[],r=e.filter(e=>!t.includes(e)),i=t.filter(t=>!e.includes(t));for(let e of r)U(e);for(let e of i){let t=h.current.find(t=>t.docName===e)?.poolEventId;on(e,t&&t.length>0?t:crypto.randomUUID())}ut(`ok/activity/mount-list-change`,{active:n,mounted:t,evicted:r}),p.current=m,ct(t)},[m,n]);let v;t[3]!==n||t[4]!==i||t[5]!==r||t[6]!==d||t[7]!==o||t[8]!==s||t[9]!==u||t[10]!==a||t[11]!==l?(v=e=>(0,Z.jsx)(_O,{entry:e,isActive:e.docName===n,isSourceMode:r,editorPlaceholder:i,isNewDoc:!d&&!u.has(e.docName),previousDocName:a,onNavigateBack:o,onRecycle:s,serverRestartRecovery:l},e.docName),t[3]=n,t[4]=i,t[5]=r,t[6]=d,t[7]=o,t[8]=s,t[9]=u,t[10]=a,t[11]=l,t[12]=v):v=t[12];let y=f.map(v),b;return t[13]===y?b=t[14]:(b=(0,Z.jsx)(Z.Fragment,{children:y}),t[13]=y,t[14]=b),b}function dO(e){return e.docName}function fO(e){let t=(0,$.c)(8),{isActive:n,initialScrollTop:r,children:i}=e,a=(0,Q.useRef)(null),o=(0,Q.useRef)(r??0),s,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=a.current;if(!e)return;let t=()=>{e.scrollTop>0&&(o.current=e.scrollTop)};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},c=[],t[0]=s,t[1]=c):(s=t[0],c=t[1]),(0,Q.useEffect)(s,c);let l,u;t[2]===n?(l=t[3],u=t[4]):(l=()=>{if(!n)return;let e=a.current;if(!e)return;let t=o.current;if(t===0)return;let r=performance.now(),i=!1;e.scrollTop=t,e.scrollTop===t&&e.scrollHeight>t&&ut(`ok/scroll-restore/phase1-success`,{target:t,elapsedMs:performance.now()-r});let s=!1,c=0,l=()=>{s||(s=!0,cancelAnimationFrame(c),clearTimeout(f),e.removeEventListener(`wheel`,u),e.removeEventListener(`touchstart`,u))},u=()=>l();e.addEventListener(`wheel`,u,{passive:!0}),e.addEventListener(`touchstart`,u,{passive:!0});let d=()=>{s||(e.scrollTop!==t&&e.scrollHeight>t&&(e.scrollTop=t,e.scrollTop===t&&!i&&(ut(`ok/scroll-restore/phase2-success`,{target:t,elapsedMs:performance.now()-r}),i=!0)),c=requestAnimationFrame(d))};c=requestAnimationFrame(d);let f=setTimeout(()=>{s||(e.scrollTop!==t&&e.scrollHeight>t&&ut(`ok/scroll-restore/abandoned`,{target:t,elapsedMs:performance.now()-r,scrollHeight:e.scrollHeight,finalScrollTop:e.scrollTop}),l())},2e3);return l},u=[n],t[2]=n,t[3]=l,t[4]=u),(0,Q.useLayoutEffect)(l,u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={overflowAnchor:`auto`},t[5]=d):d=t[5];let f;return t[6]===i?f=t[7]:(f=(0,Z.jsx)(`div`,{ref:a,"data-testid":`editor-scroll-container`,className:`subtle-scrollbar h-full overflow-y-auto pt-14 scroll-pt-14`,style:d,children:i}),t[6]=i,t[7]=f),f}function pO(e){let t=(0,$.c)(12),{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a}=e,o=r&&i,[s,c]=(0,Q.useState)(o),l,u;if(t[0]===o?(l=t[1],u=t[2]):(l=()=>{o&&c(!0)},u=[o],t[0]=o,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u),!s&&!o)return null;let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(Vb,{}),t[3]=d):d=t[3];let f=n.docName,p;t[4]===n.provider.document?p=t[5]:(p=n.provider.document.getText(`source`),t[4]=n.provider.document,t[5]=p);let m;return t[6]!==a||t[7]!==n.docName||t[8]!==n.provider||t[9]!==o||t[10]!==p?(m=(0,Z.jsx)(Q.Suspense,{fallback:d,children:(0,Z.jsx)(oO,{docName:f,ytext:p,provider:n.provider,placeholder:a,isSourceModeActive:o})}),t[6]=a,t[7]=n.docName,t[8]=n.provider,t[9]=o,t[10]=p,t[11]=m):m=t[11],m}function mO(e){let t=(0,$.c)(18),{view:n}=e,r=n.kind===`failed`,i=r?`alert`:`status`,a=!r,o;t[0]===r?o=t[1]:(o=(0,Z.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-full border bg-muted text-muted-foreground`,children:r?(0,Z.jsx)(io,{className:`size-5`,"aria-hidden":`true`}):(0,Z.jsx)(Ce,{className:`size-5 animate-spin`,"aria-hidden":`true`})}),t[0]=r,t[1]=o);let s;t[2]===n.title?s=t[3]:(s=(0,Z.jsx)(`h2`,{className:`text-lg font-medium`,children:n.title}),t[2]=n.title,t[3]=s);let c;t[4]===n.summary?c=t[5]:(c=(0,Z.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:n.summary}),t[4]=n.summary,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==r||t[10]!==n.actionLabel?(u=r?(0,Z.jsxs)(sa,{type:`button`,onClick:hO,children:[(0,Z.jsx)(io,{className:`size-4`,"aria-hidden":`true`}),n.actionLabel]}):null,t[9]=r,t[10]=n.actionLabel,t[11]=u):u=t[11];let d;return t[12]!==i||t[13]!==a||t[14]!==o||t[15]!==l||t[16]!==u?(d=(0,Z.jsxs)(`div`,{"data-slot":`server-restart-recovery`,role:i,"aria-busy":a,className:`flex h-full flex-col items-center justify-center gap-6 p-8 text-center`,children:[o,l,u]}),t[12]=i,t[13]=a,t[14]=o,t[15]=l,t[16]=u,t[17]=d):d=t[17],d}function hO(){return window.location.reload()}function gO(e){let t=(0,$.c)(2),{html:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`tiptap-editor h-full pointer-events-none`,"aria-hidden":`true`,children:(0,Z.jsx)(`div`,{className:`tiptap ProseMirror tiptap-editor-portal-content`,dangerouslySetInnerHTML:{__html:n}})}),t[0]=n,t[1]=r),r}function _O(e){let t=(0,$.c)(53),{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a,isNewDoc:o,previousDocName:s,onNavigateBack:c,onRecycle:l,serverRestartRecovery:u}=e,d;t[0]!==n.docName||t[1]!==u?(d=cO(n.docName,u),t[0]=n.docName,t[1]=u,t[2]=d):d=t[2];let f=d,p=gC(n.docName)===`conflict`,h;t[3]===n.docName?h=t[4]:(h=()=>{let e=document.createElement(`div`);return e.setAttribute(`data-ok-editor-portal`,n.docName),e.style.display=`contents`,e},t[3]=n.docName,t[4]=h);let[g]=(0,Q.useState)(h),_=n.provider.document.getText(`source`).length,[v,y]=(0,Q.useState)(i),[b,x]=(0,Q.useState)(!i),S,C;t[5]!==i||t[6]!==v||t[7]!==b?(S=()=>{i&&!v?y(!0):!i&&!b&&x(!0)},C=[i,v,b],t[5]=i,t[6]=v,t[7]=b,t[8]=S,t[9]=C):(S=t[8],C=t[9]),(0,Q.useEffect)(S,C);let w=nO({ytextLength:_,isSourceMode:i,visitedSource:v,visitedVisual:b}),T=(0,Q.useRef)(``),E=`${w.isLarge}-${w.renderSource}-${w.renderVisual}`,D,O;t[10]!==n.docName||t[11]!==w.isLarge||t[12]!==w.renderSource||t[13]!==w.renderVisual||t[14]!==E||t[15]!==i||t[16]!==_?(D=()=>{T.current!==E&&(T.current=E,w.isLarge&&ut(`ok/activity/defer-mount`,{docName:n.docName,ytextLength:_,isSourceMode:i,renderSource:w.renderSource,renderVisual:w.renderVisual}))},O=[E,w.isLarge,w.renderSource,w.renderVisual,n.docName,_,i],t[10]=n.docName,t[11]=w.isLarge,t[12]=w.renderSource,t[13]=w.renderVisual,t[14]=E,t[15]=i,t[16]=_,t[17]=D,t[18]=O):(D=t[17],O=t[18]),(0,Q.useEffect)(D,O);let k;t[19]===n.docName?k=t[20]:(k=()=>m(n.docName),t[19]=n.docName,t[20]=k);let[A]=(0,Q.useState)(k),j=A?.html??null,[M,N]=(0,Q.useState)(!1),P,F;t[21]!==n.docName||t[22]!==w.isLarge||t[23]!==w.renderSource||t[24]!==w.renderVisual||t[25]!==M||t[26]!==i||t[27]!==_?(P=()=>{rO({isLarge:w.isLarge,renderSource:w.renderSource,renderVisual:w.renderVisual,hasEmittedFirstToggle:M})&&(ut(`ok/cold/first-toggle`,{docName:n.docName,mountId:ce(n.docName),ytextLength:_,modeEnteredFirst:i?`source`:`visual`}),N(!0))},F=[M,w.isLarge,w.renderSource,w.renderVisual,n.docName,_,i],t[21]=n.docName,t[22]=w.isLarge,t[23]=w.renderSource,t[24]=w.renderVisual,t[25]=M,t[26]=i,t[27]=_,t[28]=P,t[29]=F):(P=t[28],F=t[29]),(0,Q.useEffect)(P,F);let I=r?`visible`:`hidden`,L=`editor:${n.docName}`,R=A?.scrollTop,z;t[30]!==a||t[31]!==n||t[32]!==w.renderSource||t[33]!==w.renderVisual||t[34]!==r||t[35]!==p||t[36]!==o||t[37]!==i||t[38]!==c||t[39]!==l||t[40]!==g||t[41]!==s||t[42]!==f||t[43]!==j?(z=f?(0,Z.jsx)(mO,{view:f}):(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsx)(qD,{activeDocName:n.docName,previousDocName:s,onNavigateBack:c,onRecycle:l,children:(0,Z.jsx)(Q.Suspense,{fallback:j?(0,Z.jsx)(gO,{html:j}):(0,Z.jsx)(Vb,{}),children:(0,Z.jsx)(HD,{docName:n.docName,provider:n.provider,children:p?(0,Z.jsx)(VD,{docName:n.docName,provider:n.provider}):(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[!i&&(0,Z.jsx)(YD,{provider:n.provider}),!i&&(0,Z.jsx)($D,{provider:n.provider}),(0,Z.jsxs)(`div`,{className:`relative flex-1`,children:[w.renderSource?(0,Z.jsx)(`div`,{className:i?`h-full`:`ok-mode-hidden h-full`,children:(0,Z.jsx)(pO,{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a})}):null,w.renderVisual?(0,Z.jsx)(`div`,{className:i?`ok-mode-hidden h-full`:`h-full`,children:(0,Z.jsx)(BT,{provider:n.provider,placeholder:a,isSourceMode:i,portalTarget:g},`${n.docName}-${String(o)}-${n.poolEventId}`)}):null]})]})})})})}),t[30]=a,t[31]=n,t[32]=w.renderSource,t[33]=w.renderVisual,t[34]=r,t[35]=p,t[36]=o,t[37]=i,t[38]=c,t[39]=l,t[40]=g,t[41]=s,t[42]=f,t[43]=j,t[44]=z):z=t[44];let B;t[45]!==r||t[46]!==R||t[47]!==z?(B=(0,Z.jsx)(fO,{isActive:r,initialScrollTop:R,children:z}),t[45]=r,t[46]=R,t[47]=z,t[48]=B):B=t[48];let V;return t[49]!==I||t[50]!==L||t[51]!==B?(V=(0,Z.jsx)(Q.Activity,{mode:I,name:L,children:B}),t[49]=I,t[50]=L,t[51]=B,t[52]=V):V=t[52],V}function vO(e){let t=e.endsWith(`rem`)?`rem`:`px`;return{value:Number.parseFloat(e),unit:t}}function yO(e){let{value:t,unit:n}=vO(e);return n===`rem`?t*16:t}function bO(e,t){return`${t===`rem`?e.toFixed(1):Math.round(e)}${t}`}var xO=3600*24*7;function SO(e){let t=(0,$.c)(28),{direction:n,currentWidth:r,onResize:i,onToggle:a,isCollapsed:o,minResizeWidth:s,maxResizeWidth:c,enableToggle:l,enableAutoCollapse:u,autoCollapseThreshold:d,expandThreshold:f,enableDrag:p,setIsDraggingRail:m,widthCookieName:h,widthCookieMaxAge:g,isNested:_}=e,v=n===void 0?`right`:n,y=o===void 0?!1:o,b=s===void 0?`14rem`:s,x=c===void 0?`24rem`:c,S=l===void 0?!0:l,C=u===void 0?!0:u,w=d===void 0?1.5:d,T=f===void 0?.2:f,E=p===void 0?!0:p,D=m===void 0?CO:m,O=g===void 0?xO:g,k=_===void 0?!1:_,A=(0,Q.useRef)(null),j=(0,Q.useRef)(0),M=(0,Q.useRef)(0),N=(0,Q.useRef)(!1),P=(0,Q.useRef)(!1),F=(0,Q.useRef)(null),I=(0,Q.useRef)(0),L=(0,Q.useRef)(!1),R=(0,Q.useRef)(0),z=(0,Q.useRef)(0),B=(0,Q.useRef)(null),V=(0,Q.useRef)(r),H=(0,Q.useRef)(y),U,ee;t[0]===r?(U=t[1],ee=t[2]):(U=()=>{V.current=r},ee=[r],t[0]=r,t[1]=U,t[2]=ee),(0,Q.useEffect)(U,ee);let te,W;t[3]===y?(te=t[4],W=t[5]):(te=()=>{H.current=y},W=[y],t[3]=y,t[4]=te,t[5]=W),(0,Q.useEffect)(te,W);let ne=yO(b),re;t[6]===x?re=t[7]:(re=yO(x),t[6]=x,t[7]=re);let G=re,ie;t[8]!==E||t[9]!==k?(ie=function(e){E&&(P.current=!0,j.current=H.current?0:yO(V.current),M.current=e.clientX,I.current=e.clientX,F.current=null,L.current=!1,R.current=0,z.current=0,B.current=k&&A.current?A.current.getBoundingClientRect():null,e.preventDefault())},t[8]=E,t[9]=k,t[10]=ie):ie=t[10];let K=ie,q,ae;t[11]!==w||t[12]!==v||t[13]!==C||t[14]!==S||t[15]!==T||t[16]!==k||t[17]!==G||t[18]!==ne||t[19]!==i||t[20]!==a||t[21]!==D||t[22]!==O||t[23]!==h?(q=()=>{let e=function(e){h&&(document.cookie=`${h}=${e}; path=/; max-age=${O}`)},t=function(e,t){return v===`left`?e<t:e>t},n=function(e,t,n,r){if(k&&r){let r=e.clientX-t;return v===`left`?n-r:n+r}return v===`left`?window.innerWidth-e.clientX:e.clientX},r=function(r){if(!P.current)return;let o=Math.abs(r.clientX-M.current);if(!N.current&&o>5&&(N.current=!0,D(!0)),N.current){let{unit:o}=vO(V.current),s=B.current;k&&A.current&&(s=A.current.getBoundingClientRect());let c=t(r.clientX,I.current)?`expand`:`collapse`;F.current!==c&&(F.current=c),z.current=Math.abs(r.clientX-I.current);let l=Date.now();if(L.current&&l-R.current>200&&(L.current=!1),!L.current){if(C&&a&&!H.current){let e=n(r,M.current,j.current,s),t=!1;if(w<=1)t=e<=ne*w;else if(e<=ne){let n=ne*(w-1);t=ne-e>=n}if(c===`collapse`&&t){a(),I.current=r.clientX,L.current=!0,R.current=l;return}}if(a&&H.current&&c===`expand`&&z.current>ne*T){a();let t=n(r,M.current,j.current,s),c=Math.max(ne,Math.min(G,t)),u=bO(o===`rem`?c/16:c,o);i(u),e(u),I.current=r.clientX,L.current=!0,R.current=l;return}}if(H.current)return;let u=n(r,M.current,j.current,s),d=Math.max(ne,Math.min(G,u)),f=bO(o===`rem`?d/16:d,o);i(f),e(f)}},o=function(){P.current&&(!N.current&&a&&S&&a(),N.current=!1,P.current=!1,F.current=null,I.current=0,L.current=!1,R.current=0,z.current=0,B.current=null,D(!1))};return document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,o),()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,o)}},ae=[i,a,D,ne,G,k,C,w,T,S,h,O,v],t[11]=w,t[12]=v,t[13]=C,t[14]=S,t[15]=T,t[16]=k,t[17]=G,t[18]=ne,t[19]=i,t[20]=a,t[21]=D,t[22]=O,t[23]=h,t[24]=q,t[25]=ae):(q=t[24],ae=t[25]),(0,Q.useEffect)(q,ae);let oe;return t[26]===K?oe=t[27]:(oe={dragRef:A,isDragging:N,handleMouseDown:K},t[26]=K,t[27]=oe),oe}function CO(){}var wO=3600*24*7,TO=`18rem`,EO=`3rem`,DO=`app-file-sidebar`,OO=`14.625rem`,kO=`32rem`,AO=`sidebar_width`,jO=/^\d+(?:\.\d+)?(?:rem|px)$/,MO=Q.createContext(null);function NO(e){if(typeof document>`u`)return e;let t=document.cookie.split(`; `).find(e=>e.startsWith(`${AO}=`))?.split(`=`)[1];if(!t)return e;let n;try{n=decodeURIComponent(t)}catch{return e}return jO.test(n)?n:e}function PO(){let e=Q.use(MO);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function FO(e){let t=(0,$.c)(58),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({open:i,onOpenChange:o,className:r,style:s,children:n,defaultWidth:c,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=c===void 0?TO:c,[u]=Q.useState(LO),d;t[8]===u?d=t[9]:(d=()=>EC(u,window.innerWidth,`left`),t[8]=u,t[9]=d);let[f,p]=Q.useState(d),m;t[10]===l?m=t[11]:(m=()=>NO(l),t[10]=l,t[11]=m);let[h,g]=Q.useState(m),[_,v]=Q.useState(!1),[y,b]=Q.useState(!1),x;t[12]===u?x=t[13]:(x=()=>{let e=NC();return FC(`left`,EC(u,window.innerWidth,`left`),e)===`open`},t[12]=u,t[13]=x);let[S,C]=Q.useState(x),w=i??S,T;t[14]!==w||t[15]!==f||t[16]!==o?(T=e=>{let t=typeof e==`function`?e(w):e;o?o(t):C(t),IC(`left`,f,t?`open`:`collapsed`)},t[14]=w,t[15]=f,t[16]=o,t[17]=T):T=t[17];let E=T,D;t[18]===E?D=t[19]:(D=function(){E(IO)},t[18]=E,t[19]=D);let O=D,k=Q.useRef(w),A;t[20]===w?A=t[21]:(A=()=>{k.current=w},t[20]=w,t[21]=A),Q.useLayoutEffect(A);let j;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(j=function(){window.innerWidth>=1024||k.current&&(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||b(!0))},t[22]=j):j=t[22];let M=j,N,P;t[23]===u?(N=t[24],P=t[25]):(P=()=>{let e=window.matchMedia(`(min-width: ${CC}px)`),t=()=>{let e=EC(u,window.innerWidth,`left`);p(e),C(FC(`left`,e,NC())===`open`)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},N=[u],t[23]=u,t[24]=N,t[25]=P),Q.useEffect(P,N);let F,I;t[26]===w?(F=t[27],I=t[28]):(F=()=>{w||document.getElementById(DO)?.contains(document.activeElement)&&document.querySelector(`[data-sidebar="trigger"]`)?.focus()},I=[w],t[26]=w,t[27]=F,t[28]=I),Q.useLayoutEffect(F,I);let L,R;t[29]!==w||t[30]!==f||t[31]!==E?(L=()=>{if(f===`above`||!w)return;let e=e=>{e.key===`Escape`&&(document.querySelector(`[data-state="open"][role="dialog"], [data-state="open"][role="alertdialog"], [data-state="open"][role="menu"], [data-state="open"][role="listbox"], [data-radix-popper-content-wrapper] [data-state="open"]`)||E(!1))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},R=[f,w,E],t[29]=w,t[30]=f,t[31]=E,t[32]=L,t[33]=R):(L=t[32],R=t[33]),Q.useEffect(L,R);let z,B;t[34]===O?(z=t[35],B=t[36]):(z=()=>{if(typeof window<`u`&&window.okDesktop!=null)return;let e=e=>{Ws(e,`toggle-files-sidebar`)&&(e.preventDefault(),O())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},B=[O],t[34]=O,t[35]=z,t[36]=B),Q.useEffect(z,B);let V=w?`expanded`:`collapsed`,H;t[37]!==_||t[38]!==w||t[39]!==E||t[40]!==y||t[41]!==V||t[42]!==O||t[43]!==h?(H={state:V,open:w,setOpen:E,toggleSidebar:O,width:h,setWidth:g,isDraggingRail:_,setIsDraggingRail:v,showPushPulse:y,setShowPushPulse:b,notifySidebarFileSelected:M},t[37]=_,t[38]=w,t[39]=E,t[40]=y,t[41]=V,t[42]=O,t[43]=h,t[44]=H):H=t[44];let U;t[45]!==s||t[46]!==h?(U={"--sidebar-width":h,"--sidebar-width-icon":EO,...s},t[45]=s,t[46]=h,t[47]=U):U=t[47];let ee=U,te;t[48]===r?te=t[49]:(te=ea(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),t[48]=r,t[49]=te);let W;t[50]!==n||t[51]!==a||t[52]!==ee||t[53]!==te?(W=(0,Z.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:ee,className:te,...a,children:n}),t[50]=n,t[51]=a,t[52]=ee,t[53]=te,t[54]=W):W=t[54];let ne;return t[55]!==H||t[56]!==W?(ne=(0,Z.jsx)(MO.Provider,{value:H,children:W}),t[55]=H,t[56]=W,t[57]=ne):ne=t[57],ne}function IO(e){return!e}function LO(){return Bi()}function RO(e){let t=(0,$.c)(39),n,r,a,o,s,c;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4],s=t[5],c=t[6]):({side:o,variant:s,collapsible:c,className:r,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=s,t[6]=c);let l=o===void 0?`left`:o,u=s===void 0?`sidebar`:s,d=c===void 0?`offcanvas`:c,{_:f}=i(),{state:p,isDraggingRail:m}=PO();if(d===`none`){let e;t[7]===r?e=t[8]:(e=ea(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),t[7]=r,t[8]=e);let i;return t[9]!==n||t[10]!==a||t[11]!==e||t[12]!==u?(i=(0,Z.jsx)(`div`,{"data-slot":`sidebar`,"data-variant":u,className:e,...a,children:n}),t[9]=n,t[10]=a,t[11]=e,t[12]=u,t[13]=i):i=t[13],i}let h=p===`collapsed`?d:``,g=u===`floating`||u===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,_;t[14]===g?_=t[15]:(_=ea(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,g,`group-data-[dragging=true]:duration-0! group-data-[dragging=true]_*:!duration-0`),t[14]=g,t[15]=_);let v;t[16]===_?v=t[17]:(v=(0,Z.jsx)(`div`,{"data-slot":`sidebar-gap`,className:_}),t[16]=_,t[17]=v);let y;t[18]===f?y=t[19]:(y=f({id:`07q4Qk`}),t[18]=f,t[19]=y);let b=u===`floating`||u===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,x;t[20]!==r||t[21]!==b?(x=ea(`fixed inset-y-0 z-10 flex h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear motion-reduce:transition-none motion-reduce:duration-0 data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,b,`group-data-[dragging=true]:duration-0! group-data-[dragging=true]_*:!duration-0`,r),t[20]=r,t[21]=b,t[22]=x):x=t[22];let S;t[23]===n?S=t[24]:(S=(0,Z.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:n}),t[23]=n,t[24]=S);let C;t[25]!==a||t[26]!==l||t[27]!==x||t[28]!==S||t[29]!==y?(C=(0,Z.jsx)(`nav`,{id:DO,"aria-label":y,"data-slot":`sidebar-container`,"data-side":l,className:x,...a,children:S}),t[25]=a,t[26]=l,t[27]=x,t[28]=S,t[29]=y,t[30]=C):C=t[30];let w;return t[31]!==m||t[32]!==l||t[33]!==p||t[34]!==C||t[35]!==h||t[36]!==v||t[37]!==u?(w=(0,Z.jsxs)(`div`,{className:`group peer text-sidebar-foreground`,"data-state":p,"data-collapsible":h,"data-variant":u,"data-side":l,"data-slot":`sidebar`,"data-dragging":m,children:[v,C]}),t[31]=m,t[32]=l,t[33]=p,t[34]=C,t[35]=h,t[36]=v,t[37]=u,t[38]=w):w=t[38],w}function zO(e){let t=(0,$.c)(34),n,r,a;t[0]===e?(n=t[1],r=t[2],a=t[3]):({className:n,onClick:r,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a);let{_:o}=i(),{toggleSidebar:s,state:c}=PO(),l,u,d,f,p,m,h,g;if(t[4]!==o||t[5]!==c){let e=Gs(`toggle-files-sidebar`);l=sa,u=`trigger`,d=`sidebar-trigger`,f=`ghost`,p=`icon-sm`,m=c===`expanded`,h=DO,g=o(c===`expanded`?{id:`4PYsOz`,values:{sidebarShortcutLabel:e}}:{id:`jbSG8V`,values:{sidebarShortcutLabel:e}}),t[4]=o,t[5]=c,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h,t[13]=g}else l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13];let _;t[14]===n?_=t[15]:(_=ea(n),t[14]=n,t[15]=_);let v;t[16]!==r||t[17]!==s?(v=e=>{r?.(e),s()},t[16]=r,t[17]=s,t[18]=v):v=t[18];let y;t[19]===c?y=t[20]:(y=c===`expanded`?(0,Z.jsx)(Te,{}):(0,Z.jsx)(kl,{}),t[19]=c,t[20]=y);let b;return t[21]!==l||t[22]!==a||t[23]!==u||t[24]!==y||t[25]!==d||t[26]!==f||t[27]!==p||t[28]!==m||t[29]!==h||t[30]!==g||t[31]!==_||t[32]!==v?(b=(0,Z.jsx)(l,{"data-sidebar":u,"data-slot":d,variant:f,size:p,"aria-expanded":m,"aria-controls":h,"aria-label":g,className:_,onClick:v,...a,children:y}),t[21]=l,t[22]=a,t[23]=u,t[24]=y,t[25]=d,t[26]=f,t[27]=p,t[28]=m,t[29]=h,t[30]=g,t[31]=_,t[32]=v,t[33]=b):b=t[33],b}function BO(e){let t=(0,$.c)(32),n,r,a,o,s;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4],s=t[5]):({className:n,enableDrag:o,enableToggle:s,onMouseDown:r,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=s);let c=o===void 0?!0:o,l=s===void 0?!0:s,{_:u}=i(),{toggleSidebar:d,setWidth:f,state:p,width:m,setIsDraggingRail:h}=PO(),g=p===`collapsed`,_;t[6]!==c||t[7]!==l||t[8]!==h||t[9]!==f||t[10]!==g||t[11]!==d||t[12]!==m?(_={direction:`right`,enableDrag:c,enableToggle:l,onResize:f,onToggle:d,currentWidth:m,isCollapsed:g,minResizeWidth:OO,maxResizeWidth:kO,setIsDraggingRail:h,widthCookieName:AO,widthCookieMaxAge:wO},t[6]=c,t[7]=l,t[8]=h,t[9]=f,t[10]=g,t[11]=d,t[12]=m,t[13]=_):_=t[13];let{dragRef:v,handleMouseDown:y}=SO(_),b;t[14]!==u||t[15]!==p?(b=u(p===`expanded`?{id:`w3vFfL`}:{id:`e8zRrb`}),t[14]=u,t[15]=p,t[16]=b):b=t[16];let x;t[17]!==y||t[18]!==r?(x=e=>{r?.(e),e.defaultPrevented||y(e)},t[17]=y,t[18]=r,t[19]=x):x=t[19];let S;t[20]!==u||t[21]!==p?(S=u(p===`expanded`?{id:`w3vFfL`}:{id:`e8zRrb`}),t[20]=u,t[21]=p,t[22]=S):S=t[22];let C;t[23]===n?C=t[24]:(C=ea(`absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2`,`in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,`md:group-data-[variant=inset]:after:inset-y-5`,n),t[23]=n,t[24]=C);let w;return t[25]!==v||t[26]!==a||t[27]!==b||t[28]!==x||t[29]!==S||t[30]!==C?(w=(0,Z.jsx)(`button`,{ref:v,"data-sidebar":`rail`,"data-slot":`sidebar-rail`,"aria-label":b,tabIndex:-1,onMouseDown:x,title:S,className:C,...a}),t[25]=v,t[26]=a,t[27]=b,t[28]=x,t[29]=S,t[30]=C,t[31]=w):w=t[31],w}function VO(e){let t=(0,$.c)(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onAnimationEnd:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{showPushPulse:a,setShowPushPulse:o}=PO(),s;t[4]!==r||t[5]!==o?(s=e=>{r?.(e),e.animationName===`sidebar-push-pulse`&&o(!1)},t[4]=r,t[5]=o,t[6]=s):s=t[6];let c=s,l=a?``:void 0,u;t[7]===n?u=t[8]:(u=ea(`relative flex w-full flex-1 flex-col bg-background peer-data-[variant=inset]:m-2 peer-data-[variant=inset]:ml-0 peer-data-[variant=inset]:rounded-xl peer-data-[variant=inset]:shadow-sm peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,n),t[7]=n,t[8]=u);let d;return t[9]!==c||t[10]!==i||t[11]!==l||t[12]!==u?(d=(0,Z.jsx)(`main`,{"data-slot":`sidebar-inset`,"data-push-pulse":l,onAnimationEnd:c,className:u,...i}),t[9]=c,t[10]=i,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function HO(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function UO(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function WO(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function GO(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`flex w-full min-w-0 flex-col gap-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function KO(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`group/menu-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var qO=la(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-hover hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-hover active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-hover data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground data-active:hover:bg-sidebar-accent [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-hover hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-hover hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function JO(e){let t=(0,$.c)(28),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({asChild:i,isActive:a,variant:o,size:s,tooltip:c,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=i===void 0?!1:i,u=a===void 0?!1:a,d=o===void 0?`default`:o,f=s===void 0?`default`:s,p=l?na:`button`,{state:m}=PO(),h;t[8]!==n||t[9]!==f||t[10]!==d?(h=ea(qO({variant:d,size:f}),n),t[8]=n,t[9]=f,t[10]=d,t[11]=h):h=t[11];let g;t[12]!==p||t[13]!==u||t[14]!==r||t[15]!==f||t[16]!==h?(g=(0,Z.jsx)(p,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":f,"data-active":u,className:h,...r}),t[12]=p,t[13]=u,t[14]=r,t[15]=f,t[16]=h,t[17]=g):g=t[17];let _=g;if(!c)return _;if(typeof c==`string`){let e;t[18]===c?e=t[19]:(e={children:c},t[18]=c,t[19]=e),c=e}let v;t[20]===_?v=t[21]:(v=(0,Z.jsx)(Gn,{asChild:!0,children:_}),t[20]=_,t[21]=v);let y=m!==`collapsed`,b;t[22]!==y||t[23]!==c?(b=(0,Z.jsx)(Ar,{side:`right`,align:`center`,hidden:y,...c}),t[22]=y,t[23]=c,t[24]=b):b=t[24];let x;return t[25]!==v||t[26]!==b?(x=(0,Z.jsxs)(pr,{children:[v,b]}),t[25]=v,t[26]=b,t[27]=x):x=t[27],x}function YO(e){let t=null,n=!1,r=new Set;function i(e){if(e!==t){t=e;for(let e of r)e()}}e.subscribeToEvent(i);async function a(){if(!n){n=!0;try{i(await e.fetchBranch())}catch{}}}return{getSnapshot:()=>t,subscribe(e){return r.add(e),a(),()=>{r.delete(e)}}}}async function XO(){let e=await fetch(`/api/server-info`,{signal:AbortSignal.timeout(5e3)});if(!e.ok)return null;let t=await e.json(),n=bi.safeParse(t);return n.success?n.data.currentBranch??null:null}var ZO=typeof window>`u`?{getSnapshot:()=>null,subscribe:()=>()=>{}}:YO({fetchBranch:XO,subscribeToEvent:ii}),QO=ZO.subscribe,$O=ZO.getSnapshot;function ek(){return(0,Q.useSyncExternalStore)(QO,$O,$O)}function tk(){let e=(0,$.c)(6),t=ek(),n=No(),{state:r}=PO(),i=typeof window<`u`?window.okDesktop:void 0;if(i&&r===`expanded`)return null;let a;e[0]===n?a=e[1]:(a=i?.config.projectName??(n&&os(n.contentDir)||null),e[0]=n,e[1]=a);let o=a,s=i?.config.projectPath??n?.contentDir??null;if(o===null&&t===null)return null;let c;return e[2]!==t||e[3]!==o||e[4]!==s?(c={projectName:o,projectPath:s,branch:t},e[2]=t,e[3]=o,e[4]=s,e[5]=c):c=e[5],c}function nk(e){let t=(0,$.c)(23),{stats:n,selectionStats:r,showStats:a}=e,o=a===void 0?!0:a,{_:c}=i(),l=tk();if(!o&&l===null)return null;let u=r??n,d=r!=null,{words:f,chars:p,tokens:m}=u,h;t[0]!==c||t[1]!==d||t[2]!==o?(h=c(o?d?{id:`Bv5a9_`}:{id:`L1ZE3M`}:{id:`goO4Ll`}),t[0]=c,t[1]=d,t[2]=o,t[3]=h):h=t[3];let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 bottom-full h-2 bg-linear-to-t from-background to-transparent`}),t[4]=g):g=t[4];let _;t[5]===l?_=t[6]:(_=l===null?null:(0,Z.jsx)(rk,{identity:l}),t[5]=l,t[6]=_);let v;t[7]===_?v=t[8]:(v=(0,Z.jsx)(`span`,{className:`flex min-w-0 items-center gap-3`,children:_}),t[7]=_,t[8]=v);let y;t[9]!==c||t[10]!==u.chars||t[11]!==u.tokens||t[12]!==u.words||t[13]!==p||t[14]!==d||t[15]!==o||t[16]!==m||t[17]!==f?(y=o?(0,Z.jsxs)(`span`,{className:`flex items-center shrink-0 gap-3`,children:[d?(0,Z.jsx)(`span`,{className:`font-medium text-foreground/70`,"data-testid":`editor-footer-selected-label`,children:c({id:`ylXj1N`})}):null,(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`tabular-nums`,children:u.words.toLocaleString()}),` `,(0,Z.jsx)(s,{id:`gljvbT`,values:{words:f}})]}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`tabular-nums`,children:u.chars.toLocaleString()}),` `,(0,Z.jsx)(s,{id:`d5rK4X`,values:{chars:p}})]}),(0,Z.jsxs)(`span`,{children:[u.tokens>0?`~`:``,(0,Z.jsx)(`span`,{className:`tabular-nums`,children:u.tokens.toLocaleString()}),` `,(0,Z.jsx)(s,{id:`uynXup`,values:{tokens:m}})]})]}):null,t[9]=c,t[10]=u.chars,t[11]=u.tokens,t[12]=u.words,t[13]=p,t[14]=d,t[15]=o,t[16]=m,t[17]=f,t[18]=y):y=t[18];let b;return t[19]!==h||t[20]!==v||t[21]!==y?(b=(0,Z.jsxs)(`section`,{"aria-label":h,className:`relative flex h-6 shrink-0 items-center justify-between gap-3 bg-background px-3 text-2xs text-muted-foreground`,children:[g,v,y]}),t[19]=h,t[20]=v,t[21]=y,t[22]=b):b=t[22],b}function rk(e){let t=(0,$.c)(8),{identity:n}=e,{projectName:r,projectPath:i,branch:a}=n,o;t[0]!==r||t[1]!==i?(o=r===null?null:i?(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(`span`,{tabIndex:0,className:`truncate`,"data-testid":`editor-footer-project-name`,children:r})}),(0,Z.jsx)(Ar,{side:`top`,className:`max-w-xs break-all`,children:i})]}):(0,Z.jsx)(`span`,{className:`truncate`,"data-testid":`editor-footer-project-name`,children:r}),t[0]=r,t[1]=i,t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=a===null?null:(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,"data-testid":`editor-footer-branch`,children:[(0,Z.jsx)(Be,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:a})]}),t[3]=a,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,Z.jsxs)(Z.Fragment,{children:[o,s]}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function ik(e){let t=(0,$.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{_:a}=i(),o;t[3]===a?o=t[4]:(o=a({id:`3__SjS`}),t[3]=a,t[4]=o);let s;t[5]===n?s=t[6]:(s=ea(n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==o||t[9]!==s?(c=(0,Z.jsx)(`nav`,{"aria-label":o,"data-slot":`breadcrumb`,className:s,...r}),t[7]=r,t[8]=o,t[9]=s,t[10]=c):c=t[10],c}function ak(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`ol`,{"data-slot":`breadcrumb-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ok(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`inline-flex items-center gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`li`,{"data-slot":`breadcrumb-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function sk(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({current:i,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0||i?`page`:void 0,o;t[4]===n?o=t[5]:(o=ea(`font-normal text-foreground`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(`span`,{"data-slot":`breadcrumb-page`,"aria-current":a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function ck(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,className:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=ea(`[&>svg]:size-3.5`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=n??(0,Z.jsx)(Os,{}),t[6]=n,t[7]=o);let s;return t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,Z.jsx)(`li`,{"data-slot":`breadcrumb-separator`,role:`presentation`,"aria-hidden":`true`,className:a,...i,children:o}),t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s}var lk=1,uk=2,dk=4;function fk(e){let t=(0,$.c)(18),{docName:n,className:r}=e;if(!n)return null;let i,a,o,s,c,l;if(t[0]!==r||t[1]!==n){l=Symbol.for(`react.early_return_sentinel`);bb0:{let{prefix:e}=Qt(n,``);if(!e){l=null;break bb0}let u=e.replace(/\/$/,``).split(`/`).filter(Boolean);if(u.length===0){l=null;break bb0}let d=(e,t)=>({kind:`segment`,value:e,key:u.slice(0,t+1).join(`/`)}),f=u.length>dk?[...u.slice(0,lk).map((e,t)=>d(e,t)),{kind:`ellipsis`,hidden:u.slice(lk,-uk)},...u.slice(-uk).map((e,t)=>d(e,u.length-uk+t))]:u.map((e,t)=>d(e,t));a=ik,t[8]===r?c=t[9]:(c=ea(`flex min-w-0 items-center`,r),t[8]=r,t[9]=c),i=ak,o=`min-w-0 flex-nowrap gap-1 overflow-hidden text-muted-foreground/70 text-xs`,s=f.map(pk)}t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7];if(l!==Symbol.for(`react.early_return_sentinel`))return l;let u;t[10]!==i||t[11]!==o||t[12]!==s?(u=(0,Z.jsx)(i,{className:o,children:s}),t[10]=i,t[11]=o,t[12]=s,t[13]=u):u=t[13];let d;return t[14]!==a||t[15]!==c||t[16]!==u?(d=(0,Z.jsx)(a,{className:c,children:u}),t[14]=a,t[15]=c,t[16]=u,t[17]=d):d=t[17],d}function pk(e,t){let n=e.kind===`segment`?e.key:`ellipsis`;return(0,Z.jsxs)(Q.Fragment,{children:[t>0&&(0,Z.jsx)(ck,{className:`shrink-0 text-muted-foreground/70 [&>svg]:size-3`}),e.kind===`ellipsis`?(0,Z.jsxs)(ok,{className:`shrink-0`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,title:e.hidden.join(` / `),className:`flex size-4 items-center justify-center text-muted-foreground/70`,children:(0,Z.jsx)(al,{className:`size-3.5`})}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.hidden.join(` / `)})]}):(0,Z.jsx)(ok,{className:`min-w-0`,children:(0,Z.jsx)(sk,{current:!1,className:`min-w-0 truncate font-normal text-muted-foreground/70`,title:e.value,children:e.value})})]},n)}var mk={fill:`none`,height:24,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`},hk=e=>{let t=(0,$.c)(15),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({color:a,size:o,strokeWidth:s,absoluteStrokeWidth:n,className:c,children:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`currentColor`:a,u=o===void 0?24:o,d=s===void 0?2:s,f=c===void 0?``:c,p=n?Number(d)*24/Number(u):d,m;return t[8]!==r||t[9]!==f||t[10]!==l||t[11]!==i||t[12]!==u||t[13]!==p?(m=(0,Z.jsx)(`svg`,{"aria-hidden":`true`,...mk,className:f,height:u,stroke:l,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:p,width:u,...i,children:r}),t[8]=r,t[9]=f,t[10]=l,t[11]=i,t[12]=u,t[13]=p,t[14]=m):m=t[14],m},gk=e=>{let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Markdown`}),r=(0,Z.jsx)(`path`,{d:`M232,48H24A16,16,0,0,0,8,64V192a16,16,0,0,0,16,16H232a16,16,0,0,0,16-16V64A16,16,0,0,0,232,48Zm0,144H24V64H232V192ZM128,104v48a8,8,0,0,1-16,0V123.31L93.66,141.66a8,8,0,0,1-11.32,0L64,123.31V152a8,8,0,0,1-16,0V104a8,8,0,0,1,13.66-5.66L88,124.69l26.34-26.35A8,8,0,0,1,128,104Zm77.66,18.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L168,132.69V104a8,8,0,0,1,16,0v28.69l10.34-10.35A8,8,0,0,1,205.66,122.34Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(hk,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i},_k=e=>{let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Textbox`}),r=(0,Z.jsx)(`path`,{d:`M112,40a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80v96a16,16,0,0,0,16,16h80v16a8,8,0,0,0,16,0V48A8,8,0,0,0,112,40ZM24,176V80h80v96ZM248,80v96a16,16,0,0,1-16,16H144a8,8,0,0,1,0-16h88V80H144a8,8,0,0,1,0-16h88A16,16,0,0,1,248,80ZM88,112a8,8,0,0,1-8,8H72v24a8,8,0,0,1-16,0V120H48a8,8,0,0,1,0-16H80A8,8,0,0,1,88,112Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(hk,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i};function vk(e){let t=(0,$.c)(90),{activeDocName:n,isSourceMode:r,sourceDisabled:a,onModeChange:o,showAddPropertyButton:c,onAddProperty:l,isPanelCollapsed:u,onTogglePanel:d}=e,{_:f}=i(),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=Us(`toggle-document-panel`),t[0]=p):p=t[0];let m=p,h,g,_,v,y,b,x,S,C,w,T,E,D,O;if(t[1]!==f||t[2]!==n||t[3]!==u||t[4]!==r||t[5]!==l||t[6]!==o||t[7]!==d||t[8]!==c||t[9]!==a){let e=Gs(`toggle-document-panel`);v=`editor-toolbar`,y=`pointer-events-none absolute inset-x-0 top-0 z-10`;let i;t[24]===n?i=t[25]:(i=(0,Z.jsx)(`div`,{className:`pointer-events-auto flex min-w-0 items-center`,children:(0,Z.jsx)(fk,{docName:n})}),t[24]=n,t[25]=i);let p=r?`source`:`wysiwyg`,m;t[26]===o?m=t[27]:(m=e=>{e&&o(e)},t[26]=o,t[27]=m);let k;t[28]===f?k=t[29]:(k=f({id:`n7aopT`}),t[28]=f,t[29]=k);let A;t[30]===f?A=t[31]:(A=f({id:`ur2XSb`}),t[30]=f,t[31]=A);let j;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Z.jsx)(Gn,{children:(0,Z.jsx)(_k,{className:`size-4`})}),t[32]=j):j=t[32];let M;t[33]===A?M=t[34]:(M=(0,Z.jsx)(hs,{value:`wysiwyg`,"aria-label":A,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,asChild:!0,children:j}),t[33]=A,t[34]=M);let N;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Z.jsx)(Ar,{side:`bottom`,children:(0,Z.jsx)(s,{id:`Mb_20S`})}),t[35]=N):N=t[35];let P;t[36]===M?P=t[37]:(P=(0,Z.jsxs)(pr,{children:[M,N]}),t[36]=M,t[37]=P);let F;t[38]===f?F=t[39]:(F=f({id:`xbdtfY`}),t[38]=f,t[39]=F);let I;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(gk,{className:`size-4`}),t[40]=I):I=t[40];let L;t[41]!==a||t[42]!==F?(L=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(`div`,{children:(0,Z.jsx)(hs,{value:`source`,"aria-label":F,disabled:a,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,children:I})})}),t[41]=a,t[42]=F,t[43]=L):L=t[43];let R;t[44]===a?R=t[45]:(R=(0,Z.jsx)(Ar,{side:`bottom`,children:a?(0,Z.jsx)(s,{id:`G-JBA1`}):(0,Z.jsx)(s,{id:`u6Hp4N`})}),t[44]=a,t[45]=R);let z;t[46]!==L||t[47]!==R?(z=(0,Z.jsxs)(pr,{children:[L,R]}),t[46]=L,t[47]=R,t[48]=z):z=t[48];let B;t[49]!==p||t[50]!==m||t[51]!==k||t[52]!==P||t[53]!==z?(B=(0,Z.jsx)(`div`,{className:`pointer-events-auto flex justify-center`,children:(0,Z.jsxs)(_s,{type:`single`,value:p,onValueChange:m,"aria-label":k,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 data-[size=sm]:rounded-[10px] bg-muted p-0.5`,children:[P,z]})}),t[49]=p,t[50]=m,t[51]=k,t[52]=P,t[53]=z,t[54]=B):B=t[54],t[55]!==i||t[56]!==B?(b=(0,Z.jsx)(`div`,{className:`editor-content-aligned bg-background py-2`,children:(0,Z.jsxs)(`div`,{className:`grid grid-cols-3 items-center`,children:[i,B]})}),t[55]=i,t[56]=B,t[57]=b):b=t[57],O=`pointer-events-auto absolute top-0 right-0 flex items-center justify-end gap-1 py-2 pr-2`,t[58]!==f||t[59]!==l||t[60]!==c?(_=c&&(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(sa,{variant:`ghost`,size:`icon`,"aria-label":f({id:`81H_23`}),onClick:l,"data-testid":`add-properties-button`,asChild:!0,children:(0,Z.jsx)(Gn,{children:(0,Z.jsx)(Sl,{})})}),(0,Z.jsx)(Ar,{side:`bottom`,children:(0,Z.jsx)(s,{id:`81H_23`})})]}),t[58]=f,t[59]=l,t[60]=c,t[61]=_):_=t[61],g=pr,h=sa,x=``,S=`ghost`,C=`icon`,w=d,T=!u,E=`doc-panel`,D=f(u?{id:`u7H-Wn`,values:{panelShortcutLabel:e}}:{id:`2hpdRq`,values:{panelShortcutLabel:e}}),t[1]=f,t[2]=n,t[3]=u,t[4]=r,t[5]=l,t[6]=o,t[7]=d,t[8]=c,t[9]=a,t[10]=h,t[11]=g,t[12]=_,t[13]=v,t[14]=y,t[15]=b,t[16]=x,t[17]=S,t[18]=C,t[19]=w,t[20]=T,t[21]=E,t[22]=D,t[23]=O}else h=t[10],g=t[11],_=t[12],v=t[13],y=t[14],b=t[15],x=t[16],S=t[17],C=t[18],w=t[19],T=t[20],E=t[21],D=t[22],O=t[23];let k;t[62]===u?k=t[63]:(k=(0,Z.jsx)(Gn,{children:u?(0,Z.jsx)(jl,{}):(0,Z.jsx)(Al,{})}),t[62]=u,t[63]=k);let A;t[64]!==h||t[65]!==k||t[66]!==x||t[67]!==S||t[68]!==C||t[69]!==w||t[70]!==T||t[71]!==E||t[72]!==D?(A=(0,Z.jsx)(h,{"data-doc-panel-toggle":x,variant:S,size:C,onClick:w,"aria-expanded":T,"aria-controls":E,"aria-label":D,asChild:!0,children:k}),t[64]=h,t[65]=k,t[66]=x,t[67]=S,t[68]=C,t[69]=w,t[70]=T,t[71]=E,t[72]=D,t[73]=A):A=t[73];let j;t[74]===u?j=t[75]:(j=(0,Z.jsx)(Ar,{side:`bottom`,children:u?(0,Z.jsx)(s,{id:`KFdXwz`,values:{panelShortcut:m}}):(0,Z.jsx)(s,{id:`MsuXaI`,values:{panelShortcut:m}})}),t[74]=u,t[75]=j);let M;t[76]!==g||t[77]!==A||t[78]!==j?(M=(0,Z.jsxs)(g,{children:[A,j]}),t[76]=g,t[77]=A,t[78]=j,t[79]=M):M=t[79];let N;t[80]!==_||t[81]!==M||t[82]!==O?(N=(0,Z.jsxs)(`div`,{className:O,children:[_,M]}),t[80]=_,t[81]=M,t[82]=O,t[83]=N):N=t[83];let P;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none h-2 bg-linear-to-b from-background to-transparent`}),t[84]=P):P=t[84];let F;return t[85]!==v||t[86]!==y||t[87]!==b||t[88]!==N?(F=(0,Z.jsxs)(`div`,{"data-testid":v,className:y,children:[b,N,P]}),t[85]=v,t[86]=y,t[87]=b,t[88]=N,t[89]=F):F=t[89],F}function yk(e){let{activeDocName:t,deferredActiveDocName:n,mountResolved:r,syncResolved:i}=e;return t===null||t===n?!1:!(r&&i)}var bk=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityModeContent-BWmb9zCZ.js`),__vite__mapDeps([34,1,2,35,36,37,22,38,39,40,41,21,6,3,7,4,10,12,9,42,43]),import.meta.url)).ActivityModeContent}));function xk(e){let t=(0,$.c)(5),n;t[0]===e?n=t[1]:(n=(0,Z.jsx)(Ck,{...e}),t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(Sk,{}),t[2]=r):r=t[2];let i;return t[3]===n?i=t[4]:(i=(0,Z.jsx)(G,{name:`editor-area`,children:(0,Z.jsxs)(OS,{children:[n,r]})}),t[3]=n,t[4]=i),i}function Sk(){let e=(0,$.c)(5),t=Nh(),n;e[0]===t?n=e[1]:(n=e=>{e||t.close()},e[0]=t,e[1]=n);let r;return e[2]!==t.open||e[3]!==n?(r=(0,Z.jsx)(zS,{open:t.open,onOpenChange:n}),e[2]=t.open,e[3]=n,e[4]=r):r=e[4],r}function Ck(e){let t=(0,$.c)(144),{editorMode:n,onModeChange:r,activeTab:a,onActiveTabChange:o,onSaveVersion:c,saving:l}=e,{_:u}=i(),{activeDocName:d,activeProvider:f,activeTarget:p,recycleDocument:m,docPanelMode:h,docPanelAgentId:g,docPanelExpandSignal:_}=yt(),{openDocumentTransition:v}=Mt(),{requestAddProperty:y}=AS(),b=mC(f,d),x=_C(d,n===`source`?`source`:`wysiwyg`),S=LC(f),C=S===`connected`||S===`synced`,w=gC(d)===`conflict`,T=(0,Q.useDeferredValue)(d),E=p?.kind===`missing`,D=!!d&&p?.kind!==`folder`,O;t[0]!==u||t[1]!==E?(O=E?u({id:`K-a33w`}):void 0,t[0]=u,t[1]=E,t[2]=O):O=t[2];let k=O,[A]=(0,Q.useState)(Tk),j=A!==null,M;t[3]===A?M=t[4]:(M=()=>EC(A,window.innerWidth,`right`),t[3]=A,t[4]=M);let[N,P]=(0,Q.useState)(M),F=(0,Q.useRef)(N),I,L;t[5]===N?(I=t[6],L=t[7]):(I=()=>{F.current=N},L=[N],t[5]=N,t[6]=I,t[7]=L),(0,Q.useEffect)(I,L);let R=kb(),z;t[8]===N?z=t[9]:(z=()=>FC(`right`,N,NC())===`collapsed`,t[8]=N,t[9]=z);let[B]=(0,Q.useState)(z),[V,H]=(0,Q.useState)(B),U=(0,Q.useRef)(V),ee,te;t[10]===V?(ee=t[11],te=t[12]):(ee=()=>{U.current=V},te=[V],t[10]=V,t[11]=ee,t[12]=te),(0,Q.useEffect)(ee,te);let[W,ne]=(0,Q.useState)(!1),re=(0,Q.useRef)(!1),[G]=(0,Q.useState)(wk),ie=(0,Q.useRef)(G),q=(0,Q.useRef)(null),ae;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(ae=function(e){q.current!=null&&clearTimeout(q.current),q.current=setTimeout(()=>{xC(e),q.current=null},100)},t[13]=ae):ae=t[13];let oe=ae,se,ce;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(ce=()=>()=>{q.current!=null&&clearTimeout(q.current)},se=[],t[14]=se,t[15]=ce):(se=t[14],ce=t[15]),(0,Q.useEffect)(ce,se);let[le,ue]=(0,Q.useState)(null),de;t[16]!==V||t[17]!==R?(de=function(){if(R.current==null)return;let e=F.current;V?(IC(`right`,e,`open`),R.current?.expand()):(IC(`right`,e,`collapsed`),R.current?.collapse())},t[16]=V,t[17]=R,t[18]=de):de=t[18];let fe=de,pe,me;t[19]!==A||t[20]!==R?(pe=()=>{let e=window.matchMedia(`(min-width: ${wC}px)`),t=()=>{let e=EC(A,window.innerWidth,`right`);P(e);let t=FC(`right`,e,NC())===`collapsed`;H(t),t?R.current?.collapse():R.current?.expand()};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},me=[A,R],t[19]=A,t[20]=R,t[21]=pe,t[22]=me):(pe=t[21],me=t[22]),(0,Q.useEffect)(pe,me);let he,ge;t[23]!==le||t[24]!==j||t[25]!==R?(he=()=>{if(le==null||j)return;let e=new ResizeObserver(()=>{U.current||re.current||R.current?.resize(`${ie.current}px`)});return e.observe(le),()=>e.disconnect()},ge=[le,j,R],t[23]=le,t[24]=j,t[25]=R,t[26]=he,t[27]=ge):(he=t[26],ge=t[27]),(0,Q.useEffect)(he,ge);let _e,ve;t[28]!==o||t[29]!==R?(_e=()=>{let e=e=>{o(e),R.current?.expand()},t=Mm();return t&&e(t),Pm(t=>{Mm(),e(t)})},ve=[o,R],t[28]=o,t[29]=R,t[30]=_e,t[31]=ve):(_e=t[30],ve=t[31]),(0,Q.useEffect)(_e,ve);let ye,be;t[32]!==_||t[33]!==R?(ye=()=>{_!==0&&R.current?.expand()},be=[_,R],t[32]=_,t[33]=R,t[34]=ye,t[35]=be):(ye=t[34],be=t[35]),(0,Q.useEffect)(ye,be);let xe,Se;t[36]===V?(xe=t[37],Se=t[38]):(xe=()=>{if(!V||!document.getElementById(`doc-panel`)?.contains(document.activeElement))return;let e=document.querySelector(`[data-doc-panel-toggle]`);if(e){e.focus();return}document.querySelector(`[data-sidebar="trigger"]`)?.focus()},Se=[V],t[36]=V,t[37]=xe,t[38]=Se),(0,Q.useLayoutEffect)(xe,Se);let Ce,we;t[39]===V?(Ce=t[40],we=t[41]):(Ce=()=>{window.okDesktop!=null&&window.okDesktop.editor.notifyViewMenuStateChanged({docPanelVisible:!V})},we=[V],t[39]=V,t[40]=Ce,t[41]=we),(0,Q.useEffect)(Ce,we);let Te,Ee;t[42]===fe?(Te=t[43],Ee=t[44]):(Te=()=>{if(window.okDesktop!=null)return window.okDesktop.onMenuAction(e=>{e===`toggle-doc-panel`&&fe()})},Ee=[fe],t[42]=fe,t[43]=Te,t[44]=Ee),(0,Q.useEffect)(Te,Ee);let De,Oe;t[45]===fe?(De=t[46],Oe=t[47]):(De=()=>{if(window.okDesktop!=null)return;let e=e=>{Ws(e,`toggle-document-panel`)&&(e.preventDefault(),fe())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},Oe=[fe],t[45]=fe,t[46]=De,t[47]=Oe),(0,Q.useEffect)(De,Oe);let ke=(0,Q.useRef)(null),[Ae,je]=(0,Q.useState)(null),Me=p?.kind===`large-file`?p.docName:d,Ne,Pe;t[48]===Me?(Ne=t[49],Pe=t[50]):(Ne=()=>{if(Me&&Me!==ke.current){let e=ke.current;ke.current=Me,je(e)}},Pe=[Me],t[48]=Me,t[49]=Ne,t[50]=Pe),(0,Q.useEffect)(Ne,Pe);let Fe;t[51]===v?Fe=t[52]:(Fe=function(e){let t=yr(e);window.location.hash===t?v(e):window.location.hash=t},t[51]=v,t[52]=Fe);let Ie=Fe;if(p?.kind===`large-file`){let e;t[53]!==Ie||t[54]!==Ae?(e=Ae?{previousDocName:Ae,onNavigateBack:Ie}:void 0,t[53]=Ie,t[54]=Ae,t[55]=e):e=t[55];let n;return t[56]!==p.docName||t[57]!==p.limit||t[58]!==p.size||t[59]!==e?(n=(0,Z.jsx)(wS,{docName:p.docName,size:p.size,limit:p.limit,backNav:e}),t[56]=p.docName,t[57]=p.limit,t[58]=p.size,t[59]=e,t[60]=n):n=t[60],n}if(p?.kind===`folder`){if(!(h===`agent`&&g!==null)){let e;return t[61]===p.folderPath?e=t[62]:(e=(0,Z.jsx)(bS,{folderPath:p.folderPath}),t[61]=p.folderPath,t[62]=e),e}let e;t[63]===p.folderPath?e=t[64]:(e=(0,Z.jsx)(GS,{minSize:`30%`,defaultSize:`75%`,children:(0,Z.jsx)(bS,{folderPath:p.folderPath})}),t[63]=p.folderPath,t[64]=e);let n;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(KS,{withHandle:!0}),t[65]=n):n=t[65];let r;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(GS,{defaultSize:`25%`,minSize:`300px`,maxSize:`40%`,className:`flex flex-col bg-muted/20`,children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{role:`status`,"aria-busy":`true`,className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:(0,Z.jsx)(s,{id:`ONPvOb`})}),children:(0,Z.jsx)(bk,{showBackButton:!1})})}),t[66]=r):r=t[66];let i;return t[67]===e?i=t[68]:(i=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1`,children:(0,Z.jsxs)(WS,{orientation:`horizontal`,children:[e,n,r]})}),t[67]=e,t[68]=i),i}if(p?.kind===`asset`){let e;return t[69]!==p.assetPath||t[70]!==p.mediaKind?(e=(0,Z.jsx)(Bb,{assetPath:p.assetPath,mediaKind:p.mediaKind},p.assetPath),t[69]=p.assetPath,t[70]=p.mediaKind,t[71]=e):e=t[71],e}if(!f||!d){if((typeof window<`u`?pi(window.location.hash):null)!==null){let e;return t[72]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Vb,{}),t[72]=e):e=t[72],e}let e;return t[73]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Vx,{}),t[73]=e):e=t[73],e}let Le=n===`source`,Re=!C,ze=V,Be;t[74]!==d||t[75]!==y?(Be=function(){d&&y(d)},t[74]=d,t[75]=y,t[76]=Be):Be=t[76];let Ve=Be,Ue=T??d,We=Ae??void 0,Ge;t[77]!==k||t[78]!==Le||t[79]!==Ie||t[80]!==m||t[81]!==Ue||t[82]!==We?(Ge=(0,Z.jsx)(lO,{activeDocName:Ue,isSourceMode:Le,editorPlaceholder:k,previousDocName:We,onNavigateBack:Ie,onRecycle:m}),t[77]=k,t[78]=Le,t[79]=Ie,t[80]=m,t[81]=Ue,t[82]=We,t[83]=Ge):Ge=t[83];let Ke;t[84]!==d||t[85]!==Le?(Ke=(0,Z.jsx)(uC,{activeDocName:d,isSourceMode:Le}),t[84]=d,t[85]=Le,t[86]=Ke):Ke=t[86];let qe;t[87]!==d||t[88]!==T?(qe=yk({activeDocName:d,deferredActiveDocName:T,mountResolved:d!==null&&K(d),syncResolved:d!==null&&He(d)})?(0,Z.jsxs)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:[(0,Z.jsx)(Vb,{}),d===null?null:(0,Z.jsx)(TS,{docName:d})]}):null,t[87]=d,t[88]=T,t[89]=qe):qe=t[89];let Je;t[90]!==Ge||t[91]!==Ke||t[92]!==qe?(Je=(0,Z.jsxs)(`div`,{className:`relative h-full`,children:[Ge,Ke,qe]}),t[90]=Ge,t[91]=Ke,t[92]=qe,t[93]=Je):Je=t[93];let Ye;t[94]!==d||t[95]!==w||t[96]!==ze||t[97]!==Le||t[98]!==r||t[99]!==Ve||t[100]!==Re||t[101]!==fe?(Ye=!w&&(0,Z.jsx)(vk,{activeDocName:d,isSourceMode:Le,sourceDisabled:Re,onModeChange:r,showAddPropertyButton:!Le,onAddProperty:Ve,isPanelCollapsed:ze,onTogglePanel:fe}),t[94]=d,t[95]=w,t[96]=ze,t[97]=Le,t[98]=r,t[99]=Ve,t[100]=Re,t[101]=fe,t[102]=Ye):Ye=t[102];let Xe;t[103]!==Je||t[104]!==Ye?(Xe=(0,Z.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[Je,Ye]}),t[103]=Je,t[104]=Ye,t[105]=Xe):Xe=t[105];let Ze;t[106]!==x||t[107]!==D||t[108]!==b?(Ze=(0,Z.jsx)(nk,{stats:b,selectionStats:x,showStats:D}),t[106]=x,t[107]=D,t[108]=b,t[109]=Ze):Ze=t[109];let Qe;t[110]!==Xe||t[111]!==Ze?(Qe=(0,Z.jsxs)(`div`,{className:`relative flex h-full flex-col`,children:[Xe,Ze]}),t[110]=Xe,t[111]=Ze,t[112]=Qe):Qe=t[112];let $e=Qe,et=W||void 0,tt;t[113]===B?tt=t[114]:(tt=B?{defaultSize:`100%`}:{},t[113]=B,t[114]=tt);let nt=W?void 0:`transition-[flex-grow] duration-200 ease-out motion-reduce:transition-none motion-reduce:duration-0`,rt;t[115]!==$e||t[116]!==tt||t[117]!==nt?(rt=(0,Z.jsx)(GS,{minSize:`30%`,...tt,className:nt,children:$e}),t[115]=$e,t[116]=tt,t[117]=nt,t[118]=rt):rt=t[118];let it=j&&V,at;t[119]===Symbol.for(`react.memo_cache_sentinel`)?(at=()=>{ne(!0),re.current=!0;let e=()=>{ne(!1),re.current=!1,window.removeEventListener(`pointerup`,e)};window.addEventListener(`pointerup`,e)},t[119]=at):at=t[119];let J;t[120]===it?J=t[121]:(J=(0,Z.jsx)(KS,{withHandle:!0,disabled:it,onPointerDown:at}),t[120]=it,t[121]=J);let ot=B?0:`${G}px`,st;t[122]===Symbol.for(`react.memo_cache_sentinel`)?(st=e=>{H(e.asPercentage===0),e.inPixels>0&&re.current&&(ie.current=e.inPixels,oe(e.inPixels))},t[122]=st):st=t[122];let ct=!W&&`transition-[flex-grow] duration-200 ease-out motion-reduce:transition-none motion-reduce:duration-0`,lt;t[123]===ct?lt=t[124]:(lt=ea(`flex flex-col bg-muted/20`,ct),t[123]=ct,t[124]=lt);let ut;t[125]!==d||t[126]!==a||t[127]!==h||t[128]!==Le||t[129]!==o||t[130]!==c||t[131]!==l?(ut=(0,Z.jsx)(Fv,{docName:d,isSourceMode:Le,activeTab:a,onActiveTabChange:o,mode:h,onSaveVersion:c,saving:l}),t[125]=d,t[126]=a,t[127]=h,t[128]=Le,t[129]=o,t[130]=c,t[131]=l,t[132]=ut):ut=t[132];let dt;t[133]!==V||t[134]!==R||t[135]!==ot||t[136]!==lt||t[137]!==ut?(dt=(0,Z.jsx)(GS,{id:`doc-panel`,panelRef:R,defaultSize:ot,minSize:`300px`,maxSize:`600px`,collapsible:!0,collapsedSize:0,onResize:st,inert:V,className:lt,children:ut}),t[133]=V,t[134]=R,t[135]=ot,t[136]=lt,t[137]=ut,t[138]=dt):dt=t[138];let ft;return t[139]!==et||t[140]!==rt||t[141]!==J||t[142]!==dt?(ft=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1`,ref:ue,children:(0,Z.jsxs)(WS,{orientation:`horizontal`,"data-dragging":et,children:[rt,J,dt]})}),t[139]=et,t[140]=rt,t[141]=J,t[142]=dt,t[143]=ft):ft=t[143],ft}function wk(){return SC()}function Tk(){return Bi()}function Ek(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.kind!==i.kind)return!1;if(r.kind===`human`&&i.kind===`human`){if(r.clientId!==i.clientId||r.mode!==i.mode||r.tabCount!==i.tabCount)return!1;let e=r.user,t=i.user;if(e.name!==t.name||e.color!==t.color||e.icon!==t.icon)return!1}else if(r.kind===`agent`&&i.kind===`agent`){if(r.agentId!==i.agentId)return!1;let e=r.presence,t=i.presence;if(e.displayName!==t.displayName||e.icon!==t.icon||e.color!==t.color||e.currentDoc!==t.currentDoc||e.mode!==t.mode)return!1}}return!0}function Dk(e){let t=new Map;for(let n of e){let e=n.user.principalId;if(typeof e==`string`&&e.length>0){let r=t.get(e);r?r.push(n):t.set(e,[n])}}let n=new Map;for(let[e,r]of t){let t=r.reduce((e,t)=>Math.min(e,t.clientId),1/0);n.set(e,{repClientId:t,count:r.length})}let r=[];for(let t of e){let e=t.user.principalId;if(typeof e==`string`&&e.length>0){let i=n.get(e);i&&i.repClientId===t.clientId&&r.push({...t,tabCount:i.count})}else r.push({...t,tabCount:1})}return r}var Ok=1e3,kk=!1;function Ak(e){return!!(e.localPrincipalId&&e.entryPrincipalId===e.localPrincipalId||!e.localPrincipalId&&e.entryClientId===e.localClientId)}function jk(e,t,n){let r=(0,$.c)(9),i;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={current:[],crossDoc:[]},r[0]=i):i=r[0];let[a,o]=(0,Q.useState)(i),s;r[1]!==n||r[2]!==e?.awareness||r[3]!==t?.awareness?(s=()=>{let r=e?.awareness,i=t?.awareness,a;i==null?a=void 0:Sa(i)?a=i:(a=void 0,kk||(kk=!0,console.warn(`[agent-presence] __system__ provider awareness missing getStates() — presence bar will render without agent peers`)));let s=()=>{let e=(r?.getLocalState())?.user?.principalId??null,t=r?.clientID??null,i=[];if(r)for(let[n,a]of r.getStates().entries()){let r=a;if(!r.user||typeof r.user!=`object`)continue;let o=r.user;o.type===`human`&&(Ak({entryPrincipalId:o.principalId,entryClientId:n,localPrincipalId:e,localClientId:t})||i.push({kind:`human`,clientId:n,user:o,mode:r.mode??`wysiwyg`,tabCount:1}))}let s=Dk(i),{current:c,crossDoc:l}=a?_a(a,n,Date.now()):{current:[],crossDoc:[]},u=Mk,d=c.map(u),f=l.map(u),p=[...s,...d],m=f;o(e=>Ek(e.current,p)&&Ek(e.crossDoc,m)?e:{current:p,crossDoc:m})};s();let c=()=>s(),l=()=>s();r?.on(`change`,c),t?.awareness?.on(`change`,l);let u=setInterval(s,Ok);return()=>{r?.off(`change`,c),t?.awareness?.off(`change`,l),clearInterval(u)}},r[1]=n,r[2]=e?.awareness,r[3]=t?.awareness,r[4]=s):s=r[4];let c;return r[5]!==n||r[6]!==e||r[7]!==t?(c=[e,t,n],r[5]=n,r[6]=e,r[7]=t,r[8]=c):c=r[8],(0,Q.useEffect)(s,c),a}function Mk(e){let{agentId:t,entry:n}=e;return{kind:`agent`,agentId:t,presence:n}}var Nk=`sync-status`;function Pk(e,t){let n=(0,$.c)(5),{_:r}=i(),a=(0,Q.useRef)(!1),o=(0,Q.useRef)(!1),s=(0,Q.useRef)(t),c,l;n[0]!==r||n[1]!==t||n[2]!==e?(c=()=>{s.current!==t&&(s.current=t,a.current=!1,o.current=!1),t&&(e===`synced`&&(a.current=!0),e===`disconnected`&&a.current?(o.current=!0,X.warning(r({id:`HGNCsl`}),{id:Nk,duration:1/0})):o.current&&e===`synced`&&(o.current=!1,X.success(r({id:`GhjUB_`}),{id:Nk,duration:3e3})))},l=[e,t,r],n[0]=r,n[1]=t,n[2]=e,n[3]=c,n[4]=l):(c=n[3],l=n[4]),(0,Q.useEffect)(c,l)}var Fk=4,Ik=3,Lk={Bird:Wc,Cat:Xc,Dog:il,Fish:ll,Mouse:Il,Rabbit:Fl,Shrimp:Ul,Snail:Wl,Squirrel:ql,Turtle:Ql};Object.freeze(Object.keys(Lk));function Rk(e){if(typeof e.principalId==`string`&&e.principalId.length>0)return{kind:`initials`};let t=e.name.split(` `)[1];return t&&Object.hasOwn(Lk,t)?{kind:`animal`,animal:t}:{kind:`initials`}}var zk={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`,bot:`Agent`};function Bk(e){let t=(0,$.c)(28),{user:n,mode:r,tabCount:a}=e,{_:o}=i(),s=Rk(n),c=s.kind===`animal`?Lk[s.animal]:void 0,l;t[0]===n.name?l=t[1]:(l=Ur(n.name),t[0]=n.name,t[1]=l);let u=l,d;t[2]===n.color?d=t[3]:(d=ni(n.color),t[2]=n.color,t[3]=d);let f=d,p=n.name,m;t[4]!==o||t[5]!==a||t[6]!==p?(m=a>1?o({id:`qAhFeg`,values:{userName:p,tabCount:a}}):p,t[4]=o,t[5]=a,t[6]=p,t[7]=m):m=t[7];let h=m,g;t[8]!==o||t[9]!==a||t[10]!==p?(g=a>1?o({id:`BEkF-P`,values:{userName:p,tabCount:a}}):p,t[8]=o,t[9]=a,t[10]=p,t[11]=g):g=t[11];let _=g,v;t[12]===n.color?v=t[13]:(v={backgroundColor:n.color},t[12]=n.color,t[13]=v);let y;t[14]!==c||t[15]!==f||t[16]!==u?(y=c?(0,Z.jsx)(c,{size:18,color:f,strokeWidth:1.5}):(0,Z.jsx)(`span`,{className:`font-mono text-2xs font-semibold leading-none`,style:{color:f},children:u}),t[14]=c,t[15]=f,t[16]=u,t[17]=y):y=t[17];let b;t[18]!==_||t[19]!==r||t[20]!==v||t[21]!==y?(b=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(`div`,{"data-presence-badge":`human`,"data-presence-mode":r,role:`img`,"aria-label":_,className:`inline-flex size-7 shrink-0 cursor-default items-center justify-center rounded-full ring-2 ring-background`,style:v,children:y})}),t[18]=_,t[19]=r,t[20]=v,t[21]=y,t[22]=b):b=t[22];let x;t[23]===h?x=t[24]:(x=(0,Z.jsx)(Ar,{children:h}),t[23]=h,t[24]=x);let S;return t[25]!==b||t[26]!==x?(S=(0,Z.jsxs)(pr,{children:[b,x]}),t[25]=b,t[26]=x,t[27]=S):S=t[27],S}function Vk(e){let t=zk[e.icon];return e.displayName||t||Y._({id:`iEQQyu`})}function Hk(e){let t=(0,$.c)(3),[n,r]=(0,Q.useState)(e===`writing`),i=(0,Q.useRef)(null),a,o;return t[0]===e?(a=t[1],o=t[2]):(a=()=>{if(e===`writing`){i.current!==null&&(clearTimeout(i.current),i.current=null),r(!0);return}return i.current!==null&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,r(!1)},600),()=>{i.current!==null&&(clearTimeout(i.current),i.current=null)}},o=[e],t[0]=e,t[1]=a,t[2]=o),(0,Q.useEffect)(a,o),n}function Uk(e){let t=(0,$.c)(33),{participant:n,crossDoc:r,scoped:a,onClickAgent:o}=e,{_:c}=i(),{activeDocName:l}=yt(),{presence:u,agentId:d}=n,f=Vk(u),p=Hk(u.mode),m=!r&&p,h=u.currentDoc&&u.currentDoc!==`(connected)`?u.currentDoc:null,g=l!==null||h!==null,_=g?`cursor-pointer`:`cursor-default opacity-50`,v=a?`ring-primary ring-offset-2 ring-offset-background`:`ring-background`,y=m&&!a?`ring-primary/40 animate-pulse`:``,b;t[0]!==_||t[1]!==v||t[2]!==y?(b=[`inline-flex size-7 shrink-0 items-center justify-center rounded-full ring-2`,_,v,y].filter(Boolean),t[0]=_,t[1]=v,t[2]=y,t[3]=b):b=t[3];let x=b.join(` `),S=r?`true`:void 0,C=a?`true`:void 0,w=g?void 0:`true`,T;t[4]!==u.mode||t[5]!==S||t[6]!==C||t[7]!==w?(T={"data-presence-badge":`agent`,"data-presence-mode":u.mode,"data-presence-crossdoc":S,"data-presence-scoped":C,"data-presence-inert":w},t[4]=u.mode,t[5]=S,t[6]=C,t[7]=w,t[8]=T):T=t[8];let E=T,D=c(r&&h?{id:`b4AQFK`,values:{tooltipName:f,realCurrentDoc:h}}:{id:`RfHNf8`,values:{tooltipName:f}}),O;t[9]!==d||t[10]!==D||t[11]!==E||t[12]!==g||t[13]!==o||t[14]!==u.color||t[15]!==u.icon||t[16]!==h||t[17]!==x||t[18]!==f?(O=g?(0,Z.jsx)(`button`,{type:`button`,...E,"aria-label":D,className:x,style:{backgroundColor:u.color},onClick:()=>o(d,h),children:(0,Z.jsx)(ba,{icon:u.icon,width:16,height:16,className:`text-white`,"aria-hidden":!0})}):(0,Z.jsx)(`div`,{...E,role:`img`,"aria-label":f,className:x,style:{backgroundColor:u.color},children:(0,Z.jsx)(ba,{icon:u.icon,width:16,height:16,className:`text-white`,"aria-hidden":!0})}),t[9]=d,t[10]=D,t[11]=E,t[12]=g,t[13]=o,t[14]=u.color,t[15]=u.icon,t[16]=h,t[17]=x,t[18]=f,t[19]=O):O=t[19];let k=O,A;t[20]===k?A=t[21]:(A=(0,Z.jsx)(Gn,{asChild:!0,children:k}),t[20]=k,t[21]=A);let j;t[22]===f?j=t[23]:(j=(0,Z.jsx)(`span`,{className:`font-medium`,children:f}),t[22]=f,t[23]=j);let M;t[24]!==r||t[25]!==h?(M=r&&h?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(s,{id:`Wh0im4`,values:{realCurrentDoc:h}})}):null,t[24]=r,t[25]=h,t[26]=M):M=t[26];let N;t[27]!==j||t[28]!==M?(N=(0,Z.jsxs)(Ar,{className:`flex flex-col gap-0.5`,children:[j,M]}),t[27]=j,t[28]=M,t[29]=N):N=t[29];let P;return t[30]!==A||t[31]!==N?(P=(0,Z.jsxs)(pr,{children:[A,N]}),t[30]=A,t[31]=N,t[32]=P):P=t[32],P}function Wk(e){let t=(0,$.c)(21),{count:n,remainder:r,crossDoc:i,scopedAgentId:a,onClickAgent:o}=e,s;t[0]!==n||t[1]!==i?(s=i?Y._({id:`9euN0m`,values:{count:n}}):Y._({id:`uhJEA2`,values:{count:n}}),t[0]=n,t[1]=i,t[2]=s):s=t[2];let c=s,l=i?`true`:void 0,u;t[3]!==n||t[4]!==c||t[5]!==l?(u=(0,Z.jsx)(T,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`presence-overflow`,"data-presence-crossdoc":l,className:`inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full bg-muted font-medium text-muted-foreground text-xs ring-2 ring-background hover:bg-muted/80`,"aria-label":c,children:[`+`,n]})}),t[3]=n,t[4]=c,t[5]=l,t[6]=u):u=t[6];let d;if(t[7]!==i||t[8]!==o||t[9]!==r||t[10]!==a){let e;t[12]!==i||t[13]!==o||t[14]!==a?(e=e=>e.kind===`human`?(0,Z.jsx)(Bk,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(Uk,{participant:e,crossDoc:i,scoped:a===e.agentId,onClickAgent:o},e.agentId),t[12]=i,t[13]=o,t[14]=a,t[15]=e):e=t[15],d=r.map(e),t[7]=i,t[8]=o,t[9]=r,t[10]=a,t[11]=d}else d=t[11];let f;t[16]===d?f=t[17]:(f=(0,Z.jsx)(ie,{align:`end`,className:`w-auto max-w-xs p-2`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:d})}),t[16]=d,t[17]=f);let p;return t[18]!==u||t[19]!==f?(p=(0,Z.jsxs)(ee,{children:[u,f]}),t[18]=u,t[19]=f,t[20]=p):p=t[20],p}function Gk(e,t,n,r){return e.kind===`human`?(0,Z.jsx)(Bk,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(Uk,{participant:e,crossDoc:n,scoped:r===e.agentId,onClickAgent:t},e.agentId)}function Kk(){let e=(0,$.c)(20),{activeProvider:t,activeDocName:n,systemProvider:r,openActivityPanel:i,docPanelMode:a,docPanelAgentId:o}=yt(),{current:s,crossDoc:c}=jk(t,r,n);if(Pk(LC(t),n),s.length===0&&c.length===0)return null;let l;if(e[0]!==c||e[1]!==s||e[2]!==o||e[3]!==a||e[4]!==i){let t=s.slice(0,Fk),n;e[6]===s?n=e[7]:(n=s.slice(Fk),e[6]=s,e[7]=n);let r=n,u=c.slice(0,Ik),d;e[8]===c?d=e[9]:(d=c.slice(Ik),e[8]=c,e[9]=d);let f=d,p=i,m=a===`agent`?o:null,h;e[10]!==p||e[11]!==m?(h=e=>Gk(e,p,!1,m),e[10]=p,e[11]=m,e[12]=h):h=e[12];let g=t.map(h),_;e[13]!==r||e[14]!==p||e[15]!==m?(_=r.length>0?(0,Z.jsx)(Wk,{count:r.length,remainder:r,crossDoc:!1,scopedAgentId:m,onClickAgent:p}):null,e[13]=r,e[14]=p,e[15]=m,e[16]=_):_=e[16];let v;e[17]!==g||e[18]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,"data-presence-section":`current`,children:[g,_]}),e[17]=g,e[18]=_,e[19]=v):v=e[19],l=(0,Z.jsxs)(`div`,{"data-slot":`presence-bar`,className:`flex items-center px-1 py-1.5`,children:[v,c.length>0?(0,Z.jsxs)(`div`,{className:`ml-1.5 flex items-center gap-1.5`,"data-presence-section":`crossdoc`,children:[u.map(e=>Gk(e,p,!0,m)),f.length>0?(0,Z.jsx)(Wk,{count:f.length,remainder:f,crossDoc:!0,scopedAgentId:m,onClickAgent:p}):null]}):null]}),e[0]=c,e[1]=s,e[2]=o,e[3]=a,e[4]=i,e[5]=l}else l=e[5];return l}var qk=`.md`,Jk=/\.(md|mdx)$/i;function Yk(e,t=qk){return`${e}${t}`}function Xk(e){return _A(e).replace(Jk,``)}function Zk(e){return Pr(e)?eA(e.path):Jn(e)?e.path:Yk(e.docName,e.docExt)}function Qk(e){let t=_A(e).match(Jk);return t?`.${t[1].toLowerCase()}`:void 0}function $k(e){return _A(e)}function eA(e){let t=_A(e.trim());return t?`${t}/`:``}function tA(e){return e.endsWith(`/`)?$k(e):Xk(e)}function nA(e){return e.map(Zk)}function rA(e){return[...e].sort().join(`\0`)}function iA(e){return rA(nA(e))}function aA(e){let t=new Set;for(let n of e){if(Pr(n)){let e=eA(n.path);e&&t.add(e)}let e=(Pr(n)||Jn(n)?n.path:n.docName).split(`/`).filter(Boolean),r=Pr(n)?e.length:e.length-1;for(let n=1;n<=r;n++)t.add(`${e.slice(0,n).join(`/`)}/`)}return[...t].sort()}function oA(e){if(!e)return[];let t=_A(e.replace(Jk,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function sA(e,t,n){let r=Qk(e);if(r)return r;let i=n.find(e=>Gi(e)&&e.docName===t);return i?i.docExt??qk:gA(e).includes(`.`)?void 0:qk}function cA(e,t){let n=e.lastIndexOf(`/`),r=n===-1?``:e.slice(0,n+1),i=n===-1?e:e.slice(n+1),a=t.filter(e=>{if(!Jn(e)||!e.path.startsWith(r))return!1;let t=e.path.slice(r.length);return!t.includes(`/`)&&t.startsWith(`${i}.`)});return a.length===1?a[0].path:null}function lA(e,t,n){if(Qk(e))return null;let r=n.find(e=>Jn(e)&&e.path===t);return r?r.path:gA(e).includes(`.`)?t:cA(t,n)}function uA(e,t){let n=e.kind===`directory`,r=n?$k(e.path):Xk(e.path);if(n)return{kind:`folder`,name:_A(gA(e.path)).replace(Jk,``),path:r,treePath:fA(e.path,!0)};let i=lA(e.path,r,t);if(i)return{kind:`asset`,name:_A(gA(i)),path:i,treePath:i};let a=sA(e.path,r,t);return{kind:`file`,name:_A(gA(e.path)).replace(Jk,``),path:r,treePath:fA(e.path,!1),docExt:a}}function dA(e){return e.kind===`directory`?$k(e.path):e.path}function fA(e,t){return t?eA(e):Jk.test(e)?e:`${e}${qk}`}function pA(e,t,n){let r=eA(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${qk}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function mA(e,t){return e===`file`?fA(t,!1):`${$k(t)}/index${qk}`}function hA(e,t){return t.kind===`root`||t.directoryPath==null?gA(e):`${t.directoryPath}${gA(e)}`}function gA(e){let t=_A(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function _A(e){return e.endsWith(`/`)?e.slice(0,-1):e}function vA(e,t){return t.trim()}function yA(e){return![``,`.`,`..`].includes(e)&&!e.includes(`/`)&&!e.includes(`\\`)&&!e.includes(`\0`)}function bA(e,t){let n=vA(e.kind,t),r=e.path.split(`/`);return r[r.length-1]=n,r.join(`/`)}function xA(e,t,n=[],r=[]){if(t.length===0&&n.length===0&&r.length===0)return e;let i=new Map(t.map(e=>[e.fromDocName,e.toDocName])),a=new Map(r.map(e=>[e.fromPath,e.toPath]));return e.map(e=>Gi(e)?{...e,docName:i.get(e.docName)??e.docName}:Pr(e)?{...e,path:OA(e.path,n)}:Jn(e)?{...e,path:a.get(e.path)??OA(e.path,n)}:e)}function SA(e,t,n,r=[]){if(t.length===0&&!n&&r.length===0)return e;let i=new Set(t),a=new Set(r);return e.filter(e=>Gi(e)?!i.has(e.docName)&&!MA(e.docName,n):Pr(e)?!MA(e.path,n):Jn(e)?!a.has(e.path)&&!MA(e.path,n):!0)}function CA(e,t){if(e.kind!==`asset`||t.some(t=>Jn(t)&&t.path===e.path))return e;let n=cA(e.path,t);return n?{...e,path:n,name:n.split(`/`).pop()??n}:e}function wA(e,t,n,r=new Date().toISOString()){let i=!1,a=[...e],o=e=>{a.some(t=>kA(t,e))||(a.push(e),i=!0)};if(n.kind===`file`){let s=e.find(e=>Gi(e)&&e.docName===t.path);return o({kind:`document`,docName:n.path,docExt:s?.docExt??t.docExt,size:s?.size??0,modified:r}),i?a:e}let s=e.find(e=>Pr(e)&&e.path===t.path);o({kind:`folder`,path:n.path,size:s?.size??0,modified:r});let c=new Set(n.duplicatedDocNames);for(let i of e){if(Gi(i)){let e=jA(i.docName,t.path,n.path);e&&c.has(e)&&o({...i,docName:e,modified:r});continue}if(Pr(i)){let e=AA(i.path,t.path,n.path);e&&o({...i,path:e,modified:r})}}return i?a:e}function TA(e,t){return e?t.find(t=>t.fromDocName===e)?.toDocName??e:null}function EA(e,t,n){return e.flatMap(e=>t===e.toDocName||!n(e.toDocName)?[e.fromDocName]:[e.fromDocName,e.toDocName])}function DA(e,t){let n=e.kind===`file`?Yk(e.path,e.docExt):e.path;return ig(t.contentDir,n,t.pathSeparator)}function OA(e,t){for(let{fromPath:n,toPath:r}of t){if(e===n)return r;if(e.startsWith(`${n}/`))return`${r}${e.slice(n.length)}`}return e}function kA(e,t){return Gi(e)&&Gi(t)?e.docName===t.docName:Pr(e)&&Pr(t)||Jn(e)&&Jn(t)?e.path===t.path:!1}function AA(e,t,n){return e===t?n:jA(e,t,n)}function jA(e,t,n){return e.startsWith(`${t}/`)?`${n}${e.slice(t.length)}`:null}function MA(e,t){return!!t&&(e===t||e.startsWith(`${t}/`))}function NA(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(Qu,{"data-slot":`context-menu`,...n}),t[2]=n,t[3]=r),r}function PA(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`select-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)($u,{"data-slot":`context-menu-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function FA(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(od,{"data-slot":`context-menu-sub`,...n}),t[2]=n,t[3]=r),r}function IA(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(ed,{children:(0,Z.jsx)(td,{"data-slot":`context-menu-content`,className:i,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function LA(e){let t=(0,$.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=ea(`group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,Z.jsx)(nd,{"data-slot":`context-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function RA(e){let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,inset:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=ea(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(Os,{className:`ml-auto`}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,Z.jsxs)(sd,{"data-slot":`context-menu-sub-trigger`,"data-inset":i,className:o,...a,children:[n,s]}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function zA(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg data-[state=closed]:overflow-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0 subtle-scrollbar`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(cd,{"data-slot":`context-menu-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function BA(e){let t=(0,$.c)(15),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:i,children:r,checked:n,inset:a,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===i?s=t[7]:(s=ea(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,i),t[6]=i,t[7]=s);let c;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(`span`,{className:`pointer-events-none absolute right-2`,children:(0,Z.jsx)(id,{children:(0,Z.jsx)(Ds,{})})}),t[8]=c):c=t[8];let l;return t[9]!==n||t[10]!==r||t[11]!==a||t[12]!==o||t[13]!==s?(l=(0,Z.jsxs)(rd,{"data-slot":`context-menu-checkbox-item`,"data-inset":a,className:s,checked:n,...o,children:[c,r]}),t[9]=n,t[10]=r,t[11]=a,t[12]=o,t[13]=s,t[14]=l):l=t[14],l}function VA(e){let t=(0,$.c)(8),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;t[3]===n?i=t[4]:(i=ea(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(ad,{"data-slot":`context-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var HA=`mr-1.5 flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground outline-none transition hover:bg-foreground/10 hover:text-foreground hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/50`,UA=`border-border bg-background text-foreground hover:bg-background focus-visible:bg-background`,WA={start:[Yo.Space],cancel:[Yo.Esc],end:[Yo.Space,Yo.Enter]};function GA(e){return ea(HA,e?`opacity-100`:`pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100`)}function KA(e){return e?void 0:-1}function qA({className:e,isDragging:t}){return ea(e,t&&UA)}function JA(e){return e.code===Yo.Enter&&e.target===e.currentTarget}function YA({event:e,hasKeyboardActivation:t,isDragging:n}){return e.defaultPrevented?`ignore`:!n&&t&&JA(e)?`activate-tab`:`delegate-sortable`}function XA({activeWidth:e,isDragging:t,outerStyle:n,transform:r,transition:i}){let a=t&&e?e:void 0;return{...n,transform:wa.Transform.toString(r?{...r,scaleX:1,scaleY:1}:null),transition:i,flexBasis:a??n?.flexBasis,maxWidth:a??n?.maxWidth,minWidth:a??n?.minWidth,opacity:n?.opacity,width:a??n?.width,zIndex:t?20:n?.zIndex}}function ZA(e){let t=e?.querySelectorAll(`[data-editor-tab-sortable]`)??[],n=1/0,r=-1/0;for(let e of t){let t=e.getBoundingClientRect();n=Math.min(n,t.left),r=Math.max(r,t.right)}return Number.isFinite(n)&&Number.isFinite(r)?{left:n,right:r}:null}function QA(e){return({activeNodeRect:t,transform:n})=>{let r={...n,y:0};if(!e||!t)return r;let i=e.left-t.left,a=e.right-t.right;return r.x=Math.min(Math.max(r.x,i),a),r}}var $A=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(r){let e=1/0,i=-1/0,a=null,o=null;for(let r of t){let t=n.get(r.id);t&&(t.left<e&&(e=t.left,a=r),t.right>i&&(i=t.right,o=r))}if(!Number.isFinite(e)||!Number.isFinite(i))return[];let s=r.x<e?a:r.x>i?o:null;if(s)return[{id:s.id,data:{droppableContainer:s,value:0}}]}return vo(e)},ej=[`.md`,`.mdx`],tj=`group relative -mb-px flex h-10 min-w-28 max-w-64 shrink-0 cursor-pointer items-center overflow-hidden border border-transparent font-medium transition-colors`,nj=`z-10 rounded-t-lg rounded-b-none border-border border-b-0 bg-background text-foreground`,rj=ea(nj,`bg-transparent hover:bg-muted focus-visible:bg-muted border-transparent hover:border-border focus-visible:border-border`),ij=`flex h-full min-w-0 flex-1 cursor-pointer items-center overflow-hidden px-3 text-left text-[13px]`;function aj(e){return e.replace(/[^A-Za-z0-9_-]/g,`-`)}function oj(e){let t=yr(e);window.location.hash!==t&&(window.location.hash=t)}function sj(e){Math.abs(e.deltaX)>=Math.abs(e.deltaY)||e.currentTarget.scrollWidth<=e.currentTarget.clientWidth||(e.preventDefault(),e.currentTarget.scrollLeft+=e.deltaY)}function cj(e,t){let n=[t,...ej].filter((e,t,n)=>e&&n.indexOf(e)===t),r=e.toLowerCase(),i=n.find(t=>e.length>t.length&&r.endsWith(t.toLowerCase()));return i?e.slice(0,-i.length):e}function lj(e){let t=(0,$.c)(37),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({activateFromKeyboard:n,className:r,tabId:l,disabled:i,onKeyDown:a,ref:o,style:s,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u;t[9]!==i||t[10]!==l?(u={id:l,disabled:i},t[9]=i,t[10]=l,t[11]=u):u=t[11];let{attributes:d,listeners:f,rect:p,setNodeRef:m,transform:h,transition:g,isDragging:_}=go(u),v=p.current?.width,y;t[12]!==_||t[13]!==s||t[14]!==v||t[15]!==h||t[16]!==g?(y=XA({activeWidth:v,isDragging:_,outerStyle:s,transform:h,transition:g}),t[12]=_,t[13]=s,t[14]=v,t[15]=h,t[16]=g,t[17]=y):y=t[17];let b=y,x;t[18]!==o||t[19]!==m?(x=function(e){m(e),typeof o==`function`?o(e):o&&`current`in o&&(o.current=e)},t[18]=o,t[19]=m,t[20]=x):x=t[20];let S=x,C=f?.onKeyDown,w;t[21]!==n||t[22]!==_||t[23]!==a||t[24]!==C?(w=function(e){a?.(e);let t=YA({event:e,hasKeyboardActivation:!!n,isDragging:_});if(t!==`ignore`){if(t===`activate-tab`&&n){e.preventDefault(),n();return}C?.(e)}},t[21]=n,t[22]=_,t[23]=a,t[24]=C,t[25]=w):w=t[25];let T=w,E;t[26]!==r||t[27]!==_?(E=qA({className:r,isDragging:_}),t[26]=r,t[27]=_,t[28]=E):E=t[28];let D;return t[29]!==d||t[30]!==S||t[31]!==T||t[32]!==f||t[33]!==c||t[34]!==b||t[35]!==E?(D=(0,Z.jsx)(`div`,{ref:S,"data-editor-tab-sortable":``,className:E,style:b,...c,...d,...f,onKeyDown:T}),t[29]=d,t[30]=S,t[31]=T,t[32]=f,t[33]=c,t[34]=b,t[35]=E,t[36]=D):D=t[36],D}function uj(e){let t=(0,$.c)(52),{children:n,closeTab:r,closeTabs:i,canPin:a,disabled:o,openTabs:c,pinTab:l,pinnedTabIds:u,tabId:d,unpinTab:f}=e,p=a===void 0?!0:a;if(o!==void 0&&o)return n;let m;t[0]!==p||t[1]!==u||t[2]!==d?(m=p&&u.includes(d),t[0]=p,t[1]=u,t[2]=d,t[3]=m):m=t[3];let h=m,g;if(t[4]!==c||t[5]!==u||t[6]!==d){let e;t[8]===d?e=t[9]:(e=e=>e!==d,t[8]=d,t[9]=e),g=rn(c.filter(e),u),t[4]=c,t[5]=u,t[6]=d,t[7]=g}else g=t[7];let _=g,v;t[10]!==c||t[11]!==u?(v=rn(c,u),t[10]=c,t[11]=u,t[12]=v):v=t[12];let y=v,b;t[13]===n?b=t[14]:(b=(0,Z.jsx)(PA,{asChild:!0,children:n}),t[13]=n,t[14]=b);let x;t[15]!==r||t[16]!==d?(x=()=>r(d),t[15]=r,t[16]=d,t[17]=x):x=t[17];let S;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(s,{id:`yz7wBu`}),t[18]=S):S=t[18];let C;t[19]!==h||t[20]!==x?(C=(0,Z.jsx)(LA,{disabled:h,onSelect:x,children:S}),t[19]=h,t[20]=x,t[21]=C):C=t[21];let w=_.length===0,T;t[22]!==i||t[23]!==_?(T=()=>{i(_)},t[22]=i,t[23]=_,t[24]=T):T=t[24];let E;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsx)(s,{id:`omXJcU`}),t[25]=E):E=t[25];let D;t[26]!==w||t[27]!==T?(D=(0,Z.jsx)(LA,{disabled:w,onSelect:T,children:E}),t[26]=w,t[27]=T,t[28]=D):D=t[28];let O=y.length===0,k;t[29]!==y||t[30]!==i?(k=()=>{i(y)},t[29]=y,t[30]=i,t[31]=k):k=t[31];let A;t[32]===u.length?A=t[33]:(A=u.length?(0,Z.jsx)(s,{id:`U2Kx6T`}):(0,Z.jsx)(s,{id:`WyXG7w`}),t[32]=u.length,t[33]=A);let j;t[34]!==O||t[35]!==k||t[36]!==A?(j=(0,Z.jsx)(LA,{disabled:O,"data-testid":`editor-tab-context-close-all`,onSelect:k,children:A}),t[34]=O,t[35]=k,t[36]=A,t[37]=j):j=t[37];let M;t[38]!==p||t[39]!==h||t[40]!==l||t[41]!==d||t[42]!==f?(M=p&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(VA,{}),(0,Z.jsx)(LA,{"data-testid":`editor-tab-context-pin-toggle`,onSelect:()=>h?f(d):l(d),children:h?(0,Z.jsx)(s,{id:`SYfHmN`}):(0,Z.jsx)(s,{id:`3pU8e-`})})]}),t[38]=p,t[39]=h,t[40]=l,t[41]=d,t[42]=f,t[43]=M):M=t[43];let N;t[44]!==D||t[45]!==j||t[46]!==M||t[47]!==C?(N=(0,Z.jsxs)(IA,{className:`min-w-40`,children:[C,D,j,M]}),t[44]=D,t[45]=j,t[46]=M,t[47]=C,t[48]=N):N=t[48];let P;return t[49]!==N||t[50]!==b?(P=(0,Z.jsxs)(NA,{children:[b,N]}),t[49]=N,t[50]=b,t[51]=P):P=t[51],P}function dj(e){let t=(0,$.c)(26),{accessibleLabel:n,closeTab:r,isActive:a,isPinned:o,tabId:s,unpinTab:c}=e,{_:l}=i();if(o){let e;t[0]!==l||t[1]!==n?(e=l({id:`t18QYR`,values:{accessibleLabel:n}}),t[0]=l,t[1]=n,t[2]=e):e=t[2];let r;t[3]!==s||t[4]!==c?(r=e=>{e.stopPropagation(),c(s)},t[3]=s,t[4]=c,t[5]=r):r=t[5];let i;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(Pl,{"aria-hidden":`true`}),t[6]=i):i=t[6];let a;return t[7]!==e||t[8]!==r?(a=(0,Z.jsx)(sa,{variant:`ghost`,size:`icon-xs`,type:`button`,"aria-label":e,"data-testid":`editor-tab-unpin-button`,className:`mr-1.5 text-primary! hover:bg-primary/10!`,onClick:r,children:i}),t[7]=e,t[8]=r,t[9]=a):a=t[9],a}let u;t[10]!==l||t[11]!==n?(u=l({id:`JLzQi_`,values:{accessibleLabel:n}}),t[10]=l,t[11]=n,t[12]=u):u=t[12];let d;t[13]===a?d=t[14]:(d=GA(a),t[13]=a,t[14]=d);let f;t[15]===a?f=t[16]:(f=KA(a),t[15]=a,t[16]=f);let p;t[17]!==r||t[18]!==s?(p=e=>{e.stopPropagation(),r(s)},t[17]=r,t[18]=s,t[19]=p):p=t[19];let m;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(ys,{"aria-hidden":`true`}),t[20]=m):m=t[20];let h;return t[21]!==u||t[22]!==d||t[23]!==f||t[24]!==p?(h=(0,Z.jsx)(sa,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":u,"data-testid":`editor-tab-close-button`,className:d,tabIndex:f,onClick:p,children:m}),t[21]=u,t[22]=d,t[23]=f,t[24]=p,t[25]=h):h=t[25],h}function fj(e){let t=(0,$.c)(1),{docName:n}=e;if(gC(n)!==`conflict`)return null;let r;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(Pi,{"aria-label":`Conflict`,"data-testid":`editor-tab-conflict-badge`,className:`mr-1 size-3.5 shrink-0 text-amber-500`}),t[0]=r):r=t[0],r}function pj(){let e=(0,$.c)(80),{activeDocName:t,activeTabId:n,activeNewTabId:r,activeTarget:a,activateTab:o,activateNewTab:c,closeAndClearForRename:l,closeNewTab:u,closeTab:d,closeTabs:f,getPoolActiveDocName:p,poolHas:m,isNewTabActive:h,newTabIds:g,openNewTab:_,openTabs:v,pinTab:b,pinnedTabIds:x,remapTabsForRename:S,reorderTabs:C,unpinTab:w,visibleTabIds:T}=yt(),{_:E}=i(),{pageMeta:D}=si(),O=(0,Q.useRef)(null),[k,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(null),[N,P]=(0,Q.useState)(``),[F,I]=(0,Q.useState)(null),[R,z]=(0,Q.useState)(!1),B=(0,Q.useRef)(null),V=(0,Q.useRef)(!1),H=(0,Q.useRef)(!1),U=(0,Q.useRef)(null),ee=(0,Q.useRef)(t),te;e[0]!==n||e[1]!==t||e[2]!==a?(te=n??(a?y(a):t?Yt(t):null),e[0]=n,e[1]=t,e[2]=a,e[3]=te):te=e[3];let W=te,ne;e[4]!==r||e[5]!==W||e[6]!==h||e[7]!==g||e[8]!==v?(ne=h?`${r??`__new-tab__`}\u0000${v.join(`\0`)}\u0000${g.join(`\0`)}`:W?`${W}\u0000${v.join(`\0`)}`:``,e[4]=r,e[5]=W,e[6]=h,e[7]=g,e[8]=v,e[9]=ne):ne=e[9];let re=ne,G,ie;e[10]===t?(G=e[11],ie=e[12]):(G=()=>{ee.current=t},ie=[t],e[10]=t,e[11]=G,e[12]=ie),(0,Q.useEffect)(G,ie);let K,q;e[13]===re?(K=e[14],q=e[15]):(K=()=>{re&&(O.current?.querySelector(`[data-active-tab="true"]`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},q=[re],e[13]=re,e[14]=K,e[15]=q),(0,Q.useEffect)(K,q);let ae,oe;e[16]===j?(ae=e[17],oe=e[18]):(ae=()=>{j&&(B.current?.focus(),B.current?.select())},oe=[j],e[16]=j,e[17]=ae,e[18]=oe),(0,Q.useEffect)(ae,oe);let se,ce;e[19]!==v||e[20]!==j?(se=()=>{!j||v.includes(j.tabId)||(H.current=!0,U.current=null,M(null),P(``),I(null),z(!1))},ce=[v,j],e[19]=v,e[20]=j,e[21]=se,e[22]=ce):(se=e[21],ce=e[22]),(0,Q.useEffect)(se,ce);let le=function(e,t){let n=t.split(`/`);H.current=!1,U.current=null,M({docName:t,tabId:e}),P(n[n.length-1]),I(null)},ue=function(){H.current=!0,U.current=null,M(null),P(``),I(null),z(!1)},de=async function(){if(H.current){H.current=!1;return}if(V.current)return;let e=j?.docName;if(!e){ue();return}let t=vA(`file`,cj(N,D.get(e)?.docExt??`.md`)),n=e.split(`/`),r=n[n.length-1];if(t===r){ue();return}if(t===U.current){B.current?.focus();return}if(!yA(t)){I(E({id:`P8yDjG`})),B.current?.focus();return}let i=bA({kind:`file`,path:e,name:r},t);V.current=!0,z(!0),I(null);try{let n=await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:`file`,fromPath:e,toPath:i})});if(H.current){z(!1),V.current=!1;return}let r=await L(n,`Server error (HTTP ${n.status})`);if(!r.ok){I(r.title),z(!1),V.current=!1,U.current=t,B.current?.focus();return}let a=Ee(Hi,r.body,`rename-path:tab`,{renamed:[],renamedAssets:[]}).renamed,o=ee.current,s=TA(o,a);pe(a);let c=!0;try{let e=EA(a,p(),m);await Promise.all(e.map(e=>l(e))),S(a),vi([`files`,`backlinks`,`graph`])}catch(n){let r=n;c=!1,console.warn(`[EditorTabs] post-rename reconciliation failed`,{err:r,docName:e,newDocName:i,normalized:t}),X.error(E({id:`MUBR8r`}))}H.current=!0,M(null),P(``),I(null),z(!1),V.current=!1,U.current=null,c&&s&&s!==o&&oj(s)}catch(n){console.warn(`[EditorTabs] rename failed`,{err:n,docName:e,newDocName:i,normalized:t}),I(E({id:`HIb0vl`})),z(!1),V.current=!1,U.current=t,B.current?.focus()}},fe=typeof window<`u`&&window.okDesktop!=null,me;e[23]===g?me=e[24]:(me=new Set(g),e[23]=g,e[24]=me);let he=me,ge;e[25]===k?ge=e[26]:(ge=QA(k),e[25]=k,e[26]=ge);let _e;e[27]===ge?_e=e[28]:(_e=[ge],e[27]=ge,e[28]=_e);let ve=_e,ye;e[29]!==u||e[30]!==f||e[31]!==he?(ye=function(e){let t=[],n=[];for(let r of e)he.has(r)?n.push(r):t.push(r);t.length>0&&f(t);for(let e of n)u(e)},e[29]=u,e[30]=f,e[31]=he,e[32]=ye):ye=e[32];let be=ye,xe;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(xe={activationConstraint:{distance:8}},e[33]=xe):xe=e[33];let Se;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(Se={coordinateGetter:fo,keyboardCodes:WA},e[34]=Se):Se=e[34];let Ce=ro(So(bo,xe),So(Ua,Se)),we;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(we=function(){A(ZA(O.current))},e[35]=we):we=e[35];let Te=we,De;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(De=function(){A(null)},e[36]=De):De=e[36];let Oe=De,ke;e[37]!==Oe||e[38]!==C||e[39]!==T?(ke=function(e){Oe();let t=String(e.active.id),n=e.over?String(e.over.id):null;if(!n||t===n)return;let r=T.indexOf(t),i=T.indexOf(n);r<0||i<0||r===i||C(mo([...T],r,i),t)},e[37]=Oe,e[38]=C,e[39]=T,e[40]=ke):ke=e[40];let Ae=ke,je=fe?``:void 0,Me;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(Me=ea(`pl-2 flex h-12 min-w-0 touch-manipulation flex-1 items-end overflow-x-auto overflow-y-hidden overscroll-x-contain scroll-fade-mask-x [scrollbar-width:none]`,fe&&`[-webkit-app-region:drag]`),e[41]=Me):Me=e[41];let Ne=sj,Pe;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=ea(`flex items-end gap-1`,fe&&`[-webkit-app-region:no-drag]`),e[42]=Pe):Pe=e[42];let Fe=Ga,Ie=$A,Le;e[43]===Symbol.for(`react.memo_cache_sentinel`)?(Le={container:typeof document<`u`?document.body:void 0},e[43]=Le):Le=e[43];let Re=Da,ze;e[44]===T?ze=e[45]:(ze=[...T],e[44]=T,e[45]=ze);let Be=za,Ve=T.map(e=>{if(he.has(e)){let t=e===r;return(0,Z.jsx)(uj,{tabId:e,canPin:!1,openTabs:T,closeTab:u,closeTabs:be,pinTab:b,pinnedTabIds:x,unpinTab:w,children:(0,Z.jsxs)(lj,{tabId:e,activateFromKeyboard:()=>c(e),"aria-current":t?`page`:void 0,"data-active-tab":t?`true`:void 0,className:ea(tj,t?nj:rj),onAuxClick:t=>{t.button===1&&(t.preventDefault(),u(e))},onClick:t=>{t.target===t.currentTarget&&c(e)},children:[(0,Z.jsx)(`button`,{type:`button`,"aria-label":E({id:`zLak8b`}),"data-testid":`editor-new-tab-placeholder-button`,className:ij,onClick:()=>c(e),tabIndex:-1,children:(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:(0,Z.jsx)(s,{id:`3YvS-c`})})}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":E({id:`xCdTnb`}),"data-testid":`editor-new-tab-placeholder-close`,className:GA(t),tabIndex:KA(t),onClick:t=>{t.stopPropagation(),u(e)},children:(0,Z.jsx)(ys,{"aria-hidden":`true`,className:`size-3.5`})})]})},e)}let t=en(e),n=e===W,i=x.includes(e);if(t.kind===`folder`){let{baseName:r,label:a,prefix:s}=Qt(t.folderPath,`/`),c=`${s}${a}`;return(0,Z.jsx)(uj,{tabId:e,openTabs:T,closeTab:d,closeTabs:be,pinTab:b,pinnedTabIds:x,unpinTab:w,children:(0,Z.jsxs)(lj,{tabId:e,activateFromKeyboard:()=>o(e),"aria-current":n?`page`:void 0,"data-active-tab":n?`true`:void 0,className:ea(tj,n?nj:rj),onAuxClick:t=>{t.button===1&&(t.preventDefault(),!i&&d(e))},onClick:t=>{t.target===t.currentTarget&&o(e)},children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":c,title:c,className:ij,onClick:()=>{o(e)},tabIndex:-1,children:[s&&(0,Z.jsx)(`span`,{className:ea(`min-w-0 flex-1 truncate`,n&&`text-muted-foreground`),children:s}),(0,Z.jsxs)(`span`,{className:ea(`flex min-w-0 items-center`,s?`max-w-[70%] shrink-0`:`flex-1`),children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:r}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:`/`})]})]}),(0,Z.jsx)(dj,{accessibleLabel:c,closeTab:d,isActive:n,isPinned:i,tabId:e,unpinTab:w})]})},e)}if(t.kind===`asset`){let{baseName:r,label:a,prefix:s}=Qt(t.assetPath,``),c=`${s}${a}`;return(0,Z.jsx)(uj,{tabId:e,openTabs:T,closeTab:d,closeTabs:be,pinTab:b,pinnedTabIds:x,unpinTab:w,children:(0,Z.jsxs)(lj,{tabId:e,activateFromKeyboard:()=>o(e),"aria-current":n?`page`:void 0,"data-active-tab":n?`true`:void 0,className:ea(tj,n?nj:rj),onAuxClick:t=>{t.button===1&&(t.preventDefault(),!i&&d(e))},onClick:t=>{t.target===t.currentTarget&&o(e)},children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":c,className:ij,onClick:()=>{o(e)},tabIndex:-1,children:[s?(0,Z.jsx)(`span`,{className:ea(`min-w-0 flex-1 truncate text-muted-foreground/60`,n&&`text-muted-foreground`),children:s}):null,(0,Z.jsx)(`span`,{className:ea(`min-w-0 truncate`,s?`max-w-[70%] shrink-0`:`flex-1`),children:r})]}),(0,Z.jsx)(dj,{accessibleLabel:c,closeTab:d,isActive:n,isPinned:i,tabId:e,unpinTab:w})]})},e)}let a=t.docName,l=D.get(a)?.docExt??`.md`,{baseName:f,extension:p,label:m,prefix:h}=Qt(a,l),g=`${h}${m}`,_=l===`.md`||l===`.mdx`,v=j?.tabId===e,y=`editor-tab-rename-error-${aj(a)}`;return(0,Z.jsx)(uj,{disabled:v,tabId:e,openTabs:T,closeTab:d,closeTabs:be,pinTab:b,pinnedTabIds:x,unpinTab:w,children:(0,Z.jsx)(lj,{tabId:e,activateFromKeyboard:()=>o(e),disabled:v,"aria-current":n?`page`:void 0,"data-active-tab":n?`true`:void 0,className:ea(tj,n?nj:rj,v&&F&&`border-destructive`),onAuxClick:t=>{t.button===1&&(t.preventDefault(),!i&&d(e))},onClick:t=>{t.target===t.currentTarget&&o(e)},children:v?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(qS,{className:`h-full min-w-0 flex-1 rounded-none border-0 bg-transparent dark:bg-transparent`,children:[(0,Z.jsx)(QS,{ref:B,value:N,disabled:R,"aria-label":E({id:`Dw1T_W`,values:{label:m}}),"data-testid":`editor-tab-rename-input`,"aria-invalid":F?!0:void 0,"aria-describedby":F?y:void 0,"aria-busy":R||void 0,title:F??a,className:`h-full min-w-0 px-2 py-0 font-medium text-foreground text-xs selection:bg-primary selection:text-primary-foreground`,onChange:e=>{P(cj(e.target.value,l)),I(null),U.current=null},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),de()):e.key===`Escape`&&(e.preventDefault(),ue())},onBlur:de}),(0,Z.jsx)(YS,{align:`inline-end`,"aria-hidden":`true`,className:`pr-2 text-xs`,children:(0,Z.jsx)(ZS,{className:`text-muted-foreground/60 text-xs`,children:l})})]}),F?(0,Z.jsx)(`span`,{id:y,role:`alert`,className:`sr-only`,children:F}):null]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":g,title:g,className:ij,onClick:()=>{o(e)},onDoubleClick:t=>{t.preventDefault(),t.stopPropagation(),le(e,a)},tabIndex:-1,children:[(0,Z.jsx)(fj,{docName:a}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:f}),!_&&(0,Z.jsx)(`span`,{className:`shrink-0`,children:p})]})]}),(0,Z.jsx)(dj,{accessibleLabel:g,closeTab:d,isActive:n,isPinned:i,tabId:e,unpinTab:w})]})})},e)}),He;e[46]!==Re||e[47]!==ze||e[48]!==Be||e[49]!==Ve?(He=(0,Z.jsx)(Re,{items:ze,strategy:Be,children:Ve}),e[46]=Re,e[47]=ze,e[48]=Be,e[49]=Ve,e[50]=He):He=e[50];let Ue;e[51]!==Fe||e[52]!==Oe||e[53]!==Ae||e[54]!==Te||e[55]!==Ce||e[56]!==!1||e[57]!==Ie||e[58]!==Le||e[59]!==He||e[60]!==ve?(Ue=(0,Z.jsx)(Fe,{sensors:Ce,autoScroll:!1,collisionDetection:Ie,modifiers:ve,onDragStart:Te,onDragEnd:Ae,onDragCancel:Oe,accessibility:Le,children:He}),e[51]=Fe,e[52]=Oe,e[53]=Ae,e[54]=Te,e[55]=Ce,e[56]=!1,e[57]=Ie,e[58]=Le,e[59]=He,e[60]=ve,e[61]=Ue):Ue=e[61];let We;e[62]===E?We=e[63]:(We=E({id:`3YvS-c`}),e[62]=E,e[63]=We);let Ge;e[64]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,Z.jsx)(At,{"aria-hidden":`true`}),e[64]=Ge):Ge=e[64];let Ke;e[65]!==_||e[66]!==We?(Ke=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":We,"data-testid":`editor-new-tab-button`,className:`first:mb-3 mb-1.5`,onClick:_,children:Ge})}),e[65]=_,e[66]=We,e[67]=Ke):Ke=e[67];let qe;e[68]===Symbol.for(`react.memo_cache_sentinel`)?(qe=(0,Z.jsx)(Ar,{children:(0,Z.jsx)(s,{id:`3YvS-c`})}),e[68]=qe):qe=e[68];let Je;e[69]===Ke?Je=e[70]:(Je=(0,Z.jsxs)(pr,{children:[Ke,qe]}),e[69]=Ke,e[70]=Je);let Ye;e[71]!==Pe||e[72]!==Ue||e[73]!==Je?(Ye=(0,Z.jsxs)(`div`,{className:Pe,children:[Ue,Je]}),e[71]=Pe,e[72]=Ue,e[73]=Je,e[74]=Ye):Ye=e[74];let Xe;return e[75]!==je||e[76]!==Me||e[77]!==Ne||e[78]!==Ye?(Xe=(0,Z.jsx)(`div`,{ref:O,"data-electron-drag":je,className:Me,onWheel:Ne,children:Ye}),e[75]=je,e[76]=Me,e[77]=Ne,e[78]=Ye,e[79]=Xe):Xe=e[79],Xe}function mj(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Discord`}),r=(0,Z.jsx)(`path`,{d:`M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9554 2.4189-2.1568 2.4189Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function hj(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`X (Twitter)`}),r=(0,Z.jsx)(`path`,{d:`M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}var gj=[{label:{id:`TvY_XA`},href:`https://openknowledge.ai/docs`,icon:Zt},{label:`GitHub`,href:`https://github.com/inkeep/open-knowledge`,icon:Hd},{label:{id:`On0aF2`},href:`https://openknowledge.ai/`,icon:ci},{label:`Discord`,href:`https://discord.com/invite/YujKpFN49`,icon:mj},{label:`Twitter`,href:`https://x.com/inkeep`,icon:hj}],_j=()=>{let e=(0,$.c)(16),{_:t}=i(),[n,r]=(0,Q.useState)(!1),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(nn,{className:`size-4`}),e[0]=a):a=e[0];let o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(T,{asChild:!0,children:(0,Z.jsxs)(sa,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,children:[a,(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(s,{id:`s-MGs7`})})]})})}),e[1]=o):o=e[1];let c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsxs)(pr,{children:[o,(0,Z.jsx)(Ar,{children:(0,Z.jsx)(s,{id:`s-MGs7`})})]}),e[2]=c):c=e[2];let l;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`p`,{className:`font-mono tracking-wide uppercase text-muted-foreground text-xs mb-1`,children:(0,Z.jsx)(s,{id:`s-MGs7`})}),e[3]=l):l=e[3];let u;e[4]===t?u=e[5]:(u=t({id:`s-MGs7`}),e[4]=t,e[5]=u);let d;e[6]===t?d=e[7]:(d=gj.map(e=>{let{label:n,href:r,icon:i}=e;return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>Xo(e,r),onAuxClick:e=>Xo(e,r),className:`flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-azure-900/5 dark:hover:bg-white/20 hover:text-primary`,children:[(0,Z.jsx)(i,{"aria-hidden":`true`,className:`size-4 shrink-0`}),typeof n==`string`?n:t(n)]})},r)}),e[6]=t,e[7]=d);let f;e[8]===d?f=e[9]:(f=(0,Z.jsx)(`ul`,{className:`space-y-0.5`,children:d}),e[8]=d,e[9]=f);let p;e[10]!==u||e[11]!==f?(p=(0,Z.jsxs)(ie,{align:`end`,className:`w-64 p-3`,children:[l,(0,Z.jsx)(`nav`,{"aria-label":u,children:f})]}),e[10]=u,e[11]=f,e[12]=p):p=e[12];let m;return e[13]!==n||e[14]!==p?(m=(0,Z.jsxs)(ee,{open:n,onOpenChange:r,children:[c,p]}),e[13]=n,e[14]=p,e[15]=m):m=e[15],m};function vj(e){let t=(0,$.c)(75),{input:n,open:r,onOpenChange:a}=e,{_:o}=i(),{states:c,refresh:l}=jg(),{dispatch:u}=bg(),{merged:d}=be(),f=d?.appearance?.preview?.autoOpen??!0,[p,m]=(0,Q.useState)(!1),h=(0,Q.useRef)(!1);if(bh())return null;let g=typeof window<`u`&&window.okDesktop!=null,_=r??p,v;t[0]!==a||t[1]!==r||t[2]!==l?(v=e=>{r===void 0&&m(e),a?.(e),e&&l()},t[0]=a,t[1]=r,t[2]=l,t[3]=v):v=t[3];let y=v,b=n===null,x=!!n?.selection,S;t[4]!==f||t[5]!==n?(S=n!==null&&n.docContext!==null?fr(n.docContext.relativePath,f):``,t[4]=f,t[5]=n,t[6]=S):S=t[6];let C=S,w;t[7]!==u||t[8]!==n?(w=e=>{n!==null&&u(e.id,n)},t[7]=u,t[8]=n,t[9]=w):w=t[9];let T=w,E,D,O,k,A,j,M,N,P,F,I,L,R,z;if(t[10]!==y||t[11]!==T||t[12]!==n||t[13]!==_||t[14]!==C||t[15]!==c||t[16]!==b){let e;t[31]===c?e=t[32]:(e=e=>c[e.id]?.installed===!0,t[31]=c,t[32]=e),A=Ch.filter(e);let r;t[33]===c?r=t[34]:(r=Ch.some(e=>c[e.id]?.installed==null),t[33]=c,t[34]=r),j=r,O=c[`claude-code`]?.installed===!0;let i;t[35]!==n||t[36]!==C?(i=()=>{n!==null&&Yb(C)},t[35]=n,t[36]=C,t[37]=i):i=t[37],k=i,D=jo,R=_,z=y,M=!1;let a;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(a=g?()=>{h.current=!0}:void 0,t[38]=a):a=t[38];let o;t[39]===y?o=t[40]:(o=g?()=>{if(h.current){h.current=!1;return}y(!0)}:void 0,t[39]=y,t[40]=o);let l,u;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(ya,{className:`size-3.5`,"aria-hidden":`true`}),u=(0,Z.jsx)(s,{id:`O7_W_a`}),t[41]=l,t[42]=u):(l=t[41],u=t[42]),t[43]!==o||t[44]!==b?(N=(0,Z.jsx)(Bo,{asChild:!0,children:(0,Z.jsxs)(sa,{variant:`ghost`,size:`sm`,disabled:b,className:`gap-1.5 text-muted-foreground px-1.5`,"data-testid":`open-in-agent-trigger`,onPointerDown:a,onClick:o,children:[l,u]})}),t[43]=o,t[44]=b,t[45]=N):N=t[45],E=Wo,P=`end`,F=`min-w-[220px]`,I=`open-in-agent-menu`;let d;t[46]!==T||t[47]!==C||t[48]!==c?(d=e=>{let t=c[e.id];return(0,Z.jsx)(Xb,{target:e,installState:t,isElectronHost:g,prompt:C,onSelect:()=>T(e)},e.id)},t[46]=T,t[47]=C,t[48]=c,t[49]=d):d=t[49],L=A.map(d),t[10]=y,t[11]=T,t[12]=n,t[13]=_,t[14]=C,t[15]=c,t[16]=b,t[17]=E,t[18]=D,t[19]=O,t[20]=k,t[21]=A,t[22]=j,t[23]=M,t[24]=N,t[25]=P,t[26]=F,t[27]=I,t[28]=L,t[29]=R,t[30]=z}else E=t[17],D=t[18],O=t[19],k=t[20],A=t[21],j=t[22],M=t[23],N=t[24],P=t[25],F=t[26],I=t[27],L=t[28],R=t[29],z=t[30];let B;t[50]!==A||t[51]!==x||t[52]!==j?(B=x&&A.length===0?(0,Z.jsx)($o,{disabled:!0,"data-testid":`open-in-agent-selection-empty`,children:j?(0,Z.jsx)(s,{id:`EcR0fl`}):(0,Z.jsx)(s,{id:`l6OXqI`})}):null,t[50]=A,t[51]=x,t[52]=j,t[53]=B):B=t[53];let V;t[54]!==o||t[55]!==O||t[56]!==k||t[57]!==n||t[58]!==x?(V=!O&&!x?(0,Z.jsxs)($o,{onSelect:k,disabled:n===null,"data-testid":`open-in-agent-claude-web-fallback`,"aria-label":o({id:`aA51jP`}),children:[(0,Z.jsx)(_t,{className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(s,{id:`0S9PW_`})}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:(0,Z.jsx)(s,{id:`pcfY8r`})})]}):null,t[54]=o,t[55]=O,t[56]=k,t[57]=n,t[58]=x,t[59]=V):V=t[59];let H;t[60]!==E||t[61]!==B||t[62]!==V||t[63]!==P||t[64]!==F||t[65]!==I||t[66]!==L?(H=(0,Z.jsxs)(E,{align:P,className:F,"data-testid":I,children:[L,B,V]}),t[60]=E,t[61]=B,t[62]=V,t[63]=P,t[64]=F,t[65]=I,t[66]=L,t[67]=H):H=t[67];let U;return t[68]!==D||t[69]!==M||t[70]!==N||t[71]!==H||t[72]!==R||t[73]!==z?(U=(0,Z.jsxs)(D,{open:R,onOpenChange:z,modal:M,children:[N,H]}),t[68]=D,t[69]=M,t[70]=N,t[71]=H,t[72]=R,t[73]=z,t[74]=U):U=t[74],U}var yj=50,bj=()=>{let e=(0,$.c)(8),t=(0,Q.useRef)(null),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=()=>{t.current===null&&(t.current=setTimeout(()=>{t.current=null,MS.preload()},yj))},e[0]=n):n=e[0];let r=n,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{t.current!==null&&(clearTimeout(t.current),t.current=null)},e[1]=i):i=e[1];let a=i,o,c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>()=>{t.current!==null&&clearTimeout(t.current)},c=[],e[2]=o,e[3]=c):(o=e[2],c=e[3]),(0,Q.useEffect)(o,c);let l,u;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{a(),window.location.hash!==`#settings`&&(window.location.hash=kh)},u=(0,Z.jsx)(Vl,{className:`size-4`}),e[4]=l,e[5]=u):(l=e[4],u=e[5]);let d;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsxs)(sa,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,"data-testid":`header-settings-button`,onMouseEnter:r,onMouseLeave:a,onFocus:r,onBlur:a,onClick:l,children:[u,(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(s,{id:`Tz0i8g`})})]})}),e[6]=d):d=e[6];let f;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsxs)(pr,{children:[d,(0,Z.jsx)(Ar,{children:(0,Z.jsx)(s,{id:`Tz0i8g`})})]}),e[7]=f):f=e[7],f};function xj(e){let t=(0,$.c)(30),{input:n,onClickWhenNoRemote:r}=e,{_:a}=i(),{status:o}=Po(),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(null),f=(0,Q.useRef)(null),p,m;t[0]===u?(p=t[1],m=t[2]):(p=()=>{!u||!f.current||(f.current.focus(),f.current.select())},m=[u],t[0]=u,t[1]=p,t[2]=m),(0,Q.useEffect)(p,m);let h=o?.hasRemote===!0,g=n===null,_;t[3]!==a||t[4]!==c||t[5]!==h||t[6]!==n||t[7]!==r?(_=async function(){if(!c&&n!==null){l(!0),d(null);try{let e=await ka({...n,hasRemote:h,onClickWhenNoRemote:r},{clipboardWrite:Eo,toastSuccess:Ej,toastError:Tj,logEvent:wj});e.kind===`clipboard-failed`&&d(e.shareUrl)}catch{X.error(a({id:`u3YnKw`}))}l(!1)}},t[3]=a,t[4]=c,t[5]=h,t[6]=n,t[7]=r,t[8]=_):_=t[8];let v=_,y=u!==null,b;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>{e||d(null)},t[9]=b):b=t[9];let x;t[10]!==a||t[11]!==n?.kind?(x=n?.kind===`folder`?a({id:`WR0y2O`}):a({id:`F4IYWe`}),t[10]=a,t[11]=n?.kind,t[12]=x):x=t[12];let S=c||g,C,w;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(Hl,{className:`size-3.5`,"aria-hidden":!0}),w=(0,Z.jsx)(s,{id:`Z8lGw6`}),t[13]=C,t[14]=w):(C=t[13],w=t[14]);let T;t[15]!==v||t[16]!==x||t[17]!==S?(T=(0,Z.jsx)(W,{asChild:!0,children:(0,Z.jsxs)(sa,{variant:`ghost`,size:`sm`,"aria-label":x,onClick:v,disabled:S,className:`gap-1.5 text-muted-foreground px-1.5`,"data-testid":`share-button`,children:[C,w]})}),t[15]=v,t[16]=x,t[17]=S,t[18]=T):T=t[18];let E;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:(0,Z.jsx)(s,{id:`I1m158`})}),t[19]=E):E=t[19];let D;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(s,{id:`ndeI89`})}),t[20]=D):D=t[20];let O=u??``,k;t[21]===a?k=t[22]:(k=a({id:`5-FeN2`}),t[21]=a,t[22]=k);let A;t[23]!==O||t[24]!==k?(A=(0,Z.jsxs)(ie,{className:`flex w-80 flex-col gap-2`,"data-testid":`share-button-fallback-popover`,children:[E,D,(0,Z.jsx)(ks,{ref:f,readOnly:!0,value:O,onFocus:Cj,onClick:Sj,className:`font-mono text-xs`,"data-testid":`share-button-fallback-url`,"aria-label":k})]}),t[23]=O,t[24]=k,t[25]=A):A=t[25];let j;return t[26]!==T||t[27]!==A||t[28]!==y?(j=(0,Z.jsxs)(ee,{open:y,onOpenChange:b,children:[T,A]}),t[26]=T,t[27]=A,t[28]=y,t[29]=j):j=t[29],j}function Sj(e){return e.currentTarget.select()}function Cj(e){return e.currentTarget.select()}function wj(e){return console.log(e)}function Tj(e){e!==`Link ready but could not copy to clipboard.`&&X.error(e)}function Ej(e){return X.success(e)}function Dj(e){let t=(0,$.c)(44),{onSignIn:n,onSetIdentity:r,onOpenSearch:a,openInAgentMenuOpen:o,openInAgentMenuInput:c,onOpenInAgentMenuOpenChange:l}=e,{_:u}=i(),{activeDocName:d,activeTarget:f}=yt(),{state:p}=PO(),m=Oh(),h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=Us(`toggle-files-sidebar`),t[0]=h):h=t[0];let g=h,_=Us(`command-palette`),v=No(),[y,b]=(0,Q.useState)(!1),x;bb0:{if(f===null){let e;t[1]===v?e=t[2]:(e=sg({workspace:v}),t[1]=v,t[2]=e),x=e;break bb0}if(f.kind===`folder`){if(!v){x=null;break bb0}let e;t[3]!==f.folderPath||t[4]!==v?(e=cg({folderRelativePath:f.folderPath,workspace:v}),t[3]=f.folderPath,t[4]=v,t[5]=e):e=t[5],x=e;break bb0}let e;t[6]!==d||t[7]!==v?(e=og({docName:d,workspace:v}),t[6]=d,t[7]=v,t[8]=e):e=t[8],x=e}let S=c??x,C;bb1:{if(f?.kind===`folder`){let e;t[9]===f.folderPath?e=t[10]:(e=so(f.folderPath),t[9]=f.folderPath,t[10]=e),C=e;break bb1}if(d){let e;t[11]===d?e=t[12]:(e=cs(d),t[11]=d,t[12]=e),C=e;break bb1}C=null}let w=C,T=typeof window<`u`&&window.okDesktop!=null,E=p===`collapsed`,D=T?``:void 0,k=T&&E&&`pl-[78px]`,A;t[13]===k?A=t[14]:(A=ea(`flex h-12 shrink-0 items-center bg-muted/35 shadow-[inset_0_-1px_0_var(--border)]`,T&&`[-webkit-app-region:drag]`,k,T&&`motion-safe:transition-[padding] motion-safe:duration-200 motion-safe:ease-linear`),t[13]=k,t[14]=A);let j=!m&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(zO,{className:ea(`-ml-1 shrink-0 text-muted-foreground`,T&&`[-webkit-app-region:no-drag]`)})}),(0,Z.jsx)(Ar,{children:p===`expanded`?(0,Z.jsx)(s,{id:`ZxXhLY`,values:{sidebarShortcut:g}}):(0,Z.jsx)(s,{id:`Zz25kq`,values:{sidebarShortcut:g}})})]}),E&&a&&(0,Z.jsxs)(pr,{children:[(0,Z.jsx)(Gn,{asChild:!0,children:(0,Z.jsx)(sa,{variant:`ghost`,size:`icon-sm`,onClick:a,"aria-label":u({id:`IN4UX8`,values:{searchShortcut:_}}),"data-telemetry-event":`ok.editor_header.search.click`,className:ea(`shrink-0 text-muted-foreground`,T&&`[-webkit-app-region:no-drag]`),children:(0,Z.jsx)(O,{"aria-hidden":`true`})})}),(0,Z.jsx)(Ar,{children:(0,Z.jsx)(s,{id:`IN4UX8`,values:{searchShortcut:_}})})]}),(0,Z.jsx)(Aa,{orientation:`vertical`,className:`mr-1 h-4 shrink-0 data-vertical:self-center`}),(0,Z.jsx)(pj,{})]}),M;t[15]===j?M=t[16]:(M=(0,Z.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 px-3`,children:j}),t[15]=j,t[16]=M);let N;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(N=ea(`flex shrink-0 items-center justify-end gap-2 px-3`,T&&`[&>*]:[-webkit-app-region:no-drag]`),t[17]=N):N=t[17];let P;t[18]!==S||t[19]!==l||t[20]!==o||t[21]!==y||t[22]!==b||t[23]!==w||t[24]!==m?(P=!m&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(vj,{input:S,open:o,onOpenChange:l}),(0,Z.jsx)(xj,{input:w,onClickWhenNoRemote:()=>b(!0)}),(0,Z.jsx)(us,{open:y,onOpenChange:b})]}),t[18]=S,t[19]=l,t[20]=o,t[21]=y,t[22]=b,t[23]=w,t[24]=m,t[25]=P):P=t[25];let F;t[26]!==r||t[27]!==n?(F=(0,Z.jsx)(Vo,{onSignIn:n,onSetIdentity:r}),t[26]=r,t[27]=n,t[28]=F):F=t[28];let I,L,R;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(Kk,{}),L=(0,Z.jsx)(Aa,{orientation:`vertical`,className:`h-4 shrink-0 data-vertical:self-center`}),R=(0,Z.jsx)(dd,{}),t[29]=I,t[30]=L,t[31]=R):(I=t[29],L=t[30],R=t[31]);let z;t[32]===m?z=t[33]:(z=!m&&(0,Z.jsx)(bj,{}),t[32]=m,t[33]=z);let B;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Z.jsx)(_j,{}),t[34]=B):B=t[34];let V;t[35]!==P||t[36]!==F||t[37]!==z?(V=(0,Z.jsxs)(`div`,{className:N,children:[P,F,I,L,R,z,B]}),t[35]=P,t[36]=F,t[37]=z,t[38]=V):V=t[38];let H;return t[39]!==V||t[40]!==D||t[41]!==A||t[42]!==M?(H=(0,Z.jsxs)(`header`,{"data-electron-drag":D,className:A,children:[M,V]}),t[39]=V,t[40]=D,t[41]=A,t[42]=M,t[43]=H):H=t[43],H}function Oj(e){let t=(0,$.c)(48),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{onOpenSearch:r}=n,{_:a}=i(),[o,s]=l_(),[c,l]=(0,Q.useState)(o),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(`auth`),[m,h]=(0,Q.useState)(Av[0].id),[g,_]=(0,Q.useState)(!1),[v,y]=(0,Q.useState)(!1),[b,x]=(0,Q.useState)(!1),[S,C]=(0,Q.useState)(null),w=Ho(),{projectLocalConfig:T,projectLocalSynced:E}=be(),D=No(),{activeDocName:O}=yt(),k=w?.hasRemote,A=w?.pushPermission?.checkStatus,j;t[2]!==v||t[3]!==T||t[4]!==E||t[5]!==k||t[6]!==A?(j=p_({autoSyncOnboardingDismissed:v,hasRemote:k,projectLocalSynced:E,projectLocalConfig:T,pushPermissionCheckStatus:A}),t[2]=v,t[3]=T,t[4]=E,t[5]=k,t[6]=A,t[7]=j):j=t[7];let M=j,N,P;t[8]===O?(N=t[9],P=t[10]):(N=()=>{let e=function(e){let t=e.detail;t&&O&&_c(O,{kind:`raw-mdx`,detail:t}),l(`source`)};return window.addEventListener(t_,e),()=>window.removeEventListener(t_,e)},P=[O],t[8]=O,t[9]=N,t[10]=P),(0,Q.useEffect)(N,P),u_(w?.pausedReason);let F;t[11]===s?F=t[12]:(F=function(e){l(e),s(e)},t[11]=s,t[12]=F);let I=F,L;t[13]===a?L=t[14]:(L=async function(){_(!0);try{let e=await fetch(`/api/save-version`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})});e.ok?X.success(a({id:`rdE6_3`})):(console.error(`[save-version] failed:`,await e.text()),X.error(a({id:`q7zsRM`})))}catch(e){console.error(`[save-version] failed:`,e),X.error(a({id:`q7zsRM`}))}_(!1)},t[13]=a,t[14]=L);let R=L,z;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(z=function(e){x(e),e||C(null)},t[15]=z):z=t[15];let B=z,V;t[16]!==a||t[17]!==O||t[18]!==D?(V={openSelection(e){let t=lg({docName:e.docName,workspace:D,instruction:e.instruction,selectionMarkdown:e.selectionMarkdown})??og({docName:O,workspace:D});return t===null?(X.error(a({id:`_VRtd7`})),!1):(C(t),x(!0),!0)}},t[16]=a,t[17]=O,t[18]=D,t[19]=V):V=t[19];let H,U;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>{p(`auth`),d(!0)},U=()=>{p(`identity`),d(!0)},t[20]=H,t[21]=U):(H=t[20],U=t[21]);let ee;t[22]!==r||t[23]!==S||t[24]!==b?(ee=(0,Z.jsx)(Dj,{onSignIn:H,onSetIdentity:U,onOpenSearch:r,openInAgentMenuOpen:b,openInAgentMenuInput:S,onOpenInAgentMenuOpenChange:B}),t[22]=r,t[23]=S,t[24]=b,t[25]=ee):ee=t[25];let te;t[26]!==m||t[27]!==c||t[28]!==I||t[29]!==R||t[30]!==g?(te=(0,Z.jsx)(xk,{editorMode:c,onModeChange:I,activeTab:m,onActiveTabChange:h,onSaveVersion:R,saving:g}),t[26]=m,t[27]=c,t[28]=I,t[29]=R,t[30]=g,t[31]=te):te=t[31];let W;t[32]!==V||t[33]!==ee||t[34]!==te?(W=(0,Z.jsxs)(wc,{value:V,children:[ee,te]}),t[32]=V,t[33]=ee,t[34]=te,t[35]=W):W=t[35];let ne=f===`identity`,re;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(re=()=>{d(!1)},t[36]=re):re=t[36];let G;t[37]!==u||t[38]!==ne?(G=(0,Z.jsx)(zo,{open:u,onOpenChange:d,identityPrompt:ne,onSuccess:re}),t[37]=u,t[38]=ne,t[39]=G):G=t[39];let ie;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(ie=()=>y(!0),t[40]=ie):ie=t[40];let K;t[41]===M?K=t[42]:(K=(0,Z.jsx)(d_,{open:M,onResolved:ie}),t[41]=M,t[42]=K);let q;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,Z.jsx)(Qg,{}),t[43]=q):q=t[43];let ae;return t[44]!==W||t[45]!==G||t[46]!==K?(ae=(0,Z.jsxs)(Z.Fragment,{children:[W,G,K,q]}),t[44]=W,t[45]=G,t[46]=K,t[47]=ae):ae=t[47],ae}function kj(e){let t=yr(di(e));typeof window>`u`||window.location.hash!==t&&(window.location.hash=t)}function Aj(){let e=(0,$.c)(11),{conflicts:t,loading:n,error:r}=lo();if(n)return null;if(r===`server`){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`section`,{"data-testid":`conflicts-section`,"aria-label":`Conflicted files`,className:`border-b border-amber-200/60 bg-amber-50/40 px-2 py-2 dark:border-amber-900/40 dark:bg-amber-950/20`,children:(0,Z.jsxs)(`p`,{"data-testid":`conflicts-section-error`,className:`px-2 py-1.5 text-[12px] text-amber-700 dark:text-amber-400`,children:[(0,Z.jsx)(Pi,{"aria-hidden":`true`,className:`mr-1.5 inline size-3`}),`Couldn't load conflicts — reload to retry.`]})}),e[0]=t):t=e[0],t}if(t.length===0)return null;let i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 font-mono text-[11px] uppercase tracking-wider text-amber-700 dark:text-amber-400`,children:[(0,Z.jsx)(Pi,{"aria-hidden":`true`,className:`size-3`}),`Conflicts`]}),e[1]=i):i=e[1];let a;e[2]===t.length?a=e[3]:(a=(0,Z.jsxs)(`header`,{className:`flex items-center justify-between px-2 pb-1.5`,children:[i,(0,Z.jsx)(`span`,{"data-testid":`conflicts-section-count`,className:`rounded-full bg-amber-500 px-1.5 py-0.5 font-mono text-[10px] font-medium leading-none text-white`,children:t.length})]}),e[2]=t.length,e[3]=a);let o;e[4]===t?o=e[5]:(o=t.map(jj),e[4]=t,e[5]=o);let s;e[6]===o?s=e[7]:(s=(0,Z.jsx)(`ul`,{className:`flex flex-col gap-px`,children:o}),e[6]=o,e[7]=s);let c;return e[8]!==a||e[9]!==s?(c=(0,Z.jsxs)(`section`,{"data-testid":`conflicts-section`,"aria-label":`Conflicted files`,className:`border-b border-amber-200/60 bg-amber-50/40 px-2 py-2 dark:border-amber-900/40 dark:bg-amber-950/20`,children:[a,s]}),e[8]=a,e[9]=s,e[10]=c):c=e[10],c}function jj(e){return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(sa,{variant:`ghost`,size:`sm`,"data-testid":`conflicts-section-row`,"data-file":e.file,title:e.file,className:`h-7 w-full justify-start gap-1.5 px-2 font-normal text-[13px] text-amber-800 hover:bg-amber-100/60 hover:text-amber-900 dark:text-amber-300 dark:hover:bg-amber-900/30 dark:hover:text-amber-200`,onClick:()=>kj(e.file),children:[(0,Z.jsx)(Pi,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:e.file})]})},e.file)}var Mj=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
29
29
  <symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
30
30
  <path d="M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06" fill="currentcolor"/>
31
31
  </symbol>