@forsion/unit 2.12.2 → 2.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/README.md +61 -0
  2. package/backendWorker.mjs +6 -2
  3. package/main.mjs +991 -497
  4. package/package.json +1 -1
  5. package/release.json +5 -5
  6. package/web/assets/ArtificialView-XwHMLUFb.js +1 -0
  7. package/web/assets/{AutomationBuilder-sxWdUa0L.js → AutomationBuilder-hqs0QhMt.js} +1 -1
  8. package/web/assets/CalendarConfigView-DKib8Oed.js +1 -0
  9. package/web/assets/CalendarView-DJ5iOzvu.js +1 -0
  10. package/web/assets/CapabilityMenu-SwVlZ06x.js +1 -0
  11. package/web/assets/{CheckboxInput-BsaoUHZ0.js → CheckboxInput-BC-5a_C9.js} +1 -1
  12. package/web/assets/Chrome-HdfyYV3i.js +1 -0
  13. package/web/assets/{CodeView-j065KtVh.js → CodeView-CFL6yQ-6.js} +3 -3
  14. package/web/assets/DashboardGridView-B9DCWYVb.js +17 -0
  15. package/web/assets/{EventCard-BmDQkEj9.js → EventCard-B_ndpqH_.js} +1 -1
  16. package/web/assets/ExcalidrawCanvas-BQ4KKLJP.js +1 -0
  17. package/web/assets/{FloatingToc-CENybkAA.js → FloatingToc-Ce9GamvH.js} +1 -1
  18. package/web/assets/HomepageView-RCOfcVbE.js +1 -0
  19. package/web/assets/ImageStudioPanels-lkS_y2uM.js +3 -0
  20. package/web/assets/ImageStudioView-UPv52acl.js +1 -0
  21. package/web/assets/InlineFiles-CQbQumkf.js +1 -0
  22. package/web/assets/MarkdownBlock--__nPQGh.css +1 -0
  23. package/web/assets/MarkdownBlock-CkqiwPXa.js +58 -0
  24. package/web/assets/ModelPill-CY-rU1RU.js +2 -0
  25. package/web/assets/MuseLibraryView-CtTHlVnT.js +2 -0
  26. package/web/assets/{MuseView-d-iBk3sc.js → MuseView-CC2A7MBs.js} +2 -2
  27. package/web/assets/{PageHistoryPanel-CR-k1AM7.js → PageHistoryPanel-KhKT1DLy.js} +2 -2
  28. package/web/assets/PdfAnnotator-C_kglLCA.css +1 -0
  29. package/web/assets/PdfAnnotator-DUyrgY-t.js +505 -0
  30. package/web/assets/{ProductView-u2aezVsl.js → ProductView-CgsIYZqD.js} +1 -1
  31. package/web/assets/RightPanel-BHDgqTFs.js +4 -0
  32. package/web/assets/RunLocationPicker-BE5mxnab.css +1 -0
  33. package/web/assets/RunLocationPicker-DBnXYV5B.js +38 -0
  34. package/web/assets/{SidebarRow-BuSkKH5q.js → SidebarRow-BAJxbMcx.js} +1 -1
  35. package/web/assets/{SketchCard-D87GADyG.js → SketchCard-BGYz-bXP.js} +5 -5
  36. package/web/assets/{StudioGuestSurface-BijU_EEb.js → StudioGuestSurface-lt6znmkl.js} +1 -1
  37. package/web/assets/{TodoListView-DPPVpPUn.js → TodoListView-DPKhee6i.js} +1 -1
  38. package/web/assets/{Tooltip-DY4ISA-e.js → Tooltip-ZxrDqN4p.js} +1 -1
  39. package/web/assets/UnifiedPage-BX6ZQL0h.js +68 -0
  40. package/web/assets/UnifiedPage-CWXc_mo1.css +1 -0
  41. package/web/assets/{amadeus-manual.en-DWaN2fPs.js → amadeus-manual.en-DzRWr4BL.js} +18 -18
  42. package/web/assets/{amadeus-manual.zh--7D5TS8X.js → amadeus-manual.zh-DW32DkL7.js} +18 -18
  43. package/web/assets/{appStore-Dg9WALEA.js → appStore-DWP8UET9.js} +208 -122
  44. package/web/assets/appStore-wtOILggO.css +1 -0
  45. package/web/assets/{arrow-up-right-CpQs92mu.js → arrow-up-right-DrCXuWS7.js} +1 -1
  46. package/web/assets/{astryxBridge-BZhaZPs4.js → astryxBridge-D-m4_kYt.js} +3 -3
  47. package/web/assets/automationListSource-C8BNy6RY.js +1 -0
  48. package/web/assets/book-open-OLNm7OaB.js +1 -0
  49. package/web/assets/{calendarNavStore-C7fGRpoH.js → calendarNavStore-Cylfvv3s.js} +1 -1
  50. package/web/assets/{canvasPrefs-BeG4oEgP.js → canvasPrefs-8taQ42Cz.js} +1 -1
  51. package/web/assets/chatBoxSurface-CIlzs45H.js +1 -0
  52. package/web/assets/{circle-question-mark-WL3vbp-Z.js → circle-question-mark-XbAFplz1.js} +1 -1
  53. package/web/assets/{circle-x-D7s-M5sB.js → circle-x-fcReAZaE.js} +1 -1
  54. package/web/assets/{client-BSKpsyAw.js → client-0MPbodA6.js} +1 -1
  55. package/web/assets/{code-xml-BALV9u_c.js → code-xml-Cuna8Kh4.js} +1 -1
  56. package/web/assets/{codeStudioStore-C2mWfm32.js → codeStudioStore-BBU62GTy.js} +1 -1
  57. package/web/assets/codingNavigation-CZB4v1ZW.css +1 -0
  58. package/web/assets/codingNavigation-DDlPpPk5.js +47 -0
  59. package/web/assets/{create-4xUyKtAF.js → create-BGtEfCcg.js} +4 -4
  60. package/web/assets/dashboardSurface-BYM3C7WG.js +1 -0
  61. package/web/assets/{deskCapture-Df701U8L.js → deskCapture-BiUCmqfc.js} +1 -1
  62. package/web/assets/{diff2html-BV-zCH4d.js → diff2html-BNp2FTbk.js} +1 -1
  63. package/web/assets/{docx-preview-DW4IyU_Q.js → docx-preview-CFznGVOU.js} +1 -1
  64. package/web/assets/{emoji-DGaxpCIu.js → emoji-6zl4yfOS.js} +1 -1
  65. package/web/assets/floatingTocSurface-DreXPCa6.js +1 -0
  66. package/web/assets/{foldActions-B7KByFdN.js → foldActions-05QcQziQ.js} +1 -1
  67. package/web/assets/folder-BpsfOHD4.js +1 -0
  68. package/web/assets/{folder-plus-D1TDb7k9.js → folder-plus-BeQHr4AZ.js} +1 -1
  69. package/web/assets/gestures-DQBCcK4y.js +1 -0
  70. package/web/assets/{hand-Crrw-nSn.js → hand-Bko7ms15.js} +1 -1
  71. package/web/assets/{hard-drive-BbyVSbfP.js → hard-drive-BpuI5ebj.js} +1 -1
  72. package/web/assets/i18n-ecQQxiMQ.css +1 -0
  73. package/web/assets/i18n.generated-BuLjnmY8.js +15 -0
  74. package/web/assets/imageStudio--KF9gwHA.css +1 -0
  75. package/web/assets/imageStudio-BLVNKmEG.js +2 -0
  76. package/web/assets/{index-DKhyDkGB.js → index-BF10xp_K.js} +1 -1
  77. package/web/assets/{index-C7U6T-k8.js → index-BHm6K743.js} +1 -1
  78. package/web/assets/{index-CF4RV4mh.js → index-BM2o7PeV.js} +90 -90
  79. package/web/assets/{index-Brik2pf9.js → index-BgnNNv3e.js} +1 -1
  80. package/web/assets/{index--drOLtq7.js → index-C0Gy2NQ6.js} +1 -1
  81. package/web/assets/{index-CflzrdSt.js → index-C1doZp5H.js} +1 -1
  82. package/web/assets/{index-SZ5waGAq.js → index-C4L6vjd_.js} +1 -1
  83. package/web/assets/{index-Cmr7gVZQ.js → index-CD3yIkOA.js} +1 -1
  84. package/web/assets/{index-BYsdKR_1.js → index-CJeUgjPU.js} +1 -1
  85. package/web/assets/{index-CzM-C2Sd.js → index-CLHoq1w-.js} +1 -1
  86. package/web/assets/{index-tAXBa_fN.js → index-CUZI62qU.js} +1 -1
  87. package/web/assets/{index-C6GJulug.js → index-Cff42k7q.js} +1 -1
  88. package/web/assets/index-Ck_O3Jdd.js +1 -0
  89. package/web/assets/index-CuiYK18N.js +1 -0
  90. package/web/assets/{index-BRW82CsP.js → index-CwcOeZdT.js} +1 -1
  91. package/web/assets/{index-DUWR2nZi.js → index-D6AycQIz.js} +1 -1
  92. package/web/assets/{index-BCZZVJ_w.js → index-D7gVhvNY.js} +1 -1
  93. package/web/assets/{index-DjzSBM0U.js → index-D9UZQy42.js} +1 -1
  94. package/web/assets/{index-KL5Rj9kP.js → index-DuBQ0j2g.js} +1 -1
  95. package/web/assets/{index-Dg9oixs4.js → index-OD1gSX3h.js} +1 -1
  96. package/web/assets/{index-gPSbFSUn.js → index-Uo5tswys.js} +1 -1
  97. package/web/assets/{index-D1f_JwPH.js → index-o8cj0pRH.js} +1 -1
  98. package/web/assets/{index-OHi69jDq.js → index-rHjhbwvm.js} +1 -1
  99. package/web/assets/{index-CqyM6tQ0.js → index-rggq2czF.js} +1 -1
  100. package/web/assets/{index-Czu_bbDM.js → index-sCXThwqZ.js} +1 -1
  101. package/web/assets/{invitePage-lLQ-e0pj.js → invitePage-b0HGvMj6.js} +1 -1
  102. package/web/assets/{ipc-DQOD2UKk.js → ipc-CxAyeo8q.js} +1 -1
  103. package/web/assets/{jszip.min-DZxV9uZ_.js → jszip.min-B94KpE21.js} +1 -1
  104. package/web/assets/launchpad-C2c1MSVX.css +1 -0
  105. package/web/assets/{layout-grid-B_pjJwz4.js → layout-grid-BBVuEdWG.js} +1 -1
  106. package/web/assets/{linkFollow-C0_3k_PC.js → linkFollow-B7ivDZMM.js} +4 -4
  107. package/web/assets/{list-tree-DkAJYEXd.js → list-tree-4-0QDbLu.js} +1 -1
  108. package/web/assets/{listFold-BsOVn9UZ.js → listFold-DLuxXiIj.js} +1 -1
  109. package/web/assets/{lock-BnGHxjeE.js → lock-CnbZm4vo.js} +1 -1
  110. package/web/assets/{log-out-DBuMeqik.js → log-out-BEynWaHa.js} +1 -1
  111. package/web/assets/{main-NgUPPqDn.css → main-BiS_5wrB.css} +1 -1
  112. package/web/assets/main-sIq2N9Z5.js +20 -0
  113. package/web/assets/markdownEditorSurface-ZSJ3RHAv.js +3 -0
  114. package/web/assets/mdMarkStore-DQHDjG7s.js +2 -0
  115. package/web/assets/{mdMarks-Bq7Hl-4C.js → mdMarks-DbIcRa0O.js} +1 -1
  116. package/web/assets/{message-square-plus-BiAZAvcw.js → message-square-plus-CpiKDvle.js} +1 -1
  117. package/web/assets/{messages-BH5MfQdZ.js → messages-_jta1lSI.js} +1 -1
  118. package/web/assets/minus-C9ndHJ9O.js +1 -0
  119. package/web/assets/mobileEntry-CPmU_c4m.js +13 -0
  120. package/web/assets/nativeDownload-BYT082bY.js +1 -0
  121. package/web/assets/{pageChrome-xLNdFaSg.css → pageChrome-CovzZPdb.css} +1 -1
  122. package/web/assets/pageChrome-D3Niv1JM.js +1 -0
  123. package/web/assets/{pageTree-CZH2J6cc.js → pageTree-CgfvpzIj.js} +2 -2
  124. package/web/assets/{pen-tool-lkmBqliH.js → pen-tool-BXEFnU2i.js} +1 -1
  125. package/web/assets/{pencil-Cvk91P_Z.js → pencil-cqvCkekG.js} +1 -1
  126. package/web/assets/pluginChat-BbBukMuN.js +2 -0
  127. package/web/assets/{redo-2-DSi54z4e.js → redo-2-BO7wCDwy.js} +1 -1
  128. package/web/assets/{rotate-ccw-CUlnplr0.js → rotate-ccw-BvipPIjC.js} +1 -1
  129. package/web/assets/{sharePage-MM6UpPJ9.js → sharePage-XbN50US7.js} +2 -2
  130. package/web/assets/{shareViewer-CDZ8lTdy.js → shareViewer-BaYogetW.js} +1 -1
  131. package/web/assets/{star-CwDiGyUW.js → star-BQWMXnn7.js} +1 -1
  132. package/web/assets/tableSurface-BXqqidd1.js +1 -0
  133. package/web/assets/{terminal-DIXogYJY.js → terminal-l9k6RDrH.js} +1 -1
  134. package/web/assets/{terminalView-B3aZSsrQ.js → terminalView-Cpnt5_0P.js} +1 -1
  135. package/web/assets/theme-C6D3tMGV.css +1 -0
  136. package/web/assets/type-CFoaj2eD.js +1 -0
  137. package/web/assets/{undo-2-tUKCv5Gs.js → undo-2-DusxpdLa.js} +1 -1
  138. package/web/assets/{unitAccount-D8lVwaaT.js → unitAccount-DwutFPPw.js} +1 -1
  139. package/web/assets/{unitBridge-D547ublk.js → unitBridge-CcgQpkqV.js} +1 -1
  140. package/web/assets/{unitCloudTransport-BVF6lVp4.js → unitCloudTransport-vA7cLDts.js} +1 -1
  141. package/web/assets/{unitOwnerAccess-BfnEjsZb.js → unitOwnerAccess-LBlJ1YfA.js} +1 -1
  142. package/web/assets/{unitShim-DxetRgmP.js → unitShim-B_M9IrbC.js} +3 -3
  143. package/web/assets/{upload-BbeAsMuD.js → upload-ZrOj6tXA.js} +1 -1
  144. package/web/assets/userSpaces-uJOnsedR.js +1 -0
  145. package/web/assets/viewportLock-D3SNkwS2.js +631 -0
  146. package/web/assets/viewportLock-IP1zaVkz.css +1 -0
  147. package/web/assets/{workflow-DuoVRSSX.js → workflow-DPoG4QE2.js} +1 -1
  148. package/web/assets/{zoom-in-hr5bRpDL.js → zoom-in-lbTgzdQP.js} +1 -1
  149. package/web/index.html +232 -13
  150. package/web/assets/ArtificialView-B4ESD4iK.js +0 -1
  151. package/web/assets/CalendarConfigView-cCfo_EvZ.js +0 -1
  152. package/web/assets/CalendarView-wgLapctk.js +0 -1
  153. package/web/assets/CapabilityMenu-BQBsM638.js +0 -1
  154. package/web/assets/ChatView-BIUk0OJd.css +0 -1
  155. package/web/assets/ChatView-C-jCJnyS.js +0 -47
  156. package/web/assets/Chrome-CwFiDmre.js +0 -1
  157. package/web/assets/DashboardGridView-DXqe0vPd.js +0 -17
  158. package/web/assets/ExcalidrawCanvas-C3egkikA.js +0 -1
  159. package/web/assets/HomepageView-CRdhjLXu.js +0 -1
  160. package/web/assets/ImageStudioPanels-Dke7xf8E.js +0 -3
  161. package/web/assets/ImageStudioView-g38V8gaj.js +0 -1
  162. package/web/assets/InlineFiles-C_hjvn3u.js +0 -1
  163. package/web/assets/MarkdownBlock-DIjYEhTK.js +0 -56
  164. package/web/assets/ModelPill-BPlgovPo.js +0 -1
  165. package/web/assets/MuseLibraryView-CenyTTim.js +0 -2
  166. package/web/assets/PdfAnnotator-CGzC_o1Q.css +0 -1
  167. package/web/assets/PdfAnnotator-D79ip27w.js +0 -560
  168. package/web/assets/RightPanel-C3OJTIqT.js +0 -4
  169. package/web/assets/RunLocationPicker-BNcZ7KKF.css +0 -1
  170. package/web/assets/RunLocationPicker-CTYXUH2z.js +0 -34
  171. package/web/assets/UnifiedPage-CKNtVD_n.js +0 -57
  172. package/web/assets/UnifiedPage-DX_sTpyZ.css +0 -1
  173. package/web/assets/appStore-Di8LXuJ9.css +0 -1
  174. package/web/assets/automationListSource-DP5xZBxo.js +0 -1
  175. package/web/assets/chatBoxSurface-zvcyfrxE.js +0 -1
  176. package/web/assets/dashboardSurface-CFTH5z4c.js +0 -1
  177. package/web/assets/ellipsis-r1EcXsFq.js +0 -1
  178. package/web/assets/floatingTocSurface-C6RJ6i41.js +0 -1
  179. package/web/assets/folder-DlxnPmWY.js +0 -1
  180. package/web/assets/frame-_xBVYe3P.js +0 -1
  181. package/web/assets/gestures-CkW1Kfs9.js +0 -1
  182. package/web/assets/i18n-D-eU58uw.css +0 -1
  183. package/web/assets/i18n.generated-Bbsz16cl.js +0 -15
  184. package/web/assets/imageStudio-BqbNOvpu.css +0 -1
  185. package/web/assets/imageStudio-C_Rs630L.js +0 -2
  186. package/web/assets/index-BCubCwdT.js +0 -1
  187. package/web/assets/index-DZfZTksa.js +0 -1
  188. package/web/assets/main-Dki8NlsT.js +0 -21
  189. package/web/assets/markdownEditorSurface-B4PeUzed.js +0 -3
  190. package/web/assets/mdMarkStore-CsKl7C8O.js +0 -2
  191. package/web/assets/minus-Cyv1YzOU.js +0 -1
  192. package/web/assets/mobileEntry-Bd_nKr0D.js +0 -13
  193. package/web/assets/nativeDownload-D-f1_L2S.js +0 -1
  194. package/web/assets/pageChrome-C9_azUYW.js +0 -1
  195. package/web/assets/panel-left-rOc8As0s.js +0 -1
  196. package/web/assets/pen-line-m6_HvWZ9.js +0 -1
  197. package/web/assets/sticky-note-BIuPUSOU.js +0 -1
  198. package/web/assets/tableSurface-Y_JBQsuz.js +0 -1
  199. package/web/assets/theme-DfEi_DND.css +0 -1
  200. package/web/assets/type-Cqoabh7H.js +0 -1
  201. package/web/assets/userSpaces-DyyAn7vj.js +0 -1
  202. package/web/assets/viewportLock-C4SX-9PO.js +0 -103
  203. package/web/assets/viewportLock-DYSe7Jsn.css +0 -1
  204. package/web/assets/waves-horizontal-B8ZpHQ5H.js +0 -1
@@ -1,9 +1,9 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./appStore-Dg9WALEA.js","./nativeDownload-D-f1_L2S.js","./ipc-DQOD2UKk.js","./client-BSKpsyAw.js","./appStore-Di8LXuJ9.css","./invitePage-lLQ-e0pj.js","./mobileEntry-Bd_nKr0D.js","./viewportLock-C4SX-9PO.js","./UnifiedPage-CKNtVD_n.js","./MarkdownBlock-DIjYEhTK.js","./index-BCubCwdT.js","./linkFollow-C0_3k_PC.js","./mdMarks-Bq7Hl-4C.js","./emoji-DGaxpCIu.js","./listFold-BsOVn9UZ.js","./pageChrome-C9_azUYW.js","./upload-BbeAsMuD.js","./pageChrome-xLNdFaSg.css","./SketchCard-D87GADyG.js","./Chrome-CwFiDmre.js","./minus-Cyv1YzOU.js","./canvasPrefs-BeG4oEgP.js","./hand-Crrw-nSn.js","./sticky-note-BIuPUSOU.js","./type-Cqoabh7H.js","./frame-_xBVYe3P.js","./foldActions-B7KByFdN.js","./lock-BnGHxjeE.js","./code-xml-BALV9u_c.js","./undo-2-tUKCv5Gs.js","./message-square-plus-BiAZAvcw.js","./UnifiedPage-DX_sTpyZ.css","./panel-left-rOc8As0s.js","./ellipsis-r1EcXsFq.js","./RunLocationPicker-CTYXUH2z.js","./codeStudioStore-C2mWfm32.js","./RightPanel-C3OJTIqT.js","./folder-DlxnPmWY.js","./folder-plus-D1TDb7k9.js","./pencil-Cvk91P_Z.js","./ModelPill-BPlgovPo.js","./ModelPill-CzdNh7Mt.css","./create-4xUyKtAF.js","./create-BgE3edmZ.css","./approvalText-Cy2UAUAQ.js","./SidebarRow-BuSkKH5q.js","./SidebarRow-CsWEqPKX.css","./waves-horizontal-B8ZpHQ5H.js","./RunLocationPicker-BNcZ7KKF.css","./ChatView-C-jCJnyS.js","./pdf.worker.min-CGb3BKV9.js","./zoom-in-hr5bRpDL.js","./InlineFiles-C_hjvn3u.js","./terminal-DIXogYJY.js","./circle-x-D7s-M5sB.js","./circle-question-mark-WL3vbp-Z.js","./rotate-ccw-CUlnplr0.js","./FloatingToc-CENybkAA.js","./mdMarkStore-CsKl7C8O.js","./arrow-up-right-CpQs92mu.js","./ChatView-BIUk0OJd.css","./hard-drive-BbyVSbfP.js","./CapabilityMenu-BQBsM638.js","./CapabilityMenu-CTIzmTJB.css","./userSpaces-DyyAn7vj.js","./automationListSource-DP5xZBxo.js","./messages-BH5MfQdZ.js","./workflow-DuoVRSSX.js","./list-tree-DkAJYEXd.js","./layout-grid-B_pjJwz4.js","./star-CwDiGyUW.js","./DashboardGridView-DXqe0vPd.js","./pageTree-CZH2J6cc.js","./pluginExt-Byb64tQO.js","./pen-tool-lkmBqliH.js","./redo-2-DSi54z4e.js","./DashboardGridView-Ck3LKkOb.css","./AutomationBuilder-sxWdUa0L.js","./gestures-CkW1Kfs9.js","./MuseView-d-iBk3sc.js","./i18n.generated-Bbsz16cl.js","./i18n-D-eU58uw.css","./log-out-DBuMeqik.js","./index-DZfZTksa.js","./StudioGuestSurface-BijU_EEb.js","./viewportLock-DYSe7Jsn.css","./mobileEntry-DS1vohuL.css","./main-Dki8NlsT.js","./main-NgUPPqDn.css"])))=>i.map(i=>d[i]);
2
- function Sd(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in e)){const r=Object.getOwnPropertyDescriptor(i,s);r&&Object.defineProperty(e,s,r.get?r:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=n(s);fetch(s.href,r)}})();const xd="modulepreload",_d=function(e,t){return new URL(e,t).href},xo={},pt=function(t,n,i){let s=Promise.resolve();if(n&&n.length>0){let c=function(d){return Promise.all(d.map(u=>Promise.resolve(u).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");s=c(n.map(d=>{if(d=_d(d,i),d in xo)return;xo[d]=!0;const u=d.endsWith(".css"),p=u?'[rel="stylesheet"]':"";if(i)for(let m=o.length-1;m>=0;m--){const h=o[m];if(h.href===d&&(!u||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${d}"]${p}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":xd,u||(f.as="script"),f.crossOrigin="",f.href=d,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((m,h)=>{f.addEventListener("load",m),f.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${d}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return t().catch(r)})};let Xs;function Cd(e){Xs=e}function Oi(e){return Xs?`${e}:account:${encodeURIComponent(Xs)}`:e}function Ad(e,t){try{const n=new URL(e);if(n.protocol!=="https:"&&n.protocol!=="http:")return null;const i=t.split(".")[1];if(!i)return null;const s=i.replace(/-/g,"+").replace(/_/g,"/"),r=Uint8Array.from(atob(s),l=>l.charCodeAt(0)),o=JSON.parse(new TextDecoder().decode(r)),a=o.userId??o.sub;return typeof a!="string"&&typeof a!="number"||!String(a).trim()?null:`${n.origin}${n.pathname.replace(/\/+$/,"")}::${String(a)}`}catch{return null}}const er="forsion.cloudCacheAccount",Ed=e=>!e.includes(":account:")&&(e==="tangu2_named_layouts"||/^tangu2_layout_(?:v[34]|detached_.+)$/.test(e)||/^lcl_sc_(?:layout|named_layouts)_v1(?:_.+)?$/.test(e));function cl(){try{for(const e of Object.keys(localStorage))e.includes(":account:")||(e==="amadeus_tree_snap"||e==="amadeus.cloudVaultId"||e.startsWith("amadeus_last_page:")||e==="forsion.deskBySession"||e==="forsion_tangu_unread_sessions"||Ed(e))&&localStorage.removeItem(e);localStorage.removeItem(er)}catch{}}function Jn(e,t){return Ad(e,t)}function Hi(e,t){const n=Jn(e,t);Cd(n??`anonymous:${Date.now()}:${Math.random().toString(36).slice(2)}`);try{(!n||localStorage.getItem(er)!==n)&&cl(),n&&localStorage.setItem(er,n)}catch{}}class rn extends Error{constructor(){super("The account changed while the request was in progress"),this.name="AccountChangedError"}}class fi extends Error{constructor(t,n){super(n),this.status=t,this.name="AccountHttpError"}status}function Td(e){const t=new URL(e.apiBase,typeof location>"u"?void 0:location.href);if(!/^https?:$/.test(t.protocol)||t.username||t.password||t.search||t.hash)throw new Error("Invalid account API base");t.pathname=t.pathname.replace(/\/+$/,"")+"/";const n=t.href.replace(/\/$/,""),i=e.fetch??globalThis.fetch.bind(globalThis),s=e.tokenKey??"forsion_token",r=e.storage,o=new Set(e.onChange?[e.onChange]:[]),a=new Set(e.beforeChange?[e.beforeChange]:[]),l=new Set;let c=f(),d=null,u=0,p=Promise.resolve();function f(){if(!r)return"";try{return r.getItem(s)||""}catch{return""}}function m(){u++;for(const E of l)E.abort(new rn);l.clear()}function h(){if(r){const E=f();E!==c&&(m(),c=E,d=null)}return c}function y(E){const g=h(),z=E===void 0?d?!0:null:E;return{loggedIn:!!g&&z!==!1,tokenValid:g?z:null,cloudUrl:n,tokenSource:g?"tangu-login":null,username:d?.username??null,accountId:d?`${n}::${d.userId}`:null,...d??{}}}function w(){const E=y();for(const g of o)try{g(E)}catch(z){console.error("[account] Change listener failed:",z)}}function C(E,g){if(h()!==g||u!==E)throw new rn}function S(E){const g=p.then(E);return p=g.catch(()=>{}),g}const I=(e.allowedPaths??[]).map(E=>{const g=new URL(E,t);if(!E.startsWith("/")||E.startsWith("//")||E.includes("\\")||E.includes("%")||g.origin!==t.origin||g.search||g.hash||g.pathname!==E||E==="/")throw new Error("Invalid account request namespace");return E.replace(/\/+$/,"")}),O=(E,g)=>E===g||E.startsWith(g+"/"),k=E=>O(E,t.pathname.slice(0,-1))||I.some(g=>O(E,g));function T(E){const g=E.split(/[?#]/,1)[0];if(!E||E.startsWith("//")||g.includes("\\"))throw new Error("Request must stay inside the account API base");const z=I.some(Y=>O(g,Y)),q=/^[a-z][a-z\d+.-]*:/i.test(E)?new URL(E):new URL(z?E:E.replace(/^\//,""),t);let M;try{M=new URL(decodeURIComponent(q.pathname).replace(/\\/g,"/"),t.origin)}catch{throw new Error("Request must stay inside the account API base")}if(q.origin!==t.origin||q.username||q.password||q.hash||!k(q.pathname)||M.origin!==t.origin||!k(M.pathname))throw new Error("Request must stay inside the account API base");return q}const $=e.identityUrl?new URL(e.identityUrl,t):T("/auth/me");if($.origin!==t.origin||$.username||$.password||$.hash)throw new Error("Identity endpoint must use the account API origin");function W(E,g,z,q){const M=E.body?.getReader();let Y;const ue=()=>{Y&&q.removeEventListener("abort",Y),z()},de=M?new ReadableStream({start(Oe){Y=()=>{const Fe=q.reason??new rn;Oe.error(Fe),M.cancel(Fe).catch(()=>{}),ue()},q.addEventListener("abort",Y,{once:!0}),q.aborted&&Y()},async pull(Oe){try{g();const Fe=await M.read();g(),Fe.done?(Oe.close(),ue()):Oe.enqueue(Fe.value)}catch(Fe){Oe.error(Fe),M.cancel(Fe).catch(()=>{}),ue()}},async cancel(Oe){ue(),await M.cancel(Oe)}},{highWaterMark:0}):null;M||z();const ye=new Response(de,{status:E.status,statusText:E.statusText,headers:E.headers});Object.defineProperties(ye,{url:{value:E.url},redirected:{value:E.redirected},type:{value:E.type}});for(const Oe of["json","text","arrayBuffer","blob","formData"]){const Fe=ye[Oe].bind(ye);Object.defineProperty(ye,Oe,{value:async()=>{g();const Yt=await Fe();return g(),Yt}})}const Ge=ye.clone.bind(ye);return Object.defineProperty(ye,"clone",{value:()=>(g(),W(Ge(),g,()=>{},q))}),ye}async function R(E,g={},z=h()){const q=h(),M=u,Y=new AbortController,ue=()=>{if(C(M,q),Y.signal.aborted)throw Y.signal.reason??new DOMException("The request was aborted","AbortError")},de=()=>Y.abort(g.signal?.reason);g.signal?.aborted?de():g.signal?.addEventListener("abort",de,{once:!0}),l.add(Y);const ye=()=>{l.delete(Y),g.signal?.removeEventListener("abort",de)},Ge=new Headers(g.headers);Ge.delete("Authorization"),z&&Ge.set("Authorization",`Bearer ${z}`);try{ue();const Oe=await i(E.href,{...g,headers:Ge,signal:Y.signal,redirect:"error",credentials:"omit",cache:"no-store"});return ue(),W(Oe,ue,ye,Y.signal)}catch(Oe){throw ye(),ue(),Oe}}function H(E,g){const z=new Headers(g?.headers).get("Authorization");if(z&&z!==`Bearer ${h()}`)throw new rn;return R(T(E),g)}function B(E){const g=E,z=g?.userId??g?.id;if(typeof z!="string"&&typeof z!="number"||!String(z).trim()||typeof g.username!="string"||!g.username)throw new Error("The account endpoint returned an invalid identity");return{userId:String(z),username:g.username,role:typeof g.role=="string"?g.role:"user",...typeof g.tenantId=="string"?{tenantId:g.tenantId}:{},...typeof g.workspaceId=="string"?{workspaceId:g.workspaceId}:{},nickname:typeof g.nickname=="string"?g.nickname:null,avatar:typeof g.avatar=="string"?g.avatar:null,membershipTier:typeof g.membershipTier=="string"?g.membershipTier:null}}async function te(E){const g=await R($,{},E);if(!g.ok)throw g.body?.cancel(),new fi(g.status,"Could not verify the account session");return B(await g.json())}async function ce(){const E=h(),g=u;if(!E)return y();try{const z=await te(E);return C(g,E),d=z,y(!0)}catch(z){if(C(g,E),z instanceof fi&&(z.status===401||z.status===403))return d=null,y(!1);if(z instanceof rn)throw z;return y(null)}}async function ne(){for(const E of a)await E()}function pe(E,g){r&&(E?r.setItem(s,E):r.removeItem(s)),m(),c=E,d=g,w()}async function me(E){if(!E.trim())throw new Error("An account token is required");const g=h(),z=u,q=await te(E);if(C(z,g),E===g)return d=q,y(!0);try{return await ne(),C(z,g),pe(E,q),y(!0)}catch(M){throw w(),M}}function we(E){return S(()=>me(E))}function ae(E){return S(async()=>{const g=await R(T("/auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(E)},"");if(!g.ok)throw g.body?.cancel(),new fi(g.status,"Account sign-in failed");const z=await g.json();if(typeof z?.token!="string")throw new Error("Sign-in did not return an account token");return me(z.token)})}function x(){const E=h(),g=u;return S(async()=>{C(g,E);const z=h(),q=u;if(z)try{await ne(),C(q,z);const M=await H("/auth/logout",{method:"POST"});if(!M.ok&&M.status!==401)throw M.body?.cancel(),new fi(M.status,"Account sign-out failed; the session was retained");if(M.ok&&M.status!==204){if((await M.json())?.ok!==!0)throw new Error("Account sign-out was not acknowledged; the session was retained")}else M.body?.cancel();C(q,z),pe("",null)}catch(M){throw w(),M}})}function A(E={}){const g=typeof E=="string"?E:E.expectedToken??h(),z=typeof E=="string"||E.prepare!==!1;return S(async()=>{if(h()===g)try{z&&await ne(),h()===g&&pe("",null)}catch(q){throw w(),q}})}return{getToken:h,getIdentity:()=>(h(),d?{...d}:null),get generation(){return h(),u},authStatus:ce,adoptToken:we,signIn:ae,login:(E,g)=>ae({username:E,password:g}),logout:x,clearSession:A,request:H,subscribe(E){return o.add(E),()=>{o.delete(E)}},beforeChange(E){return a.add(E),()=>{a.delete(E)}}}}function Id(e){const t=new URL(e.apiBase),n=t.pathname.replace(/\/+$/,"");return async(i,s)=>{const r=new URL(typeof i=="string"?i:i instanceof URL?i.href:i.url,location.href);if(!(r.origin===t.origin&&(r.pathname===n||r.pathname.startsWith(n+"/"))))return e.fallback(i,s);const a=e.getToken(),c=new Headers(s?.headers??(i instanceof Request?i.headers:void 0)).get("Authorization");if(c&&c!==`Bearer ${a}`)throw new rn;let d=s;if(i instanceof Request){const u=new Request(i,s);d={method:u.method,headers:u.headers,signal:u.signal,body:u.body,...u.body?{duplex:"half"}:{}}}return e.request(r.href,d)}}const ul="forsion_token";let pi;function vn(){if(!pi){let e;try{e=localStorage}catch{}pi=Td({apiBase:Sn(),storage:e,tokenKey:ul,onChange:()=>Hi(Sn(),pi?.getToken()||"")})}return pi}function ln(){return vn().getToken()}function Ut(e,t=!1){const n=e??location.origin+"./";location.replace("/auth?redirect="+encodeURIComponent(n)+"&app=tangu-web"+(t?"&logout=1":""))}async function dl(){const e=new URL(location.href),t=e.searchParams.get("token");if(!t)return!0;e.searchParams.delete("token"),history.replaceState(null,"",e.toString());try{return await vn().adoptToken(t),!0}catch{return Ut(void 0,!0),!1}}async function Pd(){if(!await dl())return!1;const e=ln();if(e){if((await vn().authStatus()).tokenValid!==!1)return Hi(Sn(),e),!0;await vn().clearSession(e)}return Ut(location.origin+location.pathname),!1}function _o(){return ln()}function Sn(){return(location.origin+"/api").replace(/\/$/,"")}function fl(){const e=vn(),t=e.getToken();e.clearSession({expectedToken:t,prepare:!1}).then(()=>{e.getToken()||(cl(),Ut(void 0,!0))}).catch(n=>console.error("[account] Could not leave the expired session:",n))}async function Od(){if(!await dl())return!1;const e=vn(),t=e.getToken();if(!t)return Ut(),!1;if((await e.authStatus()).tokenValid===!1)return await e.clearSession(t),Ut(void 0,!0),!1;const i=Sn(),s=i;Hi(i,t);const r=window.fetch.bind(window),o=e.authStatus,a=(p="?")=>{const f=ln();return f?`${p}token=${encodeURIComponent(f)}`:""},l=p=>{let f=!1;try{f=localStorage.getItem("lcl.uiMode")==="mobile"}catch{}f?location.href=p:window.open(p,"_blank","noopener")},c=async(p,f,m)=>{const h=ln();if(!h)return{status:401,json:null};try{const y=await e.request(f,{method:p,headers:{Authorization:`Bearer ${h}`,...m!==void 0?{"Content-Type":"application/json"}:{}},body:m!==void 0?JSON.stringify(m):void 0});return{status:y.status,json:await y.json().catch(()=>null)}}catch(y){return{status:0,json:{detail:String(y?.message||y)}}}};window.tangu={cloudWeb:!0,getConfig:async()=>({mode:"external",backendUrl:s,token:ln(),modelId:"",cloudUrl:i,cloudApiBase:i,sandbox:"none"}),authStatus:o,forsionLogin:async()=>{e.getToken()&&await e.logout(),Ut(void 0,!0)},forsionLogout:async()=>{await e.logout(),Ut(void 0,!0)},onAuthWillChange:e.beforeChange,onAuthChanged:e.subscribe,openAccountCenter:async p=>{const f=p&&/^[a-z0-9-]+$/i.test(p)?`#${p}`:"";return l(`/account/${a()}${f}`),{ok:!0}},openPayCenter:async()=>{const p=encodeURIComponent(location.origin+"/account/");return l(`/pay/?tab=membership${a("&")}&redirect=${p}`),{ok:!0}},accountQuota:()=>c("GET","/token-quota/my"),accountUseResetCard:p=>p!==void 0&&p!=="both"&&p!=="weekly"?Promise.resolve({status:400,json:{error:"invalid_type",detail:`invalid reset card type: ${p}`}}):c("POST","/token-quota/reset-card/use",{type:p??"both"})};const u=new URL(i).pathname.replace(/\/+$/,"");return window.fetch=Id({apiBase:i,getToken:e.getToken,fallback:r,request:async(p,f)=>{const m=e.getToken(),h=e.generation,y=await e.request(p,f),w=new URL(p);return m===e.getToken()&&h===e.generation&&y.status===401&&(w.pathname.startsWith(u+"/agent/")||w.pathname.startsWith(u+"/amadeus/"))&&fl(),y}}),window.addEventListener("storage",p=>{p.key!==ul||p.oldValue===p.newValue||(Hi(i,ln()),location.reload())}),!0}const $d="amadeus.page/3",Rd="3.0.0";let Nd=e=>crypto.getRandomValues(new Uint8Array(e)),Ld=(e,t,n)=>{let i=256-256%e.length;if(i===256){let r=e.length-1;return(o=t)=>{if(!o)return"";let a="";for(;;){let l=n(o),c=o;for(;c--;)if(a+=e[l[c]&r],a.length>=o)return a}}}let s=Math.ceil(1.6*256*t/i);return(r=t)=>{if(!r)return"";let o="";for(;;){let a=n(s),l=s;for(;l--;)if(a[l]<i&&(o+=e[a[l]%e.length],o.length>=r))return o}}},Fd=(e,t=21)=>Ld(e,t|0,Nd);const Dd="0123456789abcdefghijklmnopqrstuvwxyz",Or=Fd(Dd,8);function qi(e,t=1){let n=0;for(const i of e){const s=Number.parseInt(String(i),10);Number.isSafeInteger(s)&&String(s)===String(i)&&s>n&&(n=s)}return String(Math.max(n+1,t))}function zd(e,t){const n=Number.parseInt(String(t),10);return!Number.isSafeInteger(n)||String(n)!==String(t)?e:Math.max(e??0,n+1)}function pl(){return`pg_${Or()}`}function Md(){return`row_${Or()}`}function jd(){return`col_${Or()}`}function hl(e){const t=e.split(/[\\/]/).pop()??e,n=t.lastIndexOf(".");return n>0?t.slice(0,n):t}function ml(e){return e.split(/[\\/]/).pop()??e}const Bd=/^<!--\s*a\s+([A-Za-z0-9_-]+)\s*-->\s*$/,Ud=/^<!--\s*\/a\s+([A-Za-z0-9_-]+)\s*-->\s*$/;function Co(e){return`<!-- a ${e} -->`}function gl(e){const t=[];let n=null,i=[];const s=()=>{const r=i.join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./appStore-DWP8UET9.js","./nativeDownload-BYT082bY.js","./ipc-CxAyeo8q.js","./client-0MPbodA6.js","./appStore-wtOILggO.css","./invitePage-b0HGvMj6.js","./mobileEntry-CPmU_c4m.js","./viewportLock-D3SNkwS2.js","./UnifiedPage-BX6ZQL0h.js","./MarkdownBlock-CkqiwPXa.js","./index-CuiYK18N.js","./linkFollow-B7ivDZMM.js","./mdMarks-DbIcRa0O.js","./emoji-6zl4yfOS.js","./listFold-DLuxXiIj.js","./book-open-OLNm7OaB.js","./MarkdownBlock--__nPQGh.css","./pageChrome-D3Niv1JM.js","./upload-ZrOj6tXA.js","./pageChrome-CovzZPdb.css","./SketchCard-BGYz-bXP.js","./arrow-up-right-DrCXuWS7.js","./Chrome-HdfyYV3i.js","./minus-C9ndHJ9O.js","./canvasPrefs-8taQ42Cz.js","./hand-Bko7ms15.js","./type-CFoaj2eD.js","./foldActions-05QcQziQ.js","./lock-CnbZm4vo.js","./undo-2-DusxpdLa.js","./code-xml-Cuna8Kh4.js","./message-square-plus-CpiKDvle.js","./UnifiedPage-CWXc_mo1.css","./RunLocationPicker-DBnXYV5B.js","./codeStudioStore-BBU62GTy.js","./RightPanel-BHDgqTFs.js","./folder-plus-BeQHr4AZ.js","./folder-BpsfOHD4.js","./pencil-cqvCkekG.js","./ModelPill-CY-rU1RU.js","./ModelPill-CzdNh7Mt.css","./create-BGtEfCcg.js","./create-BgE3edmZ.css","./approvalText-Cy2UAUAQ.js","./SidebarRow-BAJxbMcx.js","./SidebarRow-CsWEqPKX.css","./RunLocationPicker-BE5mxnab.css","./codingNavigation-DDlPpPk5.js","./pdf.worker.min-CGb3BKV9.js","./zoom-in-lbTgzdQP.js","./InlineFiles-CQbQumkf.js","./terminal-l9k6RDrH.js","./circle-x-fcReAZaE.js","./circle-question-mark-XbAFplz1.js","./rotate-ccw-BvipPIjC.js","./FloatingToc-Ce9GamvH.js","./mdMarkStore-DQHDjG7s.js","./codingNavigation-CZB4v1ZW.css","./hard-drive-BpuI5ebj.js","./CapabilityMenu-SwVlZ06x.js","./CapabilityMenu-CTIzmTJB.css","./userSpaces-uJOnsedR.js","./automationListSource-C8BNy6RY.js","./messages-_jta1lSI.js","./workflow-DPoG4QE2.js","./list-tree-4-0QDbLu.js","./layout-grid-BBVuEdWG.js","./star-BQWMXnn7.js","./DashboardGridView-B9DCWYVb.js","./pageTree-CgfvpzIj.js","./pluginExt-Byb64tQO.js","./pen-tool-BXEFnU2i.js","./redo-2-BO7wCDwy.js","./DashboardGridView-Ck3LKkOb.css","./AutomationBuilder-hqs0QhMt.js","./gestures-DQBCcK4y.js","./MuseView-CC2A7MBs.js","./i18n.generated-BuLjnmY8.js","./i18n-ecQQxiMQ.css","./log-out-BEynWaHa.js","./index-Ck_O3Jdd.js","./StudioGuestSurface-lt6znmkl.js","./viewportLock-IP1zaVkz.css","./launchpad-C2c1MSVX.css","./mobileEntry-DS1vohuL.css","./main-sIq2N9Z5.js","./main-BiS_5wrB.css"])))=>i.map(i=>d[i]);
2
+ function Sd(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in e)){const r=Object.getOwnPropertyDescriptor(i,s);r&&Object.defineProperty(e,s,r.get?r:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=n(s);fetch(s.href,r)}})();const xd="modulepreload",_d=function(e,t){return new URL(e,t).href},xo={},ht=function(t,n,i){let s=Promise.resolve();if(n&&n.length>0){let c=function(d){return Promise.all(d.map(u=>Promise.resolve(u).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");s=c(n.map(d=>{if(d=_d(d,i),d in xo)return;xo[d]=!0;const u=d.endsWith(".css"),h=u?'[rel="stylesheet"]':"";if(i)for(let m=o.length-1;m>=0;m--){const p=o[m];if(p.href===d&&(!u||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${d}"]${h}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":xd,u||(f.as="script"),f.crossOrigin="",f.href=d,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((m,p)=>{f.addEventListener("load",m),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${d}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return t().catch(r)})};let Xs;function Cd(e){Xs=e}function Oi(e){return Xs?`${e}:account:${encodeURIComponent(Xs)}`:e}function Ad(e,t){try{const n=new URL(e);if(n.protocol!=="https:"&&n.protocol!=="http:")return null;const i=t.split(".")[1];if(!i)return null;const s=i.replace(/-/g,"+").replace(/_/g,"/"),r=Uint8Array.from(atob(s),l=>l.charCodeAt(0)),o=JSON.parse(new TextDecoder().decode(r)),a=o.userId??o.sub;return typeof a!="string"&&typeof a!="number"||!String(a).trim()?null:`${n.origin}${n.pathname.replace(/\/+$/,"")}::${String(a)}`}catch{return null}}const er="forsion.cloudCacheAccount",Td=e=>!e.includes(":account:")&&(e==="tangu2_named_layouts"||/^tangu2_layout_(?:v[34]|detached_.+)$/.test(e)||/^lcl_sc_(?:layout|named_layouts)_v1(?:_.+)?$/.test(e));function cl(){try{for(const e of Object.keys(localStorage))e.includes(":account:")||(e==="amadeus_tree_snap"||e==="amadeus.cloudVaultId"||e.startsWith("amadeus_last_page:")||e==="forsion.deskBySession"||e==="forsion_tangu_unread_sessions"||Td(e))&&localStorage.removeItem(e);localStorage.removeItem(er)}catch{}}function Jn(e,t){return Ad(e,t)}function Hi(e,t){const n=Jn(e,t);Cd(n??`anonymous:${Date.now()}:${Math.random().toString(36).slice(2)}`);try{(!n||localStorage.getItem(er)!==n)&&cl(),n&&localStorage.setItem(er,n)}catch{}}class rn extends Error{constructor(){super("The account changed while the request was in progress"),this.name="AccountChangedError"}}class fi extends Error{constructor(t,n){super(n),this.status=t,this.name="AccountHttpError"}status}function Ed(e){const t=new URL(e.apiBase,typeof location>"u"?void 0:location.href);if(!/^https?:$/.test(t.protocol)||t.username||t.password||t.search||t.hash)throw new Error("Invalid account API base");t.pathname=t.pathname.replace(/\/+$/,"")+"/";const n=t.href.replace(/\/$/,""),i=e.fetch??globalThis.fetch.bind(globalThis),s=e.tokenKey??"forsion_token",r=e.storage,o=new Set(e.onChange?[e.onChange]:[]),a=new Set(e.beforeChange?[e.beforeChange]:[]),l=new Set;let c=f(),d=null,u=0,h=Promise.resolve();function f(){if(!r)return"";try{return r.getItem(s)||""}catch{return""}}function m(){u++;for(const T of l)T.abort(new rn);l.clear()}function p(){if(r){const T=f();T!==c&&(m(),c=T,d=null)}return c}function y(T){const g=p(),z=T===void 0?d?!0:null:T;return{loggedIn:!!g&&z!==!1,tokenValid:g?z:null,cloudUrl:n,tokenSource:g?"tangu-login":null,username:d?.username??null,accountId:d?`${n}::${d.userId}`:null,...d??{}}}function w(){const T=y();for(const g of o)try{g(T)}catch(z){console.error("[account] Change listener failed:",z)}}function C(T,g){if(p()!==g||u!==T)throw new rn}function S(T){const g=h.then(T);return h=g.catch(()=>{}),g}const I=(e.allowedPaths??[]).map(T=>{const g=new URL(T,t);if(!T.startsWith("/")||T.startsWith("//")||T.includes("\\")||T.includes("%")||g.origin!==t.origin||g.search||g.hash||g.pathname!==T||T==="/")throw new Error("Invalid account request namespace");return T.replace(/\/+$/,"")}),O=(T,g)=>T===g||T.startsWith(g+"/"),k=T=>O(T,t.pathname.slice(0,-1))||I.some(g=>O(T,g));function E(T){const g=T.split(/[?#]/,1)[0];if(!T||T.startsWith("//")||g.includes("\\"))throw new Error("Request must stay inside the account API base");const z=I.some(Y=>O(g,Y)),q=/^[a-z][a-z\d+.-]*:/i.test(T)?new URL(T):new URL(z?T:T.replace(/^\//,""),t);let M;try{M=new URL(decodeURIComponent(q.pathname).replace(/\\/g,"/"),t.origin)}catch{throw new Error("Request must stay inside the account API base")}if(q.origin!==t.origin||q.username||q.password||q.hash||!k(q.pathname)||M.origin!==t.origin||!k(M.pathname))throw new Error("Request must stay inside the account API base");return q}const $=e.identityUrl?new URL(e.identityUrl,t):E("/auth/me");if($.origin!==t.origin||$.username||$.password||$.hash)throw new Error("Identity endpoint must use the account API origin");function W(T,g,z,q){const M=T.body?.getReader();let Y;const ue=()=>{Y&&q.removeEventListener("abort",Y),z()},de=M?new ReadableStream({start(Oe){Y=()=>{const Fe=q.reason??new rn;Oe.error(Fe),M.cancel(Fe).catch(()=>{}),ue()},q.addEventListener("abort",Y,{once:!0}),q.aborted&&Y()},async pull(Oe){try{g();const Fe=await M.read();g(),Fe.done?(Oe.close(),ue()):Oe.enqueue(Fe.value)}catch(Fe){Oe.error(Fe),M.cancel(Fe).catch(()=>{}),ue()}},async cancel(Oe){ue(),await M.cancel(Oe)}},{highWaterMark:0}):null;M||z();const ye=new Response(de,{status:T.status,statusText:T.statusText,headers:T.headers});Object.defineProperties(ye,{url:{value:T.url},redirected:{value:T.redirected},type:{value:T.type}});for(const Oe of["json","text","arrayBuffer","blob","formData"]){const Fe=ye[Oe].bind(ye);Object.defineProperty(ye,Oe,{configurable:!0,value:async()=>{g();const Yt=await Fe();return g(),Yt}})}const Ge=ye.clone.bind(ye);return Object.defineProperty(ye,"clone",{value:()=>(g(),W(Ge(),g,()=>{},q))}),ye}async function R(T,g={},z=p()){const q=p(),M=u,Y=new AbortController,ue=()=>{if(C(M,q),Y.signal.aborted)throw Y.signal.reason??new DOMException("The request was aborted","AbortError")},de=()=>Y.abort(g.signal?.reason);g.signal?.aborted?de():g.signal?.addEventListener("abort",de,{once:!0}),l.add(Y);const ye=()=>{l.delete(Y),g.signal?.removeEventListener("abort",de)},Ge=new Headers(g.headers);Ge.delete("Authorization"),z&&Ge.set("Authorization",`Bearer ${z}`);try{ue();const Oe=await i(T.href,{...g,headers:Ge,signal:Y.signal,redirect:"error",credentials:"omit",cache:"no-store"});return ue(),W(Oe,ue,ye,Y.signal)}catch(Oe){throw ye(),ue(),Oe}}function H(T,g){const z=new Headers(g?.headers).get("Authorization");if(z&&z!==`Bearer ${p()}`)throw new rn;return R(E(T),g)}function B(T){const g=T,z=g?.userId??g?.id;if(typeof z!="string"&&typeof z!="number"||!String(z).trim()||typeof g.username!="string"||!g.username)throw new Error("The account endpoint returned an invalid identity");return{userId:String(z),username:g.username,role:typeof g.role=="string"?g.role:"user",...typeof g.tenantId=="string"?{tenantId:g.tenantId}:{},...typeof g.workspaceId=="string"?{workspaceId:g.workspaceId}:{},nickname:typeof g.nickname=="string"?g.nickname:null,avatar:typeof g.avatar=="string"?g.avatar:null,membershipTier:typeof g.membershipTier=="string"?g.membershipTier:null}}async function te(T){const g=await R($,{},T);if(!g.ok)throw g.body?.cancel(),new fi(g.status,"Could not verify the account session");return B(await g.json())}async function ce(){const T=p(),g=u;if(!T)return y();try{const z=await te(T);return C(g,T),d=z,y(!0)}catch(z){if(C(g,T),z instanceof fi&&(z.status===401||z.status===403))return d=null,y(!1);if(z instanceof rn)throw z;return y(null)}}async function ne(){for(const T of a)await T()}function he(T,g){r&&(T?r.setItem(s,T):r.removeItem(s)),m(),c=T,d=g,w()}async function me(T){if(!T.trim())throw new Error("An account token is required");const g=p(),z=u,q=await te(T);if(C(z,g),T===g)return d=q,y(!0);try{return await ne(),C(z,g),he(T,q),y(!0)}catch(M){throw w(),M}}function we(T){return S(()=>me(T))}function ae(T){return S(async()=>{const g=await R(E("/auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)},"");if(!g.ok)throw g.body?.cancel(),new fi(g.status,"Account sign-in failed");const z=await g.json();if(typeof z?.token!="string")throw new Error("Sign-in did not return an account token");return me(z.token)})}function x(){const T=p(),g=u;return S(async()=>{C(g,T);const z=p(),q=u;if(z)try{await ne(),C(q,z);const M=await H("/auth/logout",{method:"POST"});if(!M.ok&&M.status!==401)throw M.body?.cancel(),new fi(M.status,"Account sign-out failed; the session was retained");if(M.ok&&M.status!==204){if((await M.json())?.ok!==!0)throw new Error("Account sign-out was not acknowledged; the session was retained")}else M.body?.cancel();C(q,z),he("",null)}catch(M){throw w(),M}})}function A(T={}){const g=typeof T=="string"?T:T.expectedToken??p(),z=typeof T=="string"||T.prepare!==!1;return S(async()=>{if(p()===g)try{z&&await ne(),p()===g&&he("",null)}catch(q){throw w(),q}})}return{getToken:p,getIdentity:()=>(p(),d?{...d}:null),get generation(){return p(),u},authStatus:ce,adoptToken:we,signIn:ae,login:(T,g)=>ae({username:T,password:g}),logout:x,clearSession:A,request:H,subscribe(T){return o.add(T),()=>{o.delete(T)}},beforeChange(T){return a.add(T),()=>{a.delete(T)}}}}function Id(e){const t=new URL(e.apiBase),n=t.pathname.replace(/\/+$/,"");return async(i,s)=>{const r=new URL(typeof i=="string"?i:i instanceof URL?i.href:i.url,location.href);if(!(r.origin===t.origin&&(r.pathname===n||r.pathname.startsWith(n+"/"))))return e.fallback(i,s);const a=e.getToken(),c=new Headers(s?.headers??(i instanceof Request?i.headers:void 0)).get("Authorization");if(c&&c!==`Bearer ${a}`)throw new rn;let d=s;if(i instanceof Request){const u=new Request(i,s);d={method:u.method,headers:u.headers,signal:u.signal,body:u.body,...u.body?{duplex:"half"}:{}}}return e.request(r.href,d)}}const ul="forsion_token";let hi;function vn(){if(!hi){let e;try{e=localStorage}catch{}hi=Ed({apiBase:Sn(),storage:e,tokenKey:ul,onChange:()=>Hi(Sn(),hi?.getToken()||"")})}return hi}function ln(){return vn().getToken()}function Ut(e,t=!1){const n=e??location.origin+"./";location.replace("/auth?redirect="+encodeURIComponent(n)+"&app=tangu-web"+(t?"&logout=1":""))}async function dl(){const e=new URL(location.href),t=e.searchParams.get("token");if(!t)return!0;e.searchParams.delete("token"),history.replaceState(null,"",e.toString());try{return await vn().adoptToken(t),!0}catch{return Ut(void 0,!0),!1}}async function Pd(){if(!await dl())return!1;const e=ln();if(e){if((await vn().authStatus()).tokenValid!==!1)return Hi(Sn(),e),!0;await vn().clearSession(e)}return Ut(location.origin+location.pathname),!1}function _o(){return ln()}function Sn(){return(location.origin+"/api").replace(/\/$/,"")}function fl(){const e=vn(),t=e.getToken();e.clearSession({expectedToken:t,prepare:!1}).then(()=>{e.getToken()||(cl(),Ut(void 0,!0))}).catch(n=>console.error("[account] Could not leave the expired session:",n))}async function Od(){if(!await dl())return!1;const e=vn(),t=e.getToken();if(!t)return Ut(),!1;if((await e.authStatus()).tokenValid===!1)return await e.clearSession(t),Ut(void 0,!0),!1;const i=Sn(),s=i;Hi(i,t);const r=window.fetch.bind(window),o=e.authStatus,a=(h="?")=>{const f=ln();return f?`${h}token=${encodeURIComponent(f)}`:""},l=h=>{let f=!1;try{f=localStorage.getItem("lcl.uiMode")==="mobile"}catch{}f?location.href=h:window.open(h,"_blank","noopener")},c=async(h,f,m)=>{const p=ln();if(!p)return{status:401,json:null};try{const y=await e.request(f,{method:h,headers:{Authorization:`Bearer ${p}`,...m!==void 0?{"Content-Type":"application/json"}:{}},body:m!==void 0?JSON.stringify(m):void 0});return{status:y.status,json:await y.json().catch(()=>null)}}catch(y){return{status:0,json:{detail:String(y?.message||y)}}}};window.tangu={cloudWeb:!0,getConfig:async()=>({mode:"external",backendUrl:s,token:ln(),modelId:"",cloudUrl:i,cloudApiBase:i,sandbox:"none"}),authStatus:o,forsionLogin:async()=>{e.getToken()&&await e.logout(),Ut(void 0,!0)},forsionLogout:async()=>{await e.logout(),Ut(void 0,!0)},onAuthWillChange:e.beforeChange,onAuthChanged:e.subscribe,openAccountCenter:async h=>{const f=h&&/^[a-z0-9-]+$/i.test(h)?`#${h}`:"";return l(`/account/${a()}${f}`),{ok:!0}},openPayCenter:async()=>{const h=encodeURIComponent(location.origin+"/account/");return l(`/pay/?tab=membership${a("&")}&redirect=${h}`),{ok:!0}},accountQuota:()=>c("GET","/token-quota/my"),accountUseResetCard:h=>h!==void 0&&h!=="both"&&h!=="weekly"?Promise.resolve({status:400,json:{error:"invalid_type",detail:`invalid reset card type: ${h}`}}):c("POST","/token-quota/reset-card/use",{type:h??"both"})};const u=new URL(i).pathname.replace(/\/+$/,"");return window.fetch=Id({apiBase:i,getToken:e.getToken,fallback:r,request:async(h,f)=>{const m=e.getToken(),p=e.generation,y=await e.request(h,f),w=new URL(h);return m===e.getToken()&&p===e.generation&&y.status===401&&(w.pathname.startsWith(u+"/agent/")||w.pathname.startsWith(u+"/amadeus/"))&&fl(),y}}),window.addEventListener("storage",h=>{h.key!==ul||h.oldValue===h.newValue||(Hi(i,ln()),location.reload())}),!0}const $d="amadeus.page/3",Rd="3.0.0";let Nd=e=>crypto.getRandomValues(new Uint8Array(e)),Ld=(e,t,n)=>{let i=256-256%e.length;if(i===256){let r=e.length-1;return(o=t)=>{if(!o)return"";let a="";for(;;){let l=n(o),c=o;for(;c--;)if(a+=e[l[c]&r],a.length>=o)return a}}}let s=Math.ceil(1.6*256*t/i);return(r=t)=>{if(!r)return"";let o="";for(;;){let a=n(s),l=s;for(;l--;)if(a[l]<i&&(o+=e[a[l]%e.length],o.length>=r))return o}}},Fd=(e,t=21)=>Ld(e,t|0,Nd);const Dd="0123456789abcdefghijklmnopqrstuvwxyz",Or=Fd(Dd,8);function qi(e,t=1){let n=0;for(const i of e){const s=Number.parseInt(String(i),10);Number.isSafeInteger(s)&&String(s)===String(i)&&s>n&&(n=s)}return String(Math.max(n+1,t))}function zd(e,t){const n=Number.parseInt(String(t),10);return!Number.isSafeInteger(n)||String(n)!==String(t)?e:Math.max(e??0,n+1)}function hl(){return`pg_${Or()}`}function Md(){return`row_${Or()}`}function jd(){return`col_${Or()}`}function pl(e){const t=e.split(/[\\/]/).pop()??e,n=t.lastIndexOf(".");return n>0?t.slice(0,n):t}function ml(e){return e.split(/[\\/]/).pop()??e}const Bd=/^<!--\s*a\s+([A-Za-z0-9_-]+)\s*-->\s*$/,Ud=/^<!--\s*\/a\s+([A-Za-z0-9_-]+)\s*-->\s*$/;function Co(e){return`<!-- a ${e} -->`}function gl(e){const t=[];let n=null,i=[];const s=()=>{const r=i.join(`
3
3
  `).replace(/^(?:[ \t]*\r?\n)+/,"").trimEnd();(n!==null||r)&&t.push({id:n,content:r}),i=[]};for(const r of e.split(`
4
- `)){const o=Bd.exec(r);if(o)s(),n=o[1];else{const a=Ud.exec(r);a&&n!==null&&a[1]===n?(s(),n=null):i.push(r)}}return s(),t}var Ao;function D(e,t,n){function i(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);const c=o.prototype,d=Object.keys(c);for(let u=0;u<d.length;u++){const p=d[u];p in a||(a[p]=c[p].bind(a))}}const s=n?.Parent??Object;class r extends s{}Object.defineProperty(r,"name",{value:e});function o(a){var l;const c=n?.Parent?new r:this;i(c,a),(l=c._zod).deferred??(l.deferred=[]);for(const d of c._zod.deferred)d();return c}return Object.defineProperty(o,"init",{value:i}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class gn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class bl extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Ao=globalThis).__zod_globalConfig??(Ao.__zod_globalConfig={});const $r=globalThis.__zod_globalConfig;function At(e){return $r}function yl(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,s])=>t.indexOf(+i)===-1).map(([i,s])=>s)}function tr(e,t){return typeof t=="bigint"?t.toString():t}function Rr(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Nr(e){return e==null}function Lr(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Hd(e,t){const n=e/t,i=Math.round(n),s=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<s?0:n-i}const Eo=Symbol("evaluating");function he(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==Eo)return i===void 0&&(i=Eo,i=n()),i},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Gt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Nt(...e){const t={};for(const n of e){const i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function To(e){return JSON.stringify(e)}function qd(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const wl="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Wi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Wd=Rr(()=>{if($r.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function xn(e){if(Wi(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Wi(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function kl(e){return xn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Vd=new Set(["string","number","symbol"]);function _n(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Lt(e,t,n){const i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function K(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Zd(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Kd={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Gd(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const r=Nt(e._zod.def,{get shape(){const o={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=n.shape[a])}return Gt(this,"shape",o),o},checks:[]});return Lt(e,r)}function Yd(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const r=Nt(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete o[a]}return Gt(this,"shape",o),o},checks:[]});return Lt(e,r)}function Jd(e,t){if(!xn(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const r=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(r,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Nt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Gt(this,"shape",r),r}});return Lt(e,s)}function Qd(e,t){if(!xn(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Nt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Gt(this,"shape",i),i}});return Lt(e,n)}function Xd(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=Nt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return Gt(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Lt(e,n)}function ef(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=Nt(t._zod.def,{get shape(){const a=t._zod.def.shape,l={...a};if(n)for(const c in n){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=e?new e({type:"optional",innerType:a[c]}):a[c])}else for(const c in a)l[c]=e?new e({type:"optional",innerType:a[c]}):a[c];return Gt(this,"shape",l),l},checks:[]});return Lt(t,o)}function tf(e,t,n){const i=Nt(t._zod.def,{get shape(){const s=t._zod.def.shape,r={...s};if(n)for(const o in n){if(!(o in r))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(r[o]=new e({type:"nonoptional",innerType:s[o]}))}else for(const o in s)r[o]=new e({type:"nonoptional",innerType:s[o]});return Gt(this,"shape",r),r}});return Lt(t,i)}function cn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function nf(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function un(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function hi(e){return typeof e=="string"?e:e?.message}function Et(e,t,n){const i=e.message?e.message:hi(e.inst?._zod.def?.error?.(e))??hi(t?.error?.(e))??hi(n.customError?.(e))??hi(n.localeError?.(e))??"Invalid input",{inst:s,continue:r,input:o,...a}=e;return a.path??(a.path=[]),a.message=i,t?.reportInput&&(a.input=o),a}function Fr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Qn(...e){const[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}const vl=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,tr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Sl=D("$ZodError",vl),xl=D("$ZodError",vl,{Parent:Error});function sf(e,t=n=>n.message){const n={},i=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):i.push(t(s));return{formErrors:i,fieldErrors:n}}function rf(e,t=n=>n.message){const n={_errors:[]},i=(s,r=[])=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>i({issues:a},[...r,...o.path]));else if(o.code==="invalid_key")i({issues:o.issues},[...r,...o.path]);else if(o.code==="invalid_element")i({issues:o.issues},[...r,...o.path]);else{const a=[...r,...o.path];if(a.length===0)n._errors.push(t(o));else{let l=n,c=0;for(;c<a.length;){const d=a[c];c===a.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(o))):l[d]=l[d]||{_errors:[]},l=l[d],c++}}}};return i(e),n}const Dr=e=>(t,n,i,s)=>{const r=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new gn;if(o.issues.length){const a=new(s?.Err??e)(o.issues.map(l=>Et(l,r,At())));throw wl(a,s?.callee),a}return o.value},zr=e=>async(t,n,i,s)=>{const r=i?{...i,async:!0}:{async:!0};let o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new(s?.Err??e)(o.issues.map(l=>Et(l,r,At())));throw wl(a,s?.callee),a}return o.value},is=e=>(t,n,i)=>{const s=i?{...i,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise)throw new gn;return r.issues.length?{success:!1,error:new(e??Sl)(r.issues.map(o=>Et(o,s,At())))}:{success:!0,data:r.value}},of=is(xl),ss=e=>async(t,n,i)=>{const s=i?{...i,async:!0}:{async:!0};let r=t._zod.run({value:n,issues:[]},s);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map(o=>Et(o,s,At())))}:{success:!0,data:r.value}},af=ss(xl),lf=e=>(t,n,i)=>{const s=i?{...i,direction:"backward"}:{direction:"backward"};return Dr(e)(t,n,s)},cf=e=>(t,n,i)=>Dr(e)(t,n,i),uf=e=>async(t,n,i)=>{const s=i?{...i,direction:"backward"}:{direction:"backward"};return zr(e)(t,n,s)},df=e=>async(t,n,i)=>zr(e)(t,n,i),ff=e=>(t,n,i)=>{const s=i?{...i,direction:"backward"}:{direction:"backward"};return is(e)(t,n,s)},pf=e=>(t,n,i)=>is(e)(t,n,i),hf=e=>async(t,n,i)=>{const s=i?{...i,direction:"backward"}:{direction:"backward"};return ss(e)(t,n,s)},mf=e=>async(t,n,i)=>ss(e)(t,n,i),gf=/^[cC][0-9a-z]{6,}$/,bf=/^[0-9a-z]+$/,yf=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,wf=/^[0-9a-vA-V]{20}$/,kf=/^[A-Za-z0-9]{27}$/,vf=/^[a-zA-Z0-9_-]{21}$/,Sf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,xf=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Io=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,_f=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Cf="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Af(){return new RegExp(Cf,"u")}const Ef=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Tf=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,If=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Pf=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Of=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_l=/^[A-Za-z0-9_-]*$/,$f=/^https?$/,Rf=/^\+[1-9]\d{6,14}$/,Cl="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Nf=new RegExp(`^${Cl}$`);function Al(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Lf(e){return new RegExp(`^${Al(e)}$`)}function Ff(e){const t=Al({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${Cl}T(?:${i})$`)}const Df=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},zf=/^-?\d+$/,El=/^-?\d+(?:\.\d+)?$/,Mf=/^(?:true|false)$/i,jf=/^null$/i,Bf=/^[^A-Z]*$/,Uf=/^[^a-z]*$/,Ze=D("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Tl={number:"number",bigint:"bigint",object:"date"},Il=D("$ZodCheckLessThan",(e,t)=>{Ze.init(e,t);const n=Tl[typeof t.value];e._zod.onattach.push(i=>{const s=i._zod.bag,r=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pl=D("$ZodCheckGreaterThan",(e,t)=>{Ze.init(e,t);const n=Tl[typeof t.value];e._zod.onattach.push(i=>{const s=i._zod.bag,r=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Hf=D("$ZodCheckMultipleOf",(e,t)=>{Ze.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Hd(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),qf=D("$ZodCheckNumberFormat",(e,t)=>{Ze.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[s,r]=Kd[t.format];e._zod.onattach.push(o=>{const a=o._zod.bag;a.format=t.format,a.minimum=s,a.maximum=r,n&&(a.pattern=zf)}),e._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a)){o.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}a<s&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>r&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Wf=D("$ZodCheckMaxLength",(e,t)=>{var n;Ze.init(e,t),(n=e._zod.def).when??(n.when=i=>{const s=i.value;return!Nr(s)&&s.length!==void 0}),e._zod.onattach.push(i=>{const s=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{const s=i.value;if(s.length<=t.maximum)return;const o=Fr(s);i.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Vf=D("$ZodCheckMinLength",(e,t)=>{var n;Ze.init(e,t),(n=e._zod.def).when??(n.when=i=>{const s=i.value;return!Nr(s)&&s.length!==void 0}),e._zod.onattach.push(i=>{const s=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const s=i.value;if(s.length>=t.minimum)return;const o=Fr(s);i.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Zf=D("$ZodCheckLengthEquals",(e,t)=>{var n;Ze.init(e,t),(n=e._zod.def).when??(n.when=i=>{const s=i.value;return!Nr(s)&&s.length!==void 0}),e._zod.onattach.push(i=>{const s=i._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=i=>{const s=i.value,r=s.length;if(r===t.length)return;const o=Fr(s),a=r>t.length;i.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),rs=D("$ZodCheckStringFormat",(e,t)=>{var n,i;Ze.init(e,t),e._zod.onattach.push(s=>{const r=s._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Kf=D("$ZodCheckRegex",(e,t)=>{rs.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Gf=D("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Bf),rs.init(e,t)}),Yf=D("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Uf),rs.init(e,t)}),Jf=D("$ZodCheckIncludes",(e,t)=>{Ze.init(e,t);const n=_n(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(s=>{const r=s._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(i)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),Qf=D("$ZodCheckStartsWith",(e,t)=>{Ze.init(e,t);const n=new RegExp(`^${_n(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Xf=D("$ZodCheckEndsWith",(e,t)=>{Ze.init(e,t);const n=new RegExp(`.*${_n(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),ep=D("$ZodCheckOverwrite",(e,t)=>{Ze.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class tp{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(`
4
+ `)){const o=Bd.exec(r);if(o)s(),n=o[1];else{const a=Ud.exec(r);a&&n!==null&&a[1]===n?(s(),n=null):i.push(r)}}return s(),t}var Ao;function D(e,t,n){function i(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);const c=o.prototype,d=Object.keys(c);for(let u=0;u<d.length;u++){const h=d[u];h in a||(a[h]=c[h].bind(a))}}const s=n?.Parent??Object;class r extends s{}Object.defineProperty(r,"name",{value:e});function o(a){var l;const c=n?.Parent?new r:this;i(c,a),(l=c._zod).deferred??(l.deferred=[]);for(const d of c._zod.deferred)d();return c}return Object.defineProperty(o,"init",{value:i}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class gn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class bl extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Ao=globalThis).__zod_globalConfig??(Ao.__zod_globalConfig={});const $r=globalThis.__zod_globalConfig;function At(e){return $r}function yl(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,s])=>t.indexOf(+i)===-1).map(([i,s])=>s)}function tr(e,t){return typeof t=="bigint"?t.toString():t}function Rr(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Nr(e){return e==null}function Lr(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Hd(e,t){const n=e/t,i=Math.round(n),s=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<s?0:n-i}const To=Symbol("evaluating");function pe(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==To)return i===void 0&&(i=To,i=n()),i},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Gt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Nt(...e){const t={};for(const n of e){const i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function Eo(e){return JSON.stringify(e)}function qd(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const wl="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Wi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Wd=Rr(()=>{if($r.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function xn(e){if(Wi(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Wi(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function kl(e){return xn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Vd=new Set(["string","number","symbol"]);function _n(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Lt(e,t,n){const i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function K(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Zd(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Kd={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Gd(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const r=Nt(e._zod.def,{get shape(){const o={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=n.shape[a])}return Gt(this,"shape",o),o},checks:[]});return Lt(e,r)}function Yd(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const r=Nt(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete o[a]}return Gt(this,"shape",o),o},checks:[]});return Lt(e,r)}function Jd(e,t){if(!xn(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const r=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(r,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Nt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Gt(this,"shape",r),r}});return Lt(e,s)}function Qd(e,t){if(!xn(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Nt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Gt(this,"shape",i),i}});return Lt(e,n)}function Xd(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=Nt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return Gt(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Lt(e,n)}function ef(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=Nt(t._zod.def,{get shape(){const a=t._zod.def.shape,l={...a};if(n)for(const c in n){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=e?new e({type:"optional",innerType:a[c]}):a[c])}else for(const c in a)l[c]=e?new e({type:"optional",innerType:a[c]}):a[c];return Gt(this,"shape",l),l},checks:[]});return Lt(t,o)}function tf(e,t,n){const i=Nt(t._zod.def,{get shape(){const s=t._zod.def.shape,r={...s};if(n)for(const o in n){if(!(o in r))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(r[o]=new e({type:"nonoptional",innerType:s[o]}))}else for(const o in s)r[o]=new e({type:"nonoptional",innerType:s[o]});return Gt(this,"shape",r),r}});return Lt(t,i)}function cn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function nf(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function un(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function pi(e){return typeof e=="string"?e:e?.message}function Tt(e,t,n){const i=e.message?e.message:pi(e.inst?._zod.def?.error?.(e))??pi(t?.error?.(e))??pi(n.customError?.(e))??pi(n.localeError?.(e))??"Invalid input",{inst:s,continue:r,input:o,...a}=e;return a.path??(a.path=[]),a.message=i,t?.reportInput&&(a.input=o),a}function Fr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Qn(...e){const[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}const vl=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,tr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Sl=D("$ZodError",vl),xl=D("$ZodError",vl,{Parent:Error});function sf(e,t=n=>n.message){const n={},i=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):i.push(t(s));return{formErrors:i,fieldErrors:n}}function rf(e,t=n=>n.message){const n={_errors:[]},i=(s,r=[])=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>i({issues:a},[...r,...o.path]));else if(o.code==="invalid_key")i({issues:o.issues},[...r,...o.path]);else if(o.code==="invalid_element")i({issues:o.issues},[...r,...o.path]);else{const a=[...r,...o.path];if(a.length===0)n._errors.push(t(o));else{let l=n,c=0;for(;c<a.length;){const d=a[c];c===a.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(o))):l[d]=l[d]||{_errors:[]},l=l[d],c++}}}};return i(e),n}const Dr=e=>(t,n,i,s)=>{const r=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new gn;if(o.issues.length){const a=new(s?.Err??e)(o.issues.map(l=>Tt(l,r,At())));throw wl(a,s?.callee),a}return o.value},zr=e=>async(t,n,i,s)=>{const r=i?{...i,async:!0}:{async:!0};let o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new(s?.Err??e)(o.issues.map(l=>Tt(l,r,At())));throw wl(a,s?.callee),a}return o.value},is=e=>(t,n,i)=>{const s=i?{...i,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise)throw new gn;return r.issues.length?{success:!1,error:new(e??Sl)(r.issues.map(o=>Tt(o,s,At())))}:{success:!0,data:r.value}},of=is(xl),ss=e=>async(t,n,i)=>{const s=i?{...i,async:!0}:{async:!0};let r=t._zod.run({value:n,issues:[]},s);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map(o=>Tt(o,s,At())))}:{success:!0,data:r.value}},af=ss(xl),lf=e=>(t,n,i)=>{const s=i?{...i,direction:"backward"}:{direction:"backward"};return Dr(e)(t,n,s)},cf=e=>(t,n,i)=>Dr(e)(t,n,i),uf=e=>async(t,n,i)=>{const s=i?{...i,direction:"backward"}:{direction:"backward"};return zr(e)(t,n,s)},df=e=>async(t,n,i)=>zr(e)(t,n,i),ff=e=>(t,n,i)=>{const s=i?{...i,direction:"backward"}:{direction:"backward"};return is(e)(t,n,s)},hf=e=>(t,n,i)=>is(e)(t,n,i),pf=e=>async(t,n,i)=>{const s=i?{...i,direction:"backward"}:{direction:"backward"};return ss(e)(t,n,s)},mf=e=>async(t,n,i)=>ss(e)(t,n,i),gf=/^[cC][0-9a-z]{6,}$/,bf=/^[0-9a-z]+$/,yf=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,wf=/^[0-9a-vA-V]{20}$/,kf=/^[A-Za-z0-9]{27}$/,vf=/^[a-zA-Z0-9_-]{21}$/,Sf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,xf=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Io=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,_f=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Cf="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Af(){return new RegExp(Cf,"u")}const Tf=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ef=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,If=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Pf=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Of=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_l=/^[A-Za-z0-9_-]*$/,$f=/^https?$/,Rf=/^\+[1-9]\d{6,14}$/,Cl="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Nf=new RegExp(`^${Cl}$`);function Al(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Lf(e){return new RegExp(`^${Al(e)}$`)}function Ff(e){const t=Al({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${Cl}T(?:${i})$`)}const Df=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},zf=/^-?\d+$/,Tl=/^-?\d+(?:\.\d+)?$/,Mf=/^(?:true|false)$/i,jf=/^null$/i,Bf=/^[^A-Z]*$/,Uf=/^[^a-z]*$/,Ze=D("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),El={number:"number",bigint:"bigint",object:"date"},Il=D("$ZodCheckLessThan",(e,t)=>{Ze.init(e,t);const n=El[typeof t.value];e._zod.onattach.push(i=>{const s=i._zod.bag,r=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pl=D("$ZodCheckGreaterThan",(e,t)=>{Ze.init(e,t);const n=El[typeof t.value];e._zod.onattach.push(i=>{const s=i._zod.bag,r=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Hf=D("$ZodCheckMultipleOf",(e,t)=>{Ze.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Hd(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),qf=D("$ZodCheckNumberFormat",(e,t)=>{Ze.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[s,r]=Kd[t.format];e._zod.onattach.push(o=>{const a=o._zod.bag;a.format=t.format,a.minimum=s,a.maximum=r,n&&(a.pattern=zf)}),e._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a)){o.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}a<s&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>r&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Wf=D("$ZodCheckMaxLength",(e,t)=>{var n;Ze.init(e,t),(n=e._zod.def).when??(n.when=i=>{const s=i.value;return!Nr(s)&&s.length!==void 0}),e._zod.onattach.push(i=>{const s=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{const s=i.value;if(s.length<=t.maximum)return;const o=Fr(s);i.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Vf=D("$ZodCheckMinLength",(e,t)=>{var n;Ze.init(e,t),(n=e._zod.def).when??(n.when=i=>{const s=i.value;return!Nr(s)&&s.length!==void 0}),e._zod.onattach.push(i=>{const s=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const s=i.value;if(s.length>=t.minimum)return;const o=Fr(s);i.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Zf=D("$ZodCheckLengthEquals",(e,t)=>{var n;Ze.init(e,t),(n=e._zod.def).when??(n.when=i=>{const s=i.value;return!Nr(s)&&s.length!==void 0}),e._zod.onattach.push(i=>{const s=i._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=i=>{const s=i.value,r=s.length;if(r===t.length)return;const o=Fr(s),a=r>t.length;i.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),rs=D("$ZodCheckStringFormat",(e,t)=>{var n,i;Ze.init(e,t),e._zod.onattach.push(s=>{const r=s._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Kf=D("$ZodCheckRegex",(e,t)=>{rs.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Gf=D("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Bf),rs.init(e,t)}),Yf=D("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Uf),rs.init(e,t)}),Jf=D("$ZodCheckIncludes",(e,t)=>{Ze.init(e,t);const n=_n(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(s=>{const r=s._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(i)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),Qf=D("$ZodCheckStartsWith",(e,t)=>{Ze.init(e,t);const n=new RegExp(`^${_n(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Xf=D("$ZodCheckEndsWith",(e,t)=>{Ze.init(e,t);const n=new RegExp(`.*${_n(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),eh=D("$ZodCheckOverwrite",(e,t)=>{Ze.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class th{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(`
5
5
  `).filter(o=>o),s=Math.min(...i.map(o=>o.length-o.trimStart().length)),r=i.map(o=>o.slice(s)).map(o=>" ".repeat(this.indent*2)+o);for(const o of r)this.content.push(o)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(r=>` ${r}`)];return new t(...n,s.join(`
6
- `))}}const np={major:4,minor:4,patch:3},ke=D("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=np;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const s of i)for(const r of s._zod.onattach)r(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(o,a,l)=>{let c=cn(o),d;for(const u of a){if(u._zod.def.when){if(nf(o)||!u._zod.def.when(o))continue}else if(c)continue;const p=o.issues.length,f=u._zod.check(o);if(f instanceof Promise&&l?.async===!1)throw new gn;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,o.issues.length!==p&&(c||(c=cn(o,p)))});else{if(o.issues.length===p)continue;c||(c=cn(o,p))}}return d?d.then(()=>o):o},r=(o,a,l)=>{if(cn(o))return o.aborted=!0,o;const c=s(a,i,l);if(c instanceof Promise){if(l.async===!1)throw new gn;return c.then(d=>e._zod.parse(d,l))}return e._zod.parse(c,l)};e._zod.run=(o,a)=>{if(a.skipChecks)return e._zod.parse(o,a);if(a.direction==="backward"){const c=e._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(d=>r(d,o,a)):r(c,o,a)}const l=e._zod.parse(o,a);if(l instanceof Promise){if(a.async===!1)throw new gn;return l.then(c=>s(c,i,a))}return s(l,i,a)}}he(e,"~standard",()=>({validate:s=>{try{const r=of(e,s);return r.success?{value:r.data}:{issues:r.error?.issues}}catch{return af(e,s).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),Mr=D("$ZodString",(e,t)=>{ke.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Df(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),ve=D("$ZodStringFormat",(e,t)=>{rs.init(e,t),Mr.init(e,t)}),ip=D("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=xf),ve.init(e,t)}),sp=D("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Io(i))}else t.pattern??(t.pattern=Io());ve.init(e,t)}),rp=D("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=_f),ve.init(e,t)}),op=D("$ZodURL",(e,t)=>{ve.init(e,t),e._zod.check=n=>{try{const i=n.value.trim();if(!t.normalize&&t.protocol?.source===$f.source&&!/^https?:\/\//i.test(i)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const s=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),ap=D("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Af()),ve.init(e,t)}),lp=D("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=vf),ve.init(e,t)}),cp=D("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=gf),ve.init(e,t)}),up=D("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=bf),ve.init(e,t)}),dp=D("$ZodULID",(e,t)=>{t.pattern??(t.pattern=yf),ve.init(e,t)}),fp=D("$ZodXID",(e,t)=>{t.pattern??(t.pattern=wf),ve.init(e,t)}),pp=D("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=kf),ve.init(e,t)}),hp=D("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ff(t)),ve.init(e,t)}),mp=D("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Nf),ve.init(e,t)}),gp=D("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Lf(t)),ve.init(e,t)}),bp=D("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Sf),ve.init(e,t)}),yp=D("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ef),ve.init(e,t),e._zod.bag.format="ipv4"}),wp=D("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Tf),ve.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),kp=D("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=If),ve.init(e,t)}),vp=D("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Pf),ve.init(e,t),e._zod.check=n=>{const i=n.value.split("/");try{if(i.length!==2)throw new Error;const[s,r]=i;if(!r)throw new Error;const o=Number(r);if(`${o}`!==r)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Ol(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Sp=D("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Of),ve.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Ol(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function xp(e){if(!_l.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ol(n)}const _p=D("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=_l),ve.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{xp(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Cp=D("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Rf),ve.init(e,t)});function Ap(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const s=JSON.parse(atob(i));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const Ep=D("$ZodJWT",(e,t)=>{ve.init(e,t),e._zod.check=n=>{Ap(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),$l=D("$ZodNumber",(e,t)=>{ke.init(e,t),e._zod.pattern=e._zod.bag.pattern??El,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const r=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...r?{received:r}:{}}),n}}),Tp=D("$ZodNumberFormat",(e,t)=>{qf.init(e,t),$l.init(e,t)}),Ip=D("$ZodBoolean",(e,t)=>{ke.init(e,t),e._zod.pattern=Mf,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),Pp=D("$ZodNull",(e,t)=>{ke.init(e,t),e._zod.pattern=jf,e._zod.values=new Set([null]),e._zod.parse=(n,i)=>{const s=n.value;return s===null||n.issues.push({expected:"null",code:"invalid_type",input:s,inst:e}),n}}),Op=D("$ZodUnknown",(e,t)=>{ke.init(e,t),e._zod.parse=n=>n}),$p=D("$ZodNever",(e,t)=>{ke.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Po(e,t,n){e.issues.length&&t.issues.push(...un(n,e.issues)),t.value[n]=e.value}const Rp=D("$ZodArray",(e,t)=>{ke.init(e,t),e._zod.parse=(n,i)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const r=[];for(let o=0;o<s.length;o++){const a=s[o],l=t.element._zod.run({value:a,issues:[]},i);l instanceof Promise?r.push(l.then(c=>Po(c,n,o))):Po(l,n,o)}return r.length?Promise.all(r).then(()=>n):n}});function Vi(e,t,n,i,s,r){const o=n in i;if(e.issues.length){if(s&&r&&!o)return;t.issues.push(...un(n,e.issues))}if(!o&&!s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Rl(e){const t=Object.keys(e.shape);for(const i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const n=Zd(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Nl(e,t,n,i,s,r){const o=[],a=s.keySet,l=s.catchall._zod,c=l.def.type,d=l.optin==="optional",u=l.optout==="optional";for(const p in t){if(p==="__proto__"||a.has(p))continue;if(c==="never"){o.push(p);continue}const f=l.run({value:t[p],issues:[]},i);f instanceof Promise?e.push(f.then(m=>Vi(m,n,p,t,d,u))):Vi(f,n,p,t,d,u)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:r}),e.length?Promise.all(e).then(()=>n):n}const Np=D("$ZodObject",(e,t)=>{if(ke.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...a};return Object.defineProperty(t,"shape",{value:l}),l}})}const i=Rr(()=>Rl(t));he(e._zod,"propValues",()=>{const a=t.shape,l={};for(const c in a){const d=a[c]._zod;if(d.values){l[c]??(l[c]=new Set);for(const u of d.values)l[c].add(u)}}return l});const s=Wi,r=t.catchall;let o;e._zod.parse=(a,l)=>{o??(o=i.value);const c=a.value;if(!s(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),a;a.value={};const d=[],u=o.shape;for(const p of o.keys){const f=u[p],m=f._zod.optin==="optional",h=f._zod.optout==="optional",y=f._zod.run({value:c[p],issues:[]},l);y instanceof Promise?d.push(y.then(w=>Vi(w,a,p,c,m,h))):Vi(y,a,p,c,m,h)}return r?Nl(d,c,a,l,i.value,e):d.length?Promise.all(d).then(()=>a):a}}),Lp=D("$ZodObjectJIT",(e,t)=>{Np.init(e,t);const n=e._zod.parse,i=Rr(()=>Rl(t)),s=p=>{const f=new tp(["shape","payload","ctx"]),m=i.value,h=S=>{const I=To(S);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};f.write("const input = payload.value;");const y=Object.create(null);let w=0;for(const S of m.keys)y[S]=`key_${w++}`;f.write("const newResult = {};");for(const S of m.keys){const I=y[S],O=To(S),k=p[S],T=k?._zod?.optin==="optional",$=k?._zod?.optout==="optional";f.write(`const ${I} = ${h(S)};`),T&&$?f.write(`
6
+ `))}}const nh={major:4,minor:4,patch:3},ke=D("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=nh;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const s of i)for(const r of s._zod.onattach)r(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(o,a,l)=>{let c=cn(o),d;for(const u of a){if(u._zod.def.when){if(nf(o)||!u._zod.def.when(o))continue}else if(c)continue;const h=o.issues.length,f=u._zod.check(o);if(f instanceof Promise&&l?.async===!1)throw new gn;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,o.issues.length!==h&&(c||(c=cn(o,h)))});else{if(o.issues.length===h)continue;c||(c=cn(o,h))}}return d?d.then(()=>o):o},r=(o,a,l)=>{if(cn(o))return o.aborted=!0,o;const c=s(a,i,l);if(c instanceof Promise){if(l.async===!1)throw new gn;return c.then(d=>e._zod.parse(d,l))}return e._zod.parse(c,l)};e._zod.run=(o,a)=>{if(a.skipChecks)return e._zod.parse(o,a);if(a.direction==="backward"){const c=e._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(d=>r(d,o,a)):r(c,o,a)}const l=e._zod.parse(o,a);if(l instanceof Promise){if(a.async===!1)throw new gn;return l.then(c=>s(c,i,a))}return s(l,i,a)}}pe(e,"~standard",()=>({validate:s=>{try{const r=of(e,s);return r.success?{value:r.data}:{issues:r.error?.issues}}catch{return af(e,s).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),Mr=D("$ZodString",(e,t)=>{ke.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Df(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),ve=D("$ZodStringFormat",(e,t)=>{rs.init(e,t),Mr.init(e,t)}),ih=D("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=xf),ve.init(e,t)}),sh=D("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Io(i))}else t.pattern??(t.pattern=Io());ve.init(e,t)}),rh=D("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=_f),ve.init(e,t)}),oh=D("$ZodURL",(e,t)=>{ve.init(e,t),e._zod.check=n=>{try{const i=n.value.trim();if(!t.normalize&&t.protocol?.source===$f.source&&!/^https?:\/\//i.test(i)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const s=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),ah=D("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Af()),ve.init(e,t)}),lh=D("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=vf),ve.init(e,t)}),ch=D("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=gf),ve.init(e,t)}),uh=D("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=bf),ve.init(e,t)}),dh=D("$ZodULID",(e,t)=>{t.pattern??(t.pattern=yf),ve.init(e,t)}),fh=D("$ZodXID",(e,t)=>{t.pattern??(t.pattern=wf),ve.init(e,t)}),hh=D("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=kf),ve.init(e,t)}),ph=D("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ff(t)),ve.init(e,t)}),mh=D("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Nf),ve.init(e,t)}),gh=D("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Lf(t)),ve.init(e,t)}),bh=D("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Sf),ve.init(e,t)}),yh=D("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Tf),ve.init(e,t),e._zod.bag.format="ipv4"}),wh=D("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ef),ve.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),kh=D("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=If),ve.init(e,t)}),vh=D("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Pf),ve.init(e,t),e._zod.check=n=>{const i=n.value.split("/");try{if(i.length!==2)throw new Error;const[s,r]=i;if(!r)throw new Error;const o=Number(r);if(`${o}`!==r)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Ol(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Sh=D("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Of),ve.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Ol(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function xh(e){if(!_l.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ol(n)}const _h=D("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=_l),ve.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{xh(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Ch=D("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Rf),ve.init(e,t)});function Ah(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const s=JSON.parse(atob(i));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const Th=D("$ZodJWT",(e,t)=>{ve.init(e,t),e._zod.check=n=>{Ah(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),$l=D("$ZodNumber",(e,t)=>{ke.init(e,t),e._zod.pattern=e._zod.bag.pattern??Tl,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const r=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...r?{received:r}:{}}),n}}),Eh=D("$ZodNumberFormat",(e,t)=>{qf.init(e,t),$l.init(e,t)}),Ih=D("$ZodBoolean",(e,t)=>{ke.init(e,t),e._zod.pattern=Mf,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),Ph=D("$ZodNull",(e,t)=>{ke.init(e,t),e._zod.pattern=jf,e._zod.values=new Set([null]),e._zod.parse=(n,i)=>{const s=n.value;return s===null||n.issues.push({expected:"null",code:"invalid_type",input:s,inst:e}),n}}),Oh=D("$ZodUnknown",(e,t)=>{ke.init(e,t),e._zod.parse=n=>n}),$h=D("$ZodNever",(e,t)=>{ke.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Po(e,t,n){e.issues.length&&t.issues.push(...un(n,e.issues)),t.value[n]=e.value}const Rh=D("$ZodArray",(e,t)=>{ke.init(e,t),e._zod.parse=(n,i)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const r=[];for(let o=0;o<s.length;o++){const a=s[o],l=t.element._zod.run({value:a,issues:[]},i);l instanceof Promise?r.push(l.then(c=>Po(c,n,o))):Po(l,n,o)}return r.length?Promise.all(r).then(()=>n):n}});function Vi(e,t,n,i,s,r){const o=n in i;if(e.issues.length){if(s&&r&&!o)return;t.issues.push(...un(n,e.issues))}if(!o&&!s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Rl(e){const t=Object.keys(e.shape);for(const i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const n=Zd(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Nl(e,t,n,i,s,r){const o=[],a=s.keySet,l=s.catchall._zod,c=l.def.type,d=l.optin==="optional",u=l.optout==="optional";for(const h in t){if(h==="__proto__"||a.has(h))continue;if(c==="never"){o.push(h);continue}const f=l.run({value:t[h],issues:[]},i);f instanceof Promise?e.push(f.then(m=>Vi(m,n,h,t,d,u))):Vi(f,n,h,t,d,u)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:r}),e.length?Promise.all(e).then(()=>n):n}const Nh=D("$ZodObject",(e,t)=>{if(ke.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...a};return Object.defineProperty(t,"shape",{value:l}),l}})}const i=Rr(()=>Rl(t));pe(e._zod,"propValues",()=>{const a=t.shape,l={};for(const c in a){const d=a[c]._zod;if(d.values){l[c]??(l[c]=new Set);for(const u of d.values)l[c].add(u)}}return l});const s=Wi,r=t.catchall;let o;e._zod.parse=(a,l)=>{o??(o=i.value);const c=a.value;if(!s(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),a;a.value={};const d=[],u=o.shape;for(const h of o.keys){const f=u[h],m=f._zod.optin==="optional",p=f._zod.optout==="optional",y=f._zod.run({value:c[h],issues:[]},l);y instanceof Promise?d.push(y.then(w=>Vi(w,a,h,c,m,p))):Vi(y,a,h,c,m,p)}return r?Nl(d,c,a,l,i.value,e):d.length?Promise.all(d).then(()=>a):a}}),Lh=D("$ZodObjectJIT",(e,t)=>{Nh.init(e,t);const n=e._zod.parse,i=Rr(()=>Rl(t)),s=h=>{const f=new th(["shape","payload","ctx"]),m=i.value,p=S=>{const I=Eo(S);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};f.write("const input = payload.value;");const y=Object.create(null);let w=0;for(const S of m.keys)y[S]=`key_${w++}`;f.write("const newResult = {};");for(const S of m.keys){const I=y[S],O=Eo(S),k=h[S],E=k?._zod?.optin==="optional",$=k?._zod?.optout==="optional";f.write(`const ${I} = ${p(S)};`),E&&$?f.write(`
7
7
  if (${I}.issues.length) {
8
8
  if (${O} in input) {
9
9
  payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
@@ -21,7 +21,7 @@ function Sd(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&
21
21
  newResult[${O}] = ${I}.value;
22
22
  }
23
23
 
24
- `):T?f.write(`
24
+ `):E?f.write(`
25
25
  if (${I}.issues.length) {
26
26
  payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
27
27
  ...iss,
@@ -62,29 +62,29 @@ function Sd(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&
62
62
  }
63
63
  }
64
64
 
65
- `)}f.write("payload.value = newResult;"),f.write("return payload;");const C=f.compile();return(S,I)=>C(p,S,I)};let r;const o=Wi,a=!$r.jitless,c=a&&Wd.value,d=t.catchall;let u;e._zod.parse=(p,f)=>{u??(u=i.value);const m=p.value;return o(m)?a&&c&&f?.async===!1&&f.jitless!==!0?(r||(r=s(t.shape)),p=r(p,f),d?Nl([],m,p,f,u,e):p):n(p,f):(p.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),p)}});function Oo(e,t,n,i){for(const r of e)if(r.issues.length===0)return t.value=r.value,t;const s=e.filter(r=>!cn(r));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(r=>r.issues.map(o=>Et(o,i,At())))}),t)}const Fp=D("$ZodUnion",(e,t)=>{ke.init(e,t),he(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),he(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),he(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),he(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>Lr(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,s)=>{if(n)return n(i,s);let r=!1;const o=[];for(const a of t.options){const l=a._zod.run({value:i.value,issues:[]},s);if(l instanceof Promise)o.push(l),r=!0;else{if(l.issues.length===0)return l;o.push(l)}}return r?Promise.all(o).then(a=>Oo(a,i,e,s)):Oo(o,i,e,s)}}),Dp=D("$ZodIntersection",(e,t)=>{ke.init(e,t),e._zod.parse=(n,i)=>{const s=n.value,r=t.left._zod.run({value:s,issues:[]},i),o=t.right._zod.run({value:s,issues:[]},i);return r instanceof Promise||o instanceof Promise?Promise.all([r,o]).then(([l,c])=>$o(n,l,c)):$o(n,r,o)}});function nr(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(xn(e)&&xn(t)){const n=Object.keys(t),i=Object.keys(e).filter(r=>n.indexOf(r)!==-1),s={...e,...t};for(const r of i){const o=nr(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};s[r]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<e.length;i++){const s=e[i],r=t[i],o=nr(s,r);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function $o(e,t,n){const i=new Map;let s;for(const a of t.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const l of a.keys)i.has(l)||i.set(l,{}),i.get(l).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const l of a.keys)i.has(l)||i.set(l,{}),i.get(l).r=!0;else e.issues.push(a);const r=[...i].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(r.length&&s&&e.issues.push({...s,keys:r}),cn(e))return e;const o=nr(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const zp=D("$ZodRecord",(e,t)=>{ke.init(e,t),e._zod.parse=(n,i)=>{const s=n.value;if(!xn(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const r=[],o=t.keyType._zod.values;if(o){n.value={};const a=new Set;for(const c of o)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);const d=t.keyType._zod.run({value:c,issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(f=>Et(f,i,At())),input:c,path:[c],inst:e});continue}const u=d.value,p=t.valueType._zod.run({value:s[c],issues:[]},i);p instanceof Promise?r.push(p.then(f=>{f.issues.length&&n.issues.push(...un(c,f.issues)),n.value[u]=f.value})):(p.issues.length&&n.issues.push(...un(c,p.issues)),n.value[u]=p.value)}let l;for(const c in s)a.has(c)||(l=l??[],l.push(c));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l})}else{n.value={};for(const a of Reflect.ownKeys(s)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,a))continue;let l=t.keyType._zod.run({value:a,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&El.test(a)&&l.issues.length){const u=t.keyType._zod.run({value:Number(a),issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");u.issues.length===0&&(l=u)}if(l.issues.length){t.mode==="loose"?n.value[a]=s[a]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(u=>Et(u,i,At())),input:a,path:[a],inst:e});continue}const d=t.valueType._zod.run({value:s[a],issues:[]},i);d instanceof Promise?r.push(d.then(u=>{u.issues.length&&n.issues.push(...un(a,u.issues)),n.value[l.value]=u.value})):(d.issues.length&&n.issues.push(...un(a,d.issues)),n.value[l.value]=d.value)}}return r.length?Promise.all(r).then(()=>n):n}}),Mp=D("$ZodEnum",(e,t)=>{ke.init(e,t);const n=yl(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(s=>Vd.has(typeof s)).map(s=>typeof s=="string"?_n(s):s.toString()).join("|")})$`),e._zod.parse=(s,r)=>{const o=s.value;return i.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:e}),s}}),jp=D("$ZodLiteral",(e,t)=>{if(ke.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?_n(i):i?_n(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,s)=>{const r=i.value;return n.has(r)||i.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),i}}),Bp=D("$ZodTransform",(e,t)=>{ke.init(e,t),e._zod.optin="optional",e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new bl(e.constructor.name);const s=t.transform(n.value,n);if(i.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(n.value=o,n.fallback=!0,n));if(s instanceof Promise)throw new gn;return n.value=s,n.fallback=!0,n}});function Ro(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Ll=D("$ZodOptional",(e,t)=>{ke.init(e,t),e._zod.optin="optional",e._zod.optout="optional",he(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),he(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Lr(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(t.innerType._zod.optin==="optional"){const s=n.value,r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>Ro(o,s)):Ro(r,s)}return n.value===void 0?n:t.innerType._zod.run(n,i)}}),Up=D("$ZodExactOptional",(e,t)=>{Ll.init(e,t),he(e._zod,"values",()=>t.innerType._zod.values),he(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),Hp=D("$ZodNullable",(e,t)=>{ke.init(e,t),he(e._zod,"optin",()=>t.innerType._zod.optin),he(e._zod,"optout",()=>t.innerType._zod.optout),he(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Lr(n.source)}|null)$`):void 0}),he(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),qp=D("$ZodDefault",(e,t)=>{ke.init(e,t),e._zod.optin="optional",he(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,i);return s instanceof Promise?s.then(r=>No(r,t)):No(s,t)}});function No(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Wp=D("$ZodPrefault",(e,t)=>{ke.init(e,t),e._zod.optin="optional",he(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),Vp=D("$ZodNonOptional",(e,t)=>{ke.init(e,t),he(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{const s=t.innerType._zod.run(n,i);return s instanceof Promise?s.then(r=>Lo(r,e)):Lo(s,e)}});function Lo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Zp=D("$ZodCatch",(e,t)=>{ke.init(e,t),e._zod.optin="optional",he(e._zod,"optout",()=>t.innerType._zod.optout),he(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const s=t.innerType._zod.run(n,i);return s instanceof Promise?s.then(r=>(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(o=>Et(o,i,At()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(r=>Et(r,i,At()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),Kp=D("$ZodPipe",(e,t)=>{ke.init(e,t),he(e._zod,"values",()=>t.in._zod.values),he(e._zod,"optin",()=>t.in._zod.optin),he(e._zod,"optout",()=>t.out._zod.optout),he(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){const r=t.out._zod.run(n,i);return r instanceof Promise?r.then(o=>mi(o,t.in,i)):mi(r,t.in,i)}const s=t.in._zod.run(n,i);return s instanceof Promise?s.then(r=>mi(r,t.out,i)):mi(s,t.out,i)}});function mi(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const Gp=D("$ZodReadonly",(e,t)=>{ke.init(e,t),he(e._zod,"propValues",()=>t.innerType._zod.propValues),he(e._zod,"values",()=>t.innerType._zod.values),he(e._zod,"optin",()=>t.innerType?._zod?.optin),he(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const s=t.innerType._zod.run(n,i);return s instanceof Promise?s.then(Fo):Fo(s)}});function Fo(e){return e.value=Object.freeze(e.value),e}const Yp=D("$ZodCustom",(e,t)=>{Ze.init(e,t),ke.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{const i=n.value,s=t.fn(i);if(s instanceof Promise)return s.then(r=>Do(r,n,i,e));Do(s,n,i,e)}});function Do(e,t,n,i){if(!e){const s={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(s.params=i._zod.def.params),t.issues.push(Qn(s))}}var zo;class Jp{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const i={...this.get(n)??{}};delete i.id;const s={...i,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Qp(){return new Jp}(zo=globalThis).__zod_globalRegistry??(zo.__zod_globalRegistry=Qp());const Bn=globalThis.__zod_globalRegistry;function Xp(e,t){return new e({type:"string",...K(t)})}function eh(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...K(t)})}function Mo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...K(t)})}function th(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...K(t)})}function nh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...K(t)})}function ih(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...K(t)})}function sh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...K(t)})}function rh(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...K(t)})}function oh(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...K(t)})}function ah(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...K(t)})}function lh(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...K(t)})}function ch(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...K(t)})}function uh(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...K(t)})}function dh(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...K(t)})}function fh(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...K(t)})}function ph(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...K(t)})}function hh(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...K(t)})}function mh(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...K(t)})}function gh(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...K(t)})}function bh(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...K(t)})}function yh(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...K(t)})}function wh(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...K(t)})}function kh(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...K(t)})}function vh(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...K(t)})}function Sh(e,t){return new e({type:"string",format:"date",check:"string_format",...K(t)})}function xh(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...K(t)})}function _h(e,t){return new e({type:"string",format:"duration",check:"string_format",...K(t)})}function Ch(e,t){return new e({type:"number",checks:[],...K(t)})}function Ah(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...K(t)})}function Eh(e,t){return new e({type:"boolean",...K(t)})}function Th(e,t){return new e({type:"null",...K(t)})}function Ih(e){return new e({type:"unknown"})}function Ph(e,t){return new e({type:"never",...K(t)})}function jo(e,t){return new Il({check:"less_than",...K(t),value:e,inclusive:!1})}function _s(e,t){return new Il({check:"less_than",...K(t),value:e,inclusive:!0})}function Bo(e,t){return new Pl({check:"greater_than",...K(t),value:e,inclusive:!1})}function Cs(e,t){return new Pl({check:"greater_than",...K(t),value:e,inclusive:!0})}function Uo(e,t){return new Hf({check:"multiple_of",...K(t),value:e})}function Fl(e,t){return new Wf({check:"max_length",...K(t),maximum:e})}function Zi(e,t){return new Vf({check:"min_length",...K(t),minimum:e})}function Dl(e,t){return new Zf({check:"length_equals",...K(t),length:e})}function Oh(e,t){return new Kf({check:"string_format",format:"regex",...K(t),pattern:e})}function $h(e){return new Gf({check:"string_format",format:"lowercase",...K(e)})}function Rh(e){return new Yf({check:"string_format",format:"uppercase",...K(e)})}function Nh(e,t){return new Jf({check:"string_format",format:"includes",...K(t),includes:e})}function Lh(e,t){return new Qf({check:"string_format",format:"starts_with",...K(t),prefix:e})}function Fh(e,t){return new Xf({check:"string_format",format:"ends_with",...K(t),suffix:e})}function Tn(e){return new ep({check:"overwrite",tx:e})}function Dh(e){return Tn(t=>t.normalize(e))}function zh(){return Tn(e=>e.trim())}function Mh(){return Tn(e=>e.toLowerCase())}function jh(){return Tn(e=>e.toUpperCase())}function Bh(){return Tn(e=>qd(e))}function Uh(e,t,n){return new e({type:"array",element:t,...K(n)})}function Hh(e,t,n){return new e({type:"custom",check:"custom",fn:t,...K(n)})}function qh(e,t){const n=Wh(i=>(i.addIssue=s=>{if(typeof s=="string")i.issues.push(Qn(s,i.value,n._zod.def));else{const r=s;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=i.value),r.inst??(r.inst=n),r.continue??(r.continue=!n._zod.def.abort),i.issues.push(Qn(r))}},e(i.value,i)),t);return n}function Wh(e,t){const n=new Ze({check:"custom",...K(t)});return n._zod.check=e,n}function zl(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Bn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Pe(e,t,n={path:[],schemaPath:[]}){var i;const s=e._zod.def,r=t.seen.get(e);if(r)return r.count++,n.schemaPath.includes(e)&&(r.cycle=n.path),r.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const a=e._zod.toJSONSchema?.();if(a)o.schema=a;else{const d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,d);else{const p=o.schema,f=t.processors[s.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);f(e,t,p,d)}const u=e._zod.parent;u&&(o.ref||(o.ref=u),Pe(u,t,d),t.seen.get(u).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(o.schema,l),t.io==="input"&&ze(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&"_prefault"in o.schema&&((i=o.schema).default??(i.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Ml(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const o of e.seen.entries()){const a=e.metadataRegistry.get(o[0])?.id;if(a){const l=i.get(a);if(l&&l!==o[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,o[0])}}const s=o=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const u=e.external.registry.get(o[0])?.id,p=e.external.uri??(m=>m);if(u)return{ref:p(u)};const f=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${f}`}}if(o[1]===n)return{ref:"#"};const c=`#/${a}/`,d=o[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:c+d}},r=o=>{if(o[1].schema.$ref)return;const a=o[1],{ref:l,defId:c}=s(o);a.def={...a.schema},c&&(a.defId=c);const d=a.schema;for(const u in d)delete d[u];d.$ref=l};if(e.cycles==="throw")for(const o of e.seen.entries()){const a=o[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
65
+ `)}f.write("payload.value = newResult;"),f.write("return payload;");const C=f.compile();return(S,I)=>C(h,S,I)};let r;const o=Wi,a=!$r.jitless,c=a&&Wd.value,d=t.catchall;let u;e._zod.parse=(h,f)=>{u??(u=i.value);const m=h.value;return o(m)?a&&c&&f?.async===!1&&f.jitless!==!0?(r||(r=s(t.shape)),h=r(h,f),d?Nl([],m,h,f,u,e):h):n(h,f):(h.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),h)}});function Oo(e,t,n,i){for(const r of e)if(r.issues.length===0)return t.value=r.value,t;const s=e.filter(r=>!cn(r));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(r=>r.issues.map(o=>Tt(o,i,At())))}),t)}const Fh=D("$ZodUnion",(e,t)=>{ke.init(e,t),pe(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),pe(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),pe(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),pe(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>Lr(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,s)=>{if(n)return n(i,s);let r=!1;const o=[];for(const a of t.options){const l=a._zod.run({value:i.value,issues:[]},s);if(l instanceof Promise)o.push(l),r=!0;else{if(l.issues.length===0)return l;o.push(l)}}return r?Promise.all(o).then(a=>Oo(a,i,e,s)):Oo(o,i,e,s)}}),Dh=D("$ZodIntersection",(e,t)=>{ke.init(e,t),e._zod.parse=(n,i)=>{const s=n.value,r=t.left._zod.run({value:s,issues:[]},i),o=t.right._zod.run({value:s,issues:[]},i);return r instanceof Promise||o instanceof Promise?Promise.all([r,o]).then(([l,c])=>$o(n,l,c)):$o(n,r,o)}});function nr(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(xn(e)&&xn(t)){const n=Object.keys(t),i=Object.keys(e).filter(r=>n.indexOf(r)!==-1),s={...e,...t};for(const r of i){const o=nr(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};s[r]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<e.length;i++){const s=e[i],r=t[i],o=nr(s,r);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function $o(e,t,n){const i=new Map;let s;for(const a of t.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const l of a.keys)i.has(l)||i.set(l,{}),i.get(l).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const l of a.keys)i.has(l)||i.set(l,{}),i.get(l).r=!0;else e.issues.push(a);const r=[...i].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(r.length&&s&&e.issues.push({...s,keys:r}),cn(e))return e;const o=nr(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const zh=D("$ZodRecord",(e,t)=>{ke.init(e,t),e._zod.parse=(n,i)=>{const s=n.value;if(!xn(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const r=[],o=t.keyType._zod.values;if(o){n.value={};const a=new Set;for(const c of o)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);const d=t.keyType._zod.run({value:c,issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(f=>Tt(f,i,At())),input:c,path:[c],inst:e});continue}const u=d.value,h=t.valueType._zod.run({value:s[c],issues:[]},i);h instanceof Promise?r.push(h.then(f=>{f.issues.length&&n.issues.push(...un(c,f.issues)),n.value[u]=f.value})):(h.issues.length&&n.issues.push(...un(c,h.issues)),n.value[u]=h.value)}let l;for(const c in s)a.has(c)||(l=l??[],l.push(c));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l})}else{n.value={};for(const a of Reflect.ownKeys(s)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,a))continue;let l=t.keyType._zod.run({value:a,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Tl.test(a)&&l.issues.length){const u=t.keyType._zod.run({value:Number(a),issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");u.issues.length===0&&(l=u)}if(l.issues.length){t.mode==="loose"?n.value[a]=s[a]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(u=>Tt(u,i,At())),input:a,path:[a],inst:e});continue}const d=t.valueType._zod.run({value:s[a],issues:[]},i);d instanceof Promise?r.push(d.then(u=>{u.issues.length&&n.issues.push(...un(a,u.issues)),n.value[l.value]=u.value})):(d.issues.length&&n.issues.push(...un(a,d.issues)),n.value[l.value]=d.value)}}return r.length?Promise.all(r).then(()=>n):n}}),Mh=D("$ZodEnum",(e,t)=>{ke.init(e,t);const n=yl(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(s=>Vd.has(typeof s)).map(s=>typeof s=="string"?_n(s):s.toString()).join("|")})$`),e._zod.parse=(s,r)=>{const o=s.value;return i.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:e}),s}}),jh=D("$ZodLiteral",(e,t)=>{if(ke.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?_n(i):i?_n(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,s)=>{const r=i.value;return n.has(r)||i.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),i}}),Bh=D("$ZodTransform",(e,t)=>{ke.init(e,t),e._zod.optin="optional",e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new bl(e.constructor.name);const s=t.transform(n.value,n);if(i.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(n.value=o,n.fallback=!0,n));if(s instanceof Promise)throw new gn;return n.value=s,n.fallback=!0,n}});function Ro(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Ll=D("$ZodOptional",(e,t)=>{ke.init(e,t),e._zod.optin="optional",e._zod.optout="optional",pe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),pe(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Lr(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(t.innerType._zod.optin==="optional"){const s=n.value,r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>Ro(o,s)):Ro(r,s)}return n.value===void 0?n:t.innerType._zod.run(n,i)}}),Uh=D("$ZodExactOptional",(e,t)=>{Ll.init(e,t),pe(e._zod,"values",()=>t.innerType._zod.values),pe(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),Hh=D("$ZodNullable",(e,t)=>{ke.init(e,t),pe(e._zod,"optin",()=>t.innerType._zod.optin),pe(e._zod,"optout",()=>t.innerType._zod.optout),pe(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Lr(n.source)}|null)$`):void 0}),pe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),qh=D("$ZodDefault",(e,t)=>{ke.init(e,t),e._zod.optin="optional",pe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,i);return s instanceof Promise?s.then(r=>No(r,t)):No(s,t)}});function No(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Wh=D("$ZodPrefault",(e,t)=>{ke.init(e,t),e._zod.optin="optional",pe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),Vh=D("$ZodNonOptional",(e,t)=>{ke.init(e,t),pe(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{const s=t.innerType._zod.run(n,i);return s instanceof Promise?s.then(r=>Lo(r,e)):Lo(s,e)}});function Lo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Zh=D("$ZodCatch",(e,t)=>{ke.init(e,t),e._zod.optin="optional",pe(e._zod,"optout",()=>t.innerType._zod.optout),pe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const s=t.innerType._zod.run(n,i);return s instanceof Promise?s.then(r=>(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(o=>Tt(o,i,At()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(r=>Tt(r,i,At()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),Kh=D("$ZodPipe",(e,t)=>{ke.init(e,t),pe(e._zod,"values",()=>t.in._zod.values),pe(e._zod,"optin",()=>t.in._zod.optin),pe(e._zod,"optout",()=>t.out._zod.optout),pe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){const r=t.out._zod.run(n,i);return r instanceof Promise?r.then(o=>mi(o,t.in,i)):mi(r,t.in,i)}const s=t.in._zod.run(n,i);return s instanceof Promise?s.then(r=>mi(r,t.out,i)):mi(s,t.out,i)}});function mi(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const Gh=D("$ZodReadonly",(e,t)=>{ke.init(e,t),pe(e._zod,"propValues",()=>t.innerType._zod.propValues),pe(e._zod,"values",()=>t.innerType._zod.values),pe(e._zod,"optin",()=>t.innerType?._zod?.optin),pe(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const s=t.innerType._zod.run(n,i);return s instanceof Promise?s.then(Fo):Fo(s)}});function Fo(e){return e.value=Object.freeze(e.value),e}const Yh=D("$ZodCustom",(e,t)=>{Ze.init(e,t),ke.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{const i=n.value,s=t.fn(i);if(s instanceof Promise)return s.then(r=>Do(r,n,i,e));Do(s,n,i,e)}});function Do(e,t,n,i){if(!e){const s={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(s.params=i._zod.def.params),t.issues.push(Qn(s))}}var zo;class Jh{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const i={...this.get(n)??{}};delete i.id;const s={...i,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Qh(){return new Jh}(zo=globalThis).__zod_globalRegistry??(zo.__zod_globalRegistry=Qh());const Bn=globalThis.__zod_globalRegistry;function Xh(e,t){return new e({type:"string",...K(t)})}function ep(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...K(t)})}function Mo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...K(t)})}function tp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...K(t)})}function np(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...K(t)})}function ip(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...K(t)})}function sp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...K(t)})}function rp(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...K(t)})}function op(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...K(t)})}function ap(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...K(t)})}function lp(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...K(t)})}function cp(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...K(t)})}function up(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...K(t)})}function dp(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...K(t)})}function fp(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...K(t)})}function hp(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...K(t)})}function pp(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...K(t)})}function mp(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...K(t)})}function gp(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...K(t)})}function bp(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...K(t)})}function yp(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...K(t)})}function wp(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...K(t)})}function kp(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...K(t)})}function vp(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...K(t)})}function Sp(e,t){return new e({type:"string",format:"date",check:"string_format",...K(t)})}function xp(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...K(t)})}function _p(e,t){return new e({type:"string",format:"duration",check:"string_format",...K(t)})}function Cp(e,t){return new e({type:"number",checks:[],...K(t)})}function Ap(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...K(t)})}function Tp(e,t){return new e({type:"boolean",...K(t)})}function Ep(e,t){return new e({type:"null",...K(t)})}function Ip(e){return new e({type:"unknown"})}function Pp(e,t){return new e({type:"never",...K(t)})}function jo(e,t){return new Il({check:"less_than",...K(t),value:e,inclusive:!1})}function _s(e,t){return new Il({check:"less_than",...K(t),value:e,inclusive:!0})}function Bo(e,t){return new Pl({check:"greater_than",...K(t),value:e,inclusive:!1})}function Cs(e,t){return new Pl({check:"greater_than",...K(t),value:e,inclusive:!0})}function Uo(e,t){return new Hf({check:"multiple_of",...K(t),value:e})}function Fl(e,t){return new Wf({check:"max_length",...K(t),maximum:e})}function Zi(e,t){return new Vf({check:"min_length",...K(t),minimum:e})}function Dl(e,t){return new Zf({check:"length_equals",...K(t),length:e})}function Op(e,t){return new Kf({check:"string_format",format:"regex",...K(t),pattern:e})}function $p(e){return new Gf({check:"string_format",format:"lowercase",...K(e)})}function Rp(e){return new Yf({check:"string_format",format:"uppercase",...K(e)})}function Np(e,t){return new Jf({check:"string_format",format:"includes",...K(t),includes:e})}function Lp(e,t){return new Qf({check:"string_format",format:"starts_with",...K(t),prefix:e})}function Fp(e,t){return new Xf({check:"string_format",format:"ends_with",...K(t),suffix:e})}function En(e){return new eh({check:"overwrite",tx:e})}function Dp(e){return En(t=>t.normalize(e))}function zp(){return En(e=>e.trim())}function Mp(){return En(e=>e.toLowerCase())}function jp(){return En(e=>e.toUpperCase())}function Bp(){return En(e=>qd(e))}function Up(e,t,n){return new e({type:"array",element:t,...K(n)})}function Hp(e,t,n){return new e({type:"custom",check:"custom",fn:t,...K(n)})}function qp(e,t){const n=Wp(i=>(i.addIssue=s=>{if(typeof s=="string")i.issues.push(Qn(s,i.value,n._zod.def));else{const r=s;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=i.value),r.inst??(r.inst=n),r.continue??(r.continue=!n._zod.def.abort),i.issues.push(Qn(r))}},e(i.value,i)),t);return n}function Wp(e,t){const n=new Ze({check:"custom",...K(t)});return n._zod.check=e,n}function zl(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Bn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Pe(e,t,n={path:[],schemaPath:[]}){var i;const s=e._zod.def,r=t.seen.get(e);if(r)return r.count++,n.schemaPath.includes(e)&&(r.cycle=n.path),r.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const a=e._zod.toJSONSchema?.();if(a)o.schema=a;else{const d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,d);else{const h=o.schema,f=t.processors[s.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);f(e,t,h,d)}const u=e._zod.parent;u&&(o.ref||(o.ref=u),Pe(u,t,d),t.seen.get(u).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(o.schema,l),t.io==="input"&&ze(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&"_prefault"in o.schema&&((i=o.schema).default??(i.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Ml(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const o of e.seen.entries()){const a=e.metadataRegistry.get(o[0])?.id;if(a){const l=i.get(a);if(l&&l!==o[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,o[0])}}const s=o=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const u=e.external.registry.get(o[0])?.id,h=e.external.uri??(m=>m);if(u)return{ref:h(u)};const f=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=f,{defId:f,ref:`${h("__shared")}#/${a}/${f}`}}if(o[1]===n)return{ref:"#"};const c=`#/${a}/`,d=o[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:c+d}},r=o=>{if(o[1].schema.$ref)return;const a=o[1],{ref:l,defId:c}=s(o);a.def={...a.schema},c&&(a.defId=c);const d=a.schema;for(const u in d)delete d[u];d.$ref=l};if(e.cycles==="throw")for(const o of e.seen.entries()){const a=o[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
66
66
 
67
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const a=o[1];if(t===o[0]){r(o);continue}if(e.external){const c=e.external.registry.get(o[0])?.id;if(t!==o[0]&&c){r(o);continue}}if(e.metadataRegistry.get(o[0])?.id){r(o);continue}if(a.cycle){r(o);continue}if(a.count>1&&e.reused==="ref"){r(o);continue}}}function jl(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=a=>{const l=e.seen.get(a);if(l.ref===null)return;const c=l.def??l.schema,d={...c},u=l.ref;if(l.ref=null,u){i(u);const f=e.seen.get(u),m=f.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):Object.assign(c,m),Object.assign(c,d),a._zod.parent===u)for(const y in c)y==="$ref"||y==="allOf"||y in d||delete c[y];if(m.$ref&&f.def)for(const y in c)y==="$ref"||y==="allOf"||y in f.def&&JSON.stringify(c[y])===JSON.stringify(f.def[y])&&delete c[y]}const p=a._zod.parent;if(p&&p!==u){i(p);const f=e.seen.get(p);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(const m in c)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(c[m])===JSON.stringify(f.def[m])&&delete c[m]}e.override({zodSchema:a,jsonSchema:c,path:l.path??[]})};for(const a of[...e.seen.entries()].reverse())i(a[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(a)}Object.assign(s,n.def??n.schema);const r=e.metadataRegistry.get(t)?.id;r!==void 0&&s.id===r&&delete s.id;const o=e.external?.defs??{};for(const a of e.seen.entries()){const l=a[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,o[l.defId]=l.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const a=JSON.parse(JSON.stringify(s));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ki(t,"input",e.processors),output:Ki(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function ze(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return ze(i.element,n);if(i.type==="set")return ze(i.valueType,n);if(i.type==="lazy")return ze(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return ze(i.innerType,n);if(i.type==="intersection")return ze(i.left,n)||ze(i.right,n);if(i.type==="record"||i.type==="map")return ze(i.keyType,n)||ze(i.valueType,n);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ze(i.in,n)||ze(i.out,n);if(i.type==="object"){for(const s in i.shape)if(ze(i.shape[s],n))return!0;return!1}if(i.type==="union"){for(const s of i.options)if(ze(s,n))return!0;return!1}if(i.type==="tuple"){for(const s of i.items)if(ze(s,n))return!0;return!!(i.rest&&ze(i.rest,n))}return!1}const Vh=(e,t={})=>n=>{const i=zl({...n,processors:t});return Pe(e,i),Ml(i,e),jl(i,e)},Ki=(e,t,n={})=>i=>{const{libraryOptions:s,target:r}=i??{},o=zl({...s??{},target:r,io:t,processors:n});return Pe(e,o),Ml(o,e),jl(o,e)},Zh={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Kh=(e,t,n,i)=>{const s=n;s.type="string";const{minimum:r,maximum:o,format:a,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof r=="number"&&(s.minLength=r),typeof o=="number"&&(s.maxLength=o),a&&(s.format=Zh[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),c&&(s.contentEncoding=c),l&&l.size>0){const d=[...l];d.length===1?s.pattern=d[0].source:d.length>1&&(s.allOf=[...d.map(u=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:u.source}))])}},Gh=(e,t,n,i)=>{const s=n,{minimum:r,maximum:o,format:a,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:d}=e._zod.bag;typeof a=="string"&&a.includes("int")?s.type="integer":s.type="number";const u=typeof d=="number"&&d>=(r??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(o??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";u?f?(s.minimum=d,s.exclusiveMinimum=!0):s.exclusiveMinimum=d:typeof r=="number"&&(s.minimum=r),p?f?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c:typeof o=="number"&&(s.maximum=o),typeof l=="number"&&(s.multipleOf=l)},Yh=(e,t,n,i)=>{n.type="boolean"},Jh=(e,t,n,i)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Qh=(e,t,n,i)=>{n.not={}},Xh=(e,t,n,i)=>{},em=(e,t,n,i)=>{const s=e._zod.def,r=yl(s.entries);r.every(o=>typeof o=="number")&&(n.type="number"),r.every(o=>typeof o=="string")&&(n.type="string"),n.enum=r},tm=(e,t,n,i)=>{const s=e._zod.def,r=[];for(const o of s.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");r.push(Number(o))}else r.push(o);if(r.length!==0)if(r.length===1){const o=r[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else r.every(o=>typeof o=="number")&&(n.type="number"),r.every(o=>typeof o=="string")&&(n.type="string"),r.every(o=>typeof o=="boolean")&&(n.type="boolean"),r.every(o=>o===null)&&(n.type="null"),n.enum=r},nm=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},im=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},sm=(e,t,n,i)=>{const s=n,r=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;typeof o=="number"&&(s.minItems=o),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=Pe(r.element,t,{...i,path:[...i.path,"items"]})},rm=(e,t,n,i)=>{const s=n,r=e._zod.def;s.type="object",s.properties={};const o=r.shape;for(const c in o)s.properties[c]=Pe(o[c],t,{...i,path:[...i.path,"properties",c]});const a=new Set(Object.keys(o)),l=new Set([...a].filter(c=>{const d=r.shape[c]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(s.required=Array.from(l)),r.catchall?._zod.def.type==="never"?s.additionalProperties=!1:r.catchall?r.catchall&&(s.additionalProperties=Pe(r.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},om=(e,t,n,i)=>{const s=e._zod.def,r=s.inclusive===!1,o=s.options.map((a,l)=>Pe(a,t,{...i,path:[...i.path,r?"oneOf":"anyOf",l]}));r?n.oneOf=o:n.anyOf=o},am=(e,t,n,i)=>{const s=e._zod.def,r=Pe(s.left,t,{...i,path:[...i.path,"allOf",0]}),o=Pe(s.right,t,{...i,path:[...i.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,l=[...a(r)?r.allOf:[r],...a(o)?o.allOf:[o]];n.allOf=l},lm=(e,t,n,i)=>{const s=n,r=e._zod.def;s.type="object";const o=r.keyType,l=o._zod.bag?.patterns;if(r.mode==="loose"&&l&&l.size>0){const d=Pe(r.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});s.patternProperties={};for(const u of l)s.patternProperties[u.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Pe(r.keyType,t,{...i,path:[...i.path,"propertyNames"]})),s.additionalProperties=Pe(r.valueType,t,{...i,path:[...i.path,"additionalProperties"]});const c=o._zod.values;if(c){const d=[...c].filter(u=>typeof u=="string"||typeof u=="number");d.length>0&&(s.required=d)}},cm=(e,t,n,i)=>{const s=e._zod.def,r=Pe(s.innerType,t,i),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[r,{type:"null"}]},um=(e,t,n,i)=>{const s=e._zod.def;Pe(s.innerType,t,i);const r=t.seen.get(e);r.ref=s.innerType},dm=(e,t,n,i)=>{const s=e._zod.def;Pe(s.innerType,t,i);const r=t.seen.get(e);r.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},fm=(e,t,n,i)=>{const s=e._zod.def;Pe(s.innerType,t,i);const r=t.seen.get(e);r.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},pm=(e,t,n,i)=>{const s=e._zod.def;Pe(s.innerType,t,i);const r=t.seen.get(e);r.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},hm=(e,t,n,i)=>{const s=e._zod.def,r=s.in._zod.traits.has("$ZodTransform"),o=t.io==="input"?r?s.out:s.in:s.out;Pe(o,t,i);const a=t.seen.get(e);a.ref=o},mm=(e,t,n,i)=>{const s=e._zod.def;Pe(s.innerType,t,i);const r=t.seen.get(e);r.ref=s.innerType,n.readOnly=!0},Bl=(e,t,n,i)=>{const s=e._zod.def;Pe(s.innerType,t,i);const r=t.seen.get(e);r.ref=s.innerType},gm=D("ZodISODateTime",(e,t)=>{hp.init(e,t),xe.init(e,t)});function bm(e){return vh(gm,e)}const ym=D("ZodISODate",(e,t)=>{mp.init(e,t),xe.init(e,t)});function wm(e){return Sh(ym,e)}const km=D("ZodISOTime",(e,t)=>{gp.init(e,t),xe.init(e,t)});function vm(e){return xh(km,e)}const Sm=D("ZodISODuration",(e,t)=>{bp.init(e,t),xe.init(e,t)});function xm(e){return _h(Sm,e)}const _m=(e,t)=>{Sl.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>rf(e,n)},flatten:{value:n=>sf(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,tr,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,tr,2)}},isEmpty:{get(){return e.issues.length===0}}})},at=D("ZodError",_m,{Parent:Error}),Cm=Dr(at),Am=zr(at),Em=is(at),Tm=ss(at),Im=lf(at),Pm=cf(at),Om=uf(at),$m=df(at),Rm=ff(at),Nm=pf(at),Lm=hf(at),Fm=mf(at),Ho=new WeakMap;function ni(e,t,n){const i=Object.getPrototypeOf(e);let s=Ho.get(i);if(s||(s=new Set,Ho.set(i,s)),!s.has(t)){s.add(t);for(const r in n){const o=n[r];Object.defineProperty(i,r,{configurable:!0,enumerable:!1,get(){const a=o.bind(this);return Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const Se=D("ZodType",(e,t)=>(ke.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ki(e,"input"),output:Ki(e,"output")}}),e.toJSONSchema=Vh(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,i)=>Cm(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>Em(e,n,i),e.parseAsync=async(n,i)=>Am(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>Tm(e,n,i),e.spa=e.safeParseAsync,e.encode=(n,i)=>Im(e,n,i),e.decode=(n,i)=>Pm(e,n,i),e.encodeAsync=async(n,i)=>Om(e,n,i),e.decodeAsync=async(n,i)=>$m(e,n,i),e.safeEncode=(n,i)=>Rm(e,n,i),e.safeDecode=(n,i)=>Nm(e,n,i),e.safeEncodeAsync=async(n,i)=>Lm(e,n,i),e.safeDecodeAsync=async(n,i)=>Fm(e,n,i),ni(e,"ZodType",{check(...n){const i=this.def;return this.clone(Nt(i,{checks:[...i.checks??[],...n.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,i){return Lt(this,n,i)},brand(){return this},register(n,i){return n.add(this,i),this},refine(n,i){return this.check(Pg(n,i))},superRefine(n,i){return this.check(Og(n,i))},overwrite(n){return this.check(Tn(n))},optional(){return Ko(this)},exactOptional(){return bg(this)},nullable(){return Go(this)},nullish(){return Ko(Go(this))},nonoptional(n){return xg(this,n)},array(){return Ne(this)},or(n){return ql([this,n])},and(n){return fg(this,n)},transform(n){return Yo(this,mg(n))},default(n){return kg(this,n)},prefault(n){return Sg(this,n)},catch(n){return Cg(this,n)},pipe(n){return Yo(this,n)},readonly(){return Tg(this)},describe(n){const i=this.clone();return Bn.add(i,{description:n}),i},meta(...n){if(n.length===0)return Bn.get(this);const i=this.clone();return Bn.add(i,n[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return Bn.get(e)?.description},configurable:!0}),e)),Ul=D("_ZodString",(e,t)=>{Mr.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(i,s,r)=>Kh(e,i,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,ni(e,"_ZodString",{regex(...i){return this.check(Oh(...i))},includes(...i){return this.check(Nh(...i))},startsWith(...i){return this.check(Lh(...i))},endsWith(...i){return this.check(Fh(...i))},min(...i){return this.check(Zi(...i))},max(...i){return this.check(Fl(...i))},length(...i){return this.check(Dl(...i))},nonempty(...i){return this.check(Zi(1,...i))},lowercase(i){return this.check($h(i))},uppercase(i){return this.check(Rh(i))},trim(){return this.check(zh())},normalize(...i){return this.check(Dh(...i))},toLowerCase(){return this.check(Mh())},toUpperCase(){return this.check(jh())},slugify(){return this.check(Bh())}})}),Dm=D("ZodString",(e,t)=>{Mr.init(e,t),Ul.init(e,t),e.email=n=>e.check(eh(zm,n)),e.url=n=>e.check(rh(Mm,n)),e.jwt=n=>e.check(kh(eg,n)),e.emoji=n=>e.check(oh(jm,n)),e.guid=n=>e.check(Mo(qo,n)),e.uuid=n=>e.check(th(gi,n)),e.uuidv4=n=>e.check(nh(gi,n)),e.uuidv6=n=>e.check(ih(gi,n)),e.uuidv7=n=>e.check(sh(gi,n)),e.nanoid=n=>e.check(ah(Bm,n)),e.guid=n=>e.check(Mo(qo,n)),e.cuid=n=>e.check(lh(Um,n)),e.cuid2=n=>e.check(ch(Hm,n)),e.ulid=n=>e.check(uh(qm,n)),e.base64=n=>e.check(bh(Jm,n)),e.base64url=n=>e.check(yh(Qm,n)),e.xid=n=>e.check(dh(Wm,n)),e.ksuid=n=>e.check(fh(Vm,n)),e.ipv4=n=>e.check(ph(Zm,n)),e.ipv6=n=>e.check(hh(Km,n)),e.cidrv4=n=>e.check(mh(Gm,n)),e.cidrv6=n=>e.check(gh(Ym,n)),e.e164=n=>e.check(wh(Xm,n)),e.datetime=n=>e.check(bm(n)),e.date=n=>e.check(wm(n)),e.time=n=>e.check(vm(n)),e.duration=n=>e.check(xm(n))});function Z(e){return Xp(Dm,e)}const xe=D("ZodStringFormat",(e,t)=>{ve.init(e,t),Ul.init(e,t)}),zm=D("ZodEmail",(e,t)=>{rp.init(e,t),xe.init(e,t)}),qo=D("ZodGUID",(e,t)=>{ip.init(e,t),xe.init(e,t)}),gi=D("ZodUUID",(e,t)=>{sp.init(e,t),xe.init(e,t)}),Mm=D("ZodURL",(e,t)=>{op.init(e,t),xe.init(e,t)}),jm=D("ZodEmoji",(e,t)=>{ap.init(e,t),xe.init(e,t)}),Bm=D("ZodNanoID",(e,t)=>{lp.init(e,t),xe.init(e,t)}),Um=D("ZodCUID",(e,t)=>{cp.init(e,t),xe.init(e,t)}),Hm=D("ZodCUID2",(e,t)=>{up.init(e,t),xe.init(e,t)}),qm=D("ZodULID",(e,t)=>{dp.init(e,t),xe.init(e,t)}),Wm=D("ZodXID",(e,t)=>{fp.init(e,t),xe.init(e,t)}),Vm=D("ZodKSUID",(e,t)=>{pp.init(e,t),xe.init(e,t)}),Zm=D("ZodIPv4",(e,t)=>{yp.init(e,t),xe.init(e,t)}),Km=D("ZodIPv6",(e,t)=>{wp.init(e,t),xe.init(e,t)}),Gm=D("ZodCIDRv4",(e,t)=>{kp.init(e,t),xe.init(e,t)}),Ym=D("ZodCIDRv6",(e,t)=>{vp.init(e,t),xe.init(e,t)}),Jm=D("ZodBase64",(e,t)=>{Sp.init(e,t),xe.init(e,t)}),Qm=D("ZodBase64URL",(e,t)=>{_p.init(e,t),xe.init(e,t)}),Xm=D("ZodE164",(e,t)=>{Cp.init(e,t),xe.init(e,t)}),eg=D("ZodJWT",(e,t)=>{Ep.init(e,t),xe.init(e,t)}),Hl=D("ZodNumber",(e,t)=>{$l.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(i,s,r)=>Gh(e,i,s),ni(e,"ZodNumber",{gt(i,s){return this.check(Bo(i,s))},gte(i,s){return this.check(Cs(i,s))},min(i,s){return this.check(Cs(i,s))},lt(i,s){return this.check(jo(i,s))},lte(i,s){return this.check(_s(i,s))},max(i,s){return this.check(_s(i,s))},int(i){return this.check(Wo(i))},safe(i){return this.check(Wo(i))},positive(i){return this.check(Bo(0,i))},nonnegative(i){return this.check(Cs(0,i))},negative(i){return this.check(jo(0,i))},nonpositive(i){return this.check(_s(0,i))},multipleOf(i,s){return this.check(Uo(i,s))},step(i,s){return this.check(Uo(i,s))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Wt(e){return Ch(Hl,e)}const tg=D("ZodNumberFormat",(e,t)=>{Tp.init(e,t),Hl.init(e,t)});function Wo(e){return Ah(tg,e)}const ng=D("ZodBoolean",(e,t)=>{Ip.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Yh(e,n,i)});function Gi(e){return Eh(ng,e)}const ig=D("ZodNull",(e,t)=>{Pp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Jh(e,n,i)});function sg(e){return Th(ig,e)}const rg=D("ZodUnknown",(e,t)=>{Op.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Xh()});function Vo(){return Ih(rg)}const og=D("ZodNever",(e,t)=>{$p.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Qh(e,n,i)});function ag(e){return Ph(og,e)}const lg=D("ZodArray",(e,t)=>{Rp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>sm(e,n,i,s),e.element=t.element,ni(e,"ZodArray",{min(n,i){return this.check(Zi(n,i))},nonempty(n){return this.check(Zi(1,n))},max(n,i){return this.check(Fl(n,i))},length(n,i){return this.check(Dl(n,i))},unwrap(){return this.element}})});function Ne(e,t){return Uh(lg,e,t)}const cg=D("ZodObject",(e,t)=>{Lp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>rm(e,n,i,s),he(e,"shape",()=>t.shape),ni(e,"ZodObject",{keyof(){return yt(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Vo()})},loose(){return this.clone({...this._zod.def,catchall:Vo()})},strict(){return this.clone({...this._zod.def,catchall:ag()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return Jd(this,n)},safeExtend(n){return Qd(this,n)},merge(n){return Xd(this,n)},pick(n){return Gd(this,n)},omit(n){return Yd(this,n)},partial(...n){return ef(Vl,this,n[0])},required(...n){return tf(Zl,this,n[0])}})});function je(e,t){const n={type:"object",shape:e??{},...K(t)};return new cg(n)}const ug=D("ZodUnion",(e,t)=>{Fp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>om(e,n,i,s),e.options=t.options});function ql(e,t){return new ug({type:"union",options:e,...K(t)})}const dg=D("ZodIntersection",(e,t)=>{Dp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>am(e,n,i,s)});function fg(e,t){return new dg({type:"intersection",left:e,right:t})}const Zo=D("ZodRecord",(e,t)=>{zp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>lm(e,n,i,s),e.keyType=t.keyType,e.valueType=t.valueType});function dn(e,t,n){return!t||!t._zod?new Zo({type:"record",keyType:Z(),valueType:e,...K(t)}):new Zo({type:"record",keyType:e,valueType:t,...K(n)})}const ir=D("ZodEnum",(e,t)=>{Mp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(i,s,r)=>em(e,i,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(i,s)=>{const r={};for(const o of i)if(n.has(o))r[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new ir({...t,checks:[],...K(s),entries:r})},e.exclude=(i,s)=>{const r={...t.entries};for(const o of i)if(n.has(o))delete r[o];else throw new Error(`Key ${o} not found in enum`);return new ir({...t,checks:[],...K(s),entries:r})}});function yt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new ir({type:"enum",entries:n,...K(t)})}const pg=D("ZodLiteral",(e,t)=>{jp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>tm(e,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Wl(e,t){return new pg({type:"literal",values:Array.isArray(e)?e:[e],...K(t)})}const hg=D("ZodTransform",(e,t)=>{Bp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>im(e,n),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new bl(e.constructor.name);n.addIssue=r=>{if(typeof r=="string")n.issues.push(Qn(r,n.value,t));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(Qn(o))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(r=>(n.value=r,n.fallback=!0,n)):(n.value=s,n.fallback=!0,n)}});function mg(e){return new hg({type:"transform",transform:e})}const Vl=D("ZodOptional",(e,t)=>{Ll.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Bl(e,n,i,s),e.unwrap=()=>e._zod.def.innerType});function Ko(e){return new Vl({type:"optional",innerType:e})}const gg=D("ZodExactOptional",(e,t)=>{Up.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Bl(e,n,i,s),e.unwrap=()=>e._zod.def.innerType});function bg(e){return new gg({type:"optional",innerType:e})}const yg=D("ZodNullable",(e,t)=>{Hp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>cm(e,n,i,s),e.unwrap=()=>e._zod.def.innerType});function Go(e){return new yg({type:"nullable",innerType:e})}const wg=D("ZodDefault",(e,t)=>{qp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>dm(e,n,i,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function kg(e,t){return new wg({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():kl(t)}})}const vg=D("ZodPrefault",(e,t)=>{Wp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>fm(e,n,i,s),e.unwrap=()=>e._zod.def.innerType});function Sg(e,t){return new vg({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():kl(t)}})}const Zl=D("ZodNonOptional",(e,t)=>{Vp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>um(e,n,i,s),e.unwrap=()=>e._zod.def.innerType});function xg(e,t){return new Zl({type:"nonoptional",innerType:e,...K(t)})}const _g=D("ZodCatch",(e,t)=>{Zp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>pm(e,n,i,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Cg(e,t){return new _g({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ag=D("ZodPipe",(e,t)=>{Kp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>hm(e,n,i,s),e.in=t.in,e.out=t.out});function Yo(e,t){return new Ag({type:"pipe",in:e,out:t})}const Eg=D("ZodReadonly",(e,t)=>{Gp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>mm(e,n,i,s),e.unwrap=()=>e._zod.def.innerType});function Tg(e){return new Eg({type:"readonly",innerType:e})}const Ig=D("ZodCustom",(e,t)=>{Yp.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>nm(e,n)});function Pg(e,t={}){return Hh(Ig,e,t)}function Og(e,t){return qh(e,t)}const $g=je({ref:Z()}),Rg=je({id:Z(),width:Wt(),children:Ne($g)}),Ng=je({type:Wl("row"),id:Z(),columns:Ne(Rg)}),Lg=je({type:Wl("stack"),children:Ne(Ng)});function Fg(e){return JSON.stringify(e)}function Dg(e){if(!e)return{type:"stack",children:[]};try{return Lg.parse(JSON.parse(e))}catch{return{type:"stack",children:[]}}}function Jo(e){if(e)throw e}var a_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function os(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var As,Qo;function zg(){if(Qo)return As;Qo=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},r=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var d=e.call(c,"constructor"),u=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!u)return!1;var p;for(p in c);return typeof p>"u"||e.call(c,p)},o=function(c,d){n&&d.name==="__proto__"?n(c,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):c[d.name]=d.newValue},a=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(i)return i(c,d).value}else return;return c[d]};return As=function l(){var c,d,u,p,f,m,h=arguments[0],y=1,w=arguments.length,C=!1;for(typeof h=="boolean"&&(C=h,h=arguments[1]||{},y=2),(h==null||typeof h!="object"&&typeof h!="function")&&(h={});y<w;++y)if(c=arguments[y],c!=null)for(d in c)u=a(h,d),p=a(c,d),h!==p&&(C&&p&&(r(p)||(f=s(p)))?(f?(f=!1,m=u&&s(u)?u:[]):m=u&&r(u)?u:{},o(h,{name:d,newValue:l(C,m,p)})):typeof p<"u"&&o(h,{name:d,newValue:p}));return h},As}var Mg=zg();const Es=os(Mg);function l_(){}function c_(){}function sr(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function jg(){const e=[],t={run:n,use:i};return t;function n(...s){let r=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...s);function a(l,...c){const d=e[++r];let u=-1;if(l){o(l);return}for(;++u<s.length;)(c[u]===null||c[u]===void 0)&&(c[u]=s[u]);s=c,d?Bg(d,a)(...c):o(null,...c)}}function i(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function Bg(e,t){let n;return i;function i(...o){const a=e.length>o.length;let l;a&&o.push(s);try{l=e.apply(this,o)}catch(c){const d=c;if(a&&n)throw d;return s(d)}a||(l&&l.then&&typeof l.then=="function"?l.then(r,s):l instanceof Error?s(l):r(l))}function s(o,...a){n||(n=!0,t(o,...a))}function r(o){s(null,o)}}function Vn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Xo(e.position):"start"in e||"end"in e?Xo(e):"line"in e||"column"in e?rr(e):""}function rr(e){return ea(e&&e.line)+":"+ea(e&&e.column)}function Xo(e){return rr(e&&e.start)+"-"+rr(e&&e.end)}function ea(e){return e&&typeof e=="number"?e:1}class Ke extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let s="",r={},o=!1;if(n&&("line"in n&&"column"in n?r={place:n}:"start"in n&&"end"in n?r={place:n}:"type"in n?r={ancestors:[n],place:n.position}:r={...n}),typeof t=="string"?s=t:!r.cause&&t&&(o=!0,s=t.message,r.cause=t),!r.ruleId&&!r.source&&typeof i=="string"){const l=i.indexOf(":");l===-1?r.ruleId=i:(r.source=i.slice(0,l),r.ruleId=i.slice(l+1))}if(!r.place&&r.ancestors&&r.ancestors){const l=r.ancestors[r.ancestors.length-1];l&&(r.place=l.position)}const a=r.place&&"start"in r.place?r.place.start:r.place;this.ancestors=r.ancestors||void 0,this.cause=r.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=a?a.line:void 0,this.name=Vn(r.place)||"1:1",this.place=r.place||void 0,this.reason=this.message,this.ruleId=r.ruleId||void 0,this.source=r.source||void 0,this.stack=o&&r.cause&&typeof r.cause.stack=="string"?r.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ke.prototype.file="";Ke.prototype.name="";Ke.prototype.reason="";Ke.prototype.message="";Ke.prototype.stack="";Ke.prototype.column=void 0;Ke.prototype.line=void 0;Ke.prototype.ancestors=void 0;Ke.prototype.cause=void 0;Ke.prototype.fatal=void 0;Ke.prototype.place=void 0;Ke.prototype.ruleId=void 0;Ke.prototype.source=void 0;const bt={basename:Ug,dirname:Hg,extname:qg,join:Wg,sep:"/"};function Ug(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ii(e);let n=0,i=-1,s=e.length,r;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(r){n=s+1;break}}else i<0&&(r=!0,i=s+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let o=-1,a=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(r){n=s+1;break}}else o<0&&(r=!0,o=s+1),a>-1&&(e.codePointAt(s)===t.codePointAt(a--)?a<0&&(i=s):(a=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function Hg(e){if(ii(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function qg(e){ii(e);let t=e.length,n=-1,i=0,s=-1,r=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){i=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?s<0?s=t:r!==1&&(r=1):s>-1&&(r=-1)}return s<0||n<0||r===0||r===1&&s===n-1&&s===i+1?"":e.slice(s,n)}function Wg(...e){let t=-1,n;for(;++t<e.length;)ii(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Vg(n)}function Vg(e){ii(e);const t=e.codePointAt(0)===47;let n=Zg(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Zg(e,t){let n="",i=0,s=-1,r=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(s===o-1||r===1))if(s!==o-1&&r===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",i=0):(n=n.slice(0,l),i=n.length-1-n.lastIndexOf("/")),s=o,r=0;continue}}else if(n.length>0){n="",i=0,s=o,r=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),i=o-s-1;s=o,r=0}else a===46&&r>-1?r++:r=-1}return n}function ii(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Kg={cwd:Gg};function Gg(){return"/"}function or(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Yg(e){if(typeof e=="string")e=new URL(e);else if(!or(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Jg(e)}function Jg(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Ts=["history","path","basename","stem","extname","dirname"];class Qg{constructor(t){let n;t?or(t)?n={path:t}:typeof t=="string"||Xg(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Kg.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Ts.length;){const r=Ts[i];r in n&&n[r]!==void 0&&n[r]!==null&&(this[r]=r==="history"?[...n[r]]:n[r])}let s;for(s in n)Ts.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?bt.basename(this.path):void 0}set basename(t){Ps(t,"basename"),Is(t,"basename"),this.path=bt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?bt.dirname(this.path):void 0}set dirname(t){ta(this.basename,"dirname"),this.path=bt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?bt.extname(this.path):void 0}set extname(t){if(Is(t,"extname"),ta(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=bt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){or(t)&&(t=Yg(t)),Ps(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?bt.basename(this.path,this.extname):void 0}set stem(t){Ps(t,"stem"),Is(t,"stem"),this.path=bt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const s=this.message(t,n,i);throw s.fatal=!0,s}info(t,n,i){const s=this.message(t,n,i);return s.fatal=void 0,s}message(t,n,i){const s=new Ke(t,n,i);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Is(e,t){if(e&&e.includes(bt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+bt.sep+"`")}function Ps(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ta(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Xg(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const eb=(function(e){const i=this.constructor.prototype,s=i[e],r=function(){return s.apply(r,arguments)};return Object.setPrototypeOf(r,i),r}),tb={}.hasOwnProperty;class jr extends eb{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=jg()}copy(){const t=new jr;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(Es(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Rs("data",this.frozen),this.namespace[t]=n,this):tb.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Rs("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const s=n.call(t,...i);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=bi(t),i=this.parser||this.Parser;return Os("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),Os("process",this.parser||this.Parser),$s("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(r,o){const a=bi(t),l=i.parse(a);i.run(l,a,function(d,u,p){if(d||!u||!p)return c(d);const f=u,m=i.stringify(f,p);ib(m)?p.value=m:p.result=m,c(d,p)});function c(d,u){d||!u?o(d):r?r(u):n(void 0,u)}}}processSync(t){let n=!1,i;return this.freeze(),Os("processSync",this.parser||this.Parser),$s("processSync",this.compiler||this.Compiler),this.process(t,s),ia("processSync","process",n),i;function s(r,o){n=!0,Jo(r),i=o}}run(t,n,i){na(t),this.freeze();const s=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?r(void 0,i):new Promise(r);function r(o,a){const l=bi(n);s.run(t,l,c);function c(d,u,p){const f=u||t;d?a(d):o?o(f):i(void 0,f,p)}}}runSync(t,n){let i=!1,s;return this.run(t,n,r),ia("runSync","run",i),s;function r(o,a){Jo(o),s=a,i=!0}}stringify(t,n){this.freeze();const i=bi(n),s=this.compiler||this.Compiler;return $s("stringify",s),na(t),s(t,i)}use(t,...n){const i=this.attachers,s=this.namespace;if(Rs("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function r(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...u]=c;l(d,u)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(s.settings=Es(!0,s.settings,c.settings))}function a(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const u=c[d];r(u)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,d){let u=-1,p=-1;for(;++u<i.length;)if(i[u][0]===c){p=u;break}if(p===-1)i.push([c,...d]);else if(d.length>0){let[f,...m]=d;const h=i[p][1];sr(h)&&sr(f)&&(f=Es(!0,h,f)),i[p]=[c,f,...m]}}}}const Kl=new jr().freeze();function Os(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function $s(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Rs(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function na(e){if(!sr(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ia(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function bi(e){return nb(e)?e:new Qg(e)}function nb(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ib(e){return typeof e=="string"||sb(e)}function sb(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const rb={};function Br(e,t){const n=rb,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Gl(e,i,s)}function Gl(e,t,n){if(ob(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return sa(e.children,t,n)}return Array.isArray(e)?sa(e,t,n):""}function sa(e,t,n){const i=[];let s=-1;for(;++s<e.length;)i[s]=Gl(e[s],t,n);return i.join("")}function ob(e){return!!(e&&typeof e=="object")}const ra=document.createElement("i");function Ur(e){const t="&"+e+";";ra.innerHTML=t;const n=ra.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Qe(e,t,n,i){const s=e.length;let r=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);r<i.length;)o=i.slice(r,r+1e4),o.unshift(t,0),e.splice(...o),r+=1e4,t+=1e4}function it(e,t){return e.length>0?(Qe(e,e.length,0,t),e):t}const oa={}.hasOwnProperty;function Yl(e){const t={};let n=-1;for(;++n<e.length;)ab(t,e[n]);return t}function ab(e,t){let n;for(n in t){const s=(oa.call(e,n)?e[n]:void 0)||(e[n]={}),r=t[n];let o;if(r)for(o in r){oa.call(s,o)||(s[o]=[]);const a=r[o];lb(s[o],Array.isArray(a)?a:a?[a]:[])}}}function lb(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);Qe(e,0,0,i)}function Jl(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ht(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Be=Ft(/[A-Za-z]/),Ve=Ft(/[\dA-Za-z]/),cb=Ft(/[#-'*+\--9=?A-Z^-~]/);function Yi(e){return e!==null&&(e<32||e===127)}const ar=Ft(/\d/),ub=Ft(/[\dA-Fa-f]/),db=Ft(/[!-/:-@[-`{-~]/);function G(e){return e!==null&&e<-2}function ge(e){return e!==null&&(e<0||e===32)}function se(e){return e===-2||e===-1||e===32}const as=Ft(new RegExp("\\p{P}|\\p{S}","u")),Vt=Ft(/\s/);function Ft(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function le(e,t,n,i){const s=i?i-1:Number.POSITIVE_INFINITY;let r=0;return o;function o(l){return se(l)?(e.enter(n),a(l)):t(l)}function a(l){return se(l)&&r++<s?(e.consume(l),a):(e.exit(n),t(l))}}const fb={tokenize:pb};function pb(e){const t=e.attempt(this.parser.constructs.contentInitial,i,s);let n;return t;function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),le(e,t,"linePrefix")}function s(a){return e.enter("paragraph"),r(a)}function r(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return G(a)?(e.consume(a),e.exit("chunkText"),r):(e.consume(a),o)}}const hb={tokenize:mb},aa={tokenize:gb};function mb(e){const t=this,n=[];let i=0,s,r,o;return a;function a(S){if(i<n.length){const I=n[i];return t.containerState=I[1],e.attempt(I[0].continuation,l,c)(S)}return c(S)}function l(S){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&C();const I=t.events.length;let O=I,k;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){k=t.events[O][1].end;break}w(i);let T=I;for(;T<t.events.length;)t.events[T][1].end={...k},T++;return Qe(t.events,O+1,0,t.events.slice(I)),t.events.length=T,c(S)}return a(S)}function c(S){if(i===n.length){if(!s)return p(S);if(s.currentConstruct&&s.currentConstruct.concrete)return m(S);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(aa,d,u)(S)}function d(S){return s&&C(),w(i),p(S)}function u(S){return t.parser.lazy[t.now().line]=i!==n.length,o=t.now().offset,m(S)}function p(S){return t.containerState={},e.attempt(aa,f,m)(S)}function f(S){return i++,n.push([t.currentConstruct,t.containerState]),p(S)}function m(S){if(S===null){s&&C(),w(0),e.consume(S);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:r}),h(S)}function h(S){if(S===null){y(e.exit("chunkFlow"),!0),w(0),e.consume(S);return}return G(S)?(e.consume(S),y(e.exit("chunkFlow")),i=0,t.interrupt=void 0,a):(e.consume(S),h)}function y(S,I){const O=t.sliceStream(S);if(I&&O.push(null),S.previous=r,r&&(r.next=S),r=S,s.defineSkip(S.start),s.write(O),t.parser.lazy[S.start.line]){let k=s.events.length;for(;k--;)if(s.events[k][1].start.offset<o&&(!s.events[k][1].end||s.events[k][1].end.offset>o))return;const T=t.events.length;let $=T,W,R;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){if(W){R=t.events[$][1].end;break}W=!0}for(w(i),k=T;k<t.events.length;)t.events[k][1].end={...R},k++;Qe(t.events,$+1,0,t.events.slice(T)),t.events.length=k}}function w(S){let I=n.length;for(;I-- >S;){const O=n[I];t.containerState=O[1],O[0].exit.call(t,e)}n.length=S}function C(){s.write([null]),r=void 0,s=void 0,t.containerState._closeFlow=void 0}}function gb(e,t,n){return le(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Cn(e){if(e===null||ge(e)||Vt(e))return 1;if(as(e))return 2}function ls(e,t,n){const i=[];let s=-1;for(;++s<e.length;){const r=e[s].resolveAll;r&&!i.includes(r)&&(t=r(t,n),i.push(r))}return t}const lr={name:"attention",resolveAll:bb,tokenize:yb};function bb(e,t){let n=-1,i,s,r,o,a,l,c,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const u={...e[i][1].end},p={...e[n][1].start};la(u,-l),la(p,l),o={type:l>1?"strongSequence":"emphasisSequence",start:u,end:{...e[i][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},r={type:l>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[i][1].end={...o.start},e[n][1].start={...a.end},c=[],e[i][1].end.offset-e[i][1].start.offset&&(c=it(c,[["enter",e[i][1],t],["exit",e[i][1],t]])),c=it(c,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",r,t]]),c=it(c,ls(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),c=it(c,[["exit",r,t],["enter",a,t],["exit",a,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=it(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Qe(e,i-1,n-i+3,c),n=i+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function yb(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,s=Cn(i);let r;return o;function o(l){return r=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===r)return e.consume(l),a;const c=e.exit("attentionSequence"),d=Cn(l),u=!d||d===2&&s||n.includes(l),p=!s||s===2&&d||n.includes(i);return c._open=!!(r===42?u:u&&(s||!p)),c._close=!!(r===42?p:p&&(d||!u)),t(l)}}function la(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const wb={name:"autolink",tokenize:kb};function kb(e,t,n){let i=0;return s;function s(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),r}function r(f){return Be(f)?(e.consume(f),o):f===64?n(f):c(f)}function o(f){return f===43||f===45||f===46||Ve(f)?(i=1,a(f)):c(f)}function a(f){return f===58?(e.consume(f),i=0,l):(f===43||f===45||f===46||Ve(f))&&i++<32?(e.consume(f),a):(i=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||Yi(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),d):cb(f)?(e.consume(f),c):n(f)}function d(f){return Ve(f)?u(f):n(f)}function u(f){return f===46?(e.consume(f),i=0,d):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):p(f)}function p(f){if((f===45||Ve(f))&&i++<63){const m=f===45?p:u;return e.consume(f),m}return n(f)}}const si={partial:!0,tokenize:vb};function vb(e,t,n){return i;function i(r){return se(r)?le(e,s,"linePrefix")(r):s(r)}function s(r){return r===null||G(r)?t(r):n(r)}}const Ql={continuation:{tokenize:xb},exit:_b,name:"blockQuote",tokenize:Sb};function Sb(e,t,n){const i=this;return s;function s(o){if(o===62){const a=i.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),r}return n(o)}function r(o){return se(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function xb(e,t,n){const i=this;return s;function s(o){return se(o)?le(e,r,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):r(o)}function r(o){return e.attempt(Ql,t,n)(o)}}function _b(e){e.exit("blockQuote")}const Xl={name:"characterEscape",tokenize:Cb};function Cb(e,t,n){return i;function i(r){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(r),e.exit("escapeMarker"),s}function s(r){return db(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}const ec={name:"characterReference",tokenize:Ab};function Ab(e,t,n){const i=this;let s=0,r,o;return a;function a(u){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),l}function l(u){return u===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(u),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),r=31,o=Ve,d(u))}function c(u){return u===88||u===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(u),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,o=ub,d):(e.enter("characterReferenceValue"),r=7,o=ar,d(u))}function d(u){if(u===59&&s){const p=e.exit("characterReferenceValue");return o===Ve&&!Ur(i.sliceSerialize(p))?n(u):(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(u)&&s++<r?(e.consume(u),d):n(u)}}const ca={partial:!0,tokenize:Tb},ua={concrete:!0,name:"codeFenced",tokenize:Eb};function Eb(e,t,n){const i=this,s={partial:!0,tokenize:O};let r=0,o=0,a;return l;function l(k){return c(k)}function c(k){const T=i.events[i.events.length-1];return r=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(k)}function d(k){return k===a?(o++,e.consume(k),d):o<3?n(k):(e.exit("codeFencedFenceSequence"),se(k)?le(e,u,"whitespace")(k):u(k))}function u(k){return k===null||G(k)?(e.exit("codeFencedFence"),i.interrupt?t(k):e.check(ca,h,I)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||G(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(k)):se(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),le(e,f,"whitespace")(k)):k===96&&k===a?n(k):(e.consume(k),p)}function f(k){return k===null||G(k)?u(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||G(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(k)):k===96&&k===a?n(k):(e.consume(k),m)}function h(k){return e.attempt(s,I,y)(k)}function y(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),w}function w(k){return r>0&&se(k)?le(e,C,"linePrefix",r+1)(k):C(k)}function C(k){return k===null||G(k)?e.check(ca,h,I)(k):(e.enter("codeFlowValue"),S(k))}function S(k){return k===null||G(k)?(e.exit("codeFlowValue"),C(k)):(e.consume(k),S)}function I(k){return e.exit("codeFenced"),t(k)}function O(k,T,$){let W=0;return R;function R(ne){return k.enter("lineEnding"),k.consume(ne),k.exit("lineEnding"),H}function H(ne){return k.enter("codeFencedFence"),se(ne)?le(k,B,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ne):B(ne)}function B(ne){return ne===a?(k.enter("codeFencedFenceSequence"),te(ne)):$(ne)}function te(ne){return ne===a?(W++,k.consume(ne),te):W>=o?(k.exit("codeFencedFenceSequence"),se(ne)?le(k,ce,"whitespace")(ne):ce(ne)):$(ne)}function ce(ne){return ne===null||G(ne)?(k.exit("codeFencedFence"),T(ne)):$(ne)}}}function Tb(e,t,n){const i=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r)}function r(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}const Ns={name:"codeIndented",tokenize:Pb},Ib={partial:!0,tokenize:Ob};function Pb(e,t,n){const i=this;return s;function s(c){return e.enter("codeIndented"),le(e,r,"linePrefix",5)(c)}function r(c){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):G(c)?e.attempt(Ib,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||G(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function Ob(e,t,n){const i=this;return s;function s(o){return i.parser.lazy[i.now().line]?n(o):G(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):le(e,r,"linePrefix",5)(o)}function r(o){const a=i.events[i.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):G(o)?s(o):n(o)}}const $b={name:"codeText",previous:Nb,resolve:Rb,tokenize:Lb};function Rb(e){let t=e.length-4,n=3,i,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)s===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(s=i):(i===t||e[i][1].type==="lineEnding")&&(e[s][1].type="codeTextData",i!==s+2&&(e[s][1].end=e[i-1][1].end,e.splice(s+2,i-s-2),t-=i-s-2,i=s+2),s=void 0);return e}function Nb(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Lb(e,t,n){let i=0,s,r;return o;function o(u){return e.enter("codeText"),e.enter("codeTextSequence"),a(u)}function a(u){return u===96?(e.consume(u),i++,a):(e.exit("codeTextSequence"),l(u))}function l(u){return u===null?n(u):u===32?(e.enter("space"),e.consume(u),e.exit("space"),l):u===96?(r=e.enter("codeTextSequence"),s=0,d(u)):G(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(u))}function c(u){return u===null||u===32||u===96||G(u)?(e.exit("codeTextData"),l(u)):(e.consume(u),c)}function d(u){return u===96?(e.consume(u),s++,d):s===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(u)):(r.type="codeTextData",c(u))}}class Fb{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const s=n||0;this.setCursor(Math.trunc(t));const r=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return i&&zn(this.left,i),r.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),zn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),zn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);zn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);zn(this.left,n.reverse())}}}function zn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function tc(e){const t={};let n=-1,i,s,r,o,a,l,c;const d=new Fb(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(i=d.get(n),n&&i[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=i[1]._tokenizer.events,r=0,r<l.length&&l[r][1].type==="lineEndingBlank"&&(r+=2),r<l.length&&l[r][1].type==="content"))for(;++r<l.length&&l[r][1].type!=="content";)l[r][1].type==="chunkText"&&(l[r][1]._isInFirstContentOfListItem=!0,r++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,Db(d,n)),n=t[n],c=!0);else if(i[1]._container){for(r=n,s=void 0;r--;)if(o=d.get(r),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(d.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=r);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(i[1].end={...d.get(s)[1].start},a=d.slice(s,n),a.unshift(i),d.splice(s,n-s+1,a))}}return Qe(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function Db(e,t){const n=e.get(t)[1],i=e.get(t)[2];let s=t-1;const r=[];let o=n._tokenizer;o||(o=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],c={};let d,u,p=-1,f=n,m=0,h=0;const y=[h];for(;f;){for(;e.get(++s)[1]!==f;);r.push(s),f._tokenizer||(d=i.sliceStream(f),f.next||d.push(null),u&&o.defineSkip(f.start),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),u=f,f=f.next}for(f=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(h=p+1,y.push(h),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(o.events=[],f?(f._tokenizer=void 0,f.previous=void 0):y.pop(),p=y.length;p--;){const w=a.slice(y[p],y[p+1]),C=r.pop();l.push([C,C+w.length-1]),e.splice(C,2,w)}for(l.reverse(),p=-1;++p<l.length;)c[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return c}const zb={resolve:jb,tokenize:Bb},Mb={partial:!0,tokenize:Ub};function jb(e){return tc(e),e}function Bb(e,t){let n;return i;function i(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(a)}function s(a){return a===null?r(a):G(a)?e.check(Mb,o,r)(a):(e.consume(a),s)}function r(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function Ub(e,t,n){const i=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),le(e,r,"linePrefix")}function r(o){if(o===null||G(o))return n(o);const a=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(i.parser.constructs.flow,n,t)(o)}}function nc(e,t,n,i,s,r,o,a,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return u;function u(w){return w===60?(e.enter(i),e.enter(s),e.enter(r),e.consume(w),e.exit(r),p):w===null||w===32||w===41||Yi(w)?n(w):(e.enter(i),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),h(w))}function p(w){return w===62?(e.enter(r),e.consume(w),e.exit(r),e.exit(s),e.exit(i),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(w))}function f(w){return w===62?(e.exit("chunkString"),e.exit(a),p(w)):w===null||w===60||G(w)?n(w):(e.consume(w),w===92?m:f)}function m(w){return w===60||w===62||w===92?(e.consume(w),f):f(w)}function h(w){return!d&&(w===null||w===41||ge(w))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(i),t(w)):d<c&&w===40?(e.consume(w),d++,h):w===41?(e.consume(w),d--,h):w===null||w===32||w===40||Yi(w)?n(w):(e.consume(w),w===92?y:h)}function y(w){return w===40||w===41||w===92?(e.consume(w),h):h(w)}}function ic(e,t,n,i,s,r){const o=this;let a=0,l;return c;function c(f){return e.enter(i),e.enter(s),e.consume(f),e.exit(s),e.enter(r),d}function d(f){return a>999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(f):f===93?(e.exit(r),e.enter(s),e.consume(f),e.exit(s),e.exit(i),t):G(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===null||f===91||f===93||G(f)||a++>999?(e.exit("chunkString"),d(f)):(e.consume(f),l||(l=!se(f)),f===92?p:u)}function p(f){return f===91||f===92||f===93?(e.consume(f),a++,u):u(f)}}function sc(e,t,n,i,s,r){let o;return a;function a(p){return p===34||p===39||p===40?(e.enter(i),e.enter(s),e.consume(p),e.exit(s),o=p===40?41:p,l):n(p)}function l(p){return p===o?(e.enter(s),e.consume(p),e.exit(s),e.exit(i),t):(e.enter(r),c(p))}function c(p){return p===o?(e.exit(r),l(o)):p===null?n(p):G(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),le(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===o||p===null||G(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?u:d)}function u(p){return p===o||p===92?(e.consume(p),d):d(p)}}function Zn(e,t){let n;return i;function i(s){return G(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,i):se(s)?le(e,i,n?"linePrefix":"lineSuffix")(s):t(s)}}const Hb={name:"definition",tokenize:Wb},qb={partial:!0,tokenize:Vb};function Wb(e,t,n){const i=this;let s;return r;function r(f){return e.enter("definition"),o(f)}function o(f){return ic.call(i,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return s=ht(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return ge(f)?Zn(e,c)(f):c(f)}function c(f){return nc(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(qb,u,u)(f)}function u(f){return se(f)?le(e,p,"whitespace")(f):p(f)}function p(f){return f===null||G(f)?(e.exit("definition"),i.parser.defined.push(s),t(f)):n(f)}}function Vb(e,t,n){return i;function i(a){return ge(a)?Zn(e,s)(a):n(a)}function s(a){return sc(e,r,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function r(a){return se(a)?le(e,o,"whitespace")(a):o(a)}function o(a){return a===null||G(a)?t(a):n(a)}}const Zb={name:"hardBreakEscape",tokenize:Kb};function Kb(e,t,n){return i;function i(r){return e.enter("hardBreakEscape"),e.consume(r),s}function s(r){return G(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}const Gb={name:"headingAtx",resolve:Yb,tokenize:Jb};function Yb(e,t){let n=e.length-2,i=3,s,r;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(s={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},r={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Qe(e,i,n-i+1,[["enter",s,t],["enter",r,t],["exit",r,t],["exit",s,t]])),e}function Jb(e,t,n){let i=0;return s;function s(d){return e.enter("atxHeading"),r(d)}function r(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&i++<6?(e.consume(d),o):d===null||ge(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||G(d)?(e.exit("atxHeading"),t(d)):se(d)?le(e,a,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),a(d))}function c(d){return d===null||d===35||ge(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),c)}}const Qb=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],da=["pre","script","style","textarea"],Xb={concrete:!0,name:"htmlFlow",resolveTo:ny,tokenize:iy},ey={partial:!0,tokenize:ry},ty={partial:!0,tokenize:sy};function ny(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function iy(e,t,n){const i=this;let s,r,o,a,l;return c;function c(g){return d(g)}function d(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),u}function u(g){return g===33?(e.consume(g),p):g===47?(e.consume(g),r=!0,h):g===63?(e.consume(g),s=3,i.interrupt?t:x):Be(g)?(e.consume(g),o=String.fromCharCode(g),y):n(g)}function p(g){return g===45?(e.consume(g),s=2,f):g===91?(e.consume(g),s=5,a=0,m):Be(g)?(e.consume(g),s=4,i.interrupt?t:x):n(g)}function f(g){return g===45?(e.consume(g),i.interrupt?t:x):n(g)}function m(g){const z="CDATA[";return g===z.charCodeAt(a++)?(e.consume(g),a===z.length?i.interrupt?t:B:m):n(g)}function h(g){return Be(g)?(e.consume(g),o=String.fromCharCode(g),y):n(g)}function y(g){if(g===null||g===47||g===62||ge(g)){const z=g===47,q=o.toLowerCase();return!z&&!r&&da.includes(q)?(s=1,i.interrupt?t(g):B(g)):Qb.includes(o.toLowerCase())?(s=6,z?(e.consume(g),w):i.interrupt?t(g):B(g)):(s=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(g):r?C(g):S(g))}return g===45||Ve(g)?(e.consume(g),o+=String.fromCharCode(g),y):n(g)}function w(g){return g===62?(e.consume(g),i.interrupt?t:B):n(g)}function C(g){return se(g)?(e.consume(g),C):R(g)}function S(g){return g===47?(e.consume(g),R):g===58||g===95||Be(g)?(e.consume(g),I):se(g)?(e.consume(g),S):R(g)}function I(g){return g===45||g===46||g===58||g===95||Ve(g)?(e.consume(g),I):O(g)}function O(g){return g===61?(e.consume(g),k):se(g)?(e.consume(g),O):S(g)}function k(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),l=g,T):se(g)?(e.consume(g),k):$(g)}function T(g){return g===l?(e.consume(g),l=null,W):g===null||G(g)?n(g):(e.consume(g),T)}function $(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||ge(g)?O(g):(e.consume(g),$)}function W(g){return g===47||g===62||se(g)?S(g):n(g)}function R(g){return g===62?(e.consume(g),H):n(g)}function H(g){return g===null||G(g)?B(g):se(g)?(e.consume(g),H):n(g)}function B(g){return g===45&&s===2?(e.consume(g),pe):g===60&&s===1?(e.consume(g),me):g===62&&s===4?(e.consume(g),A):g===63&&s===3?(e.consume(g),x):g===93&&s===5?(e.consume(g),ae):G(g)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(ey,E,te)(g)):g===null||G(g)?(e.exit("htmlFlowData"),te(g)):(e.consume(g),B)}function te(g){return e.check(ty,ce,E)(g)}function ce(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),ne}function ne(g){return g===null||G(g)?te(g):(e.enter("htmlFlowData"),B(g))}function pe(g){return g===45?(e.consume(g),x):B(g)}function me(g){return g===47?(e.consume(g),o="",we):B(g)}function we(g){if(g===62){const z=o.toLowerCase();return da.includes(z)?(e.consume(g),A):B(g)}return Be(g)&&o.length<8?(e.consume(g),o+=String.fromCharCode(g),we):B(g)}function ae(g){return g===93?(e.consume(g),x):B(g)}function x(g){return g===62?(e.consume(g),A):g===45&&s===2?(e.consume(g),x):B(g)}function A(g){return g===null||G(g)?(e.exit("htmlFlowData"),E(g)):(e.consume(g),A)}function E(g){return e.exit("htmlFlow"),t(g)}}function sy(e,t,n){const i=this;return s;function s(o){return G(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r):n(o)}function r(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}function ry(e,t,n){return i;function i(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(si,t,n)}}const oy={name:"htmlText",tokenize:ay};function ay(e,t,n){const i=this;let s,r,o;return a;function a(x){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(x),l}function l(x){return x===33?(e.consume(x),c):x===47?(e.consume(x),O):x===63?(e.consume(x),S):Be(x)?(e.consume(x),$):n(x)}function c(x){return x===45?(e.consume(x),d):x===91?(e.consume(x),r=0,m):Be(x)?(e.consume(x),C):n(x)}function d(x){return x===45?(e.consume(x),f):n(x)}function u(x){return x===null?n(x):x===45?(e.consume(x),p):G(x)?(o=u,me(x)):(e.consume(x),u)}function p(x){return x===45?(e.consume(x),f):u(x)}function f(x){return x===62?pe(x):x===45?p(x):u(x)}function m(x){const A="CDATA[";return x===A.charCodeAt(r++)?(e.consume(x),r===A.length?h:m):n(x)}function h(x){return x===null?n(x):x===93?(e.consume(x),y):G(x)?(o=h,me(x)):(e.consume(x),h)}function y(x){return x===93?(e.consume(x),w):h(x)}function w(x){return x===62?pe(x):x===93?(e.consume(x),w):h(x)}function C(x){return x===null||x===62?pe(x):G(x)?(o=C,me(x)):(e.consume(x),C)}function S(x){return x===null?n(x):x===63?(e.consume(x),I):G(x)?(o=S,me(x)):(e.consume(x),S)}function I(x){return x===62?pe(x):S(x)}function O(x){return Be(x)?(e.consume(x),k):n(x)}function k(x){return x===45||Ve(x)?(e.consume(x),k):T(x)}function T(x){return G(x)?(o=T,me(x)):se(x)?(e.consume(x),T):pe(x)}function $(x){return x===45||Ve(x)?(e.consume(x),$):x===47||x===62||ge(x)?W(x):n(x)}function W(x){return x===47?(e.consume(x),pe):x===58||x===95||Be(x)?(e.consume(x),R):G(x)?(o=W,me(x)):se(x)?(e.consume(x),W):pe(x)}function R(x){return x===45||x===46||x===58||x===95||Ve(x)?(e.consume(x),R):H(x)}function H(x){return x===61?(e.consume(x),B):G(x)?(o=H,me(x)):se(x)?(e.consume(x),H):W(x)}function B(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),s=x,te):G(x)?(o=B,me(x)):se(x)?(e.consume(x),B):(e.consume(x),ce)}function te(x){return x===s?(e.consume(x),s=void 0,ne):x===null?n(x):G(x)?(o=te,me(x)):(e.consume(x),te)}function ce(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===47||x===62||ge(x)?W(x):(e.consume(x),ce)}function ne(x){return x===47||x===62||ge(x)?W(x):n(x)}function pe(x){return x===62?(e.consume(x),e.exit("htmlTextData"),e.exit("htmlText"),t):n(x)}function me(x){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),we}function we(x){return se(x)?le(e,ae,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):ae(x)}function ae(x){return e.enter("htmlTextData"),o(x)}}const Hr={name:"labelEnd",resolveAll:dy,resolveTo:fy,tokenize:py},ly={tokenize:hy},cy={tokenize:my},uy={tokenize:gy};function dy(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const s=i.type==="labelImage"?4:2;i.type="data",t+=s}}return e.length!==n.length&&Qe(e,0,e.length,n),e}function fy(e,t){let n=e.length,i=0,s,r,o,a;for(;n--;)if(s=e[n][1],r){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(r=n,s.type!=="labelLink")){i=2;break}}else s.type==="labelEnd"&&(o=n);const l={type:e[r][1].type==="labelLink"?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},d={type:"labelText",start:{...e[r+i+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=it(a,e.slice(r+1,r+i+3)),a=it(a,[["enter",d,t]]),a=it(a,ls(t.parser.constructs.insideSpan.null,e.slice(r+i+4,o-3),t)),a=it(a,[["exit",d,t],e[o-2],e[o-1],["exit",c,t]]),a=it(a,e.slice(o+1)),a=it(a,[["exit",l,t]]),Qe(e,r,e.length,a),e}function py(e,t,n){const i=this;let s=i.events.length,r,o;for(;s--;)if((i.events[s][1].type==="labelImage"||i.events[s][1].type==="labelLink")&&!i.events[s][1]._balanced){r=i.events[s][1];break}return a;function a(p){return r?r._inactive?u(p):(o=i.parser.defined.includes(ht(i.sliceSerialize({start:r.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(ly,d,o?d:u)(p):p===91?e.attempt(cy,d,o?c:u)(p):o?d(p):u(p)}function c(p){return e.attempt(uy,d,u)(p)}function d(p){return t(p)}function u(p){return r._balanced=!0,n(p)}}function hy(e,t,n){return i;function i(u){return e.enter("resource"),e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),s}function s(u){return ge(u)?Zn(e,r)(u):r(u)}function r(u){return u===41?d(u):nc(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function o(u){return ge(u)?Zn(e,l)(u):d(u)}function a(u){return n(u)}function l(u){return u===34||u===39||u===40?sc(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):d(u)}function c(u){return ge(u)?Zn(e,d)(u):d(u)}function d(u){return u===41?(e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),e.exit("resource"),t):n(u)}}function my(e,t,n){const i=this;return s;function s(a){return ic.call(i,e,r,o,"reference","referenceMarker","referenceString")(a)}function r(a){return i.parser.defined.includes(ht(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function gy(e,t,n){return i;function i(r){return e.enter("reference"),e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),s}function s(r){return r===93?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}const by={name:"labelStartImage",resolveAll:Hr.resolveAll,tokenize:yy};function yy(e,t,n){const i=this;return s;function s(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),r}function r(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(a):t(a)}}const wy={name:"labelStartLink",resolveAll:Hr.resolveAll,tokenize:ky};function ky(e,t,n){const i=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),r}function r(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(o):t(o)}}const Ls={name:"lineEnding",tokenize:vy};function vy(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),le(e,t,"linePrefix")}}const $i={name:"thematicBreak",tokenize:Sy};function Sy(e,t,n){let i=0,s;return r;function r(c){return e.enter("thematicBreak"),o(c)}function o(c){return s=c,a(c)}function a(c){return c===s?(e.enter("thematicBreakSequence"),l(c)):i>=3&&(c===null||G(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===s?(e.consume(c),i++,l):(e.exit("thematicBreakSequence"),se(c)?le(e,a,"whitespace")(c):a(c))}}const We={continuation:{tokenize:Ay},exit:Ty,name:"list",tokenize:Cy},xy={partial:!0,tokenize:Iy},_y={partial:!0,tokenize:Ey};function Cy(e,t,n){const i=this,s=i.events[i.events.length-1];let r=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return a;function a(f){const m=i.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!i.containerState.marker||f===i.containerState.marker:ar(f)){if(i.containerState.type||(i.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check($i,n,c)(f):c(f);if(!i.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return ar(f)&&++o<10?(e.consume(f),l):(!i.interrupt||o<2)&&(i.containerState.marker?f===i.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||f,e.check(si,i.interrupt?n:d,e.attempt(xy,p,u))}function d(f){return i.containerState.initialBlankLine=!0,r++,p(f)}function u(f){return se(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),p):n(f)}function p(f){return i.containerState.size=r+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Ay(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(si,s,r);function s(a){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,le(e,t,"listItemIndent",i.containerState.size+1)(a)}function r(a){return i.containerState.furtherBlankLines||!se(a)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(a)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(_y,t,o)(a))}function o(a){return i.containerState._closeFlow=!0,i.interrupt=void 0,le(e,e.attempt(We,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Ey(e,t,n){const i=this;return le(e,s,"listItemIndent",i.containerState.size+1);function s(r){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?t(r):n(r)}}function Ty(e){e.exit(this.containerState.type)}function Iy(e,t,n){const i=this;return le(e,s,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(r){const o=i.events[i.events.length-1];return!se(r)&&o&&o[1].type==="listItemPrefixWhitespace"?t(r):n(r)}}const fa={name:"setextUnderline",resolveTo:Py,tokenize:Oy};function Py(e,t){let n=e.length,i,s,r;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!r&&e[n][1].type==="definition"&&(r=n);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",r?(e.splice(s,0,["enter",o,t]),e.splice(r+1,0,["exit",e[i][1],t]),e[i][1].end={...e[r][1].end}):e[i][1]=o,e.push(["exit",o,t]),e}function Oy(e,t,n){const i=this;let s;return r;function r(c){let d=i.events.length,u;for(;d--;)if(i.events[d][1].type!=="lineEnding"&&i.events[d][1].type!=="linePrefix"&&i.events[d][1].type!=="content"){u=i.events[d][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||u)?(e.enter("setextHeadingLine"),s=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===s?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),se(c)?le(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||G(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const $y={tokenize:Ry};function Ry(e){const t=this,n=e.attempt(si,i,e.attempt(this.parser.constructs.flowInitial,s,le(e,e.attempt(this.parser.constructs.flow,s,e.attempt(zb,s)),"linePrefix")));return n;function i(r){if(r===null){e.consume(r);return}return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(r){if(r===null){e.consume(r);return}return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Ny={resolveAll:oc()},Ly=rc("string"),Fy=rc("text");function rc(e){return{resolveAll:oc(e==="text"?Dy:void 0),tokenize:t};function t(n){const i=this,s=this.parser.constructs[e],r=n.attempt(s,o,a);return o;function o(d){return c(d)?r(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return c(d)?(n.exit("data"),r(d)):(n.consume(d),l)}function c(d){if(d===null)return!0;const u=s[d];let p=-1;if(u)for(;++p<u.length;){const f=u[p];if(!f.previous||f.previous.call(i,i.previous))return!0}return!1}}}function oc(e){return t;function t(n,i){let s=-1,r;for(;++s<=n.length;)r===void 0?n[s]&&n[s][1].type==="data"&&(r=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==r+2&&(n[r][1].end=n[s-1][1].end,n.splice(r+2,s-r-2),s=r+2),r=void 0);return e?e(n,i):n}}function Dy(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],s=t.sliceStream(i);let r=s.length,o=-1,a=0,l;for(;r--;){const c=s[r];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){r++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:r?o:i.start._bufferIndex+o,_index:i.start._index+r,line:i.end.line,column:i.end.column-a,offset:i.end.offset-a},end:{...i.end}};i.end={...c.start},i.start.offset===i.end.offset?Object.assign(i,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const zy={42:We,43:We,45:We,48:We,49:We,50:We,51:We,52:We,53:We,54:We,55:We,56:We,57:We,62:Ql},My={91:Hb},jy={[-2]:Ns,[-1]:Ns,32:Ns},By={35:Gb,42:$i,45:[fa,$i],60:Xb,61:fa,95:$i,96:ua,126:ua},Uy={38:ec,92:Xl},Hy={[-5]:Ls,[-4]:Ls,[-3]:Ls,33:by,38:ec,42:lr,60:[wb,oy],91:wy,92:[Zb,Xl],93:Hr,95:lr,96:$b},qy={null:[lr,Ny]},Wy={null:[42,95]},Vy={null:[]},Zy=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Wy,contentInitial:My,disable:Vy,document:zy,flow:By,flowInitial:jy,insideSpan:qy,string:Uy,text:Hy},Symbol.toStringTag,{value:"Module"}));function Ky(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},r=[];let o=[],a=[];const l={attempt:T(O),check:T(k),consume:C,enter:S,exit:I,interrupt:T(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:p,sliceStream:f,write:u};let d=t.tokenize.call(c,l);return t.resolveAll&&r.push(t),c;function u(H){return o=it(o,H),y(),o[o.length-1]!==null?[]:($(t,0),c.events=ls(r,c.events,c),c.events)}function p(H,B){return Yy(f(H),B)}function f(H){return Gy(o,H)}function m(){const{_bufferIndex:H,_index:B,line:te,column:ce,offset:ne}=i;return{_bufferIndex:H,_index:B,line:te,column:ce,offset:ne}}function h(H){s[H.line]=H.column,R()}function y(){let H;for(;i._index<o.length;){const B=o[i._index];if(typeof B=="string")for(H=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===H&&i._bufferIndex<B.length;)w(B.charCodeAt(i._bufferIndex));else w(B)}}function w(H){d=d(H)}function C(H){G(H)?(i.line++,i.column=1,i.offset+=H===-3?2:1,R()):H!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===o[i._index].length&&(i._bufferIndex=-1,i._index++)),c.previous=H}function S(H,B){const te=B||{};return te.type=H,te.start=m(),c.events.push(["enter",te,c]),a.push(te),te}function I(H){const B=a.pop();return B.end=m(),c.events.push(["exit",B,c]),B}function O(H,B){$(H,B.from)}function k(H,B){B.restore()}function T(H,B){return te;function te(ce,ne,pe){let me,we,ae,x;return Array.isArray(ce)?E(ce):"tokenize"in ce?E([ce]):A(ce);function A(M){return Y;function Y(ue){const de=ue!==null&&M[ue],ye=ue!==null&&M.null,Ge=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(ye)?ye:ye?[ye]:[]];return E(Ge)(ue)}}function E(M){return me=M,we=0,M.length===0?pe:g(M[we])}function g(M){return Y;function Y(ue){return x=W(),ae=M,M.partial||(c.currentConstruct=M),M.name&&c.parser.constructs.disable.null.includes(M.name)?q():M.tokenize.call(B?Object.assign(Object.create(c),B):c,l,z,q)(ue)}}function z(M){return H(ae,x),ne}function q(M){return x.restore(),++we<me.length?g(me[we]):pe}}}function $(H,B){H.resolveAll&&!r.includes(H)&&r.push(H),H.resolve&&Qe(c.events,B,c.events.length-B,H.resolve(c.events.slice(B),c)),H.resolveTo&&(c.events=H.resolveTo(c.events,c))}function W(){const H=m(),B=c.previous,te=c.currentConstruct,ce=c.events.length,ne=Array.from(a);return{from:ce,restore:pe};function pe(){i=H,c.previous=B,c.currentConstruct=te,c.events.length=ce,a=ne,R()}}function R(){i.line in s&&i.column<2&&(i.column=s[i.line],i.offset+=s[i.line]-1)}}function Gy(e,t){const n=t.start._index,i=t.start._bufferIndex,s=t.end._index,r=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(i,r)];else{if(o=e.slice(n,s),i>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(i):o.shift()}r>0&&o.push(e[s].slice(0,r))}return o}function Yy(e,t){let n=-1;const i=[];let s;for(;++n<e.length;){const r=e[n];let o;if(typeof r=="string")o=r;else switch(r){case-5:{o="\r";break}case-4:{o=`
67
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const a=o[1];if(t===o[0]){r(o);continue}if(e.external){const c=e.external.registry.get(o[0])?.id;if(t!==o[0]&&c){r(o);continue}}if(e.metadataRegistry.get(o[0])?.id){r(o);continue}if(a.cycle){r(o);continue}if(a.count>1&&e.reused==="ref"){r(o);continue}}}function jl(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=a=>{const l=e.seen.get(a);if(l.ref===null)return;const c=l.def??l.schema,d={...c},u=l.ref;if(l.ref=null,u){i(u);const f=e.seen.get(u),m=f.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):Object.assign(c,m),Object.assign(c,d),a._zod.parent===u)for(const y in c)y==="$ref"||y==="allOf"||y in d||delete c[y];if(m.$ref&&f.def)for(const y in c)y==="$ref"||y==="allOf"||y in f.def&&JSON.stringify(c[y])===JSON.stringify(f.def[y])&&delete c[y]}const h=a._zod.parent;if(h&&h!==u){i(h);const f=e.seen.get(h);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(const m in c)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(c[m])===JSON.stringify(f.def[m])&&delete c[m]}e.override({zodSchema:a,jsonSchema:c,path:l.path??[]})};for(const a of[...e.seen.entries()].reverse())i(a[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(a)}Object.assign(s,n.def??n.schema);const r=e.metadataRegistry.get(t)?.id;r!==void 0&&s.id===r&&delete s.id;const o=e.external?.defs??{};for(const a of e.seen.entries()){const l=a[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,o[l.defId]=l.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const a=JSON.parse(JSON.stringify(s));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ki(t,"input",e.processors),output:Ki(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function ze(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return ze(i.element,n);if(i.type==="set")return ze(i.valueType,n);if(i.type==="lazy")return ze(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return ze(i.innerType,n);if(i.type==="intersection")return ze(i.left,n)||ze(i.right,n);if(i.type==="record"||i.type==="map")return ze(i.keyType,n)||ze(i.valueType,n);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ze(i.in,n)||ze(i.out,n);if(i.type==="object"){for(const s in i.shape)if(ze(i.shape[s],n))return!0;return!1}if(i.type==="union"){for(const s of i.options)if(ze(s,n))return!0;return!1}if(i.type==="tuple"){for(const s of i.items)if(ze(s,n))return!0;return!!(i.rest&&ze(i.rest,n))}return!1}const Vp=(e,t={})=>n=>{const i=zl({...n,processors:t});return Pe(e,i),Ml(i,e),jl(i,e)},Ki=(e,t,n={})=>i=>{const{libraryOptions:s,target:r}=i??{},o=zl({...s??{},target:r,io:t,processors:n});return Pe(e,o),Ml(o,e),jl(o,e)},Zp={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Kp=(e,t,n,i)=>{const s=n;s.type="string";const{minimum:r,maximum:o,format:a,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof r=="number"&&(s.minLength=r),typeof o=="number"&&(s.maxLength=o),a&&(s.format=Zp[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),c&&(s.contentEncoding=c),l&&l.size>0){const d=[...l];d.length===1?s.pattern=d[0].source:d.length>1&&(s.allOf=[...d.map(u=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:u.source}))])}},Gp=(e,t,n,i)=>{const s=n,{minimum:r,maximum:o,format:a,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:d}=e._zod.bag;typeof a=="string"&&a.includes("int")?s.type="integer":s.type="number";const u=typeof d=="number"&&d>=(r??Number.NEGATIVE_INFINITY),h=typeof c=="number"&&c<=(o??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";u?f?(s.minimum=d,s.exclusiveMinimum=!0):s.exclusiveMinimum=d:typeof r=="number"&&(s.minimum=r),h?f?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c:typeof o=="number"&&(s.maximum=o),typeof l=="number"&&(s.multipleOf=l)},Yp=(e,t,n,i)=>{n.type="boolean"},Jp=(e,t,n,i)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Qp=(e,t,n,i)=>{n.not={}},Xp=(e,t,n,i)=>{},em=(e,t,n,i)=>{const s=e._zod.def,r=yl(s.entries);r.every(o=>typeof o=="number")&&(n.type="number"),r.every(o=>typeof o=="string")&&(n.type="string"),n.enum=r},tm=(e,t,n,i)=>{const s=e._zod.def,r=[];for(const o of s.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");r.push(Number(o))}else r.push(o);if(r.length!==0)if(r.length===1){const o=r[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else r.every(o=>typeof o=="number")&&(n.type="number"),r.every(o=>typeof o=="string")&&(n.type="string"),r.every(o=>typeof o=="boolean")&&(n.type="boolean"),r.every(o=>o===null)&&(n.type="null"),n.enum=r},nm=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},im=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},sm=(e,t,n,i)=>{const s=n,r=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;typeof o=="number"&&(s.minItems=o),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=Pe(r.element,t,{...i,path:[...i.path,"items"]})},rm=(e,t,n,i)=>{const s=n,r=e._zod.def;s.type="object",s.properties={};const o=r.shape;for(const c in o)s.properties[c]=Pe(o[c],t,{...i,path:[...i.path,"properties",c]});const a=new Set(Object.keys(o)),l=new Set([...a].filter(c=>{const d=r.shape[c]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(s.required=Array.from(l)),r.catchall?._zod.def.type==="never"?s.additionalProperties=!1:r.catchall?r.catchall&&(s.additionalProperties=Pe(r.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},om=(e,t,n,i)=>{const s=e._zod.def,r=s.inclusive===!1,o=s.options.map((a,l)=>Pe(a,t,{...i,path:[...i.path,r?"oneOf":"anyOf",l]}));r?n.oneOf=o:n.anyOf=o},am=(e,t,n,i)=>{const s=e._zod.def,r=Pe(s.left,t,{...i,path:[...i.path,"allOf",0]}),o=Pe(s.right,t,{...i,path:[...i.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,l=[...a(r)?r.allOf:[r],...a(o)?o.allOf:[o]];n.allOf=l},lm=(e,t,n,i)=>{const s=n,r=e._zod.def;s.type="object";const o=r.keyType,l=o._zod.bag?.patterns;if(r.mode==="loose"&&l&&l.size>0){const d=Pe(r.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});s.patternProperties={};for(const u of l)s.patternProperties[u.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Pe(r.keyType,t,{...i,path:[...i.path,"propertyNames"]})),s.additionalProperties=Pe(r.valueType,t,{...i,path:[...i.path,"additionalProperties"]});const c=o._zod.values;if(c){const d=[...c].filter(u=>typeof u=="string"||typeof u=="number");d.length>0&&(s.required=d)}},cm=(e,t,n,i)=>{const s=e._zod.def,r=Pe(s.innerType,t,i),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[r,{type:"null"}]},um=(e,t,n,i)=>{const s=e._zod.def;Pe(s.innerType,t,i);const r=t.seen.get(e);r.ref=s.innerType},dm=(e,t,n,i)=>{const s=e._zod.def;Pe(s.innerType,t,i);const r=t.seen.get(e);r.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},fm=(e,t,n,i)=>{const s=e._zod.def;Pe(s.innerType,t,i);const r=t.seen.get(e);r.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},hm=(e,t,n,i)=>{const s=e._zod.def;Pe(s.innerType,t,i);const r=t.seen.get(e);r.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},pm=(e,t,n,i)=>{const s=e._zod.def,r=s.in._zod.traits.has("$ZodTransform"),o=t.io==="input"?r?s.out:s.in:s.out;Pe(o,t,i);const a=t.seen.get(e);a.ref=o},mm=(e,t,n,i)=>{const s=e._zod.def;Pe(s.innerType,t,i);const r=t.seen.get(e);r.ref=s.innerType,n.readOnly=!0},Bl=(e,t,n,i)=>{const s=e._zod.def;Pe(s.innerType,t,i);const r=t.seen.get(e);r.ref=s.innerType},gm=D("ZodISODateTime",(e,t)=>{ph.init(e,t),xe.init(e,t)});function bm(e){return vp(gm,e)}const ym=D("ZodISODate",(e,t)=>{mh.init(e,t),xe.init(e,t)});function wm(e){return Sp(ym,e)}const km=D("ZodISOTime",(e,t)=>{gh.init(e,t),xe.init(e,t)});function vm(e){return xp(km,e)}const Sm=D("ZodISODuration",(e,t)=>{bh.init(e,t),xe.init(e,t)});function xm(e){return _p(Sm,e)}const _m=(e,t)=>{Sl.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>rf(e,n)},flatten:{value:n=>sf(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,tr,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,tr,2)}},isEmpty:{get(){return e.issues.length===0}}})},at=D("ZodError",_m,{Parent:Error}),Cm=Dr(at),Am=zr(at),Tm=is(at),Em=ss(at),Im=lf(at),Pm=cf(at),Om=uf(at),$m=df(at),Rm=ff(at),Nm=hf(at),Lm=pf(at),Fm=mf(at),Ho=new WeakMap;function ni(e,t,n){const i=Object.getPrototypeOf(e);let s=Ho.get(i);if(s||(s=new Set,Ho.set(i,s)),!s.has(t)){s.add(t);for(const r in n){const o=n[r];Object.defineProperty(i,r,{configurable:!0,enumerable:!1,get(){const a=o.bind(this);return Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const Se=D("ZodType",(e,t)=>(ke.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ki(e,"input"),output:Ki(e,"output")}}),e.toJSONSchema=Vp(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,i)=>Cm(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>Tm(e,n,i),e.parseAsync=async(n,i)=>Am(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>Em(e,n,i),e.spa=e.safeParseAsync,e.encode=(n,i)=>Im(e,n,i),e.decode=(n,i)=>Pm(e,n,i),e.encodeAsync=async(n,i)=>Om(e,n,i),e.decodeAsync=async(n,i)=>$m(e,n,i),e.safeEncode=(n,i)=>Rm(e,n,i),e.safeDecode=(n,i)=>Nm(e,n,i),e.safeEncodeAsync=async(n,i)=>Lm(e,n,i),e.safeDecodeAsync=async(n,i)=>Fm(e,n,i),ni(e,"ZodType",{check(...n){const i=this.def;return this.clone(Nt(i,{checks:[...i.checks??[],...n.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,i){return Lt(this,n,i)},brand(){return this},register(n,i){return n.add(this,i),this},refine(n,i){return this.check(Pg(n,i))},superRefine(n,i){return this.check(Og(n,i))},overwrite(n){return this.check(En(n))},optional(){return Ko(this)},exactOptional(){return bg(this)},nullable(){return Go(this)},nullish(){return Ko(Go(this))},nonoptional(n){return xg(this,n)},array(){return Ne(this)},or(n){return ql([this,n])},and(n){return fg(this,n)},transform(n){return Yo(this,mg(n))},default(n){return kg(this,n)},prefault(n){return Sg(this,n)},catch(n){return Cg(this,n)},pipe(n){return Yo(this,n)},readonly(){return Eg(this)},describe(n){const i=this.clone();return Bn.add(i,{description:n}),i},meta(...n){if(n.length===0)return Bn.get(this);const i=this.clone();return Bn.add(i,n[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return Bn.get(e)?.description},configurable:!0}),e)),Ul=D("_ZodString",(e,t)=>{Mr.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(i,s,r)=>Kp(e,i,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,ni(e,"_ZodString",{regex(...i){return this.check(Op(...i))},includes(...i){return this.check(Np(...i))},startsWith(...i){return this.check(Lp(...i))},endsWith(...i){return this.check(Fp(...i))},min(...i){return this.check(Zi(...i))},max(...i){return this.check(Fl(...i))},length(...i){return this.check(Dl(...i))},nonempty(...i){return this.check(Zi(1,...i))},lowercase(i){return this.check($p(i))},uppercase(i){return this.check(Rp(i))},trim(){return this.check(zp())},normalize(...i){return this.check(Dp(...i))},toLowerCase(){return this.check(Mp())},toUpperCase(){return this.check(jp())},slugify(){return this.check(Bp())}})}),Dm=D("ZodString",(e,t)=>{Mr.init(e,t),Ul.init(e,t),e.email=n=>e.check(ep(zm,n)),e.url=n=>e.check(rp(Mm,n)),e.jwt=n=>e.check(kp(eg,n)),e.emoji=n=>e.check(op(jm,n)),e.guid=n=>e.check(Mo(qo,n)),e.uuid=n=>e.check(tp(gi,n)),e.uuidv4=n=>e.check(np(gi,n)),e.uuidv6=n=>e.check(ip(gi,n)),e.uuidv7=n=>e.check(sp(gi,n)),e.nanoid=n=>e.check(ap(Bm,n)),e.guid=n=>e.check(Mo(qo,n)),e.cuid=n=>e.check(lp(Um,n)),e.cuid2=n=>e.check(cp(Hm,n)),e.ulid=n=>e.check(up(qm,n)),e.base64=n=>e.check(bp(Jm,n)),e.base64url=n=>e.check(yp(Qm,n)),e.xid=n=>e.check(dp(Wm,n)),e.ksuid=n=>e.check(fp(Vm,n)),e.ipv4=n=>e.check(hp(Zm,n)),e.ipv6=n=>e.check(pp(Km,n)),e.cidrv4=n=>e.check(mp(Gm,n)),e.cidrv6=n=>e.check(gp(Ym,n)),e.e164=n=>e.check(wp(Xm,n)),e.datetime=n=>e.check(bm(n)),e.date=n=>e.check(wm(n)),e.time=n=>e.check(vm(n)),e.duration=n=>e.check(xm(n))});function Z(e){return Xh(Dm,e)}const xe=D("ZodStringFormat",(e,t)=>{ve.init(e,t),Ul.init(e,t)}),zm=D("ZodEmail",(e,t)=>{rh.init(e,t),xe.init(e,t)}),qo=D("ZodGUID",(e,t)=>{ih.init(e,t),xe.init(e,t)}),gi=D("ZodUUID",(e,t)=>{sh.init(e,t),xe.init(e,t)}),Mm=D("ZodURL",(e,t)=>{oh.init(e,t),xe.init(e,t)}),jm=D("ZodEmoji",(e,t)=>{ah.init(e,t),xe.init(e,t)}),Bm=D("ZodNanoID",(e,t)=>{lh.init(e,t),xe.init(e,t)}),Um=D("ZodCUID",(e,t)=>{ch.init(e,t),xe.init(e,t)}),Hm=D("ZodCUID2",(e,t)=>{uh.init(e,t),xe.init(e,t)}),qm=D("ZodULID",(e,t)=>{dh.init(e,t),xe.init(e,t)}),Wm=D("ZodXID",(e,t)=>{fh.init(e,t),xe.init(e,t)}),Vm=D("ZodKSUID",(e,t)=>{hh.init(e,t),xe.init(e,t)}),Zm=D("ZodIPv4",(e,t)=>{yh.init(e,t),xe.init(e,t)}),Km=D("ZodIPv6",(e,t)=>{wh.init(e,t),xe.init(e,t)}),Gm=D("ZodCIDRv4",(e,t)=>{kh.init(e,t),xe.init(e,t)}),Ym=D("ZodCIDRv6",(e,t)=>{vh.init(e,t),xe.init(e,t)}),Jm=D("ZodBase64",(e,t)=>{Sh.init(e,t),xe.init(e,t)}),Qm=D("ZodBase64URL",(e,t)=>{_h.init(e,t),xe.init(e,t)}),Xm=D("ZodE164",(e,t)=>{Ch.init(e,t),xe.init(e,t)}),eg=D("ZodJWT",(e,t)=>{Th.init(e,t),xe.init(e,t)}),Hl=D("ZodNumber",(e,t)=>{$l.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(i,s,r)=>Gp(e,i,s),ni(e,"ZodNumber",{gt(i,s){return this.check(Bo(i,s))},gte(i,s){return this.check(Cs(i,s))},min(i,s){return this.check(Cs(i,s))},lt(i,s){return this.check(jo(i,s))},lte(i,s){return this.check(_s(i,s))},max(i,s){return this.check(_s(i,s))},int(i){return this.check(Wo(i))},safe(i){return this.check(Wo(i))},positive(i){return this.check(Bo(0,i))},nonnegative(i){return this.check(Cs(0,i))},negative(i){return this.check(jo(0,i))},nonpositive(i){return this.check(_s(0,i))},multipleOf(i,s){return this.check(Uo(i,s))},step(i,s){return this.check(Uo(i,s))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Wt(e){return Cp(Hl,e)}const tg=D("ZodNumberFormat",(e,t)=>{Eh.init(e,t),Hl.init(e,t)});function Wo(e){return Ap(tg,e)}const ng=D("ZodBoolean",(e,t)=>{Ih.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Yp(e,n,i)});function Gi(e){return Tp(ng,e)}const ig=D("ZodNull",(e,t)=>{Ph.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Jp(e,n,i)});function sg(e){return Ep(ig,e)}const rg=D("ZodUnknown",(e,t)=>{Oh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Xp()});function Vo(){return Ip(rg)}const og=D("ZodNever",(e,t)=>{$h.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Qp(e,n,i)});function ag(e){return Pp(og,e)}const lg=D("ZodArray",(e,t)=>{Rh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>sm(e,n,i,s),e.element=t.element,ni(e,"ZodArray",{min(n,i){return this.check(Zi(n,i))},nonempty(n){return this.check(Zi(1,n))},max(n,i){return this.check(Fl(n,i))},length(n,i){return this.check(Dl(n,i))},unwrap(){return this.element}})});function Ne(e,t){return Up(lg,e,t)}const cg=D("ZodObject",(e,t)=>{Lh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>rm(e,n,i,s),pe(e,"shape",()=>t.shape),ni(e,"ZodObject",{keyof(){return yt(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Vo()})},loose(){return this.clone({...this._zod.def,catchall:Vo()})},strict(){return this.clone({...this._zod.def,catchall:ag()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return Jd(this,n)},safeExtend(n){return Qd(this,n)},merge(n){return Xd(this,n)},pick(n){return Gd(this,n)},omit(n){return Yd(this,n)},partial(...n){return ef(Vl,this,n[0])},required(...n){return tf(Zl,this,n[0])}})});function je(e,t){const n={type:"object",shape:e??{},...K(t)};return new cg(n)}const ug=D("ZodUnion",(e,t)=>{Fh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>om(e,n,i,s),e.options=t.options});function ql(e,t){return new ug({type:"union",options:e,...K(t)})}const dg=D("ZodIntersection",(e,t)=>{Dh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>am(e,n,i,s)});function fg(e,t){return new dg({type:"intersection",left:e,right:t})}const Zo=D("ZodRecord",(e,t)=>{zh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>lm(e,n,i,s),e.keyType=t.keyType,e.valueType=t.valueType});function dn(e,t,n){return!t||!t._zod?new Zo({type:"record",keyType:Z(),valueType:e,...K(t)}):new Zo({type:"record",keyType:e,valueType:t,...K(n)})}const ir=D("ZodEnum",(e,t)=>{Mh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(i,s,r)=>em(e,i,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(i,s)=>{const r={};for(const o of i)if(n.has(o))r[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new ir({...t,checks:[],...K(s),entries:r})},e.exclude=(i,s)=>{const r={...t.entries};for(const o of i)if(n.has(o))delete r[o];else throw new Error(`Key ${o} not found in enum`);return new ir({...t,checks:[],...K(s),entries:r})}});function yt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new ir({type:"enum",entries:n,...K(t)})}const hg=D("ZodLiteral",(e,t)=>{jh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>tm(e,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Wl(e,t){return new hg({type:"literal",values:Array.isArray(e)?e:[e],...K(t)})}const pg=D("ZodTransform",(e,t)=>{Bh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>im(e,n),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new bl(e.constructor.name);n.addIssue=r=>{if(typeof r=="string")n.issues.push(Qn(r,n.value,t));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(Qn(o))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(r=>(n.value=r,n.fallback=!0,n)):(n.value=s,n.fallback=!0,n)}});function mg(e){return new pg({type:"transform",transform:e})}const Vl=D("ZodOptional",(e,t)=>{Ll.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Bl(e,n,i,s),e.unwrap=()=>e._zod.def.innerType});function Ko(e){return new Vl({type:"optional",innerType:e})}const gg=D("ZodExactOptional",(e,t)=>{Uh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>Bl(e,n,i,s),e.unwrap=()=>e._zod.def.innerType});function bg(e){return new gg({type:"optional",innerType:e})}const yg=D("ZodNullable",(e,t)=>{Hh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>cm(e,n,i,s),e.unwrap=()=>e._zod.def.innerType});function Go(e){return new yg({type:"nullable",innerType:e})}const wg=D("ZodDefault",(e,t)=>{qh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>dm(e,n,i,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function kg(e,t){return new wg({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():kl(t)}})}const vg=D("ZodPrefault",(e,t)=>{Wh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>fm(e,n,i,s),e.unwrap=()=>e._zod.def.innerType});function Sg(e,t){return new vg({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():kl(t)}})}const Zl=D("ZodNonOptional",(e,t)=>{Vh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>um(e,n,i,s),e.unwrap=()=>e._zod.def.innerType});function xg(e,t){return new Zl({type:"nonoptional",innerType:e,...K(t)})}const _g=D("ZodCatch",(e,t)=>{Zh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>hm(e,n,i,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Cg(e,t){return new _g({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ag=D("ZodPipe",(e,t)=>{Kh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>pm(e,n,i,s),e.in=t.in,e.out=t.out});function Yo(e,t){return new Ag({type:"pipe",in:e,out:t})}const Tg=D("ZodReadonly",(e,t)=>{Gh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>mm(e,n,i,s),e.unwrap=()=>e._zod.def.innerType});function Eg(e){return new Tg({type:"readonly",innerType:e})}const Ig=D("ZodCustom",(e,t)=>{Yh.init(e,t),Se.init(e,t),e._zod.processJSONSchema=(n,i,s)=>nm(e,n)});function Pg(e,t={}){return Hp(Ig,e,t)}function Og(e,t){return qp(e,t)}const $g=je({ref:Z()}),Rg=je({id:Z(),width:Wt(),children:Ne($g)}),Ng=je({type:Wl("row"),id:Z(),columns:Ne(Rg)}),Lg=je({type:Wl("stack"),children:Ne(Ng)});function Fg(e){return JSON.stringify(e)}function Dg(e){if(!e)return{type:"stack",children:[]};try{return Lg.parse(JSON.parse(e))}catch{return{type:"stack",children:[]}}}function Jo(e){if(e)throw e}var a_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function os(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var As,Qo;function zg(){if(Qo)return As;Qo=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},r=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var d=e.call(c,"constructor"),u=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!u)return!1;var h;for(h in c);return typeof h>"u"||e.call(c,h)},o=function(c,d){n&&d.name==="__proto__"?n(c,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):c[d.name]=d.newValue},a=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(i)return i(c,d).value}else return;return c[d]};return As=function l(){var c,d,u,h,f,m,p=arguments[0],y=1,w=arguments.length,C=!1;for(typeof p=="boolean"&&(C=p,p=arguments[1]||{},y=2),(p==null||typeof p!="object"&&typeof p!="function")&&(p={});y<w;++y)if(c=arguments[y],c!=null)for(d in c)u=a(p,d),h=a(c,d),p!==h&&(C&&h&&(r(h)||(f=s(h)))?(f?(f=!1,m=u&&s(u)?u:[]):m=u&&r(u)?u:{},o(p,{name:d,newValue:l(C,m,h)})):typeof h<"u"&&o(p,{name:d,newValue:h}));return p},As}var Mg=zg();const Ts=os(Mg);function l_(){}function c_(){}function sr(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function jg(){const e=[],t={run:n,use:i};return t;function n(...s){let r=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...s);function a(l,...c){const d=e[++r];let u=-1;if(l){o(l);return}for(;++u<s.length;)(c[u]===null||c[u]===void 0)&&(c[u]=s[u]);s=c,d?Bg(d,a)(...c):o(null,...c)}}function i(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function Bg(e,t){let n;return i;function i(...o){const a=e.length>o.length;let l;a&&o.push(s);try{l=e.apply(this,o)}catch(c){const d=c;if(a&&n)throw d;return s(d)}a||(l&&l.then&&typeof l.then=="function"?l.then(r,s):l instanceof Error?s(l):r(l))}function s(o,...a){n||(n=!0,t(o,...a))}function r(o){s(null,o)}}function Vn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Xo(e.position):"start"in e||"end"in e?Xo(e):"line"in e||"column"in e?rr(e):""}function rr(e){return ea(e&&e.line)+":"+ea(e&&e.column)}function Xo(e){return rr(e&&e.start)+"-"+rr(e&&e.end)}function ea(e){return e&&typeof e=="number"?e:1}class Ke extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let s="",r={},o=!1;if(n&&("line"in n&&"column"in n?r={place:n}:"start"in n&&"end"in n?r={place:n}:"type"in n?r={ancestors:[n],place:n.position}:r={...n}),typeof t=="string"?s=t:!r.cause&&t&&(o=!0,s=t.message,r.cause=t),!r.ruleId&&!r.source&&typeof i=="string"){const l=i.indexOf(":");l===-1?r.ruleId=i:(r.source=i.slice(0,l),r.ruleId=i.slice(l+1))}if(!r.place&&r.ancestors&&r.ancestors){const l=r.ancestors[r.ancestors.length-1];l&&(r.place=l.position)}const a=r.place&&"start"in r.place?r.place.start:r.place;this.ancestors=r.ancestors||void 0,this.cause=r.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=a?a.line:void 0,this.name=Vn(r.place)||"1:1",this.place=r.place||void 0,this.reason=this.message,this.ruleId=r.ruleId||void 0,this.source=r.source||void 0,this.stack=o&&r.cause&&typeof r.cause.stack=="string"?r.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ke.prototype.file="";Ke.prototype.name="";Ke.prototype.reason="";Ke.prototype.message="";Ke.prototype.stack="";Ke.prototype.column=void 0;Ke.prototype.line=void 0;Ke.prototype.ancestors=void 0;Ke.prototype.cause=void 0;Ke.prototype.fatal=void 0;Ke.prototype.place=void 0;Ke.prototype.ruleId=void 0;Ke.prototype.source=void 0;const bt={basename:Ug,dirname:Hg,extname:qg,join:Wg,sep:"/"};function Ug(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ii(e);let n=0,i=-1,s=e.length,r;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(r){n=s+1;break}}else i<0&&(r=!0,i=s+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let o=-1,a=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(r){n=s+1;break}}else o<0&&(r=!0,o=s+1),a>-1&&(e.codePointAt(s)===t.codePointAt(a--)?a<0&&(i=s):(a=-1,i=o));return n===i?i=o:i<0&&(i=e.length),e.slice(n,i)}function Hg(e){if(ii(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function qg(e){ii(e);let t=e.length,n=-1,i=0,s=-1,r=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){i=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?s<0?s=t:r!==1&&(r=1):s>-1&&(r=-1)}return s<0||n<0||r===0||r===1&&s===n-1&&s===i+1?"":e.slice(s,n)}function Wg(...e){let t=-1,n;for(;++t<e.length;)ii(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Vg(n)}function Vg(e){ii(e);const t=e.codePointAt(0)===47;let n=Zg(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Zg(e,t){let n="",i=0,s=-1,r=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(s===o-1||r===1))if(s!==o-1&&r===2){if(n.length<2||i!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",i=0):(n=n.slice(0,l),i=n.length-1-n.lastIndexOf("/")),s=o,r=0;continue}}else if(n.length>0){n="",i=0,s=o,r=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),i=o-s-1;s=o,r=0}else a===46&&r>-1?r++:r=-1}return n}function ii(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Kg={cwd:Gg};function Gg(){return"/"}function or(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Yg(e){if(typeof e=="string")e=new URL(e);else if(!or(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Jg(e)}function Jg(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const i=t.codePointAt(n+2);if(i===70||i===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Es=["history","path","basename","stem","extname","dirname"];class Qg{constructor(t){let n;t?or(t)?n={path:t}:typeof t=="string"||Xg(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Kg.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i<Es.length;){const r=Es[i];r in n&&n[r]!==void 0&&n[r]!==null&&(this[r]=r==="history"?[...n[r]]:n[r])}let s;for(s in n)Es.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?bt.basename(this.path):void 0}set basename(t){Ps(t,"basename"),Is(t,"basename"),this.path=bt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?bt.dirname(this.path):void 0}set dirname(t){ta(this.basename,"dirname"),this.path=bt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?bt.extname(this.path):void 0}set extname(t){if(Is(t,"extname"),ta(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=bt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){or(t)&&(t=Yg(t)),Ps(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?bt.basename(this.path,this.extname):void 0}set stem(t){Ps(t,"stem"),Is(t,"stem"),this.path=bt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,i){const s=this.message(t,n,i);throw s.fatal=!0,s}info(t,n,i){const s=this.message(t,n,i);return s.fatal=void 0,s}message(t,n,i){const s=new Ke(t,n,i);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Is(e,t){if(e&&e.includes(bt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+bt.sep+"`")}function Ps(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ta(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Xg(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const eb=(function(e){const i=this.constructor.prototype,s=i[e],r=function(){return s.apply(r,arguments)};return Object.setPrototypeOf(r,i),r}),tb={}.hasOwnProperty;class jr extends eb{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=jg()}copy(){const t=new jr;let n=-1;for(;++n<this.attachers.length;){const i=this.attachers[n];t.use(...i)}return t.data(Ts(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Rs("data",this.frozen),this.namespace[t]=n,this):tb.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Rs("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...i]=this.attachers[this.freezeIndex];if(i[0]===!1)continue;i[0]===!0&&(i[0]=void 0);const s=n.call(t,...i);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=bi(t),i=this.parser||this.Parser;return Os("parse",i),i(String(n),n)}process(t,n){const i=this;return this.freeze(),Os("process",this.parser||this.Parser),$s("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(r,o){const a=bi(t),l=i.parse(a);i.run(l,a,function(d,u,h){if(d||!u||!h)return c(d);const f=u,m=i.stringify(f,h);ib(m)?h.value=m:h.result=m,c(d,h)});function c(d,u){d||!u?o(d):r?r(u):n(void 0,u)}}}processSync(t){let n=!1,i;return this.freeze(),Os("processSync",this.parser||this.Parser),$s("processSync",this.compiler||this.Compiler),this.process(t,s),ia("processSync","process",n),i;function s(r,o){n=!0,Jo(r),i=o}}run(t,n,i){na(t),this.freeze();const s=this.transformers;return!i&&typeof n=="function"&&(i=n,n=void 0),i?r(void 0,i):new Promise(r);function r(o,a){const l=bi(n);s.run(t,l,c);function c(d,u,h){const f=u||t;d?a(d):o?o(f):i(void 0,f,h)}}}runSync(t,n){let i=!1,s;return this.run(t,n,r),ia("runSync","run",i),s;function r(o,a){Jo(o),s=a,i=!0}}stringify(t,n){this.freeze();const i=bi(n),s=this.compiler||this.Compiler;return $s("stringify",s),na(t),s(t,i)}use(t,...n){const i=this.attachers,s=this.namespace;if(Rs("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function r(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...u]=c;l(d,u)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(s.settings=Ts(!0,s.settings,c.settings))}function a(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const u=c[d];r(u)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,d){let u=-1,h=-1;for(;++u<i.length;)if(i[u][0]===c){h=u;break}if(h===-1)i.push([c,...d]);else if(d.length>0){let[f,...m]=d;const p=i[h][1];sr(p)&&sr(f)&&(f=Ts(!0,p,f)),i[h]=[c,f,...m]}}}}const Kl=new jr().freeze();function Os(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function $s(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Rs(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function na(e){if(!sr(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ia(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function bi(e){return nb(e)?e:new Qg(e)}function nb(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ib(e){return typeof e=="string"||sb(e)}function sb(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const rb={};function Br(e,t){const n=rb,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Gl(e,i,s)}function Gl(e,t,n){if(ob(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return sa(e.children,t,n)}return Array.isArray(e)?sa(e,t,n):""}function sa(e,t,n){const i=[];let s=-1;for(;++s<e.length;)i[s]=Gl(e[s],t,n);return i.join("")}function ob(e){return!!(e&&typeof e=="object")}const ra=document.createElement("i");function Ur(e){const t="&"+e+";";ra.innerHTML=t;const n=ra.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Qe(e,t,n,i){const s=e.length;let r=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);r<i.length;)o=i.slice(r,r+1e4),o.unshift(t,0),e.splice(...o),r+=1e4,t+=1e4}function it(e,t){return e.length>0?(Qe(e,e.length,0,t),e):t}const oa={}.hasOwnProperty;function Yl(e){const t={};let n=-1;for(;++n<e.length;)ab(t,e[n]);return t}function ab(e,t){let n;for(n in t){const s=(oa.call(e,n)?e[n]:void 0)||(e[n]={}),r=t[n];let o;if(r)for(o in r){oa.call(s,o)||(s[o]=[]);const a=r[o];lb(s[o],Array.isArray(a)?a:a?[a]:[])}}}function lb(e,t){let n=-1;const i=[];for(;++n<t.length;)(t[n].add==="after"?e:i).push(t[n]);Qe(e,0,0,i)}function Jl(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function pt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Be=Ft(/[A-Za-z]/),Ve=Ft(/[\dA-Za-z]/),cb=Ft(/[#-'*+\--9=?A-Z^-~]/);function Yi(e){return e!==null&&(e<32||e===127)}const ar=Ft(/\d/),ub=Ft(/[\dA-Fa-f]/),db=Ft(/[!-/:-@[-`{-~]/);function G(e){return e!==null&&e<-2}function ge(e){return e!==null&&(e<0||e===32)}function se(e){return e===-2||e===-1||e===32}const as=Ft(new RegExp("\\p{P}|\\p{S}","u")),Vt=Ft(/\s/);function Ft(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function le(e,t,n,i){const s=i?i-1:Number.POSITIVE_INFINITY;let r=0;return o;function o(l){return se(l)?(e.enter(n),a(l)):t(l)}function a(l){return se(l)&&r++<s?(e.consume(l),a):(e.exit(n),t(l))}}const fb={tokenize:hb};function hb(e){const t=e.attempt(this.parser.constructs.contentInitial,i,s);let n;return t;function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),le(e,t,"linePrefix")}function s(a){return e.enter("paragraph"),r(a)}function r(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return G(a)?(e.consume(a),e.exit("chunkText"),r):(e.consume(a),o)}}const pb={tokenize:mb},aa={tokenize:gb};function mb(e){const t=this,n=[];let i=0,s,r,o;return a;function a(S){if(i<n.length){const I=n[i];return t.containerState=I[1],e.attempt(I[0].continuation,l,c)(S)}return c(S)}function l(S){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&C();const I=t.events.length;let O=I,k;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){k=t.events[O][1].end;break}w(i);let E=I;for(;E<t.events.length;)t.events[E][1].end={...k},E++;return Qe(t.events,O+1,0,t.events.slice(I)),t.events.length=E,c(S)}return a(S)}function c(S){if(i===n.length){if(!s)return h(S);if(s.currentConstruct&&s.currentConstruct.concrete)return m(S);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(aa,d,u)(S)}function d(S){return s&&C(),w(i),h(S)}function u(S){return t.parser.lazy[t.now().line]=i!==n.length,o=t.now().offset,m(S)}function h(S){return t.containerState={},e.attempt(aa,f,m)(S)}function f(S){return i++,n.push([t.currentConstruct,t.containerState]),h(S)}function m(S){if(S===null){s&&C(),w(0),e.consume(S);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:r}),p(S)}function p(S){if(S===null){y(e.exit("chunkFlow"),!0),w(0),e.consume(S);return}return G(S)?(e.consume(S),y(e.exit("chunkFlow")),i=0,t.interrupt=void 0,a):(e.consume(S),p)}function y(S,I){const O=t.sliceStream(S);if(I&&O.push(null),S.previous=r,r&&(r.next=S),r=S,s.defineSkip(S.start),s.write(O),t.parser.lazy[S.start.line]){let k=s.events.length;for(;k--;)if(s.events[k][1].start.offset<o&&(!s.events[k][1].end||s.events[k][1].end.offset>o))return;const E=t.events.length;let $=E,W,R;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){if(W){R=t.events[$][1].end;break}W=!0}for(w(i),k=E;k<t.events.length;)t.events[k][1].end={...R},k++;Qe(t.events,$+1,0,t.events.slice(E)),t.events.length=k}}function w(S){let I=n.length;for(;I-- >S;){const O=n[I];t.containerState=O[1],O[0].exit.call(t,e)}n.length=S}function C(){s.write([null]),r=void 0,s=void 0,t.containerState._closeFlow=void 0}}function gb(e,t,n){return le(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Cn(e){if(e===null||ge(e)||Vt(e))return 1;if(as(e))return 2}function ls(e,t,n){const i=[];let s=-1;for(;++s<e.length;){const r=e[s].resolveAll;r&&!i.includes(r)&&(t=r(t,n),i.push(r))}return t}const lr={name:"attention",resolveAll:bb,tokenize:yb};function bb(e,t){let n=-1,i,s,r,o,a,l,c,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(i=n;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const u={...e[i][1].end},h={...e[n][1].start};la(u,-l),la(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:u,end:{...e[i][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},r={type:l>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[i][1].end={...o.start},e[n][1].start={...a.end},c=[],e[i][1].end.offset-e[i][1].start.offset&&(c=it(c,[["enter",e[i][1],t],["exit",e[i][1],t]])),c=it(c,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",r,t]]),c=it(c,ls(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),c=it(c,[["exit",r,t],["enter",a,t],["exit",a,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=it(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Qe(e,i-1,n-i+3,c),n=i+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function yb(e,t){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,s=Cn(i);let r;return o;function o(l){return r=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===r)return e.consume(l),a;const c=e.exit("attentionSequence"),d=Cn(l),u=!d||d===2&&s||n.includes(l),h=!s||s===2&&d||n.includes(i);return c._open=!!(r===42?u:u&&(s||!h)),c._close=!!(r===42?h:h&&(d||!u)),t(l)}}function la(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const wb={name:"autolink",tokenize:kb};function kb(e,t,n){let i=0;return s;function s(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),r}function r(f){return Be(f)?(e.consume(f),o):f===64?n(f):c(f)}function o(f){return f===43||f===45||f===46||Ve(f)?(i=1,a(f)):c(f)}function a(f){return f===58?(e.consume(f),i=0,l):(f===43||f===45||f===46||Ve(f))&&i++<32?(e.consume(f),a):(i=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||Yi(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),d):cb(f)?(e.consume(f),c):n(f)}function d(f){return Ve(f)?u(f):n(f)}function u(f){return f===46?(e.consume(f),i=0,d):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||Ve(f))&&i++<63){const m=f===45?h:u;return e.consume(f),m}return n(f)}}const si={partial:!0,tokenize:vb};function vb(e,t,n){return i;function i(r){return se(r)?le(e,s,"linePrefix")(r):s(r)}function s(r){return r===null||G(r)?t(r):n(r)}}const Ql={continuation:{tokenize:xb},exit:_b,name:"blockQuote",tokenize:Sb};function Sb(e,t,n){const i=this;return s;function s(o){if(o===62){const a=i.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),r}return n(o)}function r(o){return se(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function xb(e,t,n){const i=this;return s;function s(o){return se(o)?le(e,r,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):r(o)}function r(o){return e.attempt(Ql,t,n)(o)}}function _b(e){e.exit("blockQuote")}const Xl={name:"characterEscape",tokenize:Cb};function Cb(e,t,n){return i;function i(r){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(r),e.exit("escapeMarker"),s}function s(r){return db(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}const ec={name:"characterReference",tokenize:Ab};function Ab(e,t,n){const i=this;let s=0,r,o;return a;function a(u){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),l}function l(u){return u===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(u),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),r=31,o=Ve,d(u))}function c(u){return u===88||u===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(u),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,o=ub,d):(e.enter("characterReferenceValue"),r=7,o=ar,d(u))}function d(u){if(u===59&&s){const h=e.exit("characterReferenceValue");return o===Ve&&!Ur(i.sliceSerialize(h))?n(u):(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(u)&&s++<r?(e.consume(u),d):n(u)}}const ca={partial:!0,tokenize:Eb},ua={concrete:!0,name:"codeFenced",tokenize:Tb};function Tb(e,t,n){const i=this,s={partial:!0,tokenize:O};let r=0,o=0,a;return l;function l(k){return c(k)}function c(k){const E=i.events[i.events.length-1];return r=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(k)}function d(k){return k===a?(o++,e.consume(k),d):o<3?n(k):(e.exit("codeFencedFenceSequence"),se(k)?le(e,u,"whitespace")(k):u(k))}function u(k){return k===null||G(k)?(e.exit("codeFencedFence"),i.interrupt?t(k):e.check(ca,p,I)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===null||G(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(k)):se(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),le(e,f,"whitespace")(k)):k===96&&k===a?n(k):(e.consume(k),h)}function f(k){return k===null||G(k)?u(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||G(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(k)):k===96&&k===a?n(k):(e.consume(k),m)}function p(k){return e.attempt(s,I,y)(k)}function y(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),w}function w(k){return r>0&&se(k)?le(e,C,"linePrefix",r+1)(k):C(k)}function C(k){return k===null||G(k)?e.check(ca,p,I)(k):(e.enter("codeFlowValue"),S(k))}function S(k){return k===null||G(k)?(e.exit("codeFlowValue"),C(k)):(e.consume(k),S)}function I(k){return e.exit("codeFenced"),t(k)}function O(k,E,$){let W=0;return R;function R(ne){return k.enter("lineEnding"),k.consume(ne),k.exit("lineEnding"),H}function H(ne){return k.enter("codeFencedFence"),se(ne)?le(k,B,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ne):B(ne)}function B(ne){return ne===a?(k.enter("codeFencedFenceSequence"),te(ne)):$(ne)}function te(ne){return ne===a?(W++,k.consume(ne),te):W>=o?(k.exit("codeFencedFenceSequence"),se(ne)?le(k,ce,"whitespace")(ne):ce(ne)):$(ne)}function ce(ne){return ne===null||G(ne)?(k.exit("codeFencedFence"),E(ne)):$(ne)}}}function Eb(e,t,n){const i=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r)}function r(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}const Ns={name:"codeIndented",tokenize:Pb},Ib={partial:!0,tokenize:Ob};function Pb(e,t,n){const i=this;return s;function s(c){return e.enter("codeIndented"),le(e,r,"linePrefix",5)(c)}function r(c){const d=i.events[i.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):G(c)?e.attempt(Ib,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||G(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function Ob(e,t,n){const i=this;return s;function s(o){return i.parser.lazy[i.now().line]?n(o):G(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):le(e,r,"linePrefix",5)(o)}function r(o){const a=i.events[i.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):G(o)?s(o):n(o)}}const $b={name:"codeText",previous:Nb,resolve:Rb,tokenize:Lb};function Rb(e){let t=e.length-4,n=3,i,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i<t;)if(e[i][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(i=n-1,t++;++i<=t;)s===void 0?i!==t&&e[i][1].type!=="lineEnding"&&(s=i):(i===t||e[i][1].type==="lineEnding")&&(e[s][1].type="codeTextData",i!==s+2&&(e[s][1].end=e[i-1][1].end,e.splice(s+2,i-s-2),t-=i-s-2,i=s+2),s=void 0);return e}function Nb(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Lb(e,t,n){let i=0,s,r;return o;function o(u){return e.enter("codeText"),e.enter("codeTextSequence"),a(u)}function a(u){return u===96?(e.consume(u),i++,a):(e.exit("codeTextSequence"),l(u))}function l(u){return u===null?n(u):u===32?(e.enter("space"),e.consume(u),e.exit("space"),l):u===96?(r=e.enter("codeTextSequence"),s=0,d(u)):G(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(u))}function c(u){return u===null||u===32||u===96||G(u)?(e.exit("codeTextData"),l(u)):(e.consume(u),c)}function d(u){return u===96?(e.consume(u),s++,d):s===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(u)):(r.type="codeTextData",c(u))}}class Fb{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(t,i):t>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const s=n||0;this.setCursor(Math.trunc(t));const r=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return i&&zn(this.left,i),r.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),zn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),zn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);zn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);zn(this.left,n.reverse())}}}function zn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function tc(e){const t={};let n=-1,i,s,r,o,a,l,c;const d=new Fb(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(i=d.get(n),n&&i[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=i[1]._tokenizer.events,r=0,r<l.length&&l[r][1].type==="lineEndingBlank"&&(r+=2),r<l.length&&l[r][1].type==="content"))for(;++r<l.length&&l[r][1].type!=="content";)l[r][1].type==="chunkText"&&(l[r][1]._isInFirstContentOfListItem=!0,r++);if(i[0]==="enter")i[1].contentType&&(Object.assign(t,Db(d,n)),n=t[n],c=!0);else if(i[1]._container){for(r=n,s=void 0;r--;)if(o=d.get(r),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(d.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=r);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(i[1].end={...d.get(s)[1].start},a=d.slice(s,n),a.unshift(i),d.splice(s,n-s+1,a))}}return Qe(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function Db(e,t){const n=e.get(t)[1],i=e.get(t)[2];let s=t-1;const r=[];let o=n._tokenizer;o||(o=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],c={};let d,u,h=-1,f=n,m=0,p=0;const y=[p];for(;f;){for(;e.get(++s)[1]!==f;);r.push(s),f._tokenizer||(d=i.sliceStream(f),f.next||d.push(null),u&&o.defineSkip(f.start),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),u=f,f=f.next}for(f=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(p=h+1,y.push(p),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(o.events=[],f?(f._tokenizer=void 0,f.previous=void 0):y.pop(),h=y.length;h--;){const w=a.slice(y[h],y[h+1]),C=r.pop();l.push([C,C+w.length-1]),e.splice(C,2,w)}for(l.reverse(),h=-1;++h<l.length;)c[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return c}const zb={resolve:jb,tokenize:Bb},Mb={partial:!0,tokenize:Ub};function jb(e){return tc(e),e}function Bb(e,t){let n;return i;function i(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(a)}function s(a){return a===null?r(a):G(a)?e.check(Mb,o,r)(a):(e.consume(a),s)}function r(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function Ub(e,t,n){const i=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),le(e,r,"linePrefix")}function r(o){if(o===null||G(o))return n(o);const a=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(i.parser.constructs.flow,n,t)(o)}}function nc(e,t,n,i,s,r,o,a,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return u;function u(w){return w===60?(e.enter(i),e.enter(s),e.enter(r),e.consume(w),e.exit(r),h):w===null||w===32||w===41||Yi(w)?n(w):(e.enter(i),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),p(w))}function h(w){return w===62?(e.enter(r),e.consume(w),e.exit(r),e.exit(s),e.exit(i),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(w))}function f(w){return w===62?(e.exit("chunkString"),e.exit(a),h(w)):w===null||w===60||G(w)?n(w):(e.consume(w),w===92?m:f)}function m(w){return w===60||w===62||w===92?(e.consume(w),f):f(w)}function p(w){return!d&&(w===null||w===41||ge(w))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(i),t(w)):d<c&&w===40?(e.consume(w),d++,p):w===41?(e.consume(w),d--,p):w===null||w===32||w===40||Yi(w)?n(w):(e.consume(w),w===92?y:p)}function y(w){return w===40||w===41||w===92?(e.consume(w),p):p(w)}}function ic(e,t,n,i,s,r){const o=this;let a=0,l;return c;function c(f){return e.enter(i),e.enter(s),e.consume(f),e.exit(s),e.enter(r),d}function d(f){return a>999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(f):f===93?(e.exit(r),e.enter(s),e.consume(f),e.exit(s),e.exit(i),t):G(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===null||f===91||f===93||G(f)||a++>999?(e.exit("chunkString"),d(f)):(e.consume(f),l||(l=!se(f)),f===92?h:u)}function h(f){return f===91||f===92||f===93?(e.consume(f),a++,u):u(f)}}function sc(e,t,n,i,s,r){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(i),e.enter(s),e.consume(h),e.exit(s),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(s),e.consume(h),e.exit(s),e.exit(i),t):(e.enter(r),c(h))}function c(h){return h===o?(e.exit(r),l(o)):h===null?n(h):G(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),le(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===o||h===null||G(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?u:d)}function u(h){return h===o||h===92?(e.consume(h),d):d(h)}}function Zn(e,t){let n;return i;function i(s){return G(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,i):se(s)?le(e,i,n?"linePrefix":"lineSuffix")(s):t(s)}}const Hb={name:"definition",tokenize:Wb},qb={partial:!0,tokenize:Vb};function Wb(e,t,n){const i=this;let s;return r;function r(f){return e.enter("definition"),o(f)}function o(f){return ic.call(i,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return s=pt(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return ge(f)?Zn(e,c)(f):c(f)}function c(f){return nc(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(qb,u,u)(f)}function u(f){return se(f)?le(e,h,"whitespace")(f):h(f)}function h(f){return f===null||G(f)?(e.exit("definition"),i.parser.defined.push(s),t(f)):n(f)}}function Vb(e,t,n){return i;function i(a){return ge(a)?Zn(e,s)(a):n(a)}function s(a){return sc(e,r,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function r(a){return se(a)?le(e,o,"whitespace")(a):o(a)}function o(a){return a===null||G(a)?t(a):n(a)}}const Zb={name:"hardBreakEscape",tokenize:Kb};function Kb(e,t,n){return i;function i(r){return e.enter("hardBreakEscape"),e.consume(r),s}function s(r){return G(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}const Gb={name:"headingAtx",resolve:Yb,tokenize:Jb};function Yb(e,t){let n=e.length-2,i=3,s,r;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(s={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},r={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Qe(e,i,n-i+1,[["enter",s,t],["enter",r,t],["exit",r,t],["exit",s,t]])),e}function Jb(e,t,n){let i=0;return s;function s(d){return e.enter("atxHeading"),r(d)}function r(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&i++<6?(e.consume(d),o):d===null||ge(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||G(d)?(e.exit("atxHeading"),t(d)):se(d)?le(e,a,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),a(d))}function c(d){return d===null||d===35||ge(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),c)}}const Qb=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],da=["pre","script","style","textarea"],Xb={concrete:!0,name:"htmlFlow",resolveTo:ny,tokenize:iy},ey={partial:!0,tokenize:ry},ty={partial:!0,tokenize:sy};function ny(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function iy(e,t,n){const i=this;let s,r,o,a,l;return c;function c(g){return d(g)}function d(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),u}function u(g){return g===33?(e.consume(g),h):g===47?(e.consume(g),r=!0,p):g===63?(e.consume(g),s=3,i.interrupt?t:x):Be(g)?(e.consume(g),o=String.fromCharCode(g),y):n(g)}function h(g){return g===45?(e.consume(g),s=2,f):g===91?(e.consume(g),s=5,a=0,m):Be(g)?(e.consume(g),s=4,i.interrupt?t:x):n(g)}function f(g){return g===45?(e.consume(g),i.interrupt?t:x):n(g)}function m(g){const z="CDATA[";return g===z.charCodeAt(a++)?(e.consume(g),a===z.length?i.interrupt?t:B:m):n(g)}function p(g){return Be(g)?(e.consume(g),o=String.fromCharCode(g),y):n(g)}function y(g){if(g===null||g===47||g===62||ge(g)){const z=g===47,q=o.toLowerCase();return!z&&!r&&da.includes(q)?(s=1,i.interrupt?t(g):B(g)):Qb.includes(o.toLowerCase())?(s=6,z?(e.consume(g),w):i.interrupt?t(g):B(g)):(s=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(g):r?C(g):S(g))}return g===45||Ve(g)?(e.consume(g),o+=String.fromCharCode(g),y):n(g)}function w(g){return g===62?(e.consume(g),i.interrupt?t:B):n(g)}function C(g){return se(g)?(e.consume(g),C):R(g)}function S(g){return g===47?(e.consume(g),R):g===58||g===95||Be(g)?(e.consume(g),I):se(g)?(e.consume(g),S):R(g)}function I(g){return g===45||g===46||g===58||g===95||Ve(g)?(e.consume(g),I):O(g)}function O(g){return g===61?(e.consume(g),k):se(g)?(e.consume(g),O):S(g)}function k(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),l=g,E):se(g)?(e.consume(g),k):$(g)}function E(g){return g===l?(e.consume(g),l=null,W):g===null||G(g)?n(g):(e.consume(g),E)}function $(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||ge(g)?O(g):(e.consume(g),$)}function W(g){return g===47||g===62||se(g)?S(g):n(g)}function R(g){return g===62?(e.consume(g),H):n(g)}function H(g){return g===null||G(g)?B(g):se(g)?(e.consume(g),H):n(g)}function B(g){return g===45&&s===2?(e.consume(g),he):g===60&&s===1?(e.consume(g),me):g===62&&s===4?(e.consume(g),A):g===63&&s===3?(e.consume(g),x):g===93&&s===5?(e.consume(g),ae):G(g)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(ey,T,te)(g)):g===null||G(g)?(e.exit("htmlFlowData"),te(g)):(e.consume(g),B)}function te(g){return e.check(ty,ce,T)(g)}function ce(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),ne}function ne(g){return g===null||G(g)?te(g):(e.enter("htmlFlowData"),B(g))}function he(g){return g===45?(e.consume(g),x):B(g)}function me(g){return g===47?(e.consume(g),o="",we):B(g)}function we(g){if(g===62){const z=o.toLowerCase();return da.includes(z)?(e.consume(g),A):B(g)}return Be(g)&&o.length<8?(e.consume(g),o+=String.fromCharCode(g),we):B(g)}function ae(g){return g===93?(e.consume(g),x):B(g)}function x(g){return g===62?(e.consume(g),A):g===45&&s===2?(e.consume(g),x):B(g)}function A(g){return g===null||G(g)?(e.exit("htmlFlowData"),T(g)):(e.consume(g),A)}function T(g){return e.exit("htmlFlow"),t(g)}}function sy(e,t,n){const i=this;return s;function s(o){return G(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r):n(o)}function r(o){return i.parser.lazy[i.now().line]?n(o):t(o)}}function ry(e,t,n){return i;function i(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(si,t,n)}}const oy={name:"htmlText",tokenize:ay};function ay(e,t,n){const i=this;let s,r,o;return a;function a(x){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(x),l}function l(x){return x===33?(e.consume(x),c):x===47?(e.consume(x),O):x===63?(e.consume(x),S):Be(x)?(e.consume(x),$):n(x)}function c(x){return x===45?(e.consume(x),d):x===91?(e.consume(x),r=0,m):Be(x)?(e.consume(x),C):n(x)}function d(x){return x===45?(e.consume(x),f):n(x)}function u(x){return x===null?n(x):x===45?(e.consume(x),h):G(x)?(o=u,me(x)):(e.consume(x),u)}function h(x){return x===45?(e.consume(x),f):u(x)}function f(x){return x===62?he(x):x===45?h(x):u(x)}function m(x){const A="CDATA[";return x===A.charCodeAt(r++)?(e.consume(x),r===A.length?p:m):n(x)}function p(x){return x===null?n(x):x===93?(e.consume(x),y):G(x)?(o=p,me(x)):(e.consume(x),p)}function y(x){return x===93?(e.consume(x),w):p(x)}function w(x){return x===62?he(x):x===93?(e.consume(x),w):p(x)}function C(x){return x===null||x===62?he(x):G(x)?(o=C,me(x)):(e.consume(x),C)}function S(x){return x===null?n(x):x===63?(e.consume(x),I):G(x)?(o=S,me(x)):(e.consume(x),S)}function I(x){return x===62?he(x):S(x)}function O(x){return Be(x)?(e.consume(x),k):n(x)}function k(x){return x===45||Ve(x)?(e.consume(x),k):E(x)}function E(x){return G(x)?(o=E,me(x)):se(x)?(e.consume(x),E):he(x)}function $(x){return x===45||Ve(x)?(e.consume(x),$):x===47||x===62||ge(x)?W(x):n(x)}function W(x){return x===47?(e.consume(x),he):x===58||x===95||Be(x)?(e.consume(x),R):G(x)?(o=W,me(x)):se(x)?(e.consume(x),W):he(x)}function R(x){return x===45||x===46||x===58||x===95||Ve(x)?(e.consume(x),R):H(x)}function H(x){return x===61?(e.consume(x),B):G(x)?(o=H,me(x)):se(x)?(e.consume(x),H):W(x)}function B(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),s=x,te):G(x)?(o=B,me(x)):se(x)?(e.consume(x),B):(e.consume(x),ce)}function te(x){return x===s?(e.consume(x),s=void 0,ne):x===null?n(x):G(x)?(o=te,me(x)):(e.consume(x),te)}function ce(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===47||x===62||ge(x)?W(x):(e.consume(x),ce)}function ne(x){return x===47||x===62||ge(x)?W(x):n(x)}function he(x){return x===62?(e.consume(x),e.exit("htmlTextData"),e.exit("htmlText"),t):n(x)}function me(x){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),we}function we(x){return se(x)?le(e,ae,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):ae(x)}function ae(x){return e.enter("htmlTextData"),o(x)}}const Hr={name:"labelEnd",resolveAll:dy,resolveTo:fy,tokenize:hy},ly={tokenize:py},cy={tokenize:my},uy={tokenize:gy};function dy(e){let t=-1;const n=[];for(;++t<e.length;){const i=e[t][1];if(n.push(e[t]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const s=i.type==="labelImage"?4:2;i.type="data",t+=s}}return e.length!==n.length&&Qe(e,0,e.length,n),e}function fy(e,t){let n=e.length,i=0,s,r,o,a;for(;n--;)if(s=e[n][1],r){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(r=n,s.type!=="labelLink")){i=2;break}}else s.type==="labelEnd"&&(o=n);const l={type:e[r][1].type==="labelLink"?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},d={type:"labelText",start:{...e[r+i+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=it(a,e.slice(r+1,r+i+3)),a=it(a,[["enter",d,t]]),a=it(a,ls(t.parser.constructs.insideSpan.null,e.slice(r+i+4,o-3),t)),a=it(a,[["exit",d,t],e[o-2],e[o-1],["exit",c,t]]),a=it(a,e.slice(o+1)),a=it(a,[["exit",l,t]]),Qe(e,r,e.length,a),e}function hy(e,t,n){const i=this;let s=i.events.length,r,o;for(;s--;)if((i.events[s][1].type==="labelImage"||i.events[s][1].type==="labelLink")&&!i.events[s][1]._balanced){r=i.events[s][1];break}return a;function a(h){return r?r._inactive?u(h):(o=i.parser.defined.includes(pt(i.sliceSerialize({start:r.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(ly,d,o?d:u)(h):h===91?e.attempt(cy,d,o?c:u)(h):o?d(h):u(h)}function c(h){return e.attempt(uy,d,u)(h)}function d(h){return t(h)}function u(h){return r._balanced=!0,n(h)}}function py(e,t,n){return i;function i(u){return e.enter("resource"),e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),s}function s(u){return ge(u)?Zn(e,r)(u):r(u)}function r(u){return u===41?d(u):nc(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function o(u){return ge(u)?Zn(e,l)(u):d(u)}function a(u){return n(u)}function l(u){return u===34||u===39||u===40?sc(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):d(u)}function c(u){return ge(u)?Zn(e,d)(u):d(u)}function d(u){return u===41?(e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),e.exit("resource"),t):n(u)}}function my(e,t,n){const i=this;return s;function s(a){return ic.call(i,e,r,o,"reference","referenceMarker","referenceString")(a)}function r(a){return i.parser.defined.includes(pt(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function gy(e,t,n){return i;function i(r){return e.enter("reference"),e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),s}function s(r){return r===93?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}const by={name:"labelStartImage",resolveAll:Hr.resolveAll,tokenize:yy};function yy(e,t,n){const i=this;return s;function s(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),r}function r(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(a):t(a)}}const wy={name:"labelStartLink",resolveAll:Hr.resolveAll,tokenize:ky};function ky(e,t,n){const i=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),r}function r(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(o):t(o)}}const Ls={name:"lineEnding",tokenize:vy};function vy(e,t){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),le(e,t,"linePrefix")}}const $i={name:"thematicBreak",tokenize:Sy};function Sy(e,t,n){let i=0,s;return r;function r(c){return e.enter("thematicBreak"),o(c)}function o(c){return s=c,a(c)}function a(c){return c===s?(e.enter("thematicBreakSequence"),l(c)):i>=3&&(c===null||G(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===s?(e.consume(c),i++,l):(e.exit("thematicBreakSequence"),se(c)?le(e,a,"whitespace")(c):a(c))}}const We={continuation:{tokenize:Ay},exit:Ey,name:"list",tokenize:Cy},xy={partial:!0,tokenize:Iy},_y={partial:!0,tokenize:Ty};function Cy(e,t,n){const i=this,s=i.events[i.events.length-1];let r=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return a;function a(f){const m=i.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!i.containerState.marker||f===i.containerState.marker:ar(f)){if(i.containerState.type||(i.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check($i,n,c)(f):c(f);if(!i.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return ar(f)&&++o<10?(e.consume(f),l):(!i.interrupt||o<2)&&(i.containerState.marker?f===i.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||f,e.check(si,i.interrupt?n:d,e.attempt(xy,h,u))}function d(f){return i.containerState.initialBlankLine=!0,r++,h(f)}function u(f){return se(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return i.containerState.size=r+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Ay(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(si,s,r);function s(a){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,le(e,t,"listItemIndent",i.containerState.size+1)(a)}function r(a){return i.containerState.furtherBlankLines||!se(a)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(a)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(_y,t,o)(a))}function o(a){return i.containerState._closeFlow=!0,i.interrupt=void 0,le(e,e.attempt(We,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Ty(e,t,n){const i=this;return le(e,s,"listItemIndent",i.containerState.size+1);function s(r){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?t(r):n(r)}}function Ey(e){e.exit(this.containerState.type)}function Iy(e,t,n){const i=this;return le(e,s,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(r){const o=i.events[i.events.length-1];return!se(r)&&o&&o[1].type==="listItemPrefixWhitespace"?t(r):n(r)}}const fa={name:"setextUnderline",resolveTo:Py,tokenize:Oy};function Py(e,t){let n=e.length,i,s,r;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!r&&e[n][1].type==="definition"&&(r=n);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",r?(e.splice(s,0,["enter",o,t]),e.splice(r+1,0,["exit",e[i][1],t]),e[i][1].end={...e[r][1].end}):e[i][1]=o,e.push(["exit",o,t]),e}function Oy(e,t,n){const i=this;let s;return r;function r(c){let d=i.events.length,u;for(;d--;)if(i.events[d][1].type!=="lineEnding"&&i.events[d][1].type!=="linePrefix"&&i.events[d][1].type!=="content"){u=i.events[d][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||u)?(e.enter("setextHeadingLine"),s=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===s?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),se(c)?le(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||G(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const $y={tokenize:Ry};function Ry(e){const t=this,n=e.attempt(si,i,e.attempt(this.parser.constructs.flowInitial,s,le(e,e.attempt(this.parser.constructs.flow,s,e.attempt(zb,s)),"linePrefix")));return n;function i(r){if(r===null){e.consume(r);return}return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(r){if(r===null){e.consume(r);return}return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Ny={resolveAll:oc()},Ly=rc("string"),Fy=rc("text");function rc(e){return{resolveAll:oc(e==="text"?Dy:void 0),tokenize:t};function t(n){const i=this,s=this.parser.constructs[e],r=n.attempt(s,o,a);return o;function o(d){return c(d)?r(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return c(d)?(n.exit("data"),r(d)):(n.consume(d),l)}function c(d){if(d===null)return!0;const u=s[d];let h=-1;if(u)for(;++h<u.length;){const f=u[h];if(!f.previous||f.previous.call(i,i.previous))return!0}return!1}}}function oc(e){return t;function t(n,i){let s=-1,r;for(;++s<=n.length;)r===void 0?n[s]&&n[s][1].type==="data"&&(r=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==r+2&&(n[r][1].end=n[s-1][1].end,n.splice(r+2,s-r-2),s=r+2),r=void 0);return e?e(n,i):n}}function Dy(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const i=e[n-1][1],s=t.sliceStream(i);let r=s.length,o=-1,a=0,l;for(;r--;){const c=s[r];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){r++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:r?o:i.start._bufferIndex+o,_index:i.start._index+r,line:i.end.line,column:i.end.column-a,offset:i.end.offset-a},end:{...i.end}};i.end={...c.start},i.start.offset===i.end.offset?Object.assign(i,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const zy={42:We,43:We,45:We,48:We,49:We,50:We,51:We,52:We,53:We,54:We,55:We,56:We,57:We,62:Ql},My={91:Hb},jy={[-2]:Ns,[-1]:Ns,32:Ns},By={35:Gb,42:$i,45:[fa,$i],60:Xb,61:fa,95:$i,96:ua,126:ua},Uy={38:ec,92:Xl},Hy={[-5]:Ls,[-4]:Ls,[-3]:Ls,33:by,38:ec,42:lr,60:[wb,oy],91:wy,92:[Zb,Xl],93:Hr,95:lr,96:$b},qy={null:[lr,Ny]},Wy={null:[42,95]},Vy={null:[]},Zy=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Wy,contentInitial:My,disable:Vy,document:zy,flow:By,flowInitial:jy,insideSpan:qy,string:Uy,text:Hy},Symbol.toStringTag,{value:"Module"}));function Ky(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},r=[];let o=[],a=[];const l={attempt:E(O),check:E(k),consume:C,enter:S,exit:I,interrupt:E(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:p,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:u};let d=t.tokenize.call(c,l);return t.resolveAll&&r.push(t),c;function u(H){return o=it(o,H),y(),o[o.length-1]!==null?[]:($(t,0),c.events=ls(r,c.events,c),c.events)}function h(H,B){return Yy(f(H),B)}function f(H){return Gy(o,H)}function m(){const{_bufferIndex:H,_index:B,line:te,column:ce,offset:ne}=i;return{_bufferIndex:H,_index:B,line:te,column:ce,offset:ne}}function p(H){s[H.line]=H.column,R()}function y(){let H;for(;i._index<o.length;){const B=o[i._index];if(typeof B=="string")for(H=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===H&&i._bufferIndex<B.length;)w(B.charCodeAt(i._bufferIndex));else w(B)}}function w(H){d=d(H)}function C(H){G(H)?(i.line++,i.column=1,i.offset+=H===-3?2:1,R()):H!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===o[i._index].length&&(i._bufferIndex=-1,i._index++)),c.previous=H}function S(H,B){const te=B||{};return te.type=H,te.start=m(),c.events.push(["enter",te,c]),a.push(te),te}function I(H){const B=a.pop();return B.end=m(),c.events.push(["exit",B,c]),B}function O(H,B){$(H,B.from)}function k(H,B){B.restore()}function E(H,B){return te;function te(ce,ne,he){let me,we,ae,x;return Array.isArray(ce)?T(ce):"tokenize"in ce?T([ce]):A(ce);function A(M){return Y;function Y(ue){const de=ue!==null&&M[ue],ye=ue!==null&&M.null,Ge=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(ye)?ye:ye?[ye]:[]];return T(Ge)(ue)}}function T(M){return me=M,we=0,M.length===0?he:g(M[we])}function g(M){return Y;function Y(ue){return x=W(),ae=M,M.partial||(c.currentConstruct=M),M.name&&c.parser.constructs.disable.null.includes(M.name)?q():M.tokenize.call(B?Object.assign(Object.create(c),B):c,l,z,q)(ue)}}function z(M){return H(ae,x),ne}function q(M){return x.restore(),++we<me.length?g(me[we]):he}}}function $(H,B){H.resolveAll&&!r.includes(H)&&r.push(H),H.resolve&&Qe(c.events,B,c.events.length-B,H.resolve(c.events.slice(B),c)),H.resolveTo&&(c.events=H.resolveTo(c.events,c))}function W(){const H=m(),B=c.previous,te=c.currentConstruct,ce=c.events.length,ne=Array.from(a);return{from:ce,restore:he};function he(){i=H,c.previous=B,c.currentConstruct=te,c.events.length=ce,a=ne,R()}}function R(){i.line in s&&i.column<2&&(i.column=s[i.line],i.offset+=s[i.line]-1)}}function Gy(e,t){const n=t.start._index,i=t.start._bufferIndex,s=t.end._index,r=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(i,r)];else{if(o=e.slice(n,s),i>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(i):o.shift()}r>0&&o.push(e[s].slice(0,r))}return o}function Yy(e,t){let n=-1;const i=[];let s;for(;++n<e.length;){const r=e[n];let o;if(typeof r=="string")o=r;else switch(r){case-5:{o="\r";break}case-4:{o=`
68
68
  `;break}case-3:{o=`\r
69
- `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(r)}s=r===-2,i.push(o)}return i.join("")}function Jy(e){const i={constructs:Yl([Zy,...(e||{}).extensions||[]]),content:s(fb),defined:[],document:s(hb),flow:s($y),lazy:{},string:s(Ly),text:s(Fy)};return i;function s(r){return o;function o(a){return Ky(i,r,a)}}}function Qy(e){for(;!tc(e););return e}const pa=/[\0\t\n\r]/g;function Xy(){let e=1,t="",n=!0,i;return s;function s(r,o,a){const l=[];let c,d,u,p,f;for(r=t+(typeof r=="string"?r.toString():new TextDecoder(o||void 0).decode(r)),u=0,t="",n&&(r.charCodeAt(0)===65279&&u++,n=void 0);u<r.length;){if(pa.lastIndex=u,c=pa.exec(r),p=c&&c.index!==void 0?c.index:r.length,f=r.charCodeAt(p),!c){t=r.slice(u);break}if(f===10&&u===p&&i)l.push(-3),i=void 0;else switch(i&&(l.push(-5),i=void 0),u<p&&(l.push(r.slice(u,p)),e+=p-u),f){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:i=!0,e=1}u=p+1}return a&&(i&&l.push(-5),t&&l.push(t),l.push(null)),l}}const ew=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ac(e){return e.replace(ew,tw)}function tw(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),r=s===120||s===88;return Jl(n.slice(r?2:1),r?16:10)}return Ur(n)||e}const lc={}.hasOwnProperty;function nw(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),iw(n)(Qy(Jy(n).document().write(Xy()(e,t,!0))))}function iw(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(Qt),autolinkProtocol:W,autolinkEmail:W,atxHeading:r(et),blockQuote:r(ye),characterEscape:W,characterReference:W,codeFenced:r(Ge),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:r(Ge,o),codeText:r(Oe,o),codeTextData:W,data:W,codeFlowValue:W,definition:r(Fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:r(Yt),hardBreakEscape:r(Jt),hardBreakTrailing:r(Jt),htmlFlow:r(gt,o),htmlFlowData:W,htmlText:r(gt,o),htmlTextData:W,image:r(Ss),label:o,link:r(Qt),listItem:r(Xt),listItemValue:p,listOrdered:r(lt,u),listUnordered:r(lt),paragraph:r(Dt),reference:g,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:r(et),strong:r(ui),thematicBreak:r(Re)},exit:{atxHeading:l(),atxHeadingSequence:O,autolink:l(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:l(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:q,characterReferenceMarkerNumeric:q,characterReferenceValue:M,characterReference:Y,codeFenced:l(y),codeFencedFence:h,codeFencedFenceInfo:f,codeFencedFenceMeta:m,codeFlowValue:R,codeIndented:l(w),codeText:l(ne),codeTextData:R,data:R,definition:l(),definitionDestinationString:I,definitionLabelString:C,definitionTitleString:S,emphasis:l(),hardBreakEscape:l(B),hardBreakTrailing:l(B),htmlFlow:l(te),htmlFlowData:R,htmlText:l(ce),htmlTextData:R,image:l(me),label:ae,labelText:we,lineEnding:H,link:l(pe),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:z,resourceDestinationString:x,resourceTitleString:A,resource:E,setextHeading:l($),setextHeadingLineSequence:T,setextHeadingText:k,strong:l(),thematicBreak:l()}};cc(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(N){let j={type:"root",children:[]};const Q={stack:[j],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:d,data:n},oe=[];let fe=-1;for(;++fe<N.length;)if(N[fe][1].type==="listOrdered"||N[fe][1].type==="listUnordered")if(N[fe][0]==="enter")oe.push(fe);else{const qe=oe.pop();fe=s(N,qe,fe)}for(fe=-1;++fe<N.length;){const qe=t[N[fe][0]];lc.call(qe,N[fe][1].type)&&qe[N[fe][1].type].call(Object.assign({sliceSerialize:N[fe][2].sliceSerialize},Q),N[fe][1])}if(Q.tokenStack.length>0){const qe=Q.tokenStack[Q.tokenStack.length-1];(qe[1]||ha).call(Q,void 0,qe[0])}for(j.position={start:Pt(N.length>0?N[0][1].start:{line:1,column:1,offset:0}),end:Pt(N.length>0?N[N.length-2][1].end:{line:1,column:1,offset:0})},fe=-1;++fe<t.transforms.length;)j=t.transforms[fe](j)||j;return j}function s(N,j,Q){let oe=j-1,fe=-1,qe=!1,ct,Ye,Ce,vt;for(;++oe<=Q;){const $e=N[oe];switch($e[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{$e[0]==="enter"?fe++:fe--,vt=void 0;break}case"lineEndingBlank":{$e[0]==="enter"&&(ct&&!vt&&!fe&&!Ce&&(Ce=oe),vt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:vt=void 0}if(!fe&&$e[0]==="enter"&&$e[1].type==="listItemPrefix"||fe===-1&&$e[0]==="exit"&&($e[1].type==="listUnordered"||$e[1].type==="listOrdered")){if(ct){let ut=oe;for(Ye=void 0;ut--;){const dt=N[ut];if(dt[1].type==="lineEnding"||dt[1].type==="lineEndingBlank"){if(dt[0]==="exit")continue;Ye&&(N[Ye][1].type="lineEndingBlank",qe=!0),dt[1].type="lineEnding",Ye=ut}else if(!(dt[1].type==="linePrefix"||dt[1].type==="blockQuotePrefix"||dt[1].type==="blockQuotePrefixWhitespace"||dt[1].type==="blockQuoteMarker"||dt[1].type==="listItemIndent"))break}Ce&&(!Ye||Ce<Ye)&&(ct._spread=!0),ct.end=Object.assign({},Ye?N[Ye][1].start:$e[1].end),N.splice(Ye||oe,0,["exit",ct,$e[2]]),oe++,Q++}if($e[1].type==="listItemPrefix"){const ut={type:"listItem",_spread:!1,start:Object.assign({},$e[1].start),end:void 0};ct=ut,N.splice(oe,0,["enter",ut,$e[2]]),oe++,Q++,Ce=void 0,vt=!0}}}return N[j][1]._spread=qe,Q}function r(N,j){return Q;function Q(oe){a.call(this,N(oe),oe),j&&j.call(this,oe)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(N,j,Q){this.stack[this.stack.length-1].children.push(N),this.stack.push(N),this.tokenStack.push([j,Q||void 0]),N.position={start:Pt(j.start),end:void 0}}function l(N){return j;function j(Q){N&&N.call(this,Q),c.call(this,Q)}}function c(N,j){const Q=this.stack.pop(),oe=this.tokenStack.pop();if(oe)oe[0].type!==N.type&&(j?j.call(this,N,oe[0]):(oe[1]||ha).call(this,N,oe[0]));else throw new Error("Cannot close `"+N.type+"` ("+Vn({start:N.start,end:N.end})+"): it’s not open");Q.position.end=Pt(N.end)}function d(){return Br(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function p(N){if(this.data.expectingFirstListItemValue){const j=this.stack[this.stack.length-2];j.start=Number.parseInt(this.sliceSerialize(N),10),this.data.expectingFirstListItemValue=void 0}}function f(){const N=this.resume(),j=this.stack[this.stack.length-1];j.lang=N}function m(){const N=this.resume(),j=this.stack[this.stack.length-1];j.meta=N}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const N=this.resume(),j=this.stack[this.stack.length-1];j.value=N.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const N=this.resume(),j=this.stack[this.stack.length-1];j.value=N.replace(/(\r?\n|\r)$/g,"")}function C(N){const j=this.resume(),Q=this.stack[this.stack.length-1];Q.label=j,Q.identifier=ht(this.sliceSerialize(N)).toLowerCase()}function S(){const N=this.resume(),j=this.stack[this.stack.length-1];j.title=N}function I(){const N=this.resume(),j=this.stack[this.stack.length-1];j.url=N}function O(N){const j=this.stack[this.stack.length-1];if(!j.depth){const Q=this.sliceSerialize(N).length;j.depth=Q}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function T(N){const j=this.stack[this.stack.length-1];j.depth=this.sliceSerialize(N).codePointAt(0)===61?1:2}function $(){this.data.setextHeadingSlurpLineEnding=void 0}function W(N){const Q=this.stack[this.stack.length-1].children;let oe=Q[Q.length-1];(!oe||oe.type!=="text")&&(oe=en(),oe.position={start:Pt(N.start),end:void 0},Q.push(oe)),this.stack.push(oe)}function R(N){const j=this.stack.pop();j.value+=this.sliceSerialize(N),j.position.end=Pt(N.end)}function H(N){const j=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Q=j.children[j.children.length-1];Q.position.end=Pt(N.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(j.type)&&(W.call(this,N),R.call(this,N))}function B(){this.data.atHardBreak=!0}function te(){const N=this.resume(),j=this.stack[this.stack.length-1];j.value=N}function ce(){const N=this.resume(),j=this.stack[this.stack.length-1];j.value=N}function ne(){const N=this.resume(),j=this.stack[this.stack.length-1];j.value=N}function pe(){const N=this.stack[this.stack.length-1];if(this.data.inReference){const j=this.data.referenceType||"shortcut";N.type+="Reference",N.referenceType=j,delete N.url,delete N.title}else delete N.identifier,delete N.label;this.data.referenceType=void 0}function me(){const N=this.stack[this.stack.length-1];if(this.data.inReference){const j=this.data.referenceType||"shortcut";N.type+="Reference",N.referenceType=j,delete N.url,delete N.title}else delete N.identifier,delete N.label;this.data.referenceType=void 0}function we(N){const j=this.sliceSerialize(N),Q=this.stack[this.stack.length-2];Q.label=ac(j),Q.identifier=ht(j).toLowerCase()}function ae(){const N=this.stack[this.stack.length-1],j=this.resume(),Q=this.stack[this.stack.length-1];if(this.data.inReference=!0,Q.type==="link"){const oe=N.children;Q.children=oe}else Q.alt=j}function x(){const N=this.resume(),j=this.stack[this.stack.length-1];j.url=N}function A(){const N=this.resume(),j=this.stack[this.stack.length-1];j.title=N}function E(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function z(N){const j=this.resume(),Q=this.stack[this.stack.length-1];Q.label=j,Q.identifier=ht(this.sliceSerialize(N)).toLowerCase(),this.data.referenceType="full"}function q(N){this.data.characterReferenceType=N.type}function M(N){const j=this.sliceSerialize(N),Q=this.data.characterReferenceType;let oe;Q?(oe=Jl(j,Q==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):oe=Ur(j);const fe=this.stack[this.stack.length-1];fe.value+=oe}function Y(N){const j=this.stack.pop();j.position.end=Pt(N.end)}function ue(N){R.call(this,N);const j=this.stack[this.stack.length-1];j.url=this.sliceSerialize(N)}function de(N){R.call(this,N);const j=this.stack[this.stack.length-1];j.url="mailto:"+this.sliceSerialize(N)}function ye(){return{type:"blockquote",children:[]}}function Ge(){return{type:"code",lang:null,meta:null,value:""}}function Oe(){return{type:"inlineCode",value:""}}function Fe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Yt(){return{type:"emphasis",children:[]}}function et(){return{type:"heading",depth:0,children:[]}}function Jt(){return{type:"break"}}function gt(){return{type:"html",value:""}}function Ss(){return{type:"image",title:null,url:"",alt:null}}function Qt(){return{type:"link",title:null,url:"",children:[]}}function lt(N){return{type:"list",ordered:N.type==="listOrdered",start:null,spread:N._spread,children:[]}}function Xt(N){return{type:"listItem",spread:N._spread,checked:null,children:[]}}function Dt(){return{type:"paragraph",children:[]}}function ui(){return{type:"strong",children:[]}}function en(){return{type:"text",value:""}}function Re(){return{type:"thematicBreak"}}}function Pt(e){return{line:e.line,column:e.column,offset:e.offset}}function cc(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?cc(e,i):sw(e,i)}}function sw(e,t){let n;for(n in t)if(lc.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function ha(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Vn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Vn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Vn({start:t.start,end:t.end})+") is still open")}function rw(e){const t=this;t.parser=n;function n(i){return nw(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}const ma={}.hasOwnProperty;function ow(e,t){const n=t||{};function i(s,...r){let o=i.invalid;const a=i.handlers;if(s&&ma.call(s,e)){const l=String(s[e]);o=ma.call(a,l)?a[l]:i.unknown}if(o)return o.call(this,s,...r)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}const aw={}.hasOwnProperty;function uc(e,t){let n=-1,i;if(t.extensions)for(;++n<t.extensions.length;)uc(e,t.extensions[n]);for(i in t)if(aw.call(t,i))switch(i){case"extensions":break;case"unsafe":{ga(e[i],t[i]);break}case"join":{ga(e[i],t[i]);break}case"handlers":{lw(e[i],t[i]);break}default:e.options[i]=t[i]}return e}function ga(e,t){t&&e.push(...t)}function lw(e,t){t&&Object.assign(e,t)}function cw(e,t,n,i){const s=n.enter("blockquote"),r=n.createTracker(i);r.move("> "),r.shift(2);const o=n.indentLines(n.containerFlow(e,r.current()),uw);return s(),o}function uw(e,t,n){return">"+(n?"":" ")+e}function dc(e,t){return ba(e,t.inConstruct,!0)&&!ba(e,t.notInConstruct,!1)}function ba(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function ya(e,t,n,i){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
69
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(r)}s=r===-2,i.push(o)}return i.join("")}function Jy(e){const i={constructs:Yl([Zy,...(e||{}).extensions||[]]),content:s(fb),defined:[],document:s(pb),flow:s($y),lazy:{},string:s(Ly),text:s(Fy)};return i;function s(r){return o;function o(a){return Ky(i,r,a)}}}function Qy(e){for(;!tc(e););return e}const ha=/[\0\t\n\r]/g;function Xy(){let e=1,t="",n=!0,i;return s;function s(r,o,a){const l=[];let c,d,u,h,f;for(r=t+(typeof r=="string"?r.toString():new TextDecoder(o||void 0).decode(r)),u=0,t="",n&&(r.charCodeAt(0)===65279&&u++,n=void 0);u<r.length;){if(ha.lastIndex=u,c=ha.exec(r),h=c&&c.index!==void 0?c.index:r.length,f=r.charCodeAt(h),!c){t=r.slice(u);break}if(f===10&&u===h&&i)l.push(-3),i=void 0;else switch(i&&(l.push(-5),i=void 0),u<h&&(l.push(r.slice(u,h)),e+=h-u),f){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:i=!0,e=1}u=h+1}return a&&(i&&l.push(-5),t&&l.push(t),l.push(null)),l}}const ew=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ac(e){return e.replace(ew,tw)}function tw(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),r=s===120||s===88;return Jl(n.slice(r?2:1),r?16:10)}return Ur(n)||e}const lc={}.hasOwnProperty;function nw(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),iw(n)(Qy(Jy(n).document().write(Xy()(e,t,!0))))}function iw(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(Qt),autolinkProtocol:W,autolinkEmail:W,atxHeading:r(et),blockQuote:r(ye),characterEscape:W,characterReference:W,codeFenced:r(Ge),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:r(Ge,o),codeText:r(Oe,o),codeTextData:W,data:W,codeFlowValue:W,definition:r(Fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:r(Yt),hardBreakEscape:r(Jt),hardBreakTrailing:r(Jt),htmlFlow:r(gt,o),htmlFlowData:W,htmlText:r(gt,o),htmlTextData:W,image:r(Ss),label:o,link:r(Qt),listItem:r(Xt),listItemValue:h,listOrdered:r(lt,u),listUnordered:r(lt),paragraph:r(Dt),reference:g,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:r(et),strong:r(ui),thematicBreak:r(Re)},exit:{atxHeading:l(),atxHeadingSequence:O,autolink:l(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:l(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:q,characterReferenceMarkerNumeric:q,characterReferenceValue:M,characterReference:Y,codeFenced:l(y),codeFencedFence:p,codeFencedFenceInfo:f,codeFencedFenceMeta:m,codeFlowValue:R,codeIndented:l(w),codeText:l(ne),codeTextData:R,data:R,definition:l(),definitionDestinationString:I,definitionLabelString:C,definitionTitleString:S,emphasis:l(),hardBreakEscape:l(B),hardBreakTrailing:l(B),htmlFlow:l(te),htmlFlowData:R,htmlText:l(ce),htmlTextData:R,image:l(me),label:ae,labelText:we,lineEnding:H,link:l(he),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:z,resourceDestinationString:x,resourceTitleString:A,resource:T,setextHeading:l($),setextHeadingLineSequence:E,setextHeadingText:k,strong:l(),thematicBreak:l()}};cc(t,(e||{}).mdastExtensions||[]);const n={};return i;function i(N){let j={type:"root",children:[]};const Q={stack:[j],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:d,data:n},oe=[];let fe=-1;for(;++fe<N.length;)if(N[fe][1].type==="listOrdered"||N[fe][1].type==="listUnordered")if(N[fe][0]==="enter")oe.push(fe);else{const qe=oe.pop();fe=s(N,qe,fe)}for(fe=-1;++fe<N.length;){const qe=t[N[fe][0]];lc.call(qe,N[fe][1].type)&&qe[N[fe][1].type].call(Object.assign({sliceSerialize:N[fe][2].sliceSerialize},Q),N[fe][1])}if(Q.tokenStack.length>0){const qe=Q.tokenStack[Q.tokenStack.length-1];(qe[1]||pa).call(Q,void 0,qe[0])}for(j.position={start:Pt(N.length>0?N[0][1].start:{line:1,column:1,offset:0}),end:Pt(N.length>0?N[N.length-2][1].end:{line:1,column:1,offset:0})},fe=-1;++fe<t.transforms.length;)j=t.transforms[fe](j)||j;return j}function s(N,j,Q){let oe=j-1,fe=-1,qe=!1,ct,Ye,Ce,vt;for(;++oe<=Q;){const $e=N[oe];switch($e[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{$e[0]==="enter"?fe++:fe--,vt=void 0;break}case"lineEndingBlank":{$e[0]==="enter"&&(ct&&!vt&&!fe&&!Ce&&(Ce=oe),vt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:vt=void 0}if(!fe&&$e[0]==="enter"&&$e[1].type==="listItemPrefix"||fe===-1&&$e[0]==="exit"&&($e[1].type==="listUnordered"||$e[1].type==="listOrdered")){if(ct){let ut=oe;for(Ye=void 0;ut--;){const dt=N[ut];if(dt[1].type==="lineEnding"||dt[1].type==="lineEndingBlank"){if(dt[0]==="exit")continue;Ye&&(N[Ye][1].type="lineEndingBlank",qe=!0),dt[1].type="lineEnding",Ye=ut}else if(!(dt[1].type==="linePrefix"||dt[1].type==="blockQuotePrefix"||dt[1].type==="blockQuotePrefixWhitespace"||dt[1].type==="blockQuoteMarker"||dt[1].type==="listItemIndent"))break}Ce&&(!Ye||Ce<Ye)&&(ct._spread=!0),ct.end=Object.assign({},Ye?N[Ye][1].start:$e[1].end),N.splice(Ye||oe,0,["exit",ct,$e[2]]),oe++,Q++}if($e[1].type==="listItemPrefix"){const ut={type:"listItem",_spread:!1,start:Object.assign({},$e[1].start),end:void 0};ct=ut,N.splice(oe,0,["enter",ut,$e[2]]),oe++,Q++,Ce=void 0,vt=!0}}}return N[j][1]._spread=qe,Q}function r(N,j){return Q;function Q(oe){a.call(this,N(oe),oe),j&&j.call(this,oe)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(N,j,Q){this.stack[this.stack.length-1].children.push(N),this.stack.push(N),this.tokenStack.push([j,Q||void 0]),N.position={start:Pt(j.start),end:void 0}}function l(N){return j;function j(Q){N&&N.call(this,Q),c.call(this,Q)}}function c(N,j){const Q=this.stack.pop(),oe=this.tokenStack.pop();if(oe)oe[0].type!==N.type&&(j?j.call(this,N,oe[0]):(oe[1]||pa).call(this,N,oe[0]));else throw new Error("Cannot close `"+N.type+"` ("+Vn({start:N.start,end:N.end})+"): it’s not open");Q.position.end=Pt(N.end)}function d(){return Br(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function h(N){if(this.data.expectingFirstListItemValue){const j=this.stack[this.stack.length-2];j.start=Number.parseInt(this.sliceSerialize(N),10),this.data.expectingFirstListItemValue=void 0}}function f(){const N=this.resume(),j=this.stack[this.stack.length-1];j.lang=N}function m(){const N=this.resume(),j=this.stack[this.stack.length-1];j.meta=N}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const N=this.resume(),j=this.stack[this.stack.length-1];j.value=N.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const N=this.resume(),j=this.stack[this.stack.length-1];j.value=N.replace(/(\r?\n|\r)$/g,"")}function C(N){const j=this.resume(),Q=this.stack[this.stack.length-1];Q.label=j,Q.identifier=pt(this.sliceSerialize(N)).toLowerCase()}function S(){const N=this.resume(),j=this.stack[this.stack.length-1];j.title=N}function I(){const N=this.resume(),j=this.stack[this.stack.length-1];j.url=N}function O(N){const j=this.stack[this.stack.length-1];if(!j.depth){const Q=this.sliceSerialize(N).length;j.depth=Q}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function E(N){const j=this.stack[this.stack.length-1];j.depth=this.sliceSerialize(N).codePointAt(0)===61?1:2}function $(){this.data.setextHeadingSlurpLineEnding=void 0}function W(N){const Q=this.stack[this.stack.length-1].children;let oe=Q[Q.length-1];(!oe||oe.type!=="text")&&(oe=en(),oe.position={start:Pt(N.start),end:void 0},Q.push(oe)),this.stack.push(oe)}function R(N){const j=this.stack.pop();j.value+=this.sliceSerialize(N),j.position.end=Pt(N.end)}function H(N){const j=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Q=j.children[j.children.length-1];Q.position.end=Pt(N.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(j.type)&&(W.call(this,N),R.call(this,N))}function B(){this.data.atHardBreak=!0}function te(){const N=this.resume(),j=this.stack[this.stack.length-1];j.value=N}function ce(){const N=this.resume(),j=this.stack[this.stack.length-1];j.value=N}function ne(){const N=this.resume(),j=this.stack[this.stack.length-1];j.value=N}function he(){const N=this.stack[this.stack.length-1];if(this.data.inReference){const j=this.data.referenceType||"shortcut";N.type+="Reference",N.referenceType=j,delete N.url,delete N.title}else delete N.identifier,delete N.label;this.data.referenceType=void 0}function me(){const N=this.stack[this.stack.length-1];if(this.data.inReference){const j=this.data.referenceType||"shortcut";N.type+="Reference",N.referenceType=j,delete N.url,delete N.title}else delete N.identifier,delete N.label;this.data.referenceType=void 0}function we(N){const j=this.sliceSerialize(N),Q=this.stack[this.stack.length-2];Q.label=ac(j),Q.identifier=pt(j).toLowerCase()}function ae(){const N=this.stack[this.stack.length-1],j=this.resume(),Q=this.stack[this.stack.length-1];if(this.data.inReference=!0,Q.type==="link"){const oe=N.children;Q.children=oe}else Q.alt=j}function x(){const N=this.resume(),j=this.stack[this.stack.length-1];j.url=N}function A(){const N=this.resume(),j=this.stack[this.stack.length-1];j.title=N}function T(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function z(N){const j=this.resume(),Q=this.stack[this.stack.length-1];Q.label=j,Q.identifier=pt(this.sliceSerialize(N)).toLowerCase(),this.data.referenceType="full"}function q(N){this.data.characterReferenceType=N.type}function M(N){const j=this.sliceSerialize(N),Q=this.data.characterReferenceType;let oe;Q?(oe=Jl(j,Q==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):oe=Ur(j);const fe=this.stack[this.stack.length-1];fe.value+=oe}function Y(N){const j=this.stack.pop();j.position.end=Pt(N.end)}function ue(N){R.call(this,N);const j=this.stack[this.stack.length-1];j.url=this.sliceSerialize(N)}function de(N){R.call(this,N);const j=this.stack[this.stack.length-1];j.url="mailto:"+this.sliceSerialize(N)}function ye(){return{type:"blockquote",children:[]}}function Ge(){return{type:"code",lang:null,meta:null,value:""}}function Oe(){return{type:"inlineCode",value:""}}function Fe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Yt(){return{type:"emphasis",children:[]}}function et(){return{type:"heading",depth:0,children:[]}}function Jt(){return{type:"break"}}function gt(){return{type:"html",value:""}}function Ss(){return{type:"image",title:null,url:"",alt:null}}function Qt(){return{type:"link",title:null,url:"",children:[]}}function lt(N){return{type:"list",ordered:N.type==="listOrdered",start:null,spread:N._spread,children:[]}}function Xt(N){return{type:"listItem",spread:N._spread,checked:null,children:[]}}function Dt(){return{type:"paragraph",children:[]}}function ui(){return{type:"strong",children:[]}}function en(){return{type:"text",value:""}}function Re(){return{type:"thematicBreak"}}}function Pt(e){return{line:e.line,column:e.column,offset:e.offset}}function cc(e,t){let n=-1;for(;++n<t.length;){const i=t[n];Array.isArray(i)?cc(e,i):sw(e,i)}}function sw(e,t){let n;for(n in t)if(lc.call(t,n))switch(n){case"canContainEols":{const i=t[n];i&&e[n].push(...i);break}case"transforms":{const i=t[n];i&&e[n].push(...i);break}case"enter":case"exit":{const i=t[n];i&&Object.assign(e[n],i);break}}}function pa(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Vn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Vn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Vn({start:t.start,end:t.end})+") is still open")}function rw(e){const t=this;t.parser=n;function n(i){return nw(i,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}const ma={}.hasOwnProperty;function ow(e,t){const n=t||{};function i(s,...r){let o=i.invalid;const a=i.handlers;if(s&&ma.call(s,e)){const l=String(s[e]);o=ma.call(a,l)?a[l]:i.unknown}if(o)return o.call(this,s,...r)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}const aw={}.hasOwnProperty;function uc(e,t){let n=-1,i;if(t.extensions)for(;++n<t.extensions.length;)uc(e,t.extensions[n]);for(i in t)if(aw.call(t,i))switch(i){case"extensions":break;case"unsafe":{ga(e[i],t[i]);break}case"join":{ga(e[i],t[i]);break}case"handlers":{lw(e[i],t[i]);break}default:e.options[i]=t[i]}return e}function ga(e,t){t&&e.push(...t)}function lw(e,t){t&&Object.assign(e,t)}function cw(e,t,n,i){const s=n.enter("blockquote"),r=n.createTracker(i);r.move("> "),r.shift(2);const o=n.indentLines(n.containerFlow(e,r.current()),uw);return s(),o}function uw(e,t,n){return">"+(n?"":" ")+e}function dc(e,t){return ba(e,t.inConstruct,!0)&&!ba(e,t.notInConstruct,!1)}function ba(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function ya(e,t,n,i){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
70
70
  `&&dc(n.stack,n.unsafe[s]))return/[ \t]/.test(i.before)?"":" ";return`\\
71
- `}function dw(e,t){const n=String(e);let i=n.indexOf(t),s=i,r=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===s?++r>o&&(o=r):r=1,s=i+t.length,i=n.indexOf(t,s);return o}function cr(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function fw(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function pw(e,t,n,i){const s=fw(n),r=e.value||"",o=s==="`"?"GraveAccent":"Tilde";if(cr(e,n)){const u=n.enter("codeIndented"),p=n.indentLines(r,hw);return u(),p}const a=n.createTracker(i),l=s.repeat(Math.max(dw(r,s)+1,3)),c=n.enter("codeFenced");let d=a.move(l);if(e.lang){const u=n.enter(`codeFencedLang${o}`);d+=a.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...a.current()})),u()}if(e.lang&&e.meta){const u=n.enter(`codeFencedMeta${o}`);d+=a.move(" "),d+=a.move(n.safe(e.meta,{before:d,after:`
71
+ `}function dw(e,t){const n=String(e);let i=n.indexOf(t),s=i,r=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===s?++r>o&&(o=r):r=1,s=i+t.length,i=n.indexOf(t,s);return o}function cr(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function fw(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function hw(e,t,n,i){const s=fw(n),r=e.value||"",o=s==="`"?"GraveAccent":"Tilde";if(cr(e,n)){const u=n.enter("codeIndented"),h=n.indentLines(r,pw);return u(),h}const a=n.createTracker(i),l=s.repeat(Math.max(dw(r,s)+1,3)),c=n.enter("codeFenced");let d=a.move(l);if(e.lang){const u=n.enter(`codeFencedLang${o}`);d+=a.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...a.current()})),u()}if(e.lang&&e.meta){const u=n.enter(`codeFencedMeta${o}`);d+=a.move(" "),d+=a.move(n.safe(e.meta,{before:d,after:`
72
72
  `,encode:["`"],...a.current()})),u()}return d+=a.move(`
73
73
  `),r&&(d+=a.move(r+`
74
- `)),d+=a.move(l),c(),d}function hw(e,t,n){return(n?"":" ")+e}function qr(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function mw(e,t,n,i){const s=qr(n),r=s==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(i);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
75
- `,...l.current()}))),a(),e.title&&(a=n.enter(`title${r}`),c+=l.move(" "+s),c+=l.move(n.safe(e.title,{before:c,after:s,...l.current()})),c+=l.move(s),a()),o(),c}function gw(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Rt(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ji(e,t,n){const i=Cn(e),s=Cn(t);return i===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}fc.peek=bw;function fc(e,t,n,i){const s=gw(n),r=n.enter("emphasis"),o=n.createTracker(i),a=o.move(s);let l=o.move(n.containerPhrasing(e,{after:s,before:a,...o.current()}));const c=l.charCodeAt(0),d=Ji(i.before.charCodeAt(i.before.length-1),c,s);d.inside&&(l=Rt(c)+l.slice(1));const u=l.charCodeAt(l.length-1),p=Ji(i.after.charCodeAt(0),u,s);p.inside&&(l=l.slice(0,-1)+Rt(u));const f=o.move(s);return r(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},a+l+f}function bw(e,t,n){return n.options.emphasis||"*"}const cs=(function(e){if(e==null)return vw;if(typeof e=="function")return us(e);if(typeof e=="object")return Array.isArray(e)?yw(e):ww(e);if(typeof e=="string")return kw(e);throw new Error("Expected function, string, or object as test")});function yw(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=cs(e[n]);return us(i);function i(...s){let r=-1;for(;++r<t.length;)if(t[r].apply(this,s))return!0;return!1}}function ww(e){const t=e;return us(n);function n(i){const s=i;let r;for(r in e)if(s[r]!==t[r])return!1;return!0}}function kw(e){return us(t);function t(n){return n&&n.type===e}}function us(e){return t;function t(n,i,s){return!!(Sw(n)&&e.call(this,n,typeof i=="number"?i:void 0,s||void 0))}}function vw(){return!0}function Sw(e){return e!==null&&typeof e=="object"&&"type"in e}const pc=[],xw=!0,ur=!1,_w="skip";function hc(e,t,n,i){let s;typeof t=="function"&&typeof n!="function"?(i=n,n=t):s=t;const r=cs(s),o=i?-1:1;a(e,void 0,[])();function a(l,c,d){const u=l&&typeof l=="object"?l:{};if(typeof u.type=="string"){const f=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return p;function p(){let f=pc,m,h,y;if((!t||r(l,c,d[d.length-1]||void 0))&&(f=Cw(n(l,d)),f[0]===ur))return f;if("children"in l&&l.children){const w=l;if(w.children&&f[0]!==_w)for(h=(i?w.children.length:-1)+o,y=d.concat(w);h>-1&&h<w.children.length;){const C=w.children[h];if(m=a(C,h,y)(),m[0]===ur)return m;h=typeof m[1]=="number"?m[1]:h+o}}return f}}}function Cw(e){return Array.isArray(e)?e:typeof e=="number"?[xw,e]:e==null?pc:[e]}function Aw(e,t,n,i){let s,r,o;typeof t=="function"&&typeof n!="function"?(r=void 0,o=t,s=n):(r=t,o=n,s=i),hc(e,r,a,s);function a(l,c){const d=c[c.length-1],u=d?d.children.indexOf(l):void 0;return o(l,u,d)}}function mc(e,t){let n=!1;return Aw(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,ur}),!!((!e.depth||e.depth<3)&&Br(e)&&(t.options.setext||n))}function Ew(e,t,n,i){const s=Math.max(Math.min(6,e.depth||1),1),r=n.createTracker(i);if(mc(e,n)){const d=n.enter("headingSetext"),u=n.enter("phrasing"),p=n.containerPhrasing(e,{...r.current(),before:`
74
+ `)),d+=a.move(l),c(),d}function pw(e,t,n){return(n?"":" ")+e}function qr(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function mw(e,t,n,i){const s=qr(n),r=s==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(i);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
75
+ `,...l.current()}))),a(),e.title&&(a=n.enter(`title${r}`),c+=l.move(" "+s),c+=l.move(n.safe(e.title,{before:c,after:s,...l.current()})),c+=l.move(s),a()),o(),c}function gw(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Rt(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ji(e,t,n){const i=Cn(e),s=Cn(t);return i===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}fc.peek=bw;function fc(e,t,n,i){const s=gw(n),r=n.enter("emphasis"),o=n.createTracker(i),a=o.move(s);let l=o.move(n.containerPhrasing(e,{after:s,before:a,...o.current()}));const c=l.charCodeAt(0),d=Ji(i.before.charCodeAt(i.before.length-1),c,s);d.inside&&(l=Rt(c)+l.slice(1));const u=l.charCodeAt(l.length-1),h=Ji(i.after.charCodeAt(0),u,s);h.inside&&(l=l.slice(0,-1)+Rt(u));const f=o.move(s);return r(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},a+l+f}function bw(e,t,n){return n.options.emphasis||"*"}const cs=(function(e){if(e==null)return vw;if(typeof e=="function")return us(e);if(typeof e=="object")return Array.isArray(e)?yw(e):ww(e);if(typeof e=="string")return kw(e);throw new Error("Expected function, string, or object as test")});function yw(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=cs(e[n]);return us(i);function i(...s){let r=-1;for(;++r<t.length;)if(t[r].apply(this,s))return!0;return!1}}function ww(e){const t=e;return us(n);function n(i){const s=i;let r;for(r in e)if(s[r]!==t[r])return!1;return!0}}function kw(e){return us(t);function t(n){return n&&n.type===e}}function us(e){return t;function t(n,i,s){return!!(Sw(n)&&e.call(this,n,typeof i=="number"?i:void 0,s||void 0))}}function vw(){return!0}function Sw(e){return e!==null&&typeof e=="object"&&"type"in e}const hc=[],xw=!0,ur=!1,_w="skip";function pc(e,t,n,i){let s;typeof t=="function"&&typeof n!="function"?(i=n,n=t):s=t;const r=cs(s),o=i?-1:1;a(e,void 0,[])();function a(l,c,d){const u=l&&typeof l=="object"?l:{};if(typeof u.type=="string"){const f=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=hc,m,p,y;if((!t||r(l,c,d[d.length-1]||void 0))&&(f=Cw(n(l,d)),f[0]===ur))return f;if("children"in l&&l.children){const w=l;if(w.children&&f[0]!==_w)for(p=(i?w.children.length:-1)+o,y=d.concat(w);p>-1&&p<w.children.length;){const C=w.children[p];if(m=a(C,p,y)(),m[0]===ur)return m;p=typeof m[1]=="number"?m[1]:p+o}}return f}}}function Cw(e){return Array.isArray(e)?e:typeof e=="number"?[xw,e]:e==null?hc:[e]}function Aw(e,t,n,i){let s,r,o;typeof t=="function"&&typeof n!="function"?(r=void 0,o=t,s=n):(r=t,o=n,s=i),pc(e,r,a,s);function a(l,c){const d=c[c.length-1],u=d?d.children.indexOf(l):void 0;return o(l,u,d)}}function mc(e,t){let n=!1;return Aw(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,ur}),!!((!e.depth||e.depth<3)&&Br(e)&&(t.options.setext||n))}function Tw(e,t,n,i){const s=Math.max(Math.min(6,e.depth||1),1),r=n.createTracker(i);if(mc(e,n)){const d=n.enter("headingSetext"),u=n.enter("phrasing"),h=n.containerPhrasing(e,{...r.current(),before:`
76
76
  `,after:`
77
- `});return u(),d(),p+`
78
- `+(s===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
77
+ `});return u(),d(),h+`
78
+ `+(s===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
79
79
  `))+1))}const o="#".repeat(s),a=n.enter("headingAtx"),l=n.enter("phrasing");r.move(o+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
80
- `,...r.current()});return/^[\t ]/.test(c)&&(c=Rt(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),a(),c}gc.peek=Tw;function gc(e){return e.value||""}function Tw(){return"<"}bc.peek=Iw;function bc(e,t,n,i){const s=qr(n),r=s==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(i);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${r}`),c+=l.move(" "+s),c+=l.move(n.safe(e.title,{before:c,after:s,...l.current()})),c+=l.move(s),a()),c+=l.move(")"),o(),c}function Iw(){return"!"}yc.peek=Pw;function yc(e,t,n,i){const s=e.referenceType,r=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(i);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const u=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=d,r(),s==="full"||!c||c!==u?l+=a.move(u+"]"):s==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function Pw(){return"!"}wc.peek=Ow;function wc(e,t,n){let i=e.value||"",s="`",r=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(i);)s+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++r<n.unsafe.length;){const o=n.unsafe[r],a=n.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(i);){let c=l.index;i.charCodeAt(c)===10&&i.charCodeAt(c-1)===13&&c--,i=i.slice(0,c)+" "+i.slice(l.index+1)}}return s+i+s}function Ow(){return"`"}function kc(e,t){const n=Br(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}vc.peek=$w;function vc(e,t,n,i){const s=qr(n),r=s==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let a,l;if(kc(e,n)){const d=n.stack;n.stack=[],a=n.enter("autolink");let u=o.move("<");return u+=o.move(n.containerPhrasing(e,{before:u,after:">",...o.current()})),u+=o.move(">"),a(),n.stack=d,u}a=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${r}`),c+=o.move(" "+s),c+=o.move(n.safe(e.title,{before:c,after:s,...o.current()})),c+=o.move(s),l()),c+=o.move(")"),a(),c}function $w(e,t,n){return kc(e,n)?"<":"["}Sc.peek=Rw;function Sc(e,t,n,i){const s=e.referenceType,r=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(i);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const u=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=d,r(),s==="full"||!c||c!==u?l+=a.move(u+"]"):s==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function Rw(){return"["}function Wr(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Nw(e){const t=Wr(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Lw(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function xc(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Fw(e,t,n,i){const s=n.enter("list"),r=n.bulletCurrent;let o=e.ordered?Lw(n):Wr(n);const a=e.ordered?o==="."?")":".":Nw(n);let l=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),xc(n)===o&&d){let u=-1;for(;++u<e.children.length;){const p=e.children[u];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const c=n.containerFlow(e,i);return n.bulletLastUsed=o,n.bulletCurrent=r,s(),c}function Dw(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function zw(e,t,n,i){const s=Dw(n);let r=n.bulletCurrent||Wr(n);t&&t.type==="list"&&t.ordered&&(r=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+r);let o=r.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(i);a.move(r+" ".repeat(o-r.length)),a.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),d);return l(),c;function d(u,p,f){return p?(f?"":" ".repeat(o))+u:(f?r:r+" ".repeat(o-r.length))+u}}function Mw(e,t,n,i){const s=n.enter("paragraph"),r=n.enter("phrasing"),o=n.containerPhrasing(e,i);return r(),s(),o}const jw=cs(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Bw(e,t,n,i){return(e.children.some(function(o){return jw(o)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function Uw(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}_c.peek=Hw;function _c(e,t,n,i){const s=Uw(n),r=n.enter("strong"),o=n.createTracker(i),a=o.move(s+s);let l=o.move(n.containerPhrasing(e,{after:s,before:a,...o.current()}));const c=l.charCodeAt(0),d=Ji(i.before.charCodeAt(i.before.length-1),c,s);d.inside&&(l=Rt(c)+l.slice(1));const u=l.charCodeAt(l.length-1),p=Ji(i.after.charCodeAt(0),u,s);p.inside&&(l=l.slice(0,-1)+Rt(u));const f=o.move(s+s);return r(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},a+l+f}function Hw(e,t,n){return n.options.strong||"*"}function qw(e,t,n,i){return n.safe(e.value,i)}function Ww(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Vw(e,t,n){const i=(xc(n)+(n.options.ruleSpaces?" ":"")).repeat(Ww(n));return n.options.ruleSpaces?i.slice(0,-1):i}const Vr={blockquote:cw,break:ya,code:pw,definition:mw,emphasis:fc,hardBreak:ya,heading:Ew,html:gc,image:bc,imageReference:yc,inlineCode:wc,link:vc,linkReference:Sc,list:Fw,listItem:zw,paragraph:Mw,root:Bw,strong:_c,text:qw,thematicBreak:Vw},Zw=[Kw];function Kw(e,t,n,i){if(t.type==="code"&&cr(t,i)&&(e.type==="list"||e.type===t.type&&cr(e,i)))return!1;if("spread"in n&&typeof n.spread=="boolean")return e.type==="paragraph"&&(e.type===t.type||t.type==="definition"||t.type==="heading"&&mc(t,i))?void 0:n.spread?1:0}const zt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],Gw=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
80
+ `,...r.current()});return/^[\t ]/.test(c)&&(c=Rt(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),a(),c}gc.peek=Ew;function gc(e){return e.value||""}function Ew(){return"<"}bc.peek=Iw;function bc(e,t,n,i){const s=qr(n),r=s==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(i);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${r}`),c+=l.move(" "+s),c+=l.move(n.safe(e.title,{before:c,after:s,...l.current()})),c+=l.move(s),a()),c+=l.move(")"),o(),c}function Iw(){return"!"}yc.peek=Pw;function yc(e,t,n,i){const s=e.referenceType,r=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(i);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const u=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=d,r(),s==="full"||!c||c!==u?l+=a.move(u+"]"):s==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function Pw(){return"!"}wc.peek=Ow;function wc(e,t,n){let i=e.value||"",s="`",r=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(i);)s+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++r<n.unsafe.length;){const o=n.unsafe[r],a=n.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(i);){let c=l.index;i.charCodeAt(c)===10&&i.charCodeAt(c-1)===13&&c--,i=i.slice(0,c)+" "+i.slice(l.index+1)}}return s+i+s}function Ow(){return"`"}function kc(e,t){const n=Br(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}vc.peek=$w;function vc(e,t,n,i){const s=qr(n),r=s==='"'?"Quote":"Apostrophe",o=n.createTracker(i);let a,l;if(kc(e,n)){const d=n.stack;n.stack=[],a=n.enter("autolink");let u=o.move("<");return u+=o.move(n.containerPhrasing(e,{before:u,after:">",...o.current()})),u+=o.move(">"),a(),n.stack=d,u}a=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${r}`),c+=o.move(" "+s),c+=o.move(n.safe(e.title,{before:c,after:s,...o.current()})),c+=o.move(s),l()),c+=o.move(")"),a(),c}function $w(e,t,n){return kc(e,n)?"<":"["}Sc.peek=Rw;function Sc(e,t,n,i){const s=e.referenceType,r=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(i);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const u=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=d,r(),s==="full"||!c||c!==u?l+=a.move(u+"]"):s==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function Rw(){return"["}function Wr(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Nw(e){const t=Wr(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Lw(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function xc(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Fw(e,t,n,i){const s=n.enter("list"),r=n.bulletCurrent;let o=e.ordered?Lw(n):Wr(n);const a=e.ordered?o==="."?")":".":Nw(n);let l=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),xc(n)===o&&d){let u=-1;for(;++u<e.children.length;){const h=e.children[u];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const c=n.containerFlow(e,i);return n.bulletLastUsed=o,n.bulletCurrent=r,s(),c}function Dw(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function zw(e,t,n,i){const s=Dw(n);let r=n.bulletCurrent||Wr(n);t&&t.type==="list"&&t.ordered&&(r=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+r);let o=r.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(i);a.move(r+" ".repeat(o-r.length)),a.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),d);return l(),c;function d(u,h,f){return h?(f?"":" ".repeat(o))+u:(f?r:r+" ".repeat(o-r.length))+u}}function Mw(e,t,n,i){const s=n.enter("paragraph"),r=n.enter("phrasing"),o=n.containerPhrasing(e,i);return r(),s(),o}const jw=cs(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Bw(e,t,n,i){return(e.children.some(function(o){return jw(o)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function Uw(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}_c.peek=Hw;function _c(e,t,n,i){const s=Uw(n),r=n.enter("strong"),o=n.createTracker(i),a=o.move(s+s);let l=o.move(n.containerPhrasing(e,{after:s,before:a,...o.current()}));const c=l.charCodeAt(0),d=Ji(i.before.charCodeAt(i.before.length-1),c,s);d.inside&&(l=Rt(c)+l.slice(1));const u=l.charCodeAt(l.length-1),h=Ji(i.after.charCodeAt(0),u,s);h.inside&&(l=l.slice(0,-1)+Rt(u));const f=o.move(s+s);return r(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},a+l+f}function Hw(e,t,n){return n.options.strong||"*"}function qw(e,t,n,i){return n.safe(e.value,i)}function Ww(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Vw(e,t,n){const i=(xc(n)+(n.options.ruleSpaces?" ":"")).repeat(Ww(n));return n.options.ruleSpaces?i.slice(0,-1):i}const Vr={blockquote:cw,break:ya,code:hw,definition:mw,emphasis:fc,hardBreak:ya,heading:Tw,html:gc,image:bc,imageReference:yc,inlineCode:wc,link:vc,linkReference:Sc,list:Fw,listItem:zw,paragraph:Mw,root:Bw,strong:_c,text:qw,thematicBreak:Vw},Zw=[Kw];function Kw(e,t,n,i){if(t.type==="code"&&cr(t,i)&&(e.type==="list"||e.type===t.type&&cr(e,i)))return!1;if("spread"in n&&typeof n.spread=="boolean")return e.type==="paragraph"&&(e.type===t.type||t.type==="definition"||t.type==="heading"&&mc(t,i))?void 0:n.spread?1:0}const zt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],Gw=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
81
81
  `,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:zt},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
82
82
  ]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:zt},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
83
83
  *])`},{character:"*",inConstruct:"phrasing",notInConstruct:zt},{atBreak:!0,character:"+",after:`(?:[ \r
84
84
  ])`},{atBreak:!0,character:"-",after:`(?:[ \r
85
85
  -])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
86
86
  ]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:zt},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:zt},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:zt},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:zt},{atBreak:!0,character:"~"}];function Yw(e){return e.label||!e.identifier?e.label||"":ac(e.identifier)}function Jw(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function Qw(e,t,n){const i=t.indexStack,s=e.children||[],r=[];let o=-1,a=n.before,l;i.push(-1);let c=t.createTracker(n);for(;++o<s.length;){const d=s[o];let u;if(i[i.length-1]=o,o+1<s.length){let m=t.handle.handlers[s[o+1].type];m&&m.peek&&(m=m.peek),u=m?m(s[o+1],e,t,{before:"",after:"",...c.current()}).charAt(0):""}else u=n.after;r.length>0&&(a==="\r"||a===`
87
- `)&&d.type==="html"&&(r[r.length-1]=r[r.length-1].replace(/(\r?\n|\r)$/," "),a=" ",c=t.createTracker(n),c.move(r.join("")));let p=t.handle(d,e,t,{...c.current(),after:u,before:a});l&&l===p.slice(0,1)&&(p=Rt(l.charCodeAt(0))+p.slice(1));const f=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,l=void 0,f&&(r.length>0&&f.before&&a===r[r.length-1].slice(-1)&&(r[r.length-1]=r[r.length-1].slice(0,-1)+Rt(a.charCodeAt(0))),f.after&&(l=u)),c.move(p),r.push(p),a=p.slice(-1)}return i.pop(),r.join("")}function Xw(e,t,n){const i=t.indexStack,s=e.children||[],r=t.createTracker(n),o=[];let a=-1;for(i.push(-1);++a<s.length;){const l=s[a];i[i.length-1]=a,o.push(r.move(t.handle(l,e,t,{before:`
87
+ `)&&d.type==="html"&&(r[r.length-1]=r[r.length-1].replace(/(\r?\n|\r)$/," "),a=" ",c=t.createTracker(n),c.move(r.join("")));let h=t.handle(d,e,t,{...c.current(),after:u,before:a});l&&l===h.slice(0,1)&&(h=Rt(l.charCodeAt(0))+h.slice(1));const f=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,l=void 0,f&&(r.length>0&&f.before&&a===r[r.length-1].slice(-1)&&(r[r.length-1]=r[r.length-1].slice(0,-1)+Rt(a.charCodeAt(0))),f.after&&(l=u)),c.move(h),r.push(h),a=h.slice(-1)}return i.pop(),r.join("")}function Xw(e,t,n){const i=t.indexStack,s=e.children||[],r=t.createTracker(n),o=[];let a=-1;for(i.push(-1);++a<s.length;){const l=s[a];i[i.length-1]=a,o.push(r.move(t.handle(l,e,t,{before:`
88
88
  `,after:`
89
89
  `,...r.current()}))),l.type!=="list"&&(t.bulletLastUsed=void 0),a<s.length-1&&o.push(r.move(ek(l,s[a+1],e,t)))}return i.pop(),o.join("")}function ek(e,t,n,i){let s=i.join.length;for(;s--;){const r=i.join[s](e,t,n,i);if(r===!0||r===1)break;if(typeof r=="number")return`
90
90
  `.repeat(1+r);if(r===!1)return`
@@ -93,33 +93,33 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
93
93
 
94
94
  `}return`
95
95
 
96
- `}const tk=/\r?\n|\r/g;function nk(e,t){const n=[];let i=0,s=0,r;for(;r=tk.exec(e);)o(e.slice(i,r.index)),n.push(r[0]),i=r.index+r[0].length,s++;return o(e.slice(i)),n.join("");function o(a){n.push(t(a,s,!a))}}function ik(e,t,n){const i=(n.before||"")+(t||"")+(n.after||""),s=[],r=[],o={};let a=-1;for(;++a<e.unsafe.length;){const d=e.unsafe[a];if(!dc(e.stack,d))continue;const u=e.compilePattern(d);let p;for(;p=u.exec(i);){const f="before"in d||!!d.atBreak,m="after"in d,h=p.index+(f?p[1].length:0);s.includes(h)?(o[h].before&&!f&&(o[h].before=!1),o[h].after&&!m&&(o[h].after=!1)):(s.push(h),o[h]={before:f,after:m})}}s.sort(sk);let l=n.before?n.before.length:0;const c=i.length-(n.after?n.after.length:0);for(a=-1;++a<s.length;){const d=s[a];d<l||d>=c||d+1<c&&s[a+1]===d+1&&o[d].after&&!o[d+1].before&&!o[d+1].after||s[a-1]===d-1&&o[d].before&&!o[d-1].before&&!o[d-1].after||(l!==d&&r.push(wa(i.slice(l,d),"\\")),l=d,/[!-/:-@[-`{-~]/.test(i.charAt(d))&&(!n.encode||!n.encode.includes(i.charAt(d)))?r.push("\\"):(r.push(Rt(i.charCodeAt(d))),l++))}return r.push(wa(i.slice(l,c),n.after)),r.join("")}function sk(e,t){return e-t}function wa(e,t){const n=/\\(?=[!-/:-@[-`{-~])/g,i=[],s=[],r=e+t;let o=-1,a=0,l;for(;l=n.exec(r);)i.push(l.index);for(;++o<i.length;)a!==i[o]&&s.push(e.slice(a,i[o])),s.push("\\"),a=i[o];return s.push(e.slice(a)),s.join("")}function rk(e){const t=e||{},n=t.now||{};let i=t.lineShift||0,s=n.line||1,r=n.column||1;return{move:l,current:o,shift:a};function o(){return{now:{line:s,column:r},lineShift:i}}function a(c){i+=c}function l(c){const d=c||"",u=d.split(/\r?\n|\r/g),p=u[u.length-1];return s+=u.length-1,r=u.length===1?r+p.length:1+p.length+i,d}}function ok(e,t){const n=t||{},i={associationId:Yw,containerPhrasing:uk,containerFlow:dk,createTracker:rk,compilePattern:Jw,enter:r,handlers:{...Vr},handle:void 0,indentLines:nk,indexStack:[],join:[...Zw],options:{},safe:fk,stack:[],unsafe:[...Gw]};uc(i,n),i.options.tightDefinitions&&i.join.push(ck),i.handle=ow("type",{invalid:ak,unknown:lk,handlers:i.handlers});let s=i.handle(e,void 0,i,{before:`
96
+ `}const tk=/\r?\n|\r/g;function nk(e,t){const n=[];let i=0,s=0,r;for(;r=tk.exec(e);)o(e.slice(i,r.index)),n.push(r[0]),i=r.index+r[0].length,s++;return o(e.slice(i)),n.join("");function o(a){n.push(t(a,s,!a))}}function ik(e,t,n){const i=(n.before||"")+(t||"")+(n.after||""),s=[],r=[],o={};let a=-1;for(;++a<e.unsafe.length;){const d=e.unsafe[a];if(!dc(e.stack,d))continue;const u=e.compilePattern(d);let h;for(;h=u.exec(i);){const f="before"in d||!!d.atBreak,m="after"in d,p=h.index+(f?h[1].length:0);s.includes(p)?(o[p].before&&!f&&(o[p].before=!1),o[p].after&&!m&&(o[p].after=!1)):(s.push(p),o[p]={before:f,after:m})}}s.sort(sk);let l=n.before?n.before.length:0;const c=i.length-(n.after?n.after.length:0);for(a=-1;++a<s.length;){const d=s[a];d<l||d>=c||d+1<c&&s[a+1]===d+1&&o[d].after&&!o[d+1].before&&!o[d+1].after||s[a-1]===d-1&&o[d].before&&!o[d-1].before&&!o[d-1].after||(l!==d&&r.push(wa(i.slice(l,d),"\\")),l=d,/[!-/:-@[-`{-~]/.test(i.charAt(d))&&(!n.encode||!n.encode.includes(i.charAt(d)))?r.push("\\"):(r.push(Rt(i.charCodeAt(d))),l++))}return r.push(wa(i.slice(l,c),n.after)),r.join("")}function sk(e,t){return e-t}function wa(e,t){const n=/\\(?=[!-/:-@[-`{-~])/g,i=[],s=[],r=e+t;let o=-1,a=0,l;for(;l=n.exec(r);)i.push(l.index);for(;++o<i.length;)a!==i[o]&&s.push(e.slice(a,i[o])),s.push("\\"),a=i[o];return s.push(e.slice(a)),s.join("")}function rk(e){const t=e||{},n=t.now||{};let i=t.lineShift||0,s=n.line||1,r=n.column||1;return{move:l,current:o,shift:a};function o(){return{now:{line:s,column:r},lineShift:i}}function a(c){i+=c}function l(c){const d=c||"",u=d.split(/\r?\n|\r/g),h=u[u.length-1];return s+=u.length-1,r=u.length===1?r+h.length:1+h.length+i,d}}function ok(e,t){const n=t||{},i={associationId:Yw,containerPhrasing:uk,containerFlow:dk,createTracker:rk,compilePattern:Jw,enter:r,handlers:{...Vr},handle:void 0,indentLines:nk,indexStack:[],join:[...Zw],options:{},safe:fk,stack:[],unsafe:[...Gw]};uc(i,n),i.options.tightDefinitions&&i.join.push(ck),i.handle=ow("type",{invalid:ak,unknown:lk,handlers:i.handlers});let s=i.handle(e,void 0,i,{before:`
97
97
  `,after:`
98
98
  `,now:{line:1,column:1},lineShift:0});return s&&s.charCodeAt(s.length-1)!==10&&s.charCodeAt(s.length-1)!==13&&(s+=`
99
- `),s;function r(o){return i.stack.push(o),a;function a(){i.stack.pop()}}}function ak(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function lk(e){const t=e;throw new Error("Cannot handle unknown node `"+t.type+"`")}function ck(e,t){if(e.type==="definition"&&e.type===t.type)return 0}function uk(e,t){return Qw(e,this,t)}function dk(e,t){return Xw(e,this,t)}function fk(e,t){return ik(this,e,t)}function pk(e){const t=this;t.compiler=n;function n(i){return ok(i,{...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]})}}function ka(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,s=n.indexOf(t);for(;s!==-1;)i++,s=n.indexOf(t,s+t.length);return i}function hk(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function mk(e,t,n){const s=cs((n||{}).ignore||[]),r=gk(t);let o=-1;for(;++o<r.length;)hc(e,"text",a);function a(c,d){let u=-1,p;for(;++u<d.length;){const f=d[u],m=p?p.children:void 0;if(s(f,m?m.indexOf(f):void 0,p))return;p=f}if(p)return l(c,d)}function l(c,d){const u=d[d.length-1],p=r[o][0],f=r[o][1];let m=0;const y=u.children.indexOf(c);let w=!1,C=[];p.lastIndex=0;let S=p.exec(c.value);for(;S;){const I=S.index,O={index:S.index,input:S.input,stack:[...d,c]};let k=f(...S,O);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?p.lastIndex=I+1:(m!==I&&C.push({type:"text",value:c.value.slice(m,I)}),Array.isArray(k)?C.push(...k):k&&C.push(k),m=I+S[0].length,w=!0),!p.global)break;S=p.exec(c.value)}return w?(m<c.value.length&&C.push({type:"text",value:c.value.slice(m)}),u.children.splice(y,1,...C)):C=[c],y+C.length}}function gk(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<n.length;){const s=n[i];t.push([bk(s[0]),yk(s[1])])}return t}function bk(e){return typeof e=="string"?new RegExp(hk(e),"g"):e}function yk(e){return typeof e=="function"?e:function(){return e}}const Fs="phrasing",Ds=["autolink","link","image","label"];function wk(){return{transforms:[Ak],enter:{literalAutolink:vk,literalAutolinkEmail:zs,literalAutolinkHttp:zs,literalAutolinkWww:zs},exit:{literalAutolink:Ck,literalAutolinkEmail:_k,literalAutolinkHttp:Sk,literalAutolinkWww:xk}}}function kk(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Fs,notInConstruct:Ds},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Fs,notInConstruct:Ds},{character:":",before:"[ps]",after:"\\/",inConstruct:Fs,notInConstruct:Ds}]}}function vk(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function zs(e){this.config.enter.autolinkProtocol.call(this,e)}function Sk(e){this.config.exit.autolinkProtocol.call(this,e)}function xk(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function _k(e){this.config.exit.autolinkEmail.call(this,e)}function Ck(e){this.exit(e)}function Ak(e){mk(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ek],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Tk]],{ignore:["link","linkReference"]})}function Ek(e,t,n,i,s){let r="";if(!Cc(s)||(/^w/i.test(t)&&(n=t+n,t="",r="http://"),!Ik(n)))return!1;const o=Pk(n+i);if(!o[0])return!1;const a={type:"link",title:null,url:r+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function Tk(e,t,n,i){return!Cc(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Ik(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Pk(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const s=ka(e,"(");let r=ka(e,")");for(;i!==-1&&s>r;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),r++;return[e,n]}function Cc(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Vt(n)||as(n))&&(!t||n!==47)}Ac.peek=Mk;function Ok(){this.buffer()}function $k(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Rk(){this.buffer()}function Nk(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Lk(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ht(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Fk(e){this.exit(e)}function Dk(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ht(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zk(e){this.exit(e)}function Mk(){return"["}function Ac(e,t,n,i){const s=n.createTracker(i);let r=s.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return r+=s.move(n.safe(n.associationId(e),{after:"]",before:r})),a(),o(),r+=s.move("]"),r}function jk(){return{enter:{gfmFootnoteCallString:Ok,gfmFootnoteCall:$k,gfmFootnoteDefinitionLabelString:Rk,gfmFootnoteDefinition:Nk},exit:{gfmFootnoteCallString:Lk,gfmFootnoteCall:Fk,gfmFootnoteDefinitionLabelString:Dk,gfmFootnoteDefinition:zk}}}function Bk(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ac},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,s,r,o){const a=r.createTracker(o);let l=a.move("[^");const c=r.enter("footnoteDefinition"),d=r.enter("label");return l+=a.move(r.safe(r.associationId(i),{before:l,after:"]"})),d(),l+=a.move("]:"),i.children&&i.children.length>0&&(a.shift(4),l+=a.move((t?`
100
- `:" ")+r.indentLines(r.containerFlow(i,a.current()),t?Ec:Uk))),c(),l}}function Uk(e,t,n){return t===0?e:Ec(e,t,n)}function Ec(e,t,n){return(n?"":" ")+e}const Hk=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Tc.peek=Kk;function qk(){return{canContainEols:["delete"],enter:{strikethrough:Vk},exit:{strikethrough:Zk}}}function Wk(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Hk}],handlers:{delete:Tc}}}function Vk(e){this.enter({type:"delete",children:[]},e)}function Zk(e){this.exit(e)}function Tc(e,t,n,i){const s=n.createTracker(i),r=n.enter("strikethrough");let o=s.move("~~");return o+=n.containerPhrasing(e,{...s.current(),before:o,after:"~"}),o+=s.move("~~"),r(),o}function Kk(){return"~"}function Gk(e){return e.length}function Yk(e,t){const n=t||{},i=(n.align||[]).concat(),s=n.stringLength||Gk,r=[],o=[],a=[],l=[];let c=0,d=-1;for(;++d<e.length;){const h=[],y=[];let w=-1;for(e[d].length>c&&(c=e[d].length);++w<e[d].length;){const C=Jk(e[d][w]);if(n.alignDelimiters!==!1){const S=s(C);y[w]=S,(l[w]===void 0||S>l[w])&&(l[w]=S)}h.push(C)}o[d]=h,a[d]=y}let u=-1;if(typeof i=="object"&&"length"in i)for(;++u<c;)r[u]=va(i[u]);else{const h=va(i);for(;++u<c;)r[u]=h}u=-1;const p=[],f=[];for(;++u<c;){const h=r[u];let y="",w="";h===99?(y=":",w=":"):h===108?y=":":h===114&&(w=":");let C=n.alignDelimiters===!1?1:Math.max(1,l[u]-y.length-w.length);const S=y+"-".repeat(C)+w;n.alignDelimiters!==!1&&(C=y.length+C+w.length,C>l[u]&&(l[u]=C),f[u]=C),p[u]=S}o.splice(1,0,p),a.splice(1,0,f),d=-1;const m=[];for(;++d<o.length;){const h=o[d],y=a[d];u=-1;const w=[];for(;++u<c;){const C=h[u]||"";let S="",I="";if(n.alignDelimiters!==!1){const O=l[u]-(y[u]||0),k=r[u];k===114?S=" ".repeat(O):k===99?O%2?(S=" ".repeat(O/2+.5),I=" ".repeat(O/2-.5)):(S=" ".repeat(O/2),I=S):I=" ".repeat(O)}n.delimiterStart!==!1&&!u&&w.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||u)&&w.push(" "),n.alignDelimiters!==!1&&w.push(S),w.push(C),n.alignDelimiters!==!1&&w.push(I),n.padding!==!1&&w.push(" "),(n.delimiterEnd!==!1||u!==c-1)&&w.push("|")}m.push(n.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return m.join(`
99
+ `),s;function r(o){return i.stack.push(o),a;function a(){i.stack.pop()}}}function ak(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function lk(e){const t=e;throw new Error("Cannot handle unknown node `"+t.type+"`")}function ck(e,t){if(e.type==="definition"&&e.type===t.type)return 0}function uk(e,t){return Qw(e,this,t)}function dk(e,t){return Xw(e,this,t)}function fk(e,t){return ik(this,e,t)}function hk(e){const t=this;t.compiler=n;function n(i){return ok(i,{...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]})}}function ka(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,s=n.indexOf(t);for(;s!==-1;)i++,s=n.indexOf(t,s+t.length);return i}function pk(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function mk(e,t,n){const s=cs((n||{}).ignore||[]),r=gk(t);let o=-1;for(;++o<r.length;)pc(e,"text",a);function a(c,d){let u=-1,h;for(;++u<d.length;){const f=d[u],m=h?h.children:void 0;if(s(f,m?m.indexOf(f):void 0,h))return;h=f}if(h)return l(c,d)}function l(c,d){const u=d[d.length-1],h=r[o][0],f=r[o][1];let m=0;const y=u.children.indexOf(c);let w=!1,C=[];h.lastIndex=0;let S=h.exec(c.value);for(;S;){const I=S.index,O={index:S.index,input:S.input,stack:[...d,c]};let k=f(...S,O);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?h.lastIndex=I+1:(m!==I&&C.push({type:"text",value:c.value.slice(m,I)}),Array.isArray(k)?C.push(...k):k&&C.push(k),m=I+S[0].length,w=!0),!h.global)break;S=h.exec(c.value)}return w?(m<c.value.length&&C.push({type:"text",value:c.value.slice(m)}),u.children.splice(y,1,...C)):C=[c],y+C.length}}function gk(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<n.length;){const s=n[i];t.push([bk(s[0]),yk(s[1])])}return t}function bk(e){return typeof e=="string"?new RegExp(pk(e),"g"):e}function yk(e){return typeof e=="function"?e:function(){return e}}const Fs="phrasing",Ds=["autolink","link","image","label"];function wk(){return{transforms:[Ak],enter:{literalAutolink:vk,literalAutolinkEmail:zs,literalAutolinkHttp:zs,literalAutolinkWww:zs},exit:{literalAutolink:Ck,literalAutolinkEmail:_k,literalAutolinkHttp:Sk,literalAutolinkWww:xk}}}function kk(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Fs,notInConstruct:Ds},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Fs,notInConstruct:Ds},{character:":",before:"[ps]",after:"\\/",inConstruct:Fs,notInConstruct:Ds}]}}function vk(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function zs(e){this.config.enter.autolinkProtocol.call(this,e)}function Sk(e){this.config.exit.autolinkProtocol.call(this,e)}function xk(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function _k(e){this.config.exit.autolinkEmail.call(this,e)}function Ck(e){this.exit(e)}function Ak(e){mk(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Tk],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Ek]],{ignore:["link","linkReference"]})}function Tk(e,t,n,i,s){let r="";if(!Cc(s)||(/^w/i.test(t)&&(n=t+n,t="",r="http://"),!Ik(n)))return!1;const o=Pk(n+i);if(!o[0])return!1;const a={type:"link",title:null,url:r+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function Ek(e,t,n,i){return!Cc(i,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Ik(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Pk(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const s=ka(e,"(");let r=ka(e,")");for(;i!==-1&&s>r;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),r++;return[e,n]}function Cc(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Vt(n)||as(n))&&(!t||n!==47)}Ac.peek=Mk;function Ok(){this.buffer()}function $k(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Rk(){this.buffer()}function Nk(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Lk(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=pt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Fk(e){this.exit(e)}function Dk(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=pt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zk(e){this.exit(e)}function Mk(){return"["}function Ac(e,t,n,i){const s=n.createTracker(i);let r=s.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return r+=s.move(n.safe(n.associationId(e),{after:"]",before:r})),a(),o(),r+=s.move("]"),r}function jk(){return{enter:{gfmFootnoteCallString:Ok,gfmFootnoteCall:$k,gfmFootnoteDefinitionLabelString:Rk,gfmFootnoteDefinition:Nk},exit:{gfmFootnoteCallString:Lk,gfmFootnoteCall:Fk,gfmFootnoteDefinitionLabelString:Dk,gfmFootnoteDefinition:zk}}}function Bk(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ac},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,s,r,o){const a=r.createTracker(o);let l=a.move("[^");const c=r.enter("footnoteDefinition"),d=r.enter("label");return l+=a.move(r.safe(r.associationId(i),{before:l,after:"]"})),d(),l+=a.move("]:"),i.children&&i.children.length>0&&(a.shift(4),l+=a.move((t?`
100
+ `:" ")+r.indentLines(r.containerFlow(i,a.current()),t?Tc:Uk))),c(),l}}function Uk(e,t,n){return t===0?e:Tc(e,t,n)}function Tc(e,t,n){return(n?"":" ")+e}const Hk=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ec.peek=Kk;function qk(){return{canContainEols:["delete"],enter:{strikethrough:Vk},exit:{strikethrough:Zk}}}function Wk(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Hk}],handlers:{delete:Ec}}}function Vk(e){this.enter({type:"delete",children:[]},e)}function Zk(e){this.exit(e)}function Ec(e,t,n,i){const s=n.createTracker(i),r=n.enter("strikethrough");let o=s.move("~~");return o+=n.containerPhrasing(e,{...s.current(),before:o,after:"~"}),o+=s.move("~~"),r(),o}function Kk(){return"~"}function Gk(e){return e.length}function Yk(e,t){const n=t||{},i=(n.align||[]).concat(),s=n.stringLength||Gk,r=[],o=[],a=[],l=[];let c=0,d=-1;for(;++d<e.length;){const p=[],y=[];let w=-1;for(e[d].length>c&&(c=e[d].length);++w<e[d].length;){const C=Jk(e[d][w]);if(n.alignDelimiters!==!1){const S=s(C);y[w]=S,(l[w]===void 0||S>l[w])&&(l[w]=S)}p.push(C)}o[d]=p,a[d]=y}let u=-1;if(typeof i=="object"&&"length"in i)for(;++u<c;)r[u]=va(i[u]);else{const p=va(i);for(;++u<c;)r[u]=p}u=-1;const h=[],f=[];for(;++u<c;){const p=r[u];let y="",w="";p===99?(y=":",w=":"):p===108?y=":":p===114&&(w=":");let C=n.alignDelimiters===!1?1:Math.max(1,l[u]-y.length-w.length);const S=y+"-".repeat(C)+w;n.alignDelimiters!==!1&&(C=y.length+C+w.length,C>l[u]&&(l[u]=C),f[u]=C),h[u]=S}o.splice(1,0,h),a.splice(1,0,f),d=-1;const m=[];for(;++d<o.length;){const p=o[d],y=a[d];u=-1;const w=[];for(;++u<c;){const C=p[u]||"";let S="",I="";if(n.alignDelimiters!==!1){const O=l[u]-(y[u]||0),k=r[u];k===114?S=" ".repeat(O):k===99?O%2?(S=" ".repeat(O/2+.5),I=" ".repeat(O/2-.5)):(S=" ".repeat(O/2),I=S):I=" ".repeat(O)}n.delimiterStart!==!1&&!u&&w.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||u)&&w.push(" "),n.alignDelimiters!==!1&&w.push(S),w.push(C),n.alignDelimiters!==!1&&w.push(I),n.padding!==!1&&w.push(" "),(n.delimiterEnd!==!1||u!==c-1)&&w.push("|")}m.push(n.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return m.join(`
101
101
  `)}function Jk(e){return e==null?"":String(e)}function va(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Qk(){return{enter:{table:Xk,tableData:Sa,tableHeader:Sa,tableRow:tv},exit:{codeText:nv,table:ev,tableData:Ms,tableHeader:Ms,tableRow:Ms}}}function Xk(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function ev(e){this.exit(e),this.data.inTable=void 0}function tv(e){this.enter({type:"tableRow",children:[]},e)}function Ms(e){this.exit(e)}function Sa(e){this.enter({type:"tableCell",children:[]},e)}function nv(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,iv));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function iv(e,t){return t==="|"?t:e}function sv(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,s=t.stringLength,r=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
102
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:o,tableCell:l,tableRow:a}};function o(f,m,h,y){return c(d(f,h,y),f.align)}function a(f,m,h,y){const w=u(f,h,y),C=c([w]);return C.slice(0,C.indexOf(`
103
- `))}function l(f,m,h,y){const w=h.enter("tableCell"),C=h.enter("phrasing"),S=h.containerPhrasing(f,{...y,before:r,after:r});return C(),w(),S}function c(f,m){return Yk(f,{align:m,alignDelimiters:i,padding:n,stringLength:s})}function d(f,m,h){const y=f.children;let w=-1;const C=[],S=m.enter("table");for(;++w<y.length;)C[w]=u(y[w],m,h);return S(),C}function u(f,m,h){const y=f.children;let w=-1;const C=[],S=m.enter("tableRow");for(;++w<y.length;)C[w]=l(y[w],f,m,h);return S(),C}function p(f,m,h){let y=Vr.inlineCode(f,m,h);return h.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function rv(){return{exit:{taskListCheckValueChecked:xa,taskListCheckValueUnchecked:xa,paragraph:av}}}function ov(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:lv}}}function xa(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function av(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const s=t.children;let r=-1,o;for(;++r<s.length;){const a=s[r];if(a.type==="paragraph"){o=a;break}}o===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function lv(e,t,n,i){const s=e.children[0],r=typeof e.checked=="boolean"&&s&&s.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(i);r&&a.move(o);let l=Vr.listItem(e,t,n,{...i,...a.current()});return r&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(d){return d+o}}function cv(){return[wk(),jk(),qk(),Qk(),rv()]}function uv(e){return{extensions:[kk(),Bk(e),Wk(),sv(e),ov()]}}const dv={tokenize:bv,partial:!0},Ic={tokenize:yv,partial:!0},Pc={tokenize:wv,partial:!0},Oc={tokenize:kv,partial:!0},fv={tokenize:vv,partial:!0},$c={name:"wwwAutolink",tokenize:mv,previous:Nc},Rc={name:"protocolAutolink",tokenize:gv,previous:Lc},Tt={name:"emailAutolink",tokenize:hv,previous:Fc},kt={};function pv(){return{text:kt}}let Mt=48;for(;Mt<123;)kt[Mt]=Tt,Mt++,Mt===58?Mt=65:Mt===91&&(Mt=97);kt[43]=Tt;kt[45]=Tt;kt[46]=Tt;kt[95]=Tt;kt[72]=[Tt,Rc];kt[104]=[Tt,Rc];kt[87]=[Tt,$c];kt[119]=[Tt,$c];function hv(e,t,n){const i=this;let s,r;return o;function o(u){return!dr(u)||!Fc.call(i,i.previous)||Zr(i.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(u))}function a(u){return dr(u)?(e.consume(u),a):u===64?(e.consume(u),l):n(u)}function l(u){return u===46?e.check(fv,d,c)(u):u===45||u===95||Ve(u)?(r=!0,e.consume(u),l):d(u)}function c(u){return e.consume(u),s=!0,l}function d(u){return r&&s&&Be(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(u)):n(u)}}function mv(e,t,n){const i=this;return s;function s(o){return o!==87&&o!==119||!Nc.call(i,i.previous)||Zr(i.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(dv,e.attempt(Ic,e.attempt(Pc,r),n),n)(o))}function r(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function gv(e,t,n){const i=this;let s="",r=!1;return o;function o(u){return(u===72||u===104)&&Lc.call(i,i.previous)&&!Zr(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(u),e.consume(u),a):n(u)}function a(u){if(Be(u)&&s.length<5)return s+=String.fromCodePoint(u),e.consume(u),a;if(u===58){const p=s.toLowerCase();if(p==="http"||p==="https")return e.consume(u),l}return n(u)}function l(u){return u===47?(e.consume(u),r?c:(r=!0,l)):n(u)}function c(u){return u===null||Yi(u)||ge(u)||Vt(u)||as(u)?n(u):e.attempt(Ic,e.attempt(Pc,d),n)(u)}function d(u){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(u)}}function bv(e,t,n){let i=0;return s;function s(o){return(o===87||o===119)&&i<3?(i++,e.consume(o),s):o===46&&i===3?(e.consume(o),r):n(o)}function r(o){return o===null?n(o):t(o)}}function yv(e,t,n){let i,s,r;return o;function o(c){return c===46||c===95?e.check(Oc,l,a)(c):c===null||ge(c)||Vt(c)||c!==45&&as(c)?l(c):(r=!0,e.consume(c),o)}function a(c){return c===95?i=!0:(s=i,i=void 0),e.consume(c),o}function l(c){return s||i||!r?n(c):t(c)}}function wv(e,t){let n=0,i=0;return s;function s(o){return o===40?(n++,e.consume(o),s):o===41&&i<n?r(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Oc,t,r)(o):o===null||ge(o)||Vt(o)?t(o):(e.consume(o),s)}function r(o){return o===41&&i++,e.consume(o),s}}function kv(e,t,n){return i;function i(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),i):a===38?(e.consume(a),r):a===93?(e.consume(a),s):a===60||a===null||ge(a)||Vt(a)?t(a):n(a)}function s(a){return a===null||a===40||a===91||ge(a)||Vt(a)?t(a):i(a)}function r(a){return Be(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),i):Be(a)?(e.consume(a),o):n(a)}}function vv(e,t,n){return i;function i(r){return e.consume(r),s}function s(r){return Ve(r)?n(r):t(r)}}function Nc(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ge(e)}function Lc(e){return!Be(e)}function Fc(e){return!(e===47||dr(e))}function dr(e){return e===43||e===45||e===46||e===95||Ve(e)}function Zr(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Sv={tokenize:Pv,partial:!0};function xv(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Ev,continuation:{tokenize:Tv},exit:Iv}},text:{91:{name:"gfmFootnoteCall",tokenize:Av},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:_v,resolveTo:Cv}}}}function _v(e,t,n){const i=this;let s=i.events.length;const r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;s--;){const l=i.events[s][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const c=ht(i.sliceSerialize({start:o.end,end:i.now()}));return c.codePointAt(0)!==94||!r.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function Cv(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const r={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},r.start),end:Object.assign({},r.end)},a=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...a),e}function Av(e,t,n){const i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let r=0,o;return a;function a(u){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),l}function l(u){return u!==94?n(u):(e.enter("gfmFootnoteCallMarker"),e.consume(u),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(u){if(r>999||u===93&&!o||u===null||u===91||ge(u))return n(u);if(u===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(ht(i.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(u)}return ge(u)||(o=!0),r++,e.consume(u),u===92?d:c}function d(u){return u===91||u===92||u===93?(e.consume(u),r++,c):c(u)}}function Ev(e,t,n){const i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let r,o=0,a;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(o>999||m===93&&!a||m===null||m===91||ge(m))return n(m);if(m===93){e.exit("chunkString");const h=e.exit("gfmFootnoteDefinitionLabelString");return r=ht(i.sliceSerialize(h)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return ge(m)||(a=!0),o++,e.consume(m),m===92?u:d}function u(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}function p(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),s.includes(r)||s.push(r),le(e,f,"gfmFootnoteDefinitionWhitespace")):n(m)}function f(m){return t(m)}}function Tv(e,t,n){return e.check(si,t,e.attempt(Sv,t,n))}function Iv(e){e.exit("gfmFootnoteDefinition")}function Pv(e,t,n){const i=this;return le(e,s,"gfmFootnoteDefinitionIndent",5);function s(r){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(r):n(r)}}function Ov(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:r,resolveAll:s};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function s(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let c=l;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[l][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[l][1].end)},u={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[l][1].start)},p=[["enter",d,a],["enter",o[c][1],a],["exit",o[c][1],a],["enter",u,a]],f=a.parser.constructs.insideSpan.null;f&&Qe(p,p.length,0,ls(f,o.slice(c+1,l),a)),Qe(p,p.length,0,[["exit",u,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",d,a]]),Qe(o,c-1,l-c+3,p),l=c+p.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function r(o,a,l){const c=this.previous,d=this.events;let u=0;return p;function p(m){return c===126&&d[d.length-1][1].type!=="characterEscape"?l(m):(o.enter("strikethroughSequenceTemporary"),f(m))}function f(m){const h=Cn(c);if(m===126)return u>1?l(m):(o.consume(m),u++,f);if(u<2&&!n)return l(m);const y=o.exit("strikethroughSequenceTemporary"),w=Cn(m);return y._open=!w||w===2&&!!h,y._close=!h||h===2&&!!w,a(m)}}}class $v{constructor(){this.map=[]}add(t,n,i){Rv(this,t,n,i)}consume(t){if(this.map.sort(function(r,o){return r[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let s=i.pop();for(;s;){for(const r of s)t.push(r);s=i.pop()}this.map.length=0}}function Rv(e,t,n,i){let s=0;if(!(n===0&&i.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...i);return}s+=1}e.map.push([t,n,i])}}function Nv(e,t){let n=!1;const i=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const r=i.length-1;i[r]=i[r]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function Lv(){return{flow:{null:{name:"table",tokenize:Fv,resolveAll:Dv}}}}function Fv(e,t,n){const i=this;let s=0,r=0,o;return a;function a(R){let H=i.events.length-1;for(;H>-1;){const ce=i.events[H][1].type;if(ce==="lineEnding"||ce==="linePrefix")H--;else break}const B=H>-1?i.events[H][1].type:null,te=B==="tableHead"||B==="tableRow"?k:l;return te===k&&i.parser.lazy[i.now().line]?n(R):te(R)}function l(R){return e.enter("tableHead"),e.enter("tableRow"),c(R)}function c(R){return R===124||(o=!0,r+=1),d(R)}function d(R){return R===null?n(R):G(R)?r>1?(r=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),f):n(R):se(R)?le(e,d,"whitespace")(R):(r+=1,o&&(o=!1,s+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),u(R)))}function u(R){return R===null||R===124||ge(R)?(e.exit("data"),d(R)):(e.consume(R),R===92?p:u)}function p(R){return R===92||R===124?(e.consume(R),u):u(R)}function f(R){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(R):(e.enter("tableDelimiterRow"),o=!1,se(R)?le(e,m,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):m(R))}function m(R){return R===45||R===58?y(R):R===124?(o=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),h):O(R)}function h(R){return se(R)?le(e,y,"whitespace")(R):y(R)}function y(R){return R===58?(r+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),w):R===45?(r+=1,w(R)):R===null||G(R)?I(R):O(R)}function w(R){return R===45?(e.enter("tableDelimiterFiller"),C(R)):O(R)}function C(R){return R===45?(e.consume(R),C):R===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(R))}function S(R){return se(R)?le(e,I,"whitespace")(R):I(R)}function I(R){return R===124?m(R):R===null||G(R)?!o||s!==r?O(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):O(R)}function O(R){return n(R)}function k(R){return e.enter("tableRow"),T(R)}function T(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),T):R===null||G(R)?(e.exit("tableRow"),t(R)):se(R)?le(e,T,"whitespace")(R):(e.enter("data"),$(R))}function $(R){return R===null||R===124||ge(R)?(e.exit("data"),T(R)):(e.consume(R),R===92?W:$)}function W(R){return R===92||R===124?(e.consume(R),$):$(R)}}function Dv(e,t){let n=-1,i=!0,s=0,r=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,c,d,u;const p=new $v;for(;++n<e.length;){const f=e[n],m=f[1];f[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(_a(p,t,l,c,d),d=void 0,l=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(i=!0,u=void 0,r=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,d={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",d,t]])),s=m.type==="tableDelimiterRow"?2:d?3:1):s&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(i=!1,o[2]===0&&(r[1]!==0&&(o[0]=o[1],u=yi(p,t,r,s,void 0,u),r=[0,0,0,0]),o[2]=n)):m.type==="tableCellDivider"&&(i?i=!1:(r[1]!==0&&(o[0]=o[1],u=yi(p,t,r,s,void 0,u)),r=o,o=[r[1],n,0,0])):m.type==="tableHead"?(a=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,r[1]!==0?(o[0]=o[1],u=yi(p,t,r,s,n,u)):o[1]!==0&&(u=yi(p,t,o,s,n,u)),s=0):s&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&_a(p,t,l,c,d),p.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=Nv(t.events,n))}return e}function yi(e,t,n,i,s,r){const o=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(r.end=Object.assign({},on(t.events,n[0])),e.add(n[0],0,[["exit",r,t]]));const l=on(t.events,n[1]);if(r={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",r,t]]),n[2]!==0){const c=on(t.events,n[2]),d=on(t.events,n[3]),u={type:a,start:Object.assign({},c),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",u,t]]),i!==2){const p=t.events[n[2]],f=t.events[n[3]];if(p[1].end=Object.assign({},f[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,h=n[3]-n[2]-1;e.add(m,h,[])}}e.add(n[3]+1,0,[["exit",u,t]])}return s!==void 0&&(r.end=Object.assign({},on(t.events,s)),e.add(s,0,[["exit",r,t]]),r=void 0),r}function _a(e,t,n,i,s){const r=[],o=on(t.events,n);s&&(s.end=Object.assign({},o),r.push(["exit",s,t])),i.end=Object.assign({},o),r.push(["exit",i,t]),e.add(n+1,0,r)}function on(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const zv={name:"tasklistCheck",tokenize:jv};function Mv(){return{text:{91:zv}}}function jv(e,t,n){const i=this;return s;function s(l){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),r)}function r(l){return ge(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return G(l)?t(l):se(l)?e.check({tokenize:Bv},t,n)(l):n(l)}}function Bv(e,t,n){return le(e,i,"whitespace");function i(s){return s===null?n(s):t(s)}}function Uv(e){return Yl([pv(),xv(),Ov(e),Lv(),Mv()])}const Hv={};function Dc(e){const t=this,n=e||Hv,i=t.data(),s=i.micromarkExtensions||(i.micromarkExtensions=[]),r=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);s.push(Uv(n)),r.push(cv()),o.push(uv(n))}var js={exports:{}},Ca;function qv(){return Ca||(Ca=1,(function(e){(function(){var t;t=e.exports=s,t.format=s,t.vsprintf=i,typeof console<"u"&&typeof console.log=="function"&&(t.printf=n);function n(){console.log(s.apply(null,arguments))}function i(r,o){return s.apply(null,[r].concat(o))}function s(r){for(var o=1,a=[].slice.call(arguments),l=0,c=r.length,d="",u,p=!1,f,m,h=!1,y,w=function(){return a[o++]},C=function(){for(var S="";/\d/.test(r[l]);)S+=r[l++],u=r[l];return S.length>0?parseInt(S):null};l<c;++l)if(u=r[l],p)switch(p=!1,u=="."?(h=!1,u=r[++l]):u=="0"&&r[l+1]=="."?(h=!0,l+=2,u=r[l]):h=!0,y=C(),u){case"b":d+=parseInt(w(),10).toString(2);break;case"c":f=w(),typeof f=="string"||f instanceof String?d+=f:d+=String.fromCharCode(parseInt(f,10));break;case"d":d+=parseInt(w(),10);break;case"f":m=String(parseFloat(w()).toFixed(y||6)),d+=h?m:m.replace(/^0/,"");break;case"j":d+=JSON.stringify(w());break;case"o":d+="0"+parseInt(w(),10).toString(8);break;case"s":d+=w();break;case"x":d+="0x"+parseInt(w(),10).toString(16);break;case"X":d+="0x"+parseInt(w(),10).toString(16).toUpperCase();break;default:d+=u;break}else u==="%"?p=!0:d+=u;return d}})()})(js)),js.exports}var Wv=qv();const Vv=os(Wv),wi=Object.assign(jt(Error),{eval:jt(EvalError),range:jt(RangeError),reference:jt(ReferenceError),syntax:jt(SyntaxError),type:jt(TypeError),uri:jt(URIError)});function jt(e){return t.displayName=e.displayName||e.name,t;function t(n,...i){const s=n&&Vv(n,...i);return new e(s)}}const ki={}.hasOwnProperty,Aa={yaml:"-",toml:"+"};function Kr(e){const t=[];let n=-1;const i=Array.isArray(e)?e:e?[e]:["yaml"];for(;++n<i.length;)t[n]=Zv(i[n]);return t}function Zv(e){let t=e;if(typeof t=="string"){if(!ki.call(Aa,t))throw wi("Missing matter definition for `%s`",t);t={type:t,marker:Aa[t]}}else if(typeof t!="object")throw wi("Expected matter to be an object, not `%j`",t);if(!ki.call(t,"type"))throw wi("Missing `type` in matter `%j`",t);if(!ki.call(t,"fence")&&!ki.call(t,"marker"))throw wi("Missing `marker` or `fence` in matter `%j`",t);return t}function Kv(e){const t=Kr(e),n={};let i=-1;for(;++i<t.length;){const s=t[i],r=fr(s,"open").charCodeAt(0),o=Gv(s),a=n[r];Array.isArray(a)?a.push(o):n[r]=[o]}return{flow:n}}function Gv(e){const t=e.anywhere,n=e.type,i=n+"Fence",s=i+"Sequence",r=n+"Value",o={tokenize:d,partial:!0};let a,l=0;return{tokenize:c,concrete:!0};function c(u,p,f){const m=this;return h;function h(T){const $=m.now();return $.column===1&&($.line===1||t)&&(a=fr(e,"open"),l=0,T===a.charCodeAt(l))?(u.enter(n),u.enter(i),u.enter(s),y(T)):f(T)}function y(T){return l===a.length?(u.exit(s),se(T)?(u.enter("whitespace"),w(T)):C(T)):T===a.charCodeAt(l++)?(u.consume(T),y):f(T)}function w(T){return se(T)?(u.consume(T),w):(u.exit("whitespace"),C(T))}function C(T){return G(T)?(u.exit(i),u.enter("lineEnding"),u.consume(T),u.exit("lineEnding"),a=fr(e,"close"),l=0,u.attempt(o,k,S)):f(T)}function S(T){return T===null||G(T)?O(T):(u.enter(r),I(T))}function I(T){return T===null||G(T)?(u.exit(r),O(T)):(u.consume(T),I)}function O(T){return T===null?f(T):(u.enter("lineEnding"),u.consume(T),u.exit("lineEnding"),u.attempt(o,k,S))}function k(T){return u.exit(n),p(T)}}function d(u,p,f){let m=0;return h;function h(S){return S===a.charCodeAt(m)?(u.enter(i),u.enter(s),y(S)):f(S)}function y(S){return m===a.length?(u.exit(s),se(S)?(u.enter("whitespace"),w(S)):C(S)):S===a.charCodeAt(m++)?(u.consume(S),y):f(S)}function w(S){return se(S)?(u.consume(S),w):(u.exit("whitespace"),C(S))}function C(S){return S===null||G(S)?(u.exit(i),p(S)):f(S)}}}function fr(e,t){return e.marker?Ea(e.marker,t).repeat(3):Ea(e.fence,t)}function Ea(e,t){return typeof e=="string"?e:e[t]}function Yv(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Jv(e){const t=Kr(e),n={},i={};let s=-1;for(;++s<t.length;){const r=t[s];n[r.type]=Qv(r),i[r.type]=Xv,i[r.type+"Value"]=eS}return{enter:n,exit:i}}function Qv(e){return t;function t(n){this.enter({type:e.type,value:""},n),this.buffer()}}function Xv(e){const t=this.resume(),n=this.stack[this.stack.length-1];this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,"")}function eS(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function tS(e){const t=[],n={},i=Kr(e);let s=-1;for(;++s<i.length;){const r=i[s];n[r.type]=nS(r);const o=pr(r,"open");t.push({atBreak:!0,character:o.charAt(0),after:Yv(o.charAt(1))})}return{unsafe:t,handlers:n}}function nS(e){const t=pr(e,"open"),n=pr(e,"close");return i;function i(s){return t+(s.value?`
102
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:l,tableRow:a}};function o(f,m,p,y){return c(d(f,p,y),f.align)}function a(f,m,p,y){const w=u(f,p,y),C=c([w]);return C.slice(0,C.indexOf(`
103
+ `))}function l(f,m,p,y){const w=p.enter("tableCell"),C=p.enter("phrasing"),S=p.containerPhrasing(f,{...y,before:r,after:r});return C(),w(),S}function c(f,m){return Yk(f,{align:m,alignDelimiters:i,padding:n,stringLength:s})}function d(f,m,p){const y=f.children;let w=-1;const C=[],S=m.enter("table");for(;++w<y.length;)C[w]=u(y[w],m,p);return S(),C}function u(f,m,p){const y=f.children;let w=-1;const C=[],S=m.enter("tableRow");for(;++w<y.length;)C[w]=l(y[w],f,m,p);return S(),C}function h(f,m,p){let y=Vr.inlineCode(f,m,p);return p.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function rv(){return{exit:{taskListCheckValueChecked:xa,taskListCheckValueUnchecked:xa,paragraph:av}}}function ov(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:lv}}}function xa(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function av(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const i=n.children[0];if(i&&i.type==="text"){const s=t.children;let r=-1,o;for(;++r<s.length;){const a=s[r];if(a.type==="paragraph"){o=a;break}}o===n&&(i.value=i.value.slice(1),i.value.length===0?n.children.shift():n.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,n.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function lv(e,t,n,i){const s=e.children[0],r=typeof e.checked=="boolean"&&s&&s.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(i);r&&a.move(o);let l=Vr.listItem(e,t,n,{...i,...a.current()});return r&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(d){return d+o}}function cv(){return[wk(),jk(),qk(),Qk(),rv()]}function uv(e){return{extensions:[kk(),Bk(e),Wk(),sv(e),ov()]}}const dv={tokenize:bv,partial:!0},Ic={tokenize:yv,partial:!0},Pc={tokenize:wv,partial:!0},Oc={tokenize:kv,partial:!0},fv={tokenize:vv,partial:!0},$c={name:"wwwAutolink",tokenize:mv,previous:Nc},Rc={name:"protocolAutolink",tokenize:gv,previous:Lc},Et={name:"emailAutolink",tokenize:pv,previous:Fc},kt={};function hv(){return{text:kt}}let Mt=48;for(;Mt<123;)kt[Mt]=Et,Mt++,Mt===58?Mt=65:Mt===91&&(Mt=97);kt[43]=Et;kt[45]=Et;kt[46]=Et;kt[95]=Et;kt[72]=[Et,Rc];kt[104]=[Et,Rc];kt[87]=[Et,$c];kt[119]=[Et,$c];function pv(e,t,n){const i=this;let s,r;return o;function o(u){return!dr(u)||!Fc.call(i,i.previous)||Zr(i.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(u))}function a(u){return dr(u)?(e.consume(u),a):u===64?(e.consume(u),l):n(u)}function l(u){return u===46?e.check(fv,d,c)(u):u===45||u===95||Ve(u)?(r=!0,e.consume(u),l):d(u)}function c(u){return e.consume(u),s=!0,l}function d(u){return r&&s&&Be(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(u)):n(u)}}function mv(e,t,n){const i=this;return s;function s(o){return o!==87&&o!==119||!Nc.call(i,i.previous)||Zr(i.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(dv,e.attempt(Ic,e.attempt(Pc,r),n),n)(o))}function r(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function gv(e,t,n){const i=this;let s="",r=!1;return o;function o(u){return(u===72||u===104)&&Lc.call(i,i.previous)&&!Zr(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(u),e.consume(u),a):n(u)}function a(u){if(Be(u)&&s.length<5)return s+=String.fromCodePoint(u),e.consume(u),a;if(u===58){const h=s.toLowerCase();if(h==="http"||h==="https")return e.consume(u),l}return n(u)}function l(u){return u===47?(e.consume(u),r?c:(r=!0,l)):n(u)}function c(u){return u===null||Yi(u)||ge(u)||Vt(u)||as(u)?n(u):e.attempt(Ic,e.attempt(Pc,d),n)(u)}function d(u){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(u)}}function bv(e,t,n){let i=0;return s;function s(o){return(o===87||o===119)&&i<3?(i++,e.consume(o),s):o===46&&i===3?(e.consume(o),r):n(o)}function r(o){return o===null?n(o):t(o)}}function yv(e,t,n){let i,s,r;return o;function o(c){return c===46||c===95?e.check(Oc,l,a)(c):c===null||ge(c)||Vt(c)||c!==45&&as(c)?l(c):(r=!0,e.consume(c),o)}function a(c){return c===95?i=!0:(s=i,i=void 0),e.consume(c),o}function l(c){return s||i||!r?n(c):t(c)}}function wv(e,t){let n=0,i=0;return s;function s(o){return o===40?(n++,e.consume(o),s):o===41&&i<n?r(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Oc,t,r)(o):o===null||ge(o)||Vt(o)?t(o):(e.consume(o),s)}function r(o){return o===41&&i++,e.consume(o),s}}function kv(e,t,n){return i;function i(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),i):a===38?(e.consume(a),r):a===93?(e.consume(a),s):a===60||a===null||ge(a)||Vt(a)?t(a):n(a)}function s(a){return a===null||a===40||a===91||ge(a)||Vt(a)?t(a):i(a)}function r(a){return Be(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),i):Be(a)?(e.consume(a),o):n(a)}}function vv(e,t,n){return i;function i(r){return e.consume(r),s}function s(r){return Ve(r)?n(r):t(r)}}function Nc(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||ge(e)}function Lc(e){return!Be(e)}function Fc(e){return!(e===47||dr(e))}function dr(e){return e===43||e===45||e===46||e===95||Ve(e)}function Zr(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Sv={tokenize:Pv,partial:!0};function xv(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Tv,continuation:{tokenize:Ev},exit:Iv}},text:{91:{name:"gfmFootnoteCall",tokenize:Av},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:_v,resolveTo:Cv}}}}function _v(e,t,n){const i=this;let s=i.events.length;const r=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o;for(;s--;){const l=i.events[s][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const c=pt(i.sliceSerialize({start:o.end,end:i.now()}));return c.codePointAt(0)!==94||!r.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function Cv(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const r={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},r.start),end:Object.assign({},r.end)},a=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...a),e}function Av(e,t,n){const i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let r=0,o;return a;function a(u){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),l}function l(u){return u!==94?n(u):(e.enter("gfmFootnoteCallMarker"),e.consume(u),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(u){if(r>999||u===93&&!o||u===null||u===91||ge(u))return n(u);if(u===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes(pt(i.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(u)}return ge(u)||(o=!0),r++,e.consume(u),u===92?d:c}function d(u){return u===91||u===92||u===93?(e.consume(u),r++,c):c(u)}}function Tv(e,t,n){const i=this,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let r,o=0,a;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(o>999||m===93&&!a||m===null||m===91||ge(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return r=pt(i.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return ge(m)||(a=!0),o++,e.consume(m),m===92?u:d}function u(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),s.includes(r)||s.push(r),le(e,f,"gfmFootnoteDefinitionWhitespace")):n(m)}function f(m){return t(m)}}function Ev(e,t,n){return e.check(si,t,e.attempt(Sv,t,n))}function Iv(e){e.exit("gfmFootnoteDefinition")}function Pv(e,t,n){const i=this;return le(e,s,"gfmFootnoteDefinitionIndent",5);function s(r){const o=i.events[i.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(r):n(r)}}function Ov(e){let n=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:r,resolveAll:s};return n==null&&(n=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function s(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let c=l;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[l][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[l][1].end)},u={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[l][1].start)},h=[["enter",d,a],["enter",o[c][1],a],["exit",o[c][1],a],["enter",u,a]],f=a.parser.constructs.insideSpan.null;f&&Qe(h,h.length,0,ls(f,o.slice(c+1,l),a)),Qe(h,h.length,0,[["exit",u,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",d,a]]),Qe(o,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function r(o,a,l){const c=this.previous,d=this.events;let u=0;return h;function h(m){return c===126&&d[d.length-1][1].type!=="characterEscape"?l(m):(o.enter("strikethroughSequenceTemporary"),f(m))}function f(m){const p=Cn(c);if(m===126)return u>1?l(m):(o.consume(m),u++,f);if(u<2&&!n)return l(m);const y=o.exit("strikethroughSequenceTemporary"),w=Cn(m);return y._open=!w||w===2&&!!p,y._close=!p||p===2&&!!w,a(m)}}}class $v{constructor(){this.map=[]}add(t,n,i){Rv(this,t,n,i)}consume(t){if(this.map.sort(function(r,o){return r[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const i=[];for(;n>0;)n-=1,i.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];i.push(t.slice()),t.length=0;let s=i.pop();for(;s;){for(const r of s)t.push(r);s=i.pop()}this.map.length=0}}function Rv(e,t,n,i){let s=0;if(!(n===0&&i.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...i);return}s+=1}e.map.push([t,n,i])}}function Nv(e,t){let n=!1;const i=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const r=i.length-1;i[r]=i[r]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return i}function Lv(){return{flow:{null:{name:"table",tokenize:Fv,resolveAll:Dv}}}}function Fv(e,t,n){const i=this;let s=0,r=0,o;return a;function a(R){let H=i.events.length-1;for(;H>-1;){const ce=i.events[H][1].type;if(ce==="lineEnding"||ce==="linePrefix")H--;else break}const B=H>-1?i.events[H][1].type:null,te=B==="tableHead"||B==="tableRow"?k:l;return te===k&&i.parser.lazy[i.now().line]?n(R):te(R)}function l(R){return e.enter("tableHead"),e.enter("tableRow"),c(R)}function c(R){return R===124||(o=!0,r+=1),d(R)}function d(R){return R===null?n(R):G(R)?r>1?(r=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),f):n(R):se(R)?le(e,d,"whitespace")(R):(r+=1,o&&(o=!1,s+=1),R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),u(R)))}function u(R){return R===null||R===124||ge(R)?(e.exit("data"),d(R)):(e.consume(R),R===92?h:u)}function h(R){return R===92||R===124?(e.consume(R),u):u(R)}function f(R){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(R):(e.enter("tableDelimiterRow"),o=!1,se(R)?le(e,m,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):m(R))}function m(R){return R===45||R===58?y(R):R===124?(o=!0,e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),p):O(R)}function p(R){return se(R)?le(e,y,"whitespace")(R):y(R)}function y(R){return R===58?(r+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),w):R===45?(r+=1,w(R)):R===null||G(R)?I(R):O(R)}function w(R){return R===45?(e.enter("tableDelimiterFiller"),C(R)):O(R)}function C(R){return R===45?(e.consume(R),C):R===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(R),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(R))}function S(R){return se(R)?le(e,I,"whitespace")(R):I(R)}function I(R){return R===124?m(R):R===null||G(R)?!o||s!==r?O(R):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(R)):O(R)}function O(R){return n(R)}function k(R){return e.enter("tableRow"),E(R)}function E(R){return R===124?(e.enter("tableCellDivider"),e.consume(R),e.exit("tableCellDivider"),E):R===null||G(R)?(e.exit("tableRow"),t(R)):se(R)?le(e,E,"whitespace")(R):(e.enter("data"),$(R))}function $(R){return R===null||R===124||ge(R)?(e.exit("data"),E(R)):(e.consume(R),R===92?W:$)}function W(R){return R===92||R===124?(e.consume(R),$):$(R)}}function Dv(e,t){let n=-1,i=!0,s=0,r=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,c,d,u;const h=new $v;for(;++n<e.length;){const f=e[n],m=f[1];f[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(_a(h,t,l,c,d),d=void 0,l=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(i=!0,u=void 0,r=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,d={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",d,t]])),s=m.type==="tableDelimiterRow"?2:d?3:1):s&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(i=!1,o[2]===0&&(r[1]!==0&&(o[0]=o[1],u=yi(h,t,r,s,void 0,u),r=[0,0,0,0]),o[2]=n)):m.type==="tableCellDivider"&&(i?i=!1:(r[1]!==0&&(o[0]=o[1],u=yi(h,t,r,s,void 0,u)),r=o,o=[r[1],n,0,0])):m.type==="tableHead"?(a=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,r[1]!==0?(o[0]=o[1],u=yi(h,t,r,s,n,u)):o[1]!==0&&(u=yi(h,t,o,s,n,u)),s=0):s&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&_a(h,t,l,c,d),h.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=Nv(t.events,n))}return e}function yi(e,t,n,i,s,r){const o=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(r.end=Object.assign({},on(t.events,n[0])),e.add(n[0],0,[["exit",r,t]]));const l=on(t.events,n[1]);if(r={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",r,t]]),n[2]!==0){const c=on(t.events,n[2]),d=on(t.events,n[3]),u={type:a,start:Object.assign({},c),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",u,t]]),i!==2){const h=t.events[n[2]],f=t.events[n[3]];if(h[1].end=Object.assign({},f[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,p=n[3]-n[2]-1;e.add(m,p,[])}}e.add(n[3]+1,0,[["exit",u,t]])}return s!==void 0&&(r.end=Object.assign({},on(t.events,s)),e.add(s,0,[["exit",r,t]]),r=void 0),r}function _a(e,t,n,i,s){const r=[],o=on(t.events,n);s&&(s.end=Object.assign({},o),r.push(["exit",s,t])),i.end=Object.assign({},o),r.push(["exit",i,t]),e.add(n+1,0,r)}function on(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const zv={name:"tasklistCheck",tokenize:jv};function Mv(){return{text:{91:zv}}}function jv(e,t,n){const i=this;return s;function s(l){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),r)}function r(l){return ge(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return G(l)?t(l):se(l)?e.check({tokenize:Bv},t,n)(l):n(l)}}function Bv(e,t,n){return le(e,i,"whitespace");function i(s){return s===null?n(s):t(s)}}function Uv(e){return Yl([hv(),xv(),Ov(e),Lv(),Mv()])}const Hv={};function Dc(e){const t=this,n=e||Hv,i=t.data(),s=i.micromarkExtensions||(i.micromarkExtensions=[]),r=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);s.push(Uv(n)),r.push(cv()),o.push(uv(n))}var js={exports:{}},Ca;function qv(){return Ca||(Ca=1,(function(e){(function(){var t;t=e.exports=s,t.format=s,t.vsprintf=i,typeof console<"u"&&typeof console.log=="function"&&(t.printf=n);function n(){console.log(s.apply(null,arguments))}function i(r,o){return s.apply(null,[r].concat(o))}function s(r){for(var o=1,a=[].slice.call(arguments),l=0,c=r.length,d="",u,h=!1,f,m,p=!1,y,w=function(){return a[o++]},C=function(){for(var S="";/\d/.test(r[l]);)S+=r[l++],u=r[l];return S.length>0?parseInt(S):null};l<c;++l)if(u=r[l],h)switch(h=!1,u=="."?(p=!1,u=r[++l]):u=="0"&&r[l+1]=="."?(p=!0,l+=2,u=r[l]):p=!0,y=C(),u){case"b":d+=parseInt(w(),10).toString(2);break;case"c":f=w(),typeof f=="string"||f instanceof String?d+=f:d+=String.fromCharCode(parseInt(f,10));break;case"d":d+=parseInt(w(),10);break;case"f":m=String(parseFloat(w()).toFixed(y||6)),d+=p?m:m.replace(/^0/,"");break;case"j":d+=JSON.stringify(w());break;case"o":d+="0"+parseInt(w(),10).toString(8);break;case"s":d+=w();break;case"x":d+="0x"+parseInt(w(),10).toString(16);break;case"X":d+="0x"+parseInt(w(),10).toString(16).toUpperCase();break;default:d+=u;break}else u==="%"?h=!0:d+=u;return d}})()})(js)),js.exports}var Wv=qv();const Vv=os(Wv),wi=Object.assign(jt(Error),{eval:jt(EvalError),range:jt(RangeError),reference:jt(ReferenceError),syntax:jt(SyntaxError),type:jt(TypeError),uri:jt(URIError)});function jt(e){return t.displayName=e.displayName||e.name,t;function t(n,...i){const s=n&&Vv(n,...i);return new e(s)}}const ki={}.hasOwnProperty,Aa={yaml:"-",toml:"+"};function Kr(e){const t=[];let n=-1;const i=Array.isArray(e)?e:e?[e]:["yaml"];for(;++n<i.length;)t[n]=Zv(i[n]);return t}function Zv(e){let t=e;if(typeof t=="string"){if(!ki.call(Aa,t))throw wi("Missing matter definition for `%s`",t);t={type:t,marker:Aa[t]}}else if(typeof t!="object")throw wi("Expected matter to be an object, not `%j`",t);if(!ki.call(t,"type"))throw wi("Missing `type` in matter `%j`",t);if(!ki.call(t,"fence")&&!ki.call(t,"marker"))throw wi("Missing `marker` or `fence` in matter `%j`",t);return t}function Kv(e){const t=Kr(e),n={};let i=-1;for(;++i<t.length;){const s=t[i],r=fr(s,"open").charCodeAt(0),o=Gv(s),a=n[r];Array.isArray(a)?a.push(o):n[r]=[o]}return{flow:n}}function Gv(e){const t=e.anywhere,n=e.type,i=n+"Fence",s=i+"Sequence",r=n+"Value",o={tokenize:d,partial:!0};let a,l=0;return{tokenize:c,concrete:!0};function c(u,h,f){const m=this;return p;function p(E){const $=m.now();return $.column===1&&($.line===1||t)&&(a=fr(e,"open"),l=0,E===a.charCodeAt(l))?(u.enter(n),u.enter(i),u.enter(s),y(E)):f(E)}function y(E){return l===a.length?(u.exit(s),se(E)?(u.enter("whitespace"),w(E)):C(E)):E===a.charCodeAt(l++)?(u.consume(E),y):f(E)}function w(E){return se(E)?(u.consume(E),w):(u.exit("whitespace"),C(E))}function C(E){return G(E)?(u.exit(i),u.enter("lineEnding"),u.consume(E),u.exit("lineEnding"),a=fr(e,"close"),l=0,u.attempt(o,k,S)):f(E)}function S(E){return E===null||G(E)?O(E):(u.enter(r),I(E))}function I(E){return E===null||G(E)?(u.exit(r),O(E)):(u.consume(E),I)}function O(E){return E===null?f(E):(u.enter("lineEnding"),u.consume(E),u.exit("lineEnding"),u.attempt(o,k,S))}function k(E){return u.exit(n),h(E)}}function d(u,h,f){let m=0;return p;function p(S){return S===a.charCodeAt(m)?(u.enter(i),u.enter(s),y(S)):f(S)}function y(S){return m===a.length?(u.exit(s),se(S)?(u.enter("whitespace"),w(S)):C(S)):S===a.charCodeAt(m++)?(u.consume(S),y):f(S)}function w(S){return se(S)?(u.consume(S),w):(u.exit("whitespace"),C(S))}function C(S){return S===null||G(S)?(u.exit(i),h(S)):f(S)}}}function fr(e,t){return e.marker?Ta(e.marker,t).repeat(3):Ta(e.fence,t)}function Ta(e,t){return typeof e=="string"?e:e[t]}function Yv(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Jv(e){const t=Kr(e),n={},i={};let s=-1;for(;++s<t.length;){const r=t[s];n[r.type]=Qv(r),i[r.type]=Xv,i[r.type+"Value"]=eS}return{enter:n,exit:i}}function Qv(e){return t;function t(n){this.enter({type:e.type,value:""},n),this.buffer()}}function Xv(e){const t=this.resume(),n=this.stack[this.stack.length-1];this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,"")}function eS(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function tS(e){const t=[],n={},i=Kr(e);let s=-1;for(;++s<i.length;){const r=i[s];n[r.type]=nS(r);const o=hr(r,"open");t.push({atBreak:!0,character:o.charAt(0),after:Yv(o.charAt(1))})}return{unsafe:t,handlers:n}}function nS(e){const t=hr(e,"open"),n=hr(e,"close");return i;function i(s){return t+(s.value?`
104
104
  `+s.value:"")+`
105
- `+n}}function pr(e,t){return e.marker?Ta(e.marker,t).repeat(3):Ta(e.fence,t)}function Ta(e,t){return typeof e=="string"?e:e[t]}const iS="yaml";function zc(e){const t=this,n=e||iS,i=t.data(),s=i.micromarkExtensions||(i.micromarkExtensions=[]),r=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);s.push(Kv(n)),r.push(Jv(n)),o.push(tS(n))}const Mc=Kl().use(rw).use(Dc).use(zc,["yaml"]);Kl().use(pk,{bullet:"-",fences:!0,listItemIndent:"one",rule:"-"}).use(Dc).use(zc,["yaml"]);function sS(e){const t={};for(const n of e.split(/\r?\n/)){const i=/^(?:"([^"]+)"|'([^']+)'|([A-Za-z0-9_-]+)):\s*(.*)$/.exec(n);i&&(t[i[1]??i[2]??i[3]]=i[4].trim())}return t}const Ia="\uFEFF";function Gr(e){return e.replace(/^\uFEFF?---\r?\n(?:[\s\S]*?\r?\n)?---[ \t]*(?:\r?\n|$)/,"")}function jc(e){const t=Mc.parse(e);for(const n of t.children??[])if(n.type==="yaml")return sS(n.value??"");return{}}const ds=/^["']?(amadeus_page|amadeus_schema|amadeus_layout|amadeus_canvas|amadeus_next_id)["']?\s*:/;function rS(e){const t=/^["']?amadeus\.page\/(\d+)\b/.exec(e.amadeus_schema??"");return t?Number.parseInt(t[1],10):null}function Yr(e){const t=[];let n=null,i=[];const s=()=>{for(const r of i)t.push([r]);i=[]};for(const r of e)!r.trim()||r.startsWith("#")?i.push(r):/^[ \t]/.test(r)||/^-(?:[ \t]|\r?$)/.test(r)||/^[}\],]/.test(r)?n?(n.push(...i,r),i=[]):(s(),t.push([r])):(s(),n=[r],t.push(n));return s(),t}function Bc(e){const t=Mc.parse(e);for(const n of t.children??[])if(n.type==="yaml")return Yr((n.value??"").split(`
105
+ `+n}}function hr(e,t){return e.marker?Ea(e.marker,t).repeat(3):Ea(e.fence,t)}function Ea(e,t){return typeof e=="string"?e:e[t]}const iS="yaml";function zc(e){const t=this,n=e||iS,i=t.data(),s=i.micromarkExtensions||(i.micromarkExtensions=[]),r=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),o=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);s.push(Kv(n)),r.push(Jv(n)),o.push(tS(n))}const Mc=Kl().use(rw).use(Dc).use(zc,["yaml"]);Kl().use(hk,{bullet:"-",fences:!0,listItemIndent:"one",rule:"-"}).use(Dc).use(zc,["yaml"]);function sS(e){const t={};for(const n of e.split(/\r?\n/)){const i=/^(?:"([^"]+)"|'([^']+)'|([A-Za-z0-9_-]+)):\s*(.*)$/.exec(n);i&&(t[i[1]??i[2]??i[3]]=i[4].trim())}return t}const Ia="\uFEFF";function Gr(e){return e.replace(/^\uFEFF?---\r?\n(?:[\s\S]*?\r?\n)?---[ \t]*(?:\r?\n|$)/,"")}function jc(e){const t=Mc.parse(e);for(const n of t.children??[])if(n.type==="yaml")return sS(n.value??"");return{}}const ds=/^["']?(amadeus_page|amadeus_schema|amadeus_layout|amadeus_canvas|amadeus_next_id)["']?\s*:/;function rS(e){const t=/^["']?amadeus\.page\/(\d+)\b/.exec(e.amadeus_schema??"");return t?Number.parseInt(t[1],10):null}function Yr(e){const t=[];let n=null,i=[];const s=()=>{for(const r of i)t.push([r]);i=[]};for(const r of e)!r.trim()||r.startsWith("#")?i.push(r):/^[ \t]/.test(r)||/^-(?:[ \t]|\r?$)/.test(r)||/^[}\],]/.test(r)?n?(n.push(...i,r),i=[]):(s(),t.push([r])):(s(),n=[r],t.push(n));return s(),t}function Bc(e){const t=Mc.parse(e);for(const n of t.children??[])if(n.type==="yaml")return Yr((n.value??"").split(`
106
106
  `)).filter(i=>!ds.test(i[0])).flat().join(`
107
107
  `).replace(/^\n+|\n+$/g,"");return""}function oS(e){let t=0;for(const n of e.root.children)for(const i of n.columns)for(const s of i.children){const r=Number.parseInt(s.ref,10);Number.isInteger(r)&&String(r)===s.ref&&r>t&&(t=r)}return t+1}function aS(e){const t=(e.fmExtra??"").split(`
108
108
  `).filter(s=>!ds.test(s)&&!/^---\s*$/.test(s)).join(`
109
109
  `).replace(/^\n+|\n+$/g,""),n=oS(e),i=Math.max(e.nextId??0,n);return["---",`amadeus_page: ${e.id}`,`amadeus_schema: ${e.schema}`,`amadeus_layout: ${Fg(e.root)}`,...i>n?[`amadeus_next_id: ${i}`]:[],...t?[t]:[],"---"].join(`
110
- `)}function hr(e,t){if(e.schemaTooNew)throw new Error("amadeus: 笔记由更新版本的格式写入(amadeus_schema 超出本端支持),已拒绝改写以防损坏");const n=[aS(e)];for(const i of e.root.children)for(const s of i.columns)for(const r of s.children){const o=(t[r.ref]??"").replace(/^(?:[ \t]*\r?\n)+/,"").trimEnd();n.push(o?`${Co(r.ref)}
110
+ `)}function pr(e,t){if(e.schemaTooNew)throw new Error("amadeus: 笔记由更新版本的格式写入(amadeus_schema 超出本端支持),已拒绝改写以防损坏");const n=[aS(e)];for(const i of e.root.children)for(const s of i.columns)for(const r of s.children){const o=(t[r.ref]??"").replace(/^(?:[ \t]*\r?\n)+/,"").trimEnd();n.push(o?`${Co(r.ref)}
111
111
 
112
112
  ${o}`:Co(r.ref))}return n.join(`
113
113
 
114
114
  `)+`
115
- `}const Uc={children:[]},lS=3;function cS(e){const t=e.reduce((n,i)=>n+(i.width>0?i.width:0),0);if(t<=0){const n=1/Math.max(1,e.length);return e.map(i=>({...i,width:n}))}return e.map(n=>({...n,width:(n.width>0?n.width:0)/t}))}function uS(e,t){const n=new Set,i=[];for(const r of e.children){const o=[];for(const a of r.columns){const l=a.children.filter(c=>t.has(c.ref)?(n.add(c.ref),!0):!1);l.length&&o.push({...a,children:l})}o.length&&i.push({...r,columns:cS(o)})}const s=[...t].filter(r=>!n.has(r));return s.length&&i.push({type:"row",id:Md(),columns:[{id:jd(),width:1,children:s.map(r=>({ref:r}))}]}),{type:"stack",children:i}}function dS(e,t){const n={};for(const[i,s]of Object.entries(e.blocks))n[i]={id:i,type:s.type,content:t[i]??""};return n}function Jr(e,t,n,i,s,r,o,a,l,c){const d=new Set(c??Object.keys(i)),u={schema:$d,id:t,title:hl(e),createdAt:r,updatedAt:o,compiler:{version:Rd},root:uS(n,d),blocks:Object.fromEntries(Object.entries(i).map(([p,f])=>[p,{type:f}])),...a?{fmExtra:a}:{},...l&&l>0?{nextId:l}:{}};return{manifest:u,blocks:dS(u,s)}}async function fS(e,t,n,i){await e.writeFile(ml(t),hr(n,i.contents))}async function pS(e,t,n){const i=qi([]),s=Jr(t,pl(),Uc,{[i]:"markdown"},{[i]:""},n,n);return await fS(e,t,s.manifest,{contents:{[i]:""}}),s}function Hc(e,t,n){const i=Gr(t).replace(/^(?:[ \t]*\r?\n)+/,"").trimEnd(),s=qi([]);return Jr(e,pl(),Uc,{[s]:"markdown"},{[s]:i},n,n,Bc(t))}function hS(e,t,n,i){const s=Hc(e,t,i);return s.manifest.id=n.amadeus_page,s.manifest.schemaTooNew=!0,s}function mS(e,t,n,i){const s=gl(Gr(t)),r=Dg(n.amadeus_layout),o=Bc(t),a=Number.parseInt(n.amadeus_next_id??"",10),l=new Set;for(const h of s)h.id!=null&&l.add(h.id);let c=Number.isSafeInteger(a)&&a>0?a:void 0,d=!1;const u=new Set,p={},f={},m=[];for(const h of s){let y;if(h.id!=null&&h.id!=="__proto__"&&!u.has(h.id))u.add(h.id),y=h.id;else{y=qi(l,c);for(let w=2;l.has(y);w++)y=`${qi(l,c)}-${w}`;l.add(y),c=zd(c,y),d=!0}p[y]="markdown",f[y]=h.content,m.push(y)}return{page:Jr(e,n.amadeus_page,r,p,f,i,i,o,c,m),renumbered:d}}function Ri(e,t,n){const i=jc(t);if(!i.amadeus_page)return Hc(e,t,n);const s=rS(i);return s!=null&&s>lS?hS(e,t,i,n):mS(e,t,i,n).page}const gS=/^ {0,3}(`{3,}|~{3,}|\$\$)(.*)$/,bS=e=>e==="$$"?/^ {0,3}\$\$\s*$/:new RegExp(`^ {0,3}${e[0]==="`"?"`":"~"}{${e.length},}\\s*$`),yS=(e,t)=>e==="$$"?!t.includes("$"):e[0]==="`"?!t.includes("`"):!0,qc=/^(?:[-*+][ \t]|\d{1,9}[.)][ \t]|>)/;function Wc(e,t){const n=e.split(`
115
+ `}const Uc={children:[]},lS=3;function cS(e){const t=e.reduce((n,i)=>n+(i.width>0?i.width:0),0);if(t<=0){const n=1/Math.max(1,e.length);return e.map(i=>({...i,width:n}))}return e.map(n=>({...n,width:(n.width>0?n.width:0)/t}))}function uS(e,t){const n=new Set,i=[];for(const r of e.children){const o=[];for(const a of r.columns){const l=a.children.filter(c=>t.has(c.ref)?(n.add(c.ref),!0):!1);l.length&&o.push({...a,children:l})}o.length&&i.push({...r,columns:cS(o)})}const s=[...t].filter(r=>!n.has(r));return s.length&&i.push({type:"row",id:Md(),columns:[{id:jd(),width:1,children:s.map(r=>({ref:r}))}]}),{type:"stack",children:i}}function dS(e,t){const n={};for(const[i,s]of Object.entries(e.blocks))n[i]={id:i,type:s.type,content:t[i]??""};return n}function Jr(e,t,n,i,s,r,o,a,l,c){const d=new Set(c??Object.keys(i)),u={schema:$d,id:t,title:pl(e),createdAt:r,updatedAt:o,compiler:{version:Rd},root:uS(n,d),blocks:Object.fromEntries(Object.entries(i).map(([h,f])=>[h,{type:f}])),...a?{fmExtra:a}:{},...l&&l>0?{nextId:l}:{}};return{manifest:u,blocks:dS(u,s)}}async function fS(e,t,n,i){await e.writeFile(ml(t),pr(n,i.contents))}async function hS(e,t,n){const i=qi([]),s=Jr(t,hl(),Uc,{[i]:"markdown"},{[i]:""},n,n);return await fS(e,t,s.manifest,{contents:{[i]:""}}),s}function Hc(e,t,n){const i=Gr(t).replace(/^(?:[ \t]*\r?\n)+/,"").trimEnd(),s=qi([]);return Jr(e,hl(),Uc,{[s]:"markdown"},{[s]:i},n,n,Bc(t))}function pS(e,t,n,i){const s=Hc(e,t,i);return s.manifest.id=n.amadeus_page,s.manifest.schemaTooNew=!0,s}function mS(e,t,n,i){const s=gl(Gr(t)),r=Dg(n.amadeus_layout),o=Bc(t),a=Number.parseInt(n.amadeus_next_id??"",10),l=new Set;for(const p of s)p.id!=null&&l.add(p.id);let c=Number.isSafeInteger(a)&&a>0?a:void 0,d=!1;const u=new Set,h={},f={},m=[];for(const p of s){let y;if(p.id!=null&&p.id!=="__proto__"&&!u.has(p.id))u.add(p.id),y=p.id;else{y=qi(l,c);for(let w=2;l.has(y);w++)y=`${qi(l,c)}-${w}`;l.add(y),c=zd(c,y),d=!0}h[y]="markdown",f[y]=p.content,m.push(y)}return{page:Jr(e,n.amadeus_page,r,h,f,i,i,o,c,m),renumbered:d}}function Ri(e,t,n){const i=jc(t);if(!i.amadeus_page)return Hc(e,t,n);const s=rS(i);return s!=null&&s>lS?pS(e,t,i,n):mS(e,t,i,n).page}const gS=/^ {0,3}(`{3,}|~{3,}|\$\$)(.*)$/,bS=e=>e==="$$"?/^ {0,3}\$\$\s*$/:new RegExp(`^ {0,3}${e[0]==="`"?"`":"~"}{${e.length},}\\s*$`),yS=(e,t)=>e==="$$"?!t.includes("$"):e[0]==="`"?!t.includes("`"):!0,qc=/^(?:[-*+][ \t]|\d{1,9}[.)][ \t]|>)/;function Wc(e,t){const n=e.split(`
116
116
  `);let i=0;if(n[0]==="---"){for(i=1;i<n.length;i++)if(n[i]==="---"||n[i]==="..."){i++;break}}let s=null,r=!1;for(;i<n.length;i++){const o=n[i];if(s){bS(s).test(o)&&(s=null);continue}const a=gS.exec(o);if(a&&yS(a[1],a[2])){s=a[1];continue}const l=t(o);l!==o&&(n[i]=l,r=!0)}return r?n.join(`
117
117
  `):e}function wS(e){return e.includes(" ")?Wc(e,t=>{const n=/^(\t+)(.*)$/.exec(t);return!n||!n[2]||qc.test(n[2])?t:"&#9;".repeat(n[1].length)+n[2]}):e}function kS(e){return e.includes("&#")?Wc(e,t=>{const n=/^((?:&#[xX]?9;|\t)+)(?=.)(.*)$/.exec(t);if(n&&n[1].includes("&#")){if(qc.test(n[2]))return t;const s=(n[1].match(/&#|\t/g)??[]).length;return" ".repeat(s)+n[2]}const i=/^((?:> ?)+|(?:[-*+]|\d{1,9}[.)])[ \t]+)((?:&#[xX]?9;)+)(.*)$/.exec(t);return i?i[1]+i[3]:t}):e}const u_=8,Pa=/\[\[([^\]\n]+)\]\]/g,d_=/(?:^|\s)#([\p{L}\p{N}_/-]+)/gu;function Vc(e){const t=e.indexOf("|");return t>0&&e[t-1]==="\\"?t-1:t}function vS(e){let t=e.trim();const n=Vc(t);n>=0&&(t=t.slice(0,n));const i=t.indexOf("#");return i>=0&&(t=t.slice(0,i)),t.trim()}function f_(e){e=xS(e);const t=new RegExp(Pa.source,Pa.flags),n=[],i=new Set;let s;for(;s=t.exec(e);){const r=vS(s[1]);if(!r)continue;const o=r.toLowerCase();i.has(o)||(i.add(o),n.push(r))}return n}function fn(e){return(e.split(/[\\/]/).pop()??e).replace(/\.md$/i,"").trim().toLowerCase()}const Ni=e=>e.replace(/\\/g,"/"),Oa=e=>Ni(e).replace(/\.md$/i,"").trim().toLowerCase();function Li(e,t,n){const i=e.trim();if(!i)return null;if(/[\\/]/.test(i)){const r=Oa(i).replace(/^\/+/,"");return t.find(o=>Oa(o)===r)??null}const s=fn(i);if(!s)return null;if(n){const r=Ni(n),o=r.includes("/")?r.slice(0,r.lastIndexOf("/")+1):"",a=t.find(d=>{const u=Ni(d);return u.startsWith(o)&&!u.slice(o.length).includes("/")&&fn(d)===s});if(a)return a;const l=`${r.replace(/\.md$/i,"")}.fd/`.toLowerCase(),c=t.find(d=>Ni(d).toLowerCase().startsWith(l)&&fn(d)===s);if(c)return c}return t.find(r=>fn(r)===s)??null}const Zc=/^(?:[ \t]*(?:[-*+]|\d{1,9}[.)])[ \t]+|[ \t]*>[ \t]?)*[ \t]*(`{3,}|~{3,})([^\r\n]*)\r?$/;function Kc(e){const t=Zc.exec(e);return!t||t[1][0]==="`"&&t[2].includes("`")?null:{ch:t[1][0],n:t[1].length}}const Gc=(e,t)=>{const n=Zc.exec(e);return!!n&&n[1][0]===t.ch&&n[1].length>=t.n&&!n[2].trim()};function ri(e,t){const n=e.split(`
118
118
  `);for(let i=0;i<n.length;i++){const s=Kc(n[i]);if(s){let r=i+1;for(;r<n.length&&!Gc(n[r],s);)r++;if(r<n.length){i=r;continue}}n[i]=t(n[i])}return n.join(`
119
119
  `)}const SS="";function xS(e){if(!e.includes("`")&&!e.includes("~~~"))return e;const t=e.split(`
120
120
  `);for(let n=0;n<t.length;n++){const i=Kc(t[n]);if(i){let s=n+1;for(;s<t.length&&!Gc(t[s],i);)s++;if(s<t.length){for(let r=n;r<=s;r++)t[r]="";n=s;continue}}t[n].includes("`")&&(t[n]=Qr(t[n],s=>s,s=>SS.repeat(s.length)))}return t.join(`
121
- `)}function p_(e){return e.includes("\\[\\[")?ri(e,t=>t.replace(/\\\[\\\[/g,"[[")):e}function h_(e){return!e.includes("\\")&&!e.includes("<")?e:ri(e,t=>t.split(/(`+[^`]*`+)/).map((n,i)=>i%2===1?n:n.replace(new RegExp("(?<=[ps])\\\\:(?=\\/)","g"),":").replace(new RegExp("(?<=[Ww])\\\\\\.(?=[-.\\w])","g"),".").replace(new RegExp("(?<=[+\\-.\\w])\\\\@(?=[-.\\w])","g"),"@").replace(/(\[\[)<(https?:\/\/[^>\s\]]+)>/g,"$1$2")).join("").replace(/^<(https?:\/\/[^>\s]+)>$/,"$1"))}function _S(e){return!(e<9||e===11||e>13&&e<32||e>126&&e<160||e>55295&&e<57344||e>64975&&e<65008||(e&65535)===65535||(e&65535)===65534||e>1114111)}const CS=/&#(?:[xX]([0-9a-fA-F]{1,6})|([0-9]{1,7}));/g;function Qr(e,t,n=i=>i){let i="",s=0,r=0;for(;(r=e.indexOf("`",r))>=0;){let o=0;for(;e[r-1-o]==="\\";)o++;if(o%2){r++;continue}let a=0;for(;e[r+a]==="`";)a++;let l=r+a,c=-1;for(;(l=e.indexOf("`",l))>=0;){let d=0;for(;e[l+d]==="`";)d++;if(d===a){c=l;break}l+=d}if(c<0){r+=a;continue}i+=t(e.slice(s,r))+n(e.slice(r,c+a)),s=r=c+a}return i+t(e.slice(s))}function m_(e){if(!e.includes("&#"))return e;const t=n=>n.replace(CS,(i,s,r,o,a)=>{let l=0;for(;a[o-1-l]==="\\";)l++;if(l%2)return i;const c=s?parseInt(s,16):parseInt(r,10);return _S(c)?c===10||c===13?" ":String.fromCodePoint(c):i});return ri(e,n=>n.includes("&#")?Qr(n,t):n)}function AS(e){const t=Vc(e),n=t>=0?e.slice(e.indexOf("|",t)+1).trim():"";return n||(t>=0?e.slice(0,t):e).trim().replace(/\s*#\^?\s*/," › ").replace(/^ › /,"")}function g_(e){return e.replace(/^\s*(?:>\s*)*(?:(?:[-*+]|\d{1,9}[.)])\s+(?:\[[ xX]\]\s+)?|#{1,6}\s+)?/,"").replace(/!?\[\[([^\]\n]+)\]\]/g,(t,n)=>AS(n)).replace(/!?\[([^\]\n]*)\]\([^)\n]*\)/g,"$1").replace(/%%.*?%%/g,"").replace(/<\/?[A-Za-z][^>\n]*>/g,"").replace(new RegExp("(\\*\\*|__|~~|==)(?=\\S)(.+?)(?<=\\S)\\1","g"),"$2").replace(new RegExp("(^|[^\\p{L}\\p{N}*_])[*_](?=\\S)(.+?)(?<=\\S)[*_](?![\\p{L}\\p{N}*_])","gu"),"$1$2").replace(/(`+)([^`]*?)\1/g,"$2").replace(/\\([\\`*_{}[\]()#+\-.!~|>=])/g,"$1").replace(/\s\^[A-Za-z0-9-]+\s*$/,"").replace(/\s+/g," ").trim()}function $a(e){return e.replace(/^\uFEFF?---\r?\n(?:[\s\S]*?\r?\n)?---[ \t]*(?:\r?\n|$)/,"").replace(/<!--[\s\S]*?-->/g,"")}const Yc="amadeus-asset";function Fi(e,t){const n=e.replace(/\\/g,"/").replace(/\/+$/,""),i=t.replace(/\\/g,"/");return!n||n==="."?i:`${n}/${i}`.replace(/\/{2,}/g,"/")}function ES(e,t){const n=e.replace(/\\/g,"/").replace(/\/+$/,"");if(!n||n===".")return t;const i=`${n}/`;return t.startsWith(i)?t.slice(i.length):t}let Jc=e=>`${Yc}://v/${encodeURIComponent(e)}`;function Qc(e){Jc=e}function TS(e){return Jc(e).replace(/[()]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())}function IS(e){const t=`${Yc}://v/`;if(!e.startsWith(t))return null;try{return decodeURIComponent(e.slice(t.length))}catch{return null}}const Xc=/(!\[[^\]]*\]\()(<[^>\n]*>|[^)\s]+)((?:\s+"[^"]*")?\))/g;function PS(e){return e.replace(/[ ()<>]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())}function OS(e){return/^(https?:|data:|amadeus-asset:|blob:|\/)/.test(e)}function b_(e,t){const n=s=>s.replace(Xc,(r,o,a,l)=>{const c=(a.startsWith("<")?a.slice(1,-1):a).trim();return!c||OS(c)?r:o+TS(Fi(t,eu(c)))+l}),i=e.includes("![")?ri(e,s=>s.includes("![")?Qr(s,n):s):e;return wS(i)}function y_(e,t){return kS(e.replace(Xc,(n,i,s,r)=>{const o=IS(s.trim());return o==null?n:i+PS(ES(t,o))+r}))}function w_(e){const t=[],n=i=>{const s=i.split("|")[0].split("#")[0].trim().replace(/^<|>$/g,"");!s||/^[a-z][a-z0-9+.-]*:/i.test(s)||!/\.[a-z0-9]{1,12}$/i.test(s)||/\.md$/i.test(s)||t.includes(s)||t.push(s)};for(const i of e.matchAll(/!?\[\[([^\]\n]+)\]\]/g))n(i[1]);for(const i of e.matchAll(/!?\[[^\]\n]*\]\(([^)\s]+)/g))n(eu(i[1]));return t}function k_(e){return(e.split(/[\\/]/).pop()??e).toLowerCase()}function eu(e){try{return decodeURIComponent(e)}catch{return e}}const $S=".forsion-vault.md";function RS(e){const t=new RegExp(`^([^/]+)/${$S.replace(/\./g,"\\.")}$`);return[...new Set(e.map(n=>t.exec(n)?.[1]).filter(n=>!!n))].sort()}const Di=e=>e.replace(/\\/g,"/").normalize("NFC");function NS(e){const t=Di(e.path);return t?e.kind==="folder"?`${t}/`:e.kind==="page"?`${t.replace(/\.md$/i,"")}.fd/`:null:null}function v_(e,t,n){const i=Di(n);if(!i)return!1;if(e.some(s=>Di(s.path)===i))return!0;for(const s of t??[]){const r=Di(s);if(!r)continue;const o=`${r.replace(/\.md$/i,"")}.fd`;if(i===r||i.startsWith(`${r}/`)||i===o||i.startsWith(`${o}/`))return!1}return e.some(s=>{const r=NS(s);return!!r&&i.startsWith(r)})}const Xr=2,S_=["text","number","checkbox","date","select","multiselect","url"],Un="__page_name",eo=ql([Z(),Wt(),Gi(),Ne(Z()),sg()]),tu=je({colId:Z().min(1),op:Z().min(1),value:eo.optional()}),LS=je({id:Z().min(1),name:Z(),type:Z().min(1),options:Ne(Z()).optional(),optionLabels:dn(Z(),Z()).optional(),width:Wt().positive().optional(),formula:Z().optional(),refDb:Z().optional(),multiple:Gi().optional(),titleCol:Z().optional(),refFilter:Ne(tu).optional(),refFilterMode:yt(["and","or"]).optional(),lookupRel:Z().optional(),lookupBackCol:Z().optional(),lookupCol:Z().optional(),lookupAgg:Z().optional(),lookupKind:yt(["links"]).optional(),prefix:Z().optional(),precision:Wt().int().min(0).max(6).optional(),unitPrefix:Z().optional(),unitSuffix:Z().optional()}),FS=je({id:Z().min(1),cells:dn(Z(),eo),body:Z().optional()}),DS=je({id:Z().min(1),name:Z(),type:Z().min(1),openMode:yt(["side","center","full"]).optional(),groupBy:Z().optional(),groupUnit:yt(["day","month"]).optional(),groupSort:yt(["manual","asc","desc"]).optional(),groupOrder:Ne(Z()).optional(),groupHidden:Ne(Z()).optional(),groupHideEmpty:Gi().optional(),treeCol:Z().optional(),fold:je({by:Ne(Z()).optional(),timeCol:Z().optional(),minutes:Wt().positive().optional()}).optional(),chartKind:Z().optional(),agg:Z().optional(),valueCol:Z().optional(),dateCol:Z().optional(),filters:Ne(tu).optional(),filterMode:Z().optional(),sort:je({colId:Z().min(1),dir:yt(["asc","desc"])}).optional(),sorts:Ne(je({colId:Z().min(1),dir:yt(["asc","desc"])})).optional(),hidden:Ne(Z()).optional(),order:Ne(Z()).optional(),widths:dn(Z(),Wt().positive()).optional(),autoSize:Gi().optional(),stats:dn(Z(),Z()).optional(),form:je({required:Ne(Z()).optional(),defaults:dn(Z(),eo).optional(),desc:dn(Z(),Z()).optional(),title:Z().optional(),submitText:Z().optional(),after:yt(["stay","table"]).optional()}).optional(),gantt:je({startCol:Z().optional(),endCol:Z().optional(),scale:yt(["day","week"]).optional()}).optional()}),nu=je({version:Wt().int().min(1),name:Z(),source:je({folder:Z()}).optional(),columns:Ne(LS),rows:Ne(FS),views:Ne(DS).optional()}),Bs=()=>Math.random().toString(36).slice(2,10),zS={id:"v-default",name:"表格",type:"table"},x_=e=>e.views?.length?e.views:[zS],__=e=>e.sorts?.length?e.sorts:e.sort?[e.sort]:[];function C_(e){return{version:Xr,name:e,columns:[{id:Bs(),name:"标题",type:"text"},{id:Bs(),name:"文本",type:"text"}],rows:[{id:Bs(),cells:{}}]}}function A_(e,t){return{version:Xr,name:e,source:{folder:t},columns:[{id:Un,name:"Page Name",type:"page"}],rows:[]}}function iu(e){let t;try{t=JSON.parse(e)}catch{return{ok:!1,error:"JSON 解析失败"}}const n=nu.safeParse(t);return n.success?n.data.version>Xr?{ok:!1,error:`版本过新(v${n.data.version}),请升级应用`}:{ok:!0,data:su(n.data)}:{ok:!1,error:"不是有效的 Database 文件结构"}}function su(e){return e.version<2&&e.rows.some(t=>t.body!==void 0)?{...e,version:2}:e}function MS(e){return`${JSON.stringify(su(e),null,2)}
122
- `}function E_(e,t){switch(t){case"text":case"url":case"page":return typeof e=="string"?e:typeof e=="number"?String(e):Array.isArray(e)?e.join(", "):"";case"number":{if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){const n=Number.parseFloat(e);if(Number.isFinite(n))return n}return null}case"checkbox":return e===!0;case"date":return typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)?e:"";case"select":return typeof e=="string"?e:Array.isArray(e)?e[0]??"":"";case"multiselect":return Array.isArray(e)?e:typeof e=="string"&&e!==""?[e]:[]}}var Us={exports:{}},Ra;function jS(){return Ra||(Ra=1,(function(e){var t=(function(){var n=String.fromCharCode,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",r={};function o(l,c){if(!r[l]){r[l]={};for(var d=0;d<l.length;d++)r[l][l.charAt(d)]=d}return r[l][c]}var a={compressToBase64:function(l){if(l==null)return"";var c=a._compress(l,6,function(d){return i.charAt(d)});switch(c.length%4){default:case 0:return c;case 1:return c+"===";case 2:return c+"==";case 3:return c+"="}},decompressFromBase64:function(l){return l==null?"":l==""?null:a._decompress(l.length,32,function(c){return o(i,l.charAt(c))})},compressToUTF16:function(l){return l==null?"":a._compress(l,15,function(c){return n(c+32)})+" "},decompressFromUTF16:function(l){return l==null?"":l==""?null:a._decompress(l.length,16384,function(c){return l.charCodeAt(c)-32})},compressToUint8Array:function(l){for(var c=a.compress(l),d=new Uint8Array(c.length*2),u=0,p=c.length;u<p;u++){var f=c.charCodeAt(u);d[u*2]=f>>>8,d[u*2+1]=f%256}return d},decompressFromUint8Array:function(l){if(l==null)return a.decompress(l);for(var c=new Array(l.length/2),d=0,u=c.length;d<u;d++)c[d]=l[d*2]*256+l[d*2+1];var p=[];return c.forEach(function(f){p.push(n(f))}),a.decompress(p.join(""))},compressToEncodedURIComponent:function(l){return l==null?"":a._compress(l,6,function(c){return s.charAt(c)})},decompressFromEncodedURIComponent:function(l){return l==null?"":l==""?null:(l=l.replace(/ /g,"+"),a._decompress(l.length,32,function(c){return o(s,l.charAt(c))}))},compress:function(l){return a._compress(l,16,function(c){return n(c)})},_compress:function(l,c,d){if(l==null)return"";var u,p,f={},m={},h="",y="",w="",C=2,S=3,I=2,O=[],k=0,T=0,$;for($=0;$<l.length;$+=1)if(h=l.charAt($),Object.prototype.hasOwnProperty.call(f,h)||(f[h]=S++,m[h]=!0),y=w+h,Object.prototype.hasOwnProperty.call(f,y))w=y;else{if(Object.prototype.hasOwnProperty.call(m,w)){if(w.charCodeAt(0)<256){for(u=0;u<I;u++)k=k<<1,T==c-1?(T=0,O.push(d(k)),k=0):T++;for(p=w.charCodeAt(0),u=0;u<8;u++)k=k<<1|p&1,T==c-1?(T=0,O.push(d(k)),k=0):T++,p=p>>1}else{for(p=1,u=0;u<I;u++)k=k<<1|p,T==c-1?(T=0,O.push(d(k)),k=0):T++,p=0;for(p=w.charCodeAt(0),u=0;u<16;u++)k=k<<1|p&1,T==c-1?(T=0,O.push(d(k)),k=0):T++,p=p>>1}C--,C==0&&(C=Math.pow(2,I),I++),delete m[w]}else for(p=f[w],u=0;u<I;u++)k=k<<1|p&1,T==c-1?(T=0,O.push(d(k)),k=0):T++,p=p>>1;C--,C==0&&(C=Math.pow(2,I),I++),f[y]=S++,w=String(h)}if(w!==""){if(Object.prototype.hasOwnProperty.call(m,w)){if(w.charCodeAt(0)<256){for(u=0;u<I;u++)k=k<<1,T==c-1?(T=0,O.push(d(k)),k=0):T++;for(p=w.charCodeAt(0),u=0;u<8;u++)k=k<<1|p&1,T==c-1?(T=0,O.push(d(k)),k=0):T++,p=p>>1}else{for(p=1,u=0;u<I;u++)k=k<<1|p,T==c-1?(T=0,O.push(d(k)),k=0):T++,p=0;for(p=w.charCodeAt(0),u=0;u<16;u++)k=k<<1|p&1,T==c-1?(T=0,O.push(d(k)),k=0):T++,p=p>>1}C--,C==0&&(C=Math.pow(2,I),I++),delete m[w]}else for(p=f[w],u=0;u<I;u++)k=k<<1|p&1,T==c-1?(T=0,O.push(d(k)),k=0):T++,p=p>>1;C--,C==0&&(C=Math.pow(2,I),I++)}for(p=2,u=0;u<I;u++)k=k<<1|p&1,T==c-1?(T=0,O.push(d(k)),k=0):T++,p=p>>1;for(;;)if(k=k<<1,T==c-1){O.push(d(k));break}else T++;return O.join("")},decompress:function(l){return l==null?"":l==""?null:a._decompress(l.length,32768,function(c){return l.charCodeAt(c)})},_decompress:function(l,c,d){var u=[],p=4,f=4,m=3,h="",y=[],w,C,S,I,O,k,T,$={val:d(0),position:c,index:1};for(w=0;w<3;w+=1)u[w]=w;for(S=0,O=Math.pow(2,2),k=1;k!=O;)I=$.val&$.position,$.position>>=1,$.position==0&&($.position=c,$.val=d($.index++)),S|=(I>0?1:0)*k,k<<=1;switch(S){case 0:for(S=0,O=Math.pow(2,8),k=1;k!=O;)I=$.val&$.position,$.position>>=1,$.position==0&&($.position=c,$.val=d($.index++)),S|=(I>0?1:0)*k,k<<=1;T=n(S);break;case 1:for(S=0,O=Math.pow(2,16),k=1;k!=O;)I=$.val&$.position,$.position>>=1,$.position==0&&($.position=c,$.val=d($.index++)),S|=(I>0?1:0)*k,k<<=1;T=n(S);break;case 2:return""}for(u[3]=T,C=T,y.push(T);;){if($.index>l)return"";for(S=0,O=Math.pow(2,m),k=1;k!=O;)I=$.val&$.position,$.position>>=1,$.position==0&&($.position=c,$.val=d($.index++)),S|=(I>0?1:0)*k,k<<=1;switch(T=S){case 0:for(S=0,O=Math.pow(2,8),k=1;k!=O;)I=$.val&$.position,$.position>>=1,$.position==0&&($.position=c,$.val=d($.index++)),S|=(I>0?1:0)*k,k<<=1;u[f++]=n(S),T=f-1,p--;break;case 1:for(S=0,O=Math.pow(2,16),k=1;k!=O;)I=$.val&$.position,$.position>>=1,$.position==0&&($.position=c,$.val=d($.index++)),S|=(I>0?1:0)*k,k<<=1;u[f++]=n(S),T=f-1,p--;break;case 2:return y.join("")}if(p==0&&(p=Math.pow(2,m),m++),u[T])h=u[T];else if(T===f)h=C+C.charAt(0);else return null;y.push(h),u[f++]=C+h.charAt(0),p--,C=h,p==0&&(p=Math.pow(2,m),m++)}}};return a})();e!=null?e.exports=t:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return t})})(Us)),Us.exports}var ru=jS();function T_(e){return/\.excalidraw(\.md)?$/i.test(e)}const ou=/(\n##? Drawing\n[^`]*```json\n)([\s\S]*?)(```\n)/,au=/(\n##? Drawing\n[^`]*```compressed-json\n)([\s\S]*?)(```\n)/,lu=/```compressed-json\n/;function Na(e){const t=lu.test(e),n=(t?au:ou).exec(e);if(!n)return null;const i=t?ru.decompressFromBase64(qS(n[2])):n[2];if(!i)return null;const s=i.lastIndexOf("}");return s===-1?null:{sceneJson:i.slice(0,s+1),compressed:t}}function BS(e,t){const n=lu.test(e),i=(n?au:ou).exec(e);if(!i)return null;const s=n?HS(t):t;return e.slice(0,i.index)+i[1]+s+`
121
+ `)}function h_(e){return e.includes("\\[\\[")?ri(e,t=>t.replace(/\\\[\\\[/g,"[[")):e}function p_(e){return!e.includes("\\")&&!e.includes("<")?e:ri(e,t=>t.split(/(`+[^`]*`+)/).map((n,i)=>i%2===1?n:n.replace(new RegExp("(?<=[ps])\\\\:(?=\\/)","g"),":").replace(new RegExp("(?<=[Ww])\\\\\\.(?=[-.\\w])","g"),".").replace(new RegExp("(?<=[+\\-.\\w])\\\\@(?=[-.\\w])","g"),"@").replace(/(\[\[)<(https?:\/\/[^>\s\]]+)>/g,"$1$2")).join("").replace(/^<(https?:\/\/[^>\s]+)>$/,"$1"))}function _S(e){return!(e<9||e===11||e>13&&e<32||e>126&&e<160||e>55295&&e<57344||e>64975&&e<65008||(e&65535)===65535||(e&65535)===65534||e>1114111)}const CS=/&#(?:[xX]([0-9a-fA-F]{1,6})|([0-9]{1,7}));/g;function Qr(e,t,n=i=>i){let i="",s=0,r=0;for(;(r=e.indexOf("`",r))>=0;){let o=0;for(;e[r-1-o]==="\\";)o++;if(o%2){r++;continue}let a=0;for(;e[r+a]==="`";)a++;let l=r+a,c=-1;for(;(l=e.indexOf("`",l))>=0;){let d=0;for(;e[l+d]==="`";)d++;if(d===a){c=l;break}l+=d}if(c<0){r+=a;continue}i+=t(e.slice(s,r))+n(e.slice(r,c+a)),s=r=c+a}return i+t(e.slice(s))}function m_(e){if(!e.includes("&#"))return e;const t=n=>n.replace(CS,(i,s,r,o,a)=>{let l=0;for(;a[o-1-l]==="\\";)l++;if(l%2)return i;const c=s?parseInt(s,16):parseInt(r,10);return _S(c)?c===10||c===13?" ":String.fromCodePoint(c):i});return ri(e,n=>n.includes("&#")?Qr(n,t):n)}function AS(e){const t=Vc(e),n=t>=0?e.slice(e.indexOf("|",t)+1).trim():"";return n||(t>=0?e.slice(0,t):e).trim().replace(/\s*#\^?\s*/," › ").replace(/^ › /,"")}function g_(e){return e.replace(/^\s*(?:>\s*)*(?:(?:[-*+]|\d{1,9}[.)])\s+(?:\[[ xX]\]\s+)?|#{1,6}\s+)?/,"").replace(/!?\[\[([^\]\n]+)\]\]/g,(t,n)=>AS(n)).replace(/!?\[([^\]\n]*)\]\([^)\n]*\)/g,"$1").replace(/%%.*?%%/g,"").replace(/<\/?[A-Za-z][^>\n]*>/g,"").replace(new RegExp("(\\*\\*|__|~~|==)(?=\\S)(.+?)(?<=\\S)\\1","g"),"$2").replace(new RegExp("(^|[^\\p{L}\\p{N}*_])[*_](?=\\S)(.+?)(?<=\\S)[*_](?![\\p{L}\\p{N}*_])","gu"),"$1$2").replace(/(`+)([^`]*?)\1/g,"$2").replace(/\\([\\`*_{}[\]()#+\-.!~|>=])/g,"$1").replace(/\s\^[A-Za-z0-9-]+\s*$/,"").replace(/\s+/g," ").trim()}function $a(e){return e.replace(/^\uFEFF?---\r?\n(?:[\s\S]*?\r?\n)?---[ \t]*(?:\r?\n|$)/,"").replace(/<!--[\s\S]*?-->/g,"")}const Yc="amadeus-asset";function Fi(e,t){const n=e.replace(/\\/g,"/").replace(/\/+$/,""),i=t.replace(/\\/g,"/");return!n||n==="."?i:`${n}/${i}`.replace(/\/{2,}/g,"/")}function TS(e,t){const n=e.replace(/\\/g,"/").replace(/\/+$/,"");if(!n||n===".")return t;const i=`${n}/`;return t.startsWith(i)?t.slice(i.length):t}let Jc=e=>`${Yc}://v/${encodeURIComponent(e)}`;function Qc(e){Jc=e}function ES(e){return Jc(e).replace(/[()]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())}function IS(e){const t=`${Yc}://v/`;if(!e.startsWith(t))return null;try{return decodeURIComponent(e.slice(t.length))}catch{return null}}const Xc=/(!\[[^\]]*\]\()(<[^>\n]*>|[^)\s]+)((?:\s+"[^"]*")?\))/g;function PS(e){return e.replace(/[ ()<>]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())}function OS(e){return/^(https?:|data:|amadeus-asset:|blob:|\/)/.test(e)}function b_(e,t){const n=s=>s.replace(Xc,(r,o,a,l)=>{const c=(a.startsWith("<")?a.slice(1,-1):a).trim();return!c||OS(c)?r:o+ES(Fi(t,eu(c)))+l}),i=e.includes("![")?ri(e,s=>s.includes("![")?Qr(s,n):s):e;return wS(i)}function y_(e,t){return kS(e.replace(Xc,(n,i,s,r)=>{const o=IS(s.trim());return o==null?n:i+PS(TS(t,o))+r}))}function w_(e){const t=[],n=i=>{const s=i.split("|")[0].split("#")[0].trim().replace(/^<|>$/g,"");!s||/^[a-z][a-z0-9+.-]*:/i.test(s)||!/\.[a-z0-9]{1,12}$/i.test(s)||/\.md$/i.test(s)||t.includes(s)||t.push(s)};for(const i of e.matchAll(/!?\[\[([^\]\n]+)\]\]/g))n(i[1]);for(const i of e.matchAll(/!?\[[^\]\n]*\]\(([^)\s]+)/g))n(eu(i[1]));return t}function k_(e){return(e.split(/[\\/]/).pop()??e).toLowerCase()}function eu(e){try{return decodeURIComponent(e)}catch{return e}}const $S=".forsion-vault.md";function RS(e){const t=new RegExp(`^([^/]+)/${$S.replace(/\./g,"\\.")}$`);return[...new Set(e.map(n=>t.exec(n)?.[1]).filter(n=>!!n))].sort()}const Di=e=>e.replace(/\\/g,"/").normalize("NFC");function NS(e){const t=Di(e.path);return t?e.kind==="folder"?`${t}/`:e.kind==="page"?`${t.replace(/\.md$/i,"")}.fd/`:null:null}function v_(e,t,n){const i=Di(n);if(!i)return!1;if(e.some(s=>Di(s.path)===i))return!0;for(const s of t??[]){const r=Di(s);if(!r)continue;const o=`${r.replace(/\.md$/i,"")}.fd`;if(i===r||i.startsWith(`${r}/`)||i===o||i.startsWith(`${o}/`))return!1}return e.some(s=>{const r=NS(s);return!!r&&i.startsWith(r)})}const Xr=2,S_=["text","number","checkbox","date","select","multiselect","url"],Un="__page_name",eo=ql([Z(),Wt(),Gi(),Ne(Z()),sg()]),tu=je({colId:Z().min(1),op:Z().min(1),value:eo.optional()}),LS=je({id:Z().min(1),name:Z(),type:Z().min(1),options:Ne(Z()).optional(),optionLabels:dn(Z(),Z()).optional(),width:Wt().positive().optional(),formula:Z().optional(),refDb:Z().optional(),multiple:Gi().optional(),titleCol:Z().optional(),refFilter:Ne(tu).optional(),refFilterMode:yt(["and","or"]).optional(),lookupRel:Z().optional(),lookupBackCol:Z().optional(),lookupCol:Z().optional(),lookupAgg:Z().optional(),lookupKind:yt(["links"]).optional(),prefix:Z().optional(),precision:Wt().int().min(0).max(6).optional(),unitPrefix:Z().optional(),unitSuffix:Z().optional()}),FS=je({id:Z().min(1),cells:dn(Z(),eo),body:Z().optional()}),DS=je({id:Z().min(1),name:Z(),type:Z().min(1),openMode:yt(["side","center","full"]).optional(),groupBy:Z().optional(),groupUnit:yt(["day","month"]).optional(),groupSort:yt(["manual","asc","desc"]).optional(),groupOrder:Ne(Z()).optional(),groupHidden:Ne(Z()).optional(),groupHideEmpty:Gi().optional(),treeCol:Z().optional(),fold:je({by:Ne(Z()).optional(),timeCol:Z().optional(),minutes:Wt().positive().optional()}).optional(),chartKind:Z().optional(),agg:Z().optional(),valueCol:Z().optional(),dateCol:Z().optional(),filters:Ne(tu).optional(),filterMode:Z().optional(),sort:je({colId:Z().min(1),dir:yt(["asc","desc"])}).optional(),sorts:Ne(je({colId:Z().min(1),dir:yt(["asc","desc"])})).optional(),hidden:Ne(Z()).optional(),order:Ne(Z()).optional(),widths:dn(Z(),Wt().positive()).optional(),autoSize:Gi().optional(),stats:dn(Z(),Z()).optional(),form:je({required:Ne(Z()).optional(),defaults:dn(Z(),eo).optional(),desc:dn(Z(),Z()).optional(),title:Z().optional(),submitText:Z().optional(),after:yt(["stay","table"]).optional()}).optional(),gantt:je({startCol:Z().optional(),endCol:Z().optional(),scale:yt(["day","week"]).optional()}).optional()}),nu=je({version:Wt().int().min(1),name:Z(),source:je({folder:Z()}).optional(),columns:Ne(LS),rows:Ne(FS),views:Ne(DS).optional()}),Bs=()=>Math.random().toString(36).slice(2,10),zS={id:"v-default",name:"表格",type:"table"},x_=e=>e.views?.length?e.views:[zS],__=e=>e.sorts?.length?e.sorts:e.sort?[e.sort]:[];function C_(e){return{version:Xr,name:e,columns:[{id:Bs(),name:"标题",type:"text"},{id:Bs(),name:"文本",type:"text"}],rows:[{id:Bs(),cells:{}}]}}function A_(e,t){return{version:Xr,name:e,source:{folder:t},columns:[{id:Un,name:"Page Name",type:"page"}],rows:[]}}function iu(e){let t;try{t=JSON.parse(e)}catch{return{ok:!1,error:"JSON 解析失败"}}const n=nu.safeParse(t);return n.success?n.data.version>Xr?{ok:!1,error:`版本过新(v${n.data.version}),请升级应用`}:{ok:!0,data:su(n.data)}:{ok:!1,error:"不是有效的 Database 文件结构"}}function su(e){return e.version<2&&e.rows.some(t=>t.body!==void 0)?{...e,version:2}:e}function MS(e){return`${JSON.stringify(su(e),null,2)}
122
+ `}function T_(e,t){switch(t){case"text":case"url":case"page":return typeof e=="string"?e:typeof e=="number"?String(e):Array.isArray(e)?e.join(", "):"";case"number":{if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){const n=Number.parseFloat(e);if(Number.isFinite(n))return n}return null}case"checkbox":return e===!0;case"date":return typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)?e:"";case"select":return typeof e=="string"?e:Array.isArray(e)?e[0]??"":"";case"multiselect":return Array.isArray(e)?e:typeof e=="string"&&e!==""?[e]:[]}}var Us={exports:{}},Ra;function jS(){return Ra||(Ra=1,(function(e){var t=(function(){var n=String.fromCharCode,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",r={};function o(l,c){if(!r[l]){r[l]={};for(var d=0;d<l.length;d++)r[l][l.charAt(d)]=d}return r[l][c]}var a={compressToBase64:function(l){if(l==null)return"";var c=a._compress(l,6,function(d){return i.charAt(d)});switch(c.length%4){default:case 0:return c;case 1:return c+"===";case 2:return c+"==";case 3:return c+"="}},decompressFromBase64:function(l){return l==null?"":l==""?null:a._decompress(l.length,32,function(c){return o(i,l.charAt(c))})},compressToUTF16:function(l){return l==null?"":a._compress(l,15,function(c){return n(c+32)})+" "},decompressFromUTF16:function(l){return l==null?"":l==""?null:a._decompress(l.length,16384,function(c){return l.charCodeAt(c)-32})},compressToUint8Array:function(l){for(var c=a.compress(l),d=new Uint8Array(c.length*2),u=0,h=c.length;u<h;u++){var f=c.charCodeAt(u);d[u*2]=f>>>8,d[u*2+1]=f%256}return d},decompressFromUint8Array:function(l){if(l==null)return a.decompress(l);for(var c=new Array(l.length/2),d=0,u=c.length;d<u;d++)c[d]=l[d*2]*256+l[d*2+1];var h=[];return c.forEach(function(f){h.push(n(f))}),a.decompress(h.join(""))},compressToEncodedURIComponent:function(l){return l==null?"":a._compress(l,6,function(c){return s.charAt(c)})},decompressFromEncodedURIComponent:function(l){return l==null?"":l==""?null:(l=l.replace(/ /g,"+"),a._decompress(l.length,32,function(c){return o(s,l.charAt(c))}))},compress:function(l){return a._compress(l,16,function(c){return n(c)})},_compress:function(l,c,d){if(l==null)return"";var u,h,f={},m={},p="",y="",w="",C=2,S=3,I=2,O=[],k=0,E=0,$;for($=0;$<l.length;$+=1)if(p=l.charAt($),Object.prototype.hasOwnProperty.call(f,p)||(f[p]=S++,m[p]=!0),y=w+p,Object.prototype.hasOwnProperty.call(f,y))w=y;else{if(Object.prototype.hasOwnProperty.call(m,w)){if(w.charCodeAt(0)<256){for(u=0;u<I;u++)k=k<<1,E==c-1?(E=0,O.push(d(k)),k=0):E++;for(h=w.charCodeAt(0),u=0;u<8;u++)k=k<<1|h&1,E==c-1?(E=0,O.push(d(k)),k=0):E++,h=h>>1}else{for(h=1,u=0;u<I;u++)k=k<<1|h,E==c-1?(E=0,O.push(d(k)),k=0):E++,h=0;for(h=w.charCodeAt(0),u=0;u<16;u++)k=k<<1|h&1,E==c-1?(E=0,O.push(d(k)),k=0):E++,h=h>>1}C--,C==0&&(C=Math.pow(2,I),I++),delete m[w]}else for(h=f[w],u=0;u<I;u++)k=k<<1|h&1,E==c-1?(E=0,O.push(d(k)),k=0):E++,h=h>>1;C--,C==0&&(C=Math.pow(2,I),I++),f[y]=S++,w=String(p)}if(w!==""){if(Object.prototype.hasOwnProperty.call(m,w)){if(w.charCodeAt(0)<256){for(u=0;u<I;u++)k=k<<1,E==c-1?(E=0,O.push(d(k)),k=0):E++;for(h=w.charCodeAt(0),u=0;u<8;u++)k=k<<1|h&1,E==c-1?(E=0,O.push(d(k)),k=0):E++,h=h>>1}else{for(h=1,u=0;u<I;u++)k=k<<1|h,E==c-1?(E=0,O.push(d(k)),k=0):E++,h=0;for(h=w.charCodeAt(0),u=0;u<16;u++)k=k<<1|h&1,E==c-1?(E=0,O.push(d(k)),k=0):E++,h=h>>1}C--,C==0&&(C=Math.pow(2,I),I++),delete m[w]}else for(h=f[w],u=0;u<I;u++)k=k<<1|h&1,E==c-1?(E=0,O.push(d(k)),k=0):E++,h=h>>1;C--,C==0&&(C=Math.pow(2,I),I++)}for(h=2,u=0;u<I;u++)k=k<<1|h&1,E==c-1?(E=0,O.push(d(k)),k=0):E++,h=h>>1;for(;;)if(k=k<<1,E==c-1){O.push(d(k));break}else E++;return O.join("")},decompress:function(l){return l==null?"":l==""?null:a._decompress(l.length,32768,function(c){return l.charCodeAt(c)})},_decompress:function(l,c,d){var u=[],h=4,f=4,m=3,p="",y=[],w,C,S,I,O,k,E,$={val:d(0),position:c,index:1};for(w=0;w<3;w+=1)u[w]=w;for(S=0,O=Math.pow(2,2),k=1;k!=O;)I=$.val&$.position,$.position>>=1,$.position==0&&($.position=c,$.val=d($.index++)),S|=(I>0?1:0)*k,k<<=1;switch(S){case 0:for(S=0,O=Math.pow(2,8),k=1;k!=O;)I=$.val&$.position,$.position>>=1,$.position==0&&($.position=c,$.val=d($.index++)),S|=(I>0?1:0)*k,k<<=1;E=n(S);break;case 1:for(S=0,O=Math.pow(2,16),k=1;k!=O;)I=$.val&$.position,$.position>>=1,$.position==0&&($.position=c,$.val=d($.index++)),S|=(I>0?1:0)*k,k<<=1;E=n(S);break;case 2:return""}for(u[3]=E,C=E,y.push(E);;){if($.index>l)return"";for(S=0,O=Math.pow(2,m),k=1;k!=O;)I=$.val&$.position,$.position>>=1,$.position==0&&($.position=c,$.val=d($.index++)),S|=(I>0?1:0)*k,k<<=1;switch(E=S){case 0:for(S=0,O=Math.pow(2,8),k=1;k!=O;)I=$.val&$.position,$.position>>=1,$.position==0&&($.position=c,$.val=d($.index++)),S|=(I>0?1:0)*k,k<<=1;u[f++]=n(S),E=f-1,h--;break;case 1:for(S=0,O=Math.pow(2,16),k=1;k!=O;)I=$.val&$.position,$.position>>=1,$.position==0&&($.position=c,$.val=d($.index++)),S|=(I>0?1:0)*k,k<<=1;u[f++]=n(S),E=f-1,h--;break;case 2:return y.join("")}if(h==0&&(h=Math.pow(2,m),m++),u[E])p=u[E];else if(E===f)p=C+C.charAt(0);else return null;y.push(p),u[f++]=C+p.charAt(0),h--,C=p,h==0&&(h=Math.pow(2,m),m++)}}};return a})();e!=null?e.exports=t:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return t})})(Us)),Us.exports}var ru=jS();function E_(e){return/\.excalidraw(\.md)?$/i.test(e)}const ou=/(\n##? Drawing\n[^`]*```json\n)([\s\S]*?)(```\n)/,au=/(\n##? Drawing\n[^`]*```compressed-json\n)([\s\S]*?)(```\n)/,lu=/```compressed-json\n/;function Na(e){const t=lu.test(e),n=(t?au:ou).exec(e);if(!n)return null;const i=t?ru.decompressFromBase64(qS(n[2])):n[2];if(!i)return null;const s=i.lastIndexOf("}");return s===-1?null:{sceneJson:i.slice(0,s+1),compressed:t}}function BS(e,t){const n=lu.test(e),i=(n?au:ou).exec(e);if(!i)return null;const s=n?HS(t):t;return e.slice(0,i.index)+i[1]+s+`
123
123
  `+i[3]+e.slice(i.index+i[0].length)}const US=["---","","excalidraw-plugin: parsed","tags: [excalidraw]","","---","==⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠== You can decompress Drawing data with the command palette: 'Decompress current Excalidraw file'. For more info check in plugin settings under 'Saving'","",""].join(`
124
124
  `);function I_(e){return`${US}
125
125
  ## Drawing
@@ -128,90 +128,90 @@ ${e}
128
128
  \`\`\`
129
129
  %%`}const P_='{"type":"excalidraw","version":2,"source":"Forsion Amadeus","elements":[],"appState":{"gridSize":null,"viewBackgroundColor":"#ffffff"}}';function HS(e){const t=ru.compressToBase64(e);let n="";for(let i=0;i<t.length;i+=256)n+=`${t.slice(i,i+256)}
130
130
 
131
- `;return n.trim()}const qS=e=>e.replace(/[\n\r]/g,""),WS=(e,t)=>{const n=e.version??0,i=t.version??0;return n!==i?n>i:(e.versionNonce??0)<=(t.versionNonce??0)},vi=e=>typeof e.index=="string"?e.index:"￿";function VS(e,t){const n=new Map;for(const i of t)i&&typeof i.id=="string"&&n.set(i.id,i);for(const i of e){if(!i||typeof i.id!="string")continue;const s=n.get(i.id);(!s||WS(i,s))&&n.set(i.id,i)}return[...n.values()].sort((i,s)=>vi(i)<vi(s)?-1:vi(i)>vi(s)?1:0)}function O_(e,t){if(e.length!==t.length)return!1;const n=new Map(e.map(i=>[i.id,i]));for(const i of t){const s=n.get(i.id);if(!s||(s.version??0)!==(i.version??0)||(s.versionNonce??0)!==(i.versionNonce??0))return!1}return!0}function ZS(e,t){return{...t,...e,elements:VS(e.elements??[],t.elements??[]),appState:e.appState??t.appState??{},files:{...t.files??{},...e.files??{}}}}const to=Symbol.for("yaml.alias"),mr=Symbol.for("yaml.document"),$t=Symbol.for("yaml.map"),cu=Symbol.for("yaml.pair"),wt=Symbol.for("yaml.scalar"),In=Symbol.for("yaml.seq"),ot=Symbol.for("yaml.node.type"),Pn=e=>!!e&&typeof e=="object"&&e[ot]===to,oi=e=>!!e&&typeof e=="object"&&e[ot]===mr,On=e=>!!e&&typeof e=="object"&&e[ot]===$t,Te=e=>!!e&&typeof e=="object"&&e[ot]===cu,be=e=>!!e&&typeof e=="object"&&e[ot]===wt,$n=e=>!!e&&typeof e=="object"&&e[ot]===In;function Ae(e){if(e&&typeof e=="object")switch(e[ot]){case $t:case In:return!0}return!1}function Ee(e){if(e&&typeof e=="object")switch(e[ot]){case to:case $t:case wt:case In:return!0}return!1}const uu=e=>(be(e)||Ae(e))&&!!e.anchor,Bt=Symbol("break visit"),KS=Symbol("skip children"),Kn=Symbol("remove node");function Rn(e,t){const n=GS(t);oi(e)?pn(null,e.contents,n,Object.freeze([e]))===Kn&&(e.contents=null):pn(null,e,n,Object.freeze([]))}Rn.BREAK=Bt;Rn.SKIP=KS;Rn.REMOVE=Kn;function pn(e,t,n,i){const s=YS(e,t,n,i);if(Ee(s)||Te(s))return JS(e,i,s),pn(e,s,n,i);if(typeof s!="symbol"){if(Ae(t)){i=Object.freeze(i.concat(t));for(let r=0;r<t.items.length;++r){const o=pn(r,t.items[r],n,i);if(typeof o=="number")r=o-1;else{if(o===Bt)return Bt;o===Kn&&(t.items.splice(r,1),r-=1)}}}else if(Te(t)){i=Object.freeze(i.concat(t));const r=pn("key",t.key,n,i);if(r===Bt)return Bt;r===Kn&&(t.key=null);const o=pn("value",t.value,n,i);if(o===Bt)return Bt;o===Kn&&(t.value=null)}}return s}function GS(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function YS(e,t,n,i){if(typeof n=="function")return n(e,t,i);if(On(t))return n.Map?.(e,t,i);if($n(t))return n.Seq?.(e,t,i);if(Te(t))return n.Pair?.(e,t,i);if(be(t))return n.Scalar?.(e,t,i);if(Pn(t))return n.Alias?.(e,t,i)}function JS(e,t,n){const i=t[t.length-1];if(Ae(i))i.items[e]=n;else if(Te(i))e==="key"?i.key=n:i.value=n;else if(oi(i))i.contents=n;else{const s=Pn(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const QS={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},XS=e=>e.replace(/[!,[\]{}]/g,t=>QS[t]);class Me{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Me.defaultYaml,t),this.tags=Object.assign({},Me.defaultTags,n)}clone(){const t=new Me(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Me(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Me.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Me.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Me.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Me.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),s=i.shift();switch(s){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[r,o]=i;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[r]=i;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return n(6,`Unsupported YAML version ${r}`,o),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,i,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const r=this.tags[i];if(r)try{return r+decodeURIComponent(s)}catch(o){return n(String(o)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+XS(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let s;if(t&&i.length>0&&Ee(t.contents)){const r={};Rn(t.contents,(o,a)=>{Ee(a)&&a.tag&&(r[a.tag]=!0)}),s=Object.keys(r)}else s=[];for(const[r,o]of i)r==="!!"&&o==="tag:yaml.org,2002:"||(!t||s.some(a=>a.startsWith(o)))&&n.push(`%TAG ${r} ${o}`);return n.join(`
132
- `)}}Me.defaultYaml={explicit:!1,version:"1.2"};Me.defaultTags={"!!":"tag:yaml.org,2002:"};function du(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function fu(e){const t=new Set;return Rn(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function pu(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function ex(e,t){const n=[],i=new Map;let s=null;return{onAnchor:r=>{n.push(r),s??(s=fu(e));const o=pu(t,s);return s.add(o),o},setAnchors:()=>{for(const r of n){const o=i.get(r);if(typeof o=="object"&&o.anchor&&(be(o.node)||Ae(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:i}}function hn(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let s=0,r=i.length;s<r;++s){const o=i[s],a=hn(e,i,String(s),o);a===void 0?delete i[s]:a!==o&&(i[s]=a)}else if(i instanceof Map)for(const s of Array.from(i.keys())){const r=i.get(s),o=hn(e,i,s,r);o===void 0?i.delete(s):o!==r&&i.set(s,o)}else if(i instanceof Set)for(const s of Array.from(i)){const r=hn(e,i,s,s);r===void 0?i.delete(s):r!==s&&(i.delete(s),i.add(r))}else for(const[s,r]of Object.entries(i)){const o=hn(e,i,s,r);o===void 0?delete i[s]:o!==r&&(i[s]=o)}return e.call(t,n,i)}function rt(e,t,n){if(Array.isArray(e))return e.map((i,s)=>rt(i,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!uu(e))return e.toJSON(t,n);const i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=r=>{i.res=r,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!n?.keep?Number(e):e}class no{constructor(t){Object.defineProperty(this,ot,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:s,reviver:r}={}){if(!oi(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=rt(this,"",o);if(typeof s=="function")for(const{count:l,res:c}of o.anchors.values())s(c,l);return typeof r=="function"?hn(r,{"":a},"",a):a}}class io extends no{constructor(t){super(to),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],Rn(t,{Node:(r,o)=>{(Pn(o)||uu(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let s;for(const r of i){if(r===this)break;r.anchor===this.source&&(s=r)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:i,doc:s,maxAliasCount:r}=n,o=this.resolve(s,n);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=i.get(o);if(a||(rt(o,null,n),a=i.get(o)),a?.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=zi(s,o,i)),a.count*a.aliasCount>r)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(t,n,i){const s=`*${this.source}`;if(t){if(du(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(t.implicitKey)return`${s} `}return s}}function zi(e,t,n){if(Pn(t)){const i=t.resolve(e),s=n&&i&&n.get(i);return s?s.count*s.aliasCount:0}else if(Ae(t)){let i=0;for(const s of t.items){const r=zi(e,s,n);r>i&&(i=r)}return i}else if(Te(t)){const i=zi(e,t.key,n),s=zi(e,t.value,n);return Math.max(i,s)}return 1}const hu=e=>!e||typeof e!="function"&&typeof e!="object";class ie extends no{constructor(t){super(wt),this.value=t}toJSON(t,n){return n?.keep?this.value:rt(this.value,t,n)}toString(){return String(this.value)}}ie.BLOCK_FOLDED="BLOCK_FOLDED";ie.BLOCK_LITERAL="BLOCK_LITERAL";ie.PLAIN="PLAIN";ie.QUOTE_DOUBLE="QUOTE_DOUBLE";ie.QUOTE_SINGLE="QUOTE_SINGLE";const tx="tag:yaml.org,2002:";function nx(e,t,n){if(t){const i=n.filter(r=>r.tag===t),s=i.find(r=>!r.format)??i[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(i=>i.identify?.(e)&&!i.format)}function Xn(e,t,n){if(oi(e)&&(e=e.contents),Ee(e))return e;if(Te(e)){const u=n.schema[$t].createNode?.(n.schema,null,n);return u.items.push(e),u}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:i,onAnchor:s,onTagObj:r,schema:o,sourceObjects:a}=n;let l;if(i&&e&&typeof e=="object"){if(l=a.get(e),l)return l.anchor??(l.anchor=s(e)),new io(l.anchor);l={anchor:null,node:null},a.set(e,l)}t?.startsWith("!!")&&(t=tx+t.slice(2));let c=nx(e,t,o.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const u=new ie(e);return l&&(l.node=u),u}c=e instanceof Map?o[$t]:Symbol.iterator in Object(e)?o[In]:o[$t]}r&&(r(c),delete n.onTagObj);const d=c?.createNode?c.createNode(n.schema,e,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,e,n):new ie(e);return t?d.tag=t:c.default||(d.tag=c.tag),l&&(l.node=d),d}function Qi(e,t,n){let i=n;for(let s=t.length-1;s>=0;--s){const r=t[s];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=i,i=o}else i=new Map([[r,i]])}return Xn(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Hn=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class mu extends no{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>Ee(i)||Te(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Hn(t))this.add(n);else{const[i,...s]=t,r=this.get(i,!0);if(Ae(r))r.addIn(s,n);else if(r===void 0&&this.schema)this.set(i,Qi(this.schema,s,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${s}`)}}deleteIn(t){const[n,...i]=t;if(i.length===0)return this.delete(n);const s=this.get(n,!0);if(Ae(s))return s.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){const[i,...s]=t,r=this.get(i,!0);return s.length===0?!n&&be(r)?r.value:r:Ae(r)?r.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Te(n))return!1;const i=n.value;return i==null||t&&be(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){const[n,...i]=t;if(i.length===0)return this.has(n);const s=this.get(n,!0);return Ae(s)?s.hasIn(i):!1}setIn(t,n){const[i,...s]=t;if(s.length===0)this.set(i,n);else{const r=this.get(i,!0);if(Ae(r))r.setIn(s,n);else if(r===void 0&&this.schema)this.set(i,Qi(this.schema,s,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${s}`)}}}const ix=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function _t(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Ht=(e,t,n)=>e.endsWith(`
131
+ `;return n.trim()}const qS=e=>e.replace(/[\n\r]/g,""),WS=(e,t)=>{const n=e.version??0,i=t.version??0;return n!==i?n>i:(e.versionNonce??0)<=(t.versionNonce??0)},vi=e=>typeof e.index=="string"?e.index:"￿";function VS(e,t){const n=new Map;for(const i of t)i&&typeof i.id=="string"&&n.set(i.id,i);for(const i of e){if(!i||typeof i.id!="string")continue;const s=n.get(i.id);(!s||WS(i,s))&&n.set(i.id,i)}return[...n.values()].sort((i,s)=>vi(i)<vi(s)?-1:vi(i)>vi(s)?1:0)}function O_(e,t){if(e.length!==t.length)return!1;const n=new Map(e.map(i=>[i.id,i]));for(const i of t){const s=n.get(i.id);if(!s||(s.version??0)!==(i.version??0)||(s.versionNonce??0)!==(i.versionNonce??0))return!1}return!0}function ZS(e,t){return{...t,...e,elements:VS(e.elements??[],t.elements??[]),appState:e.appState??t.appState??{},files:{...t.files??{},...e.files??{}}}}const to=Symbol.for("yaml.alias"),mr=Symbol.for("yaml.document"),$t=Symbol.for("yaml.map"),cu=Symbol.for("yaml.pair"),wt=Symbol.for("yaml.scalar"),In=Symbol.for("yaml.seq"),ot=Symbol.for("yaml.node.type"),Pn=e=>!!e&&typeof e=="object"&&e[ot]===to,oi=e=>!!e&&typeof e=="object"&&e[ot]===mr,On=e=>!!e&&typeof e=="object"&&e[ot]===$t,Ee=e=>!!e&&typeof e=="object"&&e[ot]===cu,be=e=>!!e&&typeof e=="object"&&e[ot]===wt,$n=e=>!!e&&typeof e=="object"&&e[ot]===In;function Ae(e){if(e&&typeof e=="object")switch(e[ot]){case $t:case In:return!0}return!1}function Te(e){if(e&&typeof e=="object")switch(e[ot]){case to:case $t:case wt:case In:return!0}return!1}const uu=e=>(be(e)||Ae(e))&&!!e.anchor,Bt=Symbol("break visit"),KS=Symbol("skip children"),Kn=Symbol("remove node");function Rn(e,t){const n=GS(t);oi(e)?hn(null,e.contents,n,Object.freeze([e]))===Kn&&(e.contents=null):hn(null,e,n,Object.freeze([]))}Rn.BREAK=Bt;Rn.SKIP=KS;Rn.REMOVE=Kn;function hn(e,t,n,i){const s=YS(e,t,n,i);if(Te(s)||Ee(s))return JS(e,i,s),hn(e,s,n,i);if(typeof s!="symbol"){if(Ae(t)){i=Object.freeze(i.concat(t));for(let r=0;r<t.items.length;++r){const o=hn(r,t.items[r],n,i);if(typeof o=="number")r=o-1;else{if(o===Bt)return Bt;o===Kn&&(t.items.splice(r,1),r-=1)}}}else if(Ee(t)){i=Object.freeze(i.concat(t));const r=hn("key",t.key,n,i);if(r===Bt)return Bt;r===Kn&&(t.key=null);const o=hn("value",t.value,n,i);if(o===Bt)return Bt;o===Kn&&(t.value=null)}}return s}function GS(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function YS(e,t,n,i){if(typeof n=="function")return n(e,t,i);if(On(t))return n.Map?.(e,t,i);if($n(t))return n.Seq?.(e,t,i);if(Ee(t))return n.Pair?.(e,t,i);if(be(t))return n.Scalar?.(e,t,i);if(Pn(t))return n.Alias?.(e,t,i)}function JS(e,t,n){const i=t[t.length-1];if(Ae(i))i.items[e]=n;else if(Ee(i))e==="key"?i.key=n:i.value=n;else if(oi(i))i.contents=n;else{const s=Pn(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const QS={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},XS=e=>e.replace(/[!,[\]{}]/g,t=>QS[t]);class Me{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Me.defaultYaml,t),this.tags=Object.assign({},Me.defaultTags,n)}clone(){const t=new Me(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Me(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Me.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Me.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Me.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Me.defaultTags),this.atNextDocument=!1);const i=t.trim().split(/[ \t]+/),s=i.shift();switch(s){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[r,o]=i;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[r]=i;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const o=/^\d+\.\d+$/.test(r);return n(6,`Unsupported YAML version ${r}`,o),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,i,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const r=this.tags[i];if(r)try{return r+decodeURIComponent(s)}catch(o){return n(String(o)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+XS(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let s;if(t&&i.length>0&&Te(t.contents)){const r={};Rn(t.contents,(o,a)=>{Te(a)&&a.tag&&(r[a.tag]=!0)}),s=Object.keys(r)}else s=[];for(const[r,o]of i)r==="!!"&&o==="tag:yaml.org,2002:"||(!t||s.some(a=>a.startsWith(o)))&&n.push(`%TAG ${r} ${o}`);return n.join(`
132
+ `)}}Me.defaultYaml={explicit:!1,version:"1.2"};Me.defaultTags={"!!":"tag:yaml.org,2002:"};function du(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function fu(e){const t=new Set;return Rn(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function hu(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function ex(e,t){const n=[],i=new Map;let s=null;return{onAnchor:r=>{n.push(r),s??(s=fu(e));const o=hu(t,s);return s.add(o),o},setAnchors:()=>{for(const r of n){const o=i.get(r);if(typeof o=="object"&&o.anchor&&(be(o.node)||Ae(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=r,a}}},sourceObjects:i}}function pn(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let s=0,r=i.length;s<r;++s){const o=i[s],a=pn(e,i,String(s),o);a===void 0?delete i[s]:a!==o&&(i[s]=a)}else if(i instanceof Map)for(const s of Array.from(i.keys())){const r=i.get(s),o=pn(e,i,s,r);o===void 0?i.delete(s):o!==r&&i.set(s,o)}else if(i instanceof Set)for(const s of Array.from(i)){const r=pn(e,i,s,s);r===void 0?i.delete(s):r!==s&&(i.delete(s),i.add(r))}else for(const[s,r]of Object.entries(i)){const o=pn(e,i,s,r);o===void 0?delete i[s]:o!==r&&(i[s]=o)}return e.call(t,n,i)}function rt(e,t,n){if(Array.isArray(e))return e.map((i,s)=>rt(i,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!uu(e))return e.toJSON(t,n);const i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=r=>{i.res=r,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!n?.keep?Number(e):e}class no{constructor(t){Object.defineProperty(this,ot,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:s,reviver:r}={}){if(!oi(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},a=rt(this,"",o);if(typeof s=="function")for(const{count:l,res:c}of o.anchors.values())s(c,l);return typeof r=="function"?pn(r,{"":a},"",a):a}}class io extends no{constructor(t){super(to),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],Rn(t,{Node:(r,o)=>{(Pn(o)||uu(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let s;for(const r of i){if(r===this)break;r.anchor===this.source&&(s=r)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:i,doc:s,maxAliasCount:r}=n,o=this.resolve(s,n);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=i.get(o);if(a||(rt(o,null,n),a=i.get(o)),a?.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=zi(s,o,i)),a.count*a.aliasCount>r)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(t,n,i){const s=`*${this.source}`;if(t){if(du(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(t.implicitKey)return`${s} `}return s}}function zi(e,t,n){if(Pn(t)){const i=t.resolve(e),s=n&&i&&n.get(i);return s?s.count*s.aliasCount:0}else if(Ae(t)){let i=0;for(const s of t.items){const r=zi(e,s,n);r>i&&(i=r)}return i}else if(Ee(t)){const i=zi(e,t.key,n),s=zi(e,t.value,n);return Math.max(i,s)}return 1}const pu=e=>!e||typeof e!="function"&&typeof e!="object";class ie extends no{constructor(t){super(wt),this.value=t}toJSON(t,n){return n?.keep?this.value:rt(this.value,t,n)}toString(){return String(this.value)}}ie.BLOCK_FOLDED="BLOCK_FOLDED";ie.BLOCK_LITERAL="BLOCK_LITERAL";ie.PLAIN="PLAIN";ie.QUOTE_DOUBLE="QUOTE_DOUBLE";ie.QUOTE_SINGLE="QUOTE_SINGLE";const tx="tag:yaml.org,2002:";function nx(e,t,n){if(t){const i=n.filter(r=>r.tag===t),s=i.find(r=>!r.format)??i[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(i=>i.identify?.(e)&&!i.format)}function Xn(e,t,n){if(oi(e)&&(e=e.contents),Te(e))return e;if(Ee(e)){const u=n.schema[$t].createNode?.(n.schema,null,n);return u.items.push(e),u}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:i,onAnchor:s,onTagObj:r,schema:o,sourceObjects:a}=n;let l;if(i&&e&&typeof e=="object"){if(l=a.get(e),l)return l.anchor??(l.anchor=s(e)),new io(l.anchor);l={anchor:null,node:null},a.set(e,l)}t?.startsWith("!!")&&(t=tx+t.slice(2));let c=nx(e,t,o.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const u=new ie(e);return l&&(l.node=u),u}c=e instanceof Map?o[$t]:Symbol.iterator in Object(e)?o[In]:o[$t]}r&&(r(c),delete n.onTagObj);const d=c?.createNode?c.createNode(n.schema,e,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,e,n):new ie(e);return t?d.tag=t:c.default||(d.tag=c.tag),l&&(l.node=d),d}function Qi(e,t,n){let i=n;for(let s=t.length-1;s>=0;--s){const r=t[s];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const o=[];o[r]=i,i=o}else i=new Map([[r,i]])}return Xn(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Hn=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class mu extends no{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>Te(i)||Ee(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Hn(t))this.add(n);else{const[i,...s]=t,r=this.get(i,!0);if(Ae(r))r.addIn(s,n);else if(r===void 0&&this.schema)this.set(i,Qi(this.schema,s,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${s}`)}}deleteIn(t){const[n,...i]=t;if(i.length===0)return this.delete(n);const s=this.get(n,!0);if(Ae(s))return s.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){const[i,...s]=t,r=this.get(i,!0);return s.length===0?!n&&be(r)?r.value:r:Ae(r)?r.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Ee(n))return!1;const i=n.value;return i==null||t&&be(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){const[n,...i]=t;if(i.length===0)return this.has(n);const s=this.get(n,!0);return Ae(s)?s.hasIn(i):!1}setIn(t,n){const[i,...s]=t;if(s.length===0)this.set(i,n);else{const r=this.get(i,!0);if(Ae(r))r.setIn(s,n);else if(r===void 0&&this.schema)this.set(i,Qi(this.schema,s,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${s}`)}}}const ix=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function _t(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Ht=(e,t,n)=>e.endsWith(`
133
133
  `)?_t(n,t):n.includes(`
134
134
  `)?`
135
- `+_t(n,t):(e.endsWith(" ")?"":" ")+n,gu="flow",gr="block",Mi="quoted";function fs(e,t,n="flow",{indentAtStart:i,lineWidth:s=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return e;s<r&&(r=0);const l=Math.max(1+r,1+s-t.length);if(e.length<=l)return e;const c=[],d={};let u=s-t.length;typeof i=="number"&&(i>s-Math.max(2,r)?c.push(0):u=s-i);let p,f,m=!1,h=-1,y=-1,w=-1;n===gr&&(h=La(e,h,t.length),h!==-1&&(u=h+l));for(let S;S=e[h+=1];){if(n===Mi&&S==="\\"){switch(y=h,e[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}w=h}if(S===`
136
- `)n===gr&&(h=La(e,h,t.length)),u=h+t.length+l,p=void 0;else{if(S===" "&&f&&f!==" "&&f!==`
137
- `&&f!==" "){const I=e[h+1];I&&I!==" "&&I!==`
138
- `&&I!==" "&&(p=h)}if(h>=u)if(p)c.push(p),u=p+l,p=void 0;else if(n===Mi){for(;f===" "||f===" ";)f=S,S=e[h+=1],m=!0;const I=h>w+1?h-2:y-1;if(d[I])return e;c.push(I),d[I]=!0,u=I+l,p=void 0}else m=!0}f=S}if(m&&a&&a(),c.length===0)return e;o&&o();let C=e.slice(0,c[0]);for(let S=0;S<c.length;++S){const I=c[S],O=c[S+1]||e.length;I===0?C=`
135
+ `+_t(n,t):(e.endsWith(" ")?"":" ")+n,gu="flow",gr="block",Mi="quoted";function fs(e,t,n="flow",{indentAtStart:i,lineWidth:s=80,minContentWidth:r=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return e;s<r&&(r=0);const l=Math.max(1+r,1+s-t.length);if(e.length<=l)return e;const c=[],d={};let u=s-t.length;typeof i=="number"&&(i>s-Math.max(2,r)?c.push(0):u=s-i);let h,f,m=!1,p=-1,y=-1,w=-1;n===gr&&(p=La(e,p,t.length),p!==-1&&(u=p+l));for(let S;S=e[p+=1];){if(n===Mi&&S==="\\"){switch(y=p,e[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}w=p}if(S===`
136
+ `)n===gr&&(p=La(e,p,t.length)),u=p+t.length+l,h=void 0;else{if(S===" "&&f&&f!==" "&&f!==`
137
+ `&&f!==" "){const I=e[p+1];I&&I!==" "&&I!==`
138
+ `&&I!==" "&&(h=p)}if(p>=u)if(h)c.push(h),u=h+l,h=void 0;else if(n===Mi){for(;f===" "||f===" ";)f=S,S=e[p+=1],m=!0;const I=p>w+1?p-2:y-1;if(d[I])return e;c.push(I),d[I]=!0,u=I+l,h=void 0}else m=!0}f=S}if(m&&a&&a(),c.length===0)return e;o&&o();let C=e.slice(0,c[0]);for(let S=0;S<c.length;++S){const I=c[S],O=c[S+1]||e.length;I===0?C=`
139
139
  ${t}${e.slice(0,O)}`:(n===Mi&&d[I]&&(C+=`${e[I]}\\`),C+=`
140
140
  ${t}${e.slice(I+1,O)}`)}return C}function La(e,t,n){let i=t,s=t+1,r=e[s];for(;r===" "||r===" ";)if(t<s+n)r=e[++t];else{do r=e[++t];while(r&&r!==`
141
- `);i=t,s=t+1,r=e[s]}return i}const ps=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),hs=e=>/^(%|---|\.\.\.)/m.test(e);function sx(e,t,n){if(!t||t<0)return!1;const i=t-n,s=e.length;if(s<=i)return!1;for(let r=0,o=0;r<s;++r)if(e[r]===`
142
- `){if(r-o>i)return!0;if(o=r+1,s-o<=i)return!1}return!0}function Gn(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,s=t.options.doubleQuotedMinMultiLineLength,r=t.indent||(hs(e)?" ":"");let o="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{o+=n.slice(a,l);const d=n.substr(l+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(i||n[l+2]==='"'||n.length<s)l+=1;else{for(o+=n.slice(a,l)+`
141
+ `);i=t,s=t+1,r=e[s]}return i}const hs=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ps=e=>/^(%|---|\.\.\.)/m.test(e);function sx(e,t,n){if(!t||t<0)return!1;const i=t-n,s=e.length;if(s<=i)return!1;for(let r=0,o=0;r<s;++r)if(e[r]===`
142
+ `){if(r-o>i)return!0;if(o=r+1,s-o<=i)return!1}return!0}function Gn(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,s=t.options.doubleQuotedMinMultiLineLength,r=t.indent||(ps(e)?" ":"");let o="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(o+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{o+=n.slice(a,l);const d=n.substr(l+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(i||n[l+2]==='"'||n.length<s)l+=1;else{for(o+=n.slice(a,l)+`
143
143
 
144
144
  `;n[l+2]==="\\"&&n[l+3]==="n"&&n[l+4]!=='"';)o+=`
145
- `,l+=2;o+=r,n[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+n.slice(a):n,i?o:fs(o,r,Mi,ps(t,!1))}function br(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
146
- `)||/[ \t]\n|\n[ \t]/.test(e))return Gn(e,t);const n=t.indent||(hs(e)?" ":""),i="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
147
- ${n}`)+"'";return t.implicitKey?i:fs(i,n,gu,ps(t,!1))}function mn(e,t){const{singleQuote:n}=t.options;let i;if(n===!1)i=Gn;else{const s=e.includes('"'),r=e.includes("'");s&&!r?i=br:r&&!s?i=Gn:i=n?br:Gn}return i(e,t)}let yr;try{yr=new RegExp(`(^|(?<!
145
+ `,l+=2;o+=r,n[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+n.slice(a):n,i?o:fs(o,r,Mi,hs(t,!1))}function br(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
146
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Gn(e,t);const n=t.indent||(ps(e)?" ":""),i="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
147
+ ${n}`)+"'";return t.implicitKey?i:fs(i,n,gu,hs(t,!1))}function mn(e,t){const{singleQuote:n}=t.options;let i;if(n===!1)i=Gn;else{const s=e.includes('"'),r=e.includes("'");s&&!r?i=br:r&&!s?i=Gn:i=n?br:Gn}return i(e,t)}let yr;try{yr=new RegExp(`(^|(?<!
148
148
  ))
149
149
  +(?!
150
- |$)`,"g")}catch{yr=/\n+(?!\n|$)/g}function ji({comment:e,type:t,value:n},i,s,r){const{blockQuote:o,commentString:a,lineWidth:l}=i.options;if(!o||/\n[\t ]+$/.test(n))return mn(n,i);const c=i.indent||(i.forceBlockIndent||hs(n)?" ":""),d=o==="literal"?!0:o==="folded"||t===ie.BLOCK_FOLDED?!1:t===ie.BLOCK_LITERAL?!0:!sx(n,l,c.length);if(!n)return d?`|
150
+ |$)`,"g")}catch{yr=/\n+(?!\n|$)/g}function ji({comment:e,type:t,value:n},i,s,r){const{blockQuote:o,commentString:a,lineWidth:l}=i.options;if(!o||/\n[\t ]+$/.test(n))return mn(n,i);const c=i.indent||(i.forceBlockIndent||ps(n)?" ":""),d=o==="literal"?!0:o==="folded"||t===ie.BLOCK_FOLDED?!1:t===ie.BLOCK_LITERAL?!0:!sx(n,l,c.length);if(!n)return d?`|
151
151
  `:`>
152
- `;let u,p;for(p=n.length;p>0;--p){const O=n[p-1];if(O!==`
153
- `&&O!==" "&&O!==" ")break}let f=n.substring(p);const m=f.indexOf(`
152
+ `;let u,h;for(h=n.length;h>0;--h){const O=n[h-1];if(O!==`
153
+ `&&O!==" "&&O!==" ")break}let f=n.substring(h);const m=f.indexOf(`
154
154
  `);m===-1?u="-":n===f||m!==f.length-1?(u="+",r&&r()):u="",f&&(n=n.slice(0,-f.length),f[f.length-1]===`
155
- `&&(f=f.slice(0,-1)),f=f.replace(yr,`$&${c}`));let h=!1,y,w=-1;for(y=0;y<n.length;++y){const O=n[y];if(O===" ")h=!0;else if(O===`
156
- `)w=y;else break}let C=n.substring(0,w<y?w+1:y);C&&(n=n.substring(C.length),C=C.replace(/\n+/g,`$&${c}`));let I=(h?c?"2":"1":"")+u;if(e&&(I+=" "+a(e.replace(/ ?[\r\n]+/g," ")),s&&s()),!d){const O=n.replace(/\n+/g,`
157
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let k=!1;const T=ps(i,!0);o!=="folded"&&t!==ie.BLOCK_FOLDED&&(T.onOverflow=()=>{k=!0});const $=fs(`${C}${O}${f}`,c,gr,T);if(!k)return`>${I}
155
+ `&&(f=f.slice(0,-1)),f=f.replace(yr,`$&${c}`));let p=!1,y,w=-1;for(y=0;y<n.length;++y){const O=n[y];if(O===" ")p=!0;else if(O===`
156
+ `)w=y;else break}let C=n.substring(0,w<y?w+1:y);C&&(n=n.substring(C.length),C=C.replace(/\n+/g,`$&${c}`));let I=(p?c?"2":"1":"")+u;if(e&&(I+=" "+a(e.replace(/ ?[\r\n]+/g," ")),s&&s()),!d){const O=n.replace(/\n+/g,`
157
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let k=!1;const E=hs(i,!0);o!=="folded"&&t!==ie.BLOCK_FOLDED&&(E.onOverflow=()=>{k=!0});const $=fs(`${C}${O}${f}`,c,gr,E);if(!k)return`>${I}
158
158
  ${c}${$}`}return n=n.replace(/\n+/g,`$&${c}`),`|${I}
159
159
  ${c}${C}${n}${f}`}function rx(e,t,n,i){const{type:s,value:r}=e,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:d}=t;if(a&&r.includes(`
160
160
  `)||d&&/[[\]{},]/.test(r))return mn(r,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return a||d||!r.includes(`
161
161
  `)?mn(r,t):ji(e,t,n,i);if(!a&&!d&&s!==ie.PLAIN&&r.includes(`
162
- `))return ji(e,t,n,i);if(hs(r)){if(l==="")return t.forceBlockIndent=!0,ji(e,t,n,i);if(a&&l===c)return mn(r,t)}const u=r.replace(/\n+/g,`$&
163
- ${l}`);if(o){const p=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(u),{compat:f,tags:m}=t.doc.schema;if(m.some(p)||f?.some(p))return mn(r,t)}return a?u:fs(u,l,gu,ps(t,!1))}function so(e,t,n,i){const{implicitKey:s,inFlow:r}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==ie.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ie.QUOTE_DOUBLE);const l=d=>{switch(d){case ie.BLOCK_FOLDED:case ie.BLOCK_LITERAL:return s||r?mn(o.value,t):ji(o,t,n,i);case ie.QUOTE_DOUBLE:return Gn(o.value,t);case ie.QUOTE_SINGLE:return br(o.value,t);case ie.PLAIN:return rx(o,t,n,i);default:return null}};let c=l(a);if(c===null){const{defaultKeyType:d,defaultStringType:u}=t.options,p=s&&d||u;if(c=l(p),c===null)throw new Error(`Unsupported default string type ${p}`)}return c}function bu(e,t){const n=Object.assign({blockQuote:!0,commentString:ix,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function ox(e,t){if(t.tag){const s=e.filter(r=>r.tag===t.tag);if(s.length>0)return s.find(r=>r.format===t.format)??s[0]}let n,i;if(be(t)){i=t.value;let s=e.filter(r=>r.identify?.(i));if(s.length>1){const r=s.filter(o=>o.test);r.length>0&&(s=r)}n=s.find(r=>r.format===t.format)??s.find(r=>!r.format)}else i=t,n=e.find(s=>s.nodeClass&&i instanceof s.nodeClass);if(!n){const s=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${s} value`)}return n}function ax(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const s=[],r=(be(e)||Ae(e))&&e.anchor;r&&du(r)&&(n.add(r),s.push(`&${r}`));const o=e.tag??(t.default?null:t.tag);return o&&s.push(i.directives.tagString(o)),s.join(" ")}function An(e,t,n,i){if(Te(e))return e.toString(t,n,i);if(Pn(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const r=Ee(e)?e:t.doc.createNode(e,{onTagObj:l=>s=l});s??(s=ox(t.doc.schema.tags,r));const o=ax(r,s,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const a=typeof s.stringify=="function"?s.stringify(r,t,n,i):be(r)?so(r,t,n,i):r.toString(t,n,i);return o?be(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
164
- ${t.indent}${a}`:a}function lx({key:e,value:t},n,i,s){const{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:d,simpleKeys:u}}=n;let p=Ee(e)&&e.comment||null;if(u){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(Ae(e)||!Ee(e)&&typeof e=="object"){const T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let f=!u&&(!e||p&&t==null&&!n.inFlow||Ae(e)||(be(e)?e.type===ie.BLOCK_FOLDED||e.type===ie.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!f&&(u||!r),indent:a+l});let m=!1,h=!1,y=An(e,n,()=>m=!0,()=>h=!0);if(!f&&!n.inFlow&&y.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");f=!0}if(n.inFlow){if(r||t==null)return m&&i&&i(),y===""?"?":f?`? ${y}`:y}else if(r&&!u||t==null&&f)return y=`? ${y}`,p&&!m?y+=Ht(y,n.indent,c(p)):h&&s&&s(),y;m&&(p=null),f?(p&&(y+=Ht(y,n.indent,c(p))),y=`? ${y}
165
- ${a}:`):(y=`${y}:`,p&&(y+=Ht(y,n.indent,c(p))));let w,C,S;Ee(t)?(w=!!t.spaceBefore,C=t.commentBefore,S=t.comment):(w=!1,C=null,S=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!f&&!p&&be(t)&&(n.indentAtStart=y.length+1),h=!1,!d&&l.length>=2&&!n.inFlow&&!f&&$n(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let I=!1;const O=An(t,n,()=>I=!0,()=>h=!0);let k=" ";if(p||w||C){if(k=w?`
166
- `:"",C){const T=c(C);k+=`
167
- ${_t(T,n.indent)}`}O===""&&!n.inFlow?k===`
162
+ `))return ji(e,t,n,i);if(ps(r)){if(l==="")return t.forceBlockIndent=!0,ji(e,t,n,i);if(a&&l===c)return mn(r,t)}const u=r.replace(/\n+/g,`$&
163
+ ${l}`);if(o){const h=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(u),{compat:f,tags:m}=t.doc.schema;if(m.some(h)||f?.some(h))return mn(r,t)}return a?u:fs(u,l,gu,hs(t,!1))}function so(e,t,n,i){const{implicitKey:s,inFlow:r}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==ie.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ie.QUOTE_DOUBLE);const l=d=>{switch(d){case ie.BLOCK_FOLDED:case ie.BLOCK_LITERAL:return s||r?mn(o.value,t):ji(o,t,n,i);case ie.QUOTE_DOUBLE:return Gn(o.value,t);case ie.QUOTE_SINGLE:return br(o.value,t);case ie.PLAIN:return rx(o,t,n,i);default:return null}};let c=l(a);if(c===null){const{defaultKeyType:d,defaultStringType:u}=t.options,h=s&&d||u;if(c=l(h),c===null)throw new Error(`Unsupported default string type ${h}`)}return c}function bu(e,t){const n=Object.assign({blockQuote:!0,commentString:ix,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function ox(e,t){if(t.tag){const s=e.filter(r=>r.tag===t.tag);if(s.length>0)return s.find(r=>r.format===t.format)??s[0]}let n,i;if(be(t)){i=t.value;let s=e.filter(r=>r.identify?.(i));if(s.length>1){const r=s.filter(o=>o.test);r.length>0&&(s=r)}n=s.find(r=>r.format===t.format)??s.find(r=>!r.format)}else i=t,n=e.find(s=>s.nodeClass&&i instanceof s.nodeClass);if(!n){const s=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${s} value`)}return n}function ax(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const s=[],r=(be(e)||Ae(e))&&e.anchor;r&&du(r)&&(n.add(r),s.push(`&${r}`));const o=e.tag??(t.default?null:t.tag);return o&&s.push(i.directives.tagString(o)),s.join(" ")}function An(e,t,n,i){if(Ee(e))return e.toString(t,n,i);if(Pn(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const r=Te(e)?e:t.doc.createNode(e,{onTagObj:l=>s=l});s??(s=ox(t.doc.schema.tags,r));const o=ax(r,s,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const a=typeof s.stringify=="function"?s.stringify(r,t,n,i):be(r)?so(r,t,n,i):r.toString(t,n,i);return o?be(r)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
164
+ ${t.indent}${a}`:a}function lx({key:e,value:t},n,i,s){const{allNullValues:r,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:d,simpleKeys:u}}=n;let h=Te(e)&&e.comment||null;if(u){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Ae(e)||!Te(e)&&typeof e=="object"){const E="With simple keys, collection cannot be used as a key value";throw new Error(E)}}let f=!u&&(!e||h&&t==null&&!n.inFlow||Ae(e)||(be(e)?e.type===ie.BLOCK_FOLDED||e.type===ie.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!f&&(u||!r),indent:a+l});let m=!1,p=!1,y=An(e,n,()=>m=!0,()=>p=!0);if(!f&&!n.inFlow&&y.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");f=!0}if(n.inFlow){if(r||t==null)return m&&i&&i(),y===""?"?":f?`? ${y}`:y}else if(r&&!u||t==null&&f)return y=`? ${y}`,h&&!m?y+=Ht(y,n.indent,c(h)):p&&s&&s(),y;m&&(h=null),f?(h&&(y+=Ht(y,n.indent,c(h))),y=`? ${y}
165
+ ${a}:`):(y=`${y}:`,h&&(y+=Ht(y,n.indent,c(h))));let w,C,S;Te(t)?(w=!!t.spaceBefore,C=t.commentBefore,S=t.comment):(w=!1,C=null,S=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!f&&!h&&be(t)&&(n.indentAtStart=y.length+1),p=!1,!d&&l.length>=2&&!n.inFlow&&!f&&$n(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let I=!1;const O=An(t,n,()=>I=!0,()=>p=!0);let k=" ";if(h||w||C){if(k=w?`
166
+ `:"",C){const E=c(C);k+=`
167
+ ${_t(E,n.indent)}`}O===""&&!n.inFlow?k===`
168
168
  `&&S&&(k=`
169
169
 
170
170
  `):k+=`
171
- ${n.indent}`}else if(!f&&Ae(t)){const T=O[0],$=O.indexOf(`
172
- `),W=$!==-1,R=n.inFlow??t.flow??t.items.length===0;if(W||!R){let H=!1;if(W&&(T==="&"||T==="!")){let B=O.indexOf(" ");T==="&"&&B!==-1&&B<$&&O[B+1]==="!"&&(B=O.indexOf(" ",B+1)),(B===-1||$<B)&&(H=!0)}H||(k=`
171
+ ${n.indent}`}else if(!f&&Ae(t)){const E=O[0],$=O.indexOf(`
172
+ `),W=$!==-1,R=n.inFlow??t.flow??t.items.length===0;if(W||!R){let H=!1;if(W&&(E==="&"||E==="!")){let B=O.indexOf(" ");E==="&"&&B!==-1&&B<$&&O[B+1]==="!"&&(B=O.indexOf(" ",B+1)),(B===-1||$<B)&&(H=!0)}H||(k=`
173
173
  ${n.indent}`)}}else(O===""||O[0]===`
174
- `)&&(k="");return y+=k+O,n.inFlow?I&&i&&i():S&&!I?y+=Ht(y,n.indent,c(S)):h&&s&&s(),y}function yu(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Si="<<",Ct={identify:e=>e===Si||typeof e=="symbol"&&e.description===Si,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ie(Symbol(Si)),{addToJSMap:wu}),stringify:()=>Si},cx=(e,t)=>(Ct.identify(t)||be(t)&&(!t.type||t.type===ie.PLAIN)&&Ct.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Ct.tag&&n.default);function wu(e,t,n){const i=ku(e,n);if($n(i))for(const s of i.items)Hs(e,t,s);else if(Array.isArray(i))for(const s of i)Hs(e,t,s);else Hs(e,t,i)}function Hs(e,t,n){const i=ku(e,n);if(!On(i))throw new Error("Merge sources must be maps or map aliases");const s=i.toJSON(null,e,Map);for(const[r,o]of s)t instanceof Map?t.has(r)||t.set(r,o):t instanceof Set?t.add(r):Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function ku(e,t){return e&&Pn(t)?t.resolve(e.doc,e):t}function vu(e,t,{key:n,value:i}){if(Ee(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(cx(e,n))wu(e,t,i);else{const s=rt(n,"",e);if(t instanceof Map)t.set(s,rt(i,s,e));else if(t instanceof Set)t.add(s);else{const r=ux(n,s,e),o=rt(i,r,e);r in t?Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[r]=o}}return t}function ux(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Ee(e)&&n?.doc){const i=bu(n.doc,{});i.anchors=new Set;for(const r of n.anchors.keys())i.anchors.add(r.anchor);i.inFlow=!0,i.inStringifyKey=!0;const s=e.toString(i);if(!n.mapKeyWarned){let r=JSON.stringify(s);r.length>40&&(r=r.substring(0,36)+'..."'),yu(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function ro(e,t,n){const i=Xn(e,void 0,n),s=Xn(t,void 0,n);return new Ue(i,s)}class Ue{constructor(t,n=null){Object.defineProperty(this,ot,{value:cu}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return Ee(n)&&(n=n.clone(t)),Ee(i)&&(i=i.clone(t)),new Ue(n,i)}toJSON(t,n){const i=n?.mapAsMap?new Map:{};return vu(n,i,this)}toString(t,n,i){return t?.doc?lx(this,t,n,i):JSON.stringify(this)}}function Su(e,t,n){return(t.inFlow??e.flow?fx:dx)(e,t,n)}function dx({comment:e,items:t},n,{blockItemPrefix:i,flowChars:s,itemIndent:r,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:c}}=n,d=Object.assign({},n,{indent:r,type:null});let u=!1;const p=[];for(let m=0;m<t.length;++m){const h=t[m];let y=null;if(Ee(h))!u&&h.spaceBefore&&p.push(""),Xi(n,p,h.commentBefore,u),h.comment&&(y=h.comment);else if(Te(h)){const C=Ee(h.key)?h.key:null;C&&(!u&&C.spaceBefore&&p.push(""),Xi(n,p,C.commentBefore,u))}u=!1;let w=An(h,d,()=>y=null,()=>u=!0);y&&(w+=Ht(w,r,c(y))),u&&y&&(u=!1),p.push(i+w)}let f;if(p.length===0)f=s.start+s.end;else{f=p[0];for(let m=1;m<p.length;++m){const h=p[m];f+=h?`
175
- ${l}${h}`:`
174
+ `)&&(k="");return y+=k+O,n.inFlow?I&&i&&i():S&&!I?y+=Ht(y,n.indent,c(S)):p&&s&&s(),y}function yu(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Si="<<",Ct={identify:e=>e===Si||typeof e=="symbol"&&e.description===Si,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ie(Symbol(Si)),{addToJSMap:wu}),stringify:()=>Si},cx=(e,t)=>(Ct.identify(t)||be(t)&&(!t.type||t.type===ie.PLAIN)&&Ct.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Ct.tag&&n.default);function wu(e,t,n){const i=ku(e,n);if($n(i))for(const s of i.items)Hs(e,t,s);else if(Array.isArray(i))for(const s of i)Hs(e,t,s);else Hs(e,t,i)}function Hs(e,t,n){const i=ku(e,n);if(!On(i))throw new Error("Merge sources must be maps or map aliases");const s=i.toJSON(null,e,Map);for(const[r,o]of s)t instanceof Map?t.has(r)||t.set(r,o):t instanceof Set?t.add(r):Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function ku(e,t){return e&&Pn(t)?t.resolve(e.doc,e):t}function vu(e,t,{key:n,value:i}){if(Te(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(cx(e,n))wu(e,t,i);else{const s=rt(n,"",e);if(t instanceof Map)t.set(s,rt(i,s,e));else if(t instanceof Set)t.add(s);else{const r=ux(n,s,e),o=rt(i,r,e);r in t?Object.defineProperty(t,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[r]=o}}return t}function ux(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Te(e)&&n?.doc){const i=bu(n.doc,{});i.anchors=new Set;for(const r of n.anchors.keys())i.anchors.add(r.anchor);i.inFlow=!0,i.inStringifyKey=!0;const s=e.toString(i);if(!n.mapKeyWarned){let r=JSON.stringify(s);r.length>40&&(r=r.substring(0,36)+'..."'),yu(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function ro(e,t,n){const i=Xn(e,void 0,n),s=Xn(t,void 0,n);return new Ue(i,s)}class Ue{constructor(t,n=null){Object.defineProperty(this,ot,{value:cu}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return Te(n)&&(n=n.clone(t)),Te(i)&&(i=i.clone(t)),new Ue(n,i)}toJSON(t,n){const i=n?.mapAsMap?new Map:{};return vu(n,i,this)}toString(t,n,i){return t?.doc?lx(this,t,n,i):JSON.stringify(this)}}function Su(e,t,n){return(t.inFlow??e.flow?fx:dx)(e,t,n)}function dx({comment:e,items:t},n,{blockItemPrefix:i,flowChars:s,itemIndent:r,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:c}}=n,d=Object.assign({},n,{indent:r,type:null});let u=!1;const h=[];for(let m=0;m<t.length;++m){const p=t[m];let y=null;if(Te(p))!u&&p.spaceBefore&&h.push(""),Xi(n,h,p.commentBefore,u),p.comment&&(y=p.comment);else if(Ee(p)){const C=Te(p.key)?p.key:null;C&&(!u&&C.spaceBefore&&h.push(""),Xi(n,h,C.commentBefore,u))}u=!1;let w=An(p,d,()=>y=null,()=>u=!0);y&&(w+=Ht(w,r,c(y))),u&&y&&(u=!1),h.push(i+w)}let f;if(h.length===0)f=s.start+s.end;else{f=h[0];for(let m=1;m<h.length;++m){const p=h[m];f+=p?`
175
+ ${l}${p}`:`
176
176
  `}}return e?(f+=`
177
- `+_t(c(e),l),a&&a()):u&&o&&o(),f}function fx({items:e},t,{flowChars:n,itemIndent:i}){const{indent:s,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=t;i+=r;const l=Object.assign({},t,{indent:i,inFlow:!0,type:null});let c=!1,d=0;const u=[];for(let m=0;m<e.length;++m){const h=e[m];let y=null;if(Ee(h))h.spaceBefore&&u.push(""),Xi(t,u,h.commentBefore,!1),h.comment&&(y=h.comment);else if(Te(h)){const C=Ee(h.key)?h.key:null;C&&(C.spaceBefore&&u.push(""),Xi(t,u,C.commentBefore,!1),C.comment&&(c=!0));const S=Ee(h.value)?h.value:null;S?(S.comment&&(y=S.comment),S.commentBefore&&(c=!0)):h.value==null&&C?.comment&&(y=C.comment)}y&&(c=!0);let w=An(h,l,()=>y=null);c||(c=u.length>d||w.includes(`
178
- `)),m<e.length-1?w+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(c||(c=u.reduce((C,S)=>C+S.length+2,2)+(w.length+2)>t.options.lineWidth)),c&&(w+=",")),y&&(w+=Ht(w,i,a(y))),u.push(w),d=u.length}const{start:p,end:f}=n;if(u.length===0)return p+f;if(!c){const m=u.reduce((h,y)=>h+y.length+2,2);c=t.options.lineWidth>0&&m>t.options.lineWidth}if(c){let m=p;for(const h of u)m+=h?`
179
- ${r}${s}${h}`:`
177
+ `+_t(c(e),l),a&&a()):u&&o&&o(),f}function fx({items:e},t,{flowChars:n,itemIndent:i}){const{indent:s,indentStep:r,flowCollectionPadding:o,options:{commentString:a}}=t;i+=r;const l=Object.assign({},t,{indent:i,inFlow:!0,type:null});let c=!1,d=0;const u=[];for(let m=0;m<e.length;++m){const p=e[m];let y=null;if(Te(p))p.spaceBefore&&u.push(""),Xi(t,u,p.commentBefore,!1),p.comment&&(y=p.comment);else if(Ee(p)){const C=Te(p.key)?p.key:null;C&&(C.spaceBefore&&u.push(""),Xi(t,u,C.commentBefore,!1),C.comment&&(c=!0));const S=Te(p.value)?p.value:null;S?(S.comment&&(y=S.comment),S.commentBefore&&(c=!0)):p.value==null&&C?.comment&&(y=C.comment)}y&&(c=!0);let w=An(p,l,()=>y=null);c||(c=u.length>d||w.includes(`
178
+ `)),m<e.length-1?w+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(c||(c=u.reduce((C,S)=>C+S.length+2,2)+(w.length+2)>t.options.lineWidth)),c&&(w+=",")),y&&(w+=Ht(w,i,a(y))),u.push(w),d=u.length}const{start:h,end:f}=n;if(u.length===0)return h+f;if(!c){const m=u.reduce((p,y)=>p+y.length+2,2);c=t.options.lineWidth>0&&m>t.options.lineWidth}if(c){let m=h;for(const p of u)m+=p?`
179
+ ${r}${s}${p}`:`
180
180
  `;return`${m}
181
- ${s}${f}`}else return`${p}${o}${u.join(" ")}${o}${f}`}function Xi({indent:e,options:{commentString:t}},n,i,s){if(i&&s&&(i=i.replace(/^\n+/,"")),i){const r=_t(t(i),e);n.push(r.trimStart())}}function qt(e,t){const n=be(t)?t.value:t;for(const i of e)if(Te(i)&&(i.key===t||i.key===n||be(i.key)&&i.key.value===n))return i}class st extends mu{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super($t,t),this.items=[]}static from(t,n,i){const{keepUndefined:s,replacer:r}=i,o=new this(t),a=(l,c)=>{if(typeof r=="function")c=r.call(n,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||s)&&o.items.push(ro(l,c,i))};if(n instanceof Map)for(const[l,c]of n)a(l,c);else if(n&&typeof n=="object")for(const l of Object.keys(n))a(l,n[l]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){let i;Te(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Ue(t,t?.value):i=new Ue(t.key,t.value);const s=qt(this.items,i.key),r=this.schema?.sortMapEntries;if(s){if(!n)throw new Error(`Key ${i.key} already set`);be(s.value)&&hu(i.value)?s.value.value=i.value:s.value=i.value}else if(r){const o=this.items.findIndex(a=>r(i,a)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(t){const n=qt(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const s=qt(this.items,t)?.value;return(!n&&be(s)?s.value:s)??void 0}has(t){return!!qt(this.items,t)}set(t,n){this.add(new Ue(t,n),!0)}toJSON(t,n,i){const s=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(s);for(const r of this.items)vu(n,s,r);return s}toString(t,n,i){if(!t)return JSON.stringify(this);for(const s of this.items)if(!Te(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Su(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const Nn={collection:"map",default:!0,nodeClass:st,tag:"tag:yaml.org,2002:map",resolve(e,t){return On(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>st.from(e,t,n)};class Zt extends mu{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(In,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=xi(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=xi(t);if(typeof i!="number")return;const s=this.items[i];return!n&&be(s)?s.value:s}has(t){const n=xi(t);return typeof n=="number"&&n<this.items.length}set(t,n){const i=xi(t);if(typeof i!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[i];be(s)&&hu(n)?s.value=n:this.items[i]=n}toJSON(t,n){const i=[];n?.onCreate&&n.onCreate(i);let s=0;for(const r of this.items)i.push(rt(r,String(s++),n));return i}toString(t,n,i){return t?Su(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(t,n,i){const{replacer:s}=i,r=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof s=="function"){const l=n instanceof Set?a:String(o++);a=s.call(n,l,a)}r.items.push(Xn(a,void 0,i))}}return r}}function xi(e){let t=be(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Ln={collection:"seq",default:!0,nodeClass:Zt,tag:"tag:yaml.org,2002:seq",resolve(e,t){return $n(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Zt.from(e,t,n)},ms={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),so(e,t,n,i)}},gs={identify:e=>e==null,createNode:()=>new ie(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ie(null),stringify:({source:e},t)=>typeof e=="string"&&gs.test.test(e)?e:t.options.nullStr},oo={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new ie(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&oo.test.test(e)){const i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};function mt({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);const s=typeof i=="number"?i:Number(i);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let r=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=t-(r.length-o-1);for(;a-- >0;)r+="0"}return r}const xu={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:mt},_u={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():mt(e)}},Cu={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new ie(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:mt},bs=e=>typeof e=="bigint"||Number.isInteger(e),ao=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function Au(e,t,n){const{value:i}=e;return bs(i)&&i>=0?n+i.toString(t):mt(e)}const Eu={identify:e=>bs(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>ao(e,2,8,n),stringify:e=>Au(e,8,"0o")},Tu={identify:bs,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>ao(e,0,10,n),stringify:mt},Iu={identify:e=>bs(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>ao(e,2,16,n),stringify:e=>Au(e,16,"0x")},px=[Nn,Ln,ms,gs,oo,Eu,Tu,Iu,xu,_u,Cu];function Fa(e){return typeof e=="bigint"||Number.isInteger(e)}const _i=({value:e})=>JSON.stringify(e),hx=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:_i},{identify:e=>e==null,createNode:()=>new ie(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:_i},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:_i},{identify:Fa,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Fa(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:_i}],mx={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},gx=[Nn,Ln].concat(hx,mx),lo={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let s=0;s<n.length;++s)i[s]=n.charCodeAt(s);return i}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},i,s,r){if(!n)return"";const o=n;let a;if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=ie.BLOCK_LITERAL),t!==ie.QUOTE_DOUBLE){const l=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),c=Math.ceil(a.length/l),d=new Array(c);for(let u=0,p=0;u<c;++u,p+=l)d[u]=a.substr(p,l);a=d.join(t===ie.BLOCK_LITERAL?`
182
- `:" ")}return so({comment:e,type:t,value:a},i,s,r)}};function Pu(e,t){if($n(e))for(let n=0;n<e.items.length;++n){let i=e.items[n];if(!Te(i)){if(On(i)){i.items.length>1&&t("Each pair must have its own sequence indicator");const s=i.items[0]||new Ue(new ie(null));if(i.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${i.commentBefore}
181
+ ${s}${f}`}else return`${h}${o}${u.join(" ")}${o}${f}`}function Xi({indent:e,options:{commentString:t}},n,i,s){if(i&&s&&(i=i.replace(/^\n+/,"")),i){const r=_t(t(i),e);n.push(r.trimStart())}}function qt(e,t){const n=be(t)?t.value:t;for(const i of e)if(Ee(i)&&(i.key===t||i.key===n||be(i.key)&&i.key.value===n))return i}class st extends mu{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super($t,t),this.items=[]}static from(t,n,i){const{keepUndefined:s,replacer:r}=i,o=new this(t),a=(l,c)=>{if(typeof r=="function")c=r.call(n,l,c);else if(Array.isArray(r)&&!r.includes(l))return;(c!==void 0||s)&&o.items.push(ro(l,c,i))};if(n instanceof Map)for(const[l,c]of n)a(l,c);else if(n&&typeof n=="object")for(const l of Object.keys(n))a(l,n[l]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){let i;Ee(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Ue(t,t?.value):i=new Ue(t.key,t.value);const s=qt(this.items,i.key),r=this.schema?.sortMapEntries;if(s){if(!n)throw new Error(`Key ${i.key} already set`);be(s.value)&&pu(i.value)?s.value.value=i.value:s.value=i.value}else if(r){const o=this.items.findIndex(a=>r(i,a)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(t){const n=qt(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const s=qt(this.items,t)?.value;return(!n&&be(s)?s.value:s)??void 0}has(t){return!!qt(this.items,t)}set(t,n){this.add(new Ue(t,n),!0)}toJSON(t,n,i){const s=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(s);for(const r of this.items)vu(n,s,r);return s}toString(t,n,i){if(!t)return JSON.stringify(this);for(const s of this.items)if(!Ee(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Su(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const Nn={collection:"map",default:!0,nodeClass:st,tag:"tag:yaml.org,2002:map",resolve(e,t){return On(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>st.from(e,t,n)};class Zt extends mu{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(In,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=xi(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=xi(t);if(typeof i!="number")return;const s=this.items[i];return!n&&be(s)?s.value:s}has(t){const n=xi(t);return typeof n=="number"&&n<this.items.length}set(t,n){const i=xi(t);if(typeof i!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[i];be(s)&&pu(n)?s.value=n:this.items[i]=n}toJSON(t,n){const i=[];n?.onCreate&&n.onCreate(i);let s=0;for(const r of this.items)i.push(rt(r,String(s++),n));return i}toString(t,n,i){return t?Su(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(t,n,i){const{replacer:s}=i,r=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof s=="function"){const l=n instanceof Set?a:String(o++);a=s.call(n,l,a)}r.items.push(Xn(a,void 0,i))}}return r}}function xi(e){let t=be(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Ln={collection:"seq",default:!0,nodeClass:Zt,tag:"tag:yaml.org,2002:seq",resolve(e,t){return $n(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Zt.from(e,t,n)},ms={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),so(e,t,n,i)}},gs={identify:e=>e==null,createNode:()=>new ie(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ie(null),stringify:({source:e},t)=>typeof e=="string"&&gs.test.test(e)?e:t.options.nullStr},oo={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new ie(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&oo.test.test(e)){const i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};function mt({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);const s=typeof i=="number"?i:Number(i);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let r=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let a=t-(r.length-o-1);for(;a-- >0;)r+="0"}return r}const xu={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:mt},_u={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():mt(e)}},Cu={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new ie(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:mt},bs=e=>typeof e=="bigint"||Number.isInteger(e),ao=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function Au(e,t,n){const{value:i}=e;return bs(i)&&i>=0?n+i.toString(t):mt(e)}const Tu={identify:e=>bs(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>ao(e,2,8,n),stringify:e=>Au(e,8,"0o")},Eu={identify:bs,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>ao(e,0,10,n),stringify:mt},Iu={identify:e=>bs(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>ao(e,2,16,n),stringify:e=>Au(e,16,"0x")},hx=[Nn,Ln,ms,gs,oo,Tu,Eu,Iu,xu,_u,Cu];function Fa(e){return typeof e=="bigint"||Number.isInteger(e)}const _i=({value:e})=>JSON.stringify(e),px=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:_i},{identify:e=>e==null,createNode:()=>new ie(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:_i},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:_i},{identify:Fa,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Fa(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:_i}],mx={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},gx=[Nn,Ln].concat(px,mx),lo={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let s=0;s<n.length;++s)i[s]=n.charCodeAt(s);return i}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},i,s,r){if(!n)return"";const o=n;let a;if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=ie.BLOCK_LITERAL),t!==ie.QUOTE_DOUBLE){const l=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),c=Math.ceil(a.length/l),d=new Array(c);for(let u=0,h=0;u<c;++u,h+=l)d[u]=a.substr(h,l);a=d.join(t===ie.BLOCK_LITERAL?`
182
+ `:" ")}return so({comment:e,type:t,value:a},i,s,r)}};function Pu(e,t){if($n(e))for(let n=0;n<e.items.length;++n){let i=e.items[n];if(!Ee(i)){if(On(i)){i.items.length>1&&t("Each pair must have its own sequence indicator");const s=i.items[0]||new Ue(new ie(null));if(i.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${i.commentBefore}
183
183
  ${s.key.commentBefore}`:i.commentBefore),i.comment){const r=s.value??s.key;r.comment=r.comment?`${i.comment}
184
- ${r.comment}`:i.comment}i=s}e.items[n]=Te(i)?i:new Ue(i)}}else t("Expected a sequence for this tag");return e}function Ou(e,t,n){const{replacer:i}=n,s=new Zt(e);s.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof i=="function"&&(o=i.call(t,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;s.items.push(ro(a,l,n))}return s}const co={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Pu,createNode:Ou};class bn extends Zt{constructor(){super(),this.add=st.prototype.add.bind(this),this.delete=st.prototype.delete.bind(this),this.get=st.prototype.get.bind(this),this.has=st.prototype.has.bind(this),this.set=st.prototype.set.bind(this),this.tag=bn.tag}toJSON(t,n){if(!n)return super.toJSON(t);const i=new Map;n?.onCreate&&n.onCreate(i);for(const s of this.items){let r,o;if(Te(s)?(r=rt(s.key,"",n),o=rt(s.value,r,n)):r=rt(s,"",n),i.has(r))throw new Error("Ordered maps must not include duplicate keys");i.set(r,o)}return i}static from(t,n,i){const s=Ou(t,n,i),r=new this;return r.items=s.items,r}}bn.tag="tag:yaml.org,2002:omap";const uo={collection:"seq",identify:e=>e instanceof Map,nodeClass:bn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Pu(e,t),i=[];for(const{key:s}of n.items)be(s)&&(i.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):i.push(s.value));return Object.assign(new bn,n)},createNode:(e,t,n)=>bn.from(e,t,n)};function $u({value:e,source:t},n){return t&&(e?Ru:Nu).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Ru={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ie(!0),stringify:$u},Nu={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ie(!1),stringify:$u},bx={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:mt},yx={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():mt(e)}},wx={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new ie(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:mt},ai=e=>typeof e=="bigint"||Number.isInteger(e);function ys(e,t,n,{intAsBigInt:i}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return s==="-"?BigInt(-1)*o:o}const r=parseInt(e,n);return s==="-"?-1*r:r}function fo(e,t,n){const{value:i}=e;if(ai(i)){const s=i.toString(t);return i<0?"-"+n+s.substr(1):n+s}return mt(e)}const kx={identify:ai,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>ys(e,2,2,n),stringify:e=>fo(e,2,"0b")},vx={identify:ai,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>ys(e,1,8,n),stringify:e=>fo(e,8,"0")},Sx={identify:ai,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>ys(e,0,10,n),stringify:mt},xx={identify:ai,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>ys(e,2,16,n),stringify:e=>fo(e,16,"0x")};class yn extends st{constructor(t){super(t),this.tag=yn.tag}add(t){let n;Te(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Ue(t.key,null):n=new Ue(t,null),qt(this.items,n.key)||this.items.push(n)}get(t,n){const i=qt(this.items,t);return!n&&Te(i)?be(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const i=qt(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new Ue(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){const{replacer:s}=i,r=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof s=="function"&&(o=s.call(n,o,o)),r.items.push(ro(o,null,i));return r}}yn.tag="tag:yaml.org,2002:set";const po={collection:"map",identify:e=>e instanceof Set,nodeClass:yn,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>yn.from(e,t,n),resolve(e,t){if(On(e)){if(e.hasAllNullValues(!0))return Object.assign(new yn,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function ho(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,s=o=>t?BigInt(o):Number(o),r=i.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return n==="-"?s(-1)*r:r}function Lu(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return mt(e);let i="";t<0&&(i="-",t*=n(-1));const s=n(60),r=[t%s];return t<60?r.unshift(0):(t=(t-r[0])/s,r.unshift(t%s),t>=60&&(t=(t-r[0])/s,r.unshift(t))),i+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Fu={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>ho(e,n),stringify:Lu},Du={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>ho(e,!1),stringify:Lu},ws={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(ws.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,s,r,o,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0;let c=Date.UTC(n,i-1,s,r||0,o||0,a||0,l);const d=t[8];if(d&&d!=="Z"){let u=ho(d,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Da=[Nn,Ln,ms,gs,Ru,Nu,kx,vx,Sx,xx,bx,yx,wx,lo,Ct,uo,co,po,Fu,Du,ws],za=new Map([["core",px],["failsafe",[Nn,Ln,ms]],["json",gx],["yaml11",Da],["yaml-1.1",Da]]),Ma={binary:lo,bool:oo,float:Cu,floatExp:_u,floatNaN:xu,floatTime:Du,int:Tu,intHex:Iu,intOct:Eu,intTime:Fu,map:Nn,merge:Ct,null:gs,omap:uo,pairs:co,seq:Ln,set:po,timestamp:ws},_x={"tag:yaml.org,2002:binary":lo,"tag:yaml.org,2002:merge":Ct,"tag:yaml.org,2002:omap":uo,"tag:yaml.org,2002:pairs":co,"tag:yaml.org,2002:set":po,"tag:yaml.org,2002:timestamp":ws};function qs(e,t,n){const i=za.get(t);if(i&&!e)return n&&!i.includes(Ct)?i.concat(Ct):i.slice();let s=i;if(!s)if(Array.isArray(e))s=[];else{const r=Array.from(za.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${r} or define customTags array`)}if(Array.isArray(e))for(const r of e)s=s.concat(r);else typeof e=="function"&&(s=e(s.slice()));return n&&(s=s.concat(Ct)),s.reduce((r,o)=>{const a=typeof o=="string"?Ma[o]:o;if(!a){const l=JSON.stringify(o),c=Object.keys(Ma).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}const Cx=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class mo{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:s,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?qs(t,"compat"):t?qs(null,t):null,this.name=typeof r=="string"&&r||"core",this.knownTags=s?_x:{},this.tags=qs(n,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,$t,{value:Nn}),Object.defineProperty(this,wt,{value:ms}),Object.defineProperty(this,In,{value:Ln}),this.sortMapEntries=typeof o=="function"?o:o===!0?Cx:null}clone(){const t=Object.create(mo.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Ax(e,t){const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const l=e.directives.toString(e);l?(n.push(l),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const s=bu(e,t),{commentString:r}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const l=r(e.commentBefore);n.unshift(_t(l,""))}let o=!1,a=null;if(e.contents){if(Ee(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const d=r(e.contents.commentBefore);n.push(_t(d,""))}s.forceBlockIndent=!!e.comment,a=e.contents.comment}const l=a?void 0:()=>o=!0;let c=An(e.contents,s,()=>a=null,l);a&&(c+=Ht(c,"",r(a))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(An(e.contents,s));if(e.directives?.docEnd)if(e.comment){const l=r(e.comment);l.includes(`
184
+ ${r.comment}`:i.comment}i=s}e.items[n]=Ee(i)?i:new Ue(i)}}else t("Expected a sequence for this tag");return e}function Ou(e,t,n){const{replacer:i}=n,s=new Zt(e);s.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof i=="function"&&(o=i.call(t,String(r++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;s.items.push(ro(a,l,n))}return s}const co={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Pu,createNode:Ou};class bn extends Zt{constructor(){super(),this.add=st.prototype.add.bind(this),this.delete=st.prototype.delete.bind(this),this.get=st.prototype.get.bind(this),this.has=st.prototype.has.bind(this),this.set=st.prototype.set.bind(this),this.tag=bn.tag}toJSON(t,n){if(!n)return super.toJSON(t);const i=new Map;n?.onCreate&&n.onCreate(i);for(const s of this.items){let r,o;if(Ee(s)?(r=rt(s.key,"",n),o=rt(s.value,r,n)):r=rt(s,"",n),i.has(r))throw new Error("Ordered maps must not include duplicate keys");i.set(r,o)}return i}static from(t,n,i){const s=Ou(t,n,i),r=new this;return r.items=s.items,r}}bn.tag="tag:yaml.org,2002:omap";const uo={collection:"seq",identify:e=>e instanceof Map,nodeClass:bn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Pu(e,t),i=[];for(const{key:s}of n.items)be(s)&&(i.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):i.push(s.value));return Object.assign(new bn,n)},createNode:(e,t,n)=>bn.from(e,t,n)};function $u({value:e,source:t},n){return t&&(e?Ru:Nu).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Ru={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ie(!0),stringify:$u},Nu={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ie(!1),stringify:$u},bx={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:mt},yx={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():mt(e)}},wx={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new ie(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:mt},ai=e=>typeof e=="bigint"||Number.isInteger(e);function ys(e,t,n,{intAsBigInt:i}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return s==="-"?BigInt(-1)*o:o}const r=parseInt(e,n);return s==="-"?-1*r:r}function fo(e,t,n){const{value:i}=e;if(ai(i)){const s=i.toString(t);return i<0?"-"+n+s.substr(1):n+s}return mt(e)}const kx={identify:ai,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>ys(e,2,2,n),stringify:e=>fo(e,2,"0b")},vx={identify:ai,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>ys(e,1,8,n),stringify:e=>fo(e,8,"0")},Sx={identify:ai,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>ys(e,0,10,n),stringify:mt},xx={identify:ai,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>ys(e,2,16,n),stringify:e=>fo(e,16,"0x")};class yn extends st{constructor(t){super(t),this.tag=yn.tag}add(t){let n;Ee(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Ue(t.key,null):n=new Ue(t,null),qt(this.items,n.key)||this.items.push(n)}get(t,n){const i=qt(this.items,t);return!n&&Ee(i)?be(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const i=qt(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new Ue(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){const{replacer:s}=i,r=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof s=="function"&&(o=s.call(n,o,o)),r.items.push(ro(o,null,i));return r}}yn.tag="tag:yaml.org,2002:set";const ho={collection:"map",identify:e=>e instanceof Set,nodeClass:yn,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>yn.from(e,t,n),resolve(e,t){if(On(e)){if(e.hasAllNullValues(!0))return Object.assign(new yn,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function po(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,s=o=>t?BigInt(o):Number(o),r=i.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return n==="-"?s(-1)*r:r}function Lu(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return mt(e);let i="";t<0&&(i="-",t*=n(-1));const s=n(60),r=[t%s];return t<60?r.unshift(0):(t=(t-r[0])/s,r.unshift(t%s),t>=60&&(t=(t-r[0])/s,r.unshift(t))),i+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Fu={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>po(e,n),stringify:Lu},Du={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>po(e,!1),stringify:Lu},ws={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(ws.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,s,r,o,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0;let c=Date.UTC(n,i-1,s,r||0,o||0,a||0,l);const d=t[8];if(d&&d!=="Z"){let u=po(d,!1);Math.abs(u)<30&&(u*=60),c-=6e4*u}return new Date(c)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Da=[Nn,Ln,ms,gs,Ru,Nu,kx,vx,Sx,xx,bx,yx,wx,lo,Ct,uo,co,ho,Fu,Du,ws],za=new Map([["core",hx],["failsafe",[Nn,Ln,ms]],["json",gx],["yaml11",Da],["yaml-1.1",Da]]),Ma={binary:lo,bool:oo,float:Cu,floatExp:_u,floatNaN:xu,floatTime:Du,int:Eu,intHex:Iu,intOct:Tu,intTime:Fu,map:Nn,merge:Ct,null:gs,omap:uo,pairs:co,seq:Ln,set:ho,timestamp:ws},_x={"tag:yaml.org,2002:binary":lo,"tag:yaml.org,2002:merge":Ct,"tag:yaml.org,2002:omap":uo,"tag:yaml.org,2002:pairs":co,"tag:yaml.org,2002:set":ho,"tag:yaml.org,2002:timestamp":ws};function qs(e,t,n){const i=za.get(t);if(i&&!e)return n&&!i.includes(Ct)?i.concat(Ct):i.slice();let s=i;if(!s)if(Array.isArray(e))s=[];else{const r=Array.from(za.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${r} or define customTags array`)}if(Array.isArray(e))for(const r of e)s=s.concat(r);else typeof e=="function"&&(s=e(s.slice()));return n&&(s=s.concat(Ct)),s.reduce((r,o)=>{const a=typeof o=="string"?Ma[o]:o;if(!a){const l=JSON.stringify(o),c=Object.keys(Ma).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return r.includes(a)||r.push(a),r},[])}const Cx=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class mo{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:s,schema:r,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?qs(t,"compat"):t?qs(null,t):null,this.name=typeof r=="string"&&r||"core",this.knownTags=s?_x:{},this.tags=qs(n,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,$t,{value:Nn}),Object.defineProperty(this,wt,{value:ms}),Object.defineProperty(this,In,{value:Ln}),this.sortMapEntries=typeof o=="function"?o:o===!0?Cx:null}clone(){const t=Object.create(mo.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Ax(e,t){const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const l=e.directives.toString(e);l?(n.push(l),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const s=bu(e,t),{commentString:r}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const l=r(e.commentBefore);n.unshift(_t(l,""))}let o=!1,a=null;if(e.contents){if(Te(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const d=r(e.contents.commentBefore);n.push(_t(d,""))}s.forceBlockIndent=!!e.comment,a=e.contents.comment}const l=a?void 0:()=>o=!0;let c=An(e.contents,s,()=>a=null,l);a&&(c+=Ht(c,"",r(a))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(An(e.contents,s));if(e.directives?.docEnd)if(e.comment){const l=r(e.comment);l.includes(`
185
185
  `)?(n.push("..."),n.push(_t(l,""))):n.push(`... ${l}`)}else n.push("...");else{let l=e.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(_t(r(l),"")))}return n.join(`
186
186
  `)+`
187
- `}class Fn{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ot,{value:mr});let s=null;typeof n=="function"||Array.isArray(n)?s=n:i===void 0&&n&&(i=n,n=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=r;let{version:o}=r;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Me({version:o}),this.setSchema(o,i),this.contents=t===void 0?null:this.createNode(t,s,i)}clone(){const t=Object.create(Fn.prototype,{[ot]:{value:mr}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Ee(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){nn(this.contents)&&this.contents.add(t)}addIn(t,n){nn(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=fu(this);t.anchor=!n||i.has(n)?pu(n||"a",i):n}return new io(t.anchor)}createNode(t,n,i){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const y=C=>typeof C=="number"||C instanceof String||C instanceof Number,w=n.filter(y).map(String);w.length>0&&(n=n.concat(w)),s=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:d}=i??{},{onAnchor:u,setAnchors:p,sourceObjects:f}=ex(this,o||"a"),m={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:u,onTagObj:c,replacer:s,schema:this.schema,sourceObjects:f},h=Xn(t,d,m);return a&&Ae(h)&&(h.flow=!0),p(),h}createPair(t,n,i={}){const s=this.createNode(t,null,i),r=this.createNode(n,null,i);return new Ue(s,r)}delete(t){return nn(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Hn(t)?this.contents==null?!1:(this.contents=null,!0):nn(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Ae(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Hn(t)?!n&&be(this.contents)?this.contents.value:this.contents:Ae(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Ae(this.contents)?this.contents.has(t):!1}hasIn(t){return Hn(t)?this.contents!==void 0:Ae(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Qi(this.schema,[t],n):nn(this.contents)&&this.contents.set(t,n)}setIn(t,n){Hn(t)?this.contents=n:this.contents==null?this.contents=Qi(this.schema,Array.from(t),n):nn(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Me({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Me({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const s=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new mo(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:s,onAnchor:r,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=rt(this.contents,n??"",a);if(typeof r=="function")for(const{count:c,res:d}of a.anchors.values())r(d,c);return typeof o=="function"?hn(o,{"":l},"",l):l}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Ax(this,t)}}function nn(e){if(Ae(e))return!0;throw new Error("Expected a YAML collection as document contents")}class zu extends Error{constructor(t,n,i,s){super(),this.name=t,this.code=i,this.message=s,this.pos=n}}class qn extends zu{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class Ex extends zu{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const ja=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));const{line:i,col:s}=n.linePos[0];n.message+=` at line ${i}, column ${s}`;let r=s-1,o=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const a=Math.min(r-39,o.length-79);o="…"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,r))){let a=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`…
187
+ `}class Fn{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ot,{value:mr});let s=null;typeof n=="function"||Array.isArray(n)?s=n:i===void 0&&n&&(i=n,n=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=r;let{version:o}=r;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Me({version:o}),this.setSchema(o,i),this.contents=t===void 0?null:this.createNode(t,s,i)}clone(){const t=Object.create(Fn.prototype,{[ot]:{value:mr}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Te(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){nn(this.contents)&&this.contents.add(t)}addIn(t,n){nn(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=fu(this);t.anchor=!n||i.has(n)?hu(n||"a",i):n}return new io(t.anchor)}createNode(t,n,i){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const y=C=>typeof C=="number"||C instanceof String||C instanceof Number,w=n.filter(y).map(String);w.length>0&&(n=n.concat(w)),s=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:r,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:d}=i??{},{onAnchor:u,setAnchors:h,sourceObjects:f}=ex(this,o||"a"),m={aliasDuplicateObjects:r??!0,keepUndefined:l??!1,onAnchor:u,onTagObj:c,replacer:s,schema:this.schema,sourceObjects:f},p=Xn(t,d,m);return a&&Ae(p)&&(p.flow=!0),h(),p}createPair(t,n,i={}){const s=this.createNode(t,null,i),r=this.createNode(n,null,i);return new Ue(s,r)}delete(t){return nn(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Hn(t)?this.contents==null?!1:(this.contents=null,!0):nn(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Ae(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Hn(t)?!n&&be(this.contents)?this.contents.value:this.contents:Ae(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Ae(this.contents)?this.contents.has(t):!1}hasIn(t){return Hn(t)?this.contents!==void 0:Ae(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Qi(this.schema,[t],n):nn(this.contents)&&this.contents.set(t,n)}setIn(t,n){Hn(t)?this.contents=n:this.contents==null?this.contents=Qi(this.schema,Array.from(t),n):nn(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Me({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Me({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const s=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new mo(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:s,onAnchor:r,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=rt(this.contents,n??"",a);if(typeof r=="function")for(const{count:c,res:d}of a.anchors.values())r(d,c);return typeof o=="function"?pn(o,{"":l},"",l):l}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Ax(this,t)}}function nn(e){if(Ae(e))return!0;throw new Error("Expected a YAML collection as document contents")}class zu extends Error{constructor(t,n,i,s){super(),this.name=t,this.code=i,this.message=s,this.pos=n}}class qn extends zu{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class Tx extends zu{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const ja=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));const{line:i,col:s}=n.linePos[0];n.message+=` at line ${i}, column ${s}`;let r=s-1,o=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const a=Math.min(r-39,o.length-79);o="…"+o.substring(a),r-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,r))){let a=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`…
188
188
  `),o=a+o}if(/[^ ]/.test(o)){let a=1;const l=n.linePos[1];l?.line===i&&l.col>s&&(a=Math.max(1,Math.min(l.col-s,80-r)));const c=" ".repeat(r)+"^".repeat(a);n.message+=`:
189
189
 
190
190
  ${o}
191
191
  ${c}
192
- `}};function En(e,{flow:t,indicator:n,next:i,offset:s,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,d=a,u="",p="",f=!1,m=!1,h=null,y=null,w=null,C=null,S=null,I=null,O=null;for(const $ of e)switch(m&&($.type!=="space"&&$.type!=="newline"&&$.type!=="comma"&&r($.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),h&&(c&&$.type!=="comment"&&$.type!=="newline"&&r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),$.type){case"space":!t&&(n!=="doc-start"||i?.type!=="flow-collection")&&$.source.includes(" ")&&(h=$),d=!0;break;case"comment":{d||r($,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const W=$.source.substring(1)||" ";u?u+=p+W:u=W,p="",c=!1;break}case"newline":c?u?u+=$.source:(!I||n!=="seq-item-ind")&&(l=!0):p+=$.source,c=!0,f=!0,(y||w)&&(C=$),d=!0;break;case"anchor":y&&r($,"MULTIPLE_ANCHORS","A node can have at most one anchor"),$.source.endsWith(":")&&r($.offset+$.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),y=$,O??(O=$.offset),c=!1,d=!1,m=!0;break;case"tag":{w&&r($,"MULTIPLE_TAGS","A node can have at most one tag"),w=$,O??(O=$.offset),c=!1,d=!1,m=!0;break}case n:(y||w)&&r($,"BAD_PROP_ORDER",`Anchors and tags must be after the ${$.source} indicator`),I&&r($,"UNEXPECTED_TOKEN",`Unexpected ${$.source} in ${t??"collection"}`),I=$,c=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){S&&r($,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),S=$,c=!1,d=!1;break}default:r($,"UNEXPECTED_TOKEN",`Unexpected ${$.type} token`),c=!1,d=!1}const k=e[e.length-1],T=k?k.offset+k.source.length:s;return m&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&r(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(c&&h.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:I,spaceBefore:l,comment:u,hasNewline:f,anchor:y,tag:w,newlineAfterProp:C,end:T,start:O??T}}function ei(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
193
- `))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(ei(t.key)||ei(t.value))return!0}return!1;default:return!0}}function wr(e,t,n){if(t?.type==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&ei(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Mu(e,t,n){const{uniqueKeys:i}=e.options;if(i===!1)return!1;const s=typeof i=="function"?i:(r,o)=>r===o||be(r)&&be(o)&&r.value===o.value;return t.some(r=>s(r.key,n))}const Ba="All mapping items must start at the same column";function Tx({composeNode:e,composeEmptyNode:t},n,i,s,r){const o=r?.nodeClass??st,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let l=i.offset,c=null;for(const d of i.items){const{start:u,key:p,sep:f,value:m}=d,h=En(u,{indicator:"explicit-key-ind",next:p??f?.[0],offset:l,onError:s,parentIndent:i.indent,startOnNewline:!0}),y=!h.found;if(y){if(p&&(p.type==="block-seq"?s(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==i.indent&&s(l,"BAD_INDENT",Ba)),!h.anchor&&!h.tag&&!f){c=h.end,h.comment&&(a.comment?a.comment+=`
194
- `+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||ei(p))&&s(p??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==i.indent&&s(l,"BAD_INDENT",Ba);n.atKey=!0;const w=h.end,C=p?e(n,p,h,s):t(n,w,u,null,h,s);n.schema.compat&&wr(i.indent,p,s),n.atKey=!1,Mu(n,a.items,C)&&s(w,"DUPLICATE_KEY","Map keys must be unique");const S=En(f??[],{indicator:"map-value-ind",next:m,offset:C.range[2],onError:s,parentIndent:i.indent,startOnNewline:!p||p.type==="block-scalar"});if(l=S.end,S.found){y&&(m?.type==="block-map"&&!S.hasNewline&&s(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&h.start<S.found.offset-1024&&s(C.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const I=m?e(n,m,S,s):t(n,l,f,null,S,s);n.schema.compat&&wr(i.indent,m,s),l=I.range[2];const O=new Ue(C,I);n.options.keepSourceTokens&&(O.srcToken=d),a.items.push(O)}else{y&&s(C.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),S.comment&&(C.comment?C.comment+=`
195
- `+S.comment:C.comment=S.comment);const I=new Ue(C);n.options.keepSourceTokens&&(I.srcToken=d),a.items.push(I)}}return c&&c<l&&s(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,l,c??l],a}function Ix({composeNode:e,composeEmptyNode:t},n,i,s,r){const o=r?.nodeClass??Zt,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let l=i.offset,c=null;for(const{start:d,value:u}of i.items){const p=En(d,{indicator:"seq-item-ind",next:u,offset:l,onError:s,parentIndent:i.indent,startOnNewline:!0});if(!p.found)if(p.anchor||p.tag||u)u?.type==="block-seq"?s(p.end,"BAD_INDENT","All sequence items must start at the same column"):s(l,"MISSING_CHAR","Sequence item without - indicator");else{c=p.end,p.comment&&(a.comment=p.comment);continue}const f=u?e(n,u,p,s):t(n,p.end,d,null,p,s);n.schema.compat&&wr(i.indent,u,s),l=f.range[2],a.items.push(f)}return a.range=[i.offset,l,c??l],a}function li(e,t,n,i){let s="";if(e){let r=!1,o="";for(const a of e){const{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{n&&!r&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const d=l.substring(1)||" ";s?s+=o+d:s=d,o="";break}case"newline":s&&(o+=l),r=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=l.length}}return{comment:s,offset:t}}const Ws="Block collections are not allowed within flow collections",Vs=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Px({composeNode:e,composeEmptyNode:t},n,i,s,r){const o=i.start.source==="{",a=o?"flow map":"flow sequence",l=r?.nodeClass??(o?st:Zt),c=new l(n.schema);c.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=i.offset+i.start.source.length;for(let y=0;y<i.items.length;++y){const w=i.items[y],{start:C,key:S,sep:I,value:O}=w,k=En(C,{flow:a,indicator:"explicit-key-ind",next:S??I?.[0],offset:u,onError:s,parentIndent:i.indent,startOnNewline:!1});if(!k.found){if(!k.anchor&&!k.tag&&!I&&!O){y===0&&k.comma?s(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):y<i.items.length-1&&s(k.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),k.comment&&(c.comment?c.comment+=`
196
- `+k.comment:c.comment=k.comment),u=k.end;continue}!o&&n.options.strict&&ei(S)&&s(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(y===0)k.comma&&s(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(k.comma||s(k.start,"MISSING_CHAR",`Missing , between ${a} items`),k.comment){let T="";e:for(const $ of C)switch($.type){case"comma":case"space":break;case"comment":T=$.source.substring(1);break e;default:break e}if(T){let $=c.items[c.items.length-1];Te($)&&($=$.value??$.key),$.comment?$.comment+=`
197
- `+T:$.comment=T,k.comment=k.comment.substring(T.length+1)}}if(!o&&!I&&!k.found){const T=O?e(n,O,k,s):t(n,k.end,I,null,k,s);c.items.push(T),u=T.range[2],Vs(O)&&s(T.range,"BLOCK_IN_FLOW",Ws)}else{n.atKey=!0;const T=k.end,$=S?e(n,S,k,s):t(n,T,C,null,k,s);Vs(S)&&s($.range,"BLOCK_IN_FLOW",Ws),n.atKey=!1;const W=En(I??[],{flow:a,indicator:"map-value-ind",next:O,offset:$.range[2],onError:s,parentIndent:i.indent,startOnNewline:!1});if(W.found){if(!o&&!k.found&&n.options.strict){if(I)for(const B of I){if(B===W.found)break;if(B.type==="newline"){s(B,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}k.start<W.found.offset-1024&&s(W.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else O&&("source"in O&&O.source?.[0]===":"?s(O,"MISSING_CHAR",`Missing space after : in ${a}`):s(W.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const R=O?e(n,O,W,s):W.found?t(n,W.end,I,null,W,s):null;R?Vs(O)&&s(R.range,"BLOCK_IN_FLOW",Ws):W.comment&&($.comment?$.comment+=`
198
- `+W.comment:$.comment=W.comment);const H=new Ue($,R);if(n.options.keepSourceTokens&&(H.srcToken=w),o){const B=c;Mu(n,B.items,$)&&s(T,"DUPLICATE_KEY","Map keys must be unique"),B.items.push(H)}else{const B=new st(n.schema);B.flow=!0,B.items.push(H);const te=(R??$).range;B.range=[$.range[0],te[1],te[2]],c.items.push(B)}u=R?R.range[2]:W.end}}const p=o?"}":"]",[f,...m]=i.end;let h=u;if(f?.source===p)h=f.offset+f.source.length;else{const y=a[0].toUpperCase()+a.substring(1),w=d?`${y} must end with a ${p}`:`${y} in block collection must be sufficiently indented and end with a ${p}`;s(u,d?"MISSING_CHAR":"BAD_INDENT",w),f&&f.source.length!==1&&m.unshift(f)}if(m.length>0){const y=li(m,h,n.options.strict,s);y.comment&&(c.comment?c.comment+=`
199
- `+y.comment:c.comment=y.comment),c.range=[i.offset,h,y.offset]}else c.range=[i.offset,h,h];return c}function Zs(e,t,n,i,s,r){const o=n.type==="block-map"?Tx(e,t,n,i,r):n.type==="block-seq"?Ix(e,t,n,i,r):Px(e,t,n,i,r),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function Ox(e,t,n,i,s){const r=i.tag,o=r?t.directives.tagName(r.source,p=>s(r,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){const{anchor:p,newlineAfterProp:f}=i,m=p&&r?p.offset>r.offset?p:r:p??r;m&&(!f||f.offset<m.offset)&&s(m,"MISSING_CHAR","Missing newline after block sequence props")}const a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===st.tagName&&a==="map"||o===Zt.tagName&&a==="seq")return Zs(e,t,n,s,o);let l=t.schema.tags.find(p=>p.tag===o&&p.collection===a);if(!l){const p=t.schema.knownTags[o];if(p?.collection===a)t.schema.tags.push(Object.assign({},p,{default:!1})),l=p;else return p?s(r,"BAD_COLLECTION_TYPE",`${p.tag} used for ${a} collection, but expects ${p.collection??"scalar"}`,!0):s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Zs(e,t,n,s,o)}const c=Zs(e,t,n,s,o,l),d=l.resolve?.(c,p=>s(r,"TAG_RESOLVE_FAILED",p),t.options)??c,u=Ee(d)?d:new ie(d);return u.range=c.range,u.tag=o,l?.format&&(u.format=l.format),u}function $x(e,t,n){const i=t.offset,s=Rx(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[i,i,i]};const r=s.mode===">"?ie.BLOCK_FOLDED:ie.BLOCK_LITERAL,o=t.source?Nx(t.source):[];let a=o.length;for(let h=o.length-1;h>=0;--h){const y=o[h][1];if(y===""||y==="\r")a=h;else break}if(a===0){const h=s.chomp==="+"&&o.length>0?`
200
- `.repeat(Math.max(1,o.length-1)):"";let y=i+s.length;return t.source&&(y+=t.source.length),{value:h,type:r,comment:s.comment,range:[i,y,y]}}let l=t.indent+s.indent,c=t.offset+s.length,d=0;for(let h=0;h<a;++h){const[y,w]=o[h];if(w===""||w==="\r")s.indent===0&&y.length>l&&(l=y.length);else{y.length<l&&n(c+y.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(l=y.length),d=h,l===0&&!e.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=y.length+w.length+1}for(let h=o.length-1;h>=a;--h)o[h][0].length>l&&(a=h+1);let u="",p="",f=!1;for(let h=0;h<d;++h)u+=o[h][0].slice(l)+`
201
- `;for(let h=d;h<a;++h){let[y,w]=o[h];c+=y.length+w.length+1;const C=w[w.length-1]==="\r";if(C&&(w=w.slice(0,-1)),w&&y.length<l){const I=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(c-w.length-(C?2:1),"BAD_INDENT",I),y=""}r===ie.BLOCK_LITERAL?(u+=p+y.slice(l)+w,p=`
202
- `):y.length>l||w[0]===" "?(p===" "?p=`
203
- `:!f&&p===`
204
- `&&(p=`
192
+ `}};function Tn(e,{flow:t,indicator:n,next:i,offset:s,onError:r,parentIndent:o,startOnNewline:a}){let l=!1,c=a,d=a,u="",h="",f=!1,m=!1,p=null,y=null,w=null,C=null,S=null,I=null,O=null;for(const $ of e)switch(m&&($.type!=="space"&&$.type!=="newline"&&$.type!=="comma"&&r($.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),p&&(c&&$.type!=="comment"&&$.type!=="newline"&&r(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),$.type){case"space":!t&&(n!=="doc-start"||i?.type!=="flow-collection")&&$.source.includes(" ")&&(p=$),d=!0;break;case"comment":{d||r($,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const W=$.source.substring(1)||" ";u?u+=h+W:u=W,h="",c=!1;break}case"newline":c?u?u+=$.source:(!I||n!=="seq-item-ind")&&(l=!0):h+=$.source,c=!0,f=!0,(y||w)&&(C=$),d=!0;break;case"anchor":y&&r($,"MULTIPLE_ANCHORS","A node can have at most one anchor"),$.source.endsWith(":")&&r($.offset+$.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),y=$,O??(O=$.offset),c=!1,d=!1,m=!0;break;case"tag":{w&&r($,"MULTIPLE_TAGS","A node can have at most one tag"),w=$,O??(O=$.offset),c=!1,d=!1,m=!0;break}case n:(y||w)&&r($,"BAD_PROP_ORDER",`Anchors and tags must be after the ${$.source} indicator`),I&&r($,"UNEXPECTED_TOKEN",`Unexpected ${$.source} in ${t??"collection"}`),I=$,c=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){S&&r($,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),S=$,c=!1,d=!1;break}default:r($,"UNEXPECTED_TOKEN",`Unexpected ${$.type} token`),c=!1,d=!1}const k=e[e.length-1],E=k?k.offset+k.source.length:s;return m&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&r(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p&&(c&&p.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&r(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:I,spaceBefore:l,comment:u,hasNewline:f,anchor:y,tag:w,newlineAfterProp:C,end:E,start:O??E}}function ei(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
193
+ `))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(ei(t.key)||ei(t.value))return!0}return!1;default:return!0}}function wr(e,t,n){if(t?.type==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&ei(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Mu(e,t,n){const{uniqueKeys:i}=e.options;if(i===!1)return!1;const s=typeof i=="function"?i:(r,o)=>r===o||be(r)&&be(o)&&r.value===o.value;return t.some(r=>s(r.key,n))}const Ba="All mapping items must start at the same column";function Ex({composeNode:e,composeEmptyNode:t},n,i,s,r){const o=r?.nodeClass??st,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let l=i.offset,c=null;for(const d of i.items){const{start:u,key:h,sep:f,value:m}=d,p=Tn(u,{indicator:"explicit-key-ind",next:h??f?.[0],offset:l,onError:s,parentIndent:i.indent,startOnNewline:!0}),y=!p.found;if(y){if(h&&(h.type==="block-seq"?s(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==i.indent&&s(l,"BAD_INDENT",Ba)),!p.anchor&&!p.tag&&!f){c=p.end,p.comment&&(a.comment?a.comment+=`
194
+ `+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||ei(h))&&s(h??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==i.indent&&s(l,"BAD_INDENT",Ba);n.atKey=!0;const w=p.end,C=h?e(n,h,p,s):t(n,w,u,null,p,s);n.schema.compat&&wr(i.indent,h,s),n.atKey=!1,Mu(n,a.items,C)&&s(w,"DUPLICATE_KEY","Map keys must be unique");const S=Tn(f??[],{indicator:"map-value-ind",next:m,offset:C.range[2],onError:s,parentIndent:i.indent,startOnNewline:!h||h.type==="block-scalar"});if(l=S.end,S.found){y&&(m?.type==="block-map"&&!S.hasNewline&&s(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start<S.found.offset-1024&&s(C.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const I=m?e(n,m,S,s):t(n,l,f,null,S,s);n.schema.compat&&wr(i.indent,m,s),l=I.range[2];const O=new Ue(C,I);n.options.keepSourceTokens&&(O.srcToken=d),a.items.push(O)}else{y&&s(C.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),S.comment&&(C.comment?C.comment+=`
195
+ `+S.comment:C.comment=S.comment);const I=new Ue(C);n.options.keepSourceTokens&&(I.srcToken=d),a.items.push(I)}}return c&&c<l&&s(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,l,c??l],a}function Ix({composeNode:e,composeEmptyNode:t},n,i,s,r){const o=r?.nodeClass??Zt,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let l=i.offset,c=null;for(const{start:d,value:u}of i.items){const h=Tn(d,{indicator:"seq-item-ind",next:u,offset:l,onError:s,parentIndent:i.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||u)u?.type==="block-seq"?s(h.end,"BAD_INDENT","All sequence items must start at the same column"):s(l,"MISSING_CHAR","Sequence item without - indicator");else{c=h.end,h.comment&&(a.comment=h.comment);continue}const f=u?e(n,u,h,s):t(n,h.end,d,null,h,s);n.schema.compat&&wr(i.indent,u,s),l=f.range[2],a.items.push(f)}return a.range=[i.offset,l,c??l],a}function li(e,t,n,i){let s="";if(e){let r=!1,o="";for(const a of e){const{source:l,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{n&&!r&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const d=l.substring(1)||" ";s?s+=o+d:s=d,o="";break}case"newline":s&&(o+=l),r=!0;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=l.length}}return{comment:s,offset:t}}const Ws="Block collections are not allowed within flow collections",Vs=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Px({composeNode:e,composeEmptyNode:t},n,i,s,r){const o=i.start.source==="{",a=o?"flow map":"flow sequence",l=r?.nodeClass??(o?st:Zt),c=new l(n.schema);c.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=i.offset+i.start.source.length;for(let y=0;y<i.items.length;++y){const w=i.items[y],{start:C,key:S,sep:I,value:O}=w,k=Tn(C,{flow:a,indicator:"explicit-key-ind",next:S??I?.[0],offset:u,onError:s,parentIndent:i.indent,startOnNewline:!1});if(!k.found){if(!k.anchor&&!k.tag&&!I&&!O){y===0&&k.comma?s(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):y<i.items.length-1&&s(k.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),k.comment&&(c.comment?c.comment+=`
196
+ `+k.comment:c.comment=k.comment),u=k.end;continue}!o&&n.options.strict&&ei(S)&&s(S,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(y===0)k.comma&&s(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(k.comma||s(k.start,"MISSING_CHAR",`Missing , between ${a} items`),k.comment){let E="";e:for(const $ of C)switch($.type){case"comma":case"space":break;case"comment":E=$.source.substring(1);break e;default:break e}if(E){let $=c.items[c.items.length-1];Ee($)&&($=$.value??$.key),$.comment?$.comment+=`
197
+ `+E:$.comment=E,k.comment=k.comment.substring(E.length+1)}}if(!o&&!I&&!k.found){const E=O?e(n,O,k,s):t(n,k.end,I,null,k,s);c.items.push(E),u=E.range[2],Vs(O)&&s(E.range,"BLOCK_IN_FLOW",Ws)}else{n.atKey=!0;const E=k.end,$=S?e(n,S,k,s):t(n,E,C,null,k,s);Vs(S)&&s($.range,"BLOCK_IN_FLOW",Ws),n.atKey=!1;const W=Tn(I??[],{flow:a,indicator:"map-value-ind",next:O,offset:$.range[2],onError:s,parentIndent:i.indent,startOnNewline:!1});if(W.found){if(!o&&!k.found&&n.options.strict){if(I)for(const B of I){if(B===W.found)break;if(B.type==="newline"){s(B,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}k.start<W.found.offset-1024&&s(W.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else O&&("source"in O&&O.source?.[0]===":"?s(O,"MISSING_CHAR",`Missing space after : in ${a}`):s(W.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const R=O?e(n,O,W,s):W.found?t(n,W.end,I,null,W,s):null;R?Vs(O)&&s(R.range,"BLOCK_IN_FLOW",Ws):W.comment&&($.comment?$.comment+=`
198
+ `+W.comment:$.comment=W.comment);const H=new Ue($,R);if(n.options.keepSourceTokens&&(H.srcToken=w),o){const B=c;Mu(n,B.items,$)&&s(E,"DUPLICATE_KEY","Map keys must be unique"),B.items.push(H)}else{const B=new st(n.schema);B.flow=!0,B.items.push(H);const te=(R??$).range;B.range=[$.range[0],te[1],te[2]],c.items.push(B)}u=R?R.range[2]:W.end}}const h=o?"}":"]",[f,...m]=i.end;let p=u;if(f?.source===h)p=f.offset+f.source.length;else{const y=a[0].toUpperCase()+a.substring(1),w=d?`${y} must end with a ${h}`:`${y} in block collection must be sufficiently indented and end with a ${h}`;s(u,d?"MISSING_CHAR":"BAD_INDENT",w),f&&f.source.length!==1&&m.unshift(f)}if(m.length>0){const y=li(m,p,n.options.strict,s);y.comment&&(c.comment?c.comment+=`
199
+ `+y.comment:c.comment=y.comment),c.range=[i.offset,p,y.offset]}else c.range=[i.offset,p,p];return c}function Zs(e,t,n,i,s,r){const o=n.type==="block-map"?Ex(e,t,n,i,r):n.type==="block-seq"?Ix(e,t,n,i,r):Px(e,t,n,i,r),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function Ox(e,t,n,i,s){const r=i.tag,o=r?t.directives.tagName(r.source,h=>s(r,"TAG_RESOLVE_FAILED",h)):null;if(n.type==="block-seq"){const{anchor:h,newlineAfterProp:f}=i,m=h&&r?h.offset>r.offset?h:r:h??r;m&&(!f||f.offset<m.offset)&&s(m,"MISSING_CHAR","Missing newline after block sequence props")}const a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===st.tagName&&a==="map"||o===Zt.tagName&&a==="seq")return Zs(e,t,n,s,o);let l=t.schema.tags.find(h=>h.tag===o&&h.collection===a);if(!l){const h=t.schema.knownTags[o];if(h?.collection===a)t.schema.tags.push(Object.assign({},h,{default:!1})),l=h;else return h?s(r,"BAD_COLLECTION_TYPE",`${h.tag} used for ${a} collection, but expects ${h.collection??"scalar"}`,!0):s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Zs(e,t,n,s,o)}const c=Zs(e,t,n,s,o,l),d=l.resolve?.(c,h=>s(r,"TAG_RESOLVE_FAILED",h),t.options)??c,u=Te(d)?d:new ie(d);return u.range=c.range,u.tag=o,l?.format&&(u.format=l.format),u}function $x(e,t,n){const i=t.offset,s=Rx(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[i,i,i]};const r=s.mode===">"?ie.BLOCK_FOLDED:ie.BLOCK_LITERAL,o=t.source?Nx(t.source):[];let a=o.length;for(let p=o.length-1;p>=0;--p){const y=o[p][1];if(y===""||y==="\r")a=p;else break}if(a===0){const p=s.chomp==="+"&&o.length>0?`
200
+ `.repeat(Math.max(1,o.length-1)):"";let y=i+s.length;return t.source&&(y+=t.source.length),{value:p,type:r,comment:s.comment,range:[i,y,y]}}let l=t.indent+s.indent,c=t.offset+s.length,d=0;for(let p=0;p<a;++p){const[y,w]=o[p];if(w===""||w==="\r")s.indent===0&&y.length>l&&(l=y.length);else{y.length<l&&n(c+y.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(l=y.length),d=p,l===0&&!e.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=y.length+w.length+1}for(let p=o.length-1;p>=a;--p)o[p][0].length>l&&(a=p+1);let u="",h="",f=!1;for(let p=0;p<d;++p)u+=o[p][0].slice(l)+`
201
+ `;for(let p=d;p<a;++p){let[y,w]=o[p];c+=y.length+w.length+1;const C=w[w.length-1]==="\r";if(C&&(w=w.slice(0,-1)),w&&y.length<l){const I=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(c-w.length-(C?2:1),"BAD_INDENT",I),y=""}r===ie.BLOCK_LITERAL?(u+=h+y.slice(l)+w,h=`
202
+ `):y.length>l||w[0]===" "?(h===" "?h=`
203
+ `:!f&&h===`
204
+ `&&(h=`
205
205
 
206
- `),u+=p+y.slice(l)+w,p=`
207
- `,f=!0):w===""?p===`
206
+ `),u+=h+y.slice(l)+w,h=`
207
+ `,f=!0):w===""?h===`
208
208
  `?u+=`
209
- `:p=`
210
- `:(u+=p+w,p=" ",f=!1)}switch(s.chomp){case"-":break;case"+":for(let h=a;h<o.length;++h)u+=`
211
- `+o[h][0].slice(l);u[u.length-1]!==`
209
+ `:h=`
210
+ `:(u+=h+w,h=" ",f=!1)}switch(s.chomp){case"-":break;case"+":for(let p=a;p<o.length;++p)u+=`
211
+ `+o[p][0].slice(l);u[u.length-1]!==`
212
212
  `&&(u+=`
213
213
  `);break;default:u+=`
214
- `}const m=i+s.length+t.source.length;return{value:u,type:r,comment:s.comment,range:[i,m,m]}}function Rx({offset:e,props:t},n,i){if(t[0].type!=="block-scalar-header")return i(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],r=s[0];let o=0,a="",l=-1;for(let p=1;p<s.length;++p){const f=s[p];if(!a&&(f==="-"||f==="+"))a=f;else{const m=Number(f);!o&&m?o=m:l===-1&&(l=e+p)}}l!==-1&&i(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let c=!1,d="",u=s.length;for(let p=1;p<t.length;++p){const f=t[p];switch(f.type){case"space":c=!0;case"newline":u+=f.source.length;break;case"comment":n&&!c&&i(f,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=f.source.length,d=f.source.substring(1);break;case"error":i(f,"UNEXPECTED_TOKEN",f.message),u+=f.source.length;break;default:{const m=`Unexpected token in block scalar header: ${f.type}`;i(f,"UNEXPECTED_TOKEN",m);const h=f.source;h&&typeof h=="string"&&(u+=h.length)}}}return{mode:r,indent:o,chomp:a,comment:d,length:u}}function Nx(e){const t=e.split(/\n( *)/),n=t[0],i=n.match(/^( *)/),r=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)r.push([t[o],t[o+1]]);return r}function Lx(e,t,n){const{offset:i,type:s,source:r,end:o}=e;let a,l;const c=(p,f,m)=>n(i+p,f,m);switch(s){case"scalar":a=ie.PLAIN,l=Fx(r,c);break;case"single-quoted-scalar":a=ie.QUOTE_SINGLE,l=Dx(r,c);break;case"double-quoted-scalar":a=ie.QUOTE_DOUBLE,l=zx(r,c);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[i,i+r.length,i+r.length]}}const d=i+r.length,u=li(o,d,t,n);return{value:l,type:a,comment:u.comment,range:[i,d,u.offset]}}function Fx(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),ju(e)}function Dx(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),ju(e.slice(1,-1)).replace(/''/g,"'")}function ju(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
214
+ `}const m=i+s.length+t.source.length;return{value:u,type:r,comment:s.comment,range:[i,m,m]}}function Rx({offset:e,props:t},n,i){if(t[0].type!=="block-scalar-header")return i(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],r=s[0];let o=0,a="",l=-1;for(let h=1;h<s.length;++h){const f=s[h];if(!a&&(f==="-"||f==="+"))a=f;else{const m=Number(f);!o&&m?o=m:l===-1&&(l=e+h)}}l!==-1&&i(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let c=!1,d="",u=s.length;for(let h=1;h<t.length;++h){const f=t[h];switch(f.type){case"space":c=!0;case"newline":u+=f.source.length;break;case"comment":n&&!c&&i(f,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=f.source.length,d=f.source.substring(1);break;case"error":i(f,"UNEXPECTED_TOKEN",f.message),u+=f.source.length;break;default:{const m=`Unexpected token in block scalar header: ${f.type}`;i(f,"UNEXPECTED_TOKEN",m);const p=f.source;p&&typeof p=="string"&&(u+=p.length)}}}return{mode:r,indent:o,chomp:a,comment:d,length:u}}function Nx(e){const t=e.split(/\n( *)/),n=t[0],i=n.match(/^( *)/),r=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)r.push([t[o],t[o+1]]);return r}function Lx(e,t,n){const{offset:i,type:s,source:r,end:o}=e;let a,l;const c=(h,f,m)=>n(i+h,f,m);switch(s){case"scalar":a=ie.PLAIN,l=Fx(r,c);break;case"single-quoted-scalar":a=ie.QUOTE_SINGLE,l=Dx(r,c);break;case"double-quoted-scalar":a=ie.QUOTE_DOUBLE,l=zx(r,c);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[i,i+r.length,i+r.length]}}const d=i+r.length,u=li(o,d,t,n);return{value:l,type:a,comment:u.comment,range:[i,d,u.offset]}}function Fx(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),ju(e)}function Dx(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),ju(e.slice(1,-1)).replace(/''/g,"'")}function ju(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
215
215
  `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
216
216
  `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=t.exec(e);if(!i)return e;let s=i[1],r=" ",o=t.lastIndex;for(n.lastIndex=o;i=n.exec(e);)i[1]===""?r===`
217
217
  `?s+=r:r=`
@@ -226,11 +226,11 @@ ${c}
226
226
  `);)i===`
227
227
  `&&(n+=`
228
228
  `),t+=1,i=e[t+1];return n||(n=" "),{fold:n,offset:t}}const jx={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
229
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Bx(e,t,n,i){const s=e.substr(t,n),o=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;try{return String.fromCodePoint(o)}catch{const a=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}function Bu(e,t,n,i){const{value:s,type:r,comment:o,range:a}=t.type==="block-scalar"?$x(e,t,i):Lx(t,e.options.strict,i),l=n?e.directives.tagName(n.source,u=>i(n,"TAG_RESOLVE_FAILED",u)):null;let c;e.options.stringKeys&&e.atKey?c=e.schema[wt]:l?c=Ux(e.schema,s,l,n,i):t.type==="scalar"?c=Hx(e,s,t,i):c=e.schema[wt];let d;try{const u=c.resolve(s,p=>i(n??t,"TAG_RESOLVE_FAILED",p),e.options);d=be(u)?u:new ie(u)}catch(u){const p=u instanceof Error?u.message:String(u);i(n??t,"TAG_RESOLVE_FAILED",p),d=new ie(s)}return d.range=a,d.source=s,r&&(d.type=r),l&&(d.tag=l),c.format&&(d.format=c.format),o&&(d.comment=o),d}function Ux(e,t,n,i,s){if(n==="!")return e[wt];const r=[];for(const a of e.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)r.push(a);else return a;for(const a of r)if(a.test?.test(t))return a;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[wt])}function Hx({atKey:e,directives:t,schema:n},i,s,r){const o=n.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(i))||n[wt];if(n.compat){const a=n.compat.find(l=>l.default&&l.test?.test(i))??n[wt];if(o.tag!==a.tag){const l=t.tagString(o.tag),c=t.tagString(a.tag),d=`Value may be parsed as either ${l} or ${c}`;r(s,"TAG_RESOLVE_FAILED",d,!0)}}return o}function qx(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let s=t[i];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++i];s?.type==="space";)e+=s.source.length,s=t[++i];break}}return e}const Wx={composeNode:Uu,composeEmptyNode:go};function Uu(e,t,n,i){const s=e.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=n;let c,d=!0;switch(t.type){case"alias":c=Vx(e,t,i),(a||l)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Bu(e,t,l,i),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=Ox(Wx,e,t,n,i),a&&(c.anchor=a.source.substring(1))}catch(u){const p=u instanceof Error?u.message:String(u);i(t,"RESOURCE_EXHAUSTION",p)}break;default:{const u=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",u),d=!1}}return c??(c=go(e,t.offset,void 0,null,n,i)),a&&c.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!be(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&i(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?c.comment=o:c.commentBefore=o),e.options.keepSourceTokens&&d&&(c.srcToken=t),c}function go(e,t,n,i,{spaceBefore:s,comment:r,anchor:o,tag:a,end:l},c){const d={type:"scalar",offset:qx(t,n,i),indent:-1,source:""},u=Bu(e,d,a,c);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(u.spaceBefore=!0),r&&(u.comment=r,u.range[2]=l),u}function Vx({options:e},{offset:t,source:n,end:i},s){const r=new io(n.substring(1));r.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&s(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,a=li(i,o,e.strict,s);return r.range=[t,o,a.offset],a.comment&&(r.comment=a.comment),r}function Zx(e,t,{offset:n,start:i,value:s,end:r},o){const a=Object.assign({_directives:t},e),l=new Fn(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=En(i,{indicator:"doc-start",next:s??r?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(l.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=s?Uu(c,s,d,o):go(c,d.end,i,null,d,o);const u=l.contents.range[2],p=li(r,u,!1,o);return p.comment&&(l.comment=p.comment),l.range=[n,u,p.offset],l}function Mn(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function Ua(e){let t="",n=!1,i=!1;for(let s=0;s<e.length;++s){const r=e[s];switch(r[0]){case"#":t+=(t===""?"":i?`
229
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Bx(e,t,n,i){const s=e.substr(t,n),o=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;try{return String.fromCodePoint(o)}catch{const a=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}function Bu(e,t,n,i){const{value:s,type:r,comment:o,range:a}=t.type==="block-scalar"?$x(e,t,i):Lx(t,e.options.strict,i),l=n?e.directives.tagName(n.source,u=>i(n,"TAG_RESOLVE_FAILED",u)):null;let c;e.options.stringKeys&&e.atKey?c=e.schema[wt]:l?c=Ux(e.schema,s,l,n,i):t.type==="scalar"?c=Hx(e,s,t,i):c=e.schema[wt];let d;try{const u=c.resolve(s,h=>i(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=be(u)?u:new ie(u)}catch(u){const h=u instanceof Error?u.message:String(u);i(n??t,"TAG_RESOLVE_FAILED",h),d=new ie(s)}return d.range=a,d.source=s,r&&(d.type=r),l&&(d.tag=l),c.format&&(d.format=c.format),o&&(d.comment=o),d}function Ux(e,t,n,i,s){if(n==="!")return e[wt];const r=[];for(const a of e.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)r.push(a);else return a;for(const a of r)if(a.test?.test(t))return a;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[wt])}function Hx({atKey:e,directives:t,schema:n},i,s,r){const o=n.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(i))||n[wt];if(n.compat){const a=n.compat.find(l=>l.default&&l.test?.test(i))??n[wt];if(o.tag!==a.tag){const l=t.tagString(o.tag),c=t.tagString(a.tag),d=`Value may be parsed as either ${l} or ${c}`;r(s,"TAG_RESOLVE_FAILED",d,!0)}}return o}function qx(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let s=t[i];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++i];s?.type==="space";)e+=s.source.length,s=t[++i];break}}return e}const Wx={composeNode:Uu,composeEmptyNode:go};function Uu(e,t,n,i){const s=e.atKey,{spaceBefore:r,comment:o,anchor:a,tag:l}=n;let c,d=!0;switch(t.type){case"alias":c=Vx(e,t,i),(a||l)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Bu(e,t,l,i),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=Ox(Wx,e,t,n,i),a&&(c.anchor=a.source.substring(1))}catch(u){const h=u instanceof Error?u.message:String(u);i(t,"RESOURCE_EXHAUSTION",h)}break;default:{const u=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",u),d=!1}}return c??(c=go(e,t.offset,void 0,null,n,i)),a&&c.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!be(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&i(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(c.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?c.comment=o:c.commentBefore=o),e.options.keepSourceTokens&&d&&(c.srcToken=t),c}function go(e,t,n,i,{spaceBefore:s,comment:r,anchor:o,tag:a,end:l},c){const d={type:"scalar",offset:qx(t,n,i),indent:-1,source:""},u=Bu(e,d,a,c);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(u.spaceBefore=!0),r&&(u.comment=r,u.range[2]=l),u}function Vx({options:e},{offset:t,source:n,end:i},s){const r=new io(n.substring(1));r.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&s(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,a=li(i,o,e.strict,s);return r.range=[t,o,a.offset],a.comment&&(r.comment=a.comment),r}function Zx(e,t,{offset:n,start:i,value:s,end:r},o){const a=Object.assign({_directives:t},e),l=new Fn(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=Tn(i,{indicator:"doc-start",next:s??r?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(l.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=s?Uu(c,s,d,o):go(c,d.end,i,null,d,o);const u=l.contents.range[2],h=li(r,u,!1,o);return h.comment&&(l.comment=h.comment),l.range=[n,u,h.offset],l}function Mn(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function Ua(e){let t="",n=!1,i=!1;for(let s=0;s<e.length;++s){const r=e[s];switch(r[0]){case"#":t+=(t===""?"":i?`
230
230
 
231
231
  `:`
232
- `)+(r.substring(1)||" "),n=!0,i=!1;break;case"%":e[s+1]?.[0]!=="#"&&(s+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:t,afterEmptyLine:i}}class Kx{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,s,r)=>{const o=Mn(n);r?this.warnings.push(new Ex(o,i,s)):this.errors.push(new qn(o,i,s))},this.directives=new Me({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:s}=Ua(this.prelude);if(i){const r=t.contents;if(n)t.comment=t.comment?`${t.comment}
233
- ${i}`:i;else if(s||t.directives.docStart||!r)t.commentBefore=i;else if(Ae(r)&&!r.flow&&r.items.length>0){let o=r.items[0];Te(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${i}
232
+ `)+(r.substring(1)||" "),n=!0,i=!1;break;case"%":e[s+1]?.[0]!=="#"&&(s+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:t,afterEmptyLine:i}}class Kx{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,s,r)=>{const o=Mn(n);r?this.warnings.push(new Tx(o,i,s)):this.errors.push(new qn(o,i,s))},this.directives=new Me({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:s}=Ua(this.prelude);if(i){const r=t.contents;if(n)t.comment=t.comment?`${t.comment}
233
+ ${i}`:i;else if(s||t.directives.docStart||!r)t.commentBefore=i;else if(Ae(r)&&!r.flow&&r.items.length>0){let o=r.items[0];Ee(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${i}
234
234
  ${a}`:i}else{const o=r.commentBefore;r.commentBefore=o?`${i}
235
235
  ${o}`:i}}if(n){for(let r=0;r<this.errors.length;++r)t.errors.push(this.errors[r]);for(let r=0;r<this.warnings.length;++r)t.warnings.push(this.warnings[r])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ua(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,i=-1){for(const s of t)yield*this.next(s);yield*this.end(n,i)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,i,s)=>{const r=Mn(t);r[0]+=n,this.onError(r,"BAD_DIRECTIVE",i,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=Zx(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new qn(Mn(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new qn(Mn(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=li(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const i=this.doc.comment;this.doc.comment=i?`${i}
236
236
  ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new qn(Mn(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const i=Object.assign({_directives:this.directives},this.options),s=new Fn(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}}const Hu="\uFEFF",qu="",Wu="",kr="";function Gx(e){switch(e){case Hu:return"byte-order-mark";case qu:return"doc-mode";case Wu:return"flow-error-end";case kr:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
@@ -258,12 +258,12 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
258
258
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
259
259
  `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2]?.value?.end;if(Array.isArray(s)){es(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const i=!this.onKeyLine&&this.indent===t.indent,s=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let r=[];if(s&&n.sep&&!n.value){const o=[];for(let a=0;a<n.sep.length;++a){const l=n.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>t.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(r.push(this.sourceToken),t.items.push({start:r}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(r.push(this.sourceToken),t.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ot(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(Vu(n.key)&&!Ot(n.sep,"newline")){const o=sn(n.start),a=n.key,l=n.sep;l.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else r.length>0?n.sep=n.sep.concat(r,this.sourceToken):n.sep.push(this.sourceToken);else if(Ot(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=sn(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?t.items.push({start:r,key:null,sep:[this.sourceToken]}):Ot(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);s||n.value?(t.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ot(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&t.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2]?.value?.end;if(Array.isArray(s)){es(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Ot(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const i=this.startBlockValue(t);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const s=Ai(i),r=sn(s);Wa(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
260
260
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
261
- `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Ai(t),i=sn(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Ai(t),i=sn(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function t0(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Xx||null,prettyErrors:t}}function n0(e,t={}){const{lineCounter:n,prettyErrors:i}=t0(t),s=new e0(n?.addNewLine),r=new Kx(t);let o=null;for(const a of r.compose(s.parse(e),!0,e.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new qn(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(ja(e,n)),o.warnings.forEach(ja(e,n))),o}function Zu(e,t,n){let i;const s=n0(e,n);if(!s)return null;if(s.warnings.forEach(r=>yu(s.options.logLevel,r)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:i},n))}function Ku(e,t,n){let i=null;if(Array.isArray(t)&&(i=t),e===void 0){const{keepUndefined:s}={};if(!s)return}return oi(e)&&!i?e.toString(n):new Fn(e,i,n).toString(n)}const i0=/^---\r?\n([\s\S]*?\r?\n)?---[ \t]*(?:\r?\n|$)/,Gu=e=>ds.test(`${e}:`);function Yu(e){if(!e.trim())return{};try{const t=Zu(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Va(e){return Yu(e)}function Ei(e){let t=/^("(?:[^"\\]|\\.)*")[ \t]*:(?=[ \t]|$)/.exec(e);if(t)try{return{key:JSON.parse(t[1]),token:t[1]}}catch{return null}return t=/^('(?:[^']|'')*')[ \t]*:(?=[ \t]|$)/.exec(e),t?{key:t[1].slice(1,-1).replace(/''/g,"'"),token:t[1]}:/^(?:[?:,[\]{}#&*!|>'"%@`]|-[ \t]|-$)/.test(e)?null:(t=/^(.+?)[ \t]*:(?=[ \t]|$)/.exec(e),t?{key:t[1],token:t[1]}:null)}function Gs(e,t,n){const i=new Fn({[e]:t});if(n){const s=i.get(e,!0);($n(s)||On(s))&&(s.flow=!0)}return i.toString({lineWidth:0,flowCollectionPadding:!1}).replace(/\n+$/,"").split(`
261
+ `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Ai(t),i=sn(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Ai(t),i=sn(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function t0(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Xx||null,prettyErrors:t}}function n0(e,t={}){const{lineCounter:n,prettyErrors:i}=t0(t),s=new e0(n?.addNewLine),r=new Kx(t);let o=null;for(const a of r.compose(s.parse(e),!0,e.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new qn(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(ja(e,n)),o.warnings.forEach(ja(e,n))),o}function Zu(e,t,n){let i;const s=n0(e,n);if(!s)return null;if(s.warnings.forEach(r=>yu(s.options.logLevel,r)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:i},n))}function Ku(e,t,n){let i=null;if(Array.isArray(t)&&(i=t),e===void 0){const{keepUndefined:s}={};if(!s)return}return oi(e)&&!i?e.toString(n):new Fn(e,i,n).toString(n)}const i0=/^---\r?\n([\s\S]*?\r?\n)?---[ \t]*(?:\r?\n|$)/,Gu=e=>ds.test(`${e}:`);function Yu(e){if(!e.trim())return{};try{const t=Zu(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Va(e){return Yu(e)}function Ti(e){let t=/^("(?:[^"\\]|\\.)*")[ \t]*:(?=[ \t]|$)/.exec(e);if(t)try{return{key:JSON.parse(t[1]),token:t[1]}}catch{return null}return t=/^('(?:[^']|'')*')[ \t]*:(?=[ \t]|$)/.exec(e),t?{key:t[1].slice(1,-1).replace(/''/g,"'"),token:t[1]}:/^(?:[?:,[\]{}#&*!|>'"%@`]|-[ \t]|-$)/.test(e)?null:(t=/^(.+?)[ \t]*:(?=[ \t]|$)/.exec(e),t?{key:t[1],token:t[1]}:null)}function Gs(e,t,n){const i=new Fn({[e]:t});if(n){const s=i.get(e,!0);($n(s)||On(s))&&(s.flow=!0)}return i.toString({lineWidth:0,flowCollectionPadding:!1}).replace(/\n+$/,"").split(`
262
262
  `)}function Ju(e,t,n,i){const s=e?e.includes(`\r
263
263
  `):n===`\r
264
264
  `,r=e.endsWith(`
265
265
  `),o=e?(r?e.slice(0,-1):e).split(`
266
- `).map(d=>s?d.replace(/\r$/,""):d):[],a=Yr(o),l=[];if("rename"in t){const{from:d,to:u}=t.rename,p=Ei(Gs(u,null,!1)[0])?.token??u;for(const f of a){const m=Ei(f[0]);l.push(...m&&m.key===d?[p+f[0].slice(m.token.length),...f.slice(1)]:f)}}else{const d=new Set;for(const u of a){const p=Ei(u[0]);if(!p||!Object.prototype.hasOwnProperty.call(t.set,p.key)){l.push(...u);continue}const f=t.set[p.key];if(f===void 0||d.has(p.key))continue;if(d.add(p.key),i&&Object.prototype.hasOwnProperty.call(i,p.key)&&ti(i[p.key],f)){l.push(...u);continue}const m=Gs(p.key,f,u.length===1&&/^[[{]/.test(u[0].slice(p.token.length).replace(/^[ \t]*:[ \t]*/,""))),h=Ei(m[0]);h&&h.token!==p.token&&(m[0]=p.token+m[0].slice(h.token.length)),l.push(...m)}for(const[u,p]of Object.entries(t.set))p!==void 0&&!d.has(u)&&l.push(...Gs(u,p,!1))}const c=s?`\r
266
+ `).map(d=>s?d.replace(/\r$/,""):d):[],a=Yr(o),l=[];if("rename"in t){const{from:d,to:u}=t.rename,h=Ti(Gs(u,null,!1)[0])?.token??u;for(const f of a){const m=Ti(f[0]);l.push(...m&&m.key===d?[h+f[0].slice(m.token.length),...f.slice(1)]:f)}}else{const d=new Set;for(const u of a){const h=Ti(u[0]);if(!h||!Object.prototype.hasOwnProperty.call(t.set,h.key)){l.push(...u);continue}const f=t.set[h.key];if(f===void 0||d.has(h.key))continue;if(d.add(h.key),i&&Object.prototype.hasOwnProperty.call(i,h.key)&&ti(i[h.key],f)){l.push(...u);continue}const m=Gs(h.key,f,u.length===1&&/^[[{]/.test(u[0].slice(h.token.length).replace(/^[ \t]*:[ \t]*/,""))),p=Ti(m[0]);p&&p.token!==h.token&&(m[0]=h.token+m[0].slice(p.token.length)),l.push(...m)}for(const[u,h]of Object.entries(t.set))h!==void 0&&!d.has(u)&&l.push(...Gs(u,h,!1))}const c=s?`\r
267
267
  `:`
268
268
  `;return l.length?l.join(c)+(r||!e?c:""):""}function ts(e){if(!e.trim())return{};try{const t=Zu(e);return t==null?{}:typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}function ti(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||typeof t!="object"||!e||!t)return!1;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((s,r)=>ti(s,t[r]));const n=Object.keys(e),i=Object.keys(t);return n.length===i.length&&n.every(s=>Object.prototype.hasOwnProperty.call(t,s)&&ti(e[s],t[s]))}function Qu(e,t){const n={...e};if("rename"in t)return Object.prototype.hasOwnProperty.call(n,t.rename.from)&&(n[t.rename.to]=n[t.rename.from],delete n[t.rename.from]),n;for(const[i,s]of Object.entries(t.set))s===void 0?delete n[i]:n[i]=s;return n}function Xu(e,t,n){const i=ts(e);if(!i)return null;const s=Qu(i,t),r=Ju(e,t,n,i),o=ts(r);return o&&ti(o,s)?r:(console.warn("[amadeus] line-level frontmatter edit did not verify; rewriting the block"),Object.keys(s).length?Ku(s).replace(/\n+$/,"")+(e.endsWith(`
269
269
  `)?`
@@ -280,19 +280,19 @@ ${s}`:`${c}
280
280
  `)))ds.test(a[0])?n.push(...a):i.push(...a);const s=Yu(i.join(`
281
281
  `));for(const[a,l]of Object.entries(t))l===void 0?delete s[a]:s[a]=l;const r=Object.keys(s).length?Ku(s).replace(/\n+$/,""):"",o=[...n,...r?[r]:[]];return o.length?`${o.join(`
282
282
  `)}
283
- `:""}function R_(e,t){const n={};for(const[s,r]of Object.entries(t))Gu(s)||(n[s]=r);const i=s0(e,n);return i==null?null:i.replace(/\r?\n+$/,"")}function l0(e){return typeof e=="boolean"?"checkbox":Array.isArray(e)?"multiselect":typeof e=="number"&&Number.isFinite(e)?"number":typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)?"date":"text"}function N_(e,t){switch(t){case"checkbox":return e===!0;case"number":if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){const n=Number.parseFloat(e);if(Number.isFinite(n))return n}return null;case"multiselect":return Array.isArray(e)?e.map(String):e==null||e===""?[]:[String(e)];case"date":return typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)?e:"";default:return e==null?"":Array.isArray(e)?e.map(String).join(", "):String(e)}}function L_(e,t){switch(t){case"checkbox":return e===!0?!0:void 0;case"number":return typeof e=="number"&&Number.isFinite(e)?e:void 0;case"multiselect":return Array.isArray(e)&&e.length?e:void 0;case"date":return typeof e=="string"&&e?e:void 0;default:return(typeof e=="string"?e:e==null?"":String(e))||void 0}}function F_(e,t){const n=e.map(s=>({...s,options:s.options?[...s.options]:void 0})),i=new Map(n.map(s=>[s.id,s]));if(!i.has(Un)){const s={id:Un,name:"Page Name",type:"page"};n.unshift(s),i.set(Un,s)}for(const s of t)for(const[r,o]of Object.entries(s)){if(r===Un||i.has(r))continue;const a={id:r,name:r,type:l0(o)};n.push(a),i.set(r,a)}for(const s of n){if(s.type!=="select"&&s.type!=="multiselect")continue;const r=new Set(s.options??[]);for(const o of t){const a=o[s.id];Array.isArray(a)?a.forEach(l=>r.add(String(l))):typeof a=="string"&&a&&r.add(a)}s.options=[...r]}return n}function D_(e,t){const n=e.lastIndexOf("/"),i=n<0?"":e.slice(0,n+1),s=n<0?e:e.slice(n+1),r=s.lastIndexOf("."),o=r>0?s.slice(0,r):s,a=r>0?s.slice(r):"",l=d=>String(d).padStart(2,"0"),c=`${t.getFullYear()}-${l(t.getMonth()+1)}-${l(t.getDate())} ${l(t.getHours())}${l(t.getMinutes())}`;return`${i}${o} (conflict ${c})${a}`}function z_(e,t){if(t<2)return e;const n=e.lastIndexOf("."),i=n>e.lastIndexOf("/")&&n>e.lastIndexOf(")"),s=i?e.slice(0,n):e,r=i?e.slice(n):"";return`${s}-${t}${r}`}function Wn(e){let t=3735928559,n=1103547991;for(let s=0;s<e.length;s++){const r=e.charCodeAt(s);t=Math.imul(t^r,2654435761),n=Math.imul(n^r,1597334677)}t=Math.imul(t^t>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(t^t>>>13,3266489909);const i=4294967296*(2097151&n)+(t>>>0);return`${e.length.toString(36)}-${i.toString(36)}`}const ed=e=>/\.pdf$/i.test(e.trim()),M_=e=>/^\/|^[A-Za-z]:[\\/]/.test(e);function j_(e){let t=e.trim();const n=t.search(/\\?\|/);n>=0&&(t=t.slice(0,n));const i=t.indexOf("#");return i>=0&&(t=t.slice(0,i)),ed(t)}function c0(e){const t=[`page=${Math.max(1,Math.trunc(e.page)||1)}`];return e.color&&t.push(`color=${encodeURIComponent(e.color)}`),e.annot&&t.push(`annot=${encodeURIComponent(e.annot)}`),e.q&&t.push(`q=${encodeURIComponent(e.q)}`),t.join("&")}function u0(e){const t=e.replace(/^#/,"");if(!t)return null;const n=new Map;for(const l of t.split("&")){const c=l.indexOf("=");c<0||n.set(l.slice(0,c),l.slice(c+1))}const i=parseInt(n.get("page")??"",10);if(!Number.isFinite(i)||i<1)return null;const s={page:i},r=n.get("color");r&&(s.color=decodeURIComponent(r));const o=n.get("annot");o&&(s.annot=decodeURIComponent(o));const a=n.get("q");if(a)try{s.q=decodeURIComponent(a)}catch{s.q=a}return s}function B_(e){let t=e.trim();const n=t.search(/\\?\|/);n>=0&&(t=t.slice(0,n).trim());const i=t.indexOf("#"),s=(i>=0?t.slice(0,i):t).trim();return ed(s)?{target:s,loc:i>=0?u0(t.slice(i+1)):null}:null}function U_(e,t){return`[[${e}#${c0(t)}]]`}function H_(e){const t=/^#?L(\d+)(?:-L?(\d+))?$/i.exec(e.trim());if(!t)return null;const n=parseInt(t[1],10);if(!n||n<1)return null;const i=t[2]?parseInt(t[2],10):NaN;return i>n?{from:n,to:i}:{from:n}}function d0(e){const t=/^#?\^([A-Za-z0-9-]+)$/.exec(e.trim());return t?t[1]:null}function f0(e){const t=/(?:^|\s)\^([A-Za-z0-9-]+)\s*$/.exec(e);return t?t[1]:null}const p0=e=>/^\s*\^[A-Za-z0-9-]+\s*$/.test(e),h0=e=>e.replace(/[*_~`]|!?\[\[|\]\]/g,"").trim().toLowerCase(),Bi=e=>e.trim().toLowerCase();function m0(e,t){for(const n of[Bi,h0]){const i=g0(e,t,n);if(i>=0)return i}return-1}function g0(e,t,n){const i=n(t);if(!i)return-1;const s=e.findIndex(a=>Bi(a.text)===i);if(s>=0)return s;const r=t.split("#").map(n).filter(Boolean);if(!r.length)return-1;const o=r[r.length-1];for(let a=0;a<e.length;a++){if(Bi(e[a].text)!==o)continue;if(r.length===1)return a;const l=[];let c=e[a].level;for(let u=a-1;u>=0&&c>1;u--)e[u].level<c&&(l.unshift(Bi(e[u].text)),c=e[u].level);let d=0;for(const u of l)d<r.length-1&&u===r[d]&&d++;if(d===r.length-1)return a}return-1}function td(e){let t=e.trim();const n=t.search(/\\?\|/);n>=0&&(t=t.slice(0,n).trim());const i=t.indexOf("#");if(i<0)return{target:t,subpath:null};const s=t.slice(i+1).trim();return{target:t.slice(0,i).trim(),subpath:s||null}}const b0=/\.(mp4|webm|mov|m4v)$/i,y0=/\.(mp3|wav|ogg|m4a|flac)$/i,w0=e=>b0.test(e.trim())||y0.test(e.trim());function Za(e){const t=e.trim();let n,i=null;return(n=/^(\d+):([0-5]\d):([0-5]\d(?:\.\d+)?)$/.exec(t))?i=+n[1]*3600+ +n[2]*60+ +n[3]:(n=/^([0-5]\d):([0-5]\d(?:\.\d+)?)$/.exec(t))?i=+n[1]*60+ +n[2]:/^\d+(?:\.\d+)?$/.test(t)&&(i=+t),i!=null&&Number.isFinite(i)?i:null}function k0(e){const t=/^#?t=(.*)$/i.exec(e.trim());if(!t||t[1].trim()==="")return null;const[n,i]=t[1].split(","),s=n.trim()===""?0:Za(n);if(s==null||s<0)return null;if(i===void 0)return{at:s};const r=Za(i);return r!=null&&r>s?{at:s,to:r}:{at:s,badTo:!0}}const v0=e=>`t=${Math.round(e.at)}${e.to?`,${Math.round(e.to)}`:""}`;function S0(e){const t=Math.max(0,Math.floor(e||0)),n=s=>String(s).padStart(2,"0"),i=Math.floor(t/3600);return i?`${i}:${n(Math.floor(t%3600/60))}:${n(t%60)}`:`${n(Math.floor(t/60))}:${n(t%60)}`}function q_(e){const{target:t,subpath:n}=td(e);return!t||!w0(t)?null:{target:t,loc:n?k0(n):null}}const W_=(e,t,n)=>`[[${e}#${v0(t)}${`|${S0(t.at)}`}]]`;function V_(e,t){if(!/^https?:\/\//i.test(e)||e.includes(":~:"))return e;const n=t.replace(/\s+/g," ").trim();return n.length<8||n.length>300||e.startsWith(n)?e:`${e.includes("#")?e:e+"#"}:~:text=${encodeURIComponent(n)}`}const Z_=e=>e.split("#")[0];function x0(e){const t=e.split("|");if(t.length<2)return;const n=t[t.length-1].trim();return/^\d{2,4}$/.test(n)?Number(n):void 0}function _0(e,t){const n=e.split("|");x0(e)!==void 0&&n.pop();const i=n.join("|");return t==null?i:`${i}|${t}`}function K_(e){const t=_0(e.trim(),null).trim();return/^https?:\/\/\S+$/i.test(t)?t:null}const G_=e=>e.replace(/\|/g,"%7C").replace(/\]/g,"%5D");function C0(e){const{target:t,subpath:n}=td(e);return{note:t,subpath:n}}const A0=/^ {0,3}(`{3,}|~{3,})/,E0=/^ {0,3}(#{1,6})[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*$/,Ka=/^([ \t]*)(?:[-*+]|\d{1,9}[.)])(?:[ \t]|$)/;function nd(e){const t=[];let n=null;for(const i of e){const s=A0.exec(i);if(n){t.push(!0),s&&s[1][0]===n[0]&&s[1].length>=n.length&&!i.slice(i.indexOf(s[1])+s[1].length).trim()&&(n=null);continue}if(s){n=s[1],t.push(!0);continue}t.push(!1)}return t}const id=e=>e.split(/\r?\n/),Ui=e=>e.join(`
284
- `).replace(/^\n+|\s+$/g,"");function T0(e){return e.replace(/`([^`]*)`/g,"$1").replace(/!?\[\[([^\]|]*\|)?([^\]]*)\]\]/g,"$2").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(new RegExp("(\\*\\*|__|~~|==)(?=\\S)(.+?)(?<=\\S)\\1","g"),"$2").replace(new RegExp("(^|[^\\w*])\\*(?=\\S)(.+?)(?<=\\S)\\*(?!\\w)","g"),"$1$2")}function I0(e,t){const n=id(e),i=nd(n),s=[];n.forEach((a,l)=>{if(i[l])return;const c=E0.exec(a);c&&c[2].trim()&&s.push({level:c[1].length,text:T0(c[2].trim()),line:l})});const r=m0(s,t);if(r<0)return null;const o=s.slice(r+1).find(a=>a.level<=s[r].level);return Ui(n.slice(s[r].line,o?o.line:n.length))}function P0(e,t){let n=t;for(;n>0&&e[n-1];)n--;return n}function O0(e,t){const n=id(e),i=nd(n),s=n.findIndex((u,p)=>!i[p]&&f0(u)===t);if(s<0)return null;const r=u=>/^[ \t]*/.exec(u)[0].length,o=u=>u>=0&&!!n[u].trim()&&!i[u];if(p0(n[s])){let u=s-1;for(;u>=0&&!n[u].trim();)u--;if(u<0)return null;if(i[u])return Ui(n.slice(P0(i,u),u+1));let p=u;for(;o(p-1);)p--;return Ui(n.slice(p,u+1))}let a=s;for(;!Ka.test(n[a])&&o(a-1);)a--;let l=s+1;const c=Ka.exec(n[a]);if(c){const u=c[1].length;for(;l<n.length;){if(n[l].trim()){if(r(n[l])<=u)break}else{const p=n.slice(l+1).find(f=>f.trim());if(p==null||r(p)<=u)break}l++}}else for(;o(l);)l++;const d=n.slice(a,l);return d[s-a]=d[s-a].replace(/[ \t]*\^[A-Za-z0-9-]+[ \t]*$/,""),Ui(d)}function $0(e,t){const n=d0(t);return n?O0(e,n):t.trim().startsWith("^")?null:I0(e,t)}class R0 extends Error{constructor(t){super(`share viewer is read-only: ${t}`),this.name="ShareReadOnlyError"}}const N0=()=>new Date().toISOString(),sd=e=>e.split("/").slice(0,-1).join("/");function Ga(e,t){const n=t.trim().replace(/^!?\[\[/,"").replace(/\]\]$/,"").split("|")[0].split("#")[0].trim(),i=n.startsWith("/")?n.slice(1):[sd(e),n].filter(Boolean).join("/"),s=[];for(const r of i.split("/"))if(!(!r||r===".")){if(r===".."){s.pop();continue}s.push(r)}return s.join("/")}const ns=/^ {0,3}(`{3,}|~{3,})/,Ya=e=>e.trim().replace(/\.block$/i,"").toLowerCase();function L0(e){const t=e.lastIndexOf("#");if(t<0)return{noteKey:null,id:Ya(e)};const n=e.slice(0,t).trim();return{noteKey:n?fn(n):null,id:Ya(e.slice(t+1))}}function F0(e){const t=/^\uFEFF?---\r?\n([\s\S]*?)\r?\n---/.exec(e)?.[1];return!!t&&t.split(`
283
+ `:""}function R_(e,t){const n={};for(const[s,r]of Object.entries(t))Gu(s)||(n[s]=r);const i=s0(e,n);return i==null?null:i.replace(/\r?\n+$/,"")}function l0(e){return typeof e=="boolean"?"checkbox":Array.isArray(e)?"multiselect":typeof e=="number"&&Number.isFinite(e)?"number":typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)?"date":"text"}function N_(e,t){switch(t){case"checkbox":return e===!0;case"number":if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){const n=Number.parseFloat(e);if(Number.isFinite(n))return n}return null;case"multiselect":return Array.isArray(e)?e.map(String):e==null||e===""?[]:[String(e)];case"date":return typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)?e:"";default:return e==null?"":Array.isArray(e)?e.map(String).join(", "):String(e)}}function L_(e,t){switch(t){case"checkbox":return e===!0?!0:void 0;case"number":return typeof e=="number"&&Number.isFinite(e)?e:void 0;case"multiselect":return Array.isArray(e)&&e.length?e:void 0;case"date":return typeof e=="string"&&e?e:void 0;default:return(typeof e=="string"?e:e==null?"":String(e))||void 0}}function F_(e,t){const n=e.map(s=>({...s,options:s.options?[...s.options]:void 0})),i=new Map(n.map(s=>[s.id,s]));if(!i.has(Un)){const s={id:Un,name:"Page Name",type:"page"};n.unshift(s),i.set(Un,s)}for(const s of t)for(const[r,o]of Object.entries(s)){if(r===Un||i.has(r))continue;const a={id:r,name:r,type:l0(o)};n.push(a),i.set(r,a)}for(const s of n){if(s.type!=="select"&&s.type!=="multiselect")continue;const r=new Set(s.options??[]);for(const o of t){const a=o[s.id];Array.isArray(a)?a.forEach(l=>r.add(String(l))):typeof a=="string"&&a&&r.add(a)}s.options=[...r]}return n}function D_(e,t){const n=e.lastIndexOf("/"),i=n<0?"":e.slice(0,n+1),s=n<0?e:e.slice(n+1),r=s.lastIndexOf("."),o=r>0?s.slice(0,r):s,a=r>0?s.slice(r):"",l=d=>String(d).padStart(2,"0"),c=`${t.getFullYear()}-${l(t.getMonth()+1)}-${l(t.getDate())} ${l(t.getHours())}${l(t.getMinutes())}`;return`${i}${o} (conflict ${c})${a}`}function z_(e,t){if(t<2)return e;const n=e.lastIndexOf("."),i=n>e.lastIndexOf("/")&&n>e.lastIndexOf(")"),s=i?e.slice(0,n):e,r=i?e.slice(n):"";return`${s}-${t}${r}`}function Wn(e){let t=3735928559,n=1103547991;for(let s=0;s<e.length;s++){const r=e.charCodeAt(s);t=Math.imul(t^r,2654435761),n=Math.imul(n^r,1597334677)}t=Math.imul(t^t>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(t^t>>>13,3266489909);const i=4294967296*(2097151&n)+(t>>>0);return`${e.length.toString(36)}-${i.toString(36)}`}const ed=e=>/\.pdf$/i.test(e.trim()),M_=e=>/^\/|^[A-Za-z]:[\\/]/.test(e);function j_(e){let t=e.trim();const n=t.search(/\\?\|/);n>=0&&(t=t.slice(0,n));const i=t.indexOf("#");return i>=0&&(t=t.slice(0,i)),ed(t)}function c0(e){const t=[`page=${Math.max(1,Math.trunc(e.page)||1)}`];return e.color&&t.push(`color=${encodeURIComponent(e.color)}`),e.annot&&t.push(`annot=${encodeURIComponent(e.annot)}`),e.q&&t.push(`q=${encodeURIComponent(e.q)}`),t.join("&")}function u0(e){const t=e.replace(/^#/,"");if(!t)return null;const n=new Map;for(const l of t.split("&")){const c=l.indexOf("=");c<0||n.set(l.slice(0,c),l.slice(c+1))}const i=parseInt(n.get("page")??"",10);if(!Number.isFinite(i)||i<1)return null;const s={page:i},r=n.get("color");r&&(s.color=decodeURIComponent(r));const o=n.get("annot");o&&(s.annot=decodeURIComponent(o));const a=n.get("q");if(a)try{s.q=decodeURIComponent(a)}catch{s.q=a}return s}function B_(e){let t=e.trim();const n=t.search(/\\?\|/);n>=0&&(t=t.slice(0,n).trim());const i=t.indexOf("#"),s=(i>=0?t.slice(0,i):t).trim();return ed(s)?{target:s,loc:i>=0?u0(t.slice(i+1)):null}:null}function U_(e,t){return`[[${e}#${c0(t)}]]`}function H_(e){const t=/^#?L(\d+)(?:-L?(\d+))?$/i.exec(e.trim());if(!t)return null;const n=parseInt(t[1],10);if(!n||n<1)return null;const i=t[2]?parseInt(t[2],10):NaN;return i>n?{from:n,to:i}:{from:n}}function d0(e){const t=/^#?\^([A-Za-z0-9-]+)$/.exec(e.trim());return t?t[1]:null}function f0(e){const t=/(?:^|\s)\^([A-Za-z0-9-]+)\s*$/.exec(e);return t?t[1]:null}const h0=e=>/^\s*\^[A-Za-z0-9-]+\s*$/.test(e),p0=e=>e.replace(/[*_~`]|!?\[\[|\]\]/g,"").trim().toLowerCase(),Bi=e=>e.trim().toLowerCase();function m0(e,t){for(const n of[Bi,p0]){const i=g0(e,t,n);if(i>=0)return i}return-1}function g0(e,t,n){const i=n(t);if(!i)return-1;const s=e.findIndex(a=>Bi(a.text)===i);if(s>=0)return s;const r=t.split("#").map(n).filter(Boolean);if(!r.length)return-1;const o=r[r.length-1];for(let a=0;a<e.length;a++){if(Bi(e[a].text)!==o)continue;if(r.length===1)return a;const l=[];let c=e[a].level;for(let u=a-1;u>=0&&c>1;u--)e[u].level<c&&(l.unshift(Bi(e[u].text)),c=e[u].level);let d=0;for(const u of l)d<r.length-1&&u===r[d]&&d++;if(d===r.length-1)return a}return-1}function td(e){let t=e.trim();const n=t.search(/\\?\|/);n>=0&&(t=t.slice(0,n).trim());const i=t.indexOf("#");if(i<0)return{target:t,subpath:null};const s=t.slice(i+1).trim();return{target:t.slice(0,i).trim(),subpath:s||null}}const b0=/\.(mp4|webm|mov|m4v)$/i,y0=/\.(mp3|wav|ogg|m4a|flac)$/i,w0=e=>b0.test(e.trim())||y0.test(e.trim());function Za(e){const t=e.trim();let n,i=null;return(n=/^(\d+):([0-5]\d):([0-5]\d(?:\.\d+)?)$/.exec(t))?i=+n[1]*3600+ +n[2]*60+ +n[3]:(n=/^([0-5]\d):([0-5]\d(?:\.\d+)?)$/.exec(t))?i=+n[1]*60+ +n[2]:/^\d+(?:\.\d+)?$/.test(t)&&(i=+t),i!=null&&Number.isFinite(i)?i:null}function k0(e){const t=/^#?t=(.*)$/i.exec(e.trim());if(!t||t[1].trim()==="")return null;const[n,i]=t[1].split(","),s=n.trim()===""?0:Za(n);if(s==null||s<0)return null;if(i===void 0)return{at:s};const r=Za(i);return r!=null&&r>s?{at:s,to:r}:{at:s,badTo:!0}}const v0=e=>`t=${Math.round(e.at)}${e.to?`,${Math.round(e.to)}`:""}`;function S0(e){const t=Math.max(0,Math.floor(e||0)),n=s=>String(s).padStart(2,"0"),i=Math.floor(t/3600);return i?`${i}:${n(Math.floor(t%3600/60))}:${n(t%60)}`:`${n(Math.floor(t/60))}:${n(t%60)}`}function q_(e){const{target:t,subpath:n}=td(e);return!t||!w0(t)?null:{target:t,loc:n?k0(n):null}}const W_=(e,t,n)=>`[[${e}#${v0(t)}${`|${S0(t.at)}`}]]`;function V_(e,t){if(!/^https?:\/\//i.test(e)||e.includes(":~:"))return e;const n=t.replace(/\s+/g," ").trim();return n.length<8||n.length>300||e.startsWith(n)?e:`${e.includes("#")?e:e+"#"}:~:text=${encodeURIComponent(n)}`}const Z_=e=>e.split("#")[0];function x0(e){const t=e.split("|");if(t.length<2)return;const n=t[t.length-1].trim();return/^\d{2,4}$/.test(n)?Number(n):void 0}function _0(e,t){const n=e.split("|");x0(e)!==void 0&&n.pop();const i=n.join("|");return t==null?i:`${i}|${t}`}function K_(e){const t=_0(e.trim(),null).trim();return/^https?:\/\/\S+$/i.test(t)?t:null}const G_=e=>e.replace(/\|/g,"%7C").replace(/\]/g,"%5D");function C0(e){const{target:t,subpath:n}=td(e);return{note:t,subpath:n}}const A0=/^ {0,3}(`{3,}|~{3,})/,T0=/^ {0,3}(#{1,6})[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*$/,Ka=/^([ \t]*)(?:[-*+]|\d{1,9}[.)])(?:[ \t]|$)/;function nd(e){const t=[];let n=null;for(const i of e){const s=A0.exec(i);if(n){t.push(!0),s&&s[1][0]===n[0]&&s[1].length>=n.length&&!i.slice(i.indexOf(s[1])+s[1].length).trim()&&(n=null);continue}if(s){n=s[1],t.push(!0);continue}t.push(!1)}return t}const id=e=>e.split(/\r?\n/),Ui=e=>e.join(`
284
+ `).replace(/^\n+|\s+$/g,"");function E0(e){return e.replace(/`([^`]*)`/g,"$1").replace(/!?\[\[([^\]|]*\|)?([^\]]*)\]\]/g,"$2").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(new RegExp("(\\*\\*|__|~~|==)(?=\\S)(.+?)(?<=\\S)\\1","g"),"$2").replace(new RegExp("(^|[^\\w*])\\*(?=\\S)(.+?)(?<=\\S)\\*(?!\\w)","g"),"$1$2")}function I0(e,t){const n=id(e),i=nd(n),s=[];n.forEach((a,l)=>{if(i[l])return;const c=T0.exec(a);c&&c[2].trim()&&s.push({level:c[1].length,text:E0(c[2].trim()),line:l})});const r=m0(s,t);if(r<0)return null;const o=s.slice(r+1).find(a=>a.level<=s[r].level);return Ui(n.slice(s[r].line,o?o.line:n.length))}function P0(e,t){let n=t;for(;n>0&&e[n-1];)n--;return n}function O0(e,t){const n=id(e),i=nd(n),s=n.findIndex((u,h)=>!i[h]&&f0(u)===t);if(s<0)return null;const r=u=>/^[ \t]*/.exec(u)[0].length,o=u=>u>=0&&!!n[u].trim()&&!i[u];if(h0(n[s])){let u=s-1;for(;u>=0&&!n[u].trim();)u--;if(u<0)return null;if(i[u])return Ui(n.slice(P0(i,u),u+1));let h=u;for(;o(h-1);)h--;return Ui(n.slice(h,u+1))}let a=s;for(;!Ka.test(n[a])&&o(a-1);)a--;let l=s+1;const c=Ka.exec(n[a]);if(c){const u=c[1].length;for(;l<n.length;){if(n[l].trim()){if(r(n[l])<=u)break}else{const h=n.slice(l+1).find(f=>f.trim());if(h==null||r(h)<=u)break}l++}}else for(;o(l);)l++;const d=n.slice(a,l);return d[s-a]=d[s-a].replace(/[ \t]*\^[A-Za-z0-9-]+[ \t]*$/,""),Ui(d)}function $0(e,t){const n=d0(t);return n?O0(e,n):t.trim().startsWith("^")?null:I0(e,t)}class R0 extends Error{constructor(t){super(`share viewer is read-only: ${t}`),this.name="ShareReadOnlyError"}}const N0=()=>new Date().toISOString(),sd=e=>e.split("/").slice(0,-1).join("/");function Ga(e,t){const n=t.trim().replace(/^!?\[\[/,"").replace(/\]\]$/,"").split("|")[0].split("#")[0].trim(),i=n.startsWith("/")?n.slice(1):[sd(e),n].filter(Boolean).join("/"),s=[];for(const r of i.split("/"))if(!(!r||r===".")){if(r===".."){s.pop();continue}s.push(r)}return s.join("/")}const ns=/^ {0,3}(`{3,}|~{3,})/,Ya=e=>e.trim().replace(/\.block$/i,"").toLowerCase();function L0(e){const t=e.lastIndexOf("#");if(t<0)return{noteKey:null,id:Ya(e)};const n=e.slice(0,t).trim();return{noteKey:n?fn(n):null,id:Ya(e.slice(t+1))}}function F0(e){const t=/^\uFEFF?---\r?\n([\s\S]*?)\r?\n---/.exec(e)?.[1];return!!t&&t.split(`
285
285
  `).some(n=>/^["']?amadeus_/.test(n))}function D0(e){const t=e.split(`
286
286
  `);let n=0;for(;n<t.length&&!t[n].trim();)n++;if(n>=t.length)return"";const i=ns.exec(t[n]),s=[];if(i){const r=i[1][0];for(s.push(t[n]),n++;n<t.length;n++){s.push(t[n]);const o=ns.exec(t[n]);if(o&&o[1][0]===r)break}return s.join(`
287
287
  `)}for(;n<t.length&&t[n].trim();n++)s.push(t[n]);return s.join(`
288
288
  `)}function z0(e,t){const n=e.split(`
289
- `);let i=null;for(let s=0;s<n.length;s++){const r=ns.exec(n[s]);if(r&&(!i||r[1][0]===i)){i=i?null:r[1][0];continue}if(i)continue;const o=/^(#{1,6})\s+(.*?)\s*#*\s*$/.exec(n[s]);if(!o||o[2].trim().toLowerCase()!==t)continue;const a=o[1].length,l=[n[s]];let c=null;for(let d=s+1;d<n.length;d++){const u=ns.exec(n[d]);if(u&&(!c||u[1][0]===c)){c=c?null:u[1][0],l.push(n[d]);continue}if(!c){const p=/^(#{1,6})\s/.exec(n[d]);if(p&&p[1].length<=a)break}l.push(n[d])}return l.join(`
290
- `).trimEnd()}return null}function rd(e,t){const n=Gr(e);for(const i of gl(n))if(i.id&&i.id.toLowerCase()===t)return F0(e)?i.content:D0(i.content);return z0(n,t)}function M0(e){const t=e.fetch??((...f)=>fetch(...f)),n=`${e.apiBase}/amadeus/public/shares/${encodeURIComponent(e.token)}`,i=f=>()=>Promise.reject(new R0(f)),s=()=>()=>{},r=()=>e.tree().pages,o=new Map,a=f=>{let m=o.get(f);return m||(m=(async()=>{const h=await t(`${n}/file?path=${encodeURIComponent(f)}`);if(h.status===404)return null;if(!h.ok)throw new Error(`share file ${h.status}`);const y=await h.json();return typeof y.content=="string"?y.content:""})(),o.set(f,m),m.catch(()=>o.delete(f))),m},l=(f,m)=>{const h=new URLSearchParams({ref:f});return m&&h.set("page",m),`${n}/asset?${h.toString()}`},c=async(f,m)=>{const h=await t(l(f,m));if(h.status===404)return null;if(!h.ok)throw new Error(`share asset ${h.status}`);return h},d=async f=>{const m=await a(f);if(m==null)throw new Error(`not found: ${f}`);return Ri(f,m,N0())},u=()=>({root:`share:${e.token}`,pages:r(),folders:e.tree().folders});return{openVault:async()=>u(),restoreVault:async()=>u(),listPages:async()=>r(),listFiles:async()=>[],listFolders:async()=>e.tree().folders,loadPage:d,readPage:d,reconcilePage:f=>d(f),newPage:i("newPage"),savePage:i("savePage"),renamePage:i("renamePage"),saveAsset:i("saveAsset"),saveVaultBytes:i("saveVaultBytes"),readVaultBytes:async f=>{const m=await c(f,e.currentPage());if(!m)throw new Error(`not found: ${f}`);return new Uint8Array(await m.arrayBuffer())},saveAttachment:i("saveAttachment"),openAttachment:async(f,m)=>{window.open(l(m,f),"_blank","noopener")},openVaultFile:async f=>{window.open(l(f,null),"_blank","noopener")},exportPdf:async()=>(window.print(),null),onExternalChange:s,onStructureChange:s,onDbExternalChange:s,search:async()=>[],backlinks:async()=>[],reindex:async()=>{},listTags:async()=>[],pagesByTag:async()=>[],deletePage:i("deletePage"),movePage:i("movePage"),resolveEmbed:async f=>{const{noteKey:m,id:h}=L0(f);if(!h)return null;const y=e.currentPage(),w=r(),C=m?w.filter(S=>fn(S)===m):[...y&&w.includes(y)?[y]:[],...w.filter(S=>S!==y)];for(const S of C){const I=await a(S);if(I==null)continue;const O=rd(I,h);if(O!==null)return{owner:S,content:O,type:"markdown"}}return null},blockBacklinks:async()=>[],createFolder:i("createFolder"),renameFolder:i("renameFolder"),deleteFolder:i("deleteFolder"),moveFolder:i("moveFolder"),listPlugins:async()=>[],openPluginsFolder:async()=>{},scaffoldSamplePlugin:async()=>{},revealInFileManager:async()=>{},readDatabase:async(f,m)=>{const h=await c(m,f);if(!h)return{status:"missing"};const y=Ga(f,m),w=iu(await h.text());return w.ok?{status:"ok",path:y,data:w.data}:{status:"corrupt",path:y,message:w.error}},writeDatabase:i("writeDatabase"),readDrawing:async(f,m)=>{for(const h of/\.md$/i.test(m)?[m]:[m,`${m}.md`]){const y=await c(h,f);if(y)return{status:"ok",path:Ga(f,h),source:await y.text()}}return{status:"missing"}},writeDrawing:i("writeDrawing"),readTextFile:f=>a(f),writeTextFile:i("writeTextFile"),listPageProps:async f=>{const m=f.replace(/\\/g,"/").replace(/^\/+|\/+$/g,""),h=r().filter(w=>sd(w)===m),y=[];for(const w of h){const C=await a(w);C!=null&&y.push({path:w,title:hl(w),fm:jc(C)})}return y},setPageFrontmatter:i("setPageFrontmatter"),renamePageFile:i("renamePageFile"),renameDbFile:i("renameDbFile")}}function Y_(e){const t=M0(e);return Qc(n=>{const i=new URLSearchParams({ref:n}),s=e.currentPage();return s&&i.set("page",s),`${e.apiBase}/amadeus/public/shares/${encodeURIComponent(e.token)}/asset?${i.toString()}`}),typeof window<"u"&&(window.amadeus=t),t}const j0=e=>{const t=e.search(/\\\||[#|]/);return t<0?{note:e,suffix:""}:{note:e.slice(0,t),suffix:e.slice(t)}},B0=e=>(e.split("/").pop()??e).replace(/\.md$/i,"");function U0(e,t,n,i){if(!e.includes("[["))return e;const s=i.pagesBefore,r=i.pagesAfter;return ri(e,o=>o.replace(/(!?)\[\[([^\]\n]+)\]\]/g,(a,l,c)=>{const{note:d,suffix:u}=j0(c),p=d.trim();if(!p)return a;const f=Li(p,s,t);if(!f)return a;const m=i.pairs.get(f)??f;if(Li(p,r,n)===m)return a;const h=B0(m),w=!/[\\/]/.test(p)&&Li(h,r,n)===m?h:m.replace(/\.md$/i,"");return`${l}[[${w}${u}]]`}))}async function H0(e,t,n,i={}){const s={rewritten:[],failed:[]},r=new Map(Object.entries(t).filter(([m,h])=>m!==h));if(!r.size)return s;const o=new Map([...r].map(([m,h])=>[h,m])),a=[...n].sort(),l=a.map(m=>r.get(m)??m).sort(),c={pairs:r,pagesBefore:a,pagesAfter:l},d=Math.max(1,i.attempts??3),u=async m=>{try{let h=await e.read(m);if(h==null){s.failed.push({path:m,error:"gone"});return}for(let y=0;y<d;y++){const w=U0(h,o.get(m)??m,m,c);if(w===h)return;const C=await e.write(m,w,Wn(h));if(C==="gone"){s.failed.push({path:m,error:"gone"});return}if(!C||C.ok){s.rewritten.push(m);return}if(C.current==null){s.failed.push({path:m,error:"gone"});return}h=C.current}s.failed.push({path:m,error:"conflict"})}catch(h){s.failed.push({path:m,error:h instanceof Error?h.message:String(h)})}},p=[...l],f=Array.from({length:Math.max(1,Math.min(i.concurrency??6,p.length))},async()=>{for(let m=p.shift();m!==void 0;m=p.shift())await u(m)});return await Promise.all(f),s.rewritten.sort(),s}const q0=["renamePage","renamePageFile","movePage","renameFolder","moveFolder","deletePage","deleteFolder","trashEntry","restoreTrash"];function W0(e){const t=e;let n=Promise.resolve();for(const i of q0){const s=t[i];typeof s=="function"&&(t[i]=(...r)=>{const o=n.then(()=>s(...r));return n=o.catch(()=>{}),o})}return e}var Ys={exports:{}},jn={};var Ja;function V0(){if(Ja)return jn;Ja=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,s,r){var o=null;if(r!==void 0&&(o=""+r),s.key!==void 0&&(o=""+s.key),"key"in s){r={};for(var a in s)a!=="key"&&(r[a]=s[a])}else r=s;return s=r.ref,{$$typeof:e,type:i,key:o,ref:s!==void 0?s:null,props:r}}return jn.Fragment=t,jn.jsx=n,jn.jsxs=n,jn}var Qa;function Z0(){return Qa||(Qa=1,Ys.exports=V0()),Ys.exports}var ks=Z0();const K0=os(ks),J_=Sd({__proto__:null,default:K0},[ks]);var Js={exports:{}},ee={};var Xa;function G0(){if(Xa)return ee;Xa=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),r=Symbol.for("react.consumer"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),u=Symbol.for("react.activity"),p=Symbol.iterator;function f(A){return A===null||typeof A!="object"?null:(A=p&&A[p]||A["@@iterator"],typeof A=="function"?A:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,y={};function w(A,E,g){this.props=A,this.context=E,this.refs=y,this.updater=g||m}w.prototype.isReactComponent={},w.prototype.setState=function(A,E){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,E,"setState")},w.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function C(){}C.prototype=w.prototype;function S(A,E,g){this.props=A,this.context=E,this.refs=y,this.updater=g||m}var I=S.prototype=new C;I.constructor=S,h(I,w.prototype),I.isPureReactComponent=!0;var O=Array.isArray;function k(){}var T={H:null,A:null,T:null,S:null},$=Object.prototype.hasOwnProperty;function W(A,E,g){var z=g.ref;return{$$typeof:e,type:A,key:E,ref:z!==void 0?z:null,props:g}}function R(A,E){return W(A.type,E,A.props)}function H(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function B(A){var E={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(g){return E[g]})}var te=/\/+/g;function ce(A,E){return typeof A=="object"&&A!==null&&A.key!=null?B(""+A.key):E.toString(36)}function ne(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(k,k):(A.status="pending",A.then(function(E){A.status==="pending"&&(A.status="fulfilled",A.value=E)},function(E){A.status==="pending"&&(A.status="rejected",A.reason=E)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function pe(A,E,g,z,q){var M=typeof A;(M==="undefined"||M==="boolean")&&(A=null);var Y=!1;if(A===null)Y=!0;else switch(M){case"bigint":case"string":case"number":Y=!0;break;case"object":switch(A.$$typeof){case e:case t:Y=!0;break;case d:return Y=A._init,pe(Y(A._payload),E,g,z,q)}}if(Y)return q=q(A),Y=z===""?"."+ce(A,0):z,O(q)?(g="",Y!=null&&(g=Y.replace(te,"$&/")+"/"),pe(q,E,g,"",function(ye){return ye})):q!=null&&(H(q)&&(q=R(q,g+(q.key==null||A&&A.key===q.key?"":(""+q.key).replace(te,"$&/")+"/")+Y)),E.push(q)),1;Y=0;var ue=z===""?".":z+":";if(O(A))for(var de=0;de<A.length;de++)z=A[de],M=ue+ce(z,de),Y+=pe(z,E,g,M,q);else if(de=f(A),typeof de=="function")for(A=de.call(A),de=0;!(z=A.next()).done;)z=z.value,M=ue+ce(z,de++),Y+=pe(z,E,g,M,q);else if(M==="object"){if(typeof A.then=="function")return pe(ne(A),E,g,z,q);throw E=String(A),Error("Objects are not valid as a React child (found: "+(E==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":E)+"). If you meant to render a collection of children, use an array instead.")}return Y}function me(A,E,g){if(A==null)return A;var z=[],q=0;return pe(A,z,"","",function(M){return E.call(g,M,q++)}),z}function we(A){if(A._status===-1){var E=A._result;E=E(),E.then(function(g){(A._status===0||A._status===-1)&&(A._status=1,A._result=g)},function(g){(A._status===0||A._status===-1)&&(A._status=2,A._result=g)}),A._status===-1&&(A._status=0,A._result=E)}if(A._status===1)return A._result.default;throw A._result}var ae=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var E=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(E))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},x={map:me,forEach:function(A,E,g){me(A,function(){E.apply(this,arguments)},g)},count:function(A){var E=0;return me(A,function(){E++}),E},toArray:function(A){return me(A,function(E){return E})||[]},only:function(A){if(!H(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return ee.Activity=u,ee.Children=x,ee.Component=w,ee.Fragment=n,ee.Profiler=s,ee.PureComponent=S,ee.StrictMode=i,ee.Suspense=l,ee.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,ee.__COMPILER_RUNTIME={__proto__:null,c:function(A){return T.H.useMemoCache(A)}},ee.cache=function(A){return function(){return A.apply(null,arguments)}},ee.cacheSignal=function(){return null},ee.cloneElement=function(A,E,g){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var z=h({},A.props),q=A.key;if(E!=null)for(M in E.key!==void 0&&(q=""+E.key),E)!$.call(E,M)||M==="key"||M==="__self"||M==="__source"||M==="ref"&&E.ref===void 0||(z[M]=E[M]);var M=arguments.length-2;if(M===1)z.children=g;else if(1<M){for(var Y=Array(M),ue=0;ue<M;ue++)Y[ue]=arguments[ue+2];z.children=Y}return W(A.type,q,z)},ee.createContext=function(A){return A={$$typeof:o,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:r,_context:A},A},ee.createElement=function(A,E,g){var z,q={},M=null;if(E!=null)for(z in E.key!==void 0&&(M=""+E.key),E)$.call(E,z)&&z!=="key"&&z!=="__self"&&z!=="__source"&&(q[z]=E[z]);var Y=arguments.length-2;if(Y===1)q.children=g;else if(1<Y){for(var ue=Array(Y),de=0;de<Y;de++)ue[de]=arguments[de+2];q.children=ue}if(A&&A.defaultProps)for(z in Y=A.defaultProps,Y)q[z]===void 0&&(q[z]=Y[z]);return W(A,M,q)},ee.createRef=function(){return{current:null}},ee.forwardRef=function(A){return{$$typeof:a,render:A}},ee.isValidElement=H,ee.lazy=function(A){return{$$typeof:d,_payload:{_status:-1,_result:A},_init:we}},ee.memo=function(A,E){return{$$typeof:c,type:A,compare:E===void 0?null:E}},ee.startTransition=function(A){var E=T.T,g={};T.T=g;try{var z=A(),q=T.S;q!==null&&q(g,z),typeof z=="object"&&z!==null&&typeof z.then=="function"&&z.then(k,ae)}catch(M){ae(M)}finally{E!==null&&g.types!==null&&(E.types=g.types),T.T=E}},ee.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},ee.use=function(A){return T.H.use(A)},ee.useActionState=function(A,E,g){return T.H.useActionState(A,E,g)},ee.useCallback=function(A,E){return T.H.useCallback(A,E)},ee.useContext=function(A){return T.H.useContext(A)},ee.useDebugValue=function(){},ee.useDeferredValue=function(A,E){return T.H.useDeferredValue(A,E)},ee.useEffect=function(A,E){return T.H.useEffect(A,E)},ee.useEffectEvent=function(A){return T.H.useEffectEvent(A)},ee.useId=function(){return T.H.useId()},ee.useImperativeHandle=function(A,E,g){return T.H.useImperativeHandle(A,E,g)},ee.useInsertionEffect=function(A,E){return T.H.useInsertionEffect(A,E)},ee.useLayoutEffect=function(A,E){return T.H.useLayoutEffect(A,E)},ee.useMemo=function(A,E){return T.H.useMemo(A,E)},ee.useOptimistic=function(A,E){return T.H.useOptimistic(A,E)},ee.useReducer=function(A,E,g){return T.H.useReducer(A,E,g)},ee.useRef=function(A){return T.H.useRef(A)},ee.useState=function(A){return T.H.useState(A)},ee.useSyncExternalStore=function(A,E,g){return T.H.useSyncExternalStore(A,E,g)},ee.useTransition=function(){return T.H.useTransition()},ee.version="19.2.7",ee}var el;function Y0(){return el||(el=1,Js.exports=G0()),Js.exports}var nt=Y0();const Q_=os(nt),X_=["off","minimal","low","medium","high","xhigh","max"];function eC(e){return!e.location||e.location.kind==="home"}const tC="xyra",nC="forsion_tangu_show_system_prompt",J0="forsion_tangu_smooth_caret",Q0="forsion_ui_zoom",ci="tangu_locale",X0="forsion_tangu_font_ui",e1="forsion_tangu_font_body",t1="forsion_tangu_font_mono",iC=e=>/^avatar\.(png|jpe?g|gif|webp)$/i.test(e||""),sC=e=>!!(e?.soloAgentSlug||e?.soloEngineId||e?.teamSlug),n1="__cloud__",i1="__rootless__",rC="__default_ws__",s1="Tangu",r1=e=>`${n1}:${e||s1}`,oC=(e,t)=>{const n=e.projectless?i1:e.project_path||r1(e.project_name);return t?.find(i=>i.key===n||i.sessionKeys?.includes(n))?.key??n},aC=e=>/^icon\.(png|jpe?g|gif|webp)$/i.test(e||""),o1=[X0,e1,t1,J0,Q0,ci],a1=/^theme\.[A-Za-z0-9._-]{1,64}\.--[a-z0-9-]{1,64}$/i;let vr=!1;function lC(e){vr=!0;try{e()}finally{vr=!1}}const tl=e=>{try{return localStorage.getItem(e)}catch{return null}};function l1(){const e={};for(const t of o1)e[t]=tl(t);try{const t=document.documentElement.dataset.theme||"";for(let n=0;n<localStorage.length;n++){const i=localStorage.key(n);i&&a1.test(i)&&i.startsWith(`theme.${t}.`)&&(e[i]=tl(i))}}catch{}return e}function c1(){if(!vr)try{window.tangu?.broadcastUi?.({prefs:l1()})}catch{}}function u1(e){const t=typeof e?.cloudApiBase=="string"?e.cloudApiBase.trim():"";if(t)return t.replace(/\/+$/,"");const n=typeof e?.cloudUrl=="string"?e.cloudUrl.trim().replace(/\/+$/,""):"";return n?`${n}/api`:""}const Sr="forsion_region";function od(){try{const e=navigator.languages?.length?navigator.languages:[navigator.language];for(const t of e){const n=String(t||"").toLowerCase();if(n)return n.startsWith("zh")?"zh":"en"}}catch{}return null}function ad(){try{const t=localStorage.getItem(ci);if(t==="en"||t==="zh")return t}catch{}const e=od();if(e==="zh")return"zh";try{const t=localStorage.getItem(Sr);if(t)return t==="CN"?"zh":"en"}catch{}return e??"zh"}async function d1(){if(od()==="zh")return;try{if(localStorage.getItem(ci)||localStorage.getItem(Sr))return}catch{return}let e="";try{e=u1(await window.tangu?.getConfig?.())}catch{}if(!e)return;const t=`${e}/auth/region`;try{const n=new AbortController,i=setTimeout(()=>n.abort(),3e3),s=await fetch(t,{signal:n.signal}).finally(()=>clearTimeout(i));if(!s.ok)return;const r=(await s.json())?.country;if(!r)return;try{localStorage.setItem(Sr,r)}catch{}const o=r==="CN"?"zh":"en";o!==_r()&&fd(o)}catch{}}const bo={"common.save":"保存","chat.wait.sending":"正在发送上下文 {kb} KB","chat.wait.firstToken":"等待模型首帧","chat.wait.elapsed":"已等待 {s} 秒","settings.python.label":"Python","settings.python.bundled":"内置(推荐)","settings.python.system":"系统","settings.python.hint":"内置:免安装、与你自己的 Python 隔离;系统:用你已装的 python(改动后重启后端生效)。","settings.mirror.label":"网络镜像","settings.mirror.toggle":"使用中国大陆镜像源","settings.mirror.recommend":"检测到你的系统环境可能位于中国大陆,建议开启镜像源以加速下载。","settings.mirror.hint":"开启后,引导安装、pip 装包、Agent 运行的 npx/git 与市场下载走国内镜像(清华/npmmirror/多站 GitHub 代理)。仅对 Forsion 发起的命令注入环境变量,不修改任何系统配置文件,可随时关闭;pip/npm/git 部分需「内置后端」模式。","settings.mirror.test":"测试连通","settings.mirror.unreachable":"不可达","settings.test.canceled":"已取消","settings.test.timeout":"✗ 连接超时","onboarding.env.mirrorLabel":"网络环境","onboarding.env.pythonBundled":"Python 已内置,无需单独安装。","onboarding.env.recheck":"重新检测","onboarding.env.installOk":"{tool} 安装成功 · {version}","onboarding.env.installedButMissing":"命令已执行完成,但仍未检测到 {tool}。可能需要重启应用或新开终端后生效,也可点「重新检测」再试。","onboarding.env.installFail":"{tool} 安装失败(exit {code}),请查看下方日志。","onboarding.env.copyCmd":"复制命令","onboarding.env.copied":"⤷ 已复制到剪贴板,请打开「终端」粘贴执行(需要输入系统密码):{command}","sidebar.newChat":"新会话","sidebar.memory":"记忆","sidebar.agents":"后台 Agent","sidebar.viewMore":"查看更多","tip.folder":"{files} 个文件,{folders} 个文件夹","tip.sessions":"{count} 个会话","tip.modified":"修改:{t}","tip.created":"创建:{t}","input.fileref.session":"历史会话","input.project.label":"项目","input.project.none":"不在项目中","input.project.dontWork":"不在项目中工作","input.project.search":"搜索项目","input.project.noMatches":"没有匹配的项目","input.project.add":"添加本地项目","input.project.addCloud":"新建云端项目","input.project.cloudName":"项目名称,回车创建","app.amadeusWorkspace":"Amadeus · {name}","app.createProjectFail":"创建项目失败:{e}","ws.detail.count":"{n} 个会话","ws.detail.newChat":"在此项目中新建会话","ws.detail.empty":"该项目暂无会话","ws.detail.viewMore":"查看更多","agents.detail.title":"后台 Agent","agents.detail.settings":"设置","agents.detail.historian":"Historian 活动","agents.detail.noActivity":"暂无活动记录","settings.advanced.sessionLimit":"侧栏每个项目显示的会话数","settings.mcpServer.label":"对外 MCP 端点(给外部 Agent 用)","settings.mcpServer.hint":"开启后本机起一个本地 HTTP MCP 端点,外部 Agent(Claude Code / Codex / OpenCode 等)可通过它调用 Forsion Desktop 的能力(当前:发消息到收件箱)。仅监听 127.0.0.1,带令牌鉴权。","settings.mcpServer.enable":"开放给外部 Agent(Claude Code / Codex / OpenCode 等)","settings.mcpServer.connectHint":"选择你的 Agent,复制配置接入(令牌已内嵌):","settings.mcpServer.endpoint":"端点","settings.mcpServer.generic":"通用 JSON","settings.mcpServer.genericNote":"任意支持 Streamable HTTP MCP 的客户端(Cursor / Windsurf / Cline 等)用「通用」配置填 url + Authorization 头即可。","settings.mcpServer.copy":"复制","settings.mcpServer.notRunning":"端点未能启动,请查看日志或重启应用。","common.cancel":"取消","common.retry":"重试","chat.action.copy":"复制","chat.you":"你","workbench.noSession":"选择或新建一个会话以查看","workbench.sessions":"工作会话","space.home":"主页","space.tangu":"Tangu","space.amadeus":"笔记","space.calendar":"日历","view.todo":"待办清单","view.calendar":"日历","view.calendarConfig":"日历设置","view.db":"多维表","view.drawing":"白板","space.coding":"编码工作室","view.codeStudio":"编码工作室","space.artificial":"造物","view.artificial":"造物","view.product":"作品","space.public":"发布","view.publicHub":"发布管理","public.title":"发布管理","public.subtitle":"集中管理你已发布的网站与笔记","public.needLogin":"登录 Forsion 账号后查看已发布内容","public.refresh":"刷新","public.empty":"暂无内容","public.open":"打开","public.copy":"复制链接","public.copied":"已复制","public.unpublish":"下架","public.revoke":"撤销","public.confirm":"确认?","public.sites":"我的网站","public.sitesDesc":"Forsion Connect 托管的网页应用","public.published":"公开发布的笔记","public.publishedDesc":"任何人可只读访问的分享链接","public.shared":"协作共享的笔记","public.sharedDesc":"邀请他人编辑 / 查看的页面","public.disabled":"已停用","public.unavailable":"此功能在当前环境不可用","coding.code":"代码","coding.preview":"预览","coding.reload":"刷新预览","coding.noEntry":"暂无入口页面","coding.noFile":"未选择文件","coding.pickFile":"在右侧文件树点选一个文件来编辑","coding.emptyPreview":"还没有可预览的页面。让左侧的 Coding Agent 生成一个 index.html 吧。","coding.projects":"项目","coding.newProject":"新建项目","coding.publish":"发布","coding.publishTitle":"发布到 Forsion","coding.publishDesc":"把这个网页应用发布成公开链接。应用内可用 window.forsion 调用 Forsion AI —— 访客登录自己的 Forsion 账号、消耗自己的额度。","coding.publishName":"应用名称","coding.publishSlug":"链接标识","coding.publishSlugHint":"3-32 位小写字母 / 数字 / 中划线","coding.publishEntry":"入口页面","coding.publishSlots":"已发布 {used}/{limit} 个({tier})","coding.publishBtn":"发布","coding.publishUpdate":"更新发布","coding.publishing":"发布中…","coding.unpublish":"下架","coding.unpublishConfirm":"确认下架?","coding.publishNeedLogin":"发布需要登录 Forsion 账号","coding.loginNow":"登录 Forsion","coding.loginWaiting":"等待浏览器完成授权…","coding.copyLink":"复制链接","coding.copied":"已复制","coding.openLink":"打开","coding.publishHint":"资源请用相对路径引用;.ts/.tsx 发布时自动转译,无需构建。","coding.publishNoEntry":"项目里还没有 .html 入口,先让 AI 生成页面再发布。","coding.listingTitle":"应用市场","coding.listingHint":"上架后会在应用市场「网站应用」中公开展示,需要平台审核。","coding.listingNone":"未上架","coding.listingPending":"审核中","coding.listingApproved":"已上架","coding.listingRejected":"已驳回","coding.listingNoteLabel":"驳回原因:{note}","coding.listingApply":"申请上架","coding.listingReapply":"重新申请","coding.listingWithdraw":"撤回申请","coding.listingDelist":"下架","coding.listingSummaryPh":"一句话介绍这个应用(审核后展示在市场卡片上,300 字内)","coding.listingSubmit":"提交申请","coding.termsTitle":"发布为公开页面","coding.termsIntro":"发布后,任何获得链接的人均可查看该页面,页面也可能被转发或被搜索引擎收录。请确认:","coding.termsLi1":"你有权发布页面中的文字、图片、音视频及其他内容;","coding.termsLi2":"页面不包含违法信息、侵权内容或未经许可披露的个人信息;","coding.termsLi3":"你将对自己发布的内容承担相应责任。","coding.termsManage":"平台将依据法律法规及《内容发布规范》对公开内容进行管理,并可能对违规内容采取限制访问、停止展示或删除等措施。","coding.termsAgreePre":"我已阅读并同意","coding.termsGuidelines":"《内容发布规范》","coding.termsConfirm":"确认发布","coding.cancel":"取消","coding.projectName":"项目名称","coding.create":"创建","coding.noProjects":"还没有项目。点「新建项目」创建第一个。","coding.switchProject":"切换项目","coding.generating":"生成中…","space.inbox":"收件箱","inbox.list":"消息列表","inbox.reader":"消息阅读","inbox.filter.unread":"未读","inbox.filter.archived":"已归档","inbox.source.forsion":"Forsion","inbox.source.automation":"自动化","inbox.source.agents":"Agent","inbox.reader.empty":"选择一封消息开始阅读","inbox.sender.system":"系统","inbox.sender.automation":"自动化","inbox.action.markRead":"标为已读","inbox.action.markUnread":"标为未读","inbox.action.readAll":"全部已读","inbox.action.archive":"归档","inbox.action.unarchive":"取消归档","inbox.action.delete":"删除","inbox.action.refresh":"拉取新消息","inbox.action.chat":"与 {name} 聊天","inbox.deleteConfirm":"删除消息「{title}」?","time.justNow":"刚刚","inbox.pullOk":"已拉取 {n} 条新消息","inbox.pullNone":"没有新消息","inbox.opFail":"操作失败:{e}","inbox.attach.title":"附带物品","inbox.attach.claim":"领取","inbox.approval.title":"请求批准","inbox.approval.loading":"读取审批记录…","inbox.approval.missing":"找不到这条审批记录(可能已过期或已清理)","inbox.approval.approved":"已批准并执行","inbox.approval.rejected":"已拒绝","inbox.approval.executing":"执行中…","inbox.approval.failed":"已批准,但执行失败","inbox.approval.loadFail":"读取审批记录失败","inbox.approval.retry":"重试","inbox.approval.reason.customAsk":"你的审批规则要求","inbox.approval.reason.rule":"审批规则「{rule}」","inbox.approval.reason.escalate":"写工作区以外的文件","inbox.approval.reason.mode":"审批档要求批准","inbox.approval.reason.control":"设置无人值守工作","inbox.attach.claiming":"领取中…","inbox.attach.claimed":"已领取","inbox.attach.expired":"已过期,无法领取","inbox.claim.ok":"已领取,物品已入账","inbox.claim.already":"之前已领取过","inbox.claim.fail":"领取失败","inbox.claim.unmet":"未满足领取条件,暂时领不了","inbox.attach.unmet":"未满足领取条件","inbox.req.title":"领取条件","inbox.req.version":"客户端 {v} 及以上","inbox.req.tiers":"{tiers}","inbox.req.currentVersion":"当前版本 {v}","inbox.req.currentTier":"当前:{tier}","inbox.req.other":"另有条件(以领取时服务端校验为准)","inbox.feedback.title":"反馈线程","inbox.feedback.event.created":"新的用户反馈","inbox.feedback.event.user_reply":"用户回复了反馈","inbox.feedback.event.admin_reply":"你的反馈有了回复","inbox.feedback.loading":"读取反馈线程…","inbox.feedback.loadFail":"读不到反馈线程","inbox.feedback.signIn":"登录 Forsion 账号后可查看与回复","inbox.feedback.missing":"这条反馈已不存在","inbox.feedback.retry":"重试","inbox.feedback.you":"你","inbox.feedback.support":"Forsion 支持","inbox.feedback.user":"用户","inbox.feedback.replyPh":"回复…","inbox.feedback.attach":"添加附件","inbox.feedback.attachHint":"图片 / 文本 / JSON,单个 ≤5MB,最多 5 个","inbox.feedback.remove":"移除","inbox.feedback.send":"发送","inbox.feedback.sending":"发送中…","inbox.feedback.sendFail":"发送失败:{e}","inbox.feedback.tooMany":"最多 5 个附件","inbox.feedback.tooBig":"{name} 超过 5MB 或为空","inbox.feedback.badType":"{name} 类型不支持(只收图片 / 文本 / JSON)","inbox.feedback.download":"下载","inbox.feedback.status.open":"待处理","inbox.feedback.status.in_progress":"处理中","inbox.feedback.status.resolved":"已解决","inbox.feedback.status.closed":"已关闭","inbox.tier.free":"免费用户","inbox.tier.plus":"Plus 会员","inbox.tier.pro":"Pro 会员","inbox.expiresAt":"有效期至 {d}","inbox.expired":"已过期","settings.inbox.title":"收件箱","settings.inbox.notifyLabel":"新消息系统通知","settings.inbox.notifyHint":"收到新消息时弹系统通知(点击可直达收件箱);关闭后仅保留图标角标。","amadeus.pages":"智库","amadeus.editor":"编辑器","amadeus.outline":"大纲","amadeus.backlinks":"反链","amadeus.search":"搜索","amadeus.tags":"标签","amadeus.graph":"关系图","chat.action.copied":"已复制","chat.action.edit":"编辑","chat.action.resend":"发送","chat.action.regenerate":"重新生成","chat.action.branch":"从此处分支","chat.branchTitle":"{title}(分支)","chat.branchEmpty":"当前会话还没有可分支的 AI 回复","chat.branched":"已分支到新会话(继承历史)","input.slash.branch":"从最近一条回复分支新会话(继承历史)","app.branchFail":"分支失败:{e}","sidebar.ws.menu":"项目操作","sidebar.ws.rename":"重命名项目","sidebar.ws.remove":"移除项目","app.truncateFail":"截断消息失败:{e}","search.jumpOutOfWindow":"命中的消息在更早的历史里,已打开会话但没能定位到它","rewind.busy":"运行中无法回退,请先停止当前运行","rewind.noTime":"这条消息没有时间戳,定位不到回退点","rewind.codeDone":"代码已回退({n} 个文件)","rewind.codePartial":"{bad} 个文件回退失败,已中止(对话未改动)","rewind.codeSkipped":"代码已回退 {n} 个文件;另有 {bad} 个当时没存下快照,恢复不了","rewind.codeConflict":"代码已回退 {n} 个文件;{kept} 个在那之后另有改动,已原样保留(未删)","inquiry.sendFail":"回答没送达:{e},请重试","rewind.codeFail":"回退代码失败:{e}","app.resendFailed":"重发失败,已恢复本地显示;请重试。","app.regenNoUser":"找不到可重新生成的用户消息","app.wsRenameFail":"重命名项目失败:{e}","app.moveToProjectFail":"把对话挪进作品文件夹失败:{e}","app.moveToProjectHalf":"这条对话只挪了一半:项目已切到「{name}」,但工作目录没切过去({e})。","app.sessionMoving":"正在把这条对话挪进作品文件夹,稍等一下再发。","app.wsRemoveFail":"移除项目失败:{e}","app.wsRemoved":"已移除项目「{name}」","app.wsTrashFail":"会话已删除,但 .tangu 文件夹没能移到废纸篓:{e}","app.agentTrashFail":"Agent 已删除,但它的文件没能移到废纸篓,还在 {path}","app.sessionExpired":"登录已过期,请重新登录 Forsion 账号","onboarding.connect.cloudSync":"开启云同步(同步云端 Agents)","onboarding.connect.cloudSyncHint":"开启后,记忆、日志与标记为云同步的 Agents 会在登录设备间双向同步。稍后可在「设置 → Forsion 账号」更改。","common.confirm":"确定","extendView.close":"关闭扩展视图","extendView.failed":"扩展视图加载失败","extendView.back":"返回","common.close":"关闭","common.back":"返回","common.refresh":"刷新","common.loading":"加载中…","common.listSep":"、","common.delete":"删除","common.edit":"编辑","common.open":"打开","common.language":"语言","common.copyCode":"复制代码","common.enabled":"开启","common.disabled":"关闭","locale.zh":"中文","locale.en":"English","locale.toggleTitle":"切换语言","feedback.title":"反馈","achievements.title":"成就","achievements.unlocked":"成就达成","achievements.claim":"领取","achievements.claimed":"已领取","achievements.pts":"{n} 点","achievements.seriesPts":"{n}/{total} 点","achievements.pluginGroup":"插件","achievements.medal.bronze":"铜牌","achievements.medal.silver":"银牌","achievements.medal.gold":"金牌","achievements.s.starter":"初识","achievements.s.chat":"对话","achievements.s.notes":"笔记","achievements.s.agents":"Agent","achievements.a.first-login.title":"Forsion is All You Need","achievements.a.first-login.desc":"登录 Forsion 账号","achievements.a.theme-change.title":"焕然一新","achievements.a.theme-change.desc":"更换一次主题或配色","achievements.a.market-install.title":"超级武装","achievements.a.market-install.desc":"从应用市场安装一个项目","achievements.a.space-save.title":"Space 之力","achievements.a.space-save.desc":"把当前布局另存为 Space","achievements.a.first-message.title":"Hello Agent!","achievements.a.first-message.desc":"向 Agent 发出第一条消息","achievements.a.chat-10.title":"畅所欲言","achievements.a.chat-10.desc":"累计发出 10 条消息","achievements.a.chat-100.title":"滔滔不绝","achievements.a.chat-100.desc":"累计发出 100 条消息","achievements.a.group-chat.title":"圆桌会议","achievements.a.group-chat.desc":"发起一次团队协作","achievements.a.first-note.title":"妙笔生花","achievements.a.first-note.desc":"创建第一篇笔记","achievements.a.notes-10.title":"笔耕不辍","achievements.a.notes-10.desc":"累计创建 10 篇笔记","achievements.a.notes-100.title":"著作等身","achievements.a.notes-100.desc":"累计创建 100 篇笔记","achievements.a.first-base.title":"数据雏形","achievements.a.first-base.desc":"创建第一个 Base 多维表","achievements.a.first-agent.title":"造物主","achievements.a.first-agent.desc":"创建你的第一个 Agent","achievements.a.agents-3.title":"智囊团","achievements.a.agents-3.desc":"累计创建 3 个 Agent","achievements.a.special-agent.title":"幕后协作","achievements.a.special-agent.desc":"开启后台 Agent Muse 或 Historian","achievements.a.first-image.title":"妙笔生花","achievements.a.first-image.desc":"让 Agent 生成第一张图片","achievements.a.debug-toast.title":"这都被你发现了?","achievements.a.debug-toast.desc":"??????","settings.developer.achToastLabel":"成就弹窗","settings.developer.achToast":"触发成就弹窗","settings.developer.achToastHint":"调试成就达成动画,可重复触发;它本身也是一个隐藏成就(奖励只发一次)。","settings.developer.activityLabel":"活动日志","settings.developer.activityExport":"导出活动日志","settings.developer.activityEnable":"记录应用内活动","settings.developer.activityHint":"在本机记录你的操作(开会话/改笔记/建任务等),供后台 Agent Muse 理解你在做什么;仅存本地 activity 目录,保留 30 天。导出可用于排查问题。","settings.developer.activityViewCmd":"活动日志实时视图命令","settings.developer.activityViewCmdHint":"开启后命令面板(⌘K)多一条「打开活动日志」:在主区标签页实时查看活动记录(2 秒刷新,可过滤/暂停)。","command.openActivityLog":"打开活动日志","view.activityLog":"活动日志","activityView.filter":"过滤(子串匹配)…","activityView.pause":"暂停","activityView.resume":"继续","activityView.count":"{n} 行","activityView.empty":"还没有活动记录。请确认开发者选项里「记录应用内活动」处于开启,然后随便操作几下。","command.openActiveWindow":"前台窗口采样","view.activeWindow":"前台窗口采样","activeWindowView.on":"接缝已开启","activeWindowView.off":"接缝未开启","activeWindowView.offHint":"前台窗口采样默认关闭。到 设置 → 开发者选项 打开「前台窗口采样」后,这里会实时显示当前焦点所在的应用。","activeWindowView.noSample":"开着但探不到前台窗口。Linux 上 Wayland 会话拿不到(与 ActivityWatch 同样的天花板),X11 需要 xprop。","activeWindowView.noTitle":"(本平台不提供:macOS 的窗口标题属于「屏幕录制」权限)","activeWindowView.idleMark":"挂机","activeWindowView.clear":"清空","activeWindowView.segEmpty":"正在采样。切到别的应用待一会儿再回来,下面会出现折好的焦点段(挂机段会变灰)。","space.automation":"自动化","view.automationList":"自动化列表","view.automationDetail":"自动化详情","view.automationRuns":"触发记录","automation.group.system":"系统自动化","automation.group.watches":"盯任务规则","automation.group.buttons":"按钮","automation.group.schedules":"Agent 日程","automation.group.finished":"已结束 ({n})","automation.finished":"已结束","automation.finishedHint":"一次性,时刻已过——编辑可改期重开","automation.fact.status":"状态:","automation.schedule.every":"每 {ivl}","automation.schedule.once":"一次性","automation.fact.desc":"描述:","automation.sched.name":"名称","automation.sched.date":"日期","automation.sched.dateHint":"YYYY-MM-DD 或 YYYY-MM-DDTHH:mm,可带 /结束时刻","automation.sched.repeat":"重复","automation.sched.repeatHint":"留空=一次性;如 24h / 7d,从锚点滚动","automation.builder.expiredReset":"原时刻已过,已重置为下一整点——保存即改期重开。","automation.builder.atPast":"一次性时刻已过,请重新设定时间。","automation.muse.title":"Muse 巡检","automation.muse.trigger":"每 {min} 分钟巡检","automation.muse.action":"思考可为用户做什么 → 产出 TODO","automation.historian.title":"Historian 记忆维护","automation.historian.trigger":"每 {n} 轮对话后","automation.historian.action":"总结会话、维护日志与记忆","automation.watches.empty":"还没有盯任务规则——点下方新建,或在聊天里说「帮我盯着…」。","automation.enabled":"已启用(点击停用)","automation.disabled":"已停用(点击启用)","automation.new":"新建自动化","automation.cond.daily":"每天 {time}","automation.cond.event":"活动含「{match}」","automation.cond.file":"{path} 满 {n} 字","automation.cond.at":"一次 · {time}","automation.cond.every":"每 {ivl}","automation.cond.manual":"手动 · 按钮","automation.cond.dbRow":"{path} 新增行","automation.cond.dbCell":"{path} 单元格变化","automation.cond.dbWhereN":"条件 ×{n}","automation.nextRun":"下次 {time}","automation.detail.empty":"在左侧选择一个自动化","automation.detail.latest":"最近运行","automation.detail.recent":"近期活动","automation.deepConfig":"深度配置","automation.fact.trigger":"触发:","automation.fact.action":"动作:","automation.fact.actions":"动作链:","automation.fact.runner":"执行:","automation.fact.prompt":"指令:","automation.fact.cooldown":"冷却:","automation.fact.where":"条件:","automation.fact.columns":"监听列:","automation.fact.noCooldown":"无(0h)","automation.fact.disabledReason":"已被引擎自动停用:{reason}","automation.fact.lastRun":"上次运行:","automation.fact.nextRun":"下次触发:","automation.fire.btn":"试跑","automation.fire.hint":"立即执行一次动作链(不影响正常触发节奏)","automation.fire.ok":"试跑完成({status})","automation.fire.fail":"试跑失败({status})","automation.exec.manual":"试跑","automation.exec.steps":"{n} 步完成","automation.step.notify":"通知","automation.step.agent_run":"跑 Agent","automation.step.db_row_add":"表格加行","automation.step.db_row_edit":"表格改行","automation.step.tool_call":"调工具","automation.transcript.empty":"还没有运行内容","automation.transcript.trigger":"触发输入","automation.transcript.agent":"Agent","automation.transcript.tools":"工具调用 {n} 次","automation.trigger.neverFired":"还没触发过——命中后这里会出现该次运行","automation.trigger.museNote":"该规则命中会唤醒 Muse,运行内容见","automation.runs.empty":"暂无记录","automation.runs.pick":"选中一条自动化后,这里显示它的运行记录","automation.builder.title":"新建自动化","automation.builder.editTitle":"编辑自动化","automation.builder.trigger":"触发","automation.builder.desc":"名称","automation.builder.descPh":"一句话描述这个自动化","automation.builder.condType":"触发方式","automation.builder.condTimer":"定时","automation.builder.condEvent":"事件","automation.builder.condFile":"文件达标","automation.builder.condManual":"手动(按钮)","automation.builder.condDb":"多维表","automation.builder.manualHint":"不会自动触发。在笔记里插入「按钮」块并选中这条规则,由你点击执行。","automation.builder.unsupported":"这条规则含有当前构建器还不认识的动作类型。用聊天里的 manage_automation 修改(在这里保存会把那部分抹掉,所以不给编辑)。","automation.builder.dbPath":"哪张多维表(.db)","automation.builder.dbPickDb":"选择多维表…","automation.builder.dbEvent":"监听事件","automation.builder.dbEventRow":"新增行","automation.builder.dbEventCell":"单元格变化","automation.builder.dbColumn":"监听列(可多选)","automation.builder.dbColumnsHint":"勾选多列时任一列变化即触发;「新值等于」按变化的那一列比。","automation.builder.dbPickCol":"选择列…","automation.builder.dbColsLoading":"表读取中…","automation.builder.dbEquals":"且新值等于(可选)","automation.builder.dbEqualsPh":"留空 = 任意变化都触发","automation.builder.dbHint":"表内容变化后由引擎按游标比对触发;规则钉在建立时的智库,切换智库不误伤同名表。","automation.builder.dbRowId":"行 id","automation.builder.dbRowIdPh":"留空 = 触发命中的那一行","automation.builder.dbRowIdRequired":"必填(当前触发方式没有「触发行」可缺省)","automation.builder.dbCells":"写入字段","automation.builder.dbCellKey":"列名或列 id","automation.builder.dbCellVal":"值(可用 {{row.列名}} 模板)","automation.builder.dbCellAdd":"添加字段","automation.builder.dbCellsHint":"多维表触发时,值里的 {{row.列名}} 会替换成触发行对应单元格。","automation.builder.dbCellValPh":"{{= {target.数量} - {row.出库数量} }}","automation.builder.dbWhere":"附加条件(可选)","automation.builder.dbWhereAdd":"添加条件","automation.builder.dbWhereOpEq":"等于","automation.builder.dbWhereOpNe":"不等于","automation.builder.dbWhereOpEmpty":"为空","automation.builder.dbWhereOpNotEmpty":"不为空","automation.builder.dbWhereValPh":"值","automation.builder.dbWhereHint":"与上面的条件 AND;比对触发行物化后的值,公式/引用列也可比;最多 10 条。","automation.builder.dbRowFrom":"沿关联列取目标行(可选)","automation.builder.dbRowFromPh":"触发表里的关联列名或列 id;留空 = 用上面的行 id","automation.builder.dbMatch":"按列值匹配多行(可选)","automation.builder.dbMatchValPh":"值,可用 {{row.id}} 模板","automation.builder.dbTargetHint":"目标行优先级:行 id > 关联列 > 列值匹配 > 触发命中的那一行。","automation.builder.dbSkipIfEmpty":"此字段为空则跳过(可选)","automation.builder.dbSkipIfEmptyPh":"填一个上面的列名/列 id","automation.builder.cooldownDbHint":"多维表触发的纯动作链可设 0 = 不冷却(链式规则需要)","automation.builder.dbNoteView":"选中的是「笔记视图」库(行来自文件夹里的笔记)——自动化只支持经典多维表,请换一张。","automation.builder.timerMode":"定时方式","automation.builder.timerDaily":"每天","automation.builder.timerOnce":"一次","automation.builder.timerEvery":"间隔","automation.builder.time":"每天时刻","automation.builder.datetime":"触发时刻","automation.builder.onceHint":"到点执行一次后自动停用(留在列表里,改期+启用即可复用)。","automation.builder.interval":"重复间隔","automation.builder.everyHint":"从创建时刻起按间隔滚动;停机错过只补最近一次。含跑 Agent 步骤时下限 1 小时。","automation.builder.unitM":"分钟","automation.builder.unitH":"小时","automation.builder.unitD":"天","automation.builder.match":"活动日志匹配串","automation.builder.matchPh":"如 note.edit、文件名或 plugin: 事件","automation.builder.matchHint":"匹配新出现的活动日志行(子串)。可盯插件事件(plugin:插件id:事件)或 run.done agent=xx。","automation.builder.path":"文件路径(绝对路径或 ~ 开头)","automation.builder.chars":"非空白字符数","automation.builder.stepN":"步骤 {n}","automation.builder.moveUp":"上移","automation.builder.moveDown":"下移","automation.builder.notifyTitle":"通知标题","automation.builder.notifyTitlePh":"收件箱消息标题","automation.builder.notifyBody":"通知正文(可选)","automation.builder.notifyHint":"直接投递到收件箱(0 token),已接微信/TG 等通道会一并推送。","automation.builder.runner":"执行者","automation.builder.runnerPick":"选择 Agent…","automation.builder.tool":"工具","automation.builder.toolPick":"选择工具…","automation.builder.dangerous":"⚠ 高危工具:参数即保存即批准,请确认内容","automation.builder.toolCatalogEmpty":"引擎未提供动作目录(需新版引擎)","automation.builder.museFallback":"唤醒 Muse(默认)","automation.builder.museFallbackHint":"不加步骤时,命中会唤醒 Muse 把这件事整理成给你的提醒/TODO。添加步骤则改为按步骤执行。","automation.builder.prompt":"执行指令","automation.builder.promptPh":"命中后让它做什么(英文最佳)","automation.builder.cooldown":"冷却(小时)","automation.builder.cooldownHint":"两次触发的最小间隔,单位小时(纯通知/工具链下限 0.25=15 分钟)","automation.builder.cooldownAgentHint":"含跑 Agent 步骤,下限 1 小时(无人值守自激护栏)","market.title":"应用市场","market.subtitle":"发现社区构建的工作流、能力与界面扩展","market.navSubtitle":"社区扩展与工作流","market.group.discover":"发现","market.group.categories":"分类","market.group.manage":"管理","market.tab.discover":"商店首页","market.tab.skills":"技能","market.tab.agents":"Agent","market.tab.plugins":"插件","market.tab.spaces":"Space","market.tab.themes":"主题","market.tab.webapps":"网站应用","market.tab.installed":"已安装","market.searchPlaceholder":"搜索名称、作者或标签","market.clearSearch":"清除搜索","market.sort.label":"排序","market.sort.popular":"热门","market.sort.latest":"最近","market.sort.name":"名称","market.sectionSubtitle":"浏览{section}并管理安装状态","market.detailSubtitle":"详情、来源与安装信息","market.webOpen":"打开","market.webHint":"用户用 Coding Space 构建并上架的网页应用,在内置浏览器中打开;AI 功能消耗访客自己的账号额度。","market.tab.updates":"可更新","market.tab.submit":"投稿","market.author":"作者","market.downloads":"{n} 次下载","market.downloadsShort":"{n} 下载","market.install":"安装","market.installing":"安装中…","market.installed":"已安装","market.reinstall":"重新安装","market.uninstall":"卸载","market.uninstallConfirm":"卸载「{name}」?将删除它的安装目录。","market.uninstallWarnAgent":"⚠️ 这是一个 Agent:它落地后有自己的记忆与日志,卸载会一并删除,且无法恢复。","market.uninstallWarnSkill":"⚠️ 若你改过这份技能,你的改动会一并删除。","market.uninstalled":"已卸载「{name}」","market.uninstalledNeedsRestart":"已卸载「{name}」· 重启后端后它的工具才会真正消失","market.uninstallFail":"卸载失败:{e}","market.openSettings":"打开设置","market.update":"更新","market.updateTitle":"更新 v{from} → v{to}","market.allUpToDate":"已安装的内容都是最新版本","market.allUpToDateHint":"发现新版本时会自动出现在这里。","market.detailBack":"返回列表","market.empty":"这个分类还没有内容","market.emptyHint":"社区内容通过审核后会出现在这里。","market.noInstalled":"还没有安装市场内容","market.noResults":"没有找到匹配内容","market.noResultsHint":"换一个名称、作者或标签试试。","market.browse":"浏览商店","market.retry":"重新加载","market.loadFailShort":"应用市场暂时无法加载","market.loadFail":"加载失败:{e}","market.summaryFallback":"作者暂未提供简介。","market.searchResults":"搜索结果","market.resultCount":"共 {n} 项内容","market.featured":"社区精选","market.viewDetails":"查看详情","market.recent":"最近上架","market.recentHint":"看看社区刚刚带来了什么。","market.popular":"热门内容","market.popularHint":"按真实安装量排序。","market.overview":"内容介绍","market.reviewed":"已通过上架审核","market.reviewedHint":"表示内容符合发布要求,不代表 Forsion 为第三方代码提供担保。","market.type":"类型","market.version":"版本","market.source":"安装来源","market.sourceUpload":"Forsion 托管包","market.updated":"最近更新","market.unknown":"未知","market.installOk":"已安装「{name}」","market.spaceInstalled":"已安装 Space「{name}」并加入功能栏","market.themeInstalled":"已安装「{name}」,可在 设置 → 外观 中选用","market.amadeusPluginInstalled":"Forsion 插件「{name}」已安装并加载","market.pluginInstalledOk":"插件已安装并启用","market.pluginInstalledRestartHint":"插件已安装,重启后端后才完整生效","market.pluginInstalledWaiting":"插件已安装,但还需要先安装或启用:{list}","market.amadeusPluginNeedsDeps":"Forsion 插件「{name}」已安装,但还需要先安装或启用:{list}","market.restartBackend":"重启后端","market.restartBackendHint":"只需几秒;正在运行的对话会被中断","market.backendRestarting":"正在重启后端…","market.backendRestarted":"后端已重启,改动已生效","market.backendRestartFailed":"后端没能重启,请稍后重试或重启应用","market.installFail":"安装失败:{e}","market.installFailNamed":"「{name}」安装失败:{e}","market.installHintGithub":"这个项目从 GitHub 下载,部分网络下连不上。可以开启系统代理后重试,或在「设置 → 常规 → 连接」打开「使用中国大陆镜像源」,改走国内代理线路。","market.installRetry":"重试","market.phase.resolve":"准备中…","market.phase.connect":"连接中…","market.phase.connectN":"连接中 {n}/{m}…","market.phase.percent":"下载中 {n}%","market.phase.bytes":"已下载 {size}","market.openRepo":"查看 GitHub 仓库","market.readmeEmpty":"(暂无详情)","market.submitHint":"支持 GitHub 仓库、npm 公开包和 ZIP 上传。在个人中心提交,审核通过后上架。","market.submitOpen":"前往投稿页","market.submitKicker":"开发者中心","market.submitTitle":"把你的工作流带给更多人","market.submitArtTitle":"统一审核与版本管理","market.submitArtHint":"Skills、Agents、Plugins、Spaces 与 Themes 使用同一条发布管线。","feedback.label":"遇到的问题 / 想反馈的内容","feedback.placeholder":"描述你遇到的问题或建议……提交后会自动附带本次会话日志,便于我们排查。","feedback.logAttached":"将自动附带本次会话日志({name})","feedback.noSession":"当前无会话,仅提交文字反馈","feedback.submit":"提交反馈","feedback.diagnoseViaChat":"让 Tangu 帮我诊断","feedback.diagnoseViaChatHint":"把问题描述发给当前会话的 Agent,就地帮你排查","feedback.ok":"已提交,感谢你的反馈!","feedback.okNoLog":"已提交(会话日志超过 5MB,本次未附带)","feedback.errEmpty":"请先填写反馈内容","feedback.errFail":"提交失败:{err}","feedback.errNotLoggedIn":"未登录 Forsion,无法提交","feedback.errUnavailable":"当前环境不支持提交反馈","sidebar.account.login":"登录 Forsion","sidebar.account.loginHint":"登录后可用云端记忆 / 技能 / 托管模型(不登录也能正常使用)","sidebar.account.loggingIn":"登录中…","sidebar.account.logout":"退出登录","sidebar.account.menu.weekly":"本周","sidebar.account.menu.daily":"今日","sidebar.account.menu.unlimited":"不限","sidebar.account.menu.loading":"加载中…","sidebar.account.menu.quotaFail":"额度加载失败","settings.provider.loginBusy":"在浏览器里完成登录后,本地引擎会自动重启加载该 provider,模型列表随后自动刷新(约几秒)。","quota.exhausted.daily":"今日 AI 额度已用尽(本次运行已预支跑完;可在「Forsion 云端 → 额度与积分」用额度重置卡立即恢复)","quota.exhausted.weekly":"本周 AI 额度已用尽(本次运行已预支跑完;可在「Forsion 云端 → 额度与积分」用额度重置卡立即恢复)","sidebar.account.loginFail":"登录失败:{e}","sidebar.account.loginSub":"点击登录","sidebar.account.engineDown":"引擎未运行 · 点击重启","sidebar.account.engineStarting":"引擎启动中…","sidebar.settings":"设置 (Ctrl+,)","header.theme":"深浅模式","header.browser":"浏览器","header.browserEnabled":"浏览器工具已开启","header.browserDisabled":"浏览器工具已关闭","settings.tab.about":"关于","about.version":"版本","about.checkUpdates":"前往官网","about.update.check":"检查更新","about.update.checking":"检查中…","about.update.upToDate":"已是最新版本","about.update.available":"发现新版本 v{version}","about.update.download":"下载更新","about.update.downloading":"下载中 {percent}%","about.update.install":"重启并安装","about.update.goToDownload":"前往下载","about.update.error":"更新失败:{error}","about.update.unsupported":"开发环境不支持自动更新","about.update.unreachable":"连不上更新服务器,稍后再试","about.update.beta":"接收测试版更新","about.update.betaHint":"打开后会收到 x.y.z-beta.N 这类预发布版本(功能更早、也更可能有问题)。关着则完全看不到它们。正式版永远优先:测试版之后发的正式版照常推送。","app.update.bannerTitle":"发现新版本 v{version}","app.update.bannerAction":"前往更新","app.update.bannerDismiss":"忽略","about.changelogTitle":"最新更新","about.builtWith":"Forsion Desktop · 扶桑","about.builtWithMobile":"Forsion 移动端 · 扶桑","about.complianceTitle":"备案与协议","about.appFiling":"App 备案号","about.privacy":"隐私政策","about.terms":"服务条款","settings.cloud.envOnly":"Forsion 云端地址由环境变量 TANGU_CLOUD_URL 设置(此处只读)。","settings.cloud.label":"Forsion 云端地址(大脑:记忆/技能/托管模型)","settings.cloud.unset":"(未设置,用内置默认)","model.group.forsion":"Forsion 云端","picker.ungrouped":"未分组","model.group.direct":"本地","model.collapseAll":"全部折叠","model.expandAll":"全部展开","model.empty":"暂无模型","model.searchPlaceholder":"搜索模型…","settings.tab.developer":"开发者选项","settings.tab.browser":"浏览器控制","settings.tab.channels":"通道","channel.name.wechat":"微信","channel.name.telegram":"Telegram","channel.name.qq":"QQ","channels.intro":"把 Tangu 接进你的 IM:连接即新建一个通道会话,消息即聊即答;收件箱转发可独立开启,两者互不影响。","channels.loadingTitle":"正在加载通道","channels.loadingHint":"正在读取本机通道能力与连接状态。","channels.notAvailable":"通道功能需要内置本地后端(桌面版)。","channels.notAvailableHint":"确认本机后端已启动后重试;外部后端模式暂不提供此设置。","channels.enable":"启用","channels.status.connected":"已连接","channels.status.notConnected":"未连接","channels.status.disabled":"已停用","channels.connect":"连接","channels.scanConnect":"扫码连接","channels.disconnect":"断开连接","channels.disconnected":"已断开。","channels.connectedAs":"已连接:{label}","channels.connectedMsg":"微信已连接,已新建通道会话。","channels.connectFailed":"操作失败:{e}","channels.qrExpired":"二维码已过期,请重新扫码。","channels.scanQrHint":"用微信「扫一扫」确认登录。","qr.failed":"二维码生成失败,请重试。","qr.alt":"登录二维码","channels.newSessionHint":"连接即新建会话;之后的消息发往该会话。在 IM 里可用 /new 新建、/list /switch 切换会话,/help 查看全部命令。","channels.botToken":"Bot Token","channels.botTokenHint":"在 Telegram 找 @BotFather 创建机器人获取 token,填入后点「连接」。","channels.qqHint":"在 QQ 开放平台(q.qq.com)创建机器人获取 AppID / AppSecret。","channels.secretSaved":"已保存(输入可更换)","channels.sessionsSec":"通道会话","channels.sessions":"启用通道会话","channels.sessionsHint":"收到的消息驱动 Agent 会话并回复;关闭后仅收件箱转发在工作。","channels.approval":"远程审批","channels.approval.readonly":"询问我批准","channels.approval.autoEdit":"替我批准","channels.approval.fullAuto":"完全放行","channels.defaultAgent":"默认 Agent","channels.defaultModel":"默认模型","channels.imageModel":"画图模型","channels.ttsModel":"语音模型","channels.ttsModelPlaceholder":"空=沿用「语音朗读」设置","channels.ttsVoice":"音色","channels.followDefault":"跟随全局默认","channels.followGlobal":"跟随全局设置","channels.forwardSec":"收件箱转发","channels.forward":"转发收件箱消息到此通道","channels.forwardHint":"收件箱有新消息时推送到你的 IM(与通道会话相互独立)。","channels.forwardSenders":"允许的发件人","channels.forwardAll":"全部","channels.waitingPeer":"已连接,等待对方发来第一条消息以绑定联系人。","channels.senderSystem":"系统","channels.senderServer":"Forsion 云端","sidebar.channel.setAsConnected":"设为正在连接","settings.tab.notes":"笔记","settings.tab.sync":"同步","settings.sync.cloudSec":"在线同步","settings.sync.remoteSec":"本地智库远程同步","settings.notes.storageTitle":"文件与附件","settings.notes.storageDescription":"集中设置附件落点与日记目录。","settings.notes.behaviorTitle":"编辑与安全","settings.notes.behaviorDescription":"控制导入、链接兼容与删除附件时的保护策略。","settings.notes.modeLabel":"附件存放方式","settings.notes.modeAttachments":"笔记同目录下的 attachments 文件夹","settings.notes.modeSame":"与笔记同目录","settings.notes.modeVault":"智库内固定文件夹","settings.notes.modeHint":"拖入笔记的文件保存到哪里。attachments 模式会在笔记所在目录自动创建 attachments 子文件夹(不存在则新建)。","settings.notes.folderLabel":"智库相对文件夹","settings.notes.folderHint":"相对智库根目录,如 assets。所有附件集中存放于此(需在智库内才能内联预览)。","settings.notes.previewLabel":"导入文件默认开启预览","settings.notes.previewHint":"开启:插入 ![[文件]] 预览块(图片内联,其它显示可点开的文件卡片)。关闭:插入 [文件名](相对路径) 链接。","settings.notes.upgradeV4Label":"打开旧笔记时升级为 v4 纯 Markdown 格式","settings.notes.upgradeV4Hint":"默认开启:v3 块标记笔记在编辑时转为纯 Markdown(无标记、标准分段)。升级仅在你真正编辑后落盘;若还有设备停留在 2.7.8 以前,可暂时关闭。","settings.notes.dailyLabel":"日记文件夹","settings.notes.dailyPlaceholder":"留空 = 智库根目录","settings.notes.dailyHint":"「打开今天的日记」创建 YYYY-MM-DD.md 的位置(智库相对路径);若存在 templates/daily.md 会自动套用为模板。","settings.notes.wikiFilesLabel":"双链补全包含附件与多维表","settings.notes.wikiFilesHint":"开启:输入 [[ 时除笔记外也补全附件、多维表(.db)、画板等文件。关闭:只补全笔记。","settings.notes.canvasDoubleClickFocusLabel":"双击聚焦画布卡片","settings.notes.canvasDoubleClickFocusHint":"双击卡片一律进入编辑并把光标落到点击处。开启:进编辑的同时还把它平滑移到画面中心并缩放到适合阅读的比例;关闭:只进编辑,视口不动。单击只选中;空格也可进编辑。","settings.notes.canvasOverviewZLabel":"画布简略标题的触发比例","settings.notes.canvasOverviewZHint":"画布缩小到这个比例或更小时,卡片正文换成标题摘要。默认 25% = 只在缩到底那一档才简略;调高则更早换成摘要。画布右下角的开关可以整个关掉简略显示。","settings.notes.deleteAssetsLabel":"删除笔记时连带删除独占附件","settings.notes.deleteAssetsAsk":"每次询问","settings.notes.deleteAssetsYes":"记住:一并删除","settings.notes.deleteAssetsNo":"记住:保留附件","settings.notes.deleteAssetsHint":"只处理「仅被这条笔记引用」的附件;被别的笔记也引用的一律保留。","settings.remote.saved":"远程设置已保存。托管后端可能会重启以应用配置。","settings.browser.title":"浏览器控制","settings.browser.agentBrowser":"Agent 浏览器","settings.browser.hint":"Tangu 会优先使用 browser_search 与 browser_* 交互工具完成网页任务;web_search 保留兼容。","settings.browser.engine":"浏览器引擎","settings.browser.engineHint":"自动模式会按可用性选择浏览器实现。","settings.browser.searchEngine":"搜索引擎","settings.browser.timeout":"超时","settings.browser.timeoutHint":"单次浏览器命令的最长等待时间(毫秒)。","settings.browser.allowPrivate":"允许浏览器工具打开私网/本机 URL","settings.browser.allowPrivateHint":"默认关闭;browser_navigate 会阻止 localhost、RFC1918 与 link-local 地址。","settings.tab.spaces":"Space","settings.spaces.hint":"管理 ribbon 顶部的 Space。内置 Space 随应用提供、不可移除;你自建或从市场安装的 Space 可卸载(删除其磁盘布局配方)。","settings.spaces.builtin":"内置","settings.spaces.user":"自建/市场","settings.spaces.uninstall":"卸载","settings.spaces.uninstalled":"已卸载「{name}」","settings.spaces.empty":"还没有任何 Space。","settings.spaces.startupTitle":"启动位置","settings.spaces.startupLabel":"打开应用时进入","settings.spaces.startupHint":"默认进入 ribbon 主位槽指着的那个 Space;也可以回到上次退出的 Space 并恢复标签页,或固定进入某一个。","settings.spaces.lastExit":"上次退出的 Space(连同标签页)","settings.spaces.homeSlotStartup":"主位槽的 Space(默认 · 当前是「{name}」)","settings.spaces.homeSlotLabel":"Ribbon 主位槽","settings.spaces.homeSlotHint":"ribbon 竖条正中那一格。默认放主页,也可以换成任何一个 Space;在那一格上右键同样能换。","settings.spaces.libraryTitle":"已安装的 Space · {count}","settings.tab.plugins":"插件","settings.tab.amadeusPlugins":"插件","settings.amadeusPlugins.builtinTitle":"内置插件","settings.amadeusPlugins.builtinHint":"随 App 发行、默认开启的能力(浏览器/终端/日历是宿主原生视图,其余是编辑器增强)。关闭即从工作台、命令面板与编辑器中移除 —— 日历连同它的 Space 一起撤下。","settings.amadeusPlugins.externalTitle":"外置插件","settings.amadeusPlugins.changelog":"更新日志","settings.amadeusPlugins.hint":"启用/禁用即时生效,点击插件可查看详情。插件目录:~/.forsion/plugins/(市场安装位置)。插件可捆绑引擎插件/Agent/技能/Space(捆绑包),随本插件一并识别、启停与卸载。","settings.amadeusPlugins.openFolder":"打开插件文件夹","settings.amadeusPlugins.reload":"重新加载","settings.amadeusPlugins.scaffold":"创建示例插件","settings.amadeusPlugins.builtin":"内置","settings.amadeusPlugins.external":"外部","settings.amadeusPlugins.agentOwned":"{agent} 自建 Space","settings.amadeusPlugins.blockedInvalid":"插件清单无效:{reason}","settings.amadeusPlugins.uninstall":"卸载","settings.amadeusPlugins.uninstallConfirm":"确定卸载插件「{name}」?其文件夹将被整体删除;内嵌的引擎插件/Space 一并移除(已播种的 Agent 会保留,可在 Agents 页手动删)。","settings.amadeusPlugins.uninstalled":"已卸载「{name}」","settings.amadeusPlugins.uninstalledRestartPending":"「{name}」文件已删除,但引擎重启未完成——内嵌工具可能仍在运行,请手动重启后端","settings.amadeusPlugins.bundleEngine":"引擎插件 ×{n}","settings.amadeusPlugins.bundleAgents":"Agent ×{n}","settings.amadeusPlugins.bundleSkills":"技能 ×{n}","settings.amadeusPlugins.bundleSpaces":"Space ×{n}","settings.amadeusPlugins.bundleTitle":"捆绑内容","settings.amadeusPlugins.bundleEngineList":"引擎插件:{list}","settings.amadeusPlugins.bundleAgentsList":"Agent:{list}","settings.amadeusPlugins.bundleSkillsList":"技能:{list}","settings.amadeusPlugins.bundleSpacesList":"Space:{list}","settings.amadeusPlugins.bundleHint":"内嵌引擎插件与 Space 随本插件启停/卸载;Agent 首次发现时播种进引擎,之后独立存在(升级不覆盖、卸载保留)。","settings.amadeusPlugins.blockedApi":"需要插件 API v{v},与当前应用不兼容","settings.amadeusPlugins.blockedMinApp":"需要应用版本 ≥ {v}","settings.amadeusPlugins.empty":"还没有任何插件。","settings.amadeusPlugins.back":"返回列表","settings.amadeusPlugins.dep":"依赖应用","settings.amadeusPlugins.depConnected":"已连接 {v}","settings.amadeusPlugins.depMissing":"未检测到,需要安装并运行","settings.amadeusPlugins.depCheck":"检测连接","settings.amadeusPlugins.depInstall":"一键安装","settings.amadeusPlugins.depInstalling":"安装中…","settings.amadeusPlugins.depFail":"安装未完成,可打开官网手动安装","settings.amadeusPlugins.depHomepage":"打开官网","settings.amadeusPlugins.commands":"命令","settings.amadeusPlugins.settings":"设置","plugin.onboarding.title":"插件引导 — {name}","plugin.onboarding.stepsTitle":"就绪步骤","plugin.onboarding.settingsTitle":"必要设置","plugin.onboarding.recommendsTitle":"配套推荐","plugin.onboarding.install":"安装","plugin.onboarding.installed":"已装","plugin.onboarding.installing":"安装中…","plugin.onboarding.notFound":"未在市场上架","plugin.onboarding.later":"稍后","plugin.onboarding.done":"完成","plugin.onboarding.laterHint":"跳过后随时可回 设置 → Forsion 插件,点该插件的「运行引导」继续;前置条件全部满足后「待引导」标记会自己消失。","plugin.onboarding.requiresTitle":"开始前需要","plugin.onboarding.req.ok":"已就绪","plugin.onboarding.req.unmet":"未完成","plugin.onboarding.req.unknown":"暂时无法检查","plugin.onboarding.req.timeout":"检查超时,稍后再试一次。","plugin.onboarding.req.inactive":"启用插件后才能检查这一项。","plugin.onboarding.recheck":"重新检查","plugin.onboarding.checking":"检查中…","plugin.onboarding.allReady":"全部就绪,可以开始用了。","plugin.onboarding.someUnknown":"没有发现未完成的项;另有 {n} 项此刻无法检查。","plugin.onboarding.guideTitle":"使用说明","plugin.onboarding.badge":"待引导","plugin.onboarding.run":"运行引导","plugin.onboarding.nudgeTitle":"「{name}」插件还差几步就绪","plugin.onboarding.nudgeBody":"「{name}」还有前置条件没满足。打开 设置 → Forsion 插件 → {name},点「运行引导」查看缺哪一项。","settings.plugins.npmInstallTitle":"从 npm 安装引擎插件","settings.plugins.npmInstallHint":"输入包名(如 npm:@forsion/tangu-computer-use)。插件以你的完整系统权限运行,只安装信任的来源。","settings.plugins.npmInstallConfirm":"即将从 npm 安装「{spec}」。插件以你的完整系统权限运行,装前请确认来源可信。继续?","settings.plugins.preferMirror":"国内镜像优先","settings.plugins.installBtn":"安装","settings.plugins.installing":"安装中…","settings.plugins.installed":"已安装 {id}@{version}","settings.plugins.empty":"暂无插件","settings.plugins.secForsion":"Forsion 插件","settings.plugins.secEngine":"Tangu 引擎插件","settings.plugins.bundleOwnedHint":"另有 {n} 个引擎插件由上方 Forsion 插件捆绑提供,在对应插件卡片中随插件统一启停。","settings.plugins.selectHint":"选择左侧插件查看其设置","settings.plugins.builtin":"内置","settings.plugins.folder":"文件夹","settings.plugins.needsRestart":"需重启","settings.plugins.needsRestartHint":"新版本已在磁盘上,但它的入口引用了相对路径模块,需重启后端才会运行新版","settings.plugins.waitingDeps":"等待前置插件","settings.plugins.loadFailed":"加载失败","settings.plugins.settling":"正在收尾","settings.plugins.settlingHint":"上一次启动或停用还没结束,结束后会按开关自动生效","settings.plugins.needsDepsToEnable":"需要先安装并启用:{list}","settings.plugins.disableDependents":"停用「{name}」后,依赖它的插件也会暂停:{list}。重新启用后它们会自动恢复。继续吗?","settings.plugins.uninstallDependents":"以下插件依赖「{name}」,卸载后将无法运行:{list}。","settings.plugins.openFolder":"打开插件文件夹","settings.plugins.rescan":"重载插件","settings.plugins.rescanning":"重扫中…","settings.plugins.rescanAdded":"重扫完成:{n} 个插件有变化(新装、更新或移除)","settings.plugins.rescanNone":"重扫完成:没有变化","settings.plugins.rescanHint":"新装入、更新或移除的插件即时生效;入口引用相对路径模块的插件更新后仍需重启后端","settings.plugins.uninstall":"卸载","settings.plugins.uninstallConfirm":"卸载「{name}」?将删除插件文件与全部设置。","settings.plugins.uninstalled":"已卸载「{name}」","settings.plugins.scope":"作用域","settings.plugins.scopeGlobal":"全局","settings.plugins.scopeAgent":"按 Agent","settings.plugins.selectAgent":"选择 Agent","settings.plugins.noSettings":"该插件无可配置项","settings.plugins.saved":"已保存","settings.plugins.import":"导入图片","settings.plugins.deleteConfirm":"删除「{name}」?","settings.plugins.onlyImage":"只能导入图片(png/jpg/gif/webp)","about.versionClickHint":"再点 {n} 次开启开发者模式","about.devUnlocked":"开发者模式已开启","settings.developer.note":"以下选项面向高级用户/调试,一般无需修改。","settings.developer.cloudUrlLabel":"Forsion 云端地址","settings.developer.cloudUrlHint":"大脑服务(记忆/技能/托管模型)的地址。留空则用环境变量 TANGU_CLOUD_URL 或内置默认。托管模式下保存会重启后端使其生效。","settings.developer.cloudUrlPlaceholder":"https://api.forsion.net","settings.developer.saveCloudUrl":"保存","settings.developer.savedRestarting":"已保存,正在重启后端…","settings.developer.saved":"已保存","settings.developer.relaunchLabel":"引导界面","settings.developer.relaunchHint":"重新进入首次安装的引导流程(主题 / 连接 / 模型 / 项目目录)。","settings.developer.relaunch":"重新进入引导","settings.developer.disable":"关闭开发者模式","settings.developer.showSystemPrompt":"回复前显示 system prompt","settings.developer.showSystemPromptHint":"开启后,每条 AI 回复前会显示本条消息发送给模型的完整 system prompt(可展开检查内容与结构);仅本机调试,关闭开发者模式时自动一并关闭。","settings.developer.activeWindow":"前台窗口采样(接缝)","settings.developer.activeWindowHint":"开启后,声明了 activeWindow 能力的插件可以读到「现在焦点在哪个应用」——用来替掉 ActivityWatch 这类外部依赖。数据只留本机。命令面板(⌘K)会多一条「前台窗口采样」调试面板。默认关闭,关闭开发者模式时自动一并关闭。","settings.developer.mobileUiPreview":"移动端 UI 预览命令","settings.developer.mobileUiPreviewHint":"开启后命令面板(⌘K)多一条「切换到移动端 UI」,运行时把桌面壳换成单列移动壳预览(会刷新页面);web 端同样可用。仅本机调试,关闭开发者模式时自动一并关闭。","command.switchToMobileUi":"切换到移动端 UI","command.switchToDesktopUi":"切换回桌面 UI","command.zoomIn":"放大页面","command.zoomOut":"缩小页面","command.zoomReset":"重置页面缩放","chat.systemPrompt":"系统提示词","onboarding.brand.caption":"AI 工作台","onboarding.progress.label":"设置进度","onboarding.phase.connect":"连接账号","onboarding.phase.appearance":"选择外观","onboarding.phase.capabilities":"配置能力","onboarding.phase.workspace":"准备项目目录","onboarding.welcome.kicker":"首次设置","onboarding.welcome.subtitle":"把模型、Agent、知识和本地工具放进同一个应用。","onboarding.welcome.railLabel":"从这里开始","onboarding.welcome.railTitle":"让 Forsion 适合你的工作方式。","onboarding.welcome.railBody":"几分钟内完成基础设置。每一项之后都可以在设置中修改。","onboarding.welcome.promiseModels":"连接 Forsion 或你自己的模型","onboarding.welcome.promiseAgents":"准备可随时切换的 Agent","onboarding.welcome.promiseLocal":"保留本地文件与执行控制权","onboarding.step.connect.title":"连接模型与账号","onboarding.step.connect.description":"登录 Forsion、使用订阅额度,或接入自己的 OpenAI 兼容服务。","onboarding.step.theme.title":"选择界面外观","onboarding.step.theme.description":"设计语言决定结构,主题色决定强调色,背景色决定底色,三者可以自由组合。","onboarding.step.model.title":"选择默认模型","onboarding.step.model.description":"先选一个日常模型,之后可以在每次对话中随时切换。","onboarding.step.speech.title":"配置语音输入","onboarding.step.speech.description":"选择语音识别模型,也可以保持默认并稍后配置。","onboarding.step.agents.title":"认识你的 Agent","onboarding.step.agents.description":"查看现有名册,按需创建一个有专属人格和记忆的助手。","onboarding.step.workspace.title":"选择工作目录","onboarding.step.workspace.description":"为本地会话指定默认目录,Forsion 只在你授权的范围内工作。","onboarding.step.env.title":"检查本机环境","onboarding.step.env.description":"确认编码任务所需工具,并按当前网络环境选择下载源。","onboarding.step.done.title":"一切准备就绪","onboarding.step.done.description":"基础配置已经完成,现在可以进入 Forsion 开始工作。","onboarding.done.cloudLine1":"· 输入栏可随时切换模型与思考档位;笔记、日历与自动化都在 Forsion 里","onboarding.done.cloudLine2":"· 设置 → 外观可随时改主题与语言;桌面版还能连接本机文件与工具","onboarding.connect.modeLabel":"连接方式","onboarding.model.choiceLabel":"默认对话模型","onboarding.speech.choiceLabel":"语音输入","onboarding.workspace.choiceLabel":"默认工作目录","onboarding.connect.forsionHint":"用 Forsion 账号登录(云端地址由环境变量配置,无需填写);也可在上方切换为自带 API Key。","onboarding.connect.skipForNow":"暂时跳过","onboarding.theme.stepLabel":"选择主题外观","onboarding.theme.modeLabel":"明暗模式","onboarding.theme.light":"浅色","onboarding.theme.dark":"深色","onboarding.theme.hint":"随时可在 设置 → 外观 中更改。","onboarding.theme.customSeedLabel":"自定义强调色","settings.theme.system":"跟随系统","settings.theme.modeLocked":"该主题固定跟随系统明暗","settings.theme.modeLockedHint":"Glass 等主题的明暗由系统决定,不可手动切换。","settings.theme.zoomLabel":"界面大小","settings.theme.zoomHint":"缩放整个界面,当前 {percent}%。也可用 ⌘/Ctrl + +/− 按 10% 微调。","settings.theme.zoomPresetLabel":"界面大小预设","settings.theme.zoomSmall":"小","settings.theme.zoomStandard":"标准","settings.theme.zoomLarge":"大","settings.theme.smoothCaret":"丝滑光标","settings.theme.smoothCaretHint":"编辑器与聊天输入框的文字光标平滑滑动到新位置(Word 手感)。默认关闭,需要时手动打开。","settings.theme.chatAvatars":"聊天头像","settings.theme.chatAvatarsHint":"在对话里显示 Agent 与你的头像。关掉后消息更素净,Agent 名字仍保留。","settings.theme.fontUi":"界面字体","settings.theme.fontBody":"正文字体","settings.theme.fontMono":"等宽字体","settings.theme.fontFollow":"跟随主题","settings.theme.fontSystem":"系统默认","settings.theme.fontHint":"预设字体随应用内置,不依赖本机是否装过,每台设备观感一致。选「跟随主题」则用当前主题自带的字体栈。","settings.theme.fontPreset.inter":"Inter(现代无衬线)","settings.theme.fontPreset.notoSans":"思源黑体 Noto Sans","settings.theme.fontPreset.wenkai":"霞鹜文楷(阅读)","settings.theme.fontPreset.jetbrains":"JetBrains Mono","settings.theme.fontPreset.system":"系统默认","settings.theme.fontGroupBuiltin":"内置","settings.theme.fontGroupPlugin":"插件提供","settings.theme.customSeedLabel":"自定义强调色","settings.theme.customBgLabel":"自定义背景色","settings.theme.customBgFollow":"跟随主题色","settings.theme.customBgClear":"恢复跟随","settings.theme.customBgHint":"不设置时背景由主题色微染;设置后将所选色作为独立氛围种子,并自动调至当前明暗模式的可读范围。","settings.theme.langLabel":"设计语言","settings.theme.openFolder":"打开主题文件夹","settings.theme.reload":"重载主题","settings.theme.dropHint":"把 theme.json + theme.css 放进 ~/.forsion/themes/<id>/ 即可装第三方主题,放好后点「重载主题」。","settings.theme.options":"{name} 选项","settings.theme.optionsReset":"重置","settings.theme.skinLabel":"配色","settings.theme.accentLabel":"主题色","settings.theme.bgLabel":"背景色","settings.theme.skin.cream":"经典","settings.theme.skin.coral":"珊瑚","settings.theme.skin.teal":"柔青","settings.theme.skin.lavender":"薰衣草","settings.theme.skin.zhi":"晴蓝","settings.theme.skin.custom":"自定义","settings.group.appearance":"外观","settings.group.account":"账户","settings.group.model":"模型","settings.group.agents":"Agent","settings.group.extensions":"扩展","settings.group.appearanceAbout":"外观·关于","settings.group.plugins":"插件","settings.group.advanced":"高级","settings.group.options":"选项","settings.group.workspace":"工作区","settings.group.ai":"AI","settings.group.system":"系统","settings.group.tools":"工具","settings.group.corePlugins":"核心插件","settings.group.communityPlugins":"社区插件","settings.tab.general":"常规","settings.page.generalDescription":"管理工作目录、运行环境与 Forsion 连接状态。","settings.page.spacesDescription":"选择启动位置,查看或移除已安装的 Space。","settings.page.notesDescription":"统一管理附件位置、笔记行为与删除安全选项。","settings.page.syncDescription":"把本地智库同步到远程存储(Dropbox、S3、WebDAV 等)。","settings.page.themeDescription":"预览并组合设计语言、配色、明暗、界面大小与字体。","settings.page.shortcutsDescription":"搜索命令并录制、解绑或恢复快捷键。","settings.page.notificationsDescription":"控制通知出口,以及每类事件与插件是否提醒。","settings.page.statusbarDescription":"选择底部状态项,并拖动调整显示顺序。","settings.page.modelDescription":"选择默认模型,管理提供商、联网搜索与语音能力。","settings.page.agentsDescription":"管理 Agent 名册、后台 Agent 与本机 Agent CLI。","settings.page.skillsDescription":"浏览技能库,导入其他工具中的技能与 MCP 配置。","settings.page.mcpDescription":"连接、启停并维护外部 MCP 工具服务器。","settings.page.hooksDescription":"管理 Agent 运行前后的自动化钩子。","settings.page.channelsDescription":"连接消息通道并集中查看其运行状态。","settings.page.browserDescription":"选择浏览器与搜索引擎,并调整访问安全边界。","settings.page.pluginsDescription":"管理核心能力与已安装插件,查看设置和更新。","settings.page.pluginDescription":"调整该插件提供的功能与运行选项。","settings.page.advancedDescription":"管理本机服务、界面行为、日志与数据安全。","settings.page.developerDescription":"用于调试界面、活动日志与内部功能的开发选项。","settings.page.aboutDescription":"查看版本、更新通道、语言与完整更新日志。","settings.overview.label":"当前状态","settings.overview.mode":"运行模式","settings.overview.backend":"后端服务","settings.overview.account":"Forsion 账号","settings.overview.signedIn":"已登录","settings.overview.signedOut":"未登录","settings.overview.readyTitle":"工作环境运行正常","settings.overview.readyDescription":"后端已连接,可以继续调整工作目录和本机运行选项。","settings.overview.attentionTitle":"工作环境尚未就绪","settings.overview.attentionDescription":"检查后端连接与运行方式,保存后会在这里显示最新状态。","settings.backend.modeDescription":"选择由 Forsion 管理本机服务,或连接你已经部署的后端。","settings.backend.modeManagedDescription":"开箱即用,由桌面端负责启动、检查和重启。","settings.backend.modeExternalDescription":"适合局域网、容器或远程部署的现有服务。","settings.workspace.summary":"新建本地会话时默认使用的位置。","settings.runtime.title":"本机运行环境","settings.runtime.description":"配置代码沙箱、Python 和下载网络,修改后重启后端生效。","settings.runtime.details":"了解 Python 与网络镜像的影响","settings.external.title":"外部后端连接","settings.external.description":"填写服务地址和访问凭证,先测试连接再保存。","settings.theme.previewLabel":"实时外观预览","settings.theme.previewChat":"对话","settings.theme.previewWorkspace":"Forsion","settings.theme.previewTitle":"让想法保持连贯","settings.theme.previewMessage":"当前的设计语言、配色、字体和质感会实时应用到这块预览。","settings.theme.previewInput":"问问 Forsion,或输入 / 使用能力","settings.theme.langDescription":"选择界面的结构、圆角、排版和整体气质。","settings.theme.skinDescription":"主题色与背景色分开选,布局不变;两边选同一个 = 原来的整套配色。","settings.theme.behaviorTitle":"显示与动效","settings.theme.behaviorDescription":"调整明暗、界面大小、层次质感和输入时的反馈。","settings.theme.flatLabel":"阴影","settings.theme.flatOff":"立体","settings.theme.flatOn":"扁平","settings.theme.flatDescription":"立体使用淡阴影,扁平隐藏装饰阴影。","settings.theme.glassDescription":"为支持的表面加入半透明模糊效果。","settings.theme.typographyTitle":"字体","settings.sub.connection":"连接","settings.sub.models":"模型","settings.sub.providers":"自定义提供方","settings.sub.webSearch":"联网搜索","settings.sub.voice":"语音","settings.sub.specialAgents":"后台 Agent","settings.sub.mcpServer":"对外 MCP","settings.sub.uiSession":"界面与会话","settings.sub.data":"数据","settings.sub.skillLibrary":"技能库","settings.group.about":"关于","settings.plugins.openSettings":"设置","onboarding.agents.stepLabel":"Agent","onboarding.agents.intro":"Agent 是有自己名字、人格与专属记忆的对话角色——默认 Agent 已就绪,你也可以养一群:工作助手、翻译、陪聊各司其职,聊天时随时切换。之后可在主界面的 Agents 完整管理(头像/模型/工具等)。","onboarding.agents.rosterLabel":"当前名册","onboarding.agents.rosterEmpty":"名册为空(默认 Agent 将在首次对话时就绪)。","onboarding.agents.systemBadge":"后台","onboarding.agents.createLabel":"快速新建(可选)","onboarding.agents.namePlaceholder":"名字,如 秦车","onboarding.agents.personaPlaceholder":"一句话人格与口吻,如 严谨的中文技术编辑,惜字如金","onboarding.agents.createBtn":"创建","onboarding.agents.createHint":"只需名字即可创建;人格描述会成为它的初始设定,之后随时可改。","onboarding.agents.created":"已创建「{name}」,聊天时可在输入框上方切换。","onboarding.agents.createFail":"创建失败:{e}","onboarding.agents.historianTitle":"后台 Agent:Historian(史官)","onboarding.agents.historianDesc":"开启后每隔几轮自动为会话起标题、整理日志与长期记忆——独立模式全自动托管;辅助模式则作为档案助手进入后台子讨论,与你的 Agent 商量后再写。","onboarding.agents.historianSaveFail":"Historian 设置保存失败:{e}","onboarding.agents.moreHint":"触发轮次、提示词与另一位后台 Agent Muse,在 设置 → 后台 Agent 里配置。","onboarding.workspace.stepLabel":"选择默认本地文件夹","onboarding.workspace.hint":"Agent 新建本机会话时的默认工作目录;留空则用智库内的 Sessions 文件夹(无智库时 ~/Forsion)。","onboarding.workspace.placeholder":"~/Forsion(默认)","onboarding.workspace.pick":"浏览文件夹","onboarding.workspace.clear":"清除","settings.advanced.agentDesk":"Agent Desk 演出面板","settings.advanced.agentDeskHint":"聊天右侧的 Agent 演出区,默认开启。Agent 编辑文件时自动在旁边展示正在改的文件;Agent 也可主动把文件、笔记、导图摆上面板给你看,并截图核对自己做的效果。可拖宽度,可收成卡片。","settings.advanced.agentDeskEnable":"启用 Agent Desk","settings.advanced.summaryOpenIn":"任务概览里点文件时","settings.advanced.summaryOpenInHint":"右侧「任务概览」卡片里的来源/产物,点一下开在哪。","settings.advanced.summaryOpenIn.tab":"在新标签页打开","settings.advanced.summaryOpenIn.desk":"在 Agent Desk 展开","desk.title":"Agent Desk","desk.close":"关闭面板","tool.verb.presented":"展示了","tool.verb.sketched":"画了","sketch.mobileUnavailable":"此卡片在移动端 App 暂不可用(请在桌面或网页端查看)。","sketch.expand":"展开卡片","sketch.collapse":"收起卡片","settings.advanced.exportLogs":"导出会话日志","settings.advanced.exportLogsHint":"将当前会话的全部对话内容、界面实际状态与动作轨迹、渲染端错误、后端运行日志打包成一个 JSON 文件,便于开发者排查问题。","settings.advanced.exportBtn":"导出为 JSON","settings.advanced.exportNoSession":"当前没有打开的会话,请先选择一个会话再导出。","settings.advanced.exportOk":"已导出到 {path}","settings.advanced.exportCanceled":"已取消导出","settings.advanced.exportFailed":"导出失败:{err}","settings.clearData.label":"清空数据 / 卸载","settings.clearData.hint":"删除本机上的 Forsion 数据。此操作不可恢复,完成后应用会重启为全新状态。","settings.clearData.tangu":"Tangu 数据与项目目录(账号、设置、Agent、会话、~/Forsion)","settings.clearData.desktop":"桌面设置(窗口与 Amadeus 壳层配置)","settings.clearData.btn":"清空并重启","settings.clearData.confirm":"确定要清空所选数据吗?此操作不可恢复,应用将重启。","settings.clearData.macNote":"这只清除数据;要彻底卸载 Forsion,请把「应用程序」里的 Forsion 拖入废纸篓。","view.changelog":"更新","changelog.newVersion":"发现新版本 {version}","changelog.newest":"最新","changelog.zhOnly":"这一版的更新说明只有中文。","settings.developer.testUpdateLabel":"更新弹窗测试","settings.developer.testUpdate":"打开更新页(测试)","settings.developer.testUpdateHint":"强制弹出更新标签页,用于验证版本更新弹窗渲染是否生效(不依赖真的有新版本)。","input.slash.loop":"最大循环轮数:/loop <轮数>(当前 {current},范围 1-200)","input.slash.loopSet":"最大循环轮数已设为 {n} 轮","input.ctxLabel":"上下文","input.sessionTokens":"本会话 {n} tokens","input.runCost":"本 run 成本 {used}/{limit} 点","cost.nearCap":"⚠ 本 run 成本已达 {used} 点(上限 {limit},TANGU_MAX_RUN_COST 可调),越过上限将自动停止","ctx.compacted.auto":"上下文已自动压缩(节省约 {saved} 字符)","ctx.compacted.forced":"上下文到达自动压缩阈值,已生成摘要压缩","ctx.compacted.overflow":"上下文超出模型上限,已生成摘要压缩并重试本轮","ctx.windowSource.override":"窗口值:手动覆盖表","ctx.windowSource.model":"窗口值:模型自报","ctx.windowSource.family":"窗口值:按模型族推断(非模型自报)","ctx.windowSource.learned":"窗口值:从上游超长报错回学到的真实上限","ctx.windowSource.default":"窗口值:272k 默认兜底(未知模型,可在设置 → 模型里手填)","ctx.windowCapped":"模型最大 {max},默认只用到 {n}","ctx.sec.persona":"人格/指令","ctx.sec.harness":"自进化笔记","ctx.sec.guidance":"基础指引/契约","ctx.sec.profile":"用户画像","ctx.sec.project":"项目指令","ctx.sec.agentFolder":"专属文件夹/资料","ctx.sec.memory":"长期记忆","ctx.sec.skills":"技能目录","ctx.sec.environment":"环境/工具目录","ctx.sec.hooks":"Hooks 注入","ctx.sec.plan":"计划模式","ctx.sec.history":"历史消息({n} 条)","ctx.files.label":"本局装载的指令文件","ctx.files.truncated":"⚠ 超 32KB 已截断","ctx.files.none":"无(本项目没有 AGENTS.md / CLAUDE.md)","approval.why.customAsk":"按你的审批规则「{rule}」,这一步必须问你","approval.why.escalate":"要写工作区以外的文件 —— 这一档下每次都要你确认(「总允许」对它无效)","approval.why.protected":"要改凭据或 Forsion 本机配置 —— 每次都要你确认(完全通行和「总允许」都不跳过)","approval.why.mode":"当前审批档「{mode}」下,这类操作需要你批准","approval.why.control":"这会设置或修改之后可在你不在场时运行的工作,需要你逐次确认(「总允许」对它无效)","inbox.approval.withdrawnSystem":"系统已撤回这条请求(它存下的内容无法完整显示,或已被同一动作的新请求取代),不能在这里批准。需要的话让 Agent 重新发起。","approval.cmdOverflow":"命令太长,框里没显示完,请滚动看完再批准。","approval.cmdWideBlank":"命令里有一大段空白,可能把后面的内容推出视线;下面是标出空白后的完整内容。","approval.previewScrollHint":"内容较长,请滚动看完再批准。","approval.cmdHiddenChars":"命令里有不可见或会改变显示顺序的字符,看到的文字可能与实际执行的不同。","input.approval.editRules":"编辑规则…","input.approval.editRulesDesc":"按工具名/参数前缀写放行、每次问、拒绝三张名单","approvalRules.loadFailed":"读不到现有规则,先不显示表单 —— 空着保存会把已有的名单整片清掉。","approvalRules.title":"自定义审批规则","approvalRules.scopeNote":"⚠ 规则是全局的 —— 存在 ~/.forsion/config.json,所有会话共用;审批档才是按会话选的。保存后下一次工具调用即生效,不用重启。","approvalRules.syntax":"写法:工具名,或 工具名* 前缀通配,可再跟:参数前缀(跑命令比命令、写文件比路径)。例:web_fetch | mcp__* | run_bash:npm test | write_file:/etc/","approvalRules.base":"兜底档","approvalRules.baseHint":"一条规则都没命中时按这一档判(优先级:拒绝 > 每次问 > 放行 > 兜底档)","approvalRules.deny":"拒绝","approvalRules.denyHint":"直接拒掉,不问你。模型会看到是哪条规则挡的。","approvalRules.denyPh":`write_file:/etc/
289
+ `);let i=null;for(let s=0;s<n.length;s++){const r=ns.exec(n[s]);if(r&&(!i||r[1][0]===i)){i=i?null:r[1][0];continue}if(i)continue;const o=/^(#{1,6})\s+(.*?)\s*#*\s*$/.exec(n[s]);if(!o||o[2].trim().toLowerCase()!==t)continue;const a=o[1].length,l=[n[s]];let c=null;for(let d=s+1;d<n.length;d++){const u=ns.exec(n[d]);if(u&&(!c||u[1][0]===c)){c=c?null:u[1][0],l.push(n[d]);continue}if(!c){const h=/^(#{1,6})\s/.exec(n[d]);if(h&&h[1].length<=a)break}l.push(n[d])}return l.join(`
290
+ `).trimEnd()}return null}function rd(e,t){const n=Gr(e);for(const i of gl(n))if(i.id&&i.id.toLowerCase()===t)return F0(e)?i.content:D0(i.content);return z0(n,t)}function M0(e){const t=e.fetch??((...f)=>fetch(...f)),n=`${e.apiBase}/amadeus/public/shares/${encodeURIComponent(e.token)}`,i=f=>()=>Promise.reject(new R0(f)),s=()=>()=>{},r=()=>e.tree().pages,o=new Map,a=f=>{let m=o.get(f);return m||(m=(async()=>{const p=await t(`${n}/file?path=${encodeURIComponent(f)}`);if(p.status===404)return null;if(!p.ok)throw new Error(`share file ${p.status}`);const y=await p.json();return typeof y.content=="string"?y.content:""})(),o.set(f,m),m.catch(()=>o.delete(f))),m},l=(f,m)=>{const p=new URLSearchParams({ref:f});return m&&p.set("page",m),`${n}/asset?${p.toString()}`},c=async(f,m)=>{const p=await t(l(f,m));if(p.status===404)return null;if(!p.ok)throw new Error(`share asset ${p.status}`);return p},d=async f=>{const m=await a(f);if(m==null)throw new Error(`not found: ${f}`);return Ri(f,m,N0())},u=()=>({root:`share:${e.token}`,pages:r(),folders:e.tree().folders});return{openVault:async()=>u(),restoreVault:async()=>u(),listPages:async()=>r(),listFiles:async()=>[],listFolders:async()=>e.tree().folders,loadPage:d,readPage:d,reconcilePage:f=>d(f),newPage:i("newPage"),savePage:i("savePage"),renamePage:i("renamePage"),saveAsset:i("saveAsset"),saveVaultBytes:i("saveVaultBytes"),readVaultBytes:async f=>{const m=await c(f,e.currentPage());if(!m)throw new Error(`not found: ${f}`);return new Uint8Array(await m.arrayBuffer())},saveAttachment:i("saveAttachment"),openAttachment:async(f,m)=>{window.open(l(m,f),"_blank","noopener")},openVaultFile:async f=>{window.open(l(f,null),"_blank","noopener")},exportPdf:async()=>(window.print(),null),onExternalChange:s,onStructureChange:s,onDbExternalChange:s,search:async()=>[],backlinks:async()=>[],reindex:async()=>{},listTags:async()=>[],pagesByTag:async()=>[],deletePage:i("deletePage"),movePage:i("movePage"),resolveEmbed:async f=>{const{noteKey:m,id:p}=L0(f);if(!p)return null;const y=e.currentPage(),w=r(),C=m?w.filter(S=>fn(S)===m):[...y&&w.includes(y)?[y]:[],...w.filter(S=>S!==y)];for(const S of C){const I=await a(S);if(I==null)continue;const O=rd(I,p);if(O!==null)return{owner:S,content:O,type:"markdown"}}return null},blockBacklinks:async()=>[],createFolder:i("createFolder"),renameFolder:i("renameFolder"),deleteFolder:i("deleteFolder"),moveFolder:i("moveFolder"),listPlugins:async()=>[],openPluginsFolder:async()=>{},scaffoldSamplePlugin:async()=>{},revealInFileManager:async()=>{},readDatabase:async(f,m)=>{const p=await c(m,f);if(!p)return{status:"missing"};const y=Ga(f,m),w=iu(await p.text());return w.ok?{status:"ok",path:y,data:w.data}:{status:"corrupt",path:y,message:w.error}},writeDatabase:i("writeDatabase"),readDrawing:async(f,m)=>{for(const p of/\.md$/i.test(m)?[m]:[m,`${m}.md`]){const y=await c(p,f);if(y)return{status:"ok",path:Ga(f,p),source:await y.text()}}return{status:"missing"}},writeDrawing:i("writeDrawing"),readTextFile:f=>a(f),writeTextFile:i("writeTextFile"),listPageProps:async f=>{const m=f.replace(/\\/g,"/").replace(/^\/+|\/+$/g,""),p=r().filter(w=>sd(w)===m),y=[];for(const w of p){const C=await a(w);C!=null&&y.push({path:w,title:pl(w),fm:jc(C)})}return y},setPageFrontmatter:i("setPageFrontmatter"),renamePageFile:i("renamePageFile"),renameDbFile:i("renameDbFile")}}function Y_(e){const t=M0(e);return Qc(n=>{const i=new URLSearchParams({ref:n}),s=e.currentPage();return s&&i.set("page",s),`${e.apiBase}/amadeus/public/shares/${encodeURIComponent(e.token)}/asset?${i.toString()}`}),typeof window<"u"&&(window.amadeus=t),t}const j0=e=>{const t=e.search(/\\\||[#|]/);return t<0?{note:e,suffix:""}:{note:e.slice(0,t),suffix:e.slice(t)}},B0=e=>(e.split("/").pop()??e).replace(/\.md$/i,"");function U0(e,t,n,i){if(!e.includes("[["))return e;const s=i.pagesBefore,r=i.pagesAfter;return ri(e,o=>o.replace(/(!?)\[\[([^\]\n]+)\]\]/g,(a,l,c)=>{const{note:d,suffix:u}=j0(c),h=d.trim();if(!h)return a;const f=Li(h,s,t);if(!f)return a;const m=i.pairs.get(f)??f;if(Li(h,r,n)===m)return a;const p=B0(m),w=!/[\\/]/.test(h)&&Li(p,r,n)===m?p:m.replace(/\.md$/i,"");return`${l}[[${w}${u}]]`}))}async function H0(e,t,n,i={}){const s={rewritten:[],failed:[]},r=new Map(Object.entries(t).filter(([m,p])=>m!==p));if(!r.size)return s;const o=new Map([...r].map(([m,p])=>[p,m])),a=[...n].sort(),l=a.map(m=>r.get(m)??m).sort(),c={pairs:r,pagesBefore:a,pagesAfter:l},d=Math.max(1,i.attempts??3),u=async m=>{try{let p=await e.read(m);if(p==null){s.failed.push({path:m,error:"gone"});return}for(let y=0;y<d;y++){const w=U0(p,o.get(m)??m,m,c);if(w===p)return;const C=await e.write(m,w,Wn(p));if(C==="gone"){s.failed.push({path:m,error:"gone"});return}if(!C||C.ok){s.rewritten.push(m);return}if(C.current==null){s.failed.push({path:m,error:"gone"});return}p=C.current}s.failed.push({path:m,error:"conflict"})}catch(p){s.failed.push({path:m,error:p instanceof Error?p.message:String(p)})}},h=[...l],f=Array.from({length:Math.max(1,Math.min(i.concurrency??6,h.length))},async()=>{for(let m=h.shift();m!==void 0;m=h.shift())await u(m)});return await Promise.all(f),s.rewritten.sort(),s}const q0=["renamePage","renamePageFile","movePage","renameFolder","moveFolder","deletePage","deleteFolder","trashEntry","restoreTrash"];function W0(e){const t=e;let n=Promise.resolve();for(const i of q0){const s=t[i];typeof s=="function"&&(t[i]=(...r)=>{const o=n.then(()=>s(...r));return n=o.catch(()=>{}),o})}return e}var Ys={exports:{}},jn={};var Ja;function V0(){if(Ja)return jn;Ja=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,s,r){var o=null;if(r!==void 0&&(o=""+r),s.key!==void 0&&(o=""+s.key),"key"in s){r={};for(var a in s)a!=="key"&&(r[a]=s[a])}else r=s;return s=r.ref,{$$typeof:e,type:i,key:o,ref:s!==void 0?s:null,props:r}}return jn.Fragment=t,jn.jsx=n,jn.jsxs=n,jn}var Qa;function Z0(){return Qa||(Qa=1,Ys.exports=V0()),Ys.exports}var ks=Z0();const K0=os(ks),J_=Sd({__proto__:null,default:K0},[ks]);var Js={exports:{}},ee={};var Xa;function G0(){if(Xa)return ee;Xa=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),r=Symbol.for("react.consumer"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),u=Symbol.for("react.activity"),h=Symbol.iterator;function f(A){return A===null||typeof A!="object"?null:(A=h&&A[h]||A["@@iterator"],typeof A=="function"?A:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,y={};function w(A,T,g){this.props=A,this.context=T,this.refs=y,this.updater=g||m}w.prototype.isReactComponent={},w.prototype.setState=function(A,T){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,T,"setState")},w.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function C(){}C.prototype=w.prototype;function S(A,T,g){this.props=A,this.context=T,this.refs=y,this.updater=g||m}var I=S.prototype=new C;I.constructor=S,p(I,w.prototype),I.isPureReactComponent=!0;var O=Array.isArray;function k(){}var E={H:null,A:null,T:null,S:null},$=Object.prototype.hasOwnProperty;function W(A,T,g){var z=g.ref;return{$$typeof:e,type:A,key:T,ref:z!==void 0?z:null,props:g}}function R(A,T){return W(A.type,T,A.props)}function H(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function B(A){var T={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(g){return T[g]})}var te=/\/+/g;function ce(A,T){return typeof A=="object"&&A!==null&&A.key!=null?B(""+A.key):T.toString(36)}function ne(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(k,k):(A.status="pending",A.then(function(T){A.status==="pending"&&(A.status="fulfilled",A.value=T)},function(T){A.status==="pending"&&(A.status="rejected",A.reason=T)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function he(A,T,g,z,q){var M=typeof A;(M==="undefined"||M==="boolean")&&(A=null);var Y=!1;if(A===null)Y=!0;else switch(M){case"bigint":case"string":case"number":Y=!0;break;case"object":switch(A.$$typeof){case e:case t:Y=!0;break;case d:return Y=A._init,he(Y(A._payload),T,g,z,q)}}if(Y)return q=q(A),Y=z===""?"."+ce(A,0):z,O(q)?(g="",Y!=null&&(g=Y.replace(te,"$&/")+"/"),he(q,T,g,"",function(ye){return ye})):q!=null&&(H(q)&&(q=R(q,g+(q.key==null||A&&A.key===q.key?"":(""+q.key).replace(te,"$&/")+"/")+Y)),T.push(q)),1;Y=0;var ue=z===""?".":z+":";if(O(A))for(var de=0;de<A.length;de++)z=A[de],M=ue+ce(z,de),Y+=he(z,T,g,M,q);else if(de=f(A),typeof de=="function")for(A=de.call(A),de=0;!(z=A.next()).done;)z=z.value,M=ue+ce(z,de++),Y+=he(z,T,g,M,q);else if(M==="object"){if(typeof A.then=="function")return he(ne(A),T,g,z,q);throw T=String(A),Error("Objects are not valid as a React child (found: "+(T==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":T)+"). If you meant to render a collection of children, use an array instead.")}return Y}function me(A,T,g){if(A==null)return A;var z=[],q=0;return he(A,z,"","",function(M){return T.call(g,M,q++)}),z}function we(A){if(A._status===-1){var T=A._result;T=T(),T.then(function(g){(A._status===0||A._status===-1)&&(A._status=1,A._result=g)},function(g){(A._status===0||A._status===-1)&&(A._status=2,A._result=g)}),A._status===-1&&(A._status=0,A._result=T)}if(A._status===1)return A._result.default;throw A._result}var ae=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var T=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(T))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},x={map:me,forEach:function(A,T,g){me(A,function(){T.apply(this,arguments)},g)},count:function(A){var T=0;return me(A,function(){T++}),T},toArray:function(A){return me(A,function(T){return T})||[]},only:function(A){if(!H(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return ee.Activity=u,ee.Children=x,ee.Component=w,ee.Fragment=n,ee.Profiler=s,ee.PureComponent=S,ee.StrictMode=i,ee.Suspense=l,ee.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=E,ee.__COMPILER_RUNTIME={__proto__:null,c:function(A){return E.H.useMemoCache(A)}},ee.cache=function(A){return function(){return A.apply(null,arguments)}},ee.cacheSignal=function(){return null},ee.cloneElement=function(A,T,g){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var z=p({},A.props),q=A.key;if(T!=null)for(M in T.key!==void 0&&(q=""+T.key),T)!$.call(T,M)||M==="key"||M==="__self"||M==="__source"||M==="ref"&&T.ref===void 0||(z[M]=T[M]);var M=arguments.length-2;if(M===1)z.children=g;else if(1<M){for(var Y=Array(M),ue=0;ue<M;ue++)Y[ue]=arguments[ue+2];z.children=Y}return W(A.type,q,z)},ee.createContext=function(A){return A={$$typeof:o,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:r,_context:A},A},ee.createElement=function(A,T,g){var z,q={},M=null;if(T!=null)for(z in T.key!==void 0&&(M=""+T.key),T)$.call(T,z)&&z!=="key"&&z!=="__self"&&z!=="__source"&&(q[z]=T[z]);var Y=arguments.length-2;if(Y===1)q.children=g;else if(1<Y){for(var ue=Array(Y),de=0;de<Y;de++)ue[de]=arguments[de+2];q.children=ue}if(A&&A.defaultProps)for(z in Y=A.defaultProps,Y)q[z]===void 0&&(q[z]=Y[z]);return W(A,M,q)},ee.createRef=function(){return{current:null}},ee.forwardRef=function(A){return{$$typeof:a,render:A}},ee.isValidElement=H,ee.lazy=function(A){return{$$typeof:d,_payload:{_status:-1,_result:A},_init:we}},ee.memo=function(A,T){return{$$typeof:c,type:A,compare:T===void 0?null:T}},ee.startTransition=function(A){var T=E.T,g={};E.T=g;try{var z=A(),q=E.S;q!==null&&q(g,z),typeof z=="object"&&z!==null&&typeof z.then=="function"&&z.then(k,ae)}catch(M){ae(M)}finally{T!==null&&g.types!==null&&(T.types=g.types),E.T=T}},ee.unstable_useCacheRefresh=function(){return E.H.useCacheRefresh()},ee.use=function(A){return E.H.use(A)},ee.useActionState=function(A,T,g){return E.H.useActionState(A,T,g)},ee.useCallback=function(A,T){return E.H.useCallback(A,T)},ee.useContext=function(A){return E.H.useContext(A)},ee.useDebugValue=function(){},ee.useDeferredValue=function(A,T){return E.H.useDeferredValue(A,T)},ee.useEffect=function(A,T){return E.H.useEffect(A,T)},ee.useEffectEvent=function(A){return E.H.useEffectEvent(A)},ee.useId=function(){return E.H.useId()},ee.useImperativeHandle=function(A,T,g){return E.H.useImperativeHandle(A,T,g)},ee.useInsertionEffect=function(A,T){return E.H.useInsertionEffect(A,T)},ee.useLayoutEffect=function(A,T){return E.H.useLayoutEffect(A,T)},ee.useMemo=function(A,T){return E.H.useMemo(A,T)},ee.useOptimistic=function(A,T){return E.H.useOptimistic(A,T)},ee.useReducer=function(A,T,g){return E.H.useReducer(A,T,g)},ee.useRef=function(A){return E.H.useRef(A)},ee.useState=function(A){return E.H.useState(A)},ee.useSyncExternalStore=function(A,T,g){return E.H.useSyncExternalStore(A,T,g)},ee.useTransition=function(){return E.H.useTransition()},ee.version="19.2.7",ee}var el;function Y0(){return el||(el=1,Js.exports=G0()),Js.exports}var nt=Y0();const Q_=os(nt),X_=["off","minimal","low","medium","high","xhigh","max"];function eC(e){return!e.location||e.location.kind==="home"}const tC="xyra",nC="forsion_tangu_show_system_prompt",J0="forsion_tangu_smooth_caret",Q0="forsion_ui_zoom",ci="tangu_locale",X0="forsion_tangu_font_ui",e1="forsion_tangu_font_body",t1="forsion_tangu_font_mono",iC=e=>/^avatar\.(png|jpe?g|gif|webp)$/i.test(e||""),sC=e=>!!(e?.soloAgentSlug||e?.soloEngineId||e?.teamSlug),n1="__cloud__",i1="__rootless__",rC="__default_ws__",s1="Tangu",r1=e=>`${n1}:${e||s1}`,oC=(e,t)=>{const n=e.projectless?i1:e.project_path||r1(e.project_name);return t?.find(i=>i.key===n||i.sessionKeys?.includes(n))?.key??n},aC=e=>/^icon\.(png|jpe?g|gif|webp)$/i.test(e||""),o1=[X0,e1,t1,J0,Q0,ci],a1=/^theme\.[A-Za-z0-9._-]{1,64}\.--[a-z0-9-]{1,64}$/i;let vr=!1;function lC(e){vr=!0;try{e()}finally{vr=!1}}const tl=e=>{try{return localStorage.getItem(e)}catch{return null}};function l1(){const e={};for(const t of o1)e[t]=tl(t);try{const t=document.documentElement.dataset.theme||"";for(let n=0;n<localStorage.length;n++){const i=localStorage.key(n);i&&a1.test(i)&&i.startsWith(`theme.${t}.`)&&(e[i]=tl(i))}}catch{}return e}function c1(){if(!vr)try{window.tangu?.broadcastUi?.({prefs:l1()})}catch{}}function u1(e){const t=typeof e?.cloudApiBase=="string"?e.cloudApiBase.trim():"";if(t)return t.replace(/\/+$/,"");const n=typeof e?.cloudUrl=="string"?e.cloudUrl.trim().replace(/\/+$/,""):"";return n?`${n}/api`:""}const Sr="forsion_region";function od(){try{const e=navigator.languages?.length?navigator.languages:[navigator.language];for(const t of e){const n=String(t||"").toLowerCase();if(n)return n.startsWith("zh")?"zh":"en"}}catch{}return null}function ad(){try{const t=localStorage.getItem(ci);if(t==="en"||t==="zh")return t}catch{}const e=od();if(e==="zh")return"zh";try{const t=localStorage.getItem(Sr);if(t)return t==="CN"?"zh":"en"}catch{}return e??"zh"}async function d1(){if(od()==="zh")return;try{if(localStorage.getItem(ci)||localStorage.getItem(Sr))return}catch{return}let e="";try{e=u1(await window.tangu?.getConfig?.())}catch{}if(!e)return;const t=`${e}/auth/region`;try{const n=new AbortController,i=setTimeout(()=>n.abort(),3e3),s=await fetch(t,{signal:n.signal}).finally(()=>clearTimeout(i));if(!s.ok)return;const r=(await s.json())?.country;if(!r)return;try{localStorage.setItem(Sr,r)}catch{}const o=r==="CN"?"zh":"en";o!==_r()&&fd(o)}catch{}}const bo={"common.save":"保存","chat.wait.sending":"正在发送上下文 {kb} KB","chat.wait.firstToken":"等待模型首帧","chat.wait.elapsed":"已等待 {s} 秒","settings.python.label":"Python","settings.python.bundled":"内置(推荐)","settings.python.system":"系统","settings.python.hint":"内置:免安装、与你自己的 Python 隔离;系统:用你已装的 python(改动后重启后端生效)。","settings.mirror.label":"网络镜像","settings.mirror.toggle":"使用中国大陆镜像源","settings.mirror.recommend":"检测到你的系统环境可能位于中国大陆,建议开启镜像源以加速下载。","settings.mirror.hint":"开启后,引导安装、pip 装包、Agent 运行的 npx/git 与商店下载走国内镜像(清华/npmmirror/多站 GitHub 代理)。仅对 Forsion 发起的命令注入环境变量,不修改任何系统配置文件,可随时关闭;pip/npm/git 部分需「内置后端」模式。","settings.mirror.test":"测试连通","settings.mirror.unreachable":"不可达","settings.test.canceled":"已取消","settings.test.timeout":"✗ 连接超时","onboarding.env.mirrorLabel":"网络环境","onboarding.env.pythonBundled":"Python 已内置,无需单独安装。","onboarding.env.recheck":"重新检测","onboarding.env.installOk":"{tool} 安装成功 · {version}","onboarding.env.installedButMissing":"命令已执行完成,但仍未检测到 {tool}。可能需要重启应用或新开终端后生效,也可点「重新检测」再试。","onboarding.env.installFail":"{tool} 安装失败(exit {code}),请查看下方日志。","onboarding.env.copyCmd":"复制命令","onboarding.env.copied":"⤷ 已复制到剪贴板,请打开「终端」粘贴执行(需要输入系统密码):{command}","sidebar.newChat":"新会话","sidebar.memory":"记忆","sidebar.agents":"后台 Agent","sidebar.viewMore":"查看更多","tip.folder":"{files} 个文件,{folders} 个文件夹","tip.sessions":"{count} 个会话","tip.modified":"修改:{t}","tip.created":"创建:{t}","input.fileref.session":"历史会话","input.project.label":"项目","input.project.none":"不在项目中","input.project.dontWork":"不在项目中工作","input.project.search":"搜索项目","input.project.noMatches":"没有匹配的项目","input.project.add":"添加本地项目","input.project.addCloud":"新建云端项目","input.project.cloudName":"项目名称,回车创建","app.amadeusWorkspace":"Amadeus · {name}","app.createProjectFail":"创建项目失败:{e}","ws.detail.count":"{n} 个会话","ws.detail.newChat":"在此项目中新建会话","ws.detail.empty":"该项目暂无会话","ws.detail.viewMore":"查看更多","agents.detail.title":"后台 Agent","agents.detail.settings":"设置","agents.detail.historian":"Historian 活动","agents.detail.noActivity":"暂无活动记录","settings.advanced.sessionLimit":"侧栏每个项目显示的会话数","settings.mcpServer.label":"对外 MCP 端点(给外部 Agent 用)","settings.mcpServer.hint":"开启后本机起一个本地 HTTP MCP 端点,外部 Agent(Claude Code / Codex / OpenCode 等)可通过它调用 Forsion Desktop 的能力(当前:发消息到收件箱)。仅监听 127.0.0.1,带令牌鉴权。","settings.mcpServer.enable":"开放给外部 Agent(Claude Code / Codex / OpenCode 等)","settings.mcpServer.connectHint":"选择你的 Agent,复制配置接入(令牌已内嵌):","settings.mcpServer.endpoint":"端点","settings.mcpServer.generic":"通用 JSON","settings.mcpServer.genericNote":"任意支持 Streamable HTTP MCP 的客户端(Cursor / Windsurf / Cline 等)用「通用」配置填 url + Authorization 头即可。","settings.mcpServer.copy":"复制","settings.mcpServer.notRunning":"端点未能启动,请查看日志或重启应用。","common.cancel":"取消","common.retry":"重试","chat.action.copy":"复制","chat.you":"你","workbench.noSession":"选择或新建一个会话以查看","workbench.sessions":"工作会话","space.home":"主页","space.tangu":"Tangu","space.amadeus":"笔记","space.calendar":"日历","view.todo":"待办清单","view.calendar":"日历","view.calendarConfig":"日历设置","view.db":"多维表","view.drawing":"白板","space.coding":"编码工作室","view.codeStudio":"编码工作室","space.artificial":"造物","view.artificial":"造物","view.product":"作品","space.public":"发布","view.publicHub":"发布管理","public.title":"发布管理","public.subtitle":"集中管理你已发布的网站与笔记","public.needLogin":"登录 Forsion 账号后查看已发布内容","public.refresh":"刷新","public.empty":"暂无内容","public.open":"打开","public.copy":"复制链接","public.copied":"已复制","public.unpublish":"下架","public.revoke":"撤销","public.confirm":"确认?","public.sites":"我的网站","public.sitesDesc":"Forsion Connect 托管的网页应用","public.published":"公开发布的笔记","public.publishedDesc":"任何人可只读访问的分享链接","public.shared":"协作共享的笔记","public.sharedDesc":"邀请他人编辑 / 查看的页面","public.disabled":"已停用","public.unavailable":"此功能在当前环境不可用","coding.code":"代码","coding.preview":"预览","coding.reload":"刷新预览","coding.noEntry":"暂无入口页面","coding.noFile":"未选择文件","coding.pickFile":"在右侧文件树点选一个文件来编辑","coding.emptyPreview":"还没有可预览的页面。让左侧的 Coding Agent 生成一个 index.html 吧。","coding.projects":"项目","coding.newProject":"新建项目","coding.publish":"发布","coding.publishTitle":"发布到 Forsion","coding.publishDesc":"把这个网页应用发布成公开链接。应用内可用 window.forsion 调用 Forsion AI —— 访客登录自己的 Forsion 账号、消耗自己的额度。","coding.publishName":"应用名称","coding.publishSlug":"链接标识","coding.publishSlugHint":"3-32 位小写字母 / 数字 / 中划线","coding.publishEntry":"入口页面","coding.publishSlots":"已发布 {used}/{limit} 个({tier})","coding.publishBtn":"发布","coding.publishUpdate":"更新发布","coding.publishing":"发布中…","coding.unpublish":"下架","coding.unpublishConfirm":"确认下架?","coding.publishNeedLogin":"发布需要登录 Forsion 账号","coding.loginNow":"登录 Forsion","coding.loginWaiting":"等待浏览器完成授权…","coding.copyLink":"复制链接","coding.copied":"已复制","coding.openLink":"打开","coding.publishHint":"资源请用相对路径引用;.ts/.tsx 发布时自动转译,无需构建。","coding.publishNoEntry":"项目里还没有 .html 入口,先让 AI 生成页面再发布。","coding.listingTitle":"商店","coding.listingHint":"上架后会在商店「网站应用」中公开展示,需要平台审核。","coding.listingNone":"未上架","coding.listingPending":"审核中","coding.listingApproved":"已上架","coding.listingRejected":"已驳回","coding.listingNoteLabel":"驳回原因:{note}","coding.listingApply":"申请上架","coding.listingReapply":"重新申请","coding.listingWithdraw":"撤回申请","coding.listingDelist":"下架","coding.listingSummaryPh":"一句话介绍这个应用(审核后展示在商店的卡片上,300 字内)","coding.listingSubmit":"提交申请","coding.termsTitle":"发布为公开页面","coding.termsIntro":"发布后,任何获得链接的人均可查看该页面,页面也可能被转发或被搜索引擎收录。请确认:","coding.termsLi1":"你有权发布页面中的文字、图片、音视频及其他内容;","coding.termsLi2":"页面不包含违法信息、侵权内容或未经许可披露的个人信息;","coding.termsLi3":"你将对自己发布的内容承担相应责任。","coding.termsManage":"平台将依据法律法规及《内容发布规范》对公开内容进行管理,并可能对违规内容采取限制访问、停止展示或删除等措施。","coding.termsAgreePre":"我已阅读并同意","coding.termsGuidelines":"《内容发布规范》","coding.termsConfirm":"确认发布","coding.cancel":"取消","coding.projectName":"项目名称","coding.create":"创建","coding.noProjects":"还没有项目。点「新建项目」创建第一个。","coding.switchProject":"切换项目","coding.generating":"生成中…","space.inbox":"收件箱","inbox.list":"消息列表","inbox.reader":"消息阅读","inbox.filter.unread":"未读","inbox.filter.archived":"已归档","inbox.source.forsion":"Forsion","inbox.source.automation":"自动化","inbox.source.agents":"Agent","inbox.reader.empty":"选择一封消息开始阅读","inbox.sender.system":"系统","inbox.sender.automation":"自动化","inbox.action.markRead":"标为已读","inbox.action.markUnread":"标为未读","inbox.action.readAll":"全部已读","inbox.action.archive":"归档","inbox.action.unarchive":"取消归档","inbox.action.delete":"删除","inbox.action.refresh":"拉取新消息","inbox.action.chat":"与 {name} 聊天","inbox.deleteConfirm":"删除消息「{title}」?","time.justNow":"刚刚","net.unavailable":"网络不可用,请稍后再试","inbox.pullOk":"已拉取 {n} 条新消息","inbox.pullNone":"没有新消息","inbox.opFail":"操作失败:{e}","inbox.attach.title":"附带物品","inbox.attach.claim":"领取","inbox.approval.title":"请求批准","inbox.approval.loading":"读取审批记录…","inbox.approval.missing":"找不到这条审批记录(可能已过期或已清理)","inbox.approval.approved":"已批准并执行","inbox.approval.rejected":"已拒绝","inbox.approval.executing":"执行中…","inbox.approval.failed":"已批准,但执行失败","inbox.approval.loadFail":"读取审批记录失败","inbox.approval.retry":"重试","inbox.approval.reason.customAsk":"你的审批规则要求","inbox.approval.reason.rule":"审批规则「{rule}」","inbox.approval.reason.escalate":"写工作区以外的文件","inbox.approval.reason.mode":"审批档要求批准","inbox.approval.reason.control":"设置无人值守工作","inbox.attach.claiming":"领取中…","inbox.attach.claimed":"已领取","inbox.attach.expired":"已过期,无法领取","inbox.claim.ok":"已领取,物品已入账","inbox.claim.already":"之前已领取过","inbox.claim.fail":"领取失败","inbox.claim.unmet":"未满足领取条件,暂时领不了","inbox.attach.unmet":"未满足领取条件","inbox.req.title":"领取条件","inbox.req.version":"客户端 {v} 及以上","inbox.req.tiers":"{tiers}","inbox.req.currentVersion":"当前版本 {v}","inbox.req.currentTier":"当前:{tier}","inbox.req.other":"另有条件(以领取时服务端校验为准)","inbox.feedback.title":"反馈线程","inbox.feedback.event.created":"新的用户反馈","inbox.feedback.event.user_reply":"用户回复了反馈","inbox.feedback.event.admin_reply":"你的反馈有了回复","inbox.feedback.loading":"读取反馈线程…","inbox.feedback.loadFail":"读不到反馈线程","inbox.feedback.signIn":"登录 Forsion 账号后可查看与回复","inbox.feedback.missing":"这条反馈已不存在","inbox.feedback.retry":"重试","inbox.feedback.you":"你","inbox.feedback.support":"Forsion 支持","inbox.feedback.user":"用户","inbox.feedback.replyPh":"回复…","inbox.feedback.attach":"添加附件","inbox.feedback.attachHint":"图片 / 文本 / JSON,单个 ≤5MB,最多 5 个","inbox.feedback.remove":"移除","inbox.feedback.send":"发送","inbox.feedback.sending":"发送中…","inbox.feedback.sendFail":"发送失败:{e}","inbox.feedback.tooMany":"最多 5 个附件","inbox.feedback.tooBig":"{name} 超过 5MB 或为空","inbox.feedback.badType":"{name} 类型不支持(只收图片 / 文本 / JSON)","inbox.feedback.download":"下载","inbox.feedback.status.open":"待处理","inbox.feedback.status.in_progress":"处理中","inbox.feedback.status.resolved":"已解决","inbox.feedback.status.closed":"已关闭","inbox.tier.free":"免费用户","inbox.tier.plus":"Plus 会员","inbox.tier.pro":"Pro 会员","inbox.expiresAt":"有效期至 {d}","inbox.expired":"已过期","settings.inbox.title":"收件箱","settings.inbox.notifyLabel":"新消息系统通知","settings.inbox.notifyHint":"收到新消息时弹系统通知(点击可直达收件箱);关闭后仅保留图标角标。","amadeus.pages":"智库","amadeus.editor":"编辑器","amadeus.outline":"大纲","amadeus.backlinks":"反链","amadeus.search":"搜索","amadeus.tags":"标签","amadeus.graph":"关系图","chat.action.copied":"已复制","chat.action.edit":"编辑","chat.action.resend":"发送","chat.action.regenerate":"重新生成","chat.action.branch":"从此处分支","chat.branchTitle":"{title}(分支)","chat.branchEmpty":"当前会话还没有可分支的 AI 回复","chat.branched":"已分支到新会话(继承历史)","input.slash.branch":"从最近一条回复分支新会话(继承历史)","app.branchFail":"分支失败:{e}","sidebar.ws.menu":"项目操作","sidebar.ws.rename":"重命名项目","sidebar.ws.remove":"移除项目","app.truncateFail":"截断消息失败:{e}","search.jumpOutOfWindow":"命中的消息在更早的历史里,已打开会话但没能定位到它","rewind.busy":"运行中无法回退,请先停止当前运行","rewind.noTime":"这条消息没有时间戳,定位不到回退点","rewind.codeDone":"代码已回退({n} 个文件)","rewind.codePartial":"{bad} 个文件回退失败,已中止(对话未改动)","rewind.codeSkipped":"代码已回退 {n} 个文件;另有 {bad} 个当时没存下快照,恢复不了","rewind.codeConflict":"代码已回退 {n} 个文件;{kept} 个在那之后另有改动,已原样保留(未删)","inquiry.sendFail":"回答没送达:{e},请重试","rewind.codeFail":"回退代码失败:{e}","app.resendFailed":"重发失败,已恢复本地显示;请重试。","app.regenNoUser":"找不到可重新生成的用户消息","app.wsRenameFail":"重命名项目失败:{e}","app.moveToProjectFail":"把对话挪进作品文件夹失败:{e}","app.moveToProjectHalf":"这条对话只挪了一半:项目已切到「{name}」,但工作目录没切过去({e})。","app.sessionMoving":"正在把这条对话挪进作品文件夹,稍等一下再发。","app.wsRemoveFail":"移除项目失败:{e}","app.wsRemoved":"已移除项目「{name}」","app.wsTrashFail":"会话已删除,但 .tangu 文件夹没能移到废纸篓:{e}","app.agentTrashFail":"Agent 已删除,但它的文件没能移到废纸篓,还在 {path}","app.sessionExpired":"登录已过期,请重新登录 Forsion 账号","onboarding.connect.cloudSync":"开启云同步(同步云端 Agents)","onboarding.connect.cloudSyncHint":"开启后,记忆、日志与标记为云同步的 Agents 会在登录设备间双向同步。稍后可在「设置 → Forsion 账号」更改。","common.confirm":"确定","extendView.close":"关闭扩展视图","extendView.failed":"扩展视图加载失败","extendView.back":"返回","common.close":"关闭","common.back":"返回","common.refresh":"刷新","common.loading":"加载中…","common.listSep":"、","common.delete":"删除","common.edit":"编辑","common.open":"打开","common.language":"语言","common.copyCode":"复制代码","common.enabled":"开启","common.disabled":"关闭","locale.zh":"中文","locale.en":"English","locale.toggleTitle":"切换语言","feedback.title":"反馈","achievements.title":"成就","achievements.unlocked":"成就达成","achievements.claim":"领取","achievements.claimed":"已领取","achievements.pts":"{n} 点","achievements.seriesPts":"{n}/{total} 点","achievements.pluginGroup":"插件","achievements.medal.bronze":"铜牌","achievements.medal.silver":"银牌","achievements.medal.gold":"金牌","achievements.s.starter":"初识","achievements.s.chat":"对话","achievements.s.notes":"笔记","achievements.s.agents":"Agent","achievements.a.first-login.title":"Forsion is All You Need","achievements.a.first-login.desc":"登录 Forsion 账号","achievements.a.theme-change.title":"焕然一新","achievements.a.theme-change.desc":"更换一次主题或配色","achievements.a.market-install.title":"超级武装","achievements.a.market-install.desc":"从商店安装一个项目","achievements.a.space-save.title":"Space 之力","achievements.a.space-save.desc":"把当前布局另存为 Space","achievements.a.first-message.title":"Hello Agent!","achievements.a.first-message.desc":"向 Agent 发出第一条消息","achievements.a.chat-10.title":"畅所欲言","achievements.a.chat-10.desc":"累计发出 10 条消息","achievements.a.chat-100.title":"滔滔不绝","achievements.a.chat-100.desc":"累计发出 100 条消息","achievements.a.group-chat.title":"圆桌会议","achievements.a.group-chat.desc":"发起一次团队协作","achievements.a.first-note.title":"妙笔生花","achievements.a.first-note.desc":"创建第一篇笔记","achievements.a.notes-10.title":"笔耕不辍","achievements.a.notes-10.desc":"累计创建 10 篇笔记","achievements.a.notes-100.title":"著作等身","achievements.a.notes-100.desc":"累计创建 100 篇笔记","achievements.a.first-base.title":"数据雏形","achievements.a.first-base.desc":"创建第一个 Base 多维表","achievements.a.first-agent.title":"造物主","achievements.a.first-agent.desc":"创建你的第一个 Agent","achievements.a.agents-3.title":"智囊团","achievements.a.agents-3.desc":"累计创建 3 个 Agent","achievements.a.special-agent.title":"幕后协作","achievements.a.special-agent.desc":"开启后台 Agent Muse 或 Historian","achievements.a.first-image.title":"妙笔生花","achievements.a.first-image.desc":"让 Agent 生成第一张图片","achievements.a.debug-toast.title":"这都被你发现了?","achievements.a.debug-toast.desc":"??????","settings.developer.achToastLabel":"成就弹窗","settings.developer.achToast":"触发成就弹窗","settings.developer.achToastHint":"调试成就达成动画,可重复触发;它本身也是一个隐藏成就(奖励只发一次)。","settings.developer.activityLabel":"活动日志","settings.developer.activityExport":"导出活动日志","settings.developer.activityEnable":"记录应用内活动","settings.developer.activityHint":"在本机记录你的操作(开会话/改笔记/建任务等),供后台 Agent Muse 理解你在做什么;仅存本地 activity 目录,保留 30 天。导出可用于排查问题。","settings.developer.activityViewCmd":"活动日志实时视图命令","settings.developer.activityViewCmdHint":"开启后命令面板(⌘K)多一条「打开活动日志」:在主区标签页实时查看活动记录(2 秒刷新,可过滤/暂停)。","command.openActivityLog":"打开活动日志","view.activityLog":"活动日志","activityView.filter":"过滤(子串匹配)…","activityView.pause":"暂停","activityView.resume":"继续","activityView.count":"{n} 行","activityView.empty":"还没有活动记录。请确认开发者选项里「记录应用内活动」处于开启,然后随便操作几下。","command.openActiveWindow":"前台窗口采样","view.activeWindow":"前台窗口采样","activeWindowView.on":"接缝已开启","activeWindowView.off":"接缝未开启","activeWindowView.offHint":"前台窗口采样默认关闭。到 设置 → 开发者选项 打开「前台窗口采样」后,这里会实时显示当前焦点所在的应用。","activeWindowView.noSample":"开着但探不到前台窗口。Linux 上 Wayland 会话拿不到(与 ActivityWatch 同样的天花板),X11 需要 xprop。","activeWindowView.noTitle":"(本平台不提供:macOS 的窗口标题属于「屏幕录制」权限)","activeWindowView.idleMark":"挂机","activeWindowView.clear":"清空","activeWindowView.segEmpty":"正在采样。切到别的应用待一会儿再回来,下面会出现折好的焦点段(挂机段会变灰)。","space.automation":"自动化","view.automationList":"自动化列表","view.automationDetail":"自动化详情","view.automationRuns":"触发记录","automation.group.system":"系统自动化","automation.group.watches":"盯任务规则","automation.group.buttons":"按钮","automation.group.schedules":"Agent 日程","automation.group.finished":"已结束 ({n})","automation.finished":"已结束","automation.finishedHint":"一次性,时刻已过——编辑可改期重开","automation.fact.status":"状态:","automation.schedule.every":"每 {ivl}","automation.schedule.once":"一次性","automation.fact.desc":"描述:","automation.sched.name":"名称","automation.sched.date":"日期","automation.sched.dateHint":"YYYY-MM-DD 或 YYYY-MM-DDTHH:mm,可带 /结束时刻","automation.sched.repeat":"重复","automation.sched.repeatHint":"留空=一次性;如 24h / 7d,从锚点滚动","automation.builder.expiredReset":"原时刻已过,已重置为下一整点——保存即改期重开。","automation.builder.atPast":"一次性时刻已过,请重新设定时间。","automation.muse.title":"Muse 巡检","automation.muse.trigger":"每 {min} 分钟巡检","automation.muse.action":"思考可为用户做什么 → 产出 TODO","automation.historian.title":"Historian 记忆维护","automation.historian.trigger":"每 {n} 轮对话后","automation.historian.action":"总结会话、维护日志与记忆","automation.watches.empty":"还没有盯任务规则——点下方新建,或在聊天里说「帮我盯着…」。","automation.enabled":"已启用(点击停用)","automation.disabled":"已停用(点击启用)","automation.new":"新建自动化","automation.cond.daily":"每天 {time}","automation.cond.event":"活动含「{match}」","automation.cond.file":"{path} 满 {n} 字","automation.cond.at":"一次 · {time}","automation.cond.every":"每 {ivl}","automation.cond.manual":"手动 · 按钮","automation.cond.dbRow":"{path} 新增行","automation.cond.dbCell":"{path} 单元格变化","automation.cond.dbWhereN":"条件 ×{n}","automation.nextRun":"下次 {time}","automation.detail.empty":"在左侧选择一个自动化","automation.detail.latest":"最近运行","automation.detail.recent":"近期活动","automation.deepConfig":"深度配置","automation.fact.trigger":"触发:","automation.fact.action":"动作:","automation.fact.actions":"动作链:","automation.fact.runner":"执行:","automation.fact.prompt":"指令:","automation.fact.cooldown":"冷却:","automation.fact.where":"条件:","automation.fact.columns":"监听列:","automation.fact.noCooldown":"无(0h)","automation.fact.disabledReason":"已被引擎自动停用:{reason}","automation.fact.lastRun":"上次运行:","automation.fact.nextRun":"下次触发:","automation.fire.btn":"试跑","automation.fire.hint":"立即执行一次动作链(不影响正常触发节奏)","automation.fire.ok":"试跑完成({status})","automation.fire.fail":"试跑失败({status})","automation.exec.manual":"试跑","automation.exec.steps":"{n} 步完成","automation.step.notify":"通知","automation.step.agent_run":"跑 Agent","automation.step.db_row_add":"表格加行","automation.step.db_row_edit":"表格改行","automation.step.tool_call":"调工具","automation.transcript.empty":"还没有运行内容","automation.transcript.trigger":"触发输入","automation.transcript.agent":"Agent","automation.transcript.tools":"工具调用 {n} 次","automation.trigger.neverFired":"还没触发过——命中后这里会出现该次运行","automation.trigger.museNote":"该规则命中会唤醒 Muse,运行内容见","automation.runs.empty":"暂无记录","automation.runs.pick":"选中一条自动化后,这里显示它的运行记录","automation.builder.title":"新建自动化","automation.builder.editTitle":"编辑自动化","automation.builder.trigger":"触发","automation.builder.desc":"名称","automation.builder.descPh":"一句话描述这个自动化","automation.builder.condType":"触发方式","automation.builder.condTimer":"定时","automation.builder.condEvent":"事件","automation.builder.condFile":"文件达标","automation.builder.condManual":"手动(按钮)","automation.builder.condDb":"多维表","automation.builder.manualHint":"不会自动触发。在笔记里插入「按钮」块并选中这条规则,由你点击执行。","automation.builder.unsupported":"这条规则含有当前构建器还不认识的动作类型。用聊天里的 manage_automation 修改(在这里保存会把那部分抹掉,所以不给编辑)。","automation.builder.dbPath":"哪张多维表(.db)","automation.builder.dbPickDb":"选择多维表…","automation.builder.dbEvent":"监听事件","automation.builder.dbEventRow":"新增行","automation.builder.dbEventCell":"单元格变化","automation.builder.dbColumn":"监听列(可多选)","automation.builder.dbColumnsHint":"勾选多列时任一列变化即触发;「新值等于」按变化的那一列比。","automation.builder.dbPickCol":"选择列…","automation.builder.dbColsLoading":"表读取中…","automation.builder.dbEquals":"且新值等于(可选)","automation.builder.dbEqualsPh":"留空 = 任意变化都触发","automation.builder.dbHint":"表内容变化后由引擎按游标比对触发;规则钉在建立时的智库,切换智库不误伤同名表。","automation.builder.dbRowId":"行 id","automation.builder.dbRowIdPh":"留空 = 触发命中的那一行","automation.builder.dbRowIdRequired":"必填(当前触发方式没有「触发行」可缺省)","automation.builder.dbCells":"写入字段","automation.builder.dbCellKey":"列名或列 id","automation.builder.dbCellVal":"值(可用 {{row.列名}} 模板)","automation.builder.dbCellAdd":"添加字段","automation.builder.dbCellsHint":"多维表触发时,值里的 {{row.列名}} 会替换成触发行对应单元格。","automation.builder.dbCellValPh":"{{= {target.数量} - {row.出库数量} }}","automation.builder.dbWhere":"附加条件(可选)","automation.builder.dbWhereAdd":"添加条件","automation.builder.dbWhereOpEq":"等于","automation.builder.dbWhereOpNe":"不等于","automation.builder.dbWhereOpEmpty":"为空","automation.builder.dbWhereOpNotEmpty":"不为空","automation.builder.dbWhereValPh":"值","automation.builder.dbWhereHint":"与上面的条件 AND;比对触发行物化后的值,公式/引用列也可比;最多 10 条。","automation.builder.dbRowFrom":"沿关联列取目标行(可选)","automation.builder.dbRowFromPh":"触发表里的关联列名或列 id;留空 = 用上面的行 id","automation.builder.dbMatch":"按列值匹配多行(可选)","automation.builder.dbMatchValPh":"值,可用 {{row.id}} 模板","automation.builder.dbTargetHint":"目标行优先级:行 id > 关联列 > 列值匹配 > 触发命中的那一行。","automation.builder.dbSkipIfEmpty":"此字段为空则跳过(可选)","automation.builder.dbSkipIfEmptyPh":"填一个上面的列名/列 id","automation.builder.cooldownDbHint":"多维表触发的纯动作链可设 0 = 不冷却(链式规则需要)","automation.builder.dbNoteView":"选中的是「笔记视图」库(行来自文件夹里的笔记)——自动化只支持经典多维表,请换一张。","automation.builder.timerMode":"定时方式","automation.builder.timerDaily":"每天","automation.builder.timerOnce":"一次","automation.builder.timerEvery":"间隔","automation.builder.time":"每天时刻","automation.builder.datetime":"触发时刻","automation.builder.onceHint":"到点执行一次后自动停用(留在列表里,改期+启用即可复用)。","automation.builder.interval":"重复间隔","automation.builder.everyHint":"从创建时刻起按间隔滚动;停机错过只补最近一次。含跑 Agent 步骤时下限 1 小时。","automation.builder.unitM":"分钟","automation.builder.unitH":"小时","automation.builder.unitD":"天","automation.builder.match":"活动日志匹配串","automation.builder.matchPh":"如 note.edit、文件名或 plugin: 事件","automation.builder.matchHint":"匹配新出现的活动日志行(子串)。可盯插件事件(plugin:插件id:事件)或 run.done agent=xx。","automation.builder.path":"文件路径(绝对路径或 ~ 开头)","automation.builder.chars":"非空白字符数","automation.builder.stepN":"步骤 {n}","automation.builder.moveUp":"上移","automation.builder.moveDown":"下移","automation.builder.notifyTitle":"通知标题","automation.builder.notifyTitlePh":"收件箱消息标题","automation.builder.notifyBody":"通知正文(可选)","automation.builder.notifyHint":"直接投递到收件箱(0 token),已接微信/TG 等通道会一并推送。","automation.builder.runner":"执行者","automation.builder.runnerPick":"选择 Agent…","automation.builder.tool":"工具","automation.builder.toolPick":"选择工具…","automation.builder.dangerous":"⚠ 高危工具:参数即保存即批准,请确认内容","automation.builder.toolCatalogEmpty":"引擎未提供动作目录(需新版引擎)","automation.builder.museFallback":"唤醒 Muse(默认)","automation.builder.museFallbackHint":"不加步骤时,命中会唤醒 Muse 把这件事整理成给你的提醒/TODO。添加步骤则改为按步骤执行。","automation.builder.prompt":"执行指令","automation.builder.promptPh":"命中后让它做什么(英文最佳)","automation.builder.cooldown":"冷却(小时)","automation.builder.cooldownHint":"两次触发的最小间隔,单位小时(纯通知/工具链下限 0.25=15 分钟)","automation.builder.cooldownAgentHint":"含跑 Agent 步骤,下限 1 小时(无人值守自激护栏)","market.title":"商店","market.subtitle":"发现社区构建的工作流、能力与界面扩展","market.navSubtitle":"社区扩展与工作流","market.group.discover":"发现","market.group.categories":"分类","market.group.manage":"管理","market.tab.discover":"商店首页","market.tab.skills":"技能","market.tab.agents":"Agent","market.tab.plugins":"插件","market.tab.spaces":"Space","market.tab.themes":"主题","market.tab.webapps":"网站应用","market.tab.installed":"已安装","market.searchPlaceholder":"搜索名称、作者或标签","market.clearSearch":"清除搜索","market.sort.label":"排序","market.sort.popular":"热门","market.sort.latest":"最近","market.sort.name":"名称","market.sectionSubtitle":"浏览{section}并管理安装状态","market.pluginsSubtitle":"浏览插件、Space 与 Agent,并管理安装状态","market.detailSubtitle":"详情、来源与安装信息","market.webOpen":"打开","market.webHint":"用户用 Coding Space 构建并上架的网页应用,在内置浏览器中打开;AI 功能消耗访客自己的账号额度。","market.tab.updates":"可更新","market.tab.submit":"投稿","market.author":"作者","market.downloads":"{n} 次下载","market.downloadsShort":"{n} 下载","market.install":"安装","market.installing":"安装中…","market.installed":"已安装","market.reinstall":"重新安装","market.uninstall":"卸载","market.uninstallConfirm":"卸载「{name}」?将删除它的安装目录。","market.uninstallWarnAgent":"⚠️ 这是一个 Agent:它落地后有自己的记忆与日志,卸载会一并删除,且无法恢复。","market.uninstallWarnSkill":"⚠️ 若你改过这份技能,你的改动会一并删除。","market.uninstalled":"已卸载「{name}」","market.uninstalledNeedsRestart":"已卸载「{name}」· 重启后端后它的工具才会真正消失","market.uninstallFail":"卸载失败:{e}","market.openSettings":"打开设置","market.update":"更新","market.updateTitle":"更新 v{from} → v{to}","market.allUpToDate":"已安装的内容都是最新版本","market.allUpToDateHint":"发现新版本时会自动出现在这里。","market.detailBack":"返回列表","market.empty":"这个分类还没有内容","market.emptyHint":"社区内容通过审核后会出现在这里。","market.noInstalled":"还没有从商店安装内容","market.noResults":"没有找到匹配内容","market.noResultsHint":"换一个名称、作者或标签试试。","market.browse":"浏览商店","market.retry":"重新加载","market.loadFailShort":"商店暂时无法加载","market.loadFail":"加载失败:{e}","market.summaryFallback":"作者暂未提供简介。","market.searchResults":"搜索结果","market.resultCount":"共 {n} 项内容","market.featured":"社区精选","market.viewDetails":"查看详情","market.recent":"最近上架","market.recentHint":"看看社区刚刚带来了什么。","market.popular":"热门内容","market.popularHint":"按真实安装量排序。","market.overview":"内容介绍","market.reviewed":"已通过上架审核","market.reviewedHint":"表示内容符合发布要求,不代表 Forsion 为第三方代码提供担保。","market.type":"类型","market.version":"版本","market.source":"安装来源","market.sourceUpload":"Forsion 托管包","market.updated":"最近更新","market.unknown":"未知","market.installOk":"已安装「{name}」","market.spaceInstalled":"已安装 Space「{name}」并加入功能栏","market.themeInstalled":"已安装「{name}」,可在 设置 → 外观 中选用","market.amadeusPluginInstalled":"Forsion 插件「{name}」已安装并加载","market.pluginInstalledOk":"插件已安装并启用","market.pluginInstalledRestartHint":"插件已安装,重启后端后才完整生效","market.pluginInstalledWaiting":"插件已安装,但还需要先安装或启用:{list}","market.amadeusPluginNeedsDeps":"Forsion 插件「{name}」已安装,但还需要先安装或启用:{list}","market.restartBackend":"重启后端","market.restartBackendHint":"只需几秒;正在运行的对话会被中断","market.backendRestarting":"正在重启后端…","market.backendRestarted":"后端已重启,改动已生效","market.backendRestartFailed":"后端没能重启,请稍后重试或重启应用","market.installFail":"安装失败:{e}","market.installFailNamed":"「{name}」安装失败:{e}","market.installHintGithub":"这个项目从 GitHub 下载,部分网络下连不上。可以开启系统代理后重试,或在「设置 → 常规 → 连接」打开「使用中国大陆镜像源」,改走国内代理线路。","market.installRetry":"重试","market.phase.resolve":"准备中…","market.phase.connect":"连接中…","market.phase.connectN":"连接中 {n}/{m}…","market.phase.percent":"下载中 {n}%","market.phase.bytes":"已下载 {size}","market.openRepo":"查看 GitHub 仓库","market.readmeEmpty":"(暂无详情)","market.submitHint":"支持 GitHub 仓库、npm 公开包和 ZIP 上传。在个人中心提交,审核通过后上架。","market.submitOpen":"前往投稿页","market.submitKicker":"开发者中心","market.submitTitle":"把你的工作流带给更多人","market.submitArtTitle":"统一审核与版本管理","market.submitArtHint":"Skills、Agents、Plugins、Spaces 与 Themes 使用同一条发布管线。","feedback.label":"遇到的问题 / 想反馈的内容","feedback.placeholder":"描述你遇到的问题或建议……提交后会自动附带本次会话日志,便于我们排查。","feedback.logAttached":"将自动附带本次会话日志({name})","feedback.noSession":"当前无会话,仅提交文字反馈","feedback.submit":"提交反馈","feedback.diagnoseViaChat":"让 Tangu 帮我诊断","feedback.diagnoseViaChatHint":"把问题描述发给当前会话的 Agent,就地帮你排查","feedback.ok":"已提交,感谢你的反馈!","feedback.okNoLog":"已提交(会话日志超过 5MB,本次未附带)","feedback.errEmpty":"请先填写反馈内容","feedback.errFail":"提交失败:{err}","feedback.errNotLoggedIn":"未登录 Forsion,无法提交","feedback.errUnavailable":"当前环境不支持提交反馈","sidebar.account.login":"登录 Forsion","sidebar.account.loginHint":"登录后可用云端记忆 / 技能 / 托管模型(不登录也能正常使用)","sidebar.account.loggingIn":"登录中…","sidebar.account.logout":"退出登录","sidebar.account.menu.weekly":"本周","sidebar.account.menu.daily":"今日","sidebar.account.menu.unlimited":"不限","sidebar.account.menu.loading":"加载中…","sidebar.account.menu.quotaFail":"额度加载失败","settings.provider.loginBusy":"在浏览器里完成登录后,本地引擎会自动重启加载该 provider,模型列表随后自动刷新(约几秒)。","quota.exhausted.daily":"今日 AI 额度已用尽(本次运行已预支跑完;可在「Forsion 云端 → 额度与积分」用额度重置卡立即恢复)","quota.exhausted.weekly":"本周 AI 额度已用尽(本次运行已预支跑完;可在「Forsion 云端 → 额度与积分」用额度重置卡立即恢复)","sidebar.account.loginFail":"登录失败:{e}","sidebar.account.loginSub":"点击登录","sidebar.account.engineDown":"引擎未运行 · 点击重启","sidebar.account.engineStarting":"引擎启动中…","sidebar.settings":"设置 (Ctrl+,)","header.theme":"深浅模式","header.browser":"浏览器","header.browserEnabled":"浏览器工具已开启","header.browserDisabled":"浏览器工具已关闭","settings.tab.about":"关于","about.version":"版本","about.checkUpdates":"前往官网","about.update.check":"检查更新","about.update.checking":"检查中…","about.update.upToDate":"已是最新版本","about.update.available":"发现新版本 v{version}","about.update.download":"下载更新","about.update.downloading":"下载中 {percent}%","about.update.install":"重启并安装","about.update.goToDownload":"前往下载","about.update.error":"更新失败:{error}","about.update.unsupported":"开发环境不支持自动更新","about.update.unreachable":"连不上更新服务器,稍后再试","about.update.beta":"接收测试版更新","about.update.betaHint":"打开后会收到 x.y.z-beta.N 这类预发布版本(功能更早、也更可能有问题)。关着则完全看不到它们。正式版永远优先:测试版之后发的正式版照常推送。","app.update.bannerTitle":"发现新版本 v{version}","app.update.bannerAction":"前往更新","app.update.bannerDismiss":"忽略","about.changelogTitle":"最新更新","about.builtWith":"Forsion Desktop · 扶桑","about.builtWithMobile":"Forsion 移动端 · 扶桑","about.complianceTitle":"备案与协议","about.appFiling":"App 备案号","about.privacy":"隐私政策","about.terms":"服务条款","settings.cloud.envOnly":"Forsion 云端地址由环境变量 TANGU_CLOUD_URL 设置(此处只读)。","settings.cloud.label":"Forsion 云端地址(大脑:记忆/技能/托管模型)","settings.cloud.unset":"(未设置,用内置默认)","model.group.forsion":"Forsion 云端","picker.ungrouped":"未分组","model.group.direct":"本地","model.collapseAll":"全部折叠","model.expandAll":"全部展开","model.empty":"暂无模型","model.searchPlaceholder":"搜索模型…","settings.tab.developer":"开发者选项","settings.tab.browser":"浏览器控制","settings.tab.channels":"通道","channel.name.wechat":"微信","channel.name.telegram":"Telegram","channel.name.qq":"QQ","channels.intro":"把 Tangu 接进你的 IM:连接即新建一个通道会话,消息即聊即答;收件箱转发可独立开启,两者互不影响。","channels.loadingTitle":"正在加载通道","channels.loadingHint":"正在读取本机通道能力与连接状态。","channels.notAvailable":"通道功能需要内置本地后端(桌面版)。","channels.notAvailableHint":"确认本机后端已启动后重试;外部后端模式暂不提供此设置。","channels.enable":"启用","channels.status.connected":"已连接","channels.status.notConnected":"未连接","channels.status.disabled":"已停用","channels.connect":"连接","channels.scanConnect":"扫码连接","channels.disconnect":"断开连接","channels.disconnected":"已断开。","channels.connectedAs":"已连接:{label}","channels.connectedMsg":"微信已连接,已新建通道会话。","channels.connectFailed":"操作失败:{e}","channels.qrExpired":"二维码已过期,请重新扫码。","channels.scanQrHint":"用微信「扫一扫」确认登录。","qr.failed":"二维码生成失败,请重试。","qr.alt":"登录二维码","channels.newSessionHint":"连接即新建会话;之后的消息发往该会话。在 IM 里可用 /new 新建、/list /switch 切换会话,/help 查看全部命令。","channels.botToken":"Bot Token","channels.botTokenHint":"在 Telegram 找 @BotFather 创建机器人获取 token,填入后点「连接」。","channels.qqHint":"在 QQ 开放平台(q.qq.com)创建机器人获取 AppID / AppSecret。","channels.secretSaved":"已保存(输入可更换)","channels.sessionsSec":"通道会话","channels.sessions":"启用通道会话","channels.sessionsHint":"收到的消息驱动 Agent 会话并回复;关闭后仅收件箱转发在工作。","channels.approval":"远程审批","channels.approval.readonly":"询问我批准","channels.approval.autoEdit":"替我批准","channels.approval.fullAuto":"完全放行","channels.defaultAgent":"默认 Agent","channels.defaultModel":"默认模型","channels.imageModel":"画图模型","channels.ttsModel":"语音模型","channels.ttsModelPlaceholder":"空=沿用「语音朗读」设置","channels.ttsVoice":"音色","channels.followDefault":"跟随全局默认","channels.followGlobal":"跟随全局设置","channels.forwardSec":"收件箱转发","channels.forward":"转发收件箱消息到此通道","channels.forwardHint":"收件箱有新消息时推送到你的 IM(与通道会话相互独立)。","channels.forwardSenders":"允许的发件人","channels.forwardAll":"全部","channels.waitingPeer":"已连接,等待对方发来第一条消息以绑定联系人。","channels.senderSystem":"系统","channels.senderServer":"Forsion 云端","sidebar.channel.setAsConnected":"设为正在连接","settings.tab.notes":"笔记","settings.tab.sync":"同步","settings.sync.cloudSec":"在线同步","settings.sync.remoteSec":"本地智库远程同步","settings.notes.storageTitle":"文件与附件","settings.notes.storageDescription":"集中设置附件落点与日记目录。","settings.notes.behaviorTitle":"编辑与安全","settings.notes.behaviorDescription":"控制导入、链接兼容与删除附件时的保护策略。","settings.notes.modeLabel":"附件存放方式","settings.notes.modeAttachments":"笔记同目录下的 attachments 文件夹","settings.notes.modeSame":"与笔记同目录","settings.notes.modeVault":"智库内固定文件夹","settings.notes.modeHint":"拖入笔记的文件保存到哪里。attachments 模式会在笔记所在目录自动创建 attachments 子文件夹(不存在则新建)。","settings.notes.folderLabel":"智库相对文件夹","settings.notes.folderHint":"相对智库根目录,如 assets。所有附件集中存放于此(需在智库内才能内联预览)。","settings.notes.previewLabel":"导入文件默认开启预览","settings.notes.previewHint":"开启:插入 ![[文件]] 预览块(图片内联,其它显示可点开的文件卡片)。关闭:插入 [文件名](相对路径) 链接。","settings.notes.upgradeV4Label":"打开旧笔记时升级为 v4 纯 Markdown 格式","settings.notes.upgradeV4Hint":"默认开启:v3 块标记笔记在编辑时转为纯 Markdown(无标记、标准分段)。升级仅在你真正编辑后落盘;若还有设备停留在 2.7.8 以前,可暂时关闭。","settings.notes.dailyLabel":"日记文件夹","settings.notes.dailyPlaceholder":"留空 = 智库根目录","settings.notes.dailyHint":"「打开今天的日记」创建 YYYY-MM-DD.md 的位置(智库相对路径);若存在 templates/daily.md 会自动套用为模板。","settings.notes.wikiFilesLabel":"双链补全包含附件与多维表","settings.notes.wikiFilesHint":"开启:输入 [[ 时除笔记外也补全附件、多维表(.db)、画板等文件。关闭:只补全笔记。","settings.notes.canvasDoubleClickFocusLabel":"双击聚焦画布卡片","settings.notes.canvasDoubleClickFocusHint":"双击卡片一律进入编辑并把光标落到点击处。开启:进编辑的同时还把它平滑移到画面中心并缩放到适合阅读的比例;关闭:只进编辑,视口不动。单击只选中;空格也可进编辑。","settings.notes.canvasOverviewZLabel":"画布简略标题的触发比例","settings.notes.canvasOverviewZHint":"画布缩小到这个比例或更小时,卡片正文换成标题摘要。默认 25% = 只在缩到底那一档才简略;调高则更早换成摘要。画布右下角的开关可以整个关掉简略显示。","settings.notes.deleteAssetsLabel":"删除笔记时连带删除独占附件","settings.notes.deleteAssetsAsk":"每次询问","settings.notes.deleteAssetsYes":"记住:一并删除","settings.notes.deleteAssetsNo":"记住:保留附件","settings.notes.deleteAssetsHint":"只处理「仅被这条笔记引用」的附件;被别的笔记也引用的一律保留。","settings.remote.saved":"远程设置已保存。托管后端可能会重启以应用配置。","settings.browser.title":"浏览器控制","settings.browser.agentBrowser":"Agent 浏览器","settings.browser.hint":"Tangu 会优先使用 browser_search 与 browser_* 交互工具完成网页任务;web_search 保留兼容。","settings.browser.engine":"浏览器引擎","settings.browser.engineHint":"自动模式会按可用性选择浏览器实现。","settings.browser.searchEngine":"搜索引擎","settings.browser.timeout":"超时","settings.browser.timeoutHint":"单次浏览器命令的最长等待时间(毫秒)。","settings.browser.allowPrivate":"允许浏览器工具打开私网/本机 URL","settings.browser.allowPrivateHint":"默认关闭;browser_navigate 会阻止 localhost、RFC1918 与 link-local 地址。","settings.tab.spaces":"Space","settings.spaces.hint":"管理 ribbon 顶部的 Space。内置 Space 随应用提供、不可移除;你自建或从商店安装的 Space 可卸载(删除其磁盘布局配方)。","settings.spaces.builtin":"内置","settings.spaces.user":"自建/商店","settings.spaces.uninstall":"卸载","settings.spaces.uninstalled":"已卸载「{name}」","settings.spaces.empty":"还没有任何 Space。","settings.spaces.startupTitle":"启动位置","settings.spaces.startupLabel":"打开应用时进入","settings.spaces.startupHint":"默认进入 ribbon 主位槽指着的那个 Space;也可以回到上次退出的 Space 并恢复标签页,或固定进入某一个。","settings.spaces.lastExit":"上次退出的 Space(连同标签页)","settings.spaces.homeSlotStartup":"主位槽的 Space(默认 · 当前是「{name}」)","settings.spaces.homeSlotLabel":"Ribbon 主位槽","settings.spaces.homeSlotHint":"ribbon 竖条正中那一格。默认放主页,也可以换成任何一个 Space;在那一格上右键同样能换。","settings.spaces.hintPhone":"内置 Space 随应用提供、不可移除;你自建或从市场安装的 Space 可卸载(删除其磁盘布局配方)。","settings.spaces.startupHintPhone":"选择打开应用时先进哪个 Space:默认的那个、上次退出的,或固定某一个。","settings.spaces.homeSlotStartupPhone":"默认(当前是「{name}」)","settings.spaces.libraryTitle":"已安装的 Space · {count}","settings.tab.plugins":"插件","settings.tab.amadeusPlugins":"插件","settings.amadeusPlugins.builtinTitle":"内置插件","settings.amadeusPlugins.builtinHint":"随 App 发行、默认开启的能力(浏览器/终端/日历是宿主原生视图,其余是编辑器增强)。关闭即从工作台、命令面板与编辑器中移除 —— 日历连同它的 Space 一起撤下。","settings.amadeusPlugins.externalTitle":"外置插件","settings.amadeusPlugins.changelog":"更新日志","settings.amadeusPlugins.hint":"启用/禁用即时生效,点击插件可查看详情。插件目录:~/.forsion/plugins/(商店安装位置)。插件可捆绑引擎插件/Agent/技能/Space(捆绑包),随本插件一并识别、启停与卸载。","settings.amadeusPlugins.openFolder":"打开插件文件夹","settings.amadeusPlugins.reload":"重新加载","settings.amadeusPlugins.scaffold":"创建示例插件","settings.amadeusPlugins.builtin":"内置","settings.amadeusPlugins.external":"外部","settings.amadeusPlugins.agentOwned":"{agent} 自建 Space","settings.amadeusPlugins.blockedInvalid":"插件清单无效:{reason}","settings.amadeusPlugins.uninstall":"卸载","settings.amadeusPlugins.uninstallConfirm":"确定卸载插件「{name}」?其文件夹将被整体删除;内嵌的引擎插件/Space 一并移除(已播种的 Agent 会保留,可在 Agents 页手动删)。","settings.amadeusPlugins.uninstalled":"已卸载「{name}」","settings.amadeusPlugins.uninstalledRestartPending":"「{name}」文件已删除,但引擎重启未完成——内嵌工具可能仍在运行,请手动重启后端","settings.amadeusPlugins.bundleEngine":"引擎插件 ×{n}","settings.amadeusPlugins.bundleAgents":"Agent ×{n}","settings.amadeusPlugins.bundleSkills":"技能 ×{n}","settings.amadeusPlugins.bundleSpaces":"Space ×{n}","settings.amadeusPlugins.bundleTitle":"捆绑内容","settings.amadeusPlugins.bundleEngineList":"引擎插件:{list}","settings.amadeusPlugins.bundleAgentsList":"Agent:{list}","settings.amadeusPlugins.bundleSkillsList":"技能:{list}","settings.amadeusPlugins.bundleSpacesList":"Space:{list}","settings.amadeusPlugins.bundleHint":"内嵌引擎插件与 Space 随本插件启停/卸载;Agent 首次发现时播种进引擎,之后独立存在(升级不覆盖、卸载保留)。","settings.amadeusPlugins.blockedApi":"需要插件 API v{v},与当前应用不兼容","settings.amadeusPlugins.blockedMinApp":"需要应用版本 ≥ {v}","settings.amadeusPlugins.empty":"还没有任何插件。","settings.amadeusPlugins.back":"返回列表","settings.amadeusPlugins.dep":"依赖应用","settings.amadeusPlugins.depConnected":"已连接 {v}","settings.amadeusPlugins.depMissing":"未检测到,需要安装并运行","settings.amadeusPlugins.depCheck":"检测连接","settings.amadeusPlugins.depInstall":"一键安装","settings.amadeusPlugins.depInstalling":"安装中…","settings.amadeusPlugins.depFail":"安装未完成,可打开官网手动安装","settings.amadeusPlugins.depHomepage":"打开官网","settings.amadeusPlugins.commands":"命令","settings.amadeusPlugins.settings":"设置","plugin.onboarding.title":"插件引导 — {name}","plugin.onboarding.stepsTitle":"就绪步骤","plugin.onboarding.settingsTitle":"必要设置","plugin.onboarding.recommendsTitle":"配套推荐","plugin.onboarding.install":"安装","plugin.onboarding.installed":"已装","plugin.onboarding.installing":"安装中…","plugin.onboarding.notFound":"未在商店上架","plugin.onboarding.later":"稍后","plugin.onboarding.done":"完成","plugin.onboarding.laterHint":"跳过后随时可回 设置 → Forsion 插件,点该插件的「运行引导」继续;前置条件全部满足后「待引导」标记会自己消失。","plugin.onboarding.requiresTitle":"开始前需要","plugin.onboarding.req.ok":"已就绪","plugin.onboarding.req.unmet":"未完成","plugin.onboarding.req.unknown":"暂时无法检查","plugin.onboarding.req.timeout":"检查超时,稍后再试一次。","plugin.onboarding.req.inactive":"启用插件后才能检查这一项。","plugin.onboarding.recheck":"重新检查","plugin.onboarding.checking":"检查中…","plugin.onboarding.allReady":"全部就绪,可以开始用了。","plugin.onboarding.someUnknown":"没有发现未完成的项;另有 {n} 项此刻无法检查。","plugin.onboarding.guideTitle":"使用说明","plugin.onboarding.badge":"待引导","plugin.onboarding.run":"运行引导","plugin.onboarding.nudgeTitle":"「{name}」插件还差几步就绪","plugin.onboarding.nudgeBody":"「{name}」还有前置条件没满足。打开 设置 → Forsion 插件 → {name},点「运行引导」查看缺哪一项。","settings.plugins.npmInstallTitle":"从 npm 安装引擎插件","settings.plugins.npmInstallHint":"输入包名(如 npm:@forsion/tangu-computer-use)。插件以你的完整系统权限运行,只安装信任的来源。","settings.plugins.npmInstallConfirm":"即将从 npm 安装「{spec}」。插件以你的完整系统权限运行,装前请确认来源可信。继续?","settings.plugins.preferMirror":"国内镜像优先","settings.plugins.installBtn":"安装","settings.plugins.installing":"安装中…","settings.plugins.installed":"已安装 {id}@{version}","settings.plugins.empty":"暂无插件","settings.plugins.secForsion":"Forsion 插件","settings.plugins.secEngine":"Tangu 引擎插件","settings.plugins.bundleOwnedHint":"另有 {n} 个引擎插件由上方 Forsion 插件捆绑提供,在对应插件卡片中随插件统一启停。","settings.plugins.selectHint":"选择左侧插件查看其设置","settings.plugins.builtin":"内置","settings.plugins.folder":"文件夹","settings.plugins.needsRestart":"需重启","settings.plugins.needsRestartHint":"新版本已在磁盘上,但它的入口引用了相对路径模块,需重启后端才会运行新版","settings.plugins.waitingDeps":"等待前置插件","settings.plugins.loadFailed":"加载失败","settings.plugins.settling":"正在收尾","settings.plugins.settlingHint":"上一次启动或停用还没结束,结束后会按开关自动生效","settings.plugins.needsDepsToEnable":"需要先安装并启用:{list}","settings.plugins.disableDependents":"停用「{name}」后,依赖它的插件也会暂停:{list}。重新启用后它们会自动恢复。继续吗?","settings.plugins.uninstallDependents":"以下插件依赖「{name}」,卸载后将无法运行:{list}。","settings.plugins.openFolder":"打开插件文件夹","settings.plugins.rescan":"重载插件","settings.plugins.rescanning":"重扫中…","settings.plugins.rescanAdded":"重扫完成:{n} 个插件有变化(新装、更新或移除)","settings.plugins.rescanNone":"重扫完成:没有变化","settings.plugins.rescanHint":"新装入、更新或移除的插件即时生效;入口引用相对路径模块的插件更新后仍需重启后端","settings.plugins.uninstall":"卸载","settings.plugins.uninstallConfirm":"卸载「{name}」?将删除插件文件与全部设置。","settings.plugins.uninstalled":"已卸载「{name}」","settings.plugins.scope":"作用域","settings.plugins.scopeGlobal":"全局","settings.plugins.scopeAgent":"按 Agent","settings.plugins.selectAgent":"选择 Agent","settings.plugins.noSettings":"该插件无可配置项","settings.plugins.saved":"已保存","settings.plugins.import":"导入图片","settings.plugins.deleteConfirm":"删除「{name}」?","settings.plugins.onlyImage":"只能导入图片(png/jpg/gif/webp)","about.versionClickHint":"再点 {n} 次开启开发者模式","about.devUnlocked":"开发者模式已开启","settings.developer.note":"以下选项面向高级用户/调试,一般无需修改。","settings.developer.cloudUrlLabel":"Forsion 云端地址","settings.developer.cloudUrlHint":"大脑服务(记忆/技能/托管模型)的地址。留空则用环境变量 TANGU_CLOUD_URL 或内置默认。托管模式下保存会重启后端使其生效。","settings.developer.cloudUrlPlaceholder":"https://api.forsion.net","settings.developer.saveCloudUrl":"保存","settings.developer.savedRestarting":"已保存,正在重启后端…","settings.developer.saved":"已保存","settings.developer.relaunchLabel":"引导界面","settings.developer.relaunchHint":"重新进入首次安装的引导流程(主题 / 连接 / 模型 / 项目目录)。","settings.developer.relaunch":"重新进入引导","settings.developer.disable":"关闭开发者模式","settings.developer.showSystemPrompt":"回复前显示 system prompt","settings.developer.showSystemPromptHint":"开启后,每条 AI 回复前会显示本条消息发送给模型的完整 system prompt(可展开检查内容与结构);仅本机调试,关闭开发者模式时自动一并关闭。","settings.developer.activeWindow":"前台窗口采样(接缝)","settings.developer.activeWindowHint":"开启后,声明了 activeWindow 能力的插件可以读到「现在焦点在哪个应用」——用来替掉 ActivityWatch 这类外部依赖。数据只留本机。命令面板(⌘K)会多一条「前台窗口采样」调试面板。默认关闭,关闭开发者模式时自动一并关闭。","settings.developer.mobileUiPreview":"移动端 UI 预览命令","settings.developer.mobileUiPreviewHint":"开启后命令面板(⌘K)多一条「切换到移动端 UI」,运行时把桌面壳换成单列移动壳预览(会刷新页面);web 端同样可用。仅本机调试,关闭开发者模式时自动一并关闭。","command.switchToMobileUi":"切换到移动端 UI","command.switchToDesktopUi":"切换回桌面 UI","command.zoomIn":"放大页面","command.zoomOut":"缩小页面","command.zoomReset":"重置页面缩放","chat.systemPrompt":"系统提示词","onboarding.brand.caption":"AI 工作台","onboarding.progress.label":"设置进度","onboarding.phase.connect":"连接账号","onboarding.phase.appearance":"选择外观","onboarding.phase.capabilities":"配置能力","onboarding.phase.workspace":"准备项目目录","onboarding.welcome.kicker":"首次设置","onboarding.welcome.subtitle":"把模型、Agent、知识和本地工具放进同一个应用。","onboarding.welcome.railLabel":"从这里开始","onboarding.welcome.railTitle":"让 Forsion 适合你的工作方式。","onboarding.welcome.railBody":"几分钟内完成基础设置。每一项之后都可以在设置中修改。","onboarding.welcome.promiseModels":"连接 Forsion 或你自己的模型","onboarding.welcome.promiseAgents":"准备可随时切换的 Agent","onboarding.welcome.promiseLocal":"保留本地文件与执行控制权","onboarding.step.connect.title":"连接模型与账号","onboarding.step.connect.description":"登录 Forsion、使用订阅额度,或接入自己的 OpenAI 兼容服务。","onboarding.step.theme.title":"选择界面外观","onboarding.step.theme.description":"设计语言决定结构,主题色决定强调色,背景色决定底色,三者可以自由组合。","onboarding.step.model.title":"选择默认模型","onboarding.step.model.description":"先选一个日常模型,之后可以在每次对话中随时切换。","onboarding.step.speech.title":"配置语音输入","onboarding.step.speech.description":"选择语音识别模型,也可以保持默认并稍后配置。","onboarding.step.agents.title":"认识你的 Agent","onboarding.step.agents.description":"查看现有名册,按需创建一个有专属人格和记忆的助手。","onboarding.step.workspace.title":"选择工作目录","onboarding.step.workspace.description":"为本地会话指定默认目录,Forsion 只在你授权的范围内工作。","onboarding.step.env.title":"检查本机环境","onboarding.step.env.description":"确认编码任务所需工具,并按当前网络环境选择下载源。","onboarding.step.done.title":"一切准备就绪","onboarding.step.done.description":"基础配置已经完成,现在可以进入 Forsion 开始工作。","onboarding.done.cloudLine1":"· 输入栏可随时切换模型与思考档位;笔记、日历与自动化都在 Forsion 里","onboarding.done.cloudLine2":"· 设置 → 外观可随时改主题与语言;桌面版还能连接本机文件与工具","onboarding.connect.modeLabel":"连接方式","onboarding.model.choiceLabel":"默认对话模型","onboarding.speech.choiceLabel":"语音输入","onboarding.workspace.choiceLabel":"默认工作目录","onboarding.connect.forsionHint":"用 Forsion 账号登录(云端地址由环境变量配置,无需填写);也可在上方切换为自带 API Key。","onboarding.connect.skipForNow":"暂时跳过","onboarding.theme.stepLabel":"选择主题外观","onboarding.theme.modeLabel":"明暗模式","onboarding.theme.light":"浅色","onboarding.theme.dark":"深色","onboarding.theme.hint":"随时可在 设置 → 外观 中更改。","onboarding.theme.customSeedLabel":"自定义强调色","settings.theme.system":"跟随系统","settings.theme.modeLocked":"该主题固定跟随系统明暗","settings.theme.modeLockedHint":"Glass 等主题的明暗由系统决定,不可手动切换。","settings.theme.zoomLabel":"界面大小","settings.theme.zoomHint":"缩放整个界面,当前 {percent}%。也可用 ⌘/Ctrl + +/− 按 10% 微调。","settings.theme.zoomPresetLabel":"界面大小预设","settings.theme.zoomSmall":"小","settings.theme.zoomStandard":"标准","settings.theme.zoomLarge":"大","settings.theme.smoothCaret":"丝滑光标","settings.theme.smoothCaretHint":"编辑器与聊天输入框的文字光标平滑滑动到新位置(Word 手感)。默认关闭,需要时手动打开。","settings.theme.chatAvatars":"聊天头像","settings.theme.chatAvatarsHint":"在对话里显示 Agent 与你的头像。关掉后消息更素净,Agent 名字仍保留。","settings.theme.calmDim":"外围淡出","settings.theme.calmDimHint":"Ribbon、未选中的标签、左侧栏和对话右侧的卡片平时淡一些,指针移过去或键盘焦点进来就恢复。","settings.theme.calmReading":"宽松正文","settings.theme.calmReadingHint":"笔记和对话正文的行距、段距放宽,笔记每行短一些。界面字号和控件大小不变。","settings.theme.calmMotion":"舒缓过渡","settings.theme.calmMotionHint":"切换视图、外围恢复时慢一点。","settings.theme.ribbonAutoHome":"Ribbon 滚动后自动归位","settings.theme.ribbonAutoHomeHint":"用滚轮翻过 Ribbon 以后,点别处或点开一个图标,稍后自动滑回原位。关掉后停在翻到的位置。","settings.theme.ribbonRecent":"Ribbon 中间显示最近使用的 Space","settings.theme.ribbonRecentHint":"在 Ribbon 中间的空当里列出最近用过的几个 Space,最近的在上。位置不够时自动少显示,直到一个不显示。","settings.theme.ribbonRecentOff":"不显示","settings.theme.fontUi":"界面字体","settings.theme.fontBody":"正文字体","settings.theme.fontMono":"等宽字体","settings.theme.fontFollow":"跟随主题","settings.theme.fontSystem":"系统默认","settings.theme.fontHint":"预设字体随应用内置,不依赖本机是否装过,每台设备观感一致。选「跟随主题」则用当前主题自带的字体栈。","settings.theme.fontPreset.inter":"Inter(现代无衬线)","settings.theme.fontPreset.notoSans":"思源黑体 Noto Sans","settings.theme.fontPreset.wenkai":"霞鹜文楷(阅读)","settings.theme.fontPreset.jetbrains":"JetBrains Mono","settings.theme.fontPreset.system":"系统默认","settings.theme.fontGroupBuiltin":"内置","settings.theme.fontGroupPlugin":"插件提供","settings.theme.customSeedLabel":"自定义强调色","settings.theme.customBgLabel":"自定义背景色","settings.theme.customBgFollow":"跟随主题色","settings.theme.customBgClear":"恢复跟随","settings.theme.customBgHint":"不设置时背景由主题色微染;设置后将所选色作为独立氛围种子,并自动调至当前明暗模式的可读范围。","settings.theme.langLabel":"设计语言","settings.theme.openFolder":"打开主题文件夹","settings.theme.reload":"重载主题","settings.theme.dropHint":"把 theme.json + theme.css 放进 ~/.forsion/themes/<id>/ 即可装第三方主题,放好后点「重载主题」。","settings.theme.options":"{name} 选项","settings.theme.optionsReset":"重置","settings.theme.skinLabel":"配色","settings.theme.accentLabel":"主题色","settings.theme.bgLabel":"背景色","settings.theme.skin.cream":"经典","settings.theme.skin.coral":"珊瑚","settings.theme.skin.teal":"柔青","settings.theme.skin.lavender":"薰衣草","settings.theme.skin.zhi":"晴蓝","settings.theme.skin.ink":"墨色","settings.theme.skin.custom":"自定义","settings.group.appearance":"外观","settings.group.account":"账户","settings.group.model":"模型","settings.group.agents":"Agent","settings.group.extensions":"扩展","settings.group.appearanceAbout":"外观·关于","settings.group.plugins":"插件","settings.group.advanced":"高级","settings.group.options":"选项","settings.group.workspace":"工作区","settings.group.ai":"AI","settings.group.system":"系统","settings.group.tools":"工具","settings.group.corePlugins":"核心插件","settings.group.communityPlugins":"社区插件","settings.tab.general":"常规","settings.page.generalDescription":"管理工作目录、运行环境与 Forsion 连接状态。","settings.page.spacesDescription":"选择启动位置,查看或移除已安装的 Space。","settings.page.notesDescription":"统一管理附件位置、笔记行为与删除安全选项。","settings.page.syncDescription":"把本地智库同步到远程存储(Dropbox、S3、WebDAV 等)。","settings.page.themeDescription":"预览并组合设计语言、配色、明暗、界面大小与字体。","settings.page.shortcutsDescription":"搜索命令并录制、解绑或恢复快捷键。","settings.page.notificationsDescription":"控制通知出口,以及每类事件与插件是否提醒。","settings.page.statusbarDescription":"选择底部状态项,并拖动调整显示顺序。","settings.page.modelDescription":"选择默认模型,管理提供商、联网搜索与语音能力。","settings.page.agentsDescription":"管理 Agent 名册、后台 Agent 与本机 Agent CLI。","settings.page.skillsDescription":"浏览技能库,导入其他工具中的技能与 MCP 配置。","settings.page.mcpDescription":"连接、启停并维护外部 MCP 工具服务器。","settings.page.hooksDescription":"管理 Agent 运行前后的自动化钩子。","settings.page.channelsDescription":"连接消息通道并集中查看其运行状态。","settings.page.browserDescription":"选择浏览器与搜索引擎,并调整访问安全边界。","settings.page.pluginsDescription":"管理核心能力与已安装插件,查看设置和更新。","settings.page.pluginDescription":"调整该插件提供的功能与运行选项。","settings.page.advancedDescription":"管理本机服务、界面行为、日志与数据安全。","settings.page.developerDescription":"用于调试界面、活动日志与内部功能的开发选项。","settings.page.aboutDescription":"查看版本、更新通道、语言与完整更新日志。","settings.overview.label":"当前状态","settings.overview.mode":"运行模式","settings.overview.backend":"后端服务","settings.overview.account":"Forsion 账号","settings.overview.signedIn":"已登录","settings.overview.signedOut":"未登录","settings.overview.readyTitle":"工作环境运行正常","settings.overview.readyDescription":"后端已连接,可以继续调整工作目录和本机运行选项。","settings.overview.attentionTitle":"工作环境尚未就绪","settings.overview.attentionDescription":"检查后端连接与运行方式,保存后会在这里显示最新状态。","settings.backend.modeDescription":"选择由 Forsion 管理本机服务,或连接你已经部署的后端。","settings.backend.modeManagedDescription":"开箱即用,由桌面端负责启动、检查和重启。","settings.backend.modeExternalDescription":"适合局域网、容器或远程部署的现有服务。","settings.workspace.summary":"新建本地会话时默认使用的位置。","settings.runtime.title":"本机运行环境","settings.runtime.description":"配置代码沙箱、Python 和下载网络,修改后重启后端生效。","settings.runtime.details":"了解 Python 与网络镜像的影响","settings.external.title":"外部后端连接","settings.external.description":"填写服务地址和访问凭证,先测试连接再保存。","settings.theme.previewLabel":"实时外观预览","settings.theme.previewChat":"对话","settings.theme.previewWorkspace":"Forsion","settings.theme.previewTitle":"让想法保持连贯","settings.theme.previewMessage":"当前的设计语言、配色、字体和质感会实时应用到这块预览。","settings.theme.previewInput":"问问 Forsion,或输入 / 使用能力","settings.theme.langDescription":"选择界面的结构、圆角、排版和整体气质。","settings.theme.skinDescription":"主题色与背景色分开选,布局不变;两边选同一个 = 原来的整套配色。","settings.theme.behaviorTitle":"显示与动效","settings.theme.behaviorDescription":"调整明暗、界面大小、层次质感和输入时的反馈。","settings.theme.flatLabel":"阴影","settings.theme.flatOff":"立体","settings.theme.flatOn":"扁平","settings.theme.flatDescription":"立体使用淡阴影,扁平隐藏装饰阴影。","settings.theme.glassDescription":"为支持的表面加入半透明模糊效果。","settings.theme.ambient":"外壳随内容取色","settings.theme.ambientHint":"Genesis 的外围磨砂玻璃跟随当前可见内容的颜色,需要开着毛玻璃。滚动和切换页面时会多占一些性能。","settings.theme.typographyTitle":"字体","settings.sub.connection":"连接","settings.sub.models":"模型","settings.sub.providers":"自定义提供方","settings.sub.webSearch":"联网搜索","settings.sub.voice":"语音","settings.sub.specialAgents":"后台 Agent","settings.sub.mcpServer":"对外 MCP","settings.sub.uiSession":"界面与会话","settings.sub.data":"数据","settings.sub.skillLibrary":"技能库","settings.group.about":"关于","settings.plugins.openSettings":"设置","onboarding.agents.stepLabel":"Agent","onboarding.agents.intro":"Agent 是有自己名字、人格与专属记忆的对话角色——默认 Agent 已就绪,你也可以养一群:工作助手、翻译、陪聊各司其职,聊天时随时切换。之后可在主界面的 Agents 完整管理(头像/模型/工具等)。","onboarding.agents.rosterLabel":"当前名册","onboarding.agents.rosterEmpty":"名册为空(默认 Agent 将在首次对话时就绪)。","onboarding.agents.systemBadge":"后台","onboarding.agents.createLabel":"快速新建(可选)","onboarding.agents.namePlaceholder":"名字,如 秦车","onboarding.agents.personaPlaceholder":"一句话人格与口吻,如 严谨的中文技术编辑,惜字如金","onboarding.agents.createBtn":"创建","onboarding.agents.createHint":"只需名字即可创建;人格描述会成为它的初始设定,之后随时可改。","onboarding.agents.created":"已创建「{name}」,聊天时可在输入框上方切换。","onboarding.agents.createFail":"创建失败:{e}","onboarding.agents.historianTitle":"后台 Agent:Historian(史官)","onboarding.agents.historianDesc":"开启后每隔几轮自动为会话起标题、整理日志与长期记忆——独立模式全自动托管;辅助模式则作为档案助手进入后台子讨论,与你的 Agent 商量后再写。","onboarding.agents.historianSaveFail":"Historian 设置保存失败:{e}","onboarding.agents.moreHint":"触发轮次、提示词与另一位后台 Agent Muse,在 设置 → 后台 Agent 里配置。","onboarding.workspace.stepLabel":"选择默认本地文件夹","onboarding.workspace.hint":"Agent 新建本机会话时的默认工作目录;留空则用智库内的 Sessions 文件夹(无智库时 ~/Forsion)。","onboarding.workspace.placeholder":"~/Forsion(默认)","onboarding.workspace.pick":"浏览文件夹","onboarding.workspace.clear":"清除","settings.advanced.agentDesk":"Agent Desk 演出面板","settings.advanced.agentDeskHint":"聊天右侧的 Agent 演出区,默认开启。Agent 编辑文件时自动在旁边展示正在改的文件;Agent 也可主动把文件、笔记、导图摆上面板给你看,并截图核对自己做的效果。可拖宽度,可收成卡片。","settings.advanced.agentDeskEnable":"启用 Agent Desk","settings.advanced.summaryOpenIn":"任务概览里点文件时","settings.advanced.summaryOpenInHint":"右侧「任务概览」卡片里的来源/产物,点一下开在哪。","settings.advanced.summaryOpenIn.tab":"在新标签页打开","settings.advanced.summaryOpenIn.desk":"在 Agent Desk 展开","desk.title":"Agent Desk","desk.close":"关闭面板","tool.verb.presented":"展示了","tool.verb.sketched":"画了","sketch.mobileUnavailable":"此卡片在移动端 App 暂不可用(请在桌面或网页端查看)。","sketch.expand":"展开卡片","sketch.collapse":"收起卡片","settings.advanced.exportLogs":"导出会话日志","settings.advanced.exportLogsHint":"将当前会话的全部对话内容、界面实际状态与动作轨迹、渲染端错误、后端运行日志打包成一个 JSON 文件,便于开发者排查问题。","settings.advanced.exportBtn":"导出为 JSON","settings.advanced.exportNoSession":"当前没有打开的会话,请先选择一个会话再导出。","settings.advanced.exportOk":"已导出到 {path}","settings.advanced.exportCanceled":"已取消导出","settings.advanced.exportFailed":"导出失败:{err}","settings.clearData.label":"清空数据 / 卸载","settings.clearData.hint":"删除本机上的 Forsion 数据。此操作不可恢复,完成后应用会重启为全新状态。","settings.clearData.tangu":"Tangu 数据与项目目录(账号、设置、Agent、会话、~/Forsion)","settings.clearData.desktop":"桌面设置(窗口与 Amadeus 壳层配置)","settings.clearData.btn":"清空并重启","settings.clearData.confirm":"确定要清空所选数据吗?此操作不可恢复,应用将重启。","settings.clearData.macNote":"这只清除数据;要彻底卸载 Forsion,请把「应用程序」里的 Forsion 拖入废纸篓。","view.changelog":"更新","changelog.newVersion":"发现新版本 {version}","changelog.newest":"最新","changelog.zhOnly":"这一版的更新说明只有中文。","settings.developer.testUpdateLabel":"更新弹窗测试","settings.developer.testUpdate":"打开更新页(测试)","settings.developer.testUpdateHint":"强制弹出更新标签页,用于验证版本更新弹窗渲染是否生效(不依赖真的有新版本)。","input.slash.loop":"最大循环轮数:/loop <轮数>(当前 {current},范围 1-200)","input.slash.loopSet":"最大循环轮数已设为 {n} 轮","input.ctxLabel":"上下文","input.sessionTokens":"本会话 {n} tokens","input.runCost":"本 run 成本 {used}/{limit} 点","cost.nearCap":"⚠ 本 run 成本已达 {used} 点(上限 {limit},TANGU_MAX_RUN_COST 可调),越过上限将自动停止","ctx.compacted.auto":"上下文已自动压缩(节省约 {saved} 字符)","ctx.compacted.forced":"上下文到达自动压缩阈值,已生成摘要压缩","ctx.compacted.overflow":"上下文超出模型上限,已生成摘要压缩并重试本轮","ctx.windowSource.override":"窗口值:手动覆盖表","ctx.windowSource.model":"窗口值:模型自报","ctx.windowSource.family":"窗口值:按模型族推断(非模型自报)","ctx.windowSource.learned":"窗口值:从上游超长报错回学到的真实上限","ctx.windowSource.default":"窗口值:272k 默认兜底(未知模型,可在设置 → 模型里手填)","ctx.windowCapped":"模型最大 {max},默认只用到 {n}","ctx.sec.persona":"人格/指令","ctx.sec.harness":"进化记录","ctx.sec.guidance":"基础指引/契约","ctx.sec.profile":"用户画像","ctx.sec.project":"项目指令","ctx.sec.agentFolder":"专属文件夹/资料","ctx.sec.memory":"长期记忆","ctx.sec.skills":"技能目录","ctx.sec.environment":"环境/工具目录","ctx.sec.hooks":"Hooks 注入","ctx.sec.plan":"计划模式","ctx.sec.history":"历史消息({n} 条)","ctx.files.label":"本局装载的指令文件","ctx.files.truncated":"⚠ 超 32KB 已截断","ctx.files.none":"无(本项目没有 AGENTS.md / CLAUDE.md)","approval.why.customAsk":"按你的审批规则「{rule}」,这一步必须问你","approval.why.escalate":"要写工作区以外的文件 —— 这一档下每次都要你确认(「总允许」对它无效)","approval.why.protected":"要改凭据或 Forsion 本机配置 —— 每次都要你确认(完全通行和「总允许」都不跳过)","approval.why.mode":"当前审批档「{mode}」下,这类操作需要你批准","approval.why.control":"这会设置或修改之后可在你不在场时运行的工作,需要你逐次确认(「总允许」对它无效)","inbox.approval.withdrawnSystem":"系统已撤回这条请求(它存下的内容无法完整显示,或已被同一动作的新请求取代),不能在这里批准。需要的话让 Agent 重新发起。","approval.cmdOverflow":"命令太长,框里没显示完,请滚动看完再批准。","approval.cmdWideBlank":"命令里有一大段空白,可能把后面的内容推出视线;下面是标出空白后的完整内容。","approval.previewScrollHint":"内容较长,请滚动看完再批准。","approval.cmdHiddenChars":"命令里有不可见或会改变显示顺序的字符,看到的文字可能与实际执行的不同。","input.approval.editRules":"编辑规则…","input.approval.editRulesDesc":"按工具名/参数前缀写放行、每次问、拒绝三张名单","approvalRules.loadFailed":"读不到现有规则,先不显示表单 —— 空着保存会把已有的名单整片清掉。","approvalRules.title":"自定义审批规则","approvalRules.scopeNote":"⚠ 规则是全局的 —— 存在 ~/.forsion/config.json,所有会话共用;审批档才是按会话选的。保存后下一次工具调用即生效,不用重启。","approvalRules.syntax":"写法:工具名,或 工具名* 前缀通配,可再跟:参数前缀(跑命令比命令、写文件比路径)。例:web_fetch | mcp__* | run_bash:npm test | write_file:/etc/","approvalRules.base":"兜底档","approvalRules.baseHint":"一条规则都没命中时按这一档判(优先级:拒绝 > 每次问 > 放行 > 兜底档)","approvalRules.deny":"拒绝","approvalRules.denyHint":"直接拒掉,不问你。模型会看到是哪条规则挡的。","approvalRules.denyPh":`write_file:/etc/
291
291
  run_bash:rm -rf`,"approvalRules.ask":"每次问我","approvalRules.askHint":"一律弹审批,「总允许」对它无效(你写下的就是「永远问我」)。","approvalRules.askPh":`run_bash:npm publish
292
292
  browser_task`,"approvalRules.allow":"放行","approvalRules.allowHint":"不问直接执行,压过兜底档。但工作区外的写入仍要确认(兜底档为「完全放行」时除外)—— 放行规则只有带绝对路径前缀、且本次所有写入目标都落在该路径之内,才免这一问(例:write_file:/Users/you/proj/)。⚠ 写宽了(如 run_bash 或 *)除上面那一问外照样整片免问,所有用自定义档的会话都生效。","approvalRules.allowPh":`web_fetch
293
- mcp__*`,"pill.thinkUnsupported":"(本模型不支持,将自动降档)","input.compact":"压缩上下文","input.compacting":"正在压缩上下文…","input.compactDone":"已压缩上下文(折叠 {n} 条消息为摘要,后续从此精简续接)","input.compactSkip":"无需压缩:{reason}","input.compactFail":"压缩失败:{e}","input.slash.compact":"压缩上下文:总结后精简续接","input.slash.voiceOn":"切到语音消息(该 Agent 回复变语音)","input.slash.voiceOff":"切回文字消息","input.slash.voiceOnHint":"已切到语音消息:该 Agent 之后的回复会以语音呈现(桌面语音条;微信端文字外附一份语音文件)。","input.slash.voiceOffHint":"已切回文字消息。","voice.play":"播放","voice.pause":"暂停","voice.label":"语音","voice.toText":"转文字","voice.toggleFailed":"语音模式切换失败:{e}","input.slash.stop":"停止当前运行","input.slash.skillUse":"本条消息使用技能 {name}","input.skillChipTitle":"本条消息将使用此技能","input.slash.agent":"选用 Normal Agent(自定义人格)","input.agentActive":"当前 Agent:{name}","input.agentCleared":"已取消 Normal Agent","input.engineDefault":"Tangu","input.engineChipTitle":"运行引擎","input.engineSection":"运行引擎","input.engineModelDefault":"用引擎默认","engine.pickTitle":"选择运行此对话的 Agent","engine.warming":"正在启动 {name}…","pill.more":"更多(翻页)","header.currentAgent":"当前 Agent","settings.tab.agentClis":"本机 Agent CLI","settings.agentClis.title":"外部 Agent CLI","settings.agentClis.hint":"检测到的第三方 Agent(Claude Code / Codex 等);可设默认模型。新会话开始时才能选用它们。","settings.agentClis.detected":"已检测到","settings.agentClis.needsSignin":"需登录","settings.agentClis.notDetected":"未检测到","settings.agentClis.notDetectedHint":"安装并登录该 Agent 后自动出现。","settings.agentClis.defaultModel":"默认模型","settings.agentClis.modelDefault":"(用引擎默认)","settings.agentClis.loadingModels":"加载模型…","settings.agentClis.empty":"无外部 Agent 引擎(仅本机形态可用)。","settings.agentClis.importHint":"导入后复制成 Tangu 自有技能/MCP(卸载该 CLI 也不丢);MCP 默认不启用,到 MCP 设置里开启。","settings.agentClis.skillsLabel":"已装技能","settings.agentClis.mcpLabel":"已装 MCP","settings.agentClis.importBtn":"导入","settings.agentClis.imported":"已导入","settings.tab.agents":"Agent","settings.agents.title":"Normal Agent(自定义人格)","settings.agents.hint":"为不同任务定义可复用的对话人格(system prompt + 模型 + 设置)。也可让 Agent 用 manage_agent 工具自创建。","settings.agents.new":"新建 Agent","settings.agents.createViaChat":"让 AI 帮我配置","settings.agents.createViaChatHint":"开一个新会话,用对话的方式让 Agent 帮你把新 Agent 建出来","settings.agents.empty":"暂无 Agent,点「新建 Agent」创建一个。","settings.agents.name":"名称","settings.agents.namePlaceholder":"如:代码审查员","settings.agents.desc":"简介","settings.agents.model":"模型(留空=用会话模型)","settings.agents.modelDefault":"(用会话模型)","settings.agents.systemPrompt":"开发指令(做什么 / 怎么做 / 必读什么)","settings.agents.systemPromptPlaceholder":"你是一位严谨的代码审查员……","settings.agents.thinking":"思考档位","settings.agents.maxIter":"最大循环轮数","settings.agents.approval":"审批档","settings.agents.inherit":"(继承)","settings.agents.byAgent":"Agent 创建","agent.badge.system":"后台","settings.agents.deleteConfirm":"删除 Agent「{name}」?","settings.agents.saveFail":"保存失败:{e}","settings.agents.cloudOnly":"Normal Agent 仅在本地(桌面/TUI)可用。","settings.agents.soul":"人格设定(SOUL)","settings.agents.soulPlaceholder":'沉静、专注;说话简洁,默认中文……(语气与价值观,区别于"做什么"的开发指令)',"settings.agents.shareMemory":"共用默认 Agent 的记忆和日志","settings.agents.shareMemoryHint":"开启后该 Agent 读写默认 Agent 的记忆/日志;默认关闭=有专属自己的记忆/日志。","settings.agents.cloudSync":"云同步(跨设备镜像)","settings.agents.cloudSyncHint":"开启后该 Agent 的全部文件(定义/记忆/日志/Library)在你的设备间完全镜像,新内容覆盖旧的;默认关闭=纯本地。","settings.agents.cloudSyncOn":"云同步:已开启","settings.agents.cloudSyncOff":"云同步:已关闭","settings.agents.activityAccess":"允许读取活动日志","settings.agents.activityAccessHint":"授权该 Agent 使用 read_activity 查看你的应用内操作记录;默认关闭=仅 Muse 可读。","settings.agents.toolPolicy":"工具黑白名单","settings.agents.toolPolicyNone":"不限制(全部可用)","settings.agents.toolPolicyDeny":"黑名单:取消勾选=禁用,引擎新增工具默认可用","settings.agents.toolPolicyAllow":"白名单:仅勾选的可用,引擎新增工具默认禁用","settings.agents.toolPolicyHint":"勾选=允许使用。仅约束下列常规工具;带权限门禁的工具(如 read_activity)不受名单影响。","settings.agents.toolPolicyEmpty":"工具目录不可用(需本地引擎在运行)。","settings.agents.avatar":"头像","settings.agents.avatarHint":"点击上传,≤1MB(PNG/JPG/GIF/WebP);存入该 Agent 的 Library。","settings.agents.avatarPick":"上传头像","settings.agents.avatarRemove":"删除头像","settings.agents.avatarTooLarge":"图片超过 1MB,请换更小的。","settings.agents.avatarSaveFirst":"请先保存 Agent,再设置头像。","settings.tab.shortcuts":"快捷键","settings.shortcuts.desc":"点击某条右侧的快捷键开始录制,按下组合键即设定;Esc 取消。同一组合键只会绑定到一个命令。","settings.shortcuts.commands":"命令与快捷键 · {count}","settings.shortcuts.searchPlaceholder":"搜索命令或快捷键","settings.shortcuts.resultCount":"显示 {count} 项","settings.shortcuts.noResults":"没有匹配的命令。","settings.shortcuts.commandPalette":"命令面板","settings.shortcuts.record":"点击录制快捷键","settings.shortcuts.recording":"按下组合键…","settings.shortcuts.reset":"恢复默认","settings.shortcuts.clear":"解绑","settings.shortcuts.unbound":"未设置","settings.shortcuts.resetAll":"全部恢复默认","settings.shortcuts.reassigned":"已从「{name}」解绑该快捷键","tool.verb.wrote":"写入","tool.verb.edited":"编辑","tool.verb.ran":"运行","tool.verb.read":"读取","tool.verb.listed":"列出","tool.verb.searched":"搜索","tool.verb.browsed":"浏览","tool.sum.wrote":"写入 {n} 文件","tool.sum.edited":"编辑 {n} 文件","tool.sum.ran":"运行 {n} 命令","tool.sum.read":"读取 {n} 项","tool.sum.searched":"搜索 {n} 次","tool.sum.browsed":"浏览 {n} 次","tool.sum.other":"{n} 个工具","settings.agents.isDefault":"默认","settings.agents.setDefault":"设为默认","settings.agents.viewMem":"查看大脑(记忆 / 日志 / 资料库)","settings.agents.brainSection":"大脑(记忆 / 日志 / 资料库)","settings.agents.brainSectionHint":"查看与编辑该 Agent 的长期记忆、按日日志和资料库文件。","settings.agents.openBrain":"打开大脑","settings.agents.memTitle":"{name} · Agent 大脑","settings.agents.memory":"长期记忆(MEMORY.md,可编辑)","settings.agents.memSaved":"已保存","settings.agents.log":"日志(LOG,可编辑)","settings.agents.noLog":"暂无日志","settings.agents.tabMemory":"记忆","settings.agents.tabLog":"日志","settings.agents.tabLibrary":"资料库","settings.agents.library":"资料库(Library/,参考资料 + 头像)","settings.agents.libraryEmpty":"暂无文件","settings.agents.libraryUpload":"上传文件","settings.agents.librarySelectHint":"点击文件查看 / 编辑","settings.agents.libraryBinaryHint":"二进制文件,仅预览","settings.agents.libraryDeleteConfirm":"删除文件「{name}」?","settings.agents.libraryTooLarge":"文件超过 5MB","settings.agents.userProfile":"用户画像(USER.md,所有 Agent 可见)","settings.agents.userProfileHint":"记录你的名字、偏好、水平、长期需求;所有 Agent 都会读到。","settings.agents.tabHarness":"进化史","settings.agents.harnessHint":"工作笔记是 Agent 从工作中自己总结的做法,写入要经审批(「完全放行」档除外),每次运行都会带上。","settings.agents.harnessEmpty":"还没有工作笔记。在该 Agent 的会话里输入 /refine 可让它复盘沉淀。","settings.agents.harnessEvidence":"证据:{text}","settings.agents.harnessKindNote":"笔记","settings.agents.harnessKindRecipe":"做法","settings.agents.harnessCount":"{count} / {max} 条工作笔记","settings.agents.harnessLastChange":"最近进化:{time}","settings.agents.harnessRefine":"复盘本次对话","settings.agents.harnessRefineSent":"已开始复盘,进度在对话里。","settings.agents.harnessShowAll":"显示全部 {count} 条","settings.agents.harnessLoading":"正在读取工作笔记…","settings.agents.harnessLocalOnly":"工作笔记仅在本机引擎可用。","settings.agents.harnessHistory":"编辑历史(本机)","settings.agents.harnessRollback":"撤销最近一次改动","settings.agents.harnessRestore":"恢复","settings.agents.harnessRollbackConfirm":"撤销「{title}」的最近一次改动?(再次撤销可还原)","settings.agents.harnessActCreate":"新建","settings.agents.harnessActUpdate":"修改","settings.agents.harnessActDelete":"删除","settings.agents.harnessActRollback":"回滚","settings.agents.harnessCandidates":"{count} 条待复盘候选","settings.agents.harnessCandidatesHint":"Historian 从过往会话里提名的做法。复盘时 Agent 会逐条审阅,采纳的写入工作笔记,其余丢弃。","settings.agents.selfAuthored":"自建","settings.agents.sharedSkill":"共享","agent.pickTitle":"选择 Agent","settings.tab.special":"后台 Agent","settings.special.title":"后台特殊 Agent(Special Agents)","settings.special.hint":"默认开启;手动关闭后不会被自动打开。不选模型时跟随云端默认;其记录隔离存于本地,不进会话列表。","settings.special.pickModelFirst":"请先选模型再开启","settings.special.followCloudDefault":"跟随云端默认({model})","settings.model.imageCloudDefaultTag":"云端默认","settings.model.imageFollowingDefault":"未手动选择,当前跟随云端生图默认:{model}。点击任一模型可改为手动指定,再点一次取消。","settings.special.model":"模型","settings.special.enable":"启用","settings.special.historian":"Historian(历史员)","settings.special.historianDesc":"每 X 轮总结会话标题;每 Y 轮判断并更新你的 LOG 与记忆。","settings.special.muse":"Muse(缪斯)","settings.special.museDesc":"后台常驻:按心跳、日程、规则醒来,在自己的 Library 里做事;越界操作按权限档处理,产出进收件箱和 Muse Space。","settings.special.h.rounds":"每几轮维护(标题+记忆)","settings.special.h.firstRound":"首轮必触发","settings.special.h.harnessCandidates":"自进化自动档","settings.special.h.harnessCandidatesHint":"判官额外提名「工作笔记候选」存入各 Agent 的收件箱;详情「进化」标签会显示待复盘数,正在看的会话有新提名时会弹通知。候选只在 /refine 复盘时经审批采纳,不会自动写入。","settings.special.h.prompt":"记忆判断提示词(留空=默认)","settings.special.m.maxIter":"每周期最多轮数","settings.special.m.maxTodos":"每窗口最多 TODO","settings.special.m.activeHours":"运行时段(本机时间)","settings.special.m.activeAllDay":"全天","settings.special.m.persona":"人格与指令在 Agent 名册的「Muse」里编辑。","settings.special.m.folders":"额外文件夹(每行一个绝对路径)","settings.special.m.foldersHintAsk":"审批 / 代批档:只是提示 Muse 去看这些目录,写入仍按权限档排队审批。","settings.special.m.foldersHintAuto":"全开档:这些目录可直接读写。","settings.special.m.secRhythm":"节奏","settings.special.m.budget":"预算","settings.special.m.budgetWindow":"预算窗口(小时)","settings.special.m.maxCycles":"每窗口最多周期","settings.special.h.mode":"工作模式","settings.special.h.modeIndependent":"独立","settings.special.h.modeAssist":"辅助","settings.special.h.modeFork":"分身","settings.special.h.modeHintIndependent":"Historian 用上方模型读取最近对话记录,自行判断并维护标题、摘要、日志与记忆。","settings.special.h.modeHintAssist":"到点后分支出一场简短的后台讨论,与该会话的 Agent 商议,由主 Agent 自己决定并写入;标题/摘要仍由 Historian 维护,首轮始终独立。","settings.special.h.modeHintFork":"用会话模型在完整上下文的尾部分叉一次补全来做判断——上下文缓存可命中,比独立模式看得更全;失败自动回落独立模式。上方模型仅用于回落判断与记忆整固。","settings.special.h.fallbackModel":"回落 / 整固模型","settings.special.saved":"已保存","settings.special.saveFail":"保存失败:{e}","settings.special.on":"启用","settings.special.off":"关闭","settings.special.custom":"自定义","settings.special.sectionTitle":"后台 Agent(Special Agents)","settings.agents.sectionTitle":"Normal Agent(自定义人格)","settings.agents.starterTemplate":"你是……(在此描述这个 Agent 的身份、专长与说话风格,以及它应如何完成任务)。","sidebar.special.title":"后台 Agent","special.action.title_updated":"更新标题","special.action.summary_updated":"更新摘要","special.action.log_appended":"写入日志","special.action.memory_appended":"写入记忆","special.action.memory_updated":"更新记忆","special.action.assist_discussion":"发起记忆讨论","special.muse.title":"Muse 工作区","special.muse.thinking":"当前思考","special.muse.idle":"Muse 空闲中","special.muse.running":"Muse 思考中…","special.muse.disabled":"Muse 未开启(在设置 → 后台 Agent 中开启并选模型)。","special.muse.todos":"Muse TODO 清单","special.muse.todosEmpty":"暂无 TODO。Muse 会在后台思考后提交高价值待办。","special.muse.selectAll":"全选","special.muse.inject":"注入所选到会话并运行","special.muse.pickSession":"选择目标会话…","special.muse.injected":"已注入 {n} 条到会话并开始运行","special.muse.dismiss":"忽略","special.muse.markDone":"标记完成","special.muse.injectFail":"注入失败:{e}","special.muse.watches":"盯任务","special.muse.watchesAll":"全部自动化 →","special.muse.watchesHint":"在任意聊天里说「帮我盯着 xxx.md 写满 100 字」即可设定;条件命中时 Muse 会被唤醒并提出待办。","special.muse.trigFile":"「{path}」达到 {n} 字","special.muse.trigEvent":"活动包含「{match}」","special.muse.trigDaily":"每天 {time}","special.muse.trigFired":"上次触发 {t}","special.muse.watchDelete":"删除规则","special.muse.approvals":"待批准","special.muse.approvalsEmpty":"没有等待你批准的操作。","special.muse.approve":"批准并执行","special.muse.reject":"拒绝","special.muse.approveFail":"批准失败:{e}","special.muse.approvalNote":"默认 Agent 代批意见:{note}","special.muse.runNew":"新会话执行所选","special.muse.injectPrefix":"请处理以下来自 Muse 的待办:","muse.lib.openEditor":"在编辑器中打开","special.muse.tracks":"追踪中","special.muse.tracksEmpty":"没有正在追踪的任务。在聊天里的任务卡上点「交给 Muse 追踪」即可添加。","special.muse.trackDelete":"停止追踪","special.muse.modeLabel":"权限档","special.muse.pending":"{n} 项待批","space.muse":"Muse","muse.builtinDesc":"Muse Space:Muse 自建的 Space(它自己写的 Forsion 插件,逐周期迭代),右栏批准它的越界操作;还没搭建时显示它的工作区。","view.museLibrary":"Muse 工作区","view.museHome":"Muse Space","muse.openLibrary":"打开 Muse 工作区","view.musePanel":"Muse","muse.lib.empty":"Muse 还没写任何东西。开启 Muse 后,它的笔记、草稿和每日工作日志会出现在这里。","muse.lib.refresh":"刷新","chat.task.here":"在此执行","chat.task.new":"新会话执行","chat.task.muse":"交给 Muse 追踪","chat.task.ignore":"忽略","chat.task.trackTag":"追踪","chat.task.tracked":"已交给 Muse 追踪(日历里可见)","chat.task.trackFail":"交给 Muse 失败:{e}","chat.task.doneHere":"已在此执行","chat.task.doneNew":"已在新会话执行","chat.task.doneMuse":"已交给 Muse 追踪","chat.task.doneIgnore":"已忽略","chat.task.showPrompt":"查看任务书","chat.task.hidePrompt":"收起任务书","chat.task.tooLong":"任务书超过 4000 字,无法交给 Muse 追踪;请拆小,或在此 / 新会话执行。","chat.task.museDo":"交给 Muse 执行","chat.task.doneMuseDo":"已交给 Muse 执行","chat.task.handedDo":"已交给 Muse:它下次运行时处理(受运行时段和预算限制),超出权限的操作会再请你审批","chat.task.museOff":"Muse 已关闭:先在设置里开启它,或改用新会话执行","chat.task.todoSyncFail":"待办状态没同步上:{e}","chat.task.doneTodo":"这条待办已经处理过了","chat.task.todoChecking":"正在确认这条待办的状态…","chat.task.todoCheckFail":"待办状态读取失败","chat.task.todoMissing":"这条待办已不存在","special.muse.actionFail":"操作失败:{e}","special.muse.execFailed":"已批准,但执行失败:{e}","settings.special.m.mode":"权限档","settings.special.m.modeAsk":"审批(越界操作排队等你批准)","settings.special.m.modeAgent":"代批(默认 Agent 替你裁决一次)","settings.special.m.modeAuto":"全开(完全自动)","settings.special.m.modeDesc":"三档都能在 Muse 自己的 Library 里自由工作;越界写入与命令按档位处理,插件安装始终需要你确认。","settings.special.m.heartbeat":"心跳间隔(分钟,0=只按日程/规则醒来)","settings.special.m.heartbeatHint":"比巡检更细时巡检自动跟着缩到这个粒度;实际次数仍受预算里「每窗口最多周期」封顶。","settings.special.m.notify":"通知","settings.special.m.notifyMode":"发送方式","settings.special.m.notifyImmediate":"即时","settings.special.m.notifyDigest":"日报","settings.special.m.escalateTo":"难活交给","settings.special.m.escalateNone":"不指定","settings.customProvider.fetchModels":"拉取模型","settings.customProvider.fetchEmpty":"未发现模型(端点未返回列表)","sidebar.search.placeholder":"搜索会话…","sidebar.search.noResults":"无匹配会话","sidebar.deleteConfirm":"永久删除会话「{name}」?此操作不可恢复。","chat.action.quote":"引用","chat.action.askInPanel":"在侧栏提问","chat.selection.actions":"选中文本操作","chat.error":"运行出错","chat.llmRetrying":"网络波动,{s} 秒后自动重试(第 {n}/{max} 次)","chat.err.network":"无法连接模型服务(网络不通或服务未启动)","chat.err.dropped":"连接中途断开(网络波动),回复未完成","chat.err.timeout":"请求超时,网络或模型响应过慢","chat.err.auth":"鉴权失败,请检查 API Key 或登录状态","chat.err.rate":"请求被限流,请稍后重试","chat.err.server":"模型服务端错误,请稍后重试","chat.err.quota":"AI 额度已用尽:点左下角头像可查看用量、使用重置卡立即恢复,或升级会员提高上限","chat.err.runCost":"本次运行成本达到上限,已自动停止","chat.err.inputTooLarge":"输入内容过长,超出模型可处理范围,请精简后重试","chat.err.groupAgents":"团队模式至少需要 2 个有效的 Agent","chat.err.orphaned":"运行意外中断(应用重启或进程退出),请重试","chat.err.engineRemote":"外部引擎不能从远程设备驱动,请回到那台电脑上继续这段对话","chat.edit.saveResend":"保存并重发","group.voting.inProgress":"正在投票…","workbench.chat":"对话","workbench.leftSidebar":"左侧栏","workbench.rightSidebar":"右侧栏","theme.changeSkin":"切换主题色","theme.changeMode":"切换明暗模式","theme.changeLanguage":"切换主题外观","command.palette":"命令面板 (⌘K)","command.toggleSmoothCaret":"开关丝滑光标","command.toggleLeft":"切换左侧栏","command.toggleRight":"切换右侧栏","command.toggleBottom":"切换底部面板","panel.emptyTitle":"空面板","panel.empty":"这个面板是空的,把标签页拖进来试试。","command.splitRight":"分屏到右侧","command.resetLayout":"恢复默认布局","command.stop":"停止当前运行","command.compact":"压缩上下文","command.branch":"从最近回复分支","command.saveLayout":"保存命名布局","command.applyLayout":"恢复命名布局","layout.namePrompt":"布局名称","layout.saved":"已保存布局「{name}」","layout.none":"还没有已保存的命名布局","layout.applyPrompt":"输入要恢复的布局名称:{names}","status.context":"上下文","header.connecting":"连接中…","command.placeholder":"运行命令…","command.empty":"没有命令","command.select":"选择","command.run":"运行","command.count":"{count} 条命令","group.host":"主持人","special.agents.title":"后台 Agent","special.memory.title":"记忆","sidebar.special.historianSub":"总结标题 · 维护记忆","sidebar.special.museSub":"后台思考 · 产出 TODO","sidebar.wechat.setConnectedOk":"已设为微信正在连接的会话。","sidebar.wechat.setConnectedFail":"设置失败:{e}","preview.close":"关闭","preview.expand":"展开","preview.collapse":"收起","preview.download":"下载","preview.notFound":"文件不存在","preview.loadFailed":"加载失败","preview.notAvailable":"此文件类型无法预览","preview.tooLarge":"文件过大({size}),不支持预览","preview.htmlPreview":"预览","view.wsfile":"文件预览","preview.openWithDefault":"用默认应用打开","preview.unsupportedAsk":"无法预览此类型,用系统默认应用打开?","preview.expired":"预览内容已过期(此类预览不随重启保留),请从来源重新打开","preview.mdEdit":"编辑","preview.openInAmadeus":"在 Amadeus 中打开","preview.mdConflict":"文件已被外部修改","preview.mdReload":"重新加载","preview.mdOverwrite":"覆盖写入","preview.mdSaveFail":"保存失败:{err}","preview.mdSalvaged":"文件已被外部修改,你的编辑已另存为「{file}」","panel.toast.invalidName":"非法的名字:{name}","panel.action.open":"打开","panel.action.newFile":"新建文件","panel.action.newFolder":"新建文件夹","panel.action.copyPath":"复制路径","preview.htmlCode":"源码","preview.reload":"重新加载","preview.openInBrowser":"在浏览器中打开(同一预览服务器,可用本人账号调 Forsion AI)","preview.csvTruncated":"仅显示前 {shown} 行(共 {total} 行)","preview.slide":"幻灯片 {n}","preview.wrap":"自动换行","preview.zoomIn":"放大","preview.zoomOut":"缩小","preview.fit":"适应","preview.diffSideBySide":"并排","preview.diffLineByLine":"逐行","preview.pdfPages":"仅渲染前 {n} 页(共 {total} 页),下载查看全部","panel.action.preview":"预览","panel.action.deleteN":"删除 {n} 项","panel.confirm.trashN":"把选中的 {n} 项移到回收站?","panel.confirm.delete":"删除「{name}」?","panel.confirm.deleteN":"删除选中的 {n} 个文件?","panel.toast.copied":"已复制 {n} 项到工作区","panel.toast.copyFail":"复制失败:{err}","panel.toast.moveFail":"移动失败:{err}","settings.tab.notifications":"通知","settings.tab.statusbar":"状态栏","ntf.enable":"启用通知","ntf.delivery":"通知方式","ntf.enableHint":"右上角弹出的悬浮小卡片;关闭后所有通知静默(错误也不弹)。","ntf.osEnable":"系统通知","ntf.osEnableHint":"应用切到后台时,同步弹一条系统通知(所有通知类型,不止收件箱)。","ntf.sendTest":"发送测试通知","ntf.testBody":"这是一条测试通知 👋","ntf.events":"通知事件","ntf.eventsHint":"只保留需要关注的事件,减少无效打扰。","ntf.event.system":"系统消息","ntf.event.syncError":"同步失败 / 冲突","ntf.event.syncDone":"远程同步完成","ntf.event.syncDoneOnline":"在线同步完成","ntf.event.agentDone":"后台会话完成","ntf.event.inbox":"收件箱新消息","ntf.event.noteReminder":"笔记提醒(@remind:)","ntf.event.harnessCandidates":"工作笔记候选提名","ntf.pluginEvents":"插件通知","ntf.pluginEventsHint":"每个插件一个开关(ctx.notify 的来源;关掉即静音该插件)。","ntf.view":"查看","ntf.syncError":"在线同步失败:{e}","ipcerr.notLoggedIn":"未登录 Forsion 账号","ipcerr.loginExpired":"登录已失效,请重新登录 Forsion 账号","ipcerr.vaultMissing":"智库目录不存在:{detail}","ipcerr.mirrorMissing":"镜像目录不存在(已有同步记录,不会自动新建空目录):{detail}","ipcerr.scanFailed":"本地目录读取失败,本轮不推断删除:{detail}","ipcerr.invalidSpaceId":"非法的 Space 标识","ipcerr.invalidPluginId":"非法的插件标识","ipcerr.notUserPlugin":"插件不在用户目录(内置 / 首方插件不可卸载)","ipcerr.pluginNotFound":"插件不存在","ipcerr.mcpNameReserved":"MCP 服务名「{detail}」是保留名:dev 与 dev_ 开头的名字留给设备工具,请换一个名字","settings.discovery.mcpReserved":"未导入 {names}:dev 与 dev_ 开头的 MCP 服务名留给设备工具。换个名字后可在 MCP 页手动添加。","ntf.syncDone":"在线同步完成","ntf.noteReminder":"提醒 · {src}","ntf.remoteSyncDone":"远程同步完成:{n} 项变更","ntf.remoteSyncFail":"远程同步失败:{e}","ntf.remoteSyncConflicts":"远程同步冲突:{n} 项待处理","ntf.remoteSyncPendingDel":"远程同步:{n} 项删除待确认","ntf.actionReview":"去处理","ntf.agentDone":"「{name}」已完成","ntf.agentFail":"「{name}」运行失败","ntf.harnessCandidates":"「{name}」有新的工作笔记候选,复盘一下?","ntf.actionRefine":"复盘","sb.enable":"显示状态栏","sb.display":"显示方式","sb.enableHint":"窗口底部一条细栏,按当前视图显示同步 / 反链 / 字数等信息。默认关闭;同步出错时会临时出现,只显示同步状态。","sb.items":"状态栏","sb.itemsHint":"取消勾选即隐藏;拖动调整顺序(插件项启用后自动出现在列表里)。","sb.side.left":"前","sb.side.right":"后","sb.item.space":"当前 Space","sb.item.agentRunning":"运行中的会话","sb.item.sync":"同步状态","sb.item.backlinks":"反向链接","sb.item.wordCount":"字数统计","sb.item.inbox":"收件箱未读","sb.agentRunning":"{n} 个运行中","sb.synced":"已同步","sb.syncing":"同步中 · {n}","sb.syncingPlain":"同步中…","sb.syncProgress":"同步 {done}/{total}","sb.syncError":"同步异常","sb.syncOffline":"离线","sb.chars":"{n} 字","sb.backlinks":"{n} 反链","amadeus.default.note":"未命名","amadeus.default.dashboard":"未命名仪表盘","amadeus.default.drawing":"未命名白板","amadeus.default.database":"未命名多维表","amadeus.default.folder":"新文件夹","amadeus.default.section":"新分区","amadeus.default.pdfBookmark":"第 {page} 页","amadeus.new.note":"新建笔记","amadeus.new.childNote":"新建子笔记","amadeus.new.dashboard":"新建仪表盘","amadeus.new.dashboardIn":"在「{folder}」中新建仪表盘","amadeus.new.drawing":"新建白板","amadeus.new.drawingIn":"在「{folder}」中新建白板","amadeus.new.folder":"新建文件夹","amadeus.new.folderIn":"在「{folder}」中新建文件夹","amadeus.new.database":"新建 Base","amadeus.new.databaseIn":"在「{folder}」中新建 Base","amadeus.exists":"「{name}」已存在","amadeus.cmd.quickSwitch":"快速切换笔记","amadeus.cmd.search":"搜索笔记(全文)","amadeus.cmd.tutorial":"打开使用教程","amadeus.cmd.manual":"打开使用手册","amadeus.cmd.dailyNote":"打开今天的日记","amadeus.cmd.toggleStar":"收藏 / 取消收藏当前笔记","amadeus.cmd.toggleSource":"切换 源码 / 可视 编辑","amadeus.cmd.openVault":"打开智库…","amadeus.cmd.reveal":"在文件管理器中显示当前笔记","amadeus.cmd.reindex":"重建全文索引","amadeus.cmd.toggleWikiFiles":"切换 双链补全是否包含附件与多维表","amadeus.cmd.wikiFilesOn":"双链补全已包含附件与多维表","amadeus.cmd.wikiFilesOff":"双链补全只包含笔记"},ld={"common.save":"Save","chat.wait.sending":"Sending context ({kb} KB)","chat.wait.firstToken":"Waiting for the model","chat.wait.elapsed":"{s}s elapsed","settings.python.label":"Python","settings.python.bundled":"Bundled (recommended)","settings.python.system":"System","settings.python.hint":"Bundled: no install, isolated from your own Python. System: use your installed python (restart backend to apply).","settings.mirror.label":"Network mirror","settings.mirror.toggle":"Use China mainland mirrors","settings.mirror.recommend":"Your system locale suggests mainland China — enabling mirrors is recommended for faster downloads.","settings.mirror.hint":"When on, guided installs, pip installs, agent-run npx/git and market downloads use domestic mirrors (Tsinghua/npmmirror/multi-proxy GitHub). Env vars are injected only into commands Forsion spawns — no system config files are modified; turn off anytime. pip/npm/git parts require managed backend mode.","settings.mirror.test":"Test connection","settings.mirror.unreachable":"unreachable","settings.test.canceled":"Canceled","settings.test.timeout":"✗ Connection timed out","onboarding.env.mirrorLabel":"Network","onboarding.env.recheck":"Re-check","onboarding.env.installOk":"{tool} installed · {version}","onboarding.env.installedButMissing":'Command finished, but {tool} is still not detected. A restart of the app or a new terminal may be required — or hit "Re-check".',"onboarding.env.installFail":"{tool} install failed (exit {code}) — check the log below.","onboarding.env.pythonBundled":"Python is bundled — no separate install needed.","onboarding.env.copyCmd":"Copy command","onboarding.env.copied":"⤷ Copied — paste and run it in Terminal (requires your password): {command}","sidebar.newChat":"New session","sidebar.memory":"Memory","sidebar.agents":"Background agents","sidebar.viewMore":"View more","tip.folder":"{files} files, {folders} folders","tip.sessions":"{count} sessions","tip.modified":"Modified: {t}","tip.created":"Created: {t}","input.project.label":"Project","input.project.none":"No project","input.project.dontWork":"Don’t work in a project","input.project.search":"Search projects","input.project.noMatches":"No matching projects","input.project.add":"Add local project","input.project.addCloud":"New cloud project","input.project.cloudName":"Project name, Enter to create","app.amadeusWorkspace":"Amadeus · {name}","app.createProjectFail":"Failed to create project: {e}","ws.detail.count":"{n} sessions","ws.detail.newChat":"New session in this project","ws.detail.empty":"No sessions in this project yet","ws.detail.viewMore":"View more","agents.detail.title":"Background agents","agents.detail.settings":"Settings","agents.detail.historian":"Historian activity","agents.detail.noActivity":"No activity yet","settings.advanced.sessionLimit":"Sessions shown per project in sidebar","settings.mcpServer.label":"External MCP endpoint (for other agents)","settings.mcpServer.hint":"When on, a local HTTP MCP endpoint runs on this machine so external agents (Claude Code / Codex / OpenCode, etc.) can call Forsion Desktop capabilities (currently: send to inbox). Listens on 127.0.0.1 only, token-authenticated.","settings.mcpServer.enable":"Expose to external agents (Claude Code / Codex / OpenCode, etc.)","settings.mcpServer.connectHint":"Pick your agent and copy the config to connect (token embedded):","settings.mcpServer.endpoint":"Endpoint","settings.mcpServer.generic":"Generic JSON","settings.mcpServer.genericNote":"Any Streamable HTTP MCP client (Cursor / Windsurf / Cline, etc.) works with the Generic config — url + Authorization header.","settings.mcpServer.copy":"Copy","settings.mcpServer.notRunning":"Endpoint failed to start. Check logs or restart the app.","common.cancel":"Cancel","common.retry":"Retry","chat.action.copy":"Copy","chat.you":"You","workbench.noSession":"Select or start a session to view","workbench.sessions":"Sessions","space.home":"Home","space.tangu":"Tangu","space.amadeus":"Note","space.calendar":"Calendar","view.todo":"To-do list","view.calendar":"Calendar","view.calendarConfig":"Calendar settings","view.db":"Database","view.drawing":"Whiteboard","space.coding":"Coding Studio","view.codeStudio":"Coding Studio","space.artificial":"Creations","view.artificial":"Creations","view.product":"Creation","space.public":"Publish","view.publicHub":"Published","public.title":"Published","public.subtitle":"Manage your published sites and notes in one place","public.needLogin":"Sign in to Forsion to see your published content","public.refresh":"Refresh","public.empty":"Nothing yet","public.open":"Open","public.copy":"Copy link","public.copied":"Copied","public.unpublish":"Unpublish","public.revoke":"Revoke","public.confirm":"Confirm?","public.sites":"My sites","public.sitesDesc":"Web apps hosted by Forsion Connect","public.published":"Published notes","public.publishedDesc":"Public read-only share links","public.shared":"Shared notes","public.sharedDesc":"Pages you invited others to edit / view","public.disabled":"Disabled","public.unavailable":"Not available in this environment","coding.code":"Code","coding.preview":"Preview","coding.reload":"Reload preview","coding.noEntry":"No entry page","coding.noFile":"No file selected","coding.pickFile":"Pick a file from the tree on the right to edit","coding.emptyPreview":"Nothing to preview yet. Ask the Coding Agent on the left to generate an index.html.","coding.projects":"Projects","coding.newProject":"New project","coding.publish":"Publish","coding.publishTitle":"Publish to Forsion","coding.publishDesc":"Publish this web app as a public link. Inside the app, window.forsion gives access to Forsion AI — visitors sign in with their own Forsion account and spend their own quota.","coding.publishName":"App name","coding.publishSlug":"Link slug","coding.publishSlugHint":"3-32 chars: lowercase letters / digits / hyphens","coding.publishEntry":"Entry page","coding.publishSlots":"Published {used}/{limit} ({tier})","coding.publishBtn":"Publish","coding.publishUpdate":"Update","coding.publishing":"Publishing…","coding.unpublish":"Unpublish","coding.unpublishConfirm":"Confirm unpublish?","coding.publishNeedLogin":"Publishing requires a Forsion account","coding.loginNow":"Sign in to Forsion","coding.loginWaiting":"Waiting for browser authorization…","coding.copyLink":"Copy link","coding.copied":"Copied","coding.openLink":"Open","coding.publishHint":"Use relative paths for assets; .ts/.tsx are transpiled on publish, no build step.","coding.publishNoEntry":"No .html entry in this project yet — generate a page first.","coding.listingTitle":"App market","coding.listingHint":'Listed apps appear publicly under "Web Apps" in the market after platform review.',"coding.listingNone":"Not listed","coding.listingPending":"In review","coding.listingApproved":"Listed","coding.listingRejected":"Rejected","coding.listingNoteLabel":"Reason: {note}","coding.listingApply":"Apply to list","coding.listingReapply":"Re-apply","coding.listingWithdraw":"Withdraw","coding.listingDelist":"Delist","coding.listingSummaryPh":"One sentence about this app (shown on the market card after review, ≤300 chars)","coding.listingSubmit":"Submit","coding.termsTitle":"Publish as a public page","coding.termsIntro":"Once published, anyone with the link can view this page, and it may be shared or indexed by search engines. Please confirm:","coding.termsLi1":"You have the right to publish all text, images, audio, video, and other content on the page;","coding.termsLi2":"The page contains no illegal information, infringing content, or personal information disclosed without permission;","coding.termsLi3":"You take responsibility for the content you publish.","coding.termsManage":"The platform manages public content per applicable laws and the Content Publishing Guidelines, and may restrict access to, stop displaying, or remove violating content.","coding.termsAgreePre":"I have read and agree to the ","coding.termsGuidelines":"Content Publishing Guidelines","coding.termsConfirm":"Confirm & publish","coding.cancel":"Cancel","coding.projectName":"Project name","coding.create":"Create","coding.noProjects":'No projects yet. Click "New project" to create your first one.',"coding.switchProject":"Switch project","coding.generating":"Generating…","space.inbox":"Inbox","inbox.list":"Messages","inbox.reader":"Message","inbox.filter.unread":"Unread","inbox.filter.archived":"Archived","inbox.source.forsion":"Forsion","inbox.source.automation":"Automations","inbox.source.agents":"Agents","inbox.reader.empty":"Select a message to read","inbox.sender.system":"System","inbox.sender.automation":"Automation","inbox.action.markRead":"Mark as read","inbox.action.markUnread":"Mark as unread","inbox.action.readAll":"Mark all read","inbox.action.archive":"Archive","inbox.action.unarchive":"Unarchive","inbox.action.delete":"Delete","inbox.action.refresh":"Check for new","inbox.action.chat":"Chat with {name}","inbox.deleteConfirm":'Delete "{title}"?',"time.justNow":"just now","inbox.pullOk":"Pulled {n} new messages","inbox.pullNone":"No new messages","inbox.opFail":"Operation failed: {e}","inbox.attach.title":"Attached items","inbox.attach.claim":"Claim","inbox.approval.title":"Approval request","inbox.approval.loading":"Loading the approval record…","inbox.approval.missing":"This approval record was not found (it may have expired or been cleaned up)","inbox.approval.approved":"Approved and executed","inbox.approval.rejected":"Rejected","inbox.approval.executing":"Executing…","inbox.approval.failed":"Approved, but the run failed","inbox.approval.loadFail":"Could not load the approval record","inbox.approval.retry":"Retry","inbox.approval.reason.customAsk":"Required by your approval rules","inbox.approval.reason.rule":'Approval rule "{rule}"',"inbox.approval.reason.escalate":"Writes outside the workspace","inbox.approval.reason.mode":"Required by the approval mode","inbox.approval.reason.control":"Sets up unattended work","inbox.attach.claiming":"Claiming…","inbox.attach.claimed":"Claimed","inbox.attach.expired":"Expired — cannot claim","inbox.claim.ok":"Claimed — items added to your account","inbox.claim.already":"Already claimed before","inbox.claim.fail":"Claim failed","inbox.claim.unmet":"Requirements not met, so this reward cannot be claimed yet","inbox.attach.unmet":"Requirements not met","inbox.req.title":"Requirements","inbox.req.version":"App {v} or later","inbox.req.tiers":"{tiers} plan","inbox.req.currentVersion":"Current version {v}","inbox.req.currentTier":"Current: {tier}","inbox.req.other":"Other requirements (checked when you claim)","inbox.feedback.title":"Feedback thread","inbox.feedback.event.created":"New user feedback","inbox.feedback.event.user_reply":"A user replied to feedback","inbox.feedback.event.admin_reply":"Your feedback got a reply","inbox.feedback.loading":"Loading feedback thread…","inbox.feedback.loadFail":"Could not load the feedback thread","inbox.feedback.signIn":"Sign in to your Forsion account to view and reply","inbox.feedback.missing":"This feedback ticket no longer exists","inbox.feedback.retry":"Retry","inbox.feedback.you":"You","inbox.feedback.support":"Forsion support","inbox.feedback.user":"User","inbox.feedback.replyPh":"Write a reply…","inbox.feedback.attach":"Add attachment","inbox.feedback.attachHint":"Images, text or JSON, up to 5MB each, 5 files max","inbox.feedback.remove":"Remove","inbox.feedback.send":"Send","inbox.feedback.sending":"Sending…","inbox.feedback.sendFail":"Send failed: {e}","inbox.feedback.tooMany":"At most 5 attachments","inbox.feedback.tooBig":"{name} exceeds 5MB or is empty","inbox.feedback.badType":"{name} is not a supported type (images, text or JSON only)","inbox.feedback.download":"Download","inbox.feedback.status.open":"Open","inbox.feedback.status.in_progress":"In progress","inbox.feedback.status.resolved":"Resolved","inbox.feedback.status.closed":"Closed","inbox.tier.free":"Free","inbox.tier.plus":"Plus","inbox.tier.pro":"Pro","inbox.expiresAt":"Valid until {d}","inbox.expired":"Expired","settings.inbox.title":"Inbox","settings.inbox.notifyLabel":"System notifications for new messages","settings.inbox.notifyHint":"Notify when new messages arrive (click jumps to Inbox); badges stay on when off.","amadeus.pages":"Vault","amadeus.editor":"Editor","amadeus.outline":"Outline","amadeus.backlinks":"Backlinks","amadeus.search":"Search","amadeus.tags":"Tags","amadeus.graph":"Graph","chat.action.copied":"Copied","chat.action.edit":"Edit","chat.action.resend":"Send","chat.action.regenerate":"Regenerate","chat.action.branch":"Branch from here","chat.branchTitle":"{title} (branch)","chat.branchEmpty":"No AI reply to branch from yet","chat.branched":"Branched into a new session (history inherited)","input.slash.branch":"Branch a new session from the latest reply (inherits history)","app.branchFail":"Branch failed: {e}","sidebar.ws.menu":"Project actions","sidebar.ws.rename":"Rename project","sidebar.ws.remove":"Remove project","app.truncateFail":"Failed to truncate messages: {e}","search.jumpOutOfWindow":"The matched message is further back in history — opened the chat but could not scroll to it","rewind.busy":"Cannot rewind while a run is in progress — stop it first","rewind.noTime":"This message has no timestamp, so there is no point to rewind to","rewind.codeDone":"Code rewound ({n} file(s))","rewind.codePartial":"{bad} file(s) failed to rewind — aborted (conversation untouched)","rewind.codeSkipped":"Code rewound for {n} file(s); {bad} had no snapshot and cannot be restored","rewind.codeConflict":"Code rewound for {n} file(s); {kept} changed since then were kept as-is (not deleted)","inquiry.sendFail":"Answer was not delivered: {e} — please retry","rewind.codeFail":"Failed to rewind code: {e}","app.resendFailed":"Resend failed; restored locally — please retry.","app.regenNoUser":"No user message to regenerate from","app.wsRenameFail":"Failed to rename project: {e}","app.moveToProjectFail":"Could not move the conversation into the creation folder: {e}","app.moveToProjectHalf":"This conversation was only partly moved: its project is now “{name}”, but its working folder was not changed ({e}).","app.sessionMoving":"This conversation is being moved into the creation folder. Send again in a moment.","app.wsRemoveFail":"Failed to remove project: {e}","app.wsRemoved":'Project "{name}" removed',"app.wsTrashFail":"The sessions were deleted, but the .tangu folder could not be moved to the Trash: {e}","app.agentTrashFail":"The agent was deleted, but its files could not be moved to the Trash; they are still in {path}","app.sessionExpired":"Session expired — please sign in to your Forsion account again","onboarding.connect.cloudSync":"Enable cloud sync (sync cloud Agents)","onboarding.connect.cloudSyncHint":"When on, your memory, logs and Agents marked for cloud sync stay in sync across your signed-in devices. You can change this later in Settings → Forsion account.","common.confirm":"OK","extendView.close":"Close extension","extendView.failed":"Extension failed to load","extendView.back":"Back","common.close":"Close","common.back":"Back","common.refresh":"Refresh","common.loading":"Loading…","common.listSep":", ","common.delete":"Delete","common.edit":"Edit","common.open":"Open","common.language":"Language","common.copyCode":"Copy code","common.enabled":"Enabled","common.disabled":"Disabled","locale.zh":"中文","locale.en":"English","locale.toggleTitle":"Switch language","feedback.title":"Feedback","achievements.title":"Achievements","achievements.unlocked":"Achievement unlocked","achievements.claim":"Claim","achievements.claimed":"Claimed","achievements.pts":"{n} pts","achievements.seriesPts":"{n}/{total} pts","achievements.pluginGroup":"Plugins","achievements.medal.bronze":"Bronze","achievements.medal.silver":"Silver","achievements.medal.gold":"Gold","achievements.s.starter":"First Steps","achievements.s.chat":"Conversation","achievements.s.notes":"Notes","achievements.s.agents":"Agents","achievements.a.first-login.title":"Forsion is All You Need","achievements.a.first-login.desc":"Sign in to your Forsion account","achievements.a.theme-change.title":"Fresh Coat","achievements.a.theme-change.desc":"Switch the theme or color scheme once","achievements.a.market-install.title":"Gear Up","achievements.a.market-install.desc":"Install an item from the market","achievements.a.space-save.title":"Power of Space","achievements.a.space-save.desc":"Save the current layout as a Space","achievements.a.first-message.title":"Hello Agent!","achievements.a.first-message.desc":"Send your first message to an agent","achievements.a.chat-10.title":"Talkative","achievements.a.chat-10.desc":"Send 10 messages in total","achievements.a.chat-100.title":"Unstoppable","achievements.a.chat-100.desc":"Send 100 messages in total","achievements.a.group-chat.title":"Round Table","achievements.a.group-chat.desc":"Start a team","achievements.a.first-note.title":"Blooming Ink","achievements.a.first-note.desc":"Create your first note","achievements.a.notes-10.title":"Diligent Writer","achievements.a.notes-10.desc":"Create 10 notes in total","achievements.a.notes-100.title":"Prolific Author","achievements.a.notes-100.desc":"Create 100 notes in total","achievements.a.first-base.title":"Data Sprout","achievements.a.first-base.desc":"Create your first Base","achievements.a.first-agent.title":"Creator","achievements.a.first-agent.desc":"Create your first agent","achievements.a.agents-3.title":"Think Tank","achievements.a.agents-3.desc":"Create 3 agents in total","achievements.a.special-agent.title":"Behind the Scenes","achievements.a.special-agent.desc":"Enable Muse or Historian","achievements.a.first-image.title":"Picture This","achievements.a.first-image.desc":"Have an agent generate an image","achievements.a.debug-toast.title":"You Found This?!","achievements.a.debug-toast.desc":"??????","settings.developer.achToastLabel":"Achievement toast","settings.developer.achToast":"Fire achievement toast","settings.developer.achToastHint":"Debug the unlock animation, repeatable; secretly an achievement itself (reward granted once).","settings.developer.activityLabel":"Activity log","settings.developer.activityExport":"Export activity log","settings.developer.activityEnable":"Record in-app activity","settings.developer.activityHint":"Locally journals your actions (new chats, note edits, tasks…) so the background agent Muse understands what you are doing; stored only in the local activity folder, kept 30 days. Export to troubleshoot issues.","settings.developer.activityViewCmd":"Activity log live view command","settings.developer.activityViewCmdHint":'Adds an "Open activity log" entry to the command palette (⌘K): a main-area tab tailing the activity journal in real time (2s refresh, filter/pause).',"command.openActivityLog":"Open activity log","view.activityLog":"Activity log","activityView.filter":"Filter (substring)…","activityView.pause":"Pause","activityView.resume":"Resume","activityView.count":"{n} lines","activityView.empty":'No activity recorded yet. Make sure "Record in-app activity" is enabled in developer options, then do something.',"command.openActiveWindow":"Active window sampling","view.activeWindow":"Active window","activeWindowView.on":"Seam enabled","activeWindowView.off":"Seam disabled","activeWindowView.offHint":'Active-window sampling is off by default. Turn on "Active window sampling" in Settings → Developer options and the app you are focused on will show up here live.',"activeWindowView.noSample":"Enabled, but no active window could be read. Wayland sessions cannot report it (same ceiling as ActivityWatch); X11 needs xprop.","activeWindowView.noTitle":"(not available on this platform: window titles on macOS require Screen Recording)","activeWindowView.idleMark":"idle","activeWindowView.clear":"Clear","activeWindowView.segEmpty":"Sampling. Switch to another app for a moment and come back — folded focus segments will appear below (idle ones greyed out).","space.automation":"Automation","view.automationList":"Automations","view.automationDetail":"Automation detail","view.automationRuns":"Run history","automation.group.system":"System automations","automation.group.watches":"Watch rules","automation.group.buttons":"Buttons","automation.group.schedules":"Agent schedules","automation.group.finished":"Finished ({n})","automation.finished":"Finished","automation.finishedHint":"One-off, time has passed — edit to reschedule","automation.fact.status":"Status: ","automation.schedule.every":"every {ivl}","automation.schedule.once":"one-off","automation.fact.desc":"Notes:","automation.sched.name":"Name","automation.sched.date":"Date","automation.sched.dateHint":"YYYY-MM-DD or YYYY-MM-DDTHH:mm, optional /end","automation.sched.repeat":"Repeat","automation.sched.repeatHint":"Empty = one-off; e.g. 24h / 7d, rolling from the anchor","automation.builder.expiredReset":"Original time has passed — reset to the next hour; saving reschedules and re-enables.","automation.builder.atPast":"The one-time datetime has passed — pick a new time.","automation.muse.title":"Muse patrol","automation.muse.trigger":"Patrols every {min} min","automation.muse.action":"Thinks about what to do for you → creates TODOs","automation.historian.title":"Historian memory upkeep","automation.historian.trigger":"After every {n} rounds","automation.historian.action":"Summarizes sessions, maintains logs & memory","automation.watches.empty":'No watch rules yet — create one below, or just ask in chat ("keep an eye on…").',"automation.enabled":"Enabled (click to disable)","automation.disabled":"Disabled (click to enable)","automation.new":"New automation","automation.cond.daily":"Daily at {time}","automation.cond.event":'Activity contains "{match}"',"automation.cond.file":"{path} reaches {n} chars","automation.cond.at":"Once · {time}","automation.cond.every":"Every {ivl}","automation.cond.manual":"Manual · button","automation.cond.dbRow":"Row added to {path}","automation.cond.dbCell":"Cell changed in {path}","automation.cond.dbWhereN":"{n} condition(s)","automation.nextRun":"next {time}","automation.detail.empty":"Select an automation on the left","automation.detail.latest":"Latest run","automation.detail.recent":"Recent activity","automation.deepConfig":"Configure","automation.fact.trigger":"Trigger:","automation.fact.action":"Action:","automation.fact.actions":"Steps:","automation.fact.runner":"Runs:","automation.fact.prompt":"Prompt:","automation.fact.cooldown":"Cooldown:","automation.fact.where":"Conditions:","automation.fact.columns":"Watched columns:","automation.fact.noCooldown":"none (0h)","automation.fact.disabledReason":"Auto-disabled by the engine: {reason}","automation.fact.lastRun":"Last run:","automation.fact.nextRun":"Next run:","automation.fire.btn":"Test run","automation.fire.hint":"Execute the action chain once now (does not affect the normal schedule)","automation.fire.ok":"Test run finished ({status})","automation.fire.fail":"Test run failed ({status})","automation.exec.manual":"test","automation.exec.steps":"{n} step(s)","automation.step.notify":"Notify","automation.step.agent_run":"Run agent","automation.step.db_row_add":"Add table row","automation.step.db_row_edit":"Edit table row","automation.step.tool_call":"Run tool","automation.transcript.empty":"No runs yet","automation.transcript.trigger":"Trigger input","automation.transcript.agent":"Agent","automation.transcript.tools":"{n} tool calls","automation.trigger.neverFired":"Not fired yet — runs will appear here once it does","automation.trigger.museNote":"This rule wakes Muse; see its runs under","automation.runs.empty":"No records","automation.runs.pick":"Select an automation to see its runs here","automation.builder.title":"New automation","automation.builder.editTitle":"Edit automation","automation.builder.trigger":"Trigger","automation.builder.desc":"Name","automation.builder.descPh":"Describe this automation in one line","automation.builder.condType":"Trigger type","automation.builder.condTimer":"Timer","automation.builder.condEvent":"Event","automation.builder.condFile":"File threshold","automation.builder.condManual":"Manual (button)","automation.builder.condDb":"Database","automation.builder.manualHint":"Never fires on its own. Insert a Button block in a note, point it at this rule, and click to run it.","automation.builder.unsupported":"This rule uses an action type this builder does not understand yet. Edit it via manage_automation in chat — saving here would silently drop that part, so editing is disabled.","automation.builder.dbPath":"Which database (.db)","automation.builder.dbPickDb":"Pick a database…","automation.builder.dbEvent":"Event","automation.builder.dbEventRow":"Row added","automation.builder.dbEventCell":"Cell changed","automation.builder.dbColumn":"Watched columns","automation.builder.dbColumnsHint":"With several columns checked, a change in any of them fires; “new value equals” is compared on the column that changed.","automation.builder.dbPickCol":"Pick a column…","automation.builder.dbColsLoading":"Loading table…","automation.builder.dbEquals":"And new value equals (optional)","automation.builder.dbEqualsPh":"Leave empty to fire on any change","automation.builder.dbHint":"The engine detects changes by cursor comparison after each save; the rule is pinned to the vault it was created in.","automation.builder.dbRowId":"Row id","automation.builder.dbRowIdPh":"Leave empty = the row that fired the trigger","automation.builder.dbRowIdRequired":"Required (this trigger type has no “triggering row” to default to)","automation.builder.dbCells":"Fields to write","automation.builder.dbCellKey":"Column name or id","automation.builder.dbCellVal":"Value ({{row.Column}} templates allowed)","automation.builder.dbCellAdd":"Add field","automation.builder.dbCellsHint":"With a database trigger, {{row.Column}} in values is replaced from the triggering row.","automation.builder.dbCellValPh":"{{= {target.qty} - {row.out_qty} }}","automation.builder.dbWhere":"Extra conditions (optional)","automation.builder.dbWhereAdd":"Add condition","automation.builder.dbWhereOpEq":"equals","automation.builder.dbWhereOpNe":"not equals","automation.builder.dbWhereOpEmpty":"is empty","automation.builder.dbWhereOpNotEmpty":"is not empty","automation.builder.dbWhereValPh":"value","automation.builder.dbWhereHint":"ANDed with the condition above; compared against the materialised row, so formula/lookup columns work too; up to 10.","automation.builder.dbRowFrom":"Target rows via relation column (optional)","automation.builder.dbRowFromPh":"A relation column (name or id) of the triggering table; empty = use the row id above","automation.builder.dbMatch":"Match rows by column value (optional)","automation.builder.dbMatchValPh":"value, {{row.id}} templates allowed","automation.builder.dbTargetHint":"Target precedence: row id > relation column > column match > the triggering row.","automation.builder.dbSkipIfEmpty":"Skip when this field is empty (optional)","automation.builder.dbSkipIfEmptyPh":"One of the column names/ids above","automation.builder.cooldownDbHint":"Pure action chains on a database trigger may use 0 = no cooldown (needed for chained rules)","automation.builder.dbNoteView":"That is a note-view database (rows come from notes in a folder) — automations only work on classic tables, pick another.","automation.builder.timerMode":"Timer mode","automation.builder.timerDaily":"Daily","automation.builder.timerOnce":"Once","automation.builder.timerEvery":"Interval","automation.builder.time":"Time of day","automation.builder.datetime":"Fire at","automation.builder.onceHint":"Runs once, then disables itself (stays in the list; reschedule + enable to reuse).","automation.builder.interval":"Repeat every","automation.builder.everyHint":"Rolls from creation time; only the most recent miss is caught up. Min 1h with agent steps.","automation.builder.unitM":"minutes","automation.builder.unitH":"hours","automation.builder.unitD":"days","automation.builder.match":"Activity match text","automation.builder.matchPh":"e.g. note.edit, a file name, or a plugin: event","automation.builder.matchHint":"Substring match on new activity lines. Watch plugin events (plugin:<id>:<event>) or run.done agent=xx.","automation.builder.path":"File path (absolute or ~ prefixed)","automation.builder.chars":"Non-whitespace characters","automation.builder.stepN":"Step {n}","automation.builder.moveUp":"Move up","automation.builder.moveDown":"Move down","automation.builder.notifyTitle":"Notification title","automation.builder.notifyTitlePh":"Inbox message title","automation.builder.notifyBody":"Body (optional)","automation.builder.notifyHint":"Delivered straight to your inbox (0 tokens); pushed to connected channels (WeChat/TG…).","automation.builder.runner":"Runner","automation.builder.runnerPick":"Pick an agent…","automation.builder.tool":"Tool","automation.builder.toolPick":"Pick a tool…","automation.builder.dangerous":"⚠ High-risk tool: saving approves these exact arguments","automation.builder.toolCatalogEmpty":"Engine has no action catalog (update the engine)","automation.builder.museFallback":"Wake Muse (default)","automation.builder.museFallbackHint":"With no steps, firing wakes Muse to turn this into a reminder/TODO for you. Add steps to run them instead.","automation.builder.prompt":"Prompt","automation.builder.promptPh":"What should it do when the rule fires (English preferred)","automation.builder.cooldown":"Cooldown (hours)","automation.builder.cooldownHint":"Minimum gap between fires, in hours (floor 0.25 = 15 min for pure notify/tool chains)","automation.builder.cooldownAgentHint":"Has agent steps — min 1 hour (unattended self-excitation guard)","market.title":"Market","market.subtitle":"Discover community-built workflows, capabilities and interface extensions","market.navSubtitle":"Community extensions","market.group.discover":"Discover","market.group.categories":"Categories","market.group.manage":"Manage","market.tab.discover":"Store home","market.tab.skills":"Skills","market.tab.agents":"Agents","market.tab.plugins":"Plugins","market.tab.spaces":"Spaces","market.tab.themes":"Themes","market.tab.webapps":"Web apps","market.tab.installed":"Installed","market.searchPlaceholder":"Search names, authors or tags","market.clearSearch":"Clear search","market.sort.label":"Sort","market.sort.popular":"Popular","market.sort.latest":"Recent","market.sort.name":"Name","market.sectionSubtitle":"Browse {section} and manage installs","market.detailSubtitle":"Details, source and install information","market.webOpen":"Open","market.webHint":"Web apps built with Coding Space and listed by users. Opens in the built-in browser; AI features spend the visitor's own account quota.","market.tab.updates":"Updates","market.tab.submit":"Submit","market.author":"by","market.downloads":"{n} downloads","market.downloadsShort":"{n} installs","market.install":"Install","market.installing":"Installing…","market.installed":"Installed","market.reinstall":"Reinstall","market.uninstall":"Uninstall","market.uninstallConfirm":'Uninstall "{name}"? Its install directory will be deleted.',"market.uninstallWarnAgent":"⚠️ This is an agent: once installed it keeps its own memory and logs. Uninstalling deletes them too, and that cannot be undone.","market.uninstallWarnSkill":"⚠️ If you have edited this skill, your edits will be deleted with it.","market.uninstalled":'Uninstalled "{name}"',"market.uninstalledNeedsRestart":'Uninstalled "{name}" · its tools only go away after a backend restart',"market.uninstallFail":"Uninstall failed: {e}","market.openSettings":"Open settings","market.update":"Update","market.updateTitle":"Update v{from} → v{to}","market.allUpToDate":"Everything installed is up to date","market.allUpToDateHint":"New versions will appear here automatically.","market.detailBack":"Back to list","market.empty":"Nothing here yet","market.emptyHint":"Community content appears here after review.","market.noInstalled":"No marketplace content installed yet","market.noResults":"No matching content found","market.noResultsHint":"Try another name, author or tag.","market.browse":"Browse market","market.retry":"Reload","market.loadFailShort":"The market is temporarily unavailable","market.loadFail":"Failed to load: {e}","market.summaryFallback":"The author has not provided a summary.","market.searchResults":"Search results","market.resultCount":"{n} items","market.featured":"Community pick","market.viewDetails":"View details","market.recent":"Recently added","market.recentHint":"See what the community just published.","market.popular":"Popular","market.popularHint":"Ordered by real install count.","market.overview":"Overview","market.reviewed":"Reviewed for listing","market.reviewedHint":"The listing meets publication requirements. Forsion does not guarantee third-party code.","market.type":"Type","market.version":"Version","market.source":"Install source","market.sourceUpload":"Forsion hosted package","market.updated":"Updated","market.unknown":"Unknown","market.installOk":'Installed "{name}"',"market.spaceInstalled":'Installed Space "{name}" and added it to the ribbon',"market.themeInstalled":'Installed "{name}". Pick it in Settings → Appearance',"market.amadeusPluginInstalled":'Forsion plugin "{name}" installed and loaded',"market.pluginInstalledOk":"Plugin installed and enabled","market.pluginInstalledRestartHint":"Plugin installed. Restart the backend for it to take full effect","market.pluginInstalledWaiting":"Plugin installed, but it needs these first: {list}","market.amadeusPluginNeedsDeps":'Forsion plugin "{name}" installed, but it needs these first: {list}',"market.restartBackend":"Restart backend","market.restartBackendHint":"Takes a few seconds; any running conversation will be interrupted","market.backendRestarting":"Restarting the backend…","market.backendRestarted":"Backend restarted — changes are now in effect","market.backendRestartFailed":"The backend didn't restart. Try again, or restart the app","market.installFail":"Install failed: {e}","market.installFailNamed":"Couldn’t install {name}: {e}","market.installHintGithub":"This item downloads from GitHub, which is unreachable on some networks. Turn on a system proxy and retry, or enable “Use China mainland mirrors” in Settings → General → Connection to download through domestic mirrors.","market.installRetry":"Retry","market.phase.resolve":"Preparing…","market.phase.connect":"Connecting…","market.phase.connectN":"Connecting {n}/{m}…","market.phase.percent":"Downloading {n}%","market.phase.bytes":"Downloaded {size}","market.openRepo":"View GitHub repo","market.readmeEmpty":"(No details)","market.submitHint":"Submit a GitHub repository, public npm package or ZIP through your account. Submissions appear after review.","market.submitOpen":"Open submission page","market.submitKicker":"Developer center","market.submitTitle":"Share your workflow with more people","market.submitArtTitle":"One review and version pipeline","market.submitArtHint":"Skills, Agents, Plugins, Spaces and Themes use the same publication flow.","feedback.label":"Issue or feedback","feedback.placeholder":"Describe the problem or suggestion… the current session log is attached automatically to help us debug.","feedback.logAttached":"Current session log will be attached ({name})","feedback.noSession":"No active session — submitting text only","feedback.submit":"Send feedback","feedback.diagnoseViaChat":"Diagnose in chat","feedback.diagnoseViaChatHint":"Send the description to the current session’s agent to troubleshoot it in place","feedback.ok":"Submitted — thank you for your feedback!","feedback.okNoLog":"Submitted (session log over 5MB, not attached this time)","feedback.errEmpty":"Please enter your feedback","feedback.errFail":"Submit failed: {err}","feedback.errNotLoggedIn":"Not logged into Forsion","feedback.errUnavailable":"Feedback not available here","sidebar.account.login":"Sign in to Forsion","sidebar.account.loginHint":"Sign in for cloud memory / skills / hosted models (works fine without signing in too)","sidebar.account.loggingIn":"Signing in…","sidebar.account.logout":"Sign out","sidebar.account.menu.weekly":"This week","sidebar.account.menu.daily":"Today","sidebar.account.menu.unlimited":"Unlimited","sidebar.account.menu.loading":"Loading…","sidebar.account.menu.quotaFail":"Failed to load usage","settings.provider.loginBusy":"After you finish signing in the browser, the local engine restarts to load this provider and the model list refreshes automatically (a few seconds).","quota.exhausted.daily":"Today's AI quota is used up (this run finished on overdraft; use a quota reset card under Forsion Cloud → Quota & points to restore it now)","quota.exhausted.weekly":"This week's AI quota is used up (this run finished on overdraft; use a quota reset card under Forsion Cloud → Quota & points to restore it now)","sidebar.account.loginFail":"Sign-in failed: {e}","sidebar.account.loginSub":"Click to sign in","sidebar.account.engineDown":"Engine not running · click to restart","sidebar.account.engineStarting":"Engine starting…","sidebar.settings":"Settings (Ctrl+,)","header.theme":"Light / dark","header.browser":"Browser","header.browserEnabled":"Browser tools enabled","header.browserDisabled":"Browser tools disabled","settings.tab.about":"About","about.version":"Version","about.checkUpdates":"Visit website","about.update.check":"Check for updates","about.update.checking":"Checking…","about.update.upToDate":"You're up to date","about.update.available":"Update available v{version}","about.update.download":"Download update","about.update.downloading":"Downloading {percent}%","about.update.install":"Restart & install","about.update.goToDownload":"Go to download","about.update.error":"Update failed: {error}","about.update.unsupported":"Auto-update unavailable in dev","about.update.unreachable":"Could not reach the update server, try again later","about.update.beta":"Receive beta updates","about.update.betaHint":"Get pre-release builds like x.y.z-beta.N — newer features, more likely to break. With this off they are invisible to you. Stable always wins: a stable release published after a beta is still offered.","app.update.bannerTitle":"New version v{version} available","app.update.bannerAction":"Update now","app.update.bannerDismiss":"Dismiss","about.changelogTitle":"What's new","about.builtWith":"Forsion Desktop","about.builtWithMobile":"Forsion Mobile","about.complianceTitle":"Compliance","about.appFiling":"App filing number","about.privacy":"Privacy policy","about.terms":"Terms of service","settings.cloud.envOnly":"The Forsion cloud URL is set via the TANGU_CLOUD_URL environment variable (read-only here).","settings.cloud.label":"Forsion cloud URL (brain: memory/skills/hosted models)","settings.cloud.unset":"(unset — using built-in default)","model.group.forsion":"Forsion Cloud","picker.ungrouped":"Ungrouped","model.group.direct":"Local","model.collapseAll":"Collapse all","model.expandAll":"Expand all","model.empty":"No models","model.searchPlaceholder":"Search models…","settings.tab.developer":"Developer","settings.tab.browser":"Browser control","settings.tab.channels":"Channels","channel.name.wechat":"WeChat","channel.name.telegram":"Telegram","channel.name.qq":"QQ","channels.intro":"Bring Tangu into your IM: connecting creates a fresh channel session and messages get answered in chat; inbox forwarding can be enabled independently.","channels.loadingTitle":"Loading channels","channels.loadingHint":"Reading local channel capabilities and connection status.","channels.notAvailable":"Channels require the built-in local backend (desktop).","channels.notAvailableHint":"Start the local backend and retry. These settings are not available in external-backend mode.","channels.enable":"Enable","channels.status.connected":"Connected","channels.status.notConnected":"Not connected","channels.status.disabled":"Disabled","channels.connect":"Connect","channels.scanConnect":"Scan to connect","channels.disconnect":"Disconnect","channels.disconnected":"Disconnected.","channels.connectedAs":"Connected: {label}","channels.connectedMsg":"WeChat connected; a new channel session was created.","channels.connectFailed":"Operation failed: {e}","channels.qrExpired":"QR code expired, please scan again.","channels.scanQrHint":"Scan with WeChat to confirm login.","qr.failed":"Failed to generate QR code, please retry.","qr.alt":"Login QR code","channels.newSessionHint":"Connecting creates a new session; later messages go to it. In the IM use /new, /list, /switch to manage sessions and /help for all commands.","channels.botToken":"Bot token","channels.botTokenHint":"Create a bot via @BotFather on Telegram to get a token, then press Connect.","channels.qqHint":"Create a bot on the QQ Open Platform (q.qq.com) to get AppID / AppSecret.","channels.secretSaved":"Saved (type to replace)","channels.sessionsSec":"Channel sessions","channels.sessions":"Enable channel sessions","channels.sessionsHint":"Incoming messages drive an agent session and get replies; when off, only inbox forwarding works.","channels.approval":"Remote approval","channels.approval.readonly":"Ask for approval","channels.approval.autoEdit":"Approve for me","channels.approval.fullAuto":"Full access","channels.defaultAgent":"Default agent","channels.defaultModel":"Default model","channels.imageModel":"Image model","channels.ttsModel":"Voice model","channels.ttsModelPlaceholder":"Empty = follow Voice settings","channels.ttsVoice":"Voice","channels.followDefault":"Follow global default","channels.followGlobal":"Follow global setting","channels.forwardSec":"Inbox forwarding","channels.forward":"Forward inbox messages to this channel","channels.forwardHint":"Push new inbox messages to your IM (independent of channel sessions).","channels.forwardSenders":"Allowed senders","channels.forwardAll":"All","channels.waitingPeer":"Connected; waiting for the first incoming message to bind the contact.","channels.senderSystem":"System","channels.senderServer":"Forsion cloud","sidebar.channel.setAsConnected":"Set as connected","settings.tab.notes":"Notes","settings.tab.sync":"Sync","settings.sync.cloudSec":"Online sync","settings.sync.remoteSec":"Vault remote sync","settings.notes.storageTitle":"Files and attachments","settings.notes.storageDescription":"Keep attachment and daily-note locations together.","settings.notes.behaviorTitle":"Editing and safety","settings.notes.behaviorDescription":"Control imports, link compatibility and attachment deletion safeguards.","settings.notes.modeLabel":"Attachment location","settings.notes.modeAttachments":"attachments/ folder next to the note","settings.notes.modeSame":"Same folder as the note","settings.notes.modeVault":"Fixed folder in the vault","settings.notes.modeHint":"Where dragged-in files are saved. “attachments” auto-creates an attachments/ subfolder beside the note.","settings.notes.folderLabel":"Vault-relative folder","settings.notes.folderHint":"Relative to the vault root, e.g. assets. All attachments live here (must be inside the vault for inline preview).","settings.notes.previewLabel":"Preview imported files by default","settings.notes.previewHint":"On: insert an ![[file]] preview block (images inline, others as a clickable file card). Off: insert a [name](path) link.","settings.notes.upgradeV4Label":"Upgrade legacy notes to v4 plain Markdown on open","settings.notes.upgradeV4Hint":"On by default: v3 marker-based notes convert to plain Markdown when you edit them. The upgrade is written only after a real edit; turn this off temporarily if some device still runs a version older than 2.7.8.","settings.notes.dailyLabel":"Daily notes folder","settings.notes.dailyPlaceholder":"Empty = vault root","settings.notes.dailyHint":`Where "Open today's daily note" creates YYYY-MM-DD.md (vault-relative); templates/daily.md is applied automatically if present.`,"settings.notes.wikiFilesLabel":"Suggest attachments and databases in [[ ]]","settings.notes.wikiFilesHint":"On: typing [[ also completes attachments, databases (.db) and drawings. Off: notes only.","settings.notes.canvasDoubleClickFocusLabel":"Focus canvas cards on double-click","settings.notes.canvasDoubleClickFocusHint":"Double-clicking a card always enters editing with the caret at the click. On: it also smoothly centers the card at a readable zoom; off: it edits in place and the viewport stays put. A single click only selects; Space also enters editing.","settings.notes.canvasOverviewZLabel":"Zoom that collapses cards to titles","settings.notes.canvasOverviewZHint":"At this zoom level or below, canvas cards show a title summary instead of their body. The default 25% only collapses at the furthest zoom-out; a higher value collapses sooner. The toggle in the canvas HUD turns the summary off entirely.","settings.notes.deleteAssetsLabel":"Delete exclusive attachments with the note","settings.notes.deleteAssetsAsk":"Ask every time","settings.notes.deleteAssetsYes":"Remembered: delete them","settings.notes.deleteAssetsNo":"Remembered: keep them","settings.notes.deleteAssetsHint":"Only attachments referenced by this note alone; anything another note links to is kept.","settings.remote.saved":"Remote settings saved. The managed backend may restart to apply them.","settings.browser.title":"Browser control","settings.browser.agentBrowser":"Agent browser","settings.browser.hint":"Tangu prefers browser_search and browser_* interaction tools for web work; web_search remains available for compatibility.","settings.browser.engine":"Browser engine","settings.browser.engineHint":"Auto picks an available browser implementation for each task.","settings.browser.searchEngine":"Search engine","settings.browser.timeout":"Timeout","settings.browser.timeoutHint":"Maximum wait for a browser command, in milliseconds.","settings.browser.allowPrivate":"Allow browser tools to open private/local network URLs","settings.browser.allowPrivateHint":"Off by default; browser_navigate blocks localhost, RFC1918 and link-local addresses.","settings.tab.spaces":"Spaces","settings.spaces.hint":"Manage the Spaces in the ribbon. Built-in Spaces ship with the app and cannot be removed; Spaces you created or installed from the market can be uninstalled (their on-disk layout recipe is deleted).","settings.spaces.builtin":"Built-in","settings.spaces.user":"Custom/market","settings.spaces.uninstall":"Uninstall","settings.spaces.uninstalled":'Uninstalled "{name}"',"settings.spaces.empty":"No Spaces yet.","settings.spaces.startupTitle":"Startup location","settings.spaces.startupLabel":"Open the app in","settings.spaces.startupHint":"Opens the Space in the ribbon home slot by default; you can also return to your last Space with its tabs, or pin a specific one.","settings.spaces.lastExit":"Last Space on exit (with its tabs)","settings.spaces.homeSlotStartup":"Space in the home slot (default — now “{name}”)","settings.spaces.homeSlotLabel":"Ribbon home slot","settings.spaces.homeSlotHint":"The centred cell on the ribbon. Home by default; swap it for any Space here or by right-clicking the cell.","settings.spaces.libraryTitle":"Installed Spaces · {count}","settings.tab.plugins":"Plugins","settings.tab.amadeusPlugins":"Plugins","settings.amadeusPlugins.builtinTitle":"Built-in plugins","settings.amadeusPlugins.builtinHint":"Ships with the app and is on by default (browser, terminal and calendar are native host views; the rest are editor add-ons). Turning one off removes it from the workbench, command palette and editor — calendar takes its Space with it.","settings.amadeusPlugins.externalTitle":"External plugins","settings.amadeusPlugins.changelog":"What's new","settings.amadeusPlugins.hint":"Toggle takes effect instantly; click a plugin for details. Plugin folder: ~/.forsion/plugins/ (market installs). A plugin may bundle engine plugins / agents / skills / Spaces — they are discovered, toggled and uninstalled together with it.","settings.amadeusPlugins.openFolder":"Open plugins folder","settings.amadeusPlugins.reload":"Reload","settings.amadeusPlugins.scaffold":"Create sample plugin","settings.amadeusPlugins.builtin":"Built-in","settings.amadeusPlugins.external":"External","settings.amadeusPlugins.agentOwned":"Space built by {agent}","settings.amadeusPlugins.blockedInvalid":"Invalid manifest: {reason}","settings.amadeusPlugins.uninstall":"Uninstall","settings.amadeusPlugins.uninstallConfirm":'Uninstall "{name}"? Its folder will be deleted; bundled engine plugins/Spaces go with it (seeded agents are kept — delete them on the Agents page if needed).',"settings.amadeusPlugins.uninstalled":'Uninstalled "{name}"',"settings.amadeusPlugins.uninstalledRestartPending":'"{name}" files were deleted, but the engine restart did not complete — bundled tools may still be running; restart the backend manually',"settings.amadeusPlugins.bundleEngine":"Engine plugins ×{n}","settings.amadeusPlugins.bundleAgents":"Agents ×{n}","settings.amadeusPlugins.bundleSkills":"Skills ×{n}","settings.amadeusPlugins.bundleSpaces":"Spaces ×{n}","settings.amadeusPlugins.bundleTitle":"Bundled content","settings.amadeusPlugins.bundleEngineList":"Engine plugins: {list}","settings.amadeusPlugins.bundleAgentsList":"Agents: {list}","settings.amadeusPlugins.bundleSkillsList":"Skills: {list}","settings.amadeusPlugins.bundleSpacesList":"Spaces: {list}","settings.amadeusPlugins.bundleHint":"Bundled engine plugins and Spaces follow this plugin's enable/uninstall state; agents are seeded into the engine once on first discovery and then live independently (upgrades never overwrite, uninstall keeps them).","settings.amadeusPlugins.blockedApi":"Requires plugin API v{v}, incompatible with this app","settings.amadeusPlugins.blockedMinApp":"Requires app version ≥ {v}","settings.amadeusPlugins.empty":"No plugins yet.","settings.amadeusPlugins.back":"Back to list","settings.amadeusPlugins.dep":"Companion app","settings.amadeusPlugins.depConnected":"Connected {v}","settings.amadeusPlugins.depMissing":"Not detected — needs to be installed and running","settings.amadeusPlugins.depCheck":"Check connection","settings.amadeusPlugins.depInstall":"Install","settings.amadeusPlugins.depInstalling":"Installing…","settings.amadeusPlugins.depFail":"Install did not finish — open the website to install manually","settings.amadeusPlugins.depHomepage":"Open website","settings.amadeusPlugins.commands":"Commands","settings.amadeusPlugins.settings":"Settings","plugin.onboarding.title":"Set up — {name}","plugin.onboarding.stepsTitle":"Steps","plugin.onboarding.settingsTitle":"Required settings","plugin.onboarding.recommendsTitle":"Recommended companions","plugin.onboarding.install":"Install","plugin.onboarding.installed":"Installed","plugin.onboarding.installing":"Installing…","plugin.onboarding.notFound":"Not in market","plugin.onboarding.later":"Later","plugin.onboarding.done":"Done","plugin.onboarding.laterHint":'You can come back anytime from Settings → Forsion plugins → this plugin → "Run setup". The "Setup pending" badge clears on its own once every requirement is met.',"plugin.onboarding.requiresTitle":"Before you start","plugin.onboarding.req.ok":"Ready","plugin.onboarding.req.unmet":"Not done yet","plugin.onboarding.req.unknown":"Can't check right now","plugin.onboarding.req.timeout":"The check timed out. Try again in a moment.","plugin.onboarding.req.inactive":"Enable the plugin to check this.","plugin.onboarding.recheck":"Check again","plugin.onboarding.checking":"Checking…","plugin.onboarding.allReady":"All set — you're ready to go.","plugin.onboarding.someUnknown":"Nothing is missing; {n} item(s) can't be checked right now.","plugin.onboarding.guideTitle":"How to use","plugin.onboarding.badge":"Setup pending","plugin.onboarding.run":"Run setup","plugin.onboarding.nudgeTitle":'Plugin "{name}" needs a quick setup',"plugin.onboarding.nudgeBody":`"{name}" still has unmet requirements. Open Settings → Forsion plugins → {name} and click "Run setup" to see what's missing.`,"settings.plugins.npmInstallTitle":"Install engine plugin from npm","settings.plugins.npmInstallHint":"Enter a package spec (e.g. npm:@forsion/tangu-computer-use). Plugins run with your full system permissions — only install sources you trust.","settings.plugins.npmInstallConfirm":'Install "{spec}" from npm? Plugins run with your full system permissions; confirm the source is trustworthy before continuing.',"settings.plugins.preferMirror":"Prefer CN mirror","settings.plugins.installBtn":"Install","settings.plugins.installing":"Installing…","settings.plugins.installed":"Installed {id}@{version}","settings.plugins.empty":"No plugins","settings.plugins.secForsion":"Forsion plugins","settings.plugins.secEngine":"Tangu engine plugins","settings.plugins.bundleOwnedHint":"{n} more engine plugin(s) are bundled by Forsion plugins above and toggle together with them.","settings.plugins.selectHint":"Select a plugin to configure","settings.plugins.builtin":"Built-in","settings.plugins.folder":"Folder","settings.plugins.needsRestart":"Restart needed","settings.plugins.needsRestartHint":"The new version is on disk, but its entry imports relative modules. Restart the backend to run it","settings.plugins.waitingDeps":"Waiting for required plugins","settings.plugins.loadFailed":"Failed to load","settings.plugins.settling":"Finishing up","settings.plugins.settlingHint":"The previous start or stop is still finishing; your setting takes effect once it ends","settings.plugins.needsDepsToEnable":"Install and turn on these first: {list}","settings.plugins.disableDependents":'Turning off "{name}" also pauses the plugins that require it: {list}. They resume when you turn it back on. Continue?',"settings.plugins.uninstallDependents":'These plugins require "{name}" and stop working once it is uninstalled: {list}.',"settings.plugins.openFolder":"Open plugins folder","settings.plugins.rescan":"Reload plugins","settings.plugins.rescanning":"Rescanning…","settings.plugins.rescanAdded":"Rescan done: {n} plugin(s) added, updated or removed","settings.plugins.rescanNone":"Rescan done: nothing changed","settings.plugins.rescanHint":"Picks up plugins added, updated or removed in the folder right away. A plugin whose entry imports relative modules still needs a backend restart after an update","settings.plugins.uninstall":"Uninstall","settings.plugins.uninstallConfirm":'Uninstall "{name}"? This deletes the plugin files and all its settings.',"settings.plugins.uninstalled":'Uninstalled "{name}"',"settings.plugins.scope":"Scope","settings.plugins.scopeGlobal":"Global","settings.plugins.scopeAgent":"Per agent","settings.plugins.selectAgent":"Select agent","settings.plugins.noSettings":"This plugin has no settings","settings.plugins.saved":"Saved","settings.plugins.import":"Import image","settings.plugins.deleteConfirm":"Delete “{name}”?","settings.plugins.onlyImage":"Images only (png/jpg/gif/webp)","about.versionClickHint":"{n} more taps to enable developer mode","about.devUnlocked":"Developer mode enabled","settings.developer.note":"These options are for advanced users / debugging — normally no need to change them.","settings.developer.cloudUrlLabel":"Forsion cloud URL","settings.developer.cloudUrlHint":"Address of the brain service (memory/skills/hosted models). Leave empty to use the TANGU_CLOUD_URL env var or the built-in default. In managed mode, saving restarts the backend to take effect.","settings.developer.cloudUrlPlaceholder":"https://api.forsion.net","settings.developer.saveCloudUrl":"Save","settings.developer.savedRestarting":"Saved, restarting backend…","settings.developer.saved":"Saved","settings.developer.relaunchLabel":"Onboarding","settings.developer.relaunchHint":"Re-run the first-install setup flow (theme / connection / model / project folder).","settings.developer.relaunch":"Re-run onboarding","settings.developer.disable":"Disable developer mode","settings.developer.showSystemPrompt":"Show system prompt before each reply","settings.developer.showSystemPromptHint":"When on, each AI reply is preceded by the full system prompt sent to the model for that message (expand to inspect its content and structure). Local debugging only; cleared automatically when you disable developer mode.","settings.developer.activeWindow":"Active window sampling (seam)","settings.developer.activeWindowHint":'Lets plugins that declare the activeWindow capability read which app you are focused on — so they can drop external dependencies like ActivityWatch. Data never leaves this machine. Adds an "Active window sampling" debug panel to the command palette (⌘K). Off by default; turned off automatically when you leave developer mode.',"settings.developer.mobileUiPreview":"Mobile UI preview command","settings.developer.mobileUiPreviewHint":'Adds a "Switch to mobile UI" entry to the command palette (⌘K) that swaps the desktop shell for the single-column mobile shell at runtime (reloads the page). Works on web too. Local debugging only; cleared when you disable developer mode.',"command.switchToMobileUi":"Switch to mobile UI","command.switchToDesktopUi":"Switch back to desktop UI","command.zoomIn":"Zoom in","command.zoomOut":"Zoom out","command.zoomReset":"Reset zoom","chat.systemPrompt":"System prompt","onboarding.brand.caption":"AI workspace","onboarding.progress.label":"Setup progress","onboarding.phase.connect":"Connect account","onboarding.phase.appearance":"Choose appearance","onboarding.phase.capabilities":"Configure capabilities","onboarding.phase.workspace":"Prepare project folder","onboarding.welcome.kicker":"First-time setup","onboarding.welcome.subtitle":"Bring models, agents, knowledge and local tools into one app.","onboarding.welcome.railLabel":"Start here","onboarding.welcome.railTitle":"Make Forsion fit the way you work.","onboarding.welcome.railBody":"Finish the essentials in a few minutes. Every choice can be changed later in Settings.","onboarding.welcome.promiseModels":"Connect Forsion or your own models","onboarding.welcome.promiseAgents":"Prepare agents you can switch anytime","onboarding.welcome.promiseLocal":"Keep control of local files and execution","onboarding.step.connect.title":"Connect models and account","onboarding.step.connect.description":"Sign in to Forsion, use subscription access, or connect an OpenAI-compatible service.","onboarding.step.theme.title":"Choose your appearance","onboarding.step.theme.description":"Design language controls structure, the accent controls highlight color, the background controls the base palette. Mix them freely.","onboarding.step.model.title":"Choose a default model","onboarding.step.model.description":"Pick a daily model now. You can switch it in any conversation later.","onboarding.step.speech.title":"Configure voice input","onboarding.step.speech.description":"Choose a speech recognition model, or keep the default and configure it later.","onboarding.step.agents.title":"Meet your agents","onboarding.step.agents.description":"Review the roster and optionally create an assistant with its own persona and memory.","onboarding.step.workspace.title":"Choose a working directory","onboarding.step.workspace.description":"Set the default folder for local sessions. Forsion works only within the scope you allow.","onboarding.step.env.title":"Check the local environment","onboarding.step.env.description":"Verify tools needed for coding tasks and choose downloads for your current network.","onboarding.step.done.title":"You’re all set","onboarding.step.done.description":"The essentials are configured. Enter Forsion and start working.","onboarding.done.cloudLine1":"· Switch models and thinking effort anytime from the input bar; notes, calendar and automation all live in Forsion","onboarding.done.cloudLine2":"· Settings → Appearance changes the theme and language anytime; the desktop app adds local files and tools","onboarding.connect.modeLabel":"Connection method","onboarding.model.choiceLabel":"Default chat model","onboarding.speech.choiceLabel":"Voice input","onboarding.workspace.choiceLabel":"Default working directory","onboarding.connect.forsionHint":"Sign in with your Forsion account (the cloud URL is set via an environment variable — nothing to enter here). Or switch to your own API key above.","onboarding.connect.skipForNow":"Skip for now","onboarding.theme.stepLabel":"Choose a theme","onboarding.theme.modeLabel":"Light / dark","onboarding.theme.light":"Light","onboarding.theme.dark":"Dark","onboarding.theme.hint":"You can change this anytime in Settings → Appearance.","onboarding.theme.customSeedLabel":"Custom accent","settings.theme.system":"Follow system","settings.theme.modeLocked":"This theme follows the system appearance","settings.theme.modeLockedHint":"Themes like Glass take light/dark from the system; it can’t be switched manually.","settings.theme.zoomLabel":"Interface size","settings.theme.zoomHint":"Scales the whole interface. Currently {percent}%. You can also fine-tune it in 10% steps with ⌘/Ctrl + +/−.","settings.theme.zoomPresetLabel":"Interface size presets","settings.theme.zoomSmall":"Small","settings.theme.zoomStandard":"Standard","settings.theme.zoomLarge":"Large","settings.theme.smoothCaret":"Smooth caret","settings.theme.smoothCaretHint":"The text caret glides smoothly to its new position in the editor and chat input (Word-style). Off by default; turn it on if you want it.","settings.theme.chatAvatars":"Chat avatars","settings.theme.chatAvatarsHint":"Show agent and user avatars in conversations. Turn off for a cleaner message view; agent names stay.","settings.theme.fontUi":"Interface font","settings.theme.fontBody":"Body font","settings.theme.fontMono":"Monospace font","settings.theme.fontFollow":"Follow theme","settings.theme.fontSystem":"System default","settings.theme.fontHint":'Preset fonts ship with the app, so they render the same on every machine regardless of what is installed locally. Pick "Follow theme" to use the current theme’s own stack.',"settings.theme.fontPreset.inter":"Inter (modern sans)","settings.theme.fontPreset.notoSans":"Noto Sans SC","settings.theme.fontPreset.wenkai":"LXGW WenKai (reading)","settings.theme.fontPreset.jetbrains":"JetBrains Mono","settings.theme.fontPreset.system":"System default","settings.theme.fontGroupBuiltin":"Built-in","settings.theme.fontGroupPlugin":"From plugins","settings.theme.customSeedLabel":"Custom accent","settings.theme.customBgLabel":"Custom background","settings.theme.customBgFollow":"Follows accent","settings.theme.customBgClear":"Reset","settings.theme.customBgHint":"Unset: the accent softly tints the background. Set: use this hue as an independent ambience seed, adjusted into the current mode’s readable range.","settings.theme.langLabel":"Design language","settings.theme.openFolder":"Open themes folder","settings.theme.reload":"Reload themes","settings.theme.dropHint":"Drop theme.json + theme.css into ~/.forsion/themes/<id>/ to install a third-party theme, then click “Reload themes”.","settings.theme.options":"{name} options","settings.theme.optionsReset":"Reset","settings.theme.skinLabel":"Color scheme","settings.theme.accentLabel":"Accent","settings.theme.bgLabel":"Background","settings.theme.skin.cream":"Classic","settings.theme.skin.coral":"Coral","settings.theme.skin.teal":"Teal","settings.theme.skin.lavender":"Lavender","settings.theme.skin.zhi":"Clear blue","settings.theme.skin.custom":"Custom","settings.group.appearance":"Appearance","settings.group.account":"Account","settings.group.model":"Models","settings.group.agents":"Agents","settings.group.extensions":"Extensions","settings.group.appearanceAbout":"Appearance & about","settings.group.plugins":"Extensions","settings.group.advanced":"Advanced","settings.group.about":"About","settings.group.options":"Options","settings.group.workspace":"Workspace","settings.group.ai":"AI","settings.group.system":"System","settings.group.tools":"Tools","settings.group.corePlugins":"Core plugins","settings.group.communityPlugins":"Community plugins","settings.tab.general":"General","settings.page.generalDescription":"Manage your working directory, runtime and Forsion connection status.","settings.page.spacesDescription":"Choose a startup location and manage installed Spaces.","settings.page.notesDescription":"Manage attachment locations, note behavior and deletion safeguards.","settings.page.syncDescription":"Sync your local vault to remote storage (Dropbox, S3, WebDAV, and more).","settings.page.themeDescription":"Preview and combine design language, color, appearance mode, interface size and typography.","settings.page.shortcutsDescription":"Find commands and record, unbind or restore shortcuts.","settings.page.notificationsDescription":"Control delivery and choose which events and plugins can notify you.","settings.page.statusbarDescription":"Choose bottom-bar items and drag them into display order.","settings.page.modelDescription":"Choose default models and manage providers, web search and voice.","settings.page.agentsDescription":"Manage the agent roster, background agents and local agent CLIs.","settings.page.skillsDescription":"Browse skills and import skills or MCP settings from other tools.","settings.page.mcpDescription":"Connect, toggle and maintain external MCP tool servers.","settings.page.hooksDescription":"Manage automations that run around agent activity.","settings.page.channelsDescription":"Connect messaging channels and review their status in one place.","settings.page.browserDescription":"Choose browser and search engines, and set network safety boundaries.","settings.page.pluginsDescription":"Manage core features and installed plugins, their settings and updates.","settings.page.pluginDescription":"Adjust the features and runtime options provided by this plugin.","settings.page.advancedDescription":"Manage local services, interface behavior, logs and data safety.","settings.page.developerDescription":"Internal options for UI debugging, activity logs and feature testing.","settings.page.aboutDescription":"Review the version, update channel, language and full changelog.","settings.overview.label":"Current status","settings.overview.mode":"Runtime mode","settings.overview.backend":"Backend service","settings.overview.account":"Forsion account","settings.overview.signedIn":"Signed in","settings.overview.signedOut":"Not signed in","settings.overview.readyTitle":"Workspace services are ready","settings.overview.readyDescription":"The backend is connected. You can continue adjusting the workspace and local runtime.","settings.overview.attentionTitle":"Workspace services need attention","settings.overview.attentionDescription":"Check the backend connection and runtime mode. The latest status will appear here after saving.","settings.backend.modeDescription":"Let Forsion manage its local service, or connect to a backend you already run.","settings.backend.modeManagedDescription":"Ready out of the box. The desktop app starts, checks and restarts it.","settings.backend.modeExternalDescription":"For an existing LAN, container or remote deployment.","settings.workspace.summary":"The default location used when creating a local session.","settings.runtime.title":"Local runtime","settings.runtime.description":"Configure the code sandbox, Python and download network. Restart the backend to apply changes.","settings.runtime.details":"About Python and network mirror behavior","settings.external.title":"External backend connection","settings.external.description":"Enter the service URL and credentials, test the connection, then save.","settings.theme.previewLabel":"Live appearance preview","settings.theme.previewChat":"Chat","settings.theme.previewWorkspace":"Forsion","settings.theme.previewTitle":"Keep ideas in flow","settings.theme.previewMessage":"Your design language, color scheme, typography and material are applied to this preview in real time.","settings.theme.previewInput":"Ask Forsion, or type / for capabilities","settings.theme.langDescription":"Choose the structure, radius, typography and overall character of the interface.","settings.theme.skinDescription":"Pick accent and background separately; same id on both = the original combined scheme.","settings.theme.behaviorTitle":"Display and motion","settings.theme.behaviorDescription":"Adjust appearance mode, interface size, depth and typing feedback.","settings.theme.flatLabel":"Shadows","settings.theme.flatOff":"Raised","settings.theme.flatOn":"Flat","settings.theme.flatDescription":"Raised adds subtle shadows. Flat hides decorative shadows.","settings.theme.glassDescription":"Add translucent blur to surfaces that support it.","settings.theme.typographyTitle":"Typography","settings.sub.connection":"Connection","settings.sub.models":"Models","settings.sub.providers":"Custom providers","settings.sub.webSearch":"Web search","settings.sub.voice":"Voice","settings.sub.specialAgents":"Background agents","settings.sub.mcpServer":"MCP endpoint","settings.sub.uiSession":"UI & sessions","settings.sub.data":"Data","settings.sub.skillLibrary":"Skill library","settings.plugins.openSettings":"Settings","onboarding.agents.stepLabel":"Agents","onboarding.agents.intro":"Agents are chat personas with their own name, personality and private memory — the default agent is ready to go, and you can raise a whole roster: a work assistant, a translator, a companion, switching anytime mid-chat. Manage them fully (avatar/model/tools) later in the Agents Space.","onboarding.agents.rosterLabel":"Current roster","onboarding.agents.rosterEmpty":"Roster is empty (the default agent is created on first chat).","onboarding.agents.systemBadge":"background","onboarding.agents.createLabel":"Quick create (optional)","onboarding.agents.namePlaceholder":"Name, e.g. Qinche","onboarding.agents.personaPlaceholder":"One-line persona, e.g. a meticulous technical editor of few words","onboarding.agents.createBtn":"Create","onboarding.agents.createHint":"A name is enough; the persona line becomes its initial instructions and can be changed anytime.","onboarding.agents.created":'Created "{name}" — switch agents above the chat input.',"onboarding.agents.createFail":"Create failed: {e}","onboarding.agents.historianTitle":"Background agent: Historian","onboarding.agents.historianDesc":"Every few rounds it automatically titles the session and maintains logs & long-term memory — independent mode is fully automated; assist mode joins a background side-discussion as an archivist and lets your agent decide what to write.","onboarding.agents.historianSaveFail":"Failed to save Historian settings: {e}","onboarding.agents.moreHint":"Trigger cadence, prompt and the other background agent (Muse) live in Settings → Background agents.","onboarding.workspace.stepLabel":"Choose a default local folder","onboarding.workspace.hint":"Default working directory for new local sessions; leave empty to use the Sessions folder inside your notes library (or ~/Forsion without one).","onboarding.workspace.placeholder":"~/Forsion (default)","onboarding.workspace.pick":"Browse folder","onboarding.workspace.clear":"Clear","settings.advanced.agentDesk":"Agent Desk stage panel","settings.advanced.agentDeskHint":"A stage area beside the chat, on by default. Files the agent edits show up there automatically, and the agent can deliberately stage files, notes and mindmaps for you — and screenshot them to check its own work. Drag to resize, collapse to a card.","settings.advanced.agentDeskEnable":"Enable Agent Desk","settings.advanced.summaryOpenIn":"Clicking a file in the task overview","settings.advanced.summaryOpenInHint":"Where sources and outputs in the task overview card open.","settings.advanced.summaryOpenIn.tab":"Open in a new tab","settings.advanced.summaryOpenIn.desk":"Show in Agent Desk","desk.title":"Agent Desk","desk.close":"Close panel","tool.verb.presented":"Presented","tool.verb.sketched":"Sketched","sketch.mobileUnavailable":"This card isn't available in the mobile app (open it on desktop or web).","sketch.expand":"Expand card","sketch.collapse":"Collapse card","settings.advanced.exportLogs":"Export session logs","settings.advanced.exportLogsHint":"Bundle this session’s full conversation, the actual interface state and action trail, renderer errors and the backend runtime logs into one JSON file for developer debugging.","settings.advanced.exportBtn":"Export as JSON","settings.advanced.exportNoSession":"No active session — open a session first, then export.","settings.advanced.exportOk":"Exported to {path}","settings.advanced.exportCanceled":"Export canceled","settings.advanced.exportFailed":"Export failed: {err}","settings.clearData.label":"Clear data / Uninstall","settings.clearData.hint":"Delete Forsion data on this machine. This cannot be undone; the app restarts fresh afterward.","settings.clearData.tangu":"Tangu data & project folders (account, settings, agents, sessions, ~/Forsion)","settings.clearData.desktop":"Desktop settings (window & Amadeus shell config)","settings.clearData.btn":"Clear & restart","settings.clearData.confirm":"Clear the selected data? This cannot be undone and the app will restart.","settings.clearData.macNote":"This only clears data. To fully uninstall Forsion, drag it from Applications to the Trash.","view.changelog":"What's new","changelog.newVersion":"New version {version} available","changelog.newest":"Latest","changelog.zhOnly":"Release notes for this version are available in Chinese only.","settings.developer.testUpdateLabel":"Update popup test","settings.developer.testUpdate":"Open update tab (test)","settings.developer.testUpdateHint":"Force-open the update tab to verify the update popup renders (no real new version required).","input.fileref.session":"Past session","input.slash.loop":"Max loop iterations: /loop <n> (currently {current}, range 1-200)","input.slash.loopSet":"Max loop iterations set to {n}","input.ctxLabel":"Context","input.sessionTokens":"Session {n} tokens","input.runCost":"Run cost {used}/{limit} pts","cost.nearCap":"⚠ Run cost reached {used} pts (limit {limit}, tune TANGU_MAX_RUN_COST); the run stops once the cap is exceeded","ctx.compacted.auto":"Context auto-compacted (~{saved} chars saved)","ctx.compacted.forced":"Context reached the auto-compact threshold; summarized and compacted","ctx.compacted.overflow":"Context exceeded the model limit; summarized, compacted and retried this turn","ctx.windowSource.override":"Window: manual override table","ctx.windowSource.model":"Window: model-reported","ctx.windowSource.family":"Window: inferred from model family (not model-reported)","ctx.windowSource.learned":"Window: learned from the provider's own overflow error","ctx.windowSource.default":"Window: 272k default fallback (unknown model; set it under Settings → Models)","ctx.windowCapped":"The model supports up to {max}; {n} is used by default","ctx.sec.persona":"Persona/instructions","ctx.sec.harness":"Self-evolution notes","ctx.sec.guidance":"Base guidance/contracts","ctx.sec.profile":"User profile","ctx.sec.project":"Project instructions","ctx.sec.agentFolder":"Agent folder/library","ctx.sec.memory":"Long-term memory","ctx.sec.skills":"Skill catalog","ctx.sec.environment":"Environment/tool catalog","ctx.sec.hooks":"Hooks context","ctx.sec.plan":"Plan mode","ctx.sec.history":"History ({n} messages)","ctx.files.label":"Instruction files loaded this run","ctx.files.truncated":"⚠ truncated over 32KB","ctx.files.none":"None (no AGENTS.md / CLAUDE.md in this project)","approval.why.customAsk":'Your approval rule "{rule}" requires asking you for this step',"approval.why.escalate":'Writes outside the workspace — this mode confirms every time ("always allow" does not apply)',"approval.why.protected":`Changes credentials or Forsion's local configuration — confirmed every time (full access and "always allow" do not skip it)`,"approval.why.mode":'The current approval mode "{mode}" requires your approval for this kind of action',"approval.why.control":'This sets up or changes work that can later run without you watching, so each call needs your confirmation ("always allow" does not apply)',"inbox.approval.withdrawnSystem":"The system withdrew this request (its stored details cannot be shown in full, or a newer request for the same action replaced it), so it cannot be approved here. Ask the agent to request it again if needed.","approval.cmdOverflow":"This command is too long to show in full; scroll to read all of it before approving.","approval.cmdWideBlank":"This command contains a long run of blank space that can push later text out of view; the full text with that space marked is shown below.","approval.previewScrollHint":"This is long; scroll to read all of it before approving.","approval.cmdHiddenChars":"This command contains invisible or direction-changing characters, so what you see may differ from what runs.","input.approval.editRules":"Edit rules…","input.approval.editRulesDesc":"Allow / ask / deny lists by tool name and argument prefix","approvalRules.loadFailed":"Couldn't load the existing rules, so the form is hidden — saving a blank form would wipe your lists.","approvalRules.title":"Custom approval rules","approvalRules.scopeNote":"⚠ Rules are global — stored in ~/.forsion/config.json and shared by all sessions; the approval mode is what you pick per session. Saved rules apply from the next tool call, no restart.","approvalRules.syntax":"Syntax: a tool name, or name* for prefix match, optionally followed by :argument-prefix (command for shell tools, path for file writes). e.g. web_fetch | mcp__* | run_bash:npm test | write_file:/etc/","approvalRules.base":"Fallback mode","approvalRules.baseHint":"Used when no rule matches (priority: deny > ask > allow > fallback)","approvalRules.deny":"Deny","approvalRules.denyHint":"Rejected outright, never asked. The model is told which rule blocked it.","approvalRules.denyPh":`write_file:/etc/
293
+ mcp__*`,"pill.thinkUnsupported":"(本模型不支持,将自动降档)","input.compact":"压缩上下文","input.compacting":"正在压缩上下文…","input.compactDone":"已压缩上下文(折叠 {n} 条消息为摘要,后续从此精简续接)","input.compactSkip":"无需压缩:{reason}","input.compactFail":"压缩失败:{e}","input.slash.compact":"压缩上下文:总结后精简续接","input.slash.voiceOn":"切到语音消息(该 Agent 回复变语音)","input.slash.voiceOff":"切回文字消息","input.slash.voiceOnHint":"已切到语音消息:该 Agent 之后的回复会以语音呈现(桌面语音条;微信端文字外附一份语音文件)。","input.slash.voiceOffHint":"已切回文字消息。","voice.play":"播放","voice.pause":"暂停","voice.label":"语音","voice.toText":"转文字","voice.toggleFailed":"语音模式切换失败:{e}","input.slash.stop":"停止当前运行","input.slash.skillUse":"本条消息使用技能 {name}","input.skillChipTitle":"本条消息将使用此技能","input.slash.agent":"选用 Normal Agent(自定义人格)","input.agentActive":"当前 Agent:{name}","input.agentCleared":"已取消 Normal Agent","input.engineDefault":"Tangu","input.engineChipTitle":"运行引擎","input.engineSection":"运行引擎","input.engineModelDefault":"用引擎默认","engine.pickTitle":"选择运行此对话的 Agent","engine.warming":"正在启动 {name}…","pill.more":"更多(翻页)","header.currentAgent":"当前 Agent","settings.tab.agentClis":"本机 Agent CLI","settings.agentClis.title":"外部 Agent CLI","settings.agentClis.hint":"检测到的第三方 Agent(Claude Code / Codex 等);可设默认模型。新会话开始时才能选用它们。","settings.agentClis.detected":"已检测到","settings.agentClis.needsSignin":"需登录","settings.agentClis.notDetected":"未检测到","settings.agentClis.notDetectedHint":"安装并登录该 Agent 后自动出现。","settings.agentClis.defaultModel":"默认模型","settings.agentClis.modelDefault":"(用引擎默认)","settings.agentClis.loadingModels":"加载模型…","settings.agentClis.empty":"无外部 Agent 引擎(仅本机形态可用)。","settings.agentClis.importHint":"导入后复制成 Tangu 自有技能/MCP(卸载该 CLI 也不丢);MCP 默认不启用,到 MCP 设置里开启。","settings.agentClis.skillsLabel":"已装技能","settings.agentClis.mcpLabel":"已装 MCP","settings.agentClis.importBtn":"导入","settings.agentClis.imported":"已导入","settings.tab.agents":"Agent","settings.agents.title":"Normal Agent(自定义人格)","settings.agents.hint":"为不同任务定义可复用的对话人格(system prompt + 模型 + 设置)。也可让 Agent 用 manage_agent 工具自创建。","settings.agents.new":"新建 Agent","settings.agents.createViaChat":"让 AI 帮我配置","settings.agents.createViaChatHint":"开一个新会话,用对话的方式让 Agent 帮你把新 Agent 建出来","settings.agents.empty":"暂无 Agent,点「新建 Agent」创建一个。","settings.agents.name":"名称","settings.agents.namePlaceholder":"如:代码审查员","settings.agents.desc":"简介","settings.agents.model":"模型(留空=用会话模型)","settings.agents.modelDefault":"(用会话模型)","settings.agents.systemPrompt":"开发指令(做什么 / 怎么做 / 必读什么)","settings.agents.systemPromptPlaceholder":"你是一位严谨的代码审查员……","settings.agents.thinking":"思考档位","settings.agents.maxIter":"最大循环轮数","settings.agents.approval":"审批档","settings.agents.inherit":"(继承)","settings.agents.byAgent":"Agent 创建","agent.badge.system":"后台","settings.agents.deleteConfirm":"删除 Agent「{name}」?","settings.agents.saveFail":"保存失败:{e}","settings.agents.cloudOnly":"Normal Agent 仅在本地(桌面/TUI)可用。","settings.agents.soul":"人格设定(SOUL)","settings.agents.soulPlaceholder":'沉静、专注;说话简洁,默认中文……(语气与价值观,区别于"做什么"的开发指令)',"settings.agents.shareMemory":"共用默认 Agent 的记忆和日志","settings.agents.shareMemoryHint":"开启后该 Agent 读写默认 Agent 的记忆/日志;默认关闭=有专属自己的记忆/日志。","settings.agents.cloudSync":"云同步(跨设备镜像)","settings.agents.cloudSyncHint":"开启后该 Agent 的全部文件(定义/记忆/日志/Library)在你的设备间完全镜像,新内容覆盖旧的;默认关闭=纯本地。","settings.agents.cloudSyncOn":"云同步:已开启","settings.agents.cloudSyncOff":"云同步:已关闭","settings.agents.activityAccess":"允许读取活动日志","settings.agents.activityAccessHint":"授权该 Agent 使用 read_activity 查看你的应用内操作记录;默认关闭=仅 Muse 可读。","settings.agents.toolPolicy":"工具黑白名单","settings.agents.toolPolicyNone":"不限制(全部可用)","settings.agents.toolPolicyDeny":"黑名单:取消勾选=禁用,引擎新增工具默认可用","settings.agents.toolPolicyAllow":"白名单:仅勾选的可用,引擎新增工具默认禁用","settings.agents.toolPolicyHint":"勾选=允许使用。仅约束下列常规工具;带权限门禁的工具(如 read_activity)不受名单影响。","settings.agents.toolPolicyEmpty":"工具目录不可用(需本地引擎在运行)。","settings.agents.avatar":"头像","settings.agents.avatarHint":"点击上传,≤1MB(PNG/JPG/GIF/WebP);存入该 Agent 的 Library。","settings.agents.avatarPick":"上传头像","settings.agents.avatarRemove":"删除头像","settings.agents.avatarTooLarge":"图片超过 1MB,请换更小的。","settings.agents.avatarSaveFirst":"请先保存 Agent,再设置头像。","settings.tab.shortcuts":"快捷键","settings.shortcuts.desc":"点击某条右侧的快捷键开始录制,按下组合键即设定;Esc 取消。同一组合键只会绑定到一个命令。","settings.shortcuts.commands":"命令与快捷键 · {count}","settings.shortcuts.searchPlaceholder":"搜索命令或快捷键","settings.shortcuts.resultCount":"显示 {count} 项","settings.shortcuts.noResults":"没有匹配的命令。","settings.shortcuts.commandPalette":"命令面板","settings.shortcuts.record":"点击录制快捷键","settings.shortcuts.recording":"按下组合键…","settings.shortcuts.reset":"恢复默认","settings.shortcuts.clear":"解绑","settings.shortcuts.unbound":"未设置","settings.shortcuts.resetAll":"全部恢复默认","settings.shortcuts.reassigned":"已从「{name}」解绑该快捷键","tool.verb.wrote":"写入","tool.verb.edited":"编辑","tool.verb.ran":"运行","tool.verb.read":"读取","tool.verb.listed":"列出","tool.verb.searched":"搜索","tool.verb.browsed":"浏览","tool.sum.wrote":"写入 {n} 文件","tool.sum.edited":"编辑 {n} 文件","tool.sum.ran":"运行 {n} 命令","tool.sum.read":"读取 {n} 项","tool.sum.searched":"搜索 {n} 次","tool.sum.browsed":"浏览 {n} 次","tool.sum.other":"{n} 个工具","settings.agents.isDefault":"默认","settings.agents.setDefault":"设为默认","settings.agents.viewMem":"查看大脑(记忆 / 日志 / 资料库)","settings.agents.brainSection":"大脑(记忆 / 日志 / 资料库)","settings.agents.brainSectionHint":"查看与编辑该 Agent 的长期记忆、按日日志和资料库文件。","settings.agents.openBrain":"打开大脑","settings.agents.memTitle":"{name} · Agent 大脑","settings.agents.memory":"长期记忆(MEMORY.md,可编辑)","settings.agents.memSaved":"已保存","settings.agents.log":"日志(LOG,可编辑)","settings.agents.noLog":"暂无日志","settings.agents.tabMemory":"记忆","settings.agents.tabLog":"日志","settings.agents.tabLibrary":"资料库","settings.agents.library":"资料库(Library/,参考资料 + 头像)","settings.agents.libraryEmpty":"暂无文件","settings.agents.libraryUpload":"上传文件","settings.agents.librarySelectHint":"点击文件查看 / 编辑","settings.agents.libraryBinaryHint":"二进制文件,仅预览","settings.agents.libraryDeleteConfirm":"删除文件「{name}」?","settings.agents.libraryTooLarge":"文件超过 5MB","settings.agents.userProfile":"用户画像(USER.md,所有 Agent 可见)","settings.agents.userProfileHint":"记录你的名字、偏好、水平、长期需求;所有 Agent 都会读到。","settings.agents.tabHarness":"进化史","settings.agents.harnessHint":"进化记录是 Agent 自我进化的内容:它从工作中自己总结的做法,以及它收起的装备。它自己写入立即生效,对话里会出现一张可撤销的更新卡;后台复盘和 Muse 的用量巡检也会直接写入,条目上标着来源,都可以在这里撤销。每次运行都会带上。","settings.agents.harnessEmpty":"还没有进化记录。Agent 自己摸索出的耐久做法会记在这里(它当场写,或由后台复盘写入);也可以在它的会话里输入 /refine 让它专门复盘一次。","settings.agents.harnessEvidence":"证据:{text}","settings.agents.harnessKindNote":"笔记","settings.agents.harnessKindRecipe":"做法","settings.agents.harnessKindEquip":"装备","settings.agents.harnessShelvedTools":"收起的工具:{names}","settings.agents.harnessShelvedSkills":"收起的技能:{names}","settings.agents.harnessCount":"{count} / {max} 条进化记录","settings.agents.harnessLastChange":"最近进化:{time}","settings.agents.harnessRefine":"复盘本次对话","settings.agents.harnessRefineSent":"已开始复盘,进度在对话里。","settings.agents.harnessShowAll":"显示全部 {count} 条","settings.agents.harnessLoading":"正在读取进化记录…","settings.agents.harnessLocalOnly":"进化记录仅在本机引擎可用。","settings.agents.harnessHistory":"编辑历史(本机)","settings.agents.harnessRollback":"撤销最近一次改动","settings.agents.harnessRestore":"恢复","settings.agents.harnessRollbackConfirm":"撤销「{title}」的最近一次改动?(再次撤销可还原)","settings.agents.harnessActCreate":"新建","settings.agents.harnessActUpdate":"修改","settings.agents.harnessActDelete":"删除","settings.agents.harnessActRollback":"回滚","settings.agents.harnessByHistorian":"后台复盘写入","settings.agents.harnessByMuse":"Muse 代为收起","settings.agents.harnessByUser":"你采纳的候选","settings.agents.harnessCandidates":"{count} 条候选","settings.agents.harnessCandidateNeedsYou":"等你确认","settings.agents.harnessCandidateAdopt":"采纳","settings.agents.harnessCandidateDismiss":"丢弃","settings.agents.harnessCandidateAdopted":"已采纳,写进了进化记录。","settings.agents.harnessCandidateDismissed":"已丢弃。","settings.agents.harnessCandidateGone":"这条候选已经不在了,已重新载入。","settings.agents.harnessCandidateFull":"进化记录已满({max} 条)。先撤掉或合并几条,再采纳。","settings.agents.harnessCandidateTooLong":"这条候选太长,一条记录放不下。可以丢弃,或让 Agent 自己改写后再记。","settings.agents.harnessCandidatesHint":"Historian 提名、但没有直接写进进化记录的做法。带网址、命令或权限字眼的由你逐条决定:采纳就写入,丢弃就删掉;其余的在复盘时由 Agent 逐条审阅,你也可以直接采纳或丢弃。","settings.agents.selfAuthored":"自建","settings.agents.sharedSkill":"共享","agent.pickTitle":"选择 Agent","settings.tab.special":"后台 Agent","settings.special.title":"后台特殊 Agent(Special Agents)","settings.special.hint":"默认开启;手动关闭后不会被自动打开。不选模型时跟随云端默认;其记录隔离存于本地,不进会话列表。","settings.special.pickModelFirst":"请先选模型再开启","settings.special.followCloudDefault":"跟随云端默认({model})","settings.model.imageCloudDefaultTag":"云端默认","settings.model.imageFollowingDefault":"未手动选择,当前跟随云端生图默认:{model}。点击任一模型可改为手动指定,再点一次取消。","settings.special.model":"模型","settings.special.enable":"启用","settings.special.historian":"Historian(历史员)","settings.special.historianDesc":"每 X 轮总结会话标题;每 Y 轮判断并更新你的 LOG 与记忆。","settings.special.muse":"Muse(缪斯)","settings.special.museDesc":"后台常驻:按心跳、日程、规则醒来,在自己的 Library 里做事;越界操作按权限档处理,产出进收件箱和 Muse Space。","settings.special.h.rounds":"每几轮维护(标题+记忆)","settings.special.h.firstRound":"首轮必触发","settings.special.h.harnessCandidates":"自进化自动档","settings.special.h.harnessCandidatesHint":"判官从对话里提名 Agent 自己摸索出的做法:像一条工作方法的直接写进它的进化记录;带网址、命令或权限、凭据字眼的留在候选里,等你在详情「进化」里逐条采纳或丢弃。写进去时正在看的会话会弹通知,可在详情「进化」里查看或撤销。","settings.special.h.prompt":"记忆判断提示词(留空=默认)","settings.special.m.maxIter":"每周期最多轮数","settings.special.m.maxTodos":"每窗口最多 TODO","settings.special.m.activeHours":"运行时段(本机时间)","settings.special.m.activeAllDay":"全天","settings.special.m.persona":"人格与指令在 Agent 名册的「Muse」里编辑。","settings.special.m.folders":"额外文件夹(每行一个绝对路径)","settings.special.m.foldersHintAsk":"审批 / 代批档:只是提示 Muse 去看这些目录,写入仍按权限档排队审批。","settings.special.m.foldersHintAuto":"全开档:这些目录可直接读写。","settings.special.m.secRhythm":"节奏","settings.special.m.budget":"预算","settings.special.m.budgetWindow":"预算窗口(小时)","settings.special.m.maxCycles":"每窗口最多周期","settings.special.h.mode":"工作模式","settings.special.h.modeIndependent":"独立","settings.special.h.modeAssist":"辅助","settings.special.h.modeFork":"分身","settings.special.h.modeHintIndependent":"Historian 用上方模型读取最近对话记录,自行判断并维护标题、摘要、日志与记忆。","settings.special.h.modeHintAssist":"到点后分支出一场简短的后台讨论,与该会话的 Agent 商议,由主 Agent 自己决定并写入;标题/摘要仍由 Historian 维护,首轮始终独立。","settings.special.h.modeHintFork":"用会话模型在完整上下文的尾部分叉一次补全来做判断——上下文缓存可命中,比独立模式看得更全;失败自动回落独立模式。上方模型仅用于回落判断与记忆整固。","settings.special.h.fallbackModel":"回落 / 整固模型","settings.special.saved":"已保存","settings.special.saveFail":"保存失败:{e}","settings.special.on":"启用","settings.special.off":"关闭","settings.special.custom":"自定义","settings.special.sectionTitle":"后台 Agent(Special Agents)","settings.agents.sectionTitle":"Normal Agent(自定义人格)","settings.agents.starterTemplate":"你是……(在此描述这个 Agent 的身份、专长与说话风格,以及它应如何完成任务)。","sidebar.special.title":"后台 Agent","special.action.title_updated":"更新标题","special.action.summary_updated":"更新摘要","special.action.log_appended":"写入日志","special.action.memory_appended":"写入记忆","special.action.memory_updated":"更新记忆","special.action.assist_discussion":"发起记忆讨论","special.muse.title":"Muse 工作区","special.muse.thinking":"当前思考","special.muse.idle":"Muse 空闲中","special.muse.running":"Muse 思考中…","special.muse.disabled":"Muse 未开启(在设置 → 后台 Agent 中开启并选模型)。","special.muse.todos":"Muse TODO 清单","special.muse.todosEmpty":"暂无 TODO。Muse 会在后台思考后提交高价值待办。","special.muse.selectAll":"全选","special.muse.inject":"注入所选到会话并运行","special.muse.pickSession":"选择目标会话…","special.muse.injected":"已注入 {n} 条到会话并开始运行","special.muse.dismiss":"忽略","special.muse.markDone":"标记完成","special.muse.injectFail":"注入失败:{e}","special.muse.watches":"盯任务","special.muse.watchesAll":"全部自动化 →","special.muse.watchesHint":"在任意聊天里说「帮我盯着 xxx.md 写满 100 字」即可设定;条件命中时 Muse 会被唤醒并提出待办。","special.muse.trigFile":"「{path}」达到 {n} 字","special.muse.trigEvent":"活动包含「{match}」","special.muse.trigDaily":"每天 {time}","special.muse.trigFired":"上次触发 {t}","special.muse.watchDelete":"删除规则","special.muse.approvals":"待批准","special.muse.approvalsEmpty":"没有等待你批准的操作。","special.muse.approve":"批准并执行","special.muse.reject":"拒绝","special.muse.approveFail":"批准失败:{e}","special.muse.approvalNote":"默认 Agent 代批意见:{note}","special.muse.runNew":"新会话执行所选","special.muse.injectPrefix":"请处理以下来自 Muse 的待办:","muse.lib.openEditor":"在编辑器中打开","special.muse.tracks":"追踪中","special.muse.tracksEmpty":"没有正在追踪的任务。在聊天里的任务卡上点「交给 Muse 追踪」即可添加。","special.muse.trackDelete":"停止追踪","special.muse.modeLabel":"权限档","special.muse.pending":"{n} 项待批","space.muse":"Muse","muse.builtinDesc":"Muse Space:Muse 自建的 Space(它自己写的 Forsion 插件,逐周期迭代),右栏批准它的越界操作;还没搭建时显示它的工作区。","view.museLibrary":"Muse 工作区","view.museHome":"Muse Space","muse.openLibrary":"打开 Muse 工作区","view.musePanel":"Muse","muse.lib.empty":"Muse 还没写任何东西。开启 Muse 后,它的笔记、草稿和每日工作日志会出现在这里。","muse.lib.refresh":"刷新","chat.task.here":"在此执行","chat.task.new":"新会话执行","chat.task.muse":"交给 Muse 追踪","chat.task.ignore":"忽略","chat.task.trackTag":"追踪","chat.task.tracked":"已交给 Muse 追踪(日历里可见)","chat.task.trackFail":"交给 Muse 失败:{e}","chat.task.doneHere":"已在此执行","chat.task.doneNew":"已在新会话执行","chat.task.doneMuse":"已交给 Muse 追踪","chat.task.doneIgnore":"已忽略","chat.task.showPrompt":"查看任务书","chat.task.hidePrompt":"收起任务书","chat.task.tooLong":"任务书超过 4000 字,无法交给 Muse 追踪;请拆小,或在此 / 新会话执行。","chat.task.museDo":"交给 Muse 执行","chat.task.doneMuseDo":"已交给 Muse 执行","chat.task.handedDo":"已交给 Muse:它下次运行时处理(受运行时段和预算限制),超出权限的操作会再请你审批","chat.task.museOff":"Muse 已关闭:先在设置里开启它,或改用新会话执行","chat.task.todoSyncFail":"待办状态没同步上:{e}","chat.task.doneTodo":"这条待办已经处理过了","chat.task.todoChecking":"正在确认这条待办的状态…","chat.task.todoCheckFail":"待办状态读取失败","chat.task.todoMissing":"这条待办已不存在","special.muse.actionFail":"操作失败:{e}","special.muse.execFailed":"已批准,但执行失败:{e}","settings.special.m.mode":"权限档","settings.special.m.modeAsk":"审批(越界操作排队等你批准)","settings.special.m.modeAgent":"代批(默认 Agent 替你裁决一次)","settings.special.m.modeAuto":"全开(完全自动)","settings.special.m.modeDesc":"三档都能在 Muse 自己的 Library 里自由工作;越界写入与命令按档位处理,插件安装始终需要你确认。","settings.special.m.heartbeat":"心跳间隔(分钟,0=只按日程/规则醒来)","settings.special.m.heartbeatHint":"比巡检更细时巡检自动跟着缩到这个粒度;实际次数仍受预算里「每窗口最多周期」封顶。","settings.special.m.notify":"通知","settings.special.m.notifyMode":"发送方式","settings.special.m.notifyImmediate":"即时","settings.special.m.notifyDigest":"日报","settings.special.m.escalateTo":"难活交给","settings.special.m.escalateNone":"不指定","settings.customProvider.fetchModels":"拉取模型","settings.customProvider.fetchEmpty":"未发现模型(端点未返回列表)","sidebar.search.placeholder":"搜索会话…","sidebar.search.noResults":"无匹配会话","sidebar.deleteConfirm":"永久删除会话「{name}」?此操作不可恢复。","chat.action.quote":"引用","chat.action.askInPanel":"在侧栏提问","chat.selection.actions":"选中文本操作","chat.error":"运行出错","chat.llmRetrying":"网络波动,{s} 秒后自动重试(第 {n}/{max} 次)","chat.err.network":"无法连接模型服务(网络不通或服务未启动)","chat.err.dropped":"连接中途断开(网络波动),回复未完成","chat.err.timeout":"请求超时,网络或模型响应过慢","chat.err.auth":"鉴权失败,请检查 API Key 或登录状态","chat.err.rate":"请求被限流,请稍后重试","chat.err.server":"模型服务端错误,请稍后重试","chat.err.quota":"AI 额度已用尽:点左下角头像可查看用量、使用重置卡立即恢复,或升级会员提高上限","chat.err.runCost":"本次运行成本达到上限,已自动停止","chat.err.inputTooLarge":"输入内容过长,超出模型可处理范围,请精简后重试","chat.err.groupAgents":"团队模式至少需要 2 个有效的 Agent","chat.err.orphaned":"运行意外中断(应用重启或进程退出),请重试","chat.err.engineRemote":"外部引擎不能从远程设备驱动,请回到那台电脑上继续这段对话","chat.edit.saveResend":"保存并重发","group.voting.inProgress":"正在投票…","workbench.chat":"对话","workbench.leftSidebar":"左侧栏","workbench.rightSidebar":"右侧栏","theme.changeSkin":"切换主题色","theme.changeMode":"切换明暗模式","theme.changeLanguage":"切换主题外观","command.palette":"命令面板 (⌘K)","command.search":"搜索","command.toggleSmoothCaret":"开关丝滑光标","command.toggleLeft":"切换左侧栏","command.toggleRight":"切换右侧栏","command.toggleBottom":"切换底部面板","panel.emptyTitle":"空面板","panel.empty":"这个面板是空的,把标签页拖进来试试。","command.splitRight":"分屏到右侧","command.resetLayout":"恢复默认布局","command.stop":"停止当前运行","command.compact":"压缩上下文","command.branch":"从最近回复分支","command.saveLayout":"保存命名布局","command.applyLayout":"恢复命名布局","layout.namePrompt":"布局名称","layout.saved":"已保存布局「{name}」","layout.none":"还没有已保存的命名布局","layout.applyPrompt":"输入要恢复的布局名称:{names}","status.context":"上下文","header.connecting":"连接中…","command.placeholder":"运行命令…","command.empty":"没有命令","command.select":"选择","command.run":"运行","command.count":"{count} 条命令","group.host":"主持人","special.agents.title":"后台 Agent","special.memory.title":"记忆","sidebar.special.historianSub":"总结标题 · 维护记忆","sidebar.special.museSub":"后台思考 · 产出 TODO","sidebar.wechat.setConnectedOk":"已设为微信正在连接的会话。","sidebar.wechat.setConnectedFail":"设置失败:{e}","preview.close":"关闭","preview.expand":"展开","preview.collapse":"收起","preview.download":"下载","preview.notFound":"文件不存在","preview.loadFailed":"加载失败","preview.notAvailable":"此文件类型无法预览","preview.tooLarge":"文件过大({size}),不支持预览","preview.htmlPreview":"预览","view.wsfile":"文件预览","preview.openWithDefault":"用默认应用打开","preview.unsupportedAsk":"无法预览此类型,用系统默认应用打开?","preview.expired":"预览内容已过期(此类预览不随重启保留),请从来源重新打开","preview.mdEdit":"编辑","preview.openInAmadeus":"在 Amadeus 中打开","preview.mdConflict":"文件已被外部修改","preview.mdReload":"重新加载","preview.mdOverwrite":"覆盖写入","preview.mdSaveFail":"保存失败:{err}","preview.mdSalvaged":"文件已被外部修改,你的编辑已另存为「{file}」","panel.toast.invalidName":"非法的名字:{name}","panel.action.open":"打开","panel.action.newFile":"新建文件","panel.action.newFolder":"新建文件夹","panel.action.copyPath":"复制路径","preview.htmlCode":"源码","preview.reload":"重新加载","preview.openInBrowser":"在浏览器中打开(同一预览服务器,可用本人账号调 Forsion AI)","preview.csvTruncated":"仅显示前 {shown} 行(共 {total} 行)","preview.slide":"幻灯片 {n}","preview.wrap":"自动换行","preview.zoomIn":"放大","preview.zoomOut":"缩小","preview.fit":"适应","preview.diffSideBySide":"并排","preview.diffLineByLine":"逐行","preview.pdfPages":"仅渲染前 {n} 页(共 {total} 页),下载查看全部","panel.action.preview":"预览","panel.action.deleteN":"删除 {n} 项","panel.confirm.trashN":"把选中的 {n} 项移到回收站?","panel.confirm.delete":"删除「{name}」?","panel.confirm.deleteN":"删除选中的 {n} 个文件?","panel.toast.copied":"已复制 {n} 项到工作区","panel.toast.copyFail":"复制失败:{err}","panel.toast.moveFail":"移动失败:{err}","settings.tab.notifications":"通知","settings.tab.statusbar":"状态栏","ntf.enable":"启用通知","ntf.delivery":"通知方式","ntf.enableHint":"右上角弹出的悬浮小卡片;关闭后所有通知静默(错误也不弹)。","ntf.osEnable":"系统通知","ntf.osEnableHint":"应用切到后台时,同步弹一条系统通知(所有通知类型,不止收件箱)。","ntf.sendTest":"发送测试通知","ntf.testBody":"这是一条测试通知 👋","ntf.events":"通知事件","ntf.eventsHint":"只保留需要关注的事件,减少无效打扰。","ntf.event.system":"系统消息","ntf.event.syncError":"同步失败 / 冲突","ntf.event.syncDone":"远程同步完成","ntf.event.syncDoneOnline":"在线同步完成","ntf.event.agentDone":"后台会话完成","ntf.event.inbox":"收件箱新消息","ntf.event.noteReminder":"笔记提醒(@remind:)","ntf.event.harnessCandidates":"进化记录的后台更新与候选","ntf.event.projectCandidates":"项目记忆里等你确认的候选","ntf.event.projectCompacted":"项目记忆写满后被压缩","ntf.pluginEvents":"插件通知","ntf.pluginEventsHint":"每个插件一个开关(ctx.notify 的来源;关掉即静音该插件)。","ntf.view":"查看","ntf.syncError":"在线同步失败:{e}","ipcerr.notLoggedIn":"未登录 Forsion 账号","ipcerr.loginExpired":"登录已失效,请重新登录 Forsion 账号","ipcerr.vaultMissing":"智库目录不存在:{detail}","ipcerr.mirrorMissing":"镜像目录不存在(已有同步记录,不会自动新建空目录):{detail}","ipcerr.scanFailed":"本地目录读取失败,本轮不推断删除:{detail}","ipcerr.invalidSpaceId":"非法的 Space 标识","ipcerr.invalidPluginId":"非法的插件标识","ipcerr.notUserPlugin":"插件不在用户目录(内置 / 首方插件不可卸载)","ipcerr.pluginNotFound":"插件不存在","ipcerr.mcpNameReserved":"MCP 服务名「{detail}」是保留名:dev 与 dev_ 开头的名字留给设备工具,请换一个名字","settings.discovery.mcpReserved":"未导入 {names}:dev 与 dev_ 开头的 MCP 服务名留给设备工具。换个名字后可在 MCP 页手动添加。","ntf.syncDone":"在线同步完成","ntf.noteReminder":"提醒 · {src}","ntf.remoteSyncDone":"远程同步完成:{n} 项变更","ntf.remoteSyncFail":"远程同步失败:{e}","ntf.remoteSyncConflicts":"远程同步冲突:{n} 项待处理","ntf.remoteSyncPendingDel":"远程同步:{n} 项删除待确认","ntf.actionReview":"去处理","ntf.agentDone":"「{name}」已完成","ntf.agentFail":"「{name}」运行失败","ntf.harnessCandidates":"「{name}」有新的进化记录候选,复盘一下?","ntf.harnessConfirm":"「{name}」有进化记录候选等你确认:它们带网址、命令或权限字眼,后台没有直接写。","ntf.projectCandidates":"项目「{name}」有后台记下的事实等你确认:它们带网址、命令或权限字眼,没有直接记进项目记忆。","ntf.projectCompacted":"项目「{name}」的记忆写满了,Agent 已把它压缩一遍再记新的。被合并或去掉的原句可以在项目详情里逐句恢复。","ntf.actionRefine":"复盘","ntf.actionView":"查看","ntf.harnessAdopted":"「{name}」的进化记录新增了后台复盘出的做法:{titles}。可在「进化」里查看或撤销。","sb.enable":"显示状态栏","sb.display":"显示方式","sb.enableHint":"窗口底部一条细栏,按当前视图显示同步 / 反链 / 字数等信息。默认关闭;同步出错时会临时出现,只显示同步状态。","sb.items":"状态栏","sb.itemsHint":"取消勾选即隐藏;拖动调整顺序(插件项启用后自动出现在列表里)。","sb.side.left":"前","sb.side.right":"后","sb.item.space":"当前 Space","sb.item.agentRunning":"运行中的会话","sb.item.sync":"同步状态","sb.item.backlinks":"反向链接","sb.item.wordCount":"字数统计","sb.item.inbox":"收件箱未读","sb.agentRunning":"{n} 个运行中","sb.synced":"已同步","sb.syncing":"同步中 · {n}","sb.syncingPlain":"同步中…","sb.syncProgress":"同步 {done}/{total}","sb.syncError":"同步异常","sb.syncOffline":"离线","sb.chars":"{n} 字","sb.backlinks":"{n} 反链","amadeus.default.note":"未命名","amadeus.default.dashboard":"未命名仪表盘","amadeus.default.drawing":"未命名白板","amadeus.default.database":"未命名多维表","amadeus.default.folder":"新文件夹","amadeus.default.section":"新分区","amadeus.default.pdfBookmark":"第 {page} 页","amadeus.new.note":"新建笔记","amadeus.new.childNote":"新建子笔记","amadeus.new.dashboard":"新建仪表盘","amadeus.new.dashboardIn":"在「{folder}」中新建仪表盘","amadeus.new.drawing":"新建白板","amadeus.new.drawingIn":"在「{folder}」中新建白板","amadeus.new.folder":"新建文件夹","amadeus.new.folderIn":"在「{folder}」中新建文件夹","amadeus.new.database":"新建 Base","amadeus.new.databaseIn":"在「{folder}」中新建 Base","amadeus.exists":"「{name}」已存在","amadeus.cmd.quickSwitch":"快速切换笔记","amadeus.cmd.search":"搜索笔记(全文)","amadeus.cmd.tutorial":"打开使用教程","amadeus.cmd.manual":"打开使用手册","amadeus.cmd.dailyNote":"打开今天的日记","amadeus.cmd.toggleStar":"收藏 / 取消收藏当前笔记","amadeus.cmd.toggleSource":"切换 源码 / 可视 编辑","amadeus.cmd.openVault":"打开智库…","amadeus.cmd.reveal":"在文件管理器中显示当前笔记","amadeus.cmd.reindex":"重建全文索引","amadeus.cmd.toggleWikiFiles":"切换 双链补全是否包含附件与多维表","amadeus.cmd.wikiFilesOn":"双链补全已包含附件与多维表","amadeus.cmd.wikiFilesOff":"双链补全只包含笔记"},ld={"common.save":"Save","chat.wait.sending":"Sending context ({kb} KB)","chat.wait.firstToken":"Waiting for the model","chat.wait.elapsed":"{s}s elapsed","settings.python.label":"Python","settings.python.bundled":"Bundled (recommended)","settings.python.system":"System","settings.python.hint":"Bundled: no install, isolated from your own Python. System: use your installed python (restart backend to apply).","settings.mirror.label":"Network mirror","settings.mirror.toggle":"Use China mainland mirrors","settings.mirror.recommend":"Your system locale suggests mainland China — enabling mirrors is recommended for faster downloads.","settings.mirror.hint":"When on, guided installs, pip installs, agent-run npx/git and store downloads use domestic mirrors (Tsinghua/npmmirror/multi-proxy GitHub). Env vars are injected only into commands Forsion spawns — no system config files are modified; turn off anytime. pip/npm/git parts require managed backend mode.","settings.mirror.test":"Test connection","settings.mirror.unreachable":"unreachable","settings.test.canceled":"Canceled","settings.test.timeout":"✗ Connection timed out","onboarding.env.mirrorLabel":"Network","onboarding.env.recheck":"Re-check","onboarding.env.installOk":"{tool} installed · {version}","onboarding.env.installedButMissing":'Command finished, but {tool} is still not detected. A restart of the app or a new terminal may be required — or hit "Re-check".',"onboarding.env.installFail":"{tool} install failed (exit {code}) — check the log below.","onboarding.env.pythonBundled":"Python is bundled — no separate install needed.","onboarding.env.copyCmd":"Copy command","onboarding.env.copied":"⤷ Copied — paste and run it in Terminal (requires your password): {command}","sidebar.newChat":"New session","sidebar.memory":"Memory","sidebar.agents":"Background agents","sidebar.viewMore":"View more","tip.folder":"{files} files, {folders} folders","tip.sessions":"{count} sessions","tip.modified":"Modified: {t}","tip.created":"Created: {t}","input.project.label":"Project","input.project.none":"No project","input.project.dontWork":"Don’t work in a project","input.project.search":"Search projects","input.project.noMatches":"No matching projects","input.project.add":"Add local project","input.project.addCloud":"New cloud project","input.project.cloudName":"Project name, Enter to create","app.amadeusWorkspace":"Amadeus · {name}","app.createProjectFail":"Failed to create project: {e}","ws.detail.count":"{n} sessions","ws.detail.newChat":"New session in this project","ws.detail.empty":"No sessions in this project yet","ws.detail.viewMore":"View more","agents.detail.title":"Background agents","agents.detail.settings":"Settings","agents.detail.historian":"Historian activity","agents.detail.noActivity":"No activity yet","settings.advanced.sessionLimit":"Sessions shown per project in sidebar","settings.mcpServer.label":"External MCP endpoint (for other agents)","settings.mcpServer.hint":"When on, a local HTTP MCP endpoint runs on this machine so external agents (Claude Code / Codex / OpenCode, etc.) can call Forsion Desktop capabilities (currently: send to inbox). Listens on 127.0.0.1 only, token-authenticated.","settings.mcpServer.enable":"Expose to external agents (Claude Code / Codex / OpenCode, etc.)","settings.mcpServer.connectHint":"Pick your agent and copy the config to connect (token embedded):","settings.mcpServer.endpoint":"Endpoint","settings.mcpServer.generic":"Generic JSON","settings.mcpServer.genericNote":"Any Streamable HTTP MCP client (Cursor / Windsurf / Cline, etc.) works with the Generic config — url + Authorization header.","settings.mcpServer.copy":"Copy","settings.mcpServer.notRunning":"Endpoint failed to start. Check logs or restart the app.","common.cancel":"Cancel","common.retry":"Retry","chat.action.copy":"Copy","chat.you":"You","workbench.noSession":"Select or start a session to view","workbench.sessions":"Sessions","space.home":"Home","space.tangu":"Tangu","space.amadeus":"Note","space.calendar":"Calendar","view.todo":"To-do list","view.calendar":"Calendar","view.calendarConfig":"Calendar settings","view.db":"Database","view.drawing":"Whiteboard","space.coding":"Coding Studio","view.codeStudio":"Coding Studio","space.artificial":"Creations","view.artificial":"Creations","view.product":"Creation","space.public":"Publish","view.publicHub":"Published","public.title":"Published","public.subtitle":"Manage your published sites and notes in one place","public.needLogin":"Sign in to Forsion to see your published content","public.refresh":"Refresh","public.empty":"Nothing yet","public.open":"Open","public.copy":"Copy link","public.copied":"Copied","public.unpublish":"Unpublish","public.revoke":"Revoke","public.confirm":"Confirm?","public.sites":"My sites","public.sitesDesc":"Web apps hosted by Forsion Connect","public.published":"Published notes","public.publishedDesc":"Public read-only share links","public.shared":"Shared notes","public.sharedDesc":"Pages you invited others to edit / view","public.disabled":"Disabled","public.unavailable":"Not available in this environment","coding.code":"Code","coding.preview":"Preview","coding.reload":"Reload preview","coding.noEntry":"No entry page","coding.noFile":"No file selected","coding.pickFile":"Pick a file from the tree on the right to edit","coding.emptyPreview":"Nothing to preview yet. Ask the Coding Agent on the left to generate an index.html.","coding.projects":"Projects","coding.newProject":"New project","coding.publish":"Publish","coding.publishTitle":"Publish to Forsion","coding.publishDesc":"Publish this web app as a public link. Inside the app, window.forsion gives access to Forsion AI — visitors sign in with their own Forsion account and spend their own quota.","coding.publishName":"App name","coding.publishSlug":"Link slug","coding.publishSlugHint":"3-32 chars: lowercase letters / digits / hyphens","coding.publishEntry":"Entry page","coding.publishSlots":"Published {used}/{limit} ({tier})","coding.publishBtn":"Publish","coding.publishUpdate":"Update","coding.publishing":"Publishing…","coding.unpublish":"Unpublish","coding.unpublishConfirm":"Confirm unpublish?","coding.publishNeedLogin":"Publishing requires a Forsion account","coding.loginNow":"Sign in to Forsion","coding.loginWaiting":"Waiting for browser authorization…","coding.copyLink":"Copy link","coding.copied":"Copied","coding.openLink":"Open","coding.publishHint":"Use relative paths for assets; .ts/.tsx are transpiled on publish, no build step.","coding.publishNoEntry":"No .html entry in this project yet — generate a page first.","coding.listingTitle":"Store","coding.listingHint":'Listed apps appear publicly under "Web apps" in the store after platform review.',"coding.listingNone":"Not listed","coding.listingPending":"In review","coding.listingApproved":"Listed","coding.listingRejected":"Rejected","coding.listingNoteLabel":"Reason: {note}","coding.listingApply":"Apply to list","coding.listingReapply":"Re-apply","coding.listingWithdraw":"Withdraw","coding.listingDelist":"Delist","coding.listingSummaryPh":"One sentence about this app (shown on its store card after review, ≤300 chars)","coding.listingSubmit":"Submit","coding.termsTitle":"Publish as a public page","coding.termsIntro":"Once published, anyone with the link can view this page, and it may be shared or indexed by search engines. Please confirm:","coding.termsLi1":"You have the right to publish all text, images, audio, video, and other content on the page;","coding.termsLi2":"The page contains no illegal information, infringing content, or personal information disclosed without permission;","coding.termsLi3":"You take responsibility for the content you publish.","coding.termsManage":"The platform manages public content per applicable laws and the Content Publishing Guidelines, and may restrict access to, stop displaying, or remove violating content.","coding.termsAgreePre":"I have read and agree to the ","coding.termsGuidelines":"Content Publishing Guidelines","coding.termsConfirm":"Confirm & publish","coding.cancel":"Cancel","coding.projectName":"Project name","coding.create":"Create","coding.noProjects":'No projects yet. Click "New project" to create your first one.',"coding.switchProject":"Switch project","coding.generating":"Generating…","space.inbox":"Inbox","inbox.list":"Messages","inbox.reader":"Message","inbox.filter.unread":"Unread","inbox.filter.archived":"Archived","inbox.source.forsion":"Forsion","inbox.source.automation":"Automations","inbox.source.agents":"Agents","inbox.reader.empty":"Select a message to read","inbox.sender.system":"System","inbox.sender.automation":"Automation","inbox.action.markRead":"Mark as read","inbox.action.markUnread":"Mark as unread","inbox.action.readAll":"Mark all read","inbox.action.archive":"Archive","inbox.action.unarchive":"Unarchive","inbox.action.delete":"Delete","inbox.action.refresh":"Check for new","inbox.action.chat":"Chat with {name}","inbox.deleteConfirm":'Delete "{title}"?',"time.justNow":"just now","net.unavailable":"Network unavailable. Try again later.","inbox.pullOk":"Pulled {n} new messages","inbox.pullNone":"No new messages","inbox.opFail":"Operation failed: {e}","inbox.attach.title":"Attached items","inbox.attach.claim":"Claim","inbox.approval.title":"Approval request","inbox.approval.loading":"Loading the approval record…","inbox.approval.missing":"This approval record was not found (it may have expired or been cleaned up)","inbox.approval.approved":"Approved and executed","inbox.approval.rejected":"Rejected","inbox.approval.executing":"Executing…","inbox.approval.failed":"Approved, but the run failed","inbox.approval.loadFail":"Could not load the approval record","inbox.approval.retry":"Retry","inbox.approval.reason.customAsk":"Required by your approval rules","inbox.approval.reason.rule":'Approval rule "{rule}"',"inbox.approval.reason.escalate":"Writes outside the workspace","inbox.approval.reason.mode":"Required by the approval mode","inbox.approval.reason.control":"Sets up unattended work","inbox.attach.claiming":"Claiming…","inbox.attach.claimed":"Claimed","inbox.attach.expired":"Expired — cannot claim","inbox.claim.ok":"Claimed — items added to your account","inbox.claim.already":"Already claimed before","inbox.claim.fail":"Claim failed","inbox.claim.unmet":"Requirements not met, so this reward cannot be claimed yet","inbox.attach.unmet":"Requirements not met","inbox.req.title":"Requirements","inbox.req.version":"App {v} or later","inbox.req.tiers":"{tiers} plan","inbox.req.currentVersion":"Current version {v}","inbox.req.currentTier":"Current: {tier}","inbox.req.other":"Other requirements (checked when you claim)","inbox.feedback.title":"Feedback thread","inbox.feedback.event.created":"New user feedback","inbox.feedback.event.user_reply":"A user replied to feedback","inbox.feedback.event.admin_reply":"Your feedback got a reply","inbox.feedback.loading":"Loading feedback thread…","inbox.feedback.loadFail":"Could not load the feedback thread","inbox.feedback.signIn":"Sign in to your Forsion account to view and reply","inbox.feedback.missing":"This feedback ticket no longer exists","inbox.feedback.retry":"Retry","inbox.feedback.you":"You","inbox.feedback.support":"Forsion support","inbox.feedback.user":"User","inbox.feedback.replyPh":"Write a reply…","inbox.feedback.attach":"Add attachment","inbox.feedback.attachHint":"Images, text or JSON, up to 5MB each, 5 files max","inbox.feedback.remove":"Remove","inbox.feedback.send":"Send","inbox.feedback.sending":"Sending…","inbox.feedback.sendFail":"Send failed: {e}","inbox.feedback.tooMany":"At most 5 attachments","inbox.feedback.tooBig":"{name} exceeds 5MB or is empty","inbox.feedback.badType":"{name} is not a supported type (images, text or JSON only)","inbox.feedback.download":"Download","inbox.feedback.status.open":"Open","inbox.feedback.status.in_progress":"In progress","inbox.feedback.status.resolved":"Resolved","inbox.feedback.status.closed":"Closed","inbox.tier.free":"Free","inbox.tier.plus":"Plus","inbox.tier.pro":"Pro","inbox.expiresAt":"Valid until {d}","inbox.expired":"Expired","settings.inbox.title":"Inbox","settings.inbox.notifyLabel":"System notifications for new messages","settings.inbox.notifyHint":"Notify when new messages arrive (click jumps to Inbox); badges stay on when off.","amadeus.pages":"Vault","amadeus.editor":"Editor","amadeus.outline":"Outline","amadeus.backlinks":"Backlinks","amadeus.search":"Search","amadeus.tags":"Tags","amadeus.graph":"Graph","chat.action.copied":"Copied","chat.action.edit":"Edit","chat.action.resend":"Send","chat.action.regenerate":"Regenerate","chat.action.branch":"Branch from here","chat.branchTitle":"{title} (branch)","chat.branchEmpty":"No AI reply to branch from yet","chat.branched":"Branched into a new session (history inherited)","input.slash.branch":"Branch a new session from the latest reply (inherits history)","app.branchFail":"Branch failed: {e}","sidebar.ws.menu":"Project actions","sidebar.ws.rename":"Rename project","sidebar.ws.remove":"Remove project","app.truncateFail":"Failed to truncate messages: {e}","search.jumpOutOfWindow":"The matched message is further back in history — opened the chat but could not scroll to it","rewind.busy":"Cannot rewind while a run is in progress — stop it first","rewind.noTime":"This message has no timestamp, so there is no point to rewind to","rewind.codeDone":"Code rewound ({n} file(s))","rewind.codePartial":"{bad} file(s) failed to rewind — aborted (conversation untouched)","rewind.codeSkipped":"Code rewound for {n} file(s); {bad} had no snapshot and cannot be restored","rewind.codeConflict":"Code rewound for {n} file(s); {kept} changed since then were kept as-is (not deleted)","inquiry.sendFail":"Answer was not delivered: {e} — please retry","rewind.codeFail":"Failed to rewind code: {e}","app.resendFailed":"Resend failed; restored locally — please retry.","app.regenNoUser":"No user message to regenerate from","app.wsRenameFail":"Failed to rename project: {e}","app.moveToProjectFail":"Could not move the conversation into the creation folder: {e}","app.moveToProjectHalf":"This conversation was only partly moved: its project is now “{name}”, but its working folder was not changed ({e}).","app.sessionMoving":"This conversation is being moved into the creation folder. Send again in a moment.","app.wsRemoveFail":"Failed to remove project: {e}","app.wsRemoved":'Project "{name}" removed',"app.wsTrashFail":"The sessions were deleted, but the .tangu folder could not be moved to the Trash: {e}","app.agentTrashFail":"The agent was deleted, but its files could not be moved to the Trash; they are still in {path}","app.sessionExpired":"Session expired — please sign in to your Forsion account again","onboarding.connect.cloudSync":"Enable cloud sync (sync cloud Agents)","onboarding.connect.cloudSyncHint":"When on, your memory, logs and Agents marked for cloud sync stay in sync across your signed-in devices. You can change this later in Settings → Forsion account.","common.confirm":"OK","extendView.close":"Close extension","extendView.failed":"Extension failed to load","extendView.back":"Back","common.close":"Close","common.back":"Back","common.refresh":"Refresh","common.loading":"Loading…","common.listSep":", ","common.delete":"Delete","common.edit":"Edit","common.open":"Open","common.language":"Language","common.copyCode":"Copy code","common.enabled":"Enabled","common.disabled":"Disabled","locale.zh":"中文","locale.en":"English","locale.toggleTitle":"Switch language","feedback.title":"Feedback","achievements.title":"Achievements","achievements.unlocked":"Achievement unlocked","achievements.claim":"Claim","achievements.claimed":"Claimed","achievements.pts":"{n} pts","achievements.seriesPts":"{n}/{total} pts","achievements.pluginGroup":"Plugins","achievements.medal.bronze":"Bronze","achievements.medal.silver":"Silver","achievements.medal.gold":"Gold","achievements.s.starter":"First Steps","achievements.s.chat":"Conversation","achievements.s.notes":"Notes","achievements.s.agents":"Agents","achievements.a.first-login.title":"Forsion is All You Need","achievements.a.first-login.desc":"Sign in to your Forsion account","achievements.a.theme-change.title":"Fresh Coat","achievements.a.theme-change.desc":"Switch the theme or color scheme once","achievements.a.market-install.title":"Gear Up","achievements.a.market-install.desc":"Install an item from the store","achievements.a.space-save.title":"Power of Space","achievements.a.space-save.desc":"Save the current layout as a Space","achievements.a.first-message.title":"Hello Agent!","achievements.a.first-message.desc":"Send your first message to an agent","achievements.a.chat-10.title":"Talkative","achievements.a.chat-10.desc":"Send 10 messages in total","achievements.a.chat-100.title":"Unstoppable","achievements.a.chat-100.desc":"Send 100 messages in total","achievements.a.group-chat.title":"Round Table","achievements.a.group-chat.desc":"Start a team","achievements.a.first-note.title":"Blooming Ink","achievements.a.first-note.desc":"Create your first note","achievements.a.notes-10.title":"Diligent Writer","achievements.a.notes-10.desc":"Create 10 notes in total","achievements.a.notes-100.title":"Prolific Author","achievements.a.notes-100.desc":"Create 100 notes in total","achievements.a.first-base.title":"Data Sprout","achievements.a.first-base.desc":"Create your first Base","achievements.a.first-agent.title":"Creator","achievements.a.first-agent.desc":"Create your first agent","achievements.a.agents-3.title":"Think Tank","achievements.a.agents-3.desc":"Create 3 agents in total","achievements.a.special-agent.title":"Behind the Scenes","achievements.a.special-agent.desc":"Enable Muse or Historian","achievements.a.first-image.title":"Picture This","achievements.a.first-image.desc":"Have an agent generate an image","achievements.a.debug-toast.title":"You Found This?!","achievements.a.debug-toast.desc":"??????","settings.developer.achToastLabel":"Achievement toast","settings.developer.achToast":"Fire achievement toast","settings.developer.achToastHint":"Debug the unlock animation, repeatable; secretly an achievement itself (reward granted once).","settings.developer.activityLabel":"Activity log","settings.developer.activityExport":"Export activity log","settings.developer.activityEnable":"Record in-app activity","settings.developer.activityHint":"Locally journals your actions (new chats, note edits, tasks…) so the background agent Muse understands what you are doing; stored only in the local activity folder, kept 30 days. Export to troubleshoot issues.","settings.developer.activityViewCmd":"Activity log live view command","settings.developer.activityViewCmdHint":'Adds an "Open activity log" entry to the command palette (⌘K): a main-area tab tailing the activity journal in real time (2s refresh, filter/pause).',"command.openActivityLog":"Open activity log","view.activityLog":"Activity log","activityView.filter":"Filter (substring)…","activityView.pause":"Pause","activityView.resume":"Resume","activityView.count":"{n} lines","activityView.empty":'No activity recorded yet. Make sure "Record in-app activity" is enabled in developer options, then do something.',"command.openActiveWindow":"Active window sampling","view.activeWindow":"Active window","activeWindowView.on":"Seam enabled","activeWindowView.off":"Seam disabled","activeWindowView.offHint":'Active-window sampling is off by default. Turn on "Active window sampling" in Settings → Developer options and the app you are focused on will show up here live.',"activeWindowView.noSample":"Enabled, but no active window could be read. Wayland sessions cannot report it (same ceiling as ActivityWatch); X11 needs xprop.","activeWindowView.noTitle":"(not available on this platform: window titles on macOS require Screen Recording)","activeWindowView.idleMark":"idle","activeWindowView.clear":"Clear","activeWindowView.segEmpty":"Sampling. Switch to another app for a moment and come back — folded focus segments will appear below (idle ones greyed out).","space.automation":"Automation","view.automationList":"Automations","view.automationDetail":"Automation detail","view.automationRuns":"Run history","automation.group.system":"System automations","automation.group.watches":"Watch rules","automation.group.buttons":"Buttons","automation.group.schedules":"Agent schedules","automation.group.finished":"Finished ({n})","automation.finished":"Finished","automation.finishedHint":"One-off, time has passed — edit to reschedule","automation.fact.status":"Status: ","automation.schedule.every":"every {ivl}","automation.schedule.once":"one-off","automation.fact.desc":"Notes:","automation.sched.name":"Name","automation.sched.date":"Date","automation.sched.dateHint":"YYYY-MM-DD or YYYY-MM-DDTHH:mm, optional /end","automation.sched.repeat":"Repeat","automation.sched.repeatHint":"Empty = one-off; e.g. 24h / 7d, rolling from the anchor","automation.builder.expiredReset":"Original time has passed — reset to the next hour; saving reschedules and re-enables.","automation.builder.atPast":"The one-time datetime has passed — pick a new time.","automation.muse.title":"Muse patrol","automation.muse.trigger":"Patrols every {min} min","automation.muse.action":"Thinks about what to do for you → creates TODOs","automation.historian.title":"Historian memory upkeep","automation.historian.trigger":"After every {n} rounds","automation.historian.action":"Summarizes sessions, maintains logs & memory","automation.watches.empty":'No watch rules yet — create one below, or just ask in chat ("keep an eye on…").',"automation.enabled":"Enabled (click to disable)","automation.disabled":"Disabled (click to enable)","automation.new":"New automation","automation.cond.daily":"Daily at {time}","automation.cond.event":'Activity contains "{match}"',"automation.cond.file":"{path} reaches {n} chars","automation.cond.at":"Once · {time}","automation.cond.every":"Every {ivl}","automation.cond.manual":"Manual · button","automation.cond.dbRow":"Row added to {path}","automation.cond.dbCell":"Cell changed in {path}","automation.cond.dbWhereN":"{n} condition(s)","automation.nextRun":"next {time}","automation.detail.empty":"Select an automation on the left","automation.detail.latest":"Latest run","automation.detail.recent":"Recent activity","automation.deepConfig":"Configure","automation.fact.trigger":"Trigger:","automation.fact.action":"Action:","automation.fact.actions":"Steps:","automation.fact.runner":"Runs:","automation.fact.prompt":"Prompt:","automation.fact.cooldown":"Cooldown:","automation.fact.where":"Conditions:","automation.fact.columns":"Watched columns:","automation.fact.noCooldown":"none (0h)","automation.fact.disabledReason":"Auto-disabled by the engine: {reason}","automation.fact.lastRun":"Last run:","automation.fact.nextRun":"Next run:","automation.fire.btn":"Test run","automation.fire.hint":"Execute the action chain once now (does not affect the normal schedule)","automation.fire.ok":"Test run finished ({status})","automation.fire.fail":"Test run failed ({status})","automation.exec.manual":"test","automation.exec.steps":"{n} step(s)","automation.step.notify":"Notify","automation.step.agent_run":"Run agent","automation.step.db_row_add":"Add table row","automation.step.db_row_edit":"Edit table row","automation.step.tool_call":"Run tool","automation.transcript.empty":"No runs yet","automation.transcript.trigger":"Trigger input","automation.transcript.agent":"Agent","automation.transcript.tools":"{n} tool calls","automation.trigger.neverFired":"Not fired yet — runs will appear here once it does","automation.trigger.museNote":"This rule wakes Muse; see its runs under","automation.runs.empty":"No records","automation.runs.pick":"Select an automation to see its runs here","automation.builder.title":"New automation","automation.builder.editTitle":"Edit automation","automation.builder.trigger":"Trigger","automation.builder.desc":"Name","automation.builder.descPh":"Describe this automation in one line","automation.builder.condType":"Trigger type","automation.builder.condTimer":"Timer","automation.builder.condEvent":"Event","automation.builder.condFile":"File threshold","automation.builder.condManual":"Manual (button)","automation.builder.condDb":"Database","automation.builder.manualHint":"Never fires on its own. Insert a Button block in a note, point it at this rule, and click to run it.","automation.builder.unsupported":"This rule uses an action type this builder does not understand yet. Edit it via manage_automation in chat — saving here would silently drop that part, so editing is disabled.","automation.builder.dbPath":"Which database (.db)","automation.builder.dbPickDb":"Pick a database…","automation.builder.dbEvent":"Event","automation.builder.dbEventRow":"Row added","automation.builder.dbEventCell":"Cell changed","automation.builder.dbColumn":"Watched columns","automation.builder.dbColumnsHint":"With several columns checked, a change in any of them fires; “new value equals” is compared on the column that changed.","automation.builder.dbPickCol":"Pick a column…","automation.builder.dbColsLoading":"Loading table…","automation.builder.dbEquals":"And new value equals (optional)","automation.builder.dbEqualsPh":"Leave empty to fire on any change","automation.builder.dbHint":"The engine detects changes by cursor comparison after each save; the rule is pinned to the vault it was created in.","automation.builder.dbRowId":"Row id","automation.builder.dbRowIdPh":"Leave empty = the row that fired the trigger","automation.builder.dbRowIdRequired":"Required (this trigger type has no “triggering row” to default to)","automation.builder.dbCells":"Fields to write","automation.builder.dbCellKey":"Column name or id","automation.builder.dbCellVal":"Value ({{row.Column}} templates allowed)","automation.builder.dbCellAdd":"Add field","automation.builder.dbCellsHint":"With a database trigger, {{row.Column}} in values is replaced from the triggering row.","automation.builder.dbCellValPh":"{{= {target.qty} - {row.out_qty} }}","automation.builder.dbWhere":"Extra conditions (optional)","automation.builder.dbWhereAdd":"Add condition","automation.builder.dbWhereOpEq":"equals","automation.builder.dbWhereOpNe":"not equals","automation.builder.dbWhereOpEmpty":"is empty","automation.builder.dbWhereOpNotEmpty":"is not empty","automation.builder.dbWhereValPh":"value","automation.builder.dbWhereHint":"ANDed with the condition above; compared against the materialised row, so formula/lookup columns work too; up to 10.","automation.builder.dbRowFrom":"Target rows via relation column (optional)","automation.builder.dbRowFromPh":"A relation column (name or id) of the triggering table; empty = use the row id above","automation.builder.dbMatch":"Match rows by column value (optional)","automation.builder.dbMatchValPh":"value, {{row.id}} templates allowed","automation.builder.dbTargetHint":"Target precedence: row id > relation column > column match > the triggering row.","automation.builder.dbSkipIfEmpty":"Skip when this field is empty (optional)","automation.builder.dbSkipIfEmptyPh":"One of the column names/ids above","automation.builder.cooldownDbHint":"Pure action chains on a database trigger may use 0 = no cooldown (needed for chained rules)","automation.builder.dbNoteView":"That is a note-view database (rows come from notes in a folder) — automations only work on classic tables, pick another.","automation.builder.timerMode":"Timer mode","automation.builder.timerDaily":"Daily","automation.builder.timerOnce":"Once","automation.builder.timerEvery":"Interval","automation.builder.time":"Time of day","automation.builder.datetime":"Fire at","automation.builder.onceHint":"Runs once, then disables itself (stays in the list; reschedule + enable to reuse).","automation.builder.interval":"Repeat every","automation.builder.everyHint":"Rolls from creation time; only the most recent miss is caught up. Min 1h with agent steps.","automation.builder.unitM":"minutes","automation.builder.unitH":"hours","automation.builder.unitD":"days","automation.builder.match":"Activity match text","automation.builder.matchPh":"e.g. note.edit, a file name, or a plugin: event","automation.builder.matchHint":"Substring match on new activity lines. Watch plugin events (plugin:<id>:<event>) or run.done agent=xx.","automation.builder.path":"File path (absolute or ~ prefixed)","automation.builder.chars":"Non-whitespace characters","automation.builder.stepN":"Step {n}","automation.builder.moveUp":"Move up","automation.builder.moveDown":"Move down","automation.builder.notifyTitle":"Notification title","automation.builder.notifyTitlePh":"Inbox message title","automation.builder.notifyBody":"Body (optional)","automation.builder.notifyHint":"Delivered straight to your inbox (0 tokens); pushed to connected channels (WeChat/TG…).","automation.builder.runner":"Runner","automation.builder.runnerPick":"Pick an agent…","automation.builder.tool":"Tool","automation.builder.toolPick":"Pick a tool…","automation.builder.dangerous":"⚠ High-risk tool: saving approves these exact arguments","automation.builder.toolCatalogEmpty":"Engine has no action catalog (update the engine)","automation.builder.museFallback":"Wake Muse (default)","automation.builder.museFallbackHint":"With no steps, firing wakes Muse to turn this into a reminder/TODO for you. Add steps to run them instead.","automation.builder.prompt":"Prompt","automation.builder.promptPh":"What should it do when the rule fires (English preferred)","automation.builder.cooldown":"Cooldown (hours)","automation.builder.cooldownHint":"Minimum gap between fires, in hours (floor 0.25 = 15 min for pure notify/tool chains)","automation.builder.cooldownAgentHint":"Has agent steps — min 1 hour (unattended self-excitation guard)","market.title":"Store","market.subtitle":"Discover community-built workflows, capabilities and interface extensions","market.navSubtitle":"Community extensions","market.group.discover":"Discover","market.group.categories":"Categories","market.group.manage":"Manage","market.tab.discover":"Store home","market.tab.skills":"Skills","market.tab.agents":"Agents","market.tab.plugins":"Plugins","market.tab.spaces":"Spaces","market.tab.themes":"Themes","market.tab.webapps":"Web apps","market.tab.installed":"Installed","market.searchPlaceholder":"Search names, authors or tags","market.clearSearch":"Clear search","market.sort.label":"Sort","market.sort.popular":"Popular","market.sort.latest":"Recent","market.sort.name":"Name","market.sectionSubtitle":"Browse {section} and manage installs","market.pluginsSubtitle":"Browse plugins, Spaces and Agents, and manage installs","market.detailSubtitle":"Details, source and install information","market.webOpen":"Open","market.webHint":"Web apps built with Coding Space and listed by users. Opens in the built-in browser; AI features spend the visitor's own account quota.","market.tab.updates":"Updates","market.tab.submit":"Submit","market.author":"by","market.downloads":"{n} downloads","market.downloadsShort":"{n} installs","market.install":"Install","market.installing":"Installing…","market.installed":"Installed","market.reinstall":"Reinstall","market.uninstall":"Uninstall","market.uninstallConfirm":'Uninstall "{name}"? Its install directory will be deleted.',"market.uninstallWarnAgent":"⚠️ This is an agent: once installed it keeps its own memory and logs. Uninstalling deletes them too, and that cannot be undone.","market.uninstallWarnSkill":"⚠️ If you have edited this skill, your edits will be deleted with it.","market.uninstalled":'Uninstalled "{name}"',"market.uninstalledNeedsRestart":'Uninstalled "{name}" · its tools only go away after a backend restart',"market.uninstallFail":"Uninstall failed: {e}","market.openSettings":"Open settings","market.update":"Update","market.updateTitle":"Update v{from} → v{to}","market.allUpToDate":"Everything installed is up to date","market.allUpToDateHint":"New versions will appear here automatically.","market.detailBack":"Back to list","market.empty":"Nothing here yet","market.emptyHint":"Community content appears here after review.","market.noInstalled":"Nothing installed from the store yet","market.noResults":"No matching content found","market.noResultsHint":"Try another name, author or tag.","market.browse":"Browse store","market.retry":"Reload","market.loadFailShort":"The store is temporarily unavailable","market.loadFail":"Failed to load: {e}","market.summaryFallback":"The author has not provided a summary.","market.searchResults":"Search results","market.resultCount":"{n} items","market.featured":"Community pick","market.viewDetails":"View details","market.recent":"Recently added","market.recentHint":"See what the community just published.","market.popular":"Popular","market.popularHint":"Ordered by real install count.","market.overview":"Overview","market.reviewed":"Reviewed for listing","market.reviewedHint":"The listing meets publication requirements. Forsion does not guarantee third-party code.","market.type":"Type","market.version":"Version","market.source":"Install source","market.sourceUpload":"Forsion hosted package","market.updated":"Updated","market.unknown":"Unknown","market.installOk":'Installed "{name}"',"market.spaceInstalled":'Installed Space "{name}" and added it to the ribbon',"market.themeInstalled":'Installed "{name}". Pick it in Settings → Appearance',"market.amadeusPluginInstalled":'Forsion plugin "{name}" installed and loaded',"market.pluginInstalledOk":"Plugin installed and enabled","market.pluginInstalledRestartHint":"Plugin installed. Restart the backend for it to take full effect","market.pluginInstalledWaiting":"Plugin installed, but it needs these first: {list}","market.amadeusPluginNeedsDeps":'Forsion plugin "{name}" installed, but it needs these first: {list}',"market.restartBackend":"Restart backend","market.restartBackendHint":"Takes a few seconds; any running conversation will be interrupted","market.backendRestarting":"Restarting the backend…","market.backendRestarted":"Backend restarted — changes are now in effect","market.backendRestartFailed":"The backend didn't restart. Try again, or restart the app","market.installFail":"Install failed: {e}","market.installFailNamed":"Couldn’t install {name}: {e}","market.installHintGithub":"This item downloads from GitHub, which is unreachable on some networks. Turn on a system proxy and retry, or enable “Use China mainland mirrors” in Settings → General → Connection to download through domestic mirrors.","market.installRetry":"Retry","market.phase.resolve":"Preparing…","market.phase.connect":"Connecting…","market.phase.connectN":"Connecting {n}/{m}…","market.phase.percent":"Downloading {n}%","market.phase.bytes":"Downloaded {size}","market.openRepo":"View GitHub repo","market.readmeEmpty":"(No details)","market.submitHint":"Submit a GitHub repository, public npm package or ZIP through your account. Submissions appear after review.","market.submitOpen":"Open submission page","market.submitKicker":"Developer center","market.submitTitle":"Share your workflow with more people","market.submitArtTitle":"One review and version pipeline","market.submitArtHint":"Skills, Agents, Plugins, Spaces and Themes use the same publication flow.","feedback.label":"Issue or feedback","feedback.placeholder":"Describe the problem or suggestion… the current session log is attached automatically to help us debug.","feedback.logAttached":"Current session log will be attached ({name})","feedback.noSession":"No active session — submitting text only","feedback.submit":"Send feedback","feedback.diagnoseViaChat":"Diagnose in chat","feedback.diagnoseViaChatHint":"Send the description to the current session’s agent to troubleshoot it in place","feedback.ok":"Submitted — thank you for your feedback!","feedback.okNoLog":"Submitted (session log over 5MB, not attached this time)","feedback.errEmpty":"Please enter your feedback","feedback.errFail":"Submit failed: {err}","feedback.errNotLoggedIn":"Not logged into Forsion","feedback.errUnavailable":"Feedback not available here","sidebar.account.login":"Sign in to Forsion","sidebar.account.loginHint":"Sign in for cloud memory / skills / hosted models (works fine without signing in too)","sidebar.account.loggingIn":"Signing in…","sidebar.account.logout":"Sign out","sidebar.account.menu.weekly":"This week","sidebar.account.menu.daily":"Today","sidebar.account.menu.unlimited":"Unlimited","sidebar.account.menu.loading":"Loading…","sidebar.account.menu.quotaFail":"Failed to load usage","settings.provider.loginBusy":"After you finish signing in the browser, the local engine restarts to load this provider and the model list refreshes automatically (a few seconds).","quota.exhausted.daily":"Today's AI quota is used up (this run finished on overdraft; use a quota reset card under Forsion Cloud → Quota & points to restore it now)","quota.exhausted.weekly":"This week's AI quota is used up (this run finished on overdraft; use a quota reset card under Forsion Cloud → Quota & points to restore it now)","sidebar.account.loginFail":"Sign-in failed: {e}","sidebar.account.loginSub":"Click to sign in","sidebar.account.engineDown":"Engine not running · click to restart","sidebar.account.engineStarting":"Engine starting…","sidebar.settings":"Settings (Ctrl+,)","header.theme":"Light / dark","header.browser":"Browser","header.browserEnabled":"Browser tools enabled","header.browserDisabled":"Browser tools disabled","settings.tab.about":"About","about.version":"Version","about.checkUpdates":"Visit website","about.update.check":"Check for updates","about.update.checking":"Checking…","about.update.upToDate":"You're up to date","about.update.available":"Update available v{version}","about.update.download":"Download update","about.update.downloading":"Downloading {percent}%","about.update.install":"Restart & install","about.update.goToDownload":"Go to download","about.update.error":"Update failed: {error}","about.update.unsupported":"Auto-update unavailable in dev","about.update.unreachable":"Could not reach the update server, try again later","about.update.beta":"Receive beta updates","about.update.betaHint":"Get pre-release builds like x.y.z-beta.N — newer features, more likely to break. With this off they are invisible to you. Stable always wins: a stable release published after a beta is still offered.","app.update.bannerTitle":"New version v{version} available","app.update.bannerAction":"Update now","app.update.bannerDismiss":"Dismiss","about.changelogTitle":"What's new","about.builtWith":"Forsion Desktop","about.builtWithMobile":"Forsion Mobile","about.complianceTitle":"Compliance","about.appFiling":"App filing number","about.privacy":"Privacy policy","about.terms":"Terms of service","settings.cloud.envOnly":"The Forsion cloud URL is set via the TANGU_CLOUD_URL environment variable (read-only here).","settings.cloud.label":"Forsion cloud URL (brain: memory/skills/hosted models)","settings.cloud.unset":"(unset — using built-in default)","model.group.forsion":"Forsion Cloud","picker.ungrouped":"Ungrouped","model.group.direct":"Local","model.collapseAll":"Collapse all","model.expandAll":"Expand all","model.empty":"No models","model.searchPlaceholder":"Search models…","settings.tab.developer":"Developer","settings.tab.browser":"Browser control","settings.tab.channels":"Channels","channel.name.wechat":"WeChat","channel.name.telegram":"Telegram","channel.name.qq":"QQ","channels.intro":"Bring Tangu into your IM: connecting creates a fresh channel session and messages get answered in chat; inbox forwarding can be enabled independently.","channels.loadingTitle":"Loading channels","channels.loadingHint":"Reading local channel capabilities and connection status.","channels.notAvailable":"Channels require the built-in local backend (desktop).","channels.notAvailableHint":"Start the local backend and retry. These settings are not available in external-backend mode.","channels.enable":"Enable","channels.status.connected":"Connected","channels.status.notConnected":"Not connected","channels.status.disabled":"Disabled","channels.connect":"Connect","channels.scanConnect":"Scan to connect","channels.disconnect":"Disconnect","channels.disconnected":"Disconnected.","channels.connectedAs":"Connected: {label}","channels.connectedMsg":"WeChat connected; a new channel session was created.","channels.connectFailed":"Operation failed: {e}","channels.qrExpired":"QR code expired, please scan again.","channels.scanQrHint":"Scan with WeChat to confirm login.","qr.failed":"Failed to generate QR code, please retry.","qr.alt":"Login QR code","channels.newSessionHint":"Connecting creates a new session; later messages go to it. In the IM use /new, /list, /switch to manage sessions and /help for all commands.","channels.botToken":"Bot token","channels.botTokenHint":"Create a bot via @BotFather on Telegram to get a token, then press Connect.","channels.qqHint":"Create a bot on the QQ Open Platform (q.qq.com) to get AppID / AppSecret.","channels.secretSaved":"Saved (type to replace)","channels.sessionsSec":"Channel sessions","channels.sessions":"Enable channel sessions","channels.sessionsHint":"Incoming messages drive an agent session and get replies; when off, only inbox forwarding works.","channels.approval":"Remote approval","channels.approval.readonly":"Ask for approval","channels.approval.autoEdit":"Approve for me","channels.approval.fullAuto":"Full access","channels.defaultAgent":"Default agent","channels.defaultModel":"Default model","channels.imageModel":"Image model","channels.ttsModel":"Voice model","channels.ttsModelPlaceholder":"Empty = follow Voice settings","channels.ttsVoice":"Voice","channels.followDefault":"Follow global default","channels.followGlobal":"Follow global setting","channels.forwardSec":"Inbox forwarding","channels.forward":"Forward inbox messages to this channel","channels.forwardHint":"Push new inbox messages to your IM (independent of channel sessions).","channels.forwardSenders":"Allowed senders","channels.forwardAll":"All","channels.waitingPeer":"Connected; waiting for the first incoming message to bind the contact.","channels.senderSystem":"System","channels.senderServer":"Forsion cloud","sidebar.channel.setAsConnected":"Set as connected","settings.tab.notes":"Notes","settings.tab.sync":"Sync","settings.sync.cloudSec":"Online sync","settings.sync.remoteSec":"Vault remote sync","settings.notes.storageTitle":"Files and attachments","settings.notes.storageDescription":"Keep attachment and daily-note locations together.","settings.notes.behaviorTitle":"Editing and safety","settings.notes.behaviorDescription":"Control imports, link compatibility and attachment deletion safeguards.","settings.notes.modeLabel":"Attachment location","settings.notes.modeAttachments":"attachments/ folder next to the note","settings.notes.modeSame":"Same folder as the note","settings.notes.modeVault":"Fixed folder in the vault","settings.notes.modeHint":"Where dragged-in files are saved. “attachments” auto-creates an attachments/ subfolder beside the note.","settings.notes.folderLabel":"Vault-relative folder","settings.notes.folderHint":"Relative to the vault root, e.g. assets. All attachments live here (must be inside the vault for inline preview).","settings.notes.previewLabel":"Preview imported files by default","settings.notes.previewHint":"On: insert an ![[file]] preview block (images inline, others as a clickable file card). Off: insert a [name](path) link.","settings.notes.upgradeV4Label":"Upgrade legacy notes to v4 plain Markdown on open","settings.notes.upgradeV4Hint":"On by default: v3 marker-based notes convert to plain Markdown when you edit them. The upgrade is written only after a real edit; turn this off temporarily if some device still runs a version older than 2.7.8.","settings.notes.dailyLabel":"Daily notes folder","settings.notes.dailyPlaceholder":"Empty = vault root","settings.notes.dailyHint":`Where "Open today's daily note" creates YYYY-MM-DD.md (vault-relative); templates/daily.md is applied automatically if present.`,"settings.notes.wikiFilesLabel":"Suggest attachments and databases in [[ ]]","settings.notes.wikiFilesHint":"On: typing [[ also completes attachments, databases (.db) and drawings. Off: notes only.","settings.notes.canvasDoubleClickFocusLabel":"Focus canvas cards on double-click","settings.notes.canvasDoubleClickFocusHint":"Double-clicking a card always enters editing with the caret at the click. On: it also smoothly centers the card at a readable zoom; off: it edits in place and the viewport stays put. A single click only selects; Space also enters editing.","settings.notes.canvasOverviewZLabel":"Zoom that collapses cards to titles","settings.notes.canvasOverviewZHint":"At this zoom level or below, canvas cards show a title summary instead of their body. The default 25% only collapses at the furthest zoom-out; a higher value collapses sooner. The toggle in the canvas HUD turns the summary off entirely.","settings.notes.deleteAssetsLabel":"Delete exclusive attachments with the note","settings.notes.deleteAssetsAsk":"Ask every time","settings.notes.deleteAssetsYes":"Remembered: delete them","settings.notes.deleteAssetsNo":"Remembered: keep them","settings.notes.deleteAssetsHint":"Only attachments referenced by this note alone; anything another note links to is kept.","settings.remote.saved":"Remote settings saved. The managed backend may restart to apply them.","settings.browser.title":"Browser control","settings.browser.agentBrowser":"Agent browser","settings.browser.hint":"Tangu prefers browser_search and browser_* interaction tools for web work; web_search remains available for compatibility.","settings.browser.engine":"Browser engine","settings.browser.engineHint":"Auto picks an available browser implementation for each task.","settings.browser.searchEngine":"Search engine","settings.browser.timeout":"Timeout","settings.browser.timeoutHint":"Maximum wait for a browser command, in milliseconds.","settings.browser.allowPrivate":"Allow browser tools to open private/local network URLs","settings.browser.allowPrivateHint":"Off by default; browser_navigate blocks localhost, RFC1918 and link-local addresses.","settings.tab.spaces":"Spaces","settings.spaces.hint":"Manage the Spaces in the ribbon. Built-in Spaces ship with the app and cannot be removed; Spaces you created or installed from the store can be uninstalled (their on-disk layout recipe is deleted).","settings.spaces.builtin":"Built-in","settings.spaces.user":"Custom/store","settings.spaces.uninstall":"Uninstall","settings.spaces.uninstalled":'Uninstalled "{name}"',"settings.spaces.empty":"No Spaces yet.","settings.spaces.startupTitle":"Startup location","settings.spaces.startupLabel":"Open the app in","settings.spaces.startupHint":"Opens the Space in the ribbon home slot by default; you can also return to your last Space with its tabs, or pin a specific one.","settings.spaces.lastExit":"Last Space on exit (with its tabs)","settings.spaces.homeSlotStartup":"Space in the home slot (default — now “{name}”)","settings.spaces.homeSlotLabel":"Ribbon home slot","settings.spaces.homeSlotHint":"The centred cell on the ribbon. Home by default; swap it for any Space here or by right-clicking the cell.","settings.spaces.hintPhone":"Built-in Spaces ship with the app and cannot be removed; Spaces you created or installed from the market can be uninstalled (their on-disk layout recipe is deleted).","settings.spaces.startupHintPhone":"Choose which Space the app opens in: the default one, the last one you were in, or a specific one.","settings.spaces.homeSlotStartupPhone":"Default (now “{name}”)","settings.spaces.libraryTitle":"Installed Spaces · {count}","settings.tab.plugins":"Plugins","settings.tab.amadeusPlugins":"Plugins","settings.amadeusPlugins.builtinTitle":"Built-in plugins","settings.amadeusPlugins.builtinHint":"Ships with the app and is on by default (browser, terminal and calendar are native host views; the rest are editor add-ons). Turning one off removes it from the workbench, command palette and editor — calendar takes its Space with it.","settings.amadeusPlugins.externalTitle":"External plugins","settings.amadeusPlugins.changelog":"What's new","settings.amadeusPlugins.hint":"Toggle takes effect instantly; click a plugin for details. Plugin folder: ~/.forsion/plugins/ (store installs). A plugin may bundle engine plugins / agents / skills / Spaces — they are discovered, toggled and uninstalled together with it.","settings.amadeusPlugins.openFolder":"Open plugins folder","settings.amadeusPlugins.reload":"Reload","settings.amadeusPlugins.scaffold":"Create sample plugin","settings.amadeusPlugins.builtin":"Built-in","settings.amadeusPlugins.external":"External","settings.amadeusPlugins.agentOwned":"Space built by {agent}","settings.amadeusPlugins.blockedInvalid":"Invalid manifest: {reason}","settings.amadeusPlugins.uninstall":"Uninstall","settings.amadeusPlugins.uninstallConfirm":'Uninstall "{name}"? Its folder will be deleted; bundled engine plugins/Spaces go with it (seeded agents are kept — delete them on the Agents page if needed).',"settings.amadeusPlugins.uninstalled":'Uninstalled "{name}"',"settings.amadeusPlugins.uninstalledRestartPending":'"{name}" files were deleted, but the engine restart did not complete — bundled tools may still be running; restart the backend manually',"settings.amadeusPlugins.bundleEngine":"Engine plugins ×{n}","settings.amadeusPlugins.bundleAgents":"Agents ×{n}","settings.amadeusPlugins.bundleSkills":"Skills ×{n}","settings.amadeusPlugins.bundleSpaces":"Spaces ×{n}","settings.amadeusPlugins.bundleTitle":"Bundled content","settings.amadeusPlugins.bundleEngineList":"Engine plugins: {list}","settings.amadeusPlugins.bundleAgentsList":"Agents: {list}","settings.amadeusPlugins.bundleSkillsList":"Skills: {list}","settings.amadeusPlugins.bundleSpacesList":"Spaces: {list}","settings.amadeusPlugins.bundleHint":"Bundled engine plugins and Spaces follow this plugin's enable/uninstall state; agents are seeded into the engine once on first discovery and then live independently (upgrades never overwrite, uninstall keeps them).","settings.amadeusPlugins.blockedApi":"Requires plugin API v{v}, incompatible with this app","settings.amadeusPlugins.blockedMinApp":"Requires app version ≥ {v}","settings.amadeusPlugins.empty":"No plugins yet.","settings.amadeusPlugins.back":"Back to list","settings.amadeusPlugins.dep":"Companion app","settings.amadeusPlugins.depConnected":"Connected {v}","settings.amadeusPlugins.depMissing":"Not detected — needs to be installed and running","settings.amadeusPlugins.depCheck":"Check connection","settings.amadeusPlugins.depInstall":"Install","settings.amadeusPlugins.depInstalling":"Installing…","settings.amadeusPlugins.depFail":"Install did not finish — open the website to install manually","settings.amadeusPlugins.depHomepage":"Open website","settings.amadeusPlugins.commands":"Commands","settings.amadeusPlugins.settings":"Settings","plugin.onboarding.title":"Set up — {name}","plugin.onboarding.stepsTitle":"Steps","plugin.onboarding.settingsTitle":"Required settings","plugin.onboarding.recommendsTitle":"Recommended companions","plugin.onboarding.install":"Install","plugin.onboarding.installed":"Installed","plugin.onboarding.installing":"Installing…","plugin.onboarding.notFound":"Not in store","plugin.onboarding.later":"Later","plugin.onboarding.done":"Done","plugin.onboarding.laterHint":'You can come back anytime from Settings → Forsion plugins → this plugin → "Run setup". The "Setup pending" badge clears on its own once every requirement is met.',"plugin.onboarding.requiresTitle":"Before you start","plugin.onboarding.req.ok":"Ready","plugin.onboarding.req.unmet":"Not done yet","plugin.onboarding.req.unknown":"Can't check right now","plugin.onboarding.req.timeout":"The check timed out. Try again in a moment.","plugin.onboarding.req.inactive":"Enable the plugin to check this.","plugin.onboarding.recheck":"Check again","plugin.onboarding.checking":"Checking…","plugin.onboarding.allReady":"All set — you're ready to go.","plugin.onboarding.someUnknown":"Nothing is missing; {n} item(s) can't be checked right now.","plugin.onboarding.guideTitle":"How to use","plugin.onboarding.badge":"Setup pending","plugin.onboarding.run":"Run setup","plugin.onboarding.nudgeTitle":'Plugin "{name}" needs a quick setup',"plugin.onboarding.nudgeBody":`"{name}" still has unmet requirements. Open Settings → Forsion plugins → {name} and click "Run setup" to see what's missing.`,"settings.plugins.npmInstallTitle":"Install engine plugin from npm","settings.plugins.npmInstallHint":"Enter a package spec (e.g. npm:@forsion/tangu-computer-use). Plugins run with your full system permissions — only install sources you trust.","settings.plugins.npmInstallConfirm":'Install "{spec}" from npm? Plugins run with your full system permissions; confirm the source is trustworthy before continuing.',"settings.plugins.preferMirror":"Prefer CN mirror","settings.plugins.installBtn":"Install","settings.plugins.installing":"Installing…","settings.plugins.installed":"Installed {id}@{version}","settings.plugins.empty":"No plugins","settings.plugins.secForsion":"Forsion plugins","settings.plugins.secEngine":"Tangu engine plugins","settings.plugins.bundleOwnedHint":"{n} more engine plugin(s) are bundled by Forsion plugins above and toggle together with them.","settings.plugins.selectHint":"Select a plugin to configure","settings.plugins.builtin":"Built-in","settings.plugins.folder":"Folder","settings.plugins.needsRestart":"Restart needed","settings.plugins.needsRestartHint":"The new version is on disk, but its entry imports relative modules. Restart the backend to run it","settings.plugins.waitingDeps":"Waiting for required plugins","settings.plugins.loadFailed":"Failed to load","settings.plugins.settling":"Finishing up","settings.plugins.settlingHint":"The previous start or stop is still finishing; your setting takes effect once it ends","settings.plugins.needsDepsToEnable":"Install and turn on these first: {list}","settings.plugins.disableDependents":'Turning off "{name}" also pauses the plugins that require it: {list}. They resume when you turn it back on. Continue?',"settings.plugins.uninstallDependents":'These plugins require "{name}" and stop working once it is uninstalled: {list}.',"settings.plugins.openFolder":"Open plugins folder","settings.plugins.rescan":"Reload plugins","settings.plugins.rescanning":"Rescanning…","settings.plugins.rescanAdded":"Rescan done: {n} plugin(s) added, updated or removed","settings.plugins.rescanNone":"Rescan done: nothing changed","settings.plugins.rescanHint":"Picks up plugins added, updated or removed in the folder right away. A plugin whose entry imports relative modules still needs a backend restart after an update","settings.plugins.uninstall":"Uninstall","settings.plugins.uninstallConfirm":'Uninstall "{name}"? This deletes the plugin files and all its settings.',"settings.plugins.uninstalled":'Uninstalled "{name}"',"settings.plugins.scope":"Scope","settings.plugins.scopeGlobal":"Global","settings.plugins.scopeAgent":"Per agent","settings.plugins.selectAgent":"Select agent","settings.plugins.noSettings":"This plugin has no settings","settings.plugins.saved":"Saved","settings.plugins.import":"Import image","settings.plugins.deleteConfirm":"Delete “{name}”?","settings.plugins.onlyImage":"Images only (png/jpg/gif/webp)","about.versionClickHint":"{n} more taps to enable developer mode","about.devUnlocked":"Developer mode enabled","settings.developer.note":"These options are for advanced users / debugging — normally no need to change them.","settings.developer.cloudUrlLabel":"Forsion cloud URL","settings.developer.cloudUrlHint":"Address of the brain service (memory/skills/hosted models). Leave empty to use the TANGU_CLOUD_URL env var or the built-in default. In managed mode, saving restarts the backend to take effect.","settings.developer.cloudUrlPlaceholder":"https://api.forsion.net","settings.developer.saveCloudUrl":"Save","settings.developer.savedRestarting":"Saved, restarting backend…","settings.developer.saved":"Saved","settings.developer.relaunchLabel":"Onboarding","settings.developer.relaunchHint":"Re-run the first-install setup flow (theme / connection / model / project folder).","settings.developer.relaunch":"Re-run onboarding","settings.developer.disable":"Disable developer mode","settings.developer.showSystemPrompt":"Show system prompt before each reply","settings.developer.showSystemPromptHint":"When on, each AI reply is preceded by the full system prompt sent to the model for that message (expand to inspect its content and structure). Local debugging only; cleared automatically when you disable developer mode.","settings.developer.activeWindow":"Active window sampling (seam)","settings.developer.activeWindowHint":'Lets plugins that declare the activeWindow capability read which app you are focused on — so they can drop external dependencies like ActivityWatch. Data never leaves this machine. Adds an "Active window sampling" debug panel to the command palette (⌘K). Off by default; turned off automatically when you leave developer mode.',"settings.developer.mobileUiPreview":"Mobile UI preview command","settings.developer.mobileUiPreviewHint":'Adds a "Switch to mobile UI" entry to the command palette (⌘K) that swaps the desktop shell for the single-column mobile shell at runtime (reloads the page). Works on web too. Local debugging only; cleared when you disable developer mode.',"command.switchToMobileUi":"Switch to mobile UI","command.switchToDesktopUi":"Switch back to desktop UI","command.zoomIn":"Zoom in","command.zoomOut":"Zoom out","command.zoomReset":"Reset zoom","chat.systemPrompt":"System prompt","onboarding.brand.caption":"AI workspace","onboarding.progress.label":"Setup progress","onboarding.phase.connect":"Connect account","onboarding.phase.appearance":"Choose appearance","onboarding.phase.capabilities":"Configure capabilities","onboarding.phase.workspace":"Prepare project folder","onboarding.welcome.kicker":"First-time setup","onboarding.welcome.subtitle":"Bring models, agents, knowledge and local tools into one app.","onboarding.welcome.railLabel":"Start here","onboarding.welcome.railTitle":"Make Forsion fit the way you work.","onboarding.welcome.railBody":"Finish the essentials in a few minutes. Every choice can be changed later in Settings.","onboarding.welcome.promiseModels":"Connect Forsion or your own models","onboarding.welcome.promiseAgents":"Prepare agents you can switch anytime","onboarding.welcome.promiseLocal":"Keep control of local files and execution","onboarding.step.connect.title":"Connect models and account","onboarding.step.connect.description":"Sign in to Forsion, use subscription access, or connect an OpenAI-compatible service.","onboarding.step.theme.title":"Choose your appearance","onboarding.step.theme.description":"Design language controls structure, the accent controls highlight color, the background controls the base palette. Mix them freely.","onboarding.step.model.title":"Choose a default model","onboarding.step.model.description":"Pick a daily model now. You can switch it in any conversation later.","onboarding.step.speech.title":"Configure voice input","onboarding.step.speech.description":"Choose a speech recognition model, or keep the default and configure it later.","onboarding.step.agents.title":"Meet your agents","onboarding.step.agents.description":"Review the roster and optionally create an assistant with its own persona and memory.","onboarding.step.workspace.title":"Choose a working directory","onboarding.step.workspace.description":"Set the default folder for local sessions. Forsion works only within the scope you allow.","onboarding.step.env.title":"Check the local environment","onboarding.step.env.description":"Verify tools needed for coding tasks and choose downloads for your current network.","onboarding.step.done.title":"You’re all set","onboarding.step.done.description":"The essentials are configured. Enter Forsion and start working.","onboarding.done.cloudLine1":"· Switch models and thinking effort anytime from the input bar; notes, calendar and automation all live in Forsion","onboarding.done.cloudLine2":"· Settings → Appearance changes the theme and language anytime; the desktop app adds local files and tools","onboarding.connect.modeLabel":"Connection method","onboarding.model.choiceLabel":"Default chat model","onboarding.speech.choiceLabel":"Voice input","onboarding.workspace.choiceLabel":"Default working directory","onboarding.connect.forsionHint":"Sign in with your Forsion account (the cloud URL is set via an environment variable — nothing to enter here). Or switch to your own API key above.","onboarding.connect.skipForNow":"Skip for now","onboarding.theme.stepLabel":"Choose a theme","onboarding.theme.modeLabel":"Light / dark","onboarding.theme.light":"Light","onboarding.theme.dark":"Dark","onboarding.theme.hint":"You can change this anytime in Settings → Appearance.","onboarding.theme.customSeedLabel":"Custom accent","settings.theme.system":"Follow system","settings.theme.modeLocked":"This theme follows the system appearance","settings.theme.modeLockedHint":"Themes like Glass take light/dark from the system; it can’t be switched manually.","settings.theme.zoomLabel":"Interface size","settings.theme.zoomHint":"Scales the whole interface. Currently {percent}%. You can also fine-tune it in 10% steps with ⌘/Ctrl + +/−.","settings.theme.zoomPresetLabel":"Interface size presets","settings.theme.zoomSmall":"Small","settings.theme.zoomStandard":"Standard","settings.theme.zoomLarge":"Large","settings.theme.smoothCaret":"Smooth caret","settings.theme.smoothCaretHint":"The text caret glides smoothly to its new position in the editor and chat input (Word-style). Off by default; turn it on if you want it.","settings.theme.chatAvatars":"Chat avatars","settings.theme.chatAvatarsHint":"Show agent and user avatars in conversations. Turn off for a cleaner message view; agent names stay.","settings.theme.calmDim":"Dim surroundings","settings.theme.calmDimHint":"The ribbon, inactive tabs, the left sidebar, and the cards beside a chat fade while you work. They come back when you point at them or move keyboard focus there.","settings.theme.calmReading":"Relaxed text","settings.theme.calmReadingHint":"Looser line and paragraph spacing in notes and chats, and a slightly narrower note column. Interface text and controls stay the same size.","settings.theme.calmMotion":"Gentle transitions","settings.theme.calmMotionHint":"Slow down view changes and the fade when surroundings come back.","settings.theme.ribbonAutoHome":"Reset ribbon after scrolling","settings.theme.ribbonAutoHomeHint":"After you scroll the ribbon, clicking elsewhere or opening an item slides it back a moment later. Turn off to keep it where you scrolled.","settings.theme.ribbonRecent":"Recent Spaces on the ribbon","settings.theme.ribbonRecentHint":"Lists your most recently used Spaces in the gap in the middle of the ribbon, newest first. Fewer are shown when there is not enough room.","settings.theme.ribbonRecentOff":"Off","settings.theme.fontUi":"Interface font","settings.theme.fontBody":"Body font","settings.theme.fontMono":"Monospace font","settings.theme.fontFollow":"Follow theme","settings.theme.fontSystem":"System default","settings.theme.fontHint":'Preset fonts ship with the app, so they render the same on every machine regardless of what is installed locally. Pick "Follow theme" to use the current theme’s own stack.',"settings.theme.fontPreset.inter":"Inter (modern sans)","settings.theme.fontPreset.notoSans":"Noto Sans SC","settings.theme.fontPreset.wenkai":"LXGW WenKai (reading)","settings.theme.fontPreset.jetbrains":"JetBrains Mono","settings.theme.fontPreset.system":"System default","settings.theme.fontGroupBuiltin":"Built-in","settings.theme.fontGroupPlugin":"From plugins","settings.theme.customSeedLabel":"Custom accent","settings.theme.customBgLabel":"Custom background","settings.theme.customBgFollow":"Follows accent","settings.theme.customBgClear":"Reset","settings.theme.customBgHint":"Unset: the accent softly tints the background. Set: use this hue as an independent ambience seed, adjusted into the current mode’s readable range.","settings.theme.langLabel":"Design language","settings.theme.openFolder":"Open themes folder","settings.theme.reload":"Reload themes","settings.theme.dropHint":"Drop theme.json + theme.css into ~/.forsion/themes/<id>/ to install a third-party theme, then click “Reload themes”.","settings.theme.options":"{name} options","settings.theme.optionsReset":"Reset","settings.theme.skinLabel":"Color scheme","settings.theme.accentLabel":"Accent","settings.theme.bgLabel":"Background","settings.theme.skin.cream":"Classic","settings.theme.skin.coral":"Coral","settings.theme.skin.teal":"Teal","settings.theme.skin.lavender":"Lavender","settings.theme.skin.zhi":"Clear blue","settings.theme.skin.ink":"Ink","settings.theme.skin.custom":"Custom","settings.group.appearance":"Appearance","settings.group.account":"Account","settings.group.model":"Models","settings.group.agents":"Agents","settings.group.extensions":"Extensions","settings.group.appearanceAbout":"Appearance & about","settings.group.plugins":"Extensions","settings.group.advanced":"Advanced","settings.group.about":"About","settings.group.options":"Options","settings.group.workspace":"Workspace","settings.group.ai":"AI","settings.group.system":"System","settings.group.tools":"Tools","settings.group.corePlugins":"Core plugins","settings.group.communityPlugins":"Community plugins","settings.tab.general":"General","settings.page.generalDescription":"Manage your working directory, runtime and Forsion connection status.","settings.page.spacesDescription":"Choose a startup location and manage installed Spaces.","settings.page.notesDescription":"Manage attachment locations, note behavior and deletion safeguards.","settings.page.syncDescription":"Sync your local vault to remote storage (Dropbox, S3, WebDAV, and more).","settings.page.themeDescription":"Preview and combine design language, color, appearance mode, interface size and typography.","settings.page.shortcutsDescription":"Find commands and record, unbind or restore shortcuts.","settings.page.notificationsDescription":"Control delivery and choose which events and plugins can notify you.","settings.page.statusbarDescription":"Choose bottom-bar items and drag them into display order.","settings.page.modelDescription":"Choose default models and manage providers, web search and voice.","settings.page.agentsDescription":"Manage the agent roster, background agents and local agent CLIs.","settings.page.skillsDescription":"Browse skills and import skills or MCP settings from other tools.","settings.page.mcpDescription":"Connect, toggle and maintain external MCP tool servers.","settings.page.hooksDescription":"Manage automations that run around agent activity.","settings.page.channelsDescription":"Connect messaging channels and review their status in one place.","settings.page.browserDescription":"Choose browser and search engines, and set network safety boundaries.","settings.page.pluginsDescription":"Manage core features and installed plugins, their settings and updates.","settings.page.pluginDescription":"Adjust the features and runtime options provided by this plugin.","settings.page.advancedDescription":"Manage local services, interface behavior, logs and data safety.","settings.page.developerDescription":"Internal options for UI debugging, activity logs and feature testing.","settings.page.aboutDescription":"Review the version, update channel, language and full changelog.","settings.overview.label":"Current status","settings.overview.mode":"Runtime mode","settings.overview.backend":"Backend service","settings.overview.account":"Forsion account","settings.overview.signedIn":"Signed in","settings.overview.signedOut":"Not signed in","settings.overview.readyTitle":"Workspace services are ready","settings.overview.readyDescription":"The backend is connected. You can continue adjusting the workspace and local runtime.","settings.overview.attentionTitle":"Workspace services need attention","settings.overview.attentionDescription":"Check the backend connection and runtime mode. The latest status will appear here after saving.","settings.backend.modeDescription":"Let Forsion manage its local service, or connect to a backend you already run.","settings.backend.modeManagedDescription":"Ready out of the box. The desktop app starts, checks and restarts it.","settings.backend.modeExternalDescription":"For an existing LAN, container or remote deployment.","settings.workspace.summary":"The default location used when creating a local session.","settings.runtime.title":"Local runtime","settings.runtime.description":"Configure the code sandbox, Python and download network. Restart the backend to apply changes.","settings.runtime.details":"About Python and network mirror behavior","settings.external.title":"External backend connection","settings.external.description":"Enter the service URL and credentials, test the connection, then save.","settings.theme.previewLabel":"Live appearance preview","settings.theme.previewChat":"Chat","settings.theme.previewWorkspace":"Forsion","settings.theme.previewTitle":"Keep ideas in flow","settings.theme.previewMessage":"Your design language, color scheme, typography and material are applied to this preview in real time.","settings.theme.previewInput":"Ask Forsion, or type / for capabilities","settings.theme.langDescription":"Choose the structure, radius, typography and overall character of the interface.","settings.theme.skinDescription":"Pick accent and background separately; same id on both = the original combined scheme.","settings.theme.behaviorTitle":"Display and motion","settings.theme.behaviorDescription":"Adjust appearance mode, interface size, depth and typing feedback.","settings.theme.flatLabel":"Shadows","settings.theme.flatOff":"Raised","settings.theme.flatOn":"Flat","settings.theme.flatDescription":"Raised adds subtle shadows. Flat hides decorative shadows.","settings.theme.glassDescription":"Add translucent blur to surfaces that support it.","settings.theme.ambient":"Tint chrome from content","settings.theme.ambientHint":"Genesis frosted chrome follows the colors of visible content. Needs frosted glass turned on. Uses more resources while scrolling and switching pages.","settings.theme.typographyTitle":"Typography","settings.sub.connection":"Connection","settings.sub.models":"Models","settings.sub.providers":"Custom providers","settings.sub.webSearch":"Web search","settings.sub.voice":"Voice","settings.sub.specialAgents":"Background agents","settings.sub.mcpServer":"MCP endpoint","settings.sub.uiSession":"UI & sessions","settings.sub.data":"Data","settings.sub.skillLibrary":"Skill library","settings.plugins.openSettings":"Settings","onboarding.agents.stepLabel":"Agents","onboarding.agents.intro":"Agents are chat personas with their own name, personality and private memory — the default agent is ready to go, and you can raise a whole roster: a work assistant, a translator, a companion, switching anytime mid-chat. Manage them fully (avatar/model/tools) later in the Agents Space.","onboarding.agents.rosterLabel":"Current roster","onboarding.agents.rosterEmpty":"Roster is empty (the default agent is created on first chat).","onboarding.agents.systemBadge":"background","onboarding.agents.createLabel":"Quick create (optional)","onboarding.agents.namePlaceholder":"Name, e.g. Qinche","onboarding.agents.personaPlaceholder":"One-line persona, e.g. a meticulous technical editor of few words","onboarding.agents.createBtn":"Create","onboarding.agents.createHint":"A name is enough; the persona line becomes its initial instructions and can be changed anytime.","onboarding.agents.created":'Created "{name}" — switch agents above the chat input.',"onboarding.agents.createFail":"Create failed: {e}","onboarding.agents.historianTitle":"Background agent: Historian","onboarding.agents.historianDesc":"Every few rounds it automatically titles the session and maintains logs & long-term memory — independent mode is fully automated; assist mode joins a background side-discussion as an archivist and lets your agent decide what to write.","onboarding.agents.historianSaveFail":"Failed to save Historian settings: {e}","onboarding.agents.moreHint":"Trigger cadence, prompt and the other background agent (Muse) live in Settings → Background agents.","onboarding.workspace.stepLabel":"Choose a default local folder","onboarding.workspace.hint":"Default working directory for new local sessions; leave empty to use the Sessions folder inside your notes library (or ~/Forsion without one).","onboarding.workspace.placeholder":"~/Forsion (default)","onboarding.workspace.pick":"Browse folder","onboarding.workspace.clear":"Clear","settings.advanced.agentDesk":"Agent Desk stage panel","settings.advanced.agentDeskHint":"A stage area beside the chat, on by default. Files the agent edits show up there automatically, and the agent can deliberately stage files, notes and mindmaps for you — and screenshot them to check its own work. Drag to resize, collapse to a card.","settings.advanced.agentDeskEnable":"Enable Agent Desk","settings.advanced.summaryOpenIn":"Clicking a file in the task overview","settings.advanced.summaryOpenInHint":"Where sources and outputs in the task overview card open.","settings.advanced.summaryOpenIn.tab":"Open in a new tab","settings.advanced.summaryOpenIn.desk":"Show in Agent Desk","desk.title":"Agent Desk","desk.close":"Close panel","tool.verb.presented":"Presented","tool.verb.sketched":"Sketched","sketch.mobileUnavailable":"This card isn't available in the mobile app (open it on desktop or web).","sketch.expand":"Expand card","sketch.collapse":"Collapse card","settings.advanced.exportLogs":"Export session logs","settings.advanced.exportLogsHint":"Bundle this session’s full conversation, the actual interface state and action trail, renderer errors and the backend runtime logs into one JSON file for developer debugging.","settings.advanced.exportBtn":"Export as JSON","settings.advanced.exportNoSession":"No active session — open a session first, then export.","settings.advanced.exportOk":"Exported to {path}","settings.advanced.exportCanceled":"Export canceled","settings.advanced.exportFailed":"Export failed: {err}","settings.clearData.label":"Clear data / Uninstall","settings.clearData.hint":"Delete Forsion data on this machine. This cannot be undone; the app restarts fresh afterward.","settings.clearData.tangu":"Tangu data & project folders (account, settings, agents, sessions, ~/Forsion)","settings.clearData.desktop":"Desktop settings (window & Amadeus shell config)","settings.clearData.btn":"Clear & restart","settings.clearData.confirm":"Clear the selected data? This cannot be undone and the app will restart.","settings.clearData.macNote":"This only clears data. To fully uninstall Forsion, drag it from Applications to the Trash.","view.changelog":"What's new","changelog.newVersion":"New version {version} available","changelog.newest":"Latest","changelog.zhOnly":"Release notes for this version are available in Chinese only.","settings.developer.testUpdateLabel":"Update popup test","settings.developer.testUpdate":"Open update tab (test)","settings.developer.testUpdateHint":"Force-open the update tab to verify the update popup renders (no real new version required).","input.fileref.session":"Past session","input.slash.loop":"Max loop iterations: /loop <n> (currently {current}, range 1-200)","input.slash.loopSet":"Max loop iterations set to {n}","input.ctxLabel":"Context","input.sessionTokens":"Session {n} tokens","input.runCost":"Run cost {used}/{limit} pts","cost.nearCap":"⚠ Run cost reached {used} pts (limit {limit}, tune TANGU_MAX_RUN_COST); the run stops once the cap is exceeded","ctx.compacted.auto":"Context auto-compacted (~{saved} chars saved)","ctx.compacted.forced":"Context reached the auto-compact threshold; summarized and compacted","ctx.compacted.overflow":"Context exceeded the model limit; summarized, compacted and retried this turn","ctx.windowSource.override":"Window: manual override table","ctx.windowSource.model":"Window: model-reported","ctx.windowSource.family":"Window: inferred from model family (not model-reported)","ctx.windowSource.learned":"Window: learned from the provider's own overflow error","ctx.windowSource.default":"Window: 272k default fallback (unknown model; set it under Settings → Models)","ctx.windowCapped":"The model supports up to {max}; {n} is used by default","ctx.sec.persona":"Persona/instructions","ctx.sec.harness":"Evolution record","ctx.sec.guidance":"Base guidance/contracts","ctx.sec.profile":"User profile","ctx.sec.project":"Project instructions","ctx.sec.agentFolder":"Agent folder/library","ctx.sec.memory":"Long-term memory","ctx.sec.skills":"Skill catalog","ctx.sec.environment":"Environment/tool catalog","ctx.sec.hooks":"Hooks context","ctx.sec.plan":"Plan mode","ctx.sec.history":"History ({n} messages)","ctx.files.label":"Instruction files loaded this run","ctx.files.truncated":"⚠ truncated over 32KB","ctx.files.none":"None (no AGENTS.md / CLAUDE.md in this project)","approval.why.customAsk":'Your approval rule "{rule}" requires asking you for this step',"approval.why.escalate":'Writes outside the workspace — this mode confirms every time ("always allow" does not apply)',"approval.why.protected":`Changes credentials or Forsion's local configuration — confirmed every time (full access and "always allow" do not skip it)`,"approval.why.mode":'The current approval mode "{mode}" requires your approval for this kind of action',"approval.why.control":'This sets up or changes work that can later run without you watching, so each call needs your confirmation ("always allow" does not apply)',"inbox.approval.withdrawnSystem":"The system withdrew this request (its stored details cannot be shown in full, or a newer request for the same action replaced it), so it cannot be approved here. Ask the agent to request it again if needed.","approval.cmdOverflow":"This command is too long to show in full; scroll to read all of it before approving.","approval.cmdWideBlank":"This command contains a long run of blank space that can push later text out of view; the full text with that space marked is shown below.","approval.previewScrollHint":"This is long; scroll to read all of it before approving.","approval.cmdHiddenChars":"This command contains invisible or direction-changing characters, so what you see may differ from what runs.","input.approval.editRules":"Edit rules…","input.approval.editRulesDesc":"Allow / ask / deny lists by tool name and argument prefix","approvalRules.loadFailed":"Couldn't load the existing rules, so the form is hidden — saving a blank form would wipe your lists.","approvalRules.title":"Custom approval rules","approvalRules.scopeNote":"⚠ Rules are global — stored in ~/.forsion/config.json and shared by all sessions; the approval mode is what you pick per session. Saved rules apply from the next tool call, no restart.","approvalRules.syntax":"Syntax: a tool name, or name* for prefix match, optionally followed by :argument-prefix (command for shell tools, path for file writes). e.g. web_fetch | mcp__* | run_bash:npm test | write_file:/etc/","approvalRules.base":"Fallback mode","approvalRules.baseHint":"Used when no rule matches (priority: deny > ask > allow > fallback)","approvalRules.deny":"Deny","approvalRules.denyHint":"Rejected outright, never asked. The model is told which rule blocked it.","approvalRules.denyPh":`write_file:/etc/
294
294
  run_bash:rm -rf`,"approvalRules.ask":"Always ask me","approvalRules.askHint":'Always prompts; "always allow" does not apply (you wrote "ask me every time").',"approvalRules.askPh":`run_bash:npm publish
295
295
  browser_task`,"approvalRules.allow":"Allow","approvalRules.allowHint":"Runs without asking and overrides the fallback mode. Writes outside the workspace still ask for confirmation (except under Full access); an allow rule skips that only when it has an absolute path prefix covering every write target (e.g. write_file:/Users/you/proj/). ⚠ A broad rule (run_bash, or *) still waves through everything else it matches, in every session on the custom mode.","approvalRules.allowPh":`web_fetch
296
- mcp__*`,"pill.thinkUnsupported":"(unsupported by this model, auto-downgrades)","input.compact":"Compact context","input.compacting":"Compacting context…","input.compactDone":"Context compacted ({n} messages folded into a summary; continues compactly)","input.compactSkip":"Nothing to compact: {reason}","input.compactFail":"Compaction failed: {e}","input.slash.compact":"Compact context: summarize then continue compactly","input.slash.voiceOn":"Switch to voice messages (this Agent replies as voice)","input.slash.voiceOff":"Switch back to text messages","input.slash.voiceOnHint":"Voice messages on: this Agent’s replies will be voice (desktop voice bar; on WeChat, an audio file alongside the text).","input.slash.voiceOffHint":"Switched back to text messages.","voice.play":"Play","voice.pause":"Pause","voice.label":"Voice","voice.toText":"Show text","voice.toggleFailed":"Failed to toggle voice mode: {e}","input.slash.stop":"Stop the current run","input.slash.skillUse":"Use skill {name} for this message","input.skillChipTitle":"This skill will be used for this message","input.slash.agent":"Use a normal agent (custom persona)","input.agentActive":"Active agent: {name}","input.agentCleared":"Normal agent cleared","input.engineDefault":"Tangu","input.engineChipTitle":"Run engine","input.engineSection":"Run engine","input.engineModelDefault":"Use engine default","engine.pickTitle":"Choose the agent for this chat","engine.warming":"Starting {name}…","pill.more":"More (next page)","header.currentAgent":"Current agent","settings.tab.agentClis":"Local agent CLIs","settings.agentClis.title":"Agent CLIs","settings.agentClis.hint":"Detected third-party agents (Claude Code / Codex …). Set a default model. New chats can pick them.","settings.agentClis.detected":"Detected","settings.agentClis.needsSignin":"Needs sign-in","settings.agentClis.notDetected":"Not detected","settings.agentClis.notDetectedHint":"Install & sign in to this agent to enable it.","settings.agentClis.defaultModel":"Default model","settings.agentClis.modelDefault":"(engine default)","settings.agentClis.loadingModels":"Loading models…","settings.agentClis.empty":"No external agent engines (host-only feature).","settings.agentClis.importHint":"Importing copies it into Tangu as your own skill/MCP (survives uninstalling the CLI). MCP imports start disabled — enable them in MCP settings.","settings.agentClis.skillsLabel":"Installed skills","settings.agentClis.mcpLabel":"Installed MCP","settings.agentClis.importBtn":"Import","settings.agentClis.imported":"Imported","settings.tab.agents":"Agents","settings.agents.title":"Normal agents (custom personas)","settings.agents.hint":"Define reusable conversational personas (system prompt + model + settings) for different tasks. Agents can also self-author via the manage_agent tool.","settings.agents.new":"New agent","settings.agents.brainSection":"Brain (memory / journal / library)","settings.agents.brainSectionHint":"View and edit this agent's long-term memory, daily journal and library files.","settings.agents.openBrain":"Open brain","settings.agents.createViaChat":"Create with AI","settings.agents.createViaChatHint":"Open a new chat and let an agent build the new agent for you","settings.agents.empty":'No agents yet — click "New agent" to create one.',"settings.agents.name":"Name","settings.agents.namePlaceholder":"e.g. Code Reviewer","settings.agents.desc":"Description","settings.agents.model":"Model (empty = use session model)","settings.agents.modelDefault":"(use session model)","settings.agents.systemPrompt":"Developer instructions (what / how / must-read)","settings.agents.systemPromptPlaceholder":"You are a meticulous code reviewer…","settings.agents.thinking":"Thinking effort","settings.agents.maxIter":"Max iterations","settings.agents.approval":"Approval","settings.agents.inherit":"(inherit)","settings.agents.byAgent":"agent-authored","agent.badge.system":"Background","settings.agents.deleteConfirm":'Delete agent "{name}"?',"settings.agents.saveFail":"Save failed: {e}","settings.agents.cloudOnly":"Normal Agents are only available locally (desktop/TUI).","settings.agents.soul":"Persona (SOUL)","settings.agents.soulPlaceholder":'Calm, focused; concise replies… (tone & values, distinct from the "what to do" instructions)',"settings.agents.shareMemory":"Share the default agent's memory & log","settings.agents.shareMemoryHint":"When on, this agent reads/writes the default agent's memory & log; off (default) = its own.","settings.agents.cloudSync":"Cloud sync (mirror across devices)","settings.agents.cloudSyncHint":"When on, all of this agent's files (definition/memory/log/Library) mirror across your devices, newest wins; off (default) = local only.","settings.agents.cloudSyncOn":"Cloud sync: on","settings.agents.cloudSyncOff":"Cloud sync: off","settings.agents.activityAccess":"Allow reading the activity log","settings.agents.activityAccessHint":"Grants this agent read_activity to view your in-app activity; off (default) = Muse only.","settings.agents.toolPolicy":"Tool allow/deny list","settings.agents.toolPolicyNone":"No restriction (all tools)","settings.agents.toolPolicyDeny":"Denylist: unchecked = disabled; new engine tools allowed by default","settings.agents.toolPolicyAllow":"Allowlist: only checked tools usable; new engine tools disabled by default","settings.agents.toolPolicyHint":"Checked = usable. Governs the regular tools below only; permission-gated tools (e.g. read_activity) are unaffected.","settings.agents.toolPolicyEmpty":"Tool catalog unavailable (local engine must be running).","settings.agents.avatar":"Avatar","settings.agents.avatarHint":"Click to upload, ≤1MB (PNG/JPG/GIF/WebP); stored in this agent's Library.","settings.agents.avatarPick":"Upload avatar","settings.agents.avatarRemove":"Remove avatar","settings.agents.avatarTooLarge":"Image exceeds 1MB, please pick a smaller one.","settings.agents.avatarSaveFirst":"Save the agent first, then set an avatar.","settings.tab.shortcuts":"Shortcuts","settings.shortcuts.desc":"Click a shortcut to record, then press the key combo to set it; Esc to cancel. Each combo binds to only one command.","settings.shortcuts.commands":"Commands and shortcuts · {count}","settings.shortcuts.searchPlaceholder":"Search commands or shortcuts","settings.shortcuts.resultCount":"Showing {count}","settings.shortcuts.noResults":"No matching commands.","settings.shortcuts.commandPalette":"Command palette","settings.shortcuts.record":"Click to record shortcut","settings.shortcuts.recording":"Press keys…","settings.shortcuts.reset":"Reset to default","settings.shortcuts.clear":"Unbind","settings.shortcuts.unbound":"Not set","settings.shortcuts.resetAll":"Reset all to default","settings.shortcuts.reassigned":'Unbound this shortcut from "{name}"',"tool.verb.wrote":"Wrote","tool.verb.edited":"Edited","tool.verb.ran":"Ran","tool.verb.read":"Read","tool.verb.listed":"Listed","tool.verb.searched":"Searched","tool.verb.browsed":"Browsed","tool.sum.wrote":"Wrote {n} file(s)","tool.sum.edited":"Edited {n} file(s)","tool.sum.ran":"Ran {n} command(s)","tool.sum.read":"Read {n} item(s)","tool.sum.searched":"Searched {n}×","tool.sum.browsed":"Browsed {n}×","tool.sum.other":"{n} tool(s)","settings.agents.isDefault":"default","settings.agents.setDefault":"Set as default","settings.agents.viewMem":"View brain (memory / log / library)","settings.agents.memTitle":"{name} · Agent brain","settings.agents.memory":"Long-term memory (MEMORY.md, editable)","settings.agents.memSaved":"Saved","settings.agents.log":"Log (LOG, editable)","settings.agents.noLog":"No log yet","settings.agents.tabMemory":"Memory","settings.agents.tabLog":"Logs","settings.agents.tabLibrary":"Library","settings.agents.library":"Library (Library/, reference docs + avatar)","settings.agents.libraryEmpty":"No files yet","settings.agents.libraryUpload":"Upload","settings.agents.librarySelectHint":"Click a file to view / edit","settings.agents.libraryBinaryHint":"Binary file — preview only","settings.agents.libraryDeleteConfirm":'Delete file "{name}"?',"settings.agents.libraryTooLarge":"File exceeds 5MB","settings.agents.userProfile":"User profile (USER.md, visible to all agents)","settings.agents.userProfileHint":"Your name, preferences, level, long-term needs; every agent reads it.","settings.agents.tabHarness":"Evolution","settings.agents.harnessHint":"Working notes are methods the agent distilled from its own work. Writes need approval (except in full access), and every run loads them.","settings.agents.harnessEmpty":"No working notes yet. Type /refine in a session with this agent to let it distill lessons.","settings.agents.harnessEvidence":"Evidence: {text}","settings.agents.harnessKindNote":"Note","settings.agents.harnessKindRecipe":"Recipe","settings.agents.harnessCount":"{count} of {max} working notes","settings.agents.harnessLastChange":"Last evolved {time}","settings.agents.harnessRefine":"Reflect on this conversation","settings.agents.harnessRefineSent":"Reflection started. Follow along in the conversation.","settings.agents.harnessShowAll":"Show all {count}","settings.agents.harnessLoading":"Loading working notes…","settings.agents.harnessLocalOnly":"Working notes are available with the local engine only.","settings.agents.harnessHistory":"Edit history (this device)","settings.agents.harnessRollback":"Undo last change","settings.agents.harnessRestore":"Restore","settings.agents.harnessRollbackConfirm":'Undo the last change to "{title}"? (Undo again to bring it back)',"settings.agents.harnessActCreate":"Created","settings.agents.harnessActUpdate":"Edited","settings.agents.harnessActDelete":"Deleted","settings.agents.harnessActRollback":"Rolled back","settings.agents.harnessCandidates":"Awaiting reflection: {count}","settings.agents.harnessCandidatesHint":"Methods the Historian nominated from past conversations. During reflection the agent reviews each one, keeps the durable ones as working notes and drops the rest.","settings.agents.selfAuthored":"Self-authored","settings.agents.sharedSkill":"Shared","agent.pickTitle":"Choose agent","settings.tab.special":"Background agents","settings.special.title":"Special Agents (background)","settings.special.hint":"On by default; once you turn one off, it stays off. Leave the model empty to follow the cloud default; records are isolated locally and never appear in the session list.","settings.special.pickModelFirst":"Pick a model before enabling","settings.special.followCloudDefault":"Follow cloud default ({model})","settings.model.imageCloudDefaultTag":"Cloud default","settings.model.imageFollowingDefault":"No manual pick — following the cloud image default: {model}. Click a model to pin your own choice; click again to unpin.","settings.special.model":"Model","settings.special.enable":"Enable","settings.special.historian":"Historian","settings.special.historianDesc":"Summarizes the session title every X rounds; reviews & updates your LOG and memory every Y rounds.","settings.special.muse":"Muse","settings.special.museDesc":"Resident background agent: wakes on heartbeat, schedules and rules and works inside its own Library; out-of-scope actions follow its permission tier, output lands in the inbox and Muse Space.","settings.special.h.rounds":"Maintain every N rounds","settings.special.h.firstRound":"Always trigger on first round","settings.special.h.harnessCandidates":"Self-evolution auto-collect","settings.special.h.harnessCandidatesHint":"The judge also nominates working-note candidates into each agent's inbox. The Evolution tab shows how many await reflection, and a notification appears when a nomination lands in the conversation you are viewing. Candidates are adopted only during /refine, via approval, never written automatically.","settings.special.h.prompt":"Memory-judgment prompt (empty = default)","settings.special.m.maxIter":"Max iterations / cycle","settings.special.m.maxTodos":"Max TODOs / window","settings.special.m.activeHours":"Active hours (device local time)","settings.special.m.activeAllDay":"All day","settings.special.m.persona":'Edit its persona and instructions under "Muse" in the agent roster.',"settings.special.m.folders":"Extra folders (one absolute path per line)","settings.special.m.foldersHintAsk":"Ask / agent tiers: only a hint telling Muse to look there; writes still queue for approval per tier.","settings.special.m.foldersHintAuto":"Full auto: these folders are directly readable and writable.","settings.special.m.secRhythm":"Rhythm","settings.special.m.budget":"Budget","settings.special.m.budgetWindow":"Budget window (hours)","settings.special.m.maxCycles":"Max cycles / window","settings.special.h.mode":"Mode","settings.special.h.modeIndependent":"Independent","settings.special.h.modeAssist":"Assist","settings.special.h.modeFork":"Fork","settings.special.h.modeHintIndependent":"Historian reads the recent transcript with the model above and maintains the title, summary, log and memory on its own.","settings.special.h.modeHintAssist":"When due, branches a short background discussion with the session's agent; the main agent decides and writes itself. Title/summary are still maintained by Historian; the first round is always independent.","settings.special.h.modeHintFork":"Judges via a single tail-fork completion of the full live context using the session model (prompt-cache friendly, sees far more than Independent; falls back to Independent on failure). The model above is only used for fallback judging and memory consolidation.","settings.special.h.fallbackModel":"Fallback / consolidation model","settings.special.saved":"Saved","settings.special.saveFail":"Save failed: {e}","settings.special.on":"On","settings.special.off":"Off","settings.special.custom":"Custom","settings.special.sectionTitle":"Background agents (special)","settings.agents.sectionTitle":"Normal agents (custom personas)","settings.agents.starterTemplate":"You are … (describe this agent's identity, expertise, tone, and how it should approach tasks).","sidebar.special.title":"Background agents","special.action.title_updated":"title updated","special.action.summary_updated":"summary updated","special.action.log_appended":"log appended","special.action.memory_appended":"memory appended","special.action.memory_updated":"memory updated","special.action.assist_discussion":"assist discussion started","special.muse.title":"Muse workspace","special.muse.thinking":"Current thinking","special.muse.idle":"Muse is idle","special.muse.running":"Muse is thinking…","special.muse.disabled":"Muse is off (enable it and pick a model in Settings → Background agents).","special.muse.todos":"Muse TODO list","special.muse.todosEmpty":"No TODOs yet. Muse proposes high-value tasks after thinking in the background.","special.muse.selectAll":"Select all","special.muse.inject":"Inject selected into a session & run","special.muse.pickSession":"Pick target session…","special.muse.injected":"Injected {n} into a session and started running","special.muse.dismiss":"Dismiss","special.muse.markDone":"Mark done","special.muse.injectFail":"Inject failed: {e}","special.muse.watches":"Watch rules","special.muse.watchesAll":"All automations →","special.muse.watchesHint":'Say "keep an eye on xxx.md until it reaches 100 chars" in any chat to set one; when a rule fires, Muse wakes up and proposes a todo.',"special.muse.trigFile":'"{path}" reaches {n} chars',"special.muse.trigEvent":'activity contains "{match}"',"special.muse.trigDaily":"daily at {time}","special.muse.trigFired":"last fired {t}","special.muse.watchDelete":"Delete rule","special.muse.approvals":"Pending approvals","special.muse.approvalsEmpty":"Nothing is waiting for your approval.","special.muse.approve":"Approve & run","special.muse.reject":"Reject","special.muse.approveFail":"Could not approve: {e}","special.muse.approvalNote":"Your agent's verdict: {note}","special.muse.runNew":"Run selected in a new session","special.muse.injectPrefix":"Please handle these todos from Muse:","muse.lib.openEditor":"Open in editor","special.muse.tracks":"Tracking","special.muse.tracksEmpty":'No tracked tasks. Use "Hand to Muse" on a task card in chat to add one.',"special.muse.trackDelete":"Stop tracking","special.muse.modeLabel":"Tier","special.muse.pending":"{n} pending approval","space.muse":"Muse","muse.builtinDesc":"Muse Space: the Space Muse builds itself (a Forsion plugin it writes and improves each cycle); approve its out-of-scope actions in the side panel. Shows its workspace until it has built one.","view.museLibrary":"Muse workspace","view.museHome":"Muse Space","muse.openLibrary":"Open Muse workspace","view.musePanel":"Muse","muse.lib.empty":"Muse has not written anything yet. Once enabled, its notes, drafts and daily journal appear here.","muse.lib.refresh":"Refresh","chat.task.here":"Run here","chat.task.new":"Run in new session","chat.task.muse":"Hand to Muse","chat.task.ignore":"Ignore","chat.task.trackTag":"Track","chat.task.tracked":"Handed to Muse (visible in Calendar)","chat.task.trackFail":"Could not hand to Muse: {e}","chat.task.doneHere":"Sent here","chat.task.doneNew":"Sent to a new session","chat.task.doneMuse":"Handed to Muse","chat.task.doneIgnore":"Ignored","chat.task.showPrompt":"Show task brief","chat.task.hidePrompt":"Hide task brief","chat.task.tooLong":"The task brief is over 4000 characters and cannot be handed to Muse; split it up, or run it here or in a new session.","chat.task.museDo":"Let Muse do it","chat.task.doneMuseDo":"Handed to Muse","chat.task.handedDo":"Handed to Muse: it picks this up on its next run (subject to its active hours and budget); anything beyond its permissions comes back to you for approval","chat.task.museOff":"Muse is turned off: turn it on in Settings, or run this in a new session","chat.task.todoSyncFail":"Could not update the todo status: {e}","chat.task.doneTodo":"This todo has already been handled","chat.task.todoChecking":"Checking this todo’s status…","chat.task.todoCheckFail":"Couldn’t load this todo’s status","chat.task.todoMissing":"This todo no longer exists","special.muse.actionFail":"Action failed: {e}","special.muse.execFailed":"Approved, but the execution failed: {e}","settings.special.m.mode":"Permission tier","settings.special.m.modeAsk":"Ask (out-of-scope actions queue for your approval)","settings.special.m.modeAgent":"Agent approves (your default agent decides once on your behalf)","settings.special.m.modeAuto":"Full auto","settings.special.m.modeDesc":"All tiers work freely inside Muse's own Library; out-of-scope writes and commands follow the tier, and plugin installs always need your confirmation.","settings.special.m.heartbeat":"Heartbeat interval (minutes; 0 = wake only for schedules and rules)","settings.special.m.heartbeatHint":'The supervisor poll shrinks to match a finer heartbeat; the actual cycle count is still capped by "Max cycles / window" under Budget.',"settings.special.m.notify":"Notifications","settings.special.m.notifyMode":"Delivery","settings.special.m.notifyImmediate":"Immediate","settings.special.m.notifyDigest":"Daily digest","settings.special.m.escalateTo":"Hand hard work to","settings.special.m.escalateNone":"None","settings.customProvider.fetchModels":"Fetch models","settings.customProvider.fetchEmpty":"No models found (endpoint returned no list)","sidebar.search.placeholder":"Search chats…","sidebar.search.noResults":"No matching chats","sidebar.deleteConfirm":'Permanently delete chat "{name}"? This cannot be undone.',"chat.action.quote":"Quote","chat.action.askInPanel":"Ask in side panel","chat.selection.actions":"Selected text actions","chat.error":"Run failed","chat.llmRetrying":"Network hiccup — retrying in {s}s (attempt {n}/{max})","chat.err.network":"Cannot reach the model service (network down or server not running)","chat.err.dropped":"Connection dropped mid-response (network hiccup); reply incomplete","chat.err.timeout":"Request timed out — slow network or model","chat.err.auth":"Authentication failed — check API key or login","chat.err.rate":"Rate limited — please retry later","chat.err.server":"Model service error — please retry later","chat.err.quota":"AI quota used up — click your avatar (bottom-left) to check usage, use a reset card to restore it now, or upgrade your plan","chat.err.runCost":"This run hit its cost ceiling and was stopped automatically","chat.err.inputTooLarge":"Input too large for the model — trim it and retry","chat.err.groupAgents":"Team mode needs at least 2 valid agents","chat.err.orphaned":"Run was interrupted unexpectedly (app restart or process exit) — please retry","chat.err.engineRemote":"External engines can't be driven from a remote device — continue this chat on the host computer","chat.edit.saveResend":"Save & resend","group.voting.inProgress":"Voting…","workbench.chat":"Chat","workbench.leftSidebar":"Left sidebar","workbench.rightSidebar":"Right sidebar","theme.changeSkin":"Change accent color","theme.changeMode":"Toggle light/dark mode","theme.changeLanguage":"Switch theme style","command.palette":"Command palette (⌘K)","command.toggleSmoothCaret":"Toggle smooth caret","command.toggleLeft":"Toggle left sidebar","command.toggleRight":"Toggle right sidebar","command.toggleBottom":"Toggle bottom panel","panel.emptyTitle":"Empty panel","panel.empty":"This panel is empty, try dragging a tab here.","command.splitRight":"Split right","command.resetLayout":"Reset layout","command.stop":"Stop current run","command.compact":"Compact context","command.branch":"Branch from latest reply","command.saveLayout":"Save named layout","command.applyLayout":"Restore named layout","layout.namePrompt":"Layout name","layout.saved":"Saved layout “{name}”","layout.none":"No named layouts saved yet","layout.applyPrompt":"Enter a layout to restore: {names}","status.context":"Context","header.connecting":"Connecting…","command.placeholder":"Run a command…","command.empty":"No commands","command.select":"Select","command.run":"Run","command.count":"{count} commands","group.host":"Host","special.agents.title":"Background agents","special.memory.title":"Memory","sidebar.special.historianSub":"Summarizes titles · curates memory","sidebar.special.museSub":"Background thinking · TODOs","sidebar.wechat.setConnectedOk":"Now the connected WeChat session.","sidebar.wechat.setConnectedFail":"Failed: {e}","preview.close":"Close","preview.expand":"Expand","preview.collapse":"Collapse","preview.download":"Download","preview.notFound":"File not found","preview.loadFailed":"Failed to load","preview.notAvailable":"No preview for this file type","preview.tooLarge":"File too large ({size}) to preview","preview.htmlPreview":"Preview","view.wsfile":"File preview","preview.openWithDefault":"Open with default app","preview.unsupportedAsk":"Can't preview this file type. Open it with the system default app?","preview.expired":"Preview content expired (this kind of preview does not survive restarts). Reopen it from its source.","preview.mdEdit":"Edit","preview.openInAmadeus":"Open in Amadeus","preview.mdConflict":"File was modified externally","preview.mdReload":"Reload","preview.mdOverwrite":"Overwrite","preview.mdSaveFail":"Save failed: {err}","preview.mdSalvaged":'File was modified externally; your edits were saved as "{file}"',"panel.toast.invalidName":"Invalid name: {name}","panel.action.open":"Open","panel.action.newFile":"New file","panel.action.newFolder":"New folder","panel.action.copyPath":"Copy path","preview.htmlCode":"Source","preview.reload":"Reload","preview.openInBrowser":"Open in browser (same preview server; Forsion AI works with your account)","preview.csvTruncated":"Showing first {shown} of {total} rows","preview.slide":"Slide {n}","preview.wrap":"Wrap","preview.zoomIn":"Zoom in","preview.zoomOut":"Zoom out","preview.fit":"Fit","preview.diffSideBySide":"Side by side","preview.diffLineByLine":"Line by line","preview.pdfPages":"Showing first {n} of {total} pages — download to view all","panel.action.preview":"Preview","panel.action.deleteN":"Delete {n}","panel.confirm.trashN":"Move {n} selected items to trash?","panel.confirm.delete":'Delete "{name}"?',"panel.confirm.deleteN":"Delete {n} selected files?","panel.toast.copied":"Copied {n} item(s) to workspace","panel.toast.copyFail":"Copy failed: {err}","panel.toast.moveFail":"Move failed: {err}","settings.tab.notifications":"Notifications","settings.tab.statusbar":"Status bar","ntf.enable":"Enable notifications","ntf.delivery":"Delivery","ntf.enableHint":"Floating cards popping from the top-right; when off, everything (errors included) is silenced.","ntf.osEnable":"System notifications","ntf.osEnableHint":"Also pop an OS notification when the app is in the background (all types, not just Inbox).","ntf.sendTest":"Send test notification","ntf.testBody":"This is a test notification 👋","ntf.events":"Notification events","ntf.eventsHint":"Keep only the events worth your attention to reduce noise.","ntf.event.system":"System messages","ntf.event.syncError":"Sync failures / conflicts","ntf.event.syncDone":"Remote sync completed","ntf.event.syncDoneOnline":"Online sync completed","ntf.event.agentDone":"Background session finished","ntf.event.inbox":"New Inbox message","ntf.event.noteReminder":"Note reminders (@remind:)","ntf.event.harnessCandidates":"Working-note nominations","ntf.pluginEvents":"Plugin notifications","ntf.pluginEventsHint":"One switch per plugin (the source of ctx.notify; turn off to mute that plugin).","ntf.view":"View","ntf.syncError":"Online sync failed: {e}","ipcerr.notLoggedIn":"Not signed in to Forsion","ipcerr.loginExpired":"Your Forsion sign-in has expired. Sign in again","ipcerr.vaultMissing":"Vault folder not found: {detail}","ipcerr.mirrorMissing":"Mirror folder not found (it has sync history, so an empty one won't be created): {detail}","ipcerr.scanFailed":"Couldn't read the local folder, so this round won't treat missing files as deleted: {detail}","ipcerr.invalidSpaceId":"Invalid Space identifier","ipcerr.invalidPluginId":"Invalid plugin identifier","ipcerr.notUserPlugin":"This plugin isn't in the user plugins folder (built-in plugins can't be uninstalled)","ipcerr.pluginNotFound":"Plugin not found","ipcerr.mcpNameReserved":'The MCP server name "{detail}" is reserved: names that are dev or start with dev_ belong to device tools. Pick another name',"settings.discovery.mcpReserved":"Not imported: {names}. MCP server names that are dev or start with dev_ belong to device tools. Rename them and add them by hand on the MCP page.","ntf.syncDone":"Online sync completed","ntf.noteReminder":"Reminder · {src}","ntf.remoteSyncDone":"Remote sync done: {n} change(s)","ntf.remoteSyncFail":"Remote sync failed: {e}","ntf.remoteSyncConflicts":"Remote sync conflicts: {n} pending","ntf.remoteSyncPendingDel":"Remote sync: {n} deletion(s) awaiting confirmation","ntf.actionReview":"Review","ntf.agentDone":'"{name}" finished',"ntf.agentFail":'"{name}" failed',"ntf.harnessCandidates":'"{name}" has new working-note candidates. Reflect now?',"ntf.actionRefine":"Reflect","sb.enable":"Show status bar","sb.display":"Display","sb.enableHint":"A slim bar at the bottom showing sync / backlinks / word count per current view. Off by default; it appears with just the sync status while sync is failing.","sb.items":"Status bar","sb.itemsHint":"Uncheck to hide; drag to reorder (plugin items appear here once enabled).","sb.side.left":"Front","sb.side.right":"Back","sb.item.space":"Current Space","sb.item.agentRunning":"Running sessions","sb.item.sync":"Sync status","sb.item.backlinks":"Backlinks","sb.item.wordCount":"Word count","sb.item.inbox":"Inbox unread","sb.agentRunning":"{n} running","sb.synced":"Synced","sb.syncing":"Syncing · {n}","sb.syncingPlain":"Syncing…","sb.syncProgress":"Syncing {done}/{total}","sb.syncError":"Sync error","sb.syncOffline":"Offline","sb.chars":"{n} chars","sb.backlinks":"{n} backlinks","amadeus.default.note":"Untitled","amadeus.default.dashboard":"Untitled dashboard","amadeus.default.drawing":"Untitled whiteboard","amadeus.default.database":"Untitled database","amadeus.default.folder":"New folder","amadeus.default.section":"New section","amadeus.default.pdfBookmark":"Page {page}","amadeus.new.note":"New note","amadeus.new.childNote":"New sub-note","amadeus.new.dashboard":"New dashboard","amadeus.new.dashboardIn":"New dashboard in “{folder}”","amadeus.new.drawing":"New whiteboard","amadeus.new.drawingIn":"New whiteboard in “{folder}”","amadeus.new.folder":"New folder","amadeus.new.folderIn":"New folder in “{folder}”","amadeus.new.database":"New base","amadeus.new.databaseIn":"New base in “{folder}”","amadeus.exists":"“{name}” already exists","amadeus.cmd.quickSwitch":"Quick switch note","amadeus.cmd.search":"Search notes (full text)","amadeus.cmd.tutorial":"Open the tutorial","amadeus.cmd.manual":"Open the user manual","amadeus.cmd.dailyNote":"Open today's daily note","amadeus.cmd.toggleStar":"Star / unstar current note","amadeus.cmd.toggleSource":"Toggle source / visual editing","amadeus.cmd.openVault":"Open vault…","amadeus.cmd.reveal":"Reveal current note in file manager","amadeus.cmd.reindex":"Rebuild full-text index","amadeus.cmd.toggleWikiFiles":"Toggle attachments & databases in wikilink autocomplete","amadeus.cmd.wikiFilesOn":"Wikilink autocomplete now includes attachments and databases","amadeus.cmd.wikiFilesOff":"Wikilink autocomplete now covers notes only"},xr={zh:bo,en:ld};function yo(e){for(const[t,n]of Object.entries(e))n.zh!=null&&(bo[t]=n.zh),n.en!=null&&(ld[t]=n.en)}const f1={"app.defaultWorkspace":["Tangu Default Workspace","Tangu 默认工作区","Tangu default workspace"],"app.cloudWorkspace":["Cloud Workspace","Cloud 工作区","Cloud workspace"]};function cC(e){const t=Object.values(xr).map(n=>n[e]).filter(n=>!!n);return[...new Set([...t,...f1[e]??[]])]}function vs(e,t,n){return cd(xr[e][t]??xr.zh[t]??t,n)}function re(e,t){return vs(Kt,e,t)}function uC(e,t,n){return vs(e,t,n)}function cd(e,t){return t?e.replace(/\{(\w+)\}/g,(n,i)=>i in t?String(t[i]):`{${i}}`):e}const wo=nt.createContext(null);let Kt=ad(),wn=null;function dC(){wn?.(Kt==="zh"?"en":"zh")}function _r(){return Kt}const Cr=new Set;function p1(e){return Cr.add(e),()=>{Cr.delete(e)}}function ud(e){if(Kt!==e){Kt=e,c1(),dd(e);for(const t of Array.from(Cr))try{t(e)}catch(n){typeof globalThis.reportError=="function"?globalThis.reportError(n):console.error("[i18n] locale subscriber failed",n)}}}function dd(e=Kt){try{window.tangu?.reportUiLocale?.(e)}catch{}}function fd(e){if(wn){wn(e);return}try{localStorage.setItem(ci,e)}catch{}try{document.documentElement.lang=e==="zh"?"zh-CN":"en"}catch{}ud(e)}const fC=({children:e})=>{const[t,n]=nt.useState(ad),i=nt.useCallback(r=>{n(r);try{localStorage.setItem(ci,r)}catch{}try{document.documentElement.lang=r==="zh"?"zh-CN":"en"}catch{}ud(r)},[]);nt.useEffect(()=>(wn=i,Kt=t,()=>{wn===i&&(wn=null)}),[i,t]),nt.useEffect(()=>{dd(t)},[t]),nt.useEffect(()=>{try{document.documentElement.lang=t==="zh"?"zh-CN":"en"}catch{}},[t]),nt.useEffect(()=>{d1()},[]);const s=nt.useMemo(()=>({locale:t,setLocale:i,t:(r,o)=>vs(t,r,o)}),[t,i]);return ks.jsx(wo.Provider,{value:s,children:e})},pC=({children:e})=>{const t=nt.useSyncExternalStore(p1,_r,_r),n=nt.useMemo(()=>({locale:t,setLocale:fd,t:(i,s)=>vs(t,i,s)}),[t]);return ks.jsx(wo.Provider,{value:n,children:e})};function hC(){const e=nt.useContext(wo);return e||{locale:"zh",setLocale:()=>{},t:(t,n)=>cd(bo[t]??t,n)}}yo({"amxlinks.rewriteFailed":{zh:"已改名 / 移动,但有 {n} 篇笔记里指向它的链接没能跟着更新:{names}。请打开这些笔记检查链接。",en:"Renamed or moved, but links to it in {n} notes could not be updated: {names}. Open those notes and check the links."},"amxlinks.nameSep":{zh:"、",en:", "}});const h1=e=>(e.split("/").pop()??e).replace(/\.md$/i,"");function m1(e){if(!e.length||typeof window>"u")return;const t=e.slice(0,5).map(h1).join(re("amxlinks.nameSep")),n=e.length>5?`${t} …`:t;window.dispatchEvent(new CustomEvent("amadeus:toast",{detail:{text:re("amxlinks.rewriteFailed",{n:e.length,names:n}),level:"error",dedupeKey:"amxlinks.rewriteFailed"}}))}yo({"amxbridge.pageNameEmpty":{zh:"页面名不能为空",en:"Page name can't be empty"},"amxbridge.pageExists":{zh:"目标页面已存在",en:"A page with that name already exists"},"amxbridge.fileExistsAtTarget":{zh:"目标位置已存在同名文件",en:"A file with the same name already exists there"},"amxbridge.folderNameEmpty":{zh:"文件夹名不能为空",en:"Folder name can't be empty"},"amxbridge.folderExists":{zh:"同名文件夹已存在",en:"A folder with the same name already exists"},"amxbridge.folderPathEmpty":{zh:"文件夹路径不能为空",en:"Folder path can't be empty"},"amxbridge.moveIntoSelf":{zh:"不能移动到自身内部",en:"Can't move a folder into itself"},"amxbridge.folderExistsAtTarget":{zh:"目标位置已存在同名文件夹",en:"A folder with the same name already exists there"},"amxbridge.noteNameEmpty":{zh:"笔记名不能为空",en:"Note name can't be empty"},"amxbridge.noteExists":{zh:"目标笔记已存在",en:"A note with that name already exists"},"amxbridge.nameEmpty":{zh:"名称不能为空",en:"Name can't be empty"},"amxbridge.fileExists":{zh:"目标文件已存在",en:"A file with that name already exists"},"amxbridge.desktopOnly":{zh:"此操作仅桌面端可用",en:"This action is only available in the desktop app"},"amxbridge.conflictReloaded":{zh:"云端已有更新,已加载最新版本(本次未保存的修改被覆盖)",en:"A newer version was in the cloud, so it was loaded (your unsaved edits were overwritten)"},"amxbridge.renamedElsewhere":{zh:"这篇笔记已在别处改名为「{name}」,本次修改已保存到新名字",en:"This note was renamed to “{name}” elsewhere; your edits were saved under the new name"},"amxbridge.deletedElsewhere":{zh:"这篇笔记已在别处被删除或移走,本次修改没有写到云端(请另存为新笔记)",en:"This note was deleted or moved elsewhere, so your edits weren't saved to the cloud (save them as a new note)"},"amxbridge.deletedElsewhereSaved":{zh:"这篇笔记已在别处被删除或移走,本端未保存的修改已另存为「{name}」",en:"This note was deleted or moved elsewhere; your unsaved edits were saved as “{name}”"},"amxbridge.connectFailed":{zh:"云端连接失败,内容可能不是最新 —— 请刷新页面",en:"Lost the connection to the cloud, so content may be out of date — please refresh the page"},"amxbridge.tooLarge":{zh:"笔记过大,云端拒绝保存",en:"The note is too large for the cloud to save"},"amxbridge.imageNameFailed":{zh:"无法为图片分配文件名",en:"Couldn't pick a file name for the image"},"amxbridge.attachmentNameFailed":{zh:"无法为附件分配文件名",en:"Couldn't pick a file name for the attachment"},"amxbridge.invalidPath":{zh:"无效路径",en:"Invalid path"},"amxbridge.trashMissing":{zh:"回收站条目不存在",en:"This item is no longer in the trash"},"amxbridge.pathOutsideVault":{zh:"路径越出智库",en:"The path is outside the vault"},"amxbridge.readFailed":{zh:"读取文件失败(HTTP {status})",en:"Couldn't read the file (HTTP {status})"},"amxbridge.notText":{zh:"不是文本文件",en:"Not a text file"},"amxbridge.timeout":{zh:"请求超时({s}s),请检查网络后重试",en:"The request timed out ({s}s). Check your network and try again"},"amxbridge.network":{zh:"网络错误:{msg}",en:"Network error: {msg}"},"amxbridge.deviceTimeout":{zh:"设备请求超时,请检查与对方设备的连接",en:"The device didn't respond in time. Check the connection to it"},"amxbridge.deviceUnreachable":{zh:"设备不可达:{msg}",en:"Can't reach the device: {msg}"},"amxbridge.deviceRevoked":{zh:"连接权限已被对方移除",en:"The other device removed your access"},"amxbridge.deviceTooLarge":{zh:"内容过大:服务器中转通道上限 10MB,同一局域网内直连不受限",en:"Too large: the server relay is limited to 10 MB (a direct connection on the same local network has no limit)"},"amxbridge.deviceHttpError":{zh:"设备端错误(HTTP {status})",en:"Device error (HTTP {status})"},"amxbridge.deviceCallFailed":{zh:"设备端调用失败",en:"The call on the device failed"},"amxbridge.remoteOnly":{zh:"{what}:请在对方设备上操作",en:"{what}: do this on the other device"},"amxbridge.op.openPluginsFolder":{zh:"打开插件文件夹",en:"Open plugins folder"},"amxbridge.op.scaffoldSamplePlugin":{zh:"创建示例插件",en:"Create sample plugin"},"amxbridge.op.uninstallPlugin":{zh:"卸载插件",en:"Uninstall plugin"},"amxbridge.op.reveal":{zh:"在文件管理器中显示",en:"Show in file manager"}});class Je extends Error{constructor(t,n,i){super(i??`HTTP ${t}`),this.status=t,this.body=n,this.name="HttpError"}status;body}const Le=e=>e instanceof Je&&e.status===404,Ie=e=>e instanceof Je&&e.status===409,nl=e=>{let t=0;return e.forEach(n=>{typeof n!="string"&&(t+=n.size)}),12e4+Math.ceil(t/256)};function g1(e){const t=e.getToken(),n=Jn(e.apiBase,t),i=()=>{const o=e.getToken();if(e.signal?.aborted||!o||(n?Jn(e.apiBase,o)!==n:o!==t))throw new Je(409,{code:"ACCOUNT_CHANGED"},"Cloud account changed");return o},s=async(o,a,l)=>{const c=l?.query?`?${new URLSearchParams(l.query).toString()}`:"",d={Authorization:`Bearer ${i()}`};o!=="GET"&&(d["X-Amadeus-Client"]=e.clientId);let u;l?.form?u=l.form:l?.json!==void 0&&(d["Content-Type"]="application/json",u=JSON.stringify(l.json));const p=l?.form?nl(l.form):3e4,f=new AbortController,m=()=>f.abort(e.signal?.reason);e.signal?.addEventListener("abort",m,{once:!0});const h=setTimeout(()=>f.abort(),p);let y;try{y=await(e.request??fetch)(`${e.apiBase}${a}${c}`,{method:o,headers:d,body:u,signal:f.signal})}catch(S){throw new Je(0,null,f.signal.aborted?re("amxbridge.timeout",{s:Math.round(p/1e3)}):re("amxbridge.network",{msg:S instanceof Error?S.message:String(S)}))}finally{clearTimeout(h),e.signal?.removeEventListener("abort",m)}if(i(),y.status===401)throw e.onUnauthorized(),new Je(401,null);const w=await y.text().catch(()=>"");i();let C;try{C=w?JSON.parse(w):void 0}catch{C=w}if(!y.ok)throw new Je(y.status,C);return C},r=(o,a,l)=>new Promise((c,d)=>{const u=new XMLHttpRequest,p=i(),f=()=>u.abort(),m=()=>e.signal?.removeEventListener("abort",f);u.open("POST",`${e.apiBase}${o}`),u.setRequestHeader("Authorization",`Bearer ${p}`),u.setRequestHeader("X-Amadeus-Client",e.clientId),u.upload.onprogress=h=>{try{i(),h.lengthComputable&&l(h.loaded,h.total)}catch(y){u.abort(),d(y)}},u.onload=()=>{m();try{i()}catch(y){d(y);return}if(u.status===401){e.onUnauthorized(),d(new Je(401,null));return}let h;try{h=u.responseText?JSON.parse(u.responseText):void 0}catch{h=u.responseText}if(u.status<200||u.status>=300){d(new Je(u.status,h));return}c(h)},u.onerror=()=>{m(),d(new Je(0,null,"network error"))},u.ontimeout=()=>{m(),d(new Je(0,null,"timeout"))},u.onabort=()=>{m(),d(new Je(409,{code:"ACCOUNT_CHANGED"},"Cloud request cancelled"))},u.timeout=nl(a),e.signal?.addEventListener("abort",f,{once:!0}),u.send(a)});return{get:(o,a)=>s("GET",o,{query:a}),post:(o,a)=>s("POST",o,{json:a??{}}),postForm:(o,a,l)=>l?r(o,a,l):s("POST",o,{form:a}),put:(o,a)=>s("PUT",o,{json:a}),del:(o,a)=>s("DELETE",o,{query:a})}}const b1=/structure|create|delete|remove|move|rename|mkdir|rmdir|folder|binary|upload/;function y1(e){let t=null,n=e.signal?.aborted??!1,i=1e3,s=null,r=null,o=null;const a=()=>{r||(r=setTimeout(()=>{r=null,!n&&e.onStructureChange()},300))},l=()=>{if(!n){a();for(const f of new Set([e.lastLoadedPage(),...e.openPages?.()??[]]))f&&e.onPageChange(f)}},c=f=>{if(n)return;let m;try{m=JSON.parse(f)}catch{return}const h=typeof m.seq=="number"?m.seq:null;h!==null&&(o=Math.max(o??0,h));const y=typeof m.path=="string"?m.path:"",w=`${typeof m.op=="string"?m.op:""} ${typeof m.kind=="string"?m.kind:""}`.toLowerCase();if((!y||b1.test(w))&&a(),!y)return;const C=typeof m.op=="string"?m.op:"",S=typeof m.newPath=="string"&&m.newPath?m.newPath:null,I=typeof m.origin?.client=="string"&&m.origin.client===e.clientId;if(C==="move"&&S){e.onPageMoved?.(y,S,typeof m.fileSeq=="number"?m.fileSeq:null,I);return}if(C==="delete"){e.onPageDeleted?.(y);return}if((C==="rename-folder"||C==="move-folder")&&S){e.onFolderMoved?.(y,S,I);return}if(C==="delete-folder"){e.onFolderDeleted?.(y);return}const O=typeof m.origin?.client=="string"&&m.origin.client===e.clientId,k=e.knownSeq(y),T=h!==null&&k!==void 0&&h<=k;O||T||(/\.md$/i.test(y)?e.onPageChange(y):/\.db$/i.test(y)&&e.onDbChange(y))},d=()=>{if(n)return;const f=o;let m=null,h;try{const y=e.url();h=new EventSource(f===null?y:`${y}${y.includes("?")?"&":"?"}since=${f}`)}catch{u();return}t=h,h.onopen=()=>{n||(i=1e3)},h.addEventListener("hello",y=>{if(n)return;let w=null;try{const C=JSON.parse(y.data);typeof C.seq=="number"&&(w=C.seq)}catch{}f!==null&&w!==null?w<f?(o=w,l()):w>f&&(m=w):w!==null&&(o=Math.max(o??0,w))}),h.addEventListener("change",y=>c(y.data)),h.addEventListener("reset",()=>{l(),m!==null&&(o=Math.max(o??0,m)),m=null}),h.addEventListener("presence",y=>{if(!n)try{e.onPresence?.(JSON.parse(y.data))}catch{}}),h.addEventListener("presence-roster",y=>{if(!n)try{e.onPresenceRoster?.(JSON.parse(y.data))}catch{}}),h.onerror=()=>{h.close(),t===h&&(t=null),u()}},u=()=>{if(n||s)return;const f=i+Math.random()*i*.3;i=Math.min(i*2,3e4),s=setTimeout(()=>{s=null,d()},f)},p=()=>{n=!0,t?.close(),t=null,s&&clearTimeout(s),r&&clearTimeout(r),e.signal?.removeEventListener("abort",p)};return e.signal?.addEventListener("abort",p,{once:!0}),d(),p}const Xe=new Set;let pd=0;const Ar=new Set;function il(){pd++;for(const e of Ar)e()}function w1(){return pd}function k1(e){return Ar.add(e),()=>Ar.delete(e)}function v1(e){return Xe.add(e),il(),()=>{Xe.delete(e),il()}}function He(e){const t=[];let n=0;for(const i of Xe)(e==null||i.path===e)&&t.push({h:i,at:i.lastActive?.()??0,i:n++});return t.sort((i,s)=>s.at-i.at||i.i-s.i).map(i=>i.h)}function S1(e){return He(e)[0]?.scope??null}function x1(e,t){for(const n of[...Xe])n.path===e&&n.owner!==t&&n.peerWrote?.()}function _1(e,t){const n=He(e).filter(r=>r.patchFm);n.sort((r,o)=>+!!o.dirty?.()-+!!r.dirty?.());let i=null;const s=[];for(const r of n)i?s.push(r):i=r.patchFm(t);if(i)for(const r of s)r.patchFm(t,!0);return i}async function C1(e=!1){await Promise.all([...Xe].map(t=>e?t.flush(!0):t.flush().catch(()=>{})))}async function A1(e,t=!1){await Promise.all([...Xe].filter(n=>n.path===e).map(n=>t?n.flush(!0):n.flush().catch(()=>{})))}function E1(){for(const e of Xe)e.retire()}function T1(e,t){for(const n of He(e))if(n.insertFiles&&n.insertFiles(t)!==!1)return!0;return!1}function I1(e,t="file",n){for(const i of Xe)(t==="file"?i.path!==e:i.path!==e&&!i.path.startsWith(`${e}/`))||i.retire(n?t==="file"?n:n+i.path.slice(e.length):void 0)}function hd(){return[...new Set([...Xe].map(e=>e.path))]}function P1(e,t){for(const n of Xe)if(n.path===e&&(n.scope??null)===t)return!0;return!1}function O1(e){for(const t of Xe)if(t.path===e)return!0;return!1}function $1(e){for(const t of He(e))if(t.bodyNow)return t.bodyNow();return null}function R1(e){for(const t of He(e))if(t.statsNow)return t.statsNow();return null}let md=0;const Er=new Set;function N1(){md++;for(const e of Er)e()}function L1(){return md}function F1(e){return Er.add(e),()=>Er.delete(e)}function D1(e){for(const t of He(e))if(t.headings)return t.headings();return null}function z1(e){for(const t of He(e))if(t.fmNow)return t.fmNow();return null}function M1(e,t,n){for(const i of He(e))if(i.insertMarkdown?.(t,n))return!0;return!1}function j1(){return Xe.size>0}function B1(){for(const e of Xe)if(e.insertReply)return!0;return!1}function U1(e,t){if(t)for(const n of He(t.path)){const i=n.insertReply?.(e,t.anchor??null);if(i)return{path:n.path,undo:i.undo}}for(const n of He()){const i=n.insertReply?.(e,null);if(i)return{path:n.path,undo:i.undo}}return null}function H1(e){for(const t of He(e))if(t.focusBody)return t.focusBody();return!1}function q1(e){for(const t of He(e))if(t.fmNow)return t.fmNow();return null}function W1(e,t,n=!1){for(const i of He(e))if(i.revealBlock)return i.revealBlock(t,n);return!1}function V1(e,t,n){for(const i of He(e))if(i.revealText)return i.revealText(t,n);return!1}function Z1(e,t,n,i=!1){for(const s of He(e))if(s.revealHeading)return s.revealHeading(t,n,i),!0;return!1}const mC=Object.freeze(Object.defineProperty({__proto__:null,announceUnifiedWrite:x1,bumpUnifiedStats:N1,flushUnifiedPath:A1,flushUnifiedScopes:C1,hasUnifiedInstance:O1,insertFilesForPath:T1,registerUnifiedPipe:v1,retireAllUnifiedScopes:E1,retireUnifiedPath:I1,subscribeUnified:k1,subscribeUnifiedStats:F1,unifiedBody:$1,unifiedFm:z1,unifiedFmNow:q1,unifiedFocusBody:H1,unifiedGen:w1,unifiedHasAny:j1,unifiedHasReplyTarget:B1,unifiedHeadings:D1,unifiedInsertMarkdown:M1,unifiedInsertReply:U1,unifiedPatchFm:_1,unifiedPaths:hd,unifiedRevealBlock:W1,unifiedRevealHeading:Z1,unifiedRevealText:V1,unifiedScopeFor:S1,unifiedScopeLive:P1,unifiedStats:R1,unifiedStatsVer:L1},Symbol.toStringTag,{value:"Module"})),K1=7e4,kn=new Map,Tr=new Set;function gd(){const e=Date.now();for(const[t,n]of kn)e-n.at>K1&&kn.delete(t);return[...kn.values()]}function bd(){const e=gd();for(const t of Tr)try{t(e)}catch{}}function G1(e){const t=e;!t||typeof t.userId!="string"||(kn.set(t.userId,{userId:t.userId,username:String(t.username??"user"),page:typeof t.page=="string"?t.page:null,at:Number(t.at)||Date.now()}),bd())}function Qs(e){if(kn.clear(),Array.isArray(e))for(const t of e){const n=t;n&&typeof n.userId=="string"&&kn.set(n.userId,n)}bd()}function Y1(e){return Tr.add(e),e(gd()),()=>{Tr.delete(e)}}let an=null;function Ir(e,t){if(!an)return e;const n=new URLSearchParams;n.set("ref",e);const i=t===void 0?an.activePage():t;i&&n.set("page",i);const s=an.assetToken();return s&&n.set("at",s),`${an.apiBase}/amadeus/vaults/${encodeURIComponent(an.vaultId())}/asset?${n.toString()}`}function J1(e){an=e,Qc(t=>Ir(t))}function xt(e){const t=e.replace(/\\/g,"/"),n=t.lastIndexOf("/");return n<0?"":t.slice(0,n)}function tt(e){const t=e.replace(/\\/g,"/"),n=t.lastIndexOf("/");return n<0?t:t.slice(n+1)}function Pr(e){const t=tt(e),n=t.lastIndexOf(".");return n>0?t.slice(n):""}function Ti(e){const t=[];for(const n of e.replace(/\\/g,"/").split("/"))if(!(!n||n===".")){if(n===".."){if(!t.length)return null;t.pop();continue}t.push(n)}return t.join("/")}function Q1(e,t){const n=e.split("/").filter(o=>o&&o!=="."),i=t.split("/").filter(o=>o&&o!==".");let s=0;for(;s<n.length&&s<i.length&&n[s]===i[s];)s++;return[...Array(n.length-s).fill(".."),...i.slice(s)].join("/")||"."}function X1(e){try{return decodeURIComponent(e)}catch{return e}}function sl(e){return e.replace(/^<|>$/g,"").trim()}function rl(e,t){const n=t.toLowerCase();for(const i of e)if(tt(i).toLowerCase()===n)return i;return null}function ol(e,t,n){const i=xt(e),s=l=>l.replace(/\\/g,"/").replace(/^\/+|\/+$/g,""),r=n.mode==="same"?i:n.mode==="vault"?s(n.folder):s(`${i}/attachments`),o=r?`${r}/${t}`:t,a=Q1(i,o);return{destDirRel:r,fileVaultRel:o,pageRel:a}}function al(e,t){const n=Pr(t),i=t.slice(0,t.length-n.length)||"file";for(let s=0;s<1e3;s++){const r=s===0?t:`${i}-${s}${n}`;if(!e.has(r.toLowerCase()))return r}return`${i}-${Date.now().toString(36)}${n}`}let yd=()=>{};function e_(e){yd=e}const St=(e,t=!1)=>{try{yd(e,t)}catch{}},Ii=()=>new Date().toISOString(),wd="amadeus.cloudVaultId";let Yn=null;function t_(){return Yn?Yn():Promise.resolve("default")}function n_(e){const t=Oi(wd),n=Oi("amadeus_tree_snap"),i=Oi("amadeus_last_page"),s=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`web-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`,r=g1({apiBase:e.apiBase,getToken:e.getToken,clientId:s,onUnauthorized:e.onAuthError,request:e.request,signal:e.signal});let o=null,a=null;const l=()=>o??"default";async function c(){return o||a||(a=(async()=>{const b=await r.get("/amadeus/vaults");let v=null;try{v=localStorage.getItem(t)}catch{}if(v&&!b.vaults.some(P=>P.id===v))try{if((await r.get("/amadeus/shared-with-me")).items.some(L=>L.vaultId===v))return o=v,v}catch{}return o=((v?b.vaults.find(P=>P.id===v):void 0)??b.vaults.find(P=>P.id==="default")??b.vaults[0])?.id??"default",o})(),a.catch(()=>{a=null}),a)}Yn=c,e.signal&&Qs([]);const d=50,u=new Map,p=(b,v)=>{u.delete(b),u.set(b,v),u.size>d&&u.delete(u.keys().next().value)},f=new Map,m=new Map,h=(b,v)=>{const _=m.get(b);return _&&_.seq===v&&f.get(b)===v?_.fp:void 0},y=new Set,w=new Map,C=new Set;class S extends Error{constructor(v){super(`vanished elsewhere: ${v}`),this.path=v}path}const I=(b,v)=>{f.set(b,v),y.add(b),w.delete(b)},O=b=>{f.delete(b),u.delete(b),y.delete(b)},k=(b,v,_)=>{const P=_??f.get(b);f.delete(b),P!==void 0&&(f.set(v,P),y.add(v)),u.delete(b),u.delete(v)},T=async b=>{const v=W(b);return v!==b&&!C.has(b)&&(C.add(b),St(re("amxbridge.renamedElsewhere",{name:v.split("/").pop()}))),{target:v,base:await j(v)}},$=b=>{C.has(b)||(C.add(b),St(re("amxbridge.deletedElsewhere"),!0))},W=b=>{let v=b;const _=new Set([b]);for(let P=0;P<16;P++){const L=w.get(v);if(!L||_.has(L))break;_.add(L),v=L}return v},R=b=>{const v=W(b);return v===b?[b]:[b,v]},H=b=>{for(const v of[...w.keys()])W(v)===b&&w.delete(v)},B=(b,v,_)=>b.includes(v)?_():M([v],_),te=async(b,v,_)=>{if(!_)return $(b),null;const P=new Date,L=V=>String(V).padStart(2,"0"),F=`${P.getFullYear()}-${L(P.getMonth()+1)}-${L(P.getDate())} ${L(P.getHours())}${L(P.getMinutes())}`,U=b.replace(/\.md$/i,"");for(let V=0;V<5;V++){const J=`${U} (recovered ${F}${V?`-${V+1}`:""}).md`;try{await N(J,v,0)}catch(X){if(Ie(X))continue;throw X}return w.set(b,J),ae(),C.has(b)||(C.add(b),St(re("amxbridge.deletedElsewhereSaved",{name:J.split("/").pop()}),!0)),J}throw $(b),new S(b)},ce=(b,v)=>{const _=`${b}/`;for(const[P,L]of[...f])P.startsWith(_)&&(f.delete(P),f.set(`${v}/${P.slice(_.length)}`,L));for(const P of[...u.keys()])P.startsWith(_)&&u.delete(P);for(const P of[...y]){if(!P.startsWith(_)||w.has(P))continue;const L=`${v}/${P.slice(_.length)}`;y.add(L),w.set(P,L)}},ne=b=>{const v=`${b}/`;for(const _ of[...f.keys()])(_===b||_.startsWith(v))&&f.delete(_);for(const _ of[...u.keys()])(_===b||_.startsWith(v))&&u.delete(_);for(const _ of[...y])(_===b||_.startsWith(v))&&(y.delete(_),H(_))},pe=b=>{const v=`${b}/`;for(const _ of[...f.keys()])(_===b||_.startsWith(v))&&(f.delete(_),u.delete(_),H(_))},me=6e4;let we=null;const ae=()=>{we=null};async function x(b=!1){const v=Date.now();if(!b&&we&&(!we.settled||v-we.at<me))return we.promise;const _=await c(),P={at:Date.now(),promise:r.get(`/amadeus/vaults/${encodeURIComponent(_)}/tree`),settled:!1};return we=P,P.promise.then(L=>{P.settled=!0,A(_,L),window.amadeusCloudMaxFileBytes=L.maxFileBytes},()=>{we===P&&(we=null)}),P.promise}const A=(b,v)=>{try{localStorage.setItem(n,JSON.stringify({v:b,tree:v}))}catch{}},E=()=>{try{const b=localStorage.getItem(n);if(!b)return null;const v=JSON.parse(b);if(typeof v.v!="string"||!v.tree||!Array.isArray(v.tree.pages)||!Array.isArray(v.tree.files)||!Array.isArray(v.tree.folders))return null;const _=localStorage.getItem(t);return _&&_!==v.v?null:v}catch{return null}},g=b=>[...b.pages,...b.files.map(v=>v.path)],z=b=>!b.split("/").some(v=>v.startsWith(".")),q=new Map;function M(b,v){const P=Promise.allSettled(b.map(F=>q.get(F)??Promise.resolve())).then(()=>v()),L=P.then(()=>{},()=>{});for(const F of b)q.set(F,L);return L.then(()=>{for(const F of b)q.get(F)===L&&q.delete(F)}),P}const Y=new Set,ue=new Set,de=new Set,ye=b=>{for(const v of[...Y])try{v(b)}catch{}},Ge=()=>{for(const b of[...ue])try{b()}catch{}},Oe=b=>{for(const v of[...de])try{v(b)}catch{}},Fe=new Set,Yt=b=>{for(const v of[...Fe])try{v(b)}catch{}};let et=null;const Jt=(b=l())=>`${i}:${b}`,gt=b=>{et=b;try{localStorage.setItem(Jt(),b)}catch{}},Ss=()=>{try{return localStorage.getItem(Jt())||void 0}catch{return}};let Qt="",lt=null;async function Xt(){if(!e.signal?.aborted){lt&&(clearTimeout(lt),lt=null);try{const b=await c(),v=await r.post(`/amadeus/vaults/${encodeURIComponent(b)}/asset-token`);if(e.signal?.aborted)return;Qt=v.token;const _=Math.max(60,v.ttlSec||600);lt=setTimeout(()=>{Xt()},_/2*1e3)}catch{e.signal?.aborted||(lt=setTimeout(()=>{Xt()},3e4))}}}J1({apiBase:e.apiBase,vaultId:l,assetToken:()=>Qt,activePage:()=>et}),window.amadeusCloudVaults=async()=>{const b=await x();return RS([...b.pages,...b.files.map(v=>v.path)])};let Dt=null;e.signal?.addEventListener("abort",()=>{lt&&clearTimeout(lt),lt=null,Qt="",Dt?.(),Dt=null,Yn===c&&(Yn=null,Qs([]))},{once:!0});function ui(b){Dt||e.signal?.aborted||(Dt=y1({signal:e.signal,url:()=>`${e.apiBase}/amadeus/vaults/${encodeURIComponent(b)}/events?token=${encodeURIComponent(e.getToken())}`,clientId:s,knownSeq:v=>f.get(v),lastLoadedPage:()=>et,openPages:hd,onPageChange:v=>{u.delete(v),ye(v)},onDbChange:v=>Oe(v),onPageMoved:(v,_,P,L)=>{w.set(v,_),k(v,_,P??void 0),L||Yt({from:v,kind:"file",to:_,root:`cloud://${b}`})},onPageDeleted:v=>{f.delete(v),u.delete(v),H(v)},onFolderMoved:(v,_,P)=>{ce(v,_),P||Yt({from:v,kind:"prefix",to:_,root:`cloud://${b}`})},onFolderDeleted:v=>pe(v),onStructureChange:()=>{ae(),u.clear(),Ge()},onPresence:G1,onPresenceRoster:Qs}),window.addEventListener("beforeunload",()=>{Dt?.()}))}const en=()=>`/amadeus/vaults/${encodeURIComponent(l())}/file`,Re=async b=>{const v=await r.get(en(),{path:b});return I(b,v.seq),m.set(b,{seq:v.seq,fp:Wn(v.content)}),v},N=async(b,v,_,P=!1)=>{const L=await r.put(en(),{path:b,content:v,baseSeq:_,...P?{force:!0}:{}});return I(b,L.seq),m.set(b,{seq:L.seq,fp:Wn(v)}),u.delete(b),L},j=async b=>{const v=f.get(b);if(v!==void 0)return v;try{return(await Re(b)).seq}catch(_){if(!Le(_))throw _;if(y.has(b))throw new S(b);return 0}},Q=async b=>{const v=await Re(b),_=Ri(b,v.content,Ii());return p(b,_),_},oe=async b=>{try{const v=f.get(b),_=await Re(b);if(_.seq===v)return;p(b,Ri(b,_.content,Ii())),ye(b)}catch{}},fe=async b=>{const v=[],P=await pS({readFile:async()=>{throw new Error("not found")},writeFile:async(L,F)=>{v.push({name:L,data:F})},deleteFile:async()=>{},exists:async()=>!1,listDir:async()=>[]},b,Ii());for(const L of v){const F=Fi(xt(b),L.name);try{await N(F,L.data,0)}catch(U){if(Ie(U))return Q(F);throw U}}return ae(),p(b,P),P},qe=async b=>{try{return await Q(b)}catch(v){if(Le(v)){if(y.has(b))throw new S(b);return fe(b)}throw v}};async function ct(b,v){const _=sl(v);if(!_)return null;if(_.includes("/"))return Ti(Fi(xt(b),X1(_)));const P=await x(),L=rl(g(P),_);if(L)return L;const F=await x(!0);return rl(g(F),_)}const Ye=async(b,v,_,P,L)=>{const F=new FormData;F.append("file",new Blob([_]),v),F.append("path",b),P&&F.append("ifAbsent","1");const U=await r.postForm(`/amadeus/vaults/${encodeURIComponent(l())}/binary`,F,L);return I(U.path??b,U.seq),ae(),U},Ce=".trash",vt=`${Ce}/.meta.json`,$e=async()=>{try{const b=await Re(vt),v=JSON.parse(b.content);return{meta:v&&typeof v=="object"?v:{},seq:b.seq}}catch(b){if(Le(b))return{meta:{},seq:0};throw b}},ut=async b=>{const v=await $e();b(v.meta);try{await N(vt,`${JSON.stringify(v.meta,null,2)}
296
+ mcp__*`,"pill.thinkUnsupported":"(unsupported by this model, auto-downgrades)","input.compact":"Compact context","input.compacting":"Compacting context…","input.compactDone":"Context compacted ({n} messages folded into a summary; continues compactly)","input.compactSkip":"Nothing to compact: {reason}","input.compactFail":"Compaction failed: {e}","input.slash.compact":"Compact context: summarize then continue compactly","input.slash.voiceOn":"Switch to voice messages (this Agent replies as voice)","input.slash.voiceOff":"Switch back to text messages","input.slash.voiceOnHint":"Voice messages on: this Agent’s replies will be voice (desktop voice bar; on WeChat, an audio file alongside the text).","input.slash.voiceOffHint":"Switched back to text messages.","voice.play":"Play","voice.pause":"Pause","voice.label":"Voice","voice.toText":"Show text","voice.toggleFailed":"Failed to toggle voice mode: {e}","input.slash.stop":"Stop the current run","input.slash.skillUse":"Use skill {name} for this message","input.skillChipTitle":"This skill will be used for this message","input.slash.agent":"Use a normal agent (custom persona)","input.agentActive":"Active agent: {name}","input.agentCleared":"Normal agent cleared","input.engineDefault":"Tangu","input.engineChipTitle":"Run engine","input.engineSection":"Run engine","input.engineModelDefault":"Use engine default","engine.pickTitle":"Choose the agent for this chat","engine.warming":"Starting {name}…","pill.more":"More (next page)","header.currentAgent":"Current agent","settings.tab.agentClis":"Local agent CLIs","settings.agentClis.title":"Agent CLIs","settings.agentClis.hint":"Detected third-party agents (Claude Code / Codex …). Set a default model. New chats can pick them.","settings.agentClis.detected":"Detected","settings.agentClis.needsSignin":"Needs sign-in","settings.agentClis.notDetected":"Not detected","settings.agentClis.notDetectedHint":"Install & sign in to this agent to enable it.","settings.agentClis.defaultModel":"Default model","settings.agentClis.modelDefault":"(engine default)","settings.agentClis.loadingModels":"Loading models…","settings.agentClis.empty":"No external agent engines (host-only feature).","settings.agentClis.importHint":"Importing copies it into Tangu as your own skill/MCP (survives uninstalling the CLI). MCP imports start disabled — enable them in MCP settings.","settings.agentClis.skillsLabel":"Installed skills","settings.agentClis.mcpLabel":"Installed MCP","settings.agentClis.importBtn":"Import","settings.agentClis.imported":"Imported","settings.tab.agents":"Agents","settings.agents.title":"Normal agents (custom personas)","settings.agents.hint":"Define reusable conversational personas (system prompt + model + settings) for different tasks. Agents can also self-author via the manage_agent tool.","settings.agents.new":"New agent","settings.agents.brainSection":"Brain (memory / journal / library)","settings.agents.brainSectionHint":"View and edit this agent's long-term memory, daily journal and library files.","settings.agents.openBrain":"Open brain","settings.agents.createViaChat":"Create with AI","settings.agents.createViaChatHint":"Open a new chat and let an agent build the new agent for you","settings.agents.empty":'No agents yet — click "New agent" to create one.',"settings.agents.name":"Name","settings.agents.namePlaceholder":"e.g. Code Reviewer","settings.agents.desc":"Description","settings.agents.model":"Model (empty = use session model)","settings.agents.modelDefault":"(use session model)","settings.agents.systemPrompt":"Developer instructions (what / how / must-read)","settings.agents.systemPromptPlaceholder":"You are a meticulous code reviewer…","settings.agents.thinking":"Thinking effort","settings.agents.maxIter":"Max iterations","settings.agents.approval":"Approval","settings.agents.inherit":"(inherit)","settings.agents.byAgent":"agent-authored","agent.badge.system":"Background","settings.agents.deleteConfirm":'Delete agent "{name}"?',"settings.agents.saveFail":"Save failed: {e}","settings.agents.cloudOnly":"Normal Agents are only available locally (desktop/TUI).","settings.agents.soul":"Persona (SOUL)","settings.agents.soulPlaceholder":'Calm, focused; concise replies… (tone & values, distinct from the "what to do" instructions)',"settings.agents.shareMemory":"Share the default agent's memory & log","settings.agents.shareMemoryHint":"When on, this agent reads/writes the default agent's memory & log; off (default) = its own.","settings.agents.cloudSync":"Cloud sync (mirror across devices)","settings.agents.cloudSyncHint":"When on, all of this agent's files (definition/memory/log/Library) mirror across your devices, newest wins; off (default) = local only.","settings.agents.cloudSyncOn":"Cloud sync: on","settings.agents.cloudSyncOff":"Cloud sync: off","settings.agents.activityAccess":"Allow reading the activity log","settings.agents.activityAccessHint":"Grants this agent read_activity to view your in-app activity; off (default) = Muse only.","settings.agents.toolPolicy":"Tool allow/deny list","settings.agents.toolPolicyNone":"No restriction (all tools)","settings.agents.toolPolicyDeny":"Denylist: unchecked = disabled; new engine tools allowed by default","settings.agents.toolPolicyAllow":"Allowlist: only checked tools usable; new engine tools disabled by default","settings.agents.toolPolicyHint":"Checked = usable. Governs the regular tools below only; permission-gated tools (e.g. read_activity) are unaffected.","settings.agents.toolPolicyEmpty":"Tool catalog unavailable (local engine must be running).","settings.agents.avatar":"Avatar","settings.agents.avatarHint":"Click to upload, ≤1MB (PNG/JPG/GIF/WebP); stored in this agent's Library.","settings.agents.avatarPick":"Upload avatar","settings.agents.avatarRemove":"Remove avatar","settings.agents.avatarTooLarge":"Image exceeds 1MB, please pick a smaller one.","settings.agents.avatarSaveFirst":"Save the agent first, then set an avatar.","settings.tab.shortcuts":"Shortcuts","settings.shortcuts.desc":"Click a shortcut to record, then press the key combo to set it; Esc to cancel. Each combo binds to only one command.","settings.shortcuts.commands":"Commands and shortcuts · {count}","settings.shortcuts.searchPlaceholder":"Search commands or shortcuts","settings.shortcuts.resultCount":"Showing {count}","settings.shortcuts.noResults":"No matching commands.","settings.shortcuts.commandPalette":"Command palette","settings.shortcuts.record":"Click to record shortcut","settings.shortcuts.recording":"Press keys…","settings.shortcuts.reset":"Reset to default","settings.shortcuts.clear":"Unbind","settings.shortcuts.unbound":"Not set","settings.shortcuts.resetAll":"Reset all to default","settings.shortcuts.reassigned":'Unbound this shortcut from "{name}"',"tool.verb.wrote":"Wrote","tool.verb.edited":"Edited","tool.verb.ran":"Ran","tool.verb.read":"Read","tool.verb.listed":"Listed","tool.verb.searched":"Searched","tool.verb.browsed":"Browsed","tool.sum.wrote":"Wrote {n} file(s)","tool.sum.edited":"Edited {n} file(s)","tool.sum.ran":"Ran {n} command(s)","tool.sum.read":"Read {n} item(s)","tool.sum.searched":"Searched {n}×","tool.sum.browsed":"Browsed {n}×","tool.sum.other":"{n} tool(s)","settings.agents.isDefault":"default","settings.agents.setDefault":"Set as default","settings.agents.viewMem":"View brain (memory / log / library)","settings.agents.memTitle":"{name} · Agent brain","settings.agents.memory":"Long-term memory (MEMORY.md, editable)","settings.agents.memSaved":"Saved","settings.agents.log":"Log (LOG, editable)","settings.agents.noLog":"No log yet","settings.agents.tabMemory":"Memory","settings.agents.tabLog":"Logs","settings.agents.tabLibrary":"Library","settings.agents.library":"Library (Library/, reference docs + avatar)","settings.agents.libraryEmpty":"No files yet","settings.agents.libraryUpload":"Upload","settings.agents.librarySelectHint":"Click a file to view / edit","settings.agents.libraryBinaryHint":"Binary file — preview only","settings.agents.libraryDeleteConfirm":'Delete file "{name}"?',"settings.agents.libraryTooLarge":"File exceeds 5MB","settings.agents.userProfile":"User profile (USER.md, visible to all agents)","settings.agents.userProfileHint":"Your name, preferences, level, long-term needs; every agent reads it.","settings.agents.tabHarness":"Evolution","settings.agents.harnessHint":"The evolution record holds how the agent evolves: methods it distilled from its own work and the equipment it shelved. Its own changes apply immediately and show an update card you can undo; background review and Muse's usage review also write here directly, each entry says where it came from, and all of them can be undone on this tab. Every run loads them.","settings.agents.harnessEmpty":"Nothing in the evolution record yet. Durable methods the agent works out for itself land here, written by the agent on the spot or by background review; you can also type /refine in a session with it to reflect on that conversation.","settings.agents.harnessEvidence":"Evidence: {text}","settings.agents.harnessKindNote":"Note","settings.agents.harnessKindRecipe":"Recipe","settings.agents.harnessKindEquip":"Equipment","settings.agents.harnessShelvedTools":"Shelved tools: {names}","settings.agents.harnessShelvedSkills":"Shelved skills: {names}","settings.agents.harnessCount":"Evolution record: {count} of {max} entries","settings.agents.harnessLastChange":"Last evolved {time}","settings.agents.harnessRefine":"Reflect on this conversation","settings.agents.harnessRefineSent":"Reflection started. Follow along in the conversation.","settings.agents.harnessShowAll":"Show all {count}","settings.agents.harnessLoading":"Loading the evolution record…","settings.agents.harnessLocalOnly":"The evolution record is available with the local engine only.","settings.agents.harnessHistory":"Edit history (this device)","settings.agents.harnessRollback":"Undo last change","settings.agents.harnessRestore":"Restore","settings.agents.harnessRollbackConfirm":'Undo the last change to "{title}"? (Undo again to bring it back)',"settings.agents.harnessActCreate":"Created","settings.agents.harnessActUpdate":"Edited","settings.agents.harnessActDelete":"Deleted","settings.agents.harnessActRollback":"Rolled back","settings.agents.harnessByHistorian":"Added by background review","settings.agents.harnessByMuse":"Shelved by Muse","settings.agents.harnessByUser":"Candidate you adopted","settings.agents.harnessCandidates":"Candidates: {count}","settings.agents.harnessCandidateNeedsYou":"Needs your decision","settings.agents.harnessCandidateAdopt":"Adopt","settings.agents.harnessCandidateDismiss":"Dismiss","settings.agents.harnessCandidateAdopted":"Adopted into the evolution record.","settings.agents.harnessCandidateDismissed":"Candidate dismissed.","settings.agents.harnessCandidateGone":"That candidate is no longer waiting. The list was reloaded.","settings.agents.harnessCandidateFull":"The evolution record is full ({max} entries). Remove or merge a few before adopting.","settings.agents.harnessCandidateTooLong":"This candidate is too long for one entry. Dismiss it, or ask the agent to rewrite it.","settings.agents.harnessCandidatesHint":"Methods the Historian nominated but did not write straight into the evolution record. Ones that carry a URL, a command or wording about permissions are yours to decide one by one: Adopt writes the entry, Dismiss removes the candidate. The agent reviews the rest during reflection, and you can adopt or dismiss those too.","settings.agents.selfAuthored":"Self-authored","settings.agents.sharedSkill":"Shared","agent.pickTitle":"Choose agent","settings.tab.special":"Background agents","settings.special.title":"Special Agents (background)","settings.special.hint":"On by default; once you turn one off, it stays off. Leave the model empty to follow the cloud default; records are isolated locally and never appear in the session list.","settings.special.pickModelFirst":"Pick a model before enabling","settings.special.followCloudDefault":"Follow cloud default ({model})","settings.model.imageCloudDefaultTag":"Cloud default","settings.model.imageFollowingDefault":"No manual pick — following the cloud image default: {model}. Click a model to pin your own choice; click again to unpin.","settings.special.model":"Model","settings.special.enable":"Enable","settings.special.historian":"Historian","settings.special.historianDesc":"Summarizes the session title every X rounds; reviews & updates your LOG and memory every Y rounds.","settings.special.muse":"Muse","settings.special.museDesc":"Resident background agent: wakes on heartbeat, schedules and rules and works inside its own Library; out-of-scope actions follow its permission tier, output lands in the inbox and Muse Space.","settings.special.h.rounds":"Maintain every N rounds","settings.special.h.firstRound":"Always trigger on first round","settings.special.h.harnessCandidates":"Self-evolution auto-collect","settings.special.h.harnessCandidatesHint":"The judge nominates methods an agent worked out for itself. One that reads like a working method goes straight into its evolution record; one that carries a URL, a command, or wording about permissions or credentials waits as a candidate until you adopt or dismiss it on the Evolution tab. A notification appears in the conversation you are viewing when an entry is added, and you can view or undo it on the Evolution tab.","settings.special.h.prompt":"Memory-judgment prompt (empty = default)","settings.special.m.maxIter":"Max iterations / cycle","settings.special.m.maxTodos":"Max TODOs / window","settings.special.m.activeHours":"Active hours (device local time)","settings.special.m.activeAllDay":"All day","settings.special.m.persona":'Edit its persona and instructions under "Muse" in the agent roster.',"settings.special.m.folders":"Extra folders (one absolute path per line)","settings.special.m.foldersHintAsk":"Ask / agent tiers: only a hint telling Muse to look there; writes still queue for approval per tier.","settings.special.m.foldersHintAuto":"Full auto: these folders are directly readable and writable.","settings.special.m.secRhythm":"Rhythm","settings.special.m.budget":"Budget","settings.special.m.budgetWindow":"Budget window (hours)","settings.special.m.maxCycles":"Max cycles / window","settings.special.h.mode":"Mode","settings.special.h.modeIndependent":"Independent","settings.special.h.modeAssist":"Assist","settings.special.h.modeFork":"Fork","settings.special.h.modeHintIndependent":"Historian reads the recent transcript with the model above and maintains the title, summary, log and memory on its own.","settings.special.h.modeHintAssist":"When due, branches a short background discussion with the session's agent; the main agent decides and writes itself. Title/summary are still maintained by Historian; the first round is always independent.","settings.special.h.modeHintFork":"Judges via a single tail-fork completion of the full live context using the session model (prompt-cache friendly, sees far more than Independent; falls back to Independent on failure). The model above is only used for fallback judging and memory consolidation.","settings.special.h.fallbackModel":"Fallback / consolidation model","settings.special.saved":"Saved","settings.special.saveFail":"Save failed: {e}","settings.special.on":"On","settings.special.off":"Off","settings.special.custom":"Custom","settings.special.sectionTitle":"Background agents (special)","settings.agents.sectionTitle":"Normal agents (custom personas)","settings.agents.starterTemplate":"You are … (describe this agent's identity, expertise, tone, and how it should approach tasks).","sidebar.special.title":"Background agents","special.action.title_updated":"title updated","special.action.summary_updated":"summary updated","special.action.log_appended":"log appended","special.action.memory_appended":"memory appended","special.action.memory_updated":"memory updated","special.action.assist_discussion":"assist discussion started","special.muse.title":"Muse workspace","special.muse.thinking":"Current thinking","special.muse.idle":"Muse is idle","special.muse.running":"Muse is thinking…","special.muse.disabled":"Muse is off (enable it and pick a model in Settings → Background agents).","special.muse.todos":"Muse TODO list","special.muse.todosEmpty":"No TODOs yet. Muse proposes high-value tasks after thinking in the background.","special.muse.selectAll":"Select all","special.muse.inject":"Inject selected into a session & run","special.muse.pickSession":"Pick target session…","special.muse.injected":"Injected {n} into a session and started running","special.muse.dismiss":"Dismiss","special.muse.markDone":"Mark done","special.muse.injectFail":"Inject failed: {e}","special.muse.watches":"Watch rules","special.muse.watchesAll":"All automations →","special.muse.watchesHint":'Say "keep an eye on xxx.md until it reaches 100 chars" in any chat to set one; when a rule fires, Muse wakes up and proposes a todo.',"special.muse.trigFile":'"{path}" reaches {n} chars',"special.muse.trigEvent":'activity contains "{match}"',"special.muse.trigDaily":"daily at {time}","special.muse.trigFired":"last fired {t}","special.muse.watchDelete":"Delete rule","special.muse.approvals":"Pending approvals","special.muse.approvalsEmpty":"Nothing is waiting for your approval.","special.muse.approve":"Approve & run","special.muse.reject":"Reject","special.muse.approveFail":"Could not approve: {e}","special.muse.approvalNote":"Your agent's verdict: {note}","special.muse.runNew":"Run selected in a new session","special.muse.injectPrefix":"Please handle these todos from Muse:","muse.lib.openEditor":"Open in editor","special.muse.tracks":"Tracking","special.muse.tracksEmpty":'No tracked tasks. Use "Hand to Muse" on a task card in chat to add one.',"special.muse.trackDelete":"Stop tracking","special.muse.modeLabel":"Tier","special.muse.pending":"{n} pending approval","space.muse":"Muse","muse.builtinDesc":"Muse Space: the Space Muse builds itself (a Forsion plugin it writes and improves each cycle); approve its out-of-scope actions in the side panel. Shows its workspace until it has built one.","view.museLibrary":"Muse workspace","view.museHome":"Muse Space","muse.openLibrary":"Open Muse workspace","view.musePanel":"Muse","muse.lib.empty":"Muse has not written anything yet. Once enabled, its notes, drafts and daily journal appear here.","muse.lib.refresh":"Refresh","chat.task.here":"Run here","chat.task.new":"Run in new session","chat.task.muse":"Hand to Muse","chat.task.ignore":"Ignore","chat.task.trackTag":"Track","chat.task.tracked":"Handed to Muse (visible in Calendar)","chat.task.trackFail":"Could not hand to Muse: {e}","chat.task.doneHere":"Sent here","chat.task.doneNew":"Sent to a new session","chat.task.doneMuse":"Handed to Muse","chat.task.doneIgnore":"Ignored","chat.task.showPrompt":"Show task brief","chat.task.hidePrompt":"Hide task brief","chat.task.tooLong":"The task brief is over 4000 characters and cannot be handed to Muse; split it up, or run it here or in a new session.","chat.task.museDo":"Let Muse do it","chat.task.doneMuseDo":"Handed to Muse","chat.task.handedDo":"Handed to Muse: it picks this up on its next run (subject to its active hours and budget); anything beyond its permissions comes back to you for approval","chat.task.museOff":"Muse is turned off: turn it on in Settings, or run this in a new session","chat.task.todoSyncFail":"Could not update the todo status: {e}","chat.task.doneTodo":"This todo has already been handled","chat.task.todoChecking":"Checking this todo’s status…","chat.task.todoCheckFail":"Couldn’t load this todo’s status","chat.task.todoMissing":"This todo no longer exists","special.muse.actionFail":"Action failed: {e}","special.muse.execFailed":"Approved, but the execution failed: {e}","settings.special.m.mode":"Permission tier","settings.special.m.modeAsk":"Ask (out-of-scope actions queue for your approval)","settings.special.m.modeAgent":"Agent approves (your default agent decides once on your behalf)","settings.special.m.modeAuto":"Full auto","settings.special.m.modeDesc":"All tiers work freely inside Muse's own Library; out-of-scope writes and commands follow the tier, and plugin installs always need your confirmation.","settings.special.m.heartbeat":"Heartbeat interval (minutes; 0 = wake only for schedules and rules)","settings.special.m.heartbeatHint":'The supervisor poll shrinks to match a finer heartbeat; the actual cycle count is still capped by "Max cycles / window" under Budget.',"settings.special.m.notify":"Notifications","settings.special.m.notifyMode":"Delivery","settings.special.m.notifyImmediate":"Immediate","settings.special.m.notifyDigest":"Daily digest","settings.special.m.escalateTo":"Hand hard work to","settings.special.m.escalateNone":"None","settings.customProvider.fetchModels":"Fetch models","settings.customProvider.fetchEmpty":"No models found (endpoint returned no list)","sidebar.search.placeholder":"Search chats…","sidebar.search.noResults":"No matching chats","sidebar.deleteConfirm":'Permanently delete chat "{name}"? This cannot be undone.',"chat.action.quote":"Quote","chat.action.askInPanel":"Ask in side panel","chat.selection.actions":"Selected text actions","chat.error":"Run failed","chat.llmRetrying":"Network hiccup — retrying in {s}s (attempt {n}/{max})","chat.err.network":"Cannot reach the model service (network down or server not running)","chat.err.dropped":"Connection dropped mid-response (network hiccup); reply incomplete","chat.err.timeout":"Request timed out — slow network or model","chat.err.auth":"Authentication failed — check API key or login","chat.err.rate":"Rate limited — please retry later","chat.err.server":"Model service error — please retry later","chat.err.quota":"AI quota used up — click your avatar (bottom-left) to check usage, use a reset card to restore it now, or upgrade your plan","chat.err.runCost":"This run hit its cost ceiling and was stopped automatically","chat.err.inputTooLarge":"Input too large for the model — trim it and retry","chat.err.groupAgents":"Team mode needs at least 2 valid agents","chat.err.orphaned":"Run was interrupted unexpectedly (app restart or process exit) — please retry","chat.err.engineRemote":"External engines can't be driven from a remote device — continue this chat on the host computer","chat.edit.saveResend":"Save & resend","group.voting.inProgress":"Voting…","workbench.chat":"Chat","workbench.leftSidebar":"Left sidebar","workbench.rightSidebar":"Right sidebar","theme.changeSkin":"Change accent color","theme.changeMode":"Toggle light/dark mode","theme.changeLanguage":"Switch theme style","command.palette":"Command palette (⌘K)","command.search":"Search","command.toggleSmoothCaret":"Toggle smooth caret","command.toggleLeft":"Toggle left sidebar","command.toggleRight":"Toggle right sidebar","command.toggleBottom":"Toggle bottom panel","panel.emptyTitle":"Empty panel","panel.empty":"This panel is empty, try dragging a tab here.","command.splitRight":"Split right","command.resetLayout":"Reset layout","command.stop":"Stop current run","command.compact":"Compact context","command.branch":"Branch from latest reply","command.saveLayout":"Save named layout","command.applyLayout":"Restore named layout","layout.namePrompt":"Layout name","layout.saved":"Saved layout “{name}”","layout.none":"No named layouts saved yet","layout.applyPrompt":"Enter a layout to restore: {names}","status.context":"Context","header.connecting":"Connecting…","command.placeholder":"Run a command…","command.empty":"No commands","command.select":"Select","command.run":"Run","command.count":"{count} commands","group.host":"Host","special.agents.title":"Background agents","special.memory.title":"Memory","sidebar.special.historianSub":"Summarizes titles · curates memory","sidebar.special.museSub":"Background thinking · TODOs","sidebar.wechat.setConnectedOk":"Now the connected WeChat session.","sidebar.wechat.setConnectedFail":"Failed: {e}","preview.close":"Close","preview.expand":"Expand","preview.collapse":"Collapse","preview.download":"Download","preview.notFound":"File not found","preview.loadFailed":"Failed to load","preview.notAvailable":"No preview for this file type","preview.tooLarge":"File too large ({size}) to preview","preview.htmlPreview":"Preview","view.wsfile":"File preview","preview.openWithDefault":"Open with default app","preview.unsupportedAsk":"Can't preview this file type. Open it with the system default app?","preview.expired":"Preview content expired (this kind of preview does not survive restarts). Reopen it from its source.","preview.mdEdit":"Edit","preview.openInAmadeus":"Open in Amadeus","preview.mdConflict":"File was modified externally","preview.mdReload":"Reload","preview.mdOverwrite":"Overwrite","preview.mdSaveFail":"Save failed: {err}","preview.mdSalvaged":'File was modified externally; your edits were saved as "{file}"',"panel.toast.invalidName":"Invalid name: {name}","panel.action.open":"Open","panel.action.newFile":"New file","panel.action.newFolder":"New folder","panel.action.copyPath":"Copy path","preview.htmlCode":"Source","preview.reload":"Reload","preview.openInBrowser":"Open in browser (same preview server; Forsion AI works with your account)","preview.csvTruncated":"Showing first {shown} of {total} rows","preview.slide":"Slide {n}","preview.wrap":"Wrap","preview.zoomIn":"Zoom in","preview.zoomOut":"Zoom out","preview.fit":"Fit","preview.diffSideBySide":"Side by side","preview.diffLineByLine":"Line by line","preview.pdfPages":"Showing first {n} of {total} pages — download to view all","panel.action.preview":"Preview","panel.action.deleteN":"Delete {n}","panel.confirm.trashN":"Move {n} selected items to trash?","panel.confirm.delete":'Delete "{name}"?',"panel.confirm.deleteN":"Delete {n} selected files?","panel.toast.copied":"Copied {n} item(s) to workspace","panel.toast.copyFail":"Copy failed: {err}","panel.toast.moveFail":"Move failed: {err}","settings.tab.notifications":"Notifications","settings.tab.statusbar":"Status bar","ntf.enable":"Enable notifications","ntf.delivery":"Delivery","ntf.enableHint":"Floating cards popping from the top-right; when off, everything (errors included) is silenced.","ntf.osEnable":"System notifications","ntf.osEnableHint":"Also pop an OS notification when the app is in the background (all types, not just Inbox).","ntf.sendTest":"Send test notification","ntf.testBody":"This is a test notification 👋","ntf.events":"Notification events","ntf.eventsHint":"Keep only the events worth your attention to reduce noise.","ntf.event.system":"System messages","ntf.event.syncError":"Sync failures / conflicts","ntf.event.syncDone":"Remote sync completed","ntf.event.syncDoneOnline":"Online sync completed","ntf.event.agentDone":"Background session finished","ntf.event.inbox":"New Inbox message","ntf.event.noteReminder":"Note reminders (@remind:)","ntf.event.harnessCandidates":"Background evolution-record updates and candidates","ntf.event.projectCandidates":"Project-memory candidates awaiting your decision","ntf.event.projectCompacted":"Project memory compacted when full","ntf.pluginEvents":"Plugin notifications","ntf.pluginEventsHint":"One switch per plugin (the source of ctx.notify; turn off to mute that plugin).","ntf.view":"View","ntf.syncError":"Online sync failed: {e}","ipcerr.notLoggedIn":"Not signed in to Forsion","ipcerr.loginExpired":"Your Forsion sign-in has expired. Sign in again","ipcerr.vaultMissing":"Vault folder not found: {detail}","ipcerr.mirrorMissing":"Mirror folder not found (it has sync history, so an empty one won't be created): {detail}","ipcerr.scanFailed":"Couldn't read the local folder, so this round won't treat missing files as deleted: {detail}","ipcerr.invalidSpaceId":"Invalid Space identifier","ipcerr.invalidPluginId":"Invalid plugin identifier","ipcerr.notUserPlugin":"This plugin isn't in the user plugins folder (built-in plugins can't be uninstalled)","ipcerr.pluginNotFound":"Plugin not found","ipcerr.mcpNameReserved":'The MCP server name "{detail}" is reserved: names that are dev or start with dev_ belong to device tools. Pick another name',"settings.discovery.mcpReserved":"Not imported: {names}. MCP server names that are dev or start with dev_ belong to device tools. Rename them and add them by hand on the MCP page.","ntf.syncDone":"Online sync completed","ntf.noteReminder":"Reminder · {src}","ntf.remoteSyncDone":"Remote sync done: {n} change(s)","ntf.remoteSyncFail":"Remote sync failed: {e}","ntf.remoteSyncConflicts":"Remote sync conflicts: {n} pending","ntf.remoteSyncPendingDel":"Remote sync: {n} deletion(s) awaiting confirmation","ntf.actionReview":"Review","ntf.agentDone":'"{name}" finished',"ntf.agentFail":'"{name}" failed',"ntf.harnessCandidates":'"{name}" has new evolution-record candidates. Reflect now?',"ntf.harnessConfirm":'"{name}" has evolution-record candidates awaiting your decision. They carry a URL, a command or wording about permissions, so nothing was written in the background.',"ntf.projectCandidates":'Project "{name}" has facts noted in the background that await your decision. They carry a URL, a command or wording about permissions, so they were not saved to project memory.',"ntf.projectCompacted":'Project memory for "{name}" was full, so the agent compacted it before saving the new entry. The original sentences that were merged or removed can be restored one by one in project details.',"ntf.actionRefine":"Reflect","ntf.actionView":"View","ntf.harnessAdopted":'Background review added an evolution-record entry for "{name}": {titles}. View or undo it under Evolution.',"sb.enable":"Show status bar","sb.display":"Display","sb.enableHint":"A slim bar at the bottom showing sync / backlinks / word count per current view. Off by default; it appears with just the sync status while sync is failing.","sb.items":"Status bar","sb.itemsHint":"Uncheck to hide; drag to reorder (plugin items appear here once enabled).","sb.side.left":"Front","sb.side.right":"Back","sb.item.space":"Current Space","sb.item.agentRunning":"Running sessions","sb.item.sync":"Sync status","sb.item.backlinks":"Backlinks","sb.item.wordCount":"Word count","sb.item.inbox":"Inbox unread","sb.agentRunning":"{n} running","sb.synced":"Synced","sb.syncing":"Syncing · {n}","sb.syncingPlain":"Syncing…","sb.syncProgress":"Syncing {done}/{total}","sb.syncError":"Sync error","sb.syncOffline":"Offline","sb.chars":"{n} chars","sb.backlinks":"{n} backlinks","amadeus.default.note":"Untitled","amadeus.default.dashboard":"Untitled dashboard","amadeus.default.drawing":"Untitled whiteboard","amadeus.default.database":"Untitled database","amadeus.default.folder":"New folder","amadeus.default.section":"New section","amadeus.default.pdfBookmark":"Page {page}","amadeus.new.note":"New note","amadeus.new.childNote":"New sub-note","amadeus.new.dashboard":"New dashboard","amadeus.new.dashboardIn":"New dashboard in “{folder}”","amadeus.new.drawing":"New whiteboard","amadeus.new.drawingIn":"New whiteboard in “{folder}”","amadeus.new.folder":"New folder","amadeus.new.folderIn":"New folder in “{folder}”","amadeus.new.database":"New base","amadeus.new.databaseIn":"New base in “{folder}”","amadeus.exists":"“{name}” already exists","amadeus.cmd.quickSwitch":"Quick switch note","amadeus.cmd.search":"Search notes (full text)","amadeus.cmd.tutorial":"Open the tutorial","amadeus.cmd.manual":"Open the user manual","amadeus.cmd.dailyNote":"Open today's daily note","amadeus.cmd.toggleStar":"Star / unstar current note","amadeus.cmd.toggleSource":"Toggle source / visual editing","amadeus.cmd.openVault":"Open vault…","amadeus.cmd.reveal":"Reveal current note in file manager","amadeus.cmd.reindex":"Rebuild full-text index","amadeus.cmd.toggleWikiFiles":"Toggle attachments & databases in wikilink autocomplete","amadeus.cmd.wikiFilesOn":"Wikilink autocomplete now includes attachments and databases","amadeus.cmd.wikiFilesOff":"Wikilink autocomplete now covers notes only"},xr={zh:bo,en:ld};function yo(e){for(const[t,n]of Object.entries(e))n.zh!=null&&(bo[t]=n.zh),n.en!=null&&(ld[t]=n.en)}const f1={"app.defaultWorkspace":["Tangu Default Workspace","Tangu 默认工作区","Tangu default workspace"],"app.cloudWorkspace":["Cloud Workspace","Cloud 工作区","Cloud workspace"]};function cC(e){const t=Object.values(xr).map(n=>n[e]).filter(n=>!!n);return[...new Set([...t,...f1[e]??[]])]}function vs(e,t,n){return cd(xr[e][t]??xr.zh[t]??t,n)}function re(e,t){return vs(Kt,e,t)}function uC(e,t,n){return vs(e,t,n)}function cd(e,t){return t?e.replace(/\{(\w+)\}/g,(n,i)=>i in t?String(t[i]):`{${i}}`):e}const wo=nt.createContext(null);let Kt=ad(),wn=null;function dC(){wn?.(Kt==="zh"?"en":"zh")}function _r(){return Kt}const Cr=new Set;function h1(e){return Cr.add(e),()=>{Cr.delete(e)}}function ud(e){if(Kt!==e){Kt=e,c1(),dd(e);for(const t of Array.from(Cr))try{t(e)}catch(n){typeof globalThis.reportError=="function"?globalThis.reportError(n):console.error("[i18n] locale subscriber failed",n)}}}function dd(e=Kt){try{window.tangu?.reportUiLocale?.(e)}catch{}}function fd(e){if(wn){wn(e);return}try{localStorage.setItem(ci,e)}catch{}try{document.documentElement.lang=e==="zh"?"zh-CN":"en"}catch{}ud(e)}const fC=({children:e})=>{const[t,n]=nt.useState(ad),i=nt.useCallback(r=>{n(r);try{localStorage.setItem(ci,r)}catch{}try{document.documentElement.lang=r==="zh"?"zh-CN":"en"}catch{}ud(r)},[]);nt.useEffect(()=>(wn=i,Kt=t,()=>{wn===i&&(wn=null)}),[i,t]),nt.useEffect(()=>{dd(t)},[t]),nt.useEffect(()=>{try{document.documentElement.lang=t==="zh"?"zh-CN":"en"}catch{}},[t]),nt.useEffect(()=>{d1()},[]);const s=nt.useMemo(()=>({locale:t,setLocale:i,t:(r,o)=>vs(t,r,o)}),[t,i]);return ks.jsx(wo.Provider,{value:s,children:e})},hC=({children:e})=>{const t=nt.useSyncExternalStore(h1,_r,_r),n=nt.useMemo(()=>({locale:t,setLocale:fd,t:(i,s)=>vs(t,i,s)}),[t]);return ks.jsx(wo.Provider,{value:n,children:e})};function pC(){const e=nt.useContext(wo);return e||{locale:"zh",setLocale:()=>{},t:(t,n)=>cd(bo[t]??t,n)}}yo({"amxlinks.rewriteFailed":{zh:"已改名 / 移动,但有 {n} 篇笔记里指向它的链接没能跟着更新:{names}。请打开这些笔记检查链接。",en:"Renamed or moved, but links to it in {n} notes could not be updated: {names}. Open those notes and check the links."},"amxlinks.nameSep":{zh:"、",en:", "}});const p1=e=>(e.split("/").pop()??e).replace(/\.md$/i,"");function m1(e){if(!e.length||typeof window>"u")return;const t=e.slice(0,5).map(p1).join(re("amxlinks.nameSep")),n=e.length>5?`${t} …`:t;window.dispatchEvent(new CustomEvent("amadeus:toast",{detail:{text:re("amxlinks.rewriteFailed",{n:e.length,names:n}),level:"error",dedupeKey:"amxlinks.rewriteFailed"}}))}yo({"amxbridge.pageNameEmpty":{zh:"页面名不能为空",en:"Page name can't be empty"},"amxbridge.pageExists":{zh:"目标页面已存在",en:"A page with that name already exists"},"amxbridge.fileExistsAtTarget":{zh:"目标位置已存在同名文件",en:"A file with the same name already exists there"},"amxbridge.folderNameEmpty":{zh:"文件夹名不能为空",en:"Folder name can't be empty"},"amxbridge.folderExists":{zh:"同名文件夹已存在",en:"A folder with the same name already exists"},"amxbridge.folderPathEmpty":{zh:"文件夹路径不能为空",en:"Folder path can't be empty"},"amxbridge.moveIntoSelf":{zh:"不能移动到自身内部",en:"Can't move a folder into itself"},"amxbridge.folderExistsAtTarget":{zh:"目标位置已存在同名文件夹",en:"A folder with the same name already exists there"},"amxbridge.noteNameEmpty":{zh:"笔记名不能为空",en:"Note name can't be empty"},"amxbridge.noteExists":{zh:"目标笔记已存在",en:"A note with that name already exists"},"amxbridge.nameEmpty":{zh:"名称不能为空",en:"Name can't be empty"},"amxbridge.fileExists":{zh:"目标文件已存在",en:"A file with that name already exists"},"amxbridge.desktopOnly":{zh:"此操作仅桌面端可用",en:"This action is only available in the desktop app"},"amxbridge.conflictReloaded":{zh:"云端已有更新,已加载最新版本(本次未保存的修改被覆盖)",en:"A newer version was in the cloud, so it was loaded (your unsaved edits were overwritten)"},"amxbridge.renamedElsewhere":{zh:"这篇笔记已在别处改名为「{name}」,本次修改已保存到新名字",en:"This note was renamed to “{name}” elsewhere; your edits were saved under the new name"},"amxbridge.deletedElsewhere":{zh:"这篇笔记已在别处被删除或移走,本次修改没有写到云端(请另存为新笔记)",en:"This note was deleted or moved elsewhere, so your edits weren't saved to the cloud (save them as a new note)"},"amxbridge.deletedElsewhereSaved":{zh:"这篇笔记已在别处被删除或移走,本端未保存的修改已另存为「{name}」",en:"This note was deleted or moved elsewhere; your unsaved edits were saved as “{name}”"},"amxbridge.connectFailed":{zh:"云端连接失败,内容可能不是最新 —— 请刷新页面",en:"Lost the connection to the cloud, so content may be out of date — please refresh the page"},"amxbridge.tooLarge":{zh:"笔记过大,云端拒绝保存",en:"The note is too large for the cloud to save"},"amxbridge.imageNameFailed":{zh:"无法为图片分配文件名",en:"Couldn't pick a file name for the image"},"amxbridge.attachmentNameFailed":{zh:"无法为附件分配文件名",en:"Couldn't pick a file name for the attachment"},"amxbridge.invalidPath":{zh:"无效路径",en:"Invalid path"},"amxbridge.trashMissing":{zh:"回收站条目不存在",en:"This item is no longer in the trash"},"amxbridge.pathOutsideVault":{zh:"路径越出智库",en:"The path is outside the vault"},"amxbridge.readFailed":{zh:"读取文件失败(HTTP {status})",en:"Couldn't read the file (HTTP {status})"},"amxbridge.notText":{zh:"不是文本文件",en:"Not a text file"},"amxbridge.timeout":{zh:"请求超时({s}s),请检查网络后重试",en:"The request timed out ({s}s). Check your network and try again"},"amxbridge.network":{zh:"网络错误:{msg}",en:"Network error: {msg}"},"amxbridge.deviceTimeout":{zh:"设备请求超时,请检查与对方设备的连接",en:"The device didn't respond in time. Check the connection to it"},"amxbridge.deviceUnreachable":{zh:"设备不可达:{msg}",en:"Can't reach the device: {msg}"},"amxbridge.deviceRevoked":{zh:"连接权限已被对方移除",en:"The other device removed your access"},"amxbridge.deviceTooLarge":{zh:"内容过大:服务器中转通道上限 10MB,同一局域网内直连不受限",en:"Too large: the server relay is limited to 10 MB (a direct connection on the same local network has no limit)"},"amxbridge.deviceHttpError":{zh:"设备端错误(HTTP {status})",en:"Device error (HTTP {status})"},"amxbridge.deviceCallFailed":{zh:"设备端调用失败",en:"The call on the device failed"},"amxbridge.remoteOnly":{zh:"{what}:请在对方设备上操作",en:"{what}: do this on the other device"},"amxbridge.op.openPluginsFolder":{zh:"打开插件文件夹",en:"Open plugins folder"},"amxbridge.op.scaffoldSamplePlugin":{zh:"创建示例插件",en:"Create sample plugin"},"amxbridge.op.uninstallPlugin":{zh:"卸载插件",en:"Uninstall plugin"},"amxbridge.op.reveal":{zh:"在文件管理器中显示",en:"Show in file manager"}});class Je extends Error{constructor(t,n,i){super(i??`HTTP ${t}`),this.status=t,this.body=n,this.name="HttpError"}status;body}const Le=e=>e instanceof Je&&e.status===404,Ie=e=>e instanceof Je&&e.status===409,nl=e=>{let t=0;return e.forEach(n=>{typeof n!="string"&&(t+=n.size)}),12e4+Math.ceil(t/256)};function g1(e){const t=e.getToken(),n=Jn(e.apiBase,t),i=()=>{const o=e.getToken();if(e.signal?.aborted||!o||(n?Jn(e.apiBase,o)!==n:o!==t))throw new Je(409,{code:"ACCOUNT_CHANGED"},"Cloud account changed");return o},s=async(o,a,l)=>{const c=l?.query?`?${new URLSearchParams(l.query).toString()}`:"",d={Authorization:`Bearer ${i()}`};o!=="GET"&&(d["X-Amadeus-Client"]=e.clientId);let u;l?.form?u=l.form:l?.json!==void 0&&(d["Content-Type"]="application/json",u=JSON.stringify(l.json));const h=l?.form?nl(l.form):3e4,f=new AbortController,m=()=>f.abort(e.signal?.reason);e.signal?.addEventListener("abort",m,{once:!0});const p=setTimeout(()=>f.abort(),h);let y;try{y=await(e.request??fetch)(`${e.apiBase}${a}${c}`,{method:o,headers:d,body:u,signal:f.signal})}catch(S){throw new Je(0,null,f.signal.aborted?re("amxbridge.timeout",{s:Math.round(h/1e3)}):re("amxbridge.network",{msg:S instanceof Error?S.message:String(S)}))}finally{clearTimeout(p),e.signal?.removeEventListener("abort",m)}if(i(),y.status===401)throw e.onUnauthorized(),new Je(401,null);const w=await y.text().catch(()=>"");i();let C;try{C=w?JSON.parse(w):void 0}catch{C=w}if(!y.ok)throw new Je(y.status,C);return C},r=(o,a,l)=>new Promise((c,d)=>{const u=new XMLHttpRequest,h=i(),f=()=>u.abort(),m=()=>e.signal?.removeEventListener("abort",f);u.open("POST",`${e.apiBase}${o}`),u.setRequestHeader("Authorization",`Bearer ${h}`),u.setRequestHeader("X-Amadeus-Client",e.clientId),u.upload.onprogress=p=>{try{i(),p.lengthComputable&&l(p.loaded,p.total)}catch(y){u.abort(),d(y)}},u.onload=()=>{m();try{i()}catch(y){d(y);return}if(u.status===401){e.onUnauthorized(),d(new Je(401,null));return}let p;try{p=u.responseText?JSON.parse(u.responseText):void 0}catch{p=u.responseText}if(u.status<200||u.status>=300){d(new Je(u.status,p));return}c(p)},u.onerror=()=>{m(),d(new Je(0,null,"network error"))},u.ontimeout=()=>{m(),d(new Je(0,null,"timeout"))},u.onabort=()=>{m(),d(new Je(409,{code:"ACCOUNT_CHANGED"},"Cloud request cancelled"))},u.timeout=nl(a),e.signal?.addEventListener("abort",f,{once:!0}),u.send(a)});return{get:(o,a)=>s("GET",o,{query:a}),post:(o,a)=>s("POST",o,{json:a??{}}),postForm:(o,a,l)=>l?r(o,a,l):s("POST",o,{form:a}),put:(o,a)=>s("PUT",o,{json:a}),del:(o,a)=>s("DELETE",o,{query:a})}}const b1=/structure|create|delete|remove|move|rename|mkdir|rmdir|folder|binary|upload/;function y1(e){let t=null,n=e.signal?.aborted??!1,i=1e3,s=null,r=null,o=null;const a=()=>{r||(r=setTimeout(()=>{r=null,!n&&e.onStructureChange()},300))},l=()=>{if(!n){a();for(const f of new Set([e.lastLoadedPage(),...e.openPages?.()??[]]))f&&e.onPageChange(f)}},c=f=>{if(n)return;let m;try{m=JSON.parse(f)}catch{return}const p=typeof m.seq=="number"?m.seq:null;p!==null&&(o=Math.max(o??0,p));const y=typeof m.path=="string"?m.path:"",w=`${typeof m.op=="string"?m.op:""} ${typeof m.kind=="string"?m.kind:""}`.toLowerCase();if((!y||b1.test(w))&&a(),!y)return;const C=typeof m.op=="string"?m.op:"",S=typeof m.newPath=="string"&&m.newPath?m.newPath:null,I=typeof m.origin?.client=="string"&&m.origin.client===e.clientId;if(C==="move"&&S){e.onPageMoved?.(y,S,typeof m.fileSeq=="number"?m.fileSeq:null,I);return}if(C==="delete"){e.onPageDeleted?.(y);return}if((C==="rename-folder"||C==="move-folder")&&S){e.onFolderMoved?.(y,S,I);return}if(C==="delete-folder"){e.onFolderDeleted?.(y);return}const O=typeof m.origin?.client=="string"&&m.origin.client===e.clientId,k=e.knownSeq(y),E=p!==null&&k!==void 0&&p<=k;O||E||(/\.md$/i.test(y)?e.onPageChange(y):/\.db$/i.test(y)&&e.onDbChange(y))},d=()=>{if(n)return;const f=o;let m=null,p;try{const y=e.url();p=new EventSource(f===null?y:`${y}${y.includes("?")?"&":"?"}since=${f}`)}catch{u();return}t=p,p.onopen=()=>{n||(i=1e3)},p.addEventListener("hello",y=>{if(n)return;let w=null;try{const C=JSON.parse(y.data);typeof C.seq=="number"&&(w=C.seq)}catch{}f!==null&&w!==null?w<f?(o=w,l()):w>f&&(m=w):w!==null&&(o=Math.max(o??0,w))}),p.addEventListener("change",y=>c(y.data)),p.addEventListener("reset",()=>{l(),m!==null&&(o=Math.max(o??0,m)),m=null}),p.addEventListener("presence",y=>{if(!n)try{e.onPresence?.(JSON.parse(y.data))}catch{}}),p.addEventListener("presence-roster",y=>{if(!n)try{e.onPresenceRoster?.(JSON.parse(y.data))}catch{}}),p.onerror=()=>{p.close(),t===p&&(t=null),u()}},u=()=>{if(n||s)return;const f=i+Math.random()*i*.3;i=Math.min(i*2,3e4),s=setTimeout(()=>{s=null,d()},f)},h=()=>{n=!0,t?.close(),t=null,s&&clearTimeout(s),r&&clearTimeout(r),e.signal?.removeEventListener("abort",h)};return e.signal?.addEventListener("abort",h,{once:!0}),d(),h}const Xe=new Set;let hd=0;const Ar=new Set;function il(){hd++;for(const e of Ar)e()}function w1(){return hd}function k1(e){return Ar.add(e),()=>Ar.delete(e)}function v1(e){return Xe.add(e),il(),()=>{Xe.delete(e),il()}}function He(e){const t=[];let n=0;for(const i of Xe)(e==null||i.path===e)&&t.push({h:i,at:i.lastActive?.()??0,i:n++});return t.sort((i,s)=>s.at-i.at||i.i-s.i).map(i=>i.h)}function S1(e){return He(e)[0]?.scope??null}function x1(e,t){for(const n of[...Xe])n.path===e&&n.owner!==t&&n.peerWrote?.()}function _1(e,t){const n=He(e).filter(r=>r.patchFm);n.sort((r,o)=>+!!o.dirty?.()-+!!r.dirty?.());let i=null;const s=[];for(const r of n)i?s.push(r):i=r.patchFm(t);if(i)for(const r of s)r.patchFm(t,!0);return i}async function C1(e=!1){await Promise.all([...Xe].map(t=>e?t.flush(!0):t.flush().catch(()=>{})))}async function A1(e,t=!1){await Promise.all([...Xe].filter(n=>n.path===e).map(n=>t?n.flush(!0):n.flush().catch(()=>{})))}function T1(){for(const e of Xe)e.retire()}function E1(e,t){for(const n of He(e))if(n.insertFiles&&n.insertFiles(t)!==!1)return!0;return!1}function I1(e,t="file",n){for(const i of Xe)(t==="file"?i.path!==e:i.path!==e&&!i.path.startsWith(`${e}/`))||i.retire(n?t==="file"?n:n+i.path.slice(e.length):void 0)}function pd(){return[...new Set([...Xe].map(e=>e.path))]}function P1(e,t){for(const n of Xe)if(n.path===e&&(n.scope??null)===t)return!0;return!1}function O1(e){for(const t of Xe)if(t.path===e)return!0;return!1}function $1(e){for(const t of He(e))if(t.bodyNow)return t.bodyNow();return null}function R1(e){for(const t of He(e))if(t.statsNow)return t.statsNow();return null}let md=0;const Tr=new Set;function N1(){md++;for(const e of Tr)e()}function L1(){return md}function F1(e){return Tr.add(e),()=>Tr.delete(e)}function D1(e){for(const t of He(e))if(t.headings)return t.headings();return null}function z1(e){for(const t of He(e))if(t.fmNow)return t.fmNow();return null}function M1(e,t,n){for(const i of He(e))if(i.insertMarkdown?.(t,n))return!0;return!1}function j1(){return Xe.size>0}function B1(){for(const e of Xe)if(e.insertReply)return!0;return!1}function U1(e,t){if(t)for(const n of He(t.path)){const i=n.insertReply?.(e,t.anchor??null);if(i)return{path:n.path,undo:i.undo}}for(const n of He()){const i=n.insertReply?.(e,null);if(i)return{path:n.path,undo:i.undo}}return null}function H1(e){for(const t of He(e))if(t.focusBody)return t.focusBody();return!1}function q1(e){for(const t of He(e))if(t.fmNow)return t.fmNow();return null}function W1(e,t,n=!1){for(const i of He(e))if(i.revealBlock)return i.revealBlock(t,n);return!1}function V1(e,t,n){for(const i of He(e))if(i.revealText)return i.revealText(t,n);return!1}function Z1(e,t,n,i=!1){for(const s of He(e))if(s.revealHeading)return s.revealHeading(t,n,i),!0;return!1}const mC=Object.freeze(Object.defineProperty({__proto__:null,announceUnifiedWrite:x1,bumpUnifiedStats:N1,flushUnifiedPath:A1,flushUnifiedScopes:C1,hasUnifiedInstance:O1,insertFilesForPath:E1,registerUnifiedPipe:v1,retireAllUnifiedScopes:T1,retireUnifiedPath:I1,subscribeUnified:k1,subscribeUnifiedStats:F1,unifiedBody:$1,unifiedFm:z1,unifiedFmNow:q1,unifiedFocusBody:H1,unifiedGen:w1,unifiedHasAny:j1,unifiedHasReplyTarget:B1,unifiedHeadings:D1,unifiedInsertMarkdown:M1,unifiedInsertReply:U1,unifiedPatchFm:_1,unifiedPaths:pd,unifiedRevealBlock:W1,unifiedRevealHeading:Z1,unifiedRevealText:V1,unifiedScopeFor:S1,unifiedScopeLive:P1,unifiedStats:R1,unifiedStatsVer:L1},Symbol.toStringTag,{value:"Module"})),K1=7e4,kn=new Map,Er=new Set;function gd(){const e=Date.now();for(const[t,n]of kn)e-n.at>K1&&kn.delete(t);return[...kn.values()]}function bd(){const e=gd();for(const t of Er)try{t(e)}catch{}}function G1(e){const t=e;!t||typeof t.userId!="string"||(kn.set(t.userId,{userId:t.userId,username:String(t.username??"user"),page:typeof t.page=="string"?t.page:null,at:Number(t.at)||Date.now()}),bd())}function Qs(e){if(kn.clear(),Array.isArray(e))for(const t of e){const n=t;n&&typeof n.userId=="string"&&kn.set(n.userId,n)}bd()}function Y1(e){return Er.add(e),e(gd()),()=>{Er.delete(e)}}let an=null;function Ir(e,t){if(!an)return e;const n=new URLSearchParams;n.set("ref",e);const i=t===void 0?an.activePage():t;i&&n.set("page",i);const s=an.assetToken();return s&&n.set("at",s),`${an.apiBase}/amadeus/vaults/${encodeURIComponent(an.vaultId())}/asset?${n.toString()}`}function J1(e){an=e,Qc(t=>Ir(t))}function xt(e){const t=e.replace(/\\/g,"/"),n=t.lastIndexOf("/");return n<0?"":t.slice(0,n)}function tt(e){const t=e.replace(/\\/g,"/"),n=t.lastIndexOf("/");return n<0?t:t.slice(n+1)}function Pr(e){const t=tt(e),n=t.lastIndexOf(".");return n>0?t.slice(n):""}function Ei(e){const t=[];for(const n of e.replace(/\\/g,"/").split("/"))if(!(!n||n===".")){if(n===".."){if(!t.length)return null;t.pop();continue}t.push(n)}return t.join("/")}function Q1(e,t){const n=e.split("/").filter(o=>o&&o!=="."),i=t.split("/").filter(o=>o&&o!==".");let s=0;for(;s<n.length&&s<i.length&&n[s]===i[s];)s++;return[...Array(n.length-s).fill(".."),...i.slice(s)].join("/")||"."}function X1(e){try{return decodeURIComponent(e)}catch{return e}}function sl(e){return e.replace(/^<|>$/g,"").trim()}function rl(e,t){const n=t.toLowerCase();for(const i of e)if(tt(i).toLowerCase()===n)return i;return null}function ol(e,t,n){const i=xt(e),s=l=>l.replace(/\\/g,"/").replace(/^\/+|\/+$/g,""),r=n.mode==="same"?i:n.mode==="vault"?s(n.folder):s(`${i}/attachments`),o=r?`${r}/${t}`:t,a=Q1(i,o);return{destDirRel:r,fileVaultRel:o,pageRel:a}}function al(e,t){const n=Pr(t),i=t.slice(0,t.length-n.length)||"file";for(let s=0;s<1e3;s++){const r=s===0?t:`${i}-${s}${n}`;if(!e.has(r.toLowerCase()))return r}return`${i}-${Date.now().toString(36)}${n}`}let yd=()=>{};function e_(e){yd=e}const St=(e,t=!1)=>{try{yd(e,t)}catch{}},Ii=()=>new Date().toISOString(),wd="amadeus.cloudVaultId";let Yn=null;function t_(){return Yn?Yn():Promise.resolve("default")}function n_(e){const t=Oi(wd),n=Oi("amadeus_tree_snap"),i=Oi("amadeus_last_page"),s=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`web-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`,r=g1({apiBase:e.apiBase,getToken:e.getToken,clientId:s,onUnauthorized:e.onAuthError,request:e.request,signal:e.signal});let o=null,a=null;const l=()=>o??"default";async function c(){return o||a||(a=(async()=>{const b=await r.get("/amadeus/vaults");let v=null;try{v=localStorage.getItem(t)}catch{}if(v&&!b.vaults.some(P=>P.id===v))try{if((await r.get("/amadeus/shared-with-me")).items.some(L=>L.vaultId===v))return o=v,v}catch{}return o=((v?b.vaults.find(P=>P.id===v):void 0)??b.vaults.find(P=>P.id==="default")??b.vaults[0])?.id??"default",o})(),a.catch(()=>{a=null}),a)}Yn=c,e.signal&&Qs([]);const d=50,u=new Map,h=(b,v)=>{u.delete(b),u.set(b,v),u.size>d&&u.delete(u.keys().next().value)},f=new Map,m=new Map,p=(b,v)=>{const _=m.get(b);return _&&_.seq===v&&f.get(b)===v?_.fp:void 0},y=new Set,w=new Map,C=new Set;class S extends Error{constructor(v){super(`vanished elsewhere: ${v}`),this.path=v}path}const I=(b,v)=>{f.set(b,v),y.add(b),w.delete(b)},O=b=>{f.delete(b),u.delete(b),y.delete(b)},k=(b,v,_)=>{const P=_??f.get(b);f.delete(b),P!==void 0&&(f.set(v,P),y.add(v)),u.delete(b),u.delete(v)},E=async b=>{const v=W(b);return v!==b&&!C.has(b)&&(C.add(b),St(re("amxbridge.renamedElsewhere",{name:v.split("/").pop()}))),{target:v,base:await j(v)}},$=b=>{C.has(b)||(C.add(b),St(re("amxbridge.deletedElsewhere"),!0))},W=b=>{let v=b;const _=new Set([b]);for(let P=0;P<16;P++){const L=w.get(v);if(!L||_.has(L))break;_.add(L),v=L}return v},R=b=>{const v=W(b);return v===b?[b]:[b,v]},H=b=>{for(const v of[...w.keys()])W(v)===b&&w.delete(v)},B=(b,v,_)=>b.includes(v)?_():M([v],_),te=async(b,v,_)=>{if(!_)return $(b),null;const P=new Date,L=V=>String(V).padStart(2,"0"),F=`${P.getFullYear()}-${L(P.getMonth()+1)}-${L(P.getDate())} ${L(P.getHours())}${L(P.getMinutes())}`,U=b.replace(/\.md$/i,"");for(let V=0;V<5;V++){const J=`${U} (recovered ${F}${V?`-${V+1}`:""}).md`;try{await N(J,v,0)}catch(X){if(Ie(X))continue;throw X}return w.set(b,J),ae(),C.has(b)||(C.add(b),St(re("amxbridge.deletedElsewhereSaved",{name:J.split("/").pop()}),!0)),J}throw $(b),new S(b)},ce=(b,v)=>{const _=`${b}/`;for(const[P,L]of[...f])P.startsWith(_)&&(f.delete(P),f.set(`${v}/${P.slice(_.length)}`,L));for(const P of[...u.keys()])P.startsWith(_)&&u.delete(P);for(const P of[...y]){if(!P.startsWith(_)||w.has(P))continue;const L=`${v}/${P.slice(_.length)}`;y.add(L),w.set(P,L)}},ne=b=>{const v=`${b}/`;for(const _ of[...f.keys()])(_===b||_.startsWith(v))&&f.delete(_);for(const _ of[...u.keys()])(_===b||_.startsWith(v))&&u.delete(_);for(const _ of[...y])(_===b||_.startsWith(v))&&(y.delete(_),H(_))},he=b=>{const v=`${b}/`;for(const _ of[...f.keys()])(_===b||_.startsWith(v))&&(f.delete(_),u.delete(_),H(_))},me=6e4;let we=null;const ae=()=>{we=null};async function x(b=!1){const v=Date.now();if(!b&&we&&(!we.settled||v-we.at<me))return we.promise;const _=await c(),P={at:Date.now(),promise:r.get(`/amadeus/vaults/${encodeURIComponent(_)}/tree`),settled:!1};return we=P,P.promise.then(L=>{P.settled=!0,A(_,L),window.amadeusCloudMaxFileBytes=L.maxFileBytes},()=>{we===P&&(we=null)}),P.promise}const A=(b,v)=>{try{localStorage.setItem(n,JSON.stringify({v:b,tree:v}))}catch{}},T=()=>{try{const b=localStorage.getItem(n);if(!b)return null;const v=JSON.parse(b);if(typeof v.v!="string"||!v.tree||!Array.isArray(v.tree.pages)||!Array.isArray(v.tree.files)||!Array.isArray(v.tree.folders))return null;const _=localStorage.getItem(t);return _&&_!==v.v?null:v}catch{return null}},g=b=>[...b.pages,...b.files.map(v=>v.path)],z=b=>!b.split("/").some(v=>v.startsWith(".")),q=new Map;function M(b,v){const P=Promise.allSettled(b.map(F=>q.get(F)??Promise.resolve())).then(()=>v()),L=P.then(()=>{},()=>{});for(const F of b)q.set(F,L);return L.then(()=>{for(const F of b)q.get(F)===L&&q.delete(F)}),P}const Y=new Set,ue=new Set,de=new Set,ye=b=>{for(const v of[...Y])try{v(b)}catch{}},Ge=()=>{for(const b of[...ue])try{b()}catch{}},Oe=b=>{for(const v of[...de])try{v(b)}catch{}},Fe=new Set,Yt=b=>{for(const v of[...Fe])try{v(b)}catch{}};let et=null;const Jt=(b=l())=>`${i}:${b}`,gt=b=>{et=b;try{localStorage.setItem(Jt(),b)}catch{}},Ss=()=>{try{return localStorage.getItem(Jt())||void 0}catch{return}};let Qt="",lt=null;async function Xt(){if(!e.signal?.aborted){lt&&(clearTimeout(lt),lt=null);try{const b=await c(),v=await r.post(`/amadeus/vaults/${encodeURIComponent(b)}/asset-token`);if(e.signal?.aborted)return;Qt=v.token;const _=Math.max(60,v.ttlSec||600);lt=setTimeout(()=>{Xt()},_/2*1e3)}catch{e.signal?.aborted||(lt=setTimeout(()=>{Xt()},3e4))}}}J1({apiBase:e.apiBase,vaultId:l,assetToken:()=>Qt,activePage:()=>et}),window.amadeusCloudVaults=async()=>{const b=await x();return RS([...b.pages,...b.files.map(v=>v.path)])};let Dt=null;e.signal?.addEventListener("abort",()=>{lt&&clearTimeout(lt),lt=null,Qt="",Dt?.(),Dt=null,Yn===c&&(Yn=null,Qs([]))},{once:!0});function ui(b){Dt||e.signal?.aborted||(Dt=y1({signal:e.signal,url:()=>`${e.apiBase}/amadeus/vaults/${encodeURIComponent(b)}/events?token=${encodeURIComponent(e.getToken())}`,clientId:s,knownSeq:v=>f.get(v),lastLoadedPage:()=>et,openPages:pd,onPageChange:v=>{u.delete(v),ye(v)},onDbChange:v=>Oe(v),onPageMoved:(v,_,P,L)=>{w.set(v,_),k(v,_,P??void 0),L||Yt({from:v,kind:"file",to:_,root:`cloud://${b}`})},onPageDeleted:v=>{f.delete(v),u.delete(v),H(v)},onFolderMoved:(v,_,P)=>{ce(v,_),P||Yt({from:v,kind:"prefix",to:_,root:`cloud://${b}`})},onFolderDeleted:v=>he(v),onStructureChange:()=>{ae(),u.clear(),Ge()},onPresence:G1,onPresenceRoster:Qs}),window.addEventListener("beforeunload",()=>{Dt?.()}))}const en=()=>`/amadeus/vaults/${encodeURIComponent(l())}/file`,Re=async b=>{const v=await r.get(en(),{path:b});return I(b,v.seq),m.set(b,{seq:v.seq,fp:Wn(v.content)}),v},N=async(b,v,_,P=!1)=>{const L=await r.put(en(),{path:b,content:v,baseSeq:_,...P?{force:!0}:{}});return I(b,L.seq),m.set(b,{seq:L.seq,fp:Wn(v)}),u.delete(b),L},j=async b=>{const v=f.get(b);if(v!==void 0)return v;try{return(await Re(b)).seq}catch(_){if(!Le(_))throw _;if(y.has(b))throw new S(b);return 0}},Q=async b=>{const v=await Re(b),_=Ri(b,v.content,Ii());return h(b,_),_},oe=async b=>{try{const v=f.get(b),_=await Re(b);if(_.seq===v)return;h(b,Ri(b,_.content,Ii())),ye(b)}catch{}},fe=async b=>{const v=[],P=await hS({readFile:async()=>{throw new Error("not found")},writeFile:async(L,F)=>{v.push({name:L,data:F})},deleteFile:async()=>{},exists:async()=>!1,listDir:async()=>[]},b,Ii());for(const L of v){const F=Fi(xt(b),L.name);try{await N(F,L.data,0)}catch(U){if(Ie(U))return Q(F);throw U}}return ae(),h(b,P),P},qe=async b=>{try{return await Q(b)}catch(v){if(Le(v)){if(y.has(b))throw new S(b);return fe(b)}throw v}};async function ct(b,v){const _=sl(v);if(!_)return null;if(_.includes("/"))return Ei(Fi(xt(b),X1(_)));const P=await x(),L=rl(g(P),_);if(L)return L;const F=await x(!0);return rl(g(F),_)}const Ye=async(b,v,_,P,L)=>{const F=new FormData;F.append("file",new Blob([_]),v),F.append("path",b),P&&F.append("ifAbsent","1");const U=await r.postForm(`/amadeus/vaults/${encodeURIComponent(l())}/binary`,F,L);return I(U.path??b,U.seq),ae(),U},Ce=".trash",vt=`${Ce}/.meta.json`,$e=async()=>{try{const b=await Re(vt),v=JSON.parse(b.content);return{meta:v&&typeof v=="object"?v:{},seq:b.seq}}catch(b){if(Le(b))return{meta:{},seq:0};throw b}},ut=async b=>{const v=await $e();b(v.meta);try{await N(vt,`${JSON.stringify(v.meta,null,2)}
297
297
  `,v.seq)}catch(_){if(!Ie(_))throw _;const P=await $e();b(P.meta),await N(vt,`${JSON.stringify(P.meta,null,2)}
298
- `,P.seq,!0)}};let dt=0,di=null;const ko=async()=>{const b=E();if(b){await Xt(),(async()=>{for(let V=0;;V++){if(e.signal?.aborted)return;try{const J=await c();await x(!0),ui(J),Ge();return}catch{if(e.signal?.aborted)return;if(V>=2){St(re("amxbridge.connectFailed"),!0);return}await new Promise(J=>{const X=()=>{clearTimeout(De),e.signal?.removeEventListener("abort",X),J()},De=setTimeout(X,[3e3,1e4][V]);e.signal?.addEventListener("abort",X,{once:!0}),e.signal?.aborted&&X()})}}})();let F;try{F=localStorage.getItem(Jt(b.v))||void 0}catch{}const U=b.tree.pages.filter(z);return{root:`cloud://${b.v}`,pages:U,folders:b.tree.folders.filter(z),lastPage:F&&U.includes(F)?F:void 0}}const v=await c(),[_]=await Promise.all([x(!0),Xt()]);ui(v);const P=Ss(),L=_.pages.filter(z);return{root:`cloud://${v}`,pages:L,folders:_.folders.filter(z),lastPage:P&&L.includes(P)?P:void 0}},vd=(b,v,_)=>M([b],async()=>{await c();for(let P=0;P<3;P++){let L;try{L=await Re(b)}catch(F){if(Le(F))return"gone";throw F}if(Wn(L.content)!==_)return{ok:!1,current:L.content};try{return await N(b,v,L.seq),{ok:!0}}catch(F){if(!Ie(F))throw F}}throw new Error("conflict")}),Dn=async(b,v)=>{const _=await H0({read:async P=>{try{return(await Re(P)).content}catch(L){if(Le(L))return null;throw L}},write:vd},b,v);for(const P of _.rewritten)ye(P);m1(_.failed.map(P=>P.path))},vo=(b,v,_)=>{const P=`${v}/`,L={};for(const F of b)F.startsWith(P)&&(L[F]=`${_}/${F.slice(P.length)}`);return L};return W0({openVault:()=>ko(),restoreVault:()=>ko(),listPages:async()=>(await x()).pages.filter(z),listFiles:async()=>(await x()).files.map(b=>b.path).filter(z),listFolders:async()=>(await x()).folders.filter(z),loadPage:async b=>{await c();const v=u.get(b);if(v)return gt(b),oe(b),v;const _=await qe(b);return gt(b),_},readPage:async b=>{await c();try{return await Q(b)}catch(v){throw Le(v)?new Error(`note not found: ${b}`):v}},newPage:async b=>{await c();const v=await M([b],()=>fe(b));return gt(b),v},savePage:(b,v,_)=>{const P=R(b);return M(P,async()=>{await c();const L=hr(v,_),F=Object.values(_).some(J=>typeof J=="string"&&J.trim().length>0);let U,V;try{({target:U,base:V}=await T(b))}catch(J){if(J instanceof S){await te(b,L,F);return}throw J}await B(P,U,async()=>{try{await N(U,L,V),p(U,Ri(U,L,Ii()))}catch(J){if(Ie(J)){const X=J.body;if(X?.code==="CONFLICT"&&X.seq===0){f.delete(U),await te(b,L,F);return}X&&typeof X.seq=="number"&&I(U,X.seq),u.delete(b),St(re("amxbridge.conflictReloaded"),!0),setTimeout(()=>ye(b),0);return}throw J instanceof Je&&J.status===413&&St(re("amxbridge.tooLarge"),!0),J}})})},renamePage:(b,v,_,P)=>{let L=null;return M([b,Pi(b,v,re("amxbridge.pageNameEmpty"))],async()=>{await c();const F=Pi(b,v,re("amxbridge.pageNameEmpty"));if(F===b)return{newPath:b,page:await Q(b)};const U=await x(!0);if(L=U.pages.filter(z),g(U).includes(F)||U.folders.includes(F))throw new Error(re("amxbridge.pageExists"));const V=hr(_,P);await N(b,V,await j(b),!0);let J;try{J=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:b,to:F})}catch(X){throw Ie(X)?new Error(re("amxbridge.pageExists")):X}return k(b,F,J.seq),ae(),gt(F),{newPath:F,page:null}}).then(async F=>F.page?{newPath:F.newPath,page:F.page}:(L&&await Dn({[b]:F.newPath},L),{newPath:F.newPath,page:await Q(F.newPath)}))},reconcilePage:async b=>(await c(),qe(b)),saveAsset:async(b,v,_,P)=>{await c();const L=Pr(v),F=(L||".png").toLowerCase().replace(/[^.a-z0-9]/g,""),U=tt(v).slice(0,tt(v).length-L.length).replace(/[^a-zA-Z0-9_-]/g,"").slice(0,24)||"img";for(let V=0;V<5;V++){const J=`${U}-${Date.now().toString(36)}-${(dt++).toString(36)}${F||".png"}`,X=Ti(Fi(xt(b),`.amadeus/${J}`));if(X===null)throw new Error("Asset escapes vault");try{return await Ye(X,J,_,!0,P),`.amadeus/${J}`}catch(De){if(Ie(De))continue;throw De}}throw new Error(re("amxbridge.imageNameFailed"))},saveAttachment:async(b,v,_,P,L)=>{await c();const F=(tt(v)||"file").replace(/[\\/]/g,""),{destDirRel:U}=ol(b,F,P),V=await x(!0),J=new Set(g(V).filter(_e=>xt(_e)===U).map(_e=>tt(_e).toLowerCase()));let X=al(J,F);const De=/\.(db|md)$/i.test(F);for(let _e=0;_e<20;_e++){const{fileVaultRel:It,pageRel:tn}=ol(b,X,P),xs=Ti(It);if(xs===null)throw new Error("Asset escapes vault");try{return De?await N(xs,new TextDecoder().decode(_),0):await Ye(xs,X,_,!0,L),{pageRel:tn,base:X}}catch(So){if(Ie(So)){J.add(X.toLowerCase()),X=al(J,F);continue}throw So}}throw new Error(re("amxbridge.attachmentNameFailed"))},openAttachment:async(b,v)=>{await c(),window.open(Ir(sl(v),b),"_blank","noopener")},openVaultFile:async b=>{await c(),window.open(Ir(b,null),"_blank","noopener")},exportPdf:async()=>(window.print(),null),onExternalChange:b=>(Y.add(b),()=>{Y.delete(b)}),onStructureChange:b=>(ue.add(b),()=>{ue.delete(b)}),onDbExternalChange:b=>(de.add(b),()=>{de.delete(b)}),onPathGone:b=>(Fe.add(b),()=>{Fe.delete(b)}),search:async b=>(await c(),(await r.get(`/amadeus/vaults/${encodeURIComponent(l())}/search`,{q:b})).filter(_=>z(_.path))),backlinks:async b=>(await c(),r.get(`/amadeus/vaults/${encodeURIComponent(l())}/backlinks`,{path:b})),reindex:async()=>{await c(),await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/reindex`)},listTags:async()=>(await c(),r.get(`/amadeus/vaults/${encodeURIComponent(l())}/tags`)),pagesByTag:async b=>(await c(),(await r.get(`/amadeus/vaults/${encodeURIComponent(l())}/tags/pages`,{tag:b})).paths),resolveEmbed:async(b,v)=>{await c();const{note:_,subpath:P}=C0(b),L=(await x()).pages.filter(z).sort(),F=_?Li(_,L,v):v&&L.includes(v)?v:null;if(F){let J=null;try{J=(await Re(F)).content}catch(X){if(!Le(X))throw X}if(J!=null){if(!P)return{owner:F,content:$a(J),type:"markdown"};const X=rd(J,P.trim().replace(/\.block$/i,"").toLowerCase())??$0($a(J),P);return X==null?null:{owner:F,content:X,type:"markdown"}}}const U=P?`${_}#${P}`:_;return U?await r.get(`/amadeus/vaults/${encodeURIComponent(l())}/embed`,{target:U})??null:null},blockBacklinks:async b=>(await c(),r.get(`/amadeus/vaults/${encodeURIComponent(l())}/block-backlinks`,{target:b})),deletePage:b=>M([b],async()=>{await c(),await r.del(en(),{path:b}),O(b),ae()}),movePage:(b,v)=>{let _=null;return M([b],async()=>{await c();const P=ml(b),L=v.replace(/\\/g,"/").replace(/^\/+|\/+$/g,""),F=L?`${L}/${P}`:P;if(F===b)return b;F.endsWith(".md")&&(_=(await x(!0)).pages.filter(z));let U;try{U=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:b,to:F})}catch(V){throw Ie(V)?new Error(re("amxbridge.fileExistsAtTarget")):V}return k(b,F,U.seq),ae(),F.endsWith(".md")&&gt(F),F}).then(async P=>(P!==b&&_&&await Dn({[b]:P},_),P))},createFolder:async(b,v)=>{await c();const _=v.trim().replace(/[\\/]/g,"");if(!_)throw new Error(re("amxbridge.folderNameEmpty"));const P=b.replace(/\\/g,"/").replace(/^\/+|\/+$/g,"");try{const L=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders`,{parent:P,name:_});return ae(),L.path}catch(L){throw Ie(L)?new Error(re("amxbridge.folderExists")):L}},renameFolder:async(b,v)=>{await c();const _=v.trim().replace(/[\\/]/g,"");if(!_)throw new Error(re("amxbridge.folderNameEmpty"));const P=xt(b);if((P?`${P}/${_}`:_)===b)return b;const F=(await x(!0)).pages.filter(z);let U;try{U=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders/rename`,{path:b,newName:_})}catch(V){throw Ie(V)?new Error(re("amxbridge.folderExists")):V}return ce(b,U.path),et&&et.startsWith(`${b}/`)&&gt(`${U.path}${et.slice(b.length)}`),ae(),await Dn(vo(F,b,U.path),F),U.path},deleteFolder:async b=>{await c(),await r.del(`/amadeus/vaults/${encodeURIComponent(l())}/folders`,{path:b}),ne(b),ae()},moveFolder:async(b,v)=>{await c();const _=b.replace(/\\/g,"/").replace(/^\/+|\/+$/g,""),P=tt(_);if(!P)throw new Error(re("amxbridge.folderPathEmpty"));const L=v.replace(/\\/g,"/").replace(/^\/+|\/+$/g,"");if((L?`${L}/${P}`:P)===_)return _;if(L===_||L.startsWith(`${_}/`))throw new Error(re("amxbridge.moveIntoSelf"));const U=(await x(!0)).pages.filter(z);let V;try{V=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders/move`,{path:_,dest:L})}catch(J){throw Ie(J)?new Error(re("amxbridge.folderExistsAtTarget")):J}return ce(_,V.path),et&&et.startsWith(`${_}/`)&&gt(`${V.path}${et.slice(_.length)}`),ae(),await Dn(vo(U,_,V.path),U),V.path},trashEntry:async b=>{await c();const v=b.replace(/\\/g,"/").replace(/^\/+|\/+$/g,"");if(!v||v===Ce||v.startsWith(`${Ce}/`))throw new Error(re("amxbridge.invalidPath"));const _=await x(!0),P=_.folders.includes(v),L=Date.now().toString(36);if(P){let F=v,U=tt(v);if(_.folders.includes(`${Ce}/${U}`)){const V=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders/rename`,{path:v,newName:`${U} (${L})`});F=V.path,U=tt(V.path)}await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders/move`,{path:F,dest:Ce}),ne(v),await ut(V=>{V[U]={original:v,deletedAt:Date.now(),dir:!0}})}else{let F=v.replace(/\//g,"__");g(_).includes(`${Ce}/${F}`)&&(F=`${L}-${F}`),await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:v,to:`${Ce}/${F}`}),O(v),await ut(U=>{U[F]={original:v,deletedAt:Date.now(),dir:!1}})}ae()},listTrash:async()=>{await c();const{meta:b}=await $e(),v=await x(),_=new Set;for(const P of[...g(v),...v.folders])P.startsWith(`${Ce}/`)&&_.add(P.slice(Ce.length+1).split("/")[0]);return Object.entries(b).filter(([P])=>_.has(P)).map(([P,L])=>({name:P,original:L.original,deletedAt:L.deletedAt,dir:L.dir})).sort((P,L)=>L.deletedAt-P.deletedAt)},restoreTrash:async b=>{await c();const{meta:v}=await $e(),_=v[b];if(!_)throw new Error(re("amxbridge.trashMissing"));const P=await x(!0),L=U=>g(P).includes(U)||P.folders.includes(U);let F=_.original;for(let U=2;L(F);U++)if(_.dir)F=`${_.original} (${U})`;else{const V=Pr(_.original);F=`${_.original.slice(0,_.original.length-V.length)} (${U})${V}`}if(_.dir){let U=`${Ce}/${b}`;const V=tt(F);tt(U)!==V&&(U=(await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders/rename`,{path:U,newName:V})).path),await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders/move`,{path:U,dest:xt(F)})}else await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:`${Ce}/${b}`,to:F});return await ut(U=>{delete U[b]}),ae(),F},deleteTrashEntry:async b=>{await c();const{meta:v}=await $e();v[b]?.dir?await r.del(`/amadeus/vaults/${encodeURIComponent(l())}/folders`,{path:`${Ce}/${b}`}).catch(_=>{if(!Le(_))throw _}):await r.del(en(),{path:`${Ce}/${b}`}).catch(_=>{if(!Le(_))throw _}),await ut(_=>{delete _[b]}),ae()},emptyTrash:async()=>{await c(),await r.del(`/amadeus/vaults/${encodeURIComponent(l())}/folders`,{path:Ce}).catch(b=>{if(!Le(b))throw b}),ne(Ce),ae()},saveVaultBytes:async(b,v)=>{await c();const _=Ti(b.replace(/\\/g,"/"));if(!_)throw new Error(re("amxbridge.pathOutsideVault"));await Ye(_,tt(_),v,!1)},readVaultBytes:async b=>{const v=await c(),_=await(e.request??fetch)(`${e.apiBase}/amadeus/vaults/${encodeURIComponent(v)}/asset?path=${encodeURIComponent(b)}`,{headers:{Authorization:`Bearer ${e.getToken()}`}});if(!_.ok)throw new Error(re("amxbridge.readFailed",{status:_.status}));return new Uint8Array(await _.arrayBuffer())},fetchLinkMeta:async b=>{try{return await r.get("/amadeus/link-meta",{url:b})}catch{return null}},searchImages:async b=>{const v=b.trim();if(!v)return[];const _=await fetch(`https://api.openverse.org/v1/images/?q=${encodeURIComponent(v)}&page_size=20`,{headers:{accept:"application/json"}});if(!_.ok)throw new Error(`openverse HTTP ${_.status}`);return((await _.json()).results??[]).map(L=>({thumb:L.thumbnail??"",full:L.url??"",author:L.creator})).filter(L=>L.thumb&&L.full)},listPlugins:async()=>[],openPluginsFolder:async()=>{St(re("amxbridge.desktopOnly"))},scaffoldSamplePlugin:async()=>{St(re("amxbridge.desktopOnly"))},revealInFileManager:async()=>{St(re("amxbridge.desktopOnly"))},hostCaps:{revealInFileManager:!1},readDatabase:async(b,v)=>{await c();const _=await ct(b,v);if(!_)return{status:"missing"};let P;try{P=await Re(_)}catch(F){if(Le(F))return{status:"missing"};if(F instanceof Je&&F.status===400)return{status:"corrupt",path:_,message:re("amxbridge.notText")};throw F}const L=iu(P.content);return L.ok?{status:"ok",path:_,data:L.data}:{status:"corrupt",path:_,message:L.error}},writeDatabase:(b,v)=>M([b],async()=>{await c();const _=nu.parse(v),P=MS(_),L=await j(b);try{await N(b,P,L)}catch(F){if(Ie(F)){try{await Re(b)}catch{}setTimeout(()=>Oe(b),0);return}throw F}}),readDrawing:async(b,v)=>{await c();const _=await ct(b,v)??await ct(b,`${v}.md`);if(!_)return{status:"missing"};for(const P of _.endsWith(".md")?[_]:[_,`${_}.md`])try{const L=await Re(P);return{status:"ok",path:P,source:L.content}}catch(L){if(!Le(L))throw L}return{status:"missing"}},writeDrawing:(b,v)=>M([b],async()=>{await c();const _=await j(b);try{await N(b,v,_)}catch(P){if(!Ie(P))throw P;try{const F=await Re(b),U=Na(v),V=Na(F.content),J=U?JSON.parse(U.sceneJson):null,X=V?JSON.parse(V.sceneJson):null;if(J&&X){const De=BS(F.content,JSON.stringify(ZS(J,X)));if(De){await N(b,De,F.seq);return}}}catch{}const L=P.body;L&&typeof L.seq=="number"&&I(b,L.seq),await N(b,v,f.get(b)??0,!0)}}),readTextFile:async b=>{await c();try{return(await Re(b)).content}catch(v){if(Le(v))return null;throw v}},writeTextFile:(b,v,_)=>{const P=R(b),L=typeof _?.base=="string"?_.base:null,F=()=>L!=null?{ok:!0}:void 0;return M(P,async()=>{if(await c(),_?.create){try{return await N(b,v,0),w.delete(b),ae(),{ok:!0}}catch(X){if(!Ie(X))throw X}try{return{ok:!1,current:(await Re(b)).content}}catch(X){if(Le(X))return{ok:!1,current:null};throw X}}const U=v.trim().length>0;let V,J;try{({target:V,base:J}=await T(b))}catch(X){if(X instanceof S)return await te(b,v,U),F();throw X}if(L!=null){const X=L;return B(P,V,async()=>{const De=async()=>{let _e;try{_e=await Re(V)}catch(It){if(Le(It))return"vanished";throw It}return Wn(_e.content)===X?_e.seq:{ok:!1,current:_e.content}};if(J>0&&h(V,J)!==X){const _e=await De();if(_e==="vanished")return await te(b,v,U),F();if(typeof _e!="number")return _e;J=_e}for(let _e=0;;_e++)try{return await N(V,v,J),{ok:!0}}catch(It){if(!Ie(It))throw It;const tn=await De();if(tn==="vanished")return await te(b,v,U),F();if(typeof tn!="number")return tn;if(_e>=2)throw It;J=tn}})}await B(P,V,async()=>{try{await N(V,v,J)}catch(X){if(!Ie(X))throw X;let De;try{De=await Re(V)}catch(_e){if(Le(_e)){await te(b,v,U);return}throw _e}await N(V,v,De.seq,!0)}})})},listPageProps:async b=>(await c(),(await r.get(`/amadeus/vaults/${encodeURIComponent(l())}/page-props`,{folder:b})).map(_=>({path:_.path,title:_.title,fm:Va(_.fmExtra||"")}))),pageIcons:async()=>{await c();const b=await x();if(di&&di.seq===b.seq)return di.icons;const v=await r.get(`/amadeus/vaults/${encodeURIComponent(l())}/page-props`,{folder:"",all:"1"}),_={};for(const P of v){const L=Va(P.fmExtra||"").icon;typeof L=="string"&&L&&(_[P.path]=L)}return di={seq:b.seq,icons:_},_},setPageFrontmatter:(b,v)=>M([b],async()=>{await c();const _=async()=>{let P;try{P=await Re(b)}catch(F){if(Le(F))return"ok";throw F}const L=r0(P.content,v);if(L===P.content)return"ok";try{return await N(b,L,P.seq),"ok"}catch(F){if(Ie(F))return"conflict";throw F}};if(await _()==="conflict")try{await _()}catch{}}),renamePageFile:(b,v)=>{let _=null;return M([b,Pi(b,v,re("amxbridge.noteNameEmpty"))],async()=>{await c();const P=Pi(b,v,re("amxbridge.noteNameEmpty"));if(P===b)return b;_=(await x(!0)).pages.filter(z);let L;try{L=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:b,to:P})}catch(F){throw Ie(F)?new Error(re("amxbridge.noteExists")):F}return k(b,P,L.seq),ae(),P}).then(async P=>(P!==b&&_&&await Dn({[b]:P},_),P))},renameDbFile:(b,v)=>M([b],async()=>{await c();const _=b.replace(/\\/g,"/");let P=v.trim().replace(/[\\/]/g,"");if(P.toLowerCase().endsWith(".db")&&(P=P.slice(0,-3)),!P)throw new Error(re("amxbridge.nameEmpty"));const L=xt(_),F=L?`${L}/${P}.db`:`${P}.db`;if(F===_)return{newPath:F,rewrittenPages:[]};let U;try{U=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:_,to:F})}catch(V){throw Ie(V)?new Error(re("amxbridge.fileExists")):V}return k(_,F,U.seq),ae(),{newPath:F,rewrittenPages:[]}})})}function Pi(e,t,n){const i=xt(e);let s=t.trim().replace(/[\\/]/g,"");if(!s)throw new Error(n);return s.toLowerCase().endsWith(".md")&&(s=s.slice(0,-3)),i?`${i}/${s}.md`:`${s}.md`}const i_=async e=>{if(!e.ok){let t=null;try{t=await e.json()}catch{}const n=new Error(t?.detail||`http ${e.status}`);throw n.status=e.status,n.code=t?.code,n}return e.json()};function s_(e){const t=Oi(wd),n=e.getToken(),i=Jn(e.apiBase,n),s=()=>{const h=e.getToken();if(e.signal?.aborted||!h||(i?Jn(e.apiBase,h)!==i:h!==n))throw new Error("Cloud account changed");return h},r=async(h,y,w)=>{const C=s(),S=new AbortController,I=()=>S.abort(e.signal?.reason);e.signal?.addEventListener("abort",I,{once:!0});const O=setTimeout(()=>S.abort(),2e4);try{const k=await i_(await(e.request??fetch)(`${e.apiBase}/amadeus${y}`,{method:h,headers:{Authorization:`Bearer ${C}`,...w!==void 0?{"Content-Type":"application/json"}:{}},body:w!==void 0?JSON.stringify(w):void 0,signal:S.signal}));return s(),k}finally{clearTimeout(O),e.signal?.removeEventListener("abort",I)}},o=()=>t_();let a=e.linkBase?.replace(/\/+$/,"")||null;const l=async()=>{if(a)return a;try{a=((await r("GET","/collab/link-base")).webOrigin??"").trim().replace(/\/+$/,"")||location.origin}catch{a=location.origin}return a},c=()=>a??location.origin;e.signal?.aborted||l();const d=()=>{if(s(),e.getUserId)return e.getUserId();try{const h=e.getToken().split(".")[1],y=JSON.parse(atob(h.replace(/-/g,"+").replace(/_/g,"/")));return typeof y.userId=="string"?y.userId:null}catch{return null}};let u=null,p=null;const f=()=>{u&&(clearInterval(u),u=null)};e.signal?.addEventListener("abort",f,{once:!0});const m=()=>{e.signal?.aborted||o().then(h=>r("POST",`/vaults/${encodeURIComponent(h)}/presence`,{page:p})).catch(()=>{})};window.amadeusCollab={listVaults:()=>r("GET","/vaults").then(h=>h.vaults),activeVaultId:o,switchVault(h){s();try{localStorage.setItem(t,h)}catch{}location.reload()},pageShare:async h=>r("GET",`/vaults/${encodeURIComponent(await o())}/page-shares?path=${encodeURIComponent(h)}`),createPageShare:async(h,y)=>r("POST",`/vaults/${encodeURIComponent(await o())}/page-shares`,{path:h,...y}),updatePageShare:async(h,y)=>r("PATCH",`/vaults/${encodeURIComponent(await o())}/page-shares/${encodeURIComponent(h)}`,y),revokePageShare:async h=>{await r("DELETE",`/vaults/${encodeURIComponent(await o())}/page-shares/${encodeURIComponent(h)}`)},setParticipantRole:async(h,y,w)=>{await r("PATCH",`/vaults/${encodeURIComponent(await o())}/page-shares/${encodeURIComponent(h)}/members/${encodeURIComponent(y)}`,{role:w})},removeParticipant:async(h,y)=>{await r("DELETE",`/vaults/${encodeURIComponent(await o())}/page-shares/${encodeURIComponent(h)}/members/${encodeURIComponent(y)}`)},sharedWithMe:()=>r("GET","/shared-with-me").then(h=>h.items),leaveShare:async h=>{const y=d();y&&await r("DELETE",`/vaults/${encodeURIComponent(await o())}/page-shares/${encodeURIComponent(h)}/members/${encodeURIComponent(y)}`)},inviteUrl:h=>`${c()}/invite/${h}`,publishes:async()=>r("GET",`/vaults/${encodeURIComponent(await o())}/shares`),createPublish:async(h,y)=>{const w=await r("POST",`/vaults/${encodeURIComponent(await o())}/shares`,{mode:h,path:y});return{...w,url:`${c()}/share/${w.token}`}},revokePublish:async h=>{await r("DELETE",`/vaults/${encodeURIComponent(await o())}/shares/${encodeURIComponent(h)}`)},publishUrl:h=>`${c()}/share/${h}`,revokePublishIn:async(h,y)=>{await r("DELETE",`/vaults/${encodeURIComponent(h)}/shares/${encodeURIComponent(y)}`)},revokePageShareIn:async(h,y)=>{await r("DELETE",`/vaults/${encodeURIComponent(h)}/page-shares/${encodeURIComponent(y)}`)},listAllShares:async()=>{const h=(await r("GET","/vaults")).vaults||[],y=d(),w=[],C=[];for(const S of h){try{const I=await r("GET",`/vaults/${encodeURIComponent(S.id)}/shares`);for(const O of I.shares||[])w.push({...O,vaultId:S.id,vaultName:S.name||""})}catch{}try{const I=await r("GET",`/vaults/${encodeURIComponent(S.id)}/page-shares`),O=I?.shares||I?.pageShares||(Array.isArray(I)?I:[]);for(const k of O){const T=k.created_by??k.createdBy;(!y||!T||T===y)&&C.push({...k,vaultId:S.id,vaultName:S.name||""})}}catch{}}return{publishes:w,pageShares:C,linkBase:await l()}},heartbeat(h){s(),p=h,m(),u||(u=setInterval(m,3e4))},stopHeartbeat:f,onPresence:h=>Y1(h),myUserId:d}}yo({"unit.bootError.title":{zh:"暂时无法打开此 Unit",en:"Unable to open this Unit"},"unit.bootError.detail":{zh:"请检查连接后重试。",en:"Check your connection and try again."},"unit.bootError.retry":{zh:"重试",en:"Try again"}});function kd(){const e=document.getElementById("root")??document.body.appendChild(document.createElement("main")),t=document.createElement("section");t.setAttribute("role","alert");const n=document.documentElement.dataset.mode==="dark";t.style.cssText='max-width:440px;margin:15vh auto;padding:24px;font:15px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif',t.style.color=`var(--text,${n?"#f2efe8":"#1c1c1c"})`,t.style.colorScheme=n?"dark":"light";const i=document.createElement("h1");i.textContent=re("unit.bootError.title"),i.style.cssText="font-size:20px;font-weight:600;margin:0 0 8px";const s=document.createElement("p");s.textContent=re("unit.bootError.detail"),s.style.cssText="margin:0 0 20px;color:var(--text-muted,inherit)";const r=document.createElement("button");r.type="button",r.textContent=re("unit.bootError.retry"),r.style.cssText="font:inherit;padding:7px 16px;cursor:pointer",r.addEventListener("click",()=>location.reload()),t.append(i,s,r),e.replaceChildren(t),r.focus()}function r_(e,t){if(e.origin!==t.origin||!e.pathname.startsWith(t.pathname))return null;const n=/^(share|invite)\/([^/]+)\/?$/.exec(e.pathname.slice(t.pathname.length));return n?{kind:n[1],token:decodeURIComponent(n[2])}:null}const ll=()=>pt(async()=>{const{useApp:e}=await import("./appStore-Dg9WALEA.js").then(t=>t.qR);return{useApp:e}},__vite__mapDeps([0,1,2,3,4]),import.meta.url).then(({useApp:e})=>{e_((t,n)=>e.getState().toast(t,n))});async function o_(){const e=location.pathname;if(window.__FORSION_UNIT_PAGE__){const t=window.__FORSION_UNIT_PAGE__,n=new URL(".",document.baseURI),i=r_(new URL(location.href),n);if(i&&t.capabilities?.amadeus){const s=new URL(t.capabilities.amadeus.apiBase,location.origin).href.replace(/\/+$/,"");if(i.kind==="share"){const{mountSharePage:r}=await pt(async()=>{const{mountSharePage:o}=await import("./sharePage-MM6UpPJ9.js");return{mountSharePage:o}},[],import.meta.url);r(i.token,{apiBase:s})}else{if(!t.account)throw new Error("Invitations require an account provider");const{installUnitAccount:r}=await pt(async()=>{const{installUnitAccount:l}=await import("./unitAccount-D8lVwaaT.js");return{installUnitAccount:l}},[],import.meta.url),o=await r({instanceId:t.instanceId,account:t.account},n);if(!o.account.getIdentity()){await o.login();return}const{mountInvitePage:a}=await pt(async()=>{const{mountInvitePage:l}=await import("./invitePage-lLQ-e0pj.js");return{mountInvitePage:l}},__vite__mapDeps([5,3]),import.meta.url);a(i.token,{apiBase:s,getToken:o.account.getToken,request:o.capability.request,appBase:n.href})}return}pt(()=>import("./unitShim-DxetRgmP.js"),[],import.meta.url).then(async s=>{if(!await s.installUnitShim())return;let r=!1;try{r=(new URLSearchParams(location.search).get("ui")||localStorage.getItem("lcl.uiMode"))==="mobile"}catch{}await(r?pt(()=>import("./mobileEntry-Bd_nKr0D.js"),__vite__mapDeps([6,3,0,1,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86]),import.meta.url):pt(()=>import("./main-Dki8NlsT.js"),__vite__mapDeps([87,3,0,1,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,88]),import.meta.url)),t.capabilities?.amadeus&&await ll()}).catch(s=>{console.error("[unit-page] bootstrap failed:",s),kd()})}else if(e.startsWith("/share/"))pt(()=>import("./sharePage-MM6UpPJ9.js"),[],import.meta.url).then(t=>t.mountSharePage(decodeURIComponent(e.slice(7)).replace(/\/+$/,""))).catch(t=>console.error("[tangu-web] share page failed:",t));else if(e.startsWith("/invite/"))await Pd()&&pt(()=>import("./invitePage-lLQ-e0pj.js"),__vite__mapDeps([5,3]),import.meta.url).then(t=>t.mountInvitePage(decodeURIComponent(e.slice(8)).replace(/\/+$/,""))).catch(t=>console.error("[tangu-web] invite page failed:",t));else if(await Od()){window.amadeus=n_({apiBase:Sn(),getToken:_o,onAuthError:fl}),s_({apiBase:Sn(),getToken:_o});let t=!1;try{t=(new URLSearchParams(location.search).get("ui")||localStorage.getItem("lcl.uiMode"))==="mobile"}catch{}(t?pt(()=>import("./mobileEntry-Bd_nKr0D.js"),__vite__mapDeps([6,3,0,1,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86]),import.meta.url):pt(()=>import("./main-Dki8NlsT.js"),__vite__mapDeps([87,3,0,1,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,88]),import.meta.url)).then(ll).catch(n=>console.error("[tangu-web] bootstrap failed:",n))}}o_().catch(e=>{console.error("[tangu-web] Account bootstrap failed:",e),window.__FORSION_UNIT_PAGE__&&kd()});export{e1 as $,rn as A,p1 as B,dC as C,E_ as D,B1 as E,U1 as F,k1 as G,j1 as H,T_ as I,pC as J,Ad as K,fC as L,aC as M,Wn as N,tC as O,Kl as P,rw as Q,Q_ as R,nC as S,X_ as T,Dc as U,b0 as V,zc as W,Ve as X,u1 as Y,t1 as Z,pt as _,_o as a,Rd as a$,X0 as a0,Q0 as a1,J0 as a2,lC as a3,ci as a4,fd as a5,_r as a6,jd as a7,Md as a8,qi as a9,m0 as aA,V1 as aB,pl as aC,hr as aD,S1 as aE,H1 as aF,O1 as aG,$d as aH,x_ as aI,__ as aJ,N_ as aK,Bs as aL,F_ as aM,zS as aN,Fi as aO,Na as aP,ZS as aQ,BS as aR,K_ as aS,M1 as aT,z1 as aU,pk as aV,uC as aW,Xr as aX,jc as aY,rS as aZ,Bc as a_,zd as aa,hl as ab,C1 as ac,I1 as ad,R_ as ae,_1 as af,q_ as ag,td as ah,d0 as ai,S_ as aj,L_ as ak,w1 as al,D1 as am,Z1 as an,F1 as ao,L1 as ap,R1 as aq,$1 as ar,S0 as as,W_ as at,n0 as au,Fn as av,I_ as aw,P_ as ax,w0 as ay,W1 as az,Oi as b,C_ as b$,Co as b0,Bd as b1,Va as b2,q1 as b3,Ri as b4,ds as b5,je as b6,Wt as b7,Ne as b8,Z as b9,Y0 as bA,D_ as bB,z_ as bC,Gr as bD,Ia as bE,r0 as bF,Zu as bG,Yr as bH,N1 as bI,$_ as bJ,Ku as bK,s0 as bL,y_ as bM,U0 as bN,A1 as bO,f0 as bP,ri as bQ,_0 as bR,G_ as bS,C0 as bT,w_ as bU,k_ as bV,IS as bW,v1 as bX,P1 as bY,b_ as bZ,MS as b_,Wl as ba,iu as bb,l_ as bc,Ke as bd,Aw as be,Qg as bf,c_ as bg,ge as bh,it as bi,ls as bj,Qe as bk,dw as bl,le as bm,G as bn,cs as bo,hc as bp,_w as bq,Pa as br,H_ as bs,V_ as bt,Z_ as bu,x0 as bv,rC as bw,s1 as bx,r1 as by,i1 as bz,Td as c,x1 as c0,A_ as c1,p0 as c2,Vr as c3,Cn as c4,_S as c5,u_ as c6,g_ as c7,$a as c8,d_ as c9,kS as ca,wS as cb,h_ as cc,p_ as cd,v_ as ce,Di as cf,m_ as cg,f_ as ch,T1 as ci,j_ as cj,Fd as ck,gl as cl,Dg as cm,U_ as cn,J_ as co,VS as cp,O_ as cq,Id as cr,n_ as cs,s_ as ct,hd as cu,Qc as cv,a_ as cw,mC as cx,nt as d,wd as e,ad as f,Sn as g,c1 as h,Y_ as i,ks as j,os as k,vS as l,Li as m,fn as n,M_ as o,B_ as p,TS as q,yo as r,Cd as s,re as t,hC as u,oC as v,cC as w,iC as x,eC as y,sC as z};
298
+ `,P.seq,!0)}};let dt=0,di=null;const ko=async()=>{const b=T();if(b){await Xt(),(async()=>{for(let V=0;;V++){if(e.signal?.aborted)return;try{const J=await c();await x(!0),ui(J),Ge();return}catch{if(e.signal?.aborted)return;if(V>=2){St(re("amxbridge.connectFailed"),!0);return}await new Promise(J=>{const X=()=>{clearTimeout(De),e.signal?.removeEventListener("abort",X),J()},De=setTimeout(X,[3e3,1e4][V]);e.signal?.addEventListener("abort",X,{once:!0}),e.signal?.aborted&&X()})}}})();let F;try{F=localStorage.getItem(Jt(b.v))||void 0}catch{}const U=b.tree.pages.filter(z);return{root:`cloud://${b.v}`,pages:U,folders:b.tree.folders.filter(z),lastPage:F&&U.includes(F)?F:void 0}}const v=await c(),[_]=await Promise.all([x(!0),Xt()]);ui(v);const P=Ss(),L=_.pages.filter(z);return{root:`cloud://${v}`,pages:L,folders:_.folders.filter(z),lastPage:P&&L.includes(P)?P:void 0}},vd=(b,v,_)=>M([b],async()=>{await c();for(let P=0;P<3;P++){let L;try{L=await Re(b)}catch(F){if(Le(F))return"gone";throw F}if(Wn(L.content)!==_)return{ok:!1,current:L.content};try{return await N(b,v,L.seq),{ok:!0}}catch(F){if(!Ie(F))throw F}}throw new Error("conflict")}),Dn=async(b,v)=>{const _=await H0({read:async P=>{try{return(await Re(P)).content}catch(L){if(Le(L))return null;throw L}},write:vd},b,v);for(const P of _.rewritten)ye(P);m1(_.failed.map(P=>P.path))},vo=(b,v,_)=>{const P=`${v}/`,L={};for(const F of b)F.startsWith(P)&&(L[F]=`${_}/${F.slice(P.length)}`);return L};return W0({openVault:()=>ko(),restoreVault:()=>ko(),listPages:async()=>(await x()).pages.filter(z),listFiles:async()=>(await x()).files.map(b=>b.path).filter(z),listFolders:async()=>(await x()).folders.filter(z),loadPage:async b=>{await c();const v=u.get(b);if(v)return gt(b),oe(b),v;const _=await qe(b);return gt(b),_},readPage:async b=>{await c();try{return await Q(b)}catch(v){throw Le(v)?new Error(`note not found: ${b}`):v}},newPage:async b=>{await c();const v=await M([b],()=>fe(b));return gt(b),v},savePage:(b,v,_)=>{const P=R(b);return M(P,async()=>{await c();const L=pr(v,_),F=Object.values(_).some(J=>typeof J=="string"&&J.trim().length>0);let U,V;try{({target:U,base:V}=await E(b))}catch(J){if(J instanceof S){await te(b,L,F);return}throw J}await B(P,U,async()=>{try{await N(U,L,V),h(U,Ri(U,L,Ii()))}catch(J){if(Ie(J)){const X=J.body;if(X?.code==="CONFLICT"&&X.seq===0){f.delete(U),await te(b,L,F);return}X&&typeof X.seq=="number"&&I(U,X.seq),u.delete(b),St(re("amxbridge.conflictReloaded"),!0),setTimeout(()=>ye(b),0);return}throw J instanceof Je&&J.status===413&&St(re("amxbridge.tooLarge"),!0),J}})})},renamePage:(b,v,_,P)=>{let L=null;return M([b,Pi(b,v,re("amxbridge.pageNameEmpty"))],async()=>{await c();const F=Pi(b,v,re("amxbridge.pageNameEmpty"));if(F===b)return{newPath:b,page:await Q(b)};const U=await x(!0);if(L=U.pages.filter(z),g(U).includes(F)||U.folders.includes(F))throw new Error(re("amxbridge.pageExists"));const V=pr(_,P);await N(b,V,await j(b),!0);let J;try{J=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:b,to:F})}catch(X){throw Ie(X)?new Error(re("amxbridge.pageExists")):X}return k(b,F,J.seq),ae(),gt(F),{newPath:F,page:null}}).then(async F=>F.page?{newPath:F.newPath,page:F.page}:(L&&await Dn({[b]:F.newPath},L),{newPath:F.newPath,page:await Q(F.newPath)}))},reconcilePage:async b=>(await c(),qe(b)),saveAsset:async(b,v,_,P)=>{await c();const L=Pr(v),F=(L||".png").toLowerCase().replace(/[^.a-z0-9]/g,""),U=tt(v).slice(0,tt(v).length-L.length).replace(/[^a-zA-Z0-9_-]/g,"").slice(0,24)||"img";for(let V=0;V<5;V++){const J=`${U}-${Date.now().toString(36)}-${(dt++).toString(36)}${F||".png"}`,X=Ei(Fi(xt(b),`.amadeus/${J}`));if(X===null)throw new Error("Asset escapes vault");try{return await Ye(X,J,_,!0,P),`.amadeus/${J}`}catch(De){if(Ie(De))continue;throw De}}throw new Error(re("amxbridge.imageNameFailed"))},saveAttachment:async(b,v,_,P,L)=>{await c();const F=(tt(v)||"file").replace(/[\\/]/g,""),{destDirRel:U}=ol(b,F,P),V=await x(!0),J=new Set(g(V).filter(_e=>xt(_e)===U).map(_e=>tt(_e).toLowerCase()));let X=al(J,F);const De=/\.(db|md)$/i.test(F);for(let _e=0;_e<20;_e++){const{fileVaultRel:It,pageRel:tn}=ol(b,X,P),xs=Ei(It);if(xs===null)throw new Error("Asset escapes vault");try{return De?await N(xs,new TextDecoder().decode(_),0):await Ye(xs,X,_,!0,L),{pageRel:tn,base:X}}catch(So){if(Ie(So)){J.add(X.toLowerCase()),X=al(J,F);continue}throw So}}throw new Error(re("amxbridge.attachmentNameFailed"))},openAttachment:async(b,v)=>{await c(),window.open(Ir(sl(v),b),"_blank","noopener")},openVaultFile:async b=>{await c(),window.open(Ir(b,null),"_blank","noopener")},exportPdf:async()=>(window.print(),null),onExternalChange:b=>(Y.add(b),()=>{Y.delete(b)}),onStructureChange:b=>(ue.add(b),()=>{ue.delete(b)}),onDbExternalChange:b=>(de.add(b),()=>{de.delete(b)}),onPathGone:b=>(Fe.add(b),()=>{Fe.delete(b)}),search:async b=>(await c(),(await r.get(`/amadeus/vaults/${encodeURIComponent(l())}/search`,{q:b})).filter(_=>z(_.path))),backlinks:async b=>(await c(),r.get(`/amadeus/vaults/${encodeURIComponent(l())}/backlinks`,{path:b})),reindex:async()=>{await c(),await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/reindex`)},listTags:async()=>(await c(),r.get(`/amadeus/vaults/${encodeURIComponent(l())}/tags`)),pagesByTag:async b=>(await c(),(await r.get(`/amadeus/vaults/${encodeURIComponent(l())}/tags/pages`,{tag:b})).paths),resolveEmbed:async(b,v)=>{await c();const{note:_,subpath:P}=C0(b),L=(await x()).pages.filter(z).sort(),F=_?Li(_,L,v):v&&L.includes(v)?v:null;if(F){let J=null;try{J=(await Re(F)).content}catch(X){if(!Le(X))throw X}if(J!=null){if(!P)return{owner:F,content:$a(J),type:"markdown"};const X=rd(J,P.trim().replace(/\.block$/i,"").toLowerCase())??$0($a(J),P);return X==null?null:{owner:F,content:X,type:"markdown"}}}const U=P?`${_}#${P}`:_;return U?await r.get(`/amadeus/vaults/${encodeURIComponent(l())}/embed`,{target:U})??null:null},blockBacklinks:async b=>(await c(),r.get(`/amadeus/vaults/${encodeURIComponent(l())}/block-backlinks`,{target:b})),deletePage:b=>M([b],async()=>{await c(),await r.del(en(),{path:b}),O(b),ae()}),movePage:(b,v)=>{let _=null;return M([b],async()=>{await c();const P=ml(b),L=v.replace(/\\/g,"/").replace(/^\/+|\/+$/g,""),F=L?`${L}/${P}`:P;if(F===b)return b;F.endsWith(".md")&&(_=(await x(!0)).pages.filter(z));let U;try{U=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:b,to:F})}catch(V){throw Ie(V)?new Error(re("amxbridge.fileExistsAtTarget")):V}return k(b,F,U.seq),ae(),F.endsWith(".md")&&gt(F),F}).then(async P=>(P!==b&&_&&await Dn({[b]:P},_),P))},createFolder:async(b,v)=>{await c();const _=v.trim().replace(/[\\/]/g,"");if(!_)throw new Error(re("amxbridge.folderNameEmpty"));const P=b.replace(/\\/g,"/").replace(/^\/+|\/+$/g,"");try{const L=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders`,{parent:P,name:_});return ae(),L.path}catch(L){throw Ie(L)?new Error(re("amxbridge.folderExists")):L}},renameFolder:async(b,v)=>{await c();const _=v.trim().replace(/[\\/]/g,"");if(!_)throw new Error(re("amxbridge.folderNameEmpty"));const P=xt(b);if((P?`${P}/${_}`:_)===b)return b;const F=(await x(!0)).pages.filter(z);let U;try{U=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders/rename`,{path:b,newName:_})}catch(V){throw Ie(V)?new Error(re("amxbridge.folderExists")):V}return ce(b,U.path),et&&et.startsWith(`${b}/`)&&gt(`${U.path}${et.slice(b.length)}`),ae(),await Dn(vo(F,b,U.path),F),U.path},deleteFolder:async b=>{await c(),await r.del(`/amadeus/vaults/${encodeURIComponent(l())}/folders`,{path:b}),ne(b),ae()},moveFolder:async(b,v)=>{await c();const _=b.replace(/\\/g,"/").replace(/^\/+|\/+$/g,""),P=tt(_);if(!P)throw new Error(re("amxbridge.folderPathEmpty"));const L=v.replace(/\\/g,"/").replace(/^\/+|\/+$/g,"");if((L?`${L}/${P}`:P)===_)return _;if(L===_||L.startsWith(`${_}/`))throw new Error(re("amxbridge.moveIntoSelf"));const U=(await x(!0)).pages.filter(z);let V;try{V=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders/move`,{path:_,dest:L})}catch(J){throw Ie(J)?new Error(re("amxbridge.folderExistsAtTarget")):J}return ce(_,V.path),et&&et.startsWith(`${_}/`)&&gt(`${V.path}${et.slice(_.length)}`),ae(),await Dn(vo(U,_,V.path),U),V.path},trashEntry:async b=>{await c();const v=b.replace(/\\/g,"/").replace(/^\/+|\/+$/g,"");if(!v||v===Ce||v.startsWith(`${Ce}/`))throw new Error(re("amxbridge.invalidPath"));const _=await x(!0),P=_.folders.includes(v),L=Date.now().toString(36);if(P){let F=v,U=tt(v);if(_.folders.includes(`${Ce}/${U}`)){const V=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders/rename`,{path:v,newName:`${U} (${L})`});F=V.path,U=tt(V.path)}await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders/move`,{path:F,dest:Ce}),ne(v),await ut(V=>{V[U]={original:v,deletedAt:Date.now(),dir:!0}})}else{let F=v.replace(/\//g,"__");g(_).includes(`${Ce}/${F}`)&&(F=`${L}-${F}`),await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:v,to:`${Ce}/${F}`}),O(v),await ut(U=>{U[F]={original:v,deletedAt:Date.now(),dir:!1}})}ae()},listTrash:async()=>{await c();const{meta:b}=await $e(),v=await x(),_=new Set;for(const P of[...g(v),...v.folders])P.startsWith(`${Ce}/`)&&_.add(P.slice(Ce.length+1).split("/")[0]);return Object.entries(b).filter(([P])=>_.has(P)).map(([P,L])=>({name:P,original:L.original,deletedAt:L.deletedAt,dir:L.dir})).sort((P,L)=>L.deletedAt-P.deletedAt)},restoreTrash:async b=>{await c();const{meta:v}=await $e(),_=v[b];if(!_)throw new Error(re("amxbridge.trashMissing"));const P=await x(!0),L=U=>g(P).includes(U)||P.folders.includes(U);let F=_.original;for(let U=2;L(F);U++)if(_.dir)F=`${_.original} (${U})`;else{const V=Pr(_.original);F=`${_.original.slice(0,_.original.length-V.length)} (${U})${V}`}if(_.dir){let U=`${Ce}/${b}`;const V=tt(F);tt(U)!==V&&(U=(await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders/rename`,{path:U,newName:V})).path),await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/folders/move`,{path:U,dest:xt(F)})}else await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:`${Ce}/${b}`,to:F});return await ut(U=>{delete U[b]}),ae(),F},deleteTrashEntry:async b=>{await c();const{meta:v}=await $e();v[b]?.dir?await r.del(`/amadeus/vaults/${encodeURIComponent(l())}/folders`,{path:`${Ce}/${b}`}).catch(_=>{if(!Le(_))throw _}):await r.del(en(),{path:`${Ce}/${b}`}).catch(_=>{if(!Le(_))throw _}),await ut(_=>{delete _[b]}),ae()},emptyTrash:async()=>{await c(),await r.del(`/amadeus/vaults/${encodeURIComponent(l())}/folders`,{path:Ce}).catch(b=>{if(!Le(b))throw b}),ne(Ce),ae()},saveVaultBytes:async(b,v)=>{await c();const _=Ei(b.replace(/\\/g,"/"));if(!_)throw new Error(re("amxbridge.pathOutsideVault"));await Ye(_,tt(_),v,!1)},readVaultBytes:async b=>{const v=await c(),_=await(e.request??fetch)(`${e.apiBase}/amadeus/vaults/${encodeURIComponent(v)}/asset?path=${encodeURIComponent(b)}`,{headers:{Authorization:`Bearer ${e.getToken()}`}});if(!_.ok)throw new Error(re("amxbridge.readFailed",{status:_.status}));return new Uint8Array(await _.arrayBuffer())},fetchLinkMeta:async b=>{try{return await r.get("/amadeus/link-meta",{url:b})}catch{return null}},searchImages:async b=>{const v=b.trim();if(!v)return[];const _=await fetch(`https://api.openverse.org/v1/images/?q=${encodeURIComponent(v)}&page_size=20`,{headers:{accept:"application/json"}});if(!_.ok)throw new Error(`openverse HTTP ${_.status}`);return((await _.json()).results??[]).map(L=>({thumb:L.thumbnail??"",full:L.url??"",author:L.creator})).filter(L=>L.thumb&&L.full)},listPlugins:async()=>[],openPluginsFolder:async()=>{St(re("amxbridge.desktopOnly"))},scaffoldSamplePlugin:async()=>{St(re("amxbridge.desktopOnly"))},revealInFileManager:async()=>{St(re("amxbridge.desktopOnly"))},hostCaps:{revealInFileManager:!1},readDatabase:async(b,v)=>{await c();const _=await ct(b,v);if(!_)return{status:"missing"};let P;try{P=await Re(_)}catch(F){if(Le(F))return{status:"missing"};if(F instanceof Je&&F.status===400)return{status:"corrupt",path:_,message:re("amxbridge.notText")};throw F}const L=iu(P.content);return L.ok?{status:"ok",path:_,data:L.data}:{status:"corrupt",path:_,message:L.error}},writeDatabase:(b,v)=>M([b],async()=>{await c();const _=nu.parse(v),P=MS(_),L=await j(b);try{await N(b,P,L)}catch(F){if(Ie(F)){try{await Re(b)}catch{}setTimeout(()=>Oe(b),0);return}throw F}}),readDrawing:async(b,v)=>{await c();const _=await ct(b,v)??await ct(b,`${v}.md`);if(!_)return{status:"missing"};for(const P of _.endsWith(".md")?[_]:[_,`${_}.md`])try{const L=await Re(P);return{status:"ok",path:P,source:L.content}}catch(L){if(!Le(L))throw L}return{status:"missing"}},writeDrawing:(b,v)=>M([b],async()=>{await c();const _=await j(b);try{await N(b,v,_)}catch(P){if(!Ie(P))throw P;try{const F=await Re(b),U=Na(v),V=Na(F.content),J=U?JSON.parse(U.sceneJson):null,X=V?JSON.parse(V.sceneJson):null;if(J&&X){const De=BS(F.content,JSON.stringify(ZS(J,X)));if(De){await N(b,De,F.seq);return}}}catch{}const L=P.body;L&&typeof L.seq=="number"&&I(b,L.seq),await N(b,v,f.get(b)??0,!0)}}),readTextFile:async b=>{await c();try{return(await Re(b)).content}catch(v){if(Le(v))return null;throw v}},writeTextFile:(b,v,_)=>{const P=R(b),L=typeof _?.base=="string"?_.base:null,F=()=>L!=null?{ok:!0}:void 0;return M(P,async()=>{if(await c(),_?.create){try{return await N(b,v,0),w.delete(b),ae(),{ok:!0}}catch(X){if(!Ie(X))throw X}try{return{ok:!1,current:(await Re(b)).content}}catch(X){if(Le(X))return{ok:!1,current:null};throw X}}const U=v.trim().length>0;let V,J;try{({target:V,base:J}=await E(b))}catch(X){if(X instanceof S)return await te(b,v,U),F();throw X}if(L!=null){const X=L;return B(P,V,async()=>{const De=async()=>{let _e;try{_e=await Re(V)}catch(It){if(Le(It))return"vanished";throw It}return Wn(_e.content)===X?_e.seq:{ok:!1,current:_e.content}};if(J>0&&p(V,J)!==X){const _e=await De();if(_e==="vanished")return await te(b,v,U),F();if(typeof _e!="number")return _e;J=_e}for(let _e=0;;_e++)try{return await N(V,v,J),{ok:!0}}catch(It){if(!Ie(It))throw It;const tn=await De();if(tn==="vanished")return await te(b,v,U),F();if(typeof tn!="number")return tn;if(_e>=2)throw It;J=tn}})}await B(P,V,async()=>{try{await N(V,v,J)}catch(X){if(!Ie(X))throw X;let De;try{De=await Re(V)}catch(_e){if(Le(_e)){await te(b,v,U);return}throw _e}await N(V,v,De.seq,!0)}})})},listPageProps:async b=>(await c(),(await r.get(`/amadeus/vaults/${encodeURIComponent(l())}/page-props`,{folder:b})).map(_=>({path:_.path,title:_.title,fm:Va(_.fmExtra||"")}))),pageIcons:async()=>{await c();const b=await x();if(di&&di.seq===b.seq)return di.icons;const v=await r.get(`/amadeus/vaults/${encodeURIComponent(l())}/page-props`,{folder:"",all:"1"}),_={};for(const P of v){const L=Va(P.fmExtra||"").icon;typeof L=="string"&&L&&(_[P.path]=L)}return di={seq:b.seq,icons:_},_},setPageFrontmatter:(b,v)=>M([b],async()=>{await c();const _=async()=>{let P;try{P=await Re(b)}catch(F){if(Le(F))return"ok";throw F}const L=r0(P.content,v);if(L===P.content)return"ok";try{return await N(b,L,P.seq),"ok"}catch(F){if(Ie(F))return"conflict";throw F}};if(await _()==="conflict")try{await _()}catch{}}),renamePageFile:(b,v)=>{let _=null;return M([b,Pi(b,v,re("amxbridge.noteNameEmpty"))],async()=>{await c();const P=Pi(b,v,re("amxbridge.noteNameEmpty"));if(P===b)return b;_=(await x(!0)).pages.filter(z);let L;try{L=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:b,to:P})}catch(F){throw Ie(F)?new Error(re("amxbridge.noteExists")):F}return k(b,P,L.seq),ae(),P}).then(async P=>(P!==b&&_&&await Dn({[b]:P},_),P))},renameDbFile:(b,v)=>M([b],async()=>{await c();const _=b.replace(/\\/g,"/");let P=v.trim().replace(/[\\/]/g,"");if(P.toLowerCase().endsWith(".db")&&(P=P.slice(0,-3)),!P)throw new Error(re("amxbridge.nameEmpty"));const L=xt(_),F=L?`${L}/${P}.db`:`${P}.db`;if(F===_)return{newPath:F,rewrittenPages:[]};let U;try{U=await r.post(`/amadeus/vaults/${encodeURIComponent(l())}/move`,{from:_,to:F})}catch(V){throw Ie(V)?new Error(re("amxbridge.fileExists")):V}return k(_,F,U.seq),ae(),{newPath:F,rewrittenPages:[]}})})}function Pi(e,t,n){const i=xt(e);let s=t.trim().replace(/[\\/]/g,"");if(!s)throw new Error(n);return s.toLowerCase().endsWith(".md")&&(s=s.slice(0,-3)),i?`${i}/${s}.md`:`${s}.md`}const i_=async e=>{if(!e.ok){let t=null;try{t=await e.json()}catch{}const n=new Error(t?.detail||`http ${e.status}`);throw n.status=e.status,n.code=t?.code,n}return e.json()};function s_(e){const t=Oi(wd),n=e.getToken(),i=Jn(e.apiBase,n),s=()=>{const p=e.getToken();if(e.signal?.aborted||!p||(i?Jn(e.apiBase,p)!==i:p!==n))throw new Error("Cloud account changed");return p},r=async(p,y,w)=>{const C=s(),S=new AbortController,I=()=>S.abort(e.signal?.reason);e.signal?.addEventListener("abort",I,{once:!0});const O=setTimeout(()=>S.abort(),2e4);try{const k=await i_(await(e.request??fetch)(`${e.apiBase}/amadeus${y}`,{method:p,headers:{Authorization:`Bearer ${C}`,...w!==void 0?{"Content-Type":"application/json"}:{}},body:w!==void 0?JSON.stringify(w):void 0,signal:S.signal}));return s(),k}finally{clearTimeout(O),e.signal?.removeEventListener("abort",I)}},o=()=>t_();let a=e.linkBase?.replace(/\/+$/,"")||null;const l=async()=>{if(a)return a;try{a=((await r("GET","/collab/link-base")).webOrigin??"").trim().replace(/\/+$/,"")||location.origin}catch{a=location.origin}return a},c=()=>a??location.origin;e.signal?.aborted||l();const d=()=>{if(s(),e.getUserId)return e.getUserId();try{const p=e.getToken().split(".")[1],y=JSON.parse(atob(p.replace(/-/g,"+").replace(/_/g,"/")));return typeof y.userId=="string"?y.userId:null}catch{return null}};let u=null,h=null;const f=()=>{u&&(clearInterval(u),u=null)};e.signal?.addEventListener("abort",f,{once:!0});const m=()=>{e.signal?.aborted||o().then(p=>r("POST",`/vaults/${encodeURIComponent(p)}/presence`,{page:h})).catch(()=>{})};window.amadeusCollab={listVaults:()=>r("GET","/vaults").then(p=>p.vaults),activeVaultId:o,switchVault(p){s();try{localStorage.setItem(t,p)}catch{}location.reload()},pageShare:async p=>r("GET",`/vaults/${encodeURIComponent(await o())}/page-shares?path=${encodeURIComponent(p)}`),createPageShare:async(p,y)=>r("POST",`/vaults/${encodeURIComponent(await o())}/page-shares`,{path:p,...y}),updatePageShare:async(p,y)=>r("PATCH",`/vaults/${encodeURIComponent(await o())}/page-shares/${encodeURIComponent(p)}`,y),revokePageShare:async p=>{await r("DELETE",`/vaults/${encodeURIComponent(await o())}/page-shares/${encodeURIComponent(p)}`)},setParticipantRole:async(p,y,w)=>{await r("PATCH",`/vaults/${encodeURIComponent(await o())}/page-shares/${encodeURIComponent(p)}/members/${encodeURIComponent(y)}`,{role:w})},removeParticipant:async(p,y)=>{await r("DELETE",`/vaults/${encodeURIComponent(await o())}/page-shares/${encodeURIComponent(p)}/members/${encodeURIComponent(y)}`)},sharedWithMe:()=>r("GET","/shared-with-me").then(p=>p.items),leaveShare:async p=>{const y=d();y&&await r("DELETE",`/vaults/${encodeURIComponent(await o())}/page-shares/${encodeURIComponent(p)}/members/${encodeURIComponent(y)}`)},inviteUrl:p=>`${c()}/invite/${p}`,publishes:async()=>r("GET",`/vaults/${encodeURIComponent(await o())}/shares`),createPublish:async(p,y)=>{const w=await r("POST",`/vaults/${encodeURIComponent(await o())}/shares`,{mode:p,path:y});return{...w,url:`${c()}/share/${w.token}`}},revokePublish:async p=>{await r("DELETE",`/vaults/${encodeURIComponent(await o())}/shares/${encodeURIComponent(p)}`)},publishUrl:p=>`${c()}/share/${p}`,revokePublishIn:async(p,y)=>{await r("DELETE",`/vaults/${encodeURIComponent(p)}/shares/${encodeURIComponent(y)}`)},revokePageShareIn:async(p,y)=>{await r("DELETE",`/vaults/${encodeURIComponent(p)}/page-shares/${encodeURIComponent(y)}`)},listAllShares:async()=>{const p=(await r("GET","/vaults")).vaults||[],y=d(),w=[],C=[];for(const S of p){try{const I=await r("GET",`/vaults/${encodeURIComponent(S.id)}/shares`);for(const O of I.shares||[])w.push({...O,vaultId:S.id,vaultName:S.name||""})}catch{}try{const I=await r("GET",`/vaults/${encodeURIComponent(S.id)}/page-shares`),O=I?.shares||I?.pageShares||(Array.isArray(I)?I:[]);for(const k of O){const E=k.created_by??k.createdBy;(!y||!E||E===y)&&C.push({...k,vaultId:S.id,vaultName:S.name||""})}}catch{}}return{publishes:w,pageShares:C,linkBase:await l()}},heartbeat(p){s(),h=p,m(),u||(u=setInterval(m,3e4))},stopHeartbeat:f,onPresence:p=>Y1(p),myUserId:d}}yo({"unit.bootError.title":{zh:"暂时无法打开此 Unit",en:"Unable to open this Unit"},"unit.bootError.detail":{zh:"请检查连接后重试。",en:"Check your connection and try again."},"unit.bootError.retry":{zh:"重试",en:"Try again"}});function kd(){const e=document.getElementById("root")??document.body.appendChild(document.createElement("main")),t=document.createElement("section");t.setAttribute("role","alert");const n=document.documentElement.dataset.mode==="dark";t.style.cssText='max-width:440px;margin:15vh auto;padding:24px;font:15px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif',t.style.color=`var(--text,${n?"#f2efe8":"#1c1c1c"})`,t.style.colorScheme=n?"dark":"light";const i=document.createElement("h1");i.textContent=re("unit.bootError.title"),i.style.cssText="font-size:20px;font-weight:600;margin:0 0 8px";const s=document.createElement("p");s.textContent=re("unit.bootError.detail"),s.style.cssText="margin:0 0 20px;color:var(--text-muted,inherit)";const r=document.createElement("button");r.type="button",r.textContent=re("unit.bootError.retry"),r.style.cssText="font:inherit;padding:7px 16px;cursor:pointer",r.addEventListener("click",()=>location.reload()),t.append(i,s,r),e.replaceChildren(t),r.focus()}function r_(e,t){if(e.origin!==t.origin||!e.pathname.startsWith(t.pathname))return null;const n=/^(share|invite)\/([^/]+)\/?$/.exec(e.pathname.slice(t.pathname.length));return n?{kind:n[1],token:decodeURIComponent(n[2])}:null}const ll=()=>ht(async()=>{const{useApp:e}=await import("./appStore-DWP8UET9.js").then(t=>t.rJ);return{useApp:e}},__vite__mapDeps([0,1,2,3,4]),import.meta.url).then(({useApp:e})=>{e_((t,n)=>e.getState().toast(t,n))});async function o_(){const e=location.pathname;if(window.__FORSION_UNIT_PAGE__){const t=window.__FORSION_UNIT_PAGE__,n=new URL(".",document.baseURI),i=r_(new URL(location.href),n);if(i&&t.capabilities?.amadeus){const s=new URL(t.capabilities.amadeus.apiBase,location.origin).href.replace(/\/+$/,"");if(i.kind==="share"){const{mountSharePage:r}=await ht(async()=>{const{mountSharePage:o}=await import("./sharePage-XbN50US7.js");return{mountSharePage:o}},[],import.meta.url);r(i.token,{apiBase:s})}else{if(!t.account)throw new Error("Invitations require an account provider");const{installUnitAccount:r}=await ht(async()=>{const{installUnitAccount:l}=await import("./unitAccount-DwutFPPw.js");return{installUnitAccount:l}},[],import.meta.url),o=await r({instanceId:t.instanceId,account:t.account},n);if(!o.account.getIdentity()){await o.login();return}const{mountInvitePage:a}=await ht(async()=>{const{mountInvitePage:l}=await import("./invitePage-b0HGvMj6.js");return{mountInvitePage:l}},__vite__mapDeps([5,3]),import.meta.url);a(i.token,{apiBase:s,getToken:o.account.getToken,request:o.capability.request,appBase:n.href})}return}ht(()=>import("./unitShim-B_M9IrbC.js"),[],import.meta.url).then(async s=>{if(!await s.installUnitShim())return;let r=!1;try{r=(new URLSearchParams(location.search).get("ui")||localStorage.getItem("lcl.uiMode"))==="mobile"}catch{}await(r?ht(()=>import("./mobileEntry-CPmU_c4m.js"),__vite__mapDeps([6,3,7,0,1,2,4,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84]),import.meta.url):ht(()=>import("./main-sIq2N9Z5.js"),__vite__mapDeps([85,3,7,0,1,2,4,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,86]),import.meta.url)),t.capabilities?.amadeus&&await ll()}).catch(s=>{console.error("[unit-page] bootstrap failed:",s),kd()})}else if(e.startsWith("/share/"))ht(()=>import("./sharePage-XbN50US7.js"),[],import.meta.url).then(t=>t.mountSharePage(decodeURIComponent(e.slice(7)).replace(/\/+$/,""))).catch(t=>console.error("[tangu-web] share page failed:",t));else if(e.startsWith("/invite/"))await Pd()&&ht(()=>import("./invitePage-b0HGvMj6.js"),__vite__mapDeps([5,3]),import.meta.url).then(t=>t.mountInvitePage(decodeURIComponent(e.slice(8)).replace(/\/+$/,""))).catch(t=>console.error("[tangu-web] invite page failed:",t));else if(await Od()){window.amadeus=n_({apiBase:Sn(),getToken:_o,onAuthError:fl}),s_({apiBase:Sn(),getToken:_o});let t=!1;try{t=(new URLSearchParams(location.search).get("ui")||localStorage.getItem("lcl.uiMode"))==="mobile"}catch{}(t?ht(()=>import("./mobileEntry-CPmU_c4m.js"),__vite__mapDeps([6,3,7,0,1,2,4,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84]),import.meta.url):ht(()=>import("./main-sIq2N9Z5.js"),__vite__mapDeps([85,3,7,0,1,2,4,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,86]),import.meta.url)).then(ll).catch(n=>console.error("[tangu-web] bootstrap failed:",n))}}o_().catch(e=>{console.error("[tangu-web] Account bootstrap failed:",e),window.__FORSION_UNIT_PAGE__&&kd()});export{t1 as $,rn as A,h1 as B,dC as C,T_ as D,B1 as E,U1 as F,k1 as G,j1 as H,E_ as I,_r as J,hC as K,fC as L,Ad as M,aC as N,Wn as O,tC as P,Kl as Q,Q_ as R,nC as S,X_ as T,rw as U,b0 as V,Dc as W,zc as X,Ve as Y,u1 as Z,ht as _,_o as a,Rd as a$,e1 as a0,X0 as a1,Q0 as a2,J0 as a3,lC as a4,ci as a5,fd as a6,jd as a7,Md as a8,qi as a9,m0 as aA,V1 as aB,hl as aC,pr as aD,S1 as aE,H1 as aF,O1 as aG,$d as aH,x_ as aI,__ as aJ,N_ as aK,Bs as aL,F_ as aM,zS as aN,Fi as aO,Na as aP,ZS as aQ,BS as aR,K_ as aS,M1 as aT,z1 as aU,hk as aV,uC as aW,Xr as aX,jc as aY,rS as aZ,Bc as a_,zd as aa,pl as ab,C1 as ac,I1 as ad,R_ as ae,_1 as af,q_ as ag,td as ah,d0 as ai,S_ as aj,L_ as ak,w1 as al,D1 as am,Z1 as an,F1 as ao,L1 as ap,R1 as aq,$1 as ar,S0 as as,W_ as at,n0 as au,Fn as av,I_ as aw,P_ as ax,w0 as ay,W1 as az,Oi as b,C_ as b$,Co as b0,Bd as b1,Va as b2,q1 as b3,Ri as b4,ds as b5,je as b6,Wt as b7,Ne as b8,Z as b9,Y0 as bA,D_ as bB,z_ as bC,Gr as bD,Ia as bE,r0 as bF,Zu as bG,Yr as bH,N1 as bI,$_ as bJ,Ku as bK,s0 as bL,y_ as bM,U0 as bN,A1 as bO,f0 as bP,ri as bQ,_0 as bR,G_ as bS,C0 as bT,w_ as bU,k_ as bV,IS as bW,v1 as bX,P1 as bY,b_ as bZ,MS as b_,Wl as ba,iu as bb,l_ as bc,Ke as bd,Aw as be,Qg as bf,c_ as bg,ge as bh,it as bi,ls as bj,Qe as bk,dw as bl,le as bm,G as bn,cs as bo,pc as bp,_w as bq,Pa as br,H_ as bs,V_ as bt,Z_ as bu,x0 as bv,rC as bw,s1 as bx,r1 as by,i1 as bz,Ed as c,x1 as c0,A_ as c1,h0 as c2,Vr as c3,Cn as c4,_S as c5,u_ as c6,g_ as c7,$a as c8,d_ as c9,kS as ca,wS as cb,p_ as cc,h_ as cd,v_ as ce,Di as cf,m_ as cg,f_ as ch,E1 as ci,j_ as cj,Fd as ck,gl as cl,Dg as cm,U_ as cn,J_ as co,VS as cp,O_ as cq,Id as cr,n_ as cs,s_ as ct,pd as cu,Qc as cv,a_ as cw,mC as cx,nt as d,wd as e,ad as f,Sn as g,c1 as h,Y_ as i,ks as j,os as k,vS as l,Li as m,fn as n,M_ as o,B_ as p,ES as q,yo as r,Cd as s,re as t,pC as u,oC as v,cC as w,iC as x,eC as y,sC as z};