@inkeep/open-knowledge 0.49.0 → 0.49.2

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 (834) hide show
  1. package/dist/abnfDiagram-VRR7QNED-DWDzSKGM.mjs +2 -0
  2. package/dist/acp-harness-probe-O9BEMpdb.mjs +3 -0
  3. package/dist/alias-JE7RI5QX-BLuOrjl2.mjs +7 -0
  4. package/dist/alias-JE7RI5QX-VxEqWoTW.mjs +1 -0
  5. package/dist/arc-DXUbbcxK.mjs +2 -0
  6. package/dist/architecture-TIHT7OUA-Bl3hpxt3.mjs +1 -0
  7. package/dist/architectureDiagram-ZJ3FMSHR-HYEpY7T3.mjs +37 -0
  8. package/dist/array-BbgQa93P.mjs +2 -0
  9. package/dist/awk2-BBAGSFUB-ClUuupKf.mjs +21 -0
  10. package/dist/awk2-BBAGSFUB-Dq-YdAGA.mjs +1 -0
  11. package/dist/banner-Be20aAVc.mjs +3 -0
  12. package/dist/base64-4YMZCVJ5-CtkujsXK.mjs +6 -0
  13. package/dist/base64-4YMZCVJ5-dXz6vbV-.mjs +1 -0
  14. package/dist/basename-AA2KJYZQ-BhoOTAHi.mjs +1 -0
  15. package/dist/basename-AA2KJYZQ-CEdH80GO.mjs +6 -0
  16. package/dist/bash-IJWYRKFO-BDtU-lTC.mjs +6 -0
  17. package/dist/bash-IJWYRKFO-jaJEvAZe.mjs +1 -0
  18. package/dist/blockDiagram-677ZJIJ3-yJugV29e.mjs +133 -0
  19. package/dist/c4Diagram-LMCZKHZV-BFQQLctA.mjs +11 -0
  20. package/dist/cat-RDUMLXKC-D1H4LA3Z.mjs +6 -0
  21. package/dist/cat-RDUMLXKC-DFuXWxVq.mjs +1 -0
  22. package/dist/channel-Cjp51EO_.mjs +2 -0
  23. package/dist/chmod-SYMGL4JA-ByMUk130.mjs +1 -0
  24. package/dist/chmod-SYMGL4JA-lEGJICyB.mjs +8 -0
  25. package/dist/chokidar-dh8zokRd.mjs +4 -0
  26. package/dist/chunk-24IMIIXA-RjlBWJtr.mjs +2 -0
  27. package/dist/chunk-2Q5K7J3B-Ck8oGqYt.mjs +2 -0
  28. package/dist/chunk-2TRDZQLB-AH-I_6yN.mjs +18 -0
  29. package/dist/chunk-2TRDZQLB-ZoW1EBbl.mjs +18 -0
  30. package/dist/chunk-32BRIVSS-Dwq69mnI.mjs +2 -0
  31. package/dist/chunk-3BS5SKQH-DpdUzS0R.mjs +140 -0
  32. package/dist/chunk-3H6UQG3A-BWCaN15a.mjs +9 -0
  33. package/dist/chunk-3THT3N7L-DYkTD3HD.mjs +2 -0
  34. package/dist/chunk-3ZUFRYJ4-H1A1hWy1.mjs +2 -0
  35. package/dist/chunk-3ZUFRYJ4-ekaYB_vG.mjs +2 -0
  36. package/dist/chunk-44UOCSGV-D1FZHMOP.mjs +2 -0
  37. package/dist/chunk-4GTNDTRF-Cx89i2Y1.mjs +8 -0
  38. package/dist/chunk-4HHKTUW3-Dk2l1S8J.mjs +3 -0
  39. package/dist/chunk-4Q4SM6WR-CGuvvBWe.mjs +5 -0
  40. package/dist/chunk-52WLFC77-Cn-qt8h-.mjs +11 -0
  41. package/dist/chunk-55VFSPNA-D2U7n2ka.mjs +3 -0
  42. package/dist/chunk-5FCAYU7R-DszODYLe.mjs +2 -0
  43. package/dist/chunk-5HE753X5-DDnyF29o.mjs +2 -0
  44. package/dist/chunk-5JV3BV7I-BkeVAZnj.mjs +2 -0
  45. package/dist/chunk-5QMZ5MUS-C5NTf5Rj.mjs +5 -0
  46. package/dist/chunk-5QVNJEHU-DS9zA_YV.mjs +9 -0
  47. package/dist/chunk-5TONJI2A-CzUNHQPX.mjs +3 -0
  48. package/dist/chunk-5V6VZH6T-DBFenjXz.mjs +2 -0
  49. package/dist/chunk-5VM5RSS4-C8vNNqW0.mjs +16 -0
  50. package/dist/chunk-62RKD26F-C4qK_fA-.mjs +21 -0
  51. package/dist/chunk-64BAICW3-BupSxcu5.mjs +2 -0
  52. package/dist/chunk-6Z5SFZXK-Cz0C4bhB.mjs +288 -0
  53. package/dist/chunk-74CEPOFO-BUVWiXkJ.mjs +23 -0
  54. package/dist/chunk-74CEPOFO-BYrCYxKO.mjs +23 -0
  55. package/dist/chunk-7BUUIJ7U-D7hE25H9.mjs +2 -0
  56. package/dist/chunk-7L36YK2X-CGwYuotX.mjs +3 -0
  57. package/dist/chunk-7L36YK2X-DAp-upAs.mjs +3 -0
  58. package/dist/chunk-7TSDKFEO-CE_P23TY.mjs +2 -0
  59. package/dist/chunk-7TSDKFEO-DBB10vPw.mjs +2 -0
  60. package/dist/chunk-A4HU7SVR-BZJ8xDMo.mjs +3 -0
  61. package/dist/chunk-A4JSPFCI-Dej71yGP.mjs +7 -0
  62. package/dist/chunk-A5O5YHGN-CczwCZ4d.mjs +2 -0
  63. package/dist/chunk-A65PWWJC-C-0S-s_f.mjs +3 -0
  64. package/dist/chunk-A7A2DBEE-DCXJ1xmx.mjs +7 -0
  65. package/dist/chunk-A7ICOL4V-BQZ9JZ1A.mjs +14 -0
  66. package/dist/chunk-ALLTKNUZ-D2ZOfcEz.mjs +6 -0
  67. package/dist/chunk-APT7OOP2-D-DaFB7K.mjs +2 -0
  68. package/dist/chunk-B74TABJS-BJwhrR8a.mjs +34 -0
  69. package/dist/chunk-BIQX33UG-Bmho6v3L.mjs +2 -0
  70. package/dist/chunk-C7G6YPKG-BAX_SClW.mjs +2 -0
  71. package/dist/chunk-CQNSW5MT-FekKjn0i.mjs +2 -0
  72. package/dist/chunk-CWQS3NFK-CcBWgb8o.mjs +2 -0
  73. package/dist/chunk-CYSBUYHQ-BftsYwRW.mjs +2 -0
  74. package/dist/chunk-D4J545R4-Br_5qOnE.mjs +12 -0
  75. package/dist/chunk-D6CWQ5DW-3AWPydfx.mjs +6 -0
  76. package/dist/chunk-D7MEQ3VN-Df6An2jd.mjs +5 -0
  77. package/dist/chunk-DBKNVD4L-B3hX287s.mjs +10 -0
  78. package/dist/chunk-DBKNVD4L-DNQP2COw.mjs +10 -0
  79. package/dist/chunk-DCAAORBQ-BDLVpBG2.mjs +2 -0
  80. package/dist/chunk-DHbaKqs-.mjs +1 -0
  81. package/dist/chunk-DXB73IDG-BBwE27jK.mjs +2 -0
  82. package/dist/chunk-EEXR5ZDP-CE452hsE.mjs +3 -0
  83. package/dist/chunk-EEXR5ZDP-Df-EPnbj.mjs +3 -0
  84. package/dist/chunk-EIZGF4BS-86nrMkyt.mjs +9 -0
  85. package/dist/chunk-EIZGF4BS-CSFp0aUh.mjs +9 -0
  86. package/dist/chunk-EMLP6XTP-C2yfLzVC.mjs +2 -0
  87. package/dist/chunk-EX3LRPZG-Chp9b-Lc.mjs +232 -0
  88. package/dist/chunk-F23WWYKW-qKke1WqP.mjs +17 -0
  89. package/dist/chunk-FWX5IMBZ-Cn1xNcn5.mjs +2 -0
  90. package/dist/chunk-GCTKCWKD-D0obXRun.mjs +4 -0
  91. package/dist/chunk-GFQRA5P5-XqPO4cim.mjs +3 -0
  92. package/dist/chunk-GOV5EKKI-CDovwI7Z.mjs +10 -0
  93. package/dist/chunk-GXVXFKBA-D-BGCybM.mjs +6 -0
  94. package/dist/chunk-HDQ56CKY-CI8IkhlS.mjs +16 -0
  95. package/dist/chunk-HDQ56CKY-Pa-7c4rC.mjs +16 -0
  96. package/dist/chunk-HJQJAYMS-BHzb4Ncl.mjs +3 -0
  97. package/dist/chunk-HJWBQKYG-B-KESSoV.mjs +6 -0
  98. package/dist/chunk-HKLCLINH-Bgw53oZd.mjs +63 -0
  99. package/dist/chunk-HL6NGDO2-CftrHAlX.mjs +24 -0
  100. package/dist/chunk-HOUHSVGY-C3h3PdhC.mjs +2 -0
  101. package/dist/chunk-HWKDQ44K-CGcvROg-.mjs +4 -0
  102. package/dist/chunk-HWKDQ44K-D3ZbaPl8.mjs +4 -0
  103. package/dist/chunk-I57KEIP3-_HYA-njf.mjs +11 -0
  104. package/dist/chunk-I57KEIP3-iiTO2OC-.mjs +11 -0
  105. package/dist/chunk-ICXQ74PX-DbJy3VdO.mjs +3 -0
  106. package/dist/chunk-IPJHKYVM-3ANqAo3C.mjs +2 -0
  107. package/dist/chunk-JG7HCLWE-lUInQ_44.mjs +3 -0
  108. package/dist/chunk-JVPRLUMK-FzUEFQw9.mjs +8 -0
  109. package/dist/chunk-JWPE2WC7-iDbhfJR-.mjs +2 -0
  110. package/dist/chunk-K6LIBGJA-BXxOXTjI.mjs +12 -0
  111. package/dist/chunk-KEIR6QF5-BLwvtFl6.mjs +176 -0
  112. package/dist/chunk-KMEYNNUA-1KiUKBQV.mjs +16 -0
  113. package/dist/chunk-KRBPSX3W-DeaaVEij.mjs +6 -0
  114. package/dist/chunk-KRBPSX3W-YDdgrCmf.mjs +6 -0
  115. package/dist/chunk-LL3S3NLB-D0lLKwVi.mjs +2 -0
  116. package/dist/chunk-LTZRCH7N-DpPs5vSq.mjs +32 -0
  117. package/dist/chunk-LWEGUNWT-DOK-XWMd.mjs +8 -0
  118. package/dist/chunk-MDDMCKUK-CTA6qEdN.mjs +7 -0
  119. package/dist/chunk-MDLLFABN-B2tA3LLA.mjs +73 -0
  120. package/dist/chunk-MHTUABJP-CrR3MfDw.mjs +9 -0
  121. package/dist/chunk-MIZPJHVH-d3bhRfh4.mjs +8 -0
  122. package/dist/chunk-MLXIYONF-C0S_CKb1.mjs +16 -0
  123. package/dist/chunk-MOJQB5TN-CUt4IiNv.mjs +89 -0
  124. package/dist/chunk-MOZMSUNE-DCxwDKn7.mjs +2 -0
  125. package/dist/chunk-MYE6AGBJ-CMoRJzYM.mjs +17 -0
  126. package/dist/chunk-NAERJDUW-Ck-SZ2Ps.mjs +9 -0
  127. package/dist/chunk-NCNPKYJZ-BxqfYu6d.mjs +3 -0
  128. package/dist/chunk-NUYSJFDK-DfaBzW-k.mjs +8 -0
  129. package/dist/chunk-OCLXQMOG-DC3689MV.mjs +7 -0
  130. package/dist/chunk-OCS6LSEM-BY3_3dNt.mjs +14 -0
  131. package/dist/chunk-OGEWGWER-DgPAesMA.mjs +2 -0
  132. package/dist/chunk-OJDRYQWQ-B9KRyRFZ.mjs +2 -0
  133. package/dist/chunk-OSBZ3O6U-BVpvamr7.mjs +2 -0
  134. package/dist/chunk-PBXLG62G-C12xrBbG.mjs +9 -0
  135. package/dist/chunk-PP6PSHAB-tlM6YKyg.mjs +5 -0
  136. package/dist/chunk-PUDLZKDR-CIWYIjrF.mjs +157 -0
  137. package/dist/chunk-PXTK5WE2-DNbfUrIy.mjs +22 -0
  138. package/dist/chunk-PXTK5WE2-e9kxtsgu.mjs +22 -0
  139. package/dist/chunk-PYSFUGCK-DqdcBhD4.mjs +11 -0
  140. package/dist/chunk-Q4XR5HBZ-jWirJQsj.mjs +71 -0
  141. package/dist/chunk-QBLGF6JB-hMrl9lGc.mjs +2 -0
  142. package/dist/chunk-QCDB2VPH-Cv7mIZWG.mjs +7 -0
  143. package/dist/chunk-QJ7O6ZN3-BRN048sn.mjs +6 -0
  144. package/dist/chunk-R6QSAL5T-CxzbKF59.mjs +2 -0
  145. package/dist/chunk-R6VWJ2ZL-DmUcUF0z.mjs +2 -0
  146. package/dist/chunk-R7FJI6CG-bmCS8vOS.mjs +2 -0
  147. package/dist/chunk-RPNGRAAP-BTpXCNpb.mjs +8 -0
  148. package/dist/chunk-RYQCIY6F-Dt7I2-Oy.mjs +2 -0
  149. package/dist/chunk-SDNKECQQ-BNRfy-15.mjs +6 -0
  150. package/dist/chunk-SNN4IESC-CZPQ88bY.mjs +2 -0
  151. package/dist/chunk-SNN4IESC-oXVGT9qo.mjs +2 -0
  152. package/dist/chunk-T56QNPHK-lY6QjpkL.mjs +15 -0
  153. package/dist/chunk-TLSUDHID-BP7dARSe.mjs +7 -0
  154. package/dist/chunk-TOMNU26N-BFsBBT9j.mjs +5 -0
  155. package/dist/chunk-TP4BZANS-C6KGxaUf.mjs +21 -0
  156. package/dist/chunk-TXBZCHCQ-DxPX5PCF.mjs +6 -0
  157. package/dist/chunk-U6XO7XAA-BHty90wb.mjs +3 -0
  158. package/dist/chunk-V5MWI2OL-DApVl_z4.mjs +5 -0
  159. package/dist/chunk-V7JOEXUC-DNM56rwe.mjs +207 -0
  160. package/dist/chunk-V7TAPXDL-CrGsULIH.mjs +28 -0
  161. package/dist/chunk-VAUOI2AC-BdotBBDE.mjs +2 -0
  162. package/dist/chunk-VJFXDYWH-DXnppZsu.mjs +11 -0
  163. package/dist/chunk-VOBGTVA6-_4QbVbSJ.mjs +7 -0
  164. package/dist/chunk-VR4S4FIN-RUJ5PgRH.mjs +2 -0
  165. package/dist/chunk-VYOJP4TV-DG_cm0JM.mjs +14 -0
  166. package/dist/chunk-WKFATFPP-DygaP6No.mjs +5 -0
  167. package/dist/chunk-WYO6CB5R-DN1R0VLx.mjs +130 -0
  168. package/dist/chunk-X2AJGDEF-BXjUENXL.mjs +2 -0
  169. package/dist/chunk-X2AJGDEF-ivzQBp_p.mjs +2 -0
  170. package/dist/chunk-XKQRETAK-CYJSOFLN.mjs +2 -0
  171. package/dist/chunk-XKWWSDBF-BTj39eCO.mjs +37 -0
  172. package/dist/chunk-XVDPCNWR-BSVT7Ttz.mjs +12 -0
  173. package/dist/chunk-XXDRQBXY-D1gFTzjI.mjs +2 -0
  174. package/dist/chunk-Y2CYZVJY-acXC9Sbb.mjs +2 -0
  175. package/dist/chunk-YMMW5UAP-CE-EQ2Is.mjs +33 -0
  176. package/dist/chunk-YOTPTUD7-63S9b4Z2.mjs +2 -0
  177. package/dist/chunk-YTNYSM6T-DFPh_641.mjs +12 -0
  178. package/dist/chunk-YULBWSET-B6FKJjk9.mjs +14 -0
  179. package/dist/chunk-Z6LRHWXI-BCgawaNX.mjs +14 -0
  180. package/dist/chunk-Z7JVV2SM-CTUpikzI.mjs +12 -0
  181. package/dist/chunk-ZGVPDNZ5-CyyHBEs2.mjs +63 -0
  182. package/dist/chunk-ZIRB5QZD-K23GvNu-.mjs +39 -0
  183. package/dist/chunk-ZZO3UDB3-MiEiJy8J.mjs +100 -0
  184. package/dist/classDiagram-OUVF2IWQ-0ApI9cDS.mjs +2 -0
  185. package/dist/classDiagram-v2-EOCWNBFH-DfQYJWNe.mjs +2 -0
  186. package/dist/clear-5CZ5X4YR-9EZyt4MH.mjs +2 -0
  187. package/dist/clear-5CZ5X4YR-BICGLF_r.mjs +1 -0
  188. package/dist/cli.mjs +22 -22
  189. package/dist/column-WLPMMSTS-D0I9TpQ2.mjs +1 -0
  190. package/dist/column-WLPMMSTS-Do8HgL6q.mjs +8 -0
  191. package/dist/comm-5SLSESQG-0igXzBnl.mjs +12 -0
  192. package/dist/comm-5SLSESQG-D2Rs9Jmo.mjs +1 -0
  193. package/dist/constants-C3InsrBS.mjs +2 -0
  194. package/dist/cose-bilkent-JH36ORCC-B1gjUwU3.mjs +2 -0
  195. package/dist/cp-XOYR4ABJ-CpnwcT2f.mjs +8 -0
  196. package/dist/cp-XOYR4ABJ-OfwEEWhR.mjs +1 -0
  197. package/dist/curl-47BFPSFW-Ko1BcK_R.mjs +26 -0
  198. package/dist/cut-OPC3VAGB-BAhJz0Qh.mjs +1 -0
  199. package/dist/cut-OPC3VAGB-nJAw1cEp.mjs +6 -0
  200. package/dist/cynefin-VYW2F7L2-C-aICrN-.mjs +1 -0
  201. package/dist/cynefinDiagram-TSTJHNR4-CoESbhp4.mjs +63 -0
  202. package/dist/cytoscape.esm-D6l9Lhue.mjs +332 -0
  203. package/dist/dagre-BkPA5x_w.mjs +2 -0
  204. package/dist/dagre-VKFMJZFB-BhCtWAkc.mjs +5 -0
  205. package/dist/date-DD7FVA2V-BGJ9-l0O.mjs +1 -0
  206. package/dist/date-DD7FVA2V-W_sbdO4n.mjs +5 -0
  207. package/dist/defaultLocale-DN4qDyCE.mjs +2 -0
  208. package/dist/diagram-FQU43EPY-BdshpOzp.mjs +4 -0
  209. package/dist/diagram-G47NLZAW-Lw1fB9_w.mjs +25 -0
  210. package/dist/diagram-NH7WQ7WH-DnzwFaQq.mjs +25 -0
  211. package/dist/diagram-OA4YK3LP-BXU-URV1.mjs +31 -0
  212. package/dist/diagram-WEI45ONY-CD_Zpcvk.mjs +42 -0
  213. package/dist/diff-HJF2MPDN-CQAaA8lM.mjs +1 -0
  214. package/dist/diff-HJF2MPDN-EjmLU95d.mjs +7 -0
  215. package/dist/dirname-LEMTZZFS-BG01-R4_.mjs +1 -0
  216. package/dist/dirname-LEMTZZFS-Dg3ijqjM.mjs +5 -0
  217. package/dist/dist-CMZz8-Ge.mjs +2 -0
  218. package/dist/du-WO2ENHXQ-jqWYqk_n.mjs +8 -0
  219. package/dist/du-WO2ENHXQ-oQRVbsEF.mjs +1 -0
  220. package/dist/ebnfDiagram-CCIWWBDH-D-647A1u.mjs +2 -0
  221. package/dist/echo-O45JWWI2-BPosfKdD.mjs +1 -0
  222. package/dist/echo-O45JWWI2-gk6mEMAU.mjs +4 -0
  223. package/dist/env-5EPCWSXR-BU5zTNDV.mjs +9 -0
  224. package/dist/env-5EPCWSXR-DygzVPiG.mjs +1 -0
  225. package/dist/erDiagram-Q63AITRT-DviwoNdm.mjs +86 -0
  226. package/dist/eventmodeling-45OFAUF4-CJqJ2hnR.mjs +1 -0
  227. package/dist/execAsync-BLKHjfg7.mjs +2 -0
  228. package/dist/execAsync-C5ympCkf.mjs +2 -0
  229. package/dist/expand-DTNXU4LQ-D2bEx87V.mjs +11 -0
  230. package/dist/expand-DTNXU4LQ-XU44HrWp.mjs +1 -0
  231. package/dist/expr-YYCVMXE3-DI2glLwn.mjs +1 -0
  232. package/dist/expr-YYCVMXE3-wI0boF3e.mjs +5 -0
  233. package/dist/file-IGDTDPLG-DkYMcmTl.mjs +24 -0
  234. package/dist/file-IGDTDPLG-sPfWVy9T.mjs +1 -0
  235. package/dist/find-DH2ALKQS-B6bMjuwo.mjs +12 -0
  236. package/dist/find-DH2ALKQS-CEKaRkgJ.mjs +1 -0
  237. package/dist/flag-coverage-6JEX67RU-QmoBigPs.mjs +2 -0
  238. package/dist/flowDiagram-23GEKE2U-Dhi3SNHm.mjs +1 -0
  239. package/dist/fold-LDSORVYE-Dhx0k6vg.mjs +12 -0
  240. package/dist/fold-LDSORVYE-DumfsCQO.mjs +1 -0
  241. package/dist/fs-traced-DVpoNaQJ.mjs +12 -0
  242. package/dist/fs-traced-_QGcVmcb.mjs +1 -0
  243. package/dist/ganttDiagram-NO4QXBWP-DnN5cTGV.mjs +293 -0
  244. package/dist/getMachineId-bsd-B_NuwbXS.mjs +2 -0
  245. package/dist/getMachineId-bsd-neTWr-l3.mjs +2 -0
  246. package/dist/getMachineId-darwin-BP4aVKkL.mjs +3 -0
  247. package/dist/getMachineId-darwin-DKDl-xYO.mjs +3 -0
  248. package/dist/getMachineId-linux-Bexb2iRT.mjs +2 -0
  249. package/dist/getMachineId-linux-YTb5epZX.mjs +2 -0
  250. package/dist/getMachineId-unsupported-Ddv20ynQ.mjs +2 -0
  251. package/dist/getMachineId-unsupported-DdwXS_Q3.mjs +2 -0
  252. package/dist/getMachineId-win-BNx0EbPq.mjs +2 -0
  253. package/dist/getMachineId-win-D8cNuBNk.mjs +2 -0
  254. package/dist/git-handle-DBSzQutT.mjs +1 -0
  255. package/dist/git-handle-r3d7s3VF.mjs +10 -0
  256. package/dist/gitGraph-TEB2WS4Q-_V7TMkJv.mjs +1 -0
  257. package/dist/gitGraphDiagram-IHSO6WYX-Bs2N855t.mjs +107 -0
  258. package/dist/graphlib-DXQPHTiH.mjs +2 -0
  259. package/dist/grep-2HUTXO5U-9G7xEEms.mjs +9 -0
  260. package/dist/grep-2HUTXO5U-DG5Ulinc.mjs +1 -0
  261. package/dist/gzip-AQXSGOVS-BcGYw5wM.mjs +32 -0
  262. package/dist/gzip-AQXSGOVS-D6UYmM0C.mjs +1 -0
  263. package/dist/head-HT2B6D2J-B5ybc-my.mjs +2 -0
  264. package/dist/head-HT2B6D2J-CHIR76LI.mjs +1 -0
  265. package/dist/help-VVWX7SA5-Bb8T3djf.mjs +16 -0
  266. package/dist/help-VVWX7SA5-BbK0QLPX.mjs +1 -0
  267. package/dist/history-J4QRNGRO-5XgHJL_Q.mjs +1 -0
  268. package/dist/history-J4QRNGRO-DesXbqi2.mjs +3 -0
  269. package/dist/hostname-BK6HG2DE-Clwz043m.mjs +1 -0
  270. package/dist/hostname-BK6HG2DE-DTiGP5th.mjs +3 -0
  271. package/dist/html-to-markdown-TFCECAGV-BsVwcc4T.mjs +1 -0
  272. package/dist/html-to-markdown-TFCECAGV-DLUGt6pW.mjs +73 -0
  273. package/dist/index.d.mts +6867 -242
  274. package/dist/index.mjs +1521 -1
  275. package/dist/info-DKCQHKI2-DIsEz1l_.mjs +1 -0
  276. package/dist/infoDiagram-FWYZ7A6U-CD5T72Pd.mjs +3 -0
  277. package/dist/init-Cg1MczGq.mjs +638 -0
  278. package/dist/init-D8OKme52.mjs +2 -0
  279. package/dist/init-DnqdKHDS.mjs +1 -0
  280. package/dist/ishikawaDiagram-FXEZZL3T-CzHEtbdq.mjs +71 -0
  281. package/dist/join-GG2LDHE5-7k4Syl20.mjs +14 -0
  282. package/dist/join-GG2LDHE5-BIH_-8vD.mjs +1 -0
  283. package/dist/journeyDiagram-5HDEW3XC-BywkQV2b.mjs +140 -0
  284. package/dist/jq-LYZFFBZB-BZ4XP29I.mjs +14 -0
  285. package/dist/jq-LYZFFBZB-Dlyx6Y7w.mjs +1 -0
  286. package/dist/js-exec-VXN6TZ7U-BrugyKqi.mjs +97 -0
  287. package/dist/js-exec-VXN6TZ7U-Ds5SsewK.mjs +97 -0
  288. package/dist/kanban-definition-HUTT4EX6-DIgH0tMg.mjs +90 -0
  289. package/dist/launch-json-removal-DFF5AXyX.mjs +2 -0
  290. package/dist/lib-B2tLN_O_.mjs +2 -0
  291. package/dist/lib-DuDqLKFD.mjs +195 -0
  292. package/dist/lib-ozx_WsjS.mjs +2 -0
  293. package/dist/libesm-qUf-Au5c.mjs +14 -0
  294. package/dist/line-eTDW_zUy.mjs +2 -0
  295. package/dist/linear-Cn1royVQ.mjs +2 -0
  296. package/dist/ln-4TRFBYAT-B0hi-FAf.mjs +1 -0
  297. package/dist/ln-4TRFBYAT-DGrhTL40.mjs +9 -0
  298. package/dist/loader-4hXM3EID.mjs +1 -0
  299. package/dist/loader-CJynt8EV.mjs +2 -0
  300. package/dist/logger-DFxEUjvj.mjs +39 -0
  301. package/dist/ls-KSXFZCWH-C_kbnNdU.mjs +1 -0
  302. package/dist/ls-KSXFZCWH-GOWXktO9.mjs +28 -0
  303. package/dist/lzma-CD6C2vYw.mjs +2 -0
  304. package/dist/lzma-CG6o9sq-.mjs +2 -0
  305. package/dist/map-bDB3k8vA.mjs +2 -0
  306. package/dist/md-manager-BbSzMHHE.mjs +2 -0
  307. package/dist/md5sum-INMIK4DX-BlgGpdCD.mjs +2 -0
  308. package/dist/md5sum-INMIK4DX-DGvi_A-E.mjs +1 -0
  309. package/dist/mermaid-parser.core-uwQfwzUX.mjs +4 -0
  310. package/dist/mermaid.core-BgpKViY0.mjs +16 -0
  311. package/dist/mindmap-definition-LN4V7U3C-H3p7uT-G.mjs +97 -0
  312. package/dist/mkdir-TDEMSB6C-BVcgITXm.mjs +7 -0
  313. package/dist/mkdir-TDEMSB6C-CMOt1jIT.mjs +1 -0
  314. package/dist/mv-Z6MORUFL-CqyCV_Ze.mjs +1 -0
  315. package/dist/mv-Z6MORUFL-El0zMsEA.mjs +7 -0
  316. package/dist/nl-U5YJDM32-BO1kUpkn.mjs +1 -0
  317. package/dist/nl-U5YJDM32-Y_hGSMac.mjs +17 -0
  318. package/dist/od-VJEF2UR5-CueTpZ68.mjs +5 -0
  319. package/dist/od-VJEF2UR5-DxUGtlve.mjs +1 -0
  320. package/dist/open-browser-BgReR_t5.mjs +2 -0
  321. package/dist/ordinal-BFK2XMXf.mjs +2 -0
  322. package/dist/packet-7NZHBO7P-B64OS2eJ.mjs +1 -0
  323. package/dist/parse-worker.d.mts +6626 -1
  324. package/dist/parse-worker.mjs +1 -1
  325. package/dist/paste-7N6AFSDS-BJHZcYXH.mjs +1 -0
  326. package/dist/paste-7N6AFSDS-BnqApCW_.mjs +8 -0
  327. package/dist/path-CIoCsClp.mjs +2 -0
  328. package/dist/pegDiagram-2B236MQR-PBU61CXk.mjs +2 -0
  329. package/dist/pie-RZYD4A2V-B313HDTA.mjs +1 -0
  330. package/dist/pieDiagram-ENE6RG2P-ClZWrO6e.mjs +40 -0
  331. package/dist/preview-BnqROnAm.mjs +1 -0
  332. package/dist/preview-Dnob-x-p.mjs +3 -0
  333. package/dist/printf-CX64KX2P-841sNxew.mjs +1 -0
  334. package/dist/printf-CX64KX2P-B_vWcqAL.mjs +15 -0
  335. package/dist/public/assets/ActivityModeContent-H-D1VX7m.js +1 -0
  336. package/dist/public/assets/AgentDiffPane-B-gK5PsE.js +2 -0
  337. package/dist/public/assets/ChangedOutsideBadge-D741mWRP.js +1 -0
  338. package/dist/public/assets/DocumentContext-CIVf31K9.js +38 -0
  339. package/dist/public/assets/FeedbackForm-YmqhKCxZ.js +1 -0
  340. package/dist/public/assets/ImportSkillDialog-DQBS4ypC.js +1 -0
  341. package/dist/public/assets/ManagedArtifactProperties-CE_UbtEZ.js +1 -0
  342. package/dist/public/assets/ManagedArtifactProperties-CawqG1nH.js +2 -0
  343. package/dist/public/assets/SessionsHost-Bp7gQA1o.js +2 -0
  344. package/dist/public/assets/SettingsDialogBody-BLpulm10.js +12 -0
  345. package/dist/public/assets/SkillToolbarControls-oKXEehFt.js +1 -0
  346. package/dist/public/assets/SourceEditor-C6NdTjpn.js +1 -0
  347. package/dist/public/assets/TerminalWindowApp-DDnvJYMu.js +1 -0
  348. package/dist/public/assets/ThreadView-CGjBIs53.js +10 -0
  349. package/dist/public/assets/TimelineDiffPane-BWfU5B2x.js +2 -0
  350. package/dist/public/assets/agent-diff-store-CwO6mhOq.js +1 -0
  351. package/dist/public/assets/auth-state-cache-BBgW3LTD.js +11 -0
  352. package/dist/public/assets/comment-chips-h8GZFVHH.js +5 -0
  353. package/dist/public/assets/follow-file-CJHokzM7.js +1 -0
  354. package/dist/public/assets/index-B6VepqFk.js +2097 -0
  355. package/dist/public/assets/selection-context-iNNNmmJS.js +4 -0
  356. package/dist/public/assets/skill-actions-8q8e7e5S.js +2 -0
  357. package/dist/public/assets/typing-burst-detector-D_ygX_hf.js +8 -0
  358. package/dist/public/assets/use-activity-panel-pkBl8bMj.js +1 -0
  359. package/dist/public/assets/use-open-skill-Mk41LRxd.js +1 -0
  360. package/dist/public/assets/use-skill-directory-Dzvfx2id.js +1 -0
  361. package/dist/public/assets/use-timeline-entry-diff-Dk10Z55V.js +6 -0
  362. package/dist/public/index.html +13 -13
  363. package/dist/pwd-D4OZ7N27-C41v1g3B.mjs +1 -0
  364. package/dist/pwd-D4OZ7N27-NYST_A3S.mjs +3 -0
  365. package/dist/python3-DNGS4G3E-DaBJervu.mjs +12 -0
  366. package/dist/python3-DNGS4G3E-OzxoFG34.mjs +12 -0
  367. package/dist/quadrantDiagram-ABIIQ3AL-Z4PbVL1N.mjs +8 -0
  368. package/dist/radar-I7S5WNFK-BdiwGd2_.mjs +1 -0
  369. package/dist/railroad-3IZDKUUU-O4nBw7jb.mjs +1 -0
  370. package/dist/railroad-abnf-AHOZXSZD-CDaO5Dcu.mjs +1 -0
  371. package/dist/railroad-ebnf-EBAXGLYW-CS4l_gpR.mjs +1 -0
  372. package/dist/railroad-peg-LSFZ7HO6-bbLhALeS.mjs +1 -0
  373. package/dist/railroadDiagram-RFXS5EU6-ZSRYpY_p.mjs +2 -0
  374. package/dist/readlink-MI4GCHJF-CQlQ03aa.mjs +1 -0
  375. package/dist/readlink-MI4GCHJF-Dl1Uxmrf.mjs +6 -0
  376. package/dist/repair-launch-json-DF-pHfel.mjs +2 -0
  377. package/dist/repair-mcp-configs-Cr9jCNwk.mjs +2 -0
  378. package/dist/repair-skills-DADI6iaT.mjs +4 -0
  379. package/dist/repair-skills-DKwDAoHc.mjs +1 -0
  380. package/dist/requirementDiagram-TGXJPOKE-H6OWjjJE.mjs +85 -0
  381. package/dist/rev-XOSYPP45-BYe7prl1.mjs +1 -0
  382. package/dist/rev-XOSYPP45-D6eJxPKd.mjs +7 -0
  383. package/dist/rg-XNF3R3II-CmxxmmUf.mjs +1 -0
  384. package/dist/rg-XNF3R3II-vKB7djPZ.mjs +33 -0
  385. package/dist/rm-RTZG23RL-Bl5s9ltJ.mjs +1 -0
  386. package/dist/rm-RTZG23RL-sCMTtbxP.mjs +8 -0
  387. package/dist/rmdir-XTQXT7RK-C1ccje2_.mjs +1 -0
  388. package/dist/rmdir-XTQXT7RK-DZfv6Zfz.mjs +14 -0
  389. package/dist/rough.cjs-BGkc0Naf.mjs +2 -0
  390. package/dist/sankeyDiagram-HTMAVEWB-CtBVJJox.mjs +41 -0
  391. package/dist/sed-JAPPVBEU-C7wh6RxT.mjs +100 -0
  392. package/dist/sed-JAPPVBEU-D9bYEx2I.mjs +1 -0
  393. package/dist/seq-RN5ZUASB-CFySG-xk.mjs +1 -0
  394. package/dist/seq-RN5ZUASB-R5HjEVux.mjs +7 -0
  395. package/dist/sequenceDiagram-DBY2YBRQ-DDLm4Ak_.mjs +163 -0
  396. package/dist/server-lock-U8YDpJpq.mjs +1 -0
  397. package/dist/server-lock-aXnDVUI8.mjs +2 -0
  398. package/dist/sha1sum-VJPNLNU6-DfzpfxJ-.mjs +2 -0
  399. package/dist/sha1sum-VJPNLNU6-DgLJCjAg.mjs +1 -0
  400. package/dist/sha256sum-PI32XWXY-DZ42pgY3.mjs +1 -0
  401. package/dist/sha256sum-PI32XWXY-DrKtnAPK.mjs +2 -0
  402. package/dist/sizeCapture-X5ZJPWSS-Izaz24Pi.mjs +2 -0
  403. package/dist/skill-teardown-onVYT1VF.mjs +2 -0
  404. package/dist/sleep-VZFPZFWA-5fZFI3Vy.mjs +1 -0
  405. package/dist/sleep-VZFPZFWA-CBARUnrz.mjs +10 -0
  406. package/dist/sort-DCNRDA7U-RFl0HYBr.mjs +1 -0
  407. package/dist/sort-DCNRDA7U-vT57Mw8o.mjs +16 -0
  408. package/dist/split-SITCSYCZ-BdATfTxU.mjs +1 -0
  409. package/dist/split-SITCSYCZ-Ci_IfVPT.mjs +17 -0
  410. package/dist/sqlite3-TE5AIOTF-BIRMe0xz.mjs +1 -0
  411. package/dist/sqlite3-TE5AIOTF-BhXSdz7U.mjs +37 -0
  412. package/dist/src-BPVU4Y0o.mjs +2 -0
  413. package/dist/src-BmS3oGY4.mjs +1 -0
  414. package/dist/src-Dt5dAyFQ.mjs +2032 -0
  415. package/dist/src-TKCctdpc.mjs +348 -0
  416. package/dist/src-cRpQSbXB.mjs +1 -0
  417. package/dist/src-pUQbXiSN.mjs +20 -0
  418. package/dist/start-DQdc8wXO.mjs +4 -0
  419. package/dist/start-XIVqnuqY.mjs +1 -0
  420. package/dist/stat-BT5A227F-CEZPXJ9_.mjs +9 -0
  421. package/dist/stat-BT5A227F-Dd-OyLQQ.mjs +1 -0
  422. package/dist/stateDiagram-2N3HPSRC-pAn2bDnn.mjs +2 -0
  423. package/dist/stateDiagram-v2-6OUMAXLB-DCmVVpGm.mjs +2 -0
  424. package/dist/strings-7PLOGTPD-CiVw0Uh4.mjs +14 -0
  425. package/dist/strings-7PLOGTPD-v3qEuUEm.mjs +1 -0
  426. package/dist/swimlanes-5IMT3BWC-nSsjdSnj.mjs +2 -0
  427. package/dist/swimlanesDiagram-G3AALYLV-CdQlHesp.mjs +9 -0
  428. package/dist/tac-SJGXQ4T2-BL4Xd7y6.mjs +9 -0
  429. package/dist/tac-SJGXQ4T2-DphHfCAY.mjs +1 -0
  430. package/dist/tail-S5ULNTJU-Cfa1pDQZ.mjs +2 -0
  431. package/dist/tail-S5ULNTJU-D6qRQZwV.mjs +1 -0
  432. package/dist/tar-MZQD7NO4-HJsWmzu9.mjs +63 -0
  433. package/dist/tar-MZQD7NO4-oAQoyk28.mjs +1 -0
  434. package/dist/tee-O7VXZDCO-D95l5L5Z.mjs +3 -0
  435. package/dist/tee-O7VXZDCO-odVO6Wjw.mjs +1 -0
  436. package/dist/time-DEUO3QV2-CviQF55F.mjs +1 -0
  437. package/dist/time-DEUO3QV2-DwnT4FOS.mjs +14 -0
  438. package/dist/timeline-definition-FHXFAJF6-CnTXJoEq.mjs +121 -0
  439. package/dist/timeout-VRKMCG72-DFU5EkCe.mjs +12 -0
  440. package/dist/timeout-VRKMCG72-jeMAkAMc.mjs +1 -0
  441. package/dist/touch-DX2IJOQ4-CRX6GYeb.mjs +7 -0
  442. package/dist/touch-DX2IJOQ4-CyiMRd7b.mjs +1 -0
  443. package/dist/tr-2HXZRDSW-ByYmbFae.mjs +21 -0
  444. package/dist/tr-2HXZRDSW-CCce6lU_.mjs +1 -0
  445. package/dist/tree-LYXBS7DC-Dq6aWetx.mjs +12 -0
  446. package/dist/tree-LYXBS7DC-pAC77Hbt.mjs +1 -0
  447. package/dist/treeView-QDETBFTQ-BCAjffnq.mjs +1 -0
  448. package/dist/treemap-6X3UGDF4-Dv-54pyt.mjs +1 -0
  449. package/dist/true-WHJNXCHG-Dzdq7R5f.mjs +1 -0
  450. package/dist/true-WHJNXCHG-XC4ZnbBw.mjs +2 -0
  451. package/dist/unexpand-RGTMIGZM-B06mOUPB.mjs +1 -0
  452. package/dist/unexpand-RGTMIGZM-BL5sZ5_Z.mjs +11 -0
  453. package/dist/uniq-SUNANL47-BIgIOFSf.mjs +1 -0
  454. package/dist/uniq-SUNANL47-DBRSkw7j.mjs +5 -0
  455. package/dist/vennDiagram-L72KCM5P-CqTzYRfa.mjs +35 -0
  456. package/dist/wardley-OPB4EBWU-DSvo57UC.mjs +1 -0
  457. package/dist/wardleyDiagram-EHGQE667-WhxG-nRT.mjs +79 -0
  458. package/dist/wc-TQB3VNOX-9RyJlZXB.mjs +1 -0
  459. package/dist/wc-TQB3VNOX-DqHFY4jy.mjs +6 -0
  460. package/dist/which-XZHEH76L-CbmRVw8E.mjs +3 -0
  461. package/dist/which-XZHEH76L-SMFjHhz2.mjs +1 -0
  462. package/dist/whoami-DGKU3D2X-BDJh39KM.mjs +3 -0
  463. package/dist/whoami-DGKU3D2X-BIUooLXE.mjs +1 -0
  464. package/dist/write-project-skill-DOogyZge.mjs +56 -0
  465. package/dist/xan-UD7JYIL2-DAuAMQ0H.mjs +1 -0
  466. package/dist/xan-UD7JYIL2-DQo9f-1a.mjs +140 -0
  467. package/dist/xan-view-OW2TB7Z3-BhVOL6hm.mjs +1 -0
  468. package/dist/xan-view-OW2TB7Z3-CwG0zS53.mjs +1 -0
  469. package/dist/xargs-I6EZUCYF-C_ZtmUCd.mjs +5 -0
  470. package/dist/xargs-I6EZUCYF-INAdKqnR.mjs +1 -0
  471. package/dist/xychartDiagram-FW5EYKEG-DDE7TRrw.mjs +8 -0
  472. package/dist/yazl-BlMyAOcT.mjs +2 -0
  473. package/dist/yq-OAKYHSXH-C1fFFHD4.mjs +1 -0
  474. package/dist/yq-OAKYHSXH-COzSqY4J.mjs +288 -0
  475. package/package.json +7 -6
  476. package/dist/abnfDiagram-VRR7QNED-DQjgDcgA.mjs +0 -2
  477. package/dist/acp-harness-probe-DOXp9Wx4.mjs +0 -3
  478. package/dist/alias-JE7RI5QX-BfILuEvo.mjs +0 -1
  479. package/dist/arc-CO8jsQkL.mjs +0 -2
  480. package/dist/architecture-TIHT7OUA-CScIhnar.mjs +0 -1
  481. package/dist/architectureDiagram-ZJ3FMSHR-CkUIG8wd.mjs +0 -37
  482. package/dist/array-Cerc_8W3.mjs +0 -2
  483. package/dist/awk2-BBAGSFUB-BH8WxyhW.mjs +0 -1
  484. package/dist/banner-CIK2GwPx.mjs +0 -3
  485. package/dist/base64-4YMZCVJ5-CDuRvFBG.mjs +0 -1
  486. package/dist/basename-AA2KJYZQ-sv8gJZXS.mjs +0 -1
  487. package/dist/bash-IJWYRKFO-DKUaUgF9.mjs +0 -1
  488. package/dist/blockDiagram-677ZJIJ3-sLhYyPCr.mjs +0 -133
  489. package/dist/c4Diagram-LMCZKHZV-Cg6dfUXU.mjs +0 -11
  490. package/dist/cat-RDUMLXKC-BtNo16C3.mjs +0 -1
  491. package/dist/channel-DRk0OEK0.mjs +0 -2
  492. package/dist/chmod-SYMGL4JA-B15Xlp42.mjs +0 -1
  493. package/dist/chokidar-CVNrjmRM.mjs +0 -4
  494. package/dist/chunk-2Q5K7J3B-2Es1K_NO.mjs +0 -2
  495. package/dist/chunk-2TRDZQLB-G1LvPXqq.mjs +0 -18
  496. package/dist/chunk-32BRIVSS-ok2xg0Je.mjs +0 -2
  497. package/dist/chunk-3BS5SKQH-CFcrGLDG.mjs +0 -140
  498. package/dist/chunk-3H6UQG3A-Dx5ykWR0.mjs +0 -9
  499. package/dist/chunk-3ZUFRYJ4-DzbWfyzV.mjs +0 -2
  500. package/dist/chunk-4GTNDTRF-COTPYeV6.mjs +0 -8
  501. package/dist/chunk-4HHKTUW3-BkuKGebe.mjs +0 -3
  502. package/dist/chunk-4Q4SM6WR-i8tiQRv3.mjs +0 -5
  503. package/dist/chunk-52WLFC77-BaT5_S-q.mjs +0 -11
  504. package/dist/chunk-55VFSPNA-Ct9maI6O.mjs +0 -3
  505. package/dist/chunk-5FCAYU7R-of7BBDNL.mjs +0 -2
  506. package/dist/chunk-5HE753X5-9kILZ5Nr.mjs +0 -2
  507. package/dist/chunk-5JV3BV7I-BKVVlFxh.mjs +0 -2
  508. package/dist/chunk-5QVNJEHU-CvZ-NmqQ.mjs +0 -9
  509. package/dist/chunk-5TONJI2A-CGHpmUrS.mjs +0 -3
  510. package/dist/chunk-5V6VZH6T-DdeqP2TW.mjs +0 -2
  511. package/dist/chunk-5VM5RSS4-COK1ErrI.mjs +0 -16
  512. package/dist/chunk-62RKD26F-RtrcFE7S.mjs +0 -21
  513. package/dist/chunk-64BAICW3-0h-yIc1e.mjs +0 -2
  514. package/dist/chunk-6Z5SFZXK-C5owNg1o.mjs +0 -288
  515. package/dist/chunk-74CEPOFO--xsxhUFC.mjs +0 -23
  516. package/dist/chunk-7BUUIJ7U-_1oXd84C.mjs +0 -2
  517. package/dist/chunk-7L36YK2X-VlH7dlrD.mjs +0 -3
  518. package/dist/chunk-7TSDKFEO-BjOrsK6M.mjs +0 -2
  519. package/dist/chunk-A4HU7SVR-oMNSpej4.mjs +0 -3
  520. package/dist/chunk-A4JSPFCI-DtnWqT5O.mjs +0 -7
  521. package/dist/chunk-A65PWWJC-LctFeUxK.mjs +0 -3
  522. package/dist/chunk-A7A2DBEE-DuuhuGG1.mjs +0 -7
  523. package/dist/chunk-A7ICOL4V-CzYDHdxM.mjs +0 -14
  524. package/dist/chunk-ALLTKNUZ-BnLIZXEI.mjs +0 -6
  525. package/dist/chunk-APT7OOP2-DESh647P.mjs +0 -2
  526. package/dist/chunk-BIQX33UG-BVtPexox.mjs +0 -2
  527. package/dist/chunk-C7G6YPKG-DpNJWc2e.mjs +0 -2
  528. package/dist/chunk-CQNSW5MT-B6mAd0WS.mjs +0 -2
  529. package/dist/chunk-CYSBUYHQ-CTWbbsmm.mjs +0 -2
  530. package/dist/chunk-D4J545R4-Dy3lcp_X.mjs +0 -12
  531. package/dist/chunk-D6CWQ5DW-Dl4tJcwX.mjs +0 -6
  532. package/dist/chunk-D7MEQ3VN-B-Qyxyo5.mjs +0 -5
  533. package/dist/chunk-DBKNVD4L-Y2Mnp5lC.mjs +0 -10
  534. package/dist/chunk-DCAAORBQ-BxtVrSMT.mjs +0 -2
  535. package/dist/chunk-EEXR5ZDP-BcjEP2wd.mjs +0 -3
  536. package/dist/chunk-EIZGF4BS-DYiqM1Ss.mjs +0 -9
  537. package/dist/chunk-EMLP6XTP-AFimKO17.mjs +0 -2
  538. package/dist/chunk-EX3LRPZG-BYcqQlY8.mjs +0 -232
  539. package/dist/chunk-F23WWYKW-BuCITNd6.mjs +0 -17
  540. package/dist/chunk-FWX5IMBZ-BFNo8SGu.mjs +0 -2
  541. package/dist/chunk-GCTKCWKD-jz3yOk3f.mjs +0 -4
  542. package/dist/chunk-GOV5EKKI-IRzA9ik3.mjs +0 -10
  543. package/dist/chunk-GXVXFKBA-CGc4vqMu.mjs +0 -6
  544. package/dist/chunk-HDQ56CKY-Svz-iz8m.mjs +0 -16
  545. package/dist/chunk-HJQJAYMS-SgZmT_QE.mjs +0 -3
  546. package/dist/chunk-HJWBQKYG-BqFDM0xp.mjs +0 -6
  547. package/dist/chunk-HKLCLINH-DKx243zB.mjs +0 -63
  548. package/dist/chunk-HL6NGDO2-B9GCn41X.mjs +0 -24
  549. package/dist/chunk-HOUHSVGY-Cg_2_CUd.mjs +0 -2
  550. package/dist/chunk-HWKDQ44K-CVxg-h0V.mjs +0 -4
  551. package/dist/chunk-I57KEIP3-FVl4IVXz.mjs +0 -11
  552. package/dist/chunk-ICXQ74PX-CewdqzeE.mjs +0 -3
  553. package/dist/chunk-JG7HCLWE-BgiWVzAI.mjs +0 -3
  554. package/dist/chunk-JVPRLUMK-CH7w4zyh.mjs +0 -8
  555. package/dist/chunk-JWPE2WC7-cMhWwV9I.mjs +0 -2
  556. package/dist/chunk-K6LIBGJA-DI9ZkJey.mjs +0 -12
  557. package/dist/chunk-KEIR6QF5-BhaMJNB5.mjs +0 -176
  558. package/dist/chunk-KMEYNNUA-CabTsa7P.mjs +0 -16
  559. package/dist/chunk-KRBPSX3W-ciCGjpAL.mjs +0 -6
  560. package/dist/chunk-LL3S3NLB-r8mDpVuz.mjs +0 -2
  561. package/dist/chunk-LTZRCH7N-Cj1hz7m7.mjs +0 -32
  562. package/dist/chunk-LWEGUNWT-C3ON4AHi.mjs +0 -8
  563. package/dist/chunk-MDDMCKUK-D3MZs3FF.mjs +0 -7
  564. package/dist/chunk-MDLLFABN-DgTeOfIY.mjs +0 -73
  565. package/dist/chunk-MHTUABJP-BbSobv_U.mjs +0 -9
  566. package/dist/chunk-MIZPJHVH-CzqfuBdK.mjs +0 -8
  567. package/dist/chunk-MLXIYONF-BcM04nM_.mjs +0 -16
  568. package/dist/chunk-MOJQB5TN-CidbQQ7m.mjs +0 -89
  569. package/dist/chunk-MOZMSUNE-DTiZcqZ1.mjs +0 -2
  570. package/dist/chunk-MYE6AGBJ-B3ukegXT.mjs +0 -17
  571. package/dist/chunk-NAERJDUW-CoAYVGR3.mjs +0 -9
  572. package/dist/chunk-NCNPKYJZ-C1KcgrGe.mjs +0 -3
  573. package/dist/chunk-NUYSJFDK-sPbPxu4W.mjs +0 -8
  574. package/dist/chunk-OCLXQMOG-BdLZfp3D.mjs +0 -7
  575. package/dist/chunk-OCS6LSEM-7beNWT9m.mjs +0 -14
  576. package/dist/chunk-OGEWGWER-B-Vr80Fa.mjs +0 -2
  577. package/dist/chunk-OSBZ3O6U-DwDyo3Ly.mjs +0 -2
  578. package/dist/chunk-PBXLG62G-ww-bn-Tp.mjs +0 -9
  579. package/dist/chunk-PP6PSHAB-xKRHmmOd.mjs +0 -5
  580. package/dist/chunk-PUDLZKDR-CI0pacGF.mjs +0 -157
  581. package/dist/chunk-PXTK5WE2-Dfi2FrE5.mjs +0 -22
  582. package/dist/chunk-PYSFUGCK-BHwvxY2Q.mjs +0 -11
  583. package/dist/chunk-Q4XR5HBZ-4H-m7p0G.mjs +0 -71
  584. package/dist/chunk-QBLGF6JB-B_tvtCRO.mjs +0 -2
  585. package/dist/chunk-QCDB2VPH-DHsQu4h6.mjs +0 -7
  586. package/dist/chunk-QJ7O6ZN3-CTKdWbns.mjs +0 -6
  587. package/dist/chunk-R6QSAL5T-DA60heK6.mjs +0 -2
  588. package/dist/chunk-R7FJI6CG-BVR1ae7y.mjs +0 -2
  589. package/dist/chunk-RPNGRAAP-df7FdhI4.mjs +0 -8
  590. package/dist/chunk-RYQCIY6F-C8F82Uai.mjs +0 -2
  591. package/dist/chunk-SDNKECQQ-BuTL-ot2.mjs +0 -6
  592. package/dist/chunk-SNN4IESC-DVqEOGsL.mjs +0 -2
  593. package/dist/chunk-T56QNPHK-COZC2A_r.mjs +0 -15
  594. package/dist/chunk-TLSUDHID-DAREQN9J.mjs +0 -7
  595. package/dist/chunk-TOMNU26N-C3JZDC96.mjs +0 -5
  596. package/dist/chunk-TP4BZANS-C2Z-CHHA.mjs +0 -21
  597. package/dist/chunk-TXBZCHCQ-DOaoE5TV.mjs +0 -6
  598. package/dist/chunk-U6XO7XAA-BpjdcG5R.mjs +0 -3
  599. package/dist/chunk-V5MWI2OL-D8SKWVO_.mjs +0 -5
  600. package/dist/chunk-V7JOEXUC-CdEIYYNc.mjs +0 -207
  601. package/dist/chunk-V7TAPXDL-CQbB1mLa.mjs +0 -28
  602. package/dist/chunk-VAUOI2AC-Ds6ZNp2p.mjs +0 -2
  603. package/dist/chunk-VJFXDYWH-C7Lg-Yts.mjs +0 -11
  604. package/dist/chunk-VOBGTVA6-CKl2LR-K.mjs +0 -7
  605. package/dist/chunk-VR4S4FIN-mH-q10Uq.mjs +0 -2
  606. package/dist/chunk-VYOJP4TV-DFxaC5Uc.mjs +0 -14
  607. package/dist/chunk-WKFATFPP-R7B51gCW.mjs +0 -5
  608. package/dist/chunk-WYO6CB5R-Cg1RXhAT.mjs +0 -130
  609. package/dist/chunk-X2AJGDEF-D97qevlv.mjs +0 -2
  610. package/dist/chunk-XKQRETAK-BTmmMuta.mjs +0 -2
  611. package/dist/chunk-XKWWSDBF-BGzAOrO3.mjs +0 -37
  612. package/dist/chunk-XVDPCNWR-3ajbQWzU.mjs +0 -12
  613. package/dist/chunk-XXDRQBXY-BvbdToKZ.mjs +0 -2
  614. package/dist/chunk-Y2CYZVJY-C7FmC3Cl.mjs +0 -2
  615. package/dist/chunk-YMMW5UAP-DbBgrudQ.mjs +0 -33
  616. package/dist/chunk-YOTPTUD7-BSOqhRr-.mjs +0 -2
  617. package/dist/chunk-YTNYSM6T-CoxqCaLl.mjs +0 -12
  618. package/dist/chunk-YULBWSET-CuKhTv4j.mjs +0 -14
  619. package/dist/chunk-Z6LRHWXI-CujGXDs8.mjs +0 -14
  620. package/dist/chunk-Z7JVV2SM-CiJwkxuY.mjs +0 -12
  621. package/dist/chunk-ZGVPDNZ5-BE_qYP6z.mjs +0 -63
  622. package/dist/chunk-ZIRB5QZD-mhYZnDzb.mjs +0 -39
  623. package/dist/chunk-ZZO3UDB3-DCkJjNN2.mjs +0 -100
  624. package/dist/classDiagram-OUVF2IWQ-rKP7gcsT.mjs +0 -2
  625. package/dist/classDiagram-v2-EOCWNBFH-BoWf4tYI.mjs +0 -2
  626. package/dist/clear-5CZ5X4YR-BNXs_KRD.mjs +0 -1
  627. package/dist/column-WLPMMSTS-BrY1gQI1.mjs +0 -1
  628. package/dist/comm-5SLSESQG-aGB098lH.mjs +0 -1
  629. package/dist/constants-J4-mibQ1.mjs +0 -2
  630. package/dist/cose-bilkent-JH36ORCC-CMfIp4st.mjs +0 -2
  631. package/dist/cp-XOYR4ABJ-D0LUaMQT.mjs +0 -1
  632. package/dist/curl-47BFPSFW-d1TMPUJw.mjs +0 -26
  633. package/dist/cut-OPC3VAGB-FXZX1WQM.mjs +0 -1
  634. package/dist/cynefin-VYW2F7L2-DtazLHUs.mjs +0 -1
  635. package/dist/cynefinDiagram-TSTJHNR4-CFbt5v4d.mjs +0 -63
  636. package/dist/cytoscape.esm-Dq6ZD9GH.mjs +0 -332
  637. package/dist/dagre-CbI1Ylqw.mjs +0 -2
  638. package/dist/dagre-VKFMJZFB-BWP36rMX.mjs +0 -5
  639. package/dist/date-DD7FVA2V-7hk1aW9g.mjs +0 -1
  640. package/dist/defaultLocale-9SlCuWEL.mjs +0 -2
  641. package/dist/diagram-FQU43EPY-D2pf7IBH.mjs +0 -4
  642. package/dist/diagram-G47NLZAW-BlOXaBe6.mjs +0 -25
  643. package/dist/diagram-NH7WQ7WH-DOwRNWDI.mjs +0 -25
  644. package/dist/diagram-OA4YK3LP-uyGYHUoX.mjs +0 -31
  645. package/dist/diagram-WEI45ONY-CmW1X9Kx.mjs +0 -42
  646. package/dist/diff-HJF2MPDN-bcOaHvDo.mjs +0 -1
  647. package/dist/dirname-LEMTZZFS-RRQ5Ar_Z.mjs +0 -1
  648. package/dist/dist-BmYngy7b.mjs +0 -2
  649. package/dist/du-WO2ENHXQ-Cg71FvLi.mjs +0 -1
  650. package/dist/ebnfDiagram-CCIWWBDH-BpBYlrRH.mjs +0 -2
  651. package/dist/echo-O45JWWI2-BacOdfFs.mjs +0 -1
  652. package/dist/env-5EPCWSXR-T8XCKOX_.mjs +0 -1
  653. package/dist/erDiagram-Q63AITRT-ChoKKmxG.mjs +0 -86
  654. package/dist/eventmodeling-45OFAUF4-BIXp-P6z.mjs +0 -1
  655. package/dist/execAsync-BKp2jujj.mjs +0 -2
  656. package/dist/execAsync-BuUKdKlz.mjs +0 -2
  657. package/dist/expand-DTNXU4LQ-BD32VJaK.mjs +0 -1
  658. package/dist/expr-YYCVMXE3-CgQib9F9.mjs +0 -1
  659. package/dist/file-IGDTDPLG-BAlm5q29.mjs +0 -1
  660. package/dist/find-DH2ALKQS-z-G7VPmU.mjs +0 -1
  661. package/dist/flag-coverage-6JEX67RU-Cj_NycUm.mjs +0 -2
  662. package/dist/flowDiagram-23GEKE2U-B4VrCGdr.mjs +0 -1
  663. package/dist/fold-LDSORVYE-CDU-6eOS.mjs +0 -1
  664. package/dist/fs-traced-By5aY-RE.mjs +0 -12
  665. package/dist/fs-traced-CkLhqsEn.mjs +0 -1
  666. package/dist/ganttDiagram-NO4QXBWP-Cv7sGb-R.mjs +0 -293
  667. package/dist/getMachineId-bsd-DtFrm1Uy.mjs +0 -2
  668. package/dist/getMachineId-bsd-GFl1-Bje.mjs +0 -2
  669. package/dist/getMachineId-darwin--IR8MP8d.mjs +0 -3
  670. package/dist/getMachineId-darwin-28jQHa_N.mjs +0 -3
  671. package/dist/getMachineId-linux-BZgyplQ5.mjs +0 -2
  672. package/dist/getMachineId-linux-Bzx3S652.mjs +0 -2
  673. package/dist/getMachineId-unsupported-CyTjujlI.mjs +0 -2
  674. package/dist/getMachineId-unsupported-DuB0leRF.mjs +0 -2
  675. package/dist/getMachineId-win-BmvAZEMa.mjs +0 -2
  676. package/dist/getMachineId-win-CuOFQQ73.mjs +0 -2
  677. package/dist/git-handle-BDmbIWwd.mjs +0 -1
  678. package/dist/git-handle-BHe1p04S.mjs +0 -10
  679. package/dist/gitGraph-TEB2WS4Q-BaTdqV7-.mjs +0 -1
  680. package/dist/gitGraphDiagram-IHSO6WYX-DxsFHicP.mjs +0 -107
  681. package/dist/graphlib-DKEQBDTz.mjs +0 -2
  682. package/dist/grep-2HUTXO5U-CsEE08ya.mjs +0 -1
  683. package/dist/gzip-AQXSGOVS-CmMf6H0r.mjs +0 -1
  684. package/dist/head-HT2B6D2J-DSBJixLD.mjs +0 -1
  685. package/dist/help-VVWX7SA5-BncYWg0B.mjs +0 -1
  686. package/dist/history-J4QRNGRO-CULSDkzp.mjs +0 -1
  687. package/dist/hostname-BK6HG2DE-CaZb-T_R.mjs +0 -1
  688. package/dist/html-to-markdown-TFCECAGV-CF0t8_d3.mjs +0 -1
  689. package/dist/index-1MIt1xrM.d.mts +0 -6628
  690. package/dist/info-DKCQHKI2-BxlpeeVn.mjs +0 -1
  691. package/dist/infoDiagram-FWYZ7A6U-CbPpTq2x.mjs +0 -3
  692. package/dist/init-Buw5jj4Q.mjs +0 -2
  693. package/dist/init-DDwncQha.mjs +0 -1
  694. package/dist/init-ZOWQ1Th4.mjs +0 -643
  695. package/dist/ishikawaDiagram-FXEZZL3T-Dd5BEpOv.mjs +0 -71
  696. package/dist/join-GG2LDHE5-kABASDPB.mjs +0 -1
  697. package/dist/journeyDiagram-5HDEW3XC-W6Nbr96_.mjs +0 -140
  698. package/dist/jq-LYZFFBZB-CIwp4u6h.mjs +0 -1
  699. package/dist/js-exec-VXN6TZ7U-1yyCDQqM.mjs +0 -97
  700. package/dist/kanban-definition-HUTT4EX6-xcwe5vNg.mjs +0 -90
  701. package/dist/launch-json-removal-CcFuFFS1.mjs +0 -2
  702. package/dist/lib-BCIeHFfP.mjs +0 -2
  703. package/dist/lib-TLTWf9qr.mjs +0 -195
  704. package/dist/line-Cq-NoiNn.mjs +0 -2
  705. package/dist/linear-DPbvcrPk.mjs +0 -2
  706. package/dist/ln-4TRFBYAT-Dhr3hBr6.mjs +0 -1
  707. package/dist/loader-BcwbnY_K.mjs +0 -1
  708. package/dist/loader-ji3pPcXi.mjs +0 -2
  709. package/dist/logger-BZPV1wv8.mjs +0 -39
  710. package/dist/ls-KSXFZCWH-BEv3e7-2.mjs +0 -1
  711. package/dist/lzma-Dh_aFpqW.mjs +0 -2
  712. package/dist/map-CFzSl60r.mjs +0 -2
  713. package/dist/md-manager-B4-M0hXs.mjs +0 -2
  714. package/dist/md5sum-INMIK4DX-CJ1G9gTe.mjs +0 -1
  715. package/dist/mermaid-parser.core-DejmtVwC.mjs +0 -4
  716. package/dist/mermaid.core-CB8v9A8r.mjs +0 -16
  717. package/dist/mindmap-definition-LN4V7U3C-BiYp6fzL.mjs +0 -97
  718. package/dist/mkdir-TDEMSB6C-BY7IIkok.mjs +0 -1
  719. package/dist/mv-Z6MORUFL-C4m2WG8E.mjs +0 -1
  720. package/dist/nl-U5YJDM32-CrNZhLtI.mjs +0 -1
  721. package/dist/od-VJEF2UR5-5RFpmlxK.mjs +0 -1
  722. package/dist/open-browser-CxnOIVsL.mjs +0 -2
  723. package/dist/ordinal-D5S_JXYv.mjs +0 -2
  724. package/dist/packet-7NZHBO7P-DJoR1MQJ.mjs +0 -1
  725. package/dist/paste-7N6AFSDS-DQNANxpk.mjs +0 -1
  726. package/dist/path-D4ahAhVD.mjs +0 -2
  727. package/dist/pegDiagram-2B236MQR-DMP1ng8V.mjs +0 -2
  728. package/dist/pie-RZYD4A2V-Ba8iL0H-.mjs +0 -1
  729. package/dist/pieDiagram-ENE6RG2P-CSKXRjGQ.mjs +0 -40
  730. package/dist/preview-2rQXoRuM.mjs +0 -3
  731. package/dist/preview-MV-qHfzy.mjs +0 -1
  732. package/dist/printf-CX64KX2P-CKuJk-Cs.mjs +0 -1
  733. package/dist/public/assets/ActivityModeContent-C08FYohG.js +0 -1
  734. package/dist/public/assets/AgentDiffPane-T499-ugv.js +0 -2
  735. package/dist/public/assets/ChangedOutsideBadge-GeQfL_b-.js +0 -1
  736. package/dist/public/assets/DocumentContext-C-Lo65-_.js +0 -38
  737. package/dist/public/assets/FeedbackForm-CmdTz11F.js +0 -1
  738. package/dist/public/assets/ImportSkillDialog-ChsGV6eb.js +0 -1
  739. package/dist/public/assets/ManagedArtifactProperties-B1ZA0ofn.js +0 -2
  740. package/dist/public/assets/ManagedArtifactProperties-B_ecuboX.js +0 -1
  741. package/dist/public/assets/SessionsHost-BobZkNwc.js +0 -2
  742. package/dist/public/assets/SettingsDialogBody-COTbFRqi.js +0 -12
  743. package/dist/public/assets/SkillToolbarControls-PvRY_LHn.js +0 -1
  744. package/dist/public/assets/SourceEditor-Duqpede9.js +0 -1
  745. package/dist/public/assets/TerminalWindowApp-CgWp2eC-.js +0 -1
  746. package/dist/public/assets/ThreadView-VqdgemBS.js +0 -10
  747. package/dist/public/assets/TimelineDiffPane-DnaRcvCk.js +0 -2
  748. package/dist/public/assets/agent-diff-store-B7oQn7l7.js +0 -1
  749. package/dist/public/assets/auth-state-cache-BUYyIMUZ.js +0 -11
  750. package/dist/public/assets/comment-chips-BhvfCPCk.js +0 -5
  751. package/dist/public/assets/follow-file-CWSsUd-S.js +0 -1
  752. package/dist/public/assets/index-Dmlpu4P1.js +0 -2097
  753. package/dist/public/assets/selection-context-CSP8zK1H.js +0 -4
  754. package/dist/public/assets/skill-actions-98H3SnCL.js +0 -2
  755. package/dist/public/assets/typing-burst-detector-BOmjXV-P.js +0 -8
  756. package/dist/public/assets/use-activity-panel-BwANCYjg.js +0 -1
  757. package/dist/public/assets/use-open-skill-DCSEJ3jJ.js +0 -1
  758. package/dist/public/assets/use-skill-directory-D9S5f8By.js +0 -1
  759. package/dist/public/assets/use-timeline-entry-diff-CB_cI1yy.js +0 -6
  760. package/dist/pwd-D4OZ7N27-CSTLotxZ.mjs +0 -1
  761. package/dist/python3-DNGS4G3E-BZ5fPY5e.mjs +0 -12
  762. package/dist/quadrantDiagram-ABIIQ3AL-Do93EPf_.mjs +0 -8
  763. package/dist/radar-I7S5WNFK-HP72Fmhl.mjs +0 -1
  764. package/dist/railroad-3IZDKUUU-DC3PWo_6.mjs +0 -1
  765. package/dist/railroad-abnf-AHOZXSZD-Vgpa9_KI.mjs +0 -1
  766. package/dist/railroad-ebnf-EBAXGLYW-B4SmMMsT.mjs +0 -1
  767. package/dist/railroad-peg-LSFZ7HO6-DLlDiUuB.mjs +0 -1
  768. package/dist/railroadDiagram-RFXS5EU6-BBHONGQu.mjs +0 -2
  769. package/dist/readlink-MI4GCHJF-V9fwXBrg.mjs +0 -1
  770. package/dist/repair-launch-json-Cq9ghST3.mjs +0 -2
  771. package/dist/repair-mcp-configs-DY0FS2-y.mjs +0 -2
  772. package/dist/repair-skills-CkZZbtNk.mjs +0 -4
  773. package/dist/repair-skills-l9Id0gzv.mjs +0 -1
  774. package/dist/requirementDiagram-TGXJPOKE-CAGy_wFo.mjs +0 -85
  775. package/dist/rev-XOSYPP45-G2PvMYC2.mjs +0 -1
  776. package/dist/rg-XNF3R3II-CuFYIwNn.mjs +0 -1
  777. package/dist/rm-RTZG23RL-BOvMrhon.mjs +0 -1
  778. package/dist/rmdir-XTQXT7RK-Dk19R-p8.mjs +0 -1
  779. package/dist/rough.cjs-LxmwwhvT.mjs +0 -2
  780. package/dist/sankeyDiagram-HTMAVEWB-B59ayZ_U.mjs +0 -41
  781. package/dist/sed-JAPPVBEU-BUaK4riL.mjs +0 -1
  782. package/dist/seq-RN5ZUASB-D5aLn_so.mjs +0 -1
  783. package/dist/sequenceDiagram-DBY2YBRQ-BqY5gm2k.mjs +0 -163
  784. package/dist/server-lock-BleUv9m0.mjs +0 -2
  785. package/dist/server-lock-uucDARDL.mjs +0 -1
  786. package/dist/sha1sum-VJPNLNU6-DnTKth9v.mjs +0 -1
  787. package/dist/sha256sum-PI32XWXY-Z-xtGDHc.mjs +0 -1
  788. package/dist/sizeCapture-X5ZJPWSS-D7Nqbe-W.mjs +0 -2
  789. package/dist/skill-teardown-CZnemDLF.mjs +0 -2
  790. package/dist/sleep-VZFPZFWA-DcISab6N.mjs +0 -1
  791. package/dist/sort-DCNRDA7U-C1gRzOOY.mjs +0 -1
  792. package/dist/split-SITCSYCZ-D4U2N_sH.mjs +0 -1
  793. package/dist/sqlite3-TE5AIOTF-DcjYN7WW.mjs +0 -1
  794. package/dist/src-9BFQh559.mjs +0 -348
  795. package/dist/src-9I3GiOoK.mjs +0 -2032
  796. package/dist/src-BuBt_xnY.mjs +0 -2
  797. package/dist/src-Dl8P6sfz.mjs +0 -20
  798. package/dist/src-h5dDPK2z.mjs +0 -1
  799. package/dist/start-BYY0acPS.mjs +0 -1
  800. package/dist/start-C4KuZHu5.mjs +0 -4
  801. package/dist/stat-BT5A227F-B4qwqNn_.mjs +0 -1
  802. package/dist/stateDiagram-2N3HPSRC-BD1FBZi9.mjs +0 -2
  803. package/dist/stateDiagram-v2-6OUMAXLB-CqmBRdZY.mjs +0 -2
  804. package/dist/strings-7PLOGTPD-BJ6vWsQi.mjs +0 -1
  805. package/dist/swimlanes-5IMT3BWC-D2eO0gTx.mjs +0 -2
  806. package/dist/swimlanesDiagram-G3AALYLV-BiRCZWbo.mjs +0 -9
  807. package/dist/tac-SJGXQ4T2-D-bfDFKg.mjs +0 -1
  808. package/dist/tail-S5ULNTJU-CWnyTuXg.mjs +0 -1
  809. package/dist/tar-MZQD7NO4-Cx5bpVMY.mjs +0 -1
  810. package/dist/tee-O7VXZDCO-B_duU1hV.mjs +0 -1
  811. package/dist/time-DEUO3QV2-CekCKA2I.mjs +0 -1
  812. package/dist/timeline-definition-FHXFAJF6-DZHpuaV_.mjs +0 -121
  813. package/dist/timeout-VRKMCG72-DaJVXXR3.mjs +0 -1
  814. package/dist/touch-DX2IJOQ4-CZteiICw.mjs +0 -1
  815. package/dist/tr-2HXZRDSW-D4XuTGWg.mjs +0 -1
  816. package/dist/tree-LYXBS7DC-CUIzQKTG.mjs +0 -1
  817. package/dist/treeView-QDETBFTQ-C9yOsbGY.mjs +0 -1
  818. package/dist/treemap-6X3UGDF4-iowse2nY.mjs +0 -1
  819. package/dist/true-WHJNXCHG-BzxCUQFd.mjs +0 -1
  820. package/dist/unexpand-RGTMIGZM-x3XCmR3I.mjs +0 -1
  821. package/dist/uniq-SUNANL47-DpupkNiO.mjs +0 -1
  822. package/dist/vennDiagram-L72KCM5P-CGoW4QcS.mjs +0 -35
  823. package/dist/wardley-OPB4EBWU-BL1Dan_S.mjs +0 -1
  824. package/dist/wardleyDiagram-EHGQE667-DHS8jBWZ.mjs +0 -79
  825. package/dist/wc-TQB3VNOX-D8llmcL9.mjs +0 -1
  826. package/dist/which-XZHEH76L-imZgNd5x.mjs +0 -1
  827. package/dist/whoami-DGKU3D2X-CzLNG51j.mjs +0 -1
  828. package/dist/write-project-skill-WXZSbQlg.mjs +0 -56
  829. package/dist/xan-UD7JYIL2-_38Iv1cI.mjs +0 -1
  830. package/dist/xan-view-OW2TB7Z3-RT-IKMgr.mjs +0 -1
  831. package/dist/xargs-I6EZUCYF-Bu8VhXV_.mjs +0 -1
  832. package/dist/xychartDiagram-FW5EYKEG-CG0DSvm_.mjs +0 -8
  833. package/dist/yq-OAKYHSXH-BcCBaLJN.mjs +0 -1
  834. /package/dist/{expansion-VBDYWVZR-CeY6vkty.mjs → expansion-VBDYWVZR-CpX0YZMb.mjs} +0 -0
@@ -1,38 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./pdf-CvpTyCsQ.js","./preload-helper-Chd9yIcd.js"])))=>i.map(i=>d[i]);
2
- import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./preload-helper-Chd9yIcd.js";import{t as r}from"./jsx-runtime-BUgB2tll.js";import{t as i}from"./react-f2sANaYj.js";import{n as a,r as o}from"./dist-Nvb76hAm.js";import{n as s}from"./dist-PQ5KMVDh.js";import{t as c}from"./react-dom-DPxgxlDT.js";import{t as l}from"./compiler-runtime-BfE3aGVn.js";import{a as u,c as d,i as f,l as p,n as m,o as h,r as g,s as _}from"./local-menu-action-bus-DLozq_c4.js";import{t as v}from"./utils-CPqDy6Hr.js";import{t as y}from"./button-RQ5o7P7w.js";import{i as b}from"./dist-DUWYPul7.js";import{l as x,n as S}from"./dist-Bi80hc1t.js";import{i as C,n as w,t as T}from"./tooltip-x7BNUa3s.js";import{n as E,r as D,t as O}from"./collapsible-OhEmjTXw.js";import{a as k,c as A,d as j,f as M,i as N,l as P,n as F,o as I,r as L,s as R,t as z,u as B}from"./dialog-eak3pI7G.js";import{A as V,B as H,C as U,D as ee,E as te,F as W,G as ne,I as re,J as ie,M as ae,N as oe,O as se,P as ce,R as le,S as G,U as K,V as q,W as ue,X as de,Z as fe,_ as pe,b as me,c as he,d as ge,g as _e,h as J,it as ve,j as ye,k as be,m as xe,n as Se,nt as Ce,p as we,q as Te,r as Ee,rt as De,s as Oe,t as ke,tt as Ae,v as je,x as Me,y as Ne,z as Pe}from"./CodeMirrorPropInput-3TWUbzXY.js";import{a as Fe,d as Ie,i as Le,l as Re,r as ze,u as Be}from"./floating-ui.dom-C0wusa09.js";import{c as Ve,i as He,n as Ue,o as We,s as Ge,t as Ke}from"./select-CRztynyQ.js";import{t as qe}from"./switch-0kSGDL9E.js";import{$i as Je,$n as Ye,B as Xe,Bi as Ze,Br as Qe,Ci as $e,Ct as et,Di as tt,Fa as nt,Fi as rt,Fn as it,Fr as at,G as ot,Gt as st,H as ct,Hn as lt,Hr as ut,Ht as dt,Ii as ft,Ir as pt,J as mt,Ja as ht,Ji as gt,Jn as _t,Jt as vt,K as yt,Kn as bt,Kt as xt,Li as St,Ln as Ct,Lr as wt,Lt as Tt,M as Et,Mn as Dt,Mr as Ot,Ni as kt,Nn as At,Nr as jt,O as Mt,Oi as Nt,On as Pt,Or as Ft,Pa as It,Pn as Lt,Qi as Rt,Ri as zt,Rr as Bt,S as Vt,Si as Ht,So as Ut,St as Wt,Ti as Gt,Tr as Kt,Tt as qt,U as Jt,Ui as Yt,Un as Xt,Ur as Zt,Vn as Qt,W as $t,Wa as en,Wi as tn,X as nn,Xi as rn,Xr as an,Xt as on,Ya as sn,Zn as cn,_a as ln,_o as un,aa as dn,ao as fn,ar as pn,b as mn,bi as hn,bt as gn,ci as _n,cr as vn,da as yn,dr as bn,ei as xn,eo as Sn,fa as Cn,fi as wn,fr as Tn,ga as En,go as Dn,gr as On,gt as kn,ha as An,hn as jn,ht as Mn,ia as Nn,ir as Pn,is as Fn,jr as In,ki as Ln,la as Rn,ln as zn,lr as Bn,lt as Vn,ma as Hn,mr as Un,mt as Wn,na as Gn,ni as Kn,no as qn,ns as Jn,nt as Yn,o as Xn,oa as Zn,or as Qn,pi as $n,pn as er,pr as tr,pt as nr,qi as rr,qr as ir,ra as ar,ri as or,rr as sr,rs as cr,sa as lr,sn as ur,sr as dr,ta as fr,tr as pr,tt as mr,ui as hr,un as gr,ur as _r,ut as vr,w as yr,wi as br,wr as xr,x as Sr,xi as Cr,xo as wr,y as Tr,yr as Er,zo as Dr,zr as Or}from"./dist-PVtTd_Sj2.js";import{t as kr}from"./trace-api-DH580DYm.js";import{n as Ar,t as jr}from"./propagation-api-DSg7UKuw.js";import"./lib-DcrRfjuF.js";import{t as Mr}from"./createLucideIcon-BbftclCc.js";import{n as Nr,t as Pr}from"./git-branch-BWBPTGqT.js";import{a as Fr,i as Ir,l as Lr,n as Rr,o as zr,r as Br,t as Vr}from"./Mermaid-Cr48L9fH.js";import{t as Hr}from"./check-BLuQ2zvV.js";import{t as Ur}from"./chevron-down-DrpHBSgH.js";import{t as Wr}from"./chevron-right-BU8AeJST.js";import{n as Gr,r as Kr,t as qr}from"./CopyButton-DysciFW5.js";import{i as Jr,o as Yr,r as Xr,s as Zr}from"./prop-types-DoONHMUn.js";import{t as Qr}from"./eye-DYUvwA0Z.js";import{t as $r}from"./folder-open-DoQalFip.js";import{t as ei}from"./hash-BZXl_HqD.js";import{t as ti}from"./info-Jj1j2YxC.js";import{t as ni}from"./loader-circle-Coob8S41.js";import{t as ri}from"./minus-DPAjfzCa.js";import{t as ii}from"./paperclip-9gdTBktj.js";import{t as ai}from"./trash-2-BSr7FcE8.js";import{t as oi}from"./triangle-alert-DNTyNeem.js";import{t as si}from"./x-COTyTduF.js";import{n as ci}from"./dist-CEwo98ia.js";import{t as li}from"./input-BKUcczSW.js";import{t as Y}from"./dist-C7IFraT6.js";import{S as ui,a as di,d as fi,f as pi,g as mi,h as hi,m as gi,p as _i,r as vi,s as yi,x as bi}from"./doc-paths-CH8QyanF.js";import{t as xi}from"./parse-api-error-Cyn4P6OR.js";import{t as Si}from"./file-tree-rename-validation-CEz8MVWM.js";import{$ as Ci,A as wi,B as Ti,C as Ei,D as Di,F as Oi,G as ki,H as Ai,I as ji,J as Mi,L as Ni,N as Pi,O as Fi,P as Ii,R as Li,S as Ri,T as zi,U as Bi,V as Vi,W as Hi,b as Ui,d as Wi,f as Gi,g as Ki,i as qi,j as Ji,k as Yi,l as Xi,m as Zi,n as Qi,p as $i,q as ea,tt as ta,u as na,w as ra,x as ia,y as aa,z as oa}from"./navigation-targets-DKe7BSku.js";import{a as sa,d as ca,f as la,r as ua}from"./documents-events-COSAPFkC.js";import{a as X,o as da,t as fa}from"./startup-marks-BzFN1cqP.js";import{t as pa}from"./badge-B89o8Vy9.js";import{$ as ma,A as ha,B as ga,C as _a,D as va,E as ya,F as ba,G as xa,J as Sa,K as Ca,L as wa,M as Ta,N as Ea,O as Da,P as Oa,Q as ka,R as Aa,S as ja,T as Ma,V as Na,X as Pa,Y as Fa,Z as Ia,_ as La,at as Ra,b as za,c as Ba,ct as Va,d as Ha,et as Ua,f as Wa,g as Ga,h as Ka,it as qa,j as Ja,k as Ya,l as Xa,m as Za,nt as Qa,o as $a,ot as eo,p as to,q as no,rt as ro,s as io,st as ao,tt as oo,u as so,v as co,w as lo,x as uo,y as fo,z as po}from"./config-provider-B7dMDFNr.js";import{n as mo}from"./use-collab-url-TKpnPAW8.js";import{E as ho,N as go,Ot as _o,Rt as vo,X as yo,c as bo,dt as xo,f as So,ft as Co,l as wo}from"./dist-BlH6jxEE.js";import{h as To,w as Eo}from"./skills-api-qDbnaMmu.js";import{i as Do,n as Oo}from"./config-context-DNY4at5d.js";import{a as ko,i as Ao,n as jo,r as Mo}from"./cm-theme-BJSRL90r.js";import{t as No}from"./dist-DndwauQ3.js";import{n as Po}from"./dist-DJ3iQH0N.js";import{n as Fo}from"./dist-ClczuKkQ.js";import{n as Io}from"./dist-BDJLSjo2.js";import{n as Lo}from"./dist--4AcVRue.js";import{n as Ro}from"./dist-yYRRvtMr.js";import{t as zo}from"./stex-CyLY7DTo.js";import{n as Bo,r as Vo}from"./external-link-BkNoUOYg.js";(function(){var e=[`user-blocking`,`user-visible`,`background`];class t{constructor(){this.t=new MessageChannel,this.i=this.t.port2,this.l={},this.o=1,this.t.port1.onmessage=e=>this.h(e)}u(e){var t=this.o++;return this.l[t]=e,this.i.postMessage(t),t}p(e){delete this.l[e]}h(e){var t=e.data;if(t in this.l){var n=this.l[t];delete this.l[t],n()}}}function n(){return n.v||=new t,n.v}class r{constructor(e,t,n){n===void 0&&(n=0),this.k=e,this.T=null,this.C=null,this.m=!1,this._(t,n)}isIdleCallback(){return this.T===0}I(){return this.T===2}cancel(){if(!this.m)switch(this.m=!0,this.T){case 0:cancelIdleCallback(this.C);break;case 1:clearTimeout(this.C);break;case 2:n().p(this.C);break;default:throw TypeError(`Unknown CallbackType`)}}_(t,r){if(r&&r>0)return this.T=1,void(this.C=setTimeout(()=>{this.P()},r));if(!e.includes(t))throw TypeError(`Invalid task priority : `+t);t===`background`&&typeof requestIdleCallback==`function`?(this.T=0,this.C=requestIdleCallback(()=>{this.P()})):typeof MessageChannel==`function`?(this.T=2,this.C=n().u(()=>{this.P()})):(this.T=1,this.C=setTimeout(()=>{this.P()}))}P(){this.m||this.k()}}var i=0;class a{constructor(){this.j=null,this.M=null}isEmpty(){return this.j==null}push(e){if(typeof e!=`object`)throw TypeError(`Task must be an Object`);e.A=i++,this.isEmpty()?(e.N=null,this.j=e):(e.N=this.M,this.M.O=e),e.O=null,this.M=e}takeNextTask(){if(this.isEmpty())return null;var e=this.j;return this.q(e),e}merge(e,t){if(typeof t!=`function`)throw TypeError(`Must provide a selector function.`);if(e==null)throw Error(`sourceQueue cannot be null`);for(var n=this.j,r=null,i=e.j;i;){var a=i;if(i=i.O,t(a)){for(e.q(a);n&&n.A<a.A;)r=n,n=n.O;this.D(a,r),r=a}}}D(e,t){if(t!=this.M){var n=t?t.O:this.j;e.O=n,n.N=e,e.N=t,t==null?this.j=e:t.O=e}else this.push(e)}q(e){if(e==null)throw Error(`Expected task to be non-null`);e===this.j&&(this.j=e.O),e===this.M&&(this.M=this.M.N),e.O&&(e.O.N=e.N),e.N&&(e.N.O=e.O)}}class o extends Event{constructor(t,n){if(!n||!e.includes(n.previousPriority))throw TypeError(`Invalid task priority: '`+n.previousPriority+`'`);super(t),this.previousPriority=n.previousPriority}}class s extends AbortController{constructor(t){if(t===void 0&&(t={}),super(),t??={},typeof t!=`object`)throw TypeError(`'init' is not an object`);var n,r,i=t.priority===void 0?`user-visible`:t.priority;if(!e.includes(i))throw TypeError(`Invalid task priority: '`+i+`'`);this.H=i,this.R=!1,r=(n=this).signal,Object.defineProperties(r,{priority:{get:function(){return n.H},enumerable:!0},onprioritychange:{value:null,writable:!0,enumerable:!0}}),r.addEventListener(`prioritychange`,e=>{r.onprioritychange&&r.onprioritychange(e)})}setPriority(t){if(!e.includes(t))throw TypeError(`Invalid task priority: `+t);if(this.R)throw new DOMException(``,`NotAllowedError`);if(this.signal.priority!==t){this.R=!0;var n=this.H;this.H=t;var r=new o(`prioritychange`,{previousPriority:n});this.signal.dispatchEvent(r),this.R=!1}}}self.scheduler===void 0?(self.scheduler=new class{constructor(){this.S={},e.forEach(e=>{this.S[e]=[new a,new a]}),this.U=null,this.W=new WeakMap}yield(){return this.B(()=>{},{priority:`user-visible`},!0)}postTask(e,t){return this.B(e,t,!1)}B(t,n,r){if((n=Object.assign({},n)).signal!==void 0){if(n.signal===null||!(`aborted`in n.signal)||typeof n.signal.addEventListener!=`function`)return Promise.reject(TypeError(`'signal' is not a valid 'AbortSignal'`));if(n.signal&&n.signal.priority&&!e.includes(n.signal.priority))return Promise.reject(TypeError(`Invalid task priority: '`+n.signal.priority+`'`))}if(n.priority!==void 0&&(n.priority===null||!e.includes(n.priority)))return Promise.reject(TypeError(`Invalid task priority: '`+n.priority+`'`));if(n.delay===void 0&&(n.delay=0),n.delay=Number(n.delay),n.delay<0)return Promise.reject(TypeError(`'delay' must be a positive number.`));var i={callback:t,options:n,resolve:null,reject:null,hostCallback:null,abortCallback:null,onTaskCompleted:function(){this.options.signal&&this.abortCallback&&(this.options.signal.removeEventListener(`abort`,this.abortCallback),this.abortCallback=null)},onTaskAborted:function(){this.hostCallback&&=(this.hostCallback.cancel(),null),this.options.signal.removeEventListener(`abort`,this.abortCallback),this.abortCallback=null,this.reject(this.options.signal.reason)},isAborted:function(){return this.options.signal&&this.options.signal.aborted},isContinuation:r},a=new Promise((e,t)=>{i.resolve=e,i.reject=t});return this._(i),a}_(e){var t=e.options.signal;if(t){if(t.aborted)return void e.reject(t.reason);e.abortCallback=()=>{e.onTaskAborted()},t.addEventListener(`abort`,e.abortCallback)}e.options.delay>0?e.hostCallback=new r(()=>{e.hostCallback=null,this.F(e)},null,e.options.delay):(this.G(e),this.J())}F(e){this.G(e),this.U&&=(this.U.cancel(),null),this.K()}L(e){var t=this.W.get(e);if(t===void 0)throw Error(`Attempting to change priority on an unregistered signal`);if(t!==e.priority){for(var n=0;n<2;n++)this.S[e.priority][n].merge(this.S[t][n],t=>t.options.signal===e);this.W.set(e,e.priority)}}K(){this.U=null,this.V(),this.J()}J(){var{priority:e}=this.X();e!=null&&(e!==`background`&&this.U&&this.U.isIdleCallback()&&(this.U.cancel(),this.U=null),this.U||=new r(()=>{this.K()},e,0))}G(t){var n;if(!e.includes(n=t.options.priority?t.options.priority:t.options.signal&&t.options.signal.priority?t.options.signal.priority:`user-visible`))throw TypeError(`Invalid task priority: `+n);if(t.options.signal&&t.options.signal.priority){var r=t.options.signal;this.W.has(r)||(r.addEventListener(`prioritychange`,()=>{this.L(r)}),this.W.set(r,r.priority))}this.S[n][+!t.isContinuation].push(t)}V(){var e=null;do{var{priority:t,type:n}=this.X();if(t==null)return;e=this.S[t][n].takeNextTask()}while(e.isAborted());try{var r=e.callback();e.resolve(r)}catch(t){e.reject(t)}finally{e.onTaskCompleted()}}X(){for(var t=0;t<e.length;t++)for(var n=e[t],r=0;r<2;r++)if(!this.S[n][r].isEmpty())return{priority:n,type:r};return{priority:null,type:0}}},self.TaskController=s,self.TaskPriorityChangeEvent=o):self.scheduler.yield||(self.scheduler.yield=function(){return self.scheduler.postTask(()=>{},{priority:`user-blocking`})})})();var Ho=Mr(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),Uo=Mr(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),Wo=Mr(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),Go=Mr(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),Ko=Mr(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),qo=Mr(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Jo=Mr(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),Yo=Mr(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),Xo=Mr(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Zo=Mr(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Qo=Mr(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),$o=Mr(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),es=Mr(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),ts=Mr(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),ns=Mr(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),rs=Mr(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),is=Mr(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),as=Mr(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),os=Mr(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),ss=Mr(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),cs=Mr(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]),ls=Mr(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),us=Mr(`layout-panel-top`,[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}]]),ds=Mr(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),fs=Mr(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),ps=[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]],ms=Mr(`link-2`,ps),hs=Mr(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),gs=Mr(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),_s=Mr(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),vs=Mr(`message-square-warning`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]),ys=Mr(`octagon-alert`,[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]]),bs=Mr(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),xs=Mr(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),Ss=Mr(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Cs=Mr(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),ws=Mr(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Ts=Mr(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Es=Mr(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),Ds=Mr(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Os=Mr(`sigma`,[[`path`,{d:`M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2`,key:`wuwx1p`}]]),ks=Mr(`smile`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),As=Mr(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),js=Mr(`square-play`,[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}]]),Ms=Mr(`superscript`,[[`path`,{d:`m4 19 8-8`,key:`hr47gm`}],[`path`,{d:`m12 19-8-8`,key:`1dhhmo`}],[`path`,{d:`M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06`,key:`1dfcux`}]]),Ns=Mr(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),Ps=Mr(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Fs=Mr(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),Is=Mr(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),Z=r(),Q=e(i(),1),Ls=e(c(),1),$=l(),Rs=`open-knowledge:doc-panel-tab`,zs=null;function Bs(){let e=zs;return zs=null,e}function Vs(e,t=typeof window>`u`?new EventTarget:window){zs=e,t.dispatchEvent(new CustomEvent(Rs,{detail:{tab:e}}))}function Hs(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail?.tab:void 0;n&&e(n)};return t.addEventListener(Rs,n),()=>t.removeEventListener(Rs,n)}function Us(e){return e.kind===`create`?`create:${e.value}`:`tag:${e.value}`}function Ws(e){if(e.kind===`create`){let t=e.value;return Y._({id:`XPqe3B`,values:{tagValue:t}})}let t=Y._({id:`pckX1A`,values:{0:e.count}}),n=e.value;return Y._({id:`m2T1Xj`,values:{tagValue:n,uses:t}})}function Gs(e){let t=(0,$.c)(38),{items:n,query:r,selectedIndex:i,onSelect:s,onHover:c,loading:l,error:u}=e,d=l===void 0?!1:l,f=u===void 0?null:u,{_:p}=o(),m=(0,Q.useRef)(null),h=(0,Q.useId)(),g=i>=0&&i<n.length?`${h}-option-${i}`:void 0,_,v;t[0]===i?(_=t[1],v=t[2]):(_=()=>{let e=m.current;if(!e)return;let t=e.querySelectorAll(`[role="option"]`).item(i);t&&t.scrollIntoView({block:`nearest`})},v=[i],t[0]=i,t[1]=_,t[2]=v),(0,Q.useEffect)(_,v);let y=Ks;if(d){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[3]=e):e=t[3];let n;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`div`,{ref:m,role:`status`,"aria-live":`polite`,className:`w-64 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:e,onMouseDown:y,children:(0,Z.jsx)(a,{id:`a_u4ck`})}),t[4]=n):n=t[4],n}if(n.length===0){let e;if(t[5]!==p||t[6]!==f||t[7]!==r){let n=r.trim();e=f??p(n?{id:`9R7pRC`,values:{trimmed:n}}:{id:`KRJ6xh`}),t[5]=p,t[6]=f,t[7]=r,t[8]=e}else e=t[8];let n=e,i;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(i={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[9]=i):i=t[9];let a;return t[10]===n?a=t[11]:(a=(0,Z.jsx)(`div`,{ref:m,role:`status`,"aria-live":`polite`,className:`w-64 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:i,onMouseDown:y,children:n}),t[10]=n,t[11]=a),a}let b=i>=0&&i<n.length?n[i]:null,x;t[12]===p?x=t[13]:(x=p({id:`SCoBBH`}),t[12]=p,t[13]=x);let S;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(S={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[14]=S):S=t[14];let C;t[15]===b?C=t[16]:(C=b?Ws(b):``,t[15]=b,t[16]=C);let w;t[17]===C?w=t[18]:(w=(0,Z.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:C}),t[17]=C,t[18]=w);let T;t[19]===f?T=t[20]:(T=f&&(0,Z.jsx)(`div`,{className:`rounded-md px-2 py-1.5 text-xs text-amber-700 dark:text-amber-300`,children:f}),t[19]=f,t[20]=T);let E;if(t[21]!==n||t[22]!==h||t[23]!==c||t[24]!==s||t[25]!==i){let e;t[27]!==h||t[28]!==c||t[29]!==s||t[30]!==i?(e=(e,t)=>{let n=t===i,r=Us(e),o=e.kind===`create`;return(0,Z.jsxs)(`button`,{id:`${h}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,"data-testid":o?`tag-suggestion-create`:`tag-suggestion-tag-${e.value}`,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),s(e)},onPointerMove:c?()=>c(t):void 0,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`font-mono text-xs text-muted-foreground`,children:`#`}),(0,Z.jsx)(`span`,{className:`truncate font-medium flex-1`,children:e.value}),o?(0,Z.jsx)(`span`,{className:`shrink-0 rounded-sm bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-primary`,children:(0,Z.jsx)(a,{id:`isRobC`})}):(0,Z.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground tabular-nums`,children:e.count})]},r)},t[27]=h,t[28]=c,t[29]=s,t[30]=i,t[31]=e):e=t[31],E=n.map(e),t[21]=n,t[22]=h,t[23]=c,t[24]=s,t[25]=i,t[26]=E}else E=t[26];let D;return t[32]!==g||t[33]!==E||t[34]!==x||t[35]!==w||t[36]!==T?(D=(0,Z.jsxs)(`div`,{ref:m,role:`listbox`,"aria-label":x,"aria-activedescendant":g,tabIndex:-1,onMouseDown:y,className:`w-64 overflow-y-auto subtle-scrollbar rounded-lg border bg-popover p-1 shadow-md`,style:S,children:[w,T,E]}),t[32]=g,t[33]=E,t[34]=x,t[35]=w,t[36]=T,t[37]=D):D=t[37],D}function Ks(e){return e.preventDefault()}var qs=new Nn(`tagSuggestion`),Js=8,Ys=/^[a-zA-Z][\w/-]*$/;async function Xs(){let e=await fetch(`/api/tags`);if(!e.ok)throw Error(`/api/tags responded with ${e.status}`);let t=await e.json();return Array.isArray(t.tags)?t.tags:[]}function Zs(e,t){let n=t.trim(),r=n.toLowerCase(),i=n===``?e.slice():e.filter(e=>e.name.toLowerCase().includes(r));return i.sort((e,t)=>{let n=+!e.name.toLowerCase().startsWith(r),i=+!t.name.toLowerCase().startsWith(r);return n===i?t.count===e.count?e.name.localeCompare(t.name):t.count-e.count:n-i}),i}function Qs(e,t){let n=Zs(e,t).slice(0,Js).map(e=>({kind:`tag`,value:e.name,count:e.count,isLeaf:e.isLeaf})),r=t.trim();return r&&Ys.test(r)&&!e.some(e=>e.name===r)&&n.push({kind:`create`,value:r}),n}function $s(e){let{$position:t}=e,n=t.parent.textBetween(0,t.parentOffset,void 0,``).match(/(^|[\s])#([a-zA-Z][\w/-]*)?$/);if(!n)return null;let r=n[2]??``,i=t.start(),a=n[1].length;return{range:{from:i+((n.index??0)+a),to:t.pos},query:r,text:`#${r}`}}function ec(e){let t=[],n=!1,r=null,i=null;return ne({editor:e,pluginKey:qs,char:`#`,allowedPrefixes:null,findSuggestionMatch:$s,allow:q,items:async({query:e})=>{if(!n){r||=Xs();try{t=await r,i=null}catch(e){console.error(`[tag-suggestion] Failed to fetch tags:`,e),i=`Failed to load tags. Press Escape and type # again to retry, or continue typing to create a new tag.`,t=[]}finally{n=!0,r=null}}return Qs(t,e)},command:({editor:e,range:t,props:n})=>{try{let r=n.value;if(!r||!Ys.test(r))return;e.chain().focus().deleteRange(t).insertContent({type:`tag`,attrs:{value:r}}).insertContent(` `).run()}catch(e){console.error(`[tag-suggestion] command failed`,{item:n,range:t},e)}},render:()=>{let e=null,a=null,o=0,s={popup:null,stopAutoUpdate:null},c=null,l=null,u=e=>{a?.command(e)},d=e=>{o!==e&&(o=e,p(null))};function f(e,t,r){let a=t===null?!n:t;return{items:e.items,query:e.query??``,selectedIndex:o,onSelect:r,onHover:d,loading:a,error:i}}let p=t=>{!e||!a||e.updateProps(f(a,t,u))};return{onBeforeStart(t){a=t,o=0;let n=Pe(()=>a,`tag-suggestion`);s.popup=n.popup,c=n.doPosition,l=n.reveal,e=new fe(Gs,{props:f(t,!0,u),editor:t.editor}),n.popup.appendChild(e.element),s.stopAutoUpdate=n.startAutoUpdate()},onStart(e){a=e,o=0,p(null),l?.()},onUpdate(e){a=e,o=Math.min(o,Math.max(0,e.items.length-1)),p(null),c?.()},onKeyDown({event:e}){if(!a)return!1;let t=a.items;if(e.key===`ArrowDown`)return t.length===0?!1:(o=(o+1)%t.length,p(null),!0);if(e.key===`ArrowUp`)return t.length===0?!1:(o=(o-1+t.length)%t.length,p(null),!0);if(e.key===`Enter`||e.key===`Tab`){let e=t[o];if(e)return a.command(e),!0;let n=(a.query??``).trim();return n&&Ys.test(n)?(a.command({kind:`create`,value:n}),!0):!1}return e.key,!1},onExit(){H(s),c=null,l=null,e?.destroy(),e=null,a=null,o=0,t=[],i=null,n=!1,r=null}}}})}var tc=new Map([[$r,`<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"/>`],[ve,`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/>`],[Ce,`<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/>`],[Ce,`<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/>`],[rs,`<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/>`],[De,`<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M7 3v18"/><path d="M3 7.5h4"/><path d="M3 12h18"/><path d="M3 16.5h4"/><path d="M17 3v18"/><path d="M17 7.5h4"/><path d="M17 16.5h4"/>`],[Ae,`<path d="M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"/><path d="M16 9a5 5 0 0 1 0 6"/><path d="M19.364 18.364a9 9 0 0 0 0-12.728"/>`],[si,`<path d="M18 6 6 18"/><path d="m6 6 12 12"/>`]]),nc=new Map;function rc(e){let t=nc.get(e);if(t!==void 0)return t;let n=`<svg xmlns="http://www.w3.org/2000/svg" width="0.75rem" height="0.75rem" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${tc.get(e)??tc.get(ve)}</svg>`;return nc.set(e,n),n}var ic=`0 0 32 32`,ac=`M26.7075 10.2925L19.7075 3.2925C19.6146 3.19967 19.5042 3.12605 19.3829 3.07586C19.2615 3.02568 19.1314 2.9999 19 3H7C6.46957 3 5.96086 3.21071 5.58579 3.58579C5.21071 3.96086 5 4.46957 5 5V14C5 14.2652 5.10536 14.5196 5.29289 14.7071C5.48043 14.8946 5.73478 15 6 15C6.26522 15 6.51957 14.8946 6.70711 14.7071C6.89464 14.5196 7 14.2652 7 14V5H18V11C18 11.2652 18.1054 11.5196 18.2929 11.7071C18.4804 11.8946 18.7348 12 19 12H25V28C25 28.2652 25.1054 28.5196 25.2929 28.7071C25.4804 28.8946 25.7348 29 26 29C26.2652 29 26.5196 28.8946 26.7071 28.7071C26.8946 28.5196 27 28.2652 27 28V11C27.0001 10.8686 26.9743 10.7385 26.9241 10.6172C26.8739 10.4958 26.8003 10.3854 26.7075 10.2925ZM20 6.41375L23.5863 10H20V6.41375ZM18 18H16C15.7348 18 15.4804 18.1054 15.2929 18.2929C15.1054 18.4804 15 18.7348 15 19V26C15 26.2652 15.1054 26.5196 15.2929 26.7071C15.4804 26.8946 15.7348 27 16 27H18C19.1935 27 20.3381 26.5259 21.182 25.682C22.0259 24.8381 22.5 23.6935 22.5 22.5C22.5 21.3065 22.0259 20.1619 21.182 19.318C20.3381 18.4741 19.1935 18 18 18ZM18 25H17V20H18C18.663 20 19.2989 20.2634 19.7678 20.7322C20.2366 21.2011 20.5 21.837 20.5 22.5C20.5 23.163 20.2366 23.7989 19.7678 24.2678C19.2989 24.7366 18.663 25 18 25ZM13 19V26C13 26.2652 12.8946 26.5196 12.7071 26.7071C12.5196 26.8946 12.2652 27 12 27C11.7348 27 11.4804 26.8946 11.2929 26.7071C11.1054 26.5196 11 26.2652 11 26V22.1725L9.31875 24.5737C9.22652 24.7053 9.10396 24.8126 8.96144 24.8868C8.81892 24.9609 8.66064 24.9996 8.5 24.9996C8.33936 24.9996 8.18108 24.9609 8.03856 24.8868C7.89604 24.8126 7.77348 24.7053 7.68125 24.5737L6 22.1725V26C6 26.2652 5.89464 26.5196 5.70711 26.7071C5.51957 26.8946 5.26522 27 5 27C4.73478 27 4.48043 26.8946 4.29289 26.7071C4.10536 26.5196 4 26.2652 4 26V19C4.00009 18.7874 4.06791 18.5804 4.19363 18.409C4.31935 18.2376 4.49642 18.1107 4.69915 18.0467C4.90188 17.9828 5.11971 17.9851 5.32104 18.0533C5.52236 18.1216 5.6967 18.2522 5.81875 18.4263L8.5 22.2563L11.1812 18.4263C11.3033 18.2522 11.4776 18.1216 11.679 18.0533C11.8803 17.9851 12.0981 17.9828 12.3008 18.0467C12.5036 18.1107 12.6807 18.2376 12.8064 18.409C12.9321 18.5804 12.9999 18.7874 13 19Z`;function oc(e){return e===`.md`||e===`.mdx`}function sc(e){switch(Dr(e)){case`image`:return rc(Ce);case`video`:return rc(De);case`audio`:return rc(Ae);default:return rc(rs)}}function cc(e){let t=(0,$.c)(7),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]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`path`,{d:ac}),t[3]=i):i=t[3];let a;return t[4]!==n||t[5]!==r?(a=(0,Z.jsx)(`svg`,{"aria-hidden":`true`,className:n,fill:`currentColor`,viewBox:ic,...r,children:i}),t[4]=n,t[5]=r,t[6]=a):a=t[6],a}function lc(e){let t=Si(e).toLowerCase();return t?oc(t)?{kind:`file`,path:e}:{kind:`file`,path:e,bodyIndexed:!1}:{kind:`folder`,path:e}}function uc(e){let t=(0,$.c)(6),{path:n,className:r,showExtensionBadge:i}=e,a;t[0]===n?a=t[1]:(a=lc(n),t[0]=n,t[1]=a);let o;return t[2]!==r||t[3]!==i||t[4]!==a?(o=(0,Z.jsx)(fc,{...a,className:r,showExtensionBadge:i}),t[2]=r,t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function dc(e){let{kind:t,bodyIndexed:n}=lc(e);if(t===`folder`)return rc($r);let r=(n===!1?Si(e):Si(e)||`.md`).toLowerCase();return oc(r)?`<svg xmlns="http://www.w3.org/2000/svg" width="0.75rem" height="0.75rem" viewBox="${ic}" fill="currentColor" aria-hidden="true"><path d="${ac}"/></svg>`:sc(r)}function fc(e){let t=(0,$.c)(25),{kind:n,path:r,docExt:i,bodyIndexed:a,className:o,showExtensionBadge:s}=e,c=s===void 0?!0:s;if(n===`folder`){let e;t[0]===o?e=t[1]:(e=v(`shrink-0`,o),t[0]=o,t[1]=e);let n;return t[2]===e?n=t[3]:(n=(0,Z.jsx)($r,{"aria-hidden":`true`,className:e,"data-file-entry-icon":`folder`}),t[2]=e,t[3]=n),n}let l;t[4]!==a||t[5]!==i||t[6]!==r?(l=a===!1?Si(r):i??(Si(r)||`.md`),t[4]=a,t[5]=i,t[6]=r,t[7]=l):l=t[7];let u=l,d,f,p,m;if(t[8]!==o||t[9]!==u||t[10]!==c){let e=u.toLowerCase(),n=Dr(e);d=c&&u&&e!==`.md`?u.slice(1).toUpperCase():null;let r=n===`image`&&`text-rose-500`,i;t[15]!==o||t[16]!==r?(i=v(o,r),t[15]=o,t[16]=r,t[17]=i):i=t[17];let a=i;f=`relative inline-flex shrink-0`,p=e||`file`,m=oc(e)?(0,Z.jsx)(cc,{className:a,"data-testid":`file-entry-icon-markdown`}):n===`image`?(0,Z.jsx)(Ce,{"aria-hidden":`true`,className:a,"data-testid":`file-entry-icon-image`}):n===`video`?(0,Z.jsx)(De,{"aria-hidden":`true`,className:a,"data-testid":`file-entry-icon-video`}):n===`audio`?(0,Z.jsx)(Ae,{"aria-hidden":`true`,className:a,"data-testid":`file-entry-icon-audio`}):(0,Z.jsx)(rs,{"aria-hidden":`true`,className:a,"data-testid":`file-entry-icon-file`}),t[8]=o,t[9]=u,t[10]=c,t[11]=d,t[12]=f,t[13]=p,t[14]=m}else d=t[11],f=t[12],p=t[13],m=t[14];let h;t[18]===d?h=t[19]:(h=d?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`-right-1 -bottom-1 absolute rounded-sm bg-background px-0.5 font-medium text-[0.5rem] text-muted-foreground leading-none`,"data-testid":`file-entry-extension-badge`,children:d}):null,t[18]=d,t[19]=h);let g;return t[20]!==f||t[21]!==p||t[22]!==m||t[23]!==h?(g=(0,Z.jsxs)(`span`,{className:f,"data-file-entry-icon":p,children:[m,h]}),t[20]=f,t[21]=p,t[22]=m,t[23]=h,t[24]=g):g=t[24],g}var pc=1,mc=.9,hc=.8,gc=.17,_c=.1,vc=.999,yc=.9999,bc=.99,xc=/[\\\/_+.#"@\[\(\{&]/,Sc=/[\\\/_+.#"@\[\(\{&]/g,Cc=/[\s-]/,wc=/[\s-]/g;function Tc(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?pc:bc;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Tc(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=pc:xc.test(e.charAt(l-1))?(d*=hc,p=e.slice(i,l-1).match(Sc),p&&i>0&&(d*=vc**+p.length)):Cc.test(e.charAt(l-1))?(d*=mc,m=e.slice(i,l-1).match(wc),m&&i>0&&(d*=vc**+m.length)):(d*=gc,i>0&&(d*=vc**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=yc)),(d<_c&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Tc(e,t,n,r,l+1,a+2,o),f*_c>d&&(d=f*_c)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Ec(e){return e.toLowerCase().replace(wc,` `)}function Dc(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Tc(e,t,Ec(e),Ec(t),0,0,{})}var Oc=`[cmdk-group=""]`,kc=`[cmdk-group-items=""]`,Ac=`[cmdk-group-heading=""]`,jc=`[cmdk-item=""]`,Mc=`${jc}:not([aria-disabled="true"])`,Nc=`cmdk-item-select`,Pc=`data-value`,Fc=(e,t,n)=>Dc(e,t,n),Ic=Q.createContext(void 0),Lc=()=>Q.useContext(Ic),Rc=Q.createContext(void 0),zc=()=>Q.useContext(Rc),Bc=Q.createContext(void 0),Vc=Q.forwardRef((e,t)=>{let n=tl(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=tl(()=>new Set),i=tl(()=>new Map),a=tl(()=>new Map),o=tl(()=>new Set),s=$c(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=S(),y=S(),b=S(),C=Q.useRef(null),w=il();el(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,T.emit()}},[u]),el(()=>{w(6,j)},[]);let T=Q.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)A(),O(),w(1,k);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(w(7,()=>{n.current.selectedItemId=M()?.id,T.emit()}),r||w(5,j),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}T.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),E=Q.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,D(t,r)),w(2,()=>{O(),T.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),w(3,()=>{A(),O(),n.current.value||k(),T.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=M();w(4,()=>{A(),t?.getAttribute(`id`)===e&&k(),T.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:C}),[]);function D(e,t){let r=s.current?.filter??Fc;return e?r(e,n.current.search,t):0}function O(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=C.current;N().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(kc);t?t.appendChild(e.parentElement===t?e:e.closest(`${kc} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${kc} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=C.current?.querySelector(`${Oc}[${Pc}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function k(){let e=N().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Pc);T.setState(`value`,e||void 0)}function A(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=D(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function j(){var e;let t=M();t&&(t.parentElement?.firstChild===t&&((e=t.closest(Oc)?.querySelector(Ac))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function M(){return C.current?.querySelector(`${jc}[aria-selected="true"]`)}function N(){return Array.from(C.current?.querySelectorAll(Mc)||[])}function P(e){let t=N()[e];t&&T.setState(`value`,t.getAttribute(Pc))}function F(e){var t;let n=M(),r=N(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&T.setState(`value`,a.getAttribute(Pc))}function I(e){let t=M()?.closest(Oc),n;for(;t&&!n;)t=e>0?Zc(t,Oc):Qc(t,Oc),n=t?.querySelector(Mc);n?T.setState(`value`,n.getAttribute(Pc)):F(e)}let L=()=>P(N().length-1),R=e=>{e.preventDefault(),e.metaKey?L():e.altKey?I(1):F(1)},z=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?I(-1):F(-1)};return Q.createElement(x.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&R(e);break;case`ArrowDown`:R(e);break;case`p`:case`k`:g&&e.ctrlKey&&z(e);break;case`ArrowUp`:z(e);break;case`Home`:e.preventDefault(),P(0);break;case`End`:e.preventDefault(),L();break;case`Enter`:{e.preventDefault();let t=M();if(t){let e=new Event(Nc);t.dispatchEvent(e)}}}}},Q.createElement(`label`,{"cmdk-label":``,htmlFor:E.inputId,id:E.labelId,style:sl},c),ol(e,e=>Q.createElement(Rc.Provider,{value:T},Q.createElement(Ic.Provider,{value:E},e))))}),Hc=Q.forwardRef((e,t)=>{let n=S(),r=Q.useRef(null),i=Q.useContext(Bc),a=Lc(),o=$c(e),s=o.current?.forceMount??i?.forceMount;el(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=rl(n,r,[e.value,e.children,r],e.keywords),l=zc(),u=nl(e=>e.value&&e.value===c.current),d=nl(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);Q.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(Nc,f),()=>t.removeEventListener(Nc,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return Q.createElement(x.div,{ref:b(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),Uc=Q.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=S(),s=Q.useRef(null),c=Q.useRef(null),l=S(),u=Lc(),d=nl(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);el(()=>u.group(o),[]),rl(o,s,[e.value,e.heading,c]);let f=Q.useMemo(()=>({id:o,forceMount:i}),[i]);return Q.createElement(x.div,{ref:b(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&Q.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),ol(e,e=>Q.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},Q.createElement(Bc.Provider,{value:f},e))))}),Wc=Q.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=Q.useRef(null),a=nl(e=>!e.search);return!n&&!a?null:Q.createElement(x.div,{ref:b(i,t),...r,"cmdk-separator":``,role:`separator`})}),Gc=Q.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=zc(),o=nl(e=>e.search),s=nl(e=>e.selectedItemId),c=Lc();return Q.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),Q.createElement(x.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Kc=Q.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=Q.useRef(null),o=Q.useRef(null),s=nl(e=>e.selectedItemId),c=Lc();return Q.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),Q.createElement(x.div,{ref:b(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},ol(e,e=>Q.createElement(`div`,{ref:b(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),qc=Q.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return Q.createElement(M,{open:n,onOpenChange:r},Q.createElement(j,{container:o},Q.createElement(B,{"cmdk-overlay":``,className:i}),Q.createElement(P,{"aria-label":e.label,"cmdk-dialog":``,className:a},Q.createElement(Vc,{ref:t,...s}))))}),Jc=Q.forwardRef((e,t)=>nl(e=>e.filtered.count===0)?Q.createElement(x.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Yc=Q.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return Q.createElement(x.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},ol(e,e=>Q.createElement(`div`,{"aria-hidden":!0},e)))}),Xc=Object.assign(Vc,{List:Kc,Item:Hc,Input:Gc,Group:Uc,Separator:Wc,Dialog:qc,Empty:Jc,Loading:Yc});function Zc(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Qc(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function $c(e){let t=Q.useRef(e);return el(()=>{t.current=e}),t}var el=typeof window>`u`?Q.useEffect:Q.useLayoutEffect;function tl(e){let t=Q.useRef();return t.current===void 0&&(t.current=e()),t}function nl(e){let t=zc(),n=()=>e(t.snapshot());return Q.useSyncExternalStore(t.subscribe,n,n)}function rl(e,t,n,r=[]){let i=Q.useRef(),a=Lc();return el(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(Pc,s),i.current=s}),i}var il=()=>{let[e,t]=Q.useState(),n=tl(()=>new Map);return el(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function al(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function ol({asChild:e,children:t},n){return e&&Q.isValidElement(t)?Q.cloneElement(al(t),{ref:t.ref},n(t.props.children)):n(t)}var sl={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function cl(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=v(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Xc,{"data-slot":`command`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ll(e){let t=(0,$.c)(36),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]):({title:s,description:c,children:n,className:r,showCloseButton:l,commandProps:i,onEscapeKeyDown:a,...o}=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=s===void 0?`Command Palette`:s,d=c===void 0?`Search for a command to run`:c,f=l===void 0?!0:l,p;t[9]===i?p=t[10]:(p=i??{},t[9]=i,t[10]=p);let m,h;t[11]===p?(m=t[12],h=t[13]):({className:m,...h}=p,t[11]=p,t[12]=m,t[13]=h);let g;t[14]===r?g=t[15]:(g=v(`top-[12vh] translate-y-0 overflow-hidden p-0`,r),t[14]=r,t[15]=g);let _;t[16]===u?_=t[17]:(_=(0,Z.jsx)(A,{className:`sr-only`,children:u}),t[16]=u,t[17]=_);let y;t[18]===d?y=t[19]:(y=(0,Z.jsx)(k,{className:`sr-only`,children:d}),t[18]=d,t[19]=y);let b;t[20]===m?b=t[21]:(b=v(`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,m),t[20]=m,t[21]=b);let x;t[22]!==n||t[23]!==h||t[24]!==b?(x=(0,Z.jsx)(cl,{className:b,...h,children:n}),t[22]=n,t[23]=h,t[24]=b,t[25]=x):x=t[25];let S;t[26]!==a||t[27]!==f||t[28]!==g||t[29]!==_||t[30]!==y||t[31]!==x?(S=(0,Z.jsxs)(N,{className:g,showCloseButton:f,onEscapeKeyDown:a,children:[_,y,x]}),t[26]=a,t[27]=f,t[28]=g,t[29]=_,t[30]=y,t[31]=x,t[32]=S):S=t[32];let C;return t[33]!==o||t[34]!==S?(C=(0,Z.jsx)(z,{...o,children:S}),t[33]=o,t[34]=S,t[35]=C):C=t[35],C}function ul(e){let t=(0,$.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(ws,{className:`size-4 shrink-0 opacity-50`}),t[3]=i):i=t[3];let a;t[4]===n?a=t[5]:(a=v(`flex w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a?(o=(0,Z.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex items-center gap-2 border-b px-3`,children:[i,(0,Z.jsx)(Xc.Input,{"data-slot":`command-input`,className:a,...r})]}),t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function dl(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=v(`max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Xc.List,{"data-slot":`command-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function fl(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(Xc.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e}),t[0]=e,t[1]=n),n}function pl(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=v(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-mono [&_[cmdk-group-heading]]:uppercase **:[[cmdk-group-heading]]:tracking-wider`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Xc.Group,{"data-slot":`command-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ml(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=v(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Xc.Item,{"data-slot":`command-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function hl(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=v(`ml-auto text-muted-foreground text-xs tracking-widest`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`span`,{"data-slot":`command-shortcut`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}async function gl(e,t){let n=null,r;try{n=await e.json()}catch(e){r=e}if(r instanceof Error&&r.name===`AbortError`)throw r;if(e.ok)return r!==void 0&&console.warn(`[parse-server-response] 2xx response with non-JSON body:`,r instanceof Error?r.message:String(r)),{ok:!0,body:r===void 0?n:null};if(r!==void 0){let t=r instanceof Error?r.message:String(r);return{ok:!1,title:`Server error (HTTP ${e.status}): ${t}`}}return{ok:!1,title:xi(n)??t}}function _l(e,t,n,r){let i=e.safeParse(t);return i.success?i.data:(console.warn(`[parse-server-response] schema drift:`,n,`bodyShape=`,typeof t==`object`&&t?Object.keys(t):typeof t,`issues=`,i.error.issues),r)}function vl(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=v(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`kbd`,{"data-slot":`kbd`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var yl=new Map,bl=null;function xl(){return da(`PREWARM_CORRELATION_WINDOW_MS`,5e3)}function Sl(){if(bl!==null)return;let e=Math.max(50,Math.floor(xl()/2));bl=setTimeout(()=>{bl=null,Cl(Date.now()),yl.size>0&&Sl()},e)}function Cl(e){let t=xl();for(let[n,r]of yl)e-r.emittedAt>=t&&(yl.delete(n),X.count(`ok/sidebar/prewarm`,{hit:!1}))}function wl(e,t,n=Date.now()){yl.has(e)&&X.count(`ok/sidebar/prewarm`,{hit:!1}),yl.set(e,{poolEventId:t,emittedAt:n}),Sl()}function Tl(e,t,n=Date.now()){let r=yl.get(e);return!r||r.poolEventId!==t||n-r.emittedAt>=xl()?!1:(yl.delete(e),X(`ok/sidebar/prewarm-clicked`,{docName:e,t:n,poolEventId:t}),X.count(`ok/sidebar/prewarm`,{hit:!0}),!0)}cr({event:Jn(`ok-branch-switched-clear-failed`),branch:Fn(),docName:Fn(),reason:Fn()});async function El(e,t){if(e.isMismatchRecycleInFlight()){console.warn(JSON.stringify({event:`ok-branch-switched-deferred-to-mismatch-recycle`,branch:t}));return}let n=[];for(let[r,i]of e.entries)i.kind===`active`&&i.persistence!==null&&n.push(i.persistence.clearData().catch(e=>{let n={event:`ok-branch-switched-clear-failed`,docName:r,branch:t,reason:e instanceof Error?e.message:String(e)};console.warn(JSON.stringify(n))}));await Promise.all(n),e.clearBufferedUpdates(),e.recycleAllEntries()}function Dl(e){let t=!1;return()=>{t?e():t=!0}}function Ol(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}async function kl(e,t=``){let n;try{n=await fetch(`${t}/api/server-info`,{signal:AbortSignal.timeout(5e3)})}catch{return}if(!n.ok)return;let r;try{r=await n.json()}catch{return}let i=qt.safeParse(r);if(!i.success){console.warn(JSON.stringify({event:`ok-server-info-schema-mismatch`,issues:i.error.issues}));return}if(e.setExpectedServerInstanceId(i.data.serverInstanceId),Va(i.data.serverInstanceId),i.data.currentBranch!==void 0&&e.compareAndUpdateObservedBranch(i.data.currentBranch)&&(El(e,i.data.currentBranch),ua(i.data.currentBranch)),i.data.currentDiskAckSVs!==void 0){let t={};for(let[e,n]of Object.entries(i.data.currentDiskAckSVs))try{t[e]=Ol(n)}catch{}e.observeDiskAckBatch(t)}}var Al=new Map,jl=new Set;function Ml(){for(let e of jl)e()}function Nl(e,t){Al.set(e,t),Ml()}function Pl(e,t){Al.get(e)===t&&(Al.delete(e),Ml())}function Fl(e){return Al.get(e)??null}function Il(e){return jl.add(e),()=>jl.delete(e)}function Ll(e){return[...new Set(e)]}function Rl(e){return{async reconcileLocalRename({renamed:t,renamedFolders:n=[],renamedAssets:r=[],additionalRemovedDocNames:i=[]}){e.captureRenameSnapshots(t);let a=e.getActivePoolDocName(),o=[];for(let{fromDocName:n,toDocName:r}of t)o.push(n),a!==r&&e.hasPooledDocument(r)&&o.push(r);o.push(...i),await Promise.all(Ll(o).map(t=>e.closeAndClear(t))),e.remapTabs({renamed:t,renamedFolders:n,renamedAssets:r})},async reconcileLocalRemoval({tabIdsToClose:t,docNamesToClear:n}){e.closeTabs(t),await Promise.all(Ll(n).map(t=>e.closeAndClear(t)))},async reconcileAuthRename({fromDocName:t,toDocName:n}){let r=e.getActivePoolDocName()===t,i=[{fromDocName:t,toDocName:n}];e.captureRenameSnapshots(i),await Promise.all([e.closeAndClear(t),e.closeAndClear(n)]),r&&e.openAndActivate(n),e.remapTabs({renamed:i,renamedFolders:[],renamedAssets:[]});let a=e.remapActiveTargetForRename(t,n);(r||a)&&e.navigateToDocument(n)},async reconcileAuthRemoval({docName:t}){let n=e.getActivePoolDocName()===t;await e.closeAndClear(t),e.removeDocumentTab(t),e.clearActiveTargetForRemoval(t),n&&e.navigateHome()}}}var zl=/[\uD800-\uDBFF]/,Bl=/[\uDC00-\uDFFF]/,Vl=(e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&zl.test(e[n-1])&&n--;r+n<e.length&&r+n<t.length&&e[e.length-r-1]===t[t.length-r-1];)r++;return r>0&&Bl.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}},Hl=(e,t)=>e>>>t|e<<32-t,Ul=e=>Hl(e,2)^Hl(e,13)^Hl(e,22),Wl=e=>Hl(e,6)^Hl(e,11)^Hl(e,25),Gl=e=>Hl(e,7)^Hl(e,18)^e>>>3,Kl=e=>Hl(e,17)^Hl(e,19)^e>>>10,ql=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Jl=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Yl=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(Jl),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=Kl(t[e-2])+t[e-7]+Gl(t[e-15])+t[e-16];let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7];for(let e=0,u,d;e<64;e++)u=l+Wl(o)+(o&s^~o&c)+ql[e]+t[e]>>>0,d=Ul(n)+(n&r^n&i^r&i)>>>0,l=c,c=s,s=o,o=a+u>>>0,a=i,i=r,r=n,n=u+d>>>0;e[0]+=n,e[1]+=r,e[2]+=i,e[3]+=a,e[4]+=o,e[5]+=s,e[6]+=c,e[7]+=l}digest(e){let t=0;for(;t+56<=e.length;){let n=0;for(;n<16&&t+3<e.length;n++)this._W[n]=e[t++]<<24|e[t++]<<16|e[t++]<<8|e[t++];if(t%64!=0){for(this._W.fill(0,n,16);t<e.length;)this._W[n]|=e[t]<<(3-t%4)*8,t++;this._W[n]|=128<<(3-t%4)*8}this._updateHash()}let n=t%64!=0;this._W.fill(0,0,16);let r=0;for(;t<e.length;r++)for(let n=3;n>=0&&t<e.length;n--)this._W[r]|=e[t++]<<n*8;n||(this._W[r-(t%4==0?0:1)]|=128<<(3-t%4)*8),this._W[14]=e.byteLength/oo,this._W[15]=e.byteLength*8,this._updateHash();let i=new Uint8Array(32);for(let e=0;e<this._H.length;e++)for(let t=0;t<4;t++)i[e*4+t]=this._H[e]>>>(3-t)*8;return i}},Xl=e=>new Yl().digest(e),Zl=new Nn(`y-sync`),Ql=new Nn(`y-undo`),$l=new Nn(`yjs-cursor`),eu=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},tu=e=>Ca(eu(Xl(xa(e)))),nu=()=>({mapping:new Map,isOMark:new Map}),ru=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!Ea(t.ds,e.id),iu=[{light:`#ecd44433`,dark:`#ecd444`}],au=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=Ra();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,Ia(t))}return e.get(n)},ou=(e,{colors:t=iu,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new uu(e,a),c=new ar({props:{editable:e=>{let t=Zl.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:Zl,state:{init:(i,a)=>({type:e,doc:e.doc,binding:s,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:t,colorMapping:n,permanentUserData:r}),apply:(e,t)=>{let n=e.getMeta(Zl);if(n!==void 0){t=Object.assign({},t);for(let e in n)t[e]=n[e]}return t.addToHistory=e.getMeta(`addToHistory`)!==!1,t.isChangeOrigin=n!==void 0&&!!n.isChangeOrigin,t.isUndoRedoOperation=n!==void 0&&!!n.isChangeOrigin&&!!n.isUndoRedoOperation,s.prosemirrorView!==null&&n!==void 0&&(n.snapshot!=null||n.prevSnapshot!=null)&&ga(0,()=>{s.prosemirrorView!=null&&(n.restore==null?s._renderSnapshot(n.snapshot,n.prevSnapshot,t):(s._renderSnapshot(n.snapshot,n.snapshot,t),delete t.restore,delete t.snapshot,delete t.prevSnapshot,s.mux(()=>{s._prosemirrorChanged(s.prosemirrorView.state.doc)})))}),t}},view:e=>(s.initView(e),a??s._forceRerender(),i(),{update:()=>{let t=c.getState(e.state);if(t.snapshot==null&&t.prevSnapshot==null&&(o||e.state.doc.content.findDiffStart(e.state.doc.type.createAndFill().content)!==null)){if(o=!0,t.addToHistory===!1&&!t.isChangeOrigin){let t=Ql.getState(e.state),n=t&&t.undoManager;n&&n.stopCapturing()}s.mux(()=>{t.doc.transact(n=>{n.meta.set(`addToHistory`,t.addToHistory),s._prosemirrorChanged(e.state.doc)},Zl)})}},destroy:()=>{s.destroy()}})});return c},su=(e,t,n)=>{if(t!==null&&t.anchor!==null&&t.head!==null)if(t.type===`all`)e.setSelection(new fr(e.doc));else if(t.type===`node`){let r=Hu(n.doc,n.type,t.anchor,n.mapping);e.setSelection(cu(e,r))}else{let r=Hu(n.doc,n.type,t.anchor,n.mapping),i=Hu(n.doc,n.type,t.head,n.mapping);r!==null&&i!==null&&e.setSelection(lr.between(e.doc.resolve(r),e.doc.resolve(i)))}},cu=(e,t)=>{let n=e.doc.resolve(t);return n.nodeAfter?Gn.create(e.doc,t):lr.near(n)},lu=(e,t)=>({type:t.selection.jsonID,anchor:Bu(t.selection.anchor,e.type,e.mapping),head:Bu(t.selection.head,e.type,e.mapping)}),uu=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=le(),this.mapping=t,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=lu(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta(`addToHistory`,!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(no&&this._domSelectionInView===null&&(ga(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){let e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;let t=this.prosemirrorView._root.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),t.getClientRects().length===0&&t.startContainer&&t.collapsed&&t.selectNodeContents(t.startContainer);let n=t.getBoundingClientRect(),r=Na.documentElement;return n.bottom>=0&&n.right>=0&&n.left<=(window.innerWidth||r.clientWidth||0)&&n.top<=(window.innerHeight||r.clientHeight||0)}renderSnapshot(e,t){t||=va(_a(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(Zl,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>fu(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ln(An.from(e),0,0));t.setMeta(Zl,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(t)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{let e=this.beforeTransactionSelection===null?this.prosemirrorView.state.selection:null,t=this.type.toArray().map(e=>fu(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ln(An.from(t),0,0));if(e){let t=ro(Qa(e.anchor,0),n.doc.content.size),r=ro(Qa(e.head,0),n.doc.content.size);n.setSelection(lr.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(Zl,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=wa(this.doc),e instanceof Uint8Array||t instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&Ua(),r=new Ha({gc:!1}),za(r,t),t=wa(r),za(r,e),e=wa(r),i._item===null){let e=Array.from(this.doc.share.keys()).find(e=>this.doc.share.get(e)===this.type);i=r.getXmlFragment(e)}else{let e=r.store.clients.get(i._item.id.client)??[];i=e[Ja(e,i._item.id.clock)].content.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let a=n.permanentUserData;a&&a.dss.forEach(e=>{ba(r,e,e=>{})});let o=(e,t)=>{let r=e===`added`?a.getUserByClientId(t.client):a.getUserByDeletedId(t);return{user:r,type:e,color:au(n.colorMapping,n.colors,r)}},s=po(i,new Za(t.ds,e.sv)).map(n=>!n._item.deleted||ru(n._item,e)||ru(n._item,t)?fu(n,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,t,o):null).filter(e=>e!==null),c=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ln(An.from(s),0,0));this.prosemirrorView.dispatch(c.setMeta(Zl,{isChangeOrigin:!0}))},Zl)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=Zl.getState(this.prosemirrorView.state);if(e.length===0||n.snapshot!=null||n.prevSnapshot!=null){this.renderSnapshot(n.snapshot,n.prevSnapshot);return}this.mux(()=>{let e=(e,t)=>this.mapping.delete(t);ba(t,t.deleteSet,e=>{if(e.constructor===Wa){let t=e.content.type;t&&this.mapping.delete(t)}}),t.changed.forEach(e),t.changedParentTypes.forEach(e);let n=this.type.toArray().map(e=>du(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ln(An.from(n),0,0));su(r,this.beforeTransactionSelection,this),r=r.setMeta(Zl,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof Ka}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&r.scrollIntoView(),this.prosemirrorView.dispatch(r)})}_prosemirrorChanged(e){this.doc.transact(()=>{Nu(this.doc,this.type,e,this),this.beforeTransactionSelection=lu(this,this.prosemirrorView.state)},Zl)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.on(`afterAllTransactions`,this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.off(`afterAllTransactions`,this.afterAllTransactions))}},du=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof La)return fu(e,t,n,r,i,a);throw ma()}return o},fu=(e,t,n,r,i,a)=>{let o=[],s=e=>{if(e instanceof La){let s=du(e,t,n,r,i,a);s!==null&&o.push(s)}else{let s=e._item.right?.content?.type;s instanceof Ga&&!s._item.deleted&&s._item.id.client===s.doc.clientID&&(e.applyDelta([{retain:e.length},...s.toDelta()]),s.doc.transact(e=>{s._item.delete(e)}));let c=pu(e,t,n,r,i,a);c!==null&&c.forEach(e=>{e!==null&&o.push(e)})}};r===void 0||i===void 0?e.toArray().forEach(s):po(e,new Za(i.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);r!==void 0&&(ru(e._item,r)?ru(e._item,i)||(s.ychange=a?a(`added`,e._item.id):{type:`added`}):s.ychange=a?a(`removed`,e._item.id):{type:`removed`});let c=Su(s),l=ju(c.marks,t),u=t.node(e.nodeName,c.plain,o,l.length?l:void 0);return n.mapping.set(e,u),u}catch(r){console.warn(`[y-prosemirror] schema.node(`+e.nodeName+`) threw:`,String(r&&r.message||r));let i=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};if(t.nodes[e.nodeName]&&t.nodes[e.nodeName].spec&&t.nodes[e.nodeName].spec.inline)i.inline++;else if(i.block++,t.nodes.rawMdxFallback)try{let i=t.node(`rawMdxFallback`,{reason:String(r&&r.message||r)},[t.text(e.nodeName)]);return n.mapping.set(e,i),i}catch(e){console.warn(`[y-prosemirror] rawMdxFallback substitution also failed:`,String(e&&e.message||e))}return n.mapping.delete(e),null}},pu=(e,t,n,r,i,a)=>{let o=[],s=e.toDelta(r,i,a);try{for(let e=0;e<s.length;e++){let n=s[e];o.push(t.text(n.insert,ju(n.attributes,t)))}}catch(e){console.warn(`[y-prosemirror] schema.text() threw:`,String(e&&e.message||e));let t=globalThis.__okYpsCounters=globalThis.__okYpsCounters||{block:0,inline:0};return t.inline++,null}return o},mu=(e,t)=>{let n=new co,r=e.map(e=>({insert:e.text,attributes:Mu(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},hu=(e,t)=>{let n=new La(e.type.name);for(let t in e.attrs){let r=e.attrs[t];r!==null&&t!==`ychange`&&n.setAttribute(t,r)}let r=Mu(e.marks||[],t);for(let e in r)n.setAttribute(xu+e,{...r[e]});return n.insert(0,yu(e).map(e=>gu(e,t))),t.mapping.set(n,e),n},gu=(e,t)=>e instanceof Array?mu(e,t):hu(e,t),_u=e=>typeof e==`object`&&!!e,vu=(e,t)=>{let n=Object.keys(e).filter(t=>e[t]!==null),r=n.length===Object.keys(t).filter(e=>t[e]!==null).length;for(let i=0;i<n.length&&r;i++){let a=n[i],o=e[a],s=t[a];r=a===`ychange`||o===s||_u(o)&&_u(s)&&vu(o,s)}return r},yu=e=>{let t=e.content.content,n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r.isText){let r=[];for(let n=t[e];e<t.length&&n.isText;n=t[++e])r.push(n);e--,n.push(r)}else n.push(r)}return n},bu=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&Fa(e.attributes||{}).length===t[n].marks.length&&Sa(e.attributes,(e,r)=>{let i=Au(r),a=t[n].marks;return a.find(e=>e.type.name===i)?vu(e,a.find(e=>e.type.name===i)?.attrs):!1}))},xu=`ymark:`,Su=e=>{let t={},n={};for(let r in e)r.startsWith(xu)?n[r.slice(6)]=e[r]:t[r]=e[r];return{plain:t,marks:n}},Cu=(e,t)=>{let n=Object.keys(e);return n.length===t.length?n.every(n=>{let r=Au(n),i=t.find(e=>e.type.name===r);return i?vu(e[n],i.attrs):!1}):!1},wu=(e,t)=>{if(e instanceof La&&!(t instanceof Array)&&Pu(e,t)){let n=yu(t),r=Su(e.getAttributes());return e._length===n.length&&Cu(r.marks,t.marks)&&vu(r.plain,t.attrs)&&e.toArray().every((e,t)=>wu(e,n[t]))}return e instanceof co&&t instanceof Array&&bu(e,t)},Tu=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),Eu=(e,t,n)=>{let r=e.toArray(),i=yu(t),a=i.length,o=r.length,s=ro(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(Tu(n.mapping.get(e),t))u=!0;else if(!wu(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(Tu(n.mapping.get(e),t))u=!0;else if(!wu(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},Du=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof Xa?t+=n.content.str:n.content instanceof Ba&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},Ou=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=Du(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,Mu(e.marks,n))})),{insert:o,remove:s,index:c}=Vl(i,a.map(e=>e.insert).join(``));e.delete(c,s),e.insert(c,o),e.applyDelta(a.map(e=>({retain:e.insert.length,attributes:e.attributes})))},ku=/(.*)(--[a-zA-Z0-9+/=]{8})$/,Au=e=>ku.exec(e)?.[1]??e,ju=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(Au(r),e[r]));return n},Mu=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=ao(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${tu(e.toJSON())}`:e.type.name]=e.attrs}}),n},Nu=(e,t,n,r)=>{if(t instanceof La&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof La){let e=t.getAttributes(),i=n.attrs;for(let n in i)i[n]===null?t.removeAttribute(n):e[n]!==i[n]&&n!==`ychange`&&t.setAttribute(n,i[n]);for(let n in e)i[n]===void 0&&!n.startsWith(xu)&&t.removeAttribute(n);let a=Mu(n.marks||[],r);for(let n in a){let r=e[xu+n];(r===void 0||!vu(r,a[n]))&&t.setAttribute(xu+n,{...a[n]})}for(let n in e)n.startsWith(xu)&&a[n.slice(6)]===void 0&&t.removeAttribute(n)}let i=yu(n),a=i.length,o=t.toArray(),s=o.length,c=ro(a,s),l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!Tu(r.mapping.get(e),t))if(wu(e,t))r.mapping.set(e,t);else break}for(;u+l+1<c;u++){let e=o[s-u-1],t=i[a-u-1];if(!Tu(r.mapping.get(e),t))if(wu(e,t))r.mapping.set(e,t);else break}e.transact(()=>{for(;s-l-u>0&&a-l-u>0;){let n=o[l],c=i[l],d=o[s-u-1],f=i[a-u-1];if(n instanceof co&&c instanceof Array)bu(n,c)||Ou(n,c,r),l+=1;else{let i=n instanceof La&&Pu(n,c),a=d instanceof La&&Pu(d,f);if(i&&a){let e=Eu(n,c,r),t=Eu(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(Nu(e,n,c,r),l+=1):a?(Nu(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[gu(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof co?(r.mapping.delete(o[0]),o[0].delete(0,o[0].length)):n>0&&(t.slice(l,l+n).forEach(e=>r.mapping.delete(e)),t.delete(l,n)),l+u<a){let e=[];for(let t=l;t<a-u;t++)e.push(gu(i[t],r));t.insert(l,e)}},Zl)},Pu=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name,Fu=null,Iu=class{constructor(e,t,n){this.view=e,this.key=t,this.value=n}apply(){let e=Zl.getState(this.view.state);if(e&&e.binding&&!e.binding.isDestroyed){let e=this.view.state.tr;e.setMeta(this.key,this.value),this.view.dispatch(e)}}},Lu=class e{constructor(e=[]){this.entries=e}getFirst(){return this.entries[0]}dequeueFirst(){return this.entries.shift()}isEmpty(){return this.entries.length===0}static fromViewsToUpdate(){let t=Fu;Fu=null;let n=[];return t.forEach((e,t)=>{e.forEach((e,r)=>{n.push(new Iu(t,r,e))})}),new e(n)}},Ru=(e=Lu.fromViewsToUpdate(),t=!1)=>{let n=!0;for(;!e.isEmpty();){let r=e.getFirst();try{r.apply()}catch(r){if(r instanceof RangeError){t&&n&&e.dequeueFirst(),e.isEmpty()||ga(0,()=>Ru(e,!0));return}throw r}n=!1,e.dequeueFirst()}},zu=(e,t,n)=>{Fu||(Fu=new Map,ga(0,Ru)),ao(Fu,e,eo).set(t,n)},Bu=(e,t,n)=>{if(e===0)return ya(t,0,-1);let r=t._first===null?null:t._first.content.type;for(;r!==null&&t!==r;){if(r instanceof co){if(r._length>=e)return ya(r,e,-1);if(e-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,e--;while(r!==t&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==t&&(r=r._item===null?null:r._item.next.content.type)}}else{let i=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&e<i)r=r._first.content.type,e--;else{if(e===1&&r._length===0&&i>1)return new to(r._item===null?null:r._item.id,r._item===null?Ta(r):null,null);if(e-=i,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(e===0)return r=r._item===null?r:r._item.parent,new to(r._item===null?null:r._item.id,r._item===null?Ta(r):null,null);do r=r._item.parent,e--;while(r!==t&&r._item.next===null);r!==t&&(r=r._item.next.content.type)}}}if(r===null)throw Ua();if(e===0&&r.constructor!==co&&r!==t)return Vu(r._item.parent,r._item)}return ya(t,t._length,-1)},Vu=(e,t)=>{let n=null,r=null;return e._item===null?r=Ta(e):n=lo(e._item.id.client,e._item.id.clock),new to(n,r,t.id)},Hu=(e,t,n,r)=>{let i=ja(n,e);if(i===null||i.type!==t&&!Oa(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===co)o=i.index;else if(a._item===null||!a._item.deleted){let e=a._first,t=0;for(;t<a._length&&t<i.index&&e!==null;){if(!e.deleted){let n=e.content.type;t++,n instanceof co?o+=n._length:o+=r.get(n).nodeSize}e=e.right}o+=1}for(;a!==t&&a._item!==null;){let e=a._item.parent;if(e._item===null||!e._item.deleted){o+=1;let t=e._first;for(;t!==null;){let e=t.content.type;if(e===a)break;t.deleted||(e instanceof co?o+=e._length:o+=r.get(e).nodeSize),t=t.right}}a=e}return o-1},Uu=(e,t)=>{let n=e.toArray().map(e=>fu(e,t,nu())).filter(e=>e!==null);return An.fromArray(n)},Wu=(e,t)=>t.topNodeType.create(null,Uu(e,t)),Gu=(e,t)=>{let n=nu(),r=e.toArray().map(e=>fu(e,t,n)).filter(e=>e!==null);return{doc:t.topNodeType.create(null,An.fromArray(r)),meta:n,mapping:n.mapping}},Ku=(e,t,n)=>e!==t,qu=e=>{let t=document.createElement(`span`);t.classList.add(`ProseMirror-yjs-cursor`),t.setAttribute(`style`,`border-color: ${e.color}`);let n=document.createElement(`div`);n.setAttribute(`style`,`background-color: ${e.color}`),n.insertBefore(document.createTextNode(e.name),null);let r=document.createTextNode(`⁠`),i=document.createTextNode(`⁠`);return t.insertBefore(r,null),t.insertBefore(n,null),t.insertBefore(i,null),t},Ju=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),Yu=/^#[0-9a-fA-F]{6}$/,Xu=(e,t,n,r,i)=>{let a=Zl.getState(e);if(a==null||a.doc==null||a.binding==null)return Je.create(e.doc,[]);let o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?Je.create(e.doc,[]):(t.getStates().forEach((t,c)=>{if(n(o.clientID,c,t)&&t.cursor!=null){let n=t.user||{};n.color==null?n.color=`#ffa500`:Yu.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=Hu(o,a.type,Ma(t.cursor.anchor),a.binding.mapping),u=Hu(o,a.type,Ma(t.cursor.head),a.binding.mapping);if(l!==null&&u!==null){let t=Qa(e.doc.content.size-1,0);l=ro(l,t),u=ro(u,t),s.push(Rt.widget(u,()=>r(n,c),{key:c+``,side:10}));let a=ro(l,u),o=Qa(l,u);s.push(Rt.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),Je.create(e.doc,s))},Zu=(e,{awarenessStateFilter:t=Ku,cursorBuilder:n=qu,selectionBuilder:r=Ju,getSelection:i=e=>e.selection}={},a=`cursor`)=>new ar({key:$l,state:{init(i,a){return Xu(a,e,t,n,r)},apply(i,a,o,s){let c=Zl.getState(s),l=i.getMeta($l);return c&&c.isChangeOrigin||l&&l.awarenessUpdated?Xu(s,e,t,n,r):a.map(i.mapping,i.doc)}},props:{decorations:e=>$l.getState(e)},view:t=>{let n=()=>{t.docView&&zu(t,$l,{awarenessUpdated:!0})},r=()=>{let n=Zl.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let o=i(t.state),s=Bu(o.anchor,n.type,n.binding.mapping),c=Bu(o.head,n.type,n.binding.mapping);(r.cursor==null||!uo(Ma(r.cursor.anchor),s)||!uo(Ma(r.cursor.head),c))&&e.setLocalStateField(a,{anchor:s,head:c})}else r.cursor!=null&&Hu(n.doc,n.type,Ma(r.cursor.anchor),n.binding.mapping)!==null&&e.setLocalStateField(a,null)};return e.on(`change`,n),t.dom.addEventListener(`focusin`,r),t.dom.addEventListener(`focusout`,r),{update:r,destroy:()=>{t.dom.removeEventListener(`focusin`,r),t.dom.removeEventListener(`focusout`,r),e.off(`change`,n),e.setLocalStateField(a,null)}}}}),Qu=e=>{let t=Ql.getState(e).undoManager;if(t!=null)return t.undo(),!0},$u=e=>{let t=Ql.getState(e).undoManager;if(t!=null)return t.redo(),!0},ed=new Set([`paragraph`]),td=(e,t)=>!(e instanceof Wa)||!(e.content instanceof so)||!(e.content.type instanceof Ga||e.content.type instanceof La&&t.has(e.content.type.nodeName))||e.content.type._length===0,nd=({protectedNodes:e=ed,trackedOrigins:t=[],undoManager:n=null}={})=>new ar({key:Ql,state:{init:(r,i)=>{let a=Zl.getState(i),o=n||new Ka(a.type,{trackedOrigins:new Set([Zl].concat(t)),deleteFilter:t=>td(t,e),captureTransaction:e=>e.meta.get(`addToHistory`)!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(e,t,n,r)=>{let i=Zl.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:lu(i,n),hasUndoOps:o,hasRedoOps:s}:o!==t.hasUndoOps||s!==t.hasRedoOps?Object.assign({},t,{hasUndoOps:a.undoStack.length>0,hasRedoOps:a.redoStack.length>0}):t}},view:e=>{let t=Zl.getState(e.state),n=Ql.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,Ql.getState(e.state).prevSel)}),n.on(`stack-item-popped`,({stackItem:e})=>{let n=t.binding;n&&(n.beforeTransactionSelection=e.meta.get(n)||n.beforeTransactionSelection)}),{destroy:()=>{n.destroy()}}}}),rd=new Map,id=new Set;function ad(){for(let e of id)e()}function od(e,t){rd.set(e,t),ad()}function sd(e,t){rd.get(e)===t&&(rd.delete(e),ad())}function cd(e){return rd.get(e)??null}function ld(e){return id.add(e),()=>{id.delete(e)}}var ud=new Map;function dd(e){return ud.get(e)}function fd(e,t){ud.set(e,t)}function pd(e){ud.delete(e)}var md=`open-knowledge-app`,hd=new Map,gd=new Set,_d=1024,vd=1024;function yd(){return kr.getTracer(md)}function bd(e,t,n){if(gd.has(e))return null;let r=hd.get(e);if(r)return r;if(hd.size>=vd){let e=hd.keys().next().value;if(e!==void 0){let t=hd.get(e);hd.delete(e);try{t?.span.end()}catch(e){console.warn(`[otel-spans] eviction span.end failed:`,e instanceof Error?e:String(e))}}}let i={span:yd().startSpan(`ok.cold-mount`,{attributes:{"mount.id":e,...t},startTime:n}),startTimeMs:n};return hd.set(e,i),i}function xd(e,t,n,r,i){try{let a=bd(e,n,r),o=a?kr.setSpan(Ar.active(),a.span):Ar.active();yd().startSpan(t,{attributes:{"mount.id":e,...n},startTime:r},o).end(i??Date.now())}catch(e){console.warn(`[otel-spans] emitColdMountChild failed:`,e instanceof Error?e:String(e))}}function Sd(e,t){try{let n=hd.get(e);if(n&&(hd.delete(e),n.span.end(t??Date.now())),!gd.has(e)){if(gd.size>=_d){let e=gd.values().next().value;e!==void 0&&gd.delete(e)}gd.add(e)}}catch(e){console.warn(`[otel-spans] finalizeColdMountSpan failed:`,e instanceof Error?e:String(e))}}var Cd=class extends Error{docName;constructor(e){super(`Mount aborted for "${e}"`),this.name=`MountAbortError`,this.docName=e}};function wd(){return da(`MOUNT_STALLED_THRESHOLD_MS`,1e4)}function Td(e){e.stalledHandle!==null&&(clearTimeout(e.stalledHandle),e.stalledHandle=null)}function Ed(e,t,n){if(e.stalledMarkEmitted)return;e.stalledMarkEmitted=!0;let r=n-e.createdAt;X(`ok/mount/stalled`,{docName:t,mountId:e.mountId,elapsedMs:r})}var Dd=new Map,Od=new Set;function kd(e){Od.add(e);for(let[t,n]of Dd)if(n.stalledMarkEmitted&&!n.settled)try{e(t,n.mountId)}catch{}return()=>{Od.delete(e)}}function Ad(e,t){for(let n of Od)try{n(e,t.mountId)}catch{}}var jd=!1;function Md(){typeof document>`u`||document.visibilityState===`visible`&&Fd(Date.now())}function Nd(){jd||typeof document>`u`||typeof document.addEventListener==`function`&&(document.addEventListener(`visibilitychange`,Md),jd=!0)}function Pd(){jd&&(typeof document>`u`||typeof document.removeEventListener==`function`&&(document.removeEventListener(`visibilitychange`,Md),jd=!1))}function Fd(e){let t=wd();for(let[n,r]of Dd)r.settled||r.stalledMarkEmitted||e-r.createdAt<t||(Ed(r,n,e),Ad(n,r))}function Id(e){let{docName:t,mountId:n,construct:r,sizeStats:i}=e,a=Dd.get(t);if(a)return a.promise;let o=new AbortController,s=Date.now(),c=()=>{},l=()=>{},u=new Promise((e,t)=>{c=e,l=t}),d={promise:u,rejectFn:l,controller:o,mountId:n,createdAt:s,settled:!1,resolved:!1,preMountEditor:null,stalledHandle:null,stalledMarkEmitted:!1};return d.stalledHandle=setTimeout(()=>{d.settled||(Ed(d,t,Date.now()),Ad(t,d))},wd()),o.signal.addEventListener(`abort`,()=>{d.settled||(d.settled=!0,Td(d),d.preMountEditor&&=(Bd(t,d.preMountEditor,`aborted`),null),Dd.delete(t),Dd.size===0&&Pd(),X(`ok/mount/reject`,{docName:t,mountId:d.mountId,reason:`aborted`}),l(new Cd(t)),Sd(d.mountId))}),Dd.set(t,d),Nd(),X(`ok/mount/create`,{docName:t,mountId:d.mountId}),Vd({docName:t,construct:r,sizeStats:i,entry:d,resolveFn:c,rejectFn:l}).catch(e=>{if(d.preMountEditor&&=(Bd(t,d.preMountEditor,`backstop`),null),d.settled){X(`ok/mount/post-settle-throw`,{docName:t,mountId:d.mountId,message:e instanceof Error?e.message:String(e)});return}d.settled=!0,Td(d);let n=e instanceof Error?e:Error(String(e));X(`ok/mount/reject`,{docName:t,mountId:d.mountId,reason:`unhandled-body-throw`,message:n.message}),l(n),Sd(d.mountId)}),u}function Ld(e){return Dd.get(e)?.resolved===!0}function Rd(e){return Dd.get(e)?.controller??null}function zd(e){let t=Dd.get(e);t&&(t.settled=!0,Td(t),t.preMountEditor&&=(Bd(e,t.preMountEditor,`aborted`),null),Dd.delete(e),Dd.size===0&&Pd(),X(`ok/mount/invalidate`,{docName:e,mountId:t.mountId}),Sd(t.mountId),t.controller.abort())}function Bd(e,t,n){let r=lf(t);try{t.destroy()}catch(t){X(`ok/mount/destroy-failed`,{docName:e,stage:n,message:t instanceof Error?t.message:String(t)})}r&&(r.restore=void 0)}async function Vd(e){let{docName:t,construct:n,sizeStats:r,entry:i,resolveFn:a,rejectFn:o}=e,s=document.createElement(`div`);if(Wf(t)!==void 0){let e=Of({docName:t,container:s,factory:()=>{throw Error(`mount-promise: V2 cache contract violation — factory invoked on HIT for "${t}"`)}});i.settled=!0,i.resolved=!0,Td(i),a(e);return}if(await scheduler.yield(),i.controller.signal.aborted)return;let c=null;try{c=n()}catch(e){i.settled=!0,Td(i);let n=e instanceof Error?e:Error(String(e));X(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`construct-failed`,message:n.message}),o(n),Sd(i.mountId);return}if(i.preMountEditor=c.editor,await scheduler.yield(),i.controller.signal.aborted){i.preMountEditor=null;return}try{c.editor.mount(s)}catch(e){Bd(t,c.editor,`mount-failed`),i.preMountEditor=null,i.settled=!0,Td(i);let n=e instanceof Error?e:Error(String(e));X(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`mount-failed`,message:n.message}),o(n),Sd(i.mountId);return}let l;try{l=Of({docName:t,container:s,sizeStats:r,factory:()=>c})}catch(e){Bd(t,c.editor,`v2-register-failed`),i.preMountEditor=null,i.settled=!0,Td(i);let n=e instanceof Error?e:Error(String(e));X(`ok/mount/reject`,{docName:t,mountId:i.mountId,reason:`v2-register-failed`,message:n.message}),o(n),Sd(i.mountId);return}i.preMountEditor=null,i.settled=!0,i.resolved=!0,Td(i);let u=Date.now()-i.createdAt;X(`ok/mount/resolve`,{docName:t,mountId:i.mountId,elapsedMs:u}),X.histogram(`ok/mount/resolve-elapsed-ms`,{docName:t,mountId:i.mountId},u),a(l);let d=Date.now();xd(i.mountId,`ok.mount-promise`,{"doc.name":t,elapsed_ms:u},i.createdAt,d),Sd(i.mountId,d)}function Hd(e,t){if(!t)return{kind:`absent`};if(t.getClientRects().length===0)return{kind:`unmeasurable`};let n=e.getBoundingClientRect().top;return{kind:`measured`,contentPos:t.getBoundingClientRect().top-n+e.scrollTop}}function Ud(e,t,n){if(t===null)return e;switch(n.kind){case`measured`:return n.contentPos+t;case`absent`:return e;case`unmeasurable`:return null;default:return Gd(n)}}function Wd(e){switch(e.kind){case`measured`:case`absent`:return!0;case`unmeasurable`:return!1;default:return Gd(e)}}function Gd(e){throw Error(`Unhandled AnchorMeasurement variant: ${JSON.stringify(e)}`)}function Kd(e,t){return Math.abs(e-t)<=1}function qd(e,t){return t-e>1}var Jd=1e4;function Yd(e,t,n){let r=t-n;return r<=0?0:Math.max(0,Math.min(1,e/r))}var Xd=new Map;function Zd(e,t){if(Xd.delete(e),Xd.set(e,t),Xd.size>256){let e=Xd.keys().next().value;e!==void 0&&Xd.delete(e)}}function Qd(e){return Xd.get(e)}var $d=`data-ok-body-anchor`;function ef(e){let t=e.anchor??e.container.querySelector(`[data-ok-body-anchor]`),n=Hd(e.container,t),r=n.kind===`measured`?n.contentPos:0;Zd(e.docName,{offset:e.targetScrollTop-r,mode:e.mode,fraction:Yd(e.targetScrollTop,e.container.scrollHeight,e.container.clientHeight)})}var tf=new Map;function nf(e){tf.set(e,(tf.get(e)??0)+1);let t=!1;return{release(){if(t)return;t=!0;let n=(tf.get(e)??0)-1;n>0?tf.set(e,n):tf.delete(e)}}}function rf(e){return(tf.get(e)??0)>0}var af=new Map;function of(e,t){let n=af.get(e)??new Set;return n.add(t),af.set(e,n),{release(){let n=af.get(e);n&&(n.delete(t),n.size===0&&af.delete(e))}}}function sf(e){let t=af.get(e);if(!t)return!0;for(let e of t)if(!e.yieldsToNavigation)return!1;let n=Array.from(t);for(let e of n)e.supersede();return!0}function cf(e,t){return sf(e)?(t(),!0):!1}function lf(e){try{let t=e.state;return Ql.getState(t)?.undoManager??null}catch(e){return X(`ok/cache/undo-manager-read-failed`,{message:e instanceof Error?e.message:String(e)}),null}}var uf=da(`MAX_CACHE`,10),df=da(`VIEW_COUNT_CACHE_THRESHOLD`,50),ff=da(`BYTES_CACHE_THRESHOLD`,8e6);function pf(e){return!(e.viewCount>0&&e.viewCount>=df||e.bytes>ff)}var mf=new Map,hf=new Map,gf=new Map;function _f(e,t){if(gf.size>=uf){let e=gf.keys().next().value;e!==void 0&&gf.delete(e)}gf.set(e,t),X(`ok/cache/snapshot-stored`,{toDocName:e,htmlBytes:t.html.length,hasScroll:t.scrollTop>0,hasSelection:t.selection!==null})}function vf(e){return gf.get(e)??null}function yf(e){if(!gf.has(e))return;let t=gf.get(e)??null;gf.delete(e),X(`ok/cache/snapshot-consumed`,{docName:e,hit:t!==null,hasScroll:t!==null&&t.scrollTop>0,hasSelection:t!==null&&t.selection!==null})}function bf(){if(typeof document>`u`)return null;let e=document.querySelectorAll(`[data-testid="editor-scroll-container"]`);for(let t of e)if(t.getClientRects().length>0)return t;return null}function xf(){try{return bf()?.scrollTop??0}catch(e){return X(`ok/cache/snapshot-scroll-read-failed`,{message:e instanceof Error?e.message:String(e)}),0}}function Sf(e){try{let t=e.state.selection;return t instanceof lr?{type:`text`,anchor:t.anchor,head:t.head}:t instanceof Gn?{type:`node`,from:t.from}:null}catch(e){return X(`ok/cache/snapshot-selection-read-failed`,{message:e instanceof Error?e.message:String(e)}),null}}function Cf(e){for(let t of e)try{let e=Wf(t.fromDocName);if(e&&!e.editor.isDestroyed){if(e.ytext.length===0){X(`ok/cache/snapshot-skipped-empty`,{fromDocName:t.fromDocName});continue}_f(t.toDocName,{html:e.editor.getHTML(),scrollTop:xf(),selection:Sf(e.editor)})}else X(`ok/cache/snapshot-skipped`,{fromDocName:t.fromDocName})}catch(e){X(`ok/cache/snapshot-capture-failed`,{fromDocName:t.fromDocName,message:e instanceof Error?e.message:String(e)})}}var wf=[],Tf=[],Ef=new Set;function Df(){if(typeof document>`u`)return null;let e=document.createElement(`div`);return e.setAttribute(`data-ok-editor-parking`,``),e.style.display=`none`,e.style.position=`absolute`,e.style.left=`-99999px`,e}function Of(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!pf(i)){let e=r(n);return X(`ok/cache/miss`,{docName:t,mountId:dd(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`size-gate`}),{editor:e.editor,ydoc:e.ydoc,ytext:e.ytext,provider:e.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null,__uncached:!0}}let a=mf.get(t);if(a){if(X(`ok/cache/reparent-start`,{docName:t,mountId:dd(t),kind:`tiptap`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),If(a,n),a.activeMountKey=t,Rf(wf,t),rf(t)||(n.scrollTop=a.scrollTop),a.hadFocus)try{a.editor.commands.focus()}catch{}return X(`ok/cache/reparent-end`,{docName:t,mountId:dd(t),kind:`tiptap`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),X(`ok/cache/hit`,{docName:t,mountId:dd(t),kind:`tiptap`}),i&&X(`ok/cold/editor-mount-stats`,{docName:t,mountId:dd(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`tiptap`}),a}for(;mf.size>=uf;){let e=zf(wf,t);if(!e)break;Af(e)}let o=r(n),s={editor:o.editor,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null};return mf.set(t,s),Rf(wf,t),X(`ok/cache/miss`,{docName:t,mountId:dd(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`tiptap`}),i&&X(`ok/cold/editor-mount-stats`,{docName:t,mountId:dd(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`tiptap`}),s}function kf(e){let t=e.activeMountKey;if(e.__uncached){t&&zd(t);let n=lf(e.editor);try{e.editor.destroy()}catch(e){X(`ok/cache/park-destroy-failed`,{docName:t??``,kind:`tiptap`,message:e instanceof Error?e.message:String(e)})}n&&(n.restore=void 0),e.activeMountKey=null;return}let n=Pf(e.editor);if(n){e.hadFocus=Ff(n.dom),e.scrollTop=(n.scrollDOM??n.dom.parentElement??n.dom).scrollTop??0;let t=n.dom.parentElement;t&&t.removeChild(n.dom),e.parkingNode||=Df(),e.parkingNode&&e.parkingNode.appendChild(n.dom)}e.activeMountKey=null}function Af(e){zd(e);let t=mf.get(e);if(!t)return!1;let n=lf(t.editor);try{t.editor.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`editor`,message:t instanceof Error?t.message:String(t)})}n&&(n.restore=void 0);try{t.provider.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`tiptap`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}mf.delete(e);let r=wf.indexOf(e);return r!==-1&&wf.splice(r,1),X(`ok/cache/evict`,{docName:e,kind:`tiptap`}),!0}function jf(e){let{docName:t,container:n,factory:r,sizeStats:i}=e;if(i&&!pf(i)){let e=r(n);return X(`ok/cache/miss`,{docName:t,mountId:dd(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`size-gate`,kind:`cm`}),{view:e.view,ydoc:e.ydoc,ytext:e.ytext,provider:e.provider,themeCompartment:e.themeCompartment,wordWrapCompartment:e.wordWrapCompartment,placeholderCompartment:e.placeholderCompartment,lintCompartment:e.lintCompartment,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null,__uncached:!0}}let a=hf.get(t);if(a){if(X(`ok/cache/reparent-start`,{docName:t,mountId:dd(t),kind:`cm`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),Lf(a,n),a.activeMountKey=t,Rf(Tf,t),rf(t)||(n.scrollTop=a.scrollTop),a.hadFocus)try{a.view.focus()}catch{}return X(`ok/cache/reparent-end`,{docName:t,mountId:dd(t),kind:`cm`,viewCount:i?.viewCount??-1,bytes:i?.bytes??-1}),X(`ok/cache/hit`,{docName:t,mountId:dd(t),kind:`cm`}),i&&X(`ok/cold/editor-mount-stats`,{docName:t,mountId:dd(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!0,kind:`cm`}),a}for(;hf.size>=uf;){let e=zf(Tf,t);if(!e)break;Nf(e)}let o=r(n),s={view:o.view,ydoc:o.ydoc,ytext:o.ytext,provider:o.provider,themeCompartment:o.themeCompartment,wordWrapCompartment:o.wordWrapCompartment,placeholderCompartment:o.placeholderCompartment,lintCompartment:o.lintCompartment,scrollTop:0,hadFocus:!1,activeMountKey:t,parkingNode:null};return hf.set(t,s),Rf(Tf,t),X(`ok/cache/miss`,{docName:t,mountId:dd(t),viewCount:i?.viewCount??-1,bytes:i?.bytes??-1,reason:`cold`,kind:`cm`}),i&&X(`ok/cold/editor-mount-stats`,{docName:t,mountId:dd(t),viewCount:i.viewCount,bytes:i.bytes,cacheHit:!1,kind:`cm`}),s}function Mf(e){if(e.__uncached){try{e.view.destroy()}catch(t){X(`ok/cache/park-destroy-failed`,{docName:e.activeMountKey??``,kind:`cm`,message:t instanceof Error?t.message:String(t)})}e.activeMountKey=null;return}let t=e.view.dom;e.hadFocus=Ff(t),e.scrollTop=(e.view.scrollDOM??t).scrollTop??0;let n=t.parentElement;n&&n.removeChild(t),e.parkingNode||=Df(),e.parkingNode&&e.parkingNode.appendChild(t),e.activeMountKey=null}function Nf(e){let t=hf.get(e);if(!t)return!1;sd(e,t.view);try{t.view.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`view`,message:t instanceof Error?t.message:String(t)})}try{t.provider.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`provider`,message:t instanceof Error?t.message:String(t)})}try{t.ydoc.destroy()}catch(t){X(`ok/cache/evict-failed`,{docName:e,kind:`cm`,stage:`ydoc`,message:t instanceof Error?t.message:String(t)})}hf.delete(e);let n=Tf.indexOf(e);return n!==-1&&Tf.splice(n,1),X(`ok/cache/evict`,{docName:e,kind:`cm`}),!0}function Pf(e){return e.editorView??null}function Ff(e){if(typeof document>`u`)return!1;let t=document.activeElement;return t?t===e?!0:e.contains(t):!1}function If(e,t){let n=Pf(e.editor);if(!n)return;let r=n.dom,i=r.parentElement;i&&i!==t&&i.removeChild(r),r.parentElement!==t&&t.appendChild(r)}function Lf(e,t){let n=e.view.dom,r=n.parentElement;r&&r!==t&&r.removeChild(n),n.parentElement!==t&&t.appendChild(n)}function Rf(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1),e.push(t)}function zf(e,t){for(let n of e)if(n!==t&&!Ef.has(n))return n;X(`ok/cache/evict-fallback-activity-saturated`,{mountingDocName:t,lruLength:e.length,activityMountCount:Ef.size});for(let n of e)if(n!==t)return n;return null}function Bf(e){let t=Ef,n=new Set(e);for(let e of t){if(n.has(e))continue;let t=Hf(e);if(t)try{t.disconnect(),X(`ok/cache/disconnect`,{docName:e})}catch(t){X(`ok/cache/disconnect-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})}}for(let e of n){if(t.has(e))continue;let n=Hf(e);if(!n)continue;let r=t=>{X(`ok/cache/connect-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})};try{let t=n.connect();t&&typeof t.then==`function`?t.then(()=>X(`ok/cache/connect`,{docName:e}),e=>r(e)):X(`ok/cache/connect`,{docName:e})}catch(e){r(e)}}Ef=n}var Vf=null;function Hf(e){let t=mf.get(e);if(t)return t.provider;let n=hf.get(e);if(n)return n.provider;if(Vf){let t=Vf.entries.get(e);if(t)return t.provider}return null}function Uf(e){Vf=e;let t=e.onEvict(e=>{Af(e),Nf(e)});return()=>{t(),Vf===e&&(Vf=null)}}function Wf(e){return mf.get(e)}var Gf=null;function Kf(e){return Gf=e,()=>{Gf===e&&(Gf=null)}}function qf(e){e&&Gf?.(e)}function Jf(e){e&&qf(Gi(e))}function Yf(e,t){let n=e=>(e.ok&&Jf(t),e);return{...e,current:()=>e.current(),subscribe:t=>e.subscribe(t),dispose:()=>e.dispose(),patch:t=>n(e.patch(t)),rename:(t,r,i)=>n(e.rename(t,r,i)),reorder:t=>n(e.reorder(t)),patchPath:(t,r)=>n(e.patchPath(t,r)),deletePath:t=>n(e.deletePath(t)),renamePath:(t,r,i)=>n(e.renamePath(t,r,i)),reorderPath:(t,r)=>n(e.reorderPath(t,r)),reorderSeqPath:(t,r)=>n(e.reorderSeqPath(t,r))}}function Xf(e){return e.docChanged?!e.getMeta(Zl):!1}function Zf(e){return e.docChanged?e.transactions.some(e=>e.annotation(vo.userEvent)!==void 0):!1}var Qf=e=>Pa((t,n)=>{e.onerror=e=>n(Error(e.target.error)),e.onsuccess=e=>t(e.target.result)}),$f=(e,t)=>Pa((n,r)=>{let i=indexedDB.open(e);i.onupgradeneeded=e=>t(e.target.result),i.onerror=e=>r(ka(e.target.error)),i.onsuccess=e=>{let t=e.target.result;t.onversionchange=()=>{t.close()},n(t)}}),ep=e=>Qf(indexedDB.deleteDatabase(e)),tp=(e,t)=>t.forEach(t=>e.createObjectStore.apply(e,t)),np=(e,t,n=`readwrite`)=>{let r=e.transaction(t,n);return t.map(e=>pp(r,e))},rp=(e,t)=>Qf(e.count(t)),ip=(e,t)=>Qf(e.get(t)),ap=(e,t)=>Qf(e.delete(t)),op=(e,t,n)=>Qf(e.put(t,n)),sp=(e,t)=>Qf(e.add(t)),cp=(e,t,n)=>Qf(e.getAll(t,n)),lp=(e,t,n)=>{let r=null;return fp(e,t,e=>(r=e,!1),n).then(()=>r)},up=(e,t=null)=>lp(e,t,`prev`),dp=(e,t)=>Pa((n,r)=>{e.onerror=r,e.onsuccess=async e=>{let r=e.target.result;if(r===null||await t(r)===!1)return n();r.continue()}}),fp=(e,t,n,r=`next`)=>dp(e.openKeyCursor(t,r),e=>n(e.key)),pp=(e,t)=>e.objectStore(t),mp=(e,t)=>IDBKeyRange.upperBound(e,t),hp=(e,t)=>IDBKeyRange.lowerBound(e,t),gp=`custom`,_p=`updates`,vp=(e,t=()=>{},n=()=>{})=>{let[r]=np(e.db,[_p]);return cp(r,hp(e._dbref,!1)).then(i=>{e._destroyed||(t(r),Aa(e.doc,()=>{i.forEach(t=>fo(e.doc,t))},e,!1),n(r))}).then(()=>up(r).then(t=>{e._dbref=t+1})).then(()=>rp(r).then(t=>{e._dbsize=t})).then(()=>r)},yp=(e,t=!0)=>vp(e).then(n=>{(t||e._dbsize>=500)&&sp(n,Ya(e.doc)).then(()=>ap(n,mp(e._dbref,!0))).then(()=>rp(n).then(t=>{e._dbsize=t}))}),bp=class extends qa{constructor(e,t){super(),this.doc=t,this.name=e,this._dbref=0,this._dbsize=0,this._destroyed=!1,this.db=null,this.synced=!1,this._db=$f(e,e=>tp(e,[[`updates`,{autoIncrement:!0}],[`custom`]])),this.whenSynced=Pa(e=>this.on(`synced`,()=>e(this))),this._db.then(e=>{this.db=e,vp(this,async e=>{await rp(e)>0&&sp(e,Ya(t))},()=>{if(this._destroyed)return this;this.synced=!0,this.emit(`synced`,[this])})}),this._storeTimeout=1e3,this._storeTimeoutId=null,this._storeUpdate=(e,t)=>{if(this.db&&t!==this){let[t]=np(this.db,[_p]);sp(t,e).catch(e=>{globalThis.__okYdbWriteWarned||(globalThis.__okYdbWriteWarned=!0,console.warn(JSON.stringify({event:`ok-ydb-write-failed`,cause:e?.name??`unknown`,message:e?.message??String(e)})))}),++this._dbsize>=500&&(this._storeTimeoutId!==null&&clearTimeout(this._storeTimeoutId),this._storeTimeoutId=setTimeout(()=>{yp(this,!1),this._storeTimeoutId=null},this._storeTimeout))}},t.on(`update`,this._storeUpdate),this.destroy=this.destroy.bind(this),t.on(`destroy`,this.destroy)}destroy(){return this._storeTimeoutId&&clearTimeout(this._storeTimeoutId),this.doc.off(`update`,this._storeUpdate),this.doc.off(`destroy`,this.destroy),this._destroyed=!0,this._db.then(e=>{e.close()})}clearData(){return this.destroy().then(()=>{ep(this.name)})}get(e){return this._db.then(t=>{let[n]=np(t,[gp],`readonly`);return ip(n,e)})}set(e,t){return this._db.then(n=>{let[r]=np(n,[gp]);return op(r,t,e)})}del(e){return this._db.then(t=>{let[n]=np(t,[gp]);return ap(n,e)})}},xp=`updates`,Sp=`custom`;function Cp(){return!0}var wp=class{_idb;_dbName;whenSynced;constructor({branch:e,serverInstanceId:t,docName:n,doc:r}){if(typeof t!=`string`||t.length===0)throw Error(`createClientPersistence: serverInstanceId is required and must be non-empty`);this._dbName=`ok-ydoc:${e}:${t}:${n}`;let i=Cp()?0:performance.now();this._idb=new bp(this._dbName,r),this.whenSynced=this._idb.whenSynced.then(()=>{if(!Cp()){let e=performance.now();X(`ok/pool/idb-whensynced`,{docName:n,durationMs:Math.round((e-i)*1e3)/1e3},{startTime:i,duration:e-i})}return this})}get synced(){return this._idb.synced}async destroy(){let e=Cp()?0:performance.now();try{await this._idb.destroy()}finally{if(!Cp()){let t=performance.now();X(`ok/pool/idb-destroy`,{dbName:this._dbName,durationMs:Math.round((t-e)*1e3)/1e3},{startTime:e,duration:t-e})}}}async flushFullState(){this._idb.db===null&&await this.whenSynced;let e=this._idb.db;if(e===null)return;let t=this._idb;await new Promise((n,r)=>{let i=e.transaction(xp,`readwrite`),a=i.objectStore(xp),o=a.getAll();o.onerror=()=>r(o.error??Error(`flushFullState getAll failed`)),o.onsuccess=()=>{try{Aa(t.doc,()=>{for(let e of o.result)fo(t.doc,e)},t,!1);let e=a.add(Ya(t.doc));e.onerror=()=>r(e.error??Error(`flushFullState add failed`)),e.onsuccess=()=>{a.delete(IDBKeyRange.upperBound(e.result,!0)),typeof i.commit==`function`&&i.commit()}}catch(e){r(e instanceof Error?e:Error(String(e)));try{i.abort()}catch{}}},i.oncomplete=()=>n(),i.onabort=()=>r(i.error??Error(`flushFullState transaction aborted`))})}async clearData(){let e=Cp()?0:performance.now();try{await this._idb.destroy();let e=this._dbName;await new Promise((t,n)=>{let r=indexedDB.deleteDatabase(e);r.onsuccess=()=>t(),r.onerror=()=>n(r.error),r.onblocked=()=>{console.warn(JSON.stringify({event:`ok-client-persistence-clear-blocked`,dbName:e}))}})}finally{if(!Cp()){let t=performance.now();X(`ok/pool/idb-cleardata`,{dbName:this._dbName,durationMs:Math.round((t-e)*1e3)/1e3},{startTime:e,duration:t-e})}}}};function Tp(e){return new wp(e)}async function Ep(e){if(typeof indexedDB>`u`)return null;let t=`ok-ydoc:${e.branch}:${e.serverInstanceId}:${e.docName}`;if(typeof indexedDB.databases==`function`&&!(await indexedDB.databases()).some(e=>e.name===t))return null;let n=await new Promise((e,n)=>{let r=indexedDB.open(t);r.onupgradeneeded=()=>{let e=r.result;e.objectStoreNames.contains(xp)||e.createObjectStore(xp,{autoIncrement:!0}),e.objectStoreNames.contains(Sp)||e.createObjectStore(Sp)},r.onsuccess=()=>e(r.result),r.onerror=()=>n(r.error)});try{if(!n.objectStoreNames.contains(xp))return null;let e=await new Promise((e,t)=>{let r=n.transaction(xp,`readonly`).objectStore(xp).getAll();r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error)});if(e.length===0)return null;let t=new Ha;try{Aa(t,()=>{for(let n of e)fo(t,n)});let n=t.getMap(`lifecycle`).get(yt);return typeof n==`string`&&n.length>0?n:null}finally{t.destroy()}}finally{n.close()}}function Dp(e){return ha(e)}function Op(e,t){return t===null?Ya(e):Ya(e,t)}function kp(e,t){if(e===null)return t;if(t===null)return e;let n=Da(e),r=Da(t),i=new Map;for(let[e,t]of n)i.set(e,t);for(let[e,t]of r){let n=i.get(e);(n===void 0||t>n)&&i.set(e,t)}return ha(i)}function Ap(e){let t={};if(jr.inject(Ar.active(),t),!t.traceparent)return e;let n=e.includes(`?`)?`&`:`?`,r=[`traceparent=${encodeURIComponent(t.traceparent)}`];return t.tracestate&&r.push(`tracestate=${encodeURIComponent(t.tracestate)}`),`${e}${n}${r.join(`&`)}`}var jp=({key:e,editor:t,onPaste:n,onDrop:r,allowedMimeTypes:i})=>new ar({key:e||new Nn(`fileHandler`),props:{handleDrop(e,n){if(!r||!n.dataTransfer?.files.length)return!1;let a=e.posAtCoords({left:n.clientX,top:n.clientY}),o=Array.from(n.dataTransfer.files);return i&&(o=o.filter(e=>i.includes(e.type))),o.length===0?!1:(n.preventDefault(),n.stopPropagation(),r(t,o,a?.pos||0),!0)},handlePaste(e,r){if(!n||!r.clipboardData?.files.length)return!1;let a=Array.from(r.clipboardData.files),o=r.clipboardData.getData(`text/html`);return i&&(a=a.filter(e=>i.includes(e.type))),!(a.length===0||(r.preventDefault(),r.stopPropagation(),n(t,a,o),o.length>0))}}}),Mp=tt.create({name:`fileHandler`,addOptions(){return{onPaste:void 0,onDrop:void 0,allowedMimeTypes:void 0}},addProseMirrorPlugins(){return[jp({key:new Nn(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}});function Np(e,t){let{state:n,view:r}=e;if(!n.selection.empty||!r.endOfTextblock(t))return!1;let i=n.selection.$head,a=t===`down`||t===`right`,o=null,s=-1;if(a){let e=i.after();if(e>=n.doc.content.size)return!1;o=n.doc.nodeAt(e),s=e}else{let e=i.before();if(e<=0||(o=n.doc.resolve(e).nodeBefore,!o))return!1;s=e-o.nodeSize}if(!o||o.type.name!==`jsxComponent`||o.childCount!==0||!Gn.isSelectable(o))return!1;try{let t=Gn.create(n.doc,s);return e.view.dispatch(n.tr.setSelection(t).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return Pn(t),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:t,tier:`L0`,reason:e.message.slice(0,500)})),!0}}function Pp(e){let{state:t,view:n}=e;if(!(t.selection instanceof lr)||!t.selection.empty||!n.endOfTextblock(`up`))return!1;let r=t.selection.$head,i=-1;for(let e=r.depth-1;e>=1;e--)if(r.node(e).type.name===`jsxComponent`){i=e;break}if(i<0)return!1;for(let e=r.depth;e>i;e--)if(r.index(e-1)!==0)return!1;let a=r.before(i);try{let n=t.doc.resolve(a),r=dn.findFrom(n,-1,!0);return!r||!(r instanceof lr)?!1:(e.view.dispatch(t.tr.setSelection(r).scrollIntoView()),!0)}catch(e){if(!(e instanceof RangeError))throw e;return Pn(`up`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`up`,tier:`L2c`,reason:e.message.slice(0,500)})),!0}}function Fp(e,t){let{state:n,view:r}=e;if(!(n.selection instanceof lr)||!n.selection.empty||!r.endOfTextblock(t))return!1;let i=n.selection.$head,a=t===`down`||t===`right`,o=null,s=-1;if(a){let e=i.after();if(e>=n.doc.content.size)return!1;o=n.doc.nodeAt(e),s=e}else{let e=i.before();if(e<=0||(o=n.doc.resolve(e).nodeBefore,!o))return!1;s=e-o.nodeSize}if(!o||o.type.name!==`jsxComponent`||o.childCount===0)return!1;let c=s+o.nodeSize;try{let t=a?s+1:c-1,r=dn.findFrom(n.doc.resolve(t),a?1:-1,!0);return!r||!(r instanceof lr)||r.$head.pos<=s||r.$head.pos>=c?!1:(e.view.dispatch(n.tr.setSelection(r).scrollIntoView()),!0)}catch(e){if(!(e instanceof RangeError))throw e;return Pn(t),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:t,tier:`L2d`,reason:e.message.slice(0,500)})),!0}}var Ip=tt.create({name:`keyboardNav`,priority:50,addKeyboardShortcuts(){return{Escape:({editor:e})=>{let{state:t}=e;if(t.selection instanceof Gn){if(t.selection.$from.depth===0)return e.commands.blur(),!0;let n=t.selection.from+t.selection.node.nodeSize,r=t.doc.resolve(Math.min(n,t.doc.content.size)),i=lr.near(r);return e.view.dispatch(t.tr.setSelection(i)),!0}return t.selection instanceof lr?e.commands.selectParentNode():!1},ArrowUp:({editor:e})=>{if(Np(e,`up`)||Pp(e)||Fp(e,`up`))return!0;let{state:t}=e;if(!(t.selection instanceof Gn))return!1;let n=t.selection.from,r=t.doc.resolve(n);if(r.index(r.depth)===0)return!1;let i=r.before(r.depth);if(i<=0)return!1;let a=t.doc.resolve(i-1).nodeBefore;if(!a||i-1-a.nodeSize+1<0)return!1;try{let n=Gn.create(t.doc,i-a.nodeSize);return e.view.dispatch(t.tr.setSelection(n).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return Pn(`up`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`up`,tier:`L2`,reason:e.message.slice(0,500)})),!1}},ArrowDown:({editor:e})=>{if(Np(e,`down`)||Fp(e,`down`))return!0;let{state:t}=e;if(!(t.selection instanceof Gn))return!1;let n=t.selection.from+t.selection.node.nodeSize;if(n>=t.doc.content.size)return!1;try{if(!t.doc.nodeAt(n))return!1;let r=Gn.create(t.doc,n);return e.view.dispatch(t.tr.setSelection(r).scrollIntoView()),!0}catch(e){if(!(e instanceof RangeError))throw e;return Pn(`down`),console.warn(JSON.stringify({event:`jsx-component-arrow-node-select-failed`,direction:`down`,tier:`L2`,reason:e.message.slice(0,500)})),!1}},ArrowLeft:({editor:e})=>Np(e,`left`)||Fp(e,`left`),ArrowRight:({editor:e})=>Np(e,`right`)||Fp(e,`right`),Enter:({editor:e})=>{let{state:t}=e;if(!(t.selection instanceof lr)||!t.selection.empty)return!1;let n=t.selection.$from,r=n.parent;if(r.type.name!==`paragraph`||r.textContent!==``||n.depth<2)return!1;let i=-1;for(let e=n.depth-1;e>=1;e--)if(n.node(e).type.name===`jsxComponent`){i=e;break}if(i<0)return!1;let a=n.node(i);if(n.index(i)!==a.childCount-1)return!1;let o=n.after(i);if(o>t.doc.content.size)return!1;let s=t.tr,c=n.before(n.depth),l=n.after(n.depth);s.delete(c,l);let u=o-(l-c),d=t.schema.nodes.paragraph.create();s.insert(u,d);let f=u+1;return s.setSelection(lr.create(s.doc,f)),e.view.dispatch(s.scrollIntoView()),!0}}}}),Lp={query:``,options:{caseSensitive:!1,wholeWord:!1},activeIndex:0,matches:[]},Rp=/[A-Za-z0-9_]/;function zp(e){return e!==void 0&&Rp.test(e)}function Bp(e,t,n){return!zp(e[t-1])&&!zp(e[n])}function Vp(e,t,n){if(t.length===0)return[];let r=n.caseSensitive?e:e.toLocaleLowerCase(),i=n.caseSensitive?t:t.toLocaleLowerCase(),a=[],o=0;for(;o<=r.length-i.length;){let t=r.indexOf(i,o);if(t===-1)break;let s=t+i.length;(!n.wholeWord||Bp(e,t,s))&&a.push({start:t,end:s,text:e.slice(t,s)}),o=s}return a}function Hp(e,t,n){if(t.length===0)return[];let r=[];return e.descendants((e,i)=>{if(!(!e.isText||typeof e.text!=`string`))for(let a of Vp(e.text,t,n))r.push({from:i+a.start,to:i+a.end,text:a.text})}),r}var Up=new Nn(`findReplace`);function Wp(e,t){return t<=0||!Number.isFinite(e)?0:Math.min(Math.max(Math.trunc(e),0),t-1)}function Gp(e,t,n,r){let i=Hp(e.doc,t,n);return{query:t,options:n,activeIndex:Wp(r,i.length),matches:i}}function Kp(e,t,n){return t<=0?0:(Wp(e,t)+n+t)%t}function qp(e,t,n){if(e.length===0)return 0;let r=t+n,i=e.findIndex(e=>e.from>=r);return i===-1?0:i}function Jp(e,t,n){if(t.matches.length===0)return null;let r=e.tr;for(let e of[...t.matches].reverse())r.insertText(n,e.from,e.to);let i=Hp(r.doc,t.query,t.options),a=Wp(0,i.length),o=i[a];return r.setMeta(Up,{type:`setActiveIndex`,activeIndex:a}),o&&r.setSelection(lr.create(r.doc,o.from,o.to)),r.scrollIntoView()}function Yp(e,t){let n=Up.getState(e)?.matches[t];return n?e.tr.setMeta(Up,{type:`setActiveIndex`,activeIndex:t}).setSelection(lr.create(e.doc,n.from,n.to)).scrollIntoView():null}function Xp(e){return Up.getState(e)??Lp}function Zp(){return new ar({key:Up,state:{init:()=>Lp,apply(e,t,n,r){let i=e.getMeta(Up);if(i?.type===`clear`)return Lp;let a=t.query,o=t.options,s=t.activeIndex;if(i?.type===`setQuery`)a=i.query,o={...o,...i.options},s=i.activeIndex??0;else if(i?.type===`setOptions`)o={...o,...i.options},s=i.activeIndex??s;else if(i?.type===`setActiveIndex`)s=i.activeIndex;else if(!e.docChanged)return t;return a.length===0?{query:a,options:o,activeIndex:0,matches:[]}:Gp(r,a,o,s)}},props:{decorations(e){let t=Up.getState(e);return!t||t.matches.length===0?null:Je.create(e.doc,t.matches.map((e,n)=>Rt.inline(e.from,e.to,{class:n===t.activeIndex?`ok-find-match ok-find-match-active`:`ok-find-match`})))}}})}var Qp=tt.create({name:`findReplace`,addCommands(){return{setFindQuery:(e,t)=>({state:n,dispatch:r})=>(r&&r(n.tr.setMeta(Up,{type:`setQuery`,query:e,options:t?.options,activeIndex:t?.activeIndex})),!0),setFindOptions:(e,t)=>({state:n,dispatch:r})=>(r&&r(n.tr.setMeta(Up,{type:`setOptions`,options:e,activeIndex:t})),!0),setActiveFindIndex:e=>({state:t,dispatch:n})=>(n&&n(t.tr.setMeta(Up,{type:`setActiveIndex`,activeIndex:e})),!0),selectNextFindMatch:()=>({state:e,dispatch:t})=>{let n=Xp(e),r=Yp(e,Kp(n.activeIndex,n.matches.length,1));return r?(t?.(r),!0):!1},selectPreviousFindMatch:()=>({state:e,dispatch:t})=>{let n=Xp(e),r=Yp(e,Kp(n.activeIndex,n.matches.length,-1));return r?(t?.(r),!0):!1},replaceCurrentFindMatch:e=>({state:t,dispatch:n})=>{let r=Xp(t),i=r.matches[r.activeIndex];if(!i||!n)return!1;let a=t.tr.insertText(e,i.from,i.to),o=Hp(a.doc,r.query,r.options),s=qp(o,i.from,e.length),c=o[s];return a.setMeta(Up,{type:`setActiveIndex`,activeIndex:s}),c&&a.setSelection(lr.create(a.doc,c.from,c.to)),a.scrollIntoView(),n(a),!0},replaceAllFindMatches:e=>({state:t,dispatch:n})=>{let r=Xp(t);if(!n)return!1;let i=Jp(t,r,e);return i?(n(i),!0):!1},clearFindMatches:()=>({state:e,dispatch:t})=>(t&&t(e.tr.setMeta(Up,{type:`clear`})),!0)}},addProseMirrorPlugins(){return[Zp()]}}),$p=/^(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/i,em=/^([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/,tm=/[-\d_]$/,nm=Wt.map(e=>`${e}:`);function rm(e){let t=e.toLowerCase();return nm.some(e=>t.startsWith(e))}function im(e,t){let n=0;for(let r of e)r===t&&n++;return n}function am(e){let t=e.split(`.`),n=t[t.length-1],r=t[t.length-2];return!(n&&(/_/.test(n)||!/[a-zA-Z\d]/.test(n))||r&&(/_/.test(r)||!/[a-zA-Z\d]/.test(r)))}function om(e){return e.split(`.`).length>=2&&am(e)}function sm(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,``];let n=e.slice(0,t.index),r=t[0],i=r.indexOf(`)`),a=im(n,`(`),o=im(n,`)`);for(;i!==-1&&a>o;)n+=r.slice(0,i+1),r=r.slice(i+1),i=r.indexOf(`)`),o++;return[n,r]}function cm(e){let t=$p.exec(e);if(!t)return null;let n=t[1],r=t[2],i=t[3],a=``,o=/^w/i.test(n);if(o&&(r=n+r,n=``,a=`http://`),o?!om(r):!am(r))return null;let[s]=sm(r+i);if(!s)return null;let c=n+s,l=a+n+s;return rm(l)?{href:l,text:c}:null}function lm(e){let t=em.exec(e);if(!t)return null;let n=t[1],r=t[2];if(tm.test(r))return null;let i=`${n}@${r}`,a=`mailto:${i}`;return rm(a)?{href:a,text:i}:null}function um(e){return e?cm(e)??lm(e):null}function dm(e,t){let n=Ql.getState(e.state)?.undoManager;n?.stopCapturing();try{e.dispatch(t)}finally{n?.stopCapturing()}}var fm=`\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000`,pm=RegExp(`[${fm}]`),mm=RegExp(`[${fm}]$`),hm=`link`,gm=`gfm-autolink`,_m=`preventAutolink`,vm=new Nn(`gfmAutolink`);function ym(e,t,n){let r=[],i=St(kt(e.doc,[...n]));for(let{newRange:e}of i){let n=ft(t.doc,e,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=t.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length===1){let r=t.doc.textBetween(e.from,e.to,` `,` `);if(!mm.test(r))continue;i=n[0],a=t.doc.textBetween(i.pos,e.to,void 0,` `)}if(!i||!a||K(i.node))continue;let o=a.split(pm).filter(Boolean),s=o[o.length-1];if(!s)continue;let c=um(s);if(!c)continue;let l=i.pos+a.lastIndexOf(s)+1,u=l+c.text.length;r.push({from:l,to:u,href:c.href,text:c.text})}return r}function bm(e={}){let t=e.isActiveEditor??(e=>e.hasFocus()),n=null,r=!1,i=[],a=()=>{r=!1;let e=n,a=i.splice(0,i.length);if(!e||e.isDestroyed||e.composing||!t(e))return;let o=e.state.schema.marks[hm];if(!o)return;let s=e.state.tr,c=!1,l=e.state.doc.content.size;for(let t of a){let{from:n,to:r,href:i,text:a}=t;n<0||r>l||n>=r||e.state.doc.textBetween(n,r)===a&&(zt(n,r,e.state.doc).some(e=>e.mark.type===o)||ue(e.state,n,r)||(s=s.addMark(n,r,o.create({href:i,linkStyle:gm})),c=!0))}if(c){s=s.setMeta(_m,!0);try{dm(e,s)}catch(e){console.warn(`[gfm-autolink] linkify dispatch failed`,{candidates:a.map(e=>({from:e.from,to:e.to,href:e.href}))},e)}}};return new ar({key:vm,view(e){return n=e,{destroy(){n=null,i.length=0,r=!1}}},appendTransaction(e,o,s){if(e.some(e=>e.getMeta(Zl))||e.some(e=>e.getMeta(`preventAutolink`))||!(e.some(e=>e.docChanged)&&!o.doc.eq(s.doc))||!n||!t(n))return null;let c=ym(o,s,e);return c.length===0?null:(i.push(...c),r||(r=!0,queueMicrotask(a)),null)}})}var xm=tt.create({name:`gfmAutolink`,addOptions(){return{isActiveEditor:void 0}},addProseMirrorPlugins(){return[bm({isActiveEditor:this.options.isActiveEditor})]}}),Sm=1e3,Cm=class extends Error{kind;constructor(e,t){super(e),this.name=`UploadFailedError`,this.kind=t}};async function wm(e,t,n=Sm){if(t<=0)return{readable:!0,bytesRead:0};let r,i=new Promise(e=>{r=setTimeout(()=>e({readable:!1,bytesRead:0,timedOut:!0}),n)}),a=(async()=>{try{let t=await e.slice(0,1).arrayBuffer();return{readable:t.byteLength===1,bytesRead:t.byteLength}}catch(e){return{readable:!1,bytesRead:0,error:e instanceof Error?`${e.name}: ${e.message}`:String(e)}}})();try{return await Promise.race([a,i])}finally{clearTimeout(r)}}function Tm(e){return e.readable?`network`:`file-unreadable`}function Em(e,t){return e===`file-unreadable`?Y._({id:`YxZDGh`,values:{fileName:t}}):Y._({id:`H0VUMo`,values:{fileName:t}})}async function Dm(e){let{file:t,sizeAtDrop:n,error:r}=e,i=await wm(t,n),a=Tm(i);return{kind:a,message:Em(a,t.name),log:{kind:a,name:t.name,type:t.type,sizeAtDrop:n,sizeAtSend:t.size,bytesRead:i.bytesRead,readError:i.error,readTimedOut:i.timedOut,error:r instanceof Error?`${r.name}: ${r.message}`:String(r)}}}var Om=new Nn(`imageUpload`);function km(e){let t=document.createElement(`div`);t.className=`image-upload-skeleton w-full h-40 rounded-md bg-muted animate-pulse motion-reduce:animate-none my-2`,t.setAttribute(`data-upload-widget`,`loading`),t.setAttribute(`role`,`status`);let n=e?.name;return t.setAttribute(`aria-label`,n?Y._({id:`KDuPiY`,values:{fileName:n}}):Y._({id:`bGa3Fk`})),t}var Am=new ar({key:Om,state:{init(){return{decorations:Je.empty,uploads:new Map}},apply(e,t){let n=t.decorations.map(e.mapping,e.doc),r=new Map;for(let[n,i]of t.uploads)r.set(n,e.mapping.map(i));let i=e.getMeta(Om);if(!i)return{decorations:n,uploads:r};if(i.type===`add`){let t=Rt.widget(i.pos,i.widget,{id:i.id,stopEvent:()=>!0}),a=n.add(e.doc,[t]),o=new Map(r);return o.set(i.id,e.mapping.map(i.pos)),{decorations:a,uploads:o}}if(i.type===`remove`){let e=n.find(void 0,void 0,e=>e.id===i.id),t=n.remove(e),a=new Map(r);return a.delete(i.id),{decorations:t,uploads:a}}return{decorations:n,uploads:r}}},props:{decorations(e){return Om.getState(e)?.decorations??Je.empty}}});function jm(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function Mm(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function Nm(e){return e.split(`/`).filter(e=>e!==``)}function Pm(e,t){let n=jm(e),r=jm(t),i=Mm(e);if(n===r)return i;let a=Nm(r),o=Nm(n),s=0;for(;s<a.length&&s<o.length&&a[s]===o[s];)s++;let c=a.length-s,l=o.slice(s);return c===0?`./${[...l,i].join(`/`)}`:[...Array(c).fill(`..`),...l,i].join(`/`)}function Fm(e){return re(e)}function Im(e,t){return{type:`jsxComponent`,attrs:{componentName:e===`jsx-img`?`img`:e===`jsx-video`?`video`:`audio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:e===`jsx-img`?{src:t}:{src:t,controls:!0}}}}function Lm(e){let t=Qt(e);return t===`md`||t===`mdx`?{kind:`wiki-link`,ext:t}:un.has(t)?{kind:`jsx-img`,ext:t}:wr.has(t)?{kind:`jsx-video`,ext:t}:fn.has(t)?{kind:`jsx-audio`,ext:t}:Dn.has(t)?{kind:`jsx-file`,ext:t}:Ut.has(t)?{kind:`wikiembed`,ext:t}:{kind:`markdown-link`,ext:t}}async function Rm(e,t,n){let r=Fm(t),i=r?`${r}.md`:``;if(!i){ci.error(Y._({id:`z5pqI8`}));return}let a=crypto.randomUUID(),o=e.size,s=km(e);t.view.dispatch(t.state.tr.setMeta(Om,{type:`add`,id:a,pos:n,widget:s}));let c=new FormData;c.append(`file`,e),c.append(`parentDocName`,i);let l;try{l=await fetch(`/api/upload`,{method:`POST`,body:c})}catch(n){let r;try{r=await Dm({file:e,sizeAtDrop:o,error:n})}catch(e){console.error(`[uploadAndInsert] upload failed, and diagnosing it failed too`,{docName:i,networkError:n,reportError:e})}r&&console.error(`[uploadAndInsert] upload failed before reaching the server`,{...r.log,docName:i}),zm(t,a,r?.message);return}let u;try{u=await l.json()}catch(e){console.error(`[uploadAndInsert] Response is not JSON:`,e),zm(t,a);return}if(!l.ok){let e=Mn.safeParse(u);if(!e.success){let n=new V(`Upload response did not match ProblemDetails.`,{cause:e.error,status:l.status});console.error(`[uploadAndInsert] Server error (unparseable):`,n),zm(t,a);return}console.error(`[uploadAndInsert] Server error:`,e.data),zm(t,a,e.data.title);return}let d=dt.safeParse(u);if(!d.success){let e=new V(`Upload success response did not match UploadAssetSuccess.`,{cause:d.error,status:l.status});console.error(`[uploadAndInsert] Response missing src:`,e),zm(t,a);return}let f=d.data,p=f.src,m=f.deduped===!0,h=jm(i),g=typeof f.path==`string`&&f.path.length>0?f.path:h?`${h}/${p}`:p;m&&ci.info(Y._({id:`VbqhBI`,values:{assetContentPath:g}}));let _=Lm(e.name),{state:v}=t,y=Om.getState(v)?.uploads.get(a)??n,b=v.tr.setMeta(Om,{type:`remove`,id:a}),x=Pm(g,i),S=`/${g}`;if(_.kind===`jsx-file`){if(!v.schema.nodes.jsxComponent){console.error(`[uploadAndInsert] jsxComponent node missing from schema`),zm(t,a);return}let n={type:`jsxComponent`,attrs:{componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:{src:S,target:p,alias:null,anchor:null,size:_t(e.size)}}};t.chain().command(({tr:e})=>(e.setMeta(Om,{type:`remove`,id:a}),!0)).focus().insertContentAt(y,n).command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=e.mapping.map(y);return e.doc.nodeAt(n)?.type.name===`jsxComponent`&&e.setSelection(Gn.create(e.doc,n)),!0}).run();return}if(_.kind===`jsx-img`||_.kind===`jsx-video`||_.kind===`jsx-audio`){if(!v.schema.nodes.jsxComponent){console.error(`[uploadAndInsert] jsxComponent node missing from schema`),zm(t,a);return}let e=Im(_.kind,S);t.chain().command(({tr:e})=>(e.setMeta(Om,{type:`remove`,id:a}),!0)).focus().insertContentAt(y,e).command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=e.mapping.map(y);return e.doc.nodeAt(n)?.type.name===`jsxComponent`&&e.setSelection(Gn.create(e.doc,n)),!0}).run();return}if(_.kind===`wikiembed`){let e=v.schema.nodes.wikiLinkEmbed;if(!e){console.error(`[uploadAndInsert] wikiLinkEmbed node missing from schema`),zm(t,a);return}b.insert(y,e.create({target:p,alias:null,anchor:null,resolvedSrc:S}))}else if(_.kind===`wiki-link`){let n=v.schema.nodes.wikiLink;if(!n){console.error(`[uploadAndInsert] wikiLink node missing from schema`),zm(t,a);return}let r=ye(e.name.replace(/\.(md|mdx)$/i,``));r?b.insert(y,n.create(r)):b.insert(y,v.schema.text(e.name))}else{let t=v.schema.marks.link;if(t){let n=v.schema.text(e.name,[t.create({href:x})]);b.insert(y,n)}else b.insert(y,v.schema.text(e.name))}t.view.dispatch(b)}function zm(e,t,n){e.view.dispatch(e.state.tr.setMeta(Om,{type:`remove`,id:t})),ci.error(n??Y._({id:`b3Thhd`}))}var Bm=/\[([^\]]+)\]\(([^)\s]+)\)$/,Vm=`link`;function Hm(e,t,n,r,i){if(e.isDestroyed||e.composing)return;let{state:a}=e,o=a.schema.marks[Vm];if(!o)return;let s=t+n.length;if(t<0||s>a.doc.content.size||a.doc.textBetween(t,s)!==n||a.doc.rangeHasMark(t,s,o))return;let c=a.schema.text(r,[o.create({href:i})]);try{dm(e,a.tr.replaceRangeWith(t,s,c))}catch(e){console.warn(`[inline-link-rule] collapse dispatch failed`,{from:t,text:r,href:i},e)}}var Um=tt.create({name:`inlineLinkInputRule`,addInputRules(){let e=this.editor;return[new Nt({find:Bm,handler:({state:t,range:n,match:r})=>{let i=r[1],a=r[2];if(!i||!a||!Un(a))return null;let o=t.schema.marks[Vm];if(!o||t.doc.rangeHasMark(n.from,n.to,o))return null;let s=n.from,c=r[0],l=e.view;return queueMicrotask(()=>Hm(l,s,c,i,a)),null}})]}}),Wm=`mathInline`,Gm=/\$\$([^$\n]+)\$\$$/,Km=/(?<![\w$])\$([^\s$\n](?:[^$\n]*[^\s$\n])?)\$$/;function qm(e,t,n){let r=t.exec(e);if(!r)return null;let i=r[1];return i?{formula:i,delimiter:n,literalLength:r[0].length}:null}function Jm(e,t,n){if(e.isDestroyed||e.composing)return;let{state:r}=e,i=r.schema.nodes[Wm];if(!i)return;let a=t+n.literalLength;if(t<0||a>r.doc.content.size)return;let o=`${n.delimiter}${n.formula}${n.delimiter}`;if(r.doc.textBetween(t,a)!==o)return;let s=!1;if(r.doc.nodesBetween(t,a,e=>(e.isInline&&!e.isText&&(s=!0),!s)),s)return;let c=i.create({formula:n.formula,sourceDelimiter:n.delimiter});try{dm(e,r.tr.replaceRangeWith(t,a,c))}catch(e){console.warn(`[math-input-rule] collapse dispatch failed`,{from:t,formula:n.formula,delimiter:n.delimiter},e)}}function Ym(e,t,n){return new Nt({find:t,handler:({state:r,range:i,match:a})=>{let o=qm(a[0],t,n);if(!o||!r.schema.nodes[Wm])return null;let s=i.from,c=e.view;return queueMicrotask(()=>Jm(c,s,o)),null}})}var Xm=tt.create({name:`mathInputRule`,addInputRules(){return[Ym(this.editor,Gm,`$$`),Ym(this.editor,Km,`$`)]}}),Zm=`ok-landing-flash`;function Qm(e,t,n,r){if(r===`clamped`||r===`ordinal`)return null;let i=Math.max(0,Math.min(t,e)),a=Math.max(i,Math.min(n,e));return a<=i?null:{from:i,to:a}}var $m=new Nn(`okLandingFlash`),eh=new WeakMap;function th(){return new ar({key:$m,state:{init:()=>Je.empty,apply(e,t){let n=e.getMeta($m),r=t.map(e.mapping,e.doc);return n?.clear&&(r=Je.empty),n?.add&&n.add.to>n.add.from&&(r=Je.create(e.doc,[Rt.inline(n.add.from,n.add.to,{class:Zm})])),r}},props:{decorations(e){return $m.getState(e)}},view(e){return{destroy(){let t=eh.get(e);t!==void 0&&(clearTimeout(t),eh.delete(e))}}}})}var nh=tt.create({name:`okLandingFlash`,addProseMirrorPlugins(){return[th()]}}),rh=new Set;function ih(e){rh.add(e)}function ah(e){return rh.delete(e)}var oh=new Nn(`markIdentity`);function sh(){return{byId:new Map,counter:0}}function ch(e,t,n,r,i){let a=[];for(let e of t.byId.values()){let t=i?i.map(e.from,-1):e.from,n=i?i.map(e.to,1):e.to;n<=t||a.push({id:e.id,markType:e.markType,attrs:e.attrs,from:t,to:n})}let o=new Map,s=new Set,c=t.counter;return e.descendants((e,t)=>{if(!(!e.isInline||e.marks.length===0))for(let i of e.marks){if(!n.has(i.type.name)||r&&!r(i))continue;let l=null;for(let e of a)if(!s.has(e.id)&&e.markType===i.type.name&&lh(e.attrs,i.attrs)&&!(t<e.from||t>=e.to)){l=e.id;break}let u=l??`m${++c}`;s.add(u);let d=t,f=t+e.nodeSize,p=o.get(u);p?p.to=Math.max(p.to,f):o.set(u,{id:u,markType:i.type.name,attrs:i.attrs,from:d,to:f})}}),{byId:o,counter:c}}function lh(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(n!==i&&(typeof n!=`object`||!n||typeof i!=`object`||!i||!((Array.isArray(n)&&Array.isArray(i)||!Array.isArray(n)&&!Array.isArray(i)&&Object.getPrototypeOf(n)===Object.prototype&&Object.getPrototypeOf(i)===Object.prototype)&&lh(n,i))))return!1}return!0}function uh(e,t,n,r){let i=new Set(t.byId.keys());for(let[r,i]of t.byId)e.has(r)||n?.(i);for(let t of e)i.has(t)||r?.(t);return i}function dh(e,t,n){let r=oh.getState(e);if(!r)return null;for(let e of r.byId.values())if(e.markType===n&&e.from<=t&&t<e.to)return e.id;return null}function fh(e){let{markTypes:t,predicate:n,onRegister:r,onDeregister:i}=e,a=new Set(t);return new ar({key:oh,state:{init(e,t){return ch(t.doc,sh(),a,n)},apply(e,t,r,i){return e.docChanged?ch(i.doc,t,a,n,e.mapping):t}},view(){let e=new Set;return{update(t){let n=oh.getState(t.state);n&&(e=uh(e,n,r,i))},destroy(){for(let t of e)i?.(t);e=new Set}}}})}var ph=300,mh=150,hh=500,gh=class{registry=new Map;_activeNodeId=null;listeners=new Set;_snapshot={activeNodeId:null,active:null};register(e){this.registry.set(e.nodeId,e),this._activeNodeId===e.nodeId&&this.refreshSnapshot()}deregister(e){this.registry.delete(e)&&this._activeNodeId===e&&(this._activeNodeId=null,this.refreshSnapshot())}setActiveNode(e){this._activeNodeId!==e&&(e!==null&&!this.registry.has(e)||(this._activeNodeId=e,this.refreshSnapshot()))}getActiveNode(){return this._activeNodeId}getRegistration(e){return this.registry.get(e)}hasRegistration(e){return this.registry.has(e)}clear(){this.registry.clear(),this._activeNodeId=null,this.refreshSnapshot()}getSnapshot=()=>this._snapshot;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});refreshSnapshot(){let e=this._activeNodeId==null?null:this.registry.get(this._activeNodeId)??null;this._snapshot={activeNodeId:this._activeNodeId,active:e};for(let e of this.listeners)e()}};function _h(e,t){let n=e??null;for(;n&&typeof n==`object`;){let e=n.getAttribute;if(typeof e==`function`){let r=e.call(n,`data-mark-id`);if(r&&t.hasRegistration(r))return r;let i=e.call(n,`data-node-id`);if(i&&t.hasRegistration(i))return i}n=n.parentElement??null}return null}function vh(e){return e?e.closest(`[data-ok-prop-panel]`)!==null:!1}function yh(){return typeof document>`u`?!1:document.querySelector(`[data-ok-layer-spawned]`)!==null}var bh=e=>{let t=(0,$.c)(18),{store:n}=e,r;t[0]===n?r=t[1]:(r=()=>n.getSnapshot(),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=()=>(a(n.getSnapshot()),n.subscribe(()=>{a(n.getSnapshot())})),s=[n],t[2]=n,t[3]=o,t[4]=s),(0,Q.useEffect)(o,s);let{active:c}=i;if(!c)return null;let l;t[5]===n?l=t[6]:(l=()=>n.setActiveNode(null),t[5]=n,t[6]=l);let u,d,f;if(t[7]!==c.controls||t[8]!==c.nodeId||t[9]!==c.type||t[10]!==l){let e={nodeId:c.nodeId,type:c.type,deactivate:l};u=c.controls.propPanel?.(e),d=c.controls.toolbar?.(e),f=c.controls.breadcrumb?.(e),t[7]=c.controls,t[8]=c.nodeId,t[9]=c.type,t[10]=l,t[11]=u,t[12]=d,t[13]=f}else u=t[11],d=t[12],f=t[13];let p;return t[14]!==u||t[15]!==d||t[16]!==f?(p=(0,Z.jsxs)(Z.Fragment,{children:[u,d,f]}),t[14]=u,t[15]=d,t[16]=f,t[17]=p):p=t[17],p};function xh(e){return e.editorView?.dom??null}function Sh(e,t){let n=e;for(;n;){if(n.getAttribute?.(`data-mark-id`)===t||n.getAttribute?.(`data-node-id`)===t)return!0;n=n.parentElement}return!1}function Ch(e){let{editor:t}=e,n=new gh,r=xh(t),i=!1,a=null,o=null,s=null,c=null,l=null,u=()=>{a!==null&&(clearTimeout(a),a=null),s=null},d=()=>{o!==null&&(clearTimeout(o),o=null)},f=()=>{c!==null&&(clearTimeout(c),c=null)},p=e=>{if(n.getActiveNode()===e){d();return}s===e&&a!==null||(u(),d(),s=e,a=setTimeout(()=>{a=null,s=null,n.setActiveNode(e)},ph))},m=()=>{n.getActiveNode()!==null&&o===null&&(o=setTimeout(()=>{o=null,!yh()&&n.setActiveNode(null)},mh))},h=null,g=!1,_=e=>{try{g=!0,e.focus({preventScroll:!0})}catch{}finally{g=!1}},v=n.subscribe(()=>{let e=n.getActiveNode();if(e!==null){if(typeof document<`u`){let t=document.activeElement;h=t&&Sh(t,e)?t:null}return}if(typeof document>`u`)return;let i=h;if(h=null,i&&document.contains(i)&&typeof i.focus==`function`){_(i);return}let a=r??xh(t);a&&typeof a.focus==`function`&&_(a)}),y=e=>{let t=e;if(t.button!==2){if(t.metaKey||t.ctrlKey||t.button===1){u(),t.button===1&&t.preventDefault?.();return}if(t.pointerType===`touch`){let t=_h(e.target,n);if(t===null)return;f(),c=setTimeout(()=>{c=null,l=t,n.setActiveNode(t)},hh);return}u()}},b=()=>{f()},x=e=>{e.pointerType===`touch`&&c!==null&&f()},S=e=>{let t=e;if(t.button===2||t.type===`click`&&t.button===1)return;let r=_h(e.target,n);if(r===null)return;if(l!==null){let e=l===r;if(l=null,e){t.preventDefault?.();return}}let i=t.metaKey||t.ctrlKey||t.button===1,a=n.getRegistration(r);if(a?.handlePrimary&&a.handlePrimary({nodeId:r,type:a.type,newTab:i})){t.preventDefault?.(),i||(u(),d(),n.getActiveNode()===r&&n.setActiveNode(null));return}i||(u(),d(),n.setActiveNode(r))},C=e=>{let t=e;if(t.key===`Escape`){n.getActiveNode()!==null&&(u(),d(),n.setActiveNode(null),t.preventDefault?.());return}if(t.key===`Tab`&&!t.shiftKey&&!t.altKey&&!t.metaKey&&!t.ctrlKey){let r=_h(e.target,n);if(r!==null&&n.getActiveNode()===r){let e=document.querySelector(`[data-ok-prop-panel]`);if(e){let n=e.querySelector(`button:not([disabled]), [href], input:not([disabled]), [tabindex]:not([tabindex="-1"])`);if(n){t.preventDefault?.(),n.focus();return}}}return}let r=t.key===`Enter`,i=t.key===` `||t.key===`Spacebar`;if(!r&&!i)return;let a=_h(e.target,n);if(a===null||i&&((e.target instanceof Element?e.target:null)?.closest(`[data-mark-id], [data-node-id]`)??null)?.getAttribute(`role`)===`link`)return;let o=n.getRegistration(a);if(t.preventDefault?.(),o?.handlePrimary&&o.handlePrimary({nodeId:a,type:o.type,newTab:!1})){u(),d(),n.getActiveNode()===a&&n.setActiveNode(null);return}n.setActiveNode(a)},w=e=>{let t=e;if(t.pointerType!==`mouse`)return;let r=t.target;if(!(r instanceof Element))return;if(vh(r)){d();return}let i=_h(r,n);i!==null&&p(i)},T=e=>{let t=e;if(t.pointerType!==`mouse`)return;let r=t.target,i=t.relatedTarget;if(!(r instanceof Element))return;let a=i instanceof Element?i:null,o=_h(r,n);if(o!==null){if(a&&vh(a)){d();return}if(a&&_h(a,n)===o)return;s===o&&u(),m();return}if(vh(r)){if(a&&vh(a))return;let e=n.getActiveNode();if(e!==null&&a&&_h(a,n)===e)return;m()}},E=e=>{if(g)return;let t=e.target;if(!(t instanceof Element))return;let r=_h(t,n);r!==null&&(u(),d(),n.setActiveNode(r))},D=e=>{let t=e;if(n.getActiveNode()===null)return;let r=t.relatedTarget,i=r instanceof Element?r:null;i&&vh(i)||i&&_h(i,n)!==null||m()},O=e=>{if(n.getActiveNode()===null)return;let t=e.target;t&&(r?.contains(t)||t instanceof Element&&(t.closest(`[data-ok-interaction-layer]`)||t.closest(`[data-ok-prop-panel]`)||t.closest(`[data-ok-layer-spawned]`))||(u(),d(),n.setActiveNode(null)))},k=()=>{i||(r=xh(t),r&&(r.addEventListener(`pointerdown`,y,!0),r.addEventListener(`pointerup`,b,!0),r.addEventListener(`pointercancel`,b,!0),r.addEventListener(`pointermove`,x,!0),r.addEventListener(`click`,S,!0),r.addEventListener(`auxclick`,S,!0),r.addEventListener(`keydown`,C,!0),typeof document<`u`&&(document.addEventListener(`pointerover`,w,!0),document.addEventListener(`pointerout`,T,!0),document.addEventListener(`focusin`,E,!0),document.addEventListener(`focusout`,D,!0),document.addEventListener(`pointerdown`,O,!0)),i=!0))},A=()=>{i&&=(r?.removeEventListener(`pointerdown`,y,!0),r?.removeEventListener(`pointerup`,b,!0),r?.removeEventListener(`pointercancel`,b,!0),r?.removeEventListener(`pointermove`,x,!0),r?.removeEventListener(`click`,S,!0),r?.removeEventListener(`auxclick`,S,!0),r?.removeEventListener(`keydown`,C,!0),typeof document<`u`&&(document.removeEventListener(`pointerover`,w,!0),document.removeEventListener(`pointerout`,T,!0),document.removeEventListener(`focusin`,E,!0),document.removeEventListener(`focusout`,D,!0),document.removeEventListener(`pointerdown`,O,!0)),!1)};return k(),{register(e){n.register(e),i||k()},deregister(e){n.deregister(e)},setActiveNode(e){n.setActiveNode(e)},getActiveNode(){return n.getActiveNode()},getRegistration(e){return n.getRegistration(e)},destroy(){A(),u(),d(),f(),v(),n.clear()},store:n}}var wh=e=>{let t=(0,$.c)(2),{store:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(`div`,{"data-ok-interaction-layer":``,className:`contents`,children:(0,Z.jsx)(bh,{store:n})}),t[0]=n,t[1]=r),r},Th=new WeakMap;function Eh(e){let t=Th.get(e);if(t)return t;let n=Ch({editor:e});return Th.set(e,n),e.on(`destroy`,()=>{n.destroy(),Th.delete(e)}),n}var Dh={AppWindow:Nr,ChevronRight:Wr,CopyPlus:Qo,FileText:ve,Film:De,GitBranch:Pr,Image:Ce,LayoutPanelTop:us,MessageSquareWarning:vs,PanelTop:xs,Paperclip:ii,Sigma:Os,SquarePlay:js,Volume2:Ae,Workflow:Fs,ZoomIn:Fr};function Oh(e){return e&&Object.hasOwn(Dh,e)?Dh[e]:Uo}var kh={Info:ti,Lightbulb:ds,MessageSquareWarning:vs,AlertTriangle:oi,AlertOctagon:ys,ClipboardList:Jo,BookOpen:Ho,ListTodo:gs,CircleCheck:Zr,CircleHelp:Ko,CircleX:qo,Zap:Is,Bug:Wo,FlaskConical:is,Quote:Cs,ChevronRight:Wr},Ah=Object.entries(kh).sort(([e],[t])=>e.localeCompare(t));function jh(e){if(!e||!e.startsWith(`lucide:`))return null;let t=e.slice(7);return Object.hasOwn(kh,t)?kh[t]??null:null}function Mh(e){let t=(0,$.c)(24),n;t[0]===e.icon?n=t[1]:(n=jh(e.icon),t[0]=e.icon,t[1]=n);let r=n,i=r?`custom`:void 0,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(Wr,{size:14,className:`accordion-chevron`,"aria-hidden":`true`}),t[2]=a):a=t[2];let o;t[3]===r?o=t[4]:(o=r?(0,Z.jsx)(r,{size:16,className:`accordion-icon`,"aria-hidden":`true`}):null,t[3]=r,t[4]=o);let s=e.title??`Accordion`,c;t[5]===s?c=t[6]:(c=(0,Z.jsx)(`span`,{className:`accordion-title`,children:s}),t[5]=s,t[6]=c);let l;t[7]===e.description?l=t[8]:(l=e.description?(0,Z.jsx)(`span`,{className:`accordion-description`,children:e.description}):null,t[7]=e.description,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,Z.jsxs)(`span`,{className:`accordion-title-group`,children:[c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;t[12]!==o||t[13]!==u?(d=(0,Z.jsxs)(`summary`,{className:`accordion-summary`,contentEditable:!1,children:[a,o,u]}),t[12]=o,t[13]=u,t[14]=d):d=t[14];let f;t[15]===e.children?f=t[16]:(f=(0,Z.jsx)(`div`,{className:`accordion-body`,children:e.children}),t[15]=e.children,t[16]=f);let p;return t[17]!==e.defaultOpen||t[18]!==e.id||t[19]!==e.name||t[20]!==i||t[21]!==d||t[22]!==f?(p=(0,Z.jsxs)(`details`,{className:`accordion`,"data-accordion-icon":i,open:e.defaultOpen,id:e.id,name:e.name,children:[d,f]}),t[17]=e.defaultOpen,t[18]=e.id,t[19]=e.name,t[20]=i,t[21]=d,t[22]=f,t[23]=p):p=t[23],p}var Nh={center:`text-center`,left:`text-left`,right:`text-right`,justify:`text-justify`};function Ph(e){let t=(0,$.c)(5),n=Nh[e.align??``]??null,r;t[0]===n?r=t[1]:(r=v(`prose-no-margin`,n),t[0]=n,t[1]=r);let i;return t[2]!==e.children||t[3]!==r?(i=(0,Z.jsx)(`div`,{"data-component-type":`align-block`,className:r,children:e.children}),t[2]=e.children,t[3]=r,t[4]=i):i=t[4],i}function Fh(e){return e!==!1}function Ih(e){let t=(0,$.c)(12),n;t[0]===e.src?n=t[1]:(n=e.src===void 0?void 0:_n(e.src),t[0]=e.src,t[1]=n);let r=e.title,i;t[2]===e.controls?i=t[3]:(i=Fh(e.controls),t[2]=e.controls,t[3]=i);let a;return t[4]!==e.autoplay||t[5]!==e.loop||t[6]!==e.muted||t[7]!==e.preload||t[8]!==e.title||t[9]!==n||t[10]!==i?(a=(0,Z.jsx)(`audio`,{className:`ok-audio`,src:n,title:r,controls:i,autoPlay:e.autoplay,loop:e.loop,muted:e.muted,preload:e.preload}),t[4]=e.autoplay,t[5]=e.loop,t[6]=e.muted,t[7]=e.preload,t[8]=e.title,t[9]=n,t[10]=i,t[11]=a):a=t[11],a}var Lh={note:ti,tip:ds,important:vs,warning:oi,caution:ys,abstract:Jo,info:Ho,todo:gs,success:Zr,question:Ko,failure:qo,danger:Is,bug:Wo,example:is,quote:Cs};function Rh(e,t){return jh(e)??Lh[t]}var zh=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]);function Bh(e){return typeof e==`string`&&zh.has(e)?e:`note`}function Vh(e){let t=(0,$.c)(29),n,r;t[0]!==e.icon||t[1]!==e.type?(r=Bh(e.type),n=Rh(e.icon,r),t[0]=e.icon,t[1]=e.type,t[2]=n,t[3]=r):(n=t[2],r=t[3]);let i=n,o;t[4]===e.color?o=t[5]:(o=e.color?{"--callout-type-color":e.color}:{},t[4]=e.color,t[5]=o);let s=o,c;t[6]!==i||t[7]!==e.title?(c=e.title||i?(0,Z.jsxs)(`span`,{className:`callout-header`,contentEditable:!1,children:[(0,Z.jsx)(i,{size:16,className:`callout-icon`,"aria-hidden":`true`}),e.title?(0,Z.jsx)(`span`,{className:`callout-title`,children:e.title}):null]}):null,t[6]=i,t[7]=e.title,t[8]=c):c=t[8];let l=c;if(e.collapsible){let n=e.defaultOpen??!0,i;t[9]===l?i=t[10]:(i=l??(0,Z.jsx)(`span`,{className:`callout-title`,children:(0,Z.jsx)(a,{id:`URmyfc`})}),t[9]=l,t[10]=i);let o;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Ur,{size:16,className:`callout-chevron`,"aria-hidden":`true`}),t[11]=o):o=t[11];let c;t[12]===i?c=t[13]:(c=(0,Z.jsxs)(`summary`,{className:`callout-summary`,contentEditable:!1,children:[i,o]}),t[12]=i,t[13]=c);let u;t[14]===e.children?u=t[15]:(u=(0,Z.jsx)(`div`,{className:`callout-body`,children:e.children}),t[14]=e.children,t[15]=u);let d;return t[16]!==n||t[17]!==s||t[18]!==c||t[19]!==u||t[20]!==r?(d=(0,Z.jsxs)(`details`,{className:`callout callout-collapsible`,"data-callout-type":r,open:n,style:s,children:[c,u]}),t[16]=n,t[17]=s,t[18]=c,t[19]=u,t[20]=r,t[21]=d):d=t[21],d}let u;t[22]===e.children?u=t[23]:(u=(0,Z.jsx)(`div`,{className:`callout-body`,children:e.children}),t[22]=e.children,t[23]=u);let d;return t[24]!==l||t[25]!==s||t[26]!==u||t[27]!==r?(d=(0,Z.jsxs)(`div`,{className:`callout callout-static`,"data-callout-type":r,style:s,children:[l,u]}),t[24]=l,t[25]=s,t[26]=u,t[27]=r,t[28]=d):d=t[28],d}var Hh=[{key:`tl`,dx:-1,dy:-1,cursor:`nwse-resize`,className:`ok-resize-handle ok-resize-handle--tl`},{key:`t`,dx:0,dy:-1,cursor:`ns-resize`,className:`ok-resize-handle ok-resize-handle--t`},{key:`tr`,dx:1,dy:-1,cursor:`nesw-resize`,className:`ok-resize-handle ok-resize-handle--tr`},{key:`r`,dx:1,dy:0,cursor:`ew-resize`,className:`ok-resize-handle ok-resize-handle--r`},{key:`br`,dx:1,dy:1,cursor:`nwse-resize`,className:`ok-resize-handle ok-resize-handle--br`},{key:`b`,dx:0,dy:1,cursor:`ns-resize`,className:`ok-resize-handle ok-resize-handle--b`},{key:`bl`,dx:-1,dy:1,cursor:`nesw-resize`,className:`ok-resize-handle ok-resize-handle--bl`},{key:`l`,dx:-1,dy:0,cursor:`ew-resize`,className:`ok-resize-handle ok-resize-handle--l`}];function Uh(e){let t=(0,$.c)(7),{targetRef:n,onResize:r,onResizeEnd:i,bounds:a}=e,{_:s}=o(),c=(0,Q.useRef)(null),l;t[0]!==a?.maxHeight||t[1]!==a?.maxWidth||t[2]!==a?.minHeight||t[3]!==a?.minWidth?(l=function(e,t){let n=t===`w`?a?.minWidth??64:a?.minHeight??64,r=t===`w`?a?.maxWidth??1/0:a?.maxHeight??1/0;return Math.max(n,Math.min(r,e))},t[0]=a?.maxHeight,t[1]=a?.maxWidth,t[2]=a?.minHeight,t[3]=a?.minWidth,t[4]=l):l=t[4];let u=l,d=function(e,t){let a=n.current;if(!a)return;e.preventDefault(),e.stopPropagation();let o=a.getBoundingClientRect();c.current={handle:t,startX:e.clientX,startY:e.clientY,startWidth:o.width,startHeight:o.height,latestWidth:o.width,latestHeight:o.height,hasMoved:!1};let s=e.currentTarget;try{s.setPointerCapture(e.pointerId)}catch{}document.body.style.setProperty(`cursor`,t.cursor),document.body.style.setProperty(`user-select`,`none`);let l=function(e){let t=c.current;if(!t)return;let n=(e.clientX-t.startX)*t.handle.dx,i=(e.clientY-t.startY)*t.handle.dy,a=t.handle.dx===0?t.startWidth:u(t.startWidth+n,`w`),o=t.handle.dy===0?t.startHeight:u(t.startHeight+i,`h`);t.latestWidth=a,t.latestHeight=o,t.hasMoved=!0,r({width:a,height:o})};function d(){let e=c.current;if(!e)return;let t={width:e.latestWidth,height:e.latestHeight},n=e.hasMoved;c.current=null,document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`),window.removeEventListener(`pointermove`,l),window.removeEventListener(`pointerup`,d),window.removeEventListener(`pointercancel`,d),n&&i?.(t)}window.addEventListener(`pointermove`,l),window.addEventListener(`pointerup`,d),window.addEventListener(`pointercancel`,d)},f=Hh.map(e=>{let t=e.key;return(0,Z.jsx)(`button`,{type:`button`,className:v(e.className),"aria-label":s({id:`NxW-md`,values:{handleKey:t}}),tabIndex:-1,style:{cursor:e.cursor},onPointerDown:t=>d(t,e)},t)}),p;return t[5]===f?p=t[6]:(p=(0,Z.jsx)(`div`,{className:`ok-resize-overlay`,contentEditable:!1,"aria-hidden":`true`,children:f}),t[5]=f,t[6]=p),p}var Wh=`26rem`,Gh=`Embedded content`,Kh=/^https?:\/\//i;function qh(e){try{return new URL(e).origin!==window.location.origin}catch{return!1}}function Jh(e){return!(typeof e!=`string`||!Kh.test(e)||!qh(e))}function Yh(e){let t=(0,$.c)(24),{src:n,title:r,width:i,height:a}=e,o=(0,Q.useRef)(null),s=Br(),c=i||void 0,l=a||Wh,u;t[0]!==c||t[1]!==l?(u={width:c,height:l},t[0]=c,t[1]=l,t[2]=u):u=t[2];let d=u,f,p;if(t[3]!==a||t[4]!==i?(f=()=>{let e=o.current;e&&(e.style.width=i||``,e.style.height=a||Wh)},p=[i,a],t[3]=a,t[4]=i,t[5]=f,t[6]=p):(f=t[5],p=t[6]),(0,Q.useEffect)(f,p),!Jh(n)){let e=`Embed a URL`;typeof n==`string`&&n.length>0&&(e=Kh.test(n)?`Embed only supports cross-origin URLs`:`URL must start with http:// or https://`);let r;return t[7]===e?r=t[8]:(r=(0,Z.jsx)(`div`,{className:`ok-embed ok-embed--placeholder`,contentEditable:!1,children:(0,Z.jsx)(`span`,{children:e})}),t[7]=e,t[8]=r),r}let m;t[9]===s?m=t[10]:(m=e=>{if(!s)return;let{editor:t,getPos:n}=s,r=n();if(typeof r==`number`)try{let n=t.state.doc.nodeAt(r);if(!n||n.type.name!==`jsxComponent`)return;let i={...n.attrs.props??{},width:`${Math.round(e.width)}px`,height:`${Math.round(e.height)}px`};t.view.dispatch(t.state.tr.setNodeMarkup(r,null,{...n.attrs,props:i,sourceDirty:!0}))}catch(e){let t=e;if(t instanceof RangeError)return;throw t}},t[9]=s,t[10]=m);let h=m,g;t[11]===n?g=t[12]:(g=an(n),t[11]=n,t[12]=g);let _=g,v=_===n?`no-referrer`:`strict-origin-when-cross-origin`,y=r||Gh,b;t[13]!==_||t[14]!==v||t[15]!==y?(b=(0,Z.jsx)(`iframe`,{title:y,src:_,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation`,referrerPolicy:v,loading:`lazy`,className:`ok-embed-frame`}),t[13]=_,t[14]=v,t[15]=y,t[16]=b):b=t[16];let x;t[17]!==s||t[18]!==h?(x=s?(0,Z.jsx)(Uh,{targetRef:o,bounds:{minWidth:192,maxWidth:2e3,minHeight:128,maxHeight:Math.round(window.innerHeight*.9)},onResize:e=>{let t=o.current;t&&(t.style.width=`${e.width}px`,t.style.height=`${e.height}px`)},onResizeEnd:h}):null,t[17]=s,t[18]=h,t[19]=x):x=t[19];let S;return t[20]!==d||t[21]!==x||t[22]!==b?(S=(0,Z.jsxs)(`div`,{className:`ok-embed`,style:d,ref:o,contentEditable:!1,children:[b,x]}),t[20]=d,t[21]=x,t[22]=b,t[23]=S):S=t[23],S}function Xh(e){if(!e)return``;let t,n=null;try{let r=new URL(e,`https://placeholder.local`);n=r.protocol,t=r.pathname}catch{t=e.split(`?`)[0]??e}if(n===`data:`||n===`blob:`)return``;let r=t.split(`/`),i=r[r.length-1]??``;try{return decodeURIComponent(i)}catch{return i}}function Zh(e){let t=(0,$.c)(18),n;t[0]!==e.name||t[1]!==e.src?(n=e.name?.trim()||Xh(e.src)||`Untitled file`,t[0]=e.name,t[1]=e.src,t[2]=n):n=t[2];let r=n,i=e.size?.trim()?e.size:null,a;t[3]===e.src?a=t[4]:(a=e.src?_n(e.src):void 0,t[3]=e.src,t[4]=a);let o=a,s;t[5]===o?s=t[6]:(s=e=>{e.stopPropagation(),e.preventDefault(),o&&window.open(o,`_blank`,`noopener,noreferrer`)},t[5]=o,t[6]=s);let c=s,l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(ns,{className:`ok-file-icon`,"aria-hidden":`true`}),t[7]=l):l=t[7];let u;t[8]===r?u=t[9]:(u=(0,Z.jsx)(`span`,{className:`ok-file-name`,children:r}),t[8]=r,t[9]=u);let d;t[10]===i?d=t[11]:(d=i?(0,Z.jsx)(`span`,{className:`ok-file-size`,children:i}):null,t[10]=i,t[11]=d);let f;return t[12]!==c||t[13]!==o||t[14]!==e.title||t[15]!==u||t[16]!==d?(f=(0,Z.jsxs)(`a`,{href:o,title:e.title,className:`ok-file-attachment`,target:`_blank`,rel:`noopener noreferrer`,onMouseDown:Qh,onClick:c,children:[l,u,d]}),t[12]=c,t[13]=o,t[14]=e.title,t[15]=u,t[16]=d,t[17]=f):f=t[17],f}function Qh(e){return e.stopPropagation()}function $h(){return Q.createElement(`svg`,{"aria-hidden":`true`,"data-rmiz-btn-unzoom-icon":!0,fill:`currentColor`,focusable:`false`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`},Q.createElement(`path`,{d:`M 14.144531 1.148438 L 9 6.292969 L 9 3 L 8 3 L 8 8 L 13 8 L 13 7 L 9.707031 7 L 14.855469 1.851563 Z M 8 8 L 3 8 L 3 9 L 6.292969 9 L 1.148438 14.144531 L 1.851563 14.855469 L 7 9.707031 L 7 13 L 8 13 Z`}))}function eg(){return Q.createElement(`svg`,{"aria-hidden":`true`,"data-rmiz-btn-zoom-icon":!0,fill:`currentColor`,focusable:`false`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`},Q.createElement(`path`,{d:`M 9 1 L 9 2 L 12.292969 2 L 2 12.292969 L 2 9 L 1 9 L 1 14 L 6 14 L 6 13 L 2.707031 13 L 13 2.707031 L 13 6 L 14 6 L 14 1 Z`}))}function tg(e){return typeof Element>`u`?!1:e instanceof Element}var ng=(e,t)=>tg(t)&&t.tagName.toUpperCase()===e,rg=e=>ng(`DIV`,e)||ng(`SPAN`,e),ig=e=>ng(`IMG`,e),ag=e=>e.complete&&e.naturalHeight!==0,og=e=>ng(`SVG`,e),sg=({height:e,offset:t,width:n})=>Math.min((window.innerWidth-t*2)/n,(window.innerHeight-t*2)/e),cg=({containerHeight:e,containerWidth:t,offset:n,targetHeight:r,targetWidth:i})=>{let a=sg({height:r,offset:n,width:i}),o=i>r?i/t:r/e;return a>1?o:a*o},lg=({containerHeight:e,containerWidth:t,hasScalableSrc:n,offset:r,targetHeight:i,targetWidth:a})=>e===0||t===0?1:!n&&i!==0&&a!==0?cg({containerHeight:e,containerWidth:t,offset:r,targetHeight:i,targetWidth:a}):sg({height:e,offset:r,width:t}),ug=/url(?:\(['"]?)(?<url>.*?)(?:['"]?\))/,dg=e=>{if(e!==null){if(ig(e))return e.currentSrc===``?void 0:e.currentSrc;if(rg(e)){let{backgroundImage:t}=window.getComputedStyle(e);if(t!==``)return ug.exec(t)?.[1]}}},fg=e=>{if(e!==null)return ig(e)?e.alt:e.getAttribute(`aria-label`)??void 0},pg=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s})=>{let c=lg({containerHeight:e,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s});return{top:n,left:t,width:r*c,height:e*c,transform:`translate(0,0) scale(${1/c})`}},mg=({position:e,relativeNum:t})=>{let n=parseFloat(e);return e.endsWith(`%`)?t*n/100:n},hg=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,objectFit:a,objectPosition:o,offset:s,targetHeight:c,targetWidth:l})=>{let u=a;if(u===`scale-down`&&(u=l<=r&&c<=e?`none`:`contain`),u===`cover`||u===`contain`){let a=r/l,d=e/c,f=u===`cover`?Math.max(a,d):Math.min(a,d),[p=`50%`,m=`50%`]=o.split(` `),h=mg({position:p,relativeNum:r-l*f}),g=mg({position:m,relativeNum:e-c*f}),_=lg({containerHeight:c*f,containerWidth:l*f,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{top:n+g,left:t+h,width:l*f*_,height:c*f*_,transform:`translate(0,0) scale(${1/_})`}}else if(u===`none`){let[a=`50%`,u=`50%`]=o.split(` `),d=mg({position:a,relativeNum:r-l}),f=mg({position:u,relativeNum:e-c}),p=lg({containerHeight:c,containerWidth:l,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{top:n+f,left:t+d,width:l*p,height:c*p,transform:`translate(0,0) scale(${1/p})`}}else if(u===`fill`){let t=r/l,n=e/c,a=Math.max(t,n),o=lg({containerHeight:c*a,containerWidth:l*a,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{width:r*o,height:e*o,transform:`translate(0,0) scale(${1/o})`}}else return{}},gg=({backgroundPosition:e,backgroundSize:t,containerHeight:n,containerLeft:r,containerTop:i,containerWidth:a,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l})=>{if(t===`cover`||t===`contain`){let u=a/l,d=n/c,f=t===`cover`?Math.max(u,d):Math.min(u,d),[p=`50%`,m=`50%`]=e.split(` `),h=mg({position:p,relativeNum:a-l*f}),g=mg({position:m,relativeNum:n-c*f}),_=lg({containerHeight:c*f,containerWidth:l*f,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+g,left:r+h,width:l*f*_,height:c*f*_,transform:`translate(0,0) scale(${1/_})`}}else if(t===`auto`){let[t=`50%`,u=`50%`]=e.split(` `),d=mg({position:t,relativeNum:a-l}),f=mg({position:u,relativeNum:n-c}),p=lg({containerHeight:c,containerWidth:l,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+f,left:r+d,width:l*p,height:c*p,transform:`translate(0,0) scale(${1/p})`}}else{let[u=`50%`,d=`50%`]=t.split(` `),f=mg({position:u,relativeNum:a}),p=mg({position:d,relativeNum:n}),m=f/l,h=p/c,g=Math.min(m,h),[_=`50%`,v=`50%`]=e.split(` `),y=mg({position:_,relativeNum:a-l*g}),b=mg({position:v,relativeNum:n-c*g}),x=lg({containerHeight:c*g,containerWidth:l*g,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l});return{top:i+b,left:r+y,width:l*g*x,height:c*g*x,transform:`translate(0,0) scale(${1/x})`}}},_g=/\.svg$/i,vg=({hasZoomImg:e,imgSrc:t,isSvg:n,isZoomed:r,loadedImgEl:i,offset:a,shouldRefresh:o,targetEl:s})=>{let c=n||t?.slice(0,18)===`data:image/svg+xml`||e||t!==void 0&&_g.test(t),l=s.getBoundingClientRect(),u=window.getComputedStyle(s),d=i!=null&&rg(s),f=i!=null&&!d,p=i!=null&&i.naturalHeight!==0?i.naturalHeight:l.height,m=i!=null&&i.naturalWidth!==0?i.naturalWidth:l.width,h=pg({containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}),g=f?hg({containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,objectFit:u.objectFit,objectPosition:u.objectPosition,offset:a,targetHeight:p,targetWidth:m}):void 0,_=d?gg({backgroundPosition:u.backgroundPosition,backgroundSize:u.backgroundSize,containerHeight:l.height,containerLeft:l.left,containerTop:l.top,containerWidth:l.width,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}):void 0,v={...h,...g,..._};if(r){let e=window.innerWidth/2,t=window.innerHeight/2,n=parseFloat(String(v.left??0))+parseFloat(String(v.width??0))/2,r=parseFloat(String(v.top??0))+parseFloat(String(v.height??0))/2,i=e-n,a=t-r;o&&(v.transitionDuration=`0.01ms`),v.transform=`translate(${i}px,${a}px) scale(1)`}return v},yg=e=>{if(e==null)return{};if(og(e)){let{parentElement:t}=e,n=e.getBoundingClientRect();if(t==null)return{height:n.height,left:n.left,width:n.width,top:n.top};{let e=t.getBoundingClientRect();return{height:n.height,left:e.left-n.left,top:e.top-n.top,width:n.width}}}else return{height:e.offsetHeight,left:e.offsetLeft,width:e.offsetWidth,top:e.offsetTop}},bg=e=>{let t=`-zoom`,n=[`clip-path`,`fill`,`mask`,`marker-start`,`marker-mid`,`marker-end`],r=new Map;if(e.hasAttribute(`id`)){let{id:n}=e,i=n+t;r.set(n,i);let a=e;a.id=i}e.querySelectorAll(`[id]`).forEach(e=>{let{id:n}=e,i=n+t;r.set(n,i);let a=e;a.id=i}),r.forEach((t,r)=>{let i=`url(#${r})`,a=`url(#${t})`,o=n.map(e=>`[${e}="${i}"]`).join(`, `);e.querySelectorAll(o).forEach(e=>{n.forEach(t=>{e.getAttribute(t)===i&&e.setAttribute(t,a)})})}),e.querySelectorAll(`style`).forEach(e=>{r.forEach((t,n)=>{let{textContent:r}=e;if(r!==``){let i=e;i.textContent=r.replaceAll(`#${n}`,`#${t}`)}})})},xg=[`img`,`svg`,`[role="img"]`,`[data-zoom]`].map(e=>`${e}:not([aria-hidden="true"])`).join(`,`),Sg={overflow:``,width:``};function Cg(){let e=document.querySelector(`[data-rmiz-portal]`);if(e!=null)return e;let t=document.createElement(`div`);return t.setAttribute(`data-rmiz-portal`,``),document.body.appendChild(t),t}function wg(e){e.preventDefault()}function Tg(e){return Q.createElement(Eg,{...e})}var Eg=class extends Q.Component{constructor(){super(...arguments),this.state={id:``,isZoomImgLoaded:!1,loadedImgEl:void 0,modalState:`UNLOADED`,shouldRefresh:!1,styleGhost:{}},this.refContent=Q.createRef(),this.refDialog=Q.createRef(),this.refModalContent=Q.createRef(),this.refModalImg=Q.createRef(),this.refWrap=Q.createRef(),this.imgEl=null,this.isScaling=!1,this.prevBodyAttrs=Sg,this.styleModalImg={},this.handleModalStateChange=e=>{let{state:{modalState:t}}=this;e!==`LOADING`&&t===`LOADING`?(this.loadZoomImg(),window.addEventListener(`resize`,this.handleResize,{passive:!0}),window.addEventListener(`touchstart`,this.handleTouchStart,{passive:!0}),window.addEventListener(`touchmove`,this.handleTouchMove,{passive:!0}),window.addEventListener(`touchend`,this.handleTouchEnd,{passive:!0}),window.addEventListener(`touchcancel`,this.handleTouchCancel,{passive:!0}),document.addEventListener(`keydown`,this.handleKeyDown,!0)):e!==`LOADED`&&t===`LOADED`?window.addEventListener(`wheel`,this.handleWheel,{passive:!0}):e!==`UNLOADING`&&t===`UNLOADING`?(this.ensureImgTransitionEnd(),window.removeEventListener(`wheel`,this.handleWheel),window.removeEventListener(`touchstart`,this.handleTouchStart),window.removeEventListener(`touchmove`,this.handleTouchMove),window.removeEventListener(`touchend`,this.handleTouchEnd),window.removeEventListener(`touchcancel`,this.handleTouchCancel),document.removeEventListener(`keydown`,this.handleKeyDown,!0)):e!==`UNLOADED`&&t===`UNLOADED`&&(this.bodyScrollEnable(),window.removeEventListener(`resize`,this.handleResize),this.refModalImg.current?.removeEventListener(`transitionend`,this.handleImgTransitionEnd),this.refDialog.current?.close())},this.setId=()=>{let e=()=>Math.random().toString(16).slice(-4);this.setState({id:e()+e()+e()})},this.setAndTrackImg=()=>{let{refContent:{current:e}}=this;e!=null&&(this.imgEl=e.querySelector(xg),this.imgEl===null?this.contentNotFoundChangeObserver??(this.contentNotFoundChangeObserver=new MutationObserver(this.setAndTrackImg),this.contentNotFoundChangeObserver.observe(e,{childList:!0,subtree:!0})):(this.contentNotFoundChangeObserver?.disconnect(),this.imgEl.addEventListener(`load`,this.handleImgLoad),this.imgEl.addEventListener(`click`,this.handleZoom),this.state.loadedImgEl??this.handleImgLoad(),this.imgElResizeObserver=new ResizeObserver(e=>{let[t]=e;t?.target!==void 0&&(this.imgEl=t.target,this.setState({styleGhost:yg(this.imgEl)}))}),this.imgElResizeObserver.observe(this.imgEl),this.contentChangeObserver??(this.contentChangeObserver=new MutationObserver(()=>{this.setState({styleGhost:yg(this.imgEl)})}),this.contentChangeObserver.observe(e,{attributes:!0,childList:!0,subtree:!0}))))},this.handleIfZoomChanged=e=>{let{props:{isZoomed:t}}=this;!e&&t?this.zoom():e&&!t&&this.unzoom()},this.handleImgLoad=()=>{let e=dg(this.imgEl);if(e==null||e===``)return;let t=new Image,{imgEl:n}=this;if(ig(n)){let{sizes:e,srcset:r,crossOrigin:i}=n;t.sizes=e,t.srcset=r,t.crossOrigin=i}t.src=e;let r=()=>{this.setState({loadedImgEl:t,styleGhost:yg(this.imgEl)})};t.decode().then(r).catch(()=>{if(ag(t)){r();return}t.onload=r})},this.handleZoom=e=>{this.props.isDisabled!==!0&&this.hasImage()&&this.props.onZoomChange?.(!0,{event:e})},this.handleUnzoom=e=>{this.props.isDisabled!==!0&&this.props.onZoomChange?.(!1,{event:e})},this.handleBtnUnzoomClick=e=>{e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e)},this.handleDialogClick=e=>{(e.target===this.refModalContent.current||e.target===this.refModalImg.current)&&(e.stopPropagation(),this.handleUnzoom(e))},this.handleDialogClose=e=>{e.stopPropagation(),this.handleUnzoom(e)},this.handleKeyDown=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e))},this.handleWheel=e=>{e.ctrlKey||(e.stopPropagation(),queueMicrotask(()=>{this.handleUnzoom(e)}))},this.handleTouchStart=e=>{if(e.touches.length>1){this.isScaling=!0;return}let{changedTouches:t}=e,[n]=t;if(t.length===1&&n!==void 0){let{screenY:e}=n;this.touchYStart=e}},this.handleTouchMove=e=>{let t=window.visualViewport?.scale??1,{changedTouches:n}=e,[r]=n;if(this.props.canSwipeToUnzoom&&!this.isScaling&&t<=1&&this.touchYStart!=null&&r!==void 0){let{screenY:t}=r;this.touchYEnd=t;let n=Math.max(this.touchYStart,this.touchYEnd),i=Math.min(this.touchYStart,this.touchYEnd);Math.abs(n-i)>this.props.swipeToUnzoomThreshold&&(this.touchYStart=void 0,this.touchYEnd=void 0,this.handleUnzoom(e))}},this.handleTouchEnd=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleTouchCancel=()=>{this.isScaling=!1,this.touchYStart=void 0,this.touchYEnd=void 0},this.handleResize=()=>{this.setState({shouldRefresh:!0})},this.hasImage=()=>this.imgEl!==null&&(this.state.loadedImgEl!==void 0||og(this.imgEl))&&window.getComputedStyle(this.imgEl).display!==`none`,this.zoom=()=>{this.bodyScrollDisable(),this.refDialog.current?.showModal(),this.refModalImg.current?.addEventListener(`transitionend`,this.handleImgTransitionEnd),this.setState({modalState:`LOADING`})},this.unzoom=()=>{this.setState({modalState:`UNLOADING`})},this.handleImgTransitionEnd=()=>{clearTimeout(this.timeoutTransitionEnd),this.state.modalState===`LOADING`?this.setState({modalState:`LOADED`}):this.state.modalState===`UNLOADING`&&this.setState({shouldRefresh:!1,modalState:`UNLOADED`})},this.ensureImgTransitionEnd=()=>{if(this.refModalImg.current!==null){let{transitionDuration:e}=window.getComputedStyle(this.refModalImg.current),t=parseFloat(e);if(t!==0&&!Number.isNaN(t)){let n=t*(e.endsWith(`ms`)?1:1e3)+50;this.timeoutTransitionEnd=setTimeout(this.handleImgTransitionEnd,n)}}},this.bodyScrollDisable=()=>{this.prevBodyAttrs={overflow:document.body.style.overflow,width:document.body.style.width};let{body:{clientWidth:e}}=document;document.body.style.overflow=`hidden`,document.body.style.width=`${e}px`},this.bodyScrollEnable=()=>{let{prevBodyAttrs:{overflow:e,width:t}}=this;document.body.style.width=t,document.body.style.overflow=e,this.prevBodyAttrs=Sg},this.loadZoomImg=()=>{let{props:{zoomImg:e}}=this;if(e==null)return;let{src:t}=e;if(t!==void 0&&t!==``){let n=new Image;n.sizes=e.sizes??``,n.srcset=e.srcSet??``,n.crossOrigin=e.crossOrigin??void 0,n.src=t;let r=()=>{this.setState({isZoomImgLoaded:!0})};n.decode().then(r).catch(()=>{if(ag(n)){r();return}n.onload=r})}},this.UNSAFE_handleSvg=()=>{let{imgEl:e,refModalImg:t,styleModalImg:n}=this;if(og(e)){let r=e.cloneNode(!0);bg(r),r.style.width=`${n.width??0}px`,r.style.height=`${n.height??0}px`,r.addEventListener(`click`,this.handleUnzoom),t.current?.firstChild?.remove(),t.current?.appendChild(r)}}}render(){let{handleBtnUnzoomClick:e,handleDialogClick:t,handleDialogClose:n,handleUnzoom:r,handleZoom:i,imgEl:a,props:{a11yNameButtonUnzoom:o,a11yNameButtonZoom:s,children:c,classDialog:l,IconUnzoom:u,IconZoom:d,isZoomed:f,wrapElement:p,ZoomContent:m,zoomImg:h,zoomMargin:g},refContent:_,refDialog:v,refModalContent:y,refModalImg:b,refWrap:x,state:{id:S,isZoomImgLoaded:C,loadedImgEl:w,modalState:T,shouldRefresh:E,styleGhost:D}}=this,O=`rmiz-modal-${S}`,k=`rmiz-modal-img-${S}`,A=rg(a),j=ig(a),M=og(a),N=fg(a),P=dg(a),F=j?a.sizes:void 0,I=j?a.srcset:void 0,L=j?a.crossOrigin:void 0,R=h?.src!==void 0&&h.src!==``,z=this.hasImage(),B=N!==void 0&&N!==``?`${s}: ${N}`:s,V=T===`LOADING`||T===`LOADED`,H=z?`found`:`not-found`,U=T===`UNLOADED`||T===`UNLOADING`?`hidden`:`visible`,ee={visibility:T===`UNLOADED`?`visible`:`hidden`};this.styleModalImg=z&&a!==null?vg({hasZoomImg:R,imgSrc:P,isSvg:M,isZoomed:f&&V,loadedImgEl:w,offset:g,shouldRefresh:E,targetEl:a}):{};let te=null;if(z){let t=j||A?Q.createElement(`img`,{alt:N,crossOrigin:L,sizes:F,src:P,srcSet:I,...C&&T===`LOADED`?h:{},"data-rmiz-modal-img":``,height:this.styleModalImg.height??void 0,id:k,ref:b,style:this.styleModalImg,width:this.styleModalImg.width??void 0}):M?Q.createElement(`div`,{"data-rmiz-modal-img":!0,ref:b,style:this.styleModalImg}):null,n=Q.createElement(`button`,{"aria-label":o,"data-rmiz-btn-unzoom":``,onClick:e,type:`button`},Q.createElement(u,null));te=m==null?Q.createElement(Q.Fragment,null,t,n):Q.createElement(m,{buttonUnzoom:n,modalState:T,img:t,isZoomImgLoaded:C,onUnzoom:r})}return Q.createElement(p,{"aria-owns":z?O:void 0,"data-rmiz":``,ref:x},Q.createElement(p,{"data-rmiz-content":H,ref:_,style:ee},c),z&&Q.createElement(p,{"data-rmiz-ghost":``,style:D},Q.createElement(`button`,{"aria-label":B,"data-rmiz-btn-zoom":``,onClick:i,type:`button`},Q.createElement(d,null))),z&&Ls.createPortal(Q.createElement(`dialog`,{"aria-labelledby":k,"aria-modal":`true`,className:l,"data-rmiz-modal":``,id:O,onClick:t,onClose:n,onCancel:wg,ref:v,role:`dialog`},Q.createElement(`div`,{"data-rmiz-modal-overlay":U}),Q.createElement(`div`,{"data-rmiz-modal-content":``,ref:y},te)),Cg()))}componentDidMount(){this.setId(),this.setAndTrackImg(),this.handleImgLoad(),this.UNSAFE_handleSvg()}componentWillUnmount(){this.state.modalState!==`UNLOADED`&&this.bodyScrollEnable(),this.contentChangeObserver?.disconnect(),this.contentNotFoundChangeObserver?.disconnect(),this.imgElResizeObserver?.disconnect(),this.imgEl?.removeEventListener(`load`,this.handleImgLoad),this.imgEl?.removeEventListener(`click`,this.handleZoom),this.refModalImg.current?.removeEventListener(`transitionend`,this.handleImgTransitionEnd),window.removeEventListener(`wheel`,this.handleWheel),window.removeEventListener(`touchstart`,this.handleTouchStart),window.removeEventListener(`touchmove`,this.handleTouchMove),window.removeEventListener(`touchend`,this.handleTouchEnd),window.removeEventListener(`touchcancel`,this.handleTouchCancel),window.removeEventListener(`resize`,this.handleResize),document.removeEventListener(`keydown`,this.handleKeyDown,!0)}componentDidUpdate(e,t){this.handleModalStateChange(t.modalState),this.UNSAFE_handleSvg(),this.handleIfZoomChanged(e.isZoomed)}};Eg.defaultProps={a11yNameButtonUnzoom:`Minimize image`,a11yNameButtonZoom:`Expand image`,canSwipeToUnzoom:!0,IconUnzoom:$h,IconZoom:eg,isDisabled:!1,swipeToUnzoomThreshold:10,wrapElement:`div`,zoomMargin:0};function Dg({onZoomChange:e,...t}){let[n,r]=Q.useState(!1),i=Q.useCallback((t,{event:n})=>{r(t),e?.(t,{event:n})},[e]);return Q.createElement(Tg,{...t,isZoomed:n,onZoomChange:i})}var Og=e(t(((e,t)=>{(function(e){let n=`(0?\\d+|0x[a-f0-9]+)`,r={fourOctet:RegExp(`^${n}\\.${n}\\.${n}\\.${n}$`,`i`),threeOctet:RegExp(`^${n}\\.${n}\\.${n}$`,`i`),twoOctet:RegExp(`^${n}\\.${n}$`,`i`),longValue:RegExp(`^${n}$`,`i`)},i=RegExp(`^0[0-7]+$`,`i`),a=RegExp(`^0x[a-f0-9]+$`,`i`),o=`%[0-9a-z]{1,}`,s=`(?:[0-9a-f]+::?)+`,c={zoneIndex:new RegExp(o,`i`),native:RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${o})?$`,`i`),deprecatedTransitional:RegExp(`^(?:::)(${n}\\.${n}\\.${n}\\.${n}(${o})?)$`,`i`),transitional:RegExp(`^((?:${s})|(?:::)(?:${s})?)${n}\\.${n}\\.${n}\\.${n}(${o})?$`,`i`)};function l(e,t){if(e.indexOf(`::`)!==e.lastIndexOf(`::`))return null;let n=0,r=-1,i=(e.match(c.zoneIndex)||[])[0],a,o;for(i&&(i=i.substring(1),e=e.replace(/%.+$/,``));(r=e.indexOf(`:`,r+1))>=0;)n++;if(e.substr(0,2)===`::`&&n--,e.substr(-2,2)===`::`&&n--,n>t)return null;for(o=t-n,a=`:`;o--;)a+=`0:`;return e=e.replace(`::`,a),e[0]===`:`&&(e=e.slice(1)),e[e.length-1]===`:`&&(e=e.slice(0,-1)),t=(function(){let t=e.split(`:`),n=[];for(let e=0;e<t.length;e++)n.push(parseInt(t[e],16));return n})(),{parts:t,zoneId:i}}function u(e,t,n,r){if(e.length!==t.length)throw Error(`ipaddr: cannot match CIDR for objects with different lengths`);let i=0,a;for(;r>0;){if(a=n-r,a<0&&(a=0),e[i]>>a!==t[i]>>a)return!1;r-=n,i+=1}return!0}function d(e){if(a.test(e))return parseInt(e,16);if(e[0]===`0`&&!isNaN(parseInt(e[1],10))){if(i.test(e))return parseInt(e,8);throw Error(`ipaddr: cannot parse ${e} as octal`)}return parseInt(e,10)}function f(e,t){for(;e.length<t;)e=`0${e}`;return e}let p={};p.IPv4=(function(){function e(e){if(e.length!==4)throw Error(`ipaddr: ipv4 octet count should be 4`);let t,n;for(t=0;t<e.length;t++)if(n=e[t],!(0<=n&&n<=255))throw Error(`ipaddr: ipv4 octet should fit in 8 bits`);this.octets=e}return e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]],as112:[[new e([192,175,48,0]),24],[new e([192,31,196,0]),24]],amt:[[new e([192,52,193,0]),24]]},e.prototype.kind=function(){return`ipv4`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv4`)throw Error(`ipaddr: cannot match ipv4 address with non-ipv4 one`);return u(this.octets,e.octets,8,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},r,i,a;for(r=3;r>=0;--r)if(i=this.octets[r],i in n){if(a=n[i],t&&a!==0)return null;a!==8&&(t=!0),e+=a}else return null;return 32-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){return this.octets.slice(0)},e.prototype.toIPv4MappedAddress=function(){return p.IPv6.parse(`::ffff:${this.toString()}`)},e.prototype.toNormalizedString=function(){return this.toString()},e.prototype.toString=function(){return this.octets.join(`.`)},e})(),p.IPv4.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<4;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.isIPv4=function(e){return this.parser(e)!==null},p.IPv4.isValid=function(e){try{return new this(this.parser(e)),!0}catch{return!1}},p.IPv4.isValidCIDR=function(e){try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv4.isValidFourPartDecimal=function(e){return!!(p.IPv4.isValid(e)&&e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},p.IPv4.isValidCIDRFourPartDecimal=function(e){let t=e.match(/^(.+)\/(\d+)$/);return!p.IPv4.isValidCIDR(e)||!t?!1:p.IPv4.isValidFourPartDecimal(t[1])},p.IPv4.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<4;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch{throw Error(`ipaddr: the address does not have IPv4 CIDR format`)}},p.IPv4.parse=function(e){let t=this.parser(e);if(t===null)throw Error(`ipaddr: string is not formatted like an IPv4 Address`);return new this(t)},p.IPv4.parseCIDR=function(e){let t;if(t=e.match(/^(.+)\/(\d+)$/)){let e=parseInt(t[2]);if(e>=0&&e<=32){let n=[this.parse(t[1]),e];return Object.defineProperty(n,`toString`,{value:function(){return this.join(`/`)}}),n}}throw Error(`ipaddr: string is not formatted like an IPv4 CIDR range`)},p.IPv4.parser=function(e){let t,n,i;if(t=e.match(r.fourOctet))return(function(){let e=t.slice(1,6),r=[];for(let t=0;t<e.length;t++)n=e[t],r.push(d(n));return r})();if(t=e.match(r.longValue)){if(i=d(t[1]),i>4294967295||i<0)throw Error(`ipaddr: address outside defined range`);return(function(){let e=[],t;for(t=0;t<=24;t+=8)e.push(i>>t&255);return e})().reverse()}else if(t=e.match(r.twoOctet))return(function(){let e=t.slice(1,4),n=[];if(i=d(e[1]),i>16777215||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(i>>16&255),n.push(i>>8&255),n.push(i&255),n})();else if(t=e.match(r.threeOctet))return(function(){let e=t.slice(1,5),n=[];if(i=d(e[2]),i>65535||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(d(e[1])),n.push(i>>8&255),n.push(i&255),n})();else return null},p.IPv4.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>32)throw Error(`ipaddr: invalid IPv4 prefix length`);let t=[0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<4&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.IPv6=(function(){function e(e,t){let n,r;if(e.length===16)for(this.parts=[],n=0;n<=14;n+=2)this.parts.push(e[n]<<8|e[n+1]);else if(e.length===8)this.parts=e;else throw Error(`ipaddr: ipv6 part count should be 8 or 16`);for(n=0;n<this.parts.length;n++)if(r=this.parts[n],!(0<=r&&r<=65535))throw Error(`ipaddr: ipv6 part should fit in 16 bits`);t&&(this.zoneId=t)}return e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],deprecatedSiteLocal:[new e([65216,0,0,0,0,0,0,0]),10],discard:[new e([256,0,0,0,0,0,0,0]),64],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[[new e([100,65435,0,0,0,0,0,0]),96],[new e([100,65435,1,0,0,0,0,0]),48]],"6to4":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[[new e([8193,4,274,0,0,0,0,0]),48],[new e([9760,79,32768,0,0,0,0,0]),48]],deprecatedOrchid:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new e([8193,48,0,0,0,0,0,0]),28],segmentRouting:[new e([24320,0,0,0,0,0,0,0]),16],reserved:[[new e([8193,0,0,0,0,0,0,0]),23],[new e([8193,3512,0,0,0,0,0,0]),32],[new e([16383,0,0,0,0,0,0,0]),20]]},e.prototype.isIPv4MappedAddress=function(){return this.range()===`ipv4Mapped`},e.prototype.kind=function(){return`ipv6`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv6`)throw Error(`ipaddr: cannot match ipv6 address with non-ipv6 one`);return u(this.parts,e.parts,16,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},r,i;for(let a=7;a>=0;--a)if(r=this.parts[a],r in n){if(i=n[r],t&&i!==0)return null;i!==16&&(t=!0),e+=i}else return null;return 128-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){let e,t=[],n=this.parts;for(let r=0;r<n.length;r++)e=n[r],t.push(e>>8),t.push(e&255);return t},e.prototype.toFixedLengthString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(f(this.parts[t].toString(16),4));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw Error(`ipaddr: trying to convert a generic ipv6 address to ipv4`);let e=this.parts.slice(-2),t=e[0],n=e[1];return new p.IPv4([t>>8,t&255,n>>8,n&255])},e.prototype.toNormalizedString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(this.parts[t].toString(16));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toRFC5952String=function(){let e=/((^|:)(0(:|$)){2,})/g,t=this.toNormalizedString(),n=0,r=-1,i;for(;i=e.exec(t);)i[0].length>r&&(n=i.index,r=i[0].length);return r<0?t:`${t.substring(0,n)}::${t.substring(n+r)}`},e.prototype.toString=function(){return this.toRFC5952String()},e})(),p.IPv6.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<16;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.isIPv6=function(e){return this.parser(e)!==null},p.IPv6.isValid=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{let t=this.parser(e);return new this(t.parts,t.zoneId),!0}catch{return!1}},p.IPv6.isValidCIDR=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv6.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<16;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`)}},p.IPv6.parse=function(e){let t=this.parser(e);if(t.parts===null)throw Error(`ipaddr: string is not formatted like an IPv6 Address`);return new this(t.parts,t.zoneId)},p.IPv6.parseCIDR=function(e){let t,n,r;if((n=e.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]),t>=0&&t<=128))return r=[this.parse(n[1]),t],Object.defineProperty(r,`toString`,{value:function(){return this.join(`/`)}}),r;throw Error(`ipaddr: string is not formatted like an IPv6 CIDR range`)},p.IPv6.parser=function(e){let t,n,r,i,a,o;if(r=e.match(c.deprecatedTransitional))return this.parser(`::ffff:${r[1]}`);if(c.native.test(e))return l(e,8);if((r=e.match(c.transitional))&&(o=r[6]||``,t=r[1],r[1].endsWith(`::`)||(t=t.slice(0,-1)),t=l(t+o,6),t.parts)){for(a=[parseInt(r[2]),parseInt(r[3]),parseInt(r[4]),parseInt(r[5])],n=0;n<a.length;n++)if(i=a[n],!(0<=i&&i<=255))return null;return t.parts.push(a[0]<<8|a[1]),t.parts.push(a[2]<<8|a[3]),{parts:t.parts,zoneId:t.zoneId}}return null},p.IPv6.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),e<0||e>128)throw Error(`ipaddr: invalid IPv6 prefix length`);let t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<16&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.fromByteArray=function(e){let t=e.length;if(t===4)return new p.IPv4(e);if(t===16)return new p.IPv6(e);throw Error(`ipaddr: the binary input is neither an IPv6 nor IPv4 address`)},p.isValid=function(e){return p.IPv6.isValid(e)||p.IPv4.isValid(e)},p.isValidCIDR=function(e){return p.IPv6.isValidCIDR(e)||p.IPv4.isValidCIDR(e)},p.parse=function(e){if(p.IPv6.isValid(e))return p.IPv6.parse(e);if(p.IPv4.isValid(e))return p.IPv4.parse(e);throw Error(`ipaddr: the address has neither IPv6 nor IPv4 format`)},p.parseCIDR=function(e){try{return p.IPv6.parseCIDR(e)}catch{try{return p.IPv4.parseCIDR(e)}catch{throw Error(`ipaddr: the address has neither IPv6 nor IPv4 CIDR format`)}}},p.process=function(e){let t=this.parse(e);return t.kind()===`ipv6`&&t.isIPv4MappedAddress()?t.toIPv4Address():t},p.subnetMatch=function(e,t,n){let r,i,a,o;for(i in n??=`unicast`,t)if(Object.prototype.hasOwnProperty.call(t,i)){for(a=t[i],a[0]&&!(a[0]instanceof Array)&&(a=[a]),r=0;r<a.length;r++)if(o=a[r],e.kind()===o[0].kind()&&e.match.apply(e,o))return i}return n},t!==void 0&&t.exports?t.exports=p:e.ipaddr=p})(e)}))(),1),kg=new Set([`href`,`src`,`srcset`,`poster`,`formaction`,`xlink:href`]),Ag=new Set([`aria-label`,`aria-description`,`title`]),jg=/(?:[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^\s"'<>]+|(?:javascript|vbscript|data|file|chrome-extension|moz-extension):[^\s"'<>]*)/gi,Mg=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,Ng=/\bexpression\s*\(/i,Pg=/(oklch|oklab|lab|lch)\(\s*([^)]+)\s*\)/gi,Fg=`data-clipboard-omit`;function Ig(e){let t=e.trim();return t===``||et.test(t)?!0:xr(t)}function Lg(e){let t=e.split(`,`);for(let e of t){let t=e.trim();if(t!==``&&!Ig(t.split(/\s+/)[0]??``))return!1}return!0}function Rg(e,t){let n=!1,r=e.replace(jg,e=>Ig(e)?e:(n=!0,`[blocked]`));return t?.reportNoChange&&!n?null:r}function zg(e){let t=e.toLowerCase();return t.length>=3&&t.startsWith(`on`)}function Bg(e){return e.length>1e4||Mg.test(e)||Ng.test(e)?``:e}function Vg(e){let t=e.indexOf(`/`),n=(t===-1?e:e.slice(0,t)).trim(),r=t===-1?null:e.slice(t+1).trim(),i=n.split(/[\s,]+/).filter(e=>e.length>0);if(i.length!==3)return null;let a=Hg(i[0],1),o=Hg(i[1],1),s=Hg(i[2],1);if(Number.isNaN(a)||Number.isNaN(o)||Number.isNaN(s))return null;let c=null;if(r!==null){if(c=Hg(r,1),Number.isNaN(c))return null;c=Math.max(0,Math.min(1,c))}return[a,o,s,c]}function Hg(e,t){return e===`none`?0:e.endsWith(`%`)?Number.parseFloat(e.slice(0,-1))/100*t:Number.parseFloat(e)}function Ug(e,t,n){let r=n*Math.PI/180;return[e,t*Math.cos(r),t*Math.sin(r)]}function Wg(e,t,n){let r=e+.3963377774*t+.2158037573*n,i=e-.1055613458*t-.0638541728*n,a=e-.0894841775*t-1.291485548*n,o=r**3,s=i**3,c=a**3;return[4.0767416621*o-3.3077115913*s+.2309699292*c,-1.2684380046*o+2.6097574011*s-.3413193965*c,-.0041960863*o-.7034186147*s+1.707614701*c]}function Gg(e){return e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055}function Kg(e){return Number.isFinite(e)?Math.max(0,Math.min(255,Math.round(e*255))):0}function qg(e,t,n,r){let i=e.toLowerCase(),a,o,s;i===`oklch`?[a,o,s]=Ug(t,n,r):i===`oklab`?[a,o,s]=[t,n,r]:i===`lch`?[a,o,s]=Ug(t/100,n/100,r):[a,o,s]=[t/100,n/100,r/100];let[c,l,u]=Wg(a,o,s);return[Kg(Gg(c)),Kg(Gg(l)),Kg(Gg(u))]}function Jg(e){if(e.length>1e4)return e;let t=e.toLowerCase();return!t.includes(`oklch`)&&!t.includes(`oklab`)&&!t.includes(`lab`)&&!t.includes(`lch`)?e:e.replace(Pg,(e,t,n)=>{let r=Vg(n);if(r===null)return e;let[i,a,o,s]=r,[c,l,u]=qg(t,i,a,o);return s===null?`rgb(${c}, ${l}, ${u})`:`rgba(${c}, ${l}, ${u}, ${s})`})}var Yg=new Set([`mailto`,`tel`,`sms`,`ftp`,`ftps`]);function Xg(e){let t=e.trim();if(t.startsWith(`#`))return{portable:!0};if(xr(t))return t.startsWith(`/`)?{portable:!1,reason:`server-absolute`}:{portable:!1,reason:`relative`};let n=new URL(t),r=n.protocol.slice(0,-1).toLowerCase();if(Yg.has(r))return{portable:!0};if(r!==`http`&&r!==`https`)return{portable:!1,reason:`other`};let i=n.hostname.toLowerCase();if(i===``)return{portable:!1,reason:`other`};let a=i.endsWith(`.`)?i.slice(0,-1):i;if(a===`localhost`||a.endsWith(`.localhost`))return{portable:!1,reason:`localhost`};let o=i.startsWith(`[`)&&i.endsWith(`]`)?i.slice(1,-1):i;return Og.IPv4.isValid(o)?Og.IPv4.parse(o).range()===`unicast`?{portable:!0}:{portable:!1,reason:`private-ip`}:Og.IPv6.isValid(o)?Og.IPv6.parse(o).range()===`unicast`?{portable:!0}:{portable:!1,reason:`private-ip`}:{portable:!0}}function Zg(e,t){return typeof e==`number`&&typeof t==`number`&&e>0&&t>0}function Qg(e,t,n){return Zg(e,t)?{...n,width:`${e}px`,aspectRatio:`${e} / ${t}`}:n}function $g(e){let t=(0,$.c)(61),n,r,i,a,s,c,l,u,d,f,p,m;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]):({width:m,height:r,loadingTestId:d,slotTestId:f,slotClassName:c,className:n,onLoad:s,onError:a,src:l,style:u,alt:p,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m);let h=d===void 0?`image-loading-skeleton`:d,g=f===void 0?`image-slot`:f,_=p===void 0?``:p,{_:y}=o(),b=(0,Q.useRef)(null),[x,S]=(0,Q.useState)(!1),[C,w]=(0,Q.useState)(!1),T;t[13]!==r||t[14]!==m?(T=Zg(m,r),t[13]=r,t[14]=m,t[15]=T):T=t[15];let E=T,D;t[16]!==r||t[17]!==u||t[18]!==m?(D=Qg(m,r,u),t[16]=r,t[17]=u,t[18]=m,t[19]=D):D=t[19];let O=D,k;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{b.current?.complete?S(!0):S(!1),w(!1)},t[20]=k):k=t[20];let A;t[21]===l?A=t[22]:(A=[l],t[21]=l,t[22]=A),(0,Q.useLayoutEffect)(k,A);let j=_&&_.length>0?_:l??``,M=C?`true`:void 0,N=!E&&!x&&!C&&`aspect-[16/9] w-full max-w-full`,P;t[23]!==c||t[24]!==N?(P=v(`relative inline-block overflow-hidden`,N,c),t[23]=c,t[24]=N,t[25]=P):P=t[25];let F;t[26]!==y||t[27]!==C||t[28]!==x||t[29]!==h?(F=!x&&!C&&(0,Z.jsx)(`span`,{"data-testid":h,role:`status`,"aria-busy":`true`,"aria-label":y({id:`N1YYa7`}),className:`absolute inset-0 animate-pulse rounded-md bg-muted motion-reduce:animate-none`}),t[26]=y,t[27]=C,t[28]=x,t[29]=h,t[30]=F):F=t[30];let I=C||void 0,L=x?`opacity-100`:`opacity-0`,R;t[31]!==n||t[32]!==L?(R=v(`block max-w-full transition-opacity motion-reduce:transition-none`,L,n),t[31]=n,t[32]=L,t[33]=R):R=t[33];let z;t[34]===s?z=t[35]:(z=e=>{S(!0),w(!1),s?.(e)},t[34]=s,t[35]=z);let B;t[36]===a?B=t[37]:(B=e=>{S(!0),w(!0),a?.(e)},t[36]=a,t[37]=B);let V;t[38]!==_||t[39]!==r||t[40]!==i||t[41]!==l||t[42]!==I||t[43]!==R||t[44]!==z||t[45]!==B||t[46]!==m?(V=(0,Z.jsx)(`img`,{...i,ref:b,src:l,alt:_,width:m,height:r,hidden:I,className:R,onLoad:z,onError:B}),t[38]=_,t[39]=r,t[40]=i,t[41]=l,t[42]=I,t[43]=R,t[44]=z,t[45]=B,t[46]=m,t[47]=V):V=t[47];let H;t[48]!==y||t[49]!==j||t[50]!==C||t[51]!==l?(H=C&&(0,Z.jsxs)(`span`,{role:`img`,"aria-label":y({id:`qlnfTD`,values:{errorLabel:j}}),"data-clipboard-omit":`true`,className:`inline-flex max-w-full items-center gap-2 rounded-md border border-dashed border-border bg-muted/40 px-2 py-1 text-muted-foreground`,children:[(0,Z.jsx)(cs,{"aria-hidden":`true`,className:`size-3.5 shrink-0 opacity-70`}),(0,Z.jsx)(`span`,{className:`text-xs font-medium`,children:y({id:`nL-HHD`})}),l?(0,Z.jsx)(`span`,{className:`max-w-[24ch] truncate font-mono text-xs opacity-70`,title:l,children:l}):null]}),t[48]=y,t[49]=j,t[50]=C,t[51]=l,t[52]=H):H=t[52];let U;return t[53]!==O||t[54]!==g||t[55]!==P||t[56]!==F||t[57]!==V||t[58]!==H||t[59]!==M?(U=(0,Z.jsxs)(`span`,{"data-testid":g,"data-image-error":M,className:P,style:O,children:[F,V,H]}),t[53]=O,t[54]=g,t[55]=P,t[56]=F,t[57]=V,t[58]=H,t[59]=M,t[60]=U):U=t[60],U}function e_(e){return e??`lazy`}function t_(e){if(typeof e!=`string`)return e;let t=Number(e);return Number.isFinite(t)&&t>0?t:e}function n_(e){let t=(0,$.c)(21),n;t[0]===e.src?n=t[1]:(n=e.src===void 0?void 0:_n(e.src),t[0]=e.src,t[1]=n);let r=e.alt??``,i;t[2]===e.width?i=t[3]:(i=t_(e.width),t[2]=e.width,t[3]=i);let a;t[4]===e.height?a=t[5]:(a=t_(e.height),t[4]=e.height,t[5]=a);let o=e.title,s;t[6]===e.loading?s=t[7]:(s=e_(e.loading),t[6]=e.loading,t[7]=s);let c;return t[8]!==e.crossorigin||t[9]!==e.decoding||t[10]!==e.fetchpriority||t[11]!==e.referrerpolicy||t[12]!==e.sizes||t[13]!==e.srcset||t[14]!==e.title||t[15]!==n||t[16]!==r||t[17]!==i||t[18]!==a||t[19]!==s?(c=(0,Z.jsx)($g,{src:n,alt:r,width:i,height:a,title:o,loading:s,srcSet:e.srcset,sizes:e.sizes,decoding:e.decoding,fetchPriority:e.fetchpriority,crossOrigin:e.crossorigin,referrerPolicy:e.referrerpolicy}),t[8]=e.crossorigin,t[9]=e.decoding,t[10]=e.fetchpriority,t[11]=e.referrerpolicy,t[12]=e.sizes,t[13]=e.srcset,t[14]=e.title,t[15]=n,t[16]=r,t[17]=i,t[18]=a,t[19]=s,t[20]=c):c=t[20],c}function r_(e){let t=(0,$.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={sizes:void 0},t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,Z.jsx)(Dg,{wrapElement:`span`,zoomMargin:20,zoomImg:n,children:(0,Z.jsx)(n_,{...e})}),t[1]=e,t[2]=r),r}var i_=(0,Q.lazy)(async()=>{let{default:e}=await n(async()=>{let{default:e}=await import(`./katex-BE6VA85g.js`);return{default:e}},[],import.meta.url);function t(t){let n=(0,$.c)(7),r;n[0]===t.formula?r=n[1]:(r=e.renderToString(t.formula,{displayMode:!0,throwOnError:!1,strict:`ignore`,trust:!1}),n[0]=t.formula,n[1]=r);let i=r,a;n[2]===i?a=n[3]:(a={__html:i},n[2]=i,n[3]=a);let o;return n[4]!==t.id||n[5]!==a?(o=(0,Z.jsx)(`div`,{className:`math math-display`,"data-component-type":`math`,id:t.id,dangerouslySetInnerHTML:a}),n[4]=t.id,n[5]=a,n[6]=o):o=n[6],o}return{default:t}});function a_(e){let t=(0,$.c)(3),n=e.formula||`\xA0`,r;return t[0]!==e.id||t[1]!==n?(r=(0,Z.jsx)(`div`,{className:`math math-placeholder`,"data-component-type":`math`,id:e.id,children:n}),t[0]=e.id,t[1]=n,t[2]=r):r=t[2],r}function o_(e){let t=(0,$.c)(6),n=e.formula??``;if(!n){let r;return t[0]!==n||t[1]!==e.id?(r=(0,Z.jsx)(a_,{formula:n,id:e.id}),t[0]=n,t[1]=e.id,t[2]=r):r=t[2],r}let r;return t[3]!==n||t[4]!==e.id?(r=(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(a_,{formula:n,id:e.id}),children:(0,Z.jsx)(i_,{formula:n,id:e.id})}),t[3]=n,t[4]=e.id,t[5]=r):r=t[5],r}function s_(e,t){if(e.type===`mdxJsxFlowElement`){let n=e;if(n.name===`MirrorSource`){for(let e of n.attributes??[])if(e.type===`mdxJsxAttribute`&&e.name===`id`&&typeof e.value==`string`&&e.value===t)return n}}let n=e.children;if(Array.isArray(n))for(let e of n){let n=s_(e,t);if(n)return n}return null}function c_(e){return Ot({type:`root`,children:e.children??[]})}var l_=new Map,u_=30,d_=150,f_=1e4;function p_(e,t){let n=`${e}|${t}`,r=l_.get(n);if(r)return r.refcount+=1,r;let i=new Ha,a=new io({url:e,name:t,document:i}),o=new Set,s={provider:a,ySource:i.getText(`source`),refcount:1,synced:!1,subscribers:o};return a.on(`synced`,()=>{s.synced=!0;for(let e of o)e.onSynced()}),s.ySource.observe(()=>{for(let e of o)e.onUpdate()}),l_.set(n,s),l_.size>u_&&console.warn(`[Mirror] provider pool exceeded ${u_} entries (current=${l_.size}). Many Mirrors pointing at distinct source docs — investigate if this is a runaway pattern.`),s}function m_(e,t){let n=`${e}|${t}`,r=l_.get(n);if(r&&(--r.refcount,r.refcount<=0)){try{r.provider.destroy()}catch(e){console.warn(`[Mirror] provider.destroy() failed during release`,{src:t,err:e})}l_.delete(n)}}function h_(e,t){let n=(0,$.c)(8),{collabUrl:r}=mo(),i;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={kind:`loading`},n[0]=i):i=n[0];let[a,o]=(0,Q.useState)(i),s=(0,Q.useRef)(t),c=(0,Q.useRef)(null),l,u;n[1]!==r||n[2]!==e?(l=()=>{if(!e){o({kind:`empty-props`});return}if(!r){o({kind:`loading`});return}let t=p_(r,e),n=()=>{let n=s.current;if(!n){o({kind:`empty-props`});return}let r=t.ySource.toString();if(!r){o(t.synced?{kind:`source-removed`}:{kind:`loading`});return}let i;try{i=be().parseToMdast(r)}catch(t){console.warn(`[Mirror] parseToMdast failed`,{src:e,anchor:n,err:t}),o({kind:`source-removed`});return}let a=s_(i,n);if(!a){o({kind:`anchor-not-found`});return}let c;try{c=c_(a)}catch(t){console.warn(`[Mirror] renderMirrorSubtree failed`,{src:e,anchor:n,err:t}),o({kind:`anchor-not-found`});return}o({kind:`ready`,html:c})},i=null,a={onUpdate:()=>{i&&clearTimeout(i),i=setTimeout(()=>{i=null,n()},d_)},onSynced:()=>{i&&=(clearTimeout(i),null),n()}};t.subscribers.add(a),c.current=n;let l=setTimeout(()=>{t.synced||o({kind:`source-removed`})},f_);return n(),()=>{clearTimeout(l),i&&clearTimeout(i),t.subscribers.delete(a),c.current=null,m_(r,e)}},u=[r,e],n[1]=r,n[2]=e,n[3]=l,n[4]=u):(l=n[3],u=n[4]),(0,Q.useEffect)(l,u);let d,f;return n[5]===t?(d=n[6],f=n[7]):(d=()=>{s.current=t,c.current?.()},f=[t],n[5]=t,n[6]=d,n[7]=f),(0,Q.useEffect)(d,f),a}function g_(e){let t=(0,$.c)(8),n=`ok-mirror-state flex items-start gap-2 rounded-md border border-dashed px-3 py-2 text-sm ${e.tone===`error`?`border-destructive/40 text-destructive`:`border-border text-muted-foreground`}`,r;t[0]===e.tone?r=t[1]:(r=e.tone===`error`?(0,Z.jsx)(fs,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}):(0,Z.jsx)(ms,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}),t[0]=e.tone,t[1]=r);let i;t[2]===e.children?i=t[3]:(i=(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:e.children}),t[2]=e.children,t[3]=i);let a;return t[4]!==n||t[5]!==r||t[6]!==i?(a=(0,Z.jsxs)(`div`,{className:n,children:[r,i]}),t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function __(e){let t=(0,$.c)(30),n=e.src??``,r=e.anchor??``,i=h_(n,r);if(i.kind===`empty-props`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(g_,{tone:`placeholder`,children:(0,Z.jsx)(a,{id:`3SDfZl`,components:{0:(0,Z.jsx)(`span`,{className:`font-medium`}),1:(0,Z.jsx)(`code`,{}),2:(0,Z.jsx)(`code`,{}),3:(0,Z.jsx)(`code`,{})}})}),t[0]=e):e=t[0],e}if(i.kind===`loading`){let e=n&&r?`${n}#${r}`:``,i;t[1]===e?i=t[2]:(i={mirrorRef:e},t[1]=e,t[2]=i);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o={0:(0,Z.jsx)(`code`,{})},t[3]=o):o=t[3];let s;return t[4]===i?s=t[5]:(s=(0,Z.jsx)(g_,{tone:`placeholder`,children:(0,Z.jsx)(a,{id:`92rbk2`,values:i,components:o})}),t[4]=i,t[5]=s),s}if(i.kind===`source-removed`){let e;t[6]===n?e=t[7]:(e={src:n},t[6]=n,t[7]=e);let r;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,Z.jsx)(`span`,{className:`font-medium`}),1:(0,Z.jsx)(`code`,{})},t[8]=r):r=t[8];let i;return t[9]===e?i=t[10]:(i=(0,Z.jsx)(g_,{tone:`error`,children:(0,Z.jsx)(a,{id:`Ud0Pj9`,values:e,components:r})}),t[9]=e,t[10]=i),i}if(i.kind===`anchor-not-found`){let e=`<MirrorSource id="${r}">`,i;t[11]!==e||t[12]!==n?(i={mirrorSourceTag:e,src:n},t[11]=e,t[12]=n,t[13]=i):i=t[13];let o;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(o={0:(0,Z.jsx)(`span`,{className:`font-medium`}),1:(0,Z.jsx)(`code`,{}),2:(0,Z.jsx)(`code`,{})},t[14]=o):o=t[14];let s;return t[15]===i?s=t[16]:(s=(0,Z.jsx)(g_,{tone:`error`,children:(0,Z.jsx)(a,{id:`mqSwZH`,values:i,components:o})}),t[15]=i,t[16]=s),s}let o;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Gr,{className:`size-3`,"aria-hidden":`true`}),t[17]=o):o=t[17];let s;t[18]===n?s=t[19]:(s={src:n},t[18]=n,t[19]=s);let c;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(c={0:(0,Z.jsx)(`code`,{className:`font-mono`})},t[20]=c):c=t[20];let l;t[21]===s?l=t[22]:(l=(0,Z.jsxs)(`div`,{className:`ok-mirror-badge pointer-events-none absolute -top-2.5 left-2 flex items-center gap-1 rounded-md bg-background px-1.5 text-xs text-muted-foreground opacity-0 transition-opacity [.jsx-component-wrapper:hover_&]:opacity-100 [.jsx-component-wrapper[data-selected="true"]_&]:opacity-100`,"aria-hidden":`true`,children:[o,(0,Z.jsx)(`span`,{children:(0,Z.jsx)(a,{id:`wQp1V3`,values:s,components:c})})]}),t[21]=s,t[22]=l);let u;t[23]===i.html?u=t[24]:(u=(0,Z.jsx)(`div`,{dangerouslySetInnerHTML:{__html:i.html}}),t[23]=i.html,t[24]=u);let d;return t[25]!==r||t[26]!==n||t[27]!==l||t[28]!==u?(d=(0,Z.jsxs)(`div`,{className:`ok-mirror-resolved relative -mx-3 prose-no-margin rounded-md border border-dashed border-transparent px-3 py-2 transition-colors [.jsx-component-wrapper:hover_&]:border-border/40 [.jsx-component-wrapper[data-selected="true"]_&]:border-border/40`,"data-mirror-src":n,"data-mirror-anchor":r,children:[l,u]}),t[25]=r,t[26]=n,t[27]=l,t[28]=u,t[29]=d):d=t[29],d}function v_(e){let t=(0,$.c)(15),{_:n}=o(),r=e.id??``,i;t[0]!==n||t[1]!==r?(i=r||n({id:`12F9WL`}),t[0]=n,t[1]=r,t[2]=i):i=t[2];let s=i,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Qo,{className:`size-3`,"aria-hidden":`true`}),t[3]=c):c=t[3];let l;t[4]===s?l=t[5]:(l={label:s},t[4]=s,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u={0:(0,Z.jsx)(`code`,{className:`font-mono`})},t[6]=u):u=t[6];let d;t[7]===l?d=t[8]:(d=(0,Z.jsxs)(`div`,{className:`ok-mirror-source-badge pointer-events-none absolute -top-2.5 left-2 flex items-center gap-1 rounded-md bg-background px-1.5 text-xs text-muted-foreground opacity-0 transition-opacity [.jsx-component-wrapper:hover_&]:opacity-100 [.jsx-component-wrapper[data-selected="true"]_&]:opacity-100`,children:[c,(0,Z.jsx)(`span`,{children:(0,Z.jsx)(a,{id:`Zon_qG`,values:l,components:u})})]}),t[7]=l,t[8]=d);let f;t[9]===e.children?f=t[10]:(f=(0,Z.jsx)(`div`,{children:e.children}),t[9]=e.children,t[10]=f);let p;return t[11]!==r||t[12]!==d||t[13]!==f?(p=(0,Z.jsxs)(`div`,{className:`ok-mirror-source relative -mx-3 rounded-md border border-dashed border-transparent px-3 py-1 transition-colors [.jsx-component-wrapper:hover_&]:border-border/50 [.jsx-component-wrapper[data-selected="true"]_&]:border-border/50`,"data-mirror-source-id":r,children:[d,f]}),t[11]=r,t[12]=d,t[13]=f,t[14]=p):p=t[14],p}var y_=24,b_=24,x_=12,S_=.1;function C_(e,t,n,r){if(n<=0&&(e===`fit-width`||e===`two-odd`||e===`two-even`)||r<=0&&e===`fit-height`)return 1;switch(e){case`fit-width`:return Math.max(S_,(n-y_)/t.naturalWidth);case`fit-height`:return Math.max(S_,(r-b_)/t.naturalHeight);case`single`:return 1;case`two-odd`:case`two-even`:return Math.max(S_,((n-y_)/2-x_)/t.naturalWidth)}}var w_=600,T_=.5,E_=3,D_=.25,O_=null;function k_(){return O_||(O_=(async()=>{let e=await n(()=>import(`./pdf-CvpTyCsQ.js`),__vite__mapDeps([0,1]),import.meta.url);if(!e.GlobalWorkerOptions.workerSrc){let t=(await n(async()=>{let{default:e}=await import(`./pdf.worker-Dwl0H-tq.js`);return{default:e}},[],import.meta.url)).default;e.GlobalWorkerOptions.workerSrc=t}return e})(),O_.catch(()=>{O_=null})),O_}function A_(e){return e instanceof Error&&e.name===`RenderingCancelledException`}function j_(e){let t=(0,$.c)(96),n,r;if(t[0]!==e.anchor||t[1]!==e.fillContainer){let{height:i,viewerFragment:a}=Qe(e.anchor);n=i===null?e.fillContainer?`100%`:`${w_}px`:`${i}px`,r=L_(a),t[0]=e.anchor,t[1]=e.fillContainer,t[2]=n,t[3]=r}else n=t[2],r=t[3];let i=r,s=(0,Q.useRef)(null),c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=[],t[4]=c):c=t[4];let l=(0,Q.useRef)(c),u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],t[5]=u):u=t[5];let d=(0,Q.useRef)(u),f=(0,Q.useRef)(null),p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],t[6]=p):p=t[6];let[m,h]=(0,Q.useState)(p),[g,_]=(0,Q.useState)(!0),[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(i??1),[S,C]=(0,Q.useState)(String(i??1)),[w,T]=(0,Q.useState)(1),[E,D]=(0,Q.useState)(`fit-width`),[O,k]=(0,Q.useState)(!1),[A,j]=(0,Q.useState)(!1),[M,N]=(0,Q.useState)(0),[P,F]=(0,Q.useState)(0),{_:I}=o(),L=m.length,R,z;t[7]!==I||t[8]!==e.src?(R=()=>{if(!e.src){_(!1);return}let t=_n(e.src),n=!1,r=null;return _(!0),y(null),(async()=>{try{let e=await(await k_()).getDocument({url:t,isEvalSupported:!1}).promise;if(n){await e.destroy();return}r=e,f.current=e;let i=[];for(let t=1;t<=e.numPages;t++){if(n)return;let r=(await e.getPage(t)).getViewport({scale:1});i.push({pageNumber:t,naturalWidth:r.width,naturalHeight:r.height})}if(n)return;h(i)}catch(e){let t=e;if(n)return;y(t instanceof Error?t.message:I({id:`jRHdCz`})),_(!1)}})(),()=>{n=!0,r&&=(r.destroy(),null),f.current=null}},z=[e.src,I],t[7]=I,t[8]=e.src,t[9]=R,t[10]=z):(R=t[9],z=t[10]),(0,Q.useEffect)(R,z);let B,V;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(B=()=>{let e=s.current;if(!e)return;let t=()=>{N(e.clientWidth),F(e.clientHeight)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},V=[],t[11]=B,t[12]=V):(B=t[11],V=t[12]),(0,Q.useEffect)(B,V);let H,U;t[13]!==I||t[14]!==P||t[15]!==M||t[16]!==E||t[17]!==m||t[18]!==w?(H=()=>{let e=f.current;if(!e||m.length===0||M===0)return;let t=!1,n=null;return(async()=>{try{let r=window.devicePixelRatio||1;for(let i of m){if(t)return;let a=l.current[i.pageNumber-1];if(!a)continue;let o=C_(E,i,M,P)*w,s=await e.getPage(i.pageNumber);if(t)return;let c=s.getViewport({scale:o});a.width=Math.floor(c.width*r),a.height=Math.floor(c.height*r),a.style.width=`${c.width}px`,a.style.height=`${c.height}px`;let u=a.getContext(`2d`);u&&(u.setTransform(r,0,0,r,0,0),n=s.render({canvas:a,canvasContext:u,viewport:c}),await n.promise,n=null)}t||_(!1)}catch(e){let n=e;if(t||A_(n))return;console.warn(`[Pdf] page render failed:`,n),y(n instanceof Error?n.message:I({id:`_TF8ep`})),_(!1)}})(),()=>{if(t=!0,n){try{n.cancel()}catch{}n=null}}},U=[m,E,w,M,P,I],t[13]=I,t[14]=P,t[15]=M,t[16]=E,t[17]=m,t[18]=w,t[19]=H,t[20]=U):(H=t[19],U=t[20]),(0,Q.useEffect)(H,U);let ee,te;t[21]!==m||t[22]!==O?(ee=()=>{if(!O)return;let e=f.current;if(!e||m.length===0)return;let t=!1,n=null;return(async()=>{try{let r=window.devicePixelRatio||1;for(let i of m){if(t)return;let a=d.current[i.pageNumber-1];if(!a)continue;let o=120/i.naturalWidth,s=await e.getPage(i.pageNumber);if(t)return;let c=s.getViewport({scale:o});a.width=Math.floor(c.width*r),a.height=Math.floor(c.height*r),a.style.width=`${c.width}px`,a.style.height=`${c.height}px`;let l=a.getContext(`2d`);l&&(l.setTransform(r,0,0,r,0,0),n=s.render({canvas:a,canvasContext:l,viewport:c}),await n.promise,n=null)}}catch(e){let t=e;A_(t)||console.warn(`[Pdf] thumbnail render failed:`,t)}})(),()=>{if(t=!0,n){try{n.cancel()}catch{}n=null}}},te=[O,m],t[21]=m,t[22]=O,t[23]=ee,t[24]=te):(ee=t[23],te=t[24]),(0,Q.useEffect)(ee,te);let W,ne;t[25]!==g||t[26]!==i?(W=()=>{if(g||!i)return;let e=s.current,t=l.current[i-1];e&&t&&(e.scrollTop=t.offsetTop-e.offsetTop)},ne=[g,i],t[25]=g,t[26]=i,t[27]=W,t[28]=ne):(W=t[27],ne=t[28]),(0,Q.useEffect)(W,ne);let re,ie;t[29]===m?(re=t[30],ie=t[31]):(re=()=>{let e=s.current;if(!e||m.length===0)return;let t=!1,n=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let n=e.scrollTop,r=1;for(let t of m){let i=l.current[t.pageNumber-1];i&&i.offsetTop-e.offsetTop<=n+40&&(r=t.pageNumber)}x(r),C(String(r))}))};return e.addEventListener(`scroll`,n,{passive:!0}),()=>e.removeEventListener(`scroll`,n)},ie=[m],t[29]=m,t[30]=re,t[31]=ie),(0,Q.useEffect)(re,ie);let ae,oe;t[32]===A?(ae=t[33],oe=t[34]):(ae=()=>{if(!A)return;let e=e=>{let t=e.target,n=s.current?.closest(`.ok-pdf`);if(!n||!t||!n.contains(t)){j(!1);return}let r=n.querySelector(`.ok-pdf-layout-menu`);r&&!r.contains(t)&&j(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},oe=[A],t[32]=A,t[33]=ae,t[34]=oe),(0,Q.useEffect)(ae,oe);let se;t[35]===L?se=t[36]:(se=e=>{let t=Math.max(1,Math.min(L||1,e));x(t),C(String(t));let n=s.current,r=l.current[t-1];n&&r&&n.scrollTo({top:r.offsetTop-n.offsetTop,behavior:`smooth`})},t[35]=L,t[36]=se);let ce=se,le;t[37]!==b||t[38]!==ce||t[39]!==S?(le=()=>{let e=Number.parseInt(S,10);if(Number.isNaN(e)){C(String(b));return}ce(e)},t[37]=b,t[38]=ce,t[39]=S,t[40]=le):le=t[40];let G=le,K;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(K=()=>T(F_),t[41]=K):K=t[41];let q=K,ue;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(ue=()=>T(P_),t[42]=ue):ue=t[42];let de=ue,fe;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(fe=e=>{D(e),j(!1),T(1)},t[43]=fe):fe=t[43];let pe=fe,me;t[44]===n?me=t[45]:(me={height:n},t[44]=n,t[45]=me);let he;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(he=()=>k(N_),t[46]=he):he=t[46];let ge;t[47]!==I||t[48]!==O?(ge=I(O?{id:`JK-Ave`}:{id:`iEYxO4`}),t[47]=I,t[48]=O,t[49]=ge):ge=t[49];let _e;t[50]===I?_e=t[51]:(_e=I({id:`zo3Dl7`}),t[50]=I,t[51]=_e);let J;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,Z.jsx)(bs,{size:14,"aria-hidden":`true`}),t[52]=J):J=t[52];let ve;t[53]!==O||t[54]!==ge||t[55]!==_e?(ve=(0,Z.jsx)(`button`,{type:`button`,onClick:he,"aria-label":ge,"aria-pressed":O,className:`ok-pdf-btn`,title:_e,children:J}),t[53]=O,t[54]=ge,t[55]=_e,t[56]=ve):ve=t[56];let ye=e.title??`PDF`,be;t[57]===ye?be=t[58]:(be=(0,Z.jsx)(`span`,{className:`ok-pdf-title`,children:ye}),t[57]=ye,t[58]=be);let xe;t[59]!==I||t[60]!==A||t[61]!==E||t[62]!==S||t[63]!==G||t[64]!==L||t[65]!==w?(xe=L>0&&(0,Z.jsxs)(`div`,{className:`ok-pdf-controls`,children:[(0,Z.jsx)(`form`,{className:`ok-pdf-page-form`,onSubmit:e=>{e.preventDefault(),G()},children:(0,Z.jsx)(`input`,{type:`text`,inputMode:`numeric`,pattern:`[0-9]*`,className:`ok-pdf-page-input`,value:S,onChange:e=>C(e.target.value.replace(/[^0-9]/g,``)),onBlur:G,"aria-label":I({id:`xsZhu-`})})}),(0,Z.jsx)(`span`,{className:`ok-pdf-page-of`,children:(0,Z.jsx)(a,{id:`1GhYxC`,values:{totalPages:L}})}),(0,Z.jsx)(`span`,{className:`ok-pdf-divider`,"aria-hidden":`true`}),(0,Z.jsx)(`button`,{type:`button`,onClick:de,disabled:w<=T_,"aria-label":I({id:`FjkaiT`}),className:`ok-pdf-btn`,title:I({id:`FjkaiT`}),children:(0,Z.jsx)(Ir,{size:14,"aria-hidden":`true`})}),(0,Z.jsxs)(`span`,{className:`ok-pdf-zoom-display`,"aria-live":`polite`,children:[Math.round(w*100),`%`]}),(0,Z.jsx)(`button`,{type:`button`,onClick:q,disabled:w>=E_,"aria-label":I({id:`AWOSPo`}),className:`ok-pdf-btn`,title:I({id:`AWOSPo`}),children:(0,Z.jsx)(Fr,{size:14,"aria-hidden":`true`})}),(0,Z.jsx)(`span`,{className:`ok-pdf-divider`,"aria-hidden":`true`}),(0,Z.jsxs)(`div`,{className:`ok-pdf-layout-menu`,children:[(0,Z.jsx)(`button`,{type:`button`,onClick:()=>j(M_),"aria-label":I({id:`GQDSBN`}),"aria-haspopup":`menu`,"aria-expanded":A,className:`ok-pdf-btn`,title:I({id:`rdU729`}),children:(0,Z.jsx)(Ur,{size:14,"aria-hidden":`true`})}),A&&(0,Z.jsxs)(`div`,{role:`menu`,className:`ok-pdf-menu`,children:[(0,Z.jsx)(I_,{label:I({id:`vIxrEk`}),active:E===`fit-width`,onSelect:()=>pe(`fit-width`)}),(0,Z.jsx)(I_,{label:I({id:`YlDuro`}),active:E===`fit-height`,onSelect:()=>pe(`fit-height`)}),(0,Z.jsx)(`hr`,{className:`ok-pdf-menu-divider`}),(0,Z.jsx)(I_,{label:I({id:`BGHHtQ`}),active:E===`single`,onSelect:()=>pe(`single`)}),(0,Z.jsx)(I_,{label:I({id:`xK291b`}),active:E===`two-odd`,onSelect:()=>pe(`two-odd`)}),(0,Z.jsx)(I_,{label:I({id:`NSnIUP`}),active:E===`two-even`,onSelect:()=>pe(`two-even`)})]})]})]}),t[59]=I,t[60]=A,t[61]=E,t[62]=S,t[63]=G,t[64]=L,t[65]=w,t[66]=xe):xe=t[66];let Se;t[67]!==ve||t[68]!==be||t[69]!==xe?(Se=(0,Z.jsxs)(`div`,{className:`ok-pdf-toolbar`,contentEditable:!1,children:[ve,be,xe]}),t[67]=ve,t[68]=be,t[69]=xe,t[70]=Se):Se=t[70];let Ce;t[71]!==I||t[72]!==b||t[73]!==ce||t[74]!==m||t[75]!==O?(Ce=O&&(0,Z.jsx)(`aside`,{className:`ok-pdf-sidebar`,"aria-label":I({id:`nzaV6Q`}),children:m.map((e,t)=>{let{pageNumber:n}=e;return(0,Z.jsxs)(`button`,{type:`button`,className:`ok-pdf-thumb`,"data-active":b===n||void 0,onClick:()=>ce(n),"aria-label":I({id:`qioCwA`,values:{pageNumber:n}}),children:[(0,Z.jsx)(`canvas`,{ref:e=>{d.current[t]=e},className:`ok-pdf-thumb-canvas`}),(0,Z.jsx)(`span`,{className:`ok-pdf-thumb-num`,children:n})]},n)})}),t[71]=I,t[72]=b,t[73]=ce,t[74]=m,t[75]=O,t[76]=Ce):Ce=t[76];let we;t[77]===g?we=t[78]:(we=g&&(0,Z.jsx)(`div`,{className:`ok-pdf-loading`,children:(0,Z.jsx)(a,{id:`T-654M`})}),t[77]=g,t[78]=we);let Te;t[79]===v?Te=t[80]:(Te=v&&(0,Z.jsx)(`div`,{className:`ok-pdf-error`,children:(0,Z.jsx)(a,{id:`WamGNs`,values:{error:v}})}),t[79]=v,t[80]=Te);let Ee;t[81]!==I||t[82]!==L?(Ee=Array.from({length:L},(e,t)=>{let n=t+1;return(0,Z.jsx)(`canvas`,{ref:e=>{l.current[t]=e},className:`ok-pdf-page`,"aria-label":I({id:`XtRoxT`,values:{pageNumber:n}})},n)}),t[81]=I,t[82]=L,t[83]=Ee):Ee=t[83];let De;t[84]!==E||t[85]!==we||t[86]!==Te||t[87]!==Ee?(De=(0,Z.jsxs)(`div`,{className:`ok-pdf-pages`,ref:s,"data-layout":E,children:[we,Te,Ee]}),t[84]=E,t[85]=we,t[86]=Te,t[87]=Ee,t[88]=De):De=t[88];let Oe;t[89]!==Ce||t[90]!==De?(Oe=(0,Z.jsxs)(`div`,{className:`ok-pdf-body`,children:[Ce,De]}),t[89]=Ce,t[90]=De,t[91]=Oe):Oe=t[91];let ke;return t[92]!==me||t[93]!==Se||t[94]!==Oe?(ke=(0,Z.jsxs)(`div`,{className:`ok-pdf`,style:me,children:[Se,Oe]}),t[92]=me,t[93]=Se,t[94]=Oe,t[95]=ke):ke=t[95],ke}function M_(e){return!e}function N_(e){return!e}function P_(e){return Math.max(T_,+(e-D_).toFixed(2))}function F_(e){return Math.min(E_,+(e+D_).toFixed(2))}function I_(e){let t=(0,$.c)(10),n=e.active||void 0,r;t[0]===e.active?r=t[1]:(r=e.active&&(0,Z.jsx)(Hr,{size:14}),t[0]=e.active,t[1]=r);let i;t[2]===r?i=t[3]:(i=(0,Z.jsx)(`span`,{className:`ok-pdf-menu-check`,"aria-hidden":`true`,children:r}),t[2]=r,t[3]=i);let a;return t[4]!==e.active||t[5]!==e.label||t[6]!==e.onSelect||t[7]!==n||t[8]!==i?(a=(0,Z.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.active,className:`ok-pdf-menu-item`,"data-active":n,onClick:e.onSelect,children:[i,e.label]}),t[4]=e.active,t[5]=e.label,t[6]=e.onSelect,t[7]=n,t[8]=i,t[9]=a):a=t[9],a}function L_(e){if(!e)return null;for(let t of e.split(`&`)){let e=t.indexOf(`=`);if(!(e<0)&&t.slice(0,e)===`page`){let n=Number.parseInt(t.slice(e+1),10);if(!Number.isNaN(n)&&n>=1)return n}}return null}function R_(e){let t=(0,$.c)(10),{label:n,id:r,children:i}=e,a=(0,Q.useId)(),o;t[0]!==r||t[1]!==a?(o=r||`tab-panel-${a.replace(/:/g,``)}`,t[0]=r,t[1]=a,t[2]=o):o=t[2];let s=o,c=`${s}-tab`,l;t[3]===n?l=t[4]:(l=n?.trim()||`Tab`,t[3]=n,t[4]=l);let u=l,d;return t[5]!==i||t[6]!==s||t[7]!==u||t[8]!==c?(d=(0,Z.jsx)(`section`,{className:`tab-panel`,id:s,role:`tabpanel`,"aria-labelledby":c,"data-tab-label":u,"data-tab-id":s,children:i}),t[5]=i,t[6]=s,t[7]=u,t[8]=c,t[9]=d):d=t[9],d}var z_=`:scope > .component-children > [data-node-view-content-react] > .react-renderer`;function B_(e){return Array.from(e.querySelectorAll(z_)).map((e,t)=>{let n=e.querySelector(`[data-tab-label]`);return{index:t,label:(n?.getAttribute(`data-tab-label`))?.trim()||`Tab ${t+1}`,panelId:n?.getAttribute(`data-tab-id`)??null}})}function V_(e,t){let n=Array.from(e.querySelectorAll(z_))[t];return n?n.querySelector(`[data-jsx-gear]`):null}function H_(e){let t=(0,$.c)(31),{id:n,children:r}=e,[i,a]=(0,Q.useState)(0),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[],t[0]=s):s=t[0];let[c,l]=(0,Q.useState)(s),u=(0,Q.useRef)(null),d=(0,Q.useRef)(null),f=(0,Q.useRef)(0),p=Br(),m=p?.addChild!=null,{_:h}=o(),g;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=u.current;if(!e)return;let t=B_(e);l(e=>{if(e.length!==t.length)return t;for(let n=0;n<e.length;n++)if(e[n].label!==t[n].label||e[n].panelId!==t[n].panelId)return t;return e})},t[1]=g):g=t[1],(0,Q.useLayoutEffect)(g);let _,v;t[2]===c.length?(_=t[3],v=t[4]):(_=()=>{c.length>f.current&&c.length>0&&a(c.length-1),f.current=c.length},v=[c.length],t[2]=c.length,t[3]=_,t[4]=v),(0,Q.useLayoutEffect)(_,v);let y;t[5]===n?y=t[6]:(y=()=>{let e=()=>{let e=window.location.hash.slice(1);if(!e)return;if(n&&e===n){a(0);return}let t=u.current;if(!t)return;let r=B_(t).findIndex(t=>t.panelId===e);r<0||(a(r),queueMicrotask(()=>{t.ownerDocument.getElementById(e)?.scrollIntoView({block:`start`,behavior:`auto`})}))};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},t[5]=n,t[6]=y),(0,Q.useLayoutEffect)(y);let b=c.length===0?0:Math.min(Math.max(i,0),c.length-1),x;t[7]!==c.length||t[8]!==b?(x=e=>{if(c.length===0)return;let t=null;e.key===`ArrowRight`?t=(b+1)%c.length:e.key===`ArrowLeft`?t=(b-1+c.length)%c.length:e.key===`Home`?t=0:e.key===`End`&&(t=c.length-1),t!==null&&(e.preventDefault(),a(t),(d.current?.querySelectorAll(`[role="tab"]`))?.[t]?.focus())},t[7]=c.length,t[8]=b,t[9]=x):x=t[9];let S=x,C=n?`Tabs: ${n}`:`Tabs`,w;t[10]!==c||t[11]!==b?(w=c.map(e=>(0,Z.jsx)(`button`,{id:e.panelId?`${e.panelId}-tab`:void 0,type:`button`,role:`tab`,className:`tabs-strip-pill`,"data-active":e.index===b,"aria-selected":e.index===b,"aria-controls":e.panelId??void 0,tabIndex:e.index===b?0:-1,onMouseDown:W_,onClick:()=>{if(e.index!==b){a(e.index);return}let t=u.current;t&&V_(t,e.index)?.click()},children:e.label},e.index)),t[10]=c,t[11]=b,t[12]=w):w=t[12];let T;t[13]!==S||t[14]!==C||t[15]!==w?(T=(0,Z.jsx)(`div`,{ref:d,role:`tablist`,"aria-label":C,className:`tabs-tablist`,onKeyDown:S,children:w}),t[13]=S,t[14]=C,t[15]=w,t[16]=T):T=t[16];let E;t[17]!==h||t[18]!==m||t[19]!==p?(E=m&&(0,Z.jsx)(`button`,{type:`button`,className:`tabs-strip-add`,"aria-label":h({id:`hjO0Mq`}),title:h({id:`hjO0Mq`}),onMouseDown:U_,onClick:()=>p?.addChild?.(),"data-tabs-strip-add":``,children:`+`}),t[17]=h,t[18]=m,t[19]=p,t[20]=E):E=t[20];let D;t[21]!==E||t[22]!==T?(D=(0,Z.jsxs)(`div`,{className:`tabs-strip`,contentEditable:!1,children:[T,E]}),t[21]=E,t[22]=T,t[23]=D):D=t[23];let O;t[24]!==r||t[25]!==b?(O=(0,Z.jsx)(`div`,{ref:u,className:`tabs-content`,"data-active-index":b,children:r}),t[24]=r,t[25]=b,t[26]=O):O=t[26];let k;return t[27]!==n||t[28]!==D||t[29]!==O?(k=(0,Z.jsxs)(`div`,{className:`tabs`,id:n,children:[D,O]}),t[27]=n,t[28]=D,t[29]=O,t[30]=k):k=t[30],k}function U_(e){return e.preventDefault()}function W_(e){return e.preventDefault()}var G_=typeof global<`u`&&{}.toString.call(global)===`[object global]`,K_=typeof Bun<`u`,q_=typeof Deno<`u`,J_=typeof WebSocketPair==`function`&&caches?.default!==void 0,Y_=G_||K_||q_||J_;function X_(e,t){return e.indexOf(t.toLowerCase())===0?e:`${t.toLowerCase()}${e.substr(0,1).toUpperCase()}${e.substr(1)}`}function Z_(e){return!!(e&&e.nodeType===1&&`nodeName`in e&&e.ownerDocument&&e.ownerDocument.defaultView)}function Q_(e){return!isNaN(parseFloat(e))&&isFinite(e)&&Math.floor(e)==e}function $_(e){return/^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))(?=$|\/)/.test(e)}function ev(e){return/^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))\/video\/\d+/.test(e)}function tv(e){let t=(e||``).match(/^(?:https?:)?(?:\/\/)?([^/?]+)/),n=(t&&t[1]||``).replace(`player.`,``);for(let e of[`.videoji.hk`,`.vimeo.work`,`.videoji.cn`])if(n.endsWith(e))return n;return`vimeo.com`}function nv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.id,n=e.url,r=t||n;if(!r)throw Error(`An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.`);if(Q_(r))return`https://vimeo.com/${r}`;if($_(r))return r.replace(`http:`,`https:`);throw TypeError(t?`“${t}” is not a valid video id.`:`“${r}” is not a vimeo.com url.`)}var rv=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`addEventListener`,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:`removeEventListener`,a=typeof t==`string`?[t]:t;return a.forEach(t=>{e[r](t,n)}),{cancel:()=>a.forEach(t=>e[i](t,n))}};function iv(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;if(!e||!t||typeof t.querySelectorAll!=`function`)return null;let n=t.querySelectorAll(`iframe`);for(let t=0;t<n.length;t++)if(n[t]&&n[t].contentWindow===e)return n[t];return null}var av=Array.prototype.indexOf!==void 0,ov=typeof window<`u`&&window.postMessage!==void 0;if(!Y_&&(!av||!ov))throw Error(`Sorry, the Vimeo Player API is not available in this browser.`);var sv=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function cv(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e){if(e.WeakMap)return;var t=Object.prototype.hasOwnProperty,n=Object.defineProperty&&function(){try{return Object.defineProperty({},`x`,{value:1}).x===1}catch{}}(),r=function(e,t,r){n?Object.defineProperty(e,t,{configurable:!0,writable:!0,value:r}):e[t]=r};e.WeakMap=function(){function e(){if(this===void 0)throw TypeError(`Constructor WeakMap requires 'new'`);if(r(this,`_id`,a(`_WeakMap`)),arguments.length>0)throw TypeError(`WeakMap iterable is not supported`)}r(e.prototype,`delete`,function(e){if(n(this,`delete`),!i(e))return!1;var t=e[this._id];return t&&t[0]===e?(delete e[this._id],!0):!1}),r(e.prototype,`get`,function(e){if(n(this,`get`),i(e)){var t=e[this._id];if(t&&t[0]===e)return t[1]}}),r(e.prototype,`has`,function(e){if(n(this,`has`),!i(e))return!1;var t=e[this._id];return!!(t&&t[0]===e)}),r(e.prototype,`set`,function(e,t){if(n(this,`set`),!i(e))throw TypeError(`Invalid value used as weak map key`);var a=e[this._id];return a&&a[0]===e?(a[1]=t,this):(r(e,this._id,[e,t]),this)});function n(e,n){if(!i(e)||!t.call(e,`_id`))throw TypeError(n+` method called on incompatible receiver `+typeof e)}function a(e){return e+`_`+o()+`.`+o()}function o(){return Math.random().toString().substring(2)}return r(e,`_polyfill`,!0),e}();function i(e){return Object(e)===e}})(typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:sv);var lv=cv(function(e){(function(t,n,r){n[t]=n[t]||r(),e.exports&&=n[t]})(`Promise`,sv,function(){var e,t,n,r=Object.prototype.toString,i=typeof setImmediate<`u`?function(e){return setImmediate(e)}:setTimeout;try{Object.defineProperty({},`x`,{}),e=function(e,t,n,r){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:r!==!1})}}catch{e=function(e,t,n){return e[t]=n,e}}n=function(){var e,n,r;function i(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(t,a){r=new i(t,a),n?n.next=r:e=r,n=r,r=void 0},drain:function(){var r=e;for(e=n=t=void 0;r;)r.fn.call(r.self),r=r.next}}}();function a(e,r){n.add(e,r),t||=i(n.drain)}function o(e){var t,n=typeof e;return e!=null&&(n==`object`||n==`function`)&&(t=e.then),typeof t==`function`?t:!1}function s(){for(var e=0;e<this.chain.length;e++)c(this,this.state===1?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function c(e,t,n){var r,i;try{t===!1?n.reject(e.msg):(r=t===!0?e.msg:t.call(void 0,e.msg),r===n.promise?n.reject(TypeError(`Promise-chain cycle`)):(i=o(r))?i.call(r,n.resolve,n.reject):n.resolve(r))}catch(e){n.reject(e)}}function l(e){var t,n=this;if(!n.triggered){n.triggered=!0,n.def&&(n=n.def);try{(t=o(e))?a(function(){var r=new f(n);try{t.call(e,function(){l.apply(r,arguments)},function(){u.apply(r,arguments)})}catch(e){u.call(r,e)}}):(n.msg=e,n.state=1,n.chain.length>0&&a(s,n))}catch(e){u.call(new f(n),e)}}}function u(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&a(s,t))}function d(e,t,n,r){for(var i=0;i<t.length;i++)(function(i){e.resolve(t[i]).then(function(e){n(i,e)},r)})(i)}function f(e){this.def=e,this.triggered=!1}function p(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function m(e){if(typeof e!=`function`)throw TypeError(`Not a function`);if(this.__NPO__!==0)throw TypeError(`Not a promise`);this.__NPO__=1;var t=new p(this);this.then=function(e,n){var r={success:typeof e==`function`?e:!0,failure:typeof n==`function`?n:!1};return r.promise=new this.constructor(function(e,t){if(typeof e!=`function`||typeof t!=`function`)throw TypeError(`Not a function`);r.resolve=e,r.reject=t}),t.chain.push(r),t.state!==0&&a(s,t),r.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,function(e){l.call(t,e)},function(e){u.call(t,e)})}catch(e){u.call(t,e)}}var h=e({},`constructor`,m,!1);return m.prototype=h,e(h,`__NPO__`,0,!1),e(m,`resolve`,function(e){var t=this;return e&&typeof e==`object`&&e.__NPO__===1?e:new t(function(t,n){if(typeof t!=`function`||typeof n!=`function`)throw TypeError(`Not a function`);t(e)})}),e(m,`reject`,function(e){return new this(function(t,n){if(typeof t!=`function`||typeof n!=`function`)throw TypeError(`Not a function`);n(e)})}),e(m,`all`,function(e){var t=this;return r.call(e)==`[object Array]`?e.length===0?t.resolve([]):new t(function(n,r){if(typeof n!=`function`||typeof r!=`function`)throw TypeError(`Not a function`);var i=e.length,a=Array(i),o=0;d(t,e,function(e,t){a[e]=t,++o===i&&n(a)},r)}):t.reject(TypeError(`Not an array`))}),e(m,`race`,function(e){var t=this;return r.call(e)==`[object Array]`?new t(function(n,r){if(typeof n!=`function`||typeof r!=`function`)throw TypeError(`Not a function`);d(t,e,function(e,t){n(t)},r)}):t.reject(TypeError(`Not an array`))}),m})}),uv=new WeakMap;function dv(e,t,n){let r=uv.get(e.element)||{};t in r||(r[t]=[]),r[t].push(n),uv.set(e.element,r)}function fv(e,t){return(uv.get(e.element)||{})[t]||[]}function pv(e,t,n){let r=uv.get(e.element)||{};if(!r[t])return!0;if(!n)return r[t]=[],uv.set(e.element,r),!0;let i=r[t].indexOf(n);return i!==-1&&r[t].splice(i,1),uv.set(e.element,r),r[t]&&r[t].length===0}function mv(e,t){let n=fv(e,t);if(n.length<1)return!1;let r=n.shift();return pv(e,t,r),r}function hv(e,t){let n=uv.get(e);uv.set(t,n),uv.delete(e)}function gv(e){if(typeof e==`string`)try{e=JSON.parse(e)}catch(e){return console.warn(e),{}}return e}function _v(e,t,n){if(!e.element.contentWindow||!e.element.contentWindow.postMessage)return;let r={method:t};n!==void 0&&(r.value=n);let i=parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/,`$1`));i>=8&&i<10&&(r=JSON.stringify(r)),e.element.contentWindow.postMessage(r,e.origin)}function vv(e,t){t=gv(t);let n=[],r;if(t.event)t.event===`error`&&fv(e,t.data.method).forEach(n=>{let r=Error(t.data.message);r.name=t.data.name,n.reject(r),pv(e,t.data.method,n)}),n=fv(e,`event:${t.event}`),r=t.data;else if(t.method){let i=mv(e,t.method);i&&(n.push(i),r=t.value)}n.forEach(t=>{try{if(typeof t==`function`){t.call(e,r);return}t.resolve(r)}catch{}})}var yv=`airplay.audio_tracks.audiotrack.autopause.autoplay.background.byline.cc.chapter_id.chapters.chromecast.color.colors.controls.disable_context_menu.dnt.end_time.fullscreen.height.id.initial_quality.interactive_params.keyboard.loop.maxheight.max_quality.maxwidth.min_quality.muted.play_button_position.playsinline.portrait.preload.progress_bar.quality.quality_selector.responsive.skipping_forward.speed.start_time.texttrack.thumbnail_id.title.transcript.transparent.unmute_button.url.vimeo_logo.volume.watch_full_video.width`.split(`.`);function bv(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return yv.reduce((t,n)=>{let r=e.getAttribute(`data-vimeo-${n}`);return(r||r===``)&&(t[n]=r===``?1:r),t},t)}function xv(e,t){let{html:n}=e;if(!t)throw TypeError(`An element must be provided`);if(t.getAttribute(`data-vimeo-initialized`)!==null)return t.querySelector(`iframe`);let r=document.createElement(`div`);return r.innerHTML=n,t.appendChild(r.firstChild),t.setAttribute(`data-vimeo-initialized`,`true`),t.querySelector(`iframe`)}function Sv(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((r,i)=>{if(!$_(e))throw TypeError(`“${e}” is not a vimeo.com url.`);let a=`https://${tv(e)}/api/oembed.json?url=${encodeURIComponent(e)}`;for(let e in t)t.hasOwnProperty(e)&&(a+=`&${e}=${encodeURIComponent(t[e])}`);let o=`XDomainRequest`in window?new XDomainRequest:new XMLHttpRequest;o.open(`GET`,a,!0),o.onload=function(){if(o.status===404){i(Error(`“${e}” was not found.`));return}if(o.status===403){i(Error(`“${e}” is not embeddable.`));return}try{let t=JSON.parse(o.responseText);if(t.domain_status_code===403){xv(t,n),i(Error(`“${e}” is not embeddable.`));return}r(t)}catch(e){i(e)}},o.onerror=function(){let e=o.status?` (${o.status})`:``;i(Error(`There was an error fetching the embed code from Vimeo${e}.`))},o.send()})}function Cv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,t=[].slice.call(e.querySelectorAll(`[data-vimeo-id], [data-vimeo-url]`)),n=e=>{`console`in window&&console.error&&console.error(`There was an error creating an embed: ${e}`)};t.forEach(e=>{try{if(e.getAttribute(`data-vimeo-defer`)!==null)return;let t=bv(e);Sv(nv(t),t,e).then(t=>xv(t,e)).catch(n)}catch(e){n(e)}})}function wv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;window.VimeoPlayerResizeEmbeds_||(window.VimeoPlayerResizeEmbeds_=!0,window.addEventListener(`message`,t=>{if(!$_(t.origin)||!t.data||t.data.event!==`spacechange`)return;let n=t.source?iv(t.source,e):null;if(n){let e=n.parentElement;e.style.paddingBottom=`${t.data.data[0].bottom}px`}}))}function Tv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;window.VimeoSeoMetadataAppended||(window.VimeoSeoMetadataAppended=!0,window.addEventListener(`message`,t=>{if(!$_(t.origin))return;let n=gv(t.data);if(!n||n.event!==`ready`)return;let r=t.source?iv(t.source,e):null;r&&ev(r.src)&&new Pv(r).callMethod(`appendVideoMetadata`,window.location.href)}))}function Ev(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;if(window.VimeoCheckedUrlTimeParam)return;window.VimeoCheckedUrlTimeParam=!0;let t=e=>{`console`in window&&console.error&&console.error(`There was an error getting video Id: ${e}`)};window.addEventListener(`message`,n=>{if(!$_(n.origin))return;let r=gv(n.data);if(!r||r.event!==`ready`)return;let i=n.source?iv(n.source,e):null;if(i&&ev(i.src)){let e=new Pv(i);e.getVideoId().then(t=>{let n=RegExp(`[?&]vimeo_t_${t}=([^&#]*)`).exec(window.location.href);if(n&&n[1]){let t=decodeURI(n[1]);e.setCurrentTime(t)}}).catch(t)}})}function Dv(){window.VimeoDRMEmbedsUpdated||(window.VimeoDRMEmbedsUpdated=!0,window.addEventListener(`message`,e=>{if(!$_(e.origin))return;let t=gv(e.data);if(!t||t.event!==`drminitfailed`)return;let n=e.source?iv(e.source):null;if(!n)return;let r=n.getAttribute(`allow`)||``;if(!r.includes(`encrypted-media`)){n.setAttribute(`allow`,`${r}; encrypted-media`);let e=new URL(n.getAttribute(`src`));e.searchParams.set(`forcereload`,`drm`),n.setAttribute(`src`,e.toString());return}}))}function Ov(){let e=function(){let e,t=[[`requestFullscreen`,`exitFullscreen`,`fullscreenElement`,`fullscreenEnabled`,`fullscreenchange`,`fullscreenerror`],[`webkitRequestFullscreen`,`webkitExitFullscreen`,`webkitFullscreenElement`,`webkitFullscreenEnabled`,`webkitfullscreenchange`,`webkitfullscreenerror`],[`webkitRequestFullScreen`,`webkitCancelFullScreen`,`webkitCurrentFullScreenElement`,`webkitCancelFullScreen`,`webkitfullscreenchange`,`webkitfullscreenerror`],[`mozRequestFullScreen`,`mozCancelFullScreen`,`mozFullScreenElement`,`mozFullScreenEnabled`,`mozfullscreenchange`,`mozfullscreenerror`],[`msRequestFullscreen`,`msExitFullscreen`,`msFullscreenElement`,`msFullscreenEnabled`,`MSFullscreenChange`,`MSFullscreenError`]],n=0,r=t.length,i={};for(;n<r;n++)if(e=t[n],e&&e[1]in document){for(n=0;n<e.length;n++)i[t[0][n]]=e[n];return i}return!1}(),t={fullscreenchange:e.fullscreenchange,fullscreenerror:e.fullscreenerror},n={request(t){return new Promise((r,i)=>{let a=function(){n.off(`fullscreenchange`,a),r()};n.on(`fullscreenchange`,a),t||=document.documentElement;let o=t[e.requestFullscreen]();o instanceof Promise&&o.then(a).catch(i)})},exit(){return new Promise((t,r)=>{if(!n.isFullscreen){t();return}let i=function(){n.off(`fullscreenchange`,i),t()};n.on(`fullscreenchange`,i);let a=document[e.exitFullscreen]();a instanceof Promise&&a.then(i).catch(r)})},on(e,n){let r=t[e];r&&document.addEventListener(r,n)},off(e,n){let r=t[e];r&&document.removeEventListener(r,n)}};return Object.defineProperties(n,{isFullscreen:{get(){return!!document[e.fullscreenElement]}},element:{enumerable:!0,get(){return document[e.fullscreenElement]}},isEnabled:{enumerable:!0,get(){return!!document[e.fullscreenEnabled]}}}),n}var kv={role:`viewer`,autoPlayMuted:!0,allowedDrift:.3,maxAllowedDrift:1,minCheckInterval:.1,maxRateAdjustment:.2,maxTimeToCatchUp:1},Av=class extends EventTarget{logger;constructor(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;super(),this.logger=r,this.init(t,e,{...kv,...n})}disconnect(){this.dispatchEvent(new Event(`disconnect`))}async init(e,t,n){if(await this.waitForTOReadyState(e,`open`),n.role===`viewer`){await this.updatePlayer(e,t,n);let r=rv(e,`change`,()=>this.updatePlayer(e,t,n)),i=this.maintainPlaybackPosition(e,t,n);this.addEventListener(`disconnect`,()=>{i.cancel(),r.cancel()})}else{await this.updateTimingObject(e,t);let n=rv(t,[`seeked`,`play`,`pause`,`ratechange`],()=>this.updateTimingObject(e,t),`on`,`off`);this.addEventListener(`disconnect`,()=>n.cancel())}}async updateTimingObject(e,t){let[n,r,i]=await Promise.all([t.getCurrentTime(),t.getPaused(),t.getPlaybackRate()]);e.update({position:n,velocity:r?0:i})}async updatePlayer(e,t,n){let{position:r,velocity:i}=e.query();typeof r==`number`&&t.setCurrentTime(r),typeof i==`number`&&(i===0?await t.getPaused()===!1&&t.pause():i>0&&(await t.getPaused()===!0&&(await t.play().catch(async e=>{e.name===`NotAllowedError`&&n.autoPlayMuted&&(await t.setMuted(!0),await t.play().catch(e=>console.error(`Couldn't play the video from TimingSrcConnector. Error:`,e)))}),this.updatePlayer(e,t,n)),await t.getPlaybackRate()!==i&&t.setPlaybackRate(i)))}maintainPlaybackPosition(e,t,n){let{allowedDrift:r,maxAllowedDrift:i,minCheckInterval:a,maxRateAdjustment:o,maxTimeToCatchUp:s}=n,c=Math.min(s,Math.max(a,i))*1e3,l=async()=>{if(e.query().velocity===0||await t.getPaused()===!0)return;let n=e.query().position-await t.getCurrentTime(),a=Math.abs(n);if(this.log(`Drift: ${n}`),a>i)await this.adjustSpeed(t,0),t.setCurrentTime(e.query().position),this.log(`Resync by currentTime`);else if(a>r){let e=a/s,r=o,i=e<r?(r-e)/2:r;await this.adjustSpeed(t,i*Math.sign(n)),this.log(`Resync by playbackRate`)}},u=setInterval(()=>l(),c);return{cancel:()=>clearInterval(u)}}log(e){this.logger?.(`TimingSrcConnector: ${e}`)}speedAdjustment=0;adjustSpeed=async(e,t)=>{if(this.speedAdjustment===t)return;let n=await e.getPlaybackRate()-this.speedAdjustment+t;this.log(`New playbackRate: ${n}`),await e.setPlaybackRate(n),this.speedAdjustment=t};waitForTOReadyState(e,t){return new Promise(n=>{let r=()=>{e.readyState===t?n():e.addEventListener(`readystatechange`,r,{once:!0})};r()})}},jv=new WeakMap,Mv=new WeakMap,Nv={},Pv=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(window.jQuery&&e instanceof jQuery&&(e.length>1&&window.console&&console.warn&&console.warn(`A jQuery object with multiple elements was passed, using the first element.`),e=e[0]),typeof document<`u`&&typeof e==`string`&&(e=document.getElementById(e)),!Z_(e))throw TypeError(`You must pass either a valid element or a valid id.`);if(e.nodeName!==`IFRAME`){let t=e.querySelector(`iframe`);t&&(e=t)}if(e.nodeName===`IFRAME`&&!$_(e.getAttribute(`src`)||``))throw Error(`The player element passed isn’t a Vimeo embed.`);if(jv.has(e))return jv.get(e);this._window=e.ownerDocument.defaultView,this.element=e,this.origin=`*`;let n=new lv((n,r)=>{if(this._onMessage=e=>{if(!$_(e.origin)||this.element.contentWindow!==e.source)return;this.origin===`*`&&(this.origin=e.origin);let t=gv(e.data);if(t&&t.event===`error`&&t.data&&t.data.method===`ready`){let e=Error(t.data.message);e.name=t.data.name,r(e);return}let i=t&&t.event===`ready`,a=t&&t.method===`ping`;if(i||a){this.element.setAttribute(`data-ready`,`true`),n();return}vv(this,t)},this._window.addEventListener(`message`,this._onMessage),this.element.nodeName!==`IFRAME`){let n=bv(e,t);Sv(nv(n),n,e).then(t=>{let n=xv(t,e);return this.element=n,this._originalElement=e,hv(e,n),jv.set(this.element,this),t}).catch(r)}});if(Mv.set(this,n),jv.set(this.element,this),this.element.nodeName===`IFRAME`&&_v(this,`ping`),Nv.isEnabled){let e=()=>Nv.exit();this.fullscreenchangeHandler=()=>{Nv.isFullscreen?dv(this,`event:exitFullscreen`,e):pv(this,`event:exitFullscreen`,e),this.ready().then(()=>{_v(this,`fullscreenchange`,Nv.isFullscreen)})},Nv.on(`fullscreenchange`,this.fullscreenchangeHandler)}return this}static isVimeoUrl(e){return $_(e)}callMethod(e){var t=[...arguments].slice(1);if(e==null)throw TypeError(`You must pass a method name.`);return new lv((n,r)=>this.ready().then(()=>{dv(this,e,{resolve:n,reject:r}),t.length===0?t={}:t.length===1&&(t=t[0]),_v(this,e,t)}).catch(r))}get(e){return new lv((t,n)=>(e=X_(e,`get`),this.ready().then(()=>{dv(this,e,{resolve:t,reject:n}),_v(this,e)}).catch(n)))}set(e,t){return new lv((n,r)=>{if(e=X_(e,`set`),t==null)throw TypeError(`There must be a value to set.`);return this.ready().then(()=>{dv(this,e,{resolve:n,reject:r}),_v(this,e,t)}).catch(r)})}on(e,t){if(!e)throw TypeError(`You must pass an event name.`);if(!t)throw TypeError(`You must pass a callback function.`);if(typeof t!=`function`)throw TypeError(`The callback must be a function.`);fv(this,`event:${e}`).length===0&&this.callMethod(`addEventListener`,e).catch(()=>{}),dv(this,`event:${e}`,t)}off(e,t){if(!e)throw TypeError(`You must pass an event name.`);if(t&&typeof t!=`function`)throw TypeError(`The callback must be a function.`);pv(this,`event:${e}`,t)&&this.callMethod(`removeEventListener`,e).catch(e=>{})}loadVideo(e){return this.callMethod(`loadVideo`,e)}ready(){let e=Mv.get(this)||new lv((e,t)=>{t(Error(`Unknown player. Probably unloaded.`))});return lv.resolve(e)}addCuePoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.callMethod(`addCuePoint`,{time:e,data:t})}removeCuePoint(e){return this.callMethod(`removeCuePoint`,e)}enableTextTrack(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e)throw TypeError(`You must pass a language.`);return this.callMethod(`enableTextTrack`,{language:e,kind:t,showing:n})}disableTextTrack(){return this.callMethod(`disableTextTrack`)}selectAudioTrack(e,t){if(!e)throw TypeError(`You must pass a language.`);return this.callMethod(`selectAudioTrack`,{language:e,kind:t})}selectDefaultAudioTrack(){return this.callMethod(`selectDefaultAudioTrack`)}pause(){return this.callMethod(`pause`)}play(){return this.callMethod(`play`)}requestFullscreen(){return Nv.isEnabled?Nv.request(this.element):this.callMethod(`requestFullscreen`)}exitFullscreen(){return Nv.isEnabled?Nv.exit():this.callMethod(`exitFullscreen`)}getFullscreen(){return Nv.isEnabled?lv.resolve(Nv.isFullscreen):this.get(`fullscreen`)}requestPictureInPicture(){return this.callMethod(`requestPictureInPicture`)}exitPictureInPicture(){return this.callMethod(`exitPictureInPicture`)}getPictureInPicture(){return this.get(`pictureInPicture`)}remotePlaybackPrompt(){return this.callMethod(`remotePlaybackPrompt`)}unload(){return this.callMethod(`unload`)}destroy(){return new lv(e=>{if(Mv.delete(this),jv.delete(this.element),this._originalElement&&(jv.delete(this._originalElement),this._originalElement.removeAttribute(`data-vimeo-initialized`)),this.element&&this.element.nodeName===`IFRAME`&&this.element.parentNode&&(this.element.parentNode.parentNode&&this._originalElement&&this._originalElement!==this.element.parentNode?this.element.parentNode.parentNode.removeChild(this.element.parentNode):this.element.parentNode.removeChild(this.element)),this.element&&this.element.nodeName===`DIV`&&this.element.parentNode){this.element.removeAttribute(`data-vimeo-initialized`);let e=this.element.querySelector(`iframe`);e&&e.parentNode&&(e.parentNode.parentNode&&this._originalElement&&this._originalElement!==e.parentNode?e.parentNode.parentNode.removeChild(e.parentNode):e.parentNode.removeChild(e))}this._window.removeEventListener(`message`,this._onMessage),Nv.isEnabled&&Nv.off(`fullscreenchange`,this.fullscreenchangeHandler),e()})}getAutopause(){return this.get(`autopause`)}setAutopause(e){return this.set(`autopause`,e)}getBuffered(){return this.get(`buffered`)}getCameraProps(){return this.get(`cameraProps`)}setCameraProps(e){return this.set(`cameraProps`,e)}getChapters(){return this.get(`chapters`)}getCurrentChapter(){return this.get(`currentChapter`)}getColor(){return this.get(`color`)}getColors(){return lv.all([this.get(`colorOne`),this.get(`colorTwo`),this.get(`colorThree`),this.get(`colorFour`)])}setColor(e){return this.set(`color`,e)}setColors(e){if(!Array.isArray(e))return new lv((e,t)=>t(TypeError(`Argument must be an array.`)));let t=new lv(e=>e(null)),n=[e[0]?this.set(`colorOne`,e[0]):t,e[1]?this.set(`colorTwo`,e[1]):t,e[2]?this.set(`colorThree`,e[2]):t,e[3]?this.set(`colorFour`,e[3]):t];return lv.all(n)}getCuePoints(){return this.get(`cuePoints`)}getCurrentTime(){return this.get(`currentTime`)}setCurrentTime(e){return this.set(`currentTime`,e)}getDuration(){return this.get(`duration`)}getEnded(){return this.get(`ended`)}getLoop(){return this.get(`loop`)}setLoop(e){return this.set(`loop`,e)}setMuted(e){return this.set(`muted`,e)}getMuted(){return this.get(`muted`)}getPaused(){return this.get(`paused`)}getPlaybackRate(){return this.get(`playbackRate`)}setPlaybackRate(e){return this.set(`playbackRate`,e)}getPlayed(){return this.get(`played`)}getQualities(){return this.get(`qualities`)}getQuality(){return this.get(`quality`)}setQuality(e){return this.set(`quality`,e)}getRemotePlaybackAvailability(){return this.get(`remotePlaybackAvailability`)}getRemotePlaybackState(){return this.get(`remotePlaybackState`)}getSeekable(){return this.get(`seekable`)}getSeeking(){return this.get(`seeking`)}getTextTracks(){return this.get(`textTracks`)}getAudioTracks(){return this.get(`audioTracks`)}getEnabledAudioTrack(){return this.get(`enabledAudioTrack`)}getDefaultAudioTrack(){return this.get(`defaultAudioTrack`)}getVideoEmbedCode(){return this.get(`videoEmbedCode`)}getVideoId(){return this.get(`videoId`)}getVideoTitle(){return this.get(`videoTitle`)}getVideoWidth(){return this.get(`videoWidth`)}getVideoHeight(){return this.get(`videoHeight`)}getVideoUrl(){return this.get(`videoUrl`)}getVolume(){return this.get(`volume`)}setVolume(e){return this.set(`volume`,e)}async setTimingSrc(e,t){if(!e)throw TypeError(`A Timing Object must be provided.`);await this.ready();let n=new Av(this,e,t);return _v(this,`notifyTimingObjectConnect`),n.addEventListener(`disconnect`,()=>_v(this,`notifyTimingObjectDisconnect`)),n}};Y_||(Nv=Ov(),Cv(),wv(),Tv(),Ev(),Dv());function Fv(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Iv(e,t)}function Iv(e,t){return Iv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Iv(e,t)}var Lv={play:`onPlay`,playing:`onPlaying`,pause:`onPause`,ended:`onEnd`,timeupdate:`onTimeUpdate`,progress:`onProgress`,seeked:`onSeeked`,texttrackchange:`onTextTrackChange`,cuechange:`onCueChange`,cuepoint:`onCuePoint`,volumechange:`onVolumeChange`,playbackratechange:`onPlaybackRateChange`,error:`onError`,loaded:`onLoaded`},Rv=function(e){function t(t){var n=e.call(this,t)||this;return n.refContainer=n.refContainer.bind(n),n}Fv(t,e);var n=t.prototype;return n.componentDidMount=function(){this.createPlayer()},n.componentDidUpdate=function(e){var t=this,n=Object.keys(this.props).filter(function(n){return t.props[n]!==e[n]});this.updateProps(n)},n.componentWillUnmount=function(){this.player.destroy()},n.getInitialOptions=function(){var e,t=this.props.video,n=/^https?:/i.test(t)?`url`:`id`;return e={},e[n]=t,e.width=this.props.width,e.height=this.props.height,e.autopause=this.props.autopause,e.autoplay=this.props.autoplay,e.byline=this.props.showByline,e.color=this.props.color,e.controls=this.props.controls,e.loop=this.props.loop,e.portrait=this.props.showPortrait,e.title=this.props.showTitle,e.muted=this.props.muted,e.background=this.props.background,e.responsive=this.props.responsive,e.dnt=this.props.dnt,e.speed=this.props.speed,e.keyboard=this.props.keyboard,e.pip=this.props.pip,e.playsinline=this.props.playsInline,e.quality=this.props.quality,e.texttrack=this.props.textTrack,e.transparent=this.props.transparent,e},n.updateProps=function(e){var t=this,n=this.player;e.forEach(function(e){var r=t.props[e];switch(e){case`autopause`:n.setAutopause(r);break;case`color`:n.setColor(r);break;case`loop`:n.setLoop(r);break;case`volume`:n.setVolume(r);break;case`paused`:n.getPaused().then(function(e){return r&&!e?n.pause():!r&&e?n.play():null});break;case`width`:case`height`:n.element[e]=r;break;case`video`:if(r){var i=t.props.start,a=n.loadVideo(r);typeof i==`number`&&a.then(function(){n.setCurrentTime(i)})}else n.unload();break;case`playbackRate`:n.setPlaybackRate(r);break;case`quality`:n.setQuality(r);break}})},n.createPlayer=function(){var e=this,t=this.props,n=t.start,r=t.volume,i=t.playbackRate;this.player=new Pv(this.container,this.getInitialOptions()),Object.keys(Lv).forEach(function(t){var n=Lv[t];e.player.on(t,function(t){var r=e.props[n];r&&r(t)})});var a=this.props,o=a.onError,s=a.onReady;this.player.ready().then(function(){s&&s(e.player)},function(e){if(o)o(e);else throw e}),typeof n==`number`&&this.player.setCurrentTime(n),typeof r==`number`&&this.updateProps([`volume`]),typeof i==`number`&&this.updateProps([`playbackRate`])},n.refContainer=function(e){this.container=e},n.render=function(){var e=this.props,t=e.id,n=e.className,r=e.style;return Q.createElement(`div`,{id:t,className:n,style:r,ref:this.refContainer})},t}(Q.Component);Rv.defaultProps={autopause:!0,autoplay:!1,showByline:!0,controls:!0,loop:!1,showPortrait:!0,showTitle:!0,muted:!1,background:!1,responsive:!1,dnt:!1,speed:!1,keyboard:!0,pip:!1,playsInline:!0,transparent:!0};var zv={default:120,mqdefault:320,hqdefault:480,sddefault:640,maxresdefault:1280},Bv=(e,t,n,r=`maxresdefault`)=>{let[i,a]=(0,Q.useState)(``);return(0,Q.useEffect)(()=>{let i=`https://img.youtube.com/${t}/${e}/${r}.${n}`,o=`https://img.youtube.com/${t}/${e}/hqdefault.${n}`,s=zv[r],c=new Image;c.onload=()=>{c.width<s?a(o):a(i)},c.onerror=()=>a(o),c.src=i},[e,t,n,r]),i};function Vv(e,t,n,r,i){let a={"@context":`https://schema.org`,"@type":`VideoObject`,name:i?.name||t,thumbnailUrl:[i?.thumbnailUrl||n],embedUrl:i?.embedUrl||`${r}/embed/${e}`,contentUrl:i?.contentUrl||`https://www.youtube.com/watch?v=${e}`,...i?.description&&{description:i.description},...i?.uploadDate&&{uploadDate:i.uploadDate},...i?.duration&&{duration:i.duration}};return JSON.stringify(a)}function Hv(e,t){let[n,r]=Q.useState(!1),[i,a]=Q.useState(e.alwaysLoadIframe||!1),o=encodeURIComponent(e.id),s=typeof e.playlistCoverId==`string`?encodeURIComponent(e.playlistCoverId):null,c=e.title,l=e.poster||`hqdefault`,u=e.announce||`Watch`,d=e.alwaysLoadIframe?e.autoplay&&e.muted:!0,f=Q.useMemo(()=>{let t=new URLSearchParams({...e.muted?{mute:`1`}:{},...d?{autoplay:`1`}:{},...e.enableJsApi?{enablejsapi:`1`}:{},...e.enableJsApi&&typeof window<`u`?{origin:window.location.origin}:{},...e.playlist?{list:o}:{}});return e.params&&new URLSearchParams(e.params.startsWith(`&`)?e.params.slice(1):e.params).forEach((e,n)=>{t.append(n,e)}),t},[e.muted,d,e.enableJsApi,e.playlist,o,e.params]),p=Q.useMemo(()=>e.cookie?`https://www.youtube.com`:`https://www.youtube-nocookie.com`,[e.cookie]),m=Q.useMemo(()=>e.playlist?`${p}/embed/videoseries?${f.toString()}`:`${p}/embed/${o}?${f.toString()}`,[e.playlist,p,o,f]),h=!e.thumbnail&&!e.playlist&&l===`maxresdefault`,g=e.webp?`webp`:`jpg`,_=e.webp?`vi_webp`:`vi`,v=h?Bv(e.id,_,g,l):null,y=Q.useMemo(()=>e.thumbnail||v||`https://i.ytimg.com/${_}/${e.playlist?s:o}/${l}.${g}`,[e.thumbnail,v,_,e.playlist,s,o,l,g]),b=e.activatedClass||`lyt-activated`,x=e.adNetwork||!1,S=e.aspectHeight||9,C=e.aspectWidth||16,w=e.iframeClass||``,T=e.playerClass||`lty-playbtn`,E=e.wrapperClass||`yt-lite`,D=Q.useCallback(e.onIframeAdded||function(){},[e.onIframeAdded]),O=e.rel?`prefetch`:`preload`,k=e.containerElement||`article`,A=e.noscriptFallback!==!1,j=()=>{n||r(!0)},M=()=>{i||a(!0)};return Q.useEffect(()=>{i&&(D(),e.focusOnLoad&&typeof t==`object`&&t?.current&&t.current.focus())},[i,D,e.focusOnLoad,t]),Q.useEffect(()=>{if(!i||!e.enableJsApi||!(e.onReady||e.onStateChange||e.onError||e.onPlay||e.onPause||e.onEnd||e.onBuffering||e.onPlaybackRateChange||e.onPlaybackQualityChange))return;let n=!1,r=!1,a=r=>{if(r.origin!==`https://www.youtube.com`&&r.origin!==`https://www.youtube-nocookie.com`)return;let i;try{i=typeof r.data==`string`?JSON.parse(r.data):r.data}catch{return}switch(i.event){case`onReady`:n||(n=!0,e.onReady&&e.onReady({videoId:e.id,title:c}));break;case`infoDelivery`:if(i.info?.playerState!==void 0){let n=i.info.playerState;switch(e.onStateChange&&e.onStateChange({state:n,currentTime:i.info.currentTime,duration:i.info.duration}),n){case 1:e.onPlay?.();break;case 2:e.onPause?.();break;case 0:e.onEnd?.(),e.stopOnEnd&&typeof t==`object`&&t?.current?.contentWindow&&t.current.contentWindow.postMessage(`{"event":"command","func":"stopVideo","args":""}`,`*`);break;case 3:e.onBuffering?.();break}}i.info?.playbackRate!==void 0&&e.onPlaybackRateChange?.(i.info.playbackRate),i.info?.playbackQuality!==void 0&&e.onPlaybackQualityChange?.(i.info.playbackQuality);break;case`onStateChange`:if(i.info?.playerState!==void 0){let n=i.info.playerState;switch(e.onStateChange&&e.onStateChange({state:n,currentTime:i.info.currentTime,duration:i.info.duration}),n){case 1:e.onPlay?.();break;case 2:e.onPause?.();break;case 0:e.onEnd?.(),e.stopOnEnd&&typeof t==`object`&&t?.current?.contentWindow&&t.current.contentWindow.postMessage(`{"event":"command","func":"stopVideo","args":""}`,`*`);break;case 3:e.onBuffering?.();break}}break;case`onError`:if(i.info&&`errorCode`in i.info){let t=i.info.errorCode;e.onError&&e.onError(t)}break;case`onPlaybackRateChange`:i.info?.playbackRate!==void 0&&e.onPlaybackRateChange?.(i.info.playbackRate);break;case`onPlaybackQualityChange`:i.info?.playbackQuality!==void 0&&e.onPlaybackQualityChange?.(i.info.playbackQuality);break}};window.addEventListener(`message`,a);let s=[],l=()=>{typeof t==`object`&&t?.current?.contentWindow&&t.current.contentWindow.postMessage(`{"event":"listening","id":"`+o+`"}`,`*`)},u=()=>{r||(r=!0,l(),[100,300,600,1200,2400].forEach(e=>{s.push(setTimeout(l,e))}))};return typeof t==`object`&&t?.current?(t.current.addEventListener(`load`,u),t.current.contentDocument?.readyState===`complete`&&u()):[200,500,1e3,2e3,3e3].forEach(e=>{s.push(setTimeout(l,e))}),()=>{window.removeEventListener(`message`,a),s.forEach(clearTimeout),typeof t==`object`&&t?.current&&t.current.removeEventListener(`load`,u)}},[i,e.enableJsApi,e.onReady,e.onStateChange,e.onError,e.onPlay,e.onPause,e.onEnd,e.onBuffering,e.onPlaybackRateChange,e.onPlaybackQualityChange,e.stopOnEnd,e.id,o,c,t]),(0,Z.jsxs)(Z.Fragment,{children:[!e.lazyLoad&&(0,Z.jsx)(`link`,{rel:O,href:y,as:`image`}),(0,Z.jsx)(Z.Fragment,{children:n&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`link`,{rel:`preconnect`,href:p}),(0,Z.jsx)(`link`,{rel:`preconnect`,href:`https://www.google.com`}),x&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`link`,{rel:`preconnect`,href:`https://static.doubleclick.net`}),(0,Z.jsx)(`link`,{rel:`preconnect`,href:`https://googleads.g.doubleclick.net`})]})]})}),e.seo&&!e.playlist&&(0,Z.jsx)(`script`,{type:`application/ld+json`,dangerouslySetInnerHTML:{__html:Vv(e.id,c,y,p,e.seo)}}),A&&!e.playlist&&(0,Z.jsx)(`noscript`,{children:(0,Z.jsxs)(`a`,{href:`https://www.youtube.com/watch?v=${e.id}`,"aria-label":`Watch ${c} on YouTube`,children:[`Watch "`,c,`" on YouTube`]})}),(0,Z.jsxs)(k,{onPointerOver:j,onClick:M,className:`${E} ${i?b:``}`,"data-title":c,role:!i&&!e.lazyLoad?`img`:void 0,"aria-label":i?void 0:`${c} - YouTube video preview`,style:{...!e.lazyLoad&&{backgroundImage:`url(${y})`},"--aspect-ratio":`${S/C*100}%`,...e.style||{}},children:[e.lazyLoad&&!i&&(0,Z.jsx)(`img`,{src:y,alt:`${c} - YouTube thumbnail`,className:`lty-thumbnail`,loading:`lazy`}),e.playlist&&!i&&(0,Z.jsx)(`div`,{className:`lty-playlist-icon`,"aria-hidden":`true`}),!(e.hideButtonOnActivate&&i)&&(0,Z.jsx)(`button`,{type:`button`,className:T,"aria-label":`${u} ${c}`,"aria-hidden":i||void 0,tabIndex:i?-1:0,onClick:M,children:(0,Z.jsx)(`span`,{className:`lty-visually-hidden`,children:u})}),i&&(0,Z.jsx)(`iframe`,{ref:t,className:w,title:c,width:`560`,height:`315`,allow:`accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0,src:m,referrerPolicy:e.referrerPolicy||`strict-origin-when-cross-origin`})]})]})}var Uv=Q.forwardRef(Hv);function Wv(e){return e!==!1}function Gv(e,t){let n=[];return t.startSeconds!==null&&n.push(`start=${t.startSeconds}`),e.controls===!1&&n.push(`controls=0`),e.loop===!0&&n.push(`loop=1`,`playlist=${t.id}`),e.playsinline===!0&&n.push(`playsinline=1`),n.length>0?n.join(`&`):void 0}function Kv(e){if(e.width!==void 0)return{width:e.width}}function qv(e){if(!(e.width===void 0||e.height===void 0))return{aspectRatio:`${e.width} / ${e.height}`}}function Jv(e){let t=(0,$.c)(23),n=(0,Q.useRef)(null),r=e.title??`Vimeo video player`,i;t[0]===r?i=t[1]:(i=e=>{let t=e;n.current=t,t.element&&(t.element.title=r)},t[0]=r,t[1]=i);let a=i,o,s;t[2]===r?(o=t[3],s=t[4]):(o=()=>{let e=n.current;e?.element&&(e.element.title=r)},s=[r],t[2]=r,t[3]=o,t[4]=s),(0,Q.useEffect)(o,s);let c;t[5]===e?c=t[6]:(c=Kv(e),t[5]=e,t[6]=c);let l=e.width===void 0,u=e.autoplay===!0,d=e.muted===!0,f=e.muted===!0?0:1,p=e.loop===!0,m=e.controls!==!1,h=e.playsinline!==!1,g;t[7]!==a||t[8]!==e.height||t[9]!==e.src||t[10]!==e.width||t[11]!==h||t[12]!==l||t[13]!==u||t[14]!==d||t[15]!==f||t[16]!==p||t[17]!==m?(g=(0,Z.jsx)(Rv,{video:e.src,responsive:l,width:e.width,height:e.height,autoplay:u,muted:d,volume:f,loop:p,controls:m,playsInline:h,onReady:a}),t[7]=a,t[8]=e.height,t[9]=e.src,t[10]=e.width,t[11]=h,t[12]=l,t[13]=u,t[14]=d,t[15]=f,t[16]=p,t[17]=m,t[18]=g):g=t[18];let _;return t[19]!==e.title||t[20]!==g||t[21]!==c?(_=(0,Z.jsx)(`div`,{className:`ok-video ok-video-vimeo`,style:c,title:e.title,children:g}),t[19]=e.title,t[20]=g,t[21]=c,t[22]=_):_=t[22],_}function Yv(e){let t=(0,$.c)(17),n;t[0]===e.src?n=t[1]:(n=Or(e.src),t[0]=e.src,t[1]=n);let r=n;if(!r)return null;let i;t[2]!==r.startRaw||t[3]!==e.autoplay||t[4]!==e.muted?(i=[],r.startRaw!==null&&i.push(`t=${r.startRaw}`),e.autoplay===!0&&i.push(`autoplay=true`),e.muted===!0&&i.push(`muted=true`),t[2]=r.startRaw,t[3]=e.autoplay,t[4]=e.muted,t[5]=i):i=t[5];let a=i.length>0?`https://www.loom.com/embed/${r.id}?${i.join(`&`)}`:`https://www.loom.com/embed/${r.id}`,o;t[6]===e?o=t[7]:(o=Kv(e),t[6]=e,t[7]=o);let s=e.title??`Loom video player`,c;t[8]!==a||t[9]!==e.height||t[10]!==e.width||t[11]!==s?(c=(0,Z.jsx)(`iframe`,{className:`ok-video-loom-iframe`,src:a,title:s,width:e.width,height:e.height,allow:`autoplay; fullscreen`,referrerPolicy:`strict-origin-when-cross-origin`,allowFullScreen:!0}),t[8]=a,t[9]=e.height,t[10]=e.width,t[11]=s,t[12]=c):c=t[12];let l;return t[13]!==e.title||t[14]!==o||t[15]!==c?(l=(0,Z.jsx)(`div`,{className:`ok-video ok-video-loom`,style:o,title:e.title,children:c}),t[13]=e.title,t[14]=o,t[15]=c,t[16]=l):l=t[16],l}function Xv(e){let t=(0,$.c)(29);if(e.src!==void 0&&Er(e.src)){let n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(Yv,{...e,src:e.src}),t[0]=e,t[1]=n),n}if(e.src!==void 0&&Ft(e.src)){let n;return t[2]===e?n=t[3]:(n=(0,Z.jsx)(Jv,{...e,src:e.src}),t[2]=e,t[3]=n),n}let n;if(t[4]!==e){n=Symbol.for(`react.early_return_sentinel`);bb0:{let r=e.src===void 0?null:Zt(e.src);if(r!==null){let i=e.autoplay===!0&&e.muted===!0,a=e.width!==void 0&&e.height!==void 0,o=Kv(e),s;t[6]===e.poster?s=t[7]:(s=e.poster===void 0?void 0:_n(e.poster),t[6]=e.poster,t[7]=s);let c=(0,Z.jsx)(Uv,{id:r.id,title:e.title??`YouTube video player`,cookie:!r.noCookie,params:Gv(e,r),muted:e.muted===!0,autoplay:e.autoplay===!0,alwaysLoadIframe:i,thumbnail:s,aspectWidth:a?Number(e.width):void 0,aspectHeight:a?Number(e.height):void 0,style:qv(e)}),l;t[8]!==o||t[9]!==c?(l=(0,Z.jsx)(`div`,{className:`ok-video ok-video-youtube`,style:o,children:c}),t[8]=o,t[9]=c,t[10]=l):l=t[10],n=l;break bb0}}t[4]=e,t[5]=n}else n=t[5];if(n!==Symbol.for(`react.early_return_sentinel`))return n;let r;t[11]===e.src?r=t[12]:(r=e.src===void 0?void 0:_n(e.src),t[11]=e.src,t[12]=r);let i=e.title,a;t[13]===e.controls?a=t[14]:(a=Wv(e.controls),t[13]=e.controls,t[14]=a);let o;t[15]===e.poster?o=t[16]:(o=e.poster===void 0?void 0:_n(e.poster),t[15]=e.poster,t[16]=o);let s;return t[17]!==e.autoplay||t[18]!==e.height||t[19]!==e.loop||t[20]!==e.muted||t[21]!==e.playsinline||t[22]!==e.preload||t[23]!==e.title||t[24]!==e.width||t[25]!==r||t[26]!==a||t[27]!==o?(s=(0,Z.jsx)(`video`,{className:`ok-video`,src:r,title:i,controls:a,autoPlay:e.autoplay,muted:e.muted,loop:e.loop,playsInline:e.playsinline,poster:o,preload:e.preload,width:e.width,height:e.height}),t[17]=e.autoplay,t[18]=e.height,t[19]=e.loop,t[20]=e.muted,t[21]=e.playsinline,t[22]=e.preload,t[23]=e.title,t[24]=e.width,t[25]=r,t[26]=a,t[27]=o,t[28]=s):s=t[28],s}function Zv(e){let t=(0,$.c)(2),n;return t[0]===e.children?n=t[1]:(n=(0,Z.jsx)(`div`,{className:`prose-no-margin`,children:e.children}),t[0]=e.children,t[1]=n),n}var Qv={Callout:Vh,img:r_,video:Xv,audio:Ih,Pdf:j_,File:Zh,Embed:Yh,Accordion:Mh,Toggle:e=>(0,Z.jsx)(Mh,{...e,title:e.title??`Toggle`}),HtmlAlignBlock:Ph,Tabs:H_,Tab:R_,Math:o_,MermaidFence:Vr,Mirror:__,MirrorSource:v_,"*":Zv};function $v(e){let t=new Set;for(let n of e)n.type===`reactnode`&&t.add(n.name);return t}var ey=At(),ty=new Map;function ny(e){if(e.surface===`compat`){let t=Qv[e.rendersAs];if(!t)throw Error(`Compat descriptor '${e.name}' declares rendersAs: '${e.rendersAs}', but no React component is registered under that name in componentMap. Add the canonical component before registering the compat descriptor.`);return{Component:t,reactNodePropNames:$v(e.props)}}let t=Qv[e.name];return t?{Component:t,reactNodePropNames:$v(e.props)}:null}for(let[e,t]of ey.entries()){let n=ny(t);n&&ty.set(e,n)}function ry(e,t){return{...e,Component:t.Component,reactNodePropNames:t.reactNodePropNames}}function iy(e){let t=ey.getOrWildcard(e),n=ty.get(t.name)??ty.get(`*`);if(!n)throw Error(`No React component registered for ${t.name} (and no '*' wildcard)`);return ry(t,n)}function ay(){let e=[];for(let[t,n]of ey.entries()){if(t===`*`)continue;let r=ty.get(t);r&&e.push(ry(n,r))}return e}var oy=``+new URL(`image-preview-BJSGEOo4.png`,import.meta.url).href,sy=``+new URL(`video-preview-vLovc_Vy.png`,import.meta.url).href,cy={Callout:{description:{id:`322lyb`},props:()=>({type:`note`,title:Y._({id:`6s7LXO`})}),children:()=>Y._({id:`64sesb`})},Accordion:{description:{id:`mWVJRX`},props:()=>({title:Y._({id:`z9NwEu`}),defaultOpen:!0}),children:()=>Y._({id:`8uGMP8`})},Toggle:{description:{id:`cT_pW4`},props:()=>({title:Y._({id:`z9NwEu`}),defaultOpen:!0}),children:()=>Y._({id:`8uGMP8`})},img:{description:{id:`VUijjF`},props:()=>({src:oy,alt:Y._({id:`R9dK63`})})},video:{description:{id:`e1hptq`},props:()=>({controls:!0,poster:sy})},audio:{description:{id:`9jnjV0`},props:()=>({controls:!0})},Math:{description:{id:`Y-Urt2`},props:()=>({formula:`c = \\pm\\sqrt{a^2 + b^2}`})},Embed:{description:{id:`jTLWxh`},render:()=>(0,Z.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-background`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-border bg-muted/40 px-2 py-1.5`,children:[(0,Z.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,Z.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,Z.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,Z.jsx)(`span`,{className:`ml-1.5 flex-1 truncate rounded-sm bg-background px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:`https://example.com/embed`})]}),(0,Z.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1.5 px-3 py-2`,children:[(0,Z.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-sm bg-muted-foreground/30`}),(0,Z.jsx)(`span`,{className:`h-1.5 w-full rounded-sm bg-muted-foreground/20`}),(0,Z.jsx)(`span`,{className:`h-1.5 w-5/6 rounded-sm bg-muted-foreground/20`}),(0,Z.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-sm bg-muted-foreground/20`})]})]})},Pdf:{description:{id:`Fqr8BP`},render:()=>(0,Z.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-background`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1 border-b border-border bg-muted/40 px-1.5 py-1`,children:[(0,Z.jsxs)(`svg`,{viewBox:`0 0 12 12`,className:`size-3 text-muted-foreground`,"aria-hidden":`true`,children:[(0,Z.jsx)(`title`,{children:`Thumbnails`}),(0,Z.jsx)(`rect`,{x:`1`,y:`1`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,Z.jsx)(`rect`,{x:`7`,y:`1`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,Z.jsx)(`rect`,{x:`1`,y:`7`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`}),(0,Z.jsx)(`rect`,{x:`7`,y:`7`,width:`4`,height:`4`,fill:`currentColor`,rx:`0.5`})]}),(0,Z.jsxs)(`span`,{className:`ml-1 flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,Z.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5 font-mono`,children:`2`}),(0,Z.jsx)(`span`,{children:`/ 12`})]}),(0,Z.jsxs)(`span`,{className:`ml-auto flex items-center gap-1 text-[10px] font-mono text-muted-foreground`,children:[(0,Z.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5`,children:`−`}),(0,Z.jsx)(`span`,{children:`100%`}),(0,Z.jsx)(`span`,{className:`rounded-sm bg-background px-1 py-0.5`,children:`+`})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-1 gap-1 p-1.5`,children:[(0,Z.jsxs)(`div`,{className:`flex w-6 flex-col gap-0.5`,children:[(0,Z.jsx)(`span`,{className:`h-3 rounded-sm bg-muted-foreground/20`}),(0,Z.jsx)(`span`,{className:`h-3 rounded-sm border border-foreground/60 bg-background`}),(0,Z.jsx)(`span`,{className:`h-3 rounded-sm bg-muted-foreground/20`})]}),(0,Z.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1 rounded-sm bg-background p-1.5`,children:[(0,Z.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-sm bg-foreground/50`}),(0,Z.jsx)(`span`,{className:`h-1 w-full rounded-sm bg-muted-foreground/30`}),(0,Z.jsx)(`span`,{className:`h-1 w-5/6 rounded-sm bg-muted-foreground/30`}),(0,Z.jsx)(`span`,{className:`h-1 w-full rounded-sm bg-muted-foreground/30`}),(0,Z.jsx)(`span`,{className:`h-1 w-2/3 rounded-sm bg-muted-foreground/30`})]})]})]})},MermaidFence:{description:{id:`z0a2EA`},render:()=>(0,Z.jsxs)(`svg`,{viewBox:`0 0 200 120`,className:`h-full w-full text-foreground`,"aria-hidden":`true`,preserveAspectRatio:`xMidYMid meet`,children:[(0,Z.jsx)(`title`,{children:`Mermaid flowchart preview`}),(0,Z.jsx)(`defs`,{children:(0,Z.jsx)(`marker`,{id:`mermaid-preview-arrow`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto-start-reverse`,children:(0,Z.jsx)(`path`,{d:`M 0 0 L 10 5 L 0 10 z`,fill:`currentColor`})})}),(0,Z.jsx)(`rect`,{x:`14`,y:`20`,width:`56`,height:`28`,rx:`14`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,Z.jsx)(`text`,{x:`42`,y:`38`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`Start`}),(0,Z.jsx)(`polygon`,{points:`100,18 140,50 100,82 60,50`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,Z.jsx)(`text`,{x:`100`,y:`54`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`Ready?`}),(0,Z.jsx)(`rect`,{x:`130`,y:`84`,width:`56`,height:`28`,rx:`14`,fill:`currentColor`,fillOpacity:`0.1`,stroke:`currentColor`,strokeOpacity:`0.7`}),(0,Z.jsx)(`text`,{x:`158`,y:`102`,textAnchor:`middle`,fontSize:`10`,fill:`currentColor`,children:`End`}),(0,Z.jsx)(`line`,{x1:`70`,y1:`34`,x2:`80`,y2:`40`,stroke:`currentColor`,strokeOpacity:`0.7`,strokeWidth:`1.2`,markerEnd:`url(#mermaid-preview-arrow)`}),(0,Z.jsx)(`line`,{x1:`124`,y1:`62`,x2:`138`,y2:`82`,stroke:`currentColor`,strokeOpacity:`0.7`,strokeWidth:`1.2`,markerEnd:`url(#mermaid-preview-arrow)`}),(0,Z.jsx)(`text`,{x:`138`,y:`74`,fontSize:`8`,fill:`currentColor`,opacity:`0.6`,children:`yes`})]})},Tabs:{description:{id:`75Y1dk`},render:()=>(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsxs)(`div`,{className:`flex gap-1 border-b border-border pb-1`,children:[(0,Z.jsx)(`span`,{className:`rounded-md bg-foreground/10 px-2 py-0.5 text-xs font-medium text-foreground`,children:`Tab 1`}),(0,Z.jsx)(`span`,{className:`rounded-md px-2 py-0.5 text-xs text-muted-foreground`,children:`Tab 2`})]}),(0,Z.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:(0,Z.jsx)(a,{id:`m6YGpY`})})]})},Mirror:{description:{id:`_WPP7e`},render:()=>(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsxs)(`div`,{className:`relative rounded-md border border-dashed border-border/40 px-2 py-1.5`,children:[(0,Z.jsxs)(`span`,{className:`absolute -top-2 right-1.5 flex items-center gap-1 rounded-md bg-background px-1 text-[10px] text-muted-foreground`,children:[(0,Z.jsx)(es,{className:`size-2.5`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{children:(0,Z.jsx)(a,{id:`EL_YRd`,components:{0:(0,Z.jsx)(`code`,{className:`font-mono`})}})})]}),(0,Z.jsx)(`span`,{className:`block h-1.5 w-3/4 rounded-sm bg-muted-foreground/30`}),(0,Z.jsx)(`span`,{className:`mt-1 block h-1.5 w-2/3 rounded-sm bg-muted-foreground/20`})]}),(0,Z.jsx)(`p`,{className:`px-1 text-[10px] text-muted-foreground`,children:(0,Z.jsx)(a,{id:`qNOgUu`})})]})},MirrorSource:{description:{id:`epuNYK`},render:()=>(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsxs)(`div`,{className:`relative rounded-md border border-dashed border-border/50 px-2 py-1.5`,children:[(0,Z.jsxs)(`span`,{className:`absolute -top-2 left-1.5 flex items-center gap-1 rounded-md bg-background px-1 text-[10px] text-muted-foreground`,children:[(0,Z.jsx)(Qo,{className:`size-2.5`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{children:(0,Z.jsx)(a,{id:`maDWIB`,components:{0:(0,Z.jsx)(`code`,{className:`font-mono`})}})})]}),(0,Z.jsx)(`span`,{className:`block h-1.5 w-4/5 rounded-sm bg-muted-foreground/30`}),(0,Z.jsx)(`span`,{className:`mt-1 block h-1.5 w-3/5 rounded-sm bg-muted-foreground/20`})]}),(0,Z.jsx)(`p`,{className:`px-1 text-[10px] text-muted-foreground`,children:(0,Z.jsx)(a,{id:`emgiet`})})]})}};function ly(e){let t={};for(let n of e.props)n.type!==`reactnode`&&`defaultValue`in n&&n.defaultValue!==void 0&&(t[n.name]=n.defaultValue);return t}function uy(e){let t=iy(e),n=ly(t);return{type:`jsxComponent`,attrs:{componentName:t.name,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!0,props:n},content:t.hasChildren?[{type:`paragraph`}]:void 0}}var dy=new Set;function fy(e){dy.add(e)}function py(e){if(typeof e==`number`)return dy.delete(e);let t=dy.values().next();return t.done?!1:(dy.delete(t.value),!0)}function my(e,t,n){n.props.some(e=>!(`hidden`in e&&e.hidden)&&e.type!==`reactnode`)?(fy(t),requestAnimationFrame(()=>{e.commands.setNodeSelection(t)})):n.hasChildren?e.commands.setTextSelection(t+2):(fy(t),requestAnimationFrame(()=>{e.commands.setNodeSelection(t)}))}function hy(e){return({chain:t,state:n,editor:r,afterCommit:i})=>{let a=new WeakSet;n.doc.descendants(t=>{t.type.name===`jsxComponent`&&t.attrs.componentName===e.name&&a.add(t)});let o=uy(e.name);if(e.name===`Tabs`){let e=uy(`Tab`),t=uy(`Tab`),n=e.attrs,r=t.attrs;n.props={...n.props,label:`Tab 1`},r.props={...r.props,label:`Tab 2`},o.content=[e,t]}t().insertContent(o).run(),i(()=>{let t=-1;r.state.doc.descendants((n,r)=>{if(t>=0)return!1;n.type.name===`jsxComponent`&&n.attrs.componentName===e.name&&!a.has(n)&&(t=r)}),!(t<0)&&my(r,t,e)})}}var gy=new Set([`File`,`Tab`]);function _y(){return[{name:`component-File`,label:Y._({id:`J2eKUI`}),icon:ns,category:`media`,aliases:[`file`,`attachment`,`download`,`upload`,`document`,`doc`,`docx`,`zip`],description:"Attach a downloadable file (`.pdf` / `.docx` / `.zip` / …)",insertsBlockComponent:!0,command:yy,preview:{description:Y._({id:`t-JXbf`}),render:()=>(0,Z.jsxs)(`div`,{className:`flex w-full items-baseline gap-2 rounded-md px-2 py-1.5`,children:[(0,Z.jsx)(ns,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:`quarterly-report.pdf`}),(0,Z.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:`1.4 MB`})]})}}]}function vy(){return[...ay().filter(e=>e.surface===`canonical`&&!gy.has(e.name)).map(e=>{let t=cy[e.name],n=e.Component,r=t?{description:Y._(t.description),render:t.render??(()=>(0,Z.jsx)(n,{...t.props?.(),children:t.children?.()}))}:void 0;return{name:`component-${e.name}`,label:e.displayName??e.name,icon:Oh(e.icon),category:e.category??`content`,command:hy(e),aliases:e.searchTerms,description:e.description,insertsBlockComponent:!0,preview:r}}),..._y()]}function yy({editor:e}){let t=document.createElement(`input`);t.type=`file`,t.accept=`*/*`,t.style.display=`none`,t.addEventListener(`change`,()=>{let n=t.files?.[0];if(n){let t=e.state.selection.from;Rm(n,e,t)}t.remove()},{once:!0}),t.addEventListener(`cancel`,()=>t.remove(),{once:!0}),document.body.appendChild(t),t.click()}function by(){return[{name:`link`,label:Y._({id:`yzF66j`}),icon:ms,category:`insert`,aliases:[`url`,`href`,`external`,`web`,`hyperlink`,`wiki`,`wikilink`,`[[`,`internal`,`page`,`backlink`,`cross-link`],description:`Link to a page or external URL`,preview:{description:Y._({id:`5WDhAk`}),render:()=>(0,Z.jsx)(`p`,{className:`leading-7 text-sm`,children:(0,Z.jsx)(a,{id:`u-9fWA`,components:{0:(0,Z.jsx)(`span`,{className:`font-medium text-azure-blue underline underline-offset-2 dark:text-sky-blue`})}})})},command:({chain:e,state:t,editor:n,afterCommit:r})=>{let i=t.selection.from;e().insertContent({type:`text`,text:`link`,marks:[{type:`link`,attrs:{href:``}}]}).run(),r(()=>{let e=dh(n.state,i,`link`);e&&(ih(e),requestAnimationFrame(()=>{Eh(n).setActiveNode(e)}))})}},{name:`component-Tag`,label:Y._({id:`UL8A9w`}),icon:ei,category:`content`,aliases:[`#`,`hashtag`,`label`],description:"Inline tag (`#tagname`) for cross-doc linking",preview:{description:Y._({id:`5ClEAu`}),render:()=>(0,Z.jsx)(`p`,{className:`text-sm leading-7`,children:(0,Z.jsx)(a,{id:`KZLdgR`,components:{0:(0,Z.jsx)(`a`,{className:`tag pointer-events-none`})}})})},command:({chain:e})=>{e().insertTag(``).run()}}]}function xy(e,t){e().insertContent({type:`codeBlock`,attrs:{language:`html`,meta:`preview`},content:[{type:`text`,text:t}]}).run()}var Sy=`<div style="padding:20px;font-family:system-ui,sans-serif;color:var(--foreground)">
3
- <h1 style="margin:0 0 8px;font-size:20px;font-weight:600">Hello, world!</h1>
4
- <p style="margin:0;color:var(--muted-foreground)">Edit this HTML — the preview updates live.</p>
5
- </div>`,Cy={chart:{icon:Go,aliases:[`chart`,`bar`,`graph`,`plot`,`viz`,`data`,`embed`,`preview`],render:()=>(0,Z.jsxs)(`div`,{className:`flex h-20 w-full items-end gap-1.5`,children:[(0,Z.jsx)(`div`,{className:`h-[45%] flex-1 rounded-t-sm bg-chart-1`}),(0,Z.jsx)(`div`,{className:`h-[70%] flex-1 rounded-t-sm bg-chart-2`}),(0,Z.jsx)(`div`,{className:`h-[90%] flex-1 rounded-t-sm bg-chart-3`}),(0,Z.jsx)(`div`,{className:`h-[60%] flex-1 rounded-t-sm bg-chart-4`}),(0,Z.jsx)(`div`,{className:`h-[80%] flex-1 rounded-t-sm bg-chart-5`})]})},"stat-cards":{icon:ls,aliases:[`stat`,`stats`,`metric`,`metrics`,`cards`,`kpi`,`embed`,`preview`],render:()=>(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex-1 rounded-md border border-border bg-card p-2`,children:[(0,Z.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:`Users`}),(0,Z.jsx)(`div`,{className:`text-sm font-bold text-card-foreground`,children:`12.4k`}),(0,Z.jsx)(`div`,{className:`text-[10px] font-semibold text-chart-2`,children:`+8.2%`})]}),(0,Z.jsxs)(`div`,{className:`flex-1 rounded-md border border-border bg-card p-2`,children:[(0,Z.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:`Revenue`}),(0,Z.jsx)(`div`,{className:`text-sm font-bold text-card-foreground`,children:`$48k`}),(0,Z.jsx)(`div`,{className:`text-[10px] font-semibold text-chart-1`,children:`+3.1%`})]})]})},"custom-svg":{icon:Es,aliases:[`svg`,`vector`,`graphic`,`illustration`,`ring`,`embed`,`preview`],render:()=>(0,Z.jsx)(`div`,{className:`flex items-center justify-center text-chart-1`,children:(0,Z.jsxs)(`svg`,{width:`72`,height:`72`,viewBox:`0 0 72 72`,"aria-hidden":`true`,children:[(0,Z.jsx)(`circle`,{cx:`36`,cy:`36`,r:`28`,fill:`none`,stroke:`currentColor`,strokeOpacity:`0.15`,strokeWidth:`9`}),(0,Z.jsx)(`circle`,{cx:`36`,cy:`36`,r:`28`,fill:`none`,stroke:`currentColor`,strokeWidth:`9`,strokeLinecap:`round`,strokeDasharray:`176`,strokeDashoffset:`53`,transform:`rotate(-90 36 36)`})]})})},"interactive-control":{icon:_,aliases:[`interactive`,`slider`,`control`,`widget`,`input`,`embed`,`preview`],render:()=>(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(`div`,{className:`text-lg font-bold text-chart-1`,children:`$2,500`}),(0,Z.jsxs)(`div`,{className:`relative h-1.5 rounded-full bg-muted`,children:[(0,Z.jsx)(`div`,{className:`absolute inset-y-0 left-0 w-1/3 rounded-full bg-primary`}),(0,Z.jsx)(`div`,{className:`-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-1/3 size-3 rounded-full bg-primary`})]}),(0,Z.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:`Drag to adjust`})]})}};function wy(){return{name:`embed-starter-html`,label:Y._({id:`FBknns`}),icon:Zo,category:`embed`,aliases:[`html`,`embed`,`preview`,`iframe`,`sandbox`,`web`,`snippet`],description:Y._({id:`4niEzY`}),command:({chain:e})=>xy(e,Sy),preview:{description:Y._({id:`rageVb`}),render:()=>(0,Z.jsxs)(`div`,{className:`flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-background`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-border bg-muted/40 px-2 py-1.5`,children:[(0,Z.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,Z.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,Z.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`}),(0,Z.jsx)(`span`,{className:`ml-1.5 flex-1 truncate rounded-sm bg-background px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:`sandbox`})]}),(0,Z.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1.5 px-3 py-3`,children:[(0,Z.jsx)(`span`,{className:`font-semibold text-foreground text-sm`,children:(0,Z.jsx)(a,{id:`3HNlwb`})}),(0,Z.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:(0,Z.jsx)(a,{id:`bH382I`})})]})]})}}}function Ty(){let e=Vn.map(e=>{let t=Cy[e.id];return{name:`embed-starter-${e.id}`,label:e.title,icon:t.icon,category:`embed`,command:({chain:t})=>xy(t,e.html),aliases:t.aliases,description:e.description,preview:{description:e.description,render:t.render}}});return[wy(),...e]}var Ey=`ok:emoji-picker-open`;function Dy(e){typeof document>`u`||document.dispatchEvent(new CustomEvent(Ey,{detail:e}))}function Oy(){return[{name:`heading1`,label:Y._({id:`lXKZGw`}),icon:as,category:`basic`,command:({chain:e})=>e().toggleHeading({level:1}).run(),aliases:[`h1`],preview:{description:Y._({id:`3J7d2N`}),render:()=>(0,Z.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:(0,Z.jsx)(a,{id:`lXKZGw`})})}},{name:`heading2`,label:Y._({id:`El7NbA`}),icon:os,category:`basic`,command:({chain:e})=>e().toggleHeading({level:2}).run(),aliases:[`h2`],preview:{description:Y._({id:`LXdWeS`}),render:()=>(0,Z.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:(0,Z.jsx)(a,{id:`El7NbA`})})}},{name:`heading3`,label:Y._({id:`SFN6dN`}),icon:ss,category:`basic`,command:({chain:e})=>e().toggleHeading({level:3}).run(),aliases:[`h3`],preview:{description:Y._({id:`g4XBm0`}),render:()=>(0,Z.jsx)(`h3`,{className:`text-base font-semibold tracking-tight`,children:(0,Z.jsx)(a,{id:`SFN6dN`})})}},{name:`bulletList`,label:Y._({id:`s1c0ja`}),icon:_s,category:`basic`,command:({chain:e})=>e().toggleBulletList().run(),aliases:[`ul`,`unordered`],preview:{description:Y._({id:`fYjgXu`}),render:()=>(0,Z.jsxs)(`ul`,{className:`list-disc pl-5 text-sm leading-7`,children:[(0,Z.jsx)(`li`,{children:(0,Z.jsx)(a,{id:`FCxvG5`})}),(0,Z.jsx)(`li`,{children:(0,Z.jsx)(a,{id:`saIASg`})})]})}},{name:`orderedList`,label:Y._({id:`Uci-Ph`}),icon:hs,category:`basic`,command:({chain:e})=>e().toggleOrderedList().run(),aliases:[`ol`,`numbered`],preview:{description:Y._({id:`rXz97P`}),render:()=>(0,Z.jsxs)(`ol`,{className:`list-decimal pl-5 text-sm leading-7`,children:[(0,Z.jsx)(`li`,{children:(0,Z.jsx)(a,{id:`FCxvG5`})}),(0,Z.jsx)(`li`,{children:(0,Z.jsx)(a,{id:`saIASg`})})]})}},{name:`taskList`,label:Y._({id:`G_686w`}),icon:gs,category:`basic`,command:({chain:e})=>e().toggleTaskList().run(),aliases:[`todo`,`checklist`,`checkbox`],preview:{description:Y._({id:`yutJKi`}),render:()=>(0,Z.jsxs)(`ul`,{className:`space-y-1.5 text-sm`,children:[(0,Z.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:!0,readOnly:!0,className:`size-3.5`}),(0,Z.jsx)(`span`,{className:`text-muted-foreground line-through`,children:(0,Z.jsx)(a,{id:`DPfwMq`})})]}),(0,Z.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,readOnly:!0,className:`size-3.5`}),(0,Z.jsx)(`span`,{children:(0,Z.jsx)(a,{id:`rZ9HZq`})})]})]})}},{name:`blockquote`,label:Y._({id:`ZhhOwV`}),icon:Cs,category:`basic`,command:({chain:e})=>e().toggleBlockquote().run(),aliases:[`quote`],preview:{description:Y._({id:`w7nm4K`}),render:()=>(0,Z.jsx)(`blockquote`,{className:`border-l-2 border-muted-foreground/40 pl-3 text-sm italic text-muted-foreground`,children:(0,Z.jsx)(a,{id:`74-bX-`})})}},{name:`codeBlock`,label:Y._({id:`N2eHWq`}),icon:Xo,category:`basic`,command:({chain:e})=>e().toggleCodeBlock({language:`js`}).run(),aliases:[`code`,`fence`],preview:{description:Y._({id:`XpIZmv`}),render:()=>(0,Z.jsx)(`pre`,{className:`rounded-md bg-muted px-2.5 py-2 font-mono text-xs leading-5`,children:(0,Z.jsx)(`code`,{children:`const greeting = "Hello";
6
- console.log(greeting);`})})}},{name:`table`,label:Y._({id:`4hJhzz`}),icon:Ns,category:`insert`,command:({chain:e})=>e().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),aliases:[`grid`],preview:{description:Y._({id:`H0WlWQ`}),render:()=>(0,Z.jsxs)(`table`,{className:`w-full border-collapse text-xs`,children:[(0,Z.jsx)(`thead`,{children:(0,Z.jsxs)(`tr`,{children:[(0,Z.jsx)(`th`,{className:`border border-border bg-muted/50 px-2 py-1 text-left font-semibold`,children:(0,Z.jsx)(a,{id:`6YtxFj`})}),(0,Z.jsx)(`th`,{className:`border border-border bg-muted/50 px-2 py-1 text-left font-semibold`,children:(0,Z.jsx)(a,{id:`GDvlUT`})})]})}),(0,Z.jsxs)(`tbody`,{children:[(0,Z.jsxs)(`tr`,{children:[(0,Z.jsx)(`td`,{className:`border border-border px-2 py-1`,children:`Ada`}),(0,Z.jsx)(`td`,{className:`border border-border px-2 py-1`,children:`Engineer`})]}),(0,Z.jsxs)(`tr`,{children:[(0,Z.jsx)(`td`,{className:`border border-border px-2 py-1`,children:`Grace`}),(0,Z.jsx)(`td`,{className:`border border-border px-2 py-1`,children:`Admiral`})]})]})]})}},{name:`separator`,label:Y._({id:`yLq4w4`}),icon:ri,category:`insert`,command:({chain:e})=>e().setHorizontalRule().run(),aliases:[`hr`,`divider`,`rule`],preview:{description:Y._({id:`0wswKc`}),render:()=>(0,Z.jsxs)(`div`,{className:`w-full`,children:[(0,Z.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:(0,Z.jsx)(a,{id:`KYcZ6Y`})}),(0,Z.jsx)(`hr`,{className:`border-border`}),(0,Z.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:(0,Z.jsx)(a,{id:`tAPZEx`})})]})}},{name:`footnote`,label:Y._({id:`dOxPd4`}),icon:Ms,category:`insert`,command:({chain:e,state:t})=>{let n=at(er(t.doc)),r=bt(t.doc)+1;e().insertFootnoteReference(n).insertContentAt(r,{type:`footnoteDefinition`,attrs:{identifier:n,label:n},content:[{type:`paragraph`}]}).run()},aliases:[`fn`,`ref`,`[^`],preview:{description:Y._({id:`kFLlsI`}),render:()=>(0,Z.jsx)(`p`,{className:`text-sm leading-6`,children:(0,Z.jsx)(a,{id:`hxBHxQ`,components:{0:(0,Z.jsx)(`sup`,{className:`footnote-ref`}),1:(0,Z.jsx)(`a`,{className:`footnote-ref-link`,href:`#fn-1`})}})})}},{name:`emoji`,label:Y._({id:`tKlWWY`}),icon:ks,category:`insert`,command:({editor:e,afterCommit:t})=>{t(()=>Dy({editor:e}))},aliases:[`:`,`emoticon`,`smiley`,`face`,`reaction`],preview:{description:Y._({id:`MI6Z0f`}),render:()=>(0,Z.jsx)(`p`,{className:`text-2xl leading-8`,children:`🎉 🚀 ✅ ❤️ 👀`})}},{name:`inlineMath`,label:Y._({id:`q2kXMG`}),icon:Os,category:`insert`,command:({chain:e,state:t,editor:n,afterCommit:r})=>{let i=t.selection.from;e().insertMathInline(``).run(),r(()=>{fy(i),requestAnimationFrame(()=>{n.commands.setNodeSelection(i)})})},aliases:[`math`,`latex`,`equation`,`formula`,`katex`,`inlinemath`],preview:{description:Y._({id:`eNQGRb`}),render:()=>(0,Z.jsx)(`p`,{className:`text-sm leading-7`,children:(0,Z.jsx)(a,{id:`5Ajb15`,components:{0:(0,Z.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 font-serif italic`})}})})}}]}function ky(e,t){if(!t)return e;let n=t.toLowerCase();return e.filter(e=>e.label.toLowerCase().includes(n)||e.name.toLowerCase().includes(n)||e.aliases?.some(e=>e.toLowerCase().includes(n)))}var Ay=null,jy=null,My=!1,Ny=!1;async function Py(){if(!My){My=!0;try{let e={project:new Map,global:new Map},t=new Map;for(let n of[`project`,`global`]){let r=await To(n);if(r.ok)for(let i of r.skills)e[n].set(i.name,{scope:i.scope,path:i.path}),t.has(i.name)||t.set(i.name,{scope:i.scope,path:i.path})}Ay=t,jy=e}catch{}finally{My=!1}}}function Fy(){Ny||(Ny=!0,la(()=>void Py()))}function Iy(){return Fy(),Ay===null&&Py(),Ay}function Ly(e){return Fy(),jy===null?(Py(),null):jy[e]}var Ry=/^\.?\/?((?:references|scripts)(?:\/[A-Za-z0-9_-][A-Za-z0-9._-]*)+)$/;function zy(e){let t=sn(e);if(t)return{scope:`project`,name:t.name};let n=ht(e);return n?.kind===`skill`?{scope:n.scope,name:n.name}:null}function By(e,t,n){let r=n.slice(n.lastIndexOf(`.`)+1).toLowerCase();if(!((r===`md`||r===`mdx`)&&!e.name.startsWith(`open-knowledge`)))return gi({...e,path:n});let i=e.scope===`project`?`${t}.md`:``;return pi(ea({scope:e.scope,name:e.name,path:i},n))}function Vy(e){if(!e.isText||e.text===void 0||!e.marks.some(e=>e.type.name===`code`))return null;let t=Ry.exec(e.text);return t?t[1]:null}function Hy(e){let t=[],n=Iy();return e.descendants((e,r)=>{let i=Vy(e);if(i!==null){t.push(Rt.inline(r,r+e.nodeSize,{class:`ok-skill-path-link`,"data-skill-path":i}));return}if(n!==null&&e.isText&&e.text!==void 0){if(e.marks.some(e=>e.type.name===`code`)){let i=/^\/([a-z0-9][a-z0-9-]{1,63})$/.exec(e.text)?.[1];i!==void 0&&en(i)&&t.push(Rt.inline(r,r+e.nodeSize,{class:n.has(i)?`ok-skill-ref`:`ok-skill-ref ok-skill-ref-missing`,"data-skill-ref":i}));return}It.lastIndex=0;for(let i=It.exec(e.text);i!==null;i=It.exec(e.text)){let e=i[2];if(!en(e))continue;let a=r+(i.index??0)+i[1].length,o=n.has(e);t.push(Rt.inline(a,a+e.length+1,{class:o?`ok-skill-ref`:`ok-skill-ref ok-skill-ref-missing`,"data-skill-ref":e}))}}}),Je.create(e,t)}var Uy=new Nn(`okSkillPathLinks`),Wy=tt.create({name:`skillPathLinks`,addOptions(){return{docName:``}},addProseMirrorPlugins(){let e=this.options.docName,t=this.options.onBundlePathClick,n=zy(e);return n===null?[]:[new ar({key:Uy,state:{init:(e,t)=>Hy(t.doc),apply:(e,t)=>e.docChanged?Hy(e.doc):t.map(e.mapping,e.doc)},props:{decorations(e){return Uy.getState(e)},handleClick(r,i,a){let o=a.target instanceof HTMLElement?a.target.closest(`[data-skill-ref]`):null,s=o instanceof HTMLElement?o.dataset.skillRef:void 0;if(s!==void 0){let e=Iy()?.get(s);return e===void 0?Eo({ref:s,scope:n.scope,from:n.name}).then(e=>{e.ok&&e.kind===`local`&&e.scope&&e.name?window.location.hash=pi(Mi({scope:e.scope,name:e.name,path:e.dir===void 0?``:`${e.dir}/SKILL.md`})):e.ok&&e.kind===`import`&&e.source&&e.ref?window.location.hash=hi({flavor:`explore`,source:e.source,name:e.ref,subtitle:e.source,level:n.scope}):window.location.hash=mi()}):window.location.hash=pi(Mi({scope:e.scope,name:s,path:e.path})),!0}let c=r.state.doc.resolve(i),l=c.parent.maybeChild(c.index()),u=l?Vy(l):null;return u===null?!1:(t?.(u)===!0||(window.location.hash=By(n,e,u)),!0)}}})]}});function Gy(e){if(!e)return null;let t=e.extensionManager.extensions.find(e=>e.name===`skillPathLinks`)?.options?.docName;return typeof t==`string`&&t!==``?t:null}function Ky(e){let t=Gy(e?.editor),n=t===null?null:zy(t);if(n===null)return[];let r=Ly(n.scope);if(r===null)return[];let i=[];for(let[e,t]of r)i.push({name:`skill-ref-${e}`,label:e,icon:As,category:`skills`,description:t.scope,command:t=>{t.chain().focus().insertContent(`/${e} `).run()}});return i.sort((e,t)=>e.label.localeCompare(t.label)),i}function qy(e){let{$from:t}=e.selection;return t.depth===0?null:{from:t.before(1),to:t.after(1)}}function Jy(e,t){let n=qy(e);if(!n)return!1;let{from:r,to:i}=n;if(r===0)return!1;let a=e.doc.resolve(r-1);if(a.depth===0)return!1;let o=a.before(1),s=e.doc.slice(r,i).content,c=e.doc.slice(o,r).content;if(!t)return!0;let l=e.tr;l.replaceWith(o,i,s.append(c));let u=o+1,d=o+s.size,f=e.selection.from-r,p=Math.min(u+f,d);return l.setSelection(lr.near(l.doc.resolve(p))),l.scrollIntoView(),t(l),!0}function Yy(e,t){let n=qy(e);if(!n)return!1;let{from:r,to:i}=n;if(i>=e.doc.content.size)return!1;let a=e.doc.resolve(i+1);if(a.depth===0)return!1;let o=a.after(1),s=e.doc.slice(r,i).content,c=e.doc.slice(i,o).content;if(!t)return!0;let l=e.tr;l.replaceWith(r,o,c.append(s));let u=r+c.size+1,d=r+c.size+s.size,f=e.selection.from-r,p=Math.min(u+f,d);return l.setSelection(lr.near(l.doc.resolve(p))),l.scrollIntoView(),t(l),!0}var Xy=tt.create({name:`blockMover`,addKeyboardShortcuts(){return{"Mod-Shift-ArrowUp":({editor:e})=>Jy(e.state,e.view.dispatch),"Mod-Shift-ArrowDown":({editor:e})=>Yy(e.state,e.view.dispatch)}}}),Zy=new Nn(`bridgeId`);function Qy(e){let t=Zl.getState(e);return t?.binding?.mapping?t.binding.mapping:null}function $y(e){let t=Qy(e);if(!t)return null;let n=new Map;for(let[e,r]of t)r&&`nodeName`in e&&typeof e.getAttribute==`function`&&n.set(r,e);return n}function eb(e,t){return e?e.get(t)??null:null}var tb=tt.create({name:`bridgeIdPlugin`,priority:1e3,addProseMirrorPlugins(){return[new ar({key:Zy,state:{init(e,t){let n={yElementToId:new WeakMap,posToId:new Map,counter:0},r=$y(t);return t.doc.descendants((e,t)=>{if(e.type.name!==`jsxComponent`)return;let i=eb(r,e);if(i){let e=`b${++n.counter}`;n.yElementToId.set(i,e),n.posToId.set(t,e)}else{let e=`b${++n.counter}`;n.posToId.set(t,e)}}),n},apply(e,t,n,r){if(!e.docChanged){let n=new Map;for(let[i,a]of t.posToId){let t=e.mapping.map(i);r.doc.nodeAt(t)?.type.name===`jsxComponent`&&n.set(t,a)}return{...t,posToId:n}}let i=new Map,{counter:a}=t,{yElementToId:o}=t,s=$y(r);return r.doc.descendants((n,r)=>{if(n.type.name!==`jsxComponent`)return;let c=eb(s,n);if(c){let e=o.get(c);if(e)i.set(r,e);else{let e=`b${++a}`;o.set(c,e),i.set(r,e)}}else{let n=!1;for(let[a,o]of t.posToId)if(e.mapping.map(a)===r){i.set(r,o),n=!0;break}if(!n){let e=`b${++a}`;i.set(r,e)}}}),{yElementToId:o,posToId:i,counter:a}}}})]}}),nb=new Set([`tableCell`,`tableHeader`]);function rb(e){let{$from:t}=e.selection;for(let e=t.depth;e>0;e--)if(nb.has(t.node(e).type.name))return!0;return!1}var ib=`jsxComponent`,ab=new Set([ib,`table`,`tableRow`,`tableCell`,`tableHeader`]);function ob(e){let t=0,n=(e,r)=>{e.forEach(e=>{let i=r||nb.has(e.type.name);i&&e.type.name===ib&&(t+=1),n(e,i)})};return n(e,!1),t}function sb(e){let t=!1;return e.content.descendants(e=>t?!1:ab.has(e.type.name)?(t=!0,!1):!0),t}var cb=new Nn(`cellInsertionGate`),lb=tt.create({name:`cellInsertionGate`,addProseMirrorPlugins(){return[new ar({key:cb,filterTransaction(e,t){return e.getMeta(Zl)||!e.docChanged||!e.steps.some(e=>(e instanceof Cn||e instanceof yn)&&sb(e.slice))?!0:ob(e.doc)<=ob(t.doc)}})]}}),ub=new Nn(`chunkWrapperDecoration`),db=`ok-chunk-wrapper`,fb=!1;function pb(){return globalThis.CSS===void 0||typeof globalThis.CSS.supports!=`function`?!0:globalThis.CSS.supports(`content-visibility`,`auto`)}var mb=pb();function hb(){return mb?new ar({key:ub,props:{decorations(e){let t=[];return e.doc.forEach((e,n)=>{e.isInline||e.type.name!==`jsxComponent`&&t.push(Rt.node(n,n+e.nodeSize,{class:db}))}),t.length===0?null:(fb||(fb=!0,X(`ok/render/cv-auto-skip`,{chunkCount:t.length},{startTime:performance.now(),duration:0})),Je.create(e.doc,t))}}}):new ar({key:ub})}function gb(e){return{name:`Gherkin`,aliases:[`feature`],keywords:`Feature Background Ability Business Need Scenario Scenarios Scenario Outline Scenario Template Examples Given And Then But When`,contains:[{className:`symbol`,begin:`\\*`,relevance:0},{className:`meta`,begin:`@[^@\\s]+`},{begin:`\\|`,end:`\\|\\w*$`,contains:[{className:`string`,begin:`[^|]+`}]},{className:`variable`,begin:`<`,end:`>`},e.HASH_COMMENT_MODE,{className:`string`,begin:`"""`,end:`"""`},e.QUOTE_STRING_MODE]}}function _b(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`decltype\\(auto\\)`,i=`[a-zA-Z_]\\w*::`,a=`(?!struct)(`+r+`|`+t.optional(i)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,o={className:`type`,begin:`\\b[a-z\\d_]*_t\\b`},s={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:`number`,variants:[{begin:`[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)`},{begin:`[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)`}],relevance:0},l={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:`title`,begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+`\\s*\\(`,f=`alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`),p=[`bool`,`char`,`char16_t`,`char32_t`,`char8_t`,`double`,`float`,`int`,`long`,`short`,`void`,`wchar_t`,`unsigned`,`signed`,`const`,`static`],m=`any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view`.split(`.`),h=`abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf`.split(`.`),g={type:p,keyword:f,literal:[`NULL`,`false`,`nullopt`,`nullptr`,`true`],built_in:[`_Pragma`],_type_hints:m},_={className:`function.dispatch`,relevance:0,keywords:{_hint:h},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},v=[_,l,o,n,e.C_BLOCK_COMMENT_MODE,c,s],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:g,contains:v.concat([{begin:/\(/,end:/\)/,keywords:g,contains:v.concat([`self`]),relevance:0}]),relevance:0},b={className:`function`,begin:`(`+a+`[\\*&\\s]+)+`+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:g,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,c]},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,c,o,{begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,s,c,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,l]};return{name:`C++`,aliases:[`cc`,`c++`,`h++`,`hpp`,`hh`,`hxx`,`cxx`],keywords:g,illegal:`</`,classNameAliases:{"function.dispatch":`built_in`},contains:[].concat(y,b,_,v,[l,{begin:`\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)`,end:`>`,keywords:g,contains:[`self`,o]},{begin:e.IDENT_RE+`::`,keywords:g},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:`keyword`,3:`title.class`}}])}}function vb(e){let t={type:[`boolean`,`byte`,`word`,`String`],built_in:`KeyboardController.MouseController.SoftwareSerial.EthernetServer.EthernetClient.LiquidCrystal.RobotControl.GSMVoiceCall.EthernetUDP.EsploraTFT.HttpClient.RobotMotor.WiFiClient.GSMScanner.FileSystem.Scheduler.GSMServer.YunClient.YunServer.IPAddress.GSMClient.GSMModem.Keyboard.Ethernet.Console.GSMBand.Esplora.Stepper.Process.WiFiUDP.GSM_SMS.Mailbox.USBHost.Firmata.PImage.Client.Server.GSMPIN.FileIO.Bridge.Serial.EEPROM.Stream.Mouse.Audio.Servo.File.Task.GPRS.WiFi.Wire.TFT.GSM.SPI.SD`.split(`.`),_hints:`setup.loop.runShellCommandAsynchronously.analogWriteResolution.retrieveCallingNumber.printFirmwareVersion.analogReadResolution.sendDigitalPortPair.noListenOnLocalhost.readJoystickButton.setFirmwareVersion.readJoystickSwitch.scrollDisplayRight.getVoiceCallStatus.scrollDisplayLeft.writeMicroseconds.delayMicroseconds.beginTransmission.getSignalStrength.runAsynchronously.getAsynchronously.listenOnLocalhost.getCurrentCarrier.readAccelerometer.messageAvailable.sendDigitalPorts.lineFollowConfig.countryNameWrite.runShellCommand.readStringUntil.rewindDirectory.readTemperature.setClockDivider.readLightSensor.endTransmission.analogReference.detachInterrupt.countryNameRead.attachInterrupt.encryptionType.readBytesUntil.robotNameWrite.readMicrophone.robotNameRead.cityNameWrite.userNameWrite.readJoystickY.readJoystickX.mouseReleased.openNextFile.scanNetworks.noInterrupts.digitalWrite.beginSpeaker.mousePressed.isActionDone.mouseDragged.displayLogos.noAutoscroll.addParameter.remoteNumber.getModifiers.keyboardRead.userNameRead.waitContinue.processInput.parseCommand.printVersion.readNetworks.writeMessage.blinkVersion.cityNameRead.readMessage.setDataMode.parsePacket.isListening.setBitOrder.beginPacket.isDirectory.motorsWrite.drawCompass.digitalRead.clearScreen.serialEvent.rightToLeft.setTextSize.leftToRight.requestFrom.keyReleased.compassRead.analogWrite.interrupts.WiFiServer.disconnect.playMelody.parseFloat.autoscroll.getPINUsed.setPINUsed.setTimeout.sendAnalog.readSlider.analogRead.beginWrite.createChar.motorsStop.keyPressed.tempoWrite.readButton.subnetMask.debugPrint.macAddress.writeGreen.randomSeed.attachGPRS.readString.sendString.remotePort.releaseAll.mouseMoved.background.getXChange.getYChange.answerCall.getResult.voiceCall.endPacket.constrain.getSocket.writeJSON.getButton.available.connected.findUntil.readBytes.exitValue.readGreen.writeBlue.startLoop.IPAddress.isPressed.sendSysex.pauseMode.gatewayIP.setCursor.getOemKey.tuneWrite.noDisplay.loadImage.switchPIN.onRequest.onReceive.changePIN.playFile.noBuffer.parseInt.overflow.checkPIN.knobRead.beginTFT.bitClear.updateIR.bitWrite.position.writeRGB.highByte.writeRed.setSpeed.readBlue.noStroke.remoteIP.transfer.shutdown.hangCall.beginSMS.endWrite.attached.maintain.noCursor.checkReg.checkPUK.shiftOut.isValid.shiftIn.pulseIn.connect.println.localIP.pinMode.getIMEI.display.noBlink.process.getBand.running.beginSD.drawBMP.lowByte.setBand.release.bitRead.prepare.pointTo.readRed.setMode.noFill.remove.listen.stroke.detach.attach.noTone.exists.buffer.height.bitSet.circle.config.cursor.random.IRread.setDNS.endSMS.getKey.micros.millis.begin.print.write.ready.flush.width.isPIN.blink.clear.press.mkdir.rmdir.close.point.yield.image.BSSID.click.delay.read.text.move.peek.beep.rect.line.open.seek.fill.size.turn.stop.home.find.step.tone.sqrt.RSSI.SSID.end.bit.tan.cos.sin.pow.map.abs.max.min.get.run.put`.split(`.`),literal:[`DIGITAL_MESSAGE`,`FIRMATA_STRING`,`ANALOG_MESSAGE`,`REPORT_DIGITAL`,`REPORT_ANALOG`,`INPUT_PULLUP`,`SET_PIN_MODE`,`INTERNAL2V56`,`SYSTEM_RESET`,`LED_BUILTIN`,`INTERNAL1V1`,`SYSEX_START`,`INTERNAL`,`EXTERNAL`,`DEFAULT`,`OUTPUT`,`INPUT`,`HIGH`,`LOW`]},n=_b(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name=`Arduino`,n.aliases=[`ino`],n.supersetOf=`cpp`,n}function yb(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}function bb(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`decltype\\(auto\\)`,i=`[a-zA-Z_]\\w*::`,a=`(`+r+`|`+t.optional(i)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,o={className:`type`,variants:[{begin:`\\b[a-z\\d_]*_t\\b`},{match:/\batomic_[a-z]{3,6}\b/}]},s={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:`number`,variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},l={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:`title`,begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+`\\s*\\(`,f={keyword:`asm.auto.break.case.continue.default.do.else.enum.extern.for.fortran.goto.if.inline.register.restrict.return.sizeof.typeof.typeof_unqual.struct.switch.typedef.union.volatile.while._Alignas._Alignof._Atomic._Generic._Noreturn._Static_assert._Thread_local.alignas.alignof.noreturn.static_assert.thread_local._Pragma`.split(`.`),type:`float.double.signed.unsigned.int.short.long.char.void._Bool._BitInt._Complex._Imaginary._Decimal32._Decimal64._Decimal96._Decimal128._Decimal64x._Decimal128x._Float16._Float32._Float64._Float128._Float32x._Float64x._Float128x.const.static.constexpr.complex.bool.imaginary`.split(`.`),literal:`true false NULL`,built_in:`std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr`},p=[l,o,n,e.C_BLOCK_COMMENT_MODE,c,s],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:f,contains:p.concat([{begin:/\(/,end:/\)/,keywords:f,contains:p.concat([`self`]),relevance:0}]),relevance:0},h={begin:`(`+a+`[\\*&\\s]+)+`+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:f,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(u,{className:`title.function`})],relevance:0},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,c,o,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,s,c,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,l]};return{name:`C`,aliases:[`h`],keywords:f,disableAutodetect:!0,illegal:`</`,contains:[].concat(m,h,p,[l,{begin:e.IDENT_RE+`::`,keywords:f},{className:`class`,beginKeywords:`enum class struct union`,end:/[{;:<>=]/,contains:[{beginKeywords:`final class struct`},e.TITLE_MODE]}]),exports:{preprocessor:l,strings:s,keywords:f}}}function xb(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`decltype\\(auto\\)`,i=`[a-zA-Z_]\\w*::`,a=`(?!struct)(`+r+`|`+t.optional(i)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,o={className:`type`,begin:`\\b[a-z\\d_]*_t\\b`},s={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:`number`,variants:[{begin:`[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)`},{begin:`[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)`}],relevance:0},l={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:`title`,begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+`\\s*\\(`,f=`alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`),p=[`bool`,`char`,`char16_t`,`char32_t`,`char8_t`,`double`,`float`,`int`,`long`,`short`,`void`,`wchar_t`,`unsigned`,`signed`,`const`,`static`],m=`any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view`.split(`.`),h=`abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf`.split(`.`),g={type:p,keyword:f,literal:[`NULL`,`false`,`nullopt`,`nullptr`,`true`],built_in:[`_Pragma`],_type_hints:m},_={className:`function.dispatch`,relevance:0,keywords:{_hint:h},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},v=[_,l,o,n,e.C_BLOCK_COMMENT_MODE,c,s],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:g,contains:v.concat([{begin:/\(/,end:/\)/,keywords:g,contains:v.concat([`self`]),relevance:0}]),relevance:0},b={className:`function`,begin:`(`+a+`[\\*&\\s]+)+`+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:g,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,c]},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,c,o,{begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,s,c,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,l]};return{name:`C++`,aliases:[`cc`,`c++`,`h++`,`hpp`,`hh`,`hxx`,`cxx`],keywords:g,illegal:`</`,classNameAliases:{"function.dispatch":`built_in`},contains:[].concat(y,b,_,v,[l,{begin:`\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)`,end:`>`,keywords:g,contains:[`self`,o]},{begin:e.IDENT_RE+`::`,keywords:g},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:`keyword`,3:`title.class`}}])}}function Sb(e){let t=[`bool`,`byte`,`char`,`decimal`,`delegate`,`double`,`dynamic`,`enum`,`float`,`int`,`long`,`nint`,`nuint`,`object`,`sbyte`,`short`,`string`,`ulong`,`uint`,`ushort`],n=[`public`,`private`,`protected`,`static`,`internal`,`protected`,`abstract`,`async`,`extern`,`override`,`unsafe`,`virtual`,`new`,`sealed`,`partial`],r={keyword:`abstract.as.base.break.case.catch.class.const.continue.do.else.event.explicit.extern.finally.fixed.for.foreach.goto.if.implicit.in.interface.internal.is.lock.namespace.new.operator.out.override.params.private.protected.public.readonly.record.ref.return.scoped.sealed.sizeof.stackalloc.static.struct.switch.this.throw.try.typeof.unchecked.unsafe.using.virtual.void.volatile.while`.split(`.`).concat(`add.alias.and.ascending.args.async.await.by.descending.dynamic.equals.file.from.get.global.group.init.into.join.let.nameof.not.notnull.on.or.orderby.partial.record.remove.required.scoped.select.set.unmanaged.value|0.var.when.where.with.yield`.split(`.`)),built_in:t,literal:[`default`,`false`,`null`,`true`]},i=e.inherit(e.TITLE_MODE,{begin:`[a-zA-Z](\\.?\\w)*`}),a={className:`number`,variants:[{begin:`\\b(0b[01']+)`},{begin:`(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)`},{begin:`(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)`}],relevance:0},o={className:`string`,begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},s={className:`string`,begin:`@"`,end:`"`,contains:[{begin:`""`}]},c=e.inherit(s,{illegal:/\n/}),l={className:`subst`,begin:/\{/,end:/\}/,keywords:r},u=e.inherit(l,{illegal:/\n/}),d={className:`string`,begin:/\$"/,end:`"`,illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,u]},f={className:`string`,begin:/\$@"/,end:`"`,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:`""`},l]},p=e.inherit(f,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:`""`},u]});l.contains=[f,d,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],u.contains=[p,d,c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let m={variants:[o,f,d,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h={begin:`<`,end:`>`,contains:[{beginKeywords:`in out`},i]},g=e.IDENT_RE+`(<`+e.IDENT_RE+`(\\s*,\\s*`+e.IDENT_RE+`)*>)?(\\[\\])?`,_={begin:`@`+e.IDENT_RE,relevance:0};return{name:`C#`,aliases:[`cs`,`c#`],keywords:r,illegal:/::/,contains:[e.COMMENT(`///`,`$`,{returnBegin:!0,contains:[{className:`doctag`,variants:[{begin:`///`,relevance:0},{begin:`<!--|-->`},{begin:`</?`,end:`>`}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`meta`,begin:`#`,end:`$`,keywords:{keyword:`if else elif endif define undef warning error line region endregion pragma checksum`}},m,a,{beginKeywords:`class interface`,relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:`where class`},i,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`namespace`,relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`record`,relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:`meta`,begin:`^\\s*\\[(?=[\\w])`,excludeBegin:!0,end:`\\]`,excludeEnd:!0,contains:[{className:`string`,begin:/"/,end:/"/}]},{beginKeywords:`new return throw await else`,relevance:0},{className:`function`,begin:`(`+g+`\\s+)+`+e.IDENT_RE+`\\s*(<[^=]+>\\s*)?\\(`,returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:r,contains:[{beginKeywords:n.join(` `),relevance:0},{begin:e.IDENT_RE+`\\s*(<[^=]+>\\s*)?\\(`,returnBegin:!0,contains:[e.TITLE_MODE,h],relevance:0},{match:/\(\)/},{className:`params`,begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,relevance:0,contains:[m,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}var Cb=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),wb=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),Tb=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),Eb=[...wb,...Tb],Db=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),Ob=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),kb=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),Ab=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function jb(e){let t=e.regex,n=Cb(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+Ob.join(`|`)+`)`},{begin:`:(:)?(`+kb.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+Ab.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:Db.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+Eb.join(`|`)+`)\\b`}]}}function Mb(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}function Nb(e){let t={keyword:[`break`,`case`,`chan`,`const`,`continue`,`default`,`defer`,`else`,`fallthrough`,`for`,`func`,`go`,`goto`,`if`,`import`,`interface`,`map`,`package`,`range`,`return`,`select`,`struct`,`switch`,`type`,`var`],type:[`bool`,`byte`,`complex64`,`complex128`,`error`,`float32`,`float64`,`int8`,`int16`,`int32`,`int64`,`string`,`uint8`,`uint16`,`uint32`,`uint64`,`int`,`uint`,`uintptr`,`rune`],literal:[`true`,`false`,`iota`,`nil`],built_in:[`append`,`cap`,`close`,`complex`,`copy`,`imag`,`len`,`make`,`new`,`panic`,`print`,`println`,`real`,`recover`,`delete`]};return{name:`Go`,aliases:[`golang`],keywords:t,illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`string`,variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:`number`,variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:`function`,beginKeywords:`func`,end:`\\s*(\\{|$)`,excludeEnd:!0,contains:[e.TITLE_MODE,{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}}function Pb(e){let t=e.regex;return{name:`GraphQL`,aliases:[`gql`],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:[`query`,`mutation`,`subscription`,`type`,`input`,`schema`,`directive`,`interface`,`union`,`scalar`,`fragment`,`enum`,`on`],literal:[`true`,`false`,`null`]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:`punctuation`,match:/[.]{3}/,relevance:0},{scope:`punctuation`,begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:`variable`,begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:`meta`,match:/@\w+/,excludeEnd:!0},{scope:`symbol`,begin:t.concat(/[_A-Za-z][_0-9A-Za-z]*/,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function Fb(e){let t=e.regex,n={className:`number`,relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let i={className:`variable`,variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={className:`literal`,begin:/\bon|off|true|false|yes|no\b/},o={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:`'''`,end:`'''`,relevance:10},{begin:`"""`,end:`"""`,relevance:10},{begin:`"`,end:`"`},{begin:`'`,end:`'`}]},s={begin:/\[/,end:/\]/,contains:[r,a,i,o,n,`self`],relevance:0},c=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:`TOML, also INI`,aliases:[`toml`],case_insensitive:!0,illegal:/\S/,contains:[r,{className:`section`,begin:/\[+/,end:/\]+/},{begin:t.concat(c,`(\\s*\\.\\s*`,c,`)*`,t.lookahead(/\s*=\s*[^#\s]/)),className:`attr`,starts:{end:/$/,contains:[r,s,a,i,o,n]}}]}}var Ib=`[0-9](_*[0-9])*`,Lb=`\\.(${Ib})`,Rb=`[0-9a-fA-F](_*[0-9a-fA-F])*`,zb={className:`number`,variants:[{begin:`(\\b(${Ib})((${Lb})|\\.)?|(${Lb}))[eE][+-]?(${Ib})[fFdD]?\\b`},{begin:`\\b(${Ib})((${Lb})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Lb})[fFdD]?\\b`},{begin:`\\b(${Ib})[fFdD]\\b`},{begin:`\\b0[xX]((${Rb})\\.?|(${Rb})?\\.(${Rb}))[pP][+-]?(${Ib})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${Rb})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function Bb(e,t,n){return n===-1?``:e.replace(t,r=>Bb(e,t,n-1))}function Vb(e){let t=e.regex,n=`[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,r=n+Bb(`(?:<`+n+`~~~(?:\\s*,\\s*[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*~~~)*>)?`,/~~~/g,2),i={keyword:`synchronized.abstract.private.var.static.if.const .for.while.strictfp.finally.protected.import.native.final.void.enum.else.break.transient.catch.instanceof.volatile.case.assert.package.default.public.try.switch.continue.throws.protected.public.private.module.requires.exports.do.sealed.yield.permits.goto.when`.split(`.`),literal:[`false`,`true`,`null`],type:[`char`,`boolean`,`long`,`float`,`int`,`byte`,`short`,`double`],built_in:[`super`,`this`]},a={className:`meta`,begin:`@`+n,contains:[{begin:/\(/,end:/\)/,contains:[`self`]}]},o={className:`params`,begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:`Java`,aliases:[`jsp`],keywords:i,illegal:/<\/|#/,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:`doctag`,begin:`@[A-Za-z]+`}]}),{begin:/import java\.[a-z]+\./,keywords:`import`,relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:`string`,contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:`keyword`,3:`title.class`}},{match:/non-sealed/,scope:`keyword`},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:`type`,3:`variable`,5:`operator`}},{begin:[/record/,/\s+/,n],className:{1:`keyword`,3:`title.class`},contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`new throw return else`,relevance:0},{begin:[`(?:`+r+`\\s+)`,e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:`title.function`},keywords:i,contains:[{className:`params`,begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,zb,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},zb,a]}}var Hb=`[A-Za-z$_][0-9A-Za-z$_]*`,Ub=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),Wb=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],Gb=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),Kb=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],qb=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],Jb=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],Yb=[].concat(qb,Gb,Kb);function Xb(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=Hb,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:Hb,keyword:Ub,literal:Wb,built_in:Yb,"variable.language":Jb},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...Gb,...Kb]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...qb,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function Zb(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}var Qb=`[0-9](_*[0-9])*`,$b=`\\.(${Qb})`,ex=`[0-9a-fA-F](_*[0-9a-fA-F])*`,tx={className:`number`,variants:[{begin:`(\\b(${Qb})((${$b})|\\.)?|(${$b}))[eE][+-]?(${Qb})[fFdD]?\\b`},{begin:`\\b(${Qb})((${$b})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${$b})[fFdD]?\\b`},{begin:`\\b(${Qb})[fFdD]\\b`},{begin:`\\b0[xX]((${ex})\\.?|(${ex})?\\.(${ex}))[pP][+-]?(${Qb})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${ex})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function nx(e){let t={keyword:`abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual`,built_in:`Byte Short Char Int Long Boolean Float Double Void Unit Nothing`,literal:`true false null`},n={className:`keyword`,begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:`symbol`,begin:/@\w+/}]}},r={className:`symbol`,begin:e.UNDERSCORE_IDENT_RE+`@`},i={className:`subst`,begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},a={className:`variable`,begin:`\\$`+e.UNDERSCORE_IDENT_RE},o={className:`string`,variants:[{begin:`"""`,end:`"""(?=[^"])`,contains:[a,i]},{begin:`'`,end:`'`,illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:`"`,end:`"`,illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,a,i]}]};i.contains.push(o);let s={className:`meta`,begin:`@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*`+e.UNDERSCORE_IDENT_RE+`)?`},c={className:`meta`,begin:`@`+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:`string`}),`self`]}]},l=tx,u=e.COMMENT(`/\\*`,`\\*/`,{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:`type`,begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=d;return f.variants[1].contains=[d],d.variants[1].contains=[f],{name:`Kotlin`,aliases:[`kt`,`kts`],keywords:t,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`}]}),e.C_LINE_COMMENT_MODE,u,n,r,s,c,{className:`function`,beginKeywords:`fun`,end:`[(]|$`,returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+`\\s*\\(`,returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:`type`,begin:/</,end:/>/,keywords:`reified`,relevance:0},{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,u],relevance:0},e.C_LINE_COMMENT_MODE,u,s,c,o,e.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:`title.class`},keywords:`class interface trait`,end:/[:\{(]|$/,excludeEnd:!0,illegal:`extends implements`,contains:[{beginKeywords:`public protected internal private constructor`},e.UNDERSCORE_TITLE_MODE,{className:`type`,begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,c]},o,{className:`meta`,begin:`^#!/usr/bin/env`,end:`$`,illegal:`
7
- `},l]}}var rx=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),ix=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),ax=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),ox=[...ix,...ax],sx=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),cx=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),lx=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),ux=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse(),dx=cx.concat(lx).sort().reverse();function fx(e){let t=rx(e),n=dx,r=`[\\w-]+`,i=`(`+r+`|@\\{[\\w-]+\\})`,a=[],o=[],s=function(e){return{className:`string`,begin:`~?`+e+`.*?`+e}},c=function(e,t,n){return{className:e,begin:t,relevance:n}},l={$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:sx.join(` `)},u={begin:`\\(`,end:`\\)`,contains:o,keywords:l,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s(`'`),s(`"`),t.CSS_NUMBER_MODE,{begin:`(url|data-uri)\\(`,starts:{className:`string`,end:`[\\)\\n]`,excludeEnd:!0}},t.HEXCOLOR,u,c(`variable`,`@@?`+r,10),c(`variable`,`@\\{`+r+`\\}`),c(`built_in`,"~?`[^`]*?`"),{className:`attribute`,begin:r+`\\s*:`,end:`:`,returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:`and not`},t.FUNCTION_DISPATCH);let d=o.concat({begin:/\{/,end:/\}/,contains:a}),f={beginKeywords:`when`,endsWithParent:!0,contains:[{beginKeywords:`and not`}].concat(o)},p={begin:i+`\\s*:`,returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+ux.join(`|`)+`)\\b`,end:/(?=:)/,starts:{endsWithParent:!0,illegal:`[<=$]`,relevance:0,contains:o}}]},m={className:`keyword`,begin:`@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b`,starts:{end:`[;{}]`,keywords:l,returnEnd:!0,contains:o,relevance:0}},h={className:`variable`,variants:[{begin:`@`+r+`\\s*:`,relevance:15},{begin:`@`+r}],starts:{end:`[;}]`,returnEnd:!0,contains:d}},g={variants:[{begin:`[\\.#:&\\[>]`,end:`[;{}]`},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,c(`keyword`,`all\\b`),c(`variable`,`@\\{`+r+`\\}`),{begin:`\\b(`+ox.join(`|`)+`)\\b`,className:`selector-tag`},t.CSS_NUMBER_MODE,c(`selector-tag`,i,0),c(`selector-id`,`#`+i),c(`selector-class`,`\\.`+i,0),c(`selector-tag`,`&`,0),t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,begin:`:(`+cx.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+lx.join(`|`)+`)`},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:`!important`},t.FUNCTION_DISPATCH]},_={begin:`[\\w-]+:(:)?(${n.join(`|`)})`,returnBegin:!0,contains:[g]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,h,_,p,g,f,t.FUNCTION_DISPATCH),{name:`Less`,case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function px(e){let t=`\\[=*\\[`,n=`\\]=*\\]`,r={begin:t,end:n,contains:[`self`]},i=[e.COMMENT(`--(?!`+t+`)`,`$`),e.COMMENT(`--`+t,n,{contains:[r],relevance:10})];return{name:`Lua`,aliases:[`pluto`],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:`true false nil`,keyword:`and break do else elseif end for goto if in local not or repeat return then until while`,built_in:`_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove`},contains:i.concat([{className:`function`,beginKeywords:`function`,end:`\\)`,contains:[e.inherit(e.TITLE_MODE,{begin:`([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*`}),{className:`params`,begin:`\\(`,endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:`string`,begin:t,end:n,contains:[r],relevance:5}])}}function mx(e){let t={className:`variable`,variants:[{begin:`\\$\\(`+e.UNDERSCORE_IDENT_RE+`\\)`,contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:`variable`,begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:`subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value`},contains:[t,n]},i={begin:`^`+e.UNDERSCORE_IDENT_RE+`\\s*(?=[:+?]?=)`},a={className:`meta`,begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:`.PHONY`}},o={className:`section`,begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:`Makefile`,aliases:[`mk`,`mak`,`make`],keywords:{$pattern:/[\w-]+/,keyword:`define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath`},contains:[e.HASH_COMMENT_MODE,t,n,r,i,a,o]}}function hx(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function gx(e){let t={className:`built_in`,begin:`\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+`},n=/[a-zA-Z@][a-zA-Z0-9_]*/,r={"variable.language":[`this`,`super`],$pattern:n,keyword:`while.export.sizeof.typedef.const.struct.for.union.volatile.static.mutable.if.do.return.goto.enum.else.break.extern.asm.case.default.register.explicit.typename.switch.continue.inline.readonly.assign.readwrite.self.@synchronized.id.typeof.nonatomic.IBOutlet.IBAction.strong.weak.copy.in.out.inout.bycopy.byref.oneway.__strong.__weak.__block.__autoreleasing.@private.@protected.@public.@try.@property.@end.@throw.@catch.@finally.@autoreleasepool.@synthesize.@dynamic.@selector.@optional.@required.@encode.@package.@import.@defs.@compatibility_alias.__bridge.__bridge_transfer.__bridge_retained.__bridge_retain.__covariant.__contravariant.__kindof._Nonnull._Nullable._Null_unspecified.__FUNCTION__.__PRETTY_FUNCTION__.__attribute__.getter.setter.retain.unsafe_unretained.nonnull.nullable.null_unspecified.null_resettable.class.instancetype.NS_DESIGNATED_INITIALIZER.NS_UNAVAILABLE.NS_REQUIRES_SUPER.NS_RETURNS_INNER_POINTER.NS_INLINE.NS_AVAILABLE.NS_DEPRECATED.NS_ENUM.NS_OPTIONS.NS_SWIFT_UNAVAILABLE.NS_ASSUME_NONNULL_BEGIN.NS_ASSUME_NONNULL_END.NS_REFINED_FOR_SWIFT.NS_SWIFT_NAME.NS_SWIFT_NOTHROW.NS_DURING.NS_HANDLER.NS_ENDHANDLER.NS_VALUERETURN.NS_VOIDRETURN`.split(`.`),literal:[`false`,`true`,`FALSE`,`TRUE`,`nil`,`YES`,`NO`,`NULL`],built_in:[`dispatch_once_t`,`dispatch_queue_t`,`dispatch_sync`,`dispatch_async`,`dispatch_once`],type:[`int`,`float`,`char`,`unsigned`,`signed`,`short`,`long`,`double`,`wchar_t`,`unichar`,`void`,`bool`,`BOOL`,`id|0`,`_Bool`]},i={$pattern:n,keyword:[`@interface`,`@class`,`@protocol`,`@implementation`]};return{name:`Objective-C`,aliases:[`mm`,`objc`,`obj-c`,`obj-c++`,`objective-c++`],keywords:r,illegal:`</`,contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:`string`,variants:[{begin:`@"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]}]},{className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),{className:`string`,begin:/<.*?>/,end:/$/,illegal:`\\n`},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:`class`,begin:`(`+i.keyword.join(`|`)+`)\\b`,end:/(\{|$)/,excludeEnd:!0,keywords:i,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:`\\.`+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function _x(e){let t=e.regex,n=`abs.accept.alarm.and.atan2.bind.binmode.bless.break.caller.chdir.chmod.chomp.chop.chown.chr.chroot.class.close.closedir.connect.continue.cos.crypt.dbmclose.dbmopen.defined.delete.die.do.dump.each.else.elsif.endgrent.endhostent.endnetent.endprotoent.endpwent.endservent.eof.eval.exec.exists.exit.exp.fcntl.field.fileno.flock.for.foreach.fork.format.formline.getc.getgrent.getgrgid.getgrnam.gethostbyaddr.gethostbyname.gethostent.getlogin.getnetbyaddr.getnetbyname.getnetent.getpeername.getpgrp.getpriority.getprotobyname.getprotobynumber.getprotoent.getpwent.getpwnam.getpwuid.getservbyname.getservbyport.getservent.getsockname.getsockopt.given.glob.gmtime.goto.grep.gt.hex.if.index.int.ioctl.join.keys.kill.last.lc.lcfirst.length.link.listen.local.localtime.log.lstat.lt.ma.map.method.mkdir.msgctl.msgget.msgrcv.msgsnd.my.ne.next.no.not.oct.open.opendir.or.ord.our.pack.package.pipe.pop.pos.print.printf.prototype.push.q|0.qq.quotemeta.qw.qx.rand.read.readdir.readline.readlink.readpipe.recv.redo.ref.rename.require.reset.return.reverse.rewinddir.rindex.rmdir.say.scalar.seek.seekdir.select.semctl.semget.semop.send.setgrent.sethostent.setnetent.setpgrp.setpriority.setprotoent.setpwent.setservent.setsockopt.shift.shmctl.shmget.shmread.shmwrite.shutdown.sin.sleep.socket.socketpair.sort.splice.split.sprintf.sqrt.srand.stat.state.study.sub.substr.symlink.syscall.sysopen.sysread.sysseek.system.syswrite.tell.telldir.tie.tied.time.times.tr.truncate.uc.ucfirst.umask.undef.unless.unlink.unpack.unshift.untie.until.use.utime.values.vec.wait.waitpid.wantarray.warn.when.while.write.x|0.xor.y|0`.split(`.`),r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(` `)},a={className:`subst`,begin:`[$@]\\{`,end:`\\}`,keywords:i},o={begin:/->\{/,end:/\}/},s={scope:`attr`,match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:`variable`,variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,`(?![A-Za-z])(?![@$%])`)},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[s]},l={className:`number`,variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[e.BACKSLASH_ESCAPE,a,c],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(e,n,i=`\\1`)=>{let a=i===`\\1`?i:t.concat(i,n);return t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,a,/(?:\\.|[^\\\/])*?/,i,r)},p=(e,n,i)=>t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,i,r),m=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:`string`,contains:u,variants:[{begin:`q[qwxr]?\\s*\\(`,end:`\\)`,relevance:5},{begin:`q[qwxr]?\\s*\\[`,end:`\\]`,relevance:5},{begin:`q[qwxr]?\\s*\\{`,end:`\\}`,relevance:5},{begin:`q[qwxr]?\\s*\\|`,end:`\\|`,relevance:5},{begin:`q[qwxr]?\\s*<`,end:`>`,relevance:5},{begin:`qw\\s+q`,end:`q`,relevance:5},{begin:`'`,end:`'`,contains:[e.BACKSLASH_ESCAPE]},{begin:`"`,end:`"`},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:`-?\\w+\\s*=>`,relevance:0}]},l,{begin:`(\\/\\/|`+e.RE_STARTERS_RE+`|\\b(split|return|print|reverse|grep)\\b)\\s*`,keywords:`split return print reverse grep`,relevance:0,contains:[e.HASH_COMMENT_MODE,{className:`regexp`,variants:[{begin:f(`s|tr|y`,t.either(...d,{capture:!0}))},{begin:f(`s|tr|y`,`\\(`,`\\)`)},{begin:f(`s|tr|y`,`\\[`,`\\]`)},{begin:f(`s|tr|y`,`\\{`,`\\}`)}],relevance:2},{className:`regexp`,variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p(`(?:m|qr)?`,/\//,/\//)},{begin:p(`m|qr`,t.either(...d,{capture:!0}),/\1/)},{begin:p(`m|qr`,/\(/,/\)/)},{begin:p(`m|qr`,/\[/,/\]/)},{begin:p(`m|qr`,/\{/,/\}/)}]}]},{className:`function`,beginKeywords:`sub method`,end:`(\\s*\\(.*?\\))?[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s]},{className:`class`,beginKeywords:`class`,end:`[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s,l]},{begin:`-\\w\\b`,relevance:0},{begin:`^__DATA__$`,end:`^__END__$`,subLanguage:`mojolicious`,contains:[{begin:`^@@.*`,end:`$`,className:`comment`}]}];return a.contains=m,o.contains=m,{name:`Perl`,aliases:[`pl`,`pm`],keywords:i,contains:m}}function vx(e){let t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),o={scope:`variable`,match:`\\$+`+r},s={scope:`meta`,variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:`subst`,variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
8
- ]`,m={scope:`string`,variants:[u,l,d,f]},h={scope:`number`,variants:[{begin:`\\b0[bB][01]+(?:_[01]+)*\\b`},{begin:`\\b0[oO][0-7]+(?:_[0-7]+)*\\b`},{begin:`\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b`},{begin:`(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?`}],relevance:0},g=[`false`,`null`,`true`],_=`__CLASS__.__DIR__.__FILE__.__FUNCTION__.__COMPILER_HALT_OFFSET__.__LINE__.__METHOD__.__NAMESPACE__.__TRAIT__.die.echo.exit.include.include_once.print.require.require_once.array.abstract.and.as.binary.bool.boolean.break.callable.case.catch.class.clone.const.continue.declare.default.do.double.else.elseif.empty.enddeclare.endfor.endforeach.endif.endswitch.endwhile.enum.eval.extends.final.finally.float.for.foreach.from.global.goto.if.implements.instanceof.insteadof.int.integer.interface.isset.iterable.list.match|0.mixed.new.never.object.or.private.protected.public.readonly.real.return.string.switch.throw.trait.try.unset.use.var.void.while.xor.yield`.split(`.`),v=`Error|0.AppendIterator.ArgumentCountError.ArithmeticError.ArrayIterator.ArrayObject.AssertionError.BadFunctionCallException.BadMethodCallException.CachingIterator.CallbackFilterIterator.CompileError.Countable.DirectoryIterator.DivisionByZeroError.DomainException.EmptyIterator.ErrorException.Exception.FilesystemIterator.FilterIterator.GlobIterator.InfiniteIterator.InvalidArgumentException.IteratorIterator.LengthException.LimitIterator.LogicException.MultipleIterator.NoRewindIterator.OutOfBoundsException.OutOfRangeException.OuterIterator.OverflowException.ParentIterator.ParseError.RangeException.RecursiveArrayIterator.RecursiveCachingIterator.RecursiveCallbackFilterIterator.RecursiveDirectoryIterator.RecursiveFilterIterator.RecursiveIterator.RecursiveIteratorIterator.RecursiveRegexIterator.RecursiveTreeIterator.RegexIterator.RuntimeException.SeekableIterator.SplDoublyLinkedList.SplFileInfo.SplFileObject.SplFixedArray.SplHeap.SplMaxHeap.SplMinHeap.SplObjectStorage.SplObserver.SplPriorityQueue.SplQueue.SplStack.SplSubject.SplTempFileObject.TypeError.UnderflowException.UnexpectedValueException.UnhandledMatchError.ArrayAccess.BackedEnum.Closure.Fiber.Generator.Iterator.IteratorAggregate.Serializable.Stringable.Throwable.Traversable.UnitEnum.WeakReference.WeakMap.Directory.__PHP_Incomplete_Class.parent.php_user_filter.self.static.stdClass`.split(`.`),y={keyword:_,literal:(e=>{let t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(g),built_in:v},b=e=>e.map(e=>e.replace(/\|\d+$/,``)),x={variants:[{match:[/new/,t.concat(p,`+`),t.concat(`(?!`,b(v).join(`\\b|`),`\\b)`),i],scope:{1:`keyword`,4:`title.class`}}]},S=t.concat(r,`\\b(?!\\()`),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{2:`variable.constant`}},{match:[/::/,/class/],scope:{2:`variable.language`}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{1:`title.class`,3:`variable.constant`}},{match:[i,t.concat(`::`,t.lookahead(/(?!class\b)/))],scope:{1:`title.class`}},{match:[i,/::/,/class/],scope:{1:`title.class`,3:`variable.language`}}]},w={scope:`attr`,match:t.concat(r,t.lookahead(`:`),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[w,o,C,e.C_BLOCK_COMMENT_MODE,m,h,x]},E={relevance:0,match:[/\b/,t.concat(`(?!fn\\b|function\\b|`,b(_).join(`\\b|`),`|`,b(v).join(`\\b|`),`\\b)`),r,t.concat(p,`*`),t.lookahead(/(?=\()/)],scope:{3:`title.function.invoke`},contains:[T]};T.contains.push(E);let D=[w,C,e.C_BLOCK_COMMENT_MODE,m,h,x],O={begin:t.concat(/#\[\s*\\?/,t.either(i,a)),beginScope:`meta`,end:/]/,endScope:`meta`,keywords:{literal:g,keyword:[`new`,`array`]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:[`new`,`array`]},contains:[`self`,...D]},...D,{scope:`meta`,variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:y,contains:[O,e.HASH_COMMENT_MODE,e.COMMENT(`//`,`$`),e.COMMENT(`/\\*`,`\\*/`,{contains:[{scope:`doctag`,match:`@[A-Za-z]+`}]}),{match:/__halt_compiler\(\);/,keywords:`__halt_compiler`,starts:{scope:`comment`,end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:`meta`,endsParent:!0}]}},s,{scope:`variable.language`,match:/\$this\b/},o,E,C,{match:[/const/,/\s/,r],scope:{1:`keyword`,3:`variable.constant`}},x,{scope:`function`,relevance:0,beginKeywords:`fn function`,end:/[;{]/,excludeEnd:!0,illegal:`[$%\\[]`,contains:[{beginKeywords:`use`},e.UNDERSCORE_TITLE_MODE,{begin:`=>`,endsParent:!0},{scope:`params`,begin:`\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0,keywords:y,contains:[`self`,O,o,C,e.C_BLOCK_COMMENT_MODE,m,h]}]},{scope:`class`,variants:[{beginKeywords:`enum`,illegal:/[($"]/},{beginKeywords:`class interface trait`,illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:`extends implements`},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:`namespace`,relevance:0,end:`;`,illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:`title.class`})]},{beginKeywords:`use`,relevance:0,end:`;`,contains:[{match:/\b(as|const|function)\b/,scope:`keyword`},e.UNDERSCORE_TITLE_MODE]},m,h]}}function yx(e){return{name:`PHP template`,subLanguage:`xml`,contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:`php`,contains:[{begin:`/\\*`,end:`\\*/`,skip:!0},{begin:`b"`,end:`"`,skip:!0},{begin:`b'`,end:`'`,skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function bx(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}function xx(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function Sx(e){return{aliases:[`pycon`],contains:[{className:`meta.prompt`,starts:{end:/ |$/,starts:{end:`$`,subLanguage:`python`}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Cx(e){let t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:`R`,keywords:{$pattern:n,keyword:`function if in break next repeat else for while`,literal:`NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10`,built_in:`LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm`},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:`doctag`,match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:`doctag`,begin:`@param`,end:/$/,contains:[{scope:`variable`,variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:`doctag`,match:/@[a-zA-Z]+/},{scope:`keyword`,match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:`"`,end:`"`,relevance:0},{begin:`'`,end:`'`,relevance:0}]},{relevance:0,variants:[{scope:{1:`operator`,2:`number`},match:[i,r]},{scope:{1:`operator`,2:`number`},match:[/%[^%]*%/,r]},{scope:{1:`punctuation`,2:`number`},match:[a,r]},{scope:{2:`number`},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:`operator`},match:[n,/\s+/,/<-/,/\s+/]},{scope:`operator`,relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:`punctuation`,relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function wx(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),a={"variable.constant":[`__FILE__`,`__LINE__`,`__ENCODING__`],"variable.language":[`self`,`super`],keyword:[`alias`,`and`,`begin`,`BEGIN`,`break`,`case`,`class`,`defined`,`do`,`else`,`elsif`,`end`,`END`,`ensure`,`for`,`if`,`in`,`module`,`next`,`not`,`or`,`redo`,`require`,`rescue`,`retry`,`return`,`then`,`undef`,`unless`,`until`,`when`,`while`,`yield`,...[`include`,`extend`,`prepend`,`public`,`private`,`protected`,`raise`,`throw`]],built_in:[`proc`,`lambda`,`attr_accessor`,`attr_reader`,`attr_writer`,`define_method`,`private_constant`,`module_function`],literal:[`true`,`false`,`nil`]},o={className:`doctag`,begin:`@[A-Za-z]+`},s={begin:`#<`,end:`>`},c=[e.COMMENT(`#`,`$`,{contains:[o]}),e.COMMENT(`^=begin`,`^=end`,{contains:[o],relevance:10}),e.COMMENT(`^__END__`,e.MATCH_NOTHING_RE)],l={className:`subst`,begin:/#\{/,end:/\}/,keywords:a},u={className:`string`,contains:[e.BACKSLASH_ESCAPE,l],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,l]})]}]},d=`[0-9](_?[0-9])*`,f={className:`number`,relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{begin:`\\b0[dD][0-9](_?[0-9])*r?i?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*r?i?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*r?i?\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b`},{begin:`\\b0(_?[0-7])+r?i?\\b`}]},p={variants:[{match:/\(\)/},{className:`params`,begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},m=[u,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:`title.class`,4:`title.class.inherited`},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:`title.class`},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:`title.class`}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`},{relevance:0,match:r,scope:`title.class`},{match:[/def/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[p]},{begin:e.IDENT_RE+`::`},{className:`symbol`,begin:e.UNDERSCORE_IDENT_RE+`(!|\\?)?:`,relevance:0},{className:`symbol`,begin:`:(?!\\s)`,contains:[u,{begin:n}],relevance:0},f,{className:`variable`,begin:`(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])`},{className:`params`,begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:`(`+e.RE_STARTERS_RE+`|unless)\\s*`,keywords:`unless`,contains:[{className:`regexp`,contains:[e.BACKSLASH_ESCAPE,l],illegal:/\n/,variants:[{begin:`/`,end:`/[a-z]*`},{begin:/%r\{/,end:/\}[a-z]*/},{begin:`%r\\(`,end:`\\)[a-z]*`},{begin:`%r!`,end:`![a-z]*`},{begin:`%r\\[`,end:`\\][a-z]*`}]}].concat(s,c),relevance:0}].concat(s,c);l.contains=m,p.contains=m;let h=[{begin:/^\s*=>/,starts:{end:`$`,contains:m}},{className:`meta.prompt`,begin:`^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])`,starts:{end:`$`,keywords:a,contains:m}}];return c.unshift(s),{name:`Ruby`,aliases:[`rb`,`gemspec`,`podspec`,`thor`,`irb`],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:`ruby`})].concat(h,c,m)}}function Tx(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o=`([ui](8|16|32|64|128|size)|f(32|64))?`,s=`abstract.as.async.await.become.box.break.const.continue.crate.do.dyn.else.enum.extern.false.final.fn.for.if.impl.in.let.loop.macro.match.mod.move.mut.override.priv.pub.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield`.split(`.`),c=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],l=`drop .Copy.Send.Sized.Sync.Drop.Fn.FnMut.FnOnce.ToOwned.Clone.Debug.PartialEq.PartialOrd.Eq.Ord.AsRef.AsMut.Into.From.Default.Iterator.Extend.IntoIterator.DoubleEndedIterator.ExactSizeIterator.SliceConcatExt.ToString.assert!.assert_eq!.bitflags!.bytes!.cfg!.col!.concat!.concat_idents!.debug_assert!.debug_assert_eq!.env!.eprintln!.panic!.file!.format!.format_args!.include_bytes!.include_str!.line!.local_data_key!.module_path!.option_env!.print!.println!.select!.stringify!.try!.unimplemented!.unreachable!.vec!.write!.writeln!.macro_rules!.assert_ne!.debug_assert_ne!`.split(`.`),u=[`i8`,`i16`,`i32`,`i64`,`i128`,`isize`,`u8`,`u16`,`u32`,`u64`,`u128`,`usize`,`f32`,`f64`,`str`,`char`,`bool`,`Box`,`Option`,`Result`,`String`,`Vec`];return{name:`Rust`,aliases:[`rs`],keywords:{$pattern:e.IDENT_RE+`!?`,type:u,keyword:s,literal:c,built_in:l},illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:`symbol`,begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:`string`,variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:`char.escape`,match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:`number`,variants:[{begin:`\\b0b([01_]+)`+o},{begin:`\\b0o([0-7_]+)`+o},{begin:`\\b0x([A-Fa-f0-9_]+)`+o},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)`+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:`keyword`,3:`title.function`}},{className:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:l,type:u}},{className:`punctuation`,begin:`->`},a]}}var Ex=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Dx=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),Ox=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),kx=[...Dx,...Ox],Ax=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),jx=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),Mx=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),Nx=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function Px(e){let t=Ex(e),n=Mx,r=jx,i=`@[a-z-]+`,a={className:`variable`,begin:`(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b`,relevance:0};return{name:`SCSS`,case_insensitive:!0,illegal:`[=/|']`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:`selector-id`,begin:`#[A-Za-z0-9_-]+`,relevance:0},{className:`selector-class`,begin:`\\.[A-Za-z0-9_-]+`,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-tag`,begin:`\\b(`+kx.join(`|`)+`)\\b`,relevance:0},{className:`selector-pseudo`,begin:`:(`+r.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+n.join(`|`)+`)`},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+Nx.join(`|`)+`)\\b`},{begin:`\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b`},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:`@(page|font-face)`,keywords:{$pattern:i,keyword:`@page @font-face`}},{begin:`@`,end:`[{;]`,returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:Ax.join(` `)},contains:[{begin:i,className:`keyword`},{begin:/[a-z-]+(?=:)/,className:`attribute`},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function Fx(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function Ix(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}function Lx(e){return e?typeof e==`string`?e:e.source:null}function Rx(e){return zx(`(?=`,e,`)`)}function zx(...e){return e.map(e=>Lx(e)).join(``)}function Bx(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Vx(...e){return`(`+(Bx(e).capture?``:`?:`)+e.map(e=>Lx(e)).join(`|`)+`)`}var Hx=e=>zx(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Ux=[`Protocol`,`Type`].map(Hx),Wx=[`init`,`self`].map(Hx),Gx=[`Any`,`Self`],Kx=[`actor`,`any`,`associatedtype`,`async`,`await`,/as\?/,/as!/,`as`,`borrowing`,`break`,`case`,`catch`,`class`,`consume`,`consuming`,`continue`,`convenience`,`copy`,`default`,`defer`,`deinit`,`didSet`,`distributed`,`do`,`dynamic`,`each`,`else`,`enum`,`extension`,`fallthrough`,/fileprivate\(set\)/,`fileprivate`,`final`,`for`,`func`,`get`,`guard`,`if`,`import`,`indirect`,`infix`,/init\?/,/init!/,`inout`,/internal\(set\)/,`internal`,`in`,`is`,`isolated`,`nonisolated`,`lazy`,`let`,`macro`,`mutating`,`nonmutating`,/open\(set\)/,`open`,`operator`,`optional`,`override`,`package`,`postfix`,`precedencegroup`,`prefix`,/private\(set\)/,`private`,`protocol`,/public\(set\)/,`public`,`repeat`,`required`,`rethrows`,`return`,`set`,`some`,`static`,`struct`,`subscript`,`super`,`switch`,`throws`,`throw`,/try\?/,/try!/,`try`,`typealias`,/unowned\(safe\)/,/unowned\(unsafe\)/,`unowned`,`var`,`weak`,`where`,`while`,`willSet`],qx=[`false`,`nil`,`true`],Jx=[`assignment`,`associativity`,`higherThan`,`left`,`lowerThan`,`none`,`right`],Yx=[`#colorLiteral`,`#column`,`#dsohandle`,`#else`,`#elseif`,`#endif`,`#error`,`#file`,`#fileID`,`#fileLiteral`,`#filePath`,`#function`,`#if`,`#imageLiteral`,`#keyPath`,`#line`,`#selector`,`#sourceLocation`,`#warning`],Xx=`abs.all.any.assert.assertionFailure.debugPrint.dump.fatalError.getVaList.isKnownUniquelyReferenced.max.min.numericCast.pointwiseMax.pointwiseMin.precondition.preconditionFailure.print.readLine.repeatElement.sequence.stride.swap.swift_unboxFromSwiftValueWithType.transcode.type.unsafeBitCast.unsafeDowncast.withExtendedLifetime.withUnsafeMutablePointer.withUnsafePointer.withVaList.withoutActuallyEscaping.zip`.split(`.`),Zx=Vx(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Qx=Vx(Zx,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),$x=zx(Zx,Qx,`*`),eS=Vx(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),tS=Vx(eS,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),nS=zx(eS,tS,`*`),rS=zx(/[A-Z]/,tS,`*`),iS=[`attached`,`autoclosure`,zx(/convention\(/,Vx(`swift`,`block`,`c`),/\)/),`discardableResult`,`dynamicCallable`,`dynamicMemberLookup`,`escaping`,`freestanding`,`frozen`,`GKInspectable`,`IBAction`,`IBDesignable`,`IBInspectable`,`IBOutlet`,`IBSegueAction`,`inlinable`,`main`,`nonobjc`,`NSApplicationMain`,`NSCopying`,`NSManaged`,zx(/objc\(/,nS,/\)/),`objc`,`objcMembers`,`propertyWrapper`,`requires_stored_property_inits`,`resultBuilder`,`Sendable`,`testable`,`UIApplicationMain`,`unchecked`,`unknown`,`usableFromInline`,`warn_unqualified_access`],aS=[`iOS`,`iOSApplicationExtension`,`macOS`,`macOSApplicationExtension`,`macCatalyst`,`macCatalystApplicationExtension`,`watchOS`,`watchOSApplicationExtension`,`tvOS`,`tvOSApplicationExtension`,`swift`];function oS(e){let t={match:/\s+/,relevance:0},n=e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,Vx(...Ux,...Wx)],className:{2:`keyword`}},a={match:zx(/\./,Vx(...Kx)),relevance:0},o=Kx.filter(e=>typeof e==`string`).concat([`_|0`]),s={variants:[{className:`keyword`,match:Vx(...Kx.filter(e=>typeof e!=`string`).concat(Gx).map(Hx),...Wx)}]},c={$pattern:Vx(/\b\w+/,/#\w+/),keyword:o.concat(Yx),literal:qx},l=[i,a,s],u=[{match:zx(/\./,Vx(...Xx)),relevance:0},{className:`built_in`,match:zx(/\b/,Vx(...Xx),/(?=\()/)}],d={match:/->/,relevance:0},f=[d,{className:`operator`,relevance:0,variants:[{match:$x},{match:`\\.(\\.|${Qx})+`}]}],p=`([0-9]_*)+`,m=`([0-9a-fA-F]_*)+`,h={className:`number`,relevance:0,variants:[{match:`\\b(${p})(\\.(${p}))?([eE][+-]?(${p}))?\\b`},{match:`\\b0x(${m})(\\.(${m}))?([pP][+-]?(${p}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(e=``)=>({className:`subst`,variants:[{match:zx(/\\/,e,/[0\\tnr"']/)},{match:zx(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(e=``)=>({className:`subst`,match:zx(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(e=``)=>({className:`subst`,label:`interpol`,begin:zx(/\\/,e,/\(/),end:/\)/}),y=(e=``)=>({begin:zx(e,/"""/),end:zx(/"""/,e),contains:[g(e),_(e),v(e)]}),b=(e=``)=>({begin:zx(e,/"/),end:zx(/"/,e),contains:[g(e),v(e)]}),x={className:`string`,variants:[y(),y(`#`),y(`##`),y(`###`),b(),b(`#`),b(`##`),b(`###`)]},S=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],C={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:S},w=e=>{let t=zx(e,/\//),n=zx(/\//,e);return{begin:t,end:n,contains:[...S,{scope:`comment`,begin:`#(?!.*${n})`,end:/$/}]}},T={scope:`regexp`,variants:[w(`###`),w(`##`),w(`#`),C]},E={match:zx(/`/,nS,/`/)},D=[E,{className:`variable`,match:/\$\d+/},{className:`variable`,match:`\\$${tS}+`}],O=[{match:/(@|#(un)?)available/,scope:`keyword`,starts:{contains:[{begin:/\(/,end:/\)/,keywords:aS,contains:[...f,h,x]}]}},{scope:`keyword`,match:zx(/@/,Vx(...iS),Rx(Vx(/\(/,/\s+/)))},{scope:`meta`,match:zx(/@/,nS)}],k={match:Rx(/\b[A-Z]/),relevance:0,contains:[{className:`type`,match:zx(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,tS,`+`)},{className:`type`,match:rS,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:zx(/\s+&\s+/,Rx(rS)),relevance:0}]},A={begin:/</,end:/>/,keywords:c,contains:[...r,...l,...O,d,k]};k.contains.push(A);let j={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:[`self`,{match:zx(nS,/\s*:/),keywords:`_|0`,relevance:0},...r,T,...l,...u,...f,h,x,...D,...O,k]},M={begin:/</,end:/>/,keywords:`repeat each`,contains:[...r,k]},N={begin:/\(/,end:/\)/,keywords:c,contains:[{begin:Vx(Rx(zx(nS,/\s*:/)),Rx(zx(nS,/\s+/,nS,/\s*:/))),end:/:/,relevance:0,contains:[{className:`keyword`,match:/\b_\b/},{className:`params`,match:nS}]},...r,...l,...f,h,x,...O,k,j],endsParent:!0,illegal:/["']/},P={match:[/(func|macro)/,/\s+/,Vx(E.match,nS,$x)],className:{1:`keyword`,3:`title.function`},contains:[M,N,t],illegal:[/\[/,/%/]},F={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:`keyword`},contains:[M,N,t],illegal:/\[|%/},I={match:[/operator/,/\s+/,$x],className:{1:`keyword`,3:`title`}},L={begin:[/precedencegroup/,/\s+/,rS],className:{1:`keyword`,3:`title`},contains:[k],keywords:[...Jx,...qx],end:/}/},R={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:`keyword`,3:`keyword`,5:`title.function`}},z={match:[/class\b/,/\s+/,/var\b/],scope:{1:`keyword`,3:`keyword`}},B={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,nS,/\s*/],beginScope:{1:`keyword`,3:`title.class`},keywords:c,contains:[M,...l,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:`title.class.inherited`,match:rS},...l],relevance:0}]};for(let e of x.variants){let t=e.contains.find(e=>e.label===`interpol`);t.keywords=c;let n=[...l,...u,...f,h,x,...D];t.contains=[...n,{begin:/\(/,end:/\)/,contains:[`self`,...n]}]}return{name:`Swift`,keywords:c,contains:[...r,P,F,R,z,B,I,L,{beginKeywords:`import`,end:/$/,contains:[...r],relevance:0},T,...l,...u,...f,h,x,...D,...O,k,j]}}var sS=`[A-Za-z$_][0-9A-Za-z$_]*`,cS=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),lS=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],uS=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),dS=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],fS=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],pS=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],mS=[].concat(fS,uS,dS);function hS(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=sS,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:sS,keyword:cS,literal:lS,built_in:mS,"variable.language":pS},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...uS,...dS]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...fS,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function gS(e){let t=e.regex,n=hS(e),r=sS,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:sS,keyword:cS.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:lS,built_in:mS.concat(i),"variable.language":pS},l={className:`meta`,begin:`@`+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function _S(e){let t=e.regex,n={className:`string`,begin:/"(""|[^/n])"C\b/},r={className:`string`,begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,c={className:`literal`,variants:[{begin:t.concat(/# */,t.either(a,i),/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,i),/ +/,t.either(o,s),/ *#/)}]},l={className:`number`,relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:`label`,begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:`doctag`,begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:`Visual Basic .NET`,aliases:[`vb`],case_insensitive:!0,classNameAliases:{label:`symbol`},keywords:{keyword:`addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield`,built_in:`addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort`,type:`boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort`,literal:`true false nothing`},illegal:`//|\\{|\\}|endif|gosub|variant|wend|^\\$ `,contains:[n,r,c,l,u,d,f,{className:`meta`,begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:`const disable else elseif enable end externalsource if region then`},contains:[f]}]}}function vS(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);return t.contains.push(`self`),{name:`WebAssembly`,keywords:{$pattern:/[\w.]+/,keyword:`anyfunc,block,br,br_if,br_table,call,call_indirect,data,drop,elem,else,end,export,func,global.get,global.set,local.get,local.set,local.tee,get_global,get_local,global,if,import,local,loop,memory,memory.grow,memory.size,module,mut,nop,offset,param,result,return,select,set_global,set_local,start,table,tee_local,then,type,unreachable`.split(`,`)},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:`keyword`,3:`operator`}},{className:`variable`,begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:`punctuation`,relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:`keyword`,3:`title.function`}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:`type`},{className:`keyword`,match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:`number`,relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}}function yS(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function bS(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}var xS={arduino:vb,bash:yb,c:bb,cpp:xb,csharp:Sb,css:jb,diff:Mb,go:Nb,graphql:Pb,ini:Fb,java:Vb,javascript:Xb,json:Zb,kotlin:nx,less:fx,lua:px,makefile:mx,markdown:hx,objectivec:gx,perl:_x,php:vx,"php-template":yx,plaintext:bx,python:xx,"python-repl":Sx,r:Cx,ruby:wx,rust:Tx,scss:Px,shell:Fx,sql:Ix,swift:oS,typescript:gS,vbnet:_S,wasm:vS,xml:yS,yaml:bS},SS=e(t(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,j=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},M={begin:`\\\\[\\s\\S]`,relevance:0},N={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[M]},P={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[M]},F={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},L=I(`//`,`$`),R=I(`/\\*`,`\\*/`),z=I(`#`,`$`),B={scope:`number`,begin:D,relevance:0},V={scope:`number`,begin:O,relevance:0},H={scope:`number`,begin:k,relevance:0},U={scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},ee={scope:`title`,begin:T,relevance:0},te={scope:`title`,begin:E,relevance:0},W={begin:`\\.\\s*`+E,relevance:0},ne=Object.freeze({__proto__:null,APOS_STRING_MODE:N,BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:H,BINARY_NUMBER_RE:k,COMMENT:I,C_BLOCK_COMMENT_MODE:R,C_LINE_COMMENT_MODE:L,C_NUMBER_MODE:V,C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:z,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:W,NUMBER_MODE:B,NUMBER_RE:D,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:P,REGEXP_MODE:U,RE_STARTERS_RE:A,SHEBANG:j,TITLE_MODE:ee,UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:te});function re(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function ie(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ae(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=re,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function oe(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function se(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function ce(e,t){e.relevance===void 0&&(e.relevance=1)}var le=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},G=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],K=`keyword`;function q(e,t,n=K){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,q(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,ue(n[0],n[1])]})}}function ue(e,t){return t?Number(t):+!de(e)}function de(e){return G.includes(e.toLowerCase())}var fe={},pe=e=>{console.error(e)},me=(e,...t)=>{console.log(`WARN: ${e}`,...t)},he=(e,t)=>{fe[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),fe[`${e}/${t}`]=!0)},ge=Error();function _e(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function J(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw pe(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),ge;if(typeof e.beginScope!=`object`||e.beginScope===null)throw pe(`beginScope must be object`),ge;_e(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function ve(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw pe(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),ge;if(typeof e.endScope!=`object`||e.endScope===null)throw pe(`endScope must be object`),ge;_e(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function ye(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function be(e){ye(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),J(e),ve(e)}function xe(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null),this.matcherRe=t(C(this.regexes.map(e=>e[1]),{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[ie,se,be,le].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[ae,oe,ce].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=q(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Ce(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Se(e){return e?e.endsWithParent||Se(e.starts):!1}function Ce(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Se(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var we=`11.11.1`,Te=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Ee=i,De=a,Oe=Symbol(`nomatch`),ke=7,Ae=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=N(n[1]);return t||(me(s.replace(`{}`,n[1])),me(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||N(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(he(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),he(`10.7.0`,`Please use highlight(code, options) instead.
9
- https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};z(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,z(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){M.addText(P);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(P),n=``;for(;t;){n+=P.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(M.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=ke&&(F+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(P)}n+=P.substring(e),M.addText(n)}function f(){if(P===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){M.addText(P);return}e=v(A.subLanguage,P,!0,j[A.subLanguage]),j[A.subLanguage]=e._top}else e=S(P,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(F+=e.relevance),M.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),P=``}function m(e,t){e!==``&&(M.startScope(t),M.addText(e),M.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(P=i,d(),P=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&M.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(P,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),P=``):e.beginScope._multi&&(h(e.beginScope,t),P=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(P+=e[0],1):(R=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?P+=t:(n.excludeBegin&&(P+=t),p(),!n.returnBegin&&!n.excludeBegin&&(P=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return Oe;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?P+=t:(a.returnEnd||a.excludeEnd||(P+=t),p(),a.excludeEnd&&(P=t));do A.scope&&M.closeNode(),!A.skip&&!A.subLanguage&&(F+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>M.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(P+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(P+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||`<unnamed>`)+`"`);throw e.mode=A,e}else if(r.type===`end`){let e=C(r);if(e!==Oe)return e}if(r.type===`illegal`&&a===``)return P+=`
10
- `,1;if(L>1e5&&L>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return P+=a,a.length}let D=N(e);if(!D)throw pe(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=xe(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,L=0,R=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){L++,R?R=!1:A.matcher.considerAll(),A.matcher.lastIndex=I;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(I,e.index),e);I=e.index+t}E(n.substring(I))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:F,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Ee(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:Ee(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:Ee(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(N).filter(F).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;if(N(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(z(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Te(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),z(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=De(l,e)}let E=()=>{k(),he(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),he(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(pe(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)pe(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&P(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function N(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function P(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function F(e){let t=N(e);return t&&!t.disableAutodetect}function I(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function L(e){I(e),a.push(e)}function R(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function z(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function B(e){return he(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),he(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:B,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:De,addPlugin:L,removePlugin:R}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=we,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in ne)typeof ne[e]==`object`&&n(ne[e]);return Object.assign(e,ne),e},je=Ae({});je.newInstance=()=>Ae({}),t.exports=je,je.HighlightJS=je,je.default=je}))()).default,CS={},wS=`hljs-`;function TS(e){let t=SS.newInstance();return e&&a(e),{highlight:n,highlightAuto:r,listLanguages:i,register:a,registerAlias:o,registered:s};function n(e,n,r){let i=r||CS,a=typeof i.prefix==`string`?i.prefix:wS;if(!t.getLanguage(e))throw Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:ES,classPrefix:a});let o=t.highlight(n,{ignoreIllegals:!0,language:e});if(o.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:o.errorRaised});let s=o._emitter.root,c=s.data;return c.language=o.language,c.relevance=o.relevance,s}function r(e,r){let a=(r||CS).subset||i(),o=-1,s=0,c;for(;++o<a.length;){let i=a[o];if(!t.getLanguage(i))continue;let l=n(i,e,r);l.data&&l.data.relevance!==void 0&&l.data.relevance>s&&(s=l.data.relevance,c=l)}return c||{type:`root`,children:[],data:{language:void 0,relevance:s}}}function i(){return t.listLanguages()}function a(e,n){if(typeof e==`string`)t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}function o(e,n){if(typeof e==`string`)t.registerAliases(typeof n==`string`?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){let r=e[n];t.registerAliases(typeof r==`string`?r:[...r],{languageName:n})}}}function s(e){return!!t.getLanguage(e)}}var ES=class{constructor(e){this.options=e,this.root={type:`root`,children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e===``)return;let t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&n.type===`text`?n.value+=e:t.children.push({type:`text`,value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){let n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:`element`,tagName:`span`,properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){let t=this,n=e.split(`.`).map(function(e,n){return n?e+`_`.repeat(n):t.options.classPrefix+e}),r=this.stack[this.stack.length-1],i={type:`element`,tagName:`span`,properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return``}};async function DS(e,t){let n=await fetch(e,{...t,headers:{"content-type":`application/json`,...t?.headers}}),r=await n.json().catch(()=>null);if(!n.ok){let e=Mn.safeParse(r);throw Error(e.success?e.data.title??e.data.detail:`comments request failed (${n.status})`)}return r}function OS(e){return DS(`/api/comment`,{method:`POST`,body:JSON.stringify(e)})}function kS(e,t){let n=e.safeParse(t);if(!n.success)throw Error(`The server returned a response this build cannot read.`);return n.data}function AS(e){let t=Sr.safeParse(e);if(!t.success)throw Error(`The server returned a comment thread this build cannot read.`);return t.data}function jS(e){let t=[];for(let n of e){let e=Sr.safeParse(n);e.success?t.push(e.data):console.warn(`[comments] skipped a thread this build cannot read`,e.error.issues)}return t}async function MS(e){let{threads:t}=await DS(e===void 0?`/api/comments`:`/api/comments?doc=${encodeURIComponent(e)}`);return jS(t)}function NS(e){return DS(`/api/comments`,{method:`POST`,body:JSON.stringify(e)}).then(AS)}function PS(e,t){return OS({action:`edit`,id:e,body:t}).then(AS)}function FS(e){return OS({action:`resolve`,id:e}).then(AS)}function IS(e){return OS({action:`reopen`,id:e}).then(AS)}function LS(e,t){return OS({action:`replace`,id:e,...t}).then(AS)}function RS(e){return OS({action:`queue`,id:e}).then(e=>kS(kn,e))}function zS(e){return OS({action:`unqueue`,id:e}).then(AS)}function BS(e){return DS(`/api/comment?id=${encodeURIComponent(e)}`,{method:`DELETE`}).then(e=>kS(Mt,e))}function VS(e){return OS({action:`dispatch-prepare-batch`,ids:e}).then(e=>kS(nr,e))}function HS(e){return OS({action:`dispatch-complete-batch`,ids:e}).then(e=>kS(Vt,e))}var US=`open-knowledge:comments-queue-scope`,WS=typeof window>`u`?new EventTarget:window,GS=!1;function KS(){let e=GS;return GS=!1,e}function qS(e){let t=()=>{GS=!1,e()};return WS.addEventListener(US,t),()=>WS.removeEventListener(US,t)}function JS(){GS=!0,Vs(`comments`),WS.dispatchEvent(new Event(US))}var YS=Object.freeze([]),XS=Object.freeze([]),ZS=new Map,QS=[],$S=new Set,eC=new Set,tC=!1,nC=new Set,rC=0,iC=0;function aC(){for(let e of $S)e()}function oC(){rC+=1,aC()}function sC(){iC+=1,aC()}function cC(e){return{id:e.threadId,docName:e.docName,target:e.target,anchor:e.anchor===null?null:{quote:e.anchor.exact,prefix:e.anchor.prefix,suffix:e.anchor.suffix,start:e.anchor.start,end:e.anchor.end},status:e.state===`anchored`?`open`:e.state,body:e.latestComment,createdAt:e.createdAt,queued:e.queued}}async function lC(){return(await MS()).map(cC).sort((e,t)=>t.createdAt-e.createdAt)}async function uC(e){e!==void 0&&eC.add(e);let t=await lC();QS=t,tC=!0;for(let e of eC)ZS.set(e,t.filter(t=>t.docName===e));oC()}var dC=!1;function fC(){dC||typeof window>`u`||(dC=!0,ca(e=>{e.includes(`comments`)&&uC().catch(()=>void 0)}))}function pC(e){fC(),!eC.has(e)&&(eC.add(e),uC(e).catch(()=>{eC.delete(e)}))}function mC(){fC(),!tC&&(tC=!0,uC().catch(()=>{tC=!1}))}function hC(e){return pC(e),ZS.get(e)??YS}function gC(e){return $S.add(e),()=>{$S.delete(e)}}function _C(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=()=>hC(e),t[0]=e,t[1]=n),(0,Q.useSyncExternalStore)(gC,n,vC)}function vC(){return YS}function yC(e){for(let t of ZS.values()){let n=t.find(t=>t.id===e);if(n)return n}return QS.find(t=>t.id===e)??null}function bC(e){NS({docName:e.docName,quote:e.quote,prefix:e.prefix,suffix:e.suffix,body:e.body,queue:!0}).then(t=>{if(uC(e.docName).catch(()=>void 0),e.onCreated!==void 0){e.onCreated(t.threadId);return}JS(),pw()}).catch(e=>{ci.error(e instanceof Error&&e.message?Y._({id:`q3W2nd`,values:{0:e.message}}):Y._({id:`SRBk2G`}))})}function xC(e){NS({docName:e.docName,propertyKey:e.propertyKey,propertyPath:e.propertyPath,quote:e.quote,body:e.body,queue:!0}).then(()=>{uC(e.docName).catch(()=>void 0),JS(),pw()}).catch(e=>{ci.error(e instanceof Error&&e.message?Y._({id:`q3W2nd`,values:{0:e.message}}):Y._({id:`SRBk2G`}))})}function SC(e,t,n){e.then(()=>uC(t)).catch(e=>{ci.error(e instanceof Error&&e.message?`${n} ${e.message}`:n),uC(t).catch(()=>void 0)})}function CC(e,t){let n=yC(e)?.docName;SC(PS(e,t),n,Y._({id:`kzpkcn`}))}function wC(e){let t=yC(e)?.docName;SC(FS(e),t,Y._({id:`eoEUI3`}))}function TC(e){let t=yC(e)?.docName;SC(IS(e),t,Y._({id:`lISYEX`}))}function EC(e){let t=yC(e)?.docName;SC(BS(e),t,Y._({id:`IxHMdF`}))}function DC(e,t,n){let r=yC(e)?.docName;SC(LS(e,{quote:t,prefix:n?.prefix,suffix:n?.suffix}),r,Y._({id:`mlvM8g`}))}var OC=XS,kC=-1,AC=XS,jC=-1,MC=-1;function NC(){if(mC(),kC!==rC){let e=QS.filter(e=>e.queued&&e.status!==`resolved`).sort((e,t)=>e.createdAt-t.createdAt).map(e=>e.id);OC=e.length===0?XS:e,kC=rC}return OC}function PC(){return(0,Q.useSyncExternalStore)(gC,NC,FC)}function FC(){return XS}function IC(){let e=NC();if(jC!==rC||MC!==iC){let t=e.filter(e=>!nC.has(e));AC=t.length===0?XS:t,jC=rC,MC=iC}return AC}function LC(){return(0,Q.useSyncExternalStore)(gC,IC,RC)}function RC(){return XS}function zC(e){return NC().includes(e)}function BC(e){let t=yC(e)?.docName;if(nC.has(e)){let t=new Set(nC);t.delete(e),nC=t,sC()}SC(RS(e),t,Y._({id:`S-7ej_`}))}function VC(e){let t=yC(e)?.docName;SC(zS(e),t,Y._({id:`PTUuoc`}))}function HC(e){zC(e)?VC(e):BC(e)}function UC(){nC.size!==0&&(nC=new Set,sC())}function WC(e){let t=new Set(nC);t.has(e)?t.delete(e):t.add(e),nC=t,sC()}function GC(){let e=NC();e.length!==0&&Promise.all(e.map(e=>zS(e).then(()=>!0).catch(()=>!1))).then(t=>{let n=t.filter(e=>!e).length;n>0&&ci.error(Y._({id:`1oawp3`,values:{0:e.length,failed:n}})),uC().catch(()=>void 0)})}var KC=!1;async function qC({compose:e,threadIds:t,resolve:n=!0}){let r=t??IC();if(r.length===0||KC)return[];KC=!0;try{return await JC(r,e,n)}finally{KC=!1}}async function JC(e,t,n){let r;try{r=await VS(e)}catch(e){return ci.error(e instanceof Error&&e.message?Y._({id:`cVKnqL`,values:{0:e.message}}):Y._({id:`7FA2iI`})),[]}oC();let i=r.results.flatMap(e=>e.ok?[{threadId:e.threadId,payload:e.payload}]:[]);if(i.length===0)return await uC().catch(()=>void 0),[];let a=!1;try{a=await t(i)}catch{a=!1}let o=a?i.map(e=>e.threadId):[];return o.length>0&&n&&await HS(o).catch(()=>{ci.error(Y._({id:`JyM0gO`}))}),await uC().catch(()=>void 0),o}var YC=`ok:comment-focus-thread`,XC=`ok:comment-open-popover`,ZC=`ok:comment-start`,QC=`ok:comment-posted`,$C=typeof window>`u`?new EventTarget:window;function ew(e){$C.dispatchEvent(new CustomEvent(YC,{detail:e}))}function tw(e){let t=t=>e(t.detail);return $C.addEventListener(YC,t),()=>$C.removeEventListener(YC,t)}var nw=null,rw=null,iw=null,aw=new Set;function ow(){let e=rw??nw;if(e!==iw){iw=e;for(let e of aw)e()}}function sw(){return iw}function cw(e){rw=e,ow()}function lw(e){rw===e&&(rw=null,ow())}function uw(e){return aw.add(e),()=>{aw.delete(e)}}function dw(e){nw=e,ow(),$C.dispatchEvent(new CustomEvent(XC,{detail:e}))}function fw(e){let t=t=>e(t.detail);return $C.addEventListener(XC,t),()=>$C.removeEventListener(XC,t)}function pw(){$C.dispatchEvent(new CustomEvent(QC))}function mw(e){let t=()=>e();return $C.addEventListener(QC,t),()=>$C.removeEventListener(QC,t)}function hw(){$C.dispatchEvent(new CustomEvent(ZC))}function gw(e){let t=()=>e();return $C.addEventListener(ZC,t),()=>$C.removeEventListener(ZC,t)}function _w(){let[e]=(0,Q.useState)(vw);return e}function vw(){return Ct()!=null}var yw=0,bw=new Set,xw=null;function Sw(){yw+=1;for(let e of bw)e()}function Cw(e){return bw.add(e),!xw&&typeof document<`u`&&(xw=new MutationObserver(Sw),xw.observe(document.documentElement,{attributes:!0,attributeFilter:[Do,`class`]}),xw.observe(document.head,{childList:!0,subtree:!0,characterData:!0})),()=>{bw.delete(e),bw.size===0&&(xw?.disconnect(),xw=null)}}function ww(){return yw}function Tw(){return 0}function Ew(){return(0,Q.useSyncExternalStore)(Cw,ww,Tw)}var Dw=`application/x-openknowledge-markdown`,Ow=`data-clipboard-omit`,kw=new WeakMap;function Aw(e){if(!Array.isArray(e))return!1;let t=e[1];return typeof t==`object`&&!!t&&!Array.isArray(t)&&t[Ow]===`true`}function jw(e){let t=kw.get(e);if(t)return t;let n={marks:new Set,nodes:new Set};for(let t of Object.values(e.marks))try{let e=t.create();Aw(t.spec.toDOM?.(e,!0))&&n.marks.add(t)}catch{}for(let t of Object.values(e.nodes))try{let e=t.createAndFill();e&&Aw(t.spec.toDOM?.(e))&&n.nodes.add(t)}catch{}return kw.set(e,n),n}function Mw(e,t){return t.nodes.has(e.type)?!0:e.marks.some(e=>t.marks.has(e.type))}function Nw(e,t){let n=[],r=!1;return e.forEach(e=>{if(Mw(e,t)){r=!0;return}let i=Nw(e.content,t);i===e.content?n.push(e):(r=!0,n.push(e.copy(i)))}),r?An.fromArray(n):e}function Pw(e,t){let n=!1;return e.forEach(e=>{n||(Mw(e,t)||Pw(e.content,t))&&(n=!0)}),n}function Fw(e,t){let n=jw(t);return n.marks.size===0&&n.nodes.size===0?!1:Pw(e.content,n)}function Iw(e,t){let n=0,r=t===`first`?e.firstChild:e.lastChild;for(;r&&!r.isLeaf;)n+=1,r=t===`first`?r.firstChild:r.lastChild;return n}function Lw(e,t){let n=jw(t);if(n.marks.size===0&&n.nodes.size===0)return e;let r=Nw(e.content,n);return r===e.content?e:new ln(r,Math.min(e.openStart,Iw(r,`first`)),Math.min(e.openEnd,Iw(r,`last`)))}function Rw(e,t){let n=jw(t);if(n.marks.size===0&&n.nodes.size===0)return e;let r=Nw(e.content,n);return r===e.content?e:e.copy(r)}function zw(e,t){let n=jw(t);return n.marks.size===0&&n.nodes.size===0?e:Nw(e,n)}var Bw=250,Vw=100;function Hw(e,t){let n=performance.now()-e;n<(t.op===`paste`||t.op===`drop`?Bw:Vw)||console.warn(JSON.stringify({event:`clipboard-slow-op`,op:t.op,view:t.view,elapsedMs:Math.round(n),branch:t.branch,source:t.source,...t.htmlBytes==null?{}:{htmlBytes:t.htmlBytes}}))}function Uw(e){console.warn(JSON.stringify({event:`clipboard-source-detected`,view:e.view,source:e.source,branch:e.branch}))}function Ww(e){console.warn(JSON.stringify({event:`clipboard-html-conversion-failed`,view:e.view,stage:e.stage,source:e.source,...e.branch==null?{}:{branch:e.branch},reason:e.reason,...e.errorClass==null?{}:{errorClass:e.errorClass},...e.htmlBytes==null?{}:{htmlBytes:e.htmlBytes}}))}function Gw(e){console.warn(JSON.stringify({event:`clipboard-serialize-failed`,view:e.view,kind:e.kind,reason:e.reason}))}function Kw(e){console.warn(JSON.stringify({event:`clipboard-walker-fallback-fired`,descriptor:e.descriptor,view:e.view}))}function qw(e){console.warn(JSON.stringify({event:`clipboard-walker-non-portable-render-source-emitted`,descriptor:e.descriptor,view:e.view}))}function Jw(e){console.warn(JSON.stringify({event:`clipboard-walker-url-blocked`,view:e.view,attr:e.attr,reason:e.reason}))}function Yw(e){console.warn(JSON.stringify({event:`clipboard-walker-url-source-emitted`,view:e.view,tag:e.tag,class:e.class,reason:e.reason}))}function Xw(e){console.warn(JSON.stringify({event:`clipboard-walker-url-classifier-failed`,view:e.view,tag:e.tag,phase:e.phase,...e.errorClass==null?{}:{errorClass:e.errorClass}}))}var Zw=new Set;function Qw(e){Zw.has(e.lucideClass)||(Zw.add(e.lucideClass),console.warn(JSON.stringify({event:`clipboard-walker-unmapped-lucide-detected`,view:e.view,lucideClass:e.lucideClass})))}function $w(e){console.warn(JSON.stringify({event:`clipboard-chunked-insert-failed`,view:e.view,chunksCompleted:e.chunksCompleted,totalChunks:e.totalChunks,bytesWritten:e.bytesWritten,bytesRemaining:e.bytesRemaining,reason:e.reason}))}function eT(e){if(e instanceof Xe)return`HtmlPayloadTooLargeError`;if(e instanceof Tr)return`ChunkedInsertError`;if(e instanceof Error&&e.name&&e.name!==`Error`)return e.name}var tT=[{value:`plaintext`,label:`Plain text`,labelMessage:{id:`pOo4Aa`},aliases:[`text`,`txt`,`none`]},{value:`bash`,label:`Bash`,aliases:[`sh`,`zsh`]},{value:`c`,label:`C`},{value:`cpp`,label:`C++`,aliases:[`c++`]},{value:`csharp`,label:`C#`,aliases:[`cs`]},{value:`css`,label:`CSS`},{value:`diff`,label:`Diff`,aliases:[`patch`]},{value:`gherkin`,label:`Gherkin`,aliases:[`feature`,`cucumber`,`bdd`]},{value:`go`,label:`Go`,aliases:[`golang`]},{value:`graphql`,label:`GraphQL`,aliases:[`gql`]},{value:`ini`,label:`INI`,aliases:[`toml`]},{value:`java`,label:`Java`},{value:`javascript`,label:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`]},{value:`json`,label:`JSON`,aliases:[`jsonc`]},{value:`kotlin`,label:`Kotlin`,aliases:[`kt`]},{value:`less`,label:`Less`},{value:`lua`,label:`Lua`},{value:`makefile`,label:`Makefile`,aliases:[`make`]},{value:`markdown`,label:`Markdown`,aliases:[`md`,`mdx`]},{value:`objectivec`,label:`Objective-C`,aliases:[`objc`,`obj-c`]},{value:`perl`,label:`Perl`,aliases:[`pl`]},{value:`php`,label:`PHP`},{value:`python`,label:`Python`,aliases:[`py`]},{value:`r`,label:`R`},{value:`ruby`,label:`Ruby`,aliases:[`rb`]},{value:`rust`,label:`Rust`,aliases:[`rs`]},{value:`scss`,label:`SCSS`,aliases:[`sass`]},{value:`shell`,label:`Shell session`,labelMessage:{id:`ewSbS_`},aliases:[`console`,`shellsession`]},{value:`sql`,label:`SQL`},{value:`swift`,label:`Swift`},{value:`typescript`,label:`TypeScript`,aliases:[`ts`,`tsx`]},{value:`xml`,label:`XML / HTML`,aliases:[`html`,`htm`,`svg`]},{value:`yaml`,label:`YAML`,aliases:[`yml`]}],nT=(()=>{let e=new Map;for(let t of tT){e.set(t.value,t.value);for(let n of t.aliases??[])e.set(n,t.value)}return e})();function rT(e){return e?nT.get(e.toLowerCase())??e.toLowerCase():null}var iT=/(?:"[^"]*"|'[^']*'|[^\s"'])+/g;function aT(e){return e?e.match(iT)??[]:[]}function oT(e){let t=e.filter(e=>e.length>0);return t.length===0?null:t.join(` `)}function sT(e,t){return aT(e).includes(t)}function cT(e,t){let n=aT(e);return n.includes(t)||n.push(t),oT(n)}function lT(e,t){return oT(aT(e).filter(e=>e!==t))}var uT=new Set([`html`,`htm`,`xml`]);function dT(e,t){return!e||!uT.has(e.toLowerCase())?!1:sT(t,`preview`)}var fT=/^([a-zA-Z][a-zA-Z0-9_-]*)=(.+)$/,pT=/^(\d+(?:\.\d+)?)(px|rem|em|vh|vw|%)?$/i;function mT(e,t){for(let n of aT(e)){let e=n.match(fT);if(e&&e[1]===t)return e[2]??null}return null}function hT(e,t,n){let r=aT(e),i=!1,a=[];for(let e of r){let r=e.match(fT);if(r&&r[1]===t){if(i)continue;i=!0,n!==null&&a.push(`${t}=${n}`);continue}a.push(e)}return!i&&n!==null&&a.push(`${t}=${n}`),oT(a)}function gT(e){return ST(e,`h`)}function _T(e){return ST(e,`w`)}var vT=/\btitle=(?:"([^"]*)"|'([^']*)'|(\S+))/,yT=/\btitle=(?:"[^"]*"|'[^']*'|\S*)/g;function bT(e){if(!e)return null;let t=e.match(vT);return t?t[1]??t[2]??t[3]??null:null}function xT(e,t){let n=e?e.replace(yT,``).trim():``,r=n.length>0?n.replace(/\s+/g,` `):``;if(t===null)return r.length>0?r:null;let i=`title="${t.replace(/["\r\n]/g,``)}"`;return r.length>0?`${i} ${r}`:i}function ST(e,t){let n=mT(e,t);if(!n)return null;let r=n.match(pT);if(!r)return null;let i=r[1];return!i||Number.parseFloat(i)<=0?null:`${i}${r[2]?.toLowerCase()??`px`}`}function CT(e){if(e.type.name===`codeBlock`){let t=typeof e.attrs.language==`string`?e.attrs.language:``,n=typeof e.attrs.meta==`string`?e.attrs.meta:``;if(!dT(rT(t),n))return null;let r=e.textContent,i=n?`${t} ${n}`:t,a=Kn(i),o=a.repeat(wn(a,r));return{source:`${o}${i}\n${r}\n${o}`}}if(e.type.name!==`jsxComponent`)return null;let t=e.attrs.componentName,n=e.attrs.props??{};switch(t){case`Math`:case`DollarMath`:case`MathFence`:return{source:`$$\n${typeof n.formula==`string`?n.formula:``}\n$$`};case`MermaidFence`:return{source:`\`\`\`mermaid\n${typeof n.chart==`string`?n.chart:``}\n\`\`\``};default:return null}}function wT(e,t){let n=CT(e);if(!n)return null;let r=t.createElement(`pre`);r.className=`mdx-component`;let i=t.createElement(`code`);return i.textContent=n.source,r.appendChild(i),r}var TT={note:{color:`#0969da`,bg:`#dbeafe`},tip:{color:`#1f883d`,bg:`#dcfce7`},important:{color:`#8250df`,bg:`#f3e8ff`},warning:{color:`#9a6700`,bg:`#fef3c7`},caution:{color:`#cf222e`,bg:`#fee2e2`}};function ET(e){return Object.hasOwn(TT,e)?TT[e]:TT.note}function DT(e){let t=typeof e.type==`string`?e.type:`note`,n=ET(t),r=document.createElement(`aside`);if(r.setAttribute(`class`,`callout callout-${t}`),r.setAttribute(`data-callout-type`,t),r.setAttribute(`style`,`border-left: 3px solid ${n.color}; background-color: ${n.bg}; padding: 0.5rem 0.75rem; border-radius: 0.25rem;`),typeof e.title==`string`&&e.title){let t=document.createElement(`strong`);t.textContent=e.title,r.appendChild(t)}return r}function OT(e){let t=document.createElement(`details`);e.defaultOpen===!0&&t.setAttribute(`open`,``),t.setAttribute(`class`,`accordion`);let n=document.createElement(`summary`);return n.textContent=typeof e.title==`string`?e.title:`Accordion`,t.appendChild(n),t}function kT(e){let t=Xg(e);return t.portable?null:t.reason}function AT(e){let t=document.createElement(`pre`);t.className=`mdx-component`;let n=document.createElement(`code`);return n.textContent=e,t.appendChild(n),t}function jT(e,t,n){if(e===``)return null;let r;try{r=kT(e)}catch(e){let n=eT(e);return Xw({view:`wysiwyg`,tag:t,phase:`classifier-throw`,...n===void 0?{}:{errorClass:n}}),null}return r===null?null:(Yw({view:`wysiwyg`,tag:t,class:`mdx-component`,reason:r}),AT(n))}function MT(e){let t=typeof e.alt==`string`?e.alt:``,n=typeof e.src==`string`?e.src:``,r=jT(n,`img`,`![${t}](${n})`);if(r!==null)return r;let i=document.createElement(`img`);return n&&Ig(n)&&i.setAttribute(`src`,n),typeof e.alt==`string`&&i.setAttribute(`alt`,e.alt),i}function NT(e,t){let n=document.createElement(e);return n.setAttribute(`src`,t),n.outerHTML}function PT(e){let t=typeof e.src==`string`?e.src:``,n=jT(t,`video`,NT(`video`,t));if(n!==null)return n;let r=document.createElement(`video`);return t&&Ig(t)&&r.setAttribute(`src`,t),e.controls!==!1&&r.setAttribute(`controls`,``),r}function FT(e){let t=typeof e.src==`string`?e.src:``,n=jT(t,`audio`,NT(`audio`,t));if(n!==null)return n;let r=document.createElement(`audio`);return t&&Ig(t)&&r.setAttribute(`src`,t),e.controls!==!1&&r.setAttribute(`controls`,``),r}function IT(e){if(e.type.name===`codeBlock`)return wT(e,document);if(e.type.name!==`jsxComponent`)return null;let t=e.attrs.componentName,n=e.attrs.props??{};switch(t){case`Callout`:case`GFMCallout`:return DT(n);case`Accordion`:case`HtmlDetailsAccordion`:return OT(n);case`img`:case`CommonMarkImage`:return MT(n);case`video`:return PT(n);case`audio`:return FT(n);case`Math`:case`DollarMath`:case`MathFence`:case`MermaidFence`:return wT(e,document);default:return null}}var LT=`color.background-color.background-image.border.border-top.border-right.border-bottom.border-left.border-color.border-width.border-style.border-radius.padding.padding-top.padding-right.padding-bottom.padding-left.margin.margin-top.margin-right.margin-bottom.margin-left.font-family.font-size.font-weight.font-style.text-decoration.text-align.line-height.list-style.list-style-type.list-style-position.vertical-align.white-space`.split(`.`),RT=new Set([`jsx-component-wrapper`,`selectedCell`,`is-empty`,`ProseMirror-selectednode`,`ProseMirror-trailingBreak`]),zT=new Set([`data-selected`,`data-has-child-selected`,`data-dragging`,`data-range-selected`,`contenteditable`,`data-pm-slice`]),BT={getComputedStyle:e=>window.getComputedStyle(e)};function VT(e,t=LT){let n=``;for(let r of t){let t=e.getPropertyValue(r);t&&(t===`initial`||t===`normal`||(n+=`${r}: ${Jg(t)}; `))}return n.trim()}function HT(e,t=RT){return e.split(/\s+/).filter(e=>e.length>0&&!t.has(e)).join(` `)||null}function UT(e,t,n){let r=!1;return e.nodesBetween(t,n,(i,a,o)=>(o===e&&(t>a||n<a+i.nodeSize)&&(r=!0),!1)),r}function WT(e,t,n=BT){let r=document.createDocumentFragment(),{from:i,to:a}=t.state.selection;return i===a||UT(t.state.doc,i,a)||t.state.doc.nodesBetween(i,a,(e,i,a)=>{if(a!==t.state.doc)return!1;let o=t.nodeDOM(i);if(o==null){Kw({descriptor:e.type.name,view:`wysiwyg`});let t=IT(e);return t&&r.appendChild(t),!1}if(!(o instanceof Element)||o.getAttribute(`data-clipboard-omit`)===`true`)return!1;let s=wT(e,document);return s===null?(r.appendChild(GT(o,n)),!1):(r.appendChild(s),qw({view:`wysiwyg`,descriptor:e.attrs.componentName??e.type.name}),!1)}),r}function GT(e,t){let n=e.cloneNode(!0);return eE(e,n,t),QT(n),tE(n),qT(n),pE(e,n,t),ZT(n),KT(n),n}function KT(e){let t=e.ownerDocument,n=e=>{let r=e.tagName.toUpperCase();if(!(r===`PRE`||r===`CODE`))for(let r of Array.from(e.childNodes))if(r.nodeType===Node.TEXT_NODE){let e=r.nodeValue??``;if(!e.includes(`
11
- `))continue;let n=e.split(`
12
- `),i=t.createDocumentFragment();for(let e=0;e<n.length;e++)e>0&&i.appendChild(t.createElement(`br`)),n[e].length>0&&i.appendChild(t.createTextNode(n[e]));r.replaceWith(i)}else r.nodeType===Node.ELEMENT_NODE&&n(r)};n(e)}function qT(e){let t=Array.from(e.querySelectorAll(`[data-component-type="math-inline"]`));for(let n of t){if(!n.parentNode)continue;let t=n.getAttribute(`data-formula`)??``,r=e.ownerDocument.createElement(`span`);r.className=`mdx-inline`,r.textContent=`$$${t}$$`,n.replaceWith(r),qw({view:`wysiwyg`,descriptor:`mathInline`})}let n=Array.from(e.querySelectorAll(`a[data-wiki-embed]`));for(let t of n){if(!t.parentNode)continue;let n=t.getAttribute(`data-target`)??``;if(!n)continue;let r=t.getAttribute(`data-alias`)||null,i=t.getAttribute(`data-anchor`)||null,a=e.ownerDocument.createElement(`span`);a.className=`mdx-inline`,a.textContent=JT(n,i,r),t.replaceWith(a),qw({view:`wysiwyg`,descriptor:`wikiLinkEmbed`})}}function JT(e,t,n){let r=e;return t&&(r+=`#${t}`),n&&(r+=`|${n}`),`![[${r}]]`}var YT={"lucide-chevron-right":`›`,"lucide-chevron-down":`⌄`,"lucide-info":`ℹ`,"lucide-lightbulb":`💡`,"lucide-message-square-warning":`❗`,"lucide-alert-triangle":`⚠`,"lucide-alert-octagon":`⛔`},XT=/(?:^|\s)(lucide-[a-z0-9-]+)(?:\s|$)/;function ZT(e){let t=e.querySelectorAll(`svg`);for(let e of Array.from(t)){let t=(e.getAttribute(`class`)??``).match(XT);if(!t)continue;let n=t[1],r=YT[n];if(!r){Qw({lucideClass:n,view:`wysiwyg`});continue}let i=e.ownerDocument.createElement(`span`);i.setAttribute(`aria-hidden`,`true`),i.textContent=r,e.replaceWith(i)}}function QT(e,t=!1){let n=e.getAttribute(`data-image-error`)===`true`;n&&e.removeAttribute(`data-image-error`);let r=t||n;r&&e.tagName.toLowerCase()===`img`&&e.removeAttribute(`hidden`);for(let t of Array.from(e.children))QT(t,r)}function $T(e,t){if(e.tagName.toUpperCase()!==`INPUT`)return;let n=e;n.type===`checkbox`&&(n.checked?t.setAttribute(`checked`,``):t.removeAttribute(`checked`))}function eE(e,t,n){let r=VT(n.getComputedStyle(e));if(r){let e=t.getAttribute(`style`);t.setAttribute(`style`,e?`${e}; ${r}`:r)}let i=t.getAttribute(`class`);if(i!==null){let e=HT(i);e?t.setAttribute(`class`,e):t.removeAttribute(`class`)}for(let e of Array.from(t.attributes)){if(zT.has(e.name)){t.removeAttribute(e.name);continue}if(zg(e.name)){t.removeAttribute(e.name),Jw({attr:`on*`,reason:`event-handler`,view:`wysiwyg`});continue}if(e.name===`style`){let n=Bg(e.value);n===``?(t.removeAttribute(`style`),Jw({attr:`style`,reason:`unsafe-url-or-expression`,view:`wysiwyg`})):n!==e.value&&t.setAttribute(`style`,n);continue}if(kg.has(e.name)){(e.name===`srcset`?Lg(e.value):Ig(e.value))||(t.removeAttribute(e.name),Jw({attr:e.name,reason:e.name===`srcset`?`srcset-candidate`:`scheme`,view:`wysiwyg`}));continue}if(Ag.has(e.name)){let n=Rg(e.value,{reportNoChange:!0});n!==null&&(t.setAttribute(e.name,n),Jw({attr:e.name,reason:`embedded-url`,view:`wysiwyg`}))}}$T(e,t);let a=Array.from(e.children),o=Array.from(t.children),s=Math.min(a.length,o.length);for(let e=0;e<s;e++){let t=a[e],r=o[e];if(t.getAttribute(`data-clipboard-omit`)===`true`){r.remove();continue}eE(t,r,n)}}function tE(e){let t=e.querySelectorAll(`span[data-wiki-link]`);for(let e of Array.from(t)){let t=e.getAttribute(`data-target`)??``;if(!t)continue;let n=Bt(e.getAttribute(`data-anchor`)),r=Bt(e.getAttribute(`data-alias`)),i=$n(t,n),a=e.ownerDocument.createElement(`a`);a.setAttribute(`class`,`wiki-link`),a.setAttribute(`href`,i),a.setAttribute(`data-target`,t),a.setAttribute(`data-anchor`,n??``),a.setAttribute(`data-alias`,r??``),a.textContent=e.textContent??``,e.replaceWith(a)}}var nE=new Set([`img`,`video`,`audio`,`source`,`a`]);function rE(e){return nE.has(e)}function iE(e){return e.closest(`p`)===null?`mdx-component`:`mdx-inline`}function aE(e,t,n){if(t===`mdx-component`){let t=e.createElement(`pre`);t.className=`mdx-component`;let r=e.createElement(`code`);return r.textContent=n,t.appendChild(r),t}let r=e.createElement(`span`);return r.className=`mdx-inline`,r.textContent=n,r}function oE(e){let t=Xg(e);return t.portable?null:t.reason}function sE(e){for(let t of e.split(`,`)){let e=t.trim();if(e===``)continue;let n=oE(e.split(/\s+/)[0]??``);if(n!==null)return n}return null}function cE(e,t){switch(t){case`img`:case`source`:{let t=e.getAttribute(`src`);if(t!==null){let e=oE(t);if(e!==null)return e}let n=e.getAttribute(`srcset`);if(n!==null){let e=sE(n);if(e!==null)return e}return null}case`video`:case`audio`:{let t=e.getAttribute(`src`);return t===null?null:oE(t)}case`a`:{let t=e.getAttribute(`href`);return t===null?null:oE(t)}default:return null}}function lE(e){let t=e.querySelectorAll(`source, img`);for(let e of Array.from(t)){let t=e.tagName.toLowerCase();if(!rE(t))continue;let n=cE(e,t);if(n!==null)return n}return null}function uE(e,t,n,r){let i;try{i=cE(n,r)}catch(e){let t=eT(e);return Xw({view:`wysiwyg`,tag:r,phase:`classifier-throw`,...t===void 0?{}:{errorClass:t}}),!1}return i===null?!1:fE(e,t,n,r,i)}function dE(e,t,n){let r;try{r=lE(n)}catch(e){let t=eT(e);return Xw({view:`wysiwyg`,tag:`picture`,phase:`classifier-throw`,...t===void 0?{}:{errorClass:t}}),!1}return r===null?!1:fE(e,t,n,`picture`,r)}function fE(e,t,n,r,i){let a=e.serializeElementMarkdown?e.serializeElementMarkdown(t):{kind:`no-correspondence`};switch(a.kind){case`no-correspondence`:return Xw({view:`wysiwyg`,tag:r,phase:`serializer-null`}),!1;case`failed`:{let e=a.errorClass;return Xw({view:`wysiwyg`,tag:r,phase:`serializer-throw`,...e===void 0?{}:{errorClass:e}}),!1}case`ok`:{let e=iE(n),t=aE(n.ownerDocument,e,a.markdown);return n.replaceWith(t),Yw({view:`wysiwyg`,tag:r,class:e,reason:i}),!0}default:return!1}}function pE(e,t,n){if(!n.serializeElementMarkdown)return;let r=t.tagName.toLowerCase();if(r===`picture`&&dE(n,e,t)||rE(r)&&uE(n,e,t,r))return;let i=Array.from(e.children),a=Array.from(t.children),o=[];for(let e of i)e.getAttribute(`data-clipboard-omit`)!==`true`&&o.push(e);let s=Math.min(o.length,a.length);for(let e=0;e<s;e++)pE(o[e],a[e],n)}function mE(e){return(t,n)=>{let r=Lw(t,n.state.schema);if(n.state.selection instanceof hn)try{return hE(n.state.selection)}catch(e){Gw({view:`wysiwyg`,kind:`text`,reason:`cellselection:${e?.message??`unknown`}`})}if(n.state.selection instanceof lr&&!n.state.selection.empty)try{let t=bE(r,n.state);if(t!==r)return wE(t,n.state.schema,e.mdManager)}catch(e){Gw({view:`wysiwyg`,kind:`text`,reason:`interior:${e?.message??`unknown`}`})}try{return wE(r,n.state.schema,e.mdManager)}catch(e){return Gw({view:`wysiwyg`,kind:`text`,reason:e?.message??`unknown`}),r.content.textBetween(0,r.content.size,`
13
-
14
- `)}}}function hE(e){let t=[],n=null,r=[];return e.forEachCell((i,a)=>{let o=e.$anchorCell.doc.resolve(a).before();(n===null||o!==n)&&(r.length>0&&t.push(r),r=[],n=o),r.push(xE(gE(i)))}),r.length>0&&t.push(r),t.map(e=>e.join(` `)).join(`
15
- `)}function gE(e){let t=Rw(e,e.type.schema);return t.textBetween(0,t.content.size,`
16
- `,e=>e.type.name===`hardBreak`?`
17
- `:``)}var _E=new Set([`table`,`tableRow`,`tableCell`,`tableHeader`]),vE=new Set([`blockquote`,`list`,`listItem`,`footnoteDefinition`]);function yE(e,t,n){let r=e.doc;return r.textBetween(e.start(n),e.pos,`
18
- `,``)===``&&r.textBetween(t.pos,t.end(n),`
19
- `,``)===``}function bE(e,t){let n=t.selection;if(!(n instanceof lr)||n.empty)return e;let{$from:r,$to:i}=n,a=e.content,o=e.openStart,s=e.openEnd,c=null,l=r.depth-e.openStart+1;for(;o>0&&s>0;){let e=a.firstChild;if(a.childCount!==1||e===null||l<1||l>r.depth||r.node(l).type!==e.type)break;let t;if(_E.has(e.type.name)||e.isTextblock)t=!0;else if(vE.has(e.type.name)){if(yE(r,i,l)){e.type.name===`listItem`&&c!==null&&({content:a,openStart:o,openEnd:s}=c);break}t=!0}else break;if(!t)break;c={content:a,openStart:o,openEnd:s},a=e.content,--o,--s,l+=1}return a===e.content?e:new ln(a,o,s)}function xE(e){return/["\t\n]/.test(e)?`"${e.replaceAll(`"`,`""`)}"`:e}var SE=class extends Hn{mdManager;view=null;constructor(e){super({},{}),this.mdManager=e}setView(e){this.view=e}serializeFragment(e,t,n){let r=this.view;if(r&&r.state.selection instanceof hn)try{let t=e.firstChild?.type.schema??r.state.schema,i=Hn.fromSchema(t),a=kE(zw(e,t),t);return i.serializeFragment(a,{document},n)}catch(e){Gw({view:`wysiwyg`,kind:`html`,reason:`cellselection:${e?.message??`unknown`}`})}if(r&&r.state.selection.from!==r.state.selection.to)try{let e=WT(r.state.selection.content(),r,EE(r,this.mdManager));if(e.childNodes.length>0){if(n){for(let t of Array.from(e.childNodes))n.appendChild(t);return n}return e}}catch(e){Gw({view:`wysiwyg`,kind:`html`,reason:`walker:${e?.message??`unknown`}`})}try{let t=e.firstChild?.type.schema;if(!t)return n??document.createDocumentFragment();let i=new ln(e,0,0);if(r&&r.state.selection instanceof lr&&!r.state.selection.empty)try{i=bE(r.state.selection.content(),r.state)}catch(t){Gw({view:`wysiwyg`,kind:`html`,reason:`interior:${t?.message??`unknown`}`}),i=new ln(e,0,0)}let a=AE(In(wE(Lw(i,t),t,this.mdManager)));if(n){for(let e of Array.from(a.childNodes))n.appendChild(e);return n}return a}catch(e){return Gw({view:`wysiwyg`,kind:`html`,reason:`markdown:${e?.message??`unknown`}`}),n??document.createDocumentFragment()}}};function CE(e){let t=new SE(e.mdManager);return{serializer:t,setView:e=>t.setView(e)}}function wE(e,t,n){return n.serialize(DE(e,t))}function TE(e){let t=null,n=e,r=null;for(;n&&!n.classList.contains(`ProseMirror`)&&!n.hasAttribute(`data-node-view-content`);){if(n.hasAttribute(`data-clipboard-inline-leaf`)){r=n,n=n.parentElement;continue}if(r?.parentElement===n&&n.classList.contains(`react-renderer`)){n=n.parentElement;continue}(n.classList.contains(`react-renderer`)||n.hasAttribute(`data-node-view-wrapper`)||n.hasAttribute(`data-jsx-component`))&&(t=n),n=n.parentElement}return t}function EE(e,t){return{getComputedStyle:e=>window.getComputedStyle(e),serializeElementMarkdown:n=>{let r=TE(n),i;try{let t=r?.parentElement;if(t&&r){let n=Array.prototype.indexOf.call(t.childNodes,r);i=e.posAtDOM(t,n,-1)}else i=e.posAtDOM(n,0)}catch(e){return{kind:`failed`,errorClass:eT(e)}}if(i<0)return{kind:`no-correspondence`};let a=e.state.doc.nodeAt(i);if(!a)return{kind:`no-correspondence`};let o=e.state.doc.slice(i,i+a.nodeSize);try{return{kind:`ok`,markdown:wE(o,e.state.schema,t)}}catch(e){return{kind:`failed`,errorClass:eT(e)}}}}}function DE(e,t){let n=e.content;if(n.firstChild?.isInline){let e=t.nodes.paragraph;if(e){let t=e.createAndFill(null,n);t&&(n=An.from(t))}}let r=t.topNodeType.createAndFill(null,n);if(!r){let e=OE(n,t);e!==n&&(r=t.topNodeType.createAndFill(null,e))}if(!r){let e=t.topNodeType.createAndFill();if(!e)throw Error(`[clipboard] schema cannot fill topNodeType`);return e.toJSON()}return r.toJSON()}function OE(e,t){let n=t.topNodeType.contentMatch,r=[],i=!1;return e.forEach(e=>{!n.matchType(e.type)&&e.childCount>0?(e.content.forEach(e=>{r.push(e)}),i=!0):r.push(e)}),i?An.fromArray(r):e}function kE(e,t){let n=t.nodes.table,r=t.nodes.tableRow;if(!n||!r)return e;let i=e.firstChild;if(!i||i.type===n)return e;let a=[];e.forEach(e=>{if(e.type===r)a.push(e);else{let t=r.createAndFill(null,e);t&&a.push(t)}});let o=n.createAndFill(null,An.fromArray(a));return o?An.from(o):e}function AE(e){let t=new DOMParser().parseFromString(e,`text/html`),n=document.createDocumentFragment();for(let e of Array.from(t.body.childNodes))n.appendChild(e);return n}function jE(e){let t=mE(e);return(n,r,i)=>{try{let{selection:a,schema:o}=n.state;if(a.empty)return!1;let s=r.clipboardData;if(!s)return!1;let c=a.content();if(!Fw(c,o))return!1;let{dom:l}=n.serializeForClipboard(c),u=t(c,n);if(r.preventDefault(),s.clearData(),s.setData(`text/html`,l.innerHTML),s.setData(`text/plain`,u),!(a instanceof hn)){let t=c;a instanceof lr&&(t=bE(c,n.state));let r=e.mdManager.serialize(DE(t,o));s.setData(Dw,r)}return i&&n.editable&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView()),!0}catch(e){return Gw({view:`wysiwyg`,kind:`html`,reason:`copy-intercept:${e?.message??`unknown`}`}),!1}}}function ME(e){if(!e)return`plaintext`;if(e.types.includes(`vscode-editor-data`))return`vscode`;if(e.types.includes(`text/x-gfm`))return`gfm`;let t=e.getData(`text/html`);return t?/data-pm-slice/i.test(t)?`pm-origin`:/docs-internal-guid-/i.test(t)?`gdocs`:/xmlns:o="urn:schemas-microsoft-com:office/i.test(t)||/<meta[^>]*Generator[^>]*Microsoft Word/i.test(t)?`word`:/class="gmail_|class='gmail_/i.test(t)?`gmail`:/notionvc:/i.test(t)?`notion`:/Cocoa HTML Writer/i.test(t)?`apple`:/c-message_kit__|c-message__|c-compose/i.test(t)?`slack`:/google-sheets-html-origin/i.test(t)?`gsheets`:/data-hovercard-type=/i.test(t)?`github`:`generic`:`plaintext`}var NE=/^```/m,PE=/^#{1,6} /m,FE=/^[-*+] /m,IE=/^\d+[.)] /m,LE=/\[[^\]\n]+\]\([^)\n]+\)/,RE=/^\|.*\|$/m,zE=/^\|?\s*(:?-+:?)(\s*\|\s*:?-+:?)+\s*\|?$/m,BE=/\$\$[\s\S]+?\$\$/,VE=/^> /m,HE=/`[^`\n]+`/,UE=/\*\*[^*\n]+\*\*/,WE=/__[^_\n]+__/,GE=/~~[^~\n]+~~/,KE=/<[A-Z]\w*[\s/>]/,qE=/<[a-z]+\s+\w+="[^"]*"/,JE=/<[a-z]+>[^<\n]*<\/[a-z]+>/,YE=/^.+\n[=-]+$/m,XE=/(^|\s)\*[^*\s\n][^*\n]*[^*\s\n]\*(\s|$)/m,ZE=/(^|\s)_[^_\s\n][^_\n]*[^_\s\n]_(\s|$)/m,QE=/^~~~/m,$E=/\\[\\`*_{}[\]<>()#+\-.!|]/,eD=256*1024,tD=32*1024;function nD(e){return e.length<=eD?e:`${e.slice(0,tD)}\n${e.slice(-tD)}`}function rD(e){if(!e)return!1;let t=nD(e),n=0;NE.test(t)&&n++,PE.test(t)&&n++,FE.test(t)&&n++,IE.test(t)&&n++,LE.test(t)&&n++,RE.test(t)&&zE.test(t)&&n++,BE.test(t)&&n++,VE.test(t)&&n++,HE.test(t)&&n++,(UE.test(t)||WE.test(t)||GE.test(t))&&n++,KE.test(t)&&n++,qE.test(t)&&n++,JE.test(t)&&n++,YE.test(t)&&n++,XE.test(t)&&n++,ZE.test(t)&&n++,QE.test(t)&&n++,$E.test(t)&&n++;let r=t.split(`
20
- `).length,i=Math.min(3,Math.floor(r/5));return n>=Math.max(1,i)}var iD=/^[a-z][a-z0-9+.-]*:/i;function aD(e){let t=e.trim();return!t||/\s/.test(t)?null:t}function oD(e){let t=aD(e);return t&&um(t)?t:null}function sD(e){let t=aD(e);if(!t)return null;if(iD.test(t))return Un(t)?t:null;let n=um(t);if(n&&n.text===t&&n.href.startsWith(`mailto:`))return n.href;let r=t.split(/[/?#]/,1)[0]??``;if(r.includes(`@`)||!r.includes(`.`)||r.startsWith(`.`)||r.endsWith(`.`))return null;let i=`https://${t}`;return Un(i)?i:null}function cD(e){let t=aD(e);return!t||!iD.test(t)?null:Un(t)?t:null}var lD=3e3,uD=new Map;function dD(e,t=`Pasted as plain text — some formatting could not be converted.`){let n=Date.now();return n-(uD.get(e)??0)<lD?!1:(uD.set(e,n),ci.error(t),!0)}var fD=!1,pD=!1;function mD(e){fD=e.shiftKey}function hD(e){(e.key===`Shift`||!e.shiftKey)&&(fD=!1)}function gD(){fD=!1}function _D(){pD||typeof window>`u`||(window.addEventListener(`keydown`,mD,!0),window.addEventListener(`keyup`,hD,!0),window.addEventListener(`blur`,gD,!0),pD=!0)}function vD(){_D()}function yD(){return _D(),fD}function bD(e){return yD()?!0:e.shiftKey===!0}function xD(e){return(t,n)=>CD(t,n,`paste`,e)}function SD(e){return(t,n)=>n.dataTransfer?.files&&n.dataTransfer.files.length>0?!1:CD(t,n,`drop`,e)}function CD(e,t,n,r){let i=n===`paste`?t.clipboardData:t.dataTransfer;if(!i||i.types.length===0)return!1;let a=performance.now(),o=ME(i),s=i.getData(`text/plain`),c=i.getData(`text/html`);if(wD(t,n))return s&&DD(e,s),Uw({view:`wysiwyg`,branch:`shift`,source:o}),Hw(a,{op:n,view:`wysiwyg`,branch:`shift`,source:o}),!0;if(TD(e))return s&&DD(e,s),Uw({view:`wysiwyg`,branch:`codeblock`,source:o}),Hw(a,{op:n,view:`wysiwyg`,branch:`codeblock`,source:o}),!0;if(s)if(e.state.selection.empty){let t=oD(s);if(t&&AD(e,t,r,`url`,o))return Uw({view:`wysiwyg`,branch:`url`,source:o}),Hw(a,{op:n,view:`wysiwyg`,branch:`url`,source:o}),!0}else{let t=sD(s);if(t&&ED(e,t,o))return Uw({view:`wysiwyg`,branch:`url`,source:o}),Hw(a,{op:n,view:`wysiwyg`,branch:`url`,source:o}),!0}let l=i.getData(Dw);if(l&&AD(e,l,r,`internal`,o))return Uw({view:`wysiwyg`,branch:`internal`,source:o}),Hw(a,{op:n,view:`wysiwyg`,branch:`internal`,source:o}),!0;let u=i.getData(`vscode-editor-data`);if(u&&s&&kD(e,u,s,o))return Uw({view:`wysiwyg`,branch:`A`,source:o}),Hw(a,{op:n,view:`wysiwyg`,branch:`A`,source:o}),!0;let d=i.getData(`text/x-gfm`);return d&&AD(e,d,r,`B`,o)||s&&c&&rD(s)&&AD(e,s,r,`B`,o)?(Uw({view:`wysiwyg`,branch:`B`,source:o}),Hw(a,{op:n,view:`wysiwyg`,branch:`B`,source:o}),!0):c&&/data-pm-slice/i.test(c)?(Uw({view:`wysiwyg`,branch:`C`,source:o}),Hw(a,{op:n,view:`wysiwyg`,branch:`C`,source:o}),!1):c&&jD(e,c,r,o)?(Uw({view:`wysiwyg`,branch:`D`,source:o}),Hw(a,{op:n,view:`wysiwyg`,branch:`D`,source:o,htmlBytes:c.length}),!0):s?rD(s)&&AD(e,s,r,`E`,`markdown-text`)?(Uw({view:`wysiwyg`,branch:`E`,source:`markdown-text`}),Hw(a,{op:n,view:`wysiwyg`,branch:`E`,source:`markdown-text`}),!0):(DD(e,s),Uw({view:`wysiwyg`,branch:`E`,source:`plaintext`}),Hw(a,{op:n,view:`wysiwyg`,branch:`E`,source:`plaintext`}),!0):!1}function wD(e,t){return t===`paste`?bD(e):e.shiftKey===!0}function TD(e){let{$from:t}=e.state.selection;for(let e=t.depth;e>=0;e--)if(t.node(e).type.name===`codeBlock`)return!0;return!1}function ED(e,t,n){try{let{state:n}=e,r=n.selection;if(!(r instanceof lr)||!r.$from.sameParent(r.$to))return!1;let i=n.schema.marks.link;if(!i)return!1;let a=n.schema.marks.code;return a&&n.doc.rangeHasMark(r.from,r.to,a)?!1:(e.dispatch(n.tr.addMark(r.from,r.to,i.create({href:t})).setMeta(_m,!0)),!0)}catch(e){return Ww({view:`wysiwyg`,stage:`linkifySelection`,source:n,branch:`url`,reason:`${e?.message??`unknown`} (href=${t})`,errorClass:eT(e)}),dD(`wysiwyg`,`Pasted without linking — the link could not be applied.`),!1}}function DD(e,t){let{schema:n,tr:r}=e.state;t&&e.dispatch(r.replaceSelectionWith(n.text(t)).setMeta(_m,!0).scrollIntoView())}var OD=/^[A-Za-z0-9_+-]+$/;function kD(e,t,n,r){try{let r=JSON.parse(t),i=typeof r.mode==`string`?r.mode:``,a=OD.test(i)?i:``,o=e.state.schema.nodes.codeBlock;if(!o)return!1;let s=o.create({language:a},n?e.state.schema.text(n):null);return e.dispatch(e.state.tr.replaceSelectionWith(s).setMeta(_m,!0).scrollIntoView()),!0}catch(e){return Ww({view:`wysiwyg`,stage:`branchA`,source:r,branch:`A`,reason:e?.message??`unknown`,errorClass:eT(e)}),dD(`wysiwyg`),!1}}function AD(e,t,n,r,i){let a;try{a=n.mdManager.parse(t)}catch(e){return Ww({view:`wysiwyg`,stage:`mdManagerParse`,source:i,branch:r,reason:e?.message??`unknown`,errorClass:eT(e)}),dD(`wysiwyg`),!1}return zD(e,a,i,r)}function jD(e,t,n,r){let i;try{i=pr(t)}catch(e){return Ww({view:`wysiwyg`,stage:`htmlToMdast`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:eT(e),htmlBytes:t.length}),dD(`wysiwyg`),!1}let a;try{a=jt(i)}catch(e){return Ww({view:`wysiwyg`,stage:`mdastToMarkdown`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:eT(e),htmlBytes:t.length}),dD(`wysiwyg`),!1}let o;try{o=n.mdManager.parse(a)}catch(e){return Ww({view:`wysiwyg`,stage:`mdManagerParse`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:eT(e),htmlBytes:t.length}),dD(`wysiwyg`),!1}return zD(e,o,r,`D`,t.length)}function MD(e){if(e.textContent.length>0)return!1;let t=!0;return e.forEach(e=>{(e.type.name!==`paragraph`||e.content.size>0)&&(t=!1)}),t}function ND(e,t){let{selection:n}=e;if(!n.empty)return null;let r=[],i=t.content.childCount>0;if(t.content.forEach(e=>{if(e.type.name!==`list`){i=!1;return}e.forEach(e=>{e.type.name===`listItem`&&r.push(e)})}),!i||r.length===0)return null;let{$from:a}=n,o=-1;for(let e=a.depth;e>0;e--)if(a.node(e).type.name===`listItem`){o=e;break}if(o<0||!a.parent.isTextblock)return null;let s=a.node(o),c=a.before(o),l=a.after(o),u=a.pos-a.start(o),d=s.cut(0,u),f=s.cut(u),p=[],m=!MD(d);m&&p.push(d),p.push(...r),MD(f)||p.push(f);let h=e.tr.replaceWith(c,l,An.fromArray(p)),g=c+(m?d.nodeSize:0);for(let e of r)g+=e.nodeSize;return h.setSelection(lr.near(h.doc.resolve(Math.min(g,h.doc.content.size)),-1)),h}function PD(e){let t=[];return e.forEach(e=>{e.type.name===`listItem`&&t.push(e)}),t}function FD(e){if(e.type.name===`list`){let t=PD(e);for(;t.length>0;){let e=FD(t[t.length-1]);if(e){t[t.length-1]=e;break}t.pop()}return t.length>0?e.copy(An.fromArray(t)):null}if(e.type.name===`listItem`){let t=[];if(e.forEach(e=>{t.push(e)}),t.length>0&&t[t.length-1].type.name===`list`){let e=FD(t[t.length-1]);e?t[t.length-1]=e:t.pop()}let n=e.copy(An.fromArray(t));return MD(n)?null:n}return e}function ID(e){let t=e;for(;t.length>0;){let e=t[0];if(MD(e)){t=t.slice(1);continue}let n=LD(e);if(n){t=[...n,...t.slice(1)];continue}break}return t}function LD(e){if(e.childCount===0)return null;let t=e.child(e.childCount-1);if(t.type.name!==`list`)return null;for(let t=0;t<e.childCount-1;t++){let n=e.child(t);if(n.type.name!==`paragraph`||n.content.size>0)return null}return PD(t)}function RD(e,t){let{selection:n}=e;if(!n.empty||t.content.childCount===0)return null;let r=!1;if(t.content.forEach(e=>{e.type.name!==`list`&&(r=!0)}),!r)return null;let{$from:i}=n;if(!i.parent.isTextblock)return null;let a=-1;for(let e=1;e<=i.depth;e++)if(i.node(e).type.name===`list`){a=e;break}if(a<0)return null;for(let e=a;e<i.depth;e++){let t=i.node(e).type.name;if(t!==`list`&&t!==`listItem`)return null}if(i.node(i.depth-1)?.type.name!==`listItem`)return null;let o=i.node(a),s=i.before(a),c=i.after(a),l=i.pos-i.start(a),u=FD(o.cut(0,l)),d=u?PD(u):[],f=ID(PD(o.cut(l))),p=[];t.content.forEach(e=>{p.push(e)});let m=0;for(;m<p.length&&p[m].type.name===`list`;)m++;let h=p.length;for(;h>m&&p[h-1].type.name===`list`;)h--;let g=p.slice(0,m),_=p.slice(m,h),v=p.slice(h),y=[];d.length>0?y.push(o.copy(An.fromArray([...d,...g.flatMap(PD)]))):y.push(...g),y.push(..._),f.length>0?y.push(o.copy(An.fromArray([...v.flatMap(PD),...f]))):y.push(...v);let b=e.tr.replaceWith(s,c,An.fromArray(y)),x=s;if(v.length>0&&f.length>0){for(let e=0;e<y.length-1;e++)x+=y[e].nodeSize;x+=1;for(let e of v)for(let t of PD(e))x+=t.nodeSize}else{let e=y.length-1-(f.length>0);for(let t=0;t<=e;t++)x+=y[t].nodeSize}return b.setSelection(lr.near(b.doc.resolve(Math.min(x,b.doc.content.size)),-1)),b}function zD(e,t,n,r,i){try{let n=e.state.schema.nodeFromJSON(t),r=null;try{r=ND(e.state,n)??RD(e.state,n)}catch{r=null}let i=r??e.state.tr.replaceSelection(n.slice(0,n.content.size));return e.dispatch(i.setMeta(_m,!0).scrollIntoView()),!0}catch(e){return Ww({view:`wysiwyg`,stage:`applyJsonSlice`,source:n,branch:r,reason:e?.message??`unknown`,errorClass:eT(e),...i==null?{}:{htmlBytes:i}}),dD(`wysiwyg`),!1}}var BD=Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`source-paste`})});function VD(e){return vD(),yo.domEventHandlers({copy:(e,t)=>UD(e,t,`copy`),cut:(e,t)=>UD(e,t,`cut`),paste:(t,n)=>WD(t,n,e)})}function HD(e){let t=document.createElement(`pre`);t.className=`mdx-component`;let n=document.createElement(`code`);return n.textContent=e,t.appendChild(n),t.outerHTML}function UD(e,t,n){let{from:r,to:i}=t.state.selection.main;if(r===i)return e.preventDefault(),!0;let a=e.clipboardData;if(!a)return!1;let o=performance.now();try{let s=t.state.sliceDoc(r,i);a.setData(`text/plain`,s);try{a.setData(`text/html`,HD(s))}catch(e){Gw({view:`source`,kind:`html`,reason:e?.message??`unknown`})}return e.preventDefault(),n===`cut`&&t.dispatch({changes:{from:r,to:i,insert:``},userEvent:`delete.cut`}),Hw(o,{op:n,view:`source`,branch:`serialize`,source:`local`}),!0}catch(e){return Gw({view:`source`,kind:`text`,reason:e?.message??`unknown`}),!1}}function WD(e,t,n){let r=e.clipboardData;if(!r||r.types.length===0)return!1;let i=performance.now(),a=ME(r),o=r.getData(`text/plain`),s=r.getData(`text/html`),c=r.getData(`vscode-editor-data`);return bD(e)?(Uw({view:`source`,branch:`shift`,source:a}),Hw(i,{op:`paste`,view:`source`,branch:`shift`,source:a}),!1):c&&o?(Uw({view:`source`,branch:`A`,source:a}),Hw(i,{op:`paste`,view:`source`,branch:`A`,source:a}),!1):o&&s&&KD(s)?(Uw({view:`source`,branch:`B-wrapper`,source:a}),Hw(i,{op:`paste`,view:`source`,branch:`B-wrapper`,source:a}),!1):o&&s&&rD(o)?(Uw({view:`source`,branch:`B`,source:a}),Hw(i,{op:`paste`,view:`source`,branch:`B`,source:a}),!1):s&&/data-pm-slice/i.test(s)?(Uw({view:`source`,branch:`C`,source:a}),Hw(i,{op:`paste`,view:`source`,branch:`C`,source:a}),!1):s&&qD(t,s,n,a)?(e.preventDefault(),Uw({view:`source`,branch:`D`,source:a}),Hw(i,{op:`paste`,view:`source`,branch:`D`,source:a,htmlBytes:s.length}),!0):(Uw({view:`source`,branch:`E`,source:a}),Hw(i,{op:`paste`,view:`source`,branch:`E`,source:a}),!1)}var GD=/<pre\b(?=[^>]*\bclass\s*=\s*["'][^"']*\bmdx-component\b[^"']*["'])[^>]*>\s*<code\b/i;function KD(e){return GD.test(e)}function qD(e,t,n,r){let i;try{i=pr(t)}catch(e){return Ww({view:`source`,stage:`htmlToMdast`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:eT(e),htmlBytes:t.length}),!1}let a;try{a=jt(i)}catch(e){return Ww({view:`source`,stage:`mdastToMarkdown`,source:r,branch:`D`,reason:e?.message??`unknown`,errorClass:eT(e),htmlBytes:t.length}),!1}let{from:o,to:s}=e.state.selection.main;if(!(a.length>500*1024))return e.dispatch({changes:{from:o,to:s,insert:a},selection:{anchor:o+a.length},userEvent:`input.paste`}),!0;let c=o===s?``:e.state.sliceDoc(o,s);o!==s&&e.dispatch({changes:{from:o,to:s,insert:``},userEvent:`input.paste`}),Jf(n.docName);let l=o,u=ya(n.ytext,l);return ur(n.ydoc,n.ytext,l,a,{resolveOffset:e=>{let t=ja(u,n.ydoc);return t==null?e:t.index+(e-l)},origin:BD}).catch(i=>{JD({view:e,source:r,html:t,restoreText:c,anchorIndex:l,anchorRelPos:u,ydoc:n.ydoc,err:i})}),!0}function JD(e){let{view:t,source:n,html:r,restoreText:i,anchorIndex:a,anchorRelPos:o,ydoc:s,err:c}=e,l=`no-restore-needed`;if(c instanceof Tr&&c.bytesWritten>0){let e=o&&s?ja(o,s)?.index??a:a,n=Math.min(e+c.bytesWritten,t.state.doc.length);try{t.dispatch({changes:{from:e,to:n,insert:i}}),l=i.length>0?`restored`:`no-restore-needed`}catch(e){console.warn(`[clipboard] partial-chunk rollback dispatch failed`,e),l=i.length>0?`restore-failed`:`no-restore-needed`}}else if(i.length>0)try{t.dispatch({changes:{from:a,to:a,insert:i}}),l=`restored`}catch(e){console.warn(`[clipboard] selection-restore dispatch failed`,e),l=`restore-failed`}let u=l===`restored`?Y._({id:`jhtG3I`}):l===`restore-failed`?Y._({id:`yCX4jp`}):``;if(c instanceof Tr){$w({view:`source`,chunksCompleted:c.chunksCompleted,totalChunks:c.totalChunks,bytesWritten:c.bytesWritten,bytesRemaining:c.bytesRemaining,reason:c.message});let e=c.chunksCompleted,t=c.totalChunks;ci.error(Y._({id:`xYMPyY`,values:{chunksCompleted:e,totalChunks:t,restoreSuffix:u}}));return}Ww({view:`source`,stage:`chunkedYTextInsert`,source:n,branch:`D`,reason:c?.message??`unknown`,errorClass:eT(c),htmlBytes:r.length}),ci.error(Y._({id:`eBIT9h`,values:{restoreSuffix:u}}))}function YD(e){switch(e){case`html`:return Po({matchClosingTags:!0,autoCloseTags:!0});case`css`:return No();case`javascript`:return Fo({jsx:!0,typescript:!0});case`json`:return Io();case`yaml`:return Ro();case`markdown`:return Lo();case`mermaid`:return se();case`latex`:return bo.define(zo);case`plain`:return null}}function XD(e){let t=(0,$.c)(72),{open:n,onOpenChange:r,initialValue:i,language:s,title:c,description:l,renderPreview:u,previewDebounceMs:d,onSave:f}=e,p=s===void 0?`plain`:s,m=d===void 0?300:d,{_:h}=o(),g=(0,Q.useRef)(f),_=(0,Q.useRef)(r),v,b;t[0]===f?(v=t[1],b=t[2]):(v=()=>{g.current=f},b=[f],t[0]=f,t[1]=v,t[2]=b),(0,Q.useEffect)(v,b);let x,S;t[3]===r?(x=t[4],S=t[5]):(x=()=>{_.current=r},S=[r],t[3]=r,t[4]=x,t[5]=S),(0,Q.useEffect)(x,S);let[C,w]=(0,Q.useState)(i),[T,E]=(0,Q.useState)(i),D,O;t[6]!==i||t[7]!==n?(D=()=>{n&&(w(i),E(i))},O=[n,i],t[6]=i,t[7]=n,t[8]=D,t[9]=O):(D=t[8],O=t[9]),(0,Q.useEffect)(D,O);let j,M;t[10]!==T||t[11]!==C||t[12]!==m||t[13]!==u?(M=()=>{if(!u||C===T)return;let e=window.setTimeout(()=>E(C),m);return()=>window.clearTimeout(e)},j=[C,T,u,m],t[10]=T,t[11]=C,t[12]=m,t[13]=u,t[14]=j,t[15]=M):(j=t[14],M=t[15]),(0,Q.useEffect)(M,j);let P=(0,Q.useRef)(null),F=(0,Q.useRef)(p),L=(0,Q.useRef)(i),B,V;t[16]===p?(B=t[17],V=t[18]):(B=()=>{F.current=p},V=[p],t[16]=p,t[17]=B,t[18]=V),(0,Q.useEffect)(B,V);let H,U;t[19]===i?(H=t[20],U=t[21]):(H=()=>{L.current=i},U=[i],t[19]=i,t[20]=H,t[21]=U),(0,Q.useEffect)(H,U);let ee;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(ee=e=>{if(!e){P.current&&=(P.current.destroy(),null);return}if(P.current)return;let t=YD(F.current),n=new yo({state:_o.create({doc:L.current,extensions:[Co(),Mo(),ho(),wo(),go(So,{fallback:!0}),go(Se),xo.of([{key:`Mod-Enter`,preventDefault:!0,run:e=>(g.current(e.state.doc.toString()),_.current(!1),!0)},ko,...jo,...Ao]),yo.lineWrapping,_o.tabSize.of(2),...t?[t]:[],yo.updateListener.of(e=>{e.docChanged&&w(e.state.doc.toString())})]}),parent:e});P.current=n,requestAnimationFrame(()=>n.focus())},t[22]=ee):ee=t[22];let te=ee,W=u!==void 0,ne;t[23]!==C||t[24]!==r||t[25]!==f?(ne=()=>{f(C),r(!1)},t[23]=C,t[24]=r,t[25]=f,t[26]=ne):ne=t[26];let re=ne,[ie,ae]=(0,Q.useState)(null),oe,se;t[27]===ie?(oe=t[28],se=t[29]):(oe=()=>{if(!ie)return;let e=P.current;e&&e.state.doc.toString()!==ie.value&&e.dispatch({changes:{from:0,to:e.state.doc.length,insert:ie.value}})},se=[ie],t[27]=ie,t[28]=oe,t[29]=se),(0,Q.useEffect)(oe,se);let ce;t[30]===C?ce=t[31]:(ce=e=>{e!==C&&(w(e),E(e),ae({value:e}))},t[30]=C,t[31]=ce);let le=ce,G;t[32]===c?G=t[33]:(G=(0,Z.jsx)(A,{children:c}),t[32]=c,t[33]=G);let K;t[34]===l?K=t[35]:(K=l?(0,Z.jsx)(k,{children:l}):(0,Z.jsx)(k,{children:(0,Z.jsx)(a,{id:`vWc9a0`,components:{0:(0,Z.jsx)(vl,{}),1:(0,Z.jsx)(vl,{})}})}),t[34]=l,t[35]=K);let q;t[36]!==G||t[37]!==K?(q=(0,Z.jsxs)(R,{className:`gap-1`,children:[G,K]}),t[36]=G,t[37]=K,t[38]=q):q=t[38];let ue=`flex min-h-0 flex-1 gap-3 overflow-y-auto overscroll-contain ${W?`flex-col md:flex-row-reverse`:`flex-col`}`,de;t[39]===p?de=t[40]:(de=(0,Z.jsx)(`div`,{ref:te,className:`ok-codepreview-cm min-h-[260px] flex-1 overflow-hidden rounded-md border border-border md:min-h-0`,"data-testid":`ok-code-preview-edit-modal-source`,"data-language":p}),t[39]=p,t[40]=de);let fe;t[41]!==le||t[42]!==T||t[43]!==W||t[44]!==u?(fe=W?(0,Z.jsx)(`div`,{className:`min-h-[260px] flex-1 overflow-auto rounded-md border border-border bg-muted/30 md:min-h-0`,"data-testid":`ok-code-preview-edit-modal-preview`,children:u(T,le)}):null,t[41]=le,t[42]=T,t[43]=W,t[44]=u,t[45]=fe):fe=t[45];let pe;t[46]!==ue||t[47]!==de||t[48]!==fe?(pe=(0,Z.jsxs)(`div`,{className:ue,"data-testid":`ok-code-preview-edit-modal-body`,children:[de,fe]}),t[46]=ue,t[47]=de,t[48]=fe,t[49]=pe):pe=t[49];let me;t[50]===r?me=t[51]:(me=()=>r(!1),t[50]=r,t[51]=me);let he;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,Z.jsx)(a,{id:`dEgA5A`}),t[52]=he):he=t[52];let ge;t[53]===me?ge=t[54]:(ge=(0,Z.jsx)(y,{variant:`ghost`,onClick:me,children:he}),t[53]=me,t[54]=ge);let _e;t[55]===h?_e=t[56]:(_e=h({id:`y3aU20`}),t[55]=h,t[56]=_e);let J;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,Z.jsx)(a,{id:`tfDRzk`}),t[57]=J):J=t[57];let ve;t[58]!==re||t[59]!==_e?(ve=(0,Z.jsx)(y,{onClick:re,"aria-label":_e,children:J}),t[58]=re,t[59]=_e,t[60]=ve):ve=t[60];let ye;t[61]!==ge||t[62]!==ve?(ye=(0,Z.jsxs)(I,{className:`gap-2`,children:[ge,ve]}),t[61]=ge,t[62]=ve,t[63]=ye):ye=t[63];let be;t[64]!==q||t[65]!==pe||t[66]!==ye?(be=(0,Z.jsxs)(N,{className:`flex h-[85vh] max-h-[900px] flex-col gap-3 p-4 sm:max-w-[1400px]`,children:[q,pe,ye]}),t[64]=q,t[65]=pe,t[66]=ye,t[67]=be):be=t[67];let xe;return t[68]!==r||t[69]!==n||t[70]!==be?(xe=(0,Z.jsx)(z,{open:n,onOpenChange:r,children:be}),t[68]=r,t[69]=n,t[70]=be,t[71]=xe):xe=t[71],xe}var ZD=4;function QD(e){let t=(0,$.c)(44),{blocked:n,truncated:r,onDismiss:i}=e,{_:s}=o(),c,l,u,d,f,p,m,h,g,_;if(t[0]!==s||t[1]!==n||t[2]!==r){let e=n.slice(0,ZD);_=!r&&n.length>e.length,p=`status`,m=`ok-codeblock-preview-blocked mt-1.5 flex items-start gap-2 rounded-md border border-border bg-muted/40 px-3 py-2 text-xs text-muted-foreground`,h=!1,t[13]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(Ds,{className:`mt-0.5 size-3.5 shrink-0 text-amber-500`,"aria-hidden":`true`}),t[13]=g):g=t[13],u=`min-w-0 flex-1`,t[14]!==n.length||t[15]!==r?(d=(0,Z.jsx)(`p`,{className:`font-medium text-foreground`,children:r?(0,Z.jsx)(a,{id:`djc1l9`,values:{0:n.length}}):(0,Z.jsx)(a,{id:`R0cyYB`,values:{0:n.length}})}),t[14]=n.length,t[15]=r,t[16]=d):d=t[16],t[17]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(`p`,{className:`mt-0.5`,children:(0,Z.jsx)(a,{id:`yEJ-sl`})}),t[17]=f):f=t[17],c=`mt-1 space-y-0.5`;let i;t[18]===s?i=t[19]:(i=e=>(0,Z.jsxs)(`li`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,Z.jsx)(`span`,{className:`break-all font-mono`,children:e.uri||s({id:`_W-elG`})}),(0,Z.jsx)(`span`,{className:`text-muted-foreground/70`,children:e.directive})]},`${e.directive} ${e.uri}`),t[18]=s,t[19]=i),l=e.map(i),t[0]=s,t[1]=n,t[2]=r,t[3]=c,t[4]=l,t[5]=u,t[6]=d,t[7]=f,t[8]=p,t[9]=m,t[10]=h,t[11]=g,t[12]=_}else c=t[3],l=t[4],u=t[5],d=t[6],f=t[7],p=t[8],m=t[9],h=t[10],g=t[11],_=t[12];let v;t[20]!==c||t[21]!==l?(v=(0,Z.jsx)(`ul`,{className:c,children:l}),t[20]=c,t[21]=l,t[22]=v):v=t[22];let y;t[23]===_?y=t[24]:(y=_?(0,Z.jsx)(`p`,{className:`mt-0.5 text-muted-foreground/70`,children:(0,Z.jsx)(a,{id:`oKBnk5`})}):null,t[23]=_,t[24]=y);let b;t[25]!==v||t[26]!==y||t[27]!==u||t[28]!==d||t[29]!==f?(b=(0,Z.jsxs)(`div`,{className:u,children:[d,f,v,y]}),t[25]=v,t[26]=y,t[27]=u,t[28]=d,t[29]=f,t[30]=b):b=t[30];let x;t[31]===s?x=t[32]:(x=s({id:`GUYwCr`}),t[31]=s,t[32]=x);let S;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(si,{className:`size-3.5`,"aria-hidden":`true`}),t[33]=S):S=t[33];let C;t[34]!==i||t[35]!==x?(C=(0,Z.jsx)(`button`,{type:`button`,className:`-mr-1 -mt-0.5 shrink-0 rounded p-1.5 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,"aria-label":x,onClick:i,children:S}),t[34]=i,t[35]=x,t[36]=C):C=t[36];let w;return t[37]!==b||t[38]!==C||t[39]!==p||t[40]!==m||t[41]!==h||t[42]!==g?(w=(0,Z.jsxs)(`div`,{role:p,className:m,contentEditable:h,children:[g,b,C]}),t[37]=b,t[38]=C,t[39]=p,t[40]=m,t[41]=h,t[42]=g,t[43]=w):w=t[43],w}var $D=[`--popover`,`--popover-foreground`,`--secondary`,`--secondary-foreground`,`--muted`,`--accent`,`--accent-foreground`,`--input`,`--ring`,`--selection-soft`,`--syntax-keyword`,`--syntax-string`,`--syntax-number`,`--syntax-comment`,`--syntax-func`,`--syntax-bg`],eO=[...vr.map(e=>e.name),...$D];function tO(){if(typeof document>`u`)return null;let e=document.documentElement;return{paletteActive:e.hasAttribute(Do),readToken:t=>{try{return getComputedStyle(e).getPropertyValue(t).trim()||null}catch{return null}}}}function nO(e=tO()){if(!e)return null;if(!e.paletteActive)return{};let t={};for(let n of eO){let r=e.readToken(n);!r||r.includes(`var(`)||(t[n]=r)}return t}function rO(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}var iO=`okPreviewTheme`,aO=`okPreviewTokens`;function oO(e,t=tO()){let n=nO(t);return n?{[iO]:e,[aO]:n}:{[iO]:e}}var sO=`okPreviewHeight`;function cO(e){if(typeof e!=`object`||!e)return null;let t=e[sO];return typeof t==`number`&&Number.isFinite(t)&&t>0?Math.ceil(t):null}var lO=`okPreviewCspViolation`;function uO(e){if(typeof e!=`object`||!e)return null;let t=e[lO];if(typeof t!=`object`||!t)return null;let n=t.blocked;if(!Array.isArray(n))return null;let r=[];for(let e of n){if(typeof e!=`object`||!e)continue;let t=e.directive,n=e.uri;typeof t==`string`&&typeof n==`string`&&r.push({directive:t,uri:n})}return r.length===0?null:{blocked:r,truncated:t.truncated===!0}}var dO=`<style>
21
- html, body { scrollbar-width: thin; scrollbar-color: rgba(115,115,115,0.4) transparent; }
22
- html::-webkit-scrollbar, body::-webkit-scrollbar,
23
- *::-webkit-scrollbar { width: 8px; height: 8px; }
24
- html::-webkit-scrollbar-track, body::-webkit-scrollbar-track,
25
- *::-webkit-scrollbar-track { background: transparent; }
26
- html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb,
27
- *::-webkit-scrollbar-thumb { background: rgba(115,115,115,0.4); border-radius: 4px; }
28
- html::-webkit-scrollbar-thumb:hover, body::-webkit-scrollbar-thumb:hover,
29
- *::-webkit-scrollbar-thumb:hover { background: rgba(115,115,115,0.6); }
30
- </style>`;function fO(e){return vr.map(t=>`${t.name}:${t[e]}`).join(`;`)}function pO(e){let t=nO(e),n=t&&Object.keys(t).length>0?`\n:root,:root.dark{${rO(t)}}`:``;return`<style>
31
- :root{${fO(`light`)};color-scheme:light}
32
- :root.dark{${fO(`dark`)};color-scheme:dark}${n}
33
- body{background:var(--background);color:var(--foreground)}
34
- </style>`}function mO(e){return`<script>(function(){var d=document.documentElement;${e===`dark`?`d.classList.add('dark');`:``}var applied=[];addEventListener('message',function(e){if(e.source!==parent)return;var t=e&&e.data&&e.data.${iO};if(t==='dark'){d.classList.add('dark');}else if(t==='light'){d.classList.remove('dark');}var k=e&&e.data&&e.data.${aO};if(k){for(var i=0;i<applied.length;i++){if(!(applied[i] in k)){try{d.style.removeProperty(applied[i]);}catch(_e){}}}applied=[];for(var n in k){applied.push(n);try{d.style.setProperty(n,k[n]);}catch(_e){}}}});var raf;function report(){var b=document.body;if(!b)return;var r=b.getBoundingClientRect();var mb=parseFloat(getComputedStyle(b).marginBottom)||0;parent.postMessage({${sO}:Math.ceil(r.bottom+mb)},'*');}function schedule(){if(raf){cancelAnimationFrame(raf);}raf=requestAnimationFrame(report);}function init(){schedule();addEventListener('load',schedule);if(window.ResizeObserver){try{new ResizeObserver(schedule).observe(document.body);}catch(_e){}}}if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',init);}else{init();}var cspSeen=new Set();var cspList=[];var cspTrunc=false;var cspTimer;function cspFlush(){parent.postMessage({${lO}:{blocked:cspList.slice(),truncated:cspTrunc}},'*');}addEventListener('securitypolicyviolation',function(e){if(cspTrunc)return;var dir=(e&&(e.effectiveDirective||e.violatedDirective))||'';var uri=(e&&e.blockedURI)||'';var k=dir+' '+uri;if(cspSeen.has(k))return;cspSeen.add(k);if(cspList.length<20){cspList.push({directive:dir,uri:uri});}else{cspTrunc=true;}if(cspTimer){clearTimeout(cspTimer);}cspTimer=setTimeout(cspFlush,250);});})();<\/script>`}var hO=`default-src 'none'; script-src 'unsafe-inline' https:; style-src 'unsafe-inline' https: data:; img-src https: data: blob:; font-src https: data:; connect-src https: wss: data: blob:; media-src https: data: blob:; frame-src https:; child-src https:; form-action 'none'; base-uri 'none';`;function gO(e,t=tO()){return`<meta http-equiv="Content-Security-Policy" content="${hO}">
35
- ${pO(t)}
36
- ${dO}
37
- ${mO(e)}`}var _O=`plaintext`;function vO(){return typeof document<`u`&&document.documentElement.classList.contains(`dark`)?`dark`:`light`}function yO(e,t){let n=(0,$.c)(4),[r,i]=(0,Q.useState)(!1),a,o;return n[0]!==e||n[1]!==t?(a=()=>{let n=()=>{let n=typeof t==`function`?t():void 0;if(typeof n!=`number`)return;let r=e.state.doc.nodeAt(n);if(!r)return;let{from:a,to:o}=e.state.selection,s=n,c=a<n+r.nodeSize&&o>s;i(e=>e===c?e:c)};return n(),e.on(`selectionUpdate`,n),()=>{e.isDestroyed||e.off(`selectionUpdate`,n)}},o=[e,t],n[0]=e,n[1]=t,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,Q.useEffect)(a,o),r}function bO(e){let t=(0,$.c)(194),{node:n,updateAttributes:r,editor:i,getPos:c,selected:l}=e,{_:d}=o(),[f,p]=(0,Q.useState)(!1),[m,_]=(0,Q.useState)(!1),y=(0,Q.useRef)(null),b=(0,Q.useRef)(null),x=(0,Q.useRef)(null),[S,C]=(0,Q.useState)(null),[w,T]=(0,Q.useState)(null),{resolvedTheme:E}=s(),D;t[0]===E?D=t[1]:(D=E===`dark`||E===`light`?E:vO(),t[0]=E,t[1]=D);let O=D,k=Ew(),[A]=(0,Q.useState)(vO),j=n.attrs.language??null,M=n.attrs.meta??null,N;t[2]===M?N=t[3]:(N=bT(M),t[2]=M,t[3]=N);let P=N,[F,I]=(0,Q.useState)(!1),[L,R]=(0,Q.useState)(!1),z=_w(),B;t[4]!==i.state||t[5]!==c||t[6]!==n.nodeSize?(B=()=>{let e=typeof c==`function`?c():void 0;if(typeof e!=`number`)return!1;let{from:t,to:r}=i.state.selection;return t===r?!1:t>e&&r<=e+n.nodeSize-1},t[4]=i.state,t[5]=c,t[6]=n.nodeSize,t[7]=B):B=t[7];let V=B,[H,U]=(0,Q.useState)(!1),ee=(0,Q.useId)(),te=`${ee}-title-input`,W=`${ee}-title-help`,ne=(0,Q.useRef)(M),re,ae;t[8]===M?(re=t[9],ae=t[10]):(re=()=>{ne.current=M},ae=[M],t[8]=M,t[9]=re,t[10]=ae),(0,Q.useEffect)(re,ae);let oe,se,ce,le,G,K;if(t[11]!==d||t[12]!==j||t[13]!==M){ce=rT(j);let e;t[20]===d?e=t[21]:(e=e=>e.labelMessage?d(e.labelMessage):e.label,t[20]=d,t[21]=e),se=e;let n=tT.find(e=>e.value===ce);oe=j?n&&se(n)||j:d({id:`LpB85N`});let r;t[22]===M?r=t[23]:(r=sT(M,`preview`),t[22]=M,t[23]=r),G=r,le=ce?uT.has(ce):!1,K=dT(ce,M),t[11]=d,t[12]=j,t[13]=M,t[14]=oe,t[15]=se,t[16]=ce,t[17]=le,t[18]=G,t[19]=K}else oe=t[14],se=t[15],ce=t[16],le=t[17],G=t[18],K=t[19];let q=K,ue;t[24]!==q||t[25]!==M?(ue=q?gT(M):null,t[24]=q,t[25]=M,t[26]=ue):ue=t[26];let de=ue,fe;t[27]!==q||t[28]!==M?(fe=q?_T(M):null,t[27]=q,t[28]=M,t[29]=fe):fe=t[29];let pe=fe,me=de??(S===null?void 0:`${S}px`),he=!q,ge,_e;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(_e=()=>()=>{y.current!==null&&window.clearTimeout(y.current)},ge=[],t[30]=ge,t[31]=_e):(ge=t[30],_e=t[31]),(0,Q.useEffect)(_e,ge);let J=i.isEditable,ve=yO(i,c),ye;t[32]===O?ye=t[33]:(ye=()=>{x.current?.contentWindow?.postMessage(oO(O),`*`)},t[32]=O,t[33]=ye);let be;t[34]!==O||t[35]!==k?(be=[O,k],t[34]=O,t[35]=k,t[36]=be):be=t[36],(0,Q.useEffect)(ye,be);let xe,Se;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(xe=()=>{let e=function(e){if(e.source!==x.current?.contentWindow)return;let t=cO(e.data);if(t!==null){C(e=>e!==null&&Math.abs(e-t)<=2?e:t);return}let n=uO(e.data);n!==null&&T(n)};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},Se=[],t[37]=xe,t[38]=Se):(xe=t[37],Se=t[38]),(0,Q.useEffect)(xe,Se);let Ce;t[39]===n.textContent?Ce=t[40]:(Ce=()=>{let e=n.textContent,t=()=>{_(!0),y.current!==null&&window.clearTimeout(y.current),y.current=window.setTimeout(()=>_(!1),1200)};try{typeof navigator<`u`&&navigator.clipboard?.writeText&&navigator.clipboard.writeText(e).then(t,TO)}catch{}},t[39]=n.textContent,t[40]=Ce);let we=Ce,Ee;t[41]!==i||t[42]!==c?(Ee=()=>{let e=typeof c==`function`?c():void 0;if(typeof e==`number`)try{i.chain().focus().setNodeSelection(e).deleteSelection().run()}catch(e){let t=e;if(!(t instanceof RangeError))throw t;console.warn(`[CodeBlockView] delete failed — position race`,t)}},t[41]=i,t[42]=c,t[43]=Ee):Ee=t[43];let De=Ee,Oe;t[44]!==G||t[45]!==M||t[46]!==r?(Oe=()=>{r({meta:G?lT(M,`preview`):cT(M,`preview`)})},t[44]=G,t[45]=M,t[46]=r,t[47]=Oe):Oe=t[47];let ke=Oe,Ae;t[48]!==M||t[49]!==r?(Ae=e=>{let t=xT(M,e.length>0?e:null);t!==M&&r({meta:t})},t[48]=M,t[49]=r,t[50]=Ae):Ae=t[50];let je=Ae,Me;t[51]!==i.state||t[52]!==i.view||t[53]!==c||t[54]!==n.attrs||t[55]!==n.nodeSize||t[56]!==n.type?(Me=e=>{let t=typeof c==`function`?c():void 0;if(typeof t==`number`)try{let{schema:r,tr:a}=i.state,o=n.type.create(n.attrs,e.length>0?r.text(e):null);a.replaceWith(t,t+n.nodeSize,o),i.view.dispatch(a)}catch(e){let t=e;if(!(t instanceof RangeError))throw t;console.warn(`[CodeBlockView] edit-save failed — position race`,t)}},t[51]=i.state,t[52]=i.view,t[53]=c,t[54]=n.attrs,t[55]=n.nodeSize,t[56]=n.type,t[57]=Me):Me=t[57];let Ne=Me,Pe;t[58]===r?Pe=t[59]:(Pe=e=>{let t=`${Math.round(e.width)}px`,n=`${Math.round(e.height)}px`;r({meta:hT(hT(ne.current,`h`,n),`w`,t)})},t[58]=r,t[59]=Pe);let Fe=Pe,Ie=j??void 0,Le=ve?`true`:void 0,Re=l?`true`:void 0,ze=q?`true`:void 0,Be=he?`true`:`false`,He=H?`true`:void 0,Ue,We;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=()=>U(!0),We=()=>U(!1),t[60]=Ue,t[61]=We):(Ue=t[60],We=t[61]);let Ge;t[62]!==d||t[63]!==O||t[64]!==A||t[65]!==he||t[66]!==me||t[67]!==Fe||t[68]!==n.textContent||t[69]!==q||t[70]!==pe?(Ge=q?(0,Z.jsxs)(`div`,{ref:b,className:v(`ok-codeblock-preview`,he?`ok-codeblock-preview--with-code`:`ok-codeblock-preview--solo`),contentEditable:!1,style:{...me?{height:me}:{},...pe?{width:pe}:{}},onMouseDown:wO,children:[(0,Z.jsx)(`iframe`,{title:d({id:`G7cMuO`}),ref:x,sandbox:`allow-scripts`,referrerPolicy:`no-referrer`,srcDoc:gO(A)+n.textContent,className:`ok-codeblock-preview-frame`,onLoad:()=>{T(null),x.current?.contentWindow?.postMessage(oO(O),`*`)}}),(0,Z.jsx)(Uh,{targetRef:b,bounds:{minWidth:192,maxWidth:Math.round(window.innerWidth*.9),minHeight:128,maxHeight:Math.round(window.innerHeight*.9)},onResize:e=>{let t=b.current;t&&(t.style.width=`${e.width}px`,t.style.height=`${e.height}px`)},onResizeEnd:Fe})]}):null,t[62]=d,t[63]=O,t[64]=A,t[65]=he,t[66]=me,t[67]=Fe,t[68]=n.textContent,t[69]=q,t[70]=pe,t[71]=Ge):Ge=t[71];let Ke;t[72]!==w||t[73]!==q?(Ke=q&&w?(0,Z.jsx)(QD,{blocked:w.blocked,truncated:w.truncated,onDismiss:()=>T(null)}):null,t[72]=w,t[73]=q,t[74]=Ke):Ke=t[74];let qe;t[75]===P?qe=t[76]:(qe=P?(0,Z.jsx)(`div`,{className:`ok-codeblock-title`,contentEditable:!1,"data-testid":`ok-codeblock-title`,title:P,children:(0,Z.jsx)(`span`,{className:`ok-codeblock-title-text`,children:P})}):null,t[75]=P,t[76]=qe);let Je=q&&he?`rounded-b-lg`:null,Ye=q?null:`rounded-lg`,Xe;t[77]!==Je||t[78]!==Ye?(Xe=v(`ok-codeblock-pre m-0 overflow-x-auto px-5 py-4 font-mono text-sm leading-relaxed`,Je,Ye),t[77]=Je,t[78]=Ye,t[79]=Xe):Xe=t[79];let Ze=!he||void 0,Qe=j?`language-${j}`:void 0,$e;t[80]===Qe?$e=t[81]:($e=v(`hljs block whitespace-pre bg-transparent p-0`,Qe),t[80]=Qe,t[81]=$e);let et;t[82]===$e?et=t[83]:(et=(0,Z.jsx)(Te,{as:`code`,className:$e}),t[82]=$e,t[83]=et);let tt;t[84]!==Xe||t[85]!==Ze||t[86]!==et?(tt=(0,Z.jsx)(`pre`,{className:Xe,"aria-hidden":Ze,children:et}),t[84]=Xe,t[85]=Ze,t[86]=et,t[87]=tt):tt=t[87];let nt;t[88]===Symbol.for(`react.memo_cache_sentinel`)?(nt={[Fg]:`true`},t[88]=nt):nt=t[88];let rt=!J,it;t[89]!==d||t[90]!==oe?(it=d({id:`c5f7sm`,values:{currentLabel:oe}}),t[89]=d,t[90]=oe,t[91]=it):it=t[91];let at;t[92]===oe?at=t[93]:(at=(0,Z.jsx)(`span`,{children:oe}),t[92]=oe,t[93]=at);let ot;t[94]===J?ot=t[95]:(ot=J?(0,Z.jsx)(Ur,{className:`size-3 opacity-60`,"aria-hidden":`true`}):null,t[94]=J,t[95]=ot);let st;t[96]!==rt||t[97]!==it||t[98]!==at||t[99]!==ot?(st=(0,Z.jsx)(h,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,disabled:rt,className:`ok-codeblock-chrome-btn ok-codeblock-chrome-lang`,"aria-label":it,children:[at,ot]})}),t[96]=rt,t[97]=it,t[98]=at,t[99]=ot,t[100]=st):st=t[100];let ct;t[101]===d?ct=t[102]:(ct=d({id:`G_mWXb`}),t[101]=d,t[102]=ct);let lt;t[103]===ct?lt=t[104]:(lt=(0,Z.jsx)(ul,{placeholder:ct}),t[103]=ct,t[104]=lt);let ut;t[105]===d?ut=t[106]:(ut=d({id:`ETyvvg`}),t[105]=d,t[106]=ut);let dt;t[107]===ut?dt=t[108]:(dt=(0,Z.jsx)(fl,{children:ut}),t[107]=ut,t[108]=dt);let ft;t[109]!==se||t[110]!==i.commands||t[111]!==ce||t[112]!==j||t[113]!==r?(ft=tT.map(e=>{let t=e.value===_O?!j||ce===_O:ce===e.value;return(0,Z.jsxs)(ml,{value:`${se(e)} ${e.label} ${e.value} ${e.aliases?.join(` `)??``}`,onSelect:()=>{r({language:e.value===_O?null:e.value}),p(!1),i.commands.focus()},children:[(0,Z.jsx)(`span`,{className:`flex-1`,children:se(e)}),t?(0,Z.jsx)(Hr,{className:`size-3.5`,"aria-hidden":`true`}):null]},e.value)}),t[109]=se,t[110]=i.commands,t[111]=ce,t[112]=j,t[113]=r,t[114]=ft):ft=t[114];let pt;t[115]===ft?pt=t[116]:(pt=(0,Z.jsx)(pl,{children:ft}),t[115]=ft,t[116]=pt);let mt;t[117]!==dt||t[118]!==pt?(mt=(0,Z.jsxs)(dl,{children:[dt,pt]}),t[117]=dt,t[118]=pt,t[119]=mt):mt=t[119];let ht;t[120]!==lt||t[121]!==mt?(ht=(0,Z.jsx)(u,{align:`end`,sideOffset:6,className:`w-56 p-0`,children:(0,Z.jsxs)(cl,{filter:SO,children:[lt,mt]})}),t[120]=lt,t[121]=mt,t[122]=ht):ht=t[122];let gt;t[123]!==f||t[124]!==st||t[125]!==ht?(gt=(0,Z.jsxs)(g,{open:f,onOpenChange:p,children:[st,ht]}),t[123]=f,t[124]=st,t[125]=ht,t[126]=gt):gt=t[126];let _t;t[127]!==d||t[128]!==J||t[129]!==q?(_t=J&&q?(0,Z.jsx)(`button`,{type:`button`,className:`ok-codeblock-chrome-btn`,"aria-label":d({id:`R3y75Z`}),"data-testid":`ok-codeblock-edit-btn`,onClick:()=>R(!0),children:(0,Z.jsx)(Ss,{className:`size-3.5`,"aria-hidden":`true`})}):null,t[127]=d,t[128]=J,t[129]=q,t[130]=_t):_t=t[130];let vt;t[131]!==d||t[132]!==J||t[133]!==ke||t[134]!==le||t[135]!==G?(vt=J&&le?(0,Z.jsx)(`button`,{type:`button`,className:`ok-codeblock-chrome-btn`,"data-active":G?`true`:void 0,"aria-pressed":G,"aria-label":d(G?{id:`xHGM4U`}:{id:`7OwvEL`}),onClick:ke,children:G?(0,Z.jsx)(Ve,{className:`size-3.5`}):(0,Z.jsx)(Qr,{className:`size-3.5`})}):null,t[131]=d,t[132]=J,t[133]=ke,t[134]=le,t[135]=G,t[136]=vt):vt=t[136];let yt;t[137]!==d||t[138]!==J||t[139]!==je||t[140]!==F||t[141]!==P||t[142]!==W||t[143]!==te?(yt=J?(0,Z.jsxs)(g,{open:F,onOpenChange:I,children:[(0,Z.jsx)(h,{asChild:!0,children:(0,Z.jsx)(`button`,{type:`button`,className:`ok-codeblock-chrome-btn`,"data-active":P?`true`:void 0,"aria-label":d({id:`DDTdLl`}),children:(0,Z.jsx)(Ts,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,Z.jsx)(u,{align:`end`,sideOffset:6,className:`w-64 p-3`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Z.jsx)(`label`,{htmlFor:te,className:`text-2xs font-mono uppercase tracking-wide text-muted-foreground`,children:(0,Z.jsx)(a,{id:`MHrjPM`})}),(0,Z.jsx)(li,{id:te,type:`text`,value:P??``,placeholder:d({id:`mk2poV`}),"data-testid":`ok-codeblock-title-input`,"aria-describedby":W,onChange:e=>je(e.target.value),onKeyDown:e=>{(e.key===`Enter`||e.key===`Escape`)&&(e.preventDefault(),I(!1))},className:`h-8`}),(0,Z.jsx)(`p`,{id:W,className:`text-2xs text-muted-foreground`,children:(0,Z.jsx)(a,{id:`lond3p`})})]})})]}):null,t[137]=d,t[138]=J,t[139]=je,t[140]=F,t[141]=P,t[142]=W,t[143]=te,t[144]=yt):yt=t[144];let bt;t[145]!==d||t[146]!==i.commands||t[147]!==c||t[148]!==z||t[149]!==V?(bt=z?null:(0,Z.jsx)(`button`,{type:`button`,className:`ok-codeblock-chrome-btn`,"aria-label":d({id:`Ohpzub`}),"data-testid":`ok-codeblock-ask-ai-btn`,onClick:()=>{if(!V()){let e=typeof c==`function`?c():void 0;if(typeof e!=`number`)return;try{i.commands.setNodeSelection(e)}catch(e){let t=e;if(!(t instanceof RangeError))throw t;console.warn(`[CodeBlockView] Ask AI failed — position race`,t);return}}requestAnimationFrame(xO)},children:(0,Z.jsx)(As,{className:`size-3.5`,"aria-hidden":`true`})}),t[145]=d,t[146]=i.commands,t[147]=c,t[148]=z,t[149]=V,t[150]=bt):bt=t[150];let xt;t[151]!==d||t[152]!==m?(xt=d(m?{id:`6V3Ea3`}:{id:`NmPNJJ`}),t[151]=d,t[152]=m,t[153]=xt):xt=t[153];let St;t[154]===m?St=t[155]:(St=m?(0,Z.jsx)(Hr,{className:`size-3.5`,"aria-hidden":`true`}):(0,Z.jsx)(Gr,{className:`size-3.5`,"aria-hidden":`true`}),t[154]=m,t[155]=St);let Ct;t[156]!==we||t[157]!==xt||t[158]!==St?(Ct=(0,Z.jsx)(`button`,{type:`button`,className:`ok-codeblock-chrome-btn`,"aria-label":xt,onClick:we,children:St}),t[156]=we,t[157]=xt,t[158]=St,t[159]=Ct):Ct=t[159];let wt;t[160]!==d||t[161]!==J||t[162]!==De?(wt=J?(0,Z.jsx)(`button`,{type:`button`,className:`ok-codeblock-chrome-btn ok-codeblock-chrome-btn--delete`,"aria-label":d({id:`oBXkm2`}),onClick:De,children:(0,Z.jsx)(ai,{className:`size-3.5`,"aria-hidden":`true`})}):null,t[160]=d,t[161]=J,t[162]=De,t[163]=wt):wt=t[163];let Tt;t[164]!==gt||t[165]!==_t||t[166]!==vt||t[167]!==yt||t[168]!==bt||t[169]!==Ct||t[170]!==wt?(Tt=(0,Z.jsxs)(`div`,{className:`ok-codeblock-chrome`,contentEditable:!1,onMouseDown:CO,...nt,children:[gt,_t,vt,yt,bt,Ct,wt]}),t[164]=gt,t[165]=_t,t[166]=vt,t[167]=yt,t[168]=bt,t[169]=Ct,t[170]=wt,t[171]=Tt):Tt=t[171];let Et;t[172]!==d||t[173]!==A||t[174]!==L||t[175]!==J||t[176]!==Ne||t[177]!==n.textContent||t[178]!==ce||t[179]!==q?(Et=J&&q?(0,Z.jsx)(XD,{open:L,onOpenChange:R,initialValue:n.textContent,language:ce===`xml`?`html`:`plain`,title:d({id:`R3y75Z`}),renderPreview:e=>(0,Z.jsx)(`iframe`,{title:d({id:`G7cMuO`}),sandbox:`allow-scripts`,className:`size-full border-0`,srcDoc:gO(A)+e}),onSave:Ne}):null,t[172]=d,t[173]=A,t[174]=L,t[175]=J,t[176]=Ne,t[177]=n.textContent,t[178]=ce,t[179]=q,t[180]=Et):Et=t[180];let Dt;return t[181]!==Ie||t[182]!==Le||t[183]!==Re||t[184]!==ze||t[185]!==Be||t[186]!==He||t[187]!==Ge||t[188]!==Ke||t[189]!==qe||t[190]!==tt||t[191]!==Tt||t[192]!==Et?(Dt=(0,Z.jsxs)(ie,{className:`ok-codeblock relative my-3`,"data-language":Ie,"data-cursor-inside":Le,"data-selected":Re,"data-preview":ze,"data-code-visible":Be,"data-hovered":He,onMouseEnter:Ue,onMouseLeave:We,children:[Ge,Ke,qe,tt,Tt,Et]}),t[181]=Ie,t[182]=Le,t[183]=Re,t[184]=ze,t[185]=Be,t[186]=He,t[187]=Ge,t[188]=Ke,t[189]=qe,t[190]=tt,t[191]=Tt,t[192]=Et,t[193]=Dt):Dt=t[193],Dt}function xO(){return hw()}function SO(e,t){return t?+!!e.toLowerCase().includes(t.toLowerCase()):1}function CO(e){return e.stopPropagation()}function wO(e){return e.stopPropagation()}function TO(){}function EO(e,t=[]){return e.flatMap(e=>{if(e.type===`text`)return[{text:e.value,classes:t}];let n=[...t,...e.properties?.className??[]];return EO(e.children,n)})}function DO(e){let{doc:t,name:n,lowlight:r,defaultLanguage:i}=e,a=[],o=r.listLanguages();return rt(t,e=>e.type.name===n).forEach(e=>{let t=e.pos+1,n=e.node.attrs.language||i;if(!n||!(o.includes(n)||(r.registered?.(n)??!1)))return;let s;try{s=r.highlight(n,e.node.textContent)}catch{return}let c=s.children??[];for(let e of EO(c)){let n=t+e.text.length;e.classes.length>0&&a.push(Rt.inline(t,n,{class:e.classes.join(` `)})),t=n}}),Je.create(t,a)}function OO(e){let{name:t,lowlight:n,defaultLanguage:r}=e,i=new ar({key:new Nn(`codeBlockLowlight`),state:{init:(e,{doc:i})=>DO({doc:i,name:t,lowlight:n,defaultLanguage:r}),apply:(e,i,a,o)=>{if(!e.docChanged)return i.map(e.mapping,e.doc);let s=a.selection.$head.parent.type.name,c=o.selection.$head.parent.type.name,l=rt(a.doc,e=>e.type.name===t),u=rt(o.doc,e=>e.type.name===t);return[s,c].includes(t)||u.length!==l.length||e.steps.some(e=>{let t=e;return t.from===void 0||t.to===void 0?!1:l.some(e=>t.from<e.pos+e.node.nodeSize&&t.to>e.pos)})?DO({doc:e.doc,name:t,lowlight:n,defaultLanguage:r}):i.map(e.mapping,e.doc)}},props:{decorations(e){return i.getState(e)}}});return i}function kO(){let e=TS(xS);return e.register(`gherkin`,gb),e}var AO=kO(),jO=mn.extend({addOptions(){return{...this.parent?.(),enableTabIndentation:!0,tabSize:2}},addNodeView(){return de(bO)},addProseMirrorPlugins(){return[...this.parent?.()??[],OO({name:this.name,lowlight:AO,defaultLanguage:null})]},addInputRules(){return[...this.parent?.()??[],rn({find:/^```$/,type:this.type,getAttributes:()=>({language:`js`})})]}});function MO(e){return!!e.getMeta(Zl)}function NO(e,t){let n=Zl.getState(e);return Hu(n.doc,n.type,t,n.binding.mapping)||0}function PO(e,t){let n=Zl.getState(e);return Bu(t,n.type,n.binding.mapping)}var FO=class e extends Ln{constructor(e,t){super(e),this.yRelativePosition=t}static fromJSON(t){return new e(t.position,t.yRelativePosition)}toJSON(){return{position:this.position,yRelativePosition:this.yRelativePosition}}};function IO(e,t){return new FO(e,PO(t,e))}function LO(e,t,n){let r=e instanceof FO?e.yRelativePosition:null;if(MO(t)&&r)return{position:new FO(NO(n,r),r),mapResult:null};let i=Yt(e,t),a=i.position.position;return{position:new FO(a,r??PO(n,a)),mapResult:i.mapResult}}var RO=tt.create({name:`collaboration`,priority:1e3,addOptions(){return{document:null,field:`default`,fragment:null,provider:null}},addStorage(){return{isDisabled:!1}},onCreate(){this.editor.extensionManager.extensions.find(e=>e.name===`undoRedo`)&&console.warn(`[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-undo-redo".`)},onBeforeCreate(){this.editor.utils.getUpdatedPosition=(e,t)=>LO(e,t,this.editor.state),this.editor.utils.createMappablePosition=e=>IO(e,this.editor.state)},addCommands(){return{undo:()=>({tr:e,state:t,dispatch:n})=>(e.setMeta(`preventDispatch`,!0),Ql.getState(t).undoManager.undoStack.length===0?!1:n?Qu(t):!0),redo:()=>({tr:e,state:t,dispatch:n})=>(e.setMeta(`preventDispatch`,!0),Ql.getState(t).undoManager.redoStack.length===0?!1:n?$u(t):!0)}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){let e=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),t=nd(this.options.yUndoOptions),n=t.spec.view;return t.spec.view=e=>{let{undoManager:t}=Ql.getState(e.state);t.restore&&=(t.restore(),()=>{});let r=n?n(e):void 0;return{destroy:()=>{let e=t.trackedOrigins.has(t),n=t._observers;t.restore=()=>{e&&t.trackedOrigins.add(t),t.doc.on(`afterTransaction`,t.afterTransactionHandler),t._observers=n},r?.destroy&&r.destroy()}}},[ou(e,{...this.options.ySyncOptions,onFirstRender:this.options.onFirstRender}),t,this.editor.options.enableContentCheck&&new ar({key:new Nn(`filterInvalidContent`),filterTransaction:t=>{if(!MO(t))return!0;if(this.storage.isDisabled)return!1;if(!t.docChanged)return!0;try{return t.doc.check(),!0}catch(t){return this.storage.isDisabled=!0,this.editor.emit(`contentError`,{error:t,editor:this.editor,disableCollaboration:()=>{var t;(t=e.doc)==null||t.destroy()}}),!1}}})].filter(Boolean)}});function zO(e){if(!e.length)return Je.empty;let t=[],n=e[0].$from.node(0);return e.forEach(e=>{let n=e.$from.pos,r=e.$from.nodeAfter;r&&t.push(Rt.node(n,n+r.nodeSize,{class:`ProseMirror-selectednoderange`}))}),Je.create(n,t)}function BO(e,t,n){let r=n.isText||n.isAtom?0:1;return{start:e+r,end:e+t-r}}function VO(e,t,n,r={}){let i=[],a=e.node(0),{extendOnBoundaryOverlap:o=!0}=r;typeof n==`number`&&n>=0||(n=e.sameParent(t)?Math.max(0,e.sharedDepth(t.pos)-1):e.sharedDepth(t.pos));let s=new En(e,t,n),c=s.depth===0?0:a.resolve(s.start).posAtIndex(0);return s.parent.forEach((n,r)=>{let l=c+r,u=l+n.nodeSize,d=BO(l,n.nodeSize,n),f=o?t.pos>=d.start&&e.pos<=d.end:t.pos>d.start&&e.pos<d.end;if(l<s.start||l>=s.end||!f)return;let p=new Zn(a.resolve(l),a.resolve(u));i.push(p)}),i}var HO=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return new UO(e.resolve(this.anchor),e.resolve(this.head))}},UO=class e extends dn{constructor(e,t,n,r=1){let{doc:i}=e,a=e===t,o=e.pos===i.content.size&&t.pos===i.content.size,s=a&&!o?i.resolve(t.pos+(r>0?1:-1)):t,c=a&&o?i.resolve(e.pos-(r>0?1:-1)):e,l=VO(c.min(s),c.max(s),n),u=s.pos>=e.pos?l[0].$from:l[l.length-1].$to,d=s.pos>=e.pos?l[l.length-1].$to:l[0].$from;super(u,d,l),this.depth=n}get $to(){return this.ranges[this.ranges.length-1].$to}eq(t){return t instanceof e&&t.$from.pos===this.$from.pos&&t.$to.pos===this.$to.pos}map(t,n){return new e(t.resolve(n.map(this.anchor)),t.resolve(n.map(this.head)))}toJSON(){return{type:`nodeRange`,anchor:this.anchor,head:this.head}}get isForwards(){return this.head>=this.anchor}get isBackwards(){return!this.isForwards}extendBackwards(){let{doc:t}=this.$from;if(this.isForwards&&this.ranges.length>1){let t=this.ranges.slice(0,-1),n=t[0].$from,r=t[t.length-1].$to;return new e(n,r,this.depth)}let n=this.ranges[0],r=t.resolve(Math.max(0,n.$from.pos-1));return new e(this.$anchor,r,this.depth)}extendForwards(){let{doc:t}=this.$from;if(this.isBackwards&&this.ranges.length>1){let t=this.ranges.slice(1),n=t[0].$from,r=t[t.length-1].$to;return new e(r,n,this.depth)}let n=this.ranges[this.ranges.length-1],r=t.resolve(Math.min(t.content.size,n.$to.pos+1));return new e(this.$anchor,r,this.depth)}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n,r,i=1){return new this(e.resolve(t),e.resolve(n),r,i)}getBookmark(){return new HO(this.anchor,this.head)}};UO.prototype.visible=!1;function WO(e){return e instanceof UO}tt.create({name:`nodeRange`,addOptions(){return{depth:void 0,key:`Mod`}},addKeyboardShortcuts(){return{"Shift-ArrowUp":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,selection:a,tr:o}=r,{anchor:s,head:c}=a;if(!WO(a)){let e=UO.create(i,s,c,t,-1);return o.setSelection(e),n.dispatch(o),!0}let l=a.extendBackwards();return o.setSelection(l),n.dispatch(o),!0},"Shift-ArrowDown":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,selection:a,tr:o}=r,{anchor:s,head:c}=a;if(!WO(a)){let e=UO.create(i,s,c,t);return o.setSelection(e),n.dispatch(o),!0}let l=a.extendForwards();return o.setSelection(l),n.dispatch(o),!0},"Mod-a":({editor:e})=>{let{depth:t}=this.options,{view:n,state:r}=e,{doc:i,tr:a}=r,o=UO.create(i,0,i.content.size,t);return a.setSelection(o),n.dispatch(a),!0}}},onSelectionUpdate(){let{selection:e}=this.editor.state;WO(e)&&this.editor.view.dom.classList.add(`ProseMirror-noderangeselection`)},addProseMirrorPlugins(){let e=!1,t=!1;return[new ar({key:new Nn(`nodeRange`),props:{attributes:()=>e?{class:`ProseMirror-noderangeselection`}:{class:``},handleDOMEvents:{mousedown:(e,n)=>{let{key:r}=this.options,i=/Mac/.test(navigator.platform),a=!!n.shiftKey,o=!!n.ctrlKey,s=!!n.altKey,c=!!n.metaKey;return(r==null||r===`Shift`&&a||r===`Control`&&o||r===`Alt`&&s||r===`Meta`&&c||r===`Mod`&&(i?c:o))&&(t=!0),t&&document.addEventListener(`mouseup`,()=>{t=!1;let{state:n}=e,{doc:r,selection:i,tr:a}=n,{$anchor:o,$head:s}=i;if(o.sameParent(s))return;let c=UO.create(r,o.pos,s.pos,this.options.depth);a.setSelection(c),e.dispatch(a)},{once:!0}),!1}},decorations:n=>{let{selection:r}=n,i=WO(r);if(e=!1,!t)return i?(e=!0,zO(r.ranges)):null;let{$from:a,$to:o}=r;if(!i&&a.sameParent(o))return null;let s=VO(a,o,this.options.depth);return s.length?(e=!0,zO(s)):null}}})]}});function GO(e){let t=``,n=getComputedStyle(e);for(let e=0;e<n.length;e+=1)t+=`${n[e]}:${n.getPropertyValue(n[e])};`;return t}function KO(e){let t=e.cloneNode(!0),n=[e,...Array.from(e.getElementsByTagName(`*`))],r=[t,...Array.from(t.getElementsByTagName(`*`))];return n.forEach((e,t)=>{r[t].style.cssText=GO(e)}),t}var qO=[{id:`listItemFirstChild`,evaluate:({parent:e,isFirst:t})=>t&&e&&[`listItem`,`taskItem`].includes(e.type.name)?1e3:0},{id:`listWrapperDeprioritize`,evaluate:({node:e})=>{let t=[`listItem`,`taskItem`],n=e.firstChild;return n&&t.includes(n.type.name)?1e3:0}},{id:`tableStructure`,evaluate:({node:e,parent:t})=>[`tableRow`,`tableCell`,`tableHeader`].includes(e.type.name)||t&&t.type.name===`tableHeader`?1e3:0},{id:`inlineContent`,evaluate:({node:e})=>e.isInline||e.isText?1e3:0}],JO={edges:[`left`,`top`],threshold:12,strength:500};function YO(e){return e===void 0||e===`left`?{...JO}:e===`right`?{edges:[`right`,`top`],threshold:12,strength:500}:e===`both`?{edges:[`left`,`right`,`top`],threshold:12,strength:500}:e===`none`?{edges:[],threshold:0,strength:0}:{...JO,...e}}function XO(e,t,n){if(n.edges.length===0)return!1;let r=t.getBoundingClientRect(),{threshold:i,edges:a}=n;return a.some(t=>t===`left`?e.x-r.left<i:t===`right`?r.right-e.x<i:t===`top`?e.y-r.top<i:t===`bottom`?r.bottom-e.y<i:!1)}function ZO(e,t,n,r){return!t||n.edges.length===0?0:XO(e,t,n)?n.strength*r:0}var QO=1e3;function $O(e,t,n,r){let i=QO,a=!1;if(t.every(t=>{let n=t.evaluate(e);return i-=n,i<=0?(a=!0,!1):!0}),a)return-1;let o=e.view.nodeDOM(e.pos);return i-=ZO(r,o,n,e.depth),i<=0?-1:i}function ek(e,t,n){return Array.from({length:t},(e,n)=>t-1-n).some(t=>n.includes(e.node(t).type.name))}function tk(e,t,n){if(!Number.isFinite(t.x)||!Number.isFinite(t.y))return null;let r=e.posAtCoords({left:t.x,top:t.y});if(!r)return null;let{doc:i}=e.state,a=i.resolve(r.pos),o=[];n.defaultRules&&o.push(...qO),o.push(...n.rules);let s=Array.from({length:a.depth},(e,t)=>a.depth-t).map(r=>{let i=a.node(r),s=a.before(r);if(n.allowedContainers&&r>0&&!ek(a,r,n.allowedContainers))return null;let c=r>0?a.node(r-1):null,l=r>0?a.index(r-1):0,u=c?c.childCount:1,d=$O({node:i,pos:s,depth:r,parent:c,index:l,isFirst:l===0,isLast:l===u-1,$pos:a,view:e},o,n.edgeDetection,t);return d<0?null:{node:i,pos:s,depth:r,score:d,dom:e.nodeDOM(s)}}).filter(e=>e!==null),c=a.nodeAfter;if(c&&c.isAtom&&!c.isInline){let i=r.pos,l=a.depth+1,u=a.parent,d=a.index(),f=u.childCount,p=!0;if(n.allowedContainers&&(p=ek(a,l,n.allowedContainers)),p){let r=$O({node:c,pos:i,depth:l,parent:u,index:d,isFirst:d===0,isLast:d===f-1,$pos:a,view:e},o,n.edgeDetection,t);if(r>=0){let t=e.nodeDOM(i);t&&s.push({node:c,pos:i,depth:l,score:r,dom:t})}}}if(s.length===0)return null;s.sort((e,t)=>t.score===e.score?t.depth-e.depth:t.score-e.score);let l=s[0];return l.dom?{node:l.node,pos:l.pos,dom:l.dom}:null}function nk(e,t){let n=e;for(;n?.parentElement&&n.parentElement!==t.dom;)n=n.parentElement;return n?.parentElement===t.dom?n:void 0}function rk(e){return Number.isFinite(e.top)&&Number.isFinite(e.bottom)&&Number.isFinite(e.left)&&Number.isFinite(e.right)&&e.width>0&&e.height>0}function ik(e,t,n,r=5){if(!Number.isFinite(t)||!Number.isFinite(n))return null;let i=e.dom,a=i.firstElementChild,o=i.lastElementChild;if(!a||!o)return null;let s=a.getBoundingClientRect(),c=o.getBoundingClientRect();if(!rk(s)||!rk(c))return null;let l=Math.min(Math.max(s.top+r,n),c.bottom-r),u=.5,d=Math.abs(s.left-c.left)<u,f=Math.abs(s.right-c.right)<u,p=s;d&&f&&(p=s);let m=Math.min(Math.max(p.left+r,t),p.right-r);return!Number.isFinite(m)||!Number.isFinite(l)?null:{x:m,y:l}}var ak=e=>{let{x:t,y:n,editor:r,nestedOptions:i}=e,{view:a,state:o}=r,s=ik(a,t,n,5);if(!s)return{resultElement:null,resultNode:null,pos:null};let{x:c,y:l}=s;if(i?.enabled){let e=tk(a,{x:c,y:l},i);return e?{resultElement:e.dom,resultNode:e.node,pos:e.pos}:{resultElement:null,resultNode:null,pos:null}}let u=a.root.elementsFromPoint(c,l),d;if(Array.prototype.some.call(u,e=>{if(!a.dom.contains(e))return!1;let t=nk(e,a);return t?(d=t,!0):!1}),!d){let e=a.posAtCoords({left:c,top:l});if(e){let t=o.doc.resolve(e.pos),n=Math.min(t.depth,1),r=n>0?t.before(n):t.pos,i=o.doc.nodeAt(r);if(i){let e=a.nodeDOM(r);return{resultElement:e instanceof HTMLElement?e:null,resultNode:i,pos:r}}}return{resultElement:null,resultNode:null,pos:null}}let f;try{f=a.posAtDOM(d,0)}catch{return{resultElement:null,resultNode:null,pos:null}}let p=o.doc.nodeAt(f);if(!p){let e=o.doc.resolve(f),t=e.parent;return{resultElement:d,resultNode:t,pos:e.start()}}return{resultElement:d,resultNode:p,pos:f}};function ok(e,t){let n=null,r=e.nodeDOM(t);if(r instanceof Element)n=r;else{let{node:r,offset:i}=e.domAtPos(t),a=r.childNodes[i];a instanceof Element?n=a:r instanceof Element?n=r:r.nodeType===Node.TEXT_NODE&&r.parentElement&&(n=r.parentElement)}return(n?getComputedStyle(n).direction:getComputedStyle(e.dom).direction)||`ltr`}function sk(e){var t;(t=e.parentNode)==null||t.removeChild(e)}function ck(e,t,n,r){let{doc:i}=t.view.state;if(n?.enabled&&r?.node&&r.pos>=0){let e=r.pos,t=r.pos+r.node.nodeSize;return[{$from:i.resolve(e),$to:i.resolve(t)}]}let a=ak({editor:t,x:e.clientX,y:e.clientY,direction:`right`,nestedOptions:n});if(!a.resultNode||a.pos===null)return[];let o=a.resultNode.isText||a.resultNode.isAtom?0:-1;return VO(i.resolve(a.pos),i.resolve(a.pos+a.resultNode.nodeSize+o),0,{extendOnBoundaryOverlap:!1})}function lk(e,t,n,r){let{view:i}=t;if(!e.dataTransfer)return;let{empty:a,$from:o,$to:s}=i.state.selection,c=ck(e,t,n,r),l=VO(o,s,0,{extendOnBoundaryOverlap:!1}),u=l.some(e=>c.find(t=>t.$from===e.$from&&t.$to===e.$to)),d=a||!u?c:l;if(!d.length)return;let{tr:f}=i.state,p=document.createElement(`div`),m=d[0].$from.pos,h=d[d.length-1].$to.pos;p.setAttribute(`dir`,ok(i,m));let g=n?.enabled&&r?.node,_,v;g?(_=i.state.doc.slice(m,h),v=Gn.create(i.state.doc,m)):(v=UO.create(i.state.doc,m,h),_=v.content()),d.forEach(e=>{let t=KO(i.nodeDOM(e.$from.pos));p.append(t)}),p.style.position=`absolute`,p.style.top=`-10000px`,p.style.contentVisibility=`visible`,document.body.append(p);for(let e of p.querySelectorAll(`*`))e.style&&e.style.contentVisibility===`auto`&&(e.style.contentVisibility=`visible`);e.dataTransfer.clearData();let y=p.getBoundingClientRect(),b=i.nodeDOM(m),x=b&&b.nodeType===1?b.getBoundingClientRect():null,S=x?Math.min(e.clientX-x.left,y.width):Math.max(0,Math.min(e.clientX-y.left,y.width)),C=x?Math.min(Math.max(e.clientY-x.top,0),y.height):0;e.dataTransfer.setDragImage(p,S,C);let w=!1,T=()=>{w||(w=!0,sk(p),document.removeEventListener(`drop`,T),document.removeEventListener(`dragend`,T))},E=v instanceof Gn?v:void 0;i.dragging={slice:_,move:!0,node:E},f.setSelection(v),i.dispatch(f),document.addEventListener(`drop`,T),document.addEventListener(`dragend`,T)}var uk=(e,t)=>{let n=e.resolve(t),{depth:r}=n;return r===0?t:n.pos-n.parentOffset-1},dk=(e,t)=>{let n=e.nodeAt(t),r=e.resolve(t),{depth:i}=r,a=n;for(;i>0;){let e=r.node(i);--i,i===0&&(a=e)}return a},fk=(e,t)=>{let n=Zl.getState(e);return n?Bu(t,n.type,n.binding.mapping):null},pk=(e,t)=>{let n=Zl.getState(e);return n?Hu(n.doc,n.type,t,n.binding.mapping)||0:-1},mk=(e,t)=>{let n=t;for(;n?.parentNode&&n.parentNode!==e.dom;)n=n.parentNode;return n},hk=new Nn(`dragHandle`),gk=({pluginKey:e=hk,element:t,editor:n,computePositionConfig:r,getReferencedVirtualElement:i,onNodeChange:a,onElementDragStart:o,onElementDragEnd:s,nestedOptions:c})=>{let l=document.createElement(`div`),u=!1,d=null,f=-1,p,m=null,h=null;function g(){t&&(t.style.visibility=`hidden`,t.style.pointerEvents=`none`)}function _(){if(t){if(!n.isEditable){g();return}t.style.visibility=``,t.style.pointerEvents=`auto`}}function v(e){Le(i?.()||{getBoundingClientRect:()=>e.getBoundingClientRect()},t,r).then(e=>{Object.assign(t.style,{position:e.strategy,left:`${e.x}px`,top:`${e.y}px`})})}function y(e){o?.(e),lk(e,n,c,{node:d,pos:f}),t&&(t.dataset.dragging=`true`),setTimeout(()=>{t&&(t.style.pointerEvents=`none`)},0)}function b(e){s?.(e),g(),t&&(t.style.pointerEvents=`auto`,t.dataset.dragging=`false`)}function x(){if(tn()){let e=n.view.dom;requestAnimationFrame(()=>{e.isContentEditable&&(e.contentEditable=`false`,e.contentEditable=`true`)})}}return l.appendChild(t),{unbind(){t.removeEventListener(`dragstart`,y),t.removeEventListener(`dragend`,b),document.removeEventListener(`drop`,x),m&&(cancelAnimationFrame(m),m=null,h=null)},plugin:new ar({key:typeof e==`string`?new Nn(e):e,state:{init(){return{locked:!1}},apply(e,r,i,o){let s=e.getMeta(`lockDragHandle`),c=e.getMeta(`hideDragHandle`);if(s!==void 0&&(u=s),c)return g(),u=!1,d=null,f=-1,a?.({editor:n,node:null,pos:-1}),r;if(e.docChanged&&f!==-1&&t)if(MO(e)){let e=pk(o,p);e!==f&&(f=e)}else{let t=e.mapping.map(f);t!==f&&(f=t,p=fk(o,f))}return r}},view:e=>{var r;return t.draggable=!0,t.style.pointerEvents=`auto`,t.dataset.dragging=`false`,(r=n.view.dom.parentElement)==null||r.appendChild(l),l.style.pointerEvents=`none`,l.style.position=`absolute`,l.style.top=`0`,l.style.left=`0`,t.addEventListener(`dragstart`,y),t.addEventListener(`dragend`,b),document.addEventListener(`drop`,x),{update(r,i){if(!t)return;if(!n.isEditable){g();return}if(u?t.draggable=!1:t.draggable=!0,e.state.doc.eq(i.doc)||f===-1)return;let o=e.nodeDOM(f);if(o=mk(e,o),o===e.dom||o?.nodeType!==1)return;let s=e.posAtDOM(o,0),c=dk(n.state.doc,s),l=uk(n.state.doc,s);d=c,f=l,p=fk(e.state,f),a?.({editor:n,node:d,pos:f}),v(o)},destroy(){t.removeEventListener(`dragstart`,y),t.removeEventListener(`dragend`,b),document.removeEventListener(`drop`,x),m&&(cancelAnimationFrame(m),m=null,h=null),t&&sk(l)}}},props:{handleDOMEvents:{keydown(e){return!t||u?!1:e.hasFocus()?(g(),d=null,f=-1,a?.({editor:n,node:null,pos:-1}),!1):!1},mouseleave(e,t){return u||t.target&&!l.contains(t.relatedTarget)&&(g(),d=null,f=-1,a?.({editor:n,node:null,pos:-1})),!1},mousemove(e,r){return!t||u||(h={x:r.clientX,y:r.clientY},m)||(m=requestAnimationFrame(()=>{if(m=null,!h)return;let{x:t,y:r}=h;h=null;let i=ak({x:t,y:r,direction:`right`,editor:n,nestedOptions:c});if(!i.resultElement)return;let o=i.resultElement,s=i.resultNode,l=i.pos;if(!c?.enabled){if(o=mk(e,o),o===e.dom||o?.nodeType!==1)return;let t=e.posAtDOM(o,0);s=dk(n.state.doc,t),l=uk(n.state.doc,t)}s!==d&&(d=s,f=l??-1,p=fk(e.state,f),a?.({editor:n,node:d,pos:f}),v(o),_())})),!1}}}})}};function _k(e){return e===!1||e===void 0?{enabled:!1,rules:[],defaultRules:!0,allowedContainers:void 0,edgeDetection:YO(`none`)}:e===!0?{enabled:!0,rules:[],defaultRules:!0,allowedContainers:void 0,edgeDetection:YO(`left`)}:{enabled:!0,rules:e.rules??[],defaultRules:e.defaultRules??!0,allowedContainers:e.allowedContainers,edgeDetection:YO(e.edgeDetection)}}var vk={placement:`left-start`,strategy:`absolute`};tt.create({name:`dragHandle`,addOptions(){return{render(){let e=document.createElement(`div`);return e.classList.add(`drag-handle`),e},computePositionConfig:{},locked:!1,onNodeChange:()=>null,onElementDragStart:void 0,onElementDragEnd:void 0,nested:!1}},addCommands(){return{lockDragHandle:()=>({editor:e})=>(this.options.locked=!0,e.commands.setMeta(`lockDragHandle`,this.options.locked)),unlockDragHandle:()=>({editor:e})=>(this.options.locked=!1,e.commands.setMeta(`lockDragHandle`,this.options.locked)),toggleDragHandle:()=>({editor:e})=>(this.options.locked=!this.options.locked,e.commands.setMeta(`lockDragHandle`,this.options.locked))}},addProseMirrorPlugins(){let e=this.options.render(),t=_k(this.options.nested);return[gk({computePositionConfig:{...vk,...this.options.computePositionConfig},getReferencedVirtualElement:this.options.getReferencedVirtualElement,element:e,editor:this.editor,onNodeChange:this.options.onNodeChange,onElementDragStart:this.options.onElementDragStart,onElementDragEnd:this.options.onElementDragEnd,nestedOptions:t}).plugin]}});var yk=20,bk=44,xk=28;function Sk(e){if(!e)return`Select block`;if(e.type.name===`jsxComponent`){let t=e.attrs.componentName??``;if(t){let e=iy(t),n=e.name===`*`?t:e.displayName??e.name;if(n)return`Select ${n}`}}return`Select ${e.type.name}`}function Ck(){let e=document.createElement(`div`);e.className=`ok-block-controls`,e.setAttribute(Fg,`true`),e.style.visibility=`hidden`;let t=document.createElement(`button`);t.className=`ok-add-block-btn`,t.setAttribute(`aria-label`,`Add block below`),t.setAttribute(`type`,`button`),t.innerHTML=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-plus"><path d="M5 12h14"/><path d="M12 5v14"/></svg>`,t.addEventListener(`mousedown`,e=>{e.preventDefault(),e.stopPropagation()});let n=document.createElement(`button`);return n.className=`ok-drag-grip`,n.setAttribute(`type`,`button`),n.setAttribute(`aria-label`,`Select block`),n.setAttribute(`tabindex`,`-1`),n.innerHTML=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-grip-vertical-icon lucide-grip-vertical"><circle cx="9" cy="12" r="1"/><circle cx="9" cy="5" r="1"/><circle cx="9" cy="19" r="1"/><circle cx="15" cy="12" r="1"/><circle cx="15" cy="5" r="1"/><circle cx="15" cy="19" r="1"/></svg>`,e.appendChild(t),e.appendChild(n),{container:e,addBtn:t,grip:n}}function wk(e,t,n){let{state:r,view:i}=e;if(n.type.name===`jsxComponent`){let i=n.attrs.componentName??``;if(i){let a=iy(i);if(a.emptyChildName){let i=t+1+n.content.size;if(i>r.doc.content.size)return;let o=a.emptyChildName;e.chain().focus().insertContentAt(i,uy(o)).run(),my(e,i,iy(o));return}}}let a=t+n.nodeSize;if(a>r.doc.content.size)return;let{tr:o}=r,s=r.schema.nodes.paragraph?.create();if(!s)return;o.insert(a,s);let c=lr.near(o.doc.resolve(a+1));o.setSelection(c).scrollIntoView(),i.dispatch(o),i.focus(),e.commands.insertContent(`/`)}var Tk=tt.create({name:`blockDragHandle`,addProseMirrorPlugins(){let e=this.editor,t=null,n=-1,{container:r,addBtn:i,grip:a}=Ck();return i.addEventListener(`click`,()=>{t&&n>=0&&wk(e,n,t)}),a.addEventListener(`click`,()=>{if(n<0)return;let r=t,i=r?.type.name??`unknown`;try{e.chain().focus().setNodeSelection(n).run()||(sr(i),console.warn(JSON.stringify({event:`block-grip-click-select-failed`,nodeType:i,componentName:String(r?.attrs.componentName??``).slice(0,200),reason:`chain-dispatch-returned-false`})))}catch(e){if(!(e instanceof RangeError))throw e;sr(i),console.warn(JSON.stringify({event:`block-grip-click-select-failed`,nodeType:i,componentName:String(r?.attrs.componentName??``).slice(0,200),reason:e.message.slice(0,500)}))}}),[gk({element:r,editor:e,onNodeChange({node:e,pos:r}){t=e,n=r??-1,a.setAttribute(`aria-label`,Sk(e))},computePositionConfig:{placement:`left-start`,strategy:`absolute`,middleware:[Re(({rects:e})=>({mainAxis:10,crossAxis:((e.reference.height<=bk?e.reference.height:xk)-yk)/2}))]},nestedOptions:_k(!1)}).plugin]}}),Ek=/^#fn(?:ref)?-/,Dk=tt.create({name:`footnoteAnchorScroll`,addProseMirrorPlugins(){return[new ar({props:{handleDOMEvents:{click(e,t){let n=t.target;if(!(n instanceof Element))return!1;let r=n.closest(`a[href^="#fn"]`);if(!(r instanceof HTMLAnchorElement))return!1;let i=r.getAttribute(`href`)??``;if(!Ek.test(i))return!1;let a=i.slice(1);t.preventDefault();let o=e.dom.ownerDocument.getElementById(a);return o&&o.scrollIntoView({behavior:`smooth`,block:`start`}),!0}}}})]}}),Ok=tt.create({name:`formattingShortcuts`,addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}}}),kk=tt.create({name:`headingAnchors`,addProseMirrorPlugins(){return[new ar({props:{decorations(e){let t=[],n=new Map;return e.doc.descendants((e,r)=>{if(e.type.name===`heading`){let i=cn(e.textContent,n);if(!i)return;t.push(Rt.node(r,r+e.nodeSize,{id:i}))}}),Je.create(e.doc,t)}}})]}});function Ak(e){let t=(0,$.c)(8),{node:n,editor:r}=e,i=n.attrs.src,a=n.attrs.alt,o=n.attrs.title,s;if(t[0]!==r||t[1]!==i){let e=r?re(r)??void 0:void 0;s=typeof i==`string`?_n(wt(i,e)):void 0,t[0]=r,t[1]=i,t[2]=s}else s=t[2];let c=s,l=typeof a==`string`?a:``,u=typeof o==`string`?o:void 0,d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d={sizes:void 0},t[3]=d):d=t[3];let f;return t[4]!==l||t[5]!==c||t[6]!==u?(f=(0,Z.jsx)(ie,{as:`span`,"data-image-inline-zoom":!0,"data-clipboard-inline-leaf":`image`,children:(0,Z.jsx)(Dg,{wrapElement:`span`,zoomMargin:20,zoomImg:d,children:(0,Z.jsx)(`img`,{src:c,alt:l,title:u})})}),t[4]=l,t[5]=c,t[6]=u,t[7]=f):f=t[7],f}var jk=Jt.extend({addNodeView(){return de(Ak)}});function Mk(e,t){let n=e;for(;n&&typeof n.hasAttribute==`function`;){if(n.hasAttribute(`data-wiki-embed`)){let e=n.getAttribute(`data-target`)??``;if(!e)return null;let r=ir(e,t);return r?{kind:n.tagName===`IMG`?`image`:`asset`,relPath:r,title:r.split(`/`).pop()??e}:null}if(n.hasAttribute(`data-wiki-link`)){let e=n.getAttribute(`data-target`)??``;return e?{kind:`wiki-link`,relPath:`${e}.md`,title:e}:null}if(n.tagName===`A`&&n.hasAttribute(`href`)){let e=zn(n.getAttribute(`href`)??``,t);if(e?.kind===`asset`){let n=ir(e.url,t);return n?{kind:`asset`,relPath:n,title:n.split(`/`).pop()??e.url}:null}}if(n.tagName===`IMG`){let e=n.getAttribute(`src`)??``;if(e){let n=zn(e,t);if(n?.kind===`asset`){let e=ir(n.url,t);return e?{kind:`image`,relPath:e,title:e.split(`/`).pop()??n.url}:null}}}n=n.parentElement}return null}var Nk=new Nn(`asset-context-menu`);function Pk(e){return new ar({key:Nk,view(t){let n=e.showAssetMenu??(e=>{let t=globalThis.window?.okDesktop;return t?t.shell.showAssetMenu({relPath:e.relPath,title:e.title,kind:e.kind}):Promise.resolve()}),r=t=>{if(!(t.target instanceof Element))return;let r=Mk(t.target,e.sourceDocName);r&&(t.preventDefault(),n(r))};return t.dom.addEventListener(`contextmenu`,r),{destroy(){t.dom.removeEventListener(`contextmenu`,r)}}}})}var Fk=e=>{let t=(0,$.c)(18),{kind:n,ariaLabel:r,onDeactivate:i,children:a,triggerReference:o,layout:s,className:c,"data-slot":l}=e,d=s===void 0?`standard`:s,p=(0,Q.useRef)(null),m,h;t[0]===o?(m=t[1],h=t[2]):(m=()=>{let e=p.current;if(e)return ze(o,e,()=>{let t=o.getBoundingClientRect();e.isConnected&&(e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.style.width=`${t.width}px`,e.style.height=`${t.height}px`)})},h=[o],t[0]=o,t[1]=m,t[2]=h),(0,Q.useLayoutEffect)(m,h);let _;t[3]===i?_=t[4]:(_=e=>{e||i()},t[3]=i,t[4]=_);let y;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(f,{asChild:!0,children:(0,Z.jsx)(`span`,{ref:p,"aria-hidden":`true`,style:{position:`fixed`,pointerEvents:`none`,left:`-9999px`,top:`-9999px`,width:0,height:0}})}),t[5]=y):y=t[5];let b=d===`wide`?`w-[min(720px,calc(100%-1rem))]`:`w-80`,x;t[6]!==c||t[7]!==b?(x=v(`ok-interaction-prop-panel pointer-events-auto p-3`,b,c),t[6]=c,t[7]=b,t[8]=x):x=t[8];let S;t[9]!==r||t[10]!==a||t[11]!==l||t[12]!==n||t[13]!==x?(S=(0,Z.jsx)(u,{side:`bottom`,align:`start`,sideOffset:8,collisionPadding:8,"aria-label":r,"data-ok-prop-panel":n,"data-ok-declines-keyboard":``,"data-slot":l,onOpenAutoFocus:Ik,onCloseAutoFocus:Lk,onPointerDownOutside:Rk,onFocusOutside:zk,onInteractOutside:Bk,className:x,children:a}),t[9]=r,t[10]=a,t[11]=l,t[12]=n,t[13]=x,t[14]=S):S=t[14];let C;return t[15]!==_||t[16]!==S?(C=(0,Z.jsxs)(g,{open:!0,onOpenChange:_,children:[y,S]}),t[15]=_,t[16]=S,t[17]=C):C=t[17],C};function Ik(e){return e.preventDefault()}function Lk(e){return e.preventDefault()}function Rk(e){e.target?.closest(`[data-ok-layer-spawned]`)&&e.preventDefault()}function zk(e){e.target?.closest(`[data-ok-layer-spawned]`)&&e.preventDefault()}function Bk(e){e.target?.closest(`[data-ok-layer-spawned]`)&&e.preventDefault()}function Vk(e){let t=e.trim();return/\.(md|mdx)$/i.test(t)?t:`${t}.md`}function Hk(e){let t=e.initialDir.trim().replace(/^\/+|\/+$/g,``),n=Vk(e.suggestedName);return t?`${t}/${n}`:n}async function Uk(e){let t=await gl(await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})}),`Failed to create page`);if(!t.ok)throw Error(t.title);let n=e.replace(/\.(mdx|md)$/i,``);return{docName:_l(yr,t.body,`create-page`,{docName:n}).docName}}async function Wk(e){return Uk(Hk(e))}async function Gk(e,t){let{docName:n}=await Wk(e);return t.addPage(n),sa([`files`,`backlinks`,`graph`]),t.onCreated?.(n),{docName:n}}var Kk=8;function qk(e){return e.trim().replace(/^\/+/,``).replace(/\.mdx?$/i,``).replace(/\/+$/g,``)}function Jk(e){return e.startsWith(`/`)&&!e.startsWith(`//`)}function Yk(e){return e.split(`/`).at(-1)??e}function Xk(e){return e.split(`/`)[0]?.startsWith(`.`)??!1}function Zk(e,t){if(!t)return 0;let n=e.toLowerCase(),r=Yk(e).toLowerCase();return n===t?0:r===t?1:n.startsWith(t)?2:r.startsWith(t)?3:r.includes(t)?4:n.includes(t)?5:null}function Qk(e){switch(e){case`page`:return 0;case`folder`:return 1;case`asset`:return 2}}function $k(e){let t=[],n=new Set;function r(e,r){let i=qk(r);if(!i)return;let a=`${e}:${i.toLowerCase()}`;n.has(a)||(n.add(a),t.push({kind:e,path:i}))}for(let t of e.pages)r(`page`,t);for(let t of e.folderPaths??[])r(`folder`,t);if(e.includeAssets)for(let t of e.assetPaths??[])r(`asset`,t);return t}function eA(e){let t=qk(e.value).toLowerCase(),n=t===``,r=[];for(let n of $k(e)){let e=Zk(n.path,t);e!==null&&r.push({suggestion:n,score:e})}return r.sort((e,t)=>{if(e.score!==t.score)return e.score-t.score;let r=Qk(e.suggestion.kind)-Qk(t.suggestion.kind);if(r!==0)return r;if(n){let n=!!Xk(e.suggestion.path)-+!!Xk(t.suggestion.path);if(n!==0)return n}return e.suggestion.path.localeCompare(t.suggestion.path)}),r.slice(0,e.limit??Kk).map(e=>e.suggestion)}var tA=`[data-ok-link-path-suggestion-panel]`;function nA(e){return e instanceof Element&&e.closest(tA)!==null}function rA(e){nA(e.target)&&e.preventDefault()}function iA(e){switch(e.kind){case`page`:return(0,Z.jsx)(fc,{className:`size-3.5`,docExt:`.md`,kind:`file`,path:e.path});case`folder`:return(0,Z.jsx)(fc,{className:`size-3.5`,kind:`folder`,path:e.path});case`asset`:return(0,Z.jsx)(fc,{bodyIndexed:!1,className:`size-3.5`,kind:`file`,path:e.path})}}function aA(e,t){if(e){if(typeof e==`function`){e(t);return}e.current=t}}function oA(e){let t=(0,$.c)(54),n,r,i,a,s,c,l,u,d,f,p,m,h,g;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14]):({value:g,pages:f,folderPaths:i,assetPaths:n,includeAssets:m,loading:h,onValueChange:d,onKeyDown:l,onSuggestionSelect:u,onFocus:c,onBlur:s,className:r,ref:p,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h,t[14]=g);let _=m===void 0?!1:m,b=h===void 0?!1:h,{_:x}=o(),[S,C]=(0,Q.useState)(!1),[w,T]=(0,Q.useState)(!1),[E,D]=(0,Q.useState)(0),O=(0,Q.useRef)(null),k=(0,Q.useRef)(null),A=(0,Q.useId)(),j,M,N;if(t[15]!==g){let e=g.trim();j=e===``,M=Jk(g),N=!On(e)&&!e.startsWith(`#`),t[15]=g,t[16]=j,t[17]=M,t[18]=N}else j=t[16],M=t[17],N=t[18];let P=j||N,F=P?eA({value:j?``:g,pages:f,folderPaths:i,assetPaths:n,includeAssets:_}):[],I=F.map(dA).join(`\0`),L=F.length>0,R=S&&!w&&P&&(L||b),z=R||S&&!w&&(j||M)&&!b&&!L,B=Math.min(E,Math.max(F.length-1,0)),V=L?`${A}-option-${B}`:void 0,H;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>{D(0)},t[19]=H):H=t[19],(0,Q.useEffect)(H,[I]);let U,ee;t[20]!==V||t[21]!==z?(U=()=>{!z||!V||document.getElementById(V)?.scrollIntoView?.({block:`nearest`})},ee=[V,z],t[20]=V,t[21]=z,t[22]=U,t[23]=ee):(U=t[22],ee=t[23]),(0,Q.useEffect)(U,ee);let te,W;t[24]===z?(te=t[25],W=t[26]):(te=()=>{if(!z)return;let e=O.current,t=k.current;if(!e||!t)return;let n=e,r=t,i=function(){Le(n,r,{placement:`bottom-start`,strategy:`fixed`,middleware:[Re(4),Fe({padding:8}),Be({padding:8}),Ie({padding:8,apply(e){let{availableHeight:t,availableWidth:n,elements:r}=e;Object.assign(r.floating.style,{width:`${Math.min(480,n)}px`,maxHeight:`${Math.min(208,Math.max(96,t))}px`})}})]}).then(e=>{let{x:t,y:n}=e;r.isConnected&&Object.assign(r.style,{left:`${t}px`,top:`${n}px`})}).catch(e=>{r.isConnected&&console.warn(`[LinkPathSuggestionInput] computePosition failed`,e)})},a=ze(n,r,i);return i(),a},W=[z],t[24]=z,t[25]=te,t[26]=W),(0,Q.useLayoutEffect)(te,W);let ne;t[27]===p?ne=t[28]:(ne=function(e){O.current=e,aA(p,e)},t[27]=p,t[28]=ne);let re=ne,ie=function(e){u?u(e):d(e.path),T(!0),requestAnimationFrame(()=>O.current?.focus())},ae=function(e){if(R&&L){if(e.key===`ArrowDown`){e.preventDefault(),D(e=>Math.min(e+1,F.length-1));return}if(e.key===`ArrowUp`){e.preventDefault(),D(uA);return}if(e.key===`Enter`){e.preventDefault();let t=F[B];t&&ie(t);return}if(e.key===`Escape`){e.preventDefault(),T(!0);return}}if(z&&e.key===`Escape`){e.preventDefault(),T(!0);return}l?.(e)},oe;t[29]===x?oe=t[30]:(oe=function(e){switch(e){case`page`:return x({id:`6WdDG7`});case`folder`:return x({id:`kNqMMd`});case`asset`:return x({id:`bUUVED`})}},t[29]=x,t[30]=oe);let se=oe,ce=z?(0,Z.jsx)(`div`,{ref:k,id:A,role:`listbox`,"aria-label":x({id:`mBltnd`}),"data-ok-layer-spawned":``,"data-ok-link-path-suggestion-panel":``,className:`fixed z-70 max-h-52 overflow-y-auto overscroll-y-contain rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md subtle-scrollbar pointer-events-auto`,onWheel:lA,onTouchMove:cA,children:L?F.map((e,t)=>{let n=t===B,r=se(e.kind);return(0,Z.jsxs)(y,{id:`${A}-option-${t}`,type:`button`,role:`option`,"aria-label":`/${e.path} ${r}`,"aria-selected":n,variant:`ghost`,className:v(`h-auto w-full justify-start gap-2 rounded-sm px-2 py-1.5 text-left font-normal`,n&&`bg-accent text-accent-foreground`),onMouseDown:sA,onClick:()=>ie(e),children:[iA(e),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,title:`/${e.path}`,children:[`/`,e.path]}),(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,children:r})]},`${e.kind}:${e.path}`)}):(0,Z.jsx)(`div`,{role:`status`,className:`px-2 py-1.5 text-muted-foreground text-sm`,children:x(b?{id:`sxTdZI`}:{id:`_QwkMu`})})}):null,le;t[31]===d?le=t[32]:(le=e=>{T(!1),d(e.target.value)},t[31]=d,t[32]=le);let G;t[33]===c?G=t[34]:(G=e=>{C(!0),c?.(e)},t[33]=c,t[34]=G);let K;t[35]===s?K=t[36]:(K=e=>{C(!1),s?.(e)},t[35]=s,t[36]=K);let q=z?A:void 0,ue;t[37]!==V||t[38]!==r||t[39]!==ae||t[40]!==a||t[41]!==re||t[42]!==z||t[43]!==le||t[44]!==G||t[45]!==K||t[46]!==q||t[47]!==g?(ue=(0,Z.jsx)(li,{...a,ref:re,value:g,onChange:le,onFocus:G,onBlur:K,onKeyDown:ae,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":z,"aria-controls":q,"aria-activedescendant":V,autoComplete:`off`,className:r}),t[37]=V,t[38]=r,t[39]=ae,t[40]=a,t[41]=re,t[42]=z,t[43]=le,t[44]=G,t[45]=K,t[46]=q,t[47]=g,t[48]=ue):ue=t[48];let de;t[49]===ce?de=t[50]:(de=ce&&(0,Ls.createPortal)(ce,document.body),t[49]=ce,t[50]=de);let fe;return t[51]!==ue||t[52]!==de?(fe=(0,Z.jsxs)(`div`,{className:`relative`,children:[ue,de]}),t[51]=ue,t[52]=de,t[53]=fe):fe=t[53],fe}function sA(e){return e.preventDefault()}function cA(e){e.stopPropagation()}function lA(e){e.stopPropagation()}function uA(e){return Math.max(e-1,0)}function dA(e){return`${e.kind}:${e.path}`}function fA(e){let t=(0,$.c)(15),{metadata:n}=e,r=n.faviconDataUri?.startsWith(`data:image/`)?n.faviconDataUri:null,i;t[0]===r?i=t[1]:(i=r?(0,Z.jsx)(`img`,{"data-slot":`external-link-preview-favicon`,src:r,alt:``,"aria-hidden":`true`,width:16,height:16,className:`size-4 shrink-0 rounded-sm`}):null,t[0]=r,t[1]=i);let a;t[2]===n.domain?a=t[3]:(a=(0,Z.jsx)(`span`,{"data-slot":`external-link-preview-domain`,className:`truncate text-xs font-medium text-muted-foreground`,children:n.domain}),t[2]=n.domain,t[3]=a);let o;t[4]!==i||t[5]!==a?(o=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6];let s;t[7]===n.title?s=t[8]:(s=n.title?(0,Z.jsx)(`div`,{"data-slot":`external-link-preview-title`,className:`mt-1 line-clamp-2 text-sm font-medium text-foreground`,children:n.title}):null,t[7]=n.title,t[8]=s);let c;t[9]===n.description?c=t[10]:(c=n.description?(0,Z.jsx)(`p`,{"data-slot":`external-link-preview-description`,className:`mt-1 line-clamp-3 text-xs text-muted-foreground`,children:n.description}):null,t[9]=n.description,t[10]=c);let l;return t[11]!==o||t[12]!==s||t[13]!==c?(l=(0,Z.jsxs)(`div`,{"data-slot":`external-link-preview-card`,className:`mt-2.5 border-t border-border/70 pt-2.5`,children:[o,s,c]}),t[11]=o,t[12]=s,t[13]=c,t[14]=l):l=t[14],l}var pA=6e4,mA=60*pA,hA=24*mA,gA=7*hA,_A=30*hA,vA=365*hA;function yA(e,t){let n=Date.parse(e);if(Number.isNaN(n))return null;let r=Math.max(0,t-n);return r<pA?Y._({id:`xOTzt5`}):r<mA?Y._({id:`zbymaY`,values:{0:Math.floor(r/pA)}}):r<hA?Y._({id:`optX0N`,values:{0:Math.floor(r/mA)}}):r<gA?Y._({id:`l1l8sj`,values:{0:Math.floor(r/hA)}}):r<_A?Y._({id:`xV5sXw`,values:{0:Math.floor(r/gA)}}):r<vA?Y._({id:`0NkNB5`,values:{0:Math.floor(r/_A)}}):Y._({id:`lY27jj`,values:{0:Math.floor(r/vA)}})}function bA(e){let t=(0,$.c)(22),{preview:n}=e,[r]=(0,Q.useState)(SA),i;t[0]!==r||t[1]!==n.lastEditedAt?(i=n.lastEditedAt?yA(n.lastEditedAt,r):null,t[0]=r,t[1]=n.lastEditedAt,t[2]=i):i=t[2];let o=i,s=n.tags!==void 0&&n.tags.length>0,c=o!==null||n.backlinkCount!==void 0,l;t[3]===n.title?l=t[4]:(l=(0,Z.jsx)(`div`,{"data-slot":`internal-doc-preview-title`,className:`truncate text-sm font-medium text-foreground`,children:n.title}),t[3]=n.title,t[4]=l);let u;t[5]===n.folderPath?u=t[6]:(u=n.folderPath?(0,Z.jsxs)(`div`,{"data-slot":`internal-doc-preview-folder`,className:`mt-0.5 flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,Z.jsx)($r,{className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`truncate`,children:n.folderPath})]}):null,t[5]=n.folderPath,t[6]=u);let d;t[7]!==s||t[8]!==n.tags?(d=s?(0,Z.jsx)(`div`,{"data-slot":`internal-doc-preview-tags`,className:`mt-1.5 flex flex-wrap gap-1`,children:n.tags?.map(xA)}):null,t[7]=s,t[8]=n.tags,t[9]=d):d=t[9];let f;t[10]===n.excerpt?f=t[11]:(f=n.excerpt===void 0?null:n.excerpt?(0,Z.jsx)(`p`,{"data-slot":`internal-doc-preview-excerpt`,className:`mt-1.5 line-clamp-3 text-xs text-muted-foreground`,children:n.excerpt}):(0,Z.jsx)(`p`,{"data-slot":`internal-doc-preview-empty`,className:`mt-1.5 text-xs italic text-muted-foreground/70`,children:(0,Z.jsx)(a,{id:`Rb1zMa`})}),t[10]=n.excerpt,t[11]=f);let p;t[12]!==o||t[13]!==c||t[14]!==n.backlinkCount?(p=c?(0,Z.jsxs)(`div`,{"data-slot":`internal-doc-preview-meta`,className:`mt-1.5 flex items-center gap-2.5 text-[11px] text-muted-foreground/80`,children:[o?(0,Z.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(Yo,{className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,Z.jsx)(a,{id:`Xisk4u`,values:{editedAgo:o}})]}):null,n.backlinkCount===void 0?null:(0,Z.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(ms,{className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,Z.jsx)(a,{id:`HjNrT0`,values:{0:n.backlinkCount}})]})]}):null,t[12]=o,t[13]=c,t[14]=n.backlinkCount,t[15]=p):p=t[15];let m;return t[16]!==l||t[17]!==u||t[18]!==d||t[19]!==f||t[20]!==p?(m=(0,Z.jsxs)(`div`,{"data-slot":`internal-doc-preview-card`,className:`mt-2.5 border-t border-border/70 pt-2.5`,children:[l,u,d,f,p]}),t[16]=l,t[17]=u,t[18]=d,t[19]=f,t[20]=p,t[21]=m):m=t[21],m}function xA(e){return(0,Z.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground`,children:e},e)}function SA(){return Date.now()}var CA=new Map,wA=new Map;async function TA(e,t){let n=await fetch(`/api/link-preview`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({url:e}),signal:t});if(!n.ok)return null;let r=nn.safeParse(await n.json());return!r.success||!r.data.ok?null:r.data.metadata}function EA(e,t){let n=CA.get(e);if(n)return CA.delete(e),CA.set(e,n),Promise.resolve(n);let r=wA.get(e);if(r)return r;let i=(async()=>{try{let n=await TA(e,t);if(n)for(CA.set(e,n);CA.size>128;){let e=CA.keys().next().value;if(e===void 0)break;CA.delete(e)}return n}catch(e){return(!(e instanceof Error)||e.name!==`AbortError`)&&console.warn(`[link-preview] external preview fetch failed:`,e instanceof Error?e.message:String(e)),null}finally{wA.delete(e)}})();return wA.set(e,i),i}function DA(e){let t=(0,$.c)(4),{url:n,enabled:r}=e,[i,a]=(0,Q.useState)(null),o,s;return t[0]!==r||t[1]!==n?(o=()=>{if(!r||!n)return;let e=new AbortController;return EA(n,e.signal).then(t=>{e.signal.aborted||!t||a({url:n,metadata:t})}),()=>e.abort()},s=[n,r],t[0]=r,t[1]=n,t[2]=o,t[3]=s):(o=t[2],s=t[3]),(0,Q.useEffect)(o,s),!r||!n?null:i?.url===n?i.metadata:null}var OA=3,kA=240,AA=400,jA=/^(#{1,6})\s+(.*)$/;function MA(e,t={}){let n=t.maxLines??OA,r=t.maxChars??kA,i=t.anchor?.trim()||null,{body:a}=Sn(e),o=a.split(`
38
- `).map(NA),s=((i?FA(o,i,n):null)??PA(o,n)).join(` `).replace(/\s+/g,` `).trim();return s.length<=r?s:`${s.slice(0,r).trimEnd()}…`}function NA(e){return e.endsWith(`\r`)?e.slice(0,-1):e}function PA(e,t){let n=Dt(),r=[],i=!1,a=Math.min(e.length,AA);for(let o=0;o<a&&r.length<t;o++){let t=e[o]??``;if(n(t))continue;if(jA.test(t)){if(i)break;continue}let a=LA(t);a&&(r.push(a),i=!0)}return r}function FA(e,t,n){let r=IA(e,t);if(!r)return null;let i=[],a=LA(e[r.index]??``);a&&i.push(a);let o=Dt();for(let t=0;t<=r.index;t++)o(e[t]??``);let s=Math.min(e.length,r.index+1+AA);for(let t=r.index+1;t<s&&i.length<n;t++){let n=e[t]??``;if(o(n))continue;let a=n.match(jA);if(a){if((a[1]??``).length<=r.level)break;continue}let s=LA(n);s&&i.push(s)}return i}function IA(e,t){let n=hr(t),r=Dt(),i=new Map,a=Math.min(e.length,AA);for(let o=0;o<a;o++){let a=e[o]??``;if(r(a))continue;let s=a.match(jA);if(!s)continue;let c=cn((s[2]??``).trim(),i);if(c&&(c===t||c===n))return{index:o,level:(s[1]??``).length}}return null}function LA(e){if(zA(e))return``;let t=e;return t=t.replace(/^\s*(?:>\s?)+/,``),t=t.replace(/^\s*(?:[-*+]\s+|\d+[.)]\s+|#{1,6}\s+)/,``),t=t.replace(/!\[\[[^\]]*\]\]/g,``),t=t.replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`),t=t.replace(/\[\[([^\]]+)\]\]/g,(e,t)=>RA(t)),t=t.replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`),t=t.replace(/\[([^\]]*)\]\[[^\]]*\]/g,`$1`),t=t.replace(/``([^`]+)``/g,`$1`),t=t.replace(/`([^`]+)`/g,`$1`),t=t.replace(/\*\*\*([^*]+)\*\*\*/g,`$1`),t=t.replace(/\*\*([^*]+)\*\*/g,`$1`),t=t.replace(/\*([^*]+)\*/g,`$1`),t=t.replace(/___([^_]+)___/g,`$1`),t=t.replace(/__([^_]+)__/g,`$1`),t=t.replace(/(^|[^A-Za-z0-9])_([^_]+)_(?![A-Za-z0-9])/g,`$1$2`),t=t.replace(/~~([^~]+)~~/g,`$1`),t=t.replace(/<((?:https?|mailto):[^>]+)>/g,`$1`),t=t.replace(/<\/?[A-Za-z][^>]*>/g,``),t=t.replace(/\\([\\`*_{}[\]()#+\-.!~>|])/g,`$1`),t.replace(/\s+/g,` `).trim()}function RA(e){let t=e.indexOf(`|`);if(t>=0){let n=e.slice(t+1).trim();if(n)return n}return((t>=0?e.slice(0,t):e).split(`#`)[0]??``).trim()}function zA(e){let t=e.trim();return t?!!(/^([-*_])(?:[ \t]*\1){2,}$/.test(t)||/^=+$/.test(t)):!1}function BA(e){let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):null}function VA(e){let{frontmatter:t}=Sn(e);return t?Xt(qn(t)):[]}function HA(e,t){return{tags:VA(e),excerpt:MA(e,{anchor:t})}}var UA=new Map,WA=new Map,GA=new Map,KA=new Map;async function qA(e){let t=await fetch(`/api/document?docName=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`document read failed: ${t.status}`);return Et.parse(await t.json()).content}async function JA(e){let t=await fetch(`/api/backlink-counts?docNames=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`backlink-counts failed: ${t.status}`);let{counts:n}=Xn.parse(await t.json());return n[e]??0}function YA(e){let t=UA.get(e);if(t!==void 0)return UA.delete(e),UA.set(e,t),Promise.resolve(t);let n=GA.get(e);if(n)return n;let r=(async()=>{try{let t=await qA(e);for(UA.set(e,t);UA.size>128;){let e=UA.keys().next().value;if(e===void 0)break;UA.delete(e)}return t}catch(e){return(!(e instanceof Error)||e.name!==`AbortError`)&&console.warn(`[link-preview] internal doc read failed:`,e instanceof Error?e.message:String(e)),null}finally{GA.delete(e)}})();return GA.set(e,r),r}function XA(e){let t=WA.get(e);if(t!==void 0)return WA.delete(e),WA.set(e,t),Promise.resolve(t);let n=KA.get(e);if(n)return n;let r=(async()=>{try{let t=await JA(e);for(WA.set(e,t);WA.size>128;){let e=WA.keys().next().value;if(e===void 0)break;WA.delete(e)}return t}catch(e){return(!(e instanceof Error)||e.name!==`AbortError`)&&console.warn(`[link-preview] backlink-count read failed:`,e instanceof Error?e.message:String(e)),null}finally{KA.delete(e)}})();return KA.set(e,r),r}function ZA(e){let t=(0,$.c)(21),{docName:n,anchor:r,enabled:i}=e,{pageTitles:a,pageMeta:o}=Jr(),[s,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(null),d,f;if(t[0]!==r||t[1]!==n||t[2]!==i?(d=()=>{if(!i||!n)return;let e=!1;return YA(n).then(t=>{e||t===null||c({docName:n,anchor:r,fields:HA(t,r)})}),XA(n).then(t=>{e||t===null||u({docName:n,count:t})}),()=>{e=!0}},f=[n,r,i],t[0]=r,t[1]=n,t[2]=i,t[3]=d,t[4]=f):(d=t[3],f=t[4]),(0,Q.useEffect)(d,f),!i||!n)return null;let p=s!==null&&s.docName===n&&s.anchor===r?s.fields:null,m=l!==null&&l.docName===n?l.count:null,h;t[5]!==n||t[6]!==a?(h=a.get(n)??n,t[5]=n,t[6]=a,t[7]=h):h=t[7];let g;t[8]===n?g=t[9]:(g=BA(n),t[8]=n,t[9]=g);let _;t[10]!==n||t[11]!==o?(_=o.get(n)?.modified??null,t[10]=n,t[11]=o,t[12]=_):_=t[12];let v=p?.tags,y=p?.excerpt,b=m??void 0,x;return t[13]!==n||t[14]!==h||t[15]!==g||t[16]!==_||t[17]!==v||t[18]!==y||t[19]!==b?(x={docName:n,title:h,folderPath:g,lastEditedAt:_,tags:v,excerpt:y,backlinkCount:b},t[13]=n,t[14]=h,t[15]=g,t[16]=_,t[17]=v,t[18]=y,t[19]=b,t[20]=x):x=t[20],x}function QA(e,t){return oh.getState(e)?.byId.get(t)??null}function $A(e){let{editor:t,layer:n,renderPropPanel:r,handlePrimary:i}=e;return{onRegister:e=>{n.register({type:e.markType,nodeId:e.id,controls:{propPanel:e=>r({editor:t,nodeId:e.nodeId,deactivate:e.deactivate})},handlePrimary:i?e=>i({editor:t,nodeId:e.nodeId,newTab:e.newTab}):void 0})},onDeregister:e=>{n.deregister(e)}}}function ej(e){let{editor:t,layer:n,markTypes:r,predicate:i,renderPropPanel:a,handlePrimary:o}=e,s=$A({editor:t,layer:n,renderPropPanel:a,handlePrimary:o});return fh({markTypes:[...r],predicate:i,onRegister:s.onRegister,onDeregister:s.onDeregister})}function tj(e){let t=Eh(e.editor);return ej({...e,layer:t})}function nj(e,t){let n=(0,$.c)(4),[r,i]=(0,Q.useState)(null),a,o;return n[0]!==e||n[1]!==t?(a=()=>{if(!t||!e){i(null);return}let n=!1;return i(null),he(e).then(e=>{n||i(e)}).catch(()=>{n||i([])}),()=>{n=!0}},o=[e,t],n[0]=e,n[1]=t,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,Q.useEffect)(a,o),r}function rj(e,t){let n=e.trim();return n?n.startsWith(`#`)?`anchor`:On(n)?`external`:`doc`:t}function ij(e){return e?.kind===`doc`?`doc`:e?.kind===`anchor`?`anchor`:`external`}function aj(e){let t=(0,$.c)(84),{open:n,href:r,text:i,pages:s,folderPaths:c,loading:l,onOpenChange:u,onSave:d}=e,[f,p]=(0,Q.useState)(``),[m,h]=(0,Q.useState)(``),[g,_]=(0,Q.useState)(``),[b,x]=(0,Q.useState)(`doc`),S=(0,Q.useId)(),C=(0,Q.useId)(),w=(0,Q.useId)(),T=(0,Q.useId)(),{_:E}=o(),D=(0,Q.useRef)(!1),O=(0,Q.useRef)(``),j,M;t[0]!==r||t[1]!==n||t[2]!==i?(j=()=>{if(!n){D.current=!1;return}if(D.current)return;D.current=!0,O.current=i,_(i);let e=J(r);if(x(ij(e)),e?.kind===`doc`){p(e.docName),h(e.anchor??``);return}if(e?.kind===`anchor`){p(`#${e.anchor}`),h(``);return}p(e?.kind===`external`?e.url:r),h(``)},M=[n,r,i],t[0]=r,t[1]=n,t[2]=i,t[3]=j,t[4]=M):(j=t[3],M=t[4]),(0,Q.useEffect)(j,M);let P,B,V;t[5]!==b||t[6]!==f||t[7]!==s?(P=vi(f),B=b===`doc`,V=B&&oe(P,s),t[5]=b,t[6]=f,t[7]=s,t[8]=P,t[9]=B,t[10]=V):(P=t[8],B=t[9],V=t[10]);let H=nj(P,V&&n),U=!!H?.length,ee;t[11]!==P||t[12]!==B||t[13]!==m||t[14]!==g||t[15]!==f||t[16]!==u||t[17]!==d?(ee=function(){let e=f.trim();e&&(d(B?xe(P,m.trim()||null):e,g,g.trim()!==O.current.trim()),u(!1))},t[11]=P,t[12]=B,t[13]=m,t[14]=g,t[15]=f,t[16]=u,t[17]=d,t[18]=ee):ee=t[18];let te=ee,W;t[19]===te?W=t[20]:(W=function(e){e.key===`Enter`&&(e.preventDefault(),te())},t[19]=te,t[20]=W);let ne=W,re;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(re=function(e){p(e.path),x(`doc`),h(``)},t[21]=re):re=t[21];let ie=re,ae;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,Z.jsx)(A,{children:(0,Z.jsx)(a,{id:`B11p-O`})}),t[22]=ae):ae=t[22];let se;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,Z.jsxs)(R,{children:[ae,(0,Z.jsx)(k,{children:(0,Z.jsx)(a,{id:`RobAKV`})})]}),t[23]=se):se=t[23];let ce;t[24]===B?ce=t[25]:(ce=B?(0,Z.jsx)(a,{id:`6WdDG7`}):(0,Z.jsx)(a,{id:`6vEr3W`}),t[24]=B,t[25]=ce);let le;t[26]!==ce||t[27]!==S?(le=(0,Z.jsx)(`label`,{className:`mb-1.5 inline-block text-sm font-medium`,htmlFor:S,children:ce}),t[26]=ce,t[27]=S,t[28]=le):le=t[28];let G;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(G=e=>{p(e),x(t=>rj(e,t))},t[29]=G):G=t[29];let K;t[30]===E?K=t[31]:(K=E({id:`Xl-UUg`}),t[30]=E,t[31]=K);let q;t[32]!==f||t[33]!==c||t[34]!==ne||t[35]!==l||t[36]!==s||t[37]!==K||t[38]!==S?(q=(0,Z.jsx)(oA,{id:S,value:f,pages:s,folderPaths:c,loading:l,onValueChange:G,onSuggestionSelect:ie,placeholder:K,autoFocus:!0,onKeyDown:ne}),t[32]=f,t[33]=c,t[34]=ne,t[35]=l,t[36]=s,t[37]=K,t[38]=S,t[39]=q):q=t[39];let ue;t[40]!==le||t[41]!==q?(ue=(0,Z.jsxs)(`div`,{children:[le,q]}),t[40]=le,t[41]=q,t[42]=ue):ue=t[42];let de;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,Z.jsx)(a,{id:`QqBQu1`,components:{0:(0,Z.jsx)(`span`,{className:`font-normal text-muted-foreground`})}}),t[43]=de):de=t[43];let fe;t[44]===w?fe=t[45]:(fe=(0,Z.jsx)(`label`,{className:`mb-1.5 inline-block text-sm font-medium`,htmlFor:w,children:de}),t[44]=w,t[45]=fe);let pe;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(pe=e=>_(e.target.value),t[46]=pe):pe=t[46];let me;t[47]===E?me=t[48]:(me=E({id:`yYR6za`}),t[47]=E,t[48]=me);let he;t[49]!==g||t[50]!==ne||t[51]!==w||t[52]!==me?(he=(0,Z.jsx)(li,{id:w,value:g,onChange:pe,placeholder:me,onKeyDown:ne}),t[49]=g,t[50]=ne,t[51]=w,t[52]=me,t[53]=he):he=t[53];let ge;t[54]!==fe||t[55]!==he?(ge=(0,Z.jsxs)(`div`,{children:[fe,he]}),t[54]=fe,t[55]=he,t[56]=ge):ge=t[56];let _e;t[57]!==E||t[58]!==C||t[59]!==B||t[60]!==m||t[61]!==ne||t[62]!==T||t[63]!==H||t[64]!==U?(_e=B?(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`label`,{className:`mb-1.5 inline-block text-sm font-medium`,htmlFor:C,children:(0,Z.jsx)(a,{id:`Tjc1pH`,components:{0:(0,Z.jsx)(`span`,{className:`font-normal text-muted-foreground`})}})}),(0,Z.jsx)(li,{id:C,value:m,onChange:e=>h(e.target.value),placeholder:E({id:`W-ntoW`}),onKeyDown:ne}),U?(0,Z.jsx)(`div`,{id:T,className:`mt-1.5 max-h-36 overflow-y-auto subtle-scrollbar rounded-md border border-border bg-muted/30`,children:H.map(e=>(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":m===e.slug,className:v(`flex w-full items-center gap-2 px-2 py-1 text-left text-sm hover:bg-accent hover:text-accent-foreground`,m===e.slug&&`bg-accent text-accent-foreground`),style:{paddingLeft:`${(e.level-1)*12+8}px`},onClick:()=>h(m===e.slug?``:e.slug),children:[(0,Z.jsxs)(`span`,{className:`w-7 shrink-0 font-mono text-[10px] text-muted-foreground`,children:[`H`,e.level]}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.text})]},`${e.slug}-${e.level}-${e.text}`))}):null]}):null,t[57]=E,t[58]=C,t[59]=B,t[60]=m,t[61]=ne,t[62]=T,t[63]=H,t[64]=U,t[65]=_e):_e=t[65];let ve;t[66]!==ue||t[67]!==ge||t[68]!==_e?(ve=(0,Z.jsxs)(F,{className:`space-y-6 pb-1`,children:[ue,ge,_e]}),t[66]=ue,t[67]=ge,t[68]=_e,t[69]=ve):ve=t[69];let ye;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,Z.jsx)(L,{asChild:!0,children:(0,Z.jsx)(y,{variant:`outline`,children:(0,Z.jsx)(a,{id:`dEgA5A`})})}),t[70]=ye):ye=t[70];let be;t[71]===f?be=t[72]:(be=f.trim(),t[71]=f,t[72]=be);let Se=!be,Ce;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,Z.jsx)(a,{id:`tfDRzk`}),t[73]=Ce):Ce=t[73];let we;t[74]!==te||t[75]!==Se?(we=(0,Z.jsxs)(I,{children:[ye,(0,Z.jsx)(y,{onClick:te,disabled:Se,children:Ce})]}),t[74]=te,t[75]=Se,t[76]=we):we=t[76];let Te;t[77]!==ve||t[78]!==we?(Te=(0,Z.jsxs)(N,{className:`sm:max-w-xl`,"data-ok-layer-spawned":``,onPointerDownOutside:rA,onFocusOutside:rA,onInteractOutside:rA,children:[se,ve,we]}),t[77]=ve,t[78]=we,t[79]=Te):Te=t[79];let Ee;return t[80]!==u||t[81]!==n||t[82]!==Te?(Ee=(0,Z.jsx)(z,{open:n,onOpenChange:u,children:Te}),t[80]=u,t[81]=n,t[82]=Te,t[83]=Ee):Ee=t[83],Ee}function oj(e){let t=(0,$.c)(105),{editor:n,nodeId:r,sourceDocName:i,onClose:s,onNavigate:c}=e,l=QA(n.state,r),u=l?.attrs?.href??``,[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(!1),g;t[0]!==r||t[1]!==p?(g=()=>{ah(r)&&p(!0)},t[0]=r,t[1]=p,t[2]=g):g=t[2];let _;t[3]===r?_=t[4]:(_=[r],t[3]=r,t[4]=_),(0,Q.useEffect)(g,_);let{addPage:b,folderPaths:x,pages:S,loading:E}=Jr(),{_:D}=o(),O=u?zn(u,i):null,k=O?.kind===`doc`?G(O.docName,{pages:S,folderPaths:x}):null,A=ZA({docName:O?.kind===`doc`&&k?.kind===`navigate`&&k.displayState===`resolved`?O.docName:null,anchor:O?.kind===`doc`?O.anchor:null,enabled:!0}),{projectLocalConfig:j}=Oo(),M=DA({url:O?.kind===`external`?O.url:null,enabled:j?.linkPreviews?.enabled??!1});if(!l)return null;let N=n.state.doc.textBetween(l.from,l.to),P;t[5]!==n||t[6]!==r?(P=function(e,t,i){let a=QA(n.state,r);if(!a)return;let o=t.trim();if(!i||!o){n.chain().setTextSelection({from:a.from,to:a.to}).extendMarkRange(`link`).updateAttributes(`link`,{href:e}).run();return}let s=n.schema.marks.link;if(!s)return;let c=s.create({href:e}),l=n.schema.text(o,[c]);n.view.dispatch(n.state.tr.replaceWith(a.from,a.to,l))},t[5]=n,t[6]=r,t[7]=P):P=t[7];let F=P,I;t[8]!==n||t[9]!==r||t[10]!==s?(I=function(){let e=QA(n.state,r);e&&(n.chain().focus().setTextSelection({from:e.from,to:e.to}).extendMarkRange(`link`).unsetLink().run(),s())},t[8]=n,t[9]=r,t[10]=s,t[11]=I):I=t[11];let L=I,R;t[12]!==n||t[13]!==r||t[14]!==s||t[15]!==p?(R=function(e){if(e){p(!0);return}let t=QA(n.state,r);if(t?.attrs?.href??``){p(!1);return}t&&n.chain().focus().deleteRange({from:t.from,to:t.to}).run(),s()},t[12]=n,t[13]=r,t[14]=s,t[15]=p,t[16]=R):R=t[16];let z=(0,Z.jsx)(aj,{open:f,href:u,text:N,pages:S,folderPaths:x,loading:E,onOpenChange:u?p:R,onSave:F});if(!u)return(0,Z.jsx)(Z.Fragment,{children:z});let B=O?.kind===`doc`?`${O.docName}${O.anchor?`#${O.anchor}`:``}`:O?.kind===`anchor`?`#${O.anchor}`:O?.kind===`external`?O.url:u,V=function(e){let t=QA(n.state,r);t&&n.chain().setTextSelection({from:t.from,to:t.to}).extendMarkRange(`link`).updateAttributes(`link`,{href:xe(e,O?.kind===`doc`?O.anchor??null:null)}).run()},H,U=!1,ee=!1,te=null;if(E){let e;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(ni,{className:`size-3.5 shrink-0 animate-spin`,"aria-hidden":`true`}),t[17]=e):e=t[17],H={icon:e,text:D({id:`yQE2r9`}),className:`text-muted-foreground/80`}}else if(O?.kind===`asset`){let e;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(rs,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[18]=e):e=t[18],H={icon:e,text:D({id:`yWWThY`}),className:`text-muted-foreground`}}else if(O?.kind===`external`){let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Yr,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[19]=e):e=t[19],H={icon:e,text:D({id:`zgSFyG`}),className:`text-muted-foreground`}}else if(O?.kind===`anchor`){let e;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(rs,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[20]=e):e=t[20],H={icon:e,text:D({id:`dprWmL`}),className:`text-muted-foreground`}}else if(O?.kind===`doc`)if(ee=k?.kind===`navigate`&&k.displayState===`folder`,U=k?.kind===`create`,te=k?.kind===`create`?{initialDir:k.initialDir,suggestedName:k.suggestedName}:null,ee){let e;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)($r,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[21]=e):e=t[21],H={icon:e,text:D({id:`kNqMMd`}),className:`text-muted-foreground`}}else if(U){let e;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Kr,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[22]=e):e=t[22],H={icon:e,text:D({id:`8F1i42`}),className:`text-red-700 dark:text-red-300`}}else{let e;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(rs,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[23]=e):e=t[23],H={icon:e,text:D({id:`JtD-Br`}),className:`text-muted-foreground`}}else{let e;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Kr,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[24]=e):e=t[24],H={icon:e,text:D({id:`-g6KIS`}),className:`text-muted-foreground/80`}}let W=O?.kind===`external`,ne=O?.kind===`doc`?Ne({docName:O.docName,anchor:O.anchor}):O?.kind===`anchor`?Ne({docName:i,anchor:O.anchor}):O?.kind===`external`&&Vo(O.url)?O.url:null,re=!E&&ne!==null&&(O?.kind===`anchor`||O?.kind===`external`||O?.kind===`doc`&&!U&&!ee),ie;t[25]!==n.state||t[26]!==n.view||t[27]!==r?(ie=()=>{let e=QA(n.state,r);if(!e)return new DOMRect;try{return gt(n.view,e.from,e.to)}catch{return new DOMRect}},t[25]=n.state,t[26]=n.view,t[27]=r,t[28]=ie):ie=t[28];let ae;t[29]!==n.view.dom||t[30]!==ie?(ae={getBoundingClientRect:ie,contextElement:n.view.dom},t[29]=n.view.dom,t[30]=ie,t[31]=ae):ae=t[31];let oe=ae,se;t[32]!==D||t[33]!==b||t[34]!==m||t[35]!==te||t[36]!==s||t[37]!==V?(se=async function(){if(!(!te||m)){h(!0);try{await Gk(te,{addPage:b,onCreated(e){V(e),window.location.hash=`#/${e}`,s()}}),h(!1)}catch(e){let t=e;ci.error(t instanceof Error?t.message:D({id:`tfi40B`})),h(!1)}}},t[32]=D,t[33]=b,t[34]=m,t[35]=te,t[36]=s,t[37]=V,t[38]=se):se=t[38];let ce=se,le=v(`flex shrink-0`,H.className),K;t[39]!==H.icon||t[40]!==le?(K=(0,Z.jsx)(`span`,{className:le,children:H.icon}),t[39]=H.icon,t[40]=le,t[41]=K):K=t[41];let q=K,ue;t[42]!==q||t[43]!==U||t[44]!==H.text?(ue=U?(0,Z.jsxs)(T,{children:[(0,Z.jsx)(C,{asChild:!0,children:(0,Z.jsx)(`span`,{className:`flex shrink-0`,"data-slot":`internal-link-prop-panel-icon-trigger`,children:q})}),(0,Z.jsx)(w,{children:H.text})]}):q,t[42]=q,t[43]=U,t[44]=H.text,t[45]=ue):ue=t[45];let de=ue,fe=`${H.text}: ${B}`,pe;t[46]!==B||t[47]!==W||t[48]!==U||t[49]!==ne||t[50]!==re||t[51]!==s||t[52]!==c?(pe=(0,Z.jsx)(C,{asChild:!0,children:re?(0,Z.jsx)(`a`,{href:ne??void 0,...W?{target:`_blank`,rel:`noopener noreferrer`}:{},onClick:e=>_e(e,c,s),"data-slot":`internal-link-prop-panel-text`,className:`block truncate text-sm font-medium text-foreground underline-offset-2 hover:underline focus-visible:underline`,children:B}):(0,Z.jsx)(`span`,{"data-slot":`internal-link-prop-panel-text`,className:v(`block truncate text-sm font-medium`,U?`text-muted-foreground`:`text-foreground`),children:B})}),t[46]=B,t[47]=W,t[48]=U,t[49]=ne,t[50]=re,t[51]=s,t[52]=c,t[53]=pe):pe=t[53];let me;t[54]===B?me=t[55]:(me=(0,Z.jsx)(w,{className:`max-w-80 break-all`,children:B}),t[54]=B,t[55]=me);let he;t[56]!==pe||t[57]!==me?(he=(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Z.jsxs)(T,{children:[pe,me]})}),t[56]=pe,t[57]=me,t[58]=he):he=t[58];let ge;t[59]!==ce||t[60]!==m||t[61]!==U?(ge=U?(0,Z.jsxs)(y,{type:`button`,size:`sm`,variant:`link`,disabled:m,onClick:()=>void ce(),"data-slot":`internal-link-prop-panel-create`,className:`flex items-center text-foreground`,children:[(0,Z.jsx)(d,{className:`size-3.5`,"aria-hidden":`true`}),m?(0,Z.jsx)(a,{id:`HM56Bx`}):(0,Z.jsx)(a,{id:`XRuL0i`})]}):null,t[59]=ce,t[60]=m,t[61]=U,t[62]=ge):ge=t[62];let J;t[63]===D?J=t[64]:(J=D({id:`ePK91l`}),t[63]=D,t[64]=J);let ve;t[65]===p?ve=t[66]:(ve=()=>p(!0),t[65]=p,t[66]=ve);let ye;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,Z.jsx)(Ss,{className:`size-3.5`,"aria-hidden":`true`}),t[67]=ye):ye=t[67];let be;t[68]!==J||t[69]!==ve?(be=(0,Z.jsx)(C,{asChild:!0,children:(0,Z.jsx)(y,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":J,onClick:ve,"data-slot":`internal-link-prop-panel-edit`,children:ye})}),t[68]=J,t[69]=ve,t[70]=be):be=t[70];let Se;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,Z.jsx)(w,{children:(0,Z.jsx)(a,{id:`ePK91l`})}),t[71]=Se):Se=t[71];let Ce;t[72]===be?Ce=t[73]:(Ce=(0,Z.jsxs)(T,{children:[be,Se]}),t[72]=be,t[73]=Ce);let we;t[74]===u?we=t[75]:(we=(0,Z.jsx)(qr,{copyContent:u}),t[74]=u,t[75]=we);let Te;t[76]===D?Te=t[77]:(Te=D({id:`t_YqKh`}),t[76]=D,t[77]=Te);let Ee;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,Z.jsx)(ai,{className:`size-3.5`,"aria-hidden":`true`}),t[78]=Ee):Ee=t[78];let De;t[79]!==L||t[80]!==Te?(De=(0,Z.jsx)(C,{asChild:!0,children:(0,Z.jsx)(y,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":Te,onClick:L,"data-slot":`internal-link-prop-panel-remove`,children:Ee})}),t[79]=L,t[80]=Te,t[81]=De):De=t[81];let Oe;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,Z.jsx)(w,{children:(0,Z.jsx)(a,{id:`t_YqKh`})}),t[82]=Oe):Oe=t[82];let ke;t[83]===De?ke=t[84]:(ke=(0,Z.jsxs)(T,{children:[De,Oe]}),t[83]=De,t[84]=ke);let Ae;t[85]!==ge||t[86]!==Ce||t[87]!==we||t[88]!==ke?(Ae=(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[ge,Ce,we,ke]}),t[85]=ge,t[86]=Ce,t[87]=we,t[88]=ke,t[89]=Ae):Ae=t[89];let je;t[90]!==de||t[91]!==he||t[92]!==Ae?(je=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[de,he,Ae]}),t[90]=de,t[91]=he,t[92]=Ae,t[93]=je):je=t[93];let Me;t[94]===A?Me=t[95]:(Me=A?(0,Z.jsx)(bA,{preview:A}):null,t[94]=A,t[95]=Me);let Pe;t[96]===M?Pe=t[97]:(Pe=M?(0,Z.jsx)(fA,{metadata:M}):null,t[96]=M,t[97]=Pe);let Fe;return t[98]!==s||t[99]!==fe||t[100]!==je||t[101]!==Me||t[102]!==Pe||t[103]!==oe?(Fe=(0,Z.jsxs)(Fk,{kind:`internal-link`,ariaLabel:fe,onDeactivate:s,triggerReference:oe,className:`w-96`,children:[je,Me,Pe]}),t[98]=s,t[99]=fe,t[100]=je,t[101]=Me,t[102]=Pe,t[103]=oe,t[104]=Fe):Fe=t[104],(0,Z.jsxs)(Z.Fragment,{children:[z,Fe]})}new Nn(`markIdentityDecoration`);var sj=`data-mark-id`,cj=new Nn(`linkResolutionDecoration`);function lj(e,t,n,r,i){if(t.size===0)return null;let a=[];for(let e of t.values()){if(!n.has(e.markType))continue;let t=r(e,i),o={[sj]:e.id};t!==null&&Object.assign(o,t),a.push(Rt.inline(e.from,e.to,o))}return a.length===0?null:Je.create(e,a)}function uj(e){let t=new Set(e.markTypes),{computeAttrs:n}=e;return new ar({key:cj,state:{init:()=>({version:0}),apply(e,t){let n=e.getMeta(cj);return n&&typeof n==`object`&&n.refresh?{version:t.version+1}:t}},props:{decorations(e){let r=oh.getState(e);if(!r)return null;let i=Ci();return lj(e.doc,r.byId,t,n,i)}},view(e){X(`ok/render/decoration-merge`,{markTypes:Array.from(t).join(`,`)},{startTime:performance.now(),duration:0});let n=ta(()=>{e.dispatch(e.state.tr.setMeta(cj,{refresh:!0}))});return{destroy(){n()}}}})}var dj=mt.extend({addOptions(){return{...this.parent?.(),docName:``}},renderHTML({HTMLAttributes:e}){let t=typeof e.href==`string`?e.href:``;return[`span`,rr(e,{"data-link":``,role:`link`,tabindex:`0`,"aria-label":t?`Link: ${t}`:`Link`,style:`touch-action: manipulation;`}),0]},addProseMirrorPlugins(){let e=this.options.docName??``,t=({editor:t,nodeId:n,newTab:r})=>{let i=QA(t.state,n),a=i?.attrs?.href;if(typeof a!=`string`||!a)return!1;let o=i?.attrs?.sourceForm,s=zn(a,e),c=lt(a);if(s?.kind===`asset`||o===`wikiembed`&&c!==null){let t=s?.kind===`asset`?s.url:a,n=s?.kind===`asset`?s.ext:c??``,i=ir(t,e);if(!i)return!1;let o=Ci();return o===null||(o.assetPaths!==void 0||o.filePaths!==void 0)&&!me(t,e,o.assetPaths,o.filePaths)?!1:(we({url:t,projectRelPath:i,ext:n,title:i.split(`/`).pop()??t,newTab:r}),!0)}if(!s)return!1;switch(s.kind){case`doc`:{let e=Ci(),t=G(s.docName,{pages:e?.pages??new Set,folderPaths:e?.folderPaths??new Set});return t.kind===`create`||t.kind===`navigate`&&t.displayState===`folder`?!1:(r?je({docName:s.docName,anchor:s.anchor}):window.location.assign(Ne({docName:s.docName,anchor:s.anchor})),!0)}case`anchor`:return r?je({docName:e,anchor:s.anchor}):window.location.assign(Ne({docName:e,anchor:s.anchor})),!0;case`external`:return Vo(s.url)?(Bo(s.url),!0):!1;default:return on(s)}};return[tj({editor:this.editor,markTypes:[`link`],renderPropPanel:({editor:n,nodeId:r,deactivate:i})=>(0,Q.createElement)(oj,{editor:n,nodeId:r,sourceDocName:e,onClose:i,onNavigate:e=>t({editor:n,nodeId:r,newTab:e})}),handlePrimary:t}),uj({markTypes:[`link`],computeAttrs:Me(e)}),Pk({sourceDocName:e})]}});function fj(e){let t=(0,$.c)(23),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({label:i,Icon:n,onClick:a,selected:s,className:r,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=s?`true`:void 0,l;t[7]===a?l=t[8]:(l=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())},t[7]=a,t[8]=l);let u;t[9]===r?u=t[10]:(u=v(`flex w-full items-center justify-center gap-2 rounded-md border border-dashed border-border bg-transparent px-3 py-2 text-center text-sm text-muted-foreground transition-colors hover:bg-muted/50 cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,r),t[9]=r,t[10]=u);let d;t[11]===n?d=t[12]:(d=(0,Z.jsx)(n,{size:16,"aria-hidden":`true`}),t[11]=n,t[12]=d);let f;t[13]===i?f=t[14]:(f=(0,Z.jsx)(`span`,{children:i}),t[13]=i,t[14]=f);let p;return t[15]!==a||t[16]!==o||t[17]!==c||t[18]!==l||t[19]!==u||t[20]!==d||t[21]!==f?(p=(0,Z.jsxs)(`div`,{...o,role:`button`,tabIndex:-1,contentEditable:!1,"data-descriptor-placeholder":``,"data-selected":c,onClick:a,onMouseDown:pj,onKeyDown:l,className:u,children:[d,f]}),t[15]=a,t[16]=o,t[17]=c,t[18]=l,t[19]=u,t[20]=d,t[21]=f,t[22]=p):p=t[22],p}function pj(e){e.preventDefault(),e.stopPropagation()}function mj(e){let t=e.trim();if(/^#[0-9a-fA-F]{6}$/.test(t))return t.toLowerCase();if(/^#[0-9a-fA-F]{3}$/.test(t)){let[,e,n,r]=t.match(/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/)??[];return`#${e}${e}${n}${n}${r}${r}`.toLowerCase()}return`#000000`}function hj(e){let t=(0,$.c)(42),{id:n,value:r,onChange:i,autoFocus:a}=e,{_:s}=o(),c=(0,Q.useRef)(null),l;t[0]===i?l=t[1]:(l=e=>i(e.target.value),t[0]=i,t[1]=l);let u=a?``:void 0,d=r?`pl-7`:void 0,f;t[2]===d?f=t[3]:(f=v(`h-7 text-sm`,d),t[2]=d,t[3]=f);let p;t[4]!==a||t[5]!==n||t[6]!==l||t[7]!==u||t[8]!==f||t[9]!==r?(p=(0,Z.jsx)(li,{id:n,type:`text`,value:r,placeholder:`#F05032 or rgb(240,80,50)`,onChange:l,autoFocus:a,"data-prop-autofocus":u,className:f,"data-color-picker-input":``}),t[4]=a,t[5]=n,t[6]=l,t[7]=u,t[8]=f,t[9]=r,t[10]=p):p=t[10];let m;t[11]===r?m=t[12]:(m=r&&(0,Z.jsx)(`span`,{style:{backgroundColor:r},className:`pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 rounded-sm border border-border`,"aria-hidden":`true`,"data-color-picker-swatch":``}),t[11]=r,t[12]=m);let h;t[13]!==p||t[14]!==m?(h=(0,Z.jsxs)(`div`,{className:`relative flex-1`,children:[p,m]}),t[13]=p,t[14]=m,t[15]=h):h=t[15];let g;t[16]===s?g=t[17]:(g=s({id:`TiPvBP`}),t[16]=s,t[17]=g);let _;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>c.current?.click(),t[18]=_):_=t[18];let b=r||`transparent`,x;t[19]===b?x=t[20]:(x=(0,Z.jsx)(`span`,{style:{backgroundColor:b},className:`size-3.5 rounded-sm border border-border`,"aria-hidden":`true`}),t[19]=b,t[20]=x);let S;t[21]!==x||t[22]!==g?(S=(0,Z.jsx)(y,{type:`button`,variant:`outline`,size:`xs`,"aria-label":g,"data-color-picker-trigger":``,className:`h-7 gap-1 px-2`,onClick:_,children:x}),t[21]=x,t[22]=g,t[23]=S):S=t[23];let C;t[24]===r?C=t[25]:(C=mj(r),t[24]=r,t[25]=C);let w;t[26]===i?w=t[27]:(w=e=>i(e.target.value),t[26]=i,t[27]=w);let T;t[28]!==C||t[29]!==w?(T=(0,Z.jsx)(`input`,{ref:c,type:`color`,value:C,onChange:w,tabIndex:-1,"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 size-7 opacity-0`,"data-color-picker-native":``}),t[28]=C,t[29]=w,t[30]=T):T=t[30];let E;t[31]!==S||t[32]!==T?(E=(0,Z.jsxs)(`div`,{className:`relative`,children:[S,T]}),t[31]=S,t[32]=T,t[33]=E):E=t[33];let D;t[34]!==s||t[35]!==i||t[36]!==r?(D=r&&(0,Z.jsx)(y,{type:`button`,variant:`ghost`,size:`xs`,"aria-label":s({id:`cb-0G0`}),"data-color-picker-clear":``,className:`h-7 px-1.5`,onClick:()=>i(``),children:(0,Z.jsx)($o,{className:`size-3`,"aria-hidden":`true`})}),t[34]=s,t[35]=i,t[36]=r,t[37]=D):D=t[37];let O;return t[38]!==E||t[39]!==D||t[40]!==h?(O=(0,Z.jsxs)(`div`,{className:`flex gap-1`,children:[h,E,D]}),t[38]=E,t[39]=D,t[40]=h,t[41]=O):O=t[41],O}function gj(e){let t=(0,$.c)(55),{id:n,value:r,onChange:i,autoFocus:s}=e,{_:c}=o(),[l,d]=(0,Q.useState)(!1),f;t[0]===r?f=t[1]:(f=jh(r),t[0]=r,t[1]=f);let p=f,m;t[2]===r?m=t[3]:(m=r.startsWith(`lucide:`)?r.slice(7):null,t[2]=r,t[3]=m);let _=m,b;t[4]===i?b=t[5]:(b=e=>i(e.target.value),t[4]=i,t[5]=b);let x=s?``:void 0,S=p?`pl-7`:void 0,C;t[6]===S?C=t[7]:(C=v(`h-7 text-sm`,S),t[6]=S,t[7]=C);let w;t[8]!==s||t[9]!==n||t[10]!==b||t[11]!==x||t[12]!==C||t[13]!==r?(w=(0,Z.jsx)(li,{id:n,type:`text`,value:r,placeholder:`lucide:Lightbulb or 📘`,onChange:b,autoFocus:s,"data-prop-autofocus":x,className:C,"data-icon-picker-input":``}),t[8]=s,t[9]=n,t[10]=b,t[11]=x,t[12]=C,t[13]=r,t[14]=w):w=t[14];let T;t[15]===p?T=t[16]:(T=p&&(0,Z.jsx)(p,{className:`pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`,"aria-hidden":`true`}),t[15]=p,t[16]=T);let E;t[17]!==w||t[18]!==T?(E=(0,Z.jsxs)(`div`,{className:`relative flex-1`,children:[w,T]}),t[17]=w,t[18]=T,t[19]=E):E=t[19];let D;t[20]===c?D=t[21]:(D=c({id:`jDhTLC`}),t[20]=c,t[21]=D);let O;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(Ur,{className:`size-3`,"aria-hidden":`true`}),t[22]=O):O=t[22];let k;t[23]!==l||t[24]!==D?(k=(0,Z.jsx)(h,{asChild:!0,children:(0,Z.jsx)(y,{type:`button`,variant:`outline`,size:`xs`,"aria-label":D,"aria-haspopup":`listbox`,"aria-expanded":l,"data-icon-picker-trigger":``,className:`h-7 gap-1 px-2`,children:O})}),t[23]=l,t[24]=D,t[25]=k):k=t[25];let A;t[26]===c?A=t[27]:(A=c({id:`DiZ3pq`}),t[26]=c,t[27]=A);let j;t[28]===c?j=t[29]:(j=c({id:`l_6JHD`}),t[28]=c,t[29]=j);let M;t[30]===j?M=t[31]:(M=(0,Z.jsx)(ul,{placeholder:j,className:`h-8 text-sm`}),t[30]=j,t[31]=M);let N;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Z.jsx)(fl,{children:(0,Z.jsx)(a,{id:`NmaGHf`})}),t[32]=N):N=t[32];let P;t[33]!==i||t[34]!==r.length?(P=r.length>0&&(0,Z.jsx)(pl,{children:(0,Z.jsxs)(ml,{value:`__clear__`,onSelect:()=>{i(``),d(!1)},className:`gap-2 text-muted-foreground`,"data-icon-picker-clear":``,children:[(0,Z.jsx)(si,{className:`size-3.5`,"aria-hidden":`true`}),`Clear icon`]})}),t[33]=i,t[34]=r.length,t[35]=P):P=t[35];let F;t[36]!==i||t[37]!==_?(F=Ah.map(e=>{let[t,n]=e,r=t===_;return(0,Z.jsx)(ml,{value:t,onSelect:()=>{i(`lucide:${t}`),d(!1)},title:t,"aria-label":t,"data-icon-picker-item":t,"data-icon-picker-selected":r?``:void 0,className:v(`flex aspect-square items-center justify-center rounded-md p-0`,r?`bg-foreground/10 text-foreground ring-1 ring-foreground/30`:`text-muted-foreground hover:bg-muted`),children:(0,Z.jsx)(n,{className:`size-4`,"aria-hidden":`true`})},t)}),t[36]=i,t[37]=_,t[38]=F):F=t[38];let I;t[39]===F?I=t[40]:(I=(0,Z.jsx)(pl,{heading:`Lucide`,children:(0,Z.jsx)(Xc.Group,{className:`[&_[cmdk-group-items]]:grid [&_[cmdk-group-items]]:grid-cols-6 [&_[cmdk-group-items]]:gap-1 [&_[cmdk-group-items]]:p-1`,children:F})}),t[39]=F,t[40]=I);let L;t[41]!==P||t[42]!==I?(L=(0,Z.jsxs)(dl,{className:`max-h-64`,children:[N,P,I]}),t[41]=P,t[42]=I,t[43]=L):L=t[43];let R;t[44]!==A||t[45]!==M||t[46]!==L?(R=(0,Z.jsx)(u,{align:`end`,className:`z-70 w-72 p-0`,onOpenAutoFocus:_j,children:(0,Z.jsxs)(cl,{label:A,children:[M,L]})}),t[44]=A,t[45]=M,t[46]=L,t[47]=R):R=t[47];let z;t[48]!==l||t[49]!==k||t[50]!==R?(z=(0,Z.jsxs)(g,{open:l,onOpenChange:d,children:[k,R]}),t[48]=l,t[49]=k,t[50]=R,t[51]=z):z=t[51];let B;return t[52]!==z||t[53]!==E?(B=(0,Z.jsxs)(`div`,{className:`flex gap-1`,children:[E,z]}),t[52]=z,t[53]=E,t[54]=B):B=t[54],B}function _j(e){return e.preventDefault()}function vj(e){let[t]=e.split(`/`);switch(t){case`image`:return`image`;case`video`:return`video`;case`audio`:return`audio`;case`application`:return e===`application/pdf`?`pdf`:null;case`text`:return`text`;default:return null}}function yj(e){if(e.length===1&&e[0]===`*/*`)return`all`;let t=new Set;for(let n of e){if(n===`*/*`)return`all`;let e=vj(n);e&&t.add(e)}return t}function bj(e){let t=e.lastIndexOf(`.`);return t<0||t<e.lastIndexOf(`/`)?``:e.slice(t+1).toLowerCase()}function xj(e,t){let n=yj(t),r=[];for(let t of e){if(n===`all`){r.push(t);continue}let e=Dr(bj(t));e&&n.has(e)&&r.push(t)}return r}var Sj=8,Cj=new Set,wj=null;function Tj(e){return{path:e,basename:e.split(`/`).pop()??e}}function Ej(e){let t=e.map(e=>e.path).join(``);return wj?.fingerprint===t||(wj={fingerprint:t,byPath:new Map(e.map(e=>[e.path,e])),itemsInOrder:e,corpus:Lt(e.map(e=>it({kind:`page`,path:e.path,title:e.basename})))}),wj}function Dj(e){let t=e.trim();return t.startsWith(`/`)?t.slice(1):t}function Oj(e,t){let n=Dj(t);return n?xn(e.corpus,n,{intent:`autocomplete`,limit:Sj}).map(t=>e.byPath.get(t.document.path)).filter(e=>!!e):e.itemsInOrder.slice(0,Sj)}function kj(e){let t=(0,$.c)(54),{value:n,onChange:r,accept:i,id:a,placeholder:s,autoFocus:c,ariaInvalid:l,ariaDescribedBy:d,dataPropAutofocus:p,className:m,onSubmit:h}=e,{_}=o(),y=Xr()?.assetPaths??Cj,b;t[0]!==i||t[1]!==y||t[2]!==n?(b=Oj(Ej(xj(y,i).map(Tj)),n),t[0]=i,t[1]=y,t[2]=n,t[3]=b):b=t[3];let x=b,[S,C]=(0,Q.useState)(!1),[w,T]=(0,Q.useState)(0),E,D;t[4]!==w||t[5]!==x.length?(E=()=>{w>=x.length&&T(0)},D=[w,x.length],t[4]=w,t[5]=x.length,t[6]=E,t[7]=D):(E=t[6],D=t[7]),(0,Q.useEffect)(E,D);let O=(0,Q.useId)(),k=(0,Q.useRef)(null),A=S&&x.length>0,j;t[8]===r?j=t[9]:(j=e=>{r(`/${e.path}`),C(!1),T(0),k.current?.focus()},t[8]=r,t[9]=j);let M=j,N;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>C(e),t[10]=N):N=t[10];let P=A?O:void 0,F=A&&x[w]?`${O}-opt-${w}`:void 0,I;t[11]===r?I=t[12]:(I=e=>{r(e.target.value),C(!0),T(0)},t[11]=r,t[12]=I);let L;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>{C(!0)},t[13]=L):L=t[13];let R;t[14]!==w||t[15]!==h||t[16]!==M||t[17]!==x||t[18]!==A?(R=e=>{if(e.key===`ArrowDown`){if(x.length===0)return;e.preventDefault(),C(!0),T(e=>(e+1)%x.length);return}if(e.key===`ArrowUp`){if(x.length===0)return;e.preventDefault(),C(!0),T(e=>(e-1+x.length)%x.length);return}if(e.key===`Enter`){if(A){let t=x[w];if(t){e.preventDefault(),M(t);return}}h&&(e.preventDefault(),h());return}if(e.key===`Escape`){if(!A)return;e.preventDefault(),e.stopPropagation(),C(!1);return}e.key===`Tab`&&C(!1)},t[14]=w,t[15]=h,t[16]=M,t[17]=x,t[18]=A,t[19]=R):R=t[19];let z;t[20]!==d||t[21]!==l||t[22]!==c||t[23]!==m||t[24]!==p||t[25]!==a||t[26]!==s||t[27]!==R||t[28]!==P||t[29]!==F||t[30]!==I||t[31]!==n||t[32]!==A?(z=(0,Z.jsx)(f,{asChild:!0,children:(0,Z.jsx)(li,{ref:k,id:a,type:`text`,value:n,placeholder:s,autoFocus:c,"data-prop-autofocus":p,"aria-invalid":l,"aria-describedby":d,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":A,"aria-controls":P,"aria-activedescendant":F,className:m,onChange:I,onClick:L,onKeyDown:R})}),t[20]=d,t[21]=l,t[22]=c,t[23]=m,t[24]=p,t[25]=a,t[26]=s,t[27]=R,t[28]=P,t[29]=F,t[30]=I,t[31]=n,t[32]=A,t[33]=z):z=t[33];let B;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>{let t=e.target;t instanceof Node&&k.current?.contains(t)&&e.preventDefault()},t[34]=B):B=t[34];let V;t[35]===_?V=t[36]:(V=_({id:`Xhm7gG`}),t[35]=_,t[36]=V);let H;if(t[37]!==w||t[38]!==O||t[39]!==M||t[40]!==x){let e;t[42]!==w||t[43]!==O||t[44]!==M?(e=(e,t)=>{let n=`${O}-opt-${t}`,r=t===w;return(0,Z.jsxs)(`button`,{id:n,type:`button`,role:`option`,"aria-selected":r,"data-testid":`src-autocomplete-option`,"data-highlighted":r?``:void 0,className:v(`flex w-full flex-col items-start gap-0.5 rounded-sm px-2 py-1 text-left text-xs`,`transition-colors`,r?`bg-accent text-accent-foreground`:`hover:bg-accent/50`),onMouseEnter:()=>T(t),onMouseDown:t=>{t.preventDefault(),M(e)},children:[(0,Z.jsx)(`span`,{className:`font-medium`,children:e.basename}),e.basename!==e.path&&(0,Z.jsx)(`span`,{className:`text-muted-foreground/70`,children:e.path})]},e.path)},t[42]=w,t[43]=O,t[44]=M,t[45]=e):e=t[45],H=x.map(e),t[37]=w,t[38]=O,t[39]=M,t[40]=x,t[41]=H}else H=t[41];let U;t[46]!==O||t[47]!==V||t[48]!==H?(U=(0,Z.jsx)(u,{align:`start`,sideOffset:4,className:`z-70 w-(--radix-popover-trigger-width) p-1`,"data-ok-declines-keyboard":``,onOpenAutoFocus:jj,onCloseAutoFocus:Aj,onInteractOutside:B,children:(0,Z.jsx)(`div`,{id:O,role:`listbox`,"aria-label":V,className:`flex flex-col gap-px`,children:H})}),t[46]=O,t[47]=V,t[48]=H,t[49]=U):U=t[49];let ee;return t[50]!==z||t[51]!==U||t[52]!==A?(ee=(0,Z.jsxs)(g,{open:A,onOpenChange:N,children:[z,U]}),t[50]=z,t[51]=U,t[52]=A,t[53]=ee):ee=t[53],ee}function Aj(e){e.preventDefault()}function jj(e){e.preventDefault()}function Mj(){if(typeof window>`u`)return null;let e=window.location.hash.match(/^#\/([^?#]+)/);return e?decodeURIComponent(e[1]):null}var Nj=`/api/upload`;async function Pj(e,t,n={}){let r=n.fetch??globalThis.fetch,i=e.size,a=n.docName===void 0?Mj():n.docName;if(!a)throw Error(`No document is open`);let o=new FormData;o.append(`file`,e),o.append(`parentDocName`,a);let s;try{s=await r(Nj,{method:`POST`,body:o})}catch(t){let n;try{n=await Dm({file:e,sizeAtDrop:i,error:t})}catch(e){console.error(`[uploadFile] upload failed, and diagnosing it failed too`,{docName:a,networkError:t,reportError:e})}throw n?(console.error(`[uploadFile] upload failed before reaching the server`,{...n.log,docName:a}),new Cm(n.message,n.kind)):Error(t instanceof Error?t.message:String(t))}let c;try{c=await s.json()}catch(e){throw new V(`Upload response is not JSON.`,{cause:e,status:s.status})}if(!s.ok){let e=Mn.safeParse(c);throw e.success?Error(e.data.title):new V(`Upload error response did not match ProblemDetails.`,{cause:e.error,status:s.status})}let l=dt.safeParse(c);if(!l.success)throw new V(`Upload success response did not match UploadAssetSuccess.`,{cause:l.error,status:s.status});let u=l.data.path??l.data.src;return{url:u.startsWith(`/`)?u:`/${u}`}}function Fj(e,t,n){return n<=0?Y._({id:`XXA1b_`,values:{componentLabel:e}}):Y._({id:`Qe47G0`,values:{componentLabel:e,childCount:n}})}function Ij(e){for(let t of e)if(t.type===`string`&&t.hidden!==!0&&t.advanced!==!0&&t.autoFocus===!0)return t.name;return null}function Lj(e){if(!e)return e;let t=e.replace(/[_-]+/g,` `).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1)}var Rj=new Set([`auto`,`inherit`,`initial`,`unset`]),zj=new Set([`px`,`%`,`rem`,`em`,`vh`,`vw`,`ch`,`ex`,`fr`]),Bj=/^(-?\d+(?:\.\d+)?)([a-z%]*)$/i;function Vj(e){let t=e.trim();if(!t)return{valid:!1,reason:`empty`};if(Rj.has(t.toLowerCase()))return{valid:!0};let n=t.match(Bj);if(!n)return{valid:!1,reason:`malformed-syntax`};let r=(n[2]??``).toLowerCase();return r===``||zj.has(r)?{valid:!0}:{valid:!1,reason:`unknown-unit`}}function Hj(e){if(e.valid)return null;switch(e.reason){case`empty`:return null;case`malformed-syntax`:return`Enter a number (e.g. 100), a number with a CSS unit (e.g. 100px, 50%, 26rem), or one of: auto, inherit, initial, unset.`;case`unknown-unit`:return`Unknown CSS unit. Use px, %, rem, em, vh, vw, ch, ex, or fr.`}}var Uj={video:wr,audio:fn,image:un},Wj={youtube:[`youtube.com`,`youtu.be`,`youtube-nocookie.com`],vimeo:[`vimeo.com`],loom:[`loom.com`]};function Gj(e){let t=e.toLowerCase();for(let e of Object.keys(Wj)){let n=Wj[e];for(let r of n)if(t===r||t.endsWith(`.${r}`))return e}return null}function Kj(e){let t=e.lastIndexOf(`/`),n=t>=0?e.slice(t+1):e,r=n.lastIndexOf(`.`);return r>0?n.slice(r+1).toLowerCase():``}var qj=`https://placeholder.invalid`;function Jj(e,t){let n=e.trim();if(n.length===0)return{valid:!0};let r,i=!0;try{r=new URL(n)}catch{try{r=new URL(n,qj),i=!1}catch{return{valid:!1,reason:`invalid-url`}}}if(t===`video`&&Zt(n)!==null||t===`video`&&Ft(n)||t===`video`&&Er(n))return{valid:!0};let a=i?Gj(r.hostname):null;if(a!==null)return{valid:!1,reason:`embed-provider`,provider:a};if(r.protocol===`data:`)return{valid:!1,reason:`data-uri`};let o=Kj(r.pathname),s=Uj[t];return o===``?i?{valid:!0}:{valid:!1,reason:`wrong-extension`,extension:``}:s.has(o)?{valid:!0}:{valid:!1,reason:`wrong-extension`,extension:o}}function Yj(e){if(e.length===0)return;let t=e[0]?.toLowerCase()??``;if(t.startsWith(`video/`))return`video`;if(t.startsWith(`audio/`))return`audio`;if(t.startsWith(`image/`))return`image`}function Xj(e){return`Direct ${e} file URL — ${Array.from(Uj[e]).map(e=>`.${e}`).join(`, `)}`}var Zj={youtube:`YouTube`,vimeo:`Vimeo`,loom:`Loom`};function Qj(e,t){if(e.valid)return``;if(e.reason===`invalid-url`)return`Not a valid URL.`;if(e.reason===`data-uri`)return`Data URIs are not supported for media fields. Use a hosted file URL.`;if(e.reason===`embed-provider`){let n=Zj[e.provider];return t===`video`?`Unrecognized ${n} URL. Paste a valid ${n} share or embed link, or a direct ${t} file URL.`:`${n} URLs are not direct ${t} files. Paste a direct ${t} file URL.`}let n=Array.from(Uj[t]).map(e=>`.${e}`).join(`, `);return e.extension===``?`Missing file extension. Accepts: ${n}.`:`Unsupported extension .${e.extension}. Accepts: ${n}.`}function $j(e){return`ok.propPanel.advanced.${e}`}function eM(e){try{return typeof localStorage>`u`?!1:localStorage.getItem($j(e))===`true`}catch{return!1}}function tM(e,t){try{if(typeof localStorage>`u`)return;localStorage.setItem($j(e),t?`true`:`false`)}catch{}}function nM(e,t){let n=0;for(let r of e){let e=t[r.name],i=`defaultValue`in r?r.defaultValue:void 0;e!==void 0&&e!==i&&(n+=1)}return n}async function rM(e,t,n){try{let{url:r}=await Pj(e,t);n(r)}catch(e){if(e instanceof Cm){ci.error(e.message);return}let t=e instanceof Error?e.message:String(e);ci.error(Y._({id:`02P3hL`,values:{message:t}}))}}function iM(e){let t=(0,$.c)(14),{descriptor:n,values:r,onChange:i,onDismiss:o}=e,s;t[0]===r?s=t[1]:(s=e=>!(`hidden`in e&&e.hidden)&&e.hideWhen?.(r)!==!0&&e.type!==`reactnode`,t[0]=r,t[1]=s);let c=n.props.filter(s),l=c.filter(oM),u=c.filter(aM),d=nM(u,r),f;t[2]===n.props?f=t[3]:(f=Ij(n.props),t[2]=n.props,t[3]=f);let p=f,m;t[4]===n.name?m=t[5]:(m=()=>eM(n.name),t[4]=n.name,t[5]=m);let[h,g]=(0,Q.useState)(m);if(c.length===0)return null;let _;t[6]!==p||t[7]!==i||t[8]!==o||t[9]!==r?(_=e=>(0,Z.jsx)(cM,{propDef:e,value:r[e.name],onChange:t=>i(e.name,t),onDismiss:o,isAutoFocused:e.name===p},e.name),t[6]=p,t[7]=i,t[8]=o,t[9]=r,t[10]=_):_=t[10];let v=l.map(_),y=u.length>0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`my-1 border-t border-border`}),(0,Z.jsxs)(O,{open:h,onOpenChange:e=>{g(e),tM(n.name,e)},children:[(0,Z.jsxs)(D,{"data-prop-panel-advanced-trigger":``,className:`group flex w-full items-center justify-between rounded px-1 py-1 text-xs text-muted-foreground hover:bg-muted hover:text-foreground uppercase font-mono`,children:[(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(Ur,{className:`size-3 transition-transform group-data-[state=closed]:-rotate-90`}),(0,Z.jsx)(a,{id:`sxkWRg`})]}),d>0&&(0,Z.jsx)(pa,{variant:`secondary`,"data-prop-panel-advanced-count":``,children:d})]}),(0,Z.jsx)(E,{className:`flex flex-col gap-4 pt-2`,children:u.map(e=>(0,Z.jsx)(cM,{propDef:e,value:r[e.name],onChange:t=>i(e.name,t),onDismiss:o,isAutoFocused:e.name===p},e.name))})]})]}),b;return t[11]!==v||t[12]!==y?(b=(0,Z.jsxs)(`div`,{"data-prop-panel":``,className:`flex flex-col gap-4 py-2 text-sm`,children:[v,y]}),t[11]=v,t[12]=y,t[13]=b):b=t[13],b}function aM(e){return`advanced`in e&&e.advanced}function oM(e){return!(`advanced`in e&&e.advanced)}function sM(e){throw Error(`PropPanel: unhandled PropDef type ${JSON.stringify(e)}`)}function cM(e){let t=(0,$.c)(165),{propDef:n,value:r,onChange:i,onDismiss:a,isAutoFocused:o}=e,s;t[0]===a?s=t[1]:(s=a?e=>{e.key===`Enter`&&(e.preventDefault(),a())}:void 0,t[0]=a,t[1]=s);let c=s;switch(n.type){case`reactnode`:return null;case`string`:{let e=`prop-${n.name}`,s=n.accept,l=s!==void 0&&s.length>0,u=!n.required&&n.defaultValue===void 0;if(n.language){let a=`${e}-label`,s;t[2]===n.name?s=t[3]:(s=Lj(n.name),t[2]=n.name,t[3]=s);let c;t[4]!==a||t[5]!==e||t[6]!==s?(c=(0,Z.jsx)(`label`,{id:a,htmlFor:e,className:`text-xs text-muted-foreground`,children:s}),t[4]=a,t[5]=e,t[6]=s,t[7]=c):c=t[7];let l=r??``,d;t[8]!==i||t[9]!==u?(d=e=>{if(e===``&&u){i(void 0);return}i(e)},t[8]=i,t[9]=u,t[10]=d):d=t[10];let f;t[11]!==o||t[12]!==a||t[13]!==n.language||t[14]!==e||t[15]!==l||t[16]!==d?(f=(0,Z.jsx)(ke,{id:e,ariaLabelledBy:a,value:l,language:n.language,onChange:d,autoFocus:o}),t[11]=o,t[12]=a,t[13]=n.language,t[14]=e,t[15]=l,t[16]=d,t[17]=f):f=t[17];let p;return t[18]!==c||t[19]!==f?(p=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[c,f]}),t[18]=c,t[19]=f,t[20]=p):p=t[20],p}if(n.iconPicker){let a=r??``,s;t[21]===n.name?s=t[22]:(s=Lj(n.name),t[21]=n.name,t[22]=s);let c;t[23]!==e||t[24]!==s?(c=(0,Z.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:s}),t[23]=e,t[24]=s,t[25]=c):c=t[25];let l;t[26]!==i||t[27]!==u?(l=e=>{if(e===``&&u){i(void 0);return}i(e)},t[26]=i,t[27]=u,t[28]=l):l=t[28];let d;t[29]!==a||t[30]!==o||t[31]!==e||t[32]!==l?(d=(0,Z.jsx)(gj,{id:e,value:a,onChange:l,autoFocus:o}),t[29]=a,t[30]=o,t[31]=e,t[32]=l,t[33]=d):d=t[33];let f;return t[34]!==c||t[35]!==d?(f=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[c,d]}),t[34]=c,t[35]=d,t[36]=f):f=t[36],f}if(n.colorPicker){let a=r??``,s;t[37]===n.name?s=t[38]:(s=Lj(n.name),t[37]=n.name,t[38]=s);let c;t[39]!==e||t[40]!==s?(c=(0,Z.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:s}),t[39]=e,t[40]=s,t[41]=c):c=t[41];let l;t[42]!==i||t[43]!==u?(l=e=>{if(e===``&&u){i(void 0);return}i(e)},t[42]=i,t[43]=u,t[44]=l):l=t[44];let d;t[45]!==a||t[46]!==o||t[47]!==e||t[48]!==l?(d=(0,Z.jsx)(hj,{id:e,value:a,onChange:l,autoFocus:o}),t[45]=a,t[46]=o,t[47]=e,t[48]=l,t[49]=d):d=t[49];let f;return t[50]!==c||t[51]!==d?(f=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[c,d]}),t[50]=c,t[51]=d,t[52]=f):f=t[52],f}if(n.cssLengthInput){let a=r??``,s;if(t[53]!==a){let e=Vj(a);s=e.valid?null:Hj(e),t[53]=a,t[54]=s}else s=t[54];let l=s,d;t[55]===n.name?d=t[56]:(d=Lj(n.name),t[55]=n.name,t[56]=d);let f;t[57]!==e||t[58]!==d?(f=(0,Z.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:d}),t[57]=e,t[58]=d,t[59]=f):f=t[59];let p;t[60]!==i||t[61]!==u?(p=e=>{let t=e.target.value;if(t===``&&u){i(void 0);return}i(t)},t[60]=i,t[61]=u,t[62]=p):p=t[62];let m=o?``:void 0,h=l===null?void 0:!0,g=l===null?void 0:`${e}-error`,_;t[63]!==a||t[64]!==c||t[65]!==o||t[66]!==e||t[67]!==p||t[68]!==m||t[69]!==h||t[70]!==g?(_=(0,Z.jsx)(li,{id:e,type:`text`,value:a,placeholder:`100px, 50%, 26rem, auto`,onChange:p,onKeyDown:c,autoFocus:o,"data-prop-autofocus":m,"aria-invalid":h,"aria-describedby":g,className:`h-7 text-sm`,"data-prop-css-length-input":``}),t[63]=a,t[64]=c,t[65]=o,t[66]=e,t[67]=p,t[68]=m,t[69]=h,t[70]=g,t[71]=_):_=t[71];let v;t[72]!==l||t[73]!==e?(v=l!==null&&(0,Z.jsx)(`p`,{id:`${e}-error`,"data-prop-css-length-error":``,className:`text-xs text-destructive`,"aria-live":`polite`,children:l}),t[72]=l,t[73]=e,t[74]=v):v=t[74];let y;return t[75]!==v||t[76]!==f||t[77]!==_?(y=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[f,_,v]}),t[75]=v,t[76]=f,t[77]=_,t[78]=y):y=t[78],y}let d,f,p;if(t[79]!==s||t[80]!==r){let e=s===void 0?void 0:Yj(s);d=r??``;let n=e===void 0?null:Jj(d,e);f=n!==null&&!n.valid&&e!==void 0&&d.trim().length>0?Qj(n,e):null,p=e===void 0?void 0:Xj(e),t[79]=s,t[80]=r,t[81]=d,t[82]=f,t[83]=p}else d=t[81],f=t[82],p=t[83];let m=p,h;t[84]===n.name?h=t[85]:(h=Lj(n.name),t[84]=n.name,t[85]=h);let g;t[86]!==e||t[87]!==h?(g=(0,Z.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:h}),t[86]=e,t[87]=h,t[88]=g):g=t[88];let _;t[89]!==s||t[90]!==d||t[91]!==c||t[92]!==o||t[93]!==f||t[94]!==m||t[95]!==i||t[96]!==a||t[97]!==e||t[98]!==u?(_=s===void 0?(0,Z.jsx)(li,{id:e,type:`text`,value:d,placeholder:m,onChange:e=>{let t=e.target.value;if(t===``&&u){i(void 0);return}i(t)},onKeyDown:c,autoFocus:o,"data-prop-autofocus":o?``:void 0,"aria-invalid":f===null?void 0:!0,"aria-describedby":f===null?void 0:`${e}-error`,className:`h-7 text-sm`}):(0,Z.jsx)(kj,{id:e,value:d,onChange:e=>{if(e===``&&u){i(void 0);return}i(e)},onSubmit:a,accept:s,placeholder:m,autoFocus:o,dataPropAutofocus:o?``:void 0,ariaInvalid:f===null?void 0:!0,ariaDescribedBy:f===null?void 0:`${e}-error`,className:`h-7 text-sm`}),t[89]=s,t[90]=d,t[91]=c,t[92]=o,t[93]=f,t[94]=m,t[95]=i,t[96]=a,t[97]=e,t[98]=u,t[99]=_):_=t[99];let v;t[100]!==s||t[101]!==i||t[102]!==l?(v=l&&(0,Z.jsx)(uM,{accept:s,onUploaded:e=>i(e)}),t[100]=s,t[101]=i,t[102]=l,t[103]=v):v=t[103];let y;t[104]!==_||t[105]!==v?(y=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[_,v]}),t[104]=_,t[105]=v,t[106]=y):y=t[106];let b;t[107]!==f||t[108]!==e?(b=f!==null&&(0,Z.jsx)(`p`,{id:`${e}-error`,"data-prop-media-error":``,className:`text-xs text-destructive`,"aria-live":`polite`,children:f}),t[107]=f,t[108]=e,t[109]=b):b=t[109];let x;return t[110]!==g||t[111]!==y||t[112]!==b?(x=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[g,y,b]}),t[110]=g,t[111]=y,t[112]=b,t[113]=x):x=t[113],x}case`boolean`:{let e=`prop-${n.name}`,a;t[114]===n.name?a=t[115]:(a=Lj(n.name),t[114]=n.name,t[115]=a);let o=a,s;t[116]!==e||t[117]!==o?(s=(0,Z.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:o}),t[116]=e,t[117]=o,t[118]=s):s=t[118];let c=!!r,l;t[119]===i?l=t[120]:(l=e=>i(e),t[119]=i,t[120]=l);let u;t[121]!==e||t[122]!==c||t[123]!==l?(u=(0,Z.jsx)(qe,{id:e,checked:c,onCheckedChange:l}),t[121]=e,t[122]=c,t[123]=l,t[124]=u):u=t[124];let d;return t[125]!==s||t[126]!==u?(d=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[s,u]}),t[125]=s,t[126]=u,t[127]=d):d=t[127],d}case`enum`:{let e=`prop-${n.name}`,a=r??n.enumValues[0]??``,o;t[128]===n.name?o=t[129]:(o=Lj(n.name),t[128]=n.name,t[129]=o);let s;t[130]!==e||t[131]!==o?(s=(0,Z.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:o}),t[130]=e,t[131]=o,t[132]=s):s=t[132];let c;t[133]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Ge,{}),t[133]=c):c=t[133];let l;t[134]===e?l=t[135]:(l=(0,Z.jsx)(We,{id:e,size:`sm`,children:c}),t[134]=e,t[135]=l);let u;t[136]===n.enumValues?u=t[137]:(u=n.enumValues.map(lM),t[136]=n.enumValues,t[137]=u);let d;t[138]===u?d=t[139]:(d=(0,Z.jsx)(Ue,{className:`z-70`,children:u}),t[138]=u,t[139]=d);let f;t[140]!==a||t[141]!==i||t[142]!==l||t[143]!==d?(f=(0,Z.jsxs)(Ke,{value:a,onValueChange:i,children:[l,d]}),t[140]=a,t[141]=i,t[142]=l,t[143]=d,t[144]=f):f=t[144];let p;return t[145]!==s||t[146]!==f?(p=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[s,f]}),t[145]=s,t[146]=f,t[147]=p):p=t[147],p}case`number`:{let e=`prop-${n.name}`,a;t[148]===n.name?a=t[149]:(a=Lj(n.name),t[148]=n.name,t[149]=a);let o;t[150]!==e||t[151]!==a?(o=(0,Z.jsx)(`label`,{htmlFor:e,className:`text-xs text-muted-foreground`,children:a}),t[150]=e,t[151]=a,t[152]=o):o=t[152];let s=r==null?``:String(r),l;t[153]===i?l=t[154]:(l=e=>{let t=e.target.value;if(t===``){i(void 0);return}if(t===`-`)return;let n=Number(t);Number.isNaN(n)||i(n)},t[153]=i,t[154]=l);let u;t[155]!==c||t[156]!==e||t[157]!==s||t[158]!==l?(u=(0,Z.jsx)(li,{id:e,type:`number`,inputMode:`numeric`,value:s,onChange:l,onKeyDown:c,className:`h-7 text-sm`}),t[155]=c,t[156]=e,t[157]=s,t[158]=l,t[159]=u):u=t[159];let d;return t[160]!==o||t[161]!==u?(d=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[o,u]}),t[160]=o,t[161]=u,t[162]=d):d=t[162],d}default:{let e;return t[163]===n?e=t[164]:(e=sM(n),t[163]=n,t[164]=e),e}}}function lM(e){return(0,Z.jsx)(He,{value:e,children:e},e)}function uM(e){let t=(0,$.c)(17),{accept:n,onUploaded:r}=e,[i,o]=(0,Q.useState)(!1),s=(0,Q.useRef)(null),c;t[0]===n?c=t[1]:(c=n.join(`,`),t[0]=n,t[1]=c);let l;t[2]!==n||t[3]!==r?(l=async e=>{let t=e.target.files?.[0];if(t){o(!0);try{await rM(t,n,r)}catch{}o(!1),s.current&&(s.current.value=``)}},t[2]=n,t[3]=r,t[4]=l):l=t[4];let u;t[5]!==c||t[6]!==l?(u=(0,Z.jsx)(`input`,{ref:s,type:`file`,accept:c,className:`hidden`,"data-prop-upload-input":``,onChange:l}),t[5]=c,t[6]=l,t[7]=u):u=t[7];let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>s.current?.click(),t[8]=d):d=t[8];let f;t[9]===i?f=t[10]:(f=i?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ni,{className:`size-3.5 animate-spin`,"aria-hidden":`true`}),(0,Z.jsx)(a,{id:`_eguJc`})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ps,{className:`size-3.5`,"aria-hidden":`true`}),(0,Z.jsx)(a,{id:`eJitUk`})]}),t[9]=i,t[10]=f);let p;t[11]!==f||t[12]!==i?(p=(0,Z.jsx)(y,{type:`button`,variant:`outline`,size:`sm`,disabled:i,"data-prop-upload-trigger":``,className:`h-7 w-full justify-center gap-1.5 px-2 text-xs`,onClick:d,children:f}),t[11]=f,t[12]=i,t[13]=p):p=t[13];let m;return t[14]!==u||t[15]!==p?(m=(0,Z.jsxs)(Z.Fragment,{children:[u,p]}),t[14]=u,t[15]=p,t[16]=m):m=t[16],m}var dM=new Set([`img`,`CommonMarkImage`,`video`,`audio`,`Pdf`,`File`]);function fM(e,t,n){if(!dM.has(e)||!n)return t;let r=t.src;if(typeof r!=`string`)return t;let i=wt(r,n);return i===r?t:{...t,src:i}}var pM=`selectionStatePlugin/origin`,mM=`selectionStatePlugin/refresh`,hM=new Nn(`selectionState`),gM=new Set,_M={selectedBlockId:null,ancestorChain:[],selectionOrigin:`programmatic`,isDragging:!1,rangeEncompassedBlockIds:gM};function vM(e){return hM.getState(e.state)??_M}function yM(e,t){let n=[],{$from:r}=t;for(let t=1;t<=r.depth;t++){let i=r.node(t);if(i.type.name!==`jsxComponent`)continue;let a=r.before(t);n.push(bM(e,i,a))}if(t instanceof Gn){let r=t.node;r.type.name===`jsxComponent`&&n.push(bM(e,r,t.from))}return n}function bM(e,t,n){let r=t.attrs.componentName??`unknown`;return{bridgeId:xM(e,n),componentName:r,pos:n}}function xM(e,t){return Zy.getState(e)?.posToId.get(t)??`pos-${t}`}function SM(e,t){if(t instanceof Gn)return gM;let{from:n,to:r}=t;if(n>=r)return gM;let i=Zy.getState(e)?.posToId;if(!i)return gM;let a=null;for(let[t,o]of i){if(t<n)continue;let i=e.doc.nodeAt(t);i&&(t+i.nodeSize>r||(a||=new Set,a.add(o)))}return a??gM}function CM(e,t,n={}){let r=yM(e,e.selection),i=r[r.length-1],a=SM(e,e.selection),o={selectedBlockId:i?.bridgeId??null,ancestorChain:r,selectionOrigin:n.origin??t.selectionOrigin,isDragging:n.isDragging??t.isDragging,rangeEncompassedBlockIds:a};return wM(t,o)?t:o}function wM(e,t){if(e===t)return!0;if(e.selectedBlockId!==t.selectedBlockId||e.selectionOrigin!==t.selectionOrigin||e.isDragging!==t.isDragging||e.ancestorChain.length!==t.ancestorChain.length)return!1;for(let n=0;n<e.ancestorChain.length;n++){let r=e.ancestorChain[n],i=t.ancestorChain[n];if(r.bridgeId!==i.bridgeId||r.componentName!==i.componentName||r.pos!==i.pos)return!1}if(e.rangeEncompassedBlockIds.size!==t.rangeEncompassedBlockIds.size)return!1;for(let n of e.rangeEncompassedBlockIds)if(!t.rangeEncompassedBlockIds.has(n))return!1;return!0}var TM=new WeakMap;function EM(e,t,n,r){let i=r?.isDragging??t.isDragging,a=!!e.getMeta(mM),o=e.selectionSet&&!a,s=e.getMeta(pM),c=o?r?.pendingOrigin??null:null,l=s??c??t.selectionOrigin;return o&&r&&(r.pendingOrigin=null),CM(n,t,{origin:l,isDragging:i})}var DM=tt.create({name:`selectionStatePlugin`,addProseMirrorPlugins(){let e=this.editor,t=new ar({key:hM,state:{init(e,t){return CM(t,_M)},apply(e,n,r,i){return EM(e,n,i,TM.get(t))}},props:{handleDOMEvents:{mousedown:()=>{let e=TM.get(t);return e&&(e.pendingOrigin=`pointer`),!1},pointerdown:()=>{let e=TM.get(t);return e&&(e.pendingOrigin=`pointer`),!1}},handleKeyDown:(e,n)=>{if(OM(n.key)){let e=TM.get(t);e&&(e.pendingOrigin=`keyboard`)}return!1}},view(n){TM.set(t,{pendingOrigin:null,isDragging:!1});let r=n.dom.parentElement??n.dom,i=()=>{let n=TM.get(t);n&&(n.isDragging=!0,kM(e))},a=()=>{let n=TM.get(t);n&&(n.isDragging=!1,kM(e))};return r.addEventListener(`dragstart`,i,!0),r.addEventListener(`dragend`,a,!0),r.addEventListener(`drop`,a,!0),{destroy:()=>{r.removeEventListener(`dragstart`,i,!0),r.removeEventListener(`dragend`,a,!0),r.removeEventListener(`drop`,a,!0),TM.delete(t)}}}});return[t]}});function OM(e){return e===`ArrowUp`||e===`ArrowDown`||e===`ArrowLeft`||e===`ArrowRight`||e===`Tab`||e===`Escape`||e===`Enter`||e===`Home`||e===`End`||e===`PageUp`||e===`PageDown`}function kM(e){queueMicrotask(()=>{if(!e.isDestroyed)try{let t=e.state.tr.setMeta(mM,!0);e.view.dispatch(t)}catch{}})}function AM(e){let t=(0,$.c)(5),n;t[0]===e?n=t[1]:(n=()=>e?vM(e):null,t[0]=e,t[1]=n);let[r,i]=(0,Q.useState)(n),a,o;return t[2]===e?(a=t[3],o=t[4]):(a=()=>{if(!e){i(null);return}i(vM(e));let t=()=>{i(vM(e))};return e.on(`transaction`,t),e.on(`selectionUpdate`,t),()=>{e.off(`transaction`,t),e.off(`selectionUpdate`,t)}},o=[e],t[2]=e,t[3]=a,t[4]=o),(0,Q.useEffect)(a,o),r}function jM(e,t){if(e.hasChildren)return!1;let n=Ij(e.props);return n===null?!1:t[n]===``}function MM(e){let t=e.placeholder?.label,n=`Add ${(e.displayName??e.name).toLowerCase()}`;return{label:t??n,Icon:Oh(e.placeholder?.icon??e.icon)}}var NM=new Set([`img`,`CommonMarkImage`,`Embed`,`video`]);function PM(e){if(!e.attrs.sourceDirty&&e.attrs.sourceRaw)return e.attrs.sourceRaw;let t=be(),n=e.type.schema.node(`doc`,null,[e]);return t.serialize(n.toJSON()).trim()}var FM=new Set(Wt.map(e=>`${e}:`)),IM=6e4,LM=10,RM=new Map;function zM(e,t){let n=t.toLowerCase();_r(n);let r=Date.now(),i=RM.get(n);if(!i||r-i.windowStart>=IM)RM.set(n,{windowStart:r,count:1});else if(i.count+=1,i.count>LM)return;typeof console<`u`&&typeof console.warn==`function`&&console.warn(JSON.stringify({event:`jsx-prop-dropped`,reason:e,prop:t}))}var BM=new Set([`href`,`src`,`action`,`formaction`,`poster`,`cite`,`data`,`manifest`,`background`,`ping`,`xlinkhref`,`xlinkactuate`,`xlinkrole`,`xlinkarcrole`,`xlinkshow`,`url`,`link`]),VM=new Set([`dangerouslysetinnerhtml`,`ref`,`key`,`defaultvalue`,`defaultchecked`,`__proto__`,`constructor`,`prototype`]),HM=1e4;function UM(e){let t=e.toLowerCase();return!!(VM.has(t)||t.length>=3&&t.startsWith(`on`))}function WM(e){return BM.has(e.toLowerCase())}function GM(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t||t.startsWith(`#`)||t.startsWith(`//`)||xr(t))return e;let n=t.indexOf(`:`),r=t.slice(0,n+1).toLowerCase();return FM.has(r)?e:`#`}function KM(e){if(e.length>HM)return``;let t=e.toLowerCase();return/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/.test(t)||/\bexpression\s*\(/.test(t)?``:e}function qM(e){if(e==null)return e;if(Array.isArray(e)){let t=!1,n=Array(e.length);for(let r=0;r<e.length;r++){let i=qM(e[r]);n[r]=i,i!==e[r]&&(t=!0)}return t?n:e}if(typeof e!=`object`)return e;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n=e,r=!1,i={};for(let[e,t]of Object.entries(n)){if(UM(e)){zM(`dangerous-prop-name-nested`,e),r=!0;continue}if(WM(e)&&typeof t==`string`){let n=GM(t);n!==t&&(r=!0),i[e]=n}else{let n=qM(t);n!==t&&(r=!0),i[e]=n}}return r?i:e}function JM(e){let t=!1,n={};for(let[r,i]of Object.entries(e)){if(UM(r)){zM(`dangerous-prop-name`,r),t=!0;continue}if(WM(r)){let e=GM(i);e!==i&&(t=!0),n[r]=e;continue}if(r===`style`){if(typeof i==`string`){let e=KM(i);e!==i&&(t=!0),n[r]=e}else t=!0;continue}let e=qM(i);e!==i&&(t=!0),n[r]=e}return t?n:e}function YM(e){let t=(0,$.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`jsx-component-error-fallback`,children:n}),t[0]=n,t[1]=r),r}function XM(e){let t=(0,$.c)(13),{children:n,resetKey:r,onError:i,descriptorName:a,rawComponentName:o}=e,s;t[0]===r?s=t[1]:(s=[r],t[0]=r,t[1]=s);let c;t[2]!==a||t[3]!==i||t[4]!==o?(c=(e,t)=>{let n=e instanceof Error?e:Error(String(e));console.warn(JSON.stringify({event:`jsx-render-failure`,component:a,rawComponentName:String(o??``).slice(0,200),error:String(n),stack:t.componentStack})),bn(a),i(n)},t[2]=a,t[3]=i,t[4]=o,t[5]=c):c=t[5];let l;t[6]===n?l=t[7]:(l=e=>(0,Z.jsx)(YM,{...e,children:n}),t[6]=n,t[7]=l);let u;return t[8]!==n||t[9]!==s||t[10]!==c||t[11]!==l?(u=(0,Z.jsx)(p,{resetKeys:s,onError:c,fallbackRender:l,children:n}),t[8]=n,t[9]=s,t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function ZM(e){if(typeof e!=`object`||!e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(ZM).join(`,`)}]`;let t=Object.entries(e);return t.sort(([e],[t])=>e<t?-1:+(e>t)),`{${t.map(([e,t])=>`${JSON.stringify(e)}:${ZM(t)}`).join(`,`)}}`}function QM(e,t){let n=e.props??{},r={};for(let[e,i]of Object.entries(n))t.has(e)||(r[e]=i);return JM(r)}function $M(e){return e.kind===`element`?e:null}var eN=3;function tN(e){let t=(0,$.c)(174),{node:n,editor:r,extension:i,getPos:s,selected:c}=e,{_:l}=o(),d=iy(n.attrs.componentName),[p,m]=(0,Q.useState)(null),[_,v]=(0,Q.useState)(!1),b=(0,Q.useRef)(!1),x=typeof s==`function`?s():void 0,S=_w(),C=!1,w=0,T=1;try{if(x!==void 0){let e=r.state.doc.resolve(x);e.depth>0&&e.parent.type.name===`jsxComponent`&&(C=!0,w=e.index(e.depth),T=e.parent.childCount)}}catch(e){let t=e;if(!(t instanceof RangeError))throw t}let E=C&&w>0,D=C&&w<T-1,O=AM(r),k=typeof x==`number`?xM(r.state,x):null,A=k!==null&&(O?.rangeEncompassedBlockIds.has(k)??!1),j;t[0]===O?.ancestorChain?j=t[1]:(j=O?.ancestorChain.at(-1)?.bridgeId??null,t[0]=O?.ancestorChain,t[1]=j);let M=k!==null&&j===k,N=c&&!A&&M,P=k!==null&&!M&&(O?.ancestorChain.some(e=>e.bridgeId===k)??!1),F=N&&O?O.selectionOrigin:void 0,I=N&&(O?.isDragging??!1),L=d.props.some(sN),R=n.attrs.props??{},z=L&&d.props.some(e=>e.type!==`string`||!e.required||`hidden`in e&&e.hidden?!1:!Object.hasOwn(R,e.name)),B=jM(d,R),V=B?MM(d):null,H=!d.hasChildren||!!d.isSelfClosing,ee=NM.has(d.name),W=d.name===`MermaidFence`?{propName:`chart`,language:`mermaid`}:d.name===`Math`||d.name===`DollarMath`||d.name===`MathFence`?{propName:`formula`,language:`latex`}:null,[ne,ae]=(0,Q.useState)(!1),oe=W!==null,se=W?R[W.propName]:void 0,ce=oe&&!L&&r.isEditable&&(typeof se!=`string`||se.trim()===``),le=ce?MM(d):null;(0,Q.useEffect)(()=>{c&&!b.current&&(L||oe)&&py(x)&&(L?v(!0):ae(!0)),b.current=c},[c,L,oe,x]);let G=QM(n.attrs,d.reactNodePropNames),K=d.surface===`compat`?d.translateProps(G):G,q=i.options.docName,ue=typeof q==`string`&&q?q:re(r),de=fM(d.name,K,ue),fe=`${d.name}::${ZM(G)}`,pe;t[2]!==s||t[3]!==n.content.size?(pe=()=>(typeof s==`function`?s()??0:0)+1+n.content.size,t[2]=s,t[3]=n.content.size,t[4]=pe):pe=t[4];let me=pe,he=d.name===`*`||p!==null,ge=(0,Q.useRef)(!1),_e=(0,Q.useRef)(0),[J,ve]=(0,Q.useState)(!1);if((0,Q.useEffect)(()=>{if(!he||ge.current||J)return;let e=typeof s==`function`?s():void 0;if(typeof e!=`number`)return;let t=PM(n),i=d.name===`*`?`Unregistered component: ${n.attrs.componentName}`:`Render error in <${d.displayName??d.name}>: ${p?.message??`unknown`}`,a=n.type.schema.nodes.rawMdxFallback.create({reason:i},n.type.schema.text(t)),o=!1,c,l=()=>{if(!o&&U(r))try{r.view.dispatch(r.state.tr.replaceWith(e,e+n.nodeSize,a)),ge.current=!0,Qn(d.name===`*`?`wildcard`:d.name)}catch(e){let t=e,r=d.name===`*`?`wildcard`:d.name;if(console.warn(JSON.stringify({event:`jsx-component-auto-convert-failed`,component:r,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t instanceof Error?t.message.slice(0,500):String(t).slice(0,500),retry:_e.current})),pn(r),_e.current+=1,_e.current<eN){let e=50*(2**_e.current-1);c=setTimeout(()=>{o||l()},e)}else o||ve(!0)}},u=requestAnimationFrame(l);return()=>{o=!0,cancelAnimationFrame(u),c!==void 0&&clearTimeout(c)}},[he,n,r,s,d,p,J]),J){let e=n.attrs.componentName,i=d.displayName??d.name,a=d.name===`*`?l({id:`Kh1n4a`,values:{componentName:e}}):l({id:`g58Kwy`,values:{descriptorLabel:i}}),o=()=>{try{let e=PM(n);typeof navigator<`u`&&navigator.clipboard?.writeText&&navigator.clipboard.writeText(e)}catch(e){let t=e;Tn(d.name),console.warn(JSON.stringify({event:`jsx-component-stuck-copy-failed`,component:d.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t instanceof Error?t.message.slice(0,500):String(t).slice(0,500)}))}},c=()=>{let e=typeof s==`function`?s():void 0;if(typeof e==`number`)try{r.chain().focus().setNodeSelection(e).deleteSelection().run()}catch(e){let t=e;if(!(t instanceof RangeError))throw t;tr(d.name),console.warn(JSON.stringify({event:`jsx-component-stuck-delete-failed`,component:d.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}},u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u={[Fg]:`true`},t[5]=u):u=t[5];let f;t[6]===a?f=t[7]:(f=(0,Z.jsx)(`span`,{className:`flex-1`,children:a}),t[6]=a,t[7]=f);let p;t[8]===l?p=t[9]:(p=l({id:`E2Mv-X`}),t[8]=l,t[9]=p);let m;t[10]!==o||t[11]!==p?(m=(0,Z.jsx)(`button`,{type:`button`,className:`text-xs underline hover:no-underline`,onClick:o,children:p}),t[10]=o,t[11]=p,t[12]=m):m=t[12];let h;t[13]===l?h=t[14]:(h=l({id:`cnGeoo`}),t[13]=l,t[14]=h);let g;t[15]!==c||t[16]!==h?(g=(0,Z.jsx)(`button`,{type:`button`,className:`text-xs underline hover:no-underline`,onClick:c,children:h}),t[15]=c,t[16]=h,t[17]=g):g=t[17];let _;t[18]!==m||t[19]!==g||t[20]!==f?(_=(0,Z.jsxs)(`div`,{className:`text-xs font-mono text-muted-foreground px-2 py-2 border border-destructive/40 rounded bg-destructive/5 flex items-center gap-2`,contentEditable:!1,...u,children:[f,m,g]}),t[18]=m,t[19]=g,t[20]=f,t[21]=_):_=t[21];let v;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(Te,{className:`component-children`}),t[22]=v):v=t[22];let y;return t[23]===_?y=t[24]:(y=(0,Z.jsxs)(ie,{className:`jsx-component-wrapper my-2`,children:[_,v]}),t[23]=_,t[24]=y),y}if(he){let e=n.attrs.componentName,r=d.displayName??d.name,i=d.name===`*`?l({id:`oJl7eO`,values:{componentName:e}}):l({id:`bcDHUM`,values:{descriptorLabel:r}}),a;t[25]===i?a=t[26]:(a=(0,Z.jsx)(`div`,{className:`text-xs font-mono text-muted-foreground px-2 py-1`,contentEditable:!1,children:i}),t[25]=i,t[26]=a);let o;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Te,{className:`component-children`}),t[27]=o):o=t[27];let s;return t[28]===a?s=t[29]:(s=(0,Z.jsxs)(ie,{className:`jsx-component-wrapper my-2`,children:[a,o]}),t[28]=a,t[29]=s),s}let ye=d.Component,be=d.displayName??d.name,xe=d.displayName??d.name,Se=d.displayName??d.name,Ce=e=>{if(B||ce||!H)return;let t=e.target;if(!e.currentTarget.contains(t)||t.closest(`.jsx-component-chrome`)||t.closest(`.jsx-add-child-pill, .jsx-empty-child-placeholder`)||t.closest(`a[href]`)||typeof x!=`number`)return;let n=r.state.doc.nodeAt(x);if(!n)return;let i=x+n.nodeSize,a=r.state.selection.from;a<x||a>=i||r.chain().focus().setNodeSelection(x).run()},we;t[30]!==r||t[31]!==s||t[32]!==v?(we=()=>{let e=typeof s==`function`?s():void 0;typeof e==`number`&&(r.chain().focus().setNodeSelection(e).run(),v(!0))},t[30]=r,t[31]=s,t[32]=v,t[33]=we):we=t[33];let Ee=we,De=d.displayName??d.name,Oe=!!d.emptyChildName,ke=Oe?Fj(De,d.emptyChildName,n.childCount):void 0,Ae=e=>{let t=e.target;if(e.key===`Backspace`||e.key===`Delete`){if(!N||!e.currentTarget.contains(t)||t.matches(`input, textarea`))return;let i=typeof s==`function`?s():void 0;if(typeof i!=`number`)return;e.preventDefault();try{r.chain().focus().setNodeSelection(i).deleteSelection().run()||(dr(d.name),console.warn(JSON.stringify({event:`jsx-component-keyboard-delete-failed`,component:d.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:`chain-dispatch-returned-false`})))}catch(e){let t=e;if(!(t instanceof RangeError))throw t;dr(d.name),console.warn(JSON.stringify({event:`jsx-component-keyboard-delete-failed`,component:d.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}return}e.key!==`Enter`&&e.key!==` `||c&&L&&(t.closest(`.jsx-component-chrome`)||t.closest(`input, textarea, select, button`)||(e.preventDefault(),v(!0)))},je=e=>{v(e),!e&&requestAnimationFrame(()=>{let e=typeof s==`function`?s():void 0;if(typeof e==`number`)try{let t=r.state.doc.nodeAt(e);if(!t)return;let n=e+t.nodeSize,i=r.state.selection.from;if(i<e||i>=n)return;if(H){let e=r.state.doc.resolve(Math.min(n,r.state.doc.content.size)),t=lr.near(e,1);r.view.dispatch(r.state.tr.setSelection(t).scrollIntoView())}else r.chain().setNodeSelection(e).run()}catch(e){let t=e;if(!(t instanceof RangeError))throw t;Bn(d.name),console.warn(JSON.stringify({event:`jsx-component-popover-close-restore-failed`,component:d.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}})},Me=g,Ne=ie,Pe;t[34]===d.name?Pe=t[35]:(Pe=d.name.toLowerCase(),t[34]=d.name,t[35]=Pe);let Fe;bb0:{let e=R.align;if(e===`left`||e===`right`||e===`center`){Fe=e;break bb0}if(ee){Fe=`center`;break bb0}Fe=void 0}let Ie=N?`true`:void 0,Le=P?`true`:void 0,Re=A?`true`:void 0,ze=I?`true`:void 0,Be=z?`true`:void 0,Ve=Oe?`group`:void 0,He=N?0:-1,Ue;t[36]===C?Ue=t[37]:(Ue=C?{draggable:`false`,onDragStart:oN}:{"data-drag-handle":``,draggable:`true`},t[36]=C,t[37]=Ue);let We=d.name,Ge=aN,Ke;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(Ke={[Fg]:`true`},t[38]=Ke):Ke=t[38];let qe=d.name===`Embed`&&typeof G.src==`string`&&/^https?:\/\//i.test(G.src)&&(0,Z.jsx)(`a`,{href:G.src,target:`_blank`,rel:`noopener noreferrer`,className:`jsx-chrome-btn`,"aria-label":l({id:`iOHg1t`}),onMouseDown:iN,children:(0,Z.jsx)(es,{size:12,"aria-hidden":`true`})}),Je=d.name===`Mirror`&&typeof G.src==`string`&&G.src.length>0&&(()=>{let e=G.src;return(0,Z.jsx)(`a`,{href:pi(e,typeof G.anchor==`string`&&G.anchor.length>0?G.anchor:null),className:`jsx-chrome-btn`,"aria-label":l({id:`3a_Bd7`,values:{mirrorSrc:e}}),title:l({id:`0kTAXe`,values:{mirrorSrc:e}}),onMouseDown:rN,children:(0,Z.jsx)(es,{size:12,"aria-hidden":`true`})})})(),Ye;t[39]!==l||t[40]!==E||t[41]!==d.name||t[42]!==r||t[43]!==n.attrs.componentName||t[44]!==n.nodeSize||t[45]!==x?(Ye=E&&(0,Z.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":l({id:`QyioBP`}),onClick:()=>{try{if(typeof x!=`number`)return;let e=r.state.doc.resolve(x),t=e.index(e.depth);if(t===0)return;let i=x-e.node(e.depth).child(t-1).nodeSize,a=x+n.nodeSize,o=r.state.tr,s=r.state.doc.slice(x,x+n.nodeSize),c=r.state.doc.slice(i,x);o.replaceWith(i,a,s.content.append(c.content)),r.view.dispatch(o.scrollIntoView())}catch(e){let t=e;if(!(t instanceof RangeError))throw t;vn(`up`),console.warn(JSON.stringify({event:`jsx-component-move-failed`,direction:`up`,component:d.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}},children:(0,Z.jsx)(zr,{size:12,"aria-hidden":`true`})}),t[39]=l,t[40]=E,t[41]=d.name,t[42]=r,t[43]=n.attrs.componentName,t[44]=n.nodeSize,t[45]=x,t[46]=Ye):Ye=t[46];let Xe;t[47]!==l||t[48]!==D||t[49]!==d.name||t[50]!==r||t[51]!==n.attrs.componentName||t[52]!==n.nodeSize||t[53]!==x?(Xe=D&&(0,Z.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":l({id:`3Ib6FN`}),onClick:()=>{try{if(typeof x!=`number`)return;let e=r.state.doc.resolve(x),t=e.index(e.depth),i=e.node(e.depth);if(t>=i.childCount-1)return;let a=i.child(t+1),o=x,s=x+n.nodeSize+a.nodeSize,c=r.state.tr,l=r.state.doc.slice(x,x+n.nodeSize),u=r.state.doc.slice(x+n.nodeSize,s);c.replaceWith(o,s,u.content.append(l.content)),r.view.dispatch(c.scrollIntoView())}catch(e){let t=e;if(!(t instanceof RangeError))throw t;vn(`down`),console.warn(JSON.stringify({event:`jsx-component-move-failed`,direction:`down`,component:d.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}},children:(0,Z.jsx)(Lr,{size:12,"aria-hidden":`true`})}),t[47]=l,t[48]=D,t[49]=d.name,t[50]=r,t[51]=n.attrs.componentName,t[52]=n.nodeSize,t[53]=x,t[54]=Xe):Xe=t[54];let Ze;t[55]!==l||t[56]!==d.displayName||t[57]!==d.name||t[58]!==W||t[59]!==x||t[60]!==ae?(Ze=W&&typeof x==`number`?(0,Z.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":l({id:`ky9Tuc`,values:{0:d.displayName??d.name}}),"data-testid":`jsx-component-edit-btn`,onClick:()=>ae(!0),children:(0,Z.jsx)(Ss,{size:12,"aria-hidden":`true`})}):null,t[55]=l,t[56]=d.displayName,t[57]=d.name,t[58]=W,t[59]=x,t[60]=ae,t[61]=Ze):Ze=t[61];let Qe;t[62]!==l||t[63]!==d.displayName||t[64]!==d.name||t[65]!==r||t[66]!==S||t[67]!==n||t[68]!==x?(Qe=!S&&jn(n).length>0&&typeof x==`number`?(0,Z.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"aria-label":l({id:`INp_z6`,values:{0:d.displayName??d.name}}),"data-testid":`jsx-component-ask-ai-btn`,onClick:()=>{try{r.commands.setNodeSelection(x)}catch(e){let t=e;console.warn(JSON.stringify({event:`jsx-component-chrome-ask-ai-failed`,component:d.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t instanceof Error?t.message.slice(0,500):String(t)}));return}requestAnimationFrame(()=>{try{hw()}catch(e){let t=e;console.warn(JSON.stringify({event:`jsx-component-chrome-ask-ai-emit-failed`,component:d.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t instanceof Error?t.message.slice(0,500):String(t)}))}})},children:(0,Z.jsx)(As,{size:12,"aria-hidden":`true`})}):null,t[62]=l,t[63]=d.displayName,t[64]=d.name,t[65]=r,t[66]=S,t[67]=n,t[68]=x,t[69]=Qe):Qe=t[69];let $e;t[70]!==l||t[71]!==be?($e=l({id:`MCjC9A`,values:{deleteDescriptorLabel:be}}),t[70]=l,t[71]=be,t[72]=$e):$e=t[72];let et;t[73]!==d.name||t[74]!==r||t[75]!==n.attrs.componentName||t[76]!==x?(et=()=>{if(typeof x==`number`)try{r.chain().focus().setNodeSelection(x).deleteSelection().run()||(dr(d.name),console.warn(JSON.stringify({event:`jsx-component-chrome-delete-failed`,component:d.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:`chain-dispatch-returned-false`})))}catch(e){let t=e;if(!(t instanceof RangeError))throw t;dr(d.name),console.warn(JSON.stringify({event:`jsx-component-chrome-delete-failed`,component:d.name,rawComponentName:String(n.attrs.componentName??``).slice(0,200),reason:t.message.slice(0,500)}))}},t[73]=d.name,t[74]=r,t[75]=n.attrs.componentName,t[76]=x,t[77]=et):et=t[77];let tt;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,Z.jsx)(ai,{size:12,"aria-hidden":`true`}),t[78]=tt):tt=t[78];let nt;t[79]!==$e||t[80]!==et?(nt=(0,Z.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn jsx-chrome-btn--delete`,"aria-label":$e,onClick:et,children:tt}),t[79]=$e,t[80]=et,t[81]=nt):nt=t[81];let rt;t[82]!==l||t[83]!==L||t[84]!==xe?(rt=L&&(0,Z.jsx)(h,{asChild:!0,children:(0,Z.jsx)(`button`,{type:`button`,className:`jsx-chrome-btn`,"data-jsx-gear":``,"aria-label":l({id:`XPJ0sN`,values:{settingsDescriptorLabel:xe}}),children:(0,Z.jsx)(Ts,{size:12,"aria-hidden":`true`})})}),t[82]=l,t[83]=L,t[84]=xe,t[85]=rt):rt=t[85];let it;t[86]!==Ge||t[87]!==Ke||t[88]!==qe||t[89]!==Je||t[90]!==Ye||t[91]!==Xe||t[92]!==Ze||t[93]!==Qe||t[94]!==nt||t[95]!==rt?(it=(0,Z.jsxs)(`div`,{className:`jsx-component-chrome`,contentEditable:!1,onMouseDown:Ge,...Ke,children:[qe,Je,Ye,Xe,Ze,Qe,nt,rt]}),t[86]=Ge,t[87]=Ke,t[88]=qe,t[89]=Je,t[90]=Ye,t[91]=Xe,t[92]=Ze,t[93]=Qe,t[94]=nt,t[95]=rt,t[96]=it):it=t[96];let at;t[97]!==ye||t[98]!==d.emptyChildName||t[99]!==d.hasChildren||t[100]!==d.isSelfClosing||t[101]!==d.name||t[102]!==r||t[103]!==s||t[104]!==me||t[105]!==N||t[106]!==n.attrs.componentName||t[107]!==n.childCount||t[108]!==Ee||t[109]!==de||t[110]!==fe||t[111]!==V||t[112]!==ae||t[113]!==m||t[114]!==B||t[115]!==ce||t[116]!==le?(at=B&&V?(0,Z.jsx)(f,{asChild:!0,children:(0,Z.jsx)(fj,{label:V.label,Icon:V.Icon,onClick:Ee,selected:N})}):ce&&le?(0,Z.jsx)(fj,{label:le.label,Icon:le.Icon,onClick:()=>ae(!0),selected:N}):(0,Z.jsx)(XM,{resetKey:fe,onError:m,descriptorName:d.name===`*`?`wildcard`:d.name,rawComponentName:n.attrs.componentName??``,children:(0,Z.jsx)(Rr,{value:typeof s==`function`?{editor:r,getPos:()=>{let e=s();return typeof e==`number`?e:void 0},addChild:d.emptyChildName?()=>{let e=d.emptyChildName,t=uy(e),n=me();r.chain().focus().insertContentAt(n,t).run(),my(r,n,iy(e))}:null}:null,children:(0,Z.jsx)(ye,{...de,children:(0,Z.jsx)(Te,{className:`component-children ${!d.hasChildren&&n.childCount===0?`min-h-0 m-0 p-0`:``}`,...!d.hasChildren||d.isSelfClosing?{contentEditable:!1}:{}})})})}),t[97]=ye,t[98]=d.emptyChildName,t[99]=d.hasChildren,t[100]=d.isSelfClosing,t[101]=d.name,t[102]=r,t[103]=s,t[104]=me,t[105]=N,t[106]=n.attrs.componentName,t[107]=n.childCount,t[108]=Ee,t[109]=de,t[110]=fe,t[111]=V,t[112]=ae,t[113]=m,t[114]=B,t[115]=ce,t[116]=le,t[117]=at):at=t[117];let ot;t[118]!==d.emptyChildName||t[119]!==d.name||t[120]!==r||t[121]!==me||t[122]!==n.childCount?(ot=d.emptyChildName&&!(d.name===`Tabs`&&n.childCount>0)&&(()=>{let e=d.emptyChildName;return(0,Z.jsx)(`button`,{type:`button`,contentEditable:!1,className:n.childCount===0?`jsx-empty-child-placeholder`:`jsx-add-child-pill`,onMouseDown:nN,onClick:()=>{let e=d.emptyChildName,t=uy(e),n=me();r.chain().focus().insertContentAt(n,t).run(),my(r,n,iy(e))},"data-clipboard-omit":`true`,children:(0,Z.jsx)(`span`,{children:(0,Z.jsx)(a,{id:`7Fkcej`,values:{addChildName:e}})})})})(),t[118]=d.emptyChildName,t[119]=d.name,t[120]=r,t[121]=me,t[122]=n.childCount,t[123]=ot):ot=t[123];let st;t[124]!==Ne||t[125]!==d.name||t[126]!==ke||t[127]!==Ce||t[128]!==Ae||t[129]!==F||t[130]!==Pe||t[131]!==Fe||t[132]!==Ie||t[133]!==Le||t[134]!==Re||t[135]!==ze||t[136]!==Be||t[137]!==Ve||t[138]!==He||t[139]!==Ue||t[140]!==it||t[141]!==at||t[142]!==ot?(st=(0,Z.jsxs)(Ne,{className:`jsx-component-wrapper my-2`,"data-jsx-component":``,"data-component-type":Pe,"data-align":Fe,"data-selected":Ie,"data-has-child-selected":Le,"data-range-selected":Re,"data-selection-origin":F,"data-dragging":ze,"data-needs-config":Be,role:Ve,"aria-label":ke,tabIndex:He,...Ue,"data-component-name":We,onClick:Ce,onKeyDown:Ae,children:[it,at,ot]}),t[124]=Ne,t[125]=d.name,t[126]=ke,t[127]=Ce,t[128]=Ae,t[129]=F,t[130]=Pe,t[131]=Fe,t[132]=Ie,t[133]=Le,t[134]=Re,t[135]=ze,t[136]=Be,t[137]=Ve,t[138]=He,t[139]=Ue,t[140]=it,t[141]=at,t[142]=ot,t[143]=st):st=t[143];let ct;t[144]!==l||t[145]!==R||t[146]!==d.Component||t[147]!==d.displayName||t[148]!==d.name||t[149]!==ne||t[150]!==W||t[151]!==r||t[152]!==s||t[153]!==x||t[154]!==de||t[155]!==ae?(ct=W&&typeof x==`number`?(0,Z.jsx)(XD,{open:ne,onOpenChange:ae,initialValue:typeof R[W.propName]==`string`?R[W.propName]:``,language:W.language,title:l({id:`ky9Tuc`,values:{0:d.displayName??d.name}}),renderPreview:(e,t)=>{let n=d.Component;return(0,Z.jsx)(`div`,{className:`flex h-full w-full items-center justify-center p-4`,children:(0,Z.jsx)(n,{...de,[W.propName]:e,...d.name===`MermaidFence`&&{className:`border-0 bg-transparent rounded-none`,editBinding:{canEdit:r.isEditable,commitChart:t}}})})},onSave:e=>{let t=typeof s==`function`?s():void 0;if(typeof t!=`number`)return;let n=r.state.doc.nodeAt(t);if(!n)return;let i=$M(n.attrs);if(i)try{let n={...i.props,[W.propName]:e},a={...i,props:n,sourceDirty:!0};r.view.dispatch(r.state.tr.setNodeMarkup(t,null,a)),te()}catch(e){let t=e;if(!(t instanceof RangeError))throw t;console.warn(`[JsxComponentView] edit-save failed — position race`,t)}}}):null,t[144]=l,t[145]=R,t[146]=d.Component,t[147]=d.displayName,t[148]=d.name,t[149]=ne,t[150]=W,t[151]=r,t[152]=s,t[153]=x,t[154]=de,t[155]=ae,t[156]=ct):ct=t[156];let lt;t[157]!==d||t[158]!==r||t[159]!==s||t[160]!==L||t[161]!==H||t[162]!==G||t[163]!==Se||t[164]!==v||t[165]!==B?(lt=L&&(0,Z.jsxs)(u,{side:B?`bottom`:`right`,align:B?`center`:`start`,sideOffset:B?-4:8,className:`w-64 p-3 z-60 overflow-y-auto subtle-scrollbar max-h-(--radix-popper-available-height) overscroll-contain`,onCloseAutoFocus:H?e=>{e.preventDefault(),r.view.focus()}:void 0,children:[(0,Z.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground mb-2`,children:(0,Z.jsx)(a,{id:`Mnavhe`,values:{propPanelDescriptorLabel:Se}})}),(0,Z.jsx)(iM,{descriptor:d,values:G,onDismiss:()=>v(!1),onChange:(e,t)=>{let n=typeof s==`function`?s():void 0;if(typeof n!=`number`)return;let i=r.state.doc.nodeAt(n);if(!i)return;let a=$M(i.attrs);if(!a)return;let o={...a.props},c=Array.isArray(i.attrs.attributes)?i.attrs.attributes:[],l=c;t===void 0?(delete o[e],l=c.filter(t=>!(typeof t==`object`&&t&&t.type===`mdxJsxAttribute`&&t.name===e))):o[e]=t,r.view.dispatch(r.state.tr.setNodeMarkup(n,null,{...a,attributes:l,props:o,sourceDirty:!0})),te()}}),(0,Z.jsx)(`div`,{className:`mt-3 flex justify-end border-t border-border pt-2`,children:(0,Z.jsx)(y,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>v(!1),className:`h-7 px-3 text-xs`,children:(0,Z.jsx)(a,{id:`DPfwMq`})})})]}),t[157]=d,t[158]=r,t[159]=s,t[160]=L,t[161]=H,t[162]=G,t[163]=Se,t[164]=v,t[165]=B,t[166]=lt):lt=t[166];let ut;return t[167]!==Me||t[168]!==je||t[169]!==_||t[170]!==st||t[171]!==ct||t[172]!==lt?(ut=(0,Z.jsxs)(Me,{open:_,onOpenChange:je,children:[st,ct,lt]}),t[167]=Me,t[168]=je,t[169]=_,t[170]=st,t[171]=ct,t[172]=lt,t[173]=ut):ut=t[173],ut}function nN(e){return e.stopPropagation()}function rN(e){return e.stopPropagation()}function iN(e){return e.stopPropagation()}function aN(e){return e.stopPropagation()}function oN(e){return e.preventDefault()}function sN(e){return!(`hidden`in e&&e.hidden)&&e.type!==`reactnode`}var cN=$t.extend({addOptions(){return{...this.parent?.(),docName:``}},addNodeView(){return de(tN)}});function lN(e){let t=(0,$.c)(4),{node:n}=e,r=n.attrs.componentName||``;if(!r){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(ie,{as:`span`,"data-jsx-inline":``,children:(0,Z.jsx)(Te,{as:`span`})}),t[0]=e):e=t[0],e}let i;return t[1]!==r||t[2]!==e?(i=(0,Z.jsx)(uN,{...e,name:r}),t[1]=r,t[2]=e,t[3]=i):i=t[3],i}function uN(e){let t=(0,$.c)(64),{node:n,selected:r,editor:i,getPos:o,name:s}=e,c=iy(s),{Component:l}=c,[d,f]=(0,Q.useState)(!1),m=(0,Q.useRef)(!1),_=QM(n.attrs,c.reactNodePropNames),v=n.attrs.props?.children;typeof v==`string`&&v!==``&&(_.children=v);let b=`${c.name}::${ZM(_)}`,x;t[0]!==i||t[1]!==o||t[2]!==f?(x=()=>{let e=()=>{let e=typeof o==`function`?o():void 0,t=i.state.selection,n=t instanceof Gn&&typeof e==`number`&&t.from===e;n&&!m.current?f(!0):!n&&m.current&&f(!1),m.current=n};return i.on(`selectionUpdate`,e),e(),()=>{i.off(`selectionUpdate`,e)}},t[0]=i,t[1]=o,t[2]=f,t[3]=x):x=t[3];let S;t[4]!==i||t[5]!==o?(S=[i,o],t[4]=i,t[5]=o,t[6]=S):S=t[6],(0,Q.useEffect)(x,S);let C;t[7]===n.attrs.props?C=t[8]:(C=n.attrs.props??{},t[7]=n.attrs.props,t[8]=C);let w=C,T;if(t[9]!==w){let{children:e,...n}=w;T=n,t[9]=w,t[10]=T}else T=t[10];let E=r?`jsx-inline-selected`:void 0,D;t[11]===b?D=t[12]:(D=[b],t[11]=b,t[12]=D);let O;t[13]!==c.name||t[14]!==s?(O=(e,t)=>{let n=e instanceof Error?e:Error(String(e));console.warn(JSON.stringify({event:`jsx-render-failure`,component:c.name===`*`?`wildcard`:c.name,rawComponentName:s.slice(0,200),error:String(n),stack:t.componentStack})),bn(c.name)},t[13]=c.name,t[14]=s,t[15]=O):O=t[15];let k;t[16]===s?k=t[17]:(k=()=>(0,Z.jsxs)(`span`,{className:`text-xs font-mono text-destructive`,children:[`[`,s,`]`]}),t[16]=s,t[17]=k);let A;t[18]!==l||t[19]!==_?(A=(0,Z.jsx)(l,{..._}),t[18]=l,t[19]=_,t[20]=A):A=t[20];let j;t[21]!==D||t[22]!==O||t[23]!==k||t[24]!==A?(j=(0,Z.jsx)(h,{asChild:!0,children:(0,Z.jsx)(`span`,{"data-jsx-inline-widget":``,children:(0,Z.jsx)(p,{resetKeys:D,onError:O,fallbackRender:k,children:A})})}),t[21]=D,t[22]=O,t[23]=k,t[24]=A,t[25]=j):j=t[25];let M;t[26]!==i.isDestroyed||t[27]!==i.state||t[28]!==i.view||t[29]!==o?(M=e=>{if(e.preventDefault(),i.isDestroyed)return;let t=typeof o==`function`?o():void 0;if(typeof t==`number`){let e=i.state,n=e.doc.nodeAt(t);if(n?.type.name===`jsxInline`){let r=t+n.nodeSize;r<=e.doc.content.size&&i.view.dispatch(e.tr.setSelection(lr.create(e.doc,r)))}}i.view.focus()},t[26]=i.isDestroyed,t[27]=i.state,t[28]=i.view,t[29]=o,t[30]=M):M=t[30];let N=c.displayName??s,P;t[31]===N?P=t[32]:(P=(0,Z.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground mb-2`,children:(0,Z.jsx)(a,{id:`hxnF0I`,values:{0:N}})}),t[31]=N,t[32]=P);let F;t[33]!==i.state.doc||t[34]!==i.state.tr||t[35]!==i.view||t[36]!==o?(F=(e,t)=>{let n=typeof o==`function`?o():void 0;if(typeof n!=`number`)return;let r=i.state.doc.nodeAt(n);if(!r||r.type.name!==`jsxInline`)return;let a={...r.attrs.props,[e]:t},s=i.state.tr.setNodeMarkup(n,null,{...r.attrs,props:a,sourceDirty:!0});s.setSelection(Gn.create(s.doc,n)),i.view.dispatch(s)},t[33]=i.state.doc,t[34]=i.state.tr,t[35]=i.view,t[36]=o,t[37]=F):F=t[37];let I;t[38]===f?I=t[39]:(I=()=>f(!1),t[38]=f,t[39]=I);let L;t[40]!==c||t[41]!==T||t[42]!==F||t[43]!==I?(L=(0,Z.jsx)(iM,{descriptor:c,values:T,onChange:F,onDismiss:I}),t[40]=c,t[41]=T,t[42]=F,t[43]=I,t[44]=L):L=t[44];let R;t[45]===f?R=t[46]:(R=()=>f(!1),t[45]=f,t[46]=R);let z;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsx)(a,{id:`DPfwMq`}),t[47]=z):z=t[47];let B;t[48]===R?B=t[49]:(B=(0,Z.jsx)(y,{variant:`secondary`,size:`sm`,className:`mt-2 w-full`,onClick:R,children:z}),t[48]=R,t[49]=B);let V;t[50]!==M||t[51]!==P||t[52]!==L||t[53]!==B?(V=(0,Z.jsxs)(u,{className:`z-[60] w-72 p-3`,side:`bottom`,align:`start`,onOpenAutoFocus:dN,onCloseAutoFocus:M,children:[P,L,B]}),t[50]=M,t[51]=P,t[52]=L,t[53]=B,t[54]=V):V=t[54];let H;t[55]!==d||t[56]!==f||t[57]!==V||t[58]!==j?(H=(0,Z.jsxs)(g,{open:d,onOpenChange:f,children:[j,V]}),t[55]=d,t[56]=f,t[57]=V,t[58]=j,t[59]=H):H=t[59];let U;return t[60]!==s||t[61]!==H||t[62]!==E?(U=(0,Z.jsx)(ie,{as:`span`,"data-jsx-inline":``,"data-component-name":s,contentEditable:!1,className:E,children:H}),t[60]=s,t[61]=H,t[62]=E,t[63]=U):U=t[63],U}function dN(e){e.preventDefault()}var fN=ot.extend({addOptions(){return{...this.parent?.(),docName:``}},addNodeView(){return de(lN)},addProseMirrorPlugins(){return[new ar({props:{handleDOMEvents:{mousedown(e,t){let n=t.target;if(!(n instanceof Element))return!1;let r=n.closest(`[data-jsx-inline][data-component-name]`);if(!r||!e.dom.contains(r)||!r.getAttribute(`data-component-name`))return!1;let i=null;try{let t=e.posAtDOM(r,0);for(let n of[t-1,t]){let t=n>=0?e.state.doc.nodeAt(n):null;if(t?.type.name===`jsxInline`&&t.attrs.componentName){i=n;break}}}catch{return!1}return i===null?!1:(t.preventDefault(),e.dispatch(e.state.tr.setSelection(Gn.create(e.state.doc,i))),e.focus(),!0)}}}})]}}),pN={name:`InlineMath`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,category:`content`,description:`Inline math`,props:[{name:`formula`,type:`string`,required:!0,autoFocus:!0,description:`LaTeX inline math source`}]},mN=(0,Q.lazy)(async()=>{let{default:e}=await n(async()=>{let{default:e}=await import(`./katex-BE6VA85g.js`);return{default:e}},[],import.meta.url);function t(t){let n=(0,$.c)(4),r;n[0]===t.formula?r=n[1]:(r=e.renderToString(t.formula,{displayMode:!1,throwOnError:!1,strict:`ignore`,trust:!1}),n[0]=t.formula,n[1]=r);let i=r,a;return n[2]===i?a=n[3]:(a=(0,Z.jsx)(`span`,{className:`math math-inline`,dangerouslySetInnerHTML:{__html:i}}),n[2]=i,n[3]=a),a}return{default:t}});function hN(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`span`,{className:`math math-inline math-placeholder math-placeholder-empty inline-flex items-center gap-1 rounded-sm border border-dashed border-muted-foreground/40 bg-muted/30 px-1.5 py-0.5 text-xs italic text-muted-foreground hover:bg-muted/60 cursor-pointer`,"data-component-type":`math-inline`,children:`f(x)`}),e[0]=t):t=e[0],t}function gN(e){let t=(0,$.c)(2),n;return t[0]===e.formula?n=t[1]:(n=(0,Z.jsx)(`span`,{className:`math math-inline math-placeholder`,"data-component-type":`math-inline`,children:e.formula}),t[0]=e.formula,t[1]=n),n}function _N(e){let t=(0,$.c)(43),{node:n,selected:r,getPos:i,editor:o}=e,s=typeof n.attrs.formula==`string`?n.attrs.formula:``,c=typeof n.attrs.id==`string`?n.attrs.id:void 0,[l,d]=(0,Q.useState)(!1),f=(0,Q.useRef)(!1),m;t[0]!==o.state||t[1]!==i||t[2]!==r?(m=()=>{let e=r&&o.state.selection instanceof Gn;e&&!f.current?(py(typeof i==`function`?i()??0:0),d(!0)):!e&&f.current&&d(!1),f.current=e},t[0]=o.state,t[1]=i,t[2]=r,t[3]=m):m=t[3];let _;t[4]!==o||t[5]!==i||t[6]!==r?(_=[r,i,o],t[4]=o,t[5]=i,t[6]=r,t[7]=_):_=t[7],(0,Q.useEffect)(m,_);let v=r?`math-inline-selected`:void 0,b;t[8]===c?b=t[9]:(b=c?{id:c}:{},t[8]=c,t[9]=b);let x;t[10]===s?x=t[11]:(x=s?(0,Z.jsx)(p,{resetKeys:[s],onError:yN,fallbackRender:()=>(0,Z.jsx)(`span`,{className:`math math-inline math-error`,children:s}),children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(gN,{formula:s}),children:(0,Z.jsx)(mN,{formula:s})})}):(0,Z.jsx)(hN,{}),t[10]=s,t[11]=x);let S;t[12]!==s||t[13]!==b||t[14]!==x?(S=(0,Z.jsx)(h,{asChild:!0,children:(0,Z.jsx)(`span`,{className:`math-inline-trigger`,"data-component-type":`math-inline`,"data-formula":s,...b,children:x})}),t[12]=s,t[13]=b,t[14]=x,t[15]=S):S=t[15];let C;t[16]!==o.state||t[17]!==o.view||t[18]!==i?(C=e=>{e.preventDefault();let t=typeof i==`function`?i():void 0;if(typeof t==`number`){let e=o.state,n=e.doc.nodeAt(t);if(n?.type.name===`mathInline`){let r=t+n.nodeSize;r<=e.doc.content.size&&o.view.dispatch(e.tr.setSelection(lr.create(e.doc,r)))}}o.view.focus()},t[16]=o.state,t[17]=o.view,t[18]=i,t[19]=C):C=t[19];let w;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground mb-2`,children:(0,Z.jsx)(a,{id:`EOjU5V`})}),t[20]=w):w=t[20];let T;t[21]===s?T=t[22]:(T={formula:s},t[21]=s,t[22]=T);let E;t[23]!==o.state||t[24]!==o.view||t[25]!==i?(E=(e,t)=>{let n=typeof i==`function`?i():void 0;if(typeof n!=`number`)return;let r=o.state.doc.nodeAt(n);if(!r||r.type.name!==`mathInline`)return;let a=o.state.tr.setNodeMarkup(n,null,{...r.attrs,[e]:t??``});a.setSelection(Gn.create(a.doc,n)),o.view.dispatch(a)},t[23]=o.state,t[24]=o.view,t[25]=i,t[26]=E):E=t[26];let D;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>d(!1),t[27]=D):D=t[27];let O;t[28]!==E||t[29]!==T?(O=(0,Z.jsx)(iM,{descriptor:pN,values:T,onChange:E,onDismiss:D}),t[28]=E,t[29]=T,t[30]=O):O=t[30];let k;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>d(!1),t[31]=k):k=t[31];let A;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(`div`,{className:`mt-3 flex justify-end border-t border-border pt-2`,children:(0,Z.jsx)(y,{type:`button`,size:`sm`,variant:`ghost`,onClick:k,className:`h-7 px-3 text-xs`,children:(0,Z.jsx)(a,{id:`DPfwMq`})})}),t[32]=A):A=t[32];let j;t[33]!==O||t[34]!==C?(j=(0,Z.jsxs)(u,{className:`z-[60] w-72 p-3`,side:`bottom`,align:`start`,onOpenAutoFocus:vN,onCloseAutoFocus:C,children:[w,O,A]}),t[33]=O,t[34]=C,t[35]=j):j=t[35];let M;t[36]!==l||t[37]!==j||t[38]!==S?(M=(0,Z.jsxs)(g,{open:l,onOpenChange:d,children:[S,j]}),t[36]=l,t[37]=j,t[38]=S,t[39]=M):M=t[39];let N;return t[40]!==M||t[41]!==v?(N=(0,Z.jsx)(ie,{as:`span`,className:v,children:M}),t[40]=M,t[41]=v,t[42]=N):N=t[42],N}function vN(e){e.preventDefault()}function yN(e,t){let n=e instanceof Error?e:Error(String(e));console.warn(JSON.stringify({event:`jsx-render-failure`,component:`mathInline`,rawComponentName:`mathInline`,error:String(n),stack:t.componentStack})),bn(`mathInline`)}var bN=Yn.extend({addNodeView(){return de(_N)}});function xN(e,t){if(!e.selection.empty)return null;let n=t===`up`||t===`left`?-1:1,r=e.selection.$head,i=n>0?r.after():r.before();if(typeof i!=`number`)return null;let a=dn.near(e.doc.resolve(i),n);return a.$head?.parent.type.name===`rawMdxFallback`?a:null}function SN(e,t){let{state:n,view:r}=e;if(!r.endOfTextblock(t))return!1;let i=xN(n,t);return i?(r.dispatch(n.tr.setSelection(i)),!0):!1}var CN=gn.extend({addKeyboardShortcuts(){return{ArrowLeft:({editor:e})=>SN(e,`left`),ArrowRight:({editor:e})=>SN(e,`right`),ArrowUp:({editor:e})=>SN(e,`up`),ArrowDown:({editor:e})=>SN(e,`down`)}},addNodeView(){return de(Ee,{stopEvent:()=>!0,ignoreMutation:()=>!0})}});function wN({editor:e,item:t,range:n}){let r=[],i;try{e.chain().focus().deleteRange(n).command(n=>{try{t.command({editor:e,chain:n.chain,state:n.state,afterCommit:e=>r.push(e)})}catch(e){i=e}return!0}).run()}catch(e){console.error(`[slash-command] deleteRange failed for "${t.name}"`,e),i!==void 0&&console.error(`[slash-command] command "${t.name}" threw an error`,i);return}i!==void 0&&console.error(`[slash-command] command "${t.name}" threw an error`,i);for(let e of r)try{e()}catch(e){console.error(`[slash-command] afterCommit callback for "${t.name}" threw an error`,e)}}function TN(e){let t=(0,$.c)(51),{items:n,selectedIndex:r,categoryLabels:i,onSelect:s,onHoverIndex:c}=e,l=(0,Q.useRef)(null),u=(0,Q.useId)(),{_:d}=o(),f=r>=0&&r<n.length?`${u}-option-${r}`:void 0,p=DN,m,h;if(t[0]===r?(m=t[1],h=t[2]):(m=()=>{let e=l.current;if(!e)return;let t=e.querySelectorAll(`[role="option"]`).item(r);t&&t.scrollIntoView({block:`nearest`})},h=[r],t[0]=r,t[1]=m,t[2]=h),(0,Q.useEffect)(m,h),n.length===0){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[3]=e):e=t[3];let n;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`div`,{ref:l,role:`status`,"aria-live":`polite`,className:`w-56 rounded-lg border bg-popover p-2 shadow-md text-sm text-muted-foreground`,style:e,onMouseDown:p,children:(0,Z.jsx)(a,{id:`Ev2r9A`})}),t[4]=n):n=t[4],n}let g,_,v,y,b,x,S,C,w,T,E,D,O;if(t[5]!==d||t[6]!==f||t[7]!==i||t[8]!==n||t[9]!==u||t[10]!==c||t[11]!==s||t[12]!==r){let e=[],a=0,o=new Map;for(let t of n){o.set(t,a++);let n=e.find(e=>e.key===t.category);n?n.items.push(t):e.push({key:t.category,items:[t]})}_=r>=0&&r<n.length?n[r]:null;let m;t[26]===n?m=t[27]:(m=n.some(EN),t[26]=n,t[27]=m),g=m,x=`flex items-start gap-2`,S=l,C=`listbox`,t[28]===d?w=t[29]:(w=d({id:`RlCInP`}),t[28]=d,t[29]=w),T=f,E=-1,D=p,O=`w-56 overflow-y-auto subtle-scrollbar rounded-lg border bg-popover p-1 shadow-md`,t[30]===Symbol.for(`react.memo_cache_sentinel`)?(v={maxHeight:`var(--suggestion-menu-max-height, 40vh)`},t[30]=v):v=t[30];let h=_?`${_.label}${_.preview?`. ${_.preview.description}`:``}`:``;t[31]===h?y=t[32]:(y=(0,Z.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:h}),t[31]=h,t[32]=y),b=e.map(e=>(0,Z.jsxs)(`div`,{role:`group`,"aria-labelledby":`${u}-group-${e.key}`,children:[(0,Z.jsx)(`div`,{id:`${u}-group-${e.key}`,className:`px-2 py-1.5 text-xs font-semibold text-muted-foreground`,children:i[e.key]??e.key}),e.items.map(e=>{let t=o.get(e)??0,n=t===r,i=e.icon;return(0,Z.jsxs)(`button`,{id:`${u}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-selected":n,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseEnter:()=>c?.(t),onMouseDown:t=>{t.preventDefault(),s(e)},children:[(0,Z.jsx)(i,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`div`,{className:`flex flex-col min-w-0`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e.label})})]},e.name)})]},e.key)),t[5]=d,t[6]=f,t[7]=i,t[8]=n,t[9]=u,t[10]=c,t[11]=s,t[12]=r,t[13]=g,t[14]=_,t[15]=v,t[16]=y,t[17]=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}else g=t[13],_=t[14],v=t[15],y=t[16],b=t[17],x=t[18],S=t[19],C=t[20],w=t[21],T=t[22],E=t[23],D=t[24],O=t[25];let k;t[33]!==v||t[34]!==y||t[35]!==b||t[36]!==S||t[37]!==C||t[38]!==w||t[39]!==T||t[40]!==E||t[41]!==D||t[42]!==O?(k=(0,Z.jsxs)(`div`,{ref:S,role:C,"aria-label":w,"aria-activedescendant":T,tabIndex:E,onMouseDown:D,className:O,style:v,children:[y,b]}),t[33]=v,t[34]=y,t[35]=b,t[36]=S,t[37]=C,t[38]=w,t[39]=T,t[40]=E,t[41]=D,t[42]=O,t[43]=k):k=t[43];let A;t[44]!==g||t[45]!==_?(A=g?(0,Z.jsx)(`aside`,{"aria-hidden":`true`,onMouseDown:p,className:`w-64 rounded-lg border bg-popover p-2 shadow-md ${_?.preview?``:`invisible`}`,children:_?.preview?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`mb-2 flex aspect-5/3 items-center justify-center overflow-hidden rounded-md bg-muted/40 p-3 *:max-h-full *:max-w-full [&_img]:size-full [&_img]:rounded-md [&_img]:object-contain`,children:_.preview.render()}),(0,Z.jsx)(`p`,{className:`line-clamp-3 px-1 pb-1 text-xs text-muted-foreground`,children:_.preview.description})]}):null}):null,t[44]=g,t[45]=_,t[46]=A):A=t[46];let j;return t[47]!==x||t[48]!==k||t[49]!==A?(j=(0,Z.jsxs)(`div`,{className:x,children:[k,A]}),t[47]=x,t[48]=k,t[49]=A,t[50]=j):j=t[50],j}function EN(e){return e.preview}function DN(e){return e.preventDefault()}var ON=new Nn(`slashCommand`);function kN(e){let{sources:t,categoryOrder:n,query:r,state:i,editor:a}=e,o=t.flatMap(e=>{try{return e(a===void 0?void 0:{editor:a})}catch(e){return console.error(`[slash-command] item source threw an error`,e),[]}}),s=e=>{let t=n.indexOf(e);return t===-1?1/0:t},c=o.map((e,t)=>({item:e,i:t})).sort((e,t)=>{let n=s(e.item.category)-s(t.item.category);return n===0?e.i-t.i:n}).map(e=>e.item);return ky(rb(i)?c.filter(e=>!e.insertsBlockComponent):c,r)}var AN=tt.create({name:`slashCommand`,addOptions(){return{itemsSources:[Oy],categoryLabels:{basic:`Basic blocks`,insert:`Insert`}}},addProseMirrorPlugins(){let e=this;return[ne({editor:this.editor,pluginKey:ON,char:`/`,startOfLine:!1,allow:q,items:({query:t,editor:n})=>kN({sources:e.options.itemsSources,categoryOrder:[...new Set([`skills`,`basic`,`insert`,...Object.keys(e.options.categoryLabels)])],query:t,state:n.state,editor:n}),command:({editor:e,range:t,props:n})=>wN({editor:e,item:n,range:t}),render:()=>{let t=null,n=null,r=0,i={popup:null,stopAutoUpdate:null},a=null,o=e=>{e!==r&&(r=e,s())},s=()=>{!t||!n||t.updateProps({items:n.items,selectedIndex:r,categoryLabels:e.options.categoryLabels,onSelect:n.command,onHoverIndex:o})};return{onStart(s){n=s,r=0;let c=Pe(()=>n,`slash-command`);i.popup=c.popup,a=c.doPosition,t=new fe(TN,{props:{items:s.items,selectedIndex:r,categoryLabels:e.options.categoryLabels,onSelect:s.command,onHoverIndex:o},editor:s.editor}),c.popup.appendChild(t.element),i.stopAutoUpdate=c.startAutoUpdate(),c.reveal()},onUpdate(e){n=e,r=Math.min(r,Math.max(0,e.items.length-1)),s(),a?.()},onKeyDown({event:e}){if(!n||n.items.length===0)return!1;let t=n.items;if(e.key===`ArrowDown`)return r=(r+1)%t.length,s(),!0;if(e.key===`ArrowUp`)return r=(r-1+t.length)%t.length,s(),!0;if(e.key===`Enter`||e.key===`Tab`){let e=t[r];return e&&n.command(e),!0}return e.key,!1},onExit(){H(i),a=null,t?.destroy(),t=null,n=null,r=0}}}})]}}),jN=new Nn(`sourceDirty`),MN=tt.create({name:`sourceDirtyObserver`,addProseMirrorPlugins(){return[new ar({key:jN,appendTransaction(e,t,n){if(!e.some(e=>!e.getMeta(Zl))||!e.some(e=>e.docChanged))return null;let r=new Rn;for(let t of e)r.appendMapping(t.mapping);let i=r.invert(),a=[];if(n.doc.descendants((e,n)=>{if(e.type.name!==`jsxComponent`||e.attrs.sourceDirty)return;let r=i.map(n),o=t.doc.nodeAt(r),s=!o||o.type.name!==`jsxComponent`,c=typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0;if(s&&c)return;if(!o){(e.content.size>0||Object.keys(e.attrs.props??{}).length>0)&&a.push({pos:n});return}if(o.type.name!==`jsxComponent`){a.push({pos:n});return}let l=!NN(o.attrs.props,e.attrs.props),u=!o.content.eq(e.content);(l||u)&&a.push({pos:n})}),a.length===0)return null;let o=n.tr;for(let{pos:e}of a)o.setNodeAttribute(e,`sourceDirty`,!0);return o}})]}});function NN(e,t){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!NN(e[n],t[n]))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!NN(e[r],t[r]))return!1;return!0}var PN=tt.create({name:`tabFocusTrap`,priority:1,addKeyboardShortcuts(){return{Tab:()=>!0,"Shift-Tab":()=>!0}}});function FN(e,t){let n=e.doc.nodeAt(t);if(!n||n.type.name!==`table`)return null;let r=Cr.get(n);return{map:r,tableStart:t+1,table:n,left:0,top:0,right:r.width,bottom:r.height}}function IN(e,t){let n=FN(e,t);return n?Ht(e.tr,n,n.map.width):null}function LN(e,t){let n=FN(e,t);return n?$e(e.tr,n,n.map.height):null}function RN(e,t){if(!e.dom.contains(t))return null;let n;try{n=e.posAtDOM(t,0)}catch{return null}return n<0?null:Gt(e.state.doc.resolve(n))?.pos??null}var zN=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="M12 5v14"/></svg>`;function BN(e,t){let n=document.createElement(`button`);return n.type=`button`,n.className=`ok-table-insert-bar ok-table-insert-${e}`,n.setAttribute(`aria-label`,t),n.tabIndex=-1,n.setAttribute(Fg,`true`),n.innerHTML=zN,n.addEventListener(`mousedown`,e=>{e.preventDefault(),e.stopPropagation()}),n}var VN=class{overlays=new Map;mount;lastEditable;constructor(e,t){this.view=e,this.editor=t,this.mount=e.dom.parentElement??e.dom,this.lastEditable=t.isEditable,this.reconcile()}update(e,t){let n=this.editor.isEditable!==this.lastEditable;this.lastEditable=this.editor.isEditable,!(!n&&t.doc.eq(this.view.state.doc))&&this.reconcile()}destroy(){for(let e of this.overlays.keys())this.removeOverlay(e)}reconcile(){if(!this.editor.isEditable){this.destroy();return}let e=new Set(this.view.dom.querySelectorAll(`.tableWrapper`));for(let t of this.overlays.keys())e.has(t)||this.removeOverlay(t);for(let t of e)this.overlays.has(t)||this.addOverlay(t)}addOverlay(e){let t=document.createElement(`div`);t.className=`ok-table-insert-controls`,t.setAttribute(Fg,`true`);let n=BN(`column`,`Add column`),r=BN(`row`,`Add row`);n.addEventListener(`click`,()=>this.insert(e,IN)),r.addEventListener(`click`,()=>this.insert(e,LN)),t.append(n,r),this.mount.appendChild(t);let i=ze(e,t,()=>{let{width:t,height:i}=e.getBoundingClientRect();Le(e,n,{strategy:`absolute`,placement:`right-start`}).then(({x:e,y:t})=>{n.style.left=`${e}px`,n.style.top=`${t}px`,n.style.height=`${i}px`}).catch(()=>{}),Le(e,r,{strategy:`absolute`,placement:`bottom-start`}).then(({x:e,y:n})=>{r.style.left=`${e}px`,r.style.top=`${n}px`,r.style.width=`${t}px`}).catch(()=>{})}),a=e=>{let t=e.target instanceof Element?e.target.closest(`td, th`):null,i=t?.parentElement;n.classList.toggle(`is-active`,!!t&&t===i?.lastElementChild),r.classList.toggle(`is-active`,!!i&&i===i.parentElement?.lastElementChild)},o=()=>{n.classList.remove(`is-active`),r.classList.remove(`is-active`)};e.addEventListener(`pointerover`,a),e.addEventListener(`pointerleave`,o),this.overlays.set(e,{container:t,cleanup:()=>{i(),e.removeEventListener(`pointerover`,a),e.removeEventListener(`pointerleave`,o),t.remove()}})}removeOverlay(e){let t=this.overlays.get(e);t&&(t.cleanup(),this.overlays.delete(e))}insert(e,t){let n=e.querySelector(`table`);if(!n)return;let r=RN(this.view,n);if(r===null)return;let i=t(this.view.state,r);i&&(this.view.dispatch(i),this.view.focus())}},HN=tt.create({name:`tableInsertControls`,addProseMirrorPlugins(){let e=this.editor;return[new ar({key:new Nn(`tableInsertControls`),view:t=>new VN(t,e)})]}});function UN(e){let{selection:t}=e;if(!(t instanceof lr))return null;let n=br(t.$from);if(!n)return null;let r=n.node(-1),i=n.start(-1),a=Cr.get(r),o=a.findCell(n.pos-i);if(o.bottom===a.height){let t=$e(e.tr,{map:a,tableStart:i,table:r,left:0,top:0,right:a.width,bottom:a.height},a.height),n=t.doc.nodeAt(i-1);if(!n)return null;let s=i+Cr.get(n).positionAt(a.height,o.left,n);return t.setSelection(lr.near(t.doc.resolve(s+1))),t.scrollIntoView()}let s=a.positionAt(o.bottom,o.left,r),c=r.nodeAt(s);if(!c)return null;let l=i+s,u=e.tr;return u.setSelection(lr.near(u.doc.resolve(l+c.nodeSize-1),-1)),u.scrollIntoView()}var WN=tt.create({name:`tableRowEnter`,addKeyboardShortcuts(){return{Enter:({editor:e})=>{let t=UN(e.state);return t?(e.view.dispatch(t),!0):!1}}}}),GN=`ok:tag-click`;function KN(e){if(typeof document>`u`)return;let t={value:e};document.dispatchEvent(new CustomEvent(GN,{detail:t}))}function qN(e){return e instanceof Element?e.closest(`a[data-tag]`):null}var JN=tt.create({name:`tagClick`,addProseMirrorPlugins(){return[new ar({props:{handleDOMEvents:{click(e,t){let n=qN(t.target);if(!n)return!1;let r=n.getAttribute(`data-tag`);return r?(t.preventDefault(),t.stopPropagation(),KN(r),!0):!1}}}})]}});function YN(e,t,n){if(typeof t!=`number`||!n||!ct.test(n))return!1;let{state:r,view:i}=e,a=r.doc.nodeAt(t);if(!a||a.type.name!==`tag`)return!1;let o=r.tr.setNodeMarkup(t,null,{...a.attrs,value:n}),s=t+a.nodeSize;return o.insertText(` `,s),o.setSelection(lr.create(o.doc,s+1)),i.dispatch(o),i.focus(),!0}function XN(e,t){if(typeof t!=`number`)return;let{state:n,view:r}=e,i=n.doc.nodeAt(t);if(!i||i.type.name!==`tag`)return;let a=n.tr.delete(t,t+i.nodeSize);r.dispatch(a),r.focus()}function ZN(e){let t=(0,$.c)(3),{value:n}=e,r=`#tag/${n}`,i;return t[0]!==r||t[1]!==n?(i=(0,Z.jsxs)(`a`,{className:`tag`,"data-tag":n,href:r,children:[`#`,n]}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function QN(e){let t=(0,$.c)(20),{initialDraft:n,onCommit:r,onCancel:i}=e,{_:a}=o(),s=(0,Q.useRef)(null),[c,l]=(0,Q.useState)(n),u=(0,Q.useRef)(!1),d,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{let e=requestAnimationFrame(()=>{s.current?.focus()});return()=>cancelAnimationFrame(e)},f=[],t[0]=d,t[1]=f):(d=t[0],f=t[1]),(0,Q.useEffect)(d,f);let p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`font-mono`,children:`#`}),t[2]=p):p=t[2];let m=Math.max(c.length,8),h;t[3]===a?h=t[4]:(h=a({id:`U2pMtf`}),t[3]=a,t[4]=h);let g;t[5]===a?g=t[6]:(g=a({id:`knjOzA`}),t[5]=a,t[6]=g);let _;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{let t=e.target.value;(t===``||ct.test(t))&&l(t)},t[7]=_):_=t[7];let v,y;t[8]!==c||t[9]!==i||t[10]!==r?(v=e=>{e.key===`Enter`||e.key===` `?(e.preventDefault(),u.current=!0,r(c)||(u.current=!1,i())):(e.key===`Escape`||e.key===`Backspace`&&c===``)&&(e.preventDefault(),i())},y=()=>{if(!u.current){if(c===``){i();return}ct.test(c)?r(c):i()}},t[8]=c,t[9]=i,t[10]=r,t[11]=v,t[12]=y):(v=t[11],y=t[12]);let b;return t[13]!==c||t[14]!==m||t[15]!==h||t[16]!==g||t[17]!==v||t[18]!==y?(b=(0,Z.jsxs)(`span`,{className:`tag tag-placeholder inline-flex items-center rounded-sm border border-dashed border-muted-foreground/40 bg-muted/30 px-1.5 py-0.5 text-xs text-muted-foreground`,"data-component-type":`tag-placeholder`,children:[p,(0,Z.jsx)(`input`,{ref:s,type:`text`,value:c,size:m,placeholder:h,"aria-label":g,spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`,className:`bg-transparent border-0 p-0 outline-none focus:outline-none focus:ring-0 text-inherit font-inherit`,onChange:_,onKeyDown:v,onBlur:y})]}),t[13]=c,t[14]=m,t[15]=h,t[16]=g,t[17]=v,t[18]=y,t[19]=b):b=t[19],b}function $N(e){let t=(0,$.c)(5),{node:n,getPos:r,editor:i}=e,a=typeof n.attrs.value==`string`?n.attrs.value:``;if(a===``){let e;return t[0]!==i||t[1]!==r?(e=(0,Z.jsx)(ie,{as:`span`,children:(0,Z.jsx)(QN,{initialDraft:``,onCommit:e=>YN(i,typeof r==`function`?r():void 0,e),onCancel:()=>XN(i,typeof r==`function`?r():void 0)})}),t[0]=i,t[1]=r,t[2]=e):e=t[2],e}let o;return t[3]===a?o=t[4]:(o=(0,Z.jsx)(ie,{as:`span`,children:(0,Z.jsx)(ZN,{value:a})}),t[3]=a,t[4]=o),o}var eP=Tt.extend({priority:200,addNodeView(){return de($N)},addKeyboardShortcuts(){return{Backspace:()=>{if(qs.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeBefore;if(t?.type.name===`tag`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from-t.nodeSize,e.from)),!0}return!1},Delete:()=>{if(qs.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeAfter;if(t?.type.name===`tag`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from,e.from+t.nodeSize)),!0}return!1}}},addProseMirrorPlugins(){return[ec(this.editor)]}}),tP=2048,nP=24;function rP(e){if(typeof e!=`string`)return{kind:`unsupported`,value:``};let t=e.trim();if(t===``||t.length>tP)return{kind:`unsupported`,value:``};if(lP(t))return{kind:`emoji`,value:t};let n=uP(t);return n===`url`?{kind:`url`,value:t}:n===`path`?{kind:`path`,value:_n(`/api/asset?path=${encodeURIComponent(cP(t))}`)}:{kind:`unsupported`,value:``}}function iP(e){return sP(e.banner).kind===`unsupported`?sP(e.cover).kind===`unsupported`?null:`cover`:`banner`}function aP(e){if(typeof e==`string`&&e.trim()===``)return null;let t=typeof e==`number`?e:typeof e==`string`?Number(e):NaN;return Number.isFinite(t)?t<0?0:t>1?1:t:null}function oP(e){return e===null?`center`:`center ${Math.round(e*100)}%`}function sP(e){if(typeof e!=`string`)return{kind:`unsupported`,value:``};let t=e.trim(),n=ut(t),r=n?n.target:t;if(r===``||r.length>tP)return{kind:`unsupported`,value:``};let i=uP(r);return i===`url`?{kind:`url`,value:r}:i===`path`?{kind:`path`,value:_n(`/api/asset?path=${encodeURIComponent(cP(r))}`)}:{kind:`unsupported`,value:``}}function cP(e){return e.startsWith(`/`)?e.slice(1):e}function lP(e){if(/\p{L}/u.test(e)||e.includes(`/`))return!1;let t=0;for(let n of e)t++;if(t>nP)return!1;let n=e.lastIndexOf(`.`);if(n>-1){let t=e.slice(n+1).toLowerCase();if(un.has(t))return!1}return!0}function uP(e){let t=dP(e);if(!t||!un.has(t))return`unsupported`;let n=e.indexOf(`:`),r=e.indexOf(`/`);return n>-1&&(r===-1||n<r)?Kt(e)?`url`:`unsupported`:e.startsWith(`//`)||e.includes(`?`)||e.includes(`#`)||e.startsWith(`../`)||e.includes(`/../`)?`unsupported`:`path`}function dP(e){let t=e.lastIndexOf(`/`),n=t>-1?e.slice(t+1):e,r=n.search(/[?#]/),i=r>-1?n.slice(0,r):n,a=i.lastIndexOf(`.`);return a<=0||a===i.length-1?null:i.slice(a+1).toLowerCase()}function fP(e){let t=(0,$.c)(133),{open:n,target:r,alias:i,anchor:s,pages:c,assetPaths:l,filePaths:u,loading:d,onOpenChange:f,onSave:p}=e,[m,h]=(0,Q.useState)(r),[g,_]=(0,Q.useState)(i??``),[b,x]=(0,Q.useState)(s??``),S=(0,Q.useId)(),C=(0,Q.useId)(),w=(0,Q.useId)(),T=(0,Q.useId)(),{_:E}=o(),D;t[0]!==l||t[1]!==m||t[2]!==u?(D=ce(m,l,u),t[0]=l,t[1]=m,t[2]=u,t[3]=D):D=t[3];let O=D,j;t[4]!==l||t[5]!==m||t[6]!==u||t[7]!==c?(j=oe(m,c,l,u),t[4]=l,t[5]=m,t[6]=u,t[7]=c,t[8]=j):j=t[8];let M=nj(m,j&&!O&&n),P=(0,Q.useRef)(!1),B,V;t[9]!==i||t[10]!==s||t[11]!==n||t[12]!==r?(B=()=>{if(!n){P.current=!1;return}P.current||(P.current=!0,h(r),_(i??``),x(s??``))},V=[n,r,i,s],t[9]=i,t[10]=s,t[11]=n,t[12]=r,t[13]=B,t[14]=V):(B=t[13],V=t[14]),(0,Q.useEffect)(B,V);let H;t[15]!==g||t[16]!==b||t[17]!==m||t[18]!==f||t[19]!==p?(H=function(){let e=m.trim();e&&(p(e,g.trim()||null,b.trim()||null),f(!1))},t[15]=g,t[16]=b,t[17]=m,t[18]=f,t[19]=p,t[20]=H):H=t[20];let U=H,ee;t[21]===U?ee=t[22]:(ee=function(e){e.key===`Enter`&&(e.preventDefault(),U())},t[21]=U,t[22]=ee);let te=ee,W;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(W=function(e){h(e.path),x(``)},t[23]=W):W=t[23];let ne=W,re,ie,ae,se,le,G,K,q,ue,de,fe,pe,me,he,ge,_e,J;if(t[24]!==E||t[25]!==w||t[26]!==C||t[27]!==l||t[28]!==g||t[29]!==b||t[30]!==m||t[31]!==te||t[32]!==T||t[33]!==M||t[34]!==d||t[35]!==f||t[36]!==n||t[37]!==c||t[38]!==S){let e=new Map,r=M?.map(t=>{let n=e.get(t.slug)??0;e.set(t.slug,n+1);let r=n===0?t.slug:`${t.slug}-${n}`;return{...t,reactKey:r}}),i=!!r?.length;ae=z,he=n,ge=f,ie=N,q=`sm:max-w-xl`,ue=``,de=rA,fe=rA,pe=rA;let o;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(A,{children:(0,Z.jsx)(a,{id:`xzktOa`})}),t[56]=o):o=t[56],t[57]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Z.jsxs)(R,{children:[o,(0,Z.jsx)(k,{children:(0,Z.jsx)(a,{id:`Jhj_lh`})})]}),t[57]=me):me=t[57],re=F,le=`space-y-6`;let s;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(a,{id:`lGs_bQ`,components:{0:(0,Z.jsx)(`span`,{className:`text-red-500`})}}),t[58]=s):s=t[58];let u;t[59]===S?u=t[60]:(u=(0,Z.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:S,children:s}),t[59]=S,t[60]=u);let p;t[61]===E?p=t[62]:(p=E({id:`aM23Wr`}),t[61]=E,t[62]=p);let y;t[63]!==l||t[64]!==m||t[65]!==te||t[66]!==d||t[67]!==c||t[68]!==p||t[69]!==S?(y=(0,Z.jsx)(oA,{id:S,value:m,pages:c,assetPaths:l,includeAssets:!0,loading:d,onValueChange:h,onSuggestionSelect:ne,placeholder:p,autoFocus:!0,"aria-required":`true`,onKeyDown:te}),t[63]=l,t[64]=m,t[65]=te,t[66]=d,t[67]=c,t[68]=p,t[69]=S,t[70]=y):y=t[70],t[71]!==u||t[72]!==y?(G=(0,Z.jsxs)(`div`,{children:[u,y]}),t[71]=u,t[72]=y,t[73]=G):G=t[73];let D;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(a,{id:`OTF92M`,components:{0:(0,Z.jsx)(`span`,{className:`font-normal text-muted-foreground`})}}),t[74]=D):D=t[74];let O;t[75]===w?O=t[76]:(O=(0,Z.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:w,children:D}),t[75]=w,t[76]=O);let j;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>_(e.target.value),t[77]=j):j=t[77];let P;t[78]===E?P=t[79]:(P=E({id:`BH56dn`}),t[78]=E,t[79]=P);let I;t[80]!==w||t[81]!==g||t[82]!==te||t[83]!==P?(I=(0,Z.jsx)(li,{id:w,value:g,onChange:j,placeholder:P,onKeyDown:te}),t[80]=w,t[81]=g,t[82]=te,t[83]=P,t[84]=I):I=t[84],t[85]!==O||t[86]!==I?(K=(0,Z.jsxs)(`div`,{children:[O,I]}),t[85]=O,t[86]=I,t[87]=K):K=t[87];let L;t[88]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(a,{id:`Tjc1pH`,components:{0:(0,Z.jsx)(`span`,{className:`font-normal text-muted-foreground`})}}),t[88]=L):L=t[88],t[89]===C?_e=t[90]:(_e=(0,Z.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:C,children:L}),t[89]=C,t[90]=_e);let B;t[91]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>x(e.target.value),t[91]=B):B=t[91];let V;t[92]===E?V=t[93]:(V=E({id:`W-ntoW`}),t[92]=E,t[93]=V),t[94]!==C||t[95]!==b||t[96]!==te||t[97]!==V?(J=(0,Z.jsx)(li,{id:C,value:b,onChange:B,placeholder:V,onKeyDown:te}),t[94]=C,t[95]=b,t[96]=te,t[97]=V,t[98]=J):J=t[98],se=i&&(0,Z.jsx)(`div`,{id:T,className:`mt-1.5 max-h-36 overflow-y-auto subtle-scrollbar rounded-md border border-border bg-muted/30`,children:r.map(e=>(0,Z.jsxs)(`button`,{type:`button`,"aria-pressed":b===e.slug,className:v(`flex w-full items-center gap-2 px-2 py-1 text-left text-sm hover:bg-accent hover:text-accent-foreground`,b===e.slug&&`bg-accent text-accent-foreground`),style:{paddingLeft:`${(e.level-1)*12+8}px`},onClick:()=>x(b===e.slug?``:e.slug),children:[(0,Z.jsxs)(`span`,{className:`w-7 shrink-0 font-mono text-[10px] text-muted-foreground`,children:[`H`,e.level]}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.text})]},e.reactKey))}),t[24]=E,t[25]=w,t[26]=C,t[27]=l,t[28]=g,t[29]=b,t[30]=m,t[31]=te,t[32]=T,t[33]=M,t[34]=d,t[35]=f,t[36]=n,t[37]=c,t[38]=S,t[39]=re,t[40]=ie,t[41]=ae,t[42]=se,t[43]=le,t[44]=G,t[45]=K,t[46]=q,t[47]=ue,t[48]=de,t[49]=fe,t[50]=pe,t[51]=me,t[52]=he,t[53]=ge,t[54]=_e,t[55]=J}else re=t[39],ie=t[40],ae=t[41],se=t[42],le=t[43],G=t[44],K=t[45],q=t[46],ue=t[47],de=t[48],fe=t[49],pe=t[50],me=t[51],he=t[52],ge=t[53],_e=t[54],J=t[55];let ve;t[99]!==se||t[100]!==_e||t[101]!==J?(ve=(0,Z.jsxs)(`div`,{children:[_e,J,se]}),t[99]=se,t[100]=_e,t[101]=J,t[102]=ve):ve=t[102];let ye;t[103]!==le||t[104]!==G||t[105]!==K||t[106]!==ve?(ye=(0,Z.jsxs)(`div`,{className:le,children:[G,K,ve]}),t[103]=le,t[104]=G,t[105]=K,t[106]=ve,t[107]=ye):ye=t[107];let be;t[108]!==re||t[109]!==ye?(be=(0,Z.jsx)(re,{children:ye}),t[108]=re,t[109]=ye,t[110]=be):be=t[110];let xe;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,Z.jsx)(L,{asChild:!0,children:(0,Z.jsx)(y,{variant:`outline`,children:(0,Z.jsx)(a,{id:`dEgA5A`})})}),t[111]=xe):xe=t[111];let Se;t[112]===m?Se=t[113]:(Se=m.trim(),t[112]=m,t[113]=Se);let Ce=!Se,we;t[114]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,Z.jsx)(a,{id:`tfDRzk`}),t[114]=we):we=t[114];let Te;t[115]!==U||t[116]!==Ce?(Te=(0,Z.jsxs)(I,{children:[xe,(0,Z.jsx)(y,{onClick:U,disabled:Ce,children:we})]}),t[115]=U,t[116]=Ce,t[117]=Te):Te=t[117];let Ee;t[118]!==ie||t[119]!==q||t[120]!==ue||t[121]!==de||t[122]!==fe||t[123]!==pe||t[124]!==me||t[125]!==be||t[126]!==Te?(Ee=(0,Z.jsxs)(ie,{className:q,"data-ok-layer-spawned":ue,onPointerDownOutside:de,onFocusOutside:fe,onInteractOutside:pe,children:[me,be,Te]}),t[118]=ie,t[119]=q,t[120]=ue,t[121]=de,t[122]=fe,t[123]=pe,t[124]=me,t[125]=be,t[126]=Te,t[127]=Ee):Ee=t[127];let De;return t[128]!==ae||t[129]!==he||t[130]!==ge||t[131]!==Ee?(De=(0,Z.jsx)(ae,{open:he,onOpenChange:ge,children:Ee}),t[128]=ae,t[129]=he,t[130]=ge,t[131]=Ee,t[132]=De):De=t[132],De}function pP(e){let t=(0,$.c)(119),{editor:n,getPos:r,onClose:i,onNavigate:s}=e,c=r(),l=c==null?null:n.state.doc.nodeAt(c),u=String(l?.attrs.target??``),f=Bt(l?.attrs.alias),p=Bt(l?.attrs.anchor),m=Ye({target:u,alias:f,anchor:p}),{addPage:h,assetPaths:g,filePaths:_,folderPaths:b,pages:x,pagesBySlug:S,pagesByBasename:E,loading:D}=Jr(),O=gr(u,p),k=O?.kind===`external`?O:null,A=O?.kind===`asset`?ce(O.url,g,_)??O.url.replace(/^\//,``):null,j=A?null:G(u,{pages:x,folderPaths:b,pagesBySlug:S,pagesByBasename:E,fallbackTargets:ae(u)}),[M,N]=(0,Q.useState)(!1),[P,F]=(0,Q.useState)(!1),{_:I}=o(),L=ZA({docName:!k&&!D&&j?.kind===`navigate`&&j.displayState===`resolved`?j.hashDocName:null,anchor:p,enabled:!0});if(!l)return null;let R;t[0]!==n.state||t[1]!==n.view||t[2]!==r?(R=function(e,t,i){let a=r();a!=null&&n.view.dispatch(n.state.tr.setNodeMarkup(a,void 0,{...n.state.doc.nodeAt(a)?.attrs,target:e,alias:t,anchor:i}))},t[0]=n.state,t[1]=n.view,t[2]=r,t[3]=R):R=t[3];let z=R,B;t[4]!==n.state||t[5]!==n.view||t[6]!==r||t[7]!==i?(B=function(){let e=r();if(e==null)return;let t=n.state.doc.nodeAt(e);t&&(n.view.dispatch(n.state.tr.delete(e,e+t.nodeSize)),i())},t[4]=n.state,t[5]=n.view,t[6]=r,t[7]=i,t[8]=B):B=t[8];let V=B,H=function(e){if(e!==u){let t=r();if(t==null)return;n.view.dispatch(n.state.tr.setNodeMarkup(t,void 0,{...n.state.doc.nodeAt(t)?.attrs,target:e,alias:f??m}))}},U=function(){return j?.kind===`create`?{initialDir:j.initialDir,suggestedName:j.suggestedName}:null},ee=async function(){let e=U();if(!(!e||P)){F(!0);try{await Gk(e,{addPage:h,onCreated(e){H(e),window.location.hash=`#/${e}`,i()}}),F(!1)}catch(e){let t=e;ci.error(t instanceof Error?t.message:I({id:`tfi40B`})),F(!1)}}},te=!k&&!D&&A!==null,W=!k&&!D&&j?.kind===`navigate`&&j.displayState===`resolved`,ne=!k&&!D&&j?.kind===`navigate`&&j.displayState===`folder`,re=!k&&!D&&!A&&j?.kind===`create`,ie=!!k,oe=k?Vo(k.url)?k.url:null:te&&A?fi(A):W&&j?.kind===`navigate`?Ne({docName:j.hashDocName,anchor:p}):null,se=!D&&oe!==null&&(ie||te||W),le,K,q,ue,de;if(t[9]!==I||t[10]!==f||t[11]!==p||t[12]!==A||t[13]!==n.state||t[14]!==n.view||t[15]!==k||t[16]!==r||t[17]!==te||t[18]!==ne||t[19]!==W||t[20]!==re||t[21]!==D||t[22]!==u){if(D){let e;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(ni,{className:`size-3.5 shrink-0 animate-spin`,"aria-hidden":`true`}),t[28]=e):e=t[28],q={icon:e,text:I({id:`yQE2r9`}),className:`text-muted-foreground/80`}}else if(k){let e;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Yr,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[29]=e):e=t[29],q={icon:e,text:I({id:`hpDtUm`}),className:`text-muted-foreground`}}else if(te){let e;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(ts,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[30]=e):e=t[30],q={icon:e,text:I({id:`bUUVED`}),className:`text-muted-foreground`}}else if(ne){let e;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)($r,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[31]=e):e=t[31],q={icon:e,text:I({id:`kNqMMd`}),className:`text-muted-foreground`}}else if(re){let e;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Kr,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[32]=e):e=t[32],q={icon:e,text:I({id:`8F1i42`}),className:`text-red-700 dark:text-red-300`}}else if(W){let e;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(rs,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[33]=e):e=t[33],q={icon:e,text:I({id:`Hrz9NY`}),className:`text-muted-foreground`}}else{let e;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Kr,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[34]=e):e=t[34],q={icon:e,text:I({id:`DeDYLr`}),className:`text-muted-foreground/80`}}let e;t[35]!==n.state||t[36]!==n.view||t[37]!==r?(e=()=>{let e=r();if(typeof e!=`number`)return new DOMRect;let t=n.state.doc.nodeAt(e);if(!t)return new DOMRect;try{return gt(n.view,e,e+t.nodeSize)}catch{return new DOMRect}},t[35]=n.state,t[36]=n.view,t[37]=r,t[38]=e):e=t[38];let i;t[39]!==n.view.dom||t[40]!==e?(i={getBoundingClientRect:e,contextElement:n.view.dom},t[39]=n.view.dom,t[40]=e,t[41]=i):i=t[41],de=i,K=A??(k?k.url:`${u}${p?`#${p}`:``}`);let a=p?`${u}#${p}`:u;le=f?`[[${a}|${f}]]`:`[[${a}]]`,ue=v(`flex shrink-0`,q.className),t[9]=I,t[10]=f,t[11]=p,t[12]=A,t[13]=n.state,t[14]=n.view,t[15]=k,t[16]=r,t[17]=te,t[18]=ne,t[19]=W,t[20]=re,t[21]=D,t[22]=u,t[23]=le,t[24]=K,t[25]=q,t[26]=ue,t[27]=de}else le=t[23],K=t[24],q=t[25],ue=t[26],de=t[27];let fe;t[42]!==q.icon||t[43]!==ue?(fe=(0,Z.jsx)(`span`,{className:ue,children:q.icon}),t[42]=q.icon,t[43]=ue,t[44]=fe):fe=t[44];let pe=fe,me;t[45]!==pe||t[46]!==re||t[47]!==q.text?(me=re?(0,Z.jsxs)(T,{children:[(0,Z.jsx)(C,{asChild:!0,children:(0,Z.jsx)(`span`,{className:`flex shrink-0`,"data-slot":`wiki-link-prop-panel-icon-trigger`,children:pe})}),(0,Z.jsx)(w,{children:q.text})]}):pe,t[45]=pe,t[46]=re,t[47]=q.text,t[48]=me):me=t[48];let he=me,ge=`${q.text}: ${K}`,J;t[49]!==K||t[50]!==ie||t[51]!==re||t[52]!==oe||t[53]!==se||t[54]!==i||t[55]!==s?(J=(0,Z.jsx)(C,{asChild:!0,children:se?(0,Z.jsx)(`a`,{href:oe??void 0,...ie?{target:`_blank`,rel:`noopener noreferrer`}:{},onClick:e=>_e(e,s,i),"data-slot":`wiki-link-prop-panel-text`,className:`block truncate text-sm font-medium text-foreground underline-offset-2 hover:underline focus-visible:underline`,children:K}):(0,Z.jsx)(`span`,{"data-slot":`wiki-link-prop-panel-text`,className:v(`block truncate text-sm font-medium`,re?`text-muted-foreground`:`text-foreground`),children:K})}),t[49]=K,t[50]=ie,t[51]=re,t[52]=oe,t[53]=se,t[54]=i,t[55]=s,t[56]=J):J=t[56];let ve;t[57]===K?ve=t[58]:(ve=(0,Z.jsx)(w,{className:`max-w-80 break-all`,children:K}),t[57]=K,t[58]=ve);let ye;t[59]!==J||t[60]!==ve?(ye=(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Z.jsxs)(T,{children:[J,ve]})}),t[59]=J,t[60]=ve,t[61]=ye):ye=t[61];let be;t[62]!==ee||t[63]!==P||t[64]!==re?(be=re?(0,Z.jsxs)(y,{type:`button`,size:`sm`,variant:`link`,disabled:P,onClick:()=>void ee(),"data-slot":`wiki-link-prop-panel-create`,className:`flex items-center text-foreground`,children:[(0,Z.jsx)(d,{className:`size-3.5`,"aria-hidden":`true`}),P?(0,Z.jsx)(a,{id:`HM56Bx`}):(0,Z.jsx)(a,{id:`XRuL0i`})]}):null,t[62]=ee,t[63]=P,t[64]=re,t[65]=be):be=t[65];let xe;t[66]===I?xe=t[67]:(xe=I({id:`ePK91l`}),t[66]=I,t[67]=xe);let Se;t[68]===N?Se=t[69]:(Se=()=>N(!0),t[68]=N,t[69]=Se);let Ce;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,Z.jsx)(Ss,{className:`size-3.5`,"aria-hidden":`true`}),t[70]=Ce):Ce=t[70];let we;t[71]!==xe||t[72]!==Se?(we=(0,Z.jsx)(C,{asChild:!0,children:(0,Z.jsx)(y,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":xe,onClick:Se,"data-slot":`wiki-link-prop-panel-edit`,children:Ce})}),t[71]=xe,t[72]=Se,t[73]=we):we=t[73];let Te;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,Z.jsx)(w,{children:(0,Z.jsx)(a,{id:`ePK91l`})}),t[74]=Te):Te=t[74];let Ee;t[75]===we?Ee=t[76]:(Ee=(0,Z.jsxs)(T,{children:[we,Te]}),t[75]=we,t[76]=Ee);let De;t[77]===le?De=t[78]:(De=(0,Z.jsx)(qr,{copyContent:le}),t[77]=le,t[78]=De);let Oe;t[79]===I?Oe=t[80]:(Oe=I({id:`t_YqKh`}),t[79]=I,t[80]=Oe);let ke;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,Z.jsx)(ai,{className:`size-3.5`,"aria-hidden":`true`}),t[81]=ke):ke=t[81];let Ae;t[82]!==V||t[83]!==Oe?(Ae=(0,Z.jsx)(C,{asChild:!0,children:(0,Z.jsx)(y,{type:`button`,size:`icon-sm`,variant:`ghost`,"aria-label":Oe,onClick:V,"data-slot":`wiki-link-prop-panel-remove`,children:ke})}),t[82]=V,t[83]=Oe,t[84]=Ae):Ae=t[84];let je;t[85]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,Z.jsx)(w,{children:(0,Z.jsx)(a,{id:`t_YqKh`})}),t[85]=je):je=t[85];let Me;t[86]===Ae?Me=t[87]:(Me=(0,Z.jsxs)(T,{children:[Ae,je]}),t[86]=Ae,t[87]=Me);let Pe;t[88]!==be||t[89]!==Ee||t[90]!==De||t[91]!==Me?(Pe=(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[be,Ee,De,Me]}),t[88]=be,t[89]=Ee,t[90]=De,t[91]=Me,t[92]=Pe):Pe=t[92];let Fe;t[93]!==he||t[94]!==ye||t[95]!==Pe?(Fe=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[he,ye,Pe]}),t[93]=he,t[94]=ye,t[95]=Pe,t[96]=Fe):Fe=t[96];let Ie;t[97]===L?Ie=t[98]:(Ie=L?(0,Z.jsx)(bA,{preview:L}):null,t[97]=L,t[98]=Ie);let Le;t[99]!==i||t[100]!==Fe||t[101]!==Ie||t[102]!==ge||t[103]!==de?(Le=(0,Z.jsxs)(Fk,{kind:`wiki-link`,ariaLabel:ge,onDeactivate:i,triggerReference:de,className:`w-96`,children:[Fe,Ie]}),t[99]=i,t[100]=Fe,t[101]=Ie,t[102]=ge,t[103]=de,t[104]=Le):Le=t[104];let Re;t[105]!==f||t[106]!==p||t[107]!==g||t[108]!==M||t[109]!==_||t[110]!==z||t[111]!==D||t[112]!==x||t[113]!==N||t[114]!==u?(Re=(0,Z.jsx)(fP,{open:M,target:u,alias:f,anchor:p,pages:x,assetPaths:g,filePaths:_,loading:D,onOpenChange:N,onSave:z}),t[105]=f,t[106]=p,t[107]=g,t[108]=M,t[109]=_,t[110]=z,t[111]=D,t[112]=x,t[113]=N,t[114]=u,t[115]=Re):Re=t[115];let ze;return t[116]!==Le||t[117]!==Re?(ze=(0,Z.jsxs)(Z.Fragment,{children:[Le,Re]}),t[116]=Le,t[117]=Re,t[118]=ze):ze=t[118],ze}var mP=0;function hP(){return`wiki-link-${++mP}`}function gP(e){let t=e.doc??(typeof document<`u`?document:{createElement:null,createTextNode:null}),n=t.createElement(`span`);n.setAttribute(`data-wiki-link`,``),n.setAttribute(`data-node-id`,e.nodeId),n.setAttribute(`data-target`,e.target),n.setAttribute(`data-alias`,e.alias??``),n.setAttribute(`data-anchor`,e.anchor??``),n.setAttribute(`contenteditable`,`false`),n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`),n.setAttribute(`aria-label`,`Wiki link: ${e.target}${e.anchor?`#${e.anchor}`:``}`),n.classList.add(`wiki-link-chip`),n.style.touchAction=`manipulation`;let r=t.createElement(`span`);r.setAttribute(`data-wiki-link-icon`,``),r.setAttribute(`aria-hidden`,`true`),n.appendChild(r);let i=e.alias??`${e.target}${e.anchor?`#${e.anchor}`:``}`,a=t.createTextNode(i);return n.appendChild(a),{dom:n,iconSpan:r}}function _P(e,t){if(!t||!e)return null;let n=W(e,t);if(!n)return null;let r=t.pageIcons?.get(n);if(!r)return null;let i=rP(r);return i.kind===`unsupported`?null:i}function vP(e,t,n=document){let r=t?.kind??``,i=t?.value??``;if(e.getAttribute(`data-kind`)===r&&e.getAttribute(`data-value`)===i)return;for(e.setAttribute(`data-kind`,r),e.setAttribute(`data-value`,i);e.firstChild;)e.removeChild(e.firstChild);if(!t)return;if(t.kind===`emoji`){e.appendChild(n.createTextNode(t.value));return}let a=n.createElement(`img`);a.setAttribute(`src`,t.value),a.setAttribute(`alt`,``),a.setAttribute(`draggable`,`false`),a.setAttribute(`referrerpolicy`,`no-referrer`),e.appendChild(a)}var yP=st.extend({priority:200,addOptions(){return{...this.parent?.(),docName:``}},addNodeView(){return({editor:e,node:t,getPos:n})=>{let r=hP(),{dom:i,iconSpan:a}=gP({nodeId:r,target:String(t.attrs.target??``),alias:t.attrs.alias==null?null:String(t.attrs.alias),anchor:t.attrs.anchor==null?null:String(t.attrs.anchor)}),o=t,s=()=>{vP(a,_P(String(o.attrs.target??``),Ci()))};s();let c=ta(s),l=()=>{let e=n();return typeof e==`number`?e:void 0},u=Eh(e),d=({newTab:e})=>{let t=o.attrs,n=typeof t.target==`string`?t.target:``;if(!n)return!1;let r=gr(n,typeof t.anchor==`string`?t.anchor:null);if(!r)return!1;if(r.kind===`doc`){let t=Ci(),i=G(n,{pages:t?.pages??new Set,folderPaths:t?.folderPaths??new Set,pagesBySlug:t?.pagesBySlug,pagesByBasename:t?.pagesByBasename,fallbackTargets:ae(n)});if(i.kind===`create`||i.kind===`navigate`&&i.displayState===`folder`)return!1;let a=i.kind===`navigate`?i.hashDocName:r.docName;return e?je({docName:a,anchor:r.anchor}):window.location.assign(Ne({docName:a,anchor:r.anchor})),!0}if(r.kind===`asset`){let t=Ci(),n=ce(r.url,t?.assetPaths??new Set,t?.filePaths)??r.url.replace(/^\//,``);return e?pe(fi(n)):window.location.hash=fi(n),!0}return Vo(r.url)?(Bo(r.url),!0):!1};return u.register({type:`wikiLink`,nodeId:r,getPos:l,controls:{propPanel:t=>(0,Q.createElement)(pP,{editor:e,getPos:l,onClose:t.deactivate,onNavigate:e=>d({newTab:e})})},handlePrimary:d}),{dom:i,ignoreMutation:()=>!0,update:e=>{if(e.type.name!==`wikiLink`)return!1;o=e;let t=String(e.attrs.target??``),n=e.attrs.alias==null?null:String(e.attrs.alias),r=e.attrs.anchor==null?null:String(e.attrs.anchor);i.setAttribute(`data-target`,t),i.setAttribute(`data-alias`,n??``),i.setAttribute(`data-anchor`,r??``),i.setAttribute(`aria-label`,`Wiki link: ${t}${r?`#${r}`:``}`);let a=n??`${t}${r?`#${r}`:``}`,c=i.lastChild;return c&&c.nodeType===3?c.nodeValue=a:i.appendChild(i.ownerDocument.createTextNode(a)),s(),!0},destroy:()=>{u.deregister(r),c()}}}},addKeyboardShortcuts(){return{Backspace:()=>{if(ge.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeBefore;if(t?.type.name===`wikiLink`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from-t.nodeSize,e.from)),!0}return!1},Delete:()=>{if(ge.getState(this.editor.state)?.active)return!1;let{selection:e}=this.editor.state;if(!e.empty)return!1;let t=e.$from.nodeAfter;if(t?.type.name===`wikiLink`){let{state:n,view:r}=this.editor;return r.dispatch(n.tr.delete(e.from,e.from+t.nodeSize)),!0}return!1}}},addProseMirrorPlugins(){return[Oe(this.editor)]}}),bP=0;function xP(){return`wiki-link-embed-${++bP}`}function SP(e){let t=e.doc??(typeof document<`u`?document:{createElement:null,createTextNode:null}),n=t.createElement(`a`);n.setAttribute(`data-wiki-embed`,``),n.setAttribute(`data-node-id`,e.nodeId),n.setAttribute(`data-target`,e.target),n.setAttribute(`data-alias`,e.alias??``),n.setAttribute(`data-anchor`,e.anchor??``),n.setAttribute(`href`,e.href),n.setAttribute(`target`,`_blank`),n.setAttribute(`rel`,`noopener noreferrer`),n.setAttribute(`contenteditable`,`false`),n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`),n.setAttribute(`aria-label`,`Embed: ${e.target}${e.anchor?`#${e.anchor}`:``}`),n.classList.add(`wiki-link-embed-chip`),n.style.touchAction=`manipulation`;let r=e.alias??`${e.target}${e.anchor?`#${e.anchor}`:``}`,i=t.createTextNode(r);return n.appendChild(i),{dom:n}}function CP(e){let t=(e.doc??(typeof document<`u`?document:{createElement:null})).createElement(`img`);return t.setAttribute(`data-wiki-embed`,``),t.setAttribute(`data-node-id`,e.nodeId),t.setAttribute(`data-target`,e.target),t.setAttribute(`data-alias`,e.alias??``),t.setAttribute(`src`,_n(e.src)),t.setAttribute(`alt`,e.alias??e.target),{dom:t}}function wP(e){let t=lt(e);return t!==null&&un.has(t)}var TP=xt.extend({addNodeView(){return({editor:e,node:t,getPos:n})=>{let r=xP(),i=t,a=String(t.attrs.target??``),o=t.attrs.alias==null?null:String(t.attrs.alias),s=t.attrs.anchor==null?null:String(t.attrs.anchor),c=t.attrs.resolvedSrc==null?null:String(t.attrs.resolvedSrc);if(wP(a)){let{dom:e}=CP({nodeId:r,target:a,alias:o,src:c??a});return{dom:e,ignoreMutation:()=>!0,update:t=>{if(t.type.name!==`wikiLinkEmbed`)return!1;i=t;let n=String(t.attrs.target??``),r=t.attrs.alias==null?null:String(t.attrs.alias),a=t.attrs.resolvedSrc==null?null:String(t.attrs.resolvedSrc);if(!wP(n))return!1;let o=a??n;return e.setAttribute(`data-target`,n),e.setAttribute(`data-alias`,r??``),e.setAttribute(`src`,_n(o)),e.setAttribute(`alt`,r??n),!0}}}let{dom:l}=SP({nodeId:r,target:a,alias:o,anchor:s,href:c??a});l.addEventListener(`click`,e=>{e.preventDefault()});let u=()=>{let e=n();return typeof e==`number`?e:void 0},d=Eh(e);return d.register({type:`wikiLinkEmbed`,nodeId:r,getPos:u,controls:{},handlePrimary:({newTab:e})=>{let t=i.attrs,n=typeof t.target==`string`?t.target:``;if(!n)return!1;let r=(typeof t.resolvedSrc==`string`&&t.resolvedSrc.length>0?t.resolvedSrc:null)??n,a=lt(n);if(a===null)return!1;let o=ir(r,``)??n;return we({url:r,projectRelPath:o,ext:a,title:o.split(`/`).pop()??r,newTab:e}),!0}}),{dom:l,ignoreMutation:()=>!0,update:e=>{if(e.type.name!==`wikiLinkEmbed`)return!1;i=e;let t=String(e.attrs.target??``);if(wP(t))return!1;let n=e.attrs.alias==null?null:String(e.attrs.alias),r=e.attrs.anchor==null?null:String(e.attrs.anchor),a=(e.attrs.resolvedSrc==null?null:String(e.attrs.resolvedSrc))??t;return l.setAttribute(`data-target`,t),l.setAttribute(`data-alias`,n??``),l.setAttribute(`data-anchor`,r??``),l.setAttribute(`href`,a),l.setAttribute(`aria-label`,`Embed: ${t}${r?`#${r}`:``}`),l.textContent=n??`${t}${r?`#${r}`:``}`,!0},destroy:()=>{d.deregister(r)}}}}}),EP=[Oy,vy,Ty,by],DP=[...or.map(e=>{if(e.name===`jsxComponent`)return cN;if(e.name===`jsxInline`)return fN;if(e.name===`image`){let t=e.options??{};return jk.configure({...t,inline:!0})}return e.name===`rawMdxFallback`?CN:e.name===`wikiLink`?yP:e.name===`wikiLinkEmbed`?TP:e.name===`link`?dj:e.name===`mathInline`?bN:e.name===`tag`?eP:e.name===`codeBlock`?jO:e}),lb,AN.configure({itemsSources:[...EP,Ky],categoryLabels:{skills:`Skills`,content:`Components`,layout:`Layout`,media:`Media`,data:`Data`,embed:`Embeds`}}),Ok,PN,Mp.configure({onDrop(e,t,n){for(let r of t)Rm(r,e,n)},onPaste(e,t,n){for(let n of t)Rm(n,e,e.state.selection.from)}}),kk,Qp,JN,Dk,Tk,Xy,HN,WN,MN,xm,Um,Xm,Ip,tb,DM,nh,tt.create({name:`chunkWrapperDecoration`,addProseMirrorPlugins(){return[hb()]}})];function OP(e){return e===nt}var kP=`ok-replay-outbox`,AP=`entry`,jP=`buffer`,MP=5e3,NP=class extends Error{constructor(e,t){super(`[replay-outbox] ${e} timed out after ${MP}ms: ${t}`),this.name=`ReplayOutboxTimeoutError`}};function PP(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>{i(new NP(e,t))},MP);n.then(e=>{clearTimeout(a),r(e)},e=>{clearTimeout(a),i(e)})})}function FP(){return typeof indexedDB<`u`&&typeof indexedDB.databases==`function`}function IP(e,t){return`${kP}:${e}:${t}`}function LP(e){return new Promise((t,n)=>{let r=indexedDB.open(e);r.onupgradeneeded=()=>{let e=r.result;e.objectStoreNames.contains(AP)||e.createObjectStore(AP)},r.onsuccess=()=>t(r.result),r.onerror=()=>n(r.error)})}async function RP(e){return FP()?(await indexedDB.databases()).some(t=>t.name===e):!1}async function zP(e,t,n){if(!FP())return!1;let r=IP(e,t);return PP(`write`,t,(async()=>{let e=await LP(r);try{return await new Promise((t,r)=>{let i=e.transaction(AP,`readwrite`);i.objectStore(AP).put({delta:n.delta,fullState:n.fullState},jP),i.oncomplete=()=>t(),i.onerror=()=>r(i.error),i.onabort=()=>r(i.error??Error(`replay-outbox write aborted`)),typeof i.commit==`function`&&i.commit()}),!0}finally{e.close()}})())}async function BP(e,t){if(!FP())return null;let n=IP(e,t);return PP(`read`,t,(async()=>{if(!await RP(n))return null;let e=await LP(n);try{let t=await new Promise((t,n)=>{let r=e.transaction(AP,`readonly`).objectStore(AP).get(jP);r.onsuccess=()=>t(r.result),r.onerror=()=>n(r.error)});if(t==null)return null;let n=t;return!(n.delta instanceof Uint8Array)||!(n.fullState instanceof Uint8Array)?null:{delta:n.delta,fullState:n.fullState}}finally{e.close()}})())}async function VP(e,t){if(!FP())return!1;let n=IP(e,t);return PP(`consume`,t,(async()=>{if(!await RP(n))return!1;let e=await LP(n);try{return await new Promise((t,n)=>{let r=e.transaction(AP,`readwrite`),i=r.objectStore(AP),a=!1,o=i.count(jP);o.onsuccess=()=>{a=o.result>0},i.delete(jP),r.oncomplete=()=>t(a),r.onerror=()=>n(r.error),r.onabort=()=>n(r.error??Error(`replay-outbox consume aborted`))})}finally{e.close()}})())}function HP(){return da(`SYNC_TIMEOUT_MS`,3e4)}var UP=class extends Error{docName;elapsedMs;constructor(e,t){super(`Sync timed out for "${e}" after ${t}ms`),this.name=`SyncTimeoutError`,this.docName=e,this.elapsedMs=t}},WP=class extends Error{docName;constructor(e){super(`Provider disconnected before sync for "${e}"`),this.name=`PreSyncDisconnectError`,this.docName=e}},GP=class extends Error{docName;constructor(e){super(`Document not found: "${e}"`),this.name=`DocumentNotFoundError`,this.docName=e}},KP=class extends Error{docName;cause;constructor(e,t){let n=t instanceof Error?t.message:String(t??`unknown`);super(`Bridge setup failed for "${e}": ${n}`),this.name=`BridgeSetupError`,this.docName=e,this.cause=t}},qP=class extends Error{docName;missingCapability;constructor(e,t){super(`Server is missing capability "${t}" required to open "${e}".`),this.name=`ServerCapabilityMismatchError`,this.docName=e,this.missingCapability=t}},JP=new Map,YP=!1;function XP(){for(let e of JP.values())if(!e.settled)return!0;return!1}function ZP(){typeof document>`u`||document.visibilityState===`visible`&&QP(Date.now())}function QP(e){let t=[];for(let[n,r]of JP){if(r.settled)continue;let i=e-r.createdAt;if(i<HP())continue;r.settled=!0;let a=new UP(n,i);nF(r),r.reject(a);let o=dd(n);o!==void 0&&Sd(o),t.push({docName:n,elapsedMs:i})}if(t.length>0){let e=t.map(e=>`${e.docName} (${e.elapsedMs}ms)`).join(`, `);console.warn(`[syncPromise] reaped ${t.length} timed-out ${t.length===1?`entry`:`entries`} on visibility restore (tab-sleep recovered): ${e}`)}return XP()||eF(),t.length}function $P(){YP||typeof document>`u`||(document.addEventListener(`visibilitychange`,ZP),YP=!0)}function eF(){YP&&(typeof document>`u`||(document.removeEventListener(`visibilitychange`,ZP),YP=!1))}var tF=new Map;function nF(e){e.detached||(e.detached=!0,e.timeoutHandle!==null&&clearTimeout(e.timeoutHandle),e.provider.off(`synced`,e.onSynced),e.provider.off(`close`,e.onClose))}function rF(e,t){let n=JP.get(e);if(n)return n.promise;let r=tF.get(e);if(r!==void 0){tF.delete(e);let n=r===`timeout`?new UP(e,0):new WP(e);console.warn(`[syncPromise] ${e} rejected on creation (test hook, armed ${r}): ${n.message}`),X(`ok/sync/create`,{docName:e,mountId:dd(e),warm:!1,armed:r}),X(`ok/sync/reject`,{docName:e,mountId:dd(e),reason:`armed-${r}`});let i=aF(n);return JP.set(e,oF(i,t)),i}if(t.synced){console.log(`[syncPromise] ${e} resolved synchronously (warm provider)`);let n=dd(e);X(`ok/sync/create`,{docName:e,mountId:n,warm:!0}),X(`ok/sync/resolve`,{docName:e,mountId:n,elapsedMs:0,warm:!0}),X.histogram(`ok/sync/resolve-elapsed-ms`,n===void 0?{docName:e,warm:!0}:{docName:e,mountId:n,warm:!0},0);let r=Promise.resolve();return JP.set(e,iF(r,t)),r}let i=Date.now(),a=()=>{},o=()=>{},s=new Promise((e,t)=>{a=e,o=t}),c=()=>{let t=JP.get(e);if(!t||t.settled)return;t.settled=!0,t.resolved=!0;let n=Date.now()-t.createdAt;console.log(`[syncPromise] ${e} resolved in ${n}ms`);let r=dd(e);if(X(`ok/sync/resolve`,{docName:e,mountId:r,elapsedMs:n,warm:!1}),X.histogram(`ok/sync/resolve-elapsed-ms`,r===void 0?{docName:e}:{docName:e,mountId:r},n),nF(t),XP()||eF(),t.resolve(),fa(),r!==void 0){let i=Date.now();xd(r,`ok.sync-promise`,{"doc.name":e,elapsed_ms:n},t.createdAt,i),Sd(r,i)}},l=t=>{let n=JP.get(e);if(!n||n.settled)return;n.settled=!0;let r=new WP(e);console.warn(`[syncPromise] ${e} rejected: ${r.message}`);let i=dd(e);X(`ok/sync/reject`,{docName:e,mountId:i,reason:`pre-sync-disconnect`}),nF(n),XP()||eF(),n.reject(r),i!==void 0&&Sd(i)},u=setTimeout(()=>{let t=JP.get(e);if(!t||t.settled)return;t.settled=!0;let n=Date.now()-t.createdAt,r=new UP(e,n);console.warn(`[syncPromise] ${e} rejected: ${r.message}`);let i=dd(e);X(`ok/sync/reject`,{docName:e,mountId:i,reason:`timeout`,elapsedMs:n}),nF(t),XP()||eF(),t.reject(r),i!==void 0&&Sd(i)},HP()),d={promise:s,resolve:a,reject:o,createdAt:i,timeoutHandle:u,provider:t,onSynced:c,onClose:l,settled:!1,resolved:!1,detached:!1};return JP.set(e,d),t.on(`synced`,c),t.on(`close`,l),$P(),X(`ok/sync/create`,{docName:e,mountId:dd(e),warm:!1}),s}function iF(e,t){return{promise:e,resolve:()=>{},reject:()=>{},createdAt:Date.now(),timeoutHandle:null,provider:t,onSynced:()=>{},onClose:()=>{},settled:!0,resolved:!0,detached:!0}}function aF(e){let t=Promise.reject(e);t.catch(()=>{});let n=t;return n.status=`rejected`,n.reason=e,n}function oF(e,t){return{promise:e,resolve:()=>{},reject:()=>{},createdAt:Date.now(),timeoutHandle:null,provider:t,onSynced:()=>{},onClose:()=>{},settled:!0,resolved:!1,detached:!0}}function sF(e){return JP.get(e)?.resolved===!0}function cF(e){let t=JP.get(e);t&&(t.settled=!0,nF(t),JP.delete(e),XP()||eF())}function lF(e,t){let n=JP.get(e);if(!n||n.settled)return!1;n.settled=!0,console.warn(`[syncPromise] ${e} rejected: ${t.message}`),nF(n),XP()||eF(),n.reject(t);let r=dd(e);return r!==void 0&&Sd(r),!0}var uF=Object.freeze({kind:`tab-replay`}),dF=Object.freeze({kind:`idle`});function fF(e,t){return()=>{}}var pF=null;function mF(){return pF??=Ze(DP),pF}var hF=4e3,gF=1e4,_F=class extends Error{constructor(e,t){super(`client persistence clearData timed out for ${e} after ${t}ms`),this.docName=e,this.timeoutMs=t,this.name=`ClientPersistenceClearTimeoutError`}},vF=class extends Error{constructor(e,t){super(`stored-state epoch peek timed out for ${e} after ${t}ms`),this.docName=e,this.timeoutMs=t,this.name=`StoredEpochPeekTimeoutError`}},yF=`ok-last-observed-branch`,bF=`ok-doc-lineage-epochs`,xF=5e3,SF=da(`MAX_BUFFER_BYTES`,1*1024*1024),CF=da(`MAX_POOL`,10),wF=class{_entries=new Map;get entries(){return this._entries}lruOrder=[];activeDocName=null;visibleDocNames=new Set;maxSize;wsUrl;recycleDebounceMs;clearDataTimeoutMs;flushOnHideEnabled=!0;unsyncedWorkListeners=new Set;onChange=null;tabIdentity=null;serverRestartRecoveryState=dF;cachedServerInstanceId=null;pendingServerInstanceKnown=null;recoveryMismatchStaleClaim;handledStaleClaims=new Set;bufferedUpdates=new Map;pendingClears=new Map;clearFailures=new Set;persistenceFactory;peekStoredEpoch;storage;constructor(e,t,n){this.maxSize=e,this.wsUrl=t,this.recycleDebounceMs=n?.recycleDebounceMs??hF,this.clearDataTimeoutMs=n?.clearDataTimeoutMs??gF,this.persistenceFactory=n?.persistenceFactory??Tp,this.peekStoredEpoch=n?.peekStoredLineageEpoch??Ep,n?.storage===void 0?this.storage=globalThis.localStorage===void 0?null:globalThis.localStorage:this.storage=n.storage}setTabIdentity(e){this.tabIdentity=e}setExpectedServerInstanceId(e){let t=e!==null&&e.length>0?e:null,n=this.cachedServerInstanceId!==null&&this.cachedServerInstanceId.length>0?this.cachedServerInstanceId:null;if(!(n!==null&&t===n)){if(n!==null&&t!==null){this.handleServerInstanceMismatch(n),this.cachedServerInstanceId=t,this.resolvePendingServerInstanceKnown(t);return}this.cachedServerInstanceId=e,t!==null&&(this.resolvePendingServerInstanceKnown(t),this.attachDeferredPersistence(t))}}resolvePendingServerInstanceKnown(e){if(this.pendingServerInstanceKnown===null)return;let t=this.pendingServerInstanceKnown;this.pendingServerInstanceKnown=null,t.resolve(e)}whenServerInstanceKnown(){if(this.cachedServerInstanceId!==null&&this.cachedServerInstanceId.length>0)return Promise.resolve(this.cachedServerInstanceId);if(this.pendingServerInstanceKnown!==null)return this.pendingServerInstanceKnown.promise;let e,t=new Promise(t=>{e=t});return this.pendingServerInstanceKnown={promise:t,resolve:e},t}buildPersistence(e,t,n){return this.persistenceFactory({branch:this.normalizedObservedBranch(),serverInstanceId:e,docName:t,doc:n})}async validateStoredStateThenAttach(e,t){if(e.persistenceAttachOwned)return;e.persistenceAttachOwned=!0;let n=e.docName,r=()=>this._entries.get(n)===e&&e.kind===`active`&&e.persistence===null&&!this.pendingClears.has(n);if(!r())return;let i;try{i=await new Promise((e,r)=>{let i=setTimeout(()=>{r(new vF(n,this.clearDataTimeoutMs))},this.clearDataTimeoutMs);this.peekStoredEpoch({branch:this.normalizedObservedBranch(),serverInstanceId:t,docName:n}).then(t=>{clearTimeout(i),e(t)},e=>{clearTimeout(i),r(e)})})}catch(e){this.emitStructuredClientRecoveryEvent({event:`ok-client-persistence-attach-failed`,...this.recoveryTelemetryBase(n),phase:`peek`,errorName:e instanceof Error?e.name:`non-error-throw`,errorMessage:e instanceof Error?e.message:String(e)});return}if(!r())return;if(i===null){this.attachValidatedPersistence(e,t);return}if(!e.hasSynced&&(await this.awaitFirstSyncOrDestroy(e),!r()||!e.hasSynced))return;let a=e.provider.document.getMap(`lifecycle`).get(yt),o=typeof a==`string`&&a.length>0?a:null;if(o===i){this.attachValidatedPersistence(e,t);return}this.emitStructuredClientRecoveryEvent({event:`ok-doc-lineage-mismatch`,...this.recoveryTelemetryBase(n),via:`stored-state-validation`,staleEpoch:i,liveEpoch:o??`<absent>`});let s=this.activeDocName===n;this.runCloseAndClearPersistence(n),this.open(n)!==null&&s&&this.setActive(n)}attachValidatedPersistence(e,t){let n=e.docName;try{let r=this.buildPersistence(t,n,e.provider.document);e.persistence=r,this.notify(),this.backfillCacheAfterFirstSync(e,r).catch(e=>{this.emitStructuredClientRecoveryEvent({event:`ok-client-persistence-attach-failed`,...this.recoveryTelemetryBase(n),phase:`backfill`,errorName:e instanceof Error?e.name:`non-error-throw`,errorMessage:e instanceof Error?e.message:String(e)})})}catch(e){this.emitStructuredClientRecoveryEvent({event:`ok-client-persistence-attach-failed`,...this.recoveryTelemetryBase(n),phase:`attach`,errorName:e instanceof Error?e.name:`non-error-throw`,errorMessage:e instanceof Error?e.message:String(e)})}}async backfillCacheAfterFirstSync(e,t){await t.whenSynced,e.hasSynced||await this.awaitFirstSyncOrDestroy(e),!(this._entries.get(e.docName)!==e||e.kind!==`active`||e.persistence!==t||!e.hasSynced)&&await t.flushFullState()}async awaitFirstSyncOrDestroy(e){e.hasSynced||await new Promise(t=>{let n=()=>{e.provider.off(`synced`,n),e.provider.off(`destroy`,n),t()};e.provider.on(`synced`,n),e.provider.on(`destroy`,n)})}attachDeferredPersistence(e){for(let t of Array.from(this._entries.values()))if(t.kind===`active`&&t.persistence===null&&this._entries.get(t.docName)===t){if(t.hasSynced&&t.lineageEpochRecordAtOpen!==null){let e=t.provider.document.getMap(`lifecycle`).get(yt);if(typeof e==`string`&&e.length>0&&e!==t.lineageEpochRecordAtOpen){let n=t.docName;this.emitStructuredClientRecoveryEvent({event:`ok-doc-lineage-mismatch`,...this.recoveryTelemetryBase(n),via:`deferred-attach`,staleEpoch:t.lineageEpochRecordAtOpen,liveEpoch:e});let r=this.activeDocName===n;this.runCloseAndClearPersistence(n),this.open(n)!==null&&r&&this.setActive(n);continue}}this.validateStoredStateThenAttach(t,e)}}getServerRestartRecoveryState(){return this.serverRestartRecoveryState}observeDiskAck(e,t){let n=this.entries.get(e);!n||n.kind!==`active`||(n.lastDiskAckedSV=kp(n.lastDiskAckedSV,t))}observeDiskAckBatch(e){for(let[t,n]of Object.entries(e))this.observeDiskAck(t,n)}lastObservedBranch=null;lastObservedBranchInitialized=!1;getOrInitObservedBranch(){if(this.lastObservedBranchInitialized)return this.lastObservedBranch;this.lastObservedBranchInitialized=!0;try{let e=this.storage?.getItem(yF)??null;e!==null&&e.length>0&&(this.lastObservedBranch=e)}catch{}return this.lastObservedBranch}persistObservedBranch(e){this.lastObservedBranch=e,this.lastObservedBranchInitialized=!0;try{e===null||e.length===0?this.storage?.removeItem(yF):this.storage?.setItem(yF,e)}catch{}}docLineageEpochs=new Map;docLineageEpochsEnvelopeConsumed=!1;normalizedObservedBranch(){return this.getOrInitObservedBranch()??`_unknown_`}consumeLineageEpochEnvelopeIfValid(){if(this.docLineageEpochsEnvelopeConsumed)return;let e=this.cachedServerInstanceId;if(!(e===null||e.length===0)){this.docLineageEpochsEnvelopeConsumed=!0;try{let t=this.storage?.getItem(bF)??null;if(t===null)return;let n=JSON.parse(t);if(typeof n!=`object`||!n)return;let r=n;if(r.branch!==this.normalizedObservedBranch()||r.serverInstanceId!==e||typeof r.epochs!=`object`||r.epochs===null)return;for(let[e,t]of Object.entries(r.epochs))typeof t==`string`&&t.length>0&&!this.docLineageEpochs.has(e)&&this.docLineageEpochs.set(e,t)}catch(e){e instanceof DOMException||console.warn(JSON.stringify({event:`ok-lineage-epoch-envelope-read-error`,errorName:e instanceof Error?e.name:typeof e,message:e instanceof Error?e.message:String(e)}))}}}getRecordedLineageEpoch(e){let t=this.docLineageEpochs.get(e);return t===void 0?(this.consumeLineageEpochEnvelopeIfValid(),this.docLineageEpochs.get(e)??null):t}persistLineageEpochEnvelope(){let e=this.cachedServerInstanceId;if(!(e===null||e.length===0))try{this.storage?.setItem(bF,JSON.stringify({branch:this.normalizedObservedBranch(),serverInstanceId:e,epochs:Object.fromEntries(this.docLineageEpochs)}))}catch{}}recordLineageEpoch(e,t){this.docLineageEpochs.get(e)!==t&&(this.docLineageEpochs.set(e,t),this.persistLineageEpochEnvelope())}deleteLineageEpochRecord(e){this.docLineageEpochs.delete(e)&&this.persistLineageEpochEnvelope()}withClearDataTimeout(e,t){return new Promise((n,r)=>{let i=setTimeout(()=>{r(new _F(e,this.clearDataTimeoutMs))},this.clearDataTimeoutMs);t.then(()=>{clearTimeout(i),n()},e=>{clearTimeout(i),r(e)})})}recoveryTelemetryBase(e,t){let n={docName:e,branch:this.normalizedObservedBranch()},r=t===void 0?this.recoveryMismatchStaleClaim:t;return r!==void 0&&r.length>0&&(n.serverInstanceId=r),n}emitStructuredClientRecoveryEvent(e){console.warn(JSON.stringify(e))}outboxFailureFields(e){return{failureKind:e instanceof NP?`timeout`:`rejected`,errorName:e instanceof Error?e.name:`non-error-throw`,errorMessage:e instanceof Error?e.message:String(e)}}emitStructuredClientBreadcrumb(e){console.info(JSON.stringify(e))}clearRecoveryMismatchStaleClaimIfTerminal(){let e=this.serverRestartRecoveryState.kind;(e===`idle`||e===`failed`)&&(this.recoveryMismatchStaleClaim=void 0)}beginServerRestartRecovery(e,t){this.emitStructuredClientBreadcrumb({event:`ok-pool-restart-recovery-begin`,phase:`clearing-local-cache`,docCount:e.length}),this.serverRestartRecoveryState={kind:`recovering`,phase:`clearing-local-cache`,docNames:e,failedDocNames:[],startedAt:t};for(let t of e)cF(t);this.notify()}enterServerRestartReconnect(e,t,n,r){if(this.emitStructuredClientBreadcrumb({event:`ok-pool-restart-recovery-reconnecting`,docCount:e.length,failedCount:t.length}),e.length===0){this.serverRestartRecoveryState=t.length===0?dF:{kind:`failed`,reason:r,docNames:t,failedDocNames:t,startedAt:n},this.clearRecoveryMismatchStaleClaimIfTerminal(),this.notify();return}this.serverRestartRecoveryState={kind:`recovering`,phase:`reconnecting`,docNames:e,failedDocNames:t,startedAt:n,...t.length>0?{clearFailureReason:r}:{}},this.notify()}markServerRestartRecoverySynced(e){let t=this.serverRestartRecoveryState;if(t.kind!==`recovering`||t.phase!==`reconnecting`||!t.docNames.includes(e))return;let n=t.docNames.filter(t=>t!==e);if(this.emitStructuredClientBreadcrumb({event:`ok-pool-restart-recovery-synced`,docName:e,remaining:n.length}),n.length>0){this.serverRestartRecoveryState={...t,docNames:n};return}if(t.failedDocNames.length>0){this.serverRestartRecoveryState={kind:`failed`,reason:t.clearFailureReason??`clear-data-failed`,docNames:t.failedDocNames,failedDocNames:t.failedDocNames,startedAt:t.startedAt},this.clearRecoveryMismatchStaleClaimIfTerminal();return}this.serverRestartRecoveryState=dF,this.clearRecoveryMismatchStaleClaimIfTerminal()}setObservedBranch(e){this.persistObservedBranch(e)}compareAndUpdateObservedBranch(e){let t=this.getOrInitObservedBranch();return this.persistObservedBranch(e),t!==null&&t!==e}onBranchMismatch=null;branchMismatchInFlight=null;mismatchInFlight=null;setOnBranchMismatch(e){if(e===null){this.onBranchMismatch=null;return}this.onBranchMismatch=()=>{if(this.branchMismatchInFlight!==null)return;let t=Promise.resolve().then(e).finally(()=>{this.branchMismatchInFlight===t&&(this.branchMismatchInFlight=null)});this.branchMismatchInFlight=t}}onRenameRedirect=null;onDocDeleted=null;setOnRenameRedirect(e){this.onRenameRedirect=e}setOnDocDeleted(e){this.onDocDeleted=e}setOnChange(e){this.onChange=e}notify(){this.onChange?.()}evictListeners=new Set;onEvict(e){return this.evictListeners.add(e),()=>{this.evictListeners.delete(e)}}fireEvict(e){for(let t of this.evictListeners)try{t(e)}catch(t){console.warn(`[ProviderPool] evict listener threw for ${e}:`,t)}}touch(e){let t=this.lruOrder.indexOf(e);t!==-1&&this.lruOrder.splice(t,1),this.lruOrder.push(e)}setVisibleDocNames(e){let t=new Set;for(let n of e)OP(n)||t.add(n);t.size===this.visibleDocNames.size&&[...t].every(e=>this.visibleDocNames.has(e))||(this.visibleDocNames=t,this.trimToCapacity(),X(`ok/pool/visible-set`,{visibleCount:this.visibleDocNames.size,poolSize:this.entries.size}))}isProtected(e){return e===this.activeDocName||this.visibleDocNames.has(e)}effectiveCapacity(){let e=this.visibleDocNames.size+ +(this.activeDocName!==null&&!this.visibleDocNames.has(this.activeDocName));return Math.max(this.maxSize,e)}trimToCapacity(){for(;this.entries.size>this.effectiveCapacity()&&this.evictLru(););}open(e){if(OP(e))return null;let t=this.entries.get(e);if(t){let n=t.lastAccessedAt;return t.lastAccessedAt=Date.now(),this.touch(e),this.notify(),X(`ok/pool/open`,{docName:e,hit:!0,lastAccessedAt:n,poolEventId:t.poolEventId}),X.count(`ok/pool/open`,{hit:!0}),t}let n=Date.now();this.entries.size>=this.effectiveCapacity()&&this.evictLru();let r=this.cachedServerInstanceId,i=this.getRecordedLineageEpoch(e),a=$a(this.tabIdentity,r,this.getOrInitObservedBranch(),r!==null&&r.length>0?i:null),o=new io({url:Ap(this.wsUrl),name:e,forceSyncInterval:xF,token:a}),s=this.cachedServerInstanceId;this.clearFailures.has(e)&&this.runCloseAndClearPersistence(e);let c=this.pendingClears.get(e),l=s!==null&&s.length>0&&c===void 0&&i!==null?this.buildPersistence(s,e,o.document):null,u=crypto.randomUUID(),d={kind:`active`,provider:o,persistence:l,lastServerSyncedSV:null,lastDiskAckedSV:null,observerCleanup:null,observerFireCounterCleanup:fF(o.document,e),syncState:`connecting`,docName:e,lastAccessedAt:Date.now(),poolEventId:u,hasSynced:!1,pendingRecycleTimer:null,bridgeSetupFailed:!1,serverDrivenCloseReauthInFlight:!1,persistenceAttachOwned:!1,lineageEpochRecordAtOpen:i};X(`ok/pool/open`,{docName:e,hit:!1,poolEventId:u}),X.count(`ok/pool/open`,{hit:!1}),o.on(`status`,({status:t})=>{d.kind!==`active`||this.entries.get(e)!==d||t===`disconnected`&&(d.syncState=`disconnected`,this.notify())}),o.on(`synced`,()=>{if(d.kind!==`active`||this.entries.get(e)!==d)return;d.syncState=`synced`,d.hasSynced=!0,d.lastServerSyncedSV=Dp(o.document);let t=o.document.getMap(`lifecycle`).get(yt);if(typeof t==`string`&&t.length>0&&this.recordLineageEpoch(e,t),d.pendingRecycleTimer&&=(clearTimeout(d.pendingRecycleTimer),null),this.markServerRestartRecoverySynced(e),this.notify(),!d.observerCleanup)try{let t=o.document,n=new mr({extensions:DP});d.observerCleanup=ee({doc:t,xmlFragment:t.getXmlFragment(`default`),ytext:t.getText(`source`),mdManager:n,schema:mF(),onSyncError:(t,n)=>{console.warn(`[Sync] ${t} failed for ${e}:`,n.message)}})}catch(t){console.error(`[ProviderPool] setupObservers init failed for ${e}:`,t),d.bridgeSetupFailed=!0,lF(e,new KP(e,t))}}),o.on(`disconnect`,()=>{d.kind!==`active`||this.entries.get(e)!==d||(d.syncState=`disconnected`,this.notify(),d.hasSynced&&o.unsyncedChanges===0&&!d.pendingRecycleTimer&&(this.emitStructuredClientBreadcrumb({event:`ok-pool-recycle-timer-armed`,docName:e,debounceMs:this.recycleDebounceMs}),d.pendingRecycleTimer=setTimeout(()=>{if(d.kind===`active`&&(d.pendingRecycleTimer=null,this.entries.get(e)===d)){if(o.unsyncedChanges>0){X(`ok/pool/recycle-skipped-unsynced`,{docName:e}),this.emitStructuredClientBreadcrumb({event:`ok-pool-recycle-skipped-unsynced`,docName:e});return}this.recycleDisconnectedEntry(e)}},this.recycleDebounceMs)))}),o.on(`authenticationFailed`,({reason:t})=>{let n=[`server-instance-mismatch`,`branch-mismatch`,`rename-redirect`,`doc-deleted`,`doc-lineage-mismatch`],i=t.indexOf(`:`),a=i===-1?t:t.slice(0,i);if(!n.includes(a)){console.warn(JSON.stringify({event:`ok-auth-failed-unknown-reason`,reason:t}));return}let o=i===-1?``:t.slice(i+1),s=o.length>0?o:void 0,c=a;if(c===`server-instance-mismatch`){if(r===null)return;this.handleServerInstanceMismatch(r);return}if(c===`branch-mismatch`){this.onBranchMismatch?.();return}if(c===`rename-redirect`){if(s===void 0||s.length===0){console.warn(JSON.stringify({event:`rename-redirect-missing-payload`,fromDocName:e}));return}let t=e,n=s;this.deleteLineageEpochRecord(t);let r=this.entries.get(t),i=r!==void 0&&r.kind===`active`;this.onRenameRedirect?.({fromDocName:t,toDocName:n,hadOpenProvider:i});return}if(c===`doc-deleted`){this.deleteLineageEpochRecord(e);let t=this.entries.get(e),n=t!==void 0&&t.kind===`active`;this.onDocDeleted?.({docName:e,hadOpenProvider:n});return}if(c===`doc-lineage-mismatch`){if(d.kind!==`active`||this.entries.get(e)!==d)return;this.deleteLineageEpochRecord(e),this.emitStructuredClientRecoveryEvent({event:`ok-doc-lineage-mismatch`,...this.recoveryTelemetryBase(e),via:`auth-rejection`,staleEpoch:d.lineageEpochRecordAtOpen??``});let t=this.activeDocName===e;this.runCloseAndClearPersistence(e),this.open(e)!==null&&t&&this.setActive(e);return}}),o.on(`close`,({event:t})=>{if(d.kind!==`active`||this.entries.get(e)!==d||d.serverDrivenCloseReauthInFlight)return;d.serverDrivenCloseReauthInFlight=!0,o.sendToken().catch(t=>{console.warn(JSON.stringify({event:`ok-provider-server-driven-close-reauth-failed`,docName:e,message:t instanceof Error?t.message:String(t)}))}).finally(()=>{d.kind===`active`&&this.entries.get(e)===d&&(d.serverDrivenCloseReauthInFlight=!1)});let n=t?.reason??`<unknown>`;console.info(JSON.stringify({event:`ok-provider-server-driven-close-reauth`,docName:e,reason:n}))}),o.on(`unsyncedChanges`,()=>this.emitUnsyncedWork()),this.emitUnsyncedWork();let f=this.recoveryMismatchStaleClaim,p=async()=>{if(d.kind!==`active`||this.entries.get(e)!==d)return;let t=this.normalizedObservedBranch(),n,r=t,i,a=this.bufferedUpdates.get(e);if(a!==void 0){if(a.branch!==t){this.discardBufferedUpdate(e),this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-branch-mismatch`,...this.recoveryTelemetryBase(e,f),reason:`buffer-captured-on-another-branch`});return}this.bufferedUpdates.delete(e),n=a,r=a.branch,i=a.durable}else try{let r=await BP(t,e);if(r===null)return;n=r,i=!0}catch(t){this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-outbox-read-failed`,...this.recoveryTelemetryBase(e,f),...this.outboxFailureFields(t)});return}if(i){let t;try{t=await VP(r,e)}catch(t){this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-outbox-consume-failed`,...this.recoveryTelemetryBase(e,f),...this.outboxFailureFields(t)});return}if(!t){this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-superseded`,...this.recoveryTelemetryBase(e,f),reason:`claimed-by-another-tab`});return}}if(d.kind!==`active`||this.entries.get(e)!==d){this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-abandoned`,...this.recoveryTelemetryBase(e,f),reason:`entry-replaced-during-consume`,replayByteLength:n.delta.byteLength});return}try{if(n.fullState!==null&&this.replayBufferedContent(e,o,n.fullState))return;fo(o.document,n.delta,uF),this.emitStructuredClientBreadcrumb({event:`ok-pool-buffer-replay-delta-applied`,docName:e,deltaBytes:n.delta.byteLength})}catch(t){let r=t instanceof Error?t.name:`non-error-throw`;this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-failed`,...this.recoveryTelemetryBase(e,f),replayByteLength:n.delta.byteLength,errorName:r,errorMessage:t instanceof Error?t.message:String(t)})}},m=()=>{o.off(`synced`,m),p().catch(t=>{this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-unexpected-error`,docName:e,errorName:t instanceof Error?t.name:`non-error-throw`,errorMessage:t instanceof Error?t.message:String(t)})})};if(o.on(`synced`,m),this._entries.set(e,d),this.touch(e),this.notify(),l===null&&s!==null&&s.length>0&&c===void 0&&this.validateStoredStateThenAttach(d,s),c!==void 0&&s!==null&&s.length>0){let t=s;c.then(()=>{this.attachDeferredPersistenceForEntry(d,t)},t=>{console.warn(JSON.stringify({event:`ok-pool-deferred-persistence-attach-skipped`,docName:e,reason:`pending-clear-failed`,message:t instanceof Error?t.message:String(t)}))})}let h=dd(e);return h!==void 0&&xd(h,`ok.provider-pool.open`,{"doc.name":e},n,Date.now()),d}attachDeferredPersistenceForEntry(e,t){let n=this._entries.get(e.docName);n!==e||n.kind!==`active`||n.persistence!==null||this.validateStoredStateThenAttach(n,t)}handleServerInstanceMismatch(e){if(this.handledStaleClaims.has(e)){this.emitStructuredClientBreadcrumb({event:`ok-pool-mismatch-transition-deduped`,reason:`claim-already-handled`,staleClaim:e});return}if(this.handledStaleClaims.add(e),this.cachedServerInstanceId===e&&(this.cachedServerInstanceId=null),this.mismatchInFlight!==null){this.emitStructuredClientBreadcrumb({event:`ok-pool-mismatch-transition-deduped`,reason:`recycle-in-flight`,staleClaim:e,inflightForClaim:this.recoveryMismatchStaleClaim??``});return}this.recoveryMismatchStaleClaim=e.length>0?e:void 0;let t=Array.from(this.entries.entries());this.emitStructuredClientBreadcrumb({event:`ok-pool-mismatch-recycle-begin`,entryCount:t.length,branch:this.normalizedObservedBranch()});let n=Date.now(),r=this.normalizedObservedBranch(),i=[],a=this.activeDocName,o=a!==null&&t.some(([e,t])=>e===a&&t.kind===`active`)?[a]:[],s=a??t.find(([,e])=>e.kind===`active`)?.[0]??``;s.length>0&&this.emitStructuredClientRecoveryEvent({event:`ok-client-cache-epoch-mismatch`,...this.recoveryTelemetryBase(s)}),this.beginServerRestartRecovery(o,n);for(let[e,n]of t)n.kind===`active`&&!o.includes(e)&&cF(e);for(let[e,n]of t){if(n.kind!==`active`)continue;let t=n.lastDiskAckedSV??n.lastServerSyncedSV;if(t===null){this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-skipped-no-baseline`,...this.recoveryTelemetryBase(e),reason:`no-disk-ack-or-server-sync-vector`});continue}let a=Op(n.provider.document,t);if(a.byteLength>SF){X(`ok/pool/buffer-overflow`,{docName:e,bytes:a.byteLength});continue}if(a.byteLength>0){let t=Ya(n.provider.document),o=t.byteLength>SF?null:t,s={delta:a,fullState:o,branch:r,durable:!1};this.bufferedUpdates.set(e,s),o!==null&&i.push(zP(r,e,{delta:a,fullState:o}).then(t=>{t?s.durable=!0:this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-outbox-unavailable`,...this.recoveryTelemetryBase(e),reason:`indexeddb-databases-unsupported`})}).catch(t=>{this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-outbox-write-failed`,...this.recoveryTelemetryBase(e),...this.outboxFailureFields(t)})})),this.emitStructuredClientBreadcrumb({event:`ok-pool-mismatch-buffer-captured`,docName:e,deltaBytes:a.byteLength,fullStateBytes:o===null?0:o.byteLength})}}let c=[];for(let[e,n]of t)n.kind===`active`&&n.persistence!==null&&c.push({docName:e,persistence:n.persistence});let l=()=>{let e=c.map(({docName:e,persistence:t})=>({docName:e,promise:this.withClearDataTimeout(e,t.clearData())}));return this.emitStructuredClientBreadcrumb({event:`ok-pool-mismatch-clears-begin`,count:e.length}),Promise.allSettled(e.map(e=>e.promise)).then(t=>{let r=[],i=[],o=!1;t.forEach((t,n)=>{let a=e[n];if(!a)return;let s=a.docName;if(t.status===`rejected`){r.push(s);let e=t.reason instanceof _F;if(e&&(o=!0),e)this.emitStructuredClientRecoveryEvent({event:`ok-client-cache-clear-failed`,...this.recoveryTelemetryBase(s),failureKind:`timeout`});else{let e=t.reason instanceof Error?t.reason.name:`unknown`;this.emitStructuredClientRecoveryEvent({event:`ok-client-cache-clear-failed`,...this.recoveryTelemetryBase(s),failureKind:`rejected`,errorName:e,errorMessage:t.reason instanceof Error?t.reason.message:String(t.reason)})}}else i.push(s)});let s=i.filter(e=>e===a);if(r.length>0){let e=o?`clear-data-timeout`:`clear-data-failed`;console.warn(JSON.stringify({event:`ok-mismatch-recycle-partial-clears-failed`,failedDocs:r,clearedDocs:i})),this.enterServerRestartReconnect(s,r,n,e);for(let e of i)this.recycleDisconnectedEntry(e);return}this.enterServerRestartReconnect(s,[],n,`clear-data-failed`),this.recycleAllEntries()})},u=(i.length===0?l():Promise.allSettled(i).then(l)).finally(()=>{this.mismatchInFlight===u&&(this.mismatchInFlight=null,this.handledStaleClaims.clear())});this.mismatchInFlight=u}replayBufferedContent(e,t,n){let r=new Ha;try{fo(r,n);let i=r.getText(`source`).toString(),a=Wu(r.getXmlFragment(`default`),mF()).toJSON(),o=new mr({extensions:DP}).serialize(a),{frontmatter:s,body:c}=Sn(i),l=t.document.getText(`source`).toString(),{body:u}=Sn(l),d=pt(u),f=pt(c)===d&&!vt(u,c),p=pt(o)===d&&!vt(u,o);if(f&&p)return!0;let m;if(f)m=Pt(s,o).md;else if(p)m=i;else return this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-diverged`,...this.recoveryTelemetryBase(e)}),!1;if(m!==l){let e=Math.min(m.length,l.length),n=0;for(;n<e&&m[n]===l[n];)n+=1;let r=0;for(;r<e-n&&m[m.length-1-r]===l[l.length-1-r];)r+=1;let i=t.document.getText(`source`);t.document.transact(()=>{i.delete(n,l.length-n-r),i.insert(n,m.slice(n,m.length-r))},uF)}return this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-content-applied`,...this.recoveryTelemetryBase(e),surface:f?`fragment`:`ytext`}),!0}catch(t){return this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-content-failed`,...this.recoveryTelemetryBase(e),errorName:t instanceof Error?t.name:`non-error-throw`,errorMessage:t instanceof Error?t.message:String(t)}),!1}finally{r.destroy()}}awaitMismatchSettled(){return this.mismatchInFlight??Promise.resolve()}isMismatchRecycleInFlight(){return this.mismatchInFlight!==null}recycleAllEntries(){let e=Array.from(this.entries.keys());this.emitStructuredClientBreadcrumb({event:`ok-pool-recycle-all`,count:e.length});for(let t of e)this.recycleDisconnectedEntry(t)}prewarm(e){if(OP(e))return null;let t=this.entries.get(e);if(t)return t;let n=this.open(e);if(!n)return null;let r=this.lruOrder.indexOf(e);return r!==-1&&(this.lruOrder.splice(r,1),this.lruOrder.unshift(e)),n}close(e){let t=this.entries.get(e);t&&(this.destroyEntry(t),this._entries.delete(e),this.lruOrder=this.lruOrder.filter(t=>t!==e),this.discardBufferedUpdate(e),this.activeDocName===e&&(this.activeDocName=null),this.notify())}async closeAndClearPersistence(e){try{await this.runCloseAndClearPersistence(e)}catch{}}runCloseAndClearPersistence(e){let t=this.pendingClears.get(e);if(t!==void 0)return t;let n=()=>{},r=()=>{},i=new Promise((e,t)=>{n=e,r=t});this.pendingClears.set(e,i);let a=()=>{this.pendingClears.get(e)===i&&this.pendingClears.delete(e)};return i.then(a,a),this.executeCloseAndClearPersistence(e).then(n,r),i}async executeCloseAndClearPersistence(e){this.clearFailures.delete(e);let t=this.entries.get(e);if(t?.kind===`active`&&t.persistence!==null){let n=t.persistence;try{this.close(e)}catch(t){console.warn(`[ProviderPool] close before clearData threw for ${e}:`,t)}try{await this.withClearDataTimeout(e,n.clearData())}catch(t){throw console.warn(`[ProviderPool] clearData on rename failed for ${e}:`,t),this.clearFailures.add(e),t}return}if(t)try{this.close(e)}catch(t){console.warn(`[ProviderPool] close before IDB-by-name delete threw for ${e}:`,t)}let n=this.normalizedObservedBranch(),r=this.cachedServerInstanceId;if(r===null)return;let i=`ok-ydoc:${n}:${r}:${e}`;try{await this.withClearDataTimeout(e,new Promise((e,t)=>{let n=indexedDB.deleteDatabase(i);n.onsuccess=()=>e(),n.onerror=()=>t(n.error),n.onblocked=()=>{console.warn(`[ProviderPool] IDB delete blocked for ${i}`)}}))}catch(t){throw console.warn(`[ProviderPool] IDB delete on rename failed for ${i}:`,t),this.clearFailures.add(e),t}}clearBufferedUpdates(){for(let e of Array.from(this.bufferedUpdates.keys()))this.discardBufferedUpdate(e)}discardBufferedUpdate(e){let t=this.bufferedUpdates.get(e);this.bufferedUpdates.delete(e),!(t===void 0||!t.durable)&&VP(t.branch,e).catch(t=>{this.emitStructuredClientRecoveryEvent({event:`ok-buffer-replay-outbox-discard-failed`,...this.recoveryTelemetryBase(e),...this.outboxFailureFields(t)})})}__test_seedBufferedUpdate(e,t,n={}){this.bufferedUpdates.set(e,{delta:t,fullState:n.fullState??null,branch:n.branch??this.normalizedObservedBranch(),durable:n.durable??!1})}__test_bufferedUpdatesSize(){return this.bufferedUpdates.size}__test_hasBufferedUpdate(e){return this.bufferedUpdates.has(e)}__test_getBufferedUpdate(e){return this.bufferedUpdates.get(e)?.delta}setActive(e){let t=this.entries.get(e);if(!t)throw Error(`[ProviderPool] Cannot setActive — "${e}" is not open`);t.lastAccessedAt=Date.now(),this.touch(e),this.activeDocName=e,this.notify()}clearActive(){this.activeDocName!==null&&(this.activeDocName=null,this.notify())}getActive(){return this.activeDocName?this.entries.get(this.activeDocName)??null:null}getActiveDocName(){return this.activeDocName}has(e){return this.entries.has(e)}peek(e){return this.entries.get(e)??null}setFlushOnHideEnabled(e){this.flushOnHideEnabled=e}flushOnHide(){if(this.flushOnHideEnabled&&this.mismatchInFlight===null)for(let e of this._entries.values())e.kind===`active`&&e.provider.unsyncedChanges>0&&(e.provider.forceSync(),e.persistence?.flushFullState().catch(t=>{this.emitStructuredClientRecoveryEvent({event:`ok-pool-flush-on-hide-failed`,...this.recoveryTelemetryBase(e.docName),errorName:t instanceof Error?t.name:`non-error-throw`,errorMessage:t instanceof Error?t.message:String(t)})}))}resyncOnVisible(){if(this.flushOnHideEnabled&&this.mismatchInFlight===null)for(let e of this._entries.values())e.kind===`active`&&e.syncState===`synced`&&e.provider.forceSync()}hasAnyUnsyncedWork(){for(let e of this._entries.values())if(e.kind===`active`&&e.provider.unsyncedChanges>0)return!0;return!1}addUnsyncedWorkListener(e){return this.unsyncedWorkListeners.add(e),()=>{this.unsyncedWorkListeners.delete(e)}}emitUnsyncedWork(){for(let e of this.unsyncedWorkListeners)try{e()}catch(e){this.emitStructuredClientRecoveryEvent({event:`ok-pool-unsynced-work-listener-threw`,error:e instanceof Error?e.message:String(e)})}}recycle(e){this.recycleDisconnectedEntry(e)}dispose(){for(let e of this._entries.values())this.destroyEntry(e);this._entries.clear(),this.lruOrder=[],this.activeDocName=null,this.visibleDocNames.clear(),this.onChange=null,this.bufferedUpdates.clear(),this.pendingClears.clear(),this.clearFailures.clear(),this.handledStaleClaims.clear(),this.docLineageEpochs.clear(),this.docLineageEpochsEnvelopeConsumed=!1,this.onBranchMismatch=null,this.branchMismatchInFlight=null,this.mismatchInFlight=null,this.onRenameRedirect=null,this.onDocDeleted=null,this.evictListeners.clear(),this.serverRestartRecoveryState=dF,this.cachedServerInstanceId=null,this.pendingServerInstanceKnown=null,this.tabIdentity=null,this.recoveryMismatchStaleClaim=void 0,this.unsyncedWorkListeners.clear(),this.flushOnHideEnabled=!0}evictLru(){for(let e of this.lruOrder)if(!this.isProtected(e))return X(`ok/pool/evict-lru`,{docName:e}),this.close(e),!0;return!1}destroyEntry(e){if(e.kind===`tearing-down`)return;let t=e.observerCleanup,n=e.observerFireCounterCleanup,r=e.persistence,i=e.pendingRecycleTimer,a=e.docName,o=e;o.kind=`tearing-down`,o.persistence=null,o.observerCleanup=null,o.observerFireCounterCleanup=null,o.pendingRecycleTimer=null,o.serverDrivenCloseReauthInFlight=!1,i&&clearTimeout(i),cF(a),this.fireEvict(a);try{t?.()}catch(e){console.warn(`[ProviderPool] observer cleanup threw for ${a}:`,e)}try{n?.()}catch(e){console.warn(`[ProviderPool] observer-fire-counter cleanup threw for ${a}:`,e)}r!==null&&r.destroy().catch(e=>{console.warn(`[ProviderPool] persistence destroy failed for ${a}:`,e)});try{o.provider.destroy()}catch(e){console.warn(`[ProviderPool] Provider destroy failed for ${a}:`,e)}}recycleDisconnectedEntry(e){let t=this.entries.get(e);if(!t||t.kind!==`active`)return;let n=this.activeDocName===e;if(X(`ok/pool/recycle-disconnected`,{docName:e,wasActive:n}),this.emitStructuredClientBreadcrumb({event:`ok-pool-recycle-entry`,docName:e,wasActive:n}),this.destroyEntry(t),this._entries.delete(e),this.lruOrder=this.lruOrder.filter(t=>t!==e),n){this.open(e)&&this.setActive(e);return}this.notify()}},TF=crypto.randomUUID(),EF=!1;function DF(e){EF||(EF=!0,console.warn(`[principal-fetch] failed to resolve principal — falling back to random identity.`,e))}var OF=(0,Q.createContext)(null),kF=/\.(md|mdx)$/i,AF=null;function jF(e){return AF||(AF=new wF(CF,e),Uf(AF)),AF}var MF={activeDocName:null,activeProvider:null,syncState:`connecting`,serverRestartRecovery:{kind:`idle`},poolEntries:[]};function NF(){if(typeof window>`u`)return null;let e=window.okDesktop;return e?.config.mode===`editor`?e:null}function PF(){return typeof window>`u`||window.okDesktop?.config.mode===`editor`?null:Ui(window.location.origin)}function FF(){if(typeof window>`u`)return Ri(null);let e=PF();return e?Ei(window.localStorage===void 0?null:window.localStorage,e):Ri(null)}var IF=`new-tab:`,LF=`new-tab:skills:`;function RF(e){return e?.startsWith(LF)??!1}function zF(e){return RF(e)||aa(e)}function BF(e){let t=ia(e);switch(t.kind){case`doc`:return pi(t.docName);case`folder`:return _i(t.folderPath);case`asset`:return fi(t.assetPath);case`skill-file`:return gi({scope:t.scope,name:t.name,path:t.path});case`skill-preview`:return hi({flavor:t.flavor,source:t.source,name:t.name,subtitle:t.subtitle})}}function VF(e){typeof window<`u`&&window.location.hash!==e&&(window.location.hash=e)}function HF(e){if(!e)throw Error(`removal reconciler is not initialized`);return e}function UF(e){let t=ia(e);switch(t.kind){case`doc`:return{kind:`doc`,target:t.docName,docName:t.docName};case`folder`:return{kind:`folder`,target:t.folderPath,folderPath:t.folderPath};case`asset`:return ZF(t.assetPath);case`skill-file`:return{kind:`skill-file`,target:`${t.scope}/${t.name}${t.host?`:${t.host}`:``}/${t.path}`,scope:t.scope,name:t.name,path:t.path,...t.host?{host:t.host}:{}};case`skill-preview`:return{kind:`skill-preview`,target:`${t.flavor}/${t.source}/${t.name}`,flavor:t.flavor,source:t.source,name:t.name,subtitle:t.subtitle,level:t.level}}}function WF(e){return e.activeNewTabId!==null||e.activeTabId===null?e.activeTarget===null?e:{...e,activeTarget:null}:(e.activeTarget?Ji(e.activeTarget):null)===e.activeTabId?e:{...e,activeTarget:UF(e.activeTabId)}}function GF(e){return{...e,panes:e.panes.map(WF)}}function KF(){let e=FF();return GF(oa({panes:e.panes,focusedPaneId:e.focusedPaneId}))}function qF(e){return!e.activeTarget||e.activeTarget.kind===`large-file`?null:Qi(e.activeTarget)}function JF(e){let t=new Set;for(let n of e.panes){let e=qF(n);e&&t.add(e)}return t}function YF(e){let t=di(e);if(t)return Xi(t);let n=bi(e);if(n)return Yi(n);let r=ui(e);if(r)return wi(r);let i=yi(e);if(!i)return null;let a=i.trim();if(/\/+$/.test(a)){let e=a.replace(/\/+$/g,``);return e?Ki(e):null}return Gi(i)}function XF(e,t,n){return!e||!n||t!==pi(e)||kF.test(e)||!kF.test(n)?!1:n.replace(kF,``)===e}function ZF(e){return{kind:`asset`,target:e,assetPath:e,mediaKind:Dr(e.split(`.`).pop()??``)}}function QF(e){switch(e.kind){case`doc`:return`doc:${e.docName}`;case`folder-index`:return`folder-index:${e.docName}:${e.folderPath}:${e.noteKind}`;case`folder`:return`folder:${e.folderPath}`;case`asset`:return`asset:${e.assetPath}:${e.mediaKind??``}`;case`skill-file`:return`skill-file:${e.scope}:${e.name}:${e.path}`;case`skills`:return`skills:hub`;case`skill-preview`:return`skill-preview:${e.flavor}:${e.source}:${e.name}:${e.subtitle}:${e.path??``}`;case`large-file`:return`large-file:${e.docName}:${e.size}:${e.limit}`;case`missing`:return`missing:${e.target}`}}function $F(e,t){return e===t?!0:!e||!t?!1:QF(e)===QF(t)}function eI(e,t){return e===t?!0:e.activeDocName!==t.activeDocName||e.activeProvider!==t.activeProvider||e.syncState!==t.syncState||e.serverRestartRecovery!==t.serverRestartRecovery||e.poolEntries.length!==t.poolEntries.length?!1:e.poolEntries.every((e,n)=>{let r=t.poolEntries[n];return e.docName===r.docName&&e.provider===r.provider&&e.poolEventId===r.poolEventId})}function tI(e){let t=e.getActive(),n=[];for(let t of e.entries.values())n.push({docName:t.docName,provider:t.provider,lastAccessedAt:t.lastAccessedAt,poolEventId:t.poolEventId});return n.sort((e,t)=>t.lastAccessedAt-e.lastAccessedAt),{activeDocName:e.getActiveDocName(),activeProvider:t?.provider??null,syncState:t?.syncState??`connecting`,serverRestartRecovery:e.getServerRestartRecoveryState(),poolEntries:n}}function nI(e){let t=(0,$.c)(186),{children:n}=e,[r,i]=(0,Q.useState)(MF),[a,o]=(0,Q.useState)(KF),s=(0,Q.useRef)(a),c;t[0]===a.panes?c=t[1]:(c=()=>new Map(a.panes.map(hI)),t[0]=a.panes,t[1]=c);let[l,u]=(0,Q.useState)(c),d=(0,Q.useRef)(l),f=Li(a),p=f.activeTarget,h=f.activeTabId,g;t[2]===a?g=t[3]:(g=ji(a),t[2]=a,t[3]=g);let _=g,v;t[4]===a?v=t[5]:(v=Oi(a),t[4]=a,t[5]=v);let y=v,b;t[6]===a.panes?b=t[7]:(b=new Map(a.panes.map(mI)),t[6]=a.panes,t[7]=b);let x=b,S=f.activeNewTabId,C=ra(l.get(f.id)??[],f.openTabs,f.newTabIds),[w,T]=(0,Q.useState)(null),E=(0,Q.useRef)({files:null,skills:null}),[D,O]=(0,Q.useState)(!1),k=(0,Q.useRef)(1),A=(0,Q.useRef)(1),j;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(j=[],t[8]=j):j=t[8];let M=(0,Q.useRef)(j),N=(0,Q.useRef)(null),P=(0,Q.useRef)(!1),F=(0,Q.useRef)(!1),[I,L]=(0,Q.useState)(null),[R,z]=(0,Q.useState)(null),[B,V]=(0,Q.useState)(`doc`),[H,U]=(0,Q.useState)(null),[ee,te]=(0,Q.useState)(0),{collabUrl:W,terminal:ne,lastError:re,retry:ie}=mo(),ae;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(ae=function(){let e=``;do e=`pane-${A.current}`,A.current+=1;while(s.current.panes.some(t=>t.id===e));return e},t[9]=ae):ae=t[9];let oe=ae,se;t[10]===W?se=t[11]:(se=function(e,t){let n=t===void 0?!1:t,r=Li(e);if(W!==null){let t=jF(W),n=JF(e);t.setVisibleDocNames(n);for(let e of n)t.open(e);let i=qF(r);i?(t.open(i),t.setActive(i)):t.clearActive()}if(!n)return;let i=``;r.activeNewTabId===null?r.activeTabId!==null&&(i=BF(r.activeTabId)):RF(r.activeNewTabId)&&(i=mi()),VF(i)},t[10]=W,t[11]=se);let ce=se,le;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(le=function(e,t){return e.focusedPaneId!==t.focusedPaneId||e.panes.length!==t.panes.length?!1:e.panes.every((e,n)=>{let r=t.panes[n];return r!==void 0&&e.id===r.id&&e.activeTabId===r.activeTabId&&e.activeNewTabId===r.activeNewTabId&&e.previewTabId===r.previewTabId&&Math.abs(e.size-r.size)<1e-9&&$F(e.activeTarget,r.activeTarget)&&e.openTabs.join(`\0`)===r.openTabs.join(`\0`)&&e.pinnedTabIds.join(`\0`)===r.pinnedTabIds.join(`\0`)&&e.newTabIds.join(`\0`)===r.newTabIds.join(`\0`)})},t[12]=le):le=t[12];let G=le,K;t[13]===ce?K=t[14]:(K=function(e,t){let n=t===void 0?!1:t,r=GF(Ti(e));if(G(s.current,r)){ce(s.current,n);return}s.current=r;let i=new Set(r.panes.map(pI));for(let e of d.current.keys())i.has(e)||d.current.delete(e);for(let e of r.panes)d.current.set(e.id,ra(d.current.get(e.id)??[],e.openTabs,e.newTabIds));u(new Map(d.current)),o(e=>e===r?e:r),ce(r,n)},t[13]=ce,t[14]=K);let q=K,ue;t[15]===q?ue=t[16]:(ue=function(e,t,n){let r=n===void 0?{}:n,i=s.current;if(!i.panes.some(t=>t.id===e))return;let a=ki(i,e,t);q(r.focus?{...a,focusedPaneId:e}:a,r.updateHash)},t[15]=q,t[16]=ue);let de=ue,fe=w??(qi(p)||RF(S));(0,Q.useEffect)(()=>{if(!h)return;let e=aa(h)?`skills`:`files`;E.current[e]=h},[h]);let pe=C.filter(e=>zF(e)===fe),me=new Map([...l].map(e=>{let[t,n]=e;return[t,n.filter(e=>zF(e)===fe)]})),he=GF(Vi(a,me)),ge=Li(he),_e;t[17]!==E||t[18]!==W||t[19]!==q||t[20]!==O||t[21]!==D?(_e=()=>{if(W===null||D)return;let e=!1,t=NF(),n=PF(),r=typeof localStorage<`u`?localStorage:null;return(t?t.project.getSessionState():Promise.resolve(n?Ei(r,n):Ri(null))).then(t=>{if(F.current=!0,e)return;let n=Ri(t);if(P.current)return;let r=s.current,i=GF(oa({panes:n.panes,focusedPaneId:n.focusedPaneId})),a=i.focusedPaneId;for(let e of r.panes)for(let t of e.openTabs){let n=Ii(i,t);if(n){if(!n.openTabs.includes(t)){i=ki(i,n.id,n=>({...n,openTabs:[...n.openTabs,t],pinnedTabIds:e.pinnedTabIds.includes(t)?[...n.pinnedTabIds,t]:n.pinnedTabIds}));continue}e.pinnedTabIds.includes(t)&&!n.pinnedTabIds.includes(t)&&(i=ki(i,n.id,e=>({...e,pinnedTabIds:[...e.pinnedTabIds,t]})));continue}i=ki(i,a,n=>({...n,openTabs:[...n.openTabs,t],pinnedTabIds:e.pinnedTabIds.includes(t)?[...n.pinnedTabIds,t]:n.pinnedTabIds}))}let o=Li(r);o.newTabIds.length>0&&(i=ki(i,a,e=>({...e,newTabIds:[...new Set([...e.newTabIds,...o.newTabIds])],activeNewTabId:o.activeNewTabId,activeTabId:o.activeNewTabId?null:e.activeTabId,activeTarget:o.activeNewTabId?null:e.activeTarget}))),E.current={files:E.current.files??n.activeTabByMode.files,skills:E.current.skills??n.activeTabByMode.skills};let c=window.location.hash,l=YF(c),u=l?Ii(i,l):null;if(u&&l&&o.activeNewTabId===null){let e=Ii(r,l),t=e?.activeTabId===l?e.activeTarget:null;i={...ki(i,u.id,e=>WF({...e,activeTabId:l,activeNewTabId:null,activeTarget:t})),focusedPaneId:u.id}}let f=yi(window.location.hash),p=Li(i).activeTabId,m=p?BF(p):null,h=p?Wi(p):null,g=f===null&&window.location.hash.length===0||m!==null&&m===window.location.hash||XF(f,window.location.hash,h);i=GF(Ti(i));for(let e of i.panes)d.current.set(e.id,[...e.openTabs,...e.newTabIds]);q(i,g&&p!==null)}).catch(fI).finally(()=>{e||O(!0)}),()=>{e=!0}},t[17]=E,t[18]=W,t[19]=q,t[20]=O,t[21]=D,t[22]=_e):_e=t[22];let J;t[23]!==W||t[24]!==D?(J=[W,D],t[23]=W,t[24]=D,t[25]=J):J=t[25],(0,Q.useEffect)(_e,J);let ve;t[26]!==E||t[27]!==_.length||t[28]!==D||t[29]!==a?(ve=()=>{if(!D||!Fi(F.current,_.length))return;let e=na(a,E.current),t=NF();if(t){t.project.setSessionState(e).catch(dI);return}let n=PF();n&&Pi(typeof localStorage<`u`?localStorage:null,n,e)},t[26]=E,t[27]=_.length,t[28]=D,t[29]=a,t[30]=ve):ve=t[30];let ye;t[31]!==_.length||t[32]!==D||t[33]!==a?(ye=[_.length,D,a],t[31]=_.length,t[32]=D,t[33]=a,t[34]=ye):ye=t[34],(0,Q.useEffect)(ve,ye);let be;t[35]===D?be=t[36]:(be=function(){D||(P.current=!0)},t[35]=D,t[36]=be);let xe=be,Se;t[37]!==q||t[38]!==xe?(Se=function(e,t,n){let r=t===void 0?[]:t,i=n===void 0?[]:n;xe();let a=t=>zi([t],e,2**53-1,r,[],i)[0]??null;for(let[t,n]of d.current)d.current.set(t,Di(n,e,r,i));let o=Li(s.current).activeTabId,c=Hi(s.current,{type:`remap-tabs`,remap:a}).workspace,l=Li(c).activeTabId;q(c,o!==null&&o!==l)},t[37]=q,t[38]=xe,t[39]=Se):Se=t[39];let Ce=Se,we;t[40]===W?we=t[41]:(we=function(e,t){if(W===null)return;let n=new Set;for(let e of ji(t)){let t=Wi(e);t&&n.add(t)}let r=jF(W);for(let t of e){let e=Wi(t);e&&!n.has(e)&&r.close(e)}},t[40]=W,t[41]=we);let Te=we,Ee;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=function(e,t,n){let r=e.activeTabId&&t.has(e.activeTabId)?e.activeTabId:e.activeNewTabId&&t.has(e.activeNewTabId)?e.activeNewTabId:null;if(!r)return n;let i=n.panes.find(t=>t.id===e.id),a=i?.activeTabId??i?.activeNewTabId??null,o=zF(r);if(!i||!a||zF(a)===o)return n;let s=ra(d.current.get(e.id)??[],e.openTabs,e.newTabIds),c=s.indexOf(r),l=c<0?s:[...s.slice(c+1),...s.slice(0,c).reverse()],u=new Set([...i.openTabs,...i.newTabIds]),f=l.find(e=>!t.has(e)&&u.has(e)&&zF(e)===o);if(f)return ki(n,e.id,e=>({...e,activeTabId:e.openTabs.includes(f)?f:null,activeNewTabId:e.newTabIds.includes(f)?f:null,activeTarget:null}));let p=`${o?LF:IF}${k.current}`;return k.current+=1,ki(n,e.id,e=>({...e,newTabIds:[...e.newTabIds,p],activeTabId:null,activeNewTabId:p,activeTarget:null}))},t[42]=Ee):Ee=t[42];let De=Ee,Oe;t[43]!==Te||t[44]!==q||t[45]!==xe?(Oe=(e,t,n)=>{let r=n===void 0?{}:n,i=s.current.panes.find(t=>t.id===e);if(!i)return;let a=new Set(r.force?t.filter(e=>i.openTabs.includes(e)):$i(t,i.pinnedTabIds).filter(e=>i.openTabs.includes(e)));if(a.size===0)return;if(xe(),!r.force)for(let t of i.openTabs.filter(e=>a.has(e)))M.current=Ai(M.current,{paneId:e,tabId:t},50);let o=s.current.focusedPaneId===e,c=De(i,a,Hi(s.current,{type:`close-tabs`,paneId:e,tabIds:[...a]}).workspace);Te(a,c),q(c,o)},t[43]=Te,t[44]=q,t[45]=xe,t[46]=Oe):Oe=t[46];let ke=Oe,Ae;t[47]===ke?Ae=t[48]:(Ae=function(e,t){let n=t===void 0?{}:t,r=new Set(e.filter(uI));for(let e of s.current.panes.map(lI)){let t=s.current.panes.find(t=>t.id===e);if(!t)continue;let i=t.openTabs.filter(e=>r.has(e));i.length>0&&ke(e,i,n)}},t[47]=ke,t[48]=Ae);let je=Ae,Me;t[49]!==je||t[50]!==W||t[51]!==q||t[52]!==Ce?(Me=function(){return Rl({captureRenameSnapshots:Cf,getActivePoolDocName:()=>W===null?null:jF(W).getActiveDocName(),hasPooledDocument:e=>W!==null&&jF(W).has(e),closeAndClear:async e=>{W!==null&&await jF(W).closeAndClearPersistence(e)},openAndActivate:e=>{if(W===null)return;let t=jF(W);t.open(e),t.setActive(e)},remapTabs:e=>{let{renamed:t,renamedFolders:n,renamedAssets:r}=e;return Ce(t,n,r)},closeTabs:e=>je(e,{force:!0}),removeDocumentTab:e=>{let t=Hi(s.current,{type:`prune-tabs`,keep:t=>Wi(t)!==e}).workspace;q(t)},remapActiveTargetForRename:(e,t)=>qF(Li(s.current))===t,clearActiveTargetForRemoval:e=>{q({...s.current,panes:s.current.panes.map(t=>t.activeTarget&&Qi(t.activeTarget)===e?{...t,activeTarget:null}:t)})},navigateToDocument:cI,navigateHome:()=>{let e=Li(s.current);VF(e.activeTabId?BF(e.activeTabId):``)}})},t[49]=je,t[50]=W,t[51]=q,t[52]=Ce,t[53]=Me):Me=t[53];let Ne=Me,Pe;t[54]===Ne?Pe=t[55]:(Pe=()=>{N.current=Ne()},t[54]=Ne,t[55]=Pe),(0,Q.useEffect)(Pe);let Fe;t[56]!==W||t[57]!==L||t[58]!==ce?(Fe=()=>{if(W===null)return;let e=!1,t=jF(W),n=()=>{i(e=>{let n=tI(t);return eI(e,n)?e:n})};return n(),ce(s.current),t.setOnBranchMismatch(()=>kl(t)),t.setOnRenameRedirect(e=>{let{fromDocName:t,toDocName:n,hadOpenProvider:r}=e;(async()=>{let e;try{await HF(N.current).reconcileAuthRename({fromDocName:t,toDocName:n})}catch(r){let i=r;e=i,console.warn(JSON.stringify({event:`removal-cleanup-error`,kind:`renamed`,fromDocName:t,toDocName:n,message:String(i instanceof Error?i.message:i)}))}console.info(JSON.stringify({event:`removal.cleanup`,kind:`renamed`,fromDocName:t,toDocName:n,hadOpenProvider:r,hadStaleIdb:!r,source:`auth-rejection`,errored:e!==void 0}))})()}),t.setOnDocDeleted(e=>{let{docName:t,hadOpenProvider:n}=e;(async()=>{let e;try{await HF(N.current).reconcileAuthRemoval({docName:t})}catch(n){let r=n;e=r,console.warn(JSON.stringify({event:`removal-cleanup-error`,kind:`deleted`,docName:t,message:String(r instanceof Error?r.message:r)}))}console.info(JSON.stringify({event:`removal.cleanup`,kind:`deleted`,fromDocName:t,hadOpenProvider:n,hadStaleIdb:!n,source:`auth-rejection`,errored:e!==void 0}))})()}),t.setOnChange(n),fetch(`/api/principal`).then(sI).then(n=>{if(e)return;let r=Wn.safeParse(n);r.success?(t.setTabIdentity({principalId:r.data.id,tabSessionId:TF}),L(r.data)):DF(r.error)}).catch(t=>{e||DF(t)}),kl(t),()=>{e=!0,t.setOnChange(null),t.setOnRenameRedirect(null),t.setOnDocDeleted(null)}},t[56]=W,t[57]=L,t[58]=ce,t[59]=Fe):Fe=t[59];let Ie;t[60]===W?Ie=t[61]:(Ie=[W],t[60]=W,t[61]=Ie),(0,Q.useEffect)(Fe,Ie);let Le=function(e,t){let n=t===void 0?!0:t,r=s.current.panes.find(t=>t.id===e);if(!r)return;let i=he.panes.find(t=>t.id===e),a=s.current;if(i?.activeTabId&&i.activeTabId!==r.activeTabId)T(null),a=Hi(a,{type:`activate-tab`,paneId:e,tabId:i.activeTabId}).workspace;else if(i?.activeNewTabId&&i.activeNewTabId!==r.activeNewTabId)T(null),a=ki(a,e,e=>({...e,activeTabId:null,activeNewTabId:i.activeNewTabId,activeTarget:null}));else if(a.focusedPaneId===e)return;q(Ni({...a,panes:a.panes.map(t=>t.id===e?WF(t):t)},e),n)},Re;t[62]!==q||t[63]!==T?(Re=function(e,t,n){let r=n===void 0?!0:n,i=s.current.panes.find(t=>t.id===e);i&&i.openTabs.includes(t)&&(T(null),q(Hi(s.current,{type:`activate-tab`,paneId:e,tabId:t}).workspace,r))},t[62]=q,t[63]=T,t[64]=Re):Re=t[64];let ze=Re,Be,Ve,He,Ue,We;if(t[65]!==W||t[66]!==q||t[67]!==xe||t[68]!==T||t[69]!==de){Ve=e=>{X(`ok/nav/open-document`,{docName:e,transition:!1}),Ue({kind:`doc`,target:e,docName:e},{disposition:`permanent`,consumeActiveNewTab:!0})},He=e=>{X(`ok/nav/open-document`,{docName:e,transition:!1}),Ve(e)};let e;t[75]!==q||t[76]!==T||t[77]!==de?(e=function(e,t){let n=s.current.panes.find(t=>t.id===e);if(!n)return;let r=n.newTabIds.find(e=>RF(e)===t);if(T(null),r){de(n.id,e=>({...e,activeNewTabId:r,activeTabId:null,activeTarget:null}),{updateHash:!0});return}let i=`${t?LF:IF}${k.current}`;k.current+=1,q(Hi(s.current,{type:`open-new-tab`,paneId:n.id,tabId:i}).workspace,!0)},t[75]=q,t[76]=T,t[77]=de,t[78]=e):e=t[78],Be=e,Ue=(e,t,n,r)=>{let i=t===void 0?{}:t,a=r===void 0?`activate-owner`:r;if(W===null)return;let o=n??s.current.focusedPaneId,c=jF(W);if(e.kind===`skills`){Be(o,!0);return}let l=Qi(e),u=Ji(e);if(!u)return;if(l&&e.kind!==`large-file`){let e=c.open(l);if(!e)return;Tl(l,e.poolEventId)}let d=Hi(s.current,{type:`open-target`,paneId:o,tabId:u,target:e,disposition:i.disposition??(i.tabBehavior===`replace-active`?`preview`:`permanent`),consumeActiveNewTab:i.consumeActiveNewTab??!0,existingTabBehavior:a});d.replacedPreviewTabId!==null&&xe(),T(null),q(d.workspace)},We=(e,t)=>{Ue(e,t)},t[65]=W,t[66]=q,t[67]=xe,t[68]=T,t[69]=de,t[70]=Be,t[71]=Ve,t[72]=He,t[73]=Ue,t[74]=We}else Be=t[70],Ve=t[71],He=t[72],Ue=t[73],We=t[74];let Ge=We,Ke;t[79]===Ue?Ke=t[80]:(Ke=(e,t,n)=>{Ue(t,n,e,`open-in-pane`)},t[79]=Ue,t[80]=Ke);let qe=Ke,Je;t[81]===Ue?Je=t[82]:(Je=(e,t)=>{X(`ok/nav/open-target`,{docName:Qi(e),kind:e.kind,transition:!1}),Ue(e,t)},t[81]=Ue,t[82]=Je);let Ye=Je,Xe;t[83]===ze?Xe=t[84]:(Xe=e=>ze(s.current.focusedPaneId,e),t[83]=ze,t[84]=Xe);let Ze=Xe,Qe;t[85]!==q||t[86]!==fe?(Qe=e=>{if(!s.current.panes.find(t=>t.id===e))return;let t=`${fe?LF:IF}${k.current}`;k.current+=1,q(Hi(s.current,{type:`open-new-tab`,paneId:e,tabId:t}).workspace,!0)},t[85]=q,t[86]=fe,t[87]=Qe):Qe=t[87];let $e=Qe,et;t[88]===$e?et=t[89]:(et=()=>$e(s.current.focusedPaneId),t[88]=$e,t[89]=et);let tt=et,nt;t[90]===ke?nt=t[91]:(nt=(e,t)=>ke(e,[t]),t[90]=ke,t[91]=nt);let rt=nt,it;t[92]===rt?it=t[93]:(it=e=>rt(s.current.focusedPaneId,e),t[92]=rt,t[93]=it);let at=it,ot;t[94]!==q||t[95]!==xe||t[96]!==T?(ot=(e,t)=>{xe();let n=s.current.panes.find(t=>t.id===e);if(!n?.newTabIds.includes(t))return;let r=n.activeNewTabId===t,i=Hi(s.current,{type:`close-tabs`,paneId:e,tabIds:[t]}).workspace,a=i.panes.find(t=>t.id===e),o=a?.activeTabId??a?.activeNewTabId??null,c=RF(t),l=o!==null&&zF(o)===c;r&&!l&&T(c),q(i,s.current.focusedPaneId===e&&r&&l)},t[94]=q,t[95]=xe,t[96]=T,t[97]=ot):ot=t[97];let st=ot,ct;t[98]===st?ct=t[99]:(ct=e=>st(s.current.focusedPaneId,e),t[98]=st,t[99]=ct);let lt=ct,ut;t[100]!==Be||t[101]!==ze||t[102]!==E||t[103]!==T||t[104]!==fe?(ut=e=>{if(e===null){T(null);return}let t=e?`skills`:`files`;if((fe?`skills`:`files`)===t){T(e);return}let n=E.current[t],r=n?Ii(s.current,n):null;if(n&&r){T(null),ze(r.id,n);return}let i=Li(s.current);Be(i.id,e)},t[100]=Be,t[101]=ze,t[102]=E,t[103]=T,t[104]=fe,t[105]=ut):ut=t[105];let dt=ut,ft;t[106]!==st||t[107]!==rt?(ft=()=>{let e=Li(s.current),t=e.activeNewTabId;if(t)return st(e.id,t),!0;let n=new Set(e.pinnedTabIds),r=new Set(e.openTabs.filter(e=>!n.has(e))),i=e.activeTabId&&r.has(e.activeTabId)?e.activeTabId:null,a=d.current.get(e.id)??[],o=i??a.find(e=>r.has(e));if(o)return rt(e.id,o),!0;let c=new Set(e.newTabIds),l=a.find(e=>c.has(e));if(l)return st(e.id,l),!0;let u=s.current.panes.find(oI);if(!u)return!1;let f=u.activeNewTabId??u.newTabIds[0]??null;if(f)return st(u.id,f),!0;let p=(u.activeTabId&&!u.pinnedTabIds.includes(u.activeTabId)?u.activeTabId:null)??u.openTabs.find(e=>!u.pinnedTabIds.includes(e));return p?(rt(u.id,p),!0):!1},t[106]=st,t[107]=rt,t[108]=ft):ft=t[108];let pt=ft,mt;t[109]===q?mt=t[110]:(mt=function(e,t){s.current.panes.find(t=>t.id===e)?.newTabIds.includes(t)&&q(Hi(s.current,{type:`activate-tab`,paneId:e,tabId:t}).workspace,!0)},t[109]=q,t[110]=mt);let ht=mt,gt;t[111]===q?gt=t[112]:(gt=function(e,t){s.current.panes.find(t=>t.id===e)?.openTabs.includes(t)&&q(Hi(s.current,{type:`pin-tab`,paneId:e,tabId:t}).workspace)},t[111]=q,t[112]=gt);let _t=gt,vt;t[113]!==q||t[114]!==xe?(vt=function(e,t){s.current.panes.find(t=>t.id===e)?.pinnedTabIds.includes(t)&&(xe(),q(Hi(s.current,{type:`unpin-tab`,paneId:e,tabId:t}).workspace))},t[113]=q,t[114]=xe,t[115]=vt):vt=t[115];let yt=vt,bt;t[116]===q?bt=t[117]:(bt=function(e,t,n){let r=s.current.panes.find(t=>t.id===e);if(!r)return;let i=new Set([...r.openTabs,...r.newTabIds]),a=t.filter(e=>i.has(e));for(let e of[...r.openTabs,...r.newTabIds])a.includes(e)||a.push(e);d.current.set(e,a),u(new Map(d.current));let o=a.filter(e=>r.openTabs.includes(e)),c=a.filter(e=>r.newTabIds.includes(e)),l=Hi(s.current,{type:`reorder-tabs`,paneId:e,tabIds:o,draggedTabId:n}).workspace;q({...l,panes:l.panes.map(t=>t.id===e?{...t,newTabIds:c}:t)})},t[116]=q,t[117]=bt);let xt=bt,St;t[118]===q?St=t[119]:(St=function(e,t,n){let r=s.current.panes.find(t=>t.openTabs.includes(e)||t.newTabIds.includes(e)),i=s.current.panes.find(e=>e.id===t);if(!r||!i)return;let a=ra(d.current.get(t)??[],i.openTabs,i.newTabIds).filter(t=>t!==e),o=Math.max(0,Math.min(n,a.length)),c=Bi(a,r.newTabIds.includes(e)?i.newTabIds:i.openTabs,o),l=Hi(s.current,{type:`move-tab`,tabId:e,paneId:t,index:c}).workspace;r.id!==t&&(d.current.set(r.id,ra(d.current.get(r.id)??[],r.openTabs,r.newTabIds).filter(t=>t!==e)),a.splice(o,0,e),d.current.set(t,a)),q(l,!0)},t[118]=q,t[119]=St);let Ct=St,wt;t[120]!==q||t[121]!==oe?(wt=function(e,t,n){let r=s.current.panes.find(t=>t.openTabs.includes(e)||t.newTabIds.includes(e));if(!r)return null;let i=oe(),a=Hi(s.current,{type:`split-tab`,tabId:e,paneId:t,side:n,newPaneId:i}).workspace,o=a.panes.find(e=>e.id===i);return o?(d.current.set(r.id,ra(d.current.get(r.id)??[],r.openTabs,r.newTabIds).filter(t=>t!==e)),d.current.set(o.id,[e]),q(a,!0),o.id):null},t[120]=q,t[121]=oe,t[122]=wt):wt=t[122];let Tt=wt,Et;t[123]===Tt?Et=t[124]:(Et=function(e,t){let n=Ii(s.current,e);return n?Tt(e,n.id,t):null},t[123]=Tt,t[124]=Et);let Dt=Et,Ot;t[125]===q?Ot=t[126]:(Ot=function(e){e.size!==0&&q(Hi(s.current,{type:`resize-panes`,sizes:s.current.panes.map(t=>e.get(t.id)??t.size)}).workspace)},t[125]=q,t[126]=Ot);let kt=Ot,At;t[127]===q?At=t[128]:(At=function(e,t){q(Hi(s.current,{type:`promote-preview`,paneId:e,tabId:t}).workspace)},t[127]=q,t[128]=At);let jt=At,Mt;t[129]===q?Mt=t[130]:(Mt=function(){q(Hi(s.current,{type:`promote-all-previews`}).workspace)},t[129]=q,t[130]=Mt);let Nt=Mt,Pt;t[131]===jt?Pt=t[132]:(Pt=function(e){let t=Ii(s.current,e);!t||t.previewTabId!==e||jt(t.id,e)},t[131]=jt,t[132]=Pt);let Ft=Pt,It,Lt;t[133]===Ft?(It=t[134],Lt=t[135]):(It=()=>Kf(Ft),Lt=[Ft],t[133]=Ft,t[134]=It,t[135]=Lt),(0,Q.useEffect)(It,Lt);let Rt,zt;t[136]===pt?(Rt=t[137],zt=t[138]):(Rt=()=>m(e=>{e===`close-active-tab-or-window`&&(pt()||window.close())}),zt=[pt],t[136]=pt,t[137]=Rt,t[138]=zt),(0,Q.useEffect)(Rt,zt);let Bt=qF(ge),Vt;t[139]!==Bt||t[140]!==r.activeDocName||t[141]!==r.activeProvider||t[142]!==r.poolEntries?(Vt=r.activeDocName===Bt?r.activeProvider:r.poolEntries.find(e=>e.docName===Bt)?.provider??null,t[139]=Bt,t[140]=r.activeDocName,t[141]=r.activeProvider,t[142]=r.poolEntries,t[143]=Vt):Vt=t[143];let Ht=Vt,Ut;t[144]===Be?Ut=t[145]:(Ut=()=>{let e=Li(s.current);e.activeNewTabId!==null&&!RF(e.activeNewTabId)||Be(e.id,!1)},t[144]=Be,t[145]=Ut);let Wt;t[146]!==W||t[147]!==q||t[148]!==xe?(Wt=e=>{xe();let t=qF(Li(s.current))===e,n=Hi(s.current,{type:`prune-tabs`,keep:t=>Wi(t)!==e}).workspace;W!==null&&jF(W).close(e),q(n,t)},t[146]=W,t[147]=q,t[148]=xe,t[149]=Wt):Wt=t[149];let Gt;t[150]===_t?Gt=t[151]:(Gt=e=>_t(s.current.focusedPaneId,e),t[150]=_t,t[151]=Gt);let Kt;t[152]===yt?Kt=t[153]:(Kt=e=>yt(s.current.focusedPaneId,e),t[152]=yt,t[153]=Kt);let qt;t[154]===xt?qt=t[155]:(qt=(e,t)=>xt(s.current.focusedPaneId,e,t),t[154]=xt,t[155]=qt);let Jt;t[156]===ht?Jt=t[157]:(Jt=e=>ht(s.current.focusedPaneId,e),t[156]=ht,t[157]=Jt);let Yt;t[158]===q?Yt=t[159]:(Yt=()=>{let e=[...M.current];for(;e.length>0;){let t=e.shift();if(!t)continue;if(Ii(s.current,t.tabId)){M.current=e;continue}let n=s.current.panes.find(e=>e.id===t.paneId)??Li(s.current);M.current=e;let r=UF(t.tabId);q(Hi(s.current,{type:`open-target`,paneId:n.id,tabId:t.tabId,target:r,disposition:`permanent`,consumeActiveNewTab:!1}).workspace,!0);return}M.current=[]},t[158]=q,t[159]=Yt);let Xt;t[160]!==Te||t[161]!==q||t[162]!==xe?(Xt=e=>{let{pages:t,folderPaths:n,assetPaths:r,filePaths:i}=e,a=new Set(s.current.panes.flatMap(aI)),o=typeof window<`u`?yi(window.location.hash):null,c=ji(s.current),l=Zi(c,{pages:new Set([...t,...a]),folderPaths:n,assetPaths:r,filePaths:i,keepMissingDocName:null,keepHashDocName:o});if(l.length===c.length)return;let u=new Set(l),d=c.filter(e=>!u.has(e));xe();let f=Li(s.current).activeTabId,p=f!==null&&!u.has(f),m=Hi(s.current,{type:`prune-tabs`,keep:e=>u.has(e)}).workspace;Te(d,m),q(m,p)},t[160]=Te,t[161]=q,t[162]=xe,t[163]=Xt):Xt=t[163];let Zt,Qt;t[164]===Ne?(Zt=t[165],Qt=t[166]):(Zt=e=>Ne().reconcileLocalRename(e),Qt=e=>Ne().reconcileLocalRemoval(e),t[164]=Ne,t[165]=Zt,t[166]=Qt);let $t,en;t[167]===W?($t=t[168],en=t[169]):($t=e=>{W!==null&&jF(W).recycle(e)},en=e=>W===null?null:jF(W).prewarm(e)?.poolEventId??null,t[167]=W,t[168]=$t,t[169]=en);let tn,nn,rn,an,on;t[170]===W?(tn=t[171],nn=t[172],rn=t[173],an=t[174],on=t[175]):(tn=e=>{W!==null&&jF(W).setExpectedServerInstanceId(e)},nn=async e=>{if(W===null)return;let t=jF(W);t.setObservedBranch(e),await El(t,e),sa([`files`,`backlinks`,`graph`]),ua(e)},rn=async e=>{if(W===null)return;let t=jF(W);t.compareAndUpdateObservedBranch(e)&&(await El(t,e),sa([`files`,`backlinks`,`graph`]),ua(e))},an=(e,t)=>{W!==null&&jF(W).observeDiskAck(e,t)},on=async()=>{W!==null&&await kl(jF(W))},t[170]=W,t[171]=tn,t[172]=nn,t[173]=rn,t[174]=an,t[175]=on);let sn;t[176]!==Bt||t[177]!==H||t[178]!==B||t[179]!==U||t[180]!==te||t[181]!==V?(sn=(e,t)=>{if(!Bt&&t){VF(pi(t)),U(e),V(`agent`),te(iI);return}if(B===`agent`&&H===e){V(`doc`);return}U(e),V(`agent`),te(rI)},t[176]=Bt,t[177]=H,t[178]=B,t[179]=U,t[180]=te,t[181]=V,t[182]=sn):sn=t[182];let cn;return t[183]!==U||t[184]!==V?(cn=()=>{V(`doc`),U(null)},t[183]=U,t[184]=V,t[185]=cn):cn=t[185],(0,Z.jsx)(OF,{value:{principal:I,activeTarget:ge.activeTarget,activeTabId:ge.activeTabId,skillsSidebar:w,setSkillsSidebar:dt,skillFocused:fe,activeDocName:Bt,activeProvider:Ht,workspace:a,panes:he.panes,focusedPaneId:he.focusedPaneId,focusPane:Le,activateTabInPane:ze,activateNewTabInPane:ht,openNewTabInPane:$e,closeTabInPane:rt,closeTabsInPane:ke,closeNewTabInPane:st,pinTabInPane:_t,unpinTabInPane:yt,reorderTabsInPane:xt,moveTabToPane:Ct,splitTab:Tt,moveTabToNewPane:Dt,resizePanes:kt,openTabs:_,pinnedTabIds:y,visibleTabIdsByPane:me,previewTabIdsByPane:x,visibleTabIds:pe,tabSessionLoaded:D,syncState:r.syncState,serverRestartRecovery:r.serverRestartRecovery,poolEntries:r.poolEntries,openDocument:Ve,openDocumentTransition:He,openTarget:Ge,openTargetInPane:qe,openTargetTransition:Ye,promoteTabInPane:jt,promoteAllPreviewTabs:Nt,clearTarget:Ut,closeDocument:Wt,closeActiveTabOrWindow:pt,closeTab:at,pinTab:Gt,unpinTab:Kt,activateTab:Ze,reorderTabs:qt,newTabIds:ge.newTabIds,activeNewTabId:ge.activeNewTabId,isNewTabActive:ge.activeNewTabId!==null,openNewTab:tt,activateNewTab:Jt,closeNewTab:lt,reopenClosedTab:Yt,closeTabs:je,syncOpenTabsWithKnownTargets:Xt,reconcileLocalRename:Zt,reconcileLocalRemoval:Qt,recycleDocument:$t,prewarm:en,systemProvider:R,setSystemProvider:z,updateServerInstanceId:tn,onBranchSwitched:nn,observeBranch:rn,observeDiskAck:an,refreshServerInfo:on,collabUrl:W,collabTerminal:ne,collabLastError:re,retryCollab:ie,docPanelMode:B,docPanelAgentId:H,docPanelExpandSignal:ee,openActivityPanel:sn,closeActivityPanel:cn},children:n})}function rI(e){return e+1}function iI(e){return e+1}function aI(e){return e.activeTarget?.kind===`missing`?[e.activeTarget.target]:[]}function oI(e){return e.newTabIds.length>0||e.openTabs.some(t=>!e.pinnedTabIds.includes(t))}function sI(e){return e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))}function cI(e){return VF(pi(e))}function lI(e){return e.id}function uI(e){return e.length>0}function dI(e){console.warn(`[editor-tabs] failed to persist tab session:`,e)}function fI(e){console.error(`[editor-tabs] failed to restore tab session:`,e)}function pI(e){return e.id}function mI(e){return[e.id,e.previewTabId]}function hI(e){return[e.id,[...e.openTabs,...e.newTabIds]]}function gI(){let e=(0,Q.use)(OF);if(!e)throw Error(`useDocumentContext must be used within <DocumentProvider />`);return e}function _I(){let e=(0,$.c)(3),{openDocumentTransition:t,openTargetTransition:n}=gI(),r;return e[0]!==t||e[1]!==n?(r={openDocumentTransition:t,openTargetTransition:n},e[0]=t,e[1]=n,e[2]=r):r=e[2],r}export{TC as $,Hs as $n,of as $t,SD as A,Dl as An,ih as At,xC as B,ml as Bn,Yf as Bt,NM as C,Gu as Cn,Zo as Cr,iy as Ct,Gk as D,Nl as Dn,Ho as Dr,Eh as Dt,oA as E,Fl as En,Wo as Er,Xh as Et,mE as F,cl as Fn,Xp as Ft,ew as G,ac as Gn,vf as Gt,EC as H,hl as Hn,jf as Ht,DE as I,ll as In,Zf as It,sw as J,rc as Jn,$d as Jt,dw as K,ic as Kn,Bf as Kt,_w as L,fl as Ln,Xf as Lt,cD as M,vl as Mn,Qm as Mt,jE as N,gl as Nn,Am as Nt,RO as O,Il as On,wh as Ot,CE as P,_l as Pn,Cm as Pt,VC as Q,Vs as Qn,rf as Qt,lw as R,pl as Rn,Jf as Rt,KN as S,uu as Sn,Qo as Sr,Ey as St,Pj as T,Zl as Tn,Ko as Tr,$g as Tt,qC as U,fc as Un,Mf as Ut,bC as V,dl as Vn,yf as Vt,CC as W,uc as Wn,kf as Wt,hC as X,Zs as Xn,sf as Xt,yC as Y,Xs as Yn,nf as Yt,uC as Z,Bs as Zn,Qd as Zt,aP as _,fd as _n,ss as _r,Ry as _t,_I as a,Ud as an,ks as ar,uw as at,rP as b,ld as bn,rs as br,zy as bt,WP as c,Hd as cn,Cs as cr,fw as ct,cF as d,Rd as dn,_s as dr,WC as dt,Zd as en,Is as er,DC as et,rF as f,Ld as fn,gs as fr,_C as ft,oP as g,dd as gn,ls as gr,qS as gt,DP as h,pd as hn,ps as hr,KS as ht,gI as i,Jd as in,As as ir,gC as it,xD as j,wl as jn,Zm as jt,VD as k,Pl as kn,dh as kt,qP as l,Wd as ln,Ss as lr,gw as lt,OP as m,kd as mn,ms as mr,LC as mt,jF as n,Yd as nn,Ps as nr,UC as nt,KP as o,Kd as on,Ts as or,mw as ot,sF as p,Id as pn,hs as pr,PC as pt,hw as q,dc as qn,bf as qt,RF as r,ef as rn,Ms as rr,cw as rt,GP as s,qd as sn,ws as sr,tw as st,nI as t,cf as tn,Fs as tr,wC as tt,UP as u,Cd as un,bs as ur,HC as ut,iP as v,cd as vn,os as vr,Wy as vt,AM as w,Zu as wn,qo as wr,j_ as wt,GN as x,sd as xn,es as xr,Iy as xt,sP as y,od as yn,as as yr,By as yt,GC as z,ul as zn,qf as zt};