@inkeep/open-knowledge 0.87.0-beta.2 → 0.87.0-beta.4

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 (281) hide show
  1. package/dist/cli.mjs +6 -6
  2. package/dist/constants-DbuQSZES.mjs +1 -0
  3. package/dist/{dist-0gI1oLbO.mjs → dist-Nf304EbD.mjs} +1 -1
  4. package/dist/{dist-_mI3Jjf-.mjs → dist-WUkQ-0NU.mjs} +1 -1
  5. package/dist/index.mjs +1 -1
  6. package/dist/init-BSfWKxH3.mjs +1 -0
  7. package/dist/{init-DIAKdBV0.mjs → init-DVV2IPlH.mjs} +2 -2
  8. package/dist/{launch-json-removal-DJC4Yapa.mjs → launch-json-removal-Cgp1LTaQ.mjs} +1 -1
  9. package/dist/loader-B24TIi2v.mjs +1 -0
  10. package/dist/{loader-CnGe_Flu.mjs → loader-DigAueDc.mjs} +1 -1
  11. package/dist/{open-browser-3bURxjbo.mjs → open-browser-DpCYxQUn.mjs} +1 -1
  12. package/dist/{preview-c3qAKdkh.mjs → preview-B6BTCdRM.mjs} +1 -1
  13. package/dist/preview-DuSjB2Jf.mjs +1 -0
  14. package/dist/public/assets/{AccountSection-Bo4dPyFQ.js → AccountSection-Db0Y5FdS.js} +1 -1
  15. package/dist/public/assets/{ActivityModeContent-CfexCY5K.js → ActivityModeContent-mBOOx8UW.js} +1 -1
  16. package/dist/public/assets/{ActivityPanelDiffView-BTB4On_E.js → ActivityPanelDiffView-CCS0Nkum.js} +1 -1
  17. package/dist/public/assets/{AddPropertiesButton-DhN1KHUi.js → AddPropertiesButton-BfMkFaFN.js} +2 -2
  18. package/dist/public/assets/{AgentConnectionsSection-BBrTu_Hd.js → AgentConnectionsSection-CFTMQXUz.js} +1 -1
  19. package/dist/public/assets/{AgentDiffPane-B4ONrFEX.js → AgentDiffPane-ePRfks7Y.js} +2 -2
  20. package/dist/public/assets/{AgentThreadClientBinder-BKZL1FEK.js → AgentThreadClientBinder-BoMnnONc.js} +1 -1
  21. package/dist/public/assets/{AppMenubar-vPHVy2jk.js → AppMenubar-Lz_2ECvw.js} +1 -1
  22. package/dist/public/assets/{AttachmentsSection-CCkTnF8H.js → AttachmentsSection-uNdpfwu0.js} +1 -1
  23. package/dist/public/assets/{BugReportHistory-DCPpzbO5.js → BugReportHistory-Cn1uopFw.js} +1 -1
  24. package/dist/public/assets/{BugReportHistoryDialog-D-QZYqdF.js → BugReportHistoryDialog-DOJthShd.js} +1 -1
  25. package/dist/public/assets/{CodeMirrorEditor-UCMRAMCV-gMzc3glM.js → CodeMirrorEditor-UCMRAMCV-NL0u-orr.js} +1 -1
  26. package/dist/public/assets/{CodeMirrorPropInput-C14KgbUB.js → CodeMirrorPropInput-BOdSzKYW.js} +3 -3
  27. package/dist/public/assets/{ConsentDialogBody-k0k7metW.js → ConsentDialogBody-XNb2G3na.js} +1 -1
  28. package/dist/public/assets/{ContentRulesSection-B9osiZ5e.js → ContentRulesSection-CHzdTm6j.js} +1 -1
  29. package/dist/public/assets/{DiffViewBoundary-DFNHnF7f.js → DiffViewBoundary-DS5sFg8l.js} +1 -1
  30. package/dist/public/assets/DocumentContext-BaFslp3W.js +108 -0
  31. package/dist/public/assets/{EditorModeToggle-lBQIZux4.js → EditorModeToggle-GDU_POcr.js} +1 -1
  32. package/dist/public/assets/{ExcalidrawDocEditor-DiwiWo-5.js → ExcalidrawDocEditor-DMwb_yqY.js} +1 -1
  33. package/dist/public/assets/FeedbackForm-h3WitRlc.js +1 -0
  34. package/dist/public/assets/{GraphPanel-4ARXQVWm.js → GraphPanel-BqNuC1PH.js} +1 -1
  35. package/dist/public/assets/{ImageAttachments-BDh-av0V.js → ImageAttachments-oSzqgO9z.js} +1 -1
  36. package/dist/public/assets/ImportSkillDialog-BSqbU7Ae.js +1 -0
  37. package/dist/public/assets/{LinkPreviewsSection-BCYSzx82.js → LinkPreviewsSection-Dq5WtXx_.js} +1 -1
  38. package/dist/public/assets/{LintConfigEditor-d7iNbkFu.js → LintConfigEditor-Q35D1bSH.js} +1 -1
  39. package/dist/public/assets/{LintingSection-BfQJhSqK.js → LintingSection-DQ0PGPlO.js} +1 -1
  40. package/dist/public/assets/{ManagedArtifactProperties-CgYx_raS.js → ManagedArtifactProperties-MA9oBq-2.js} +1 -1
  41. package/dist/public/assets/ManagedArtifactProperties-X-CbCRJf.js +1 -0
  42. package/dist/public/assets/{McpConsentDialogBody-9u-ImAfw.js → McpConsentDialogBody-xbsziJ8M.js} +1 -1
  43. package/dist/public/assets/{Mermaid-DqNhHNi1.js → Mermaid-CSQrzsa-.js} +2 -2
  44. package/dist/public/assets/{MermaidDocEditor-hIN30U4A.js → MermaidDocEditor-DLxjxh6u.js} +1 -1
  45. package/dist/public/assets/{MultiFileDiff-BFbTHRMN.js → MultiFileDiff-BPqKFglt.js} +1 -1
  46. package/dist/public/assets/{NetworkAccessSection-Bc1mBEpU.js → NetworkAccessSection-DX9o-uvH.js} +1 -1
  47. package/dist/public/assets/{OkCliPathRow-CIrEL7IY.js → OkCliPathRow-qha7ViCN.js} +1 -1
  48. package/dist/public/assets/{OkignoreSection-DplnnxQb.js → OkignoreSection-CQywQkmc.js} +1 -1
  49. package/dist/public/assets/{PageListContext-CbzXXblg.js → PageListContext-Bsok6Dkc.js} +1 -1
  50. package/dist/public/assets/{ProjectTemplatesSection-DYj1MFJG.js → ProjectTemplatesSection-BtUwaSYs.js} +1 -1
  51. package/dist/public/assets/{PropertyDisplayRow-DYZRoIHn.js → PropertyDisplayRow-DJsnpgG8.js} +1 -1
  52. package/dist/public/assets/{PublishToGitHubDialog-CWgik3XO.js → PublishToGitHubDialog-5MHJQrpq.js} +1 -1
  53. package/dist/public/assets/{ReportBugDialogBody-Bbd3DGIB.js → ReportBugDialogBody-Dx_LVm22.js} +1 -1
  54. package/dist/public/assets/{ReportBugMenuTrigger-DFg5tOG8.js → ReportBugMenuTrigger-xHppTUcT.js} +1 -1
  55. package/dist/public/assets/{SchemaConfigEditor-kryiWiDK.js → SchemaConfigEditor-BzQH91rB.js} +1 -1
  56. package/dist/public/assets/{SearchSection-Cj7FdFQQ.js → SearchSection-D-Pr_9-R.js} +1 -1
  57. package/dist/public/assets/{SessionsHost-B9gM79-g.js → SessionsHost-Bc4cskDH.js} +2 -2
  58. package/dist/public/assets/{SettingsDialogBody-CdmGZmCh.js → SettingsDialogBody-BIa5_zwI.js} +2 -2
  59. package/dist/public/assets/{ShareReceiveMissDialog-BydqiR7F.js → ShareReceiveMissDialog-CFVAh9nW.js} +1 -1
  60. package/dist/public/assets/{SharingSection-C-9tTPow.js → SharingSection-HnLTw3fT.js} +1 -1
  61. package/dist/public/assets/{SkillEditBanner-FV1XZks2.js → SkillEditBanner-BYQhRIjd.js} +1 -1
  62. package/dist/public/assets/{SkillForkDialog-BHqkO5bK.js → SkillForkDialog-Cp2VfBKT.js} +1 -1
  63. package/dist/public/assets/{SkillInstallMenu-DtXyIqB8.js → SkillInstallMenu-CsSIF4d7.js} +1 -1
  64. package/dist/public/assets/{SkillOriginInline-Z5JCe0T2.js → SkillOriginInline-DXmcEqEw.js} +2 -2
  65. package/dist/public/assets/{SkillPluginBundleDialog-XB1fO90e.js → SkillPluginBundleDialog-D8f_Pygy.js} +1 -1
  66. package/dist/public/assets/{SkillToolbarControls-KYUxZQNe.js → SkillToolbarControls-CTk9ooVZ.js} +1 -1
  67. package/dist/public/assets/{SkillUpdateConflictDialog-D_oqmK3K.js → SkillUpdateConflictDialog-BbujrDOD.js} +1 -1
  68. package/dist/public/assets/{SkillsManagerSection-DCJlhnvy.js → SkillsManagerSection-BQ6eCTsP.js} +1 -1
  69. package/dist/public/assets/{SlidesPluginSection-BhUKklqb.js → SlidesPluginSection-dXy1hGNp.js} +1 -1
  70. package/dist/public/assets/{SourceEditor-BIPGmkaK.js → SourceEditor-BUnCs6rW.js} +1 -1
  71. package/dist/public/assets/{SpellingSettings-DhyHqpT4.js → SpellingSettings-Bqz9pslj.js} +1 -1
  72. package/dist/public/assets/{SyncSection-CPLGR0K4.js → SyncSection-KBplRgYc.js} +1 -1
  73. package/dist/public/assets/{SyncStatusBadge-Co74i3q_.js → SyncStatusBadge-jRLOv6OZ.js} +1 -1
  74. package/dist/public/assets/{TerminalPanel-Bj0ZrCsM.js → TerminalPanel-DYxs61YB.js} +1 -1
  75. package/dist/public/assets/{TerminalSection-DEVYY41F.js → TerminalSection-C3kz8ltC.js} +1 -1
  76. package/dist/public/assets/{TerminalWindowApp-XRrhf3K3.js → TerminalWindowApp-v86NLljc.js} +1 -1
  77. package/dist/public/assets/{TextDocEditor-Eqrxtsiw.js → TextDocEditor-1q9gEeRK.js} +1 -1
  78. package/dist/public/assets/{ThemePluginSection-DvtPYcRy.js → ThemePluginSection-DyuaEmFe.js} +1 -1
  79. package/dist/public/assets/{ThreadView-CDE0BRUz.js → ThreadView-DFt4WifR.js} +10 -10
  80. package/dist/public/assets/{TimelineDiffPane-CLScmppv.js → TimelineDiffPane-DNZGTsLz.js} +2 -2
  81. package/dist/public/assets/{abnfDiagram-N423BO3Z-DxZ-Koze.js → abnfDiagram-N423BO3Z-DtxRG9UX.js} +1 -1
  82. package/dist/public/assets/{architectureDiagram-T3A2C74G-kC-V7IMi.js → architectureDiagram-T3A2C74G-wLxYdHFB.js} +1 -1
  83. package/dist/public/assets/{blockDiagram-VBNYF7ZC-BKEhT33t.js → blockDiagram-VBNYF7ZC-Pjeu3MNP.js} +1 -1
  84. package/dist/public/assets/{bug-report-send-manager-DWzqdFH7.js → bug-report-send-manager-BAnvVPby.js} +1 -1
  85. package/dist/public/assets/{c4Diagram-5PPSVZJV-Do2HOyes.js → c4Diagram-5PPSVZJV-DE3wsCgr.js} +1 -1
  86. package/dist/public/assets/channel-C3dKvFV5.js +1 -0
  87. package/dist/public/assets/{chunk-2GRJ4B5K-S_oJ0t4y.js → chunk-2GRJ4B5K-ClzGKqzp.js} +1 -1
  88. package/dist/public/assets/{chunk-3NCLNEKW-D5wa2WAP.js → chunk-3NCLNEKW-jfRpWNZt.js} +1 -1
  89. package/dist/public/assets/{chunk-4I5QYGJK-Dp669PmE.js → chunk-4I5QYGJK-BvE0r05N.js} +1 -1
  90. package/dist/public/assets/{chunk-5RXB4S5H-DRiK0ixI.js → chunk-5RXB4S5H-gTApSFEx.js} +1 -1
  91. package/dist/public/assets/{chunk-6Q2QTUOP-CDDzU8ni.js → chunk-6Q2QTUOP-qvPNNDVk.js} +1 -1
  92. package/dist/public/assets/{chunk-7Z6QIM7H-riu23jJK.js → chunk-7Z6QIM7H-rwCNkfVu.js} +1 -1
  93. package/dist/public/assets/{chunk-BO2N2NFS-D_QMFEED.js → chunk-BO2N2NFS-De4FWds-.js} +4 -4
  94. package/dist/public/assets/{chunk-GF5L2VYU-CcvARaXd.js → chunk-GF5L2VYU-BBflv717.js} +1 -1
  95. package/dist/public/assets/{chunk-I66GZJ75-Mkx0wAj8.js → chunk-I66GZJ75-CJhve8_m.js} +1 -1
  96. package/dist/public/assets/{chunk-J7OUQ5F2-B_dGIV0c.js → chunk-J7OUQ5F2-DS7HkZLi.js} +2 -2
  97. package/dist/public/assets/{chunk-JQJVKLGR-DzOLtgmE.js → chunk-JQJVKLGR-CHVgYkog.js} +1 -1
  98. package/dist/public/assets/{chunk-KBJHAD2P-ByDw6A4K.js → chunk-KBJHAD2P-DK3QrMpY.js} +1 -1
  99. package/dist/public/assets/{chunk-NSK5VX7P-BytRcAia.js → chunk-NSK5VX7P-CcEZtfre.js} +1 -1
  100. package/dist/public/assets/{chunk-QR6OTTB3-D8za8qsa.js → chunk-QR6OTTB3-qF4HoiE9.js} +1 -1
  101. package/dist/public/assets/{chunk-UBXNYLIW-BikKpxC2.js → chunk-UBXNYLIW-CGvZjPjz.js} +1 -1
  102. package/dist/public/assets/{chunk-W5SLKNZC-D_CrJ8tI.js → chunk-W5SLKNZC-Dw_hS9zr.js} +1 -1
  103. package/dist/public/assets/{chunk-WRU74C26-D5Y_Dzwm.js → chunk-WRU74C26-Ct6yd0-T.js} +1 -1
  104. package/dist/public/assets/classDiagram-JCYQIIEL-BuTWccfh.js +1 -0
  105. package/dist/public/assets/classDiagram-v2-OCEON4UE-xIsJuttE.js +1 -0
  106. package/dist/public/assets/{client-version-V5JX2_9H.js → client-version-BIIcXp-F.js} +1 -1
  107. package/dist/public/assets/{cm-theme-Dml6DrPs.js → cm-theme-DY245iRg.js} +1 -1
  108. package/dist/public/assets/{code-highlighter-impl-y1C6ECDp.js → code-highlighter-impl-CrzNiVvD.js} +1 -1
  109. package/dist/public/assets/{comment-chips-B6PiUF0P.js → comment-chips-DMkDjrn6.js} +1 -1
  110. package/dist/public/assets/{config-provider-CY8rv6VT.js → config-provider-B7giKNZc.js} +1 -1
  111. package/dist/public/assets/{cynefinDiagram-MW4NZA55-C5F835a_.js → cynefinDiagram-MW4NZA55-BlRVUElT.js} +1 -1
  112. package/dist/public/assets/{dagre-VZM6K2ZE-Bhk3ecW_.js → dagre-VZM6K2ZE-DFuv-cK6.js} +1 -1
  113. package/dist/public/assets/{diagram-7IWD3JNH-DvWl2aZ9.js → diagram-7IWD3JNH-BM0WTGbx.js} +1 -1
  114. package/dist/public/assets/{diagram-B4RE2ZJO-DvkMsKBc.js → diagram-B4RE2ZJO-CKPW7n8V.js} +1 -1
  115. package/dist/public/assets/{diagram-LBJQPF4R-BU8SmhWa.js → diagram-LBJQPF4R-BGJO2kEk.js} +1 -1
  116. package/dist/public/assets/{diagram-Q27KOJAE-BLJoDpTp.js → diagram-Q27KOJAE-s8QuJeNx.js} +1 -1
  117. package/dist/public/assets/{diagram-UB23O5K3-BEJov894.js → diagram-UB23O5K3-B0i1xg24.js} +1 -1
  118. package/dist/public/assets/{dist-Bw3EnfRK.js → dist-8cadZTcN.js} +1 -1
  119. package/dist/public/assets/{dist-CRnJUJYV.js → dist-B1oPuPz8.js} +1 -1
  120. package/dist/public/assets/{dist-DL4JUOn7.js → dist-B3DJFAAc.js} +1 -1
  121. package/dist/public/assets/{dist-DxN51Ana2.js → dist-BIq0_yiu2.js} +1 -1
  122. package/dist/public/assets/{dist-BxVTbkVl.js → dist-C3P7yzPg.js} +1 -1
  123. package/dist/public/assets/{dist-urhiDaCp.js → dist-CwnKas8E.js} +1 -1
  124. package/dist/public/assets/{dist-nSDmHl8c.js → dist-D0egXYuQ.js} +1 -1
  125. package/dist/public/assets/{dist-CtBRIMC4.js → dist-DNUUqdDe.js} +1 -1
  126. package/dist/public/assets/{dist-Jw9rDwKW.js → dist-DchonWFB.js} +1 -1
  127. package/dist/public/assets/{dist-LjMlqXYz.js → dist-DhRS7v2X.js} +1 -1
  128. package/dist/public/assets/{dist-CBBf5U_8.js → dist-Dn7hbatR.js} +1 -1
  129. package/dist/public/assets/{dist-D2c3re7d.js → dist-MW_4cYgC.js} +1 -1
  130. package/dist/public/assets/dist-ei2QQdZM.js +1 -0
  131. package/dist/public/assets/{dist-DTvyxWzB.js → dist-pOXH7Izb.js} +1 -1
  132. package/dist/public/assets/{dist-BjL32yBS.js → dist-rrfJUNqT.js} +1 -1
  133. package/dist/public/assets/{doc-undo-manager-BgNKZ6KQ.js → doc-undo-manager-PHzC2AmJ.js} +1 -1
  134. package/dist/public/assets/{ebnfDiagram-BXEA7PRR-CCNI1OBw.js → ebnfDiagram-BXEA7PRR-BMJ-QLYi.js} +1 -1
  135. package/dist/public/assets/{engine-compile-DCFDOxYT.js → engine-compile-D75sBEQx.js} +1 -1
  136. package/dist/public/assets/{erDiagram-JOGREHBK-s9FPNXy0.js → erDiagram-JOGREHBK-B7RLRxay.js} +1 -1
  137. package/dist/public/assets/field-controls-BpWrodXJ.js +1 -0
  138. package/dist/public/assets/{field-controls-DtQ6Aw_j.js → field-controls-D31F23S8.js} +1 -1
  139. package/dist/public/assets/{file-tree-adapter-DC-yGI9s.js → file-tree-adapter-B_KOESNY.js} +1 -1
  140. package/dist/public/assets/flowDiagram-UKHOOZJN-DATdWVJi.js +1 -0
  141. package/dist/public/assets/{ganttDiagram-PKOTCBZU-tQng7xZg.js → ganttDiagram-PKOTCBZU-CmzX9pwR.js} +1 -1
  142. package/dist/public/assets/{gitGraphDiagram-DS77QQ5N-0oGaI7oi.js → gitGraphDiagram-DS77QQ5N-Dkk025kT.js} +1 -1
  143. package/dist/public/assets/globals-Bwyn_Aih.css +1 -0
  144. package/dist/public/assets/{highlighted-body-OFNGDK62-BwM9yU73.js → highlighted-body-OFNGDK62-CNZlBSJb.js} +1 -1
  145. package/dist/public/assets/{image-attachment-CkuQ83TY.js → image-attachment-BPChXLGL.js} +1 -1
  146. package/dist/public/assets/{ime-composition-DSJh5ynW.js → ime-composition-B56Lnl92.js} +1 -1
  147. package/dist/public/assets/{index-zyBtEQ0N.js → index-D9p_dx5H.js} +16 -16
  148. package/dist/public/assets/{infoDiagram-6WML65LV-DQIEucLv.js → infoDiagram-6WML65LV-Ba5SAnnJ.js} +1 -1
  149. package/dist/public/assets/{ishikawaDiagram-WSZJBQD7-Qb2IAMef.js → ishikawaDiagram-WSZJBQD7-DPN71z8-.js} +1 -1
  150. package/dist/public/assets/{journeyDiagram-NVQOT4AX-8_jX-C8a.js → journeyDiagram-NVQOT4AX-DqPWIdSs.js} +1 -1
  151. package/dist/public/assets/{kanban-definition-27J2QSJJ-CEEYwllg.js → kanban-definition-27J2QSJJ-Yb-w6MLu.js} +1 -1
  152. package/dist/public/assets/{lib-CHTgVmKZ.js → lib-B4aE3tlX.js} +1 -1
  153. package/dist/public/assets/{lib-BiDTxxNs.js → lib-BZo-U1ex.js} +1 -1
  154. package/dist/public/assets/{lib-DggJrklf.js → lib-CUUpVIaO.js} +1 -1
  155. package/dist/public/assets/{line-BsarArEL.js → line-DSgqlaou.js} +1 -1
  156. package/dist/public/assets/{lint-config-client-DZxh6x0d.js → lint-config-client-CLttd-hM.js} +1 -1
  157. package/dist/public/assets/{lint-plugins-D1JSXJl8.js → lint-plugins-CFqN0r2X.js} +1 -1
  158. package/dist/public/assets/{markdown-lint-CYB8LZHY.js → markdown-lint-wCP_bSbs.js} +3 -3
  159. package/dist/public/assets/{markdownlint-rule-browser-BHLBJ88w.js → markdownlint-rule-browser-nIryvJXe.js} +1 -1
  160. package/dist/public/assets/mermaid-GHXKKRXX-BmxFNCbl.js +1 -0
  161. package/dist/public/assets/{mermaid.core-CyLGJzps.js → mermaid.core-kyxAVtOe.js} +3 -3
  162. package/dist/public/assets/mermaid.core-vijUbFeL.js +1 -0
  163. package/dist/public/assets/{mindmap-definition-FAOFIHXS-CtH6yYX-.js → mindmap-definition-FAOFIHXS-WaeBxEI3.js} +1 -1
  164. package/dist/public/assets/{navigation-targets-DSSJ_2xi.js → navigation-targets-wIVrXum1.js} +1 -1
  165. package/dist/public/assets/{page-list-cache-p7dO1d0k.js → page-list-cache-DjTjuoEq.js} +1 -1
  166. package/dist/public/assets/{pegDiagram-VL7TDLO6-DlYnsUKl.js → pegDiagram-VL7TDLO6-CtHls9u3.js} +1 -1
  167. package/dist/public/assets/{pending-receive-nav-store-DDsjXMmg.js → pending-receive-nav-store-CEqPw9Ws.js} +1 -1
  168. package/dist/public/assets/{pieDiagram-7S7Q4E2Y-BDatfRsc.js → pieDiagram-7S7Q4E2Y-DExDDy1k.js} +1 -1
  169. package/dist/public/assets/{pierre-theme-DzTcpkj5.js → pierre-theme-BcjBYmHp.js} +1 -1
  170. package/dist/public/assets/{preferred-session-events-YlTzEpA1.js → preferred-session-events-CIXvQFyG.js} +1 -1
  171. package/dist/public/assets/{prod-CN58f7_5.js → prod-TDqup_vF.js} +5 -5
  172. package/dist/public/assets/{progress-fe7kZ4GR.js → progress-gj6w_kTR.js} +1 -1
  173. package/dist/public/assets/{project-paths-BFzGZn4G.js → project-paths-DtCPeXsO.js} +1 -1
  174. package/dist/public/assets/{quadrantDiagram-CIZ2JOQS-DqK8f_ul.js → quadrantDiagram-CIZ2JOQS-jtaC898v.js} +1 -1
  175. package/dist/public/assets/{railroadDiagram-AXF67PYL-BRhbMHP6.js → railroadDiagram-AXF67PYL-Cu9VIEoH.js} +1 -1
  176. package/dist/public/assets/{requirementDiagram-LRYGKXZP-vdezDb9X.js → requirementDiagram-LRYGKXZP-Ai-HpF_c.js} +1 -1
  177. package/dist/public/assets/{restart-collab-server-D_8KLQoA.js → restart-collab-server-CHlRP7RK.js} +1 -1
  178. package/dist/public/assets/{sankeyDiagram-W5VNT64P-C57JgB9L.js → sankeyDiagram-W5VNT64P-CMNt1Rab.js} +1 -1
  179. package/dist/public/assets/{schema-section-DUv4SBzP.js → schema-section-Ceiv9_HZ.js} +1 -1
  180. package/dist/public/assets/{selection-context-CJj4QU9m.js → selection-context-DRmEMsEZ.js} +1 -1
  181. package/dist/public/assets/{sequenceDiagram-SI44F4Z6-BuLkAztr.js → sequenceDiagram-SI44F4Z6-CBkryIPb.js} +1 -1
  182. package/dist/public/assets/{sign-in-terminal-events-BjvOWBuh.js → sign-in-terminal-events-D1Wi4Xw6.js} +1 -1
  183. package/dist/public/assets/{single-file-mode-_W9sHrBm.js → single-file-mode-BxiPl4Ah.js} +1 -1
  184. package/dist/public/assets/{skeleton-CrbF9ppq.js → skeleton-izVZCkjV.js} +1 -1
  185. package/dist/public/assets/{src-DHA7yznt.js → src-CVi-8D7H.js} +1 -1
  186. package/dist/public/assets/{stateDiagram-OKZ733FA-DXk5EfyR.js → stateDiagram-OKZ733FA-DEf6Fks3.js} +1 -1
  187. package/dist/public/assets/stateDiagram-v2-UEYNNEHI-ZjpHqFIy.js +1 -0
  188. package/dist/public/assets/{swimlanes-SLNWSIFB-CMmm9y1W.js → swimlanes-SLNWSIFB-BgtzsnGU.js} +1 -1
  189. package/dist/public/assets/swimlanesDiagram-ULZ7WXOC-BvPT90kO.js +8 -0
  190. package/dist/public/assets/{syntax-YjkwC8Y2.js → syntax-DSW4pYwe.js} +1 -1
  191. package/dist/public/assets/{tag-pill-input-qgfgpKpV.js → tag-pill-input-D_fe_Zbo.js} +1 -1
  192. package/dist/public/assets/{target-navigation-intent-D1w61eVY.js → target-navigation-intent-Bh2lFZbu.js} +1 -1
  193. package/dist/public/assets/{telemetry-impl-BoQfVHFh.js → telemetry-impl-62LVdmmL.js} +1 -1
  194. package/dist/public/assets/{telemetry-startup-BePJfd1G.js → telemetry-startup-CbVoQQGP.js} +1 -1
  195. package/dist/public/assets/{text-viewer-languages-BpNCtJFb.js → text-viewer-languages-CKtwqOI2.js} +2 -2
  196. package/dist/public/assets/{thread-client-CySNJ-9g.js → thread-client-BCtL-FWj.js} +1 -1
  197. package/dist/public/assets/{timeline-definition-Z64GVDOM-Bu9qjWc1.js → timeline-definition-Z64GVDOM-fW0Ws4bU.js} +1 -1
  198. package/dist/public/assets/{trim-lines-6NHDbF9s.js → trim-lines-BXDvYbHZ.js} +1 -1
  199. package/dist/public/assets/{typing-burst-detector-DEB_IQXO.js → typing-burst-detector-WWwAiWAb.js} +3 -3
  200. package/dist/public/assets/{uninstall-DnITG12q.js → uninstall-DyYmGM9i.js} +1 -1
  201. package/dist/public/assets/{use-activity-panel-DmN2jwm1.js → use-activity-panel-B5VoL2zJ.js} +1 -1
  202. package/dist/public/assets/{use-collab-url-BWFGjvvU.js → use-collab-url-BDpItMkY.js} +1 -1
  203. package/dist/public/assets/{use-installed-clis-IB8iDaEn.js → use-installed-clis-D3LjLTuG.js} +2 -2
  204. package/dist/public/assets/{use-open-skill-D8ppWfzv.js → use-open-skill-BztMkDbq.js} +1 -1
  205. package/dist/public/assets/{use-skill-origin-B9YRoKsz.js → use-skill-origin-CiJpOXFq.js} +1 -1
  206. package/dist/public/assets/{use-skill-targets-DZmqRDS7.js → use-skill-targets-EVebu2kh.js} +1 -1
  207. package/dist/public/assets/{use-skills-CkvdjORj.js → use-skills-BWAh3dDS.js} +1 -1
  208. package/dist/public/assets/{use-terminal-enabled-CnYgBQu6.js → use-terminal-enabled-CfpnEp8D.js} +1 -1
  209. package/dist/public/assets/{use-timeline-entry-diff-Bj9IKZ0j.js → use-timeline-entry-diff-CLuh0nLL.js} +1 -1
  210. package/dist/public/assets/{vennDiagram-T6HMQDX7-DZCyigDG.js → vennDiagram-T6HMQDX7-Q3FtvMIj.js} +1 -1
  211. package/dist/public/assets/{wardleyDiagram-T6FBY63Y-BabyWrgB.js → wardleyDiagram-T6FBY63Y-C5C7LOLR.js} +1 -1
  212. package/dist/public/assets/{xychartDiagram-ELKLHX3M-8objR63x.js → xychartDiagram-ELKLHX3M-WBJDnI7r.js} +1 -1
  213. package/dist/public/index.html +98 -98
  214. package/dist/public/uninstall.html +3 -3
  215. package/dist/{registry-probes-DjoTkaRp.mjs → registry-probes-BbWNGKfd.mjs} +1 -1
  216. package/dist/{removal-file-path-C3qKjXP1.mjs → removal-file-path-Cvsoz35t.mjs} +1 -1
  217. package/dist/{repair-launch-json-BLLbBwuS.mjs → repair-launch-json-C4WV8ng6.mjs} +1 -1
  218. package/dist/{repair-mcp-configs-Du599MHw.mjs → repair-mcp-configs-BBPwpkkl.mjs} +1 -1
  219. package/dist/src-DQ9BvUF9.mjs +1 -0
  220. package/dist/{src-CV7s8o8N.mjs → src-DtfcZBsp.mjs} +1 -1
  221. package/dist/{start-WZZeXyQg.mjs → start-D-wMeTj8.mjs} +3 -3
  222. package/dist/start-DWFGBNZm.mjs +1 -0
  223. package/package.json +4 -4
  224. package/dist/constants-BHRHFiiA.mjs +0 -1
  225. package/dist/init-D8PiEGEU.mjs +0 -1
  226. package/dist/loader-CjDr4LBh.mjs +0 -1
  227. package/dist/preview-Bb3fqNig.mjs +0 -1
  228. package/dist/public/assets/DocumentContext-B534Taw0.js +0 -108
  229. package/dist/public/assets/FeedbackForm-DN-7wKfh.js +0 -1
  230. package/dist/public/assets/ImportSkillDialog-gWGVsUXL.js +0 -1
  231. package/dist/public/assets/ManagedArtifactProperties-D0kvL_kU.js +0 -1
  232. package/dist/public/assets/channel-pAazZ6IO.js +0 -1
  233. package/dist/public/assets/classDiagram-JCYQIIEL-DkFvSY54.js +0 -1
  234. package/dist/public/assets/classDiagram-v2-OCEON4UE-CDzbe5RX.js +0 -1
  235. package/dist/public/assets/dist-B5Lgn--k.js +0 -1
  236. package/dist/public/assets/field-controls-DShsojhy.js +0 -1
  237. package/dist/public/assets/flowDiagram-UKHOOZJN-B24oe-HH.js +0 -1
  238. package/dist/public/assets/globals-kLKgmkBv.css +0 -1
  239. package/dist/public/assets/mermaid-GHXKKRXX-C2B7_ENC.js +0 -1
  240. package/dist/public/assets/mermaid.core-B351QNJ8.js +0 -1
  241. package/dist/public/assets/stateDiagram-v2-UEYNNEHI-DbQ9-zRG.js +0 -1
  242. package/dist/public/assets/swimlanesDiagram-ULZ7WXOC-p2VXN9vA.js +0 -8
  243. package/dist/src-C3wvr_Qn.mjs +0 -1
  244. package/dist/start-B6ETYSpw.mjs +0 -1
  245. /package/dist/public/assets/{AuthModal-YZGpNH__.js → AuthModal-CDv9Ka9d.js} +0 -0
  246. /package/dist/public/assets/{ConfigSharingInfoTooltip-DSloJmkE.js → ConfigSharingInfoTooltip-DySl2X4f.js} +0 -0
  247. /package/dist/public/assets/{CopyButton-BTy3joJd.js → CopyButton-BQkeo9bl.js} +0 -0
  248. /package/dist/public/assets/{RowDisclosure-Bj2sD4-N.js → RowDisclosure-BIxlyswE.js} +0 -0
  249. /package/dist/public/assets/{TemplateRow-B04s7sdl.js → TemplateRow-CQTK4uJX.js} +0 -0
  250. /package/dist/public/assets/{acp-thread-protocol-DEJR583g.js → acp-thread-protocol-CWbl02Jp.js} +0 -0
  251. /package/dist/public/assets/{agent-diff-store-Bxx1cLWW.js → agent-diff-store-B_PHpjoM.js} +0 -0
  252. /package/dist/public/assets/{agent-launcher-labels-CKZLww6j.js → agent-launcher-labels-WHKiZE2H.js} +0 -0
  253. /package/dist/public/assets/{agent-presence-BB8MLPTF.js → agent-presence-DttIZzMw.js} +0 -0
  254. /package/dist/public/assets/{api-config-BeqD_2Y2.js → api-config-DY0IQM13.js} +0 -0
  255. /package/dist/public/assets/{ccount-DGTHxXcy.js → ccount-D2axTgHX.js} +0 -0
  256. /package/dist/public/assets/{channel-cli-copy-DOAEiMde.js → channel-cli-copy-BySq87hR.js} +0 -0
  257. /package/dist/public/assets/{clipboard-adapter-C8gKg_7K.js → clipboard-adapter-BzEuR0hT.js} +0 -0
  258. /package/dist/public/assets/{contact-email-store-Cr7VN6uy.js → contact-email-store-K5cpIvvi.js} +0 -0
  259. /package/dist/public/assets/{context-menu-B5MxEep2.js → context-menu-DSlq1GYo.js} +0 -0
  260. /package/dist/public/assets/{desktop-bridge-p6CFXLIz.js → desktop-bridge-BJzXwZwD.js} +0 -0
  261. /package/dist/public/assets/{dist-BosZaL03.js → dist-B8KZUrr_.js} +0 -0
  262. /package/dist/public/assets/{doc-paths-DiEZR__C.js → doc-paths-5ibOUcTo.js} +0 -0
  263. /package/dist/public/assets/{documents-fetch-BPNWNaEf.js → documents-fetch-C22H7c-g.js} +0 -0
  264. /package/dist/public/assets/{excalidraw-scene-7qRUVF00.js → excalidraw-scene-DKlZeb8o.js} +0 -0
  265. /package/dist/public/assets/{file-tree-rename-validation-DAMy4Ak1.js → file-tree-rename-validation-Cpa_Vek-.js} +0 -0
  266. /package/dist/public/assets/{globals-CcgTjZMO.js → globals-DcxxoWPt.js} +0 -0
  267. /package/dist/public/assets/{katex-Diqujmde.js → katex-DUOilEXW.js} +0 -0
  268. /package/dist/public/assets/{known-skill-dirs-WpNGuhvr.js → known-skill-dirs-DNpdjBsx.js} +0 -0
  269. /package/dist/public/assets/{lazy-with-preload-D9fROG5C.js → lazy-with-preload-Ct49YkMK.js} +0 -0
  270. /package/dist/public/assets/{lib-DjmHwbg0.js → lib-CYXogIvt.js} +0 -0
  271. /package/dist/public/assets/{lib-qLdVx2Nx.js → lib-DlCf5-vZ.js} +0 -0
  272. /package/dist/public/assets/{markdownit-BNu6K0Lc.js → markdownit-Ck6NoOTM.js} +0 -0
  273. /package/dist/public/assets/{open-managed-artifact-tab-Bgndx1BG.js → open-managed-artifact-tab-Bt4fZblC.js} +0 -0
  274. /package/dist/public/assets/{panel-4D0jDR6z.js → panel-dxdTyKXc.js} +0 -0
  275. /package/dist/public/assets/{skill-scope-DOTLd4gL.js → skill-scope-DlzReYLC.js} +0 -0
  276. /package/dist/public/assets/{skills-api-CCijBzjo.js → skills-api-DjykKWn7.js} +0 -0
  277. /package/dist/public/assets/{space-separated-tokens-BMeAno6f.js → space-separated-tokens-DnBNyEmh.js} +0 -0
  278. /package/dist/public/assets/{startup-marks-Cb3e8PuI.js → startup-marks-DLk8fGL-.js} +0 -0
  279. /package/dist/public/assets/{stex-BAMK64Qm.js → stex-C0vEAtfn.js} +0 -0
  280. /package/dist/public/assets/{terminal-cli-display-Irv_lU4O.js → terminal-cli-display-nVuidfOl.js} +0 -0
  281. /package/dist/public/assets/{use-semantic-search-status-7_z6UOU1.js → use-semantic-search-status-D9HCPCCa.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{t as e}from"./lib-BiDTxxNs.js";var t=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function n(e){return r(e)}function r(e){return Array.isArray(e)?i(e):e instanceof RegExp?e:typeof e==`object`?a(e):e}function i(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=r(e[n]);return t}function a(e){let t={};for(let n in e)t[n]=r(e[n]);return t}function o(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function s(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?s(e.substring(0,e.length-1)):e.substr(~t+1)}var c=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,l=class{static hasCaptures(e){return e===null?!1:(c.lastIndex=0,c.test(e))}static replaceCaptures(e,t,n){return e.replace(c,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function u(e,t){return e<t?-1:+(e>t)}function d(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=u(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function f(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function p(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var m=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},h=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(te(e),t)}static createFromParsedTheme(e,t){return re(e,t)}_cachedMatchRoot=new m(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>_(e.parent,t.parentScopes));return n?new ee(n.fontStyle,n.foreground,n.background):null}},g=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function _(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!v(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function v(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var ee=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function te(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8;break}}let s=null;typeof i.settings.foreground==`string`&&f(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&f(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new ne(l,u,e,o,s,c)}}return n}var ne=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},y=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(y||{});function re(e,t){e.sort((e,t)=>{let n=u(e.scope,t.scope);return n!==0||(n=d(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new ie(t),o=new ee(n,a.getId(r),a.getId(i)),s=new se(new oe(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new h(a,o,s)}var ie=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},ae=Object.freeze([]),oe=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||ae,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},se=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),oe.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(d(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new oe(e,t,n,r,i))}},b=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=le(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function ce(e){return e}function le(e){return e}function ue(e,t){let n=[],r=fe(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(de(i)){let e=[];do e.push(i),i=r.next();while(de(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function de(e){return!!e&&!!e.match(/[\w\.:]+/)}function fe(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function pe(e){typeof e.dispose==`function`&&e.dispose()}var me=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},he=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},ge=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},_e=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new me(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new ge;for(let n of e)ve(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof me){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function ve(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof me?be({baseGrammar:a,selfGrammar:i},r):ye(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new me(e))}function ye(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];xe([r],t,n)}}function be(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&xe(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&xe(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function xe(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?o({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&xe(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=De(i);switch(a.kind){case 0:be({...t,selfGrammar:t.baseGrammar},n);break;case 1:be(t,n);break;case 2:ye(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?ye(a.ruleName,i,n):be(i,n)}else a.kind===4?n.add(new he(a.scopeName,a.ruleName)):n.add(new me(a.scopeName));break}}}var Se=class{kind=0},Ce=class{kind=1},we=class{constructor(e){this.ruleName=e}kind=2},Te=class{constructor(e){this.scopeName=e}kind=3},Ee=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function De(e){if(e===`$base`)return new Se;if(e===`$self`)return new Ce;let t=e.indexOf(`#`);return t===-1?new Te(e):t===0?new we(e.substring(1)):new Ee(e.substring(0,t),e.substring(t+1))}var Oe=/\\(\d+)/,ke=/\\(\d+)/g,Ae=-1,je=-2;function Me(e){return e}function Ne(e){return e}var x=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=l.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=l.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${s(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:l.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:l.replaceCaptures(this._contentName,e,t)}},Pe=class extends x{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Fe=class extends x{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new S(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new C,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ie=class extends x{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new C,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Le=class extends x{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new S(i,this.id),this.beginCaptures=a,this._end=new S(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new C;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Re=class extends x{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new S(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new S(o,je),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new C;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new C,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},ze=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Pe(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Fe(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=o({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Ie(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Re(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Le(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=De(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l)if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Ie||e instanceof Le||e instanceof Re)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},S=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=Oe.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return ke.lastIndex=0,this.source.replace(ke,(e,t)=>p(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},C=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){return this._cached||=new Be(e,this._items.map(e=>e.source),this._items.map(e=>e.ruleId)),this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Be(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Be=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
1
+ import{t as e}from"./lib-BZo-U1ex.js";var t=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function n(e){return r(e)}function r(e){return Array.isArray(e)?i(e):e instanceof RegExp?e:typeof e==`object`?a(e):e}function i(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=r(e[n]);return t}function a(e){let t={};for(let n in e)t[n]=r(e[n]);return t}function o(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function s(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?s(e.substring(0,e.length-1)):e.substr(~t+1)}var c=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,l=class{static hasCaptures(e){return e===null?!1:(c.lastIndex=0,c.test(e))}static replaceCaptures(e,t,n){return e.replace(c,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function u(e,t){return e<t?-1:+(e>t)}function d(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=u(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function f(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function p(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var m=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},h=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(te(e),t)}static createFromParsedTheme(e,t){return re(e,t)}_cachedMatchRoot=new m(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>_(e.parent,t.parentScopes));return n?new ee(n.fontStyle,n.foreground,n.background):null}},g=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function _(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!v(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function v(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var ee=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function te(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8;break}}let s=null;typeof i.settings.foreground==`string`&&f(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&f(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new ne(l,u,e,o,s,c)}}return n}var ne=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},y=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(y||{});function re(e,t){e.sort((e,t)=>{let n=u(e.scope,t.scope);return n!==0||(n=d(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new ie(t),o=new ee(n,a.getId(r),a.getId(i)),s=new se(new oe(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new h(a,o,s)}var ie=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},ae=Object.freeze([]),oe=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||ae,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},se=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),oe.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(d(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new oe(e,t,n,r,i))}},b=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=le(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function ce(e){return e}function le(e){return e}function ue(e,t){let n=[],r=fe(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(de(i)){let e=[];do e.push(i),i=r.next();while(de(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function de(e){return!!e&&!!e.match(/[\w\.:]+/)}function fe(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function pe(e){typeof e.dispose==`function`&&e.dispose()}var me=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},he=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},ge=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},_e=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new me(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new ge;for(let n of e)ve(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof me){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function ve(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof me?be({baseGrammar:a,selfGrammar:i},r):ye(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new me(e))}function ye(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];xe([r],t,n)}}function be(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&xe(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&xe(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function xe(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?o({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&xe(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=De(i);switch(a.kind){case 0:be({...t,selfGrammar:t.baseGrammar},n);break;case 1:be(t,n);break;case 2:ye(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?ye(a.ruleName,i,n):be(i,n)}else a.kind===4?n.add(new he(a.scopeName,a.ruleName)):n.add(new me(a.scopeName));break}}}var Se=class{kind=0},Ce=class{kind=1},we=class{constructor(e){this.ruleName=e}kind=2},Te=class{constructor(e){this.scopeName=e}kind=3},Ee=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function De(e){if(e===`$base`)return new Se;if(e===`$self`)return new Ce;let t=e.indexOf(`#`);return t===-1?new Te(e):t===0?new we(e.substring(1)):new Ee(e.substring(0,t),e.substring(t+1))}var Oe=/\\(\d+)/,ke=/\\(\d+)/g,Ae=-1,je=-2;function Me(e){return e}function Ne(e){return e}var x=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=l.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=l.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${s(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:l.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:l.replaceCaptures(this._contentName,e,t)}},Pe=class extends x{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Fe=class extends x{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new S(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new C,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ie=class extends x{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new C,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Le=class extends x{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new S(i,this.id),this.beginCaptures=a,this._end=new S(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new C;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Re=class extends x{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new S(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new S(o,je),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new C;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new C,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},ze=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Pe(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Fe(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=o({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Ie(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Re(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Le(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=De(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l)if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Ie||e instanceof Le||e instanceof Re)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},S=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=Oe.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return ke.lastIndex=0,this.source.replace(ke,(e,t)=>p(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},C=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){return this._cached||=new Be(e,this._items.map(e=>e.source),this._items.map(e=>e.ruleId)),this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Be(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Be=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
2
2
  `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Ve=class{constructor(e,t){this.languageId=e,this.tokenType=t}},He=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Ve(e,8),this._embeddedLanguagesMatcher=new Ue(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Ve(0,0);_getBasicScopeAttributes=new m(e=>new Ve(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Ue=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>p(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var We=!1,Ge=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Ke(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=qe(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Ge(i,!0);f()}return new Ge(i,!1);function f(){let o=Je(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===Ae){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),w(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof Le){let r=o;w(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof Re){let r=o;w(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(w(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function qe(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof Re&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Qe(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==je){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),w(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Je(e,t,n,r,i,a){let o=Ye(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Xe(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function Ye(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Ze(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Xe(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=Ze(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Ze(e,t,n,r,i){return We?{ruleScanner:e.compile(t,n),findOptions:$e(r,i)}:{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Qe(e,t,n,r,i){return We?{ruleScanner:e.compileWhile(t,n),findOptions:$e(r,i)}:{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function $e(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function w(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Ke(e,p,n&&d.start===0,d.start,f,i,!1,0),pe(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new et(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var et=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function tt(e,t,n,r,i,a,o,s){return new at(e,t,n,r,i,a,o,s)}function nt(e,t,n,r,i){let a=ue(t,rt),o=ze.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function rt(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(it(t[r],e))return n=r+1,!0;return!1})}function it(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var at=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new He(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=ot(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=ue(e,rt);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)nt(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&nt(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(Me(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Ne(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=ot(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=ze.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===st.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=b.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?T.createRootAndLookUpScopeName(a,r,this):T.createRoot(`unknown`,r),t=new st(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
3
3
  `;let a=this.createOnigString(e),o=a.content.length,s=new lt(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Ke(this,a,i,0,t,s,!0,r);return pe(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function ot(e,t){return e=n(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var T=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=g.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new g(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new g(null,t),o=r.themeProvider.themeMatch(a);return new e(null,a,e.mergeAttributes(n,i,o))}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),b.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a);return new e(t,a,e.mergeAttributes(t.tokenAttributes,i,o))}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},st=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?T.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Ne(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=T.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Me(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,T.fromExtension(r,n.contentNameScopesList))}},ct=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):ue(e,rt).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>ue(e,rt).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},lt=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=b.set(n,0,ce(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=b.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},ut=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,tt(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},dt=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new ut(h.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(h.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new ct(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new _e(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},ft=st.NULL;function pt(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function E(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function mt(e){return Array.isArray(e)?e:[e]}async function ht(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function gt(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function _t(e){return e===`ansi`||gt(e)}function vt(e){return e===`none`}function yt(e){return vt(e)}function bt(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(/\s+/g);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function xt(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(/(\r?\n)/g),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}function St(e){let t=xt(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function Ct(e,t,n){let r=new Set;for(let t of e.matchAll(/:?lang=["']([^"']+)["']/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/(?:```|~~~)([\w-]+)/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/\\begin\{([\w-]+)\}/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return Array.from(r);let i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}var wt=`light-dark()`,Tt=[`color`,`background-color`];function Et(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Dt(e,t){let n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?Et(e,t):e})):e}function Ot(e,n,r,i,a=`css-vars`){let o={content:e.content,explanation:e.explanation,offset:e.offset},s=n.map(t=>kt(e.variants[t])),c=new Set(s.flatMap(e=>Object.keys(e))),l={},u=(e,t)=>{let i=t===`color`?``:t===`background-color`?`-bg`:`-${t}`;return r+n[e]+(t===`color`?``:i)};return s.forEach((e,r)=>{for(let o of c){let c=e[o]||`inherit`;if(r===0&&i&&Tt.includes(o))if(i===wt&&s.length>1){let e=n.findIndex(e=>e===`light`),i=n.findIndex(e=>e===`dark`);if(e===-1||i===-1)throw new t('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');l[o]=`light-dark(${s[e][o]||`inherit`}, ${s[i][o]||`inherit`})`,a===`css-vars`&&(l[u(r,o)]=c)}else l[o]=c;else a===`css-vars`&&(l[u(r,o)]=c)}}),o.htmlStyle=l,o}function kt(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&y.Italic&&(t[`font-style`]=`italic`),e.fontStyle&y.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&y.Underline&&n.push(`underline`),e.fontStyle&y.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function At(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}var jt=new WeakMap;function Mt(e,t){jt.set(e,t)}function D(e){return jt.get(e)}var Nt=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(mt(n).map(e=>[e,ft])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Pt(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Pt(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function Ft(e,n){if(!(e instanceof Nt))throw new t(`Invalid grammar state`);return e.getInternalStack(n)}function It(){let e=new WeakMap;function n(n){if(!e.has(n.meta)){let r=function(e){if(typeof e==`number`){if(e<0||e>n.source.length)throw new t(`Invalid decoration offset: ${e}. Code length: ${n.source.length}`);return{...i.indexToPos(e),offset:e}}else{let n=i.lines[e.line];if(n===void 0)throw new t(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${i.lines.length}`);let r=e.character;if(r<0&&(r=n.length+r),r<0||r>n.length)throw new t(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${n.length}`);return{...e,character:r,offset:i.posToIndex(e.line,r)}}},i=St(n.source),a=(n.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));Lt(a),e.set(n.meta,{decorations:a,converter:i,source:n.source})}return e.get(n.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return Dt(e,n(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let r=n(this),i=Array.from(e.children).filter(e=>e.type===`element`&&e.tagName===`span`);if(i.length!==r.converter.lines.length)throw new t(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function a(e,n,r,a){let o=i[e],c=``,l=-1,u=-1;if(n===0&&(l=0),r===0&&(u=0),r===1/0&&(u=o.children.length),l===-1||u===-1)for(let e=0;e<o.children.length;e++)c+=Rt(o.children[e]),l===-1&&c.length===n&&(l=e+1),u===-1&&c.length===r&&(u=e+1);if(l===-1)throw new t(`Failed to find start index for decoration ${JSON.stringify(a.start)}`);if(u===-1)throw new t(`Failed to find end index for decoration ${JSON.stringify(a.end)}`);let d=o.children.slice(l,u);if(!a.alwaysWrap&&d.length===o.children.length)s(o,a,`line`);else if(!a.alwaysWrap&&d.length===1&&d[0].type===`element`)s(d[0],a,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:d};s(e,a,`wrapper`),o.children.splice(l,d.length,e)}}function o(e,t){i[e]=s(i[e],t,`line`)}function s(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&bt(e,t.properties.class),e=i(e,n)||e,e}let c=[],l=r.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of l){let{start:t,end:n}=e;if(t.line===n.line)a(t.line,t.character,n.character,e);else if(t.line<n.line){a(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)c.unshift(()=>o(r,e));a(n.line,0,n.character,e)}}c.forEach(e=>e())}}}function Lt(e){for(let n=0;n<e.length;n++){let r=e[n];if(r.start.offset>r.end.offset)throw new t(`Invalid decoration range: ${JSON.stringify(r.start)} - ${JSON.stringify(r.end)}`);for(let i=n+1;i<e.length;i++){let n=e[i],a=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,o=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset,s=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,c=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset;if(a||o||s||c){if(a&&o||s&&c||s&&r.start.offset===r.end.offset||o&&n.start.offset===n.end.offset)continue;throw new t(`Decorations ${JSON.stringify(r.start)} and ${JSON.stringify(n.start)} intersect.`)}}}}function Rt(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Rt).join(``):``}var zt=[It()];function Bt(e){let t=Vt(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...zt]}function Vt(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var O=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Ht={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Ut(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function Wt(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}else if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function Gt(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:`resetAll`});else if(r<=9)Ht[r]&&t.push({type:`setDecoration`,value:Ht[r]});else if(r<=29){let e=Ht[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:O[r-30]}});else if(r===38){let n=Wt(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:O[r-40]}});else if(r===48){let n=Wt(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:O[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:O[r-100+8]}})}return t}function Kt(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Ut(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=Gt(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var qt={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function Jt(e=qt){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<O.length;e++)r.push(t(O[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Yt={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function Xt(e,t,n){let r=pt(e,n),i=xt(t),a=Jt(Object.fromEntries(O.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Yt[t]]}))),o=Kt();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=E(i,r),o=E(o,r),n.decorations.has(`dim`)&&(i=Zt(i));let s=y.None;return n.decorations.has(`bold`)&&(s|=y.Bold),n.decorations.has(`italic`)&&(s|=y.Italic),n.decorations.has(`underline`)&&(s|=y.Underline),n.decorations.has(`strikethrough`)&&(s|=y.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Zt(e){let t=e.match(/#([0-9a-f]{3,8})/i);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}else if(e.length===6)return`#${e}80`;else if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}else if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Qt(e,n,r={}){let{theme:i=e.getLoadedThemes()[0]}=r,a=e.resolveLangAlias(r.lang||`text`);if(gt(a)||vt(i))return xt(n).map(e=>[{content:e[0],offset:e[1]}]);let{theme:o,colorMap:s}=e.setTheme(i);if(a===`ansi`)return Xt(o,n,r);let c=e.getLanguage(r.lang||`text`);if(r.grammarState){if(r.grammarState.lang!==c.name)throw new t(`Grammar state language "${r.grammarState.lang}" does not match highlight language "${c.name}"`);if(!r.grammarState.themes.includes(o.name))throw new t(`Grammar state themes "${r.grammarState.themes}" do not contain highlight theme "${o.name}"`)}return en(n,c,o,s,r)}function $t(...e){if(e.length===2)return D(e[1]);let[n,r,i={}]=e,{lang:a=`text`,theme:o=n.getLoadedThemes()[0]}=i;if(gt(a)||vt(o))throw new t(`Plain language does not have grammar state`);if(a===`ansi`)throw new t(`ANSI language does not have grammar state`);let{theme:s,colorMap:c}=n.setTheme(o),l=n.getLanguage(a);return new Nt(tn(r,l,s,c,i).stateStack,l.name,s.name)}function en(e,t,n,r,i){let a=tn(e,t,n,r,i),o=new Nt(a.stateStack,t.name,n.name);return Mt(a.tokens,o),a.tokens}function tn(e,t,n,r,i){let a=pt(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=xt(e),l=i.grammarState?Ft(i.grammarState,n.name)??ft:i.grammarContextCode==null?ft:tn(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=E(r[b.getForeground(s)],a),l=b.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(/,/).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?nn(t.scopes):rn(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function nn(e){return e.map(e=>({scopeName:e}))}function rn(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:sn(e,i,t.slice(0,r))}}return n}function an(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function on(e,t,n){if(!an(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)an(e[r],n[i])&&--r,--i;return r===-1}function sn(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(on(e,t,n)){r.push(a);break}return r}function cn(e,t,n){let r=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),i=r.map(r=>{let i=Qt(e,t,{...n,theme:r.theme});return{tokens:i,state:D(i),theme:typeof r.theme==`string`?r.theme:r.theme.name}}),a=ln(...i.map(e=>e.tokens)),o=a[0].map((e,t)=>e.map((e,i)=>{let o={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(o.explanation=e.explanation),a.forEach((e,n)=>{let{content:a,explanation:s,offset:c,...l}=e[t][i];o.variants[r[n].color]=l}),o})),s=i[0].state?new Nt(Object.fromEntries(i.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),i[0].state.lang):void 0;return s&&Mt(o,s),o}function ln(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}function un(e,n,r){let i,a,o,s,c,l;if(`themes`in r){let{defaultColor:u=`light`,cssVariablePrefix:d=`--shiki-`,colorsRendering:f=`css-vars`}=r,p=Object.entries(r.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===u?-1:+(t.color===u));if(p.length===0)throw new t("`themes` option must not be empty");let m=cn(e,n,r);if(l=D(m),u&&wt!==u&&!p.find(e=>e.color===u))throw new t(`\`themes\` option must contain the defaultColor key \`${u}\``);let h=p.map(t=>e.getTheme(t.theme)),g=p.map(e=>e.color);o=m.map(e=>e.map(e=>Ot(e,g,d,u,f))),l&&Mt(o,l);let _=p.map(e=>pt(e.theme,r));a=dn(p,h,_,d,u,`fg`,f),i=dn(p,h,_,d,u,`bg`,f),s=`shiki-themes ${h.map(e=>e.name).join(` `)}`,c=u?void 0:[a,i].join(`;`)}else if(`theme`in r){let t=pt(r.theme,r);o=Qt(e,n,r);let c=e.getTheme(r.theme);i=E(c.bg,t),a=E(c.fg,t),s=c.name,l=D(o)}else throw new t("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:a,bg:i,themeName:s,rootStyle:c,grammarState:l}}function dn(e,n,r,i,a,o,s){return e.map((c,l)=>{let u=E(n[l][o],r[l])||`inherit`,d=`${i+c.color}${o===`bg`?`-bg`:``}:${u}`;if(l===0&&a){if(a===wt&&e.length>1){let i=e.findIndex(e=>e.color===`light`),a=e.findIndex(e=>e.color===`dark`);if(i===-1||a===-1)throw new t('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${E(n[i][o],r[i])||`inherit`}, ${E(n[a][o],r[a])||`inherit`});${d}`}return u}return s===`css-vars`?d:null}).filter(e=>!!e).join(`;`)}function fn(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>fn(e,t,n),codeToTokens:(t,n)=>un(e,t,n)}){let i=t;for(let e of Bt(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=un(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=mn(a):d===`never`&&(a=hn(a)),f&&(a=gn(a));let p={...r,get source(){return i}};for(let e of Bt(n))a=e.tokens?.call(p,a)||a;return pn(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function pn(e,t,n,r=D(e)){let i=Bt(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(t.rootStyle==null?l.style=`background-color:${t.bg};color:${t.fg}`:l.style=t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:bt,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
4
4
  `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=At(a.htmlStyle||kt(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&Mt(m,r),m}function mn(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&y.Underline||i.fontStyle&y.Strikethrough));o&&i.content.match(/^\s+$/)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function hn(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function gn(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t[t.length-1],r=At(e.htmlStyle||kt(e)),i=At(n.htmlStyle||kt(n)),a=e.fontStyle&&(e.fontStyle&y.Underline||e.fontStyle&y.Strikethrough),o=n.fontStyle&&(n.fontStyle&y.Underline||n.fontStyle&y.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var _n=e;function vn(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>fn(e,t,n),codeToTokens:(t,n)=>un(e,t,n)},i=_n(fn(e,t,n,r));for(let e of Bt(n))i=e.postprocess?.call(r,i,n)||i;return i}var yn={light:`#333333`,dark:`#bbbbbb`},bn={light:`#fffffe`,dark:`#1e1e1e`},xn=`__shiki_resolved`;function Sn(e){if(e?.[xn])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?yn.light:yn.dark,n||=t.type===`light`?bn.light:bn.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,xn,{enumerable:!1,writable:!1,value:!0}),t}async function Cn(e){return Array.from(new Set((await Promise.all(e.filter(e=>!_t(e)).map(async e=>await ht(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function wn(e){return(await Promise.all(e.map(async e=>yt(e)?null:Sn(await ht(e))))).filter(e=>!!e)}var Tn=3,En=!1;function Dn(e,t=3){if(Tn&&!(typeof Tn==`number`&&t>Tn)){if(En)throw Error(`[SHIKI DEPRECATE]: ${e}`);console.trace(`[SHIKI DEPRECATE]: ${e}`)}}var k=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function On(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new k(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var kn=class extends dt{constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=Sn(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=h.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=On(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new k(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},An=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},A=0;function jn(e){A+=1,e.warnings!==!1&&A>=10&&A%10==0&&console.warn(`[Shiki] ${A} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new k("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Sn),i=new kn(new An(e.engine,n),r,n,e.langAlias),a;function o(t){return On(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new k(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new k(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await Cn(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await wn(e))}function g(){if(t)throw new k(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--A)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function Mn(e){e.engine||Dn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([wn(e.themes||[]),Cn(e.langs||[]),e.engine]);return jn({...e,themes:t,langs:n,engine:r})}async function Nn(e){let t=await Mn(e);return{getLastGrammarState:(...e)=>$t(t,...e),codeToTokensBase:(e,n)=>Qt(t,e,n),codeToTokensWithThemes:(e,n)=>cn(t,e,n),codeToTokens:(e,n)=>un(t,e,n),codeToHast:(e,n)=>fn(t,e,n),codeToHtml:(e,n)=>vn(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Pn(e){let n=e.langs,r=e.themes,i=e.engine;async function a(e){function a(r){if(typeof r==`string`){if(r=e.langAlias?.[r]||r,_t(r))return[];let i=n[r];if(!i)throw new t(`Language \`${r}\` is not included in this bundle. You may want to load it from external source.`);return i}return r}function o(e){if(yt(e))return`none`;if(typeof e==`string`){let n=r[e];if(!n)throw new t(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return n}return e}let s=(e.themes??[]).map(e=>o(e)),c=(e.langs??[]).map(e=>a(e)),l=await Nn({engine:e.engine??i(),...e,themes:s,langs:c});return{...l,loadLanguage(...e){return l.loadLanguage(...e.map(a))},loadTheme(...e){return l.loadTheme(...e.map(o))},getBundledLanguages(){return n},getBundledThemes(){return r}}}return a}function Fn(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}else{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function In(e,t){let n=Fn(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}function j(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Ln(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var Rn=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),M=String.raw;function N(e,t){if(e==null)throw Error(t??`Value expected`);return e}var zn=M`\[\^?`,Bn=`c.? | C(?:-.?)?|${M`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${M`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${M`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${M`o\{[^\}]*\}?`}|${M`\d{1,3}`}`,Vn=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Hn=new RegExp(M`
@@ -1,4 +1,4 @@
1
- import{n as e,t}from"./chunk-Y2CYZVJY-DouB_olA.js";import{t as n}from"./src-CP90en3s.js";import{H as r,K as i,U as a,a as o,it as s,v as c,w as l,x as u,y as d}from"./chunk-I66GZJ75-Mkx0wAj8.js";import{t as f}from"./channel-pAazZ6IO.js";import{C as p}from"./src-BCu1z_qw.js";import{c as m,g as h}from"./chunk-NSK5VX7P-BytRcAia.js";import"./chunk-W5SLKNZC-D_CrJ8tI.js";import"./chunk-UBXNYLIW-BikKpxC2.js";import"./chunk-4I5QYGJK-Dp669PmE.js";import"./chunk-WRU74C26-D5Y_Dzwm.js";import"./chunk-QR6OTTB3-D8za8qsa.js";import"./chunk-7BUUIJ7U-2u7V-5wt.js";import"./chunk-7Z6QIM7H-riu23jJK.js";import{r as g,t as _}from"./chunk-J7OUQ5F2-B_dGIV0c.js";import{t as v}from"./chunk-XXDRQBXY-TtItiY2c.js";import{t as y}from"./chunk-KBJHAD2P-ByDw6A4K.js";var b=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],r=[1,10],i=[1,11],a=[1,12],o=[1,13],s=[1,23],c=[1,24],l=[1,25],u=[1,26],d=[1,27],f=[1,19],p=[1,28],m=[1,29],h=[1,20],g=[1,18],_=[1,21],v=[1,22],y=[1,36],b=[1,37],x=[1,38],S=[1,39],C=[1,40],w=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],T=[1,45],E=[1,46],D=[1,55],O=[40,48,50,51,52,71,72],k=[1,66],A=[1,64],j=[1,61],M=[1,65],N=[1,67],P=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],F=[66,67,68,69,70],I=[1,85],L=[1,84],R=[1,82],z=[1,83],B=[6,10,42,47],V=[6,10,13,41,42,47,48,49],H=[1,93],U=[1,92],W=[1,91],G=[19,58],K=[1,102],q=[1,101],J=[19,58,61,63],Y={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:`error`,4:`ER_DIAGRAM`,6:`EOF`,8:`SPACE`,10:`NEWLINE`,13:`COLON`,15:`STYLE_SEPARATOR`,17:`BLOCK_START`,19:`BLOCK_STOP`,20:`SQS`,21:`SQE`,22:`title`,23:`title_value`,24:`acc_title`,25:`acc_title_value`,26:`acc_descr`,27:`acc_descr_value`,28:`acc_descr_multiline_value`,33:`direction_tb`,34:`direction_bt`,35:`direction_rl`,36:`direction_lr`,37:`CLASSDEF`,40:`UNICODE_TEXT`,41:`STYLE_TEXT`,42:`COMMA`,43:`CLASS`,44:`STYLE`,47:`SEMI`,48:`NUM`,49:`BRKT`,50:`ENTITY_NAME`,51:`DECIMAL_NUM`,52:`ENTITY_ONE`,58:`ATTRIBUTE_WORD`,59:`?`,61:`,`,62:`ATTRIBUTE_KEY`,63:`COMMENT`,66:`ZERO_OR_ONE`,67:`ZERO_OR_MORE`,68:`ONE_OR_MORE`,69:`ONLY_ONE`,70:`MD_PARENT`,71:`NON_IDENTIFYING`,72:`IDENTIFYING`,73:`WORD`},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:break;case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(a[s-4]),r.addEntity(a[s-2]),r.addRelationship(a[s-4],a[s],a[s-2],a[s-3]);break;case 9:r.addEntity(a[s-8]),r.addEntity(a[s-4]),r.addRelationship(a[s-8],a[s],a[s-4],a[s-5]),r.setClass([a[s-8]],a[s-6]),r.setClass([a[s-4]],a[s-2]);break;case 10:r.addEntity(a[s-6]),r.addEntity(a[s-2]),r.addRelationship(a[s-6],a[s],a[s-2],a[s-3]),r.setClass([a[s-6]],a[s-4]);break;case 11:r.addEntity(a[s-6]),r.addEntity(a[s-4]),r.addRelationship(a[s-6],a[s],a[s-4],a[s-5]),r.setClass([a[s-4]],a[s-2]);break;case 12:r.addEntity(a[s-3]),r.addAttributes(a[s-3],a[s-1]);break;case 13:r.addEntity(a[s-5]),r.addAttributes(a[s-5],a[s-1]),r.setClass([a[s-5]],a[s-3]);break;case 14:r.addEntity(a[s-2]);break;case 15:r.addEntity(a[s-4]),r.setClass([a[s-4]],a[s-2]);break;case 16:r.addEntity(a[s]);break;case 17:r.addEntity(a[s-2]),r.setClass([a[s-2]],a[s]);break;case 18:r.addEntity(a[s-6],a[s-4]),r.addAttributes(a[s-6],a[s-1]);break;case 19:r.addEntity(a[s-8],a[s-6]),r.addAttributes(a[s-8],a[s-1]),r.setClass([a[s-8]],a[s-3]);break;case 20:r.addEntity(a[s-5],a[s-3]);break;case 21:r.addEntity(a[s-7],a[s-5]),r.setClass([a[s-7]],a[s-2]);break;case 22:r.addEntity(a[s-3],a[s-1]);break;case 23:r.addEntity(a[s-5],a[s-3]),r.setClass([a[s-5]],a[s]);break;case 24:case 25:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection(`TB`);break;case 33:r.setDirection(`BT`);break;case 34:r.setDirection(`RL`);break;case 35:r.setDirection(`LR`);break;case 36:this.$=a[s-3],r.addClass(a[s-2],a[s-1]);break;case 37:case 38:case 59:case 68:this.$=[a[s]];break;case 39:case 40:this.$=a[s-2].concat([a[s]]);break;case 41:this.$=a[s-2],r.setClass(a[s-1],a[s]);break;case 42:this.$=a[s-3],r.addCssStyles(a[s-2],a[s-1]);break;case 43:this.$=[a[s]];break;case 44:a[s-2].push(a[s]),this.$=a[s-2];break;case 46:this.$=a[s-1]+a[s];break;case 54:case 80:case 81:this.$=a[s].replace(/"/g,``);break;case 55:case 56:case 57:case 58:case 82:this.$=a[s];break;case 60:a[s].push(a[s-1]),this.$=a[s];break;case 61:this.$={type:a[s-1],name:a[s]};break;case 62:this.$={type:a[s-2],name:a[s-1],keys:a[s]};break;case 63:this.$={type:a[s-2],name:a[s-1],comment:a[s]};break;case 64:this.$={type:a[s-3],name:a[s-2],keys:a[s-1],comment:a[s]};break;case 65:case 67:case 70:this.$=a[s];break;case 66:this.$=a[s-1]+a[s];break;case 69:a[s-2].push(a[s]),this.$=a[s-2];break;case 71:this.$=a[s].replace(/"/g,``);break;case 72:this.$={cardA:a[s],relType:a[s-1],cardB:a[s-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},t(n,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:i,26:a,28:o,29:14,30:15,31:16,32:17,33:s,34:c,35:l,36:u,37:d,40:f,43:p,44:m,48:h,50:g,51:_,52:v},t(n,[2,7],{1:[2,1]}),t(n,[2,3]),{9:30,11:9,22:r,24:i,26:a,28:o,29:14,30:15,31:16,32:17,33:s,34:c,35:l,36:u,37:d,40:f,43:p,44:m,48:h,50:g,51:_,52:v},t(n,[2,5]),t(n,[2,6]),t(n,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:y,67:b,68:x,69:S,70:C}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(n,[2,27]),t(n,[2,28]),t(n,[2,29]),t(n,[2,30]),t(n,[2,31]),t(w,[2,54]),t(w,[2,55]),t(w,[2,56]),t(w,[2,57]),t(w,[2,58]),t(n,[2,32]),t(n,[2,33]),t(n,[2,34]),t(n,[2,35]),{16:44,40:T,41:E},{16:47,40:T,41:E},{16:48,40:T,41:E},t(n,[2,4]),{11:49,40:f,48:h,50:g,51:_,52:v},{16:50,40:T,41:E},{18:51,19:[1,52],53:53,54:54,58:D},{11:56,40:f,48:h,50:g,51:_,52:v},{65:57,71:[1,58],72:[1,59]},t(O,[2,73]),t(O,[2,74]),t(O,[2,75]),t(O,[2,76]),t(O,[2,77]),t(n,[2,24]),t(n,[2,25]),t(n,[2,26]),{13:k,38:60,41:A,42:j,45:62,46:63,48:M,49:N},t(P,[2,37]),t(P,[2,38]),{16:68,40:T,41:E,42:j},{13:k,38:69,41:A,42:j,45:62,46:63,48:M,49:N},{13:[1,70],15:[1,71]},t(n,[2,17],{64:35,12:72,17:[1,73],42:j,66:y,67:b,68:x,69:S,70:C}),{19:[1,74]},t(n,[2,14]),{18:75,19:[2,59],53:53,54:54,58:D},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:y,67:b,68:x,69:S,70:C},t(F,[2,78]),t(F,[2,79]),{6:I,10:L,39:81,42:R,47:z},{40:[1,86],41:[1,87]},t(B,[2,43],{46:88,13:k,41:A,48:M,49:N}),t(V,[2,45]),t(V,[2,50]),t(V,[2,51]),t(V,[2,52]),t(V,[2,53]),t(n,[2,41],{42:j}),{6:I,10:L,39:89,42:R,47:z},{14:90,40:H,50:U,73:W},{16:94,40:T,41:E},{11:95,40:f,48:h,50:g,51:_,52:v},{18:96,19:[1,97],53:53,54:54,58:D},t(n,[2,12]),{19:[2,60]},t(G,[2,61],{56:98,57:99,60:100,62:K,63:q}),t([19,58,62,63],[2,67]),{58:[2,66]},t(n,[2,22],{15:[1,104],17:[1,103]}),t([40,48,50,51,52],[2,72]),t(n,[2,36]),{13:k,41:A,45:105,46:63,48:M,49:N},t(n,[2,47]),t(n,[2,48]),t(n,[2,49]),t(P,[2,39]),t(P,[2,40]),t(V,[2,46]),t(n,[2,42]),t(n,[2,8]),t(n,[2,80]),t(n,[2,81]),t(n,[2,82]),{13:[1,106],42:j},{13:[1,108],15:[1,107]},{19:[1,109]},t(n,[2,15]),t(G,[2,62],{57:110,61:[1,111],63:q}),t(G,[2,63]),t(J,[2,68]),t(G,[2,71]),t(J,[2,70]),{18:112,19:[1,113],53:53,54:54,58:D},{16:114,40:T,41:E},t(B,[2,44],{46:88,13:k,41:A,48:M,49:N}),{14:115,40:H,50:U,73:W},{16:116,40:T,41:E},{14:117,40:H,50:U,73:W},t(n,[2,13]),t(G,[2,64]),{60:118,62:K},{19:[1,119]},t(n,[2,20]),t(n,[2,23],{17:[1,120],42:j}),t(n,[2,11]),{13:[1,121],42:j},t(n,[2,10]),t(J,[2,69]),t(n,[2,18]),{18:122,19:[1,123],53:53,54:54,58:D},{14:124,40:H,50:U,73:W},{19:[1,125]},t(n,[2,21]),t(n,[2,9]),t(n,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{n as e,t}from"./chunk-Y2CYZVJY-DouB_olA.js";import{t as n}from"./src-CP90en3s.js";import{H as r,K as i,U as a,a as o,it as s,v as c,w as l,x as u,y as d}from"./chunk-I66GZJ75-CJhve8_m.js";import{t as f}from"./channel-C3dKvFV5.js";import{C as p}from"./src-BCu1z_qw.js";import{c as m,g as h}from"./chunk-NSK5VX7P-CcEZtfre.js";import"./chunk-W5SLKNZC-Dw_hS9zr.js";import"./chunk-UBXNYLIW-CGvZjPjz.js";import"./chunk-4I5QYGJK-BvE0r05N.js";import"./chunk-WRU74C26-Ct6yd0-T.js";import"./chunk-QR6OTTB3-qF4HoiE9.js";import"./chunk-7BUUIJ7U-2u7V-5wt.js";import"./chunk-7Z6QIM7H-rwCNkfVu.js";import{r as g,t as _}from"./chunk-J7OUQ5F2-DS7HkZLi.js";import{t as v}from"./chunk-XXDRQBXY-TtItiY2c.js";import{t as y}from"./chunk-KBJHAD2P-DK3QrMpY.js";var b=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],r=[1,10],i=[1,11],a=[1,12],o=[1,13],s=[1,23],c=[1,24],l=[1,25],u=[1,26],d=[1,27],f=[1,19],p=[1,28],m=[1,29],h=[1,20],g=[1,18],_=[1,21],v=[1,22],y=[1,36],b=[1,37],x=[1,38],S=[1,39],C=[1,40],w=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],T=[1,45],E=[1,46],D=[1,55],O=[40,48,50,51,52,71,72],k=[1,66],A=[1,64],j=[1,61],M=[1,65],N=[1,67],P=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],F=[66,67,68,69,70],I=[1,85],L=[1,84],R=[1,82],z=[1,83],B=[6,10,42,47],V=[6,10,13,41,42,47,48,49],H=[1,93],U=[1,92],W=[1,91],G=[19,58],K=[1,102],q=[1,101],J=[19,58,61,63],Y={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:`error`,4:`ER_DIAGRAM`,6:`EOF`,8:`SPACE`,10:`NEWLINE`,13:`COLON`,15:`STYLE_SEPARATOR`,17:`BLOCK_START`,19:`BLOCK_STOP`,20:`SQS`,21:`SQE`,22:`title`,23:`title_value`,24:`acc_title`,25:`acc_title_value`,26:`acc_descr`,27:`acc_descr_value`,28:`acc_descr_multiline_value`,33:`direction_tb`,34:`direction_bt`,35:`direction_rl`,36:`direction_lr`,37:`CLASSDEF`,40:`UNICODE_TEXT`,41:`STYLE_TEXT`,42:`COMMA`,43:`CLASS`,44:`STYLE`,47:`SEMI`,48:`NUM`,49:`BRKT`,50:`ENTITY_NAME`,51:`DECIMAL_NUM`,52:`ENTITY_ONE`,58:`ATTRIBUTE_WORD`,59:`?`,61:`,`,62:`ATTRIBUTE_KEY`,63:`COMMENT`,66:`ZERO_OR_ONE`,67:`ZERO_OR_MORE`,68:`ONE_OR_MORE`,69:`ONLY_ONE`,70:`MD_PARENT`,71:`NON_IDENTIFYING`,72:`IDENTIFYING`,73:`WORD`},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:break;case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(a[s-4]),r.addEntity(a[s-2]),r.addRelationship(a[s-4],a[s],a[s-2],a[s-3]);break;case 9:r.addEntity(a[s-8]),r.addEntity(a[s-4]),r.addRelationship(a[s-8],a[s],a[s-4],a[s-5]),r.setClass([a[s-8]],a[s-6]),r.setClass([a[s-4]],a[s-2]);break;case 10:r.addEntity(a[s-6]),r.addEntity(a[s-2]),r.addRelationship(a[s-6],a[s],a[s-2],a[s-3]),r.setClass([a[s-6]],a[s-4]);break;case 11:r.addEntity(a[s-6]),r.addEntity(a[s-4]),r.addRelationship(a[s-6],a[s],a[s-4],a[s-5]),r.setClass([a[s-4]],a[s-2]);break;case 12:r.addEntity(a[s-3]),r.addAttributes(a[s-3],a[s-1]);break;case 13:r.addEntity(a[s-5]),r.addAttributes(a[s-5],a[s-1]),r.setClass([a[s-5]],a[s-3]);break;case 14:r.addEntity(a[s-2]);break;case 15:r.addEntity(a[s-4]),r.setClass([a[s-4]],a[s-2]);break;case 16:r.addEntity(a[s]);break;case 17:r.addEntity(a[s-2]),r.setClass([a[s-2]],a[s]);break;case 18:r.addEntity(a[s-6],a[s-4]),r.addAttributes(a[s-6],a[s-1]);break;case 19:r.addEntity(a[s-8],a[s-6]),r.addAttributes(a[s-8],a[s-1]),r.setClass([a[s-8]],a[s-3]);break;case 20:r.addEntity(a[s-5],a[s-3]);break;case 21:r.addEntity(a[s-7],a[s-5]),r.setClass([a[s-7]],a[s-2]);break;case 22:r.addEntity(a[s-3],a[s-1]);break;case 23:r.addEntity(a[s-5],a[s-3]),r.setClass([a[s-5]],a[s]);break;case 24:case 25:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection(`TB`);break;case 33:r.setDirection(`BT`);break;case 34:r.setDirection(`RL`);break;case 35:r.setDirection(`LR`);break;case 36:this.$=a[s-3],r.addClass(a[s-2],a[s-1]);break;case 37:case 38:case 59:case 68:this.$=[a[s]];break;case 39:case 40:this.$=a[s-2].concat([a[s]]);break;case 41:this.$=a[s-2],r.setClass(a[s-1],a[s]);break;case 42:this.$=a[s-3],r.addCssStyles(a[s-2],a[s-1]);break;case 43:this.$=[a[s]];break;case 44:a[s-2].push(a[s]),this.$=a[s-2];break;case 46:this.$=a[s-1]+a[s];break;case 54:case 80:case 81:this.$=a[s].replace(/"/g,``);break;case 55:case 56:case 57:case 58:case 82:this.$=a[s];break;case 60:a[s].push(a[s-1]),this.$=a[s];break;case 61:this.$={type:a[s-1],name:a[s]};break;case 62:this.$={type:a[s-2],name:a[s-1],keys:a[s]};break;case 63:this.$={type:a[s-2],name:a[s-1],comment:a[s]};break;case 64:this.$={type:a[s-3],name:a[s-2],keys:a[s-1],comment:a[s]};break;case 65:case 67:case 70:this.$=a[s];break;case 66:this.$=a[s-1]+a[s];break;case 69:a[s-2].push(a[s]),this.$=a[s-2];break;case 71:this.$=a[s].replace(/"/g,``);break;case 72:this.$={cardA:a[s],relType:a[s-1],cardB:a[s-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},t(n,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:r,24:i,26:a,28:o,29:14,30:15,31:16,32:17,33:s,34:c,35:l,36:u,37:d,40:f,43:p,44:m,48:h,50:g,51:_,52:v},t(n,[2,7],{1:[2,1]}),t(n,[2,3]),{9:30,11:9,22:r,24:i,26:a,28:o,29:14,30:15,31:16,32:17,33:s,34:c,35:l,36:u,37:d,40:f,43:p,44:m,48:h,50:g,51:_,52:v},t(n,[2,5]),t(n,[2,6]),t(n,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:y,67:b,68:x,69:S,70:C}),{23:[1,41]},{25:[1,42]},{27:[1,43]},t(n,[2,27]),t(n,[2,28]),t(n,[2,29]),t(n,[2,30]),t(n,[2,31]),t(w,[2,54]),t(w,[2,55]),t(w,[2,56]),t(w,[2,57]),t(w,[2,58]),t(n,[2,32]),t(n,[2,33]),t(n,[2,34]),t(n,[2,35]),{16:44,40:T,41:E},{16:47,40:T,41:E},{16:48,40:T,41:E},t(n,[2,4]),{11:49,40:f,48:h,50:g,51:_,52:v},{16:50,40:T,41:E},{18:51,19:[1,52],53:53,54:54,58:D},{11:56,40:f,48:h,50:g,51:_,52:v},{65:57,71:[1,58],72:[1,59]},t(O,[2,73]),t(O,[2,74]),t(O,[2,75]),t(O,[2,76]),t(O,[2,77]),t(n,[2,24]),t(n,[2,25]),t(n,[2,26]),{13:k,38:60,41:A,42:j,45:62,46:63,48:M,49:N},t(P,[2,37]),t(P,[2,38]),{16:68,40:T,41:E,42:j},{13:k,38:69,41:A,42:j,45:62,46:63,48:M,49:N},{13:[1,70],15:[1,71]},t(n,[2,17],{64:35,12:72,17:[1,73],42:j,66:y,67:b,68:x,69:S,70:C}),{19:[1,74]},t(n,[2,14]),{18:75,19:[2,59],53:53,54:54,58:D},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:y,67:b,68:x,69:S,70:C},t(F,[2,78]),t(F,[2,79]),{6:I,10:L,39:81,42:R,47:z},{40:[1,86],41:[1,87]},t(B,[2,43],{46:88,13:k,41:A,48:M,49:N}),t(V,[2,45]),t(V,[2,50]),t(V,[2,51]),t(V,[2,52]),t(V,[2,53]),t(n,[2,41],{42:j}),{6:I,10:L,39:89,42:R,47:z},{14:90,40:H,50:U,73:W},{16:94,40:T,41:E},{11:95,40:f,48:h,50:g,51:_,52:v},{18:96,19:[1,97],53:53,54:54,58:D},t(n,[2,12]),{19:[2,60]},t(G,[2,61],{56:98,57:99,60:100,62:K,63:q}),t([19,58,62,63],[2,67]),{58:[2,66]},t(n,[2,22],{15:[1,104],17:[1,103]}),t([40,48,50,51,52],[2,72]),t(n,[2,36]),{13:k,41:A,45:105,46:63,48:M,49:N},t(n,[2,47]),t(n,[2,48]),t(n,[2,49]),t(P,[2,39]),t(P,[2,40]),t(V,[2,46]),t(n,[2,42]),t(n,[2,8]),t(n,[2,80]),t(n,[2,81]),t(n,[2,82]),{13:[1,106],42:j},{13:[1,108],15:[1,107]},{19:[1,109]},t(n,[2,15]),t(G,[2,62],{57:110,61:[1,111],63:q}),t(G,[2,63]),t(J,[2,68]),t(G,[2,71]),t(J,[2,70]),{18:112,19:[1,113],53:53,54:54,58:D},{16:114,40:T,41:E},t(B,[2,44],{46:88,13:k,41:A,48:M,49:N}),{14:115,40:H,50:U,73:W},{16:116,40:T,41:E},{14:117,40:H,50:U,73:W},t(n,[2,13]),t(G,[2,64]),{60:118,62:K},{19:[1,119]},t(n,[2,20]),t(n,[2,23],{17:[1,120],42:j}),t(n,[2,11]),{13:[1,121],42:j},t(n,[2,10]),t(J,[2,69]),t(n,[2,18]),{18:122,19:[1,123],53:53,54:54,58:D},{14:124,40:H,50:U,73:W},{19:[1,125]},t(n,[2,21]),t(n,[2,9]),t(n,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};Y.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -0,0 +1 @@
1
+ import{n as e}from"./field-controls-D31F23S8.js";export{e as SectionSkeleton};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{n as a}from"./dist-PQ5KMVDh.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{i as c,n as l,t as u}from"./tooltip-Bz6z4_se.js";import{i as d,n as f,o as p,s as m,t as h}from"./select-pACXgFe2.js";import{t as g}from"./switch-BKZTXkzu.js";import{n as _,r as v,t as y}from"./toggle-group-B7p69Qfd.js";import{t as b}from"./button-DzgjsZzC.js";import{n as x}from"./dist-BGzUo_18.js";import{n as S,r as C}from"./config-errors-DDAH9fqy.js";import{Ct as w}from"./schemas-api-CL5ZXlEj.js";import{a as T,t as E}from"./use-apply-config-theme-CYFG76sS.js";import{t as D}from"./check-B2OLRY33.js";import{t as O}from"./circle-alert-eBm4JPxY.js";import{n as ee,r as te,t as k}from"./ThemePicker-pc5gwEur.js";import{n as A,t as j}from"./plus-zPnYzcqL.js";import{t as M}from"./rotate-ccw-Zi1IjIg9.js";import{t as ne}from"./trash-2-CchZ0T47.js";import{t as re}from"./triangle-alert-BXrUEeRU.js";import{a as ie,c as ae,i as oe,n as se,o as ce,s as le,t as ue}from"./dialog-BJEjKJjL.js";import{i as de,o as fe,r as pe,t as me}from"./field-DFJgKWGh.js";import{a as he,b as ge,c as _e,g as ve,n as ye,o as be,p as xe,s as Se,u as Ce,v as we,x as N,y as P}from"./use-apply-config-color-theme-Bpi7AD0s.js";import{T as Te,n as Ee,o as F,s as I}from"./saved-themes-client-BPWMEtsb.js";import{l as L,n as R,u as z}from"./use-apply-config-language-DlSviEmN.js";import{t as De}from"./trace-api-BSvaJNnr.js";import{a as Oe,f as ke,i as Ae,n as je,o as Me,p as B,r as V,s as H}from"./form-U6OjlA0v.js";import{t as Ne}from"./input-BsFOyzfK.js";import{t as U}from"./textarea-DYYN2PV4.js";import{t as W}from"./skeleton-CrbF9ppq.js";import"./config-schema-gPKGwQR7.js";var G=e(n(),1),K=o(),q=`open-knowledge-app`;function J({from:e,to:t}){try{De.getTracer(q).startSpan(`ok.language.preferenceChanged`,{attributes:{"ok.language.from":e,"ok.language.to":t}}).end()}catch(e){console.warn(`[language-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}var Y=`open-knowledge-app`;function X(e){let t=e.light.startsWith(`saved-`),n=e.dark.startsWith(`saved-`);return!t||!n?`incomplete`:e.light===e.dark?`same`:`different`}function Z(e){try{De.getTracer(Y).startSpan(`ok.saved_themes.assignment`,{attributes:{"saved_theme.pair":X(e)}}).end()}catch(e){console.warn(`[saved-theme-telemetry] assignment span emit failed:`,e instanceof Error?e:String(e))}}var Q=t(),$=`system`;function Pe(e){return typeof e==`string`&&z.includes(e)}function Fe(e){return Pe(e)?e:$}function Ie(e){return new Intl.DisplayNames([e],{type:`language`}).of(e)??e}function Le(e){let t=(0,K.c)(6),{choice:n}=e;if(n===$){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(r,{id:`D-NlUC`}),t[0]=e):e=t[0],e}let i;t[1]===n?i=t[2]:(i=Ie(n),t[1]=n,t[2]=i);let a;return t[3]!==n||t[4]!==i?(a=(0,Q.jsx)(`span`,{lang:n,className:`capitalize`,children:i}),t[3]=n,t[4]=i,t[5]=a):a=t[5],a}function Re(e){let t=(0,K.c)(22),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({value:o,onValueChange:r,onBlur:n,ref:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===o?s=t[7]:(s=Fe(o),t[6]=o,t[7]=s);let c=s,l;t[8]===r?l=t[9]:(l=e=>r(Fe(e)),t[8]=r,t[9]=l);let u;t[10]===c?u=t[11]:(u=(0,Q.jsx)(m,{children:(0,Q.jsx)(Le,{choice:c})}),t[10]=c,t[11]=u);let g;t[12]!==n||t[13]!==i||t[14]!==a||t[15]!==u?(g=(0,Q.jsx)(p,{...a,ref:i,onBlur:n,size:`sm`,className:`w-48`,children:u}),t[12]=n,t[13]=i,t[14]=a,t[15]=u,t[16]=g):g=t[16];let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsxs)(f,{children:[(0,Q.jsx)(d,{value:$,children:(0,Q.jsx)(Le,{choice:$})}),L.map(ze)]}),t[17]=_):_=t[17];let v;return t[18]!==c||t[19]!==l||t[20]!==g?(v=(0,Q.jsxs)(h,{value:c,onValueChange:l,children:[g,_]}),t[18]=c,t[19]=l,t[20]=g,t[21]=v):v=t[21],v}function ze(e){return(0,Q.jsx)(d,{value:e,children:(0,Q.jsx)(Le,{choice:e})},e)}function Be(e){return{chrome:e.sidebar,surface:e.background,bar:e.primary,line:e.border,dots:[e[`syntax-string`],e[`syntax-keyword`],e[`syntax-atom`]]}}function Ve(e,t,n){return e.id===`custom`?Be(w(xe(t))):e.scheme?Be(w(e.scheme)):Be(Ce(n))}function He(e){let t=(0,K.c)(38),{theme:n,customSeed:r,slotMode:i}=e,a,o,s,c,l,u,d,f,p,m;t[0]!==r||t[1]!==i||t[2]!==n?(a=Ve(n,r,i),u=!0,d=``,f=`aspect-[4/3] w-full overflow-hidden rounded-md border`,p={backgroundColor:a.surface,borderColor:a.line},m=(0,Q.jsxs)(`div`,{className:`flex h-1/3 items-center gap-1 px-1.5`,style:{backgroundColor:a.chrome,borderBottom:`1px solid ${a.line}`},children:[(0,Q.jsx)(`span`,{className:`h-1.5 w-5 rounded-full`,style:{backgroundColor:a.bar}}),(0,Q.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full opacity-50`,style:{backgroundColor:a.line}})]}),l=`flex h-2/3`,o=`flex w-1/4 flex-col items-center justify-center gap-1`,s={backgroundColor:a.chrome,borderRight:`1px solid ${a.line}`},c=a.dots.map(Ue),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m):(a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]);let h;t[13]!==o||t[14]!==s||t[15]!==c?(h=(0,Q.jsx)(`div`,{className:o,style:s,children:c}),t[13]=o,t[14]=s,t[15]=c,t[16]=h):h=t[16];let g;t[17]===a.dots[1]?g=t[18]:(g=(0,Q.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-full`,style:{backgroundColor:a.dots[1]}}),t[17]=a.dots[1],t[18]=g);let _;t[19]===a.line?_=t[20]:(_=(0,Q.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-full opacity-60`,style:{backgroundColor:a.line}}),t[19]=a.line,t[20]=_);let v;t[21]===a.dots[0]?v=t[22]:(v=(0,Q.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:a.dots[0]}}),t[21]=a.dots[0],t[22]=v);let y;t[23]!==g||t[24]!==_||t[25]!==v?(y=(0,Q.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1 px-1.5`,children:[g,_,v]}),t[23]=g,t[24]=_,t[25]=v,t[26]=y):y=t[26];let b;t[27]!==h||t[28]!==y||t[29]!==l?(b=(0,Q.jsxs)(`div`,{className:l,children:[h,y]}),t[27]=h,t[28]=y,t[29]=l,t[30]=b):b=t[30];let x;return t[31]!==b||t[32]!==u||t[33]!==d||t[34]!==f||t[35]!==p||t[36]!==m?(x=(0,Q.jsxs)(`div`,{"aria-hidden":u,"data-theme-swatch":d,className:f,style:p,children:[m,b]}),t[31]=b,t[32]=u,t[33]=d,t[34]=f,t[35]=p,t[36]=m,t[37]=x):x=t[37],x}function Ue(e,t){return(0,Q.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function We(e){return s(`size-6 min-w-6 rounded-md border p-0 transition-colors`,e?`border-primary bg-primary/15 text-primary hover:bg-primary/20 data-[state=on]:bg-primary/15`:`border-border/70 text-muted-foreground/70 hover:text-foreground`)}function Ge(e){return s(`size-3.5`,e&&`fill-current`)}function Ke(e){let t=(0,K.c)(34),{selection:n,themes:r,unavailableThemes:a,onAssign:o,editControl:c,deleteControl:l,createControl:u,createTileRef:d,slotMode:f,customSeed:p,firstItemId:m,"aria-label":h,"aria-describedby":g,"aria-invalid":_}=e,y=r===void 0?ve:r,x;t[0]===a?x=t[1]:(x=a===void 0?[]:a,t[0]=a,t[1]=x);let S=x,C=f===void 0?`light`:f,{_:w}=i(),T;if(t[2]!==w||t[3]!==p||t[4]!==l||t[5]!==c||t[6]!==m||t[7]!==o||t[8]!==n||t[9]!==C||t[10]!==y){let e;t[12]!==w||t[13]!==p||t[14]!==l||t[15]!==c||t[16]!==m||t[17]!==o||t[18]!==n||t[19]!==C?(e=(e,t)=>{let r=n.light===e.id,i=n.dark===e.id,a=c?.themeIds.includes(e.id)??!1,u=l?.themeIds.includes(e.id)??!1,d=c?.selectedId===e.id,f=w(C===`light`?{id:`hgF0al`,values:{0:e.label}}:{id:`6Nea1q`,values:{0:e.label}});return(0,Q.jsxs)(`fieldset`,{"aria-label":e.label,className:s(`relative flex min-w-0 flex-col gap-1.5 rounded-lg border-2 p-1 text-left`,n[C]===e.id?`border-primary`:`border-transparent`),children:[(0,Q.jsx)(b,{type:`button`,variant:`ghost`,"aria-label":f,"data-theme-focus-target":``,onClick:()=>o(C,e.id),className:`h-auto w-full cursor-pointer p-0 transition-opacity hover:bg-transparent hover:opacity-90`,children:(0,Q.jsx)(He,{theme:e,customSeed:p,slotMode:C})}),u?(0,Q.jsx)(b,{type:`button`,variant:`outline`,size:`icon-sm`,title:w({id:`Y2tU6I`,values:{0:e.label}}),"aria-label":w({id:`Y2tU6I`,values:{0:e.label}}),className:`absolute top-2 end-2 z-10 border-border/80 bg-background/85 text-muted-foreground shadow-sm backdrop-blur-sm hover:border-destructive/50 hover:bg-destructive/15 hover:text-destructive focus-visible:border-destructive/50 focus-visible:text-destructive focus-visible:ring-destructive/20 dark:bg-background/80 dark:hover:bg-destructive/20`,onClick:async t=>{let n=t.currentTarget.closest(`fieldset`),r=n?.previousElementSibling?.querySelector(`[data-theme-focus-target]`)??n?.nextElementSibling?.querySelector(`[data-theme-focus-target]`);await l?.onDelete(e.id)!==!1&&r?.focus()},children:(0,Q.jsx)(ne,{"aria-hidden":!0})}):null,(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-1 px-0.5`,children:[(0,Q.jsx)(`span`,{className:`truncate text-1sm font-medium text-foreground`,children:e.label}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[a?(0,Q.jsx)(v,{className:We(d),pressed:d,onPressedChange:t=>{c?.onSelect(t?e.id:null)},"aria-label":w(d?{id:`8x6zk9`,values:{0:e.label}}:{id:`N6j2JH`,values:{0:e.label}}),children:(0,Q.jsx)(A,{className:`size-3.5`})}):null,(0,Q.jsx)(v,{id:t===0?m:void 0,className:We(r),pressed:r,onPressedChange:t=>{t&&o(`light`,e.id)},"aria-label":w({id:`sq4WQH`,values:{0:e.label}}),children:(0,Q.jsx)(ee,{className:Ge(r)})}),(0,Q.jsx)(v,{className:We(i),pressed:i,onPressedChange:t=>{t&&o(`dark`,e.id)},"aria-label":w({id:`lZvQrY`,values:{0:e.label}}),children:(0,Q.jsx)(te,{className:Ge(i)})})]})]})]},e.id)},t[12]=w,t[13]=p,t[14]=l,t[15]=c,t[16]=m,t[17]=o,t[18]=n,t[19]=C,t[20]=e):e=t[20],T=y.map(e),t[2]=w,t[3]=p,t[4]=l,t[5]=c,t[6]=m,t[7]=o,t[8]=n,t[9]=C,t[10]=y,t[11]=T}else T=t[11];let E;t[21]!==w||t[22]!==u||t[23]!==d?(E=u?(0,Q.jsxs)(b,{ref:d,type:`button`,variant:`ghost`,onClick:u.onCreate,className:`group h-auto min-w-0 flex-col items-stretch gap-1.5 rounded-lg border-2 border-transparent p-1 text-left text-muted-foreground hover:bg-transparent hover:text-foreground`,children:[(0,Q.jsx)(`span`,{className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-dashed border-border bg-muted/10 transition-colors group-hover:border-foreground/40`,children:(0,Q.jsx)(j,{"aria-hidden":!0,className:`size-6`})}),(0,Q.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium`,children:w({id:`AJ7_B2`})})]}):null,t[21]=w,t[22]=u,t[23]=d,t[24]=E):E=t[24];let D;t[25]===S?D=t[26]:(D=S.map(qe),t[25]=S,t[26]=D);let O;return t[27]!==g||t[28]!==_||t[29]!==h||t[30]!==T||t[31]!==E||t[32]!==D?(O=(0,Q.jsxs)(`fieldset`,{"aria-label":h,"aria-describedby":g,"aria-invalid":_,className:`color-theme-picker grid w-full min-w-0 grid-cols-2 gap-2 sm:grid-cols-3`,children:[T,E,D]}),t[27]=g,t[28]=_,t[29]=h,t[30]=T,t[31]=E,t[32]=D,t[33]=O):O=t[33],O}function qe(e){return(0,Q.jsxs)(`fieldset`,{"aria-label":e.label,className:`flex min-w-0 flex-col gap-1.5 rounded-lg border-2 border-destructive/40 bg-destructive/5 p-1 text-left`,children:[(0,Q.jsx)(`div`,{"aria-hidden":!0,className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-destructive/30 bg-muted/40 text-destructive`,children:(0,Q.jsx)(O,{className:`size-6`})}),(0,Q.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium text-foreground`,children:e.label}),(0,Q.jsx)(`span`,{className:`px-0.5 text-xs font-medium text-destructive`,children:e.problem}),(0,Q.jsx)(`span`,{className:`px-0.5 pb-0.5 text-xs text-muted-foreground`,children:e.detail})]},e.key)}var Je=12e3;function Ye(e){let t=(0,K.c)(213),n,r,a;t[0]===e?(n=t[1],r=t[2],a=t[3]):({appearance:n,onAssign:r,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a);let{_:o}=i(),{themes:s,warnings:c,truncated:l,loadError:u,refresh:d,deleteTheme:f,restoreTheme:p,editingThemeId:m,themeEditorOpen:h,selectThemeToEdit:g}=Ee(),[_,v]=(0,G.useState)(!1),[y,S]=(0,G.useState)(``),[C,T]=(0,G.useState)(null),[E,D]=(0,G.useState)(!1),O=(0,G.useRef)(null),ee=(0,G.useRef)(null),te=(0,G.useRef)(null),k,A;t[4]===d?(k=t[5],A=t[6]):(k=()=>{d()},A=[d],t[4]=d,t[5]=k,t[6]=A),(0,G.useEffect)(k,A);let j;t[7]!==n||t[8]!==s?(j=ge(n,s),t[7]=n,t[8]=s,t[9]=j):j=t[9];let M=j,ne,he,_e,ve,ye,be,Se,Ce,N,P,Te,F,I,L,R,z,De,Oe,ke,Ae,je,Me;if(t[10]!==o||t[11]!==C||t[12]!==y||t[13]!==_||t[14]!==f||t[15]!==m||t[16]!==E||t[17]!==u||t[18]!==r||t[19]!==a||t[20]!==d||t[21]!==p||t[22]!==g||t[23]!==M||t[24]!==h||t[25]!==s||t[26]!==l||t[27]!==c){let e=we(y),n;t[50]===s?n=t[51]:(n=s.filter(et),t[50]=s,t[51]=n);let i=n,k,A,j,ce,de,ge,Ee,B,V;if(t[52]!==o||t[53]!==y||t[54]!==f||t[55]!==m||t[56]!==i||t[57]!==E||t[58]!==u||t[59]!==r||t[60]!==a||t[61]!==d||t[62]!==p||t[63]!==g||t[64]!==M||t[65]!==h||t[66]!==s||t[67]!==l||t[68]!==c){let e=s.flatMap($e),n;t[81]!==o||t[82]!==d||t[83]!==p?(n=async function(e){let t=await p({id:e.id,name:e.scheme.name,stem:e.stem,scheme:{...e.scheme,palette:{...e.scheme.palette}},extension:e.filename.endsWith(`.yml`)?`.yml`:`.yaml`});if(t.ok){await d(),x.success(o({id:`Kx881F`,values:{0:e.label}}));return}if(t.reason===`name-taken`){x.error(o({id:`oZUYMv`,values:{0:e.label}}));return}x.error(o({id:`7O7REc`,values:{0:e.label}}))},t[81]=o,t[82]=d,t[83]=p,t[84]=n):n=t[84];let _=n;j=async function(t){let n=e.find(e=>e.id===t);if(!n)return x.error(o({id:`ANFxWn`})),!1;let r=await f(n.id);if(!r.ok)return x.error(o({id:`kkux8f`,values:{0:n.label}})),!1;if(m===n.id&&g(null),await d(),!r.existed)return x(o({id:`ekSPiP`,values:{0:n.label}})),!0;let i={...n,filename:r.filename,label:r.scheme.name,scheme:r.scheme};return x(o({id:`YCmS3k`,values:{0:i.label}}),{duration:Je,action:{label:o({id:`9uI_rE`}),onClick:()=>_(i)}}),!0};let C;t[85]!==o||t[86]!==y||t[87]!==E||t[88]!==r||t[89]!==a||t[90]!==d||t[91]!==p||t[92]!==M||t[93]!==s?(C=async function(e){if(e.preventDefault(),E)return;let t=we(y);if(!t.ok){T(o({id:`RG3yW6`})),O.current?.focus();return}let n=a.slotMode??`light`,i=s.find(e=>e.id===M[n])?.scheme??xe(a.customSeed),c={name:t.name,variant:i.variant,palette:{...i.palette}};T(null),D(!0);let l=await p({id:t.id,name:t.name,scheme:c});if(!l.ok){T(l.reason===`name-taken`?o({id:`_IfSZn`}):l.reason===`name-invalid`?o({id:`qtnmEX`}):o({id:`DmkTrb`})),D(!1),O.current?.focus();return}let u={id:l.id,label:c.name,kind:c.variant,scheme:c,toTokens:()=>w(c)};r(n,l.id,M,[...s,u]),await d(),S(``),ee.current=l.id,v(!1),D(!1)},t[85]=o,t[86]=y,t[87]=E,t[88]=r,t[89]=a,t[90]=d,t[91]=p,t[92]=M,t[93]=s,t[94]=C):C=t[94],A=C;let te;if(t[95]!==o||t[96]!==c){let e;t[98]===o?e=t[99]:(e=e=>{let t;bb90:switch(e.code){case`unparseable`:t=o({id:`g12y1g`});break bb90;case`not-a-scheme`:t=o({id:`p7Utw8`});break bb90;case`missing-slots`:t=o({id:`GUZHkL`});break bb90;case`bad-hex`:t=o({id:`IMLUBh`});break bb90;case`empty`:t=o({id:`k_tFzX`});break bb90;case`too-long`:t=o({id:`FyyIjH`});break bb90;case`invalid-chars`:t=o({id:`JaU1ld`});break bb90;case`unsupported-extension-case`:t=o({id:`R30SFt`});break bb90;case`duplicate-identity`:t=o({id:`DUb7Ax`});break bb90;case`symlink`:t=o({id:`hFmYGU`});break bb90;case`not-regular-file`:t=o({id:`UH0Zqw`});break bb90;case`file-too-large`:t=o({id:`-othoN`});break bb90;case`read-failed`:t=o({id:`cLn264`});break bb90;default:t=o({id:`WBNpt9`,values:{0:e.code}})}return{key:e.filename,label:e.filename,problem:t,detail:e.conflictingFilenames?o({id:`QwG_zJ`,values:{0:e.conflictingFilenames.join(`, `)}}):o({id:`kwNS82`})}},t[98]=o,t[99]=e),te=c.map(e),t[95]=o,t[96]=c,t[97]=te}else te=t[97];let ne=te;I=`flex w-full min-w-0 flex-col gap-2`,t[100]!==o||t[101]!==u||t[102]!==d?(L=u?(0,Q.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-2 rounded-md border border-destructive/30 px-3 py-2 text-sm text-foreground`,children:[(0,Q.jsx)(`span`,{children:o({id:`hVzt9x`})}),(0,Q.jsx)(b,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>void d(),children:o({id:`KDw4GX`})})]}):null,t[100]=o,t[101]=u,t[102]=d,t[103]=L):L=t[103];let ie;t[104]!==o||t[105]!==l?(ie=l?(0,Q.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-warning/30 px-3 py-2 text-sm text-foreground`,children:[(0,Q.jsx)(re,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-warning`}),(0,Q.jsx)(`span`,{children:o({id:`DLIljL`})})]}):null,t[104]=o,t[105]=l,t[106]=ie):ie=t[106],t[107]===ie?R=t[108]:(R=(0,Q.jsx)(`div`,{role:`status`,children:ie}),t[107]=ie,t[108]=R),k=Ke,de=a,ge=M,Ee=i,B=ne;let ae;t[109]===s?ae=t[110]:(ae=s.filter(Qe).map(Ze),t[109]=s,t[110]=ae);let oe=h?m:null;t[111]!==g||t[112]!==ae||t[113]!==oe?(V={themeIds:ae,selectedId:oe,onSelect:g},t[111]=g,t[112]=ae,t[113]=oe,t[114]=V):V=t[114],ce=e.map(Xe),t[52]=o,t[53]=y,t[54]=f,t[55]=m,t[56]=i,t[57]=E,t[58]=u,t[59]=r,t[60]=a,t[61]=d,t[62]=p,t[63]=g,t[64]=M,t[65]=h,t[66]=s,t[67]=l,t[68]=c,t[69]=k,t[70]=A,t[71]=j,t[72]=I,t[73]=L,t[74]=R,t[75]=ce,t[76]=de,t[77]=ge,t[78]=Ee,t[79]=B,t[80]=V}else k=t[69],A=t[70],j=t[71],I=t[72],L=t[73],R=t[74],ce=t[75],de=t[76],ge=t[77],Ee=t[78],B=t[79],V=t[80];let H;t[115]!==j||t[116]!==ce?(H={themeIds:ce,onDelete:j},t[115]=j,t[116]=ce,t[117]=H):H=t[117];let U;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(U={onCreate:()=>v(!0)},t[118]=U):U=t[118];let W;t[119]!==r||t[120]!==M||t[121]!==s?(W=(e,t)=>r(e,t,M,s),t[119]=r,t[120]=M,t[121]=s,t[122]=W):W=t[122],t[123]!==k||t[124]!==de||t[125]!==ge||t[126]!==Ee||t[127]!==B||t[128]!==V||t[129]!==H||t[130]!==W?(z=(0,Q.jsx)(k,{...de,selection:ge,themes:Ee,unavailableThemes:B,editControl:V,deleteControl:H,createControl:U,createTileRef:te,onAssign:W}),t[123]=k,t[124]=de,t[125]=ge,t[126]=Ee,t[127]=B,t[128]=V,t[129]=H,t[130]=W,t[131]=z):z=t[131],ye=ue,Te=_,t[132]===E?F=t[133]:(F=e=>{E||v(e)},t[132]=E,t[133]=F),ve=oe,t[134]===g?N=t[135]:(N=e=>{e.preventDefault();let t=ee.current;if(t===null){te.current?.focus();return}ee.current=null,g(t)},t[134]=g,t[135]=N);let G;t[136]===o?G=t[137]:(G=o({id:`Z_nNa2`}),t[136]=o,t[137]=G);let K;t[138]===G?K=t[139]:(K=(0,Q.jsx)(ae,{children:G}),t[138]=G,t[139]=K);let q;t[140]===o?q=t[141]:(q=o({id:`nTM8ab`}),t[140]=o,t[141]=q);let J;t[142]===q?J=t[143]:(J=(0,Q.jsx)(ie,{children:q}),t[142]=q,t[143]=J),t[144]!==K||t[145]!==J?(P=(0,Q.jsxs)(le,{className:`gap-2`,children:[K,J]}),t[144]=K,t[145]=J,t[146]=P):P=t[146],_e=se,be=`create-saved-theme-form`,Se=!0,Ce=A,he=me,Ae=C!==null;let Y;t[147]===o?Y=t[148]:(Y=o({id:`HZ7fEu`}),t[147]=o,t[148]=Y),t[149]===Y?je=t[150]:(je=(0,Q.jsx)(fe,{htmlFor:`create-saved-theme-name`,children:Y}),t[149]=Y,t[150]=je);let X=C!==null,Z=C?`create-saved-theme-help create-saved-theme-error`:`create-saved-theme-help`,$;t[151]===C?$=t[152]:($=e=>{S(e.target.value),C&&T(null)},t[151]=C,t[152]=$),t[153]!==y||t[154]!==E||t[155]!==X||t[156]!==Z||t[157]!==$?(Me=(0,Q.jsx)(Ne,{ref:O,id:`create-saved-theme-name`,value:y,autoFocus:!0,autoComplete:`off`,required:!0,readOnly:E,"aria-invalid":X,"aria-describedby":Z,onChange:$}),t[153]=y,t[154]=E,t[155]=X,t[156]=Z,t[157]=$,t[158]=Me):Me=t[158],ne=pe,De=`create-saved-theme-help`,Oe=`font-mono`,ke=e.ok?o({id:`Yb82LN`,values:{0:e.stem}}):o({id:`4d0VYJ`}),t[10]=o,t[11]=C,t[12]=y,t[13]=_,t[14]=f,t[15]=m,t[16]=E,t[17]=u,t[18]=r,t[19]=a,t[20]=d,t[21]=p,t[22]=g,t[23]=M,t[24]=h,t[25]=s,t[26]=l,t[27]=c,t[28]=ne,t[29]=he,t[30]=_e,t[31]=ve,t[32]=ye,t[33]=be,t[34]=Se,t[35]=Ce,t[36]=N,t[37]=P,t[38]=Te,t[39]=F,t[40]=I,t[41]=L,t[42]=R,t[43]=z,t[44]=De,t[45]=Oe,t[46]=ke,t[47]=Ae,t[48]=je,t[49]=Me}else ne=t[28],he=t[29],_e=t[30],ve=t[31],ye=t[32],be=t[33],Se=t[34],Ce=t[35],N=t[36],P=t[37],Te=t[38],F=t[39],I=t[40],L=t[41],R=t[42],z=t[43],De=t[44],Oe=t[45],ke=t[46],Ae=t[47],je=t[48],Me=t[49];let B;t[159]!==ne||t[160]!==De||t[161]!==Oe||t[162]!==ke?(B=(0,Q.jsx)(ne,{id:De,className:Oe,children:ke}),t[159]=ne,t[160]=De,t[161]=Oe,t[162]=ke,t[163]=B):B=t[163];let V;t[164]===C?V=t[165]:(V=C?(0,Q.jsx)(de,{id:`create-saved-theme-error`,children:C}):null,t[164]=C,t[165]=V);let H;t[166]!==he||t[167]!==B||t[168]!==V||t[169]!==Ae||t[170]!==je||t[171]!==Me?(H=(0,Q.jsxs)(he,{"data-invalid":Ae,children:[je,Me,B,V]}),t[166]=he,t[167]=B,t[168]=V,t[169]=Ae,t[170]=je,t[171]=Me,t[172]=H):H=t[172];let U;t[173]!==be||t[174]!==Se||t[175]!==Ce||t[176]!==H?(U=(0,Q.jsx)(`form`,{id:be,noValidate:Se,onSubmit:Ce,children:H}),t[173]=be,t[174]=Se,t[175]=Ce,t[176]=H,t[177]=U):U=t[177];let W;t[178]!==_e||t[179]!==U?(W=(0,Q.jsx)(_e,{children:U}),t[178]=_e,t[179]=U,t[180]=W):W=t[180];let q;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(q=()=>v(!1),t[181]=q):q=t[181];let J;t[182]===o?J=t[183]:(J=o({id:`dEgA5A`}),t[182]=o,t[183]=J);let Y;t[184]!==E||t[185]!==J?(Y=(0,Q.jsx)(b,{type:`button`,variant:`outline`,disabled:E,onClick:q,children:J}),t[184]=E,t[185]=J,t[186]=Y):Y=t[186];let X;t[187]!==o||t[188]!==E?(X=o(E?{id:`_DwR-n`}:{id:`cuHhjo`}),t[187]=o,t[188]=E,t[189]=X):X=t[189];let Z;t[190]!==E||t[191]!==X?(Z=(0,Q.jsx)(b,{type:`submit`,form:`create-saved-theme-form`,disabled:E,children:X}),t[190]=E,t[191]=X,t[192]=Z):Z=t[192];let $;t[193]!==Y||t[194]!==Z?($=(0,Q.jsxs)(ce,{children:[Y,Z]}),t[193]=Y,t[194]=Z,t[195]=$):$=t[195];let Pe;t[196]!==ve||t[197]!==N||t[198]!==P||t[199]!==W||t[200]!==$?(Pe=(0,Q.jsxs)(ve,{onCloseAutoFocus:N,children:[P,W,$]}),t[196]=ve,t[197]=N,t[198]=P,t[199]=W,t[200]=$,t[201]=Pe):Pe=t[201];let Fe;t[202]!==ye||t[203]!==Te||t[204]!==F||t[205]!==Pe?(Fe=(0,Q.jsx)(ye,{open:Te,onOpenChange:F,children:Pe}),t[202]=ye,t[203]=Te,t[204]=F,t[205]=Pe,t[206]=Fe):Fe=t[206];let Ie;return t[207]!==I||t[208]!==L||t[209]!==R||t[210]!==z||t[211]!==Fe?(Ie=(0,Q.jsxs)(`div`,{className:I,children:[L,R,z,Fe]}),t[207]=I,t[208]=L,t[209]=R,t[210]=z,t[211]=Fe,t[212]=Ie):Ie=t[212],Ie}function Xe(e){return e.id}function Ze(e){return e.id}function Qe(e){return e.id.startsWith(`saved-`)}function $e(e){let t=P(e.id);return!t.ok||!e.scheme?[]:[{id:e.id,stem:t.stem,label:e.label,scheme:e.scheme}]}function et(e){return e.id!==`custom`}function tt(e,t){if(e.length===0)throw Error(`buildPatch: path must be non-empty`);let[n,...r]=e;return r.length===0?{[String(n)]:t}:{[String(n)]:tt(r,t)}}function nt(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(e?.type===`default`){let t=e.defaultValue;return typeof t==`function`?t():t}let n=t?._zod?.def?.innerType;if(n===void 0)return;t=n}}function rt(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`default`||e.type===`optional`||e.type===`nullable`){t=e.innerType;continue}return e.type}}function it(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`enum`)return e.entries?Object.values(e.entries):void 0;if(e.innerType!==void 0){t=e.innerType;continue}return}}function at(e){let t=(0,K.c)(14),n;t[0]===e?n=t[1]:(n=e.current(),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i={defaultValues:r,mode:`onBlur`},t[2]=r,t[3]=i);let a=ke(i),o,s;t[4]!==e||t[5]!==a?(o=()=>e.subscribe(e=>{ot(a,e)}),s=[e,a],t[4]=e,t[5]=a,t[6]=o,t[7]=s):(o=t[6],s=t[7]),(0,G.useEffect)(o,s);let c;t[8]!==e||t[9]!==a?(c=t=>st(a,e,t),t[8]=e,t[9]=a,t[10]=c):c=t[10];let l=c,u;return t[11]!==l||t[12]!==a?(u={form:a,commitField:l},t[11]=l,t[12]=a,t[13]=u):u=t[13],u}function ot(e,t){e.reset(t,{keepDirtyValues:!0,keepDirty:!0,keepTouched:!0})}function st(e,t,n){let r=e.getValues(n),i=tt(ut(n),r),a=t.patch(i);if(a.ok)return e.clearErrors(n),e.resetField(n,{defaultValue:r,keepError:!1}),!0;if(C(a.error)&&a.error.code===`SCHEMA_INVALID`&&a.error.issues.length>0){e.clearErrors(n);for(let t of a.error.issues){let r=t.path.length>0?t.path.map(String).join(`.`):n;e.setError(r,{type:`config-binding`,message:t.message})}}else e.setError(n,{type:`config-binding`,message:ct(a.error,n)});return!1}function ct(e,t){if(C(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>lt(e,t));if(n)return n.message}return S(e)}function lt(e,t){return e.path.map(String).join(`.`)===t}function ut(e){return e.split(`.`)}function dt(e){if(!C(e)||e.code!==`SCHEMA_INVALID`)return null;let t=e.issues[0];return!t||t.path.length===0?null:t.path.map(String).join(`.`)}function ft(){let e=(0,K.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(W,{className:`h-5 w-32`}),n=(0,Q.jsx)(W,{className:`h-4 w-64`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[t,n,(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(W,{className:`h-9 w-full`}),(0,Q.jsx)(W,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function pt({field:e,scope:t,commitField:n,isFlashed:o}){"use no memo";let{_:d}=i(),f=B(),{setTheme:p}=a(),m=T(),h=F(I,e.path),g=h?rt(h):void 0,_=h?nt(h):void 0,v=h?it(h):void 0,y=h?Te(h):void 0,x=y?.scope===`project`&&t!==`project`||y?.scope===`user`&&t!==`user`,S=e.path.join(`.`),C=d(e.label),[w,D]=(0,G.useState)(!1),O=(0,G.useRef)(null);(0,G.useEffect)(()=>()=>{O.current&&clearTimeout(O.current)},[]);let ee=()=>{D(!0),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>D(!1),1200)},te=()=>{let e=n(S);return e&&ee(),e},k=()=>f.getFieldState(S).isDirty?te():!0,A=()=>{if(e.control===`theme-tiles`){let e=m?.userBinding;if(!e)return;let t=e.patch({appearance:be()});t.ok?ee():f.setError(S,{type:`manual`,message:ct(t.error,S)});return}let t=_===void 0?null:_;f.setValue(S,t,{shouldDirty:!1}),e.control===`theme-cards`&&p(E(t)),te()},j=s(`relative`,o&&`animate-settings-flash`);return(0,Q.jsx)(Ae,{control:f.control,name:S,render:({field:n})=>{let i=!x&&(_!==void 0||n.value!==void 0);return(0,Q.jsxs)(Oe,{className:j,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsx)(Me,{className:`text-sm font-medium`,children:C}),i?(0,Q.jsxs)(u,{children:[(0,Q.jsx)(c,{asChild:!0,children:(0,Q.jsx)(b,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:A,"aria-label":d({id:`lhjq3G`,values:{labelText:C}}),children:(0,Q.jsx)(M,{className:`size-3.5`})})}),(0,Q.jsx)(l,{children:(0,Q.jsx)(r,{id:`L-rMC9`})})]}):null]}),e.description?(0,Q.jsx)(V,{className:`text-muted-foreground text-1sm`,children:d(e.description)}):null,(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(je,{children:(0,Q.jsx)(ht,{field:e,ctl:n,typeTag:g,enumOptions:v,onCommit:k,onRevertToBaseline:()=>f.resetField(S,{keepError:!0}),onSavedOutsideForm:ee,onWriteRejected:e=>{f.setError(S,{type:`manual`,message:ct(e,S)})}})}),(0,Q.jsx)(yt,{visible:w,srOnly:mt(e.control)})]}),(0,Q.jsx)(H,{"data-field-error":e.path.join(`.`)})]})}})}function mt(e){return e===`theme-tiles`||e===`theme-cards`}function ht({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:o,onRevertToBaseline:s,onSavedOutsideForm:c,onWriteRejected:l,...u}){"use no memo";let{_:d}=i(),{setTheme:f,systemTheme:p}=a(),m=T(),h=m?.merged??null;if(e.control===`language-select`)return(0,Q.jsx)(Re,{...u,value:t.value,ref:t.ref,onBlur:t.onBlur,onValueChange:e=>{let n=R(t.value)??`system`;n!==e&&J({from:n,to:e}),t.onChange(e),o()}});if(e.control===`theme-cards`){let{id:n,...r}=u;return(0,Q.jsx)(k,{...r,firstItemId:n,value:E(t.value),"aria-label":d(e.label),onValueChange:e=>{let n=E(t.value);f(e),t.onChange(e),!o()&&(f(n),s())}})}if(e.control===`theme-tiles`){let{id:t,...n}=u,r=h?.appearance?.customTheme,i=h?.appearance?.theme,a=N(i,p===`dark`);return(0,Q.jsx)(Ye,{...n,firstItemId:t,appearance:h?.appearance,customSeed:r,slotMode:a,"aria-label":d(e.label),onAssign:(e,t,n,o)=>{let s=m?.userBinding;if(!s)return;let u={...n,[e]:t},d=e=>{let t=e[a];return t===`custom`?_e(xe(r)):he(t,o)};ye({selection:u,modePreference:i,slotMode:a,customSeed:r,themes:o}),f(d(u)??i??`system`);let p=s.patch({appearance:Se(u)});if(p.ok){Z(u),c();return}ye({selection:n,modePreference:i,slotMode:a,customSeed:r,themes:o}),f(d(n)??i??`system`),l(p.error)}})}if(n===`boolean`)return(0,Q.jsx)(g,{...u,checked:!!t.value,ref:t.ref,onCheckedChange:e=>{t.onChange(e),o()},onBlur:t.onBlur});if(n===`enum`&&r&&r.length>0&&(e.control===`enum-toggle`||r.length<=4)){let{id:n,...i}=u;return(0,Q.jsx)(y,{...i,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(t.onChange(e),o())},onBlur:t.onBlur,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-lg`,"aria-label":d(e.label),children:r.map((e,t)=>(0,Q.jsx)(_,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,Q.jsx)(_t,{ctl:t,onCommit:o,...u}):n===`array`?(0,Q.jsx)(vt,{ctl:t,onCommit:o,...u}):(0,Q.jsx)(gt,{ctl:t,onCommit:o,...u})}function gt({ctl:e,onCommit:t,...n}){"use no memo";return(0,Q.jsx)(Ne,{...n,value:typeof e.value==`string`?e.value:``,ref:e.ref,onChange:t=>e.onChange(t.target.value),onBlur:()=>{e.onBlur(),t()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),t())},className:`h-8 text-sm`})}function _t({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,G.useState)(e.value===void 0?``:String(e.value)),a=(0,G.useRef)(e.value);(0,G.useEffect)(()=>{a.current!==e.value&&(i(e.value===void 0?``:String(e.value)),a.current=e.value)},[e.value]);let o=()=>{let n=Number(r);if(!Number.isFinite(n)){e.onChange(r),t();return}e.onChange(n),t(),a.current=n};return(0,Q.jsx)(Ne,{...n,type:`number`,value:r,ref:e.ref,onChange:e=>i(e.target.value),onBlur:()=>{e.onBlur(),o()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},className:`h-8 w-28 text-sm tabular-nums`})}function vt({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{n as a}from"./dist-PQ5KMVDh.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{i as c,n as l,t as u}from"./tooltip-Bz6z4_se.js";import{i as d,n as f,o as p,s as m,t as h}from"./select-pACXgFe2.js";import{t as g}from"./switch-BKZTXkzu.js";import{n as _,r as v,t as y}from"./toggle-group-B7p69Qfd.js";import{t as b}from"./button-DzgjsZzC.js";import{n as x}from"./dist-BGzUo_18.js";import{n as S,r as C}from"./config-errors-DDAH9fqy.js";import{Ct as w}from"./schemas-api-CL5ZXlEj.js";import{a as T,t as E}from"./use-apply-config-theme-CYFG76sS.js";import{t as D}from"./check-B2OLRY33.js";import{t as O}from"./circle-alert-eBm4JPxY.js";import{n as ee,r as te,t as k}from"./ThemePicker-pc5gwEur.js";import{n as A,t as j}from"./plus-zPnYzcqL.js";import{t as M}from"./rotate-ccw-Zi1IjIg9.js";import{t as ne}from"./trash-2-CchZ0T47.js";import{t as re}from"./triangle-alert-BXrUEeRU.js";import{a as ie,c as ae,i as oe,n as se,o as ce,s as le,t as ue}from"./dialog-BJEjKJjL.js";import{i as de,o as fe,r as pe,t as me}from"./field-DFJgKWGh.js";import{a as he,b as ge,c as _e,g as ve,n as ye,o as be,p as xe,s as Se,u as Ce,v as we,x as N,y as P}from"./use-apply-config-color-theme-Bpi7AD0s.js";import{T as Te,n as Ee,o as F,s as I}from"./saved-themes-client-BPWMEtsb.js";import{l as L,n as R,u as z}from"./use-apply-config-language-DlSviEmN.js";import{t as De}from"./trace-api-BSvaJNnr.js";import{a as Oe,f as ke,i as Ae,n as je,o as Me,p as B,r as V,s as H}from"./form-U6OjlA0v.js";import{t as Ne}from"./input-BsFOyzfK.js";import{t as U}from"./textarea-DYYN2PV4.js";import{t as W}from"./skeleton-izVZCkjV.js";import"./config-schema-gPKGwQR7.js";var G=e(n(),1),K=o(),q=`open-knowledge-app`;function J({from:e,to:t}){try{De.getTracer(q).startSpan(`ok.language.preferenceChanged`,{attributes:{"ok.language.from":e,"ok.language.to":t}}).end()}catch(e){console.warn(`[language-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}var Y=`open-knowledge-app`;function X(e){let t=e.light.startsWith(`saved-`),n=e.dark.startsWith(`saved-`);return!t||!n?`incomplete`:e.light===e.dark?`same`:`different`}function Z(e){try{De.getTracer(Y).startSpan(`ok.saved_themes.assignment`,{attributes:{"saved_theme.pair":X(e)}}).end()}catch(e){console.warn(`[saved-theme-telemetry] assignment span emit failed:`,e instanceof Error?e:String(e))}}var Q=t(),$=`system`;function Pe(e){return typeof e==`string`&&z.includes(e)}function Fe(e){return Pe(e)?e:$}function Ie(e){return new Intl.DisplayNames([e],{type:`language`}).of(e)??e}function Le(e){let t=(0,K.c)(6),{choice:n}=e;if(n===$){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(r,{id:`D-NlUC`}),t[0]=e):e=t[0],e}let i;t[1]===n?i=t[2]:(i=Ie(n),t[1]=n,t[2]=i);let a;return t[3]!==n||t[4]!==i?(a=(0,Q.jsx)(`span`,{lang:n,className:`capitalize`,children:i}),t[3]=n,t[4]=i,t[5]=a):a=t[5],a}function Re(e){let t=(0,K.c)(22),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({value:o,onValueChange:r,onBlur:n,ref:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===o?s=t[7]:(s=Fe(o),t[6]=o,t[7]=s);let c=s,l;t[8]===r?l=t[9]:(l=e=>r(Fe(e)),t[8]=r,t[9]=l);let u;t[10]===c?u=t[11]:(u=(0,Q.jsx)(m,{children:(0,Q.jsx)(Le,{choice:c})}),t[10]=c,t[11]=u);let g;t[12]!==n||t[13]!==i||t[14]!==a||t[15]!==u?(g=(0,Q.jsx)(p,{...a,ref:i,onBlur:n,size:`sm`,className:`w-48`,children:u}),t[12]=n,t[13]=i,t[14]=a,t[15]=u,t[16]=g):g=t[16];let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsxs)(f,{children:[(0,Q.jsx)(d,{value:$,children:(0,Q.jsx)(Le,{choice:$})}),L.map(ze)]}),t[17]=_):_=t[17];let v;return t[18]!==c||t[19]!==l||t[20]!==g?(v=(0,Q.jsxs)(h,{value:c,onValueChange:l,children:[g,_]}),t[18]=c,t[19]=l,t[20]=g,t[21]=v):v=t[21],v}function ze(e){return(0,Q.jsx)(d,{value:e,children:(0,Q.jsx)(Le,{choice:e})},e)}function Be(e){return{chrome:e.sidebar,surface:e.background,bar:e.primary,line:e.border,dots:[e[`syntax-string`],e[`syntax-keyword`],e[`syntax-atom`]]}}function Ve(e,t,n){return e.id===`custom`?Be(w(xe(t))):e.scheme?Be(w(e.scheme)):Be(Ce(n))}function He(e){let t=(0,K.c)(38),{theme:n,customSeed:r,slotMode:i}=e,a,o,s,c,l,u,d,f,p,m;t[0]!==r||t[1]!==i||t[2]!==n?(a=Ve(n,r,i),u=!0,d=``,f=`aspect-[4/3] w-full overflow-hidden rounded-md border`,p={backgroundColor:a.surface,borderColor:a.line},m=(0,Q.jsxs)(`div`,{className:`flex h-1/3 items-center gap-1 px-1.5`,style:{backgroundColor:a.chrome,borderBottom:`1px solid ${a.line}`},children:[(0,Q.jsx)(`span`,{className:`h-1.5 w-5 rounded-full`,style:{backgroundColor:a.bar}}),(0,Q.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full opacity-50`,style:{backgroundColor:a.line}})]}),l=`flex h-2/3`,o=`flex w-1/4 flex-col items-center justify-center gap-1`,s={backgroundColor:a.chrome,borderRight:`1px solid ${a.line}`},c=a.dots.map(Ue),t[0]=r,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m):(a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]);let h;t[13]!==o||t[14]!==s||t[15]!==c?(h=(0,Q.jsx)(`div`,{className:o,style:s,children:c}),t[13]=o,t[14]=s,t[15]=c,t[16]=h):h=t[16];let g;t[17]===a.dots[1]?g=t[18]:(g=(0,Q.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-full`,style:{backgroundColor:a.dots[1]}}),t[17]=a.dots[1],t[18]=g);let _;t[19]===a.line?_=t[20]:(_=(0,Q.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-full opacity-60`,style:{backgroundColor:a.line}}),t[19]=a.line,t[20]=_);let v;t[21]===a.dots[0]?v=t[22]:(v=(0,Q.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:a.dots[0]}}),t[21]=a.dots[0],t[22]=v);let y;t[23]!==g||t[24]!==_||t[25]!==v?(y=(0,Q.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1 px-1.5`,children:[g,_,v]}),t[23]=g,t[24]=_,t[25]=v,t[26]=y):y=t[26];let b;t[27]!==h||t[28]!==y||t[29]!==l?(b=(0,Q.jsxs)(`div`,{className:l,children:[h,y]}),t[27]=h,t[28]=y,t[29]=l,t[30]=b):b=t[30];let x;return t[31]!==b||t[32]!==u||t[33]!==d||t[34]!==f||t[35]!==p||t[36]!==m?(x=(0,Q.jsxs)(`div`,{"aria-hidden":u,"data-theme-swatch":d,className:f,style:p,children:[m,b]}),t[31]=b,t[32]=u,t[33]=d,t[34]=f,t[35]=p,t[36]=m,t[37]=x):x=t[37],x}function Ue(e,t){return(0,Q.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function We(e){return s(`size-6 min-w-6 rounded-md border p-0 transition-colors`,e?`border-primary bg-primary/15 text-primary hover:bg-primary/20 data-[state=on]:bg-primary/15`:`border-border/70 text-muted-foreground/70 hover:text-foreground`)}function Ge(e){return s(`size-3.5`,e&&`fill-current`)}function Ke(e){let t=(0,K.c)(34),{selection:n,themes:r,unavailableThemes:a,onAssign:o,editControl:c,deleteControl:l,createControl:u,createTileRef:d,slotMode:f,customSeed:p,firstItemId:m,"aria-label":h,"aria-describedby":g,"aria-invalid":_}=e,y=r===void 0?ve:r,x;t[0]===a?x=t[1]:(x=a===void 0?[]:a,t[0]=a,t[1]=x);let S=x,C=f===void 0?`light`:f,{_:w}=i(),T;if(t[2]!==w||t[3]!==p||t[4]!==l||t[5]!==c||t[6]!==m||t[7]!==o||t[8]!==n||t[9]!==C||t[10]!==y){let e;t[12]!==w||t[13]!==p||t[14]!==l||t[15]!==c||t[16]!==m||t[17]!==o||t[18]!==n||t[19]!==C?(e=(e,t)=>{let r=n.light===e.id,i=n.dark===e.id,a=c?.themeIds.includes(e.id)??!1,u=l?.themeIds.includes(e.id)??!1,d=c?.selectedId===e.id,f=w(C===`light`?{id:`hgF0al`,values:{0:e.label}}:{id:`6Nea1q`,values:{0:e.label}});return(0,Q.jsxs)(`fieldset`,{"aria-label":e.label,className:s(`relative flex min-w-0 flex-col gap-1.5 rounded-lg border-2 p-1 text-left`,n[C]===e.id?`border-primary`:`border-transparent`),children:[(0,Q.jsx)(b,{type:`button`,variant:`ghost`,"aria-label":f,"data-theme-focus-target":``,onClick:()=>o(C,e.id),className:`h-auto w-full cursor-pointer p-0 transition-opacity hover:bg-transparent hover:opacity-90`,children:(0,Q.jsx)(He,{theme:e,customSeed:p,slotMode:C})}),u?(0,Q.jsx)(b,{type:`button`,variant:`outline`,size:`icon-sm`,title:w({id:`Y2tU6I`,values:{0:e.label}}),"aria-label":w({id:`Y2tU6I`,values:{0:e.label}}),className:`absolute top-2 end-2 z-10 border-border/80 bg-background/85 text-muted-foreground shadow-sm backdrop-blur-sm hover:border-destructive/50 hover:bg-destructive/15 hover:text-destructive focus-visible:border-destructive/50 focus-visible:text-destructive focus-visible:ring-destructive/20 dark:bg-background/80 dark:hover:bg-destructive/20`,onClick:async t=>{let n=t.currentTarget.closest(`fieldset`),r=n?.previousElementSibling?.querySelector(`[data-theme-focus-target]`)??n?.nextElementSibling?.querySelector(`[data-theme-focus-target]`);await l?.onDelete(e.id)!==!1&&r?.focus()},children:(0,Q.jsx)(ne,{"aria-hidden":!0})}):null,(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-1 px-0.5`,children:[(0,Q.jsx)(`span`,{className:`truncate text-1sm font-medium text-foreground`,children:e.label}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[a?(0,Q.jsx)(v,{className:We(d),pressed:d,onPressedChange:t=>{c?.onSelect(t?e.id:null)},"aria-label":w(d?{id:`8x6zk9`,values:{0:e.label}}:{id:`N6j2JH`,values:{0:e.label}}),children:(0,Q.jsx)(A,{className:`size-3.5`})}):null,(0,Q.jsx)(v,{id:t===0?m:void 0,className:We(r),pressed:r,onPressedChange:t=>{t&&o(`light`,e.id)},"aria-label":w({id:`sq4WQH`,values:{0:e.label}}),children:(0,Q.jsx)(ee,{className:Ge(r)})}),(0,Q.jsx)(v,{className:We(i),pressed:i,onPressedChange:t=>{t&&o(`dark`,e.id)},"aria-label":w({id:`lZvQrY`,values:{0:e.label}}),children:(0,Q.jsx)(te,{className:Ge(i)})})]})]})]},e.id)},t[12]=w,t[13]=p,t[14]=l,t[15]=c,t[16]=m,t[17]=o,t[18]=n,t[19]=C,t[20]=e):e=t[20],T=y.map(e),t[2]=w,t[3]=p,t[4]=l,t[5]=c,t[6]=m,t[7]=o,t[8]=n,t[9]=C,t[10]=y,t[11]=T}else T=t[11];let E;t[21]!==w||t[22]!==u||t[23]!==d?(E=u?(0,Q.jsxs)(b,{ref:d,type:`button`,variant:`ghost`,onClick:u.onCreate,className:`group h-auto min-w-0 flex-col items-stretch gap-1.5 rounded-lg border-2 border-transparent p-1 text-left text-muted-foreground hover:bg-transparent hover:text-foreground`,children:[(0,Q.jsx)(`span`,{className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-dashed border-border bg-muted/10 transition-colors group-hover:border-foreground/40`,children:(0,Q.jsx)(j,{"aria-hidden":!0,className:`size-6`})}),(0,Q.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium`,children:w({id:`AJ7_B2`})})]}):null,t[21]=w,t[22]=u,t[23]=d,t[24]=E):E=t[24];let D;t[25]===S?D=t[26]:(D=S.map(qe),t[25]=S,t[26]=D);let O;return t[27]!==g||t[28]!==_||t[29]!==h||t[30]!==T||t[31]!==E||t[32]!==D?(O=(0,Q.jsxs)(`fieldset`,{"aria-label":h,"aria-describedby":g,"aria-invalid":_,className:`color-theme-picker grid w-full min-w-0 grid-cols-2 gap-2 sm:grid-cols-3`,children:[T,E,D]}),t[27]=g,t[28]=_,t[29]=h,t[30]=T,t[31]=E,t[32]=D,t[33]=O):O=t[33],O}function qe(e){return(0,Q.jsxs)(`fieldset`,{"aria-label":e.label,className:`flex min-w-0 flex-col gap-1.5 rounded-lg border-2 border-destructive/40 bg-destructive/5 p-1 text-left`,children:[(0,Q.jsx)(`div`,{"aria-hidden":!0,className:`flex aspect-[4/3] w-full items-center justify-center rounded-md border border-destructive/30 bg-muted/40 text-destructive`,children:(0,Q.jsx)(O,{className:`size-6`})}),(0,Q.jsx)(`span`,{className:`truncate px-0.5 text-1sm font-medium text-foreground`,children:e.label}),(0,Q.jsx)(`span`,{className:`px-0.5 text-xs font-medium text-destructive`,children:e.problem}),(0,Q.jsx)(`span`,{className:`px-0.5 pb-0.5 text-xs text-muted-foreground`,children:e.detail})]},e.key)}var Je=12e3;function Ye(e){let t=(0,K.c)(213),n,r,a;t[0]===e?(n=t[1],r=t[2],a=t[3]):({appearance:n,onAssign:r,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a);let{_:o}=i(),{themes:s,warnings:c,truncated:l,loadError:u,refresh:d,deleteTheme:f,restoreTheme:p,editingThemeId:m,themeEditorOpen:h,selectThemeToEdit:g}=Ee(),[_,v]=(0,G.useState)(!1),[y,S]=(0,G.useState)(``),[C,T]=(0,G.useState)(null),[E,D]=(0,G.useState)(!1),O=(0,G.useRef)(null),ee=(0,G.useRef)(null),te=(0,G.useRef)(null),k,A;t[4]===d?(k=t[5],A=t[6]):(k=()=>{d()},A=[d],t[4]=d,t[5]=k,t[6]=A),(0,G.useEffect)(k,A);let j;t[7]!==n||t[8]!==s?(j=ge(n,s),t[7]=n,t[8]=s,t[9]=j):j=t[9];let M=j,ne,he,_e,ve,ye,be,Se,Ce,N,P,Te,F,I,L,R,z,De,Oe,ke,Ae,je,Me;if(t[10]!==o||t[11]!==C||t[12]!==y||t[13]!==_||t[14]!==f||t[15]!==m||t[16]!==E||t[17]!==u||t[18]!==r||t[19]!==a||t[20]!==d||t[21]!==p||t[22]!==g||t[23]!==M||t[24]!==h||t[25]!==s||t[26]!==l||t[27]!==c){let e=we(y),n;t[50]===s?n=t[51]:(n=s.filter(et),t[50]=s,t[51]=n);let i=n,k,A,j,ce,de,ge,Ee,B,V;if(t[52]!==o||t[53]!==y||t[54]!==f||t[55]!==m||t[56]!==i||t[57]!==E||t[58]!==u||t[59]!==r||t[60]!==a||t[61]!==d||t[62]!==p||t[63]!==g||t[64]!==M||t[65]!==h||t[66]!==s||t[67]!==l||t[68]!==c){let e=s.flatMap($e),n;t[81]!==o||t[82]!==d||t[83]!==p?(n=async function(e){let t=await p({id:e.id,name:e.scheme.name,stem:e.stem,scheme:{...e.scheme,palette:{...e.scheme.palette}},extension:e.filename.endsWith(`.yml`)?`.yml`:`.yaml`});if(t.ok){await d(),x.success(o({id:`Kx881F`,values:{0:e.label}}));return}if(t.reason===`name-taken`){x.error(o({id:`oZUYMv`,values:{0:e.label}}));return}x.error(o({id:`7O7REc`,values:{0:e.label}}))},t[81]=o,t[82]=d,t[83]=p,t[84]=n):n=t[84];let _=n;j=async function(t){let n=e.find(e=>e.id===t);if(!n)return x.error(o({id:`ANFxWn`})),!1;let r=await f(n.id);if(!r.ok)return x.error(o({id:`kkux8f`,values:{0:n.label}})),!1;if(m===n.id&&g(null),await d(),!r.existed)return x(o({id:`ekSPiP`,values:{0:n.label}})),!0;let i={...n,filename:r.filename,label:r.scheme.name,scheme:r.scheme};return x(o({id:`YCmS3k`,values:{0:i.label}}),{duration:Je,action:{label:o({id:`9uI_rE`}),onClick:()=>_(i)}}),!0};let C;t[85]!==o||t[86]!==y||t[87]!==E||t[88]!==r||t[89]!==a||t[90]!==d||t[91]!==p||t[92]!==M||t[93]!==s?(C=async function(e){if(e.preventDefault(),E)return;let t=we(y);if(!t.ok){T(o({id:`RG3yW6`})),O.current?.focus();return}let n=a.slotMode??`light`,i=s.find(e=>e.id===M[n])?.scheme??xe(a.customSeed),c={name:t.name,variant:i.variant,palette:{...i.palette}};T(null),D(!0);let l=await p({id:t.id,name:t.name,scheme:c});if(!l.ok){T(l.reason===`name-taken`?o({id:`_IfSZn`}):l.reason===`name-invalid`?o({id:`qtnmEX`}):o({id:`DmkTrb`})),D(!1),O.current?.focus();return}let u={id:l.id,label:c.name,kind:c.variant,scheme:c,toTokens:()=>w(c)};r(n,l.id,M,[...s,u]),await d(),S(``),ee.current=l.id,v(!1),D(!1)},t[85]=o,t[86]=y,t[87]=E,t[88]=r,t[89]=a,t[90]=d,t[91]=p,t[92]=M,t[93]=s,t[94]=C):C=t[94],A=C;let te;if(t[95]!==o||t[96]!==c){let e;t[98]===o?e=t[99]:(e=e=>{let t;bb90:switch(e.code){case`unparseable`:t=o({id:`g12y1g`});break bb90;case`not-a-scheme`:t=o({id:`p7Utw8`});break bb90;case`missing-slots`:t=o({id:`GUZHkL`});break bb90;case`bad-hex`:t=o({id:`IMLUBh`});break bb90;case`empty`:t=o({id:`k_tFzX`});break bb90;case`too-long`:t=o({id:`FyyIjH`});break bb90;case`invalid-chars`:t=o({id:`JaU1ld`});break bb90;case`unsupported-extension-case`:t=o({id:`R30SFt`});break bb90;case`duplicate-identity`:t=o({id:`DUb7Ax`});break bb90;case`symlink`:t=o({id:`hFmYGU`});break bb90;case`not-regular-file`:t=o({id:`UH0Zqw`});break bb90;case`file-too-large`:t=o({id:`-othoN`});break bb90;case`read-failed`:t=o({id:`cLn264`});break bb90;default:t=o({id:`WBNpt9`,values:{0:e.code}})}return{key:e.filename,label:e.filename,problem:t,detail:e.conflictingFilenames?o({id:`QwG_zJ`,values:{0:e.conflictingFilenames.join(`, `)}}):o({id:`kwNS82`})}},t[98]=o,t[99]=e),te=c.map(e),t[95]=o,t[96]=c,t[97]=te}else te=t[97];let ne=te;I=`flex w-full min-w-0 flex-col gap-2`,t[100]!==o||t[101]!==u||t[102]!==d?(L=u?(0,Q.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-2 rounded-md border border-destructive/30 px-3 py-2 text-sm text-foreground`,children:[(0,Q.jsx)(`span`,{children:o({id:`hVzt9x`})}),(0,Q.jsx)(b,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>void d(),children:o({id:`KDw4GX`})})]}):null,t[100]=o,t[101]=u,t[102]=d,t[103]=L):L=t[103];let ie;t[104]!==o||t[105]!==l?(ie=l?(0,Q.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-warning/30 px-3 py-2 text-sm text-foreground`,children:[(0,Q.jsx)(re,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-warning`}),(0,Q.jsx)(`span`,{children:o({id:`DLIljL`})})]}):null,t[104]=o,t[105]=l,t[106]=ie):ie=t[106],t[107]===ie?R=t[108]:(R=(0,Q.jsx)(`div`,{role:`status`,children:ie}),t[107]=ie,t[108]=R),k=Ke,de=a,ge=M,Ee=i,B=ne;let ae;t[109]===s?ae=t[110]:(ae=s.filter(Qe).map(Ze),t[109]=s,t[110]=ae);let oe=h?m:null;t[111]!==g||t[112]!==ae||t[113]!==oe?(V={themeIds:ae,selectedId:oe,onSelect:g},t[111]=g,t[112]=ae,t[113]=oe,t[114]=V):V=t[114],ce=e.map(Xe),t[52]=o,t[53]=y,t[54]=f,t[55]=m,t[56]=i,t[57]=E,t[58]=u,t[59]=r,t[60]=a,t[61]=d,t[62]=p,t[63]=g,t[64]=M,t[65]=h,t[66]=s,t[67]=l,t[68]=c,t[69]=k,t[70]=A,t[71]=j,t[72]=I,t[73]=L,t[74]=R,t[75]=ce,t[76]=de,t[77]=ge,t[78]=Ee,t[79]=B,t[80]=V}else k=t[69],A=t[70],j=t[71],I=t[72],L=t[73],R=t[74],ce=t[75],de=t[76],ge=t[77],Ee=t[78],B=t[79],V=t[80];let H;t[115]!==j||t[116]!==ce?(H={themeIds:ce,onDelete:j},t[115]=j,t[116]=ce,t[117]=H):H=t[117];let U;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(U={onCreate:()=>v(!0)},t[118]=U):U=t[118];let W;t[119]!==r||t[120]!==M||t[121]!==s?(W=(e,t)=>r(e,t,M,s),t[119]=r,t[120]=M,t[121]=s,t[122]=W):W=t[122],t[123]!==k||t[124]!==de||t[125]!==ge||t[126]!==Ee||t[127]!==B||t[128]!==V||t[129]!==H||t[130]!==W?(z=(0,Q.jsx)(k,{...de,selection:ge,themes:Ee,unavailableThemes:B,editControl:V,deleteControl:H,createControl:U,createTileRef:te,onAssign:W}),t[123]=k,t[124]=de,t[125]=ge,t[126]=Ee,t[127]=B,t[128]=V,t[129]=H,t[130]=W,t[131]=z):z=t[131],ye=ue,Te=_,t[132]===E?F=t[133]:(F=e=>{E||v(e)},t[132]=E,t[133]=F),ve=oe,t[134]===g?N=t[135]:(N=e=>{e.preventDefault();let t=ee.current;if(t===null){te.current?.focus();return}ee.current=null,g(t)},t[134]=g,t[135]=N);let G;t[136]===o?G=t[137]:(G=o({id:`Z_nNa2`}),t[136]=o,t[137]=G);let K;t[138]===G?K=t[139]:(K=(0,Q.jsx)(ae,{children:G}),t[138]=G,t[139]=K);let q;t[140]===o?q=t[141]:(q=o({id:`nTM8ab`}),t[140]=o,t[141]=q);let J;t[142]===q?J=t[143]:(J=(0,Q.jsx)(ie,{children:q}),t[142]=q,t[143]=J),t[144]!==K||t[145]!==J?(P=(0,Q.jsxs)(le,{className:`gap-2`,children:[K,J]}),t[144]=K,t[145]=J,t[146]=P):P=t[146],_e=se,be=`create-saved-theme-form`,Se=!0,Ce=A,he=me,Ae=C!==null;let Y;t[147]===o?Y=t[148]:(Y=o({id:`HZ7fEu`}),t[147]=o,t[148]=Y),t[149]===Y?je=t[150]:(je=(0,Q.jsx)(fe,{htmlFor:`create-saved-theme-name`,children:Y}),t[149]=Y,t[150]=je);let X=C!==null,Z=C?`create-saved-theme-help create-saved-theme-error`:`create-saved-theme-help`,$;t[151]===C?$=t[152]:($=e=>{S(e.target.value),C&&T(null)},t[151]=C,t[152]=$),t[153]!==y||t[154]!==E||t[155]!==X||t[156]!==Z||t[157]!==$?(Me=(0,Q.jsx)(Ne,{ref:O,id:`create-saved-theme-name`,value:y,autoFocus:!0,autoComplete:`off`,required:!0,readOnly:E,"aria-invalid":X,"aria-describedby":Z,onChange:$}),t[153]=y,t[154]=E,t[155]=X,t[156]=Z,t[157]=$,t[158]=Me):Me=t[158],ne=pe,De=`create-saved-theme-help`,Oe=`font-mono`,ke=e.ok?o({id:`Yb82LN`,values:{0:e.stem}}):o({id:`4d0VYJ`}),t[10]=o,t[11]=C,t[12]=y,t[13]=_,t[14]=f,t[15]=m,t[16]=E,t[17]=u,t[18]=r,t[19]=a,t[20]=d,t[21]=p,t[22]=g,t[23]=M,t[24]=h,t[25]=s,t[26]=l,t[27]=c,t[28]=ne,t[29]=he,t[30]=_e,t[31]=ve,t[32]=ye,t[33]=be,t[34]=Se,t[35]=Ce,t[36]=N,t[37]=P,t[38]=Te,t[39]=F,t[40]=I,t[41]=L,t[42]=R,t[43]=z,t[44]=De,t[45]=Oe,t[46]=ke,t[47]=Ae,t[48]=je,t[49]=Me}else ne=t[28],he=t[29],_e=t[30],ve=t[31],ye=t[32],be=t[33],Se=t[34],Ce=t[35],N=t[36],P=t[37],Te=t[38],F=t[39],I=t[40],L=t[41],R=t[42],z=t[43],De=t[44],Oe=t[45],ke=t[46],Ae=t[47],je=t[48],Me=t[49];let B;t[159]!==ne||t[160]!==De||t[161]!==Oe||t[162]!==ke?(B=(0,Q.jsx)(ne,{id:De,className:Oe,children:ke}),t[159]=ne,t[160]=De,t[161]=Oe,t[162]=ke,t[163]=B):B=t[163];let V;t[164]===C?V=t[165]:(V=C?(0,Q.jsx)(de,{id:`create-saved-theme-error`,children:C}):null,t[164]=C,t[165]=V);let H;t[166]!==he||t[167]!==B||t[168]!==V||t[169]!==Ae||t[170]!==je||t[171]!==Me?(H=(0,Q.jsxs)(he,{"data-invalid":Ae,children:[je,Me,B,V]}),t[166]=he,t[167]=B,t[168]=V,t[169]=Ae,t[170]=je,t[171]=Me,t[172]=H):H=t[172];let U;t[173]!==be||t[174]!==Se||t[175]!==Ce||t[176]!==H?(U=(0,Q.jsx)(`form`,{id:be,noValidate:Se,onSubmit:Ce,children:H}),t[173]=be,t[174]=Se,t[175]=Ce,t[176]=H,t[177]=U):U=t[177];let W;t[178]!==_e||t[179]!==U?(W=(0,Q.jsx)(_e,{children:U}),t[178]=_e,t[179]=U,t[180]=W):W=t[180];let q;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(q=()=>v(!1),t[181]=q):q=t[181];let J;t[182]===o?J=t[183]:(J=o({id:`dEgA5A`}),t[182]=o,t[183]=J);let Y;t[184]!==E||t[185]!==J?(Y=(0,Q.jsx)(b,{type:`button`,variant:`outline`,disabled:E,onClick:q,children:J}),t[184]=E,t[185]=J,t[186]=Y):Y=t[186];let X;t[187]!==o||t[188]!==E?(X=o(E?{id:`_DwR-n`}:{id:`cuHhjo`}),t[187]=o,t[188]=E,t[189]=X):X=t[189];let Z;t[190]!==E||t[191]!==X?(Z=(0,Q.jsx)(b,{type:`submit`,form:`create-saved-theme-form`,disabled:E,children:X}),t[190]=E,t[191]=X,t[192]=Z):Z=t[192];let $;t[193]!==Y||t[194]!==Z?($=(0,Q.jsxs)(ce,{children:[Y,Z]}),t[193]=Y,t[194]=Z,t[195]=$):$=t[195];let Pe;t[196]!==ve||t[197]!==N||t[198]!==P||t[199]!==W||t[200]!==$?(Pe=(0,Q.jsxs)(ve,{onCloseAutoFocus:N,children:[P,W,$]}),t[196]=ve,t[197]=N,t[198]=P,t[199]=W,t[200]=$,t[201]=Pe):Pe=t[201];let Fe;t[202]!==ye||t[203]!==Te||t[204]!==F||t[205]!==Pe?(Fe=(0,Q.jsx)(ye,{open:Te,onOpenChange:F,children:Pe}),t[202]=ye,t[203]=Te,t[204]=F,t[205]=Pe,t[206]=Fe):Fe=t[206];let Ie;return t[207]!==I||t[208]!==L||t[209]!==R||t[210]!==z||t[211]!==Fe?(Ie=(0,Q.jsxs)(`div`,{className:I,children:[L,R,z,Fe]}),t[207]=I,t[208]=L,t[209]=R,t[210]=z,t[211]=Fe,t[212]=Ie):Ie=t[212],Ie}function Xe(e){return e.id}function Ze(e){return e.id}function Qe(e){return e.id.startsWith(`saved-`)}function $e(e){let t=P(e.id);return!t.ok||!e.scheme?[]:[{id:e.id,stem:t.stem,label:e.label,scheme:e.scheme}]}function et(e){return e.id!==`custom`}function tt(e,t){if(e.length===0)throw Error(`buildPatch: path must be non-empty`);let[n,...r]=e;return r.length===0?{[String(n)]:t}:{[String(n)]:tt(r,t)}}function nt(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(e?.type===`default`){let t=e.defaultValue;return typeof t==`function`?t():t}let n=t?._zod?.def?.innerType;if(n===void 0)return;t=n}}function rt(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`default`||e.type===`optional`||e.type===`nullable`){t=e.innerType;continue}return e.type}}function it(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`enum`)return e.entries?Object.values(e.entries):void 0;if(e.innerType!==void 0){t=e.innerType;continue}return}}function at(e){let t=(0,K.c)(14),n;t[0]===e?n=t[1]:(n=e.current(),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i={defaultValues:r,mode:`onBlur`},t[2]=r,t[3]=i);let a=ke(i),o,s;t[4]!==e||t[5]!==a?(o=()=>e.subscribe(e=>{ot(a,e)}),s=[e,a],t[4]=e,t[5]=a,t[6]=o,t[7]=s):(o=t[6],s=t[7]),(0,G.useEffect)(o,s);let c;t[8]!==e||t[9]!==a?(c=t=>st(a,e,t),t[8]=e,t[9]=a,t[10]=c):c=t[10];let l=c,u;return t[11]!==l||t[12]!==a?(u={form:a,commitField:l},t[11]=l,t[12]=a,t[13]=u):u=t[13],u}function ot(e,t){e.reset(t,{keepDirtyValues:!0,keepDirty:!0,keepTouched:!0})}function st(e,t,n){let r=e.getValues(n),i=tt(ut(n),r),a=t.patch(i);if(a.ok)return e.clearErrors(n),e.resetField(n,{defaultValue:r,keepError:!1}),!0;if(C(a.error)&&a.error.code===`SCHEMA_INVALID`&&a.error.issues.length>0){e.clearErrors(n);for(let t of a.error.issues){let r=t.path.length>0?t.path.map(String).join(`.`):n;e.setError(r,{type:`config-binding`,message:t.message})}}else e.setError(n,{type:`config-binding`,message:ct(a.error,n)});return!1}function ct(e,t){if(C(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>lt(e,t));if(n)return n.message}return S(e)}function lt(e,t){return e.path.map(String).join(`.`)===t}function ut(e){return e.split(`.`)}function dt(e){if(!C(e)||e.code!==`SCHEMA_INVALID`)return null;let t=e.issues[0];return!t||t.path.length===0?null:t.path.map(String).join(`.`)}function ft(){let e=(0,K.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(W,{className:`h-5 w-32`}),n=(0,Q.jsx)(W,{className:`h-4 w-64`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[t,n,(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(W,{className:`h-9 w-full`}),(0,Q.jsx)(W,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function pt({field:e,scope:t,commitField:n,isFlashed:o}){"use no memo";let{_:d}=i(),f=B(),{setTheme:p}=a(),m=T(),h=F(I,e.path),g=h?rt(h):void 0,_=h?nt(h):void 0,v=h?it(h):void 0,y=h?Te(h):void 0,x=y?.scope===`project`&&t!==`project`||y?.scope===`user`&&t!==`user`,S=e.path.join(`.`),C=d(e.label),[w,D]=(0,G.useState)(!1),O=(0,G.useRef)(null);(0,G.useEffect)(()=>()=>{O.current&&clearTimeout(O.current)},[]);let ee=()=>{D(!0),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>D(!1),1200)},te=()=>{let e=n(S);return e&&ee(),e},k=()=>f.getFieldState(S).isDirty?te():!0,A=()=>{if(e.control===`theme-tiles`){let e=m?.userBinding;if(!e)return;let t=e.patch({appearance:be()});t.ok?ee():f.setError(S,{type:`manual`,message:ct(t.error,S)});return}let t=_===void 0?null:_;f.setValue(S,t,{shouldDirty:!1}),e.control===`theme-cards`&&p(E(t)),te()},j=s(`relative`,o&&`animate-settings-flash`);return(0,Q.jsx)(Ae,{control:f.control,name:S,render:({field:n})=>{let i=!x&&(_!==void 0||n.value!==void 0);return(0,Q.jsxs)(Oe,{className:j,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsx)(Me,{className:`text-sm font-medium`,children:C}),i?(0,Q.jsxs)(u,{children:[(0,Q.jsx)(c,{asChild:!0,children:(0,Q.jsx)(b,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:A,"aria-label":d({id:`lhjq3G`,values:{labelText:C}}),children:(0,Q.jsx)(M,{className:`size-3.5`})})}),(0,Q.jsx)(l,{children:(0,Q.jsx)(r,{id:`L-rMC9`})})]}):null]}),e.description?(0,Q.jsx)(V,{className:`text-muted-foreground text-1sm`,children:d(e.description)}):null,(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(je,{children:(0,Q.jsx)(ht,{field:e,ctl:n,typeTag:g,enumOptions:v,onCommit:k,onRevertToBaseline:()=>f.resetField(S,{keepError:!0}),onSavedOutsideForm:ee,onWriteRejected:e=>{f.setError(S,{type:`manual`,message:ct(e,S)})}})}),(0,Q.jsx)(yt,{visible:w,srOnly:mt(e.control)})]}),(0,Q.jsx)(H,{"data-field-error":e.path.join(`.`)})]})}})}function mt(e){return e===`theme-tiles`||e===`theme-cards`}function ht({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:o,onRevertToBaseline:s,onSavedOutsideForm:c,onWriteRejected:l,...u}){"use no memo";let{_:d}=i(),{setTheme:f,systemTheme:p}=a(),m=T(),h=m?.merged??null;if(e.control===`language-select`)return(0,Q.jsx)(Re,{...u,value:t.value,ref:t.ref,onBlur:t.onBlur,onValueChange:e=>{let n=R(t.value)??`system`;n!==e&&J({from:n,to:e}),t.onChange(e),o()}});if(e.control===`theme-cards`){let{id:n,...r}=u;return(0,Q.jsx)(k,{...r,firstItemId:n,value:E(t.value),"aria-label":d(e.label),onValueChange:e=>{let n=E(t.value);f(e),t.onChange(e),!o()&&(f(n),s())}})}if(e.control===`theme-tiles`){let{id:t,...n}=u,r=h?.appearance?.customTheme,i=h?.appearance?.theme,a=N(i,p===`dark`);return(0,Q.jsx)(Ye,{...n,firstItemId:t,appearance:h?.appearance,customSeed:r,slotMode:a,"aria-label":d(e.label),onAssign:(e,t,n,o)=>{let s=m?.userBinding;if(!s)return;let u={...n,[e]:t},d=e=>{let t=e[a];return t===`custom`?_e(xe(r)):he(t,o)};ye({selection:u,modePreference:i,slotMode:a,customSeed:r,themes:o}),f(d(u)??i??`system`);let p=s.patch({appearance:Se(u)});if(p.ok){Z(u),c();return}ye({selection:n,modePreference:i,slotMode:a,customSeed:r,themes:o}),f(d(n)??i??`system`),l(p.error)}})}if(n===`boolean`)return(0,Q.jsx)(g,{...u,checked:!!t.value,ref:t.ref,onCheckedChange:e=>{t.onChange(e),o()},onBlur:t.onBlur});if(n===`enum`&&r&&r.length>0&&(e.control===`enum-toggle`||r.length<=4)){let{id:n,...i}=u;return(0,Q.jsx)(y,{...i,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(t.onChange(e),o())},onBlur:t.onBlur,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-lg`,"aria-label":d(e.label),children:r.map((e,t)=>(0,Q.jsx)(_,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,Q.jsx)(_t,{ctl:t,onCommit:o,...u}):n===`array`?(0,Q.jsx)(vt,{ctl:t,onCommit:o,...u}):(0,Q.jsx)(gt,{ctl:t,onCommit:o,...u})}function gt({ctl:e,onCommit:t,...n}){"use no memo";return(0,Q.jsx)(Ne,{...n,value:typeof e.value==`string`?e.value:``,ref:e.ref,onChange:t=>e.onChange(t.target.value),onBlur:()=>{e.onBlur(),t()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),t())},className:`h-8 text-sm`})}function _t({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,G.useState)(e.value===void 0?``:String(e.value)),a=(0,G.useRef)(e.value);(0,G.useEffect)(()=>{a.current!==e.value&&(i(e.value===void 0?``:String(e.value)),a.current=e.value)},[e.value]);let o=()=>{let n=Number(r);if(!Number.isFinite(n)){e.onChange(r),t();return}e.onChange(n),t(),a.current=n};return(0,Q.jsx)(Ne,{...n,type:`number`,value:r,ref:e.ref,onChange:e=>i(e.target.value),onBlur:()=>{e.onBlur(),o()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},className:`h-8 w-28 text-sm tabular-nums`})}function vt({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
2
2
  `):``,[i,a]=(0,G.useState)(r),o=(0,G.useRef)(r);(0,G.useEffect)(()=>{let t=Array.isArray(e.value)?e.value.join(`
3
3
  `):``;t!==o.current&&(a(t),o.current=t)},[e.value]);let s=()=>{let n=i.split(`
4
4
  `).map(e=>e.trim()).filter(e=>e.length>0);e.onChange(n),t(),o.current=n.join(`
@@ -1 +1 @@
1
- import{g as e,h as t,p as n,y as r}from"./constants-upload-CVKO8P4d.js";import{c as i,l as a,u as o}from"./doc-hash-BJkweiX9.js";import{c as s,l as c,s as l}from"./file-tree-utils-CiVz_BRk.js";import{i as u}from"./navigation-targets-DSSJ_2xi.js";import{t as d}from"./file-tree-rename-validation-DAMy4Ak1.js";var f=`application/x-open-knowledge-sidebar-item+json`,p={image:!0,video:!0,audio:!0,pdf:!0,text:!0,mermaid:!0,excalidraw:!0};function m(e){return JSON.stringify(e)}function h(e){return e?Array.from(e.types).includes(f):!1}function ee(e){return e.kind===`folder`?{target:{kind:`folder`,target:e.folderPath,folderPath:e.folderPath},hash:o(e.folderPath)}:e.kind===`asset`?{target:{kind:`asset`,target:e.assetPath,assetPath:e.assetPath,mediaKind:e.mediaKind},hash:i(e.assetPath)}:{target:u(e.docName,e.size)??{kind:`doc`,target:e.docName,docName:e.docName},hash:a(e.docName)}}function g(e){if(!e||!h(e))return null;let t=e.getData(f);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!_(n)||n.v!==1||typeof n.kind!=`string`)return null;if(n.kind===`doc`){if(typeof n.docName!=`string`||n.docName.length===0)return null;let e=n.size;return e!==null&&typeof e!=`number`?null:{v:1,kind:`doc`,docName:n.docName,size:e}}if(n.kind===`folder`)return typeof n.folderPath==`string`?{v:1,kind:`folder`,folderPath:n.folderPath}:null;if(n.kind===`asset`){if(typeof n.assetPath!=`string`||n.assetPath.length===0)return null;let e=n.mediaKind;return e!==null&&!v(e)?null:{v:1,kind:`asset`,assetPath:n.assetPath,mediaKind:e}}return null}function _(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function v(e){return typeof e==`string`&&Object.hasOwn(p,e)}var y=`.md`,b=/\.(md|mdx)$/i;function x(e,i=y){return b.test(e)||t(e)||n(e)||r(e)?e:`${e}${i}`}function S(e){return $(e).replace(b,``)}function C(e,t){let n=$(e),r=k(t),i=t.find(e=>s(e)&&A(e,r)===n)??t.find(e=>s(e)&&T(e)===n);if(i)return i.docName;let a=S(n);return t.find(e=>{let t=T(e);return t!==n&&b.test(t)&&S(t)===a})&&b.test(n)?n:a}function w(e,t){let n=k(t);return t.find(t=>A(t,n)===e)??t.find(t=>T(t)===e)}function T(e){return c(e)?O(e.path):l(e)?e.path:x(e.docName,e.docExt)}function E(e){let t=$(e).match(b);return t?`.${t[1].toLowerCase()}`:void 0}function D(e){return $(e)}function O(e){let t=$(e.trim());return t?`${t}/`:``}function te(e){return e.endsWith(`/`)?D(e):S(e)}function k(e){let t=new Map;for(let n of e){if(!s(n))continue;let e=n.docName.match(b);if(!e)continue;let r=n.docName.slice(0,-e[0].length),i=t.get(r);i?i.add(e[0]):t.set(r,new Set([e[0]]))}return t}function A(e,t){let n=T(e);if(!s(e))return n;let r=e.docName.match(b);if(!r)return n;let i=e.docName.slice(0,-r[0].length);return(t.get(i)?.size??0)>1?n:`${e.docName}${e.docExt??y}`}function j(e){let t=k(e),n=new Set,r=[];for(let i of e){let e=A(i,t);n.has(e)||(n.add(e),r.push(e))}return r}function M(e){return[...e].sort().join(`\0`)}function N(e){return M(j(e))}function P(e,t={}){let n=new Set;for(let r of e){let e=(c(r)||l(r)?r.path:r.docName).split(`/`).filter(Boolean);if(!t.includeOkFolders&&e.includes(`.ok`))continue;if(c(r)){let e=O(r.path);e&&n.add(e)}let i=c(r)?e.length:e.length-1;for(let t=1;t<=i;t++)n.add(`${e.slice(0,t).join(`/`)}/`)}return[...n].sort()}function F(e){if(!e)return[];let t=$(e.replace(b,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function I(e,t,n){let r=E(e);if(r)return r;let i=n.find(e=>s(e)&&e.docName===t);return i?i.docExt??y:Q(e).includes(`.`)?void 0:y}function L(e,t){let n=e.lastIndexOf(`/`),r=n===-1?``:e.slice(0,n+1),i=n===-1?e:e.slice(n+1),a=t.filter(e=>{if(!l(e)||!e.path.startsWith(r))return!1;let t=e.path.slice(r.length);return!t.includes(`/`)&&t.startsWith(`${i}.`)});return a.length===1?a[0].path:null}function R(e,t,n){if(E(e))return null;let r=n.find(e=>l(e)&&e.path===t);return r?r.path:Q(e).includes(`.`)?t:L(t,n)}function z(e,t){let n=e.kind===`directory`,r=n?D(e.path):C(e.path,t);if(n)return{kind:`folder`,name:$(Q(e.path)).replace(b,``),path:r,treePath:V(e.path,!0)};let i=R(e.path,r,t);if(i)return{kind:`asset`,name:$(Q(i)),path:i,treePath:i};let a=I(e.path,r,t);return{kind:`file`,name:$(Q(e.path)).replace(b,``),path:r,treePath:V(e.path,!1),docExt:a}}function B(e){return e.kind===`directory`?D(e.path):e.path}function V(e,t){return t?O(e):b.test(e)?e:`${e}${y}`}function H(e,t,n){let r=O(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${y}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function U(e,t){return e===`file`?V(t,!1):`${D(t)}/index${y}`}function W(e,t){return t.kind===`root`||t.directoryPath==null?Q(e):`${t.directoryPath}${Q(e)}`}function G(e,t){if(t)return D(O(e));let n=S(e),r=n.lastIndexOf(`/`);return r===-1?``:n.slice(0,r)}function K(e,t){let n=D(O(e));return n?`${n}/${t}`:t}function q(e,t,n){e.append(`parentDocName`,K(t,n)),e.append(`placement`,`parent-dir`)}function J(e,t){return(t.path??K(e,t.src)).replace(/^\/+/,``)}function Y(e){let t=e.dataTransfer?.types;if(!t)return!1;let n=Array.from(t);return n.includes(`Files`)&&!n.includes(`application/x-open-knowledge-sidebar-item+json`)}function X(e){return Array.from(e.dataTransfer?.files??[]).filter(e=>e.name.length>0||e.size>0)}function Z(t,n){let r=d(t).toLowerCase();if(r===``)return null;let i=new Date().toISOString();if(r===`.md`||r===`.mdx`)return{kind:`document`,docName:S(t),docExt:r,modified:i,size:n.size};let a=r.startsWith(`.`)?r.slice(1):r;return{kind:`asset`,path:t,assetExt:a,mediaKind:e(a),modified:i,size:n.size}}function Q(e){let t=$(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function $(e){return e.endsWith(`/`)?e.slice(0,-1):e}export{g as A,z as C,f as D,J as E,h as O,C as S,te as T,G as _,U as a,D as b,j as c,T as d,X as f,V as g,Y as h,W as i,m as j,ee as k,N as l,O as m,P as n,H as o,w as p,F as r,x as s,q as t,Z as u,B as v,M as w,S as x,L as y};
1
+ import{g as e,h as t,p as n,y as r}from"./constants-upload-CVKO8P4d.js";import{c as i,l as a,u as o}from"./doc-hash-BJkweiX9.js";import{c as s,l as c,s as l}from"./file-tree-utils-CiVz_BRk.js";import{i as u}from"./navigation-targets-wIVrXum1.js";import{t as d}from"./file-tree-rename-validation-Cpa_Vek-.js";var f=`application/x-open-knowledge-sidebar-item+json`,p={image:!0,video:!0,audio:!0,pdf:!0,text:!0,mermaid:!0,excalidraw:!0};function m(e){return JSON.stringify(e)}function h(e){return e?Array.from(e.types).includes(f):!1}function ee(e){return e.kind===`folder`?{target:{kind:`folder`,target:e.folderPath,folderPath:e.folderPath},hash:o(e.folderPath)}:e.kind===`asset`?{target:{kind:`asset`,target:e.assetPath,assetPath:e.assetPath,mediaKind:e.mediaKind},hash:i(e.assetPath)}:{target:u(e.docName,e.size)??{kind:`doc`,target:e.docName,docName:e.docName},hash:a(e.docName)}}function g(e){if(!e||!h(e))return null;let t=e.getData(f);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!_(n)||n.v!==1||typeof n.kind!=`string`)return null;if(n.kind===`doc`){if(typeof n.docName!=`string`||n.docName.length===0)return null;let e=n.size;return e!==null&&typeof e!=`number`?null:{v:1,kind:`doc`,docName:n.docName,size:e}}if(n.kind===`folder`)return typeof n.folderPath==`string`?{v:1,kind:`folder`,folderPath:n.folderPath}:null;if(n.kind===`asset`){if(typeof n.assetPath!=`string`||n.assetPath.length===0)return null;let e=n.mediaKind;return e!==null&&!v(e)?null:{v:1,kind:`asset`,assetPath:n.assetPath,mediaKind:e}}return null}function _(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function v(e){return typeof e==`string`&&Object.hasOwn(p,e)}var y=`.md`,b=/\.(md|mdx)$/i;function x(e,i=y){return b.test(e)||t(e)||n(e)||r(e)?e:`${e}${i}`}function S(e){return $(e).replace(b,``)}function C(e,t){let n=$(e),r=k(t),i=t.find(e=>s(e)&&A(e,r)===n)??t.find(e=>s(e)&&T(e)===n);if(i)return i.docName;let a=S(n);return t.find(e=>{let t=T(e);return t!==n&&b.test(t)&&S(t)===a})&&b.test(n)?n:a}function w(e,t){let n=k(t);return t.find(t=>A(t,n)===e)??t.find(t=>T(t)===e)}function T(e){return c(e)?O(e.path):l(e)?e.path:x(e.docName,e.docExt)}function E(e){let t=$(e).match(b);return t?`.${t[1].toLowerCase()}`:void 0}function D(e){return $(e)}function O(e){let t=$(e.trim());return t?`${t}/`:``}function te(e){return e.endsWith(`/`)?D(e):S(e)}function k(e){let t=new Map;for(let n of e){if(!s(n))continue;let e=n.docName.match(b);if(!e)continue;let r=n.docName.slice(0,-e[0].length),i=t.get(r);i?i.add(e[0]):t.set(r,new Set([e[0]]))}return t}function A(e,t){let n=T(e);if(!s(e))return n;let r=e.docName.match(b);if(!r)return n;let i=e.docName.slice(0,-r[0].length);return(t.get(i)?.size??0)>1?n:`${e.docName}${e.docExt??y}`}function j(e){let t=k(e),n=new Set,r=[];for(let i of e){let e=A(i,t);n.has(e)||(n.add(e),r.push(e))}return r}function M(e){return[...e].sort().join(`\0`)}function N(e){return M(j(e))}function P(e,t={}){let n=new Set;for(let r of e){let e=(c(r)||l(r)?r.path:r.docName).split(`/`).filter(Boolean);if(!t.includeOkFolders&&e.includes(`.ok`))continue;if(c(r)){let e=O(r.path);e&&n.add(e)}let i=c(r)?e.length:e.length-1;for(let t=1;t<=i;t++)n.add(`${e.slice(0,t).join(`/`)}/`)}return[...n].sort()}function F(e){if(!e)return[];let t=$(e.replace(b,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function I(e,t,n){let r=E(e);if(r)return r;let i=n.find(e=>s(e)&&e.docName===t);return i?i.docExt??y:Q(e).includes(`.`)?void 0:y}function L(e,t){let n=e.lastIndexOf(`/`),r=n===-1?``:e.slice(0,n+1),i=n===-1?e:e.slice(n+1),a=t.filter(e=>{if(!l(e)||!e.path.startsWith(r))return!1;let t=e.path.slice(r.length);return!t.includes(`/`)&&t.startsWith(`${i}.`)});return a.length===1?a[0].path:null}function R(e,t,n){if(E(e))return null;let r=n.find(e=>l(e)&&e.path===t);return r?r.path:Q(e).includes(`.`)?t:L(t,n)}function z(e,t){let n=e.kind===`directory`,r=n?D(e.path):C(e.path,t);if(n)return{kind:`folder`,name:$(Q(e.path)).replace(b,``),path:r,treePath:V(e.path,!0)};let i=R(e.path,r,t);if(i)return{kind:`asset`,name:$(Q(i)),path:i,treePath:i};let a=I(e.path,r,t);return{kind:`file`,name:$(Q(e.path)).replace(b,``),path:r,treePath:V(e.path,!1),docExt:a}}function B(e){return e.kind===`directory`?D(e.path):e.path}function V(e,t){return t?O(e):b.test(e)?e:`${e}${y}`}function H(e,t,n){let r=O(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${y}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function U(e,t){return e===`file`?V(t,!1):`${D(t)}/index${y}`}function W(e,t){return t.kind===`root`||t.directoryPath==null?Q(e):`${t.directoryPath}${Q(e)}`}function G(e,t){if(t)return D(O(e));let n=S(e),r=n.lastIndexOf(`/`);return r===-1?``:n.slice(0,r)}function K(e,t){let n=D(O(e));return n?`${n}/${t}`:t}function q(e,t,n){e.append(`parentDocName`,K(t,n)),e.append(`placement`,`parent-dir`)}function J(e,t){return(t.path??K(e,t.src)).replace(/^\/+/,``)}function Y(e){let t=e.dataTransfer?.types;if(!t)return!1;let n=Array.from(t);return n.includes(`Files`)&&!n.includes(`application/x-open-knowledge-sidebar-item+json`)}function X(e){return Array.from(e.dataTransfer?.files??[]).filter(e=>e.name.length>0||e.size>0)}function Z(t,n){let r=d(t).toLowerCase();if(r===``)return null;let i=new Date().toISOString();if(r===`.md`||r===`.mdx`)return{kind:`document`,docName:S(t),docExt:r,modified:i,size:n.size};let a=r.startsWith(`.`)?r.slice(1):r;return{kind:`asset`,path:t,assetExt:a,mediaKind:e(a),modified:i,size:n.size}}function Q(e){let t=$(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function $(e){return e.endsWith(`/`)?e.slice(0,-1):e}export{g as A,z as C,f as D,J as E,h as O,C as S,te as T,G as _,U as a,D as b,j as c,T as d,X as f,V as g,Y as h,W as i,m as j,ee as k,N as l,O as m,P as n,H as o,w as p,F as r,x as s,q as t,Z as u,B as v,M as w,S as x,L as y};
@@ -0,0 +1 @@
1
+ import"./src-CP90en3s.js";import"./chunk-I66GZJ75-CJhve8_m.js";import"./chunk-NSK5VX7P-CcEZtfre.js";import"./chunk-ZIRB5QZD-BC43nZIY.js";import"./chunk-W5SLKNZC-Dw_hS9zr.js";import"./chunk-UBXNYLIW-CGvZjPjz.js";import"./chunk-4I5QYGJK-BvE0r05N.js";import"./chunk-WRU74C26-Ct6yd0-T.js";import"./chunk-QR6OTTB3-qF4HoiE9.js";import"./chunk-7BUUIJ7U-2u7V-5wt.js";import"./chunk-7Z6QIM7H-rwCNkfVu.js";import"./chunk-J7OUQ5F2-DS7HkZLi.js";import"./chunk-2GRJ4B5K-ClzGKqzp.js";import"./chunk-XXDRQBXY-TtItiY2c.js";import"./chunk-KBJHAD2P-DK3QrMpY.js";import{n as e}from"./chunk-JQJVKLGR-CHVgYkog.js";export{e as diagram};