allyhub 0.20.0 → 0.22.0

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 (323) hide show
  1. package/dist/commands/cloud-tools.js +5 -5
  2. package/dist/commands/export.js +1 -1
  3. package/dist/commands/frames.js +8 -8
  4. package/dist/commands/index.js +1 -1
  5. package/dist/commands/run.js +2 -0
  6. package/dist/commands.json +1 -1
  7. package/dist/help.js +3 -3
  8. package/dist/main.js +4 -4
  9. package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
  10. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  11. package/dist/node_modules/@allyhub/blocks/dist/elements.js +1 -1
  12. package/dist/node_modules/@allyhub/blocks/dist/layout.js +1 -1
  13. package/dist/node_modules/@allyhub/blocks/dist/palette.js +1 -1
  14. package/dist/node_modules/@allyhub/blocks/dist/resolve.js +1 -1
  15. package/dist/node_modules/@allyhub/blocks/package.json +1 -1
  16. package/dist/node_modules/@allyhub/browser/package.json +1 -1
  17. package/dist/node_modules/@allyhub/build/dist/migrate.js +1 -1
  18. package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
  19. package/dist/node_modules/@allyhub/build/dist/project-root.js +1 -1
  20. package/dist/node_modules/@allyhub/build/dist/work.js +3 -3
  21. package/dist/node_modules/@allyhub/build/package.json +1 -1
  22. package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
  23. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  24. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  25. package/dist/node_modules/@allyhub/check/package.json +1 -1
  26. package/dist/node_modules/@allyhub/cloud/dist/call.js +2 -2
  27. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  28. package/dist/node_modules/@allyhub/cloud/package.json +1 -1
  29. package/dist/node_modules/@allyhub/components/package.json +1 -1
  30. package/dist/node_modules/@allyhub/dev-server/dist/index.js +1 -1
  31. package/dist/node_modules/@allyhub/dev-server/dist/record.js +2 -1
  32. package/dist/node_modules/@allyhub/dev-server/dist/validate.js +2 -2
  33. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  34. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  35. package/dist/node_modules/@allyhub/doc/dist/block-shapes.js +2 -0
  36. package/dist/node_modules/@allyhub/doc/dist/blocks.js +1 -1
  37. package/dist/node_modules/@allyhub/doc/dist/docx.js +5 -5
  38. package/dist/node_modules/@allyhub/doc/dist/shapes.js +2 -2
  39. package/dist/node_modules/@allyhub/doc/package.json +1 -1
  40. package/dist/node_modules/@allyhub/doc-extension/dist/cli/import.js +1 -1
  41. package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
  42. package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
  43. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  44. package/dist/node_modules/@allyhub/export/package.json +1 -1
  45. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  46. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  47. package/dist/node_modules/@allyhub/formats/dist/data/deck-code.d.ts +3 -3
  48. package/dist/node_modules/@allyhub/formats/dist/data/page-data.d.ts +9 -1
  49. package/dist/node_modules/@allyhub/formats/dist/data/page-data.js +1 -1
  50. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +151 -151
  51. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +173 -173
  52. package/dist/node_modules/@allyhub/formats/dist/data/work.d.ts +1 -2
  53. package/dist/node_modules/@allyhub/formats/dist/data/work.js +1 -1
  54. package/dist/node_modules/@allyhub/formats/dist/index.d.ts +1 -1
  55. package/dist/node_modules/@allyhub/formats/dist/index.js +1 -1
  56. package/dist/node_modules/@allyhub/formats/dist/layout.d.ts +2 -0
  57. package/dist/node_modules/@allyhub/formats/dist/layout.js +1 -1
  58. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +106 -101
  59. package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
  60. package/dist/node_modules/@allyhub/formats/dist/tolerant.d.ts +26 -1
  61. package/dist/node_modules/@allyhub/formats/dist/tolerant.js +1 -1
  62. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  63. package/dist/node_modules/@allyhub/html-extension/package.json +1 -1
  64. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  65. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  66. package/dist/node_modules/@allyhub/image-extension/package.json +1 -1
  67. package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +1 -1
  68. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  69. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  70. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  71. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  72. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  73. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  74. package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -1
  75. package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
  76. package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
  77. package/dist/node_modules/@allyhub/linkedin-view/src/style.css +1 -1
  78. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  79. package/dist/node_modules/@allyhub/media/package.json +1 -1
  80. package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
  81. package/dist/node_modules/@allyhub/model/package.json +1 -1
  82. package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
  83. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  84. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  85. package/dist/node_modules/@allyhub/project/package.json +1 -1
  86. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  87. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  88. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  89. package/dist/node_modules/@allyhub/render/package.json +1 -1
  90. package/dist/node_modules/@allyhub/report-extension/LICENSE +241 -0
  91. package/dist/node_modules/@allyhub/report-extension/dist/build.js +3 -0
  92. package/dist/node_modules/@allyhub/report-extension/dist/check.js +37 -0
  93. package/dist/node_modules/@allyhub/report-extension/dist/cli/index.js +4 -0
  94. package/dist/node_modules/@allyhub/report-extension/dist/export.js +2 -0
  95. package/dist/node_modules/@allyhub/report-extension/dist/inline.js +58 -0
  96. package/dist/node_modules/@allyhub/report-extension/dist/page.js +23 -0
  97. package/dist/node_modules/@allyhub/report-extension/dist/project-tools.js +33 -0
  98. package/dist/node_modules/@allyhub/report-extension/dist/styles.js +2 -0
  99. package/dist/node_modules/@allyhub/report-extension/dist/theme.js +2 -0
  100. package/dist/node_modules/@allyhub/report-extension/dist/tools.js +2 -0
  101. package/dist/node_modules/@allyhub/report-extension/dist/workspace.js +2 -0
  102. package/dist/node_modules/@allyhub/report-extension/package.json +185 -0
  103. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/STYLE.md +180 -0
  104. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.json +15 -0
  105. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  106. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  107. package/dist/node_modules/@allyhub/scaffold/dist/index.js +8 -8
  108. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  109. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  110. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  111. package/dist/node_modules/@allyhub/sheet/dist/file.js +2 -2
  112. package/dist/node_modules/@allyhub/sheet/dist/html.js +10 -10
  113. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  114. package/dist/node_modules/@allyhub/sheet/dist/table-style.js +1 -1
  115. package/dist/node_modules/@allyhub/sheet/dist/theme.js +1 -1
  116. package/dist/node_modules/@allyhub/sheet/dist/tiles.js +1 -1
  117. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  118. package/dist/node_modules/@allyhub/sheet/dist/xlsx/tile-shapes.js +2 -0
  119. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  120. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  121. package/dist/node_modules/@allyhub/sheet-extension/dist/build.js +1 -1
  122. package/dist/node_modules/@allyhub/sheet-extension/dist/cli/sheet.js +1 -1
  123. package/dist/node_modules/@allyhub/sheet-extension/package.json +1 -1
  124. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  125. package/dist/node_modules/@allyhub/slides-core/dist/file.js +3 -3
  126. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  127. package/dist/node_modules/@allyhub/slides-extension/dist/build.js +2 -2
  128. package/dist/node_modules/@allyhub/slides-extension/dist/cli/slides.js +1 -1
  129. package/dist/node_modules/@allyhub/slides-extension/package.json +1 -1
  130. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  131. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  132. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  133. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  134. package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +2 -2
  135. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  136. package/dist/node_modules/@allyhub/telemetry/package.json +1 -1
  137. package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
  138. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  139. package/dist/node_modules/@allyhub/video-extension/package.json +1 -1
  140. package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
  141. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  142. package/dist/node_modules/@allyhub/website/package.json +1 -1
  143. package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
  144. package/dist/node_modules/@allyhub/x-extension/package.json +1 -1
  145. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  146. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  147. package/dist/package.json +15 -14
  148. package/dist/run-register.js +2 -0
  149. package/dist/works.js +1 -1
  150. package/editor-web/assets/{abnfDiagram-WEYOIA3C-BkVJMd53.js → abnfDiagram-WEYOIA3C-D6qI3rai.js} +1 -1
  151. package/editor-web/assets/{architecture-WOLXFQ4H-C6rnaynZ.js → architecture-WOLXFQ4H-B3V6ggq8.js} +1 -1
  152. package/editor-web/assets/{architectureDiagram-ZHVYKT53-D3vrh8LK.js → architectureDiagram-ZHVYKT53-IauNyxXn.js} +1 -1
  153. package/editor-web/assets/article-BHjKp5We.js +3 -0
  154. package/editor-web/assets/article-BlNKv1Cn.js +7 -0
  155. package/editor-web/assets/bar-button-CJmpgNg4.js +1 -0
  156. package/editor-web/assets/{blockDiagram-RJAE7QA3-BKngt8H7.js → blockDiagram-RJAE7QA3-yXhlfxbH.js} +1 -1
  157. package/editor-web/assets/{c4Diagram-XDPPPE54-j7sUELqF.js → c4Diagram-XDPPPE54-B-anrhvt.js} +1 -1
  158. package/editor-web/assets/{calc-worker-Cr4a0xmt.js → calc-worker-BpAgQE9E.js} +3 -3
  159. package/editor-web/assets/channel-Bhb-_8v6.js +1 -0
  160. package/editor-web/assets/chip-pNQlYa2W.js +1 -0
  161. package/editor-web/assets/{chunk-2E7WHVMD-BXa-uRSi.js → chunk-2E7WHVMD-QPOni4XB.js} +1 -1
  162. package/editor-web/assets/{chunk-4EMNKR2T-B3ntcsZN.js → chunk-4EMNKR2T-DG1FCRRI.js} +1 -1
  163. package/editor-web/assets/{chunk-55XCU76K-AMvnFwUg.js → chunk-55XCU76K-mKuMXpnC.js} +1 -1
  164. package/editor-web/assets/{chunk-7S6XSTFO-BA6esfFu.js → chunk-7S6XSTFO-CgZAazgt.js} +1 -1
  165. package/editor-web/assets/{chunk-AQDTSKZB-BT_vANXs.js → chunk-AQDTSKZB-BRU84phF.js} +1 -1
  166. package/editor-web/assets/{chunk-DSNLSHJZ-DoUgmzGB.js → chunk-DSNLSHJZ-zku9oeG3.js} +1 -1
  167. package/editor-web/assets/{chunk-HAGFOTED-DtnIrCZb.js → chunk-HAGFOTED-CaUkBv_0.js} +1 -1
  168. package/editor-web/assets/{chunk-HNE4Q36P-BlPwQx3_.js → chunk-HNE4Q36P-BQz4ZCJf.js} +1 -1
  169. package/editor-web/assets/{chunk-NQOKRVIF-D2r7jp2r.js → chunk-NQOKRVIF-CHVBEDkg.js} +1 -1
  170. package/editor-web/assets/{chunk-UHW7PFBP-Cmc0_F5o.js → chunk-UHW7PFBP-DrYeJo1e.js} +1 -1
  171. package/editor-web/assets/{chunk-VQ5W62QI-nJSMqAr0.js → chunk-VQ5W62QI-D8ToVCUe.js} +1 -1
  172. package/editor-web/assets/{chunk-WQQL4CDK-Btq2nbF6.js → chunk-WQQL4CDK-DZ0tyi9F.js} +1 -1
  173. package/editor-web/assets/{chunk-YZO67HFG-DTbcCoGt.js → chunk-YZO67HFG-BLe7PXER.js} +1 -1
  174. package/editor-web/assets/{chunk-ZAUX2LTX-DVwkg-2N.js → chunk-ZAUX2LTX-ByaeSIre.js} +1 -1
  175. package/editor-web/assets/{chunk-ZCHMQSOR-BV39jOOE.js → chunk-ZCHMQSOR-DdMJr_t5.js} +1 -1
  176. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-Cj74-fhM.js → classDiagram-v2-4MYWR3UA-DDpq7fFC.js} +1 -1
  177. package/editor-web/assets/collaborator-CbTacvkB.js +1 -0
  178. package/editor-web/assets/color-picker-CDeICDN5.js +1 -0
  179. package/editor-web/assets/{cynefin-EF2NZ3EQ-C0CkiipV.js → cynefin-EF2NZ3EQ-CMivy2fr.js} +1 -1
  180. package/editor-web/assets/{cynefinDiagram-WF24UDRP-hdsnJ4cI.js → cynefinDiagram-WF24UDRP-GtxT_9wW.js} +1 -1
  181. package/editor-web/assets/{dagre-NK4GIZVX-CC7WSgaK.js → dagre-NK4GIZVX-Bn1O2Hjl.js} +1 -1
  182. package/editor-web/assets/deck-Cohd-G5m.js +1 -0
  183. package/editor-web/assets/{diagram-CBK3MWTC-DmaVm13J.js → diagram-CBK3MWTC-W715PWZw.js} +1 -1
  184. package/editor-web/assets/{diagram-I5XIIV2D-De8jqp7b.js → diagram-I5XIIV2D-BKObZPn2.js} +1 -1
  185. package/editor-web/assets/{diagram-ODIL2UCW-B5pBTulX.js → diagram-ODIL2UCW-UtQxEPoW.js} +1 -1
  186. package/editor-web/assets/{diagram-PFBEJUXE-BYsXg5_w.js → diagram-PFBEJUXE-CpLGEK-k.js} +1 -1
  187. package/editor-web/assets/{diagram-RJA3I4VV-DZ8f6bYe.js → diagram-RJA3I4VV-DGyMXoHb.js} +1 -1
  188. package/editor-web/assets/{diagram-TYUNFSNR-qXHUsauD.js → diagram-TYUNFSNR-Dy_Ewr8V.js} +1 -1
  189. package/editor-web/assets/dist-0I0Obj60.js +19 -0
  190. package/editor-web/assets/dist-6ugUm4dS.js +6 -0
  191. package/editor-web/assets/dist-B0rUvCi2.js +1 -0
  192. package/editor-web/assets/{dist-DAhe-kFC.js → dist-B8_6sJ_V.js} +1 -1
  193. package/editor-web/assets/dist-CKD_paj_.js +1 -0
  194. package/editor-web/assets/dist-CKUW5NzS.js +3 -0
  195. package/editor-web/assets/dist-Ca9Gsuu0.js +24 -0
  196. package/editor-web/assets/dist-Cc8v9lfc.js +1 -0
  197. package/editor-web/assets/dist-CynBNzYv.js +1 -0
  198. package/editor-web/assets/{dist-9kuRjUTN.js → dist-D7M5YTq2.js} +6 -6
  199. package/editor-web/assets/dist-D9tsFc2N.js +16 -0
  200. package/editor-web/assets/dist-DNMKDcLg.js +35 -0
  201. package/editor-web/assets/dist-Doj7_HUI.js +547 -0
  202. package/editor-web/assets/dist-DptBQzJR.js +1 -0
  203. package/editor-web/assets/dist-DzKB210A.js +5 -0
  204. package/editor-web/assets/{dist-B3rd02Cg.js → dist-H9rTuNhb.js} +6 -6
  205. package/editor-web/assets/{dist-DA72-4WB.js → dist-QLXI7XGS.js} +1 -1
  206. package/editor-web/assets/dist-RyGsFHE0.js +4 -0
  207. package/editor-web/assets/dist-oeSWr2LE.js +19 -0
  208. package/editor-web/assets/dist-wD_hHJ8_.js +19 -0
  209. package/editor-web/assets/{docx-draw-L54blreB.js → docx-draw-B5cM77hc.js} +1 -1
  210. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-B7-IfVI-.js → ebnfDiagram-V4P3TTPT-GPYcx6dU.js} +1 -1
  211. package/editor-web/assets/{elk-QONTBCTQ-Gj_WaeBn.js → elk-QONTBCTQ-Bi0r4UFM.js} +1 -1
  212. package/editor-web/assets/{erDiagram-KYQIGQAA-BDF6Qoqx.js → erDiagram-KYQIGQAA-DrOSrnci.js} +1 -1
  213. package/editor-web/assets/esm-jIPnpbBD.js +21 -0
  214. package/editor-web/assets/{eventmodeling-K75KTNOO-elxVXXEe.js → eventmodeling-K75KTNOO-Dw-MjgUb.js} +1 -1
  215. package/editor-web/assets/eye-DwfE1USj.js +1 -0
  216. package/editor-web/assets/flowDiagram-IUGLLWBU-DbZTfPEP.js +1 -0
  217. package/editor-web/assets/{ganttDiagram-R7GPNTJY-CEogW3jW.js → ganttDiagram-R7GPNTJY-Bwe8cQqi.js} +1 -1
  218. package/editor-web/assets/{gitGraph-VSP46ZUC-Bh9cRWFa.js → gitGraph-VSP46ZUC-DsAcAKP0.js} +1 -1
  219. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-BQAvdM_V.js → gitGraphDiagram-PDYL7XHY-aObRwdru.js} +1 -1
  220. package/editor-web/assets/hint-F4fIBnVU.js +1 -0
  221. package/editor-web/assets/index-Cah2zchD.css +2 -0
  222. package/editor-web/assets/index-D-MNVykg.js +28 -0
  223. package/editor-web/assets/{info-OHQRW6UA-CdPrqere.js → info-OHQRW6UA-DBPN8JFr.js} +1 -1
  224. package/editor-web/assets/{infoDiagram-MVDRKAX5-uwIMeP44.js → infoDiagram-MVDRKAX5-Bx26Hq7M.js} +1 -1
  225. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-rtfvqK7E.js → ishikawaDiagram-HPEHV2GE-BJ_MCDwA.js} +1 -1
  226. package/editor-web/assets/{journeyDiagram-BOSHW7O7-mmhfIyVG.js → journeyDiagram-BOSHW7O7-B5g4W2Dx.js} +1 -1
  227. package/editor-web/assets/{kanban-definition-FNSA4HC5-Fe7jBsi-.js → kanban-definition-FNSA4HC5-U8YNlxN7.js} +1 -1
  228. package/editor-web/assets/layout-CuWN7_3k.js +1 -0
  229. package/editor-web/assets/{mermaid-parser.core-BxOSjBH9.js → mermaid-parser.core-DYLQlYDo.js} +3 -3
  230. package/editor-web/assets/{mermaid.core-BOln9YdH.js → mermaid.core-qNJmZ0b4.js} +4 -4
  231. package/editor-web/assets/{mindmap-definition-6OY57UG3-M3Q1LOtO.js → mindmap-definition-6OY57UG3-CI5aBWbK.js} +1 -1
  232. package/editor-web/assets/{packet-JDAUHWVQ-Dbb0TUG6.js → packet-JDAUHWVQ-BBclMGlJ.js} +1 -1
  233. package/editor-web/assets/palette-DchDLJj6.js +1 -0
  234. package/editor-web/assets/panes-BShVq38A.js +3 -0
  235. package/editor-web/assets/{pegDiagram-ECIUJNBX-BZMRpSFC.js → pegDiagram-ECIUJNBX-B3pljPTu.js} +1 -1
  236. package/editor-web/assets/{pie-XZMESJXO-Ctm9XdKp.js → pie-XZMESJXO-B7WzimHm.js} +1 -1
  237. package/editor-web/assets/{pieDiagram-GNMPY74T-cGbs5ZTl.js → pieDiagram-GNMPY74T-tM1Da50-.js} +1 -1
  238. package/editor-web/assets/progress-D1Uv3d1b.js +6 -0
  239. package/editor-web/assets/{quadrantDiagram-D57K4MC3-BUe_zsxT.js → quadrantDiagram-D57K4MC3-BEq_Shj9.js} +1 -1
  240. package/editor-web/assets/{radar-ABXABTNO-CCmKtqLs.js → radar-ABXABTNO-v2jJSW5T.js} +1 -1
  241. package/editor-web/assets/{railroad-I3PHUGI6-k-yhjhjA.js → railroad-I3PHUGI6-6W3Z4F8Y.js} +1 -1
  242. package/editor-web/assets/{railroad-abnf-LNEFI6M7-B-PvntB3.js → railroad-abnf-LNEFI6M7-DxIN7Zrt.js} +1 -1
  243. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-Ds2rua1h.js → railroad-ebnf-DWYD2UWJ-Bb5O7tAx.js} +1 -1
  244. package/editor-web/assets/{railroad-peg-JR7BVNR7-jNZ2wEp2.js → railroad-peg-JR7BVNR7-i2LjEP5t.js} +1 -1
  245. package/editor-web/assets/{railroadDiagram-Y72NRBL7-CTqSQ15w.js → railroadDiagram-Y72NRBL7-DhsyVKbG.js} +1 -1
  246. package/editor-web/assets/{requirementDiagram-EQYSW5RA-CUblhR5M.js → requirementDiagram-EQYSW5RA-Du2k7i1E.js} +1 -1
  247. package/editor-web/assets/ribbon-tabs-Bxuj_hct.js +1 -0
  248. package/editor-web/assets/row-DqS4-5b1.js +1 -0
  249. package/editor-web/assets/{sankeyDiagram-SY24JHO5-nSz6zDX3.js → sankeyDiagram-SY24JHO5-CDnRMu7J.js} +1 -1
  250. package/editor-web/assets/schemas-CnlOL0u4.js +1 -0
  251. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-DxTpOYuo.js → sequenceDiagram-BLEHNHQU-BUXBhWYW.js} +1 -1
  252. package/editor-web/assets/{session-BhClkDyr.js → session--OJYv_B7.js} +1 -1
  253. package/editor-web/assets/{snapshots-DwGHDN3t.js → snapshots-DYooVfOx.js} +1 -1
  254. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-C3e14iHY.js → stateDiagram-v2-A6IESKWZ-Enb8LZUA.js} +1 -1
  255. package/editor-web/assets/surface-BUoi7cmR.js +1 -0
  256. package/editor-web/assets/swatch-DCmD1gZl.js +1 -0
  257. package/editor-web/assets/{swimlanes-B3ENRKFQ-DPPdzNzu.js → swimlanes-B3ENRKFQ-pnpjgTrl.js} +1 -1
  258. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B-B2Eoc8.js +8 -0
  259. package/editor-web/assets/switch-b6GCy_ix.js +1 -0
  260. package/editor-web/assets/syntax-Bqyhj0dw.js +1 -0
  261. package/editor-web/assets/tablet-C6oePHEW.js +1 -0
  262. package/editor-web/assets/textarea-Bu6uPEqT.js +1 -0
  263. package/editor-web/assets/themes-D_ISkWVz.js +1 -0
  264. package/editor-web/assets/{timeline-definition-JXYKGLGB-DRTJ1_Er.js → timeline-definition-JXYKGLGB-C4pR18kd.js} +1 -1
  265. package/editor-web/assets/trash-2-SFReAxVM.js +1 -0
  266. package/editor-web/assets/{treeView-D4JQ5SDB-BYJ_m-i5.js → treeView-D4JQ5SDB-kzNGeAv6.js} +1 -1
  267. package/editor-web/assets/{treemap-SAJKECNS-BcU6I6Rg.js → treemap-SAJKECNS-Buhb5wzt.js} +1 -1
  268. package/editor-web/assets/updating-Cbxw83_O.js +1 -0
  269. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-YV92pS4o.js → usecaseDiagram-WPOLBNNX-CL-xLQWl.js} +1 -1
  270. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-oAvfHZtf.js → vennDiagram-Q3Y3IDCW-bwsyCcdK.js} +1 -1
  271. package/editor-web/assets/{video-SJvDRCJK.js → video-8MxWX9f5.js} +1 -1
  272. package/editor-web/assets/{wardley-7MLQ67FV-BLNiqxtt.js → wardley-7MLQ67FV-DXsLgedI.js} +1 -1
  273. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-SppgC6xW.js → wardleyDiagram-IVAIDKWA-Cn0ph953.js} +1 -1
  274. package/editor-web/assets/{words-BUlNNuH2.js → words-B2jQwWpp.js} +1 -1
  275. package/editor-web/assets/{words-zMedmPWc.js → words-DgMuEmDO.js} +1 -1
  276. package/editor-web/assets/workbook-BDWkQ149.js +41 -0
  277. package/editor-web/assets/x-BAJilkKD.js +41 -0
  278. package/editor-web/assets/{xychartDiagram-4URNHDU4-BHMn_jwJ.js → xychartDiagram-4URNHDU4-CfXnqGWZ.js} +1 -1
  279. package/editor-web/index.html +6 -6
  280. package/package.json +5 -2
  281. package/editor-web/assets/article-DHf6mOY_.js +0 -7
  282. package/editor-web/assets/article-Dns1-Xh-.js +0 -3
  283. package/editor-web/assets/bar-button-CKPfx2AB.js +0 -1
  284. package/editor-web/assets/channel-CVWSV3su.js +0 -1
  285. package/editor-web/assets/chip-Bn_9JRRG.js +0 -1
  286. package/editor-web/assets/collaborator-XiHOxwGM.js +0 -1
  287. package/editor-web/assets/deck-DQpNIS2p.js +0 -1
  288. package/editor-web/assets/dist--z0ZHp4T.js +0 -16
  289. package/editor-web/assets/dist-B5GOGGEe.js +0 -1
  290. package/editor-web/assets/dist-Bx6q9kCu.js +0 -1
  291. package/editor-web/assets/dist-C4hHtrJr.js +0 -1
  292. package/editor-web/assets/dist-CCXJewsi.js +0 -19
  293. package/editor-web/assets/dist-CfK2BLl8.js +0 -4
  294. package/editor-web/assets/dist-Cmux3oJ_.js +0 -1
  295. package/editor-web/assets/dist-Cspf85KV.js +0 -6
  296. package/editor-web/assets/dist-DOrGo1GD.js +0 -19
  297. package/editor-web/assets/dist-DjiCHlSu.js +0 -35
  298. package/editor-web/assets/dist-Do4a40Wn.js +0 -19
  299. package/editor-web/assets/dist-FKEWS3Co.js +0 -547
  300. package/editor-web/assets/dist-QKd2i6kG.js +0 -5
  301. package/editor-web/assets/dist-SGnOfLhx.js +0 -24
  302. package/editor-web/assets/dist-VmVB7tl4.js +0 -3
  303. package/editor-web/assets/esm-PQD5Pn8a.js +0 -21
  304. package/editor-web/assets/flowDiagram-IUGLLWBU-B-25n8zE.js +0 -1
  305. package/editor-web/assets/hint-CbwoSBMw.js +0 -1
  306. package/editor-web/assets/index-CXisi0Cj.css +0 -2
  307. package/editor-web/assets/index-wMlfx8aT.js +0 -28
  308. package/editor-web/assets/layout-SWqqA0yV.js +0 -1
  309. package/editor-web/assets/progress-DZQTiRLv.js +0 -6
  310. package/editor-web/assets/ribbon-DajdQ_Ya.js +0 -1
  311. package/editor-web/assets/row-Bei9HNEe.js +0 -1
  312. package/editor-web/assets/schemas-C21MyseF.js +0 -1
  313. package/editor-web/assets/split-DBAbwPZ5.js +0 -3
  314. package/editor-web/assets/surface-CIF0Ae0z.js +0 -1
  315. package/editor-web/assets/swatch-BUzr_XmH.js +0 -1
  316. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B8n3zOw_.js +0 -8
  317. package/editor-web/assets/switch-DrZxoPQS.js +0 -1
  318. package/editor-web/assets/syntax-emXV4DnN.js +0 -1
  319. package/editor-web/assets/tabs-BwU2E7bU.js +0 -1
  320. package/editor-web/assets/textarea-BX_ax3X8.js +0 -1
  321. package/editor-web/assets/tolerant-DM9s0Mt1.js +0 -1
  322. package/editor-web/assets/type-CvZ0HZsV.js +0 -41
  323. package/editor-web/assets/workbook-BZKYx4WB.js +0 -41
@@ -0,0 +1,3 @@
1
+ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{a as t,b as n,c as r,f as i,m as a,s as o}from"./react-Byupo4pA.js";import{Et as s,ht as c,kt as l,n as u,t as d}from"./x-BAJilkKD.js";import{t as f}from"./session--OJYv_B7.js";import{t as p}from"./jsx-runtime-DePvh3-m.js";import{A as m,C as h,f as g,m as _,u as v}from"./bar-button-CJmpgNg4.js";import{C as y,E as ee,S as b,b as x,i as te}from"./dist-6ugUm4dS.js";import{n as ne,t as S}from"./italic-BV7iHxoP.js";import{t as C}from"./code-Ch6AB5bZ.js";import{c as re,d as w,i as ie,l as ae,n as oe,o as se,r as ce,s as le,t as ue,u as T}from"./panes-BShVq38A.js";import{t as E}from"./link-CFOv3nz-.js";import{D,O}from"./dist-DQ6RpEJD.js";import{t as de}from"./minus-ngE8owxs.js";import{O as k,T as A,n as j,nt as M,o as N,s as fe,t as pe,ut as P}from"./dist-QLXI7XGS.js";import{n as F,t as I}from"./undo-2-DCbMWoug.js";import{t as me}from"./sigma-B4AWtnVA.js";import{n as he,t as L}from"./table-BW43XXVd.js";import{a as R,g as ge}from"./index-D-MNVykg.js";import{n as _e,t as ve}from"./updating-Cbxw83_O.js";import{t as ye}from"./collaborator-CbTacvkB.js";import{t as be}from"./row-DqS4-5b1.js";import{c as xe,n as Se,s as Ce,t as we}from"./dist-DIJnhQFK.js";import{i as Te,n as Ee,r as De,t as Oe}from"./dist-B8_6sJ_V.js";import{S as ke,_ as Ae,a as je,c as Me,g as z,h as Ne,i as Pe,m as Fe,o as Ie,r as Le,s as Re,t as B,u as V,v as ze,x as Be}from"./words-B2jQwWpp.js";var H=e(n(),1),U=p(),Ve=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function He(e,t){if(e.title!==t.title||!Ve(e.cover,t.cover))return{head:!0};for(let n=0;n<t.blocks.length;n++)if(!Ve(e.blocks[n],t.blocks[n]))return{block:n};if(e.blocks.length>t.blocks.length&&t.blocks.length>0)return{block:t.blocks.length-1}}function Ue(e,t){let n=z(e),r=e=>e.from<=t.to&&t.from<=e.to;if(n.head&&r(n.head))return{head:!0};let i=n.lines.findIndex(r);return i<0?void 0:{block:i}}function We(e,t){if(e.from!==void 0&&e.path===t.path)return Ue(t.text,{from:e.from,to:e.to??e.from})}var W=new xe(`xArticleAgent`),Ge=A.create({name:`xArticleAgent`,addProseMirrorPlugins(){return[new Ce({key:W,state:{init:()=>null,apply:(e,t)=>{let n=e.getMeta(W);return n===void 0?t:n}},props:{decorations(e){let t=W.getState(e);if(!t)return null;let n;return e.doc.forEach((e,r,i)=>{i===t.block&&(n=we.node(r,r+e.nodeSize,{class:`ak-x-agent`,"data-agent":t.label,"data-testid":`x-agent-block`}))}),n?Se.create(e.doc,[n]):null}}})]}});function Ke(e,t){e.isDestroyed||e.view.dispatch(e.state.tr.setMeta(W,t))}var G={image:`xImage`,post:`xPost`,link:`xLink`,latex:`xLatex`,markdown:`xMarkdown`};function qe(e){let t=[];return e.bold===!0&&t.push({type:`bold`}),e.italic===!0&&t.push({type:`italic`}),e.strike===!0&&t.push({type:`strike`}),e.link!==void 0&&t.push({type:`link`,attrs:{href:e.link}}),{type:`text`,text:e.text,...t.length>0?{marks:t}:{}}}var K=e=>({type:`paragraph`,...e.length>0?{content:e.filter(e=>e.text!==``).map(qe)}:{}});function q(e){let t=e.map(e=>{switch(e.type){case`paragraph`:return K(e.runs);case`h1`:case`h2`:return{type:`heading`,attrs:{level:e.type===`h1`?1:2},...e.runs.length>0?{content:e.runs.map(qe)}:{}};case`quote`:return{type:`blockquote`,content:[K(e.runs)]};case`ul`:case`ol`:return{type:e.type===`ul`?`bulletList`:`orderedList`,content:e.items.map(e=>({type:`listItem`,content:[K(e)]}))};case`image`:return{type:G.image,attrs:{file:e.file,alt:e.alt??``,caption:e.caption??``}};case`post`:return{type:G.post,attrs:{url:e.url,id:e.id}};case`link`:return{type:G.link,attrs:{url:e.url}};case`divider`:return{type:`horizontalRule`};case`latex`:return{type:G.latex,attrs:{tex:e.tex}};case`markdown`:return{type:G.markdown,attrs:{markdown:e.markdown}}}});return{type:`doc`,content:t.length>0?t:[{type:`paragraph`}]}}function Je(e){let t=e.marks??[],n=e=>t.some(t=>t.type===e),r=t.find(e=>e.type===`link`)?.attrs?.href;return{text:e.text??``,...n(`bold`)?{bold:!0}:{},...n(`italic`)?{italic:!0}:{},...n(`strike`)?{strike:!0}:{},...r===void 0?{}:{link:r}}}var J=e=>(e?.content??[]).map(e=>e.type===`hardBreak`?{text:` `}:Je(e)),Y=(e,t)=>{let n=e.attrs?.[t];return typeof n==`string`?n:``};function X(e){let t=[];for(let n of e.content??[])switch(n.type){case`paragraph`:t.push({type:`paragraph`,runs:J(n)});break;case`heading`:{let e=Number(n.attrs?.level??1);t.push({type:e<=1?`h1`:`h2`,runs:J(n)});break}case`blockquote`:for(let e of n.content??[])t.push({type:`quote`,runs:J(e)});break;case`bulletList`:case`orderedList`:t.push({type:n.type===`bulletList`?`ul`:`ol`,items:(n.content??[]).map(e=>(e.content??[]).flatMap(e=>J(e)))});break;case`horizontalRule`:t.push({type:`divider`});break;case G.image:{let e=Y(n,`alt`),r=Y(n,`caption`);t.push({type:`image`,file:Y(n,`file`),...e===``?{}:{alt:e},...r===``?{}:{caption:r}});break}case G.post:t.push({type:`post`,url:Y(n,`url`),id:Y(n,`id`)});break;case G.link:t.push({type:`link`,url:Y(n,`url`)});break;case G.latex:t.push({type:`latex`,tex:Y(n,`tex`)});break;case G.markdown:t.push({type:`markdown`,markdown:Y(n,`markdown`)})}let n=t[0];return t.length===1&&n?.type===`paragraph`&&n.runs.every(e=>e.text===``)?[]:t}var Ye=new xe(`x-found`);function Xe(e){let t=[];return e.descendants((e,n)=>{if(!e.isTextblock)return!0;let r=e.textContent;for(let e of Be(r))t.push(we.inline(n+1+e.start,n+1+e.end,{class:`ak-x-link`}));return!1}),Se.create(e,t)}var Ze=A.create({name:`xFound`,addProseMirrorPlugins(){return[new Ce({key:Ye,state:{init:(e,t)=>Xe(t.doc),apply:(e,t)=>e.docChanged?Xe(e.doc):t},props:{decorations:e=>Ye.getState(e)}})]}}),Qe=(0,H.createContext)(()=>void 0),Z=e=>typeof e==`string`?e:``;function $e({node:e,updateAttributes:t}){let n=B(),r=(0,H.useContext)(Qe),i=Z(e.attrs.file),a=r(i),o=ze(i.split(`#`)[0]?.split(`.`).pop()??``);return(0,U.jsxs)(j,{as:`figure`,"data-x":`image`,className:`relative`,children:[(0,U.jsxs)(`div`,{className:`ak-x-a-picture`,children:[a===void 0?(0,U.jsx)(`div`,{className:`ak-x-made`,children:i}):o===`video`?(0,U.jsx)(re,{src:a,file:i,controls:!0,muted:!0,playsInline:!0,className:`w-full`}):(0,U.jsx)(`img`,{src:a,alt:Z(e.attrs.alt)}),(0,U.jsxs)(`div`,{className:`ak-x-labels`,contentEditable:!1,children:[o===`gif`?(0,U.jsx)(`span`,{className:`ak-x-label`,children:n.gif}):null,(0,U.jsx)(T,{most:ke.alt,alt:Z(e.attrs.alt),onAlt:e=>{t({alt:e})},trigger:(0,U.jsx)(u,{variant:`secondary`,size:`xs`,className:`bg-media/75 text-on-media font-bold`,"aria-label":n.altText,children:n.alt})})]})]}),(0,U.jsx)(`input`,{className:`mt-2 w-full bg-transparent text-left text-[13px] leading-4 text-[var(--ak-x-caption)] outline-none`,value:Z(e.attrs.caption),placeholder:n.caption,"aria-label":n.caption,dir:`auto`,onChange:e=>{t({caption:e.target.value})}})]})}function et({node:e}){return(0,U.jsx)(j,{"data-x":`link`,children:(0,U.jsx)(Re,{url:Z(e.attrs.url)})})}function tt({node:e}){return(0,U.jsx)(j,{className:`ak-x-a-post`,"data-x":`post`,children:Ne(Z(e.attrs.url))})}function nt(e){return function({node:t,updateAttributes:n,selected:r}){let i=B(),a=e===`tex`?i.article.equation:i.article.code,o=Z(t.attrs[e]);return!r&&o.trim()!==``?(0,U.jsx)(j,{"data-x":e,children:e===`tex`?(0,U.jsx)(Ie,{tex:o}):(0,U.jsx)(Me,{markdown:o})}):(0,U.jsx)(j,{as:`pre`,"data-latex":e===`tex`?``:void 0,children:(0,U.jsx)(`textarea`,{className:`block w-full resize-none bg-transparent font-[inherit] outline-none [field-sizing:content]`,value:o,"aria-label":a,placeholder:a,spellCheck:!1,onChange:t=>{n({[e]:t.target.value})}})})}}function Q(e,t,n){return k.create({name:e,group:`block`,atom:!0,selectable:!0,draggable:!0,addAttributes(){return Object.fromEntries(t.map(e=>[e,{default:``}]))},parseHTML(){return[{tag:`div[data-node="${e}"]`}]},renderHTML({HTMLAttributes:t}){return[`div`,M(t,{"data-node":e})]},addNodeView(){return N(n)}})}var rt=[Q(G.image,[`file`,`alt`,`caption`],$e),Q(G.post,[`url`,`id`],tt),Q(G.link,[`url`],et),Q(G.latex,[`tex`],nt(`tex`)),Q(G.markdown,[`markdown`],nt(`markdown`))],it=/^https?:\/\/(?:www\.)?(?:x|twitter)\.com\/[A-Za-z0-9_]+\/status\/([0-9]{1,19})/u,at=3e4;function ot(e){return z(e).issues.some(e=>e.rule===`article-markup`||e.rule===`format`)}var st=class{head;listeners=new Set;body;show;session;constructor(e){this.session=e;let{article:t}=z(e.text);this.head={title:t.title,cover:t.cover,state:e.state,held:ot(e.text)},e.attach({save:e=>{let t=this.article();if(t===void 0||ot(e))return;let n=Ae(t);return n===Ae(z(e).article)?void 0:n},take:(e,t,n)=>{let{article:r}=z(e),i=n?.kind===`agent`?He(z(t).article,r):void 0;this.set({title:r.title,cover:r.cover,held:ot(e),...i===void 0?{}:{landed:{spot:i,at:Date.now()}}}),this.show?.(r)}}),e.onState(e=>{this.set({state:e})})}get read(){return z(this.session.text).article}bind(e,t){this.body=e,this.show=t}article(){if(this.body!==void 0)return{title:this.head.title,...this.head.cover?{cover:this.head.cover}:{},blocks:this.body()}}get(){return this.head}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}set(e){this.head={...this.head,...e};for(let e of this.listeners)e()}edited(e={}){Object.keys(e).length>0&&this.set(e),this.session.edited()}};function $(e){return(0,U.jsx)(u,{variant:`ghost`,size:`icon-sm`,"aria-label":e.label,title:e.label,"aria-pressed":e.on,disabled:e.disabled,className:c(e.on===!0&&`bg-here`),onMouseDown:e=>{e.preventDefault()},onClick:e.onClick,children:e.children})}function ct(e){let t=B(),[n,r]=(0,H.useState)(!1),[i,a]=(0,H.useState)(``),o=i.trim()===``?void 0:e.check?.(i.trim());return(0,U.jsxs)(x,{open:n,onOpenChange:e=>{r(e),e&&a(``)},children:[(0,U.jsx)(y,{asChild:!0,children:(0,U.jsx)(u,{variant:`ghost`,size:`icon-sm`,"aria-label":e.label,title:e.label,disabled:e.disabled,children:e.icon})}),(0,U.jsx)(b,{className:`w-80`,align:`start`,children:(0,U.jsxs)(`form`,{className:`flex flex-col gap-2`,onSubmit:t=>{t.preventDefault(),i.trim()!==``&&o===void 0&&(e.onAnswer(i.trim()),r(!1))},children:[(0,U.jsx)(R,{autoFocus:!0,value:i,placeholder:e.hint,"aria-label":e.hint,onChange:e=>{a(e.target.value)}}),o===void 0?null:(0,U.jsx)(`p`,{className:`text-destructive text-xs`,children:o}),(0,U.jsx)(u,{type:`submit`,size:`sm`,className:`self-end`,disabled:i.trim()===``||o!==void 0,children:t.article.add})]})})]})}function lt({dir:e,entry:t,insert:n,divider:r}){let i=B().article,[a,o]=(0,H.useState)(!1),[s,l]=(0,H.useState)(`menu`),[d,f]=(0,H.useState)(``),p=()=>{o(!1)},h=(e,t,n)=>(0,U.jsx)(be,{size:`dense`,icon:t,onClick:n,children:e}),g=(e,t,n)=>{let r=d.trim()===``?void 0:t(d.trim());return(0,U.jsxs)(`form`,{className:`flex w-80 flex-col gap-2`,onSubmit:e=>{e.preventDefault(),d.trim()!==``&&r===void 0&&(n(d.trim()),p())},children:[(0,U.jsx)(R,{autoFocus:!0,value:d,placeholder:e,"aria-label":e,onChange:e=>{f(e.target.value)}}),r===void 0?null:(0,U.jsx)(`p`,{className:`text-destructive text-xs`,children:r}),(0,U.jsx)(u,{type:`submit`,size:`sm`,className:`self-end`,disabled:d.trim()===``||r!==void 0,children:i.add})]})};return(0,U.jsxs)(x,{open:a,onOpenChange:e=>{o(e),e&&(l(`menu`),f(``))},children:[(0,U.jsx)(y,{asChild:!0,children:(0,U.jsxs)(u,{variant:`ghost`,size:`sm`,className:`gap-1 px-2`,children:[i.insert,(0,U.jsx)(m,{})]})}),(0,U.jsx)(b,{className:c(s===`menu`?`w-48 p-1`:`w-auto`),align:`start`,children:s===`menu`?(0,U.jsxs)(`div`,{role:`menu`,children:[h(i.media,(0,U.jsx)(w,{}),()=>{l(`media`)}),h(i.post,(0,U.jsx)(ge,{}),()=>{l(`post`)}),h(i.linkCard,(0,U.jsx)(E,{}),()=>{l(`link`)}),h(i.divider,(0,U.jsx)(de,{}),()=>{r(),p()}),h(i.code,(0,U.jsx)(C,{}),()=>{n(G.markdown,{markdown:"```\n\n```"}),p()}),h(i.equation,(0,U.jsx)(me,{}),()=>{n(G.latex,{tex:``}),p()}),h(i.table,(0,U.jsx)(L,{}),()=>{n(G.markdown,{markdown:`| A | B |
2
+ | - | - |
3
+ | | |`}),p()})]}):s===`media`?(0,U.jsx)(ie,{self:t,types:Pe,testId:`x-picker`,onPick:t=>{n(G.image,{file:le(e,t),alt:``,caption:``}),p()}}):s===`post`?g(i.postHint,e=>it.test(e)?void 0:i.notPost,e=>{n(G.post,{url:e,id:it.exec(e)?.[1]??``})}):g(i.linkHint,e=>/^https?:\/\/\S+$/u.test(e)?void 0:i.notLink,e=>{n(G.link,{url:e})})})]})}function ut({editor:e}){let t=B().article,n=()=>e.chain().focus(),r=e.isActive(`heading`,{level:1})?t.heading:e.isActive(`heading`,{level:2})?t.subheading:t.paragraph;return(0,U.jsxs)(v,{children:[(0,U.jsx)(h,{asChild:!0,children:(0,U.jsxs)(u,{variant:`ghost`,size:`sm`,className:`w-32 justify-between gap-1 px-2`,onMouseDown:e=>{e.preventDefault()},children:[r,(0,U.jsx)(m,{})]})}),(0,U.jsxs)(g,{align:`start`,className:`ak-x w-48`,children:[(0,U.jsx)(_,{className:`text-[31px] leading-10 font-extrabold`,onSelect:()=>n().setHeading({level:1}).run(),children:t.heading}),(0,U.jsx)(_,{className:`text-[26px] leading-9 font-extrabold`,onSelect:()=>n().setHeading({level:2}).run(),children:t.subheading}),(0,U.jsx)(_,{className:`text-[15px] font-bold`,onSelect:()=>n().setParagraph().run(),children:t.paragraph})]})]})}function dt({editor:e,dir:t,entry:n}){let r=B(),i=r.article,[,a]=(0,H.useState)(0);(0,H.useEffect)(()=>{let t=()=>{a(e=>e+1)};return e.on(`transaction`,t),()=>{e.off(`transaction`,t)}},[e]);let o=()=>e.chain().focus(),s=(t,n)=>{let{$from:r}=e.state.selection;r.depth>1?o().insertContentAt(r.after(1),{type:t,attrs:n}).run():o().insertContent({type:t,attrs:n}).run()},c=e.getText().split(/\s+/u).filter(e=>e!==``).length;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)($,{label:r.undo,disabled:!e.can().undo(),onClick:()=>o().undo().run(),children:(0,U.jsx)(I,{})}),(0,U.jsx)($,{label:r.redo,disabled:!e.can().redo(),onClick:()=>o().redo().run(),children:(0,U.jsx)(F,{})}),(0,U.jsx)(`span`,{className:`bg-rule mx-1 h-5 w-px`,"aria-hidden":`true`}),(0,U.jsx)($,{label:i.bold,on:e.isActive(`bold`),onClick:()=>o().toggleBold().run(),children:(0,U.jsx)(ne,{})}),(0,U.jsx)($,{label:i.italic,on:e.isActive(`italic`),onClick:()=>o().toggleItalic().run(),children:(0,U.jsx)(S,{})}),(0,U.jsx)($,{label:i.strike,on:e.isActive(`strike`),onClick:()=>o().toggleStrike().run(),children:(0,U.jsx)(he,{})}),(0,U.jsx)(ut,{editor:e}),(0,U.jsx)(`span`,{className:`bg-rule mx-1 h-5 w-px`,"aria-hidden":`true`}),(0,U.jsx)($,{label:i.quote,on:e.isActive(`blockquote`),onClick:()=>o().toggleBlockquote().run(),children:(0,U.jsx)(P,{})}),(0,U.jsx)($,{label:i.bullets,on:e.isActive(`bulletList`),onClick:()=>o().toggleBulletList().run(),children:(0,U.jsx)(D,{})}),(0,U.jsx)($,{label:i.numbers,on:e.isActive(`orderedList`),onClick:()=>o().toggleOrderedList().run(),children:(0,U.jsx)(O,{})}),(0,U.jsx)(`span`,{className:`bg-rule mx-1 h-5 w-px`,"aria-hidden":`true`}),e.isActive(`link`)?(0,U.jsx)($,{label:i.removeLink,on:!0,onClick:()=>o().extendMarkRange(`link`).unsetLink().run(),children:(0,U.jsx)(d,{})}):(0,U.jsx)(ct,{label:i.link,hint:i.linkHint,icon:(0,U.jsx)(E,{}),disabled:e.state.selection.empty,onAnswer:e=>{o().extendMarkRange(`link`).setLink({href:e}).run()}}),(0,U.jsx)(lt,{dir:t,entry:n,insert:s,divider:()=>o().setHorizontalRule().run()}),(0,U.jsx)(`span`,{className:`text-muted-foreground ml-2 text-xs tabular-nums`,children:i.words(c)})]})}function ft({doc:e,dir:n,entry:o}){let c=B(),f=r(),p=a(),[m,h]=ce(),g=(0,H.useSyncExternalStore)(t=>e.subscribe(t),()=>e.get()),_=p||g.held,v=(0,H.useMemo)(()=>e.read,[e]),[ne,S]=(0,H.useState)(()=>v.blocks.flatMap(e=>e.type===`image`?[e.file]:[])),C=fe({textDirection:`auto`,editable:!_,immediatelyRender:!0,extensions:[Oe.configure({heading:{levels:[1,2]},listItem:!1,blockquote:!1,code:!1,codeBlock:!1,underline:!1,hardBreak:!1,link:{openOnClick:!1,autolink:!0}}),Ee.extend({content:`paragraph`}),De.extend({content:`paragraph`}),Te.configure({placeholder:c.article.body}),Ze,Ge,...rt],content:q(v.blocks),onUpdate:({editor:t,transaction:n})=>{n.docChanged&&(S(X(t.getJSON()).flatMap(e=>e.type===`image`?[e.file]:[])),e.edited())}}),[re,T]=(0,H.useState)(()=>v.blocks);(0,H.useEffect)(()=>{e.bind(()=>X(C.getJSON()),e=>{C.commands.setContent(q(e.blocks),{emitUpdate:!1}),S(e.blocks.flatMap(e=>e.type===`image`?[e.file]:[])),T(e.blocks)})},[e,C]),(0,H.useEffect)(()=>{C.setEditable(!_)},[C,_]),(0,H.useEffect)(()=>{let e=()=>{T(X(C.getJSON()))};return C.on(`update`,e),()=>{C.off(`update`,e)}},[C]);let E=(0,H.useDeferredValue)(re),{agent:D,following:O}=t(),de=ee(),k=(()=>{if(D?.doing===void 0)return;let t=g.landed,n=t!==void 0&&t.at>=D.at-at;return n&&D.source?.path===o?t.spot:(D.source?We(D.source,{path:o,text:e.session.text}):void 0)??(n?t.spot:void 0)})(),A=k&&`block`in k?k.block:void 0,j=k!==void 0&&`head`in k,M=D?de(D):``,N=(0,H.useRef)(null),P=(0,H.useRef)(null);(0,H.useEffect)(()=>{Ke(C,A===void 0?null:{block:A,label:M})},[C,A,M]),(0,H.useEffect)(()=>{let e=P.current;if(e){for(let t of e.querySelectorAll(`[data-agent]`))t.removeAttribute(`data-agent`);(j?e.querySelector(`.ak-x-a-title`):A===void 0?null:e.querySelector(`.ak-x-a-body`)?.children[A])?.setAttribute(`data-agent`,``)}},[A,j,E,g.title]),(0,H.useEffect)(()=>{O&&k!==void 0&&((j?N.current?.querySelector(`.ak-x-a-title`):N.current?.querySelector(`[data-testid="x-agent-block"]`))?.scrollIntoView({block:`nearest`}),P.current?.querySelector(`[data-agent]`)?.scrollIntoView({block:`nearest`}))},[O,k,j,g.landed]),i({hold:()=>Promise.resolve({key:`${o}@${String(e.session.text.length)}`,what:`The X article ${o}`,source:{path:o}}),locate:t=>{let n=z(e.session.text),r=e=>{let t=e?.getBoundingClientRect();return t&&t.width>0&&t.height>0?{x:t.x,y:t.y,width:t.width,height:t.height}:void 0},i=s(t)[0],a=e=>e!==void 0&&i!==void 0&&i.x>=e.x&&i.x<=e.x+e.width&&i.y>=e.y&&i.y<=e.y+e.height,c=[{as:`where it is written`,head:[`.ak-x-a-cover`,`.ak-x-a-title`].map(e=>N.current?.querySelector(e)),blocks:[...N.current?.querySelector(`.ak-x-a-body .ProseMirror`)?.children??[]]},{as:`as X will show it`,head:[`.ak-x-a-cover`,`.ak-x-a-title`].map(e=>P.current?.querySelector(e)),blocks:[...P.current?.querySelector(`.ak-x-a-body`)?.children??[]]}],u=e=>e===void 0?{}:{line:e.from,...e.to>e.from?{endLine:e.to}:{}},d=c.some(e=>e.head.some(e=>{let n=r(e);return n!==void 0&&l(t,n)})),f=new Set;for(let e of c)e.blocks.forEach((e,n)=>{let i=r(e);i&&l(t,i)&&f.add(n)});let p=[...d?[{name:`the article's head: its cover and title`,source:{path:o,...u(n.head)},...g.title===``?{}:{text:g.title}}]:[],...[...f].sort((e,t)=>e-t).map(e=>{let t=c.map(t=>t.blocks[e]?.textContent.trim()??``).find(e=>e!==``)??``;return{name:`block ${String(e+1)} of the article`,source:{path:o,...u(n.lines[e])},...t===``?{}:{text:t}}})],m=c.flatMap(e=>{if(e.head.some(e=>a(r(e))))return[`in the article's head, ${e.as}`];let t=e.blocks.findIndex(e=>a(r(e)));return t<0?[]:[`in block ${String(t+1)}, ${e.as}`]}).at(0);return Promise.resolve({elements:p,...m===void 0?{}:{where:m}})}});let F=se(n,[...g.cover?[g.cover.file]:[],...ne]),I=(0,H.useMemo)(()=>e=>F.get(e),[F]),[me,he]=(0,H.useState)(!1),L=g.cover===void 0?void 0:F.get(g.cover.file),R=f?.theme===`dark`,ge=(0,U.jsxs)(x,{open:me,onOpenChange:he,children:[(0,U.jsx)(`div`,{className:`group/cover ak-x-a-cover relative`,children:g.cover===void 0?_?null:(0,U.jsx)(y,{asChild:!0,children:(0,U.jsxs)(u,{variant:`ghost`,className:`size-full flex-col gap-2 rounded-none text-[13px] font-normal text-[var(--ak-x-muted)]`,"aria-label":c.article.addCover,children:[(0,U.jsx)(`span`,{className:`grid size-10 place-items-center rounded-full bg-[var(--ak-x-muted)] text-[var(--ak-x-bg)]`,children:(0,U.jsx)(w,{className:`size-5`})}),c.article.coverHint]})}):(0,U.jsxs)(U.Fragment,{children:[L===void 0?(0,U.jsx)(`div`,{className:`ak-x-made`,children:g.cover.file}):(0,U.jsx)(`img`,{src:L,alt:g.cover.alt??``}),_?null:(0,U.jsxs)(`div`,{className:`absolute top-2 right-2 flex gap-1`,children:[(0,U.jsx)(y,{asChild:!0,children:(0,U.jsxs)(u,{variant:`secondary`,size:`sm`,className:`bg-media/75 text-on-media`,children:[(0,U.jsx)(w,{}),c.article.changeCover]})}),(0,U.jsx)(u,{variant:`secondary`,size:`icon-sm`,className:`bg-media/75 text-on-media`,"aria-label":c.article.removeCover,title:c.article.removeCover,onClick:()=>{e.edited({cover:void 0})},children:(0,U.jsx)(d,{})})]})]})}),(0,U.jsx)(b,{className:`w-auto`,align:`center`,children:(0,U.jsx)(ie,{self:o,types:Le,testId:`x-picker`,onPick:t=>{he(!1),e.edited({cover:{file:le(n,t)}})}})})]}),ve=(0,U.jsxs)(`div`,{ref:N,className:`ak-x ak-x-editing min-h-full`,"data-theme":R?`dark`:`light`,children:[ge,(0,U.jsxs)(`div`,{className:`ak-x-e-page`,children:[(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(`textarea`,{className:`ak-x-a-title block w-full resize-none border-0 bg-transparent p-0 outline-none [field-sizing:content] placeholder:text-[var(--ak-x-muted)]`,value:g.title,placeholder:c.article.title,"aria-label":c.article.title,readOnly:_,dir:`auto`,"data-testid":`x-article-title`,onChange:t=>{_||e.edited({title:t.target.value.replace(/\n/gu,` `)})}}),D&&j?(0,U.jsx)(ye,{"data-testid":`x-agent-head`,label:M,className:`-inset-1`}):null]}),(0,U.jsxs)(`div`,{className:`ak-x-e-by`,children:[(0,U.jsx)(`div`,{className:`ak-x-avatar`,"aria-hidden":`true`,children:V.name.slice(0,1)}),(0,U.jsx)(`span`,{className:`ak-x-name`,children:V.name}),(0,U.jsxs)(`span`,{className:`ak-x-handle`,children:[`@`,V.handle]})]}),(0,U.jsx)(Qe.Provider,{value:I,children:(0,U.jsx)(`div`,{className:`ak-x-a-body`,"data-testid":`x-article-body`,children:(0,U.jsx)(pe,{editor:C,className:`[&_.ProseMirror]:outline-none`})})})]})]}),be=(0,U.jsx)(`div`,{ref:P,className:`ak-x ak-x-column`,"data-theme":R?`dark`:`light`,children:(0,U.jsx)(je,{article:{title:g.title,...g.cover?{cover:g.cover}:{},blocks:E},source:I})});return(0,U.jsxs)(`div`,{className:`bg-background flex size-full flex-col`,"data-testid":`x-article-editor`,children:[(0,U.jsx)(te,{start:(0,U.jsxs)(U.Fragment,{children:[_||m!==`edit`?null:(0,U.jsx)(dt,{editor:C,dir:n,entry:o}),(0,U.jsx)(`span`,{className:`flex-1`}),(0,U.jsx)(ue,{pane:m,onPane:h})]}),saved:{state:g.state},exports:{}}),(0,U.jsx)(Fe.Provider,{value:ae,children:(0,U.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[g.held?(0,U.jsx)(_e,{}):null,(0,U.jsx)(oe,{pane:m,edit:ve,preview:be,width:600,background:R?`#000000`:`#ffffff`,testId:`x-preview`})]})})]})}function pt(){let e=B(),t=o(),n=r(),i=n?.item.entry,a=n?.item.dir??``,[s,c]=(0,H.useState)(),[l,u]=(0,H.useState)(!1);return(0,H.useEffect)(()=>{if(i===void 0)return;let e,n=!0;return f.open(t,i).then(t=>{n?(e=t,c(new st(t))):t.close()},e=>{reportError(e),n&&u(!0)}),()=>{n=!1,e?.close()}},[t,i]),l?(0,U.jsx)(`div`,{className:`flex size-full`,"data-testid":`x-article-editor`,"data-state":`updating`,children:(0,U.jsx)(ve,{})}):!s||i===void 0?(0,U.jsx)(`div`,{className:`text-muted-foreground flex size-full items-center justify-center text-sm`,"data-testid":`x-article-editor`,"data-state":`loading`,children:e.article.loading}):(0,U.jsx)(ft,{doc:s,dir:a,entry:i})}export{pt as XArticleEditor,pt as default,X as fromDoc,q as toDoc};
@@ -0,0 +1,7 @@
1
+ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{a as t,b as n,c as r,f as i,m as a,s as o}from"./react-Byupo4pA.js";import{Et as s,ht as c,kt as l,n as u,t as d}from"./x-BAJilkKD.js";import{C as f,S as p,T as m}from"./schemas-DlRAoVtq.js";import{t as ee}from"./session--OJYv_B7.js";import{t as h}from"./jsx-runtime-DePvh3-m.js";import{A as g,C as _,f as te,j as v,m as y,u as ne}from"./bar-button-CJmpgNg4.js";import{C as b,E as re,S as x,b as S,i as ie}from"./dist-6ugUm4dS.js";import{t as C}from"./createLucideIcon-euu7Wcd9.js";import{n as w,t as T}from"./italic-BV7iHxoP.js";import{t as E}from"./copy-SoaMYqsN.js";import{d as ae,i as oe,l as se,n as ce,o as le,r as ue,s as de,t as fe,u as pe}from"./panes-BShVq38A.js";import{t as D}from"./link-CFOv3nz-.js";import{D as O,O as k}from"./dist-DQ6RpEJD.js";import{t as A}from"./minus-ngE8owxs.js";import{O as j,T as M,n as N,nt as P,o as me,s as he,t as ge,ut as F}from"./dist-QLXI7XGS.js";import{n as I,t as L}from"./undo-2-DCbMWoug.js";import{a as _e,y as ve}from"./index-D-MNVykg.js";import{n as ye,t as be}from"./updating-Cbxw83_O.js";import{t as xe}from"./collaborator-CbTacvkB.js";import{S as Se,h as Ce,i as we,n as Te,p as Ee,r as De,t as Oe}from"./syntax-C0iPON60.js";import{i as ke,n as Ae,t as je}from"./syntax-BIEjjMZL.js";import{r as Me,t as Ne}from"./browser-DEGNhKTV.js";import{n as Pe,r as Fe,t as Ie}from"./lib-KOEbW83T.js";import{c as Le,n as Re,s as ze,t as Be}from"./dist-DIJnhQFK.js";import{i as Ve,n as He,r as Ue,t as We}from"./dist-B8_6sJ_V.js";import{d as Ge,l as Ke,o as qe,p as Je,r as Ye,s as Xe,t as R,v as Ze}from"./words-DgMuEmDO.js";var Qe=C(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),$e=C(`square-play`,[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}]]),et=p({title:f().optional(),cover:m([f().min(1),p({file:f().min(1),alt:f().optional()})]).optional()}),tt=/^<br\s*\/?>$/iu,nt=/^https?:\/\/\S+$/u,rt={extensions:[Fe([`yaml`]),Te(),Oe(),De(),je()],mdastExtensions:[Ie([`yaml`]),Ce(),Ee(),we(),Ae()]},it={extensions:[Pe([`yaml`])],bullet:`-`,emphasis:`*`,strong:`*`,rule:`-`,fences:!0},at=e=>`${e.bold===!0?`b`:``}${e.italic===!0?`i`:``}|${e.link??``}`;function z(e){let t=[];for(let n of e){if(n.text===``)continue;let e=t.at(-1);e&&at(e)===at(n)?t[t.length-1]={...e,text:e.text+n.text}:t.push(n)}return t}function B(e,t,n,r={}){let i=[];for(let a of e)switch(a.type){case`text`:i.push({...r,text:a.value.replace(/\n/gu,` `)});break;case`break`:i.push({...r,text:` `});break;case`strong`:i.push(...B(a.children,t,n,{...r,bold:!0}));break;case`emphasis`:i.push(...B(a.children,t,n,{...r,italic:!0}));break;case`delete`:t(a,`strikethrough, which LinkedIn's article editor does not have: its words are kept plain`),i.push(...B(a.children,t,n,r));break;case`link`:i.push(...B(a.children,t,n,{...r,link:a.url}));break;case`linkReference`:{let e=n.get(a.identifier.toLowerCase());i.push(...B(a.children,t,n,e===void 0?r:{...r,link:e}));break}case`footnoteReference`:t(a,`a footnote, which LinkedIn's blocks do not hold: write the source in the words, or as a link`);break;case`inlineCode`:t(a,`inline code, which LinkedIn's article editor does not style: write it as words, or as a code snippet`),i.push({...r,text:a.value});break;case`image`:t(a,`a picture inside a line: LinkedIn takes a picture as a block of its own, on a line of its own`);break;case`inlineMath`:t(a,`an equation, which LinkedIn's article editor does not have`),i.push({...r,text:a.value});break;case`html`:/^<!--[\s\S]*-->$/u.test(a.value.trim())||t(a,`HTML, which LinkedIn's blocks do not hold`);break;default:t(a,`${a.type}, which LinkedIn's blocks do not hold`)}return i}var ot=e=>e.map(e=>`value`in e?e.value:`children`in e?ot(e.children):``).join(``);function V(e){let t=[],n=(e,n)=>{t.push({rule:`article-markup`,line:e.position?.start.line,message:`${n[0]?.toUpperCase()??``}${n.slice(1)}.`})},r=Se(e,rt),i=new Map;for(let e of r.children)e.type===`definition`&&i.set(e.identifier.toLowerCase(),e.url);let a=``,o,s=[],c=e=>{switch(e.type){case`yaml`:{let n;try{n=Ne(e.value)}catch(n){t.push({rule:`format`,line:e.position?.start.line,message:`Its front matter is not YAML: ${n.message.split(`
2
+ `)[0]??``}`});break}let r=et.safeParse(n??{});if(!r.success){t.push({rule:`format`,line:e.position?.start.line,message:`Its front matter takes a title and a cover (a file, or { file, alt }): ${r.error.issues.map(e=>e.message).join(`; `)}`});break}a=r.data.title??``;let i=r.data.cover;o=i===void 0?void 0:typeof i==`string`?{file:i}:{file:i.file,...i.alt===void 0?{}:{alt:i.alt}};break}case`paragraph`:{let t=e.children.filter(e=>e.type===`image`),r=e.children.filter(e=>e.type!==`image`&&e.type!==`break`&&(e.type!==`text`||e.value.trim()!==``));if(t.length>0&&r.length===0){for(let e of t)s.push({type:`image`,file:e.url,...e.alt?{alt:e.alt}:{},...e.title?{caption:e.title}:{}});break}let a=ot(e.children).trim();if(!a.includes(` `)&&nt.test(a)){s.push({type:`embed`,url:a});break}s.push({type:`paragraph`,runs:z(B(e.children,n,i))});break}case`heading`:e.depth>2&&n(e,`a heading of level ${String(e.depth)}: LinkedIn has a Heading (#) and a Subheading (##)`),s.push({type:e.depth===1?`h1`:`h2`,runs:z(B(e.children,n,i))});break;case`blockquote`:for(let t of e.children)t.type===`paragraph`?s.push({type:`quote`,runs:z(B(t.children,n,i))}):n(t,`${t.type} inside a quote, which LinkedIn's blocks do not hold`);break;case`list`:{let t=[],r=()=>{t.length>0&&s.push({type:e.ordered===!0?`ol`:`ul`,items:t}),t=[]};e.ordered===!0&&(e.start??1)!==1&&n(e,`a numbered list starting at ${String(e.start)}: LinkedIn numbers every list from 1`);for(let a of e.children){let[e,...o]=a.children;t.push(e?.type===`paragraph`?z(B(e.children,n,i)):[]),e!==void 0&&e.type!==`paragraph`&&o.unshift(e);for(let e of o)e.type===`list`?n(e,`a list inside a list: LinkedIn's lists are one level deep`):(r(),c(e))}r();break}case`thematicBreak`:s.push({type:`divider`});break;case`code`:s.push({type:`code`,code:e.value,...e.lang?{lang:e.lang}:{}});break;case`math`:n(e,`an equation, which LinkedIn's article editor does not have`);break;case`table`:n(e,`a table, which LinkedIn's article editor does not have: a picture of it, or a list`);break;case`html`:if(tt.test(e.value.trim())){s.push({type:`paragraph`,runs:[]});break}if(/^<!--[\s\S]*-->$/u.test(e.value.trim()))break;n(e,`HTML, which LinkedIn's blocks do not hold (an empty line is <br /> alone)`);break;case`definition`:break;case`footnoteDefinition`:n(e,`a footnote, which LinkedIn's blocks do not hold: write the source in the words, or as a link`);break;default:n(e,`${e.type}, which LinkedIn's blocks do not hold`)}},l=[],u;for(let e of r.children){let t=s.length;c(e);let n=e.position&&{from:e.position.start.line,to:e.position.end.line};if(n){e.type===`yaml`&&(u=n);for(let e=t;e<s.length;e++)l.push(n)}}return a.trim()===``&&t.push({rule:`article-title`,line:1,message:`It has no title: LinkedIn's article needs one (front matter: title: …).`}),{article:{title:a,...o?{cover:o}:{},blocks:s},issues:t,lines:l,head:u}}function H(e){return e.map(e=>{let t={type:`text`,value:e.text};return e.italic===!0&&(t={type:`emphasis`,children:[t]}),e.bold===!0&&(t={type:`strong`,children:[t]}),e.link!==void 0&&(t={type:`link`,url:e.link,children:[t]}),t})}function st(e){switch(e.type){case`paragraph`:return e.runs.every(e=>e.text===``)?[{type:`html`,value:`<br />`}]:[{type:`paragraph`,children:H(e.runs)}];case`h1`:case`h2`:return[{type:`heading`,depth:e.type===`h1`?1:2,children:H(e.runs)}];case`quote`:return[{type:`blockquote`,children:[{type:`paragraph`,children:H(e.runs)}]}];case`ul`:case`ol`:return[{type:`list`,ordered:e.type===`ol`,spread:!1,children:e.items.map(e=>({type:`listItem`,spread:!1,children:[{type:`paragraph`,children:H(e)}]}))}];case`image`:return[{type:`paragraph`,children:[{type:`image`,url:e.file,alt:e.alt??``,title:e.caption??null}]}];case`embed`:return[{type:`paragraph`,children:[{type:`text`,value:e.url}]}];case`divider`:return[{type:`thematicBreak`}];case`code`:return[{type:`code`,lang:e.lang??null,value:e.code}]}}function ct(e){let t={title:e.title};e.cover&&(t.cover=e.cover.alt===void 0?e.cover.file:{file:e.cover.file,alt:e.cover.alt});let n={type:`root`,children:[{type:`yaml`,value:Me(t,{lineWidth:0}).trimEnd()},...e.blocks.flatMap(st)]};return ke(n,it)}var U=e=>e.replace(/&/gu,`&amp;`).replace(/</gu,`&lt;`).replace(/>/gu,`&gt;`).replace(/"/gu,`&quot;`);function W(e){return e.map(e=>{let t=U(e.text);return e.italic===!0&&(t=`<em>${t}</em>`),e.bold===!0&&(t=`<strong>${t}</strong>`),e.link!==void 0&&(t=`<a href="${U(e.link)}">${t}</a>`),t}).join(``)}function lt(e,t){switch(e.type){case`paragraph`:return e.runs.length===0?`<p><br></p>`:`<p>${W(e.runs)}</p>`;case`h1`:return`<h1>${W(e.runs)}</h1>`;case`h2`:return`<h2>${W(e.runs)}</h2>`;case`quote`:return`<blockquote><p>${W(e.runs)}</p></blockquote>`;case`ul`:case`ol`:return`<${e.type}>${e.items.map(e=>`<li>${W(e)}</li>`).join(``)}</${e.type}>`;case`code`:return`<pre><code>${U(e.code)}</code></pre>`;case`divider`:return`<hr>`;case`embed`:return`<p><a href="${U(e.url)}">${U(e.url)}</a></p>`;case`image`:{let n=t(e.file);return n===void 0?``:`<figure><img src="${U(n)}" alt="${U(e.alt??``)}">${e.caption===void 0?``:`<figcaption>${U(e.caption)}</figcaption>`}</figure>`}}}function ut(e,t=()=>void 0){return e.blocks.map(e=>lt(e,t)).filter(e=>e!==``).join(`
3
+ `)}function dt(e){return e.blocks.map(e=>{switch(e.type){case`ul`:return e.items.map(e=>`• ${e.map(e=>e.text).join(``)}`).join(`
4
+ `);case`ol`:return e.items.map((e,t)=>`${String(t+1)}. ${e.map(e=>e.text).join(``)}`).join(`
5
+ `);case`code`:return e.code;case`divider`:return`---`;case`embed`:return e.url;case`image`:return e.caption??``;default:return e.runs.map(e=>e.text).join(``)}}).join(`
6
+
7
+ `)}var G=e(n(),1),K=h(),ft=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function pt(e,t){if(e.title!==t.title||!ft(e.cover,t.cover))return{head:!0};for(let n=0;n<t.blocks.length;n++)if(!ft(e.blocks[n],t.blocks[n]))return{block:n};if(e.blocks.length>t.blocks.length&&t.blocks.length>0)return{block:t.blocks.length-1}}function mt(e,t){let n=V(e),r=e=>e.from<=t.to&&t.from<=e.to;if(n.head&&r(n.head))return{head:!0};let i=n.lines.findIndex(r);return i<0?void 0:{block:i}}function ht(e,t){if(e.from!==void 0&&e.path===t.path)return mt(t.text,{from:e.from,to:e.to??e.from})}var q=new Le(`liArticleAgent`),gt=M.create({name:`liArticleAgent`,addProseMirrorPlugins(){return[new ze({key:q,state:{init:()=>null,apply:(e,t)=>{let n=e.getMeta(q);return n===void 0?t:n}},props:{decorations(e){let t=q.getState(e);if(!t)return null;let n;return e.doc.forEach((e,r,i)=>{i===t.block&&(n=Be.node(r,r+e.nodeSize,{class:`ak-li-agent`,"data-agent":t.label,"data-testid":`linkedin-agent-block`}))}),n?Re.create(e.doc,[n]):null}}})]}});function _t(e,t){e.isDestroyed||e.view.dispatch(e.state.tr.setMeta(q,t))}var J={image:`liImage`,embed:`liEmbed`};function vt(e){let t=[];return e.bold===!0&&t.push({type:`bold`}),e.italic===!0&&t.push({type:`italic`}),e.link!==void 0&&t.push({type:`link`,attrs:{href:e.link}}),{type:`text`,text:e.text,...t.length>0?{marks:t}:{}}}var yt=e=>({type:`paragraph`,...e.length>0?{content:e.filter(e=>e.text!==``).map(vt)}:{}});function bt(e){let t=e.map(e=>{switch(e.type){case`paragraph`:return yt(e.runs);case`h1`:case`h2`:return{type:`heading`,attrs:{level:e.type===`h1`?1:2},...e.runs.length>0?{content:e.runs.map(vt)}:{}};case`quote`:return{type:`blockquote`,content:[yt(e.runs)]};case`ul`:case`ol`:return{type:e.type===`ul`?`bulletList`:`orderedList`,content:e.items.map(e=>({type:`listItem`,content:[yt(e)]}))};case`code`:return{type:`codeBlock`,attrs:{language:e.lang??null},...e.code===``?{}:{content:[{type:`text`,text:e.code}]}};case`image`:return{type:J.image,attrs:{file:e.file,alt:e.alt??``,caption:e.caption??``}};case`embed`:return{type:J.embed,attrs:{url:e.url}};case`divider`:return{type:`horizontalRule`}}});return{type:`doc`,content:t.length>0?t:[{type:`paragraph`}]}}function xt(e){let t=e.marks??[],n=e=>t.some(t=>t.type===e),r=t.find(e=>e.type===`link`)?.attrs?.href;return{text:e.text??``,...n(`bold`)?{bold:!0}:{},...n(`italic`)?{italic:!0}:{},...r===void 0?{}:{link:r}}}var Y=e=>(e?.content??[]).map(e=>e.type===`hardBreak`?{text:` `}:xt(e)),X=(e,t)=>{let n=e.attrs?.[t];return typeof n==`string`?n:``};function Z(e){let t=[];for(let n of e.content??[])switch(n.type){case`paragraph`:t.push({type:`paragraph`,runs:Y(n)});break;case`heading`:{let e=Number(n.attrs?.level??1);t.push({type:e<=1?`h1`:`h2`,runs:Y(n)});break}case`blockquote`:for(let e of n.content??[])t.push({type:`quote`,runs:Y(e)});break;case`bulletList`:case`orderedList`:t.push({type:n.type===`bulletList`?`ul`:`ol`,items:(n.content??[]).map(e=>(e.content??[]).flatMap(e=>Y(e)))});break;case`codeBlock`:{let e=X(n,`language`);t.push({type:`code`,code:(n.content??[]).map(e=>e.text??``).join(``),...e===``?{}:{lang:e}});break}case`horizontalRule`:t.push({type:`divider`});break;case J.image:{let e=X(n,`alt`),r=X(n,`caption`);t.push({type:`image`,file:X(n,`file`),...e===``?{}:{alt:e},...r===``?{}:{caption:r}});break}case J.embed:t.push({type:`embed`,url:X(n,`url`)})}let n=t[0];return t.length===1&&n?.type===`paragraph`&&n.runs.every(e=>e.text===``)?[]:t}var St=(0,G.createContext)(()=>void 0),Q=e=>typeof e==`string`?e:``;function Ct({node:e,updateAttributes:t}){let n=R(),r=(0,G.useContext)(St),i=Q(e.attrs.file),a=r(i);return(0,K.jsxs)(N,{as:`figure`,"data-li":`image`,className:`relative`,children:[(0,K.jsxs)(`div`,{className:`relative`,children:[a===void 0?(0,K.jsx)(`div`,{className:`ak-li-made`,children:i}):(0,K.jsx)(`img`,{src:a,alt:Q(e.attrs.alt)}),(0,K.jsx)(`div`,{className:`absolute bottom-2 left-2`,contentEditable:!1,children:(0,K.jsx)(pe,{most:Ze.alt,alt:Q(e.attrs.alt),onAlt:e=>{t({alt:e})},trigger:(0,K.jsx)(u,{variant:`secondary`,size:`xs`,className:`bg-media/75 text-on-media font-bold`,children:n.alt})})})]}),(0,K.jsx)(`input`,{className:`mt-2 w-full bg-transparent text-center text-sm text-[var(--ak-li-muted)] outline-none`,value:Q(e.attrs.caption),placeholder:n.article.caption,"aria-label":n.article.caption,dir:`auto`,onChange:e=>{t({caption:e.target.value})}})]})}function wt({node:e}){return(0,K.jsx)(N,{"data-li":`embed`,children:(0,K.jsx)(Ge,{url:Q(e.attrs.url)})})}function Tt(e,t,n){return j.create({name:e,group:`block`,atom:!0,selectable:!0,draggable:!0,addAttributes(){return Object.fromEntries(t.map(e=>[e,{default:``}]))},parseHTML(){return[{tag:`div[data-node="${e}"]`}]},renderHTML({HTMLAttributes:t}){return[`div`,P(t,{"data-node":e})]},addNodeView(){return me(n)}})}var Et=[Tt(J.image,[`file`,`alt`,`caption`],Ct),Tt(J.embed,[`url`],wt)],Dt=3e4;function Ot(e){return V(e).issues.some(e=>e.rule===`article-markup`||e.rule===`format`)}var kt=class{head;listeners=new Set;body;show;session;constructor(e){this.session=e;let{article:t}=V(e.text);this.head={title:t.title,cover:t.cover,state:e.state,held:Ot(e.text)},e.attach({save:e=>{let t=this.article();if(t===void 0||Ot(e))return;let n=ct(t);return n===ct(V(e).article)?void 0:n},take:(e,t,n)=>{let{article:r}=V(e),i=n?.kind===`agent`?pt(V(t).article,r):void 0;this.set({title:r.title,cover:r.cover,held:Ot(e),...i===void 0?{}:{landed:{spot:i,at:Date.now()}}}),this.show?.(r)}}),e.onState(e=>{this.set({state:e})})}get read(){return V(this.session.text).article}bind(e,t){this.body=e,this.show=t}article(){if(this.body!==void 0)return{title:this.head.title,...this.head.cover?{cover:this.head.cover}:{},blocks:this.body()}}get(){return this.head}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}set(e){this.head={...this.head,...e};for(let e of this.listeners)e()}edited(e={}){Object.keys(e).length>0&&this.set(e),this.session.edited()}};function $(e){return(0,K.jsx)(u,{variant:`ghost`,size:`icon-sm`,"aria-label":e.label,title:e.label,"aria-pressed":e.on,disabled:e.disabled,className:c(e.on===!0&&`bg-here`),onMouseDown:e=>{e.preventDefault()},onClick:e.onClick,children:e.children})}function At(e){let t=R(),[n,r]=(0,G.useState)(!1),[i,a]=(0,G.useState)(``),o=i.trim()===``||/^https?:\/\/\S+$/u.test(i.trim())?void 0:t.article.notLink;return(0,K.jsxs)(S,{open:n,onOpenChange:e=>{r(e),e&&a(``)},children:[(0,K.jsx)(b,{asChild:!0,children:(0,K.jsx)(u,{variant:`ghost`,size:`icon-sm`,"aria-label":e.label,title:e.label,disabled:e.disabled,children:e.icon})}),(0,K.jsx)(x,{className:`w-80`,align:`start`,children:(0,K.jsxs)(`form`,{className:`flex flex-col gap-2`,onSubmit:t=>{t.preventDefault(),i.trim()!==``&&o===void 0&&(e.onAnswer(i.trim()),r(!1))},children:[(0,K.jsx)(_e,{autoFocus:!0,value:i,placeholder:e.hint,"aria-label":e.hint,onChange:e=>{a(e.target.value)}}),o===void 0?null:(0,K.jsx)(`p`,{className:`text-destructive text-xs`,children:o}),(0,K.jsx)(u,{type:`submit`,size:`sm`,className:`self-end`,disabled:i.trim()===``||o!==void 0,children:t.article.add})]})})]})}function jt({editor:e}){let t=R().article,n=()=>e.chain().focus(),r=e.isActive(`heading`,{level:1})?t.heading:e.isActive(`heading`,{level:2})?t.subheading:t.normal;return(0,K.jsxs)(ne,{children:[(0,K.jsx)(_,{asChild:!0,children:(0,K.jsxs)(u,{variant:`ghost`,size:`sm`,className:`w-28 justify-between gap-1 px-2`,"aria-label":t.style,onMouseDown:e=>{e.preventDefault()},children:[r,(0,K.jsx)(g,{})]})}),(0,K.jsxs)(te,{align:`start`,className:`w-44`,children:[(0,K.jsx)(y,{className:`text-sm`,onSelect:()=>n().setParagraph().run(),children:t.normal}),(0,K.jsx)(y,{className:`text-base font-semibold`,onSelect:()=>n().setHeading({level:1}).run(),children:t.heading}),(0,K.jsx)(y,{className:`text-sm font-semibold`,onSelect:()=>n().setHeading({level:2}).run(),children:t.subheading})]})]})}function Mt({article:e}){let t=R().article,[n,r]=(0,G.useState)(!1);return(0,G.useEffect)(()=>{if(!n)return;let e=setTimeout(()=>{r(!1)},4e3);return()=>{clearTimeout(e)}},[n]),(0,K.jsxs)(u,{variant:`outline`,size:`sm`,className:`gap-1`,title:n?t.copied:t.copy,"data-testid":`linkedin-copy`,onClick:()=>{let t=e(),n=ut(t),i=dt(t);navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([n],{type:`text/html`}),"text/plain":new Blob([i],{type:`text/plain`})})]).then(()=>{r(!0)})},children:[n?(0,K.jsx)(v,{}):(0,K.jsx)(E,{}),n?t.copied:t.copy]})}function Nt({editor:e,dir:t,entry:n}){let r=R(),i=r.article,[,a]=(0,G.useState)(0);(0,G.useEffect)(()=>{let t=()=>{a(e=>e+1)};return e.on(`transaction`,t),()=>{e.off(`transaction`,t)}},[e]);let[o,s]=(0,G.useState)(!1),c=()=>e.chain().focus(),l=(t,n)=>{let{$from:r}=e.state.selection;r.depth>1?c().insertContentAt(r.after(1),{type:t,attrs:n}).run():c().insertContent({type:t,attrs:n}).run()},f=e.getText().split(/\s+/u).filter(e=>e!==``).length;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)($,{label:r.undo,disabled:!e.can().undo(),onClick:()=>c().undo().run(),children:(0,K.jsx)(L,{})}),(0,K.jsx)($,{label:r.redo,disabled:!e.can().redo(),onClick:()=>c().redo().run(),children:(0,K.jsx)(I,{})}),(0,K.jsx)(`span`,{className:`bg-rule mx-1 h-5 w-px`,"aria-hidden":`true`}),(0,K.jsx)(jt,{editor:e}),(0,K.jsx)($,{label:i.bold,on:e.isActive(`bold`),onClick:()=>c().toggleBold().run(),children:(0,K.jsx)(w,{})}),(0,K.jsx)($,{label:i.italic,on:e.isActive(`italic`),onClick:()=>c().toggleItalic().run(),children:(0,K.jsx)(T,{})}),(0,K.jsx)($,{label:i.bullets,on:e.isActive(`bulletList`),onClick:()=>c().toggleBulletList().run(),children:(0,K.jsx)(O,{})}),(0,K.jsx)($,{label:i.numbers,on:e.isActive(`orderedList`),onClick:()=>c().toggleOrderedList().run(),children:(0,K.jsx)(k,{})}),(0,K.jsx)($,{label:i.quote,on:e.isActive(`blockquote`),onClick:()=>c().toggleBlockquote().run(),children:(0,K.jsx)(F,{})}),(0,K.jsx)($,{label:i.code,on:e.isActive(`codeBlock`),onClick:()=>c().toggleCodeBlock().run(),children:(0,K.jsx)(Qe,{})}),(0,K.jsx)($,{label:i.divider,onClick:()=>c().setHorizontalRule().run(),children:(0,K.jsx)(A,{})}),e.isActive(`link`)?(0,K.jsx)($,{label:i.removeLink,on:!0,onClick:()=>c().extendMarkRange(`link`).unsetLink().run(),children:(0,K.jsx)(d,{})}):(0,K.jsx)(At,{label:i.link,hint:i.linkHint,icon:(0,K.jsx)(D,{}),disabled:e.state.selection.empty,onAnswer:e=>{c().extendMarkRange(`link`).setLink({href:e}).run()}}),(0,K.jsx)(At,{label:i.embed,hint:i.embedHint,icon:(0,K.jsx)($e,{}),onAnswer:e=>{l(J.embed,{url:e})}}),(0,K.jsxs)(S,{open:o,onOpenChange:s,children:[(0,K.jsx)(b,{asChild:!0,children:(0,K.jsx)(u,{variant:`ghost`,size:`icon-sm`,"aria-label":i.image,title:i.image,children:(0,K.jsx)(ve,{})})}),(0,K.jsx)(x,{className:`w-auto`,align:`start`,children:(0,K.jsx)(oe,{self:n,types:qe,testId:`linkedin-picker`,onPick:e=>{s(!1),l(J.image,{file:de(t,e),alt:``,caption:``})}})})]}),(0,K.jsx)(`span`,{className:`text-muted-foreground ml-2 text-xs tabular-nums`,children:i.words(f)})]})}function Pt({doc:e,dir:n,entry:o}){let c=R(),f=r(),p=a(),[m,ee]=ue(),h=(0,G.useSyncExternalStore)(t=>e.subscribe(t),()=>e.get()),g=p||h.held,_=(0,G.useMemo)(()=>e.read,[e]),[te,v]=(0,G.useState)(()=>_.blocks.flatMap(e=>e.type===`image`?[e.file]:[])),y=he({textDirection:`auto`,editable:!g,immediatelyRender:!0,extensions:[We.configure({heading:{levels:[1,2]},listItem:!1,blockquote:!1,code:!1,strike:!1,underline:!1,hardBreak:!1,link:{openOnClick:!1,autolink:!0}}),He.extend({content:`paragraph`}),Ue.extend({content:`paragraph`}),Ve.configure({placeholder:c.article.body}),gt,...Et],content:bt(_.blocks),onUpdate:({editor:t,transaction:n})=>{n.docChanged&&(v(Z(t.getJSON()).flatMap(e=>e.type===`image`?[e.file]:[])),e.edited())}}),[ne,C]=(0,G.useState)(()=>_.blocks);(0,G.useEffect)(()=>{e.bind(()=>Z(y.getJSON()),e=>{y.commands.setContent(bt(e.blocks),{emitUpdate:!1}),v(e.blocks.flatMap(e=>e.type===`image`?[e.file]:[])),C(e.blocks)})},[e,y]),(0,G.useEffect)(()=>{y.setEditable(!g)},[y,g]),(0,G.useEffect)(()=>{let e=()=>{C(Z(y.getJSON()))};return y.on(`update`,e),()=>{y.off(`update`,e)}},[y]);let w=(0,G.useDeferredValue)(ne),{agent:T,following:E}=t(),pe=re(),D=(()=>{if(T?.doing===void 0)return;let t=h.landed,n=t!==void 0&&t.at>=T.at-Dt;return n&&T.source?.path===o?t.spot:(T.source?ht(T.source,{path:o,text:e.session.text}):void 0)??(n?t.spot:void 0)})(),O=D&&`block`in D?D.block:void 0,k=D!==void 0&&`head`in D,A=T?pe(T):``,j=(0,G.useRef)(null),M=(0,G.useRef)(null);(0,G.useEffect)(()=>{_t(y,O===void 0?null:{block:O,label:A})},[y,O,A]),(0,G.useEffect)(()=>{let e=M.current;if(e){for(let t of e.querySelectorAll(`[data-agent]`))t.removeAttribute(`data-agent`);(k?e.querySelector(`.ak-li-a-title`):O===void 0?null:e.querySelector(`.ak-li-a-body`)?.children[O])?.setAttribute(`data-agent`,``)}},[O,k,w,h.title]),(0,G.useEffect)(()=>{E&&D!==void 0&&((k?j.current?.querySelector(`.ak-li-a-title`):j.current?.querySelector(`[data-testid="linkedin-agent-block"]`))?.scrollIntoView({block:`nearest`}),M.current?.querySelector(`[data-agent]`)?.scrollIntoView({block:`nearest`}))},[E,D,k,h.landed]),i({hold:()=>Promise.resolve({key:`${o}@${String(e.session.text.length)}`,what:`The LinkedIn article ${o}`,source:{path:o}}),locate:t=>{let n=V(e.session.text),r=e=>{let t=e?.getBoundingClientRect();return t&&t.width>0&&t.height>0?{x:t.x,y:t.y,width:t.width,height:t.height}:void 0},i=s(t)[0],a=e=>e!==void 0&&i!==void 0&&i.x>=e.x&&i.x<=e.x+e.width&&i.y>=e.y&&i.y<=e.y+e.height,c=[{as:`where it is written`,head:[`.ak-li-a-cover`,`.ak-li-a-title`].map(e=>j.current?.querySelector(e)),blocks:[...j.current?.querySelector(`.ak-li-a-body .ProseMirror`)?.children??[]]},{as:`as LinkedIn will show it`,head:[`.ak-li-a-cover`,`.ak-li-a-title`].map(e=>M.current?.querySelector(e)),blocks:[...M.current?.querySelector(`.ak-li-a-body`)?.children??[]]}],u=e=>e===void 0?{}:{line:e.from,...e.to>e.from?{endLine:e.to}:{}},d=c.some(e=>e.head.some(e=>{let n=r(e);return n!==void 0&&l(t,n)})),f=new Set;for(let e of c)e.blocks.forEach((e,n)=>{let i=r(e);i&&l(t,i)&&f.add(n)});let p=[...d?[{name:`the article's head: its cover and title`,source:{path:o,...u(n.head)},...h.title===``?{}:{text:h.title}}]:[],...[...f].sort((e,t)=>e-t).map(e=>{let t=c.map(t=>t.blocks[e]?.textContent.trim()??``).find(e=>e!==``)??``;return{name:`block ${String(e+1)} of the article`,source:{path:o,...u(n.lines[e])},...t===``?{}:{text:t}}})],m=c.flatMap(e=>{if(e.head.some(e=>a(r(e))))return[`in the article's head, ${e.as}`];let t=e.blocks.findIndex(e=>a(r(e)));return t<0?[]:[`in block ${String(t+1)}, ${e.as}`]}).at(0);return Promise.resolve({elements:p,...m===void 0?{}:{where:m}})}});let N=le(n,[...h.cover?[h.cover.file]:[],...te]),P=(0,G.useMemo)(()=>e=>N.get(e),[N]),[me,F]=(0,G.useState)(!1),I=h.cover===void 0?void 0:N.get(h.cover.file),L=f?.theme===`dark`,_e=(0,K.jsxs)(S,{open:me,onOpenChange:F,children:[(0,K.jsx)(`div`,{className:`ak-li-a-cover ak-li-e-cover relative`,children:h.cover===void 0?g?null:(0,K.jsx)(b,{asChild:!0,children:(0,K.jsxs)(u,{variant:`ghost`,className:`size-full flex-col gap-2 rounded-none text-sm font-normal text-[var(--ak-li-muted)]`,children:[(0,K.jsx)(ae,{className:`size-6`}),c.article.addCover]})}):(0,K.jsxs)(K.Fragment,{children:[I===void 0?(0,K.jsx)(`div`,{className:`ak-li-made`,children:h.cover.file}):/\.mp4$/iu.test(h.cover.file)?(0,K.jsx)(`video`,{src:I,muted:!0,playsInline:!0,className:`w-full`}):(0,K.jsx)(`img`,{src:I,alt:h.cover.alt??``}),g?null:(0,K.jsxs)(`div`,{className:`absolute top-2 right-2 flex gap-1`,children:[(0,K.jsx)(b,{asChild:!0,children:(0,K.jsxs)(u,{variant:`secondary`,size:`sm`,className:`bg-media/75 text-on-media`,children:[(0,K.jsx)(ae,{}),c.article.changeCover]})}),(0,K.jsx)(u,{variant:`secondary`,size:`icon-sm`,className:`bg-media/75 text-on-media`,"aria-label":c.article.removeCover,title:c.article.removeCover,onClick:()=>{e.edited({cover:void 0})},children:(0,K.jsx)(d,{})})]})]})}),(0,K.jsx)(x,{className:`w-auto`,align:`center`,children:(0,K.jsx)(oe,{self:o,types:Ye,testId:`linkedin-picker`,onPick:t=>{F(!1),e.edited({cover:{file:de(n,t)}})}})})]}),ve=(0,K.jsxs)(`div`,{ref:j,className:`ak-li ak-li-editing min-h-full`,"data-theme":L?`dark`:`light`,children:[_e,(0,K.jsxs)(`div`,{className:`ak-li-e-page`,children:[(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(`textarea`,{className:`ak-li-a-title block w-full resize-none border-0 bg-transparent p-0 outline-none [field-sizing:content] placeholder:text-[var(--ak-li-muted)]`,value:h.title,placeholder:c.article.title,"aria-label":c.article.title,readOnly:g,dir:`auto`,"data-testid":`linkedin-article-title`,onChange:t=>{g||e.edited({title:t.target.value.replace(/\n/gu,` `)})}}),T&&k?(0,K.jsx)(xe,{"data-testid":`linkedin-agent-head`,label:A,className:`-inset-1`}):null]}),(0,K.jsx)(Ke,{}),(0,K.jsx)(St.Provider,{value:P,children:(0,K.jsx)(`div`,{className:`ak-li-a-body`,"data-testid":`linkedin-article-body`,children:(0,K.jsx)(ge,{editor:y,className:`[&_.ProseMirror]:outline-none`})})})]})]}),be=()=>({title:h.title,...h.cover?{cover:h.cover}:{},blocks:Z(y.getJSON())}),Se=(0,K.jsx)(`div`,{ref:M,className:`ak-li ak-li-page`,"data-theme":L?`dark`:`light`,children:(0,K.jsx)(Xe,{article:{title:h.title,...h.cover?{cover:h.cover}:{},blocks:w},source:P})});return(0,K.jsxs)(`div`,{className:`bg-background flex size-full flex-col`,"data-testid":`linkedin-article-editor`,children:[(0,K.jsx)(ie,{start:(0,K.jsxs)(K.Fragment,{children:[g||m!==`edit`?null:(0,K.jsx)(Nt,{editor:y,dir:n,entry:o}),(0,K.jsx)(`span`,{className:`flex-1`}),(0,K.jsx)(fe,{pane:m,onPane:ee}),(0,K.jsx)(Mt,{article:be})]}),saved:{state:h.state},exports:{}}),(0,K.jsx)(Je.Provider,{value:se,children:(0,K.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[h.held?(0,K.jsx)(ye,{}):null,(0,K.jsx)(ce,{pane:m,edit:ve,preview:Se,width:632,background:L?`#000000`:`#f4f2ee`,testId:`linkedin-preview`})]})})]})}function Ft(){let e=R(),t=o(),n=r(),i=n?.item.entry,a=n?.item.dir??``,[s,c]=(0,G.useState)(),[l,u]=(0,G.useState)(!1);return(0,G.useEffect)(()=>{if(i===void 0)return;let e,n=!0;return ee.open(t,i).then(t=>{n?(e=t,c(new kt(t))):t.close()},e=>{reportError(e),n&&u(!0)}),()=>{n=!1,e?.close()}},[t,i]),l?(0,K.jsx)(`div`,{className:`flex size-full`,"data-testid":`linkedin-article-editor`,"data-state":`updating`,children:(0,K.jsx)(be,{})}):!s||i===void 0?(0,K.jsx)(`div`,{className:`text-muted-foreground flex size-full items-center justify-center text-sm`,"data-testid":`linkedin-article-editor`,"data-state":`loading`,children:e.article.loading}):(0,K.jsx)(Pt,{doc:s,dir:a,entry:i})}export{Ft as LinkedInArticleEditor,Ft as default,Z as fromDoc,bt as toDoc};
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{b as t}from"./react-Byupo4pA.js";import{$ as n,J as r,K as i,Q as a,X as o,Y as s,Z as c,at as l,ct as u,dt as d,et as f,ft as p,ht as m,i as h,it as g,jt as _,mt as v,n as y,nt as b,o as x,ot as S,q as C,r as w,rt as T,s as E,st as D,tt as O,ut as k}from"./x-BAJilkKD.js";import{t as A}from"./jsx-runtime-DePvh3-m.js";import{t as j}from"./createLucideIcon-euu7Wcd9.js";var M=e(t(),1),N=A(),P=Object.defineProperty,F=(e,t)=>P(e,`name`,{value:t,configurable:!0});function I(e){let t=e+`CollectionProvider`,[n,r]=D(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=F(e=>{let{scope:t,children:n}=e,r=M.useRef(null),a=M.useRef(new Map).current;return(0,N.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=p(s),l=M.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(s,n),o=v(t,i.collectionRef);return(0,N.jsx)(c,{ref:o,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=p(u),m=M.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=M.useRef(null),s=v(t,o),c=a(u,n);return M.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,N.jsx)(f,{[d]:``,ref:s,children:r})});m.displayName=u;function h(t){let n=a(e+`CollectionConsumer`,t);return M.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return F(h,`useCollection`),[{Provider:o,Slot:l,ItemSlot:m},h,r]}F(I,`createCollection`);var L=new WeakMap,R=class e extends Map{static{F(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],L.set(this,!0)}set(e,t){return L.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=ne(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=ee(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=ee(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return ee(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function ee(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=te(e,t);return n===-1?void 0:e[n]}F(ee,`at`);function te(e,t){let n=e.length,r=ne(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}F(te,`toSafeIndex`);function ne(e){return e!==e||e===0?0:Math.trunc(e)}F(ne,`toSafeInteger`);function z(e){let t=e+`CollectionProvider`,[n,r]=D(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new R,setItemMap:F(()=>void 0,`setItemMap`)}),o=F(({state:e,...t})=>e?(0,N.jsx)(c,{...t,state:e}):(0,N.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=F(e=>{let t=g();return(0,N.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=F(e=>{let{scope:t,children:n,state:r}=e,a=M.useRef(null),[o,s]=M.useState(null),c=v(a,s),[l,u]=r;return M.useEffect(()=>{if(!o)return;let e=ae(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,N.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=p(l),d=M.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(l,n),o=v(t,i.collectionRef);return(0,N.jsx)(u,{ref:o,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,m=p(f),h=M.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=M.useRef(null),[s,c]=M.useState(null),l=v(t,o,c),{setItemMap:u}=a(f,n),d=M.useRef(i);B(d.current,i)||(d.current=i);let p=d.current;return M.useEffect(()=>{let e=p;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(ie):(t.set(s,{...e,element:s}),t.toSorted(ie)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new R(e)))}},[s,p,u]),(0,N.jsx)(m,{"data-radix-collection-item":``,ref:l,children:r})});h.displayName=f;function g(){return M.useState(new R)}F(g,`useInitCollection`);function _(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return F(_,`useCollection`),[{Provider:o,Slot:d,ItemSlot:h},{createCollectionScope:r,useCollection:_,useInitCollection:g}]}F(z,`createCollection`);function B(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}F(B,`shallowEqual`);function re(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}F(re,`isElementPreceding`);function ie(e,t){return!e[1].element||!t[1].element?0:re(e[1].element,t[1].element)?-1:1}F(ie,`sortByDocumentPosition`);function ae(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}F(ae,`getChildListObserver`);var V=Object.defineProperty,oe=(e,t)=>V(e,`name`,{value:t,configurable:!0}),se={LTR:`ltr`,RTL:`rtl`},H=M.createContext(void 0);function ce(e){let t=M.useContext(H);return e||t||se.LTR}oe(ce,`useDirection`);var U=Object.defineProperty,le=(e,t)=>U(e,`name`,{value:t,configurable:!0}),ue=!1;function de(){let[e,t]=M.useState(ue);return M.useEffect(()=>{ue||(ue=!0,t(!0))},[]),e}le(de,`useIsHydrated`);var fe=M.useSyncExternalStore;function pe(){return()=>{}}le(pe,`subscribe`);function me(){return fe(pe,()=>!0,()=>!1)}le(me,`useIsHydratedModern`);var he=typeof fe==`function`?me:de,ge=Object.defineProperty,W=(e,t)=>ge(e,`name`,{value:t,configurable:!0}),_e=`rovingFocusGroup.onEntryFocus`,ve={bubbles:!1,cancelable:!0},ye=`RovingFocusGroup`,[be,G,xe]=I(ye),[Se,K]=D(ye,[xe]),Ce={Vertical:`vertical`,Horizontal:`horizontal`},we={LTR:`ltr`,RTL:`rtl`},[Te,Ee]=Se(ye),De=M.forwardRef(W(function(e,t){return(0,N.jsx)(be.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,N.jsx)(be.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,N.jsx)(Oe,{...e,ref:t})})})},`RovingFocusGroup`)),Oe=M.forwardRef(W(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=M.useRef(null),p=v(t,f),m=ce(a),[h,_]=g({prop:o,defaultProp:s??null,onChange:c,caller:ye}),[y,b]=M.useState(!1),x=O(l),C=G(n),w=M.useRef(!1),[T,E]=M.useState(0);return M.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(_e,x),()=>e.removeEventListener(_e,x)},[x]),(0,N.jsx)(Te,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:M.useCallback(e=>_(e),[_]),onItemShiftTab:M.useCallback(()=>b(!0),[]),onFocusableItemAdd:M.useCallback(()=>E(e=>e+1),[]),onFocusableItemRemove:M.useCallback(()=>E(e=>e-1),[]),children:(0,N.jsx)(k.div,{tabIndex:y||T===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:S(e.onMouseDown,()=>{w.current=!0}),onFocus:S(e.onFocus,e=>{let t=!w.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(_e,ve);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=C().filter(e=>e.focusable);Pe([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}w.current=!1}),onBlur:S(e.onBlur,()=>b(!1))})})},`RovingFocusGroupImpl`)),ke=`RovingFocusGroupItem`,Ae=M.forwardRef(W(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=b(),u=a||c,d=Ee(ke,n),f=d.currentTabStopId===u,p=G(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:g}=d,_=he();return l(()=>{if(_&&r)return m(),()=>h()},[_,r,m,h]),M.useEffect(()=>{if(!_&&r)return m(),()=>h()},[_,r,m,h]),(0,N.jsx)(be.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:(0,N.jsx)(k.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:S(e.onMouseDown,e=>{r?d.onItemFocus(u):e.preventDefault()}),onFocus:S(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:S(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Ne(e,d.orientation,d.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=d.loop?Fe(n,r+1):n.slice(r+1)}setTimeout(()=>Pe(n))}}),children:typeof o==`function`?o({isCurrentTabStop:f,hasTabStop:g!=null}):o})})},`RovingFocusGroupItem`)),je={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Me(e,t){return t===we.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}W(Me,`getDirectionAwareKey`);function Ne(e,t,n){let r=Me(e.key,n);if(!(t===Ce.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Ce.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return je[r]}W(Ne,`getFocusIntent`);function Pe(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}W(Pe,`focusFirst`);function Fe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}W(Fe,`wrapArray`);var Ie=Object.defineProperty,q=(e,t)=>Ie(e,`name`,{value:t,configurable:!0}),Le={LTR:`ltr`,RTL:`rtl`},Re=[`Enter`,` `],ze=[`ArrowDown`,`PageUp`,`Home`],Be=[`ArrowUp`,`PageDown`,`End`],Ve=[...ze,...Be],He={ltr:[...Re,`ArrowRight`],rtl:[...Re,`ArrowLeft`]},Ue={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},We=`Menu`,[Ge,Ke,qe]=I(We),[Je,Ye]=D(We,[qe,E,K]),Xe=E(),Ze=K(),[Qe,$e]=Je(We),[et,tt]=Je(We),nt=q(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Xe(t),[c,l]=M.useState(null),u=M.useRef(!1),d=O(a),f=ce(i);return M.useEffect(()=>{let e=q(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=q(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),M.useEffect(()=>{if(!n)return;let e=q(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,N.jsx)(w,{...s,children:(0,N.jsx)(Qe,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,N.jsx)(et,{scope:t,onClose:M.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),rt=M.forwardRef(q(function(e,t){let{__scopeMenu:n,...r}=e,i=Xe(n);return(0,N.jsx)(h,{...i,...r,ref:t})},`MenuAnchor`)),it=`MenuPortal`,[at,ot]=Je(it,{forceMount:void 0}),st=q(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=$e(it,t);return(0,N.jsx)(at,{scope:t,forceMount:n,children:(0,N.jsx)(T,{present:n||a.open,children:(0,N.jsx)(s,{asChild:!0,container:i,children:r})})})},`MenuPortal`),J=`MenuContent`,[ct,lt]=Je(J),ut=M.forwardRef(q(function(e,t){let n=ot(J,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=$e(J,e.__scopeMenu),o=tt(J,e.__scopeMenu);return(0,N.jsx)(Ge.Provider,{scope:e.__scopeMenu,children:(0,N.jsx)(T,{present:r||a.open,children:(0,N.jsx)(Ge.Slot,{scope:e.__scopeMenu,children:o.modal?(0,N.jsx)(dt,{...i,ref:t}):(0,N.jsx)(ft,{...i,ref:t})})})})},`MenuContent`)),dt=M.forwardRef(q(function(e,t){let n=$e(J,e.__scopeMenu),r=M.useRef(null),a=v(t,r);return M.useEffect(()=>{let e=r.current;if(e)return i(e)},[]),(0,N.jsx)(mt,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:S(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),ft=M.forwardRef(q(function(e,t){let n=$e(J,e.__scopeMenu);return(0,N.jsx)(mt,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),pt=p(`MenuContent.ScrollLock`),mt=M.forwardRef(q(function(e,t){let{__scopeMenu:i,loop:s=!1,trapFocus:l,onOpenAutoFocus:u,onCloseAutoFocus:d,disableOutsidePointerEvents:p,onEntryFocus:m,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:_,onInteractOutside:y,onDismiss:b,disableOutsideScroll:w,...T}=e,E=$e(J,i),D=tt(J,i),O=Xe(i),k=Ze(i),A=Ke(i),[j,P]=M.useState(null),F=M.useRef(null),[I,L]=M.useState(null);a(I);let{nodes:R,registry:ee}=n(),te=!!(l||w),ne=v(t,F,E.onContentChange,L),z=M.useRef(0),B=M.useRef(``),re=M.useRef(0),ie=M.useRef(null),ae=M.useRef(`right`),V=M.useRef(0),oe=M.useMemo(()=>w?[F,...R.map(e=>({current:e}))]:[],[F,R,w]),se=w?C:M.Fragment,H=w?{as:pt,allowPinchZoom:!0,shards:oe}:void 0,ce=q(e=>{let t=B.current+e,n=A().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Gt(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;q((function e(t){B.current=t,window.clearTimeout(z.current),t!==``&&(z.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);M.useEffect(()=>()=>window.clearTimeout(z.current),[]),r();let U=M.useCallback(e=>ae.current===ie.current?.side&&qt(e,ie.current?.area),[]);return(0,N.jsx)(ct,{scope:i,searchRef:B,onItemEnter:M.useCallback(e=>{U(e)&&e.preventDefault()},[U]),onItemLeave:M.useCallback(e=>{U(e)||(F.current?.focus(),P(null))},[U]),onTriggerLeave:M.useCallback(e=>{U(e)&&e.preventDefault()},[U]),pointerGraceTimerRef:re,onPointerGraceIntentChange:M.useCallback(e=>{ie.current=e},[]),children:(0,N.jsx)(c,{registry:te?ee:null,children:(0,N.jsx)(se,{...H,children:(0,N.jsx)(o,{asChild:!0,trapped:l,branches:R,onMountAutoFocus:S(u,e=>{e.preventDefault(),F.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:(0,N.jsx)(f,{asChild:!0,disableOutsidePointerEvents:p,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:_,onInteractOutside:y,onDismiss:b,children:(0,N.jsx)(De,{asChild:!0,...k,dir:D.dir,orientation:`vertical`,loop:s,currentTabStopId:j,onCurrentTabStopIdChange:P,onEntryFocus:S(m,e=>{D.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,N.jsx)(x,{role:`menu`,"aria-orientation":`vertical`,"data-state":Bt(E.open),"data-radix-menu-content":``,dir:D.dir,...O,...T,ref:ne,style:{outline:`none`,...T.style},onKeyDown:S(T.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ce(e.key));let i=F.current;if(e.target!==i||!Ve.includes(e.key))return;e.preventDefault();let a=A().filter(e=>!e.disabled).map(e=>e.ref.current);Be.includes(e.key)&&a.reverse(),Ut(a)}),onBlur:S(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(z.current),B.current=``)}),onPointerMove:S(e.onPointerMove,Jt(e=>{let t=e.target,n=V.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>V.current?`right`:`left`;ae.current=t,V.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),ht=M.forwardRef(q(function(e,t){let{__scopeMenu:n,...r}=e;return(0,N.jsx)(k.div,{role:`group`,...r,ref:t})},`MenuGroup`)),gt=M.forwardRef(q(function(e,t){let{__scopeMenu:n,...r}=e;return(0,N.jsx)(k.div,{...r,ref:t})},`MenuLabel`)),_t=`MenuItem`,vt=`menu.itemSelect`,yt=M.forwardRef(q(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=M.useRef(null),o=tt(_t,e.__scopeMenu),s=lt(_t,e.__scopeMenu),c=v(t,a),l=M.useRef(!1),u=q(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(vt,{bubbles:!0,cancelable:!0});e.addEventListener(vt,e=>r?.(e),{once:!0}),d(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,N.jsx)(bt,{...i,ref:c,disabled:n,onClick:S(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:S(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:S(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&Re.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),bt=M.forwardRef(q(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=lt(_t,n),s=Ze(n),c=M.useRef(null),l=v(t,c),[u,d]=M.useState(!1),[f,p]=M.useState(``);return M.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,N.jsx)(Ge.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,N.jsx)(Ae,{asChild:!0,...s,focusable:!r,children:(0,N.jsx)(k.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:S(e.onPointerMove,Jt(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:S(e.onPointerLeave,Jt(e=>o.onItemLeave(e))),onFocus:S(e.onFocus,()=>d(!0)),onBlur:S(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),xt=M.forwardRef(q(function(e,t){let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,N.jsx)(Ot,{scope:e.__scopeMenu,checked:n,children:(0,N.jsx)(yt,{role:`menuitemcheckbox`,"aria-checked":Vt(n)?`mixed`:n,...i,ref:t,"data-state":Ht(n),onSelect:S(i.onSelect,()=>r?.(Vt(n)?!0:!n),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[St,Ct]=Je(`MenuRadioGroup`,{value:void 0,onValueChange:q(()=>{},`onValueChange`)}),wt=M.forwardRef(q(function(e,t){let{value:n,onValueChange:r,...i}=e,a=O(r);return(0,N.jsx)(St,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,N.jsx)(ht,{...i,ref:t})})},`MenuRadioGroup`)),Tt=`MenuRadioItem`,Et=M.forwardRef(q(function(e,t){let{value:n,...r}=e,i=Ct(Tt,e.__scopeMenu),a=n===i.value;return(0,N.jsx)(Ot,{scope:e.__scopeMenu,checked:a,children:(0,N.jsx)(yt,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Ht(a),onSelect:S(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),Dt=`MenuItemIndicator`,[Ot,kt]=Je(Dt,{checked:!1}),At=M.forwardRef(q(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=kt(Dt,n);return(0,N.jsx)(T,{present:r||Vt(a.checked)||a.checked===!0,children:(0,N.jsx)(k.span,{...i,ref:t,"data-state":Ht(a.checked)})})},`MenuItemIndicator`)),jt=M.forwardRef(q(function(e,t){let{__scopeMenu:n,...r}=e;return(0,N.jsx)(k.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),Mt=`MenuSub`,[Nt,Pt]=Je(Mt),Ft=q(e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=$e(Mt,t),o=Xe(t),[s,c]=M.useState(null),[l,u]=M.useState(null),d=O(i);return M.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,N.jsx)(w,{...o,children:(0,N.jsx)(Qe,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,N.jsx)(Nt,{scope:t,contentId:b(),triggerId:b(),trigger:s,onTriggerChange:c,children:n})})})},`MenuSub`),It=`MenuSubTrigger`,Lt=M.forwardRef(q(function(e,t){let n=$e(It,e.__scopeMenu),r=tt(It,e.__scopeMenu),i=Pt(It,e.__scopeMenu),a=lt(It,e.__scopeMenu),o=M.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=M.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);M.useEffect(()=>u,[u]),M.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=v(t,i.onTriggerChange);return(0,N.jsx)(rt,{asChild:!0,...l,children:(0,N.jsx)(bt,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":Bt(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:S(e.onPointerMove,Jt(t=>{a.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||o.current||(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:S(e.onPointerLeave,Jt(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:S(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(a.searchRef.current===``||t.key!==` `)&&He[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),Rt=`MenuSubContent`,zt=M.forwardRef(q(function(e,t){let n=ot(J,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=$e(J,e.__scopeMenu),s=tt(J,e.__scopeMenu),c=Pt(Rt,e.__scopeMenu),l=M.useRef(null),u=v(t,l);return(0,N.jsx)(Ge.Provider,{scope:e.__scopeMenu,children:(0,N.jsx)(T,{present:r||o.open,children:(0,N.jsx)(Ge.Slot,{scope:e.__scopeMenu,children:(0,N.jsx)(mt,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===Le.RTL?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:S(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:S(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:S(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Ue[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function Bt(e){return e?`open`:`closed`}q(Bt,`getOpenState`);function Vt(e){return e===`indeterminate`}q(Vt,`isIndeterminate`);function Ht(e){return Vt(e)?`indeterminate`:e?`checked`:`unchecked`}q(Ht,`getCheckedState`);function Ut(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}q(Ut,`focusFirst`);function Wt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}q(Wt,`wrapArray`);function Gt(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Wt(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}q(Gt,`getNextMatch`);function Kt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}q(Kt,`isPointInPolygon`);function qt(e,t){return t?Kt({x:e.clientX,y:e.clientY},t):!1}q(qt,`isPointerInGraceArea`);function Jt(e){return t=>t.pointerType===`mouse`?e(t):void 0}q(Jt,`whenMouse`);var Yt=Object.defineProperty,Y=(e,t)=>Yt(e,`name`,{value:t,configurable:!0}),Xt=`DropdownMenu`,[Zt,Qt]=D(Xt,[Ye]),X=Ye(),[$t,en]=Zt(Xt),tn=Y(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=X(t),l=M.useRef(null),[u,d]=g({prop:i,defaultProp:a??!1,onChange:o,caller:Xt});return(0,N.jsx)($t,{scope:t,triggerId:b(),triggerRef:l,contentId:b(),open:u,onOpenChange:d,onOpenToggle:M.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,N.jsx)(nt,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),nn=`DropdownMenuTrigger`,rn=M.forwardRef(Y(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=en(nn,n),o=X(n),s=v(t,a.triggerRef);return(0,N.jsx)(rt,{asChild:!0,...o,children:(0,N.jsx)(k.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:S(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:S(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),an=Y(e=>{let{__scopeDropdownMenu:t,...n}=e,r=X(t);return(0,N.jsx)(st,{...r,...n})},`DropdownMenuPortal`),on=`DropdownMenuContent`,sn=M.forwardRef(Y(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=en(on,n),a=X(n),o=M.useRef(!1);return(0,N.jsx)(ut,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:S(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:S(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),cn=M.forwardRef(Y(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=X(n);return(0,N.jsx)(ht,{...i,...r,ref:t})},`DropdownMenuGroup`)),ln=M.forwardRef(Y(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=X(n);return(0,N.jsx)(gt,{...i,...r,ref:t})},`DropdownMenuLabel`)),un=M.forwardRef(Y(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=X(n);return(0,N.jsx)(yt,{...i,...r,ref:t})},`DropdownMenuItem`)),dn=M.forwardRef(Y(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=X(n);return(0,N.jsx)(xt,{...i,...r,ref:t})},`DropdownMenuCheckboxItem`)),fn=M.forwardRef(Y(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=X(n);return(0,N.jsx)(wt,{...i,...r,ref:t})},`DropdownMenuRadioGroup`)),pn=M.forwardRef(Y(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=X(n);return(0,N.jsx)(Et,{...i,...r,ref:t})},`DropdownMenuRadioItem`)),mn=M.forwardRef(Y(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=X(n);return(0,N.jsx)(At,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),hn=M.forwardRef(Y(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=X(n);return(0,N.jsx)(jt,{...i,...r,ref:t})},`DropdownMenuSeparator`)),gn=Y(e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=X(t),[s,c]=g({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,N.jsx)(Ft,{...o,open:s,onOpenChange:c,children:n})},`DropdownMenuSub`),_n=M.forwardRef(Y(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=X(n);return(0,N.jsx)(Lt,{...i,...r,ref:t})},`DropdownMenuSubTrigger`)),vn=M.forwardRef(Y(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=X(n);return(0,N.jsx)(zt,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuSubContent`)),yn=e(_(),1),bn=Object.defineProperty,xn=(e,t)=>bn(e,`name`,{value:t,configurable:!0});function Sn(e){let t=M.useRef({value:e,previous:e});return M.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}xn(Sn,`usePrevious`);var Cn=Object.defineProperty,wn=(e,t)=>Cn(e,`name`,{value:t,configurable:!0});function Tn(e,[t,n]){return Math.min(n,Math.max(t,e))}wn(Tn,`clamp`);var En=Object.defineProperty,Z=(e,t)=>En(e,`name`,{value:t,configurable:!0}),Dn={ItemAligned:`item-aligned`,Popper:`popper`},On={LTR:`ltr`,RTL:`rtl`},kn=[` `,`Enter`,`ArrowUp`,`ArrowDown`],An=[` `,`Enter`],jn=`Select`,[Mn,Nn,Pn]=I(jn),[Fn,In]=D(jn,[Pn,E]),Ln=E(),[Rn,zn]=Fn(jn),[Bn,Vn]=Fn(jn);function Hn(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,_=Ln(t),[v,y]=M.useState(null),[x,S]=M.useState(null),[C,T]=M.useState(!1),E=ce(l),[D,O]=g({prop:r,defaultProp:i??!1,onChange:a,caller:jn}),[k,A]=g({prop:o,defaultProp:s,onChange:c,caller:jn}),j=M.useRef(null),P=M.useRef(k);M.useEffect(()=>{let e=m?v?.ownerDocument.getElementById(m):v?.form;if(e instanceof HTMLFormElement){let t=Z(()=>A(P.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,v,A]);let F=!v||!!m||!!v.closest(`form`),[I,L]=M.useState(new Set),R=b(),ee=Array.from(I).map(e=>e.props.value).join(`;`),te=M.useCallback(e=>{L(t=>new Set(t).add(e))},[]),ne=M.useCallback(e=>{L(t=>{let n=new Set(t);return n.delete(e),n})},[]),z={required:p,trigger:v,onTriggerChange:y,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:T,contentId:R,value:k,onValueChange:A,open:D,onOpenChange:O,dir:E,triggerPointerDownPosRef:j,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:I,nativeSelectKey:ee,isFormControl:F};return(0,N.jsx)(w,{..._,children:(0,N.jsx)(Rn,{scope:t,...z,children:(0,N.jsx)(Mn.Provider,{scope:t,children:(0,N.jsx)(Bn,{scope:t,onNativeOptionAdd:te,onNativeOptionRemove:ne,children:kr(h)?h(z):n})})})})}Z(Hn,`SelectProvider`);var Un=Z(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,N.jsx)(Hn,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,N.jsxs)(N.Fragment,{children:[n,e?(0,N.jsx)(Or,{__scopeSelect:t}):null]})})},`Select`),Wn=`SelectTrigger`,Gn=M.forwardRef(Z(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Ln(n),o=zn(Wn,n),s=o.disabled||r,c=v(t,o.onTriggerChange),l=Nn(n),u=M.useRef(`touch`),[d,f,p]=jr(e=>{let t=l().filter(e=>!e.disabled),n=Mr(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=Z(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,N.jsx)(h,{asChild:!0,...a,children:(0,N.jsx)(k.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Ar(o.value)?``:void 0,...i,ref:c,onClick:S(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:S(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:S(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&kn.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),Kn=`SelectValue`,qn=M.forwardRef(Z(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=zn(Kn,n),{onValueNodeHasChildrenChange:u}=c,d=a!==void 0,f=v(t,c.onValueNodeChange);l(()=>{u(d)},[u,d]);let p=Ar(c.value);return(0,N.jsx)(k.span,{...s,asChild:!p&&s.asChild,ref:f,style:{pointerEvents:`none`},children:(0,N.jsx)(M.Fragment,{children:p?o:a},p?`placeholder`:`value`)})},`SelectValue`)),Jn=M.forwardRef(Z(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,N.jsx)(k.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[Yn,Xn]=Fn(`SelectPortal`,{forceMount:void 0}),Zn=Z(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,N.jsx)(Yn,{scope:e.__scopeSelect,forceMount:n,children:(0,N.jsx)(s,{asChild:!0,...r})})},`SelectPortal`),Qn=`SelectContent`,$n=M.forwardRef(Z(function(e,t){let n=Xn(Qn,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=zn(Qn,e.__scopeSelect),[o,s]=M.useState();return l(()=>{s(new DocumentFragment)},[]),(0,N.jsx)(T,{present:r||a.open,children:({present:e})=>e?(0,N.jsx)(ir,{...i,ref:t}):(0,N.jsx)(er,{...i,fragment:o})})},`SelectContent`)),er=M.forwardRef(Z(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?yn.createPortal((0,N.jsx)(tr,{scope:n,children:(0,N.jsx)(Mn.Slot,{scope:n,children:(0,N.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),Q=10,[tr,nr]=Fn(Qn),rr=p(`SelectContent.RemoveScroll`),ir=M.forwardRef(Z(function(e,t){let{__scopeSelect:n}=e,{position:a=Dn.ItemAligned,onCloseAutoFocus:s,onEscapeKeyDown:c,onPointerDownOutside:l,side:u,sideOffset:d,align:p,alignOffset:m,arrowPadding:h,collisionBoundary:g,collisionPadding:_,sticky:y,hideWhenDetached:b,avoidCollisions:x,...w}=e,T=zn(Qn,n),[E,D]=M.useState(null),[O,k]=M.useState(null),A=v(t,D),[j,P]=M.useState(null),[F,I]=M.useState(null),L=Nn(n),[R,ee]=M.useState(!1),te=M.useRef(!1);M.useEffect(()=>{if(E)return i(E)},[E]),r();let ne=M.useCallback(e=>{let[t,...n]=L().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&O&&(O.scrollTop=0),n===r&&O&&(O.scrollTop=O.scrollHeight),n?.focus(),document.activeElement!==i))return},[L,O]),z=M.useCallback(()=>ne([j,E]),[ne,j,E]);M.useEffect(()=>{R&&z()},[R,z]);let{onOpenChange:B,triggerPointerDownPosRef:re}=T;M.useEffect(()=>{if(E){let e={x:0,y:0},t=Z(t=>{e={x:Math.abs(Math.round(t.pageX)-(re.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(re.current?.y??0))}},`handlePointerMove`),n=Z(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(E)||B(!1),document.removeEventListener(`pointermove`,t),re.current=null},`handlePointerUp`);return re.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[E,B,re]),M.useEffect(()=>{let e=Z(()=>B(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[B]);let[ie,ae]=jr(e=>{let t=L().filter(e=>!e.disabled),n=Mr(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),V=M.useCallback((e,t,n)=>{let r=!te.current&&!n;(T.value!==void 0&&T.value===t||r)&&(P(e),r&&(te.current=!0))},[T.value]),oe=M.useCallback(()=>E?.focus(),[E]),se=M.useCallback((e,t,n)=>{let r=!te.current&&!n;(T.value!==void 0&&T.value===t||r)&&I(e)},[T.value]),H=a===Dn.Popper?or:ar,ce=H===or?{side:u,sideOffset:d,align:p,alignOffset:m,arrowPadding:h,collisionBoundary:g,collisionPadding:_,sticky:y,hideWhenDetached:b,avoidCollisions:x}:{};return(0,N.jsx)(tr,{scope:n,content:E,viewport:O,onViewportChange:k,itemRefCallback:V,selectedItem:j,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:z,selectedItemText:F,position:a,isPositioned:R,searchRef:ie,children:(0,N.jsx)(C,{as:rr,allowPinchZoom:!0,children:(0,N.jsx)(o,{asChild:!0,trapped:T.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:S(s,e=>{T.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,N.jsx)(f,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:(0,N.jsx)(H,{role:`listbox`,id:T.contentId,"data-state":T.open?`open`:`closed`,dir:T.dir,onContextMenu:e=>e.preventDefault(),...w,...ce,onPlaced:()=>ee(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...w.style},onKeyDown:S(w.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ae(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>ne(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),ar=M.forwardRef(Z(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=zn(Qn,n),o=nr(Qn,n),[s,c]=M.useState(null),[u,d]=M.useState(null),f=v(t,d),p=Nn(n),m=M.useRef(!1),h=M.useRef(!0),{viewport:g,selectedItem:_,selectedItemText:y,focusSelectedItem:b}=o,x=M.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&u&&g&&_&&y){let e=a.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(a.dir!==On.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Q,d=Tn(a,[Q,Math.max(Q,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Q,d=Tn(a,[Q,Math.max(Q,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=p(),c=window.innerHeight-Q*2,l=g.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),v=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=f+h+l+b+v,S=Math.min(_.offsetHeight*5,x),C=window.getComputedStyle(g),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Q,D=c-E,O=_.offsetHeight/2,k=_.offsetTop+O,A=f+h+k,j=x-A;if(A<=E){let e=o.length>0&&_===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=u.clientHeight-g.offsetTop-g.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+v);s.style.height=n+`px`}else{let e=o.length>0&&_===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,f+g.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,g.scrollTop=A-E+g.offsetTop}s.style.margin=`${Q}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>m.current=!0)}},[p,a.trigger,a.valueNode,s,u,g,_,y,a.dir,r]);l(()=>x(),[x]);let[S,C]=M.useState();l(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);let w=M.useCallback(e=>{e&&h.current===!0&&(x(),b?.(),h.current=!1)},[x,b]);return(0,N.jsx)(sr,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:w,children:(0,N.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,N.jsx)(k.div,{...i,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),or=M.forwardRef(Z(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Q,...a}=e,o=Ln(n);return(0,N.jsx)(x,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[sr,cr]=Fn(Qn,{}),lr=`SelectViewport`,ur=M.forwardRef(Z(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=nr(lr,n),o=cr(lr,n),s=v(t,a.onViewportChange),c=M.useRef(0);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,N.jsx)(Mn.Slot,{scope:n,children:(0,N.jsx)(k.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:S(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Q*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[dr,fr]=Fn(`SelectGroup`),pr=`SelectItem`,[mr,hr]=Fn(pr),gr=M.forwardRef(Z(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=zn(pr,n),c=nr(pr,n),l=s.value===r,[u,d]=M.useState(a??``),[f,p]=M.useState(!1),m=O(e=>c.itemRefCallback?.(e,r,i)),h=v(t,m),g=b(),_=M.useRef(`touch`),y=Z(()=>{s.onValueChange(r),s.onOpenChange(!1)},`handleSelect`);return(0,N.jsx)(mr,{scope:n,value:r,disabled:i,textId:g,isSelected:l,onItemTextChange:M.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,N.jsx)(Mn.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,N.jsx)(k.div,{role:`option`,"aria-labelledby":g,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:h,onFocus:S(o.onFocus,()=>p(!0)),onBlur:S(o.onBlur,()=>p(!1)),onClick:S(o.onClick,()=>{i||_.current!==`mouse`&&y()}),onPointerUp:S(o.onPointerUp,()=>{i||_.current===`mouse`&&y()}),onPointerDown:S(o.onPointerDown,e=>{_.current=e.pointerType}),onPointerMove:S(o.onPointerMove,e=>{_.current=e.pointerType,i?c.onItemLeave?.():_.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:S(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:S(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(An.includes(e.key)&&y(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),_r=`SelectItemText`,vr=M.forwardRef(Z(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=zn(_r,n),s=nr(_r,n),c=hr(_r,n),u=Vn(_r,n),[d,f]=M.useState(null),p=O(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),m=v(t,f,c.onItemTextChange,p),h=d?.textContent,g=M.useMemo(()=>(0,N.jsx)(`option`,{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:_,onNativeOptionRemove:y}=u;return l(()=>(_(g),()=>y(g)),[_,y,g]),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(k.span,{id:c.textId,...a,ref:m}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Ar(o.value)?yn.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),yr=`SelectItemIndicator`,br=M.forwardRef(Z(function(e,t){let{__scopeSelect:n,...r}=e;return hr(yr,n).isSelected?(0,N.jsx)(k.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),xr=`SelectScrollUpButton`,Sr=M.forwardRef(Z(function(e,t){let n=nr(xr,e.__scopeSelect),r=cr(xr,e.__scopeSelect),[i,a]=M.useState(!1),o=v(t,r.onScrollButtonChange);return l(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};Z(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,N.jsx)(Tr,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Cr=`SelectScrollDownButton`,wr=M.forwardRef(Z(function(e,t){let n=nr(Cr,e.__scopeSelect),r=cr(Cr,e.__scopeSelect),[i,a]=M.useState(!1),o=v(t,r.onScrollButtonChange);return l(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};Z(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,N.jsx)(Tr,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),Tr=M.forwardRef(Z(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=nr(`SelectScrollButton`,n),o=M.useRef(null),s=Nn(n),c=M.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return M.useEffect(()=>()=>c(),[c]),l(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,N.jsx)(k.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:S(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:S(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:S(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),Er=M.forwardRef(Z(function(e,t){let{__scopeSelect:n,...r}=e;return(0,N.jsx)(k.div,{"aria-hidden":!0,...r,ref:t})},`SelectSeparator`)),Dr=`SelectBubbleInput`,Or=M.forwardRef(Z(function({__scopeSelect:e,...t},n){let r=zn(Dr,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:d}=r,{nativeOptions:f,nativeSelectKey:p}=r,m=M.useRef(null),h=v(n,m),g=i??``,_=Sn(g),y=Array.from(f).some(e=>(e.props.value??``)===``);return M.useEffect(()=>{let e=m.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(_!==g&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,g),e.dispatchEvent(t)}},[_,g]),(0,N.jsxs)(k.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:d,onChange:e=>a(e.target.value),...t,style:{...u,...t.style},ref:h,defaultValue:g,children:[Ar(i)&&!y?(0,N.jsx)(`option`,{value:``}):null,Array.from(f)]},p)},`SelectBubbleInput`));function kr(e){return typeof e==`function`}Z(kr,`isFunction`);function Ar(e){return e===``||e===void 0}Z(Ar,`shouldShowPlaceholder`);function jr(e){let t=O(e),n=M.useRef(``),r=M.useRef(0),i=M.useCallback(e=>{let i=n.current+e;t(i),Z((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=M.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return M.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}Z(jr,`useTypeaheadSearch`);function Mr(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Nr(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Z(Mr,`findNextItem`);function Nr(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Z(Nr,`wrapArray`);var Pr=j(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Fr=j(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ir=j(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Lr=j(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Rr=j(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),zr=j(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Br=j(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);function Vr(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Hr=e=>{switch(e){case`success`:return Gr;case`info`:return qr;case`warning`:return Kr;case`error`:return Jr;default:return null}},Ur=Array(12).fill(0),Wr=({visible:e,className:t})=>M.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},M.createElement(`div`,{className:`sonner-spinner`},Ur.map((e,t)=>M.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Gr=M.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},M.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Kr=M.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},M.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),qr=M.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},M.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Jr=M.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},M.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Yr=M.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},M.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),M.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Xr=()=>{let[e,t]=M.useState(document.hidden);return M.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},Zr=1,Qr=100,$r=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:Zr++,$=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Qr;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=$r(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],M.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(ti(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!M.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!M.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!M.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!M.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=$r(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},ei=(e,t)=>$.message(e,t),ti=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,ni=Object.assign(ei,{success:$.success,info:$.info,warning:$.warning,error:$.error,custom:$.custom,message:$.message,promise:$.promise,dismiss:$.dismiss,loading:$.loading},{getHistory:()=>$.toasts,getToasts:()=>$.getActiveToasts()});Vr(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function ri(e){return e.label!==void 0}var ii=3,ai=`24px`,oi=`16px`,si=4e3,ci=356,li=14,ui=45,di=200;function fi(...e){return e.filter(Boolean).join(` `)}function pi(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var mi=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=M.useState(null),[O,k]=M.useState(null),[A,j]=M.useState(!1),[N,P]=M.useState(!1),[F,I]=M.useState(!1),[L,R]=M.useState(!1),[ee,te]=M.useState(!1),[ne,z]=M.useState(0),[B,re]=M.useState(0),ie=M.useRef(n.duration||y||si),ae=M.useRef(null),V=M.useRef(null),oe=c===0,se=c+1<=o,H=n.type,ce=H??`default`,U=n.dismissible!==!1,le=n.className||``,ue=n.descriptionClassName||``,de=M.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),fe=M.useMemo(()=>n.closeButton??p,[n.closeButton,p]),pe=M.useMemo(()=>n.duration||y||si,[n.duration,y]),me=M.useRef(0),he=M.useRef(0),ge=M.useRef(0),W=M.useRef(null),[_e,ve]=b.split(`-`),ye=M.useMemo(()=>s.reduce((e,t,n)=>n>=de?e:e+t.height,0),[s,de]),be=Xr(),G=M.useMemo(()=>e.swipeDirections??pi(b),[e.swipeDirections,b]),xe=n.invert||t,Se=H===`loading`;he.current=M.useMemo(()=>de*x+ye,[de,ye]),M.useEffect(()=>{ie.current=pe},[pe]),M.useEffect(()=>{j(!0)},[]),M.useEffect(()=>{let e=V.current;if(e){let t=e.getBoundingClientRect().height;return re(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),M.useLayoutEffect(()=>{if(!A)return;let e=V.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,re(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let K=M.useCallback(()=>{P(!0),z(he.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},di)},[n,d,a,he]);M.useEffect(()=>{if(n.promise&&H===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||be?(()=>{if(ge.current<me.current){let e=new Date().getTime()-me.current;ie.current-=e}ge.current=new Date().getTime()})():ie.current!==1/0&&(me.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),K()},ie.current)),()=>clearTimeout(e)},[u,i,n,H,be,K]),M.useEffect(()=>{n.delete&&(K(),n.onDismiss==null||n.onDismiss.call(n,n))},[K,n.delete]);function Ce(){return w?.loading?M.createElement(`div`,{className:fi(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":H===`loading`},w.loading):M.createElement(Wr,{className:fi(C?.loader,n?.classNames?.loader),visible:H===`loading`})}let we=n.icon||w?.[H]||Hr(H);return M.createElement(`li`,{tabIndex:0,ref:V,className:fi(_,le,C?.toast,n?.classNames?.toast,C?.[ce],n?.classNames?.[ce]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":ee,"data-removed":N,"data-visible":se,"data-y-position":_e,"data-x-position":ve,"data-index":c,"data-front":oe,"data-swiping":F,"data-dismissible":U,"data-type":H,"data-invert":xe,"data-swipe-out":L,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${N?ne:he.current}px`,"--initial-height":S?`auto`:`${B}px`,...m,...n.style},onDragEnd:()=>{I(!1),D(null),W.current=null},onPointerDown:e=>{e.button!==2&&!Se&&U&&(ae.current=new Date,z(he.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(I(!0),W.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(L||!U)return;W.current=null;let e=Number(V.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(V.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ae.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if((E===`x`?G.includes(e>0?`right`:`left`):G.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=ui||a>.11))z(he.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),K(),R(!0);else{var o,s;(o=V.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=V.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),te(!1),I(!1),D(null)}},onPointerMove:e=>{var t,n;if(!W.current||!U||window.getSelection()?.toString().length>0)return;let r=e.clientY-W.current.y,i=e.clientX-W.current.x;!E&&(Math.abs(i)>1||Math.abs(r)>1)&&D(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(G.includes(`top`)||G.includes(`bottom`)){if(G.includes(`top`)&&r<0||G.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(E===`x`&&(G.includes(`left`)||G.includes(`right`))){if(G.includes(`left`)&&i<0||G.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&te(!0),(t=V.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=V.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},fe&&!n.jsx&&H!==`loading`?M.createElement(`button`,{"aria-label":T,"data-disabled":Se,"data-close-button":!0,onClick:Se||!U?()=>{}:()=>{K(),n.onDismiss==null||n.onDismiss.call(n,n)},className:fi(C?.closeButton,n?.classNames?.closeButton)},w?.close??Yr):null,(H||n.icon||n.promise)&&n.icon!==null&&(w?.[H]!==null||n.icon)?M.createElement(`div`,{"data-icon":``,className:fi(C?.icon,n?.classNames?.icon)},H===`loading`?n.icon||Ce():n.promise?Ce():null,H===`loading`?null:we):null,M.createElement(`div`,{"data-content":``,className:fi(C?.content,n?.classNames?.content)},M.createElement(`div`,{"data-title":``,className:fi(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?M.createElement(`div`,{"data-description":``,className:fi(v,ue,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),M.isValidElement(n.cancel)?n.cancel:n.cancel&&ri(n.cancel)?M.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{ri(n.cancel)&&U&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),K())},className:fi(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,M.isValidElement(n.action)?n.action:n.action&&ri(n.action)?M.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{ri(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&K())},className:fi(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function hi(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function gi(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?oi:ai;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var _i=M.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=ii,toastOptions:g,dir:_=hi(),gap:v=li,icons:y,customAriaLabel:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=M.useState([]),w=M.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=M.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=M.useState([]),[O,k]=M.useState(!1),[A,j]=M.useState(!1),[N,P]=M.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),F=M.useRef(null),I=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),L=M.useRef(null),R=M.useRef(!1),ee=M.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||$.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return M.useEffect(()=>$.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{yn.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),M.useEffect(()=>{if(d!==`system`){P(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),M.useEffect(()=>{S.length<=1&&k(!1)},[S]),M.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=F.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===F.current||F.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),M.useEffect(()=>{if(F.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,R.current=!1)}},[F.current]),M.createElement(`section`,{ref:t,"aria-label":b??`${x} ${I}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?M.createElement(`ol`,{key:t,dir:_===`auto`?hi():_,tabIndex:-1,ref:F,className:c,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${ci}px`,"--gap":`${v}px`,...m,...gi(l,u)},onBlur:e=>{R.current&&!e.currentTarget.contains(e.relatedTarget)&&(R.current=!1,L.current&&=(L.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||R.current||(R.current=!0,L.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||j(!0)},onPointerUp:()=>j(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>M.createElement(mi,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:ee,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:v,expanded:O,swipeDirections:e.swipeDirections}))):null}))});function vi({...e}){return(0,N.jsx)(tn,{"data-slot":`dropdown-menu`,...e})}function yi({...e}){return(0,N.jsx)(rn,{"data-slot":`dropdown-menu-trigger`,...e})}function bi({className:e,sideOffset:t=4,container:n,...r}){return(0,N.jsx)(an,{container:n,children:(0,N.jsx)(sn,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:m(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...r})})}function xi({...e}){return(0,N.jsx)(cn,{"data-slot":`dropdown-menu-group`,...e})}function Si({className:e,inset:t,variant:n=`default`,...r}){return(0,N.jsx)(un,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:m(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function Ci({className:e,children:t,checked:n,...r}){return(0,N.jsxs)(dn,{"data-slot":`dropdown-menu-checkbox-item`,className:m(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...r,children:[(0,N.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,N.jsx)(mn,{children:(0,N.jsx)(Pr,{className:`size-4`})})}),t]})}function wi({...e}){return(0,N.jsx)(fn,{"data-slot":`dropdown-menu-radio-group`,...e})}function Ti({className:e,children:t,...n}){return(0,N.jsxs)(pn,{"data-slot":`dropdown-menu-radio-item`,className:m(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,N.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,N.jsx)(mn,{children:(0,N.jsx)(Rr,{className:`size-2 fill-current`})})}),t]})}function Ei({className:e,inset:t,...n}){return(0,N.jsx)(ln,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:m(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function Di({className:e,...t}){return(0,N.jsx)(hn,{"data-slot":`dropdown-menu-separator`,className:m(`-mx-1 my-1 h-px bg-border`,e),...t})}function Oi({className:e,...t}){return(0,N.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:m(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}function ki({...e}){return(0,N.jsx)(gn,{"data-slot":`dropdown-menu-sub`,...e})}function Ai({className:e,inset:t,children:n,...r}){return(0,N.jsxs)(_n,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:m(`flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,N.jsx)(Ir,{className:`ml-auto size-4`})]})}function ji({className:e,...t}){return(0,N.jsx)(vn,{"data-slot":`dropdown-menu-sub-content`,className:m(`z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...t})}function Mi({...e}){return(0,N.jsx)(Un,{"data-slot":`select`,...e})}function Ni({...e}){return(0,N.jsx)(qn,{"data-slot":`select-value`,...e})}function Pi({className:e,size:t=`default`,children:n,...r}){return(0,N.jsxs)(Gn,{"data-slot":`select-trigger`,"data-size":t,className:m(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,N.jsx)(Jn,{asChild:!0,children:(0,N.jsx)(Fr,{className:`size-4 opacity-50`})})]})}function Fi({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,N.jsx)(Zn,{children:(0,N.jsxs)($n,{"data-slot":`select-content`,className:m(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,N.jsx)(Ri,{}),(0,N.jsx)(ur,{className:m(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,N.jsx)(zi,{})]})})}function Ii({className:e,children:t,...n}){return(0,N.jsxs)(gr,{"data-slot":`select-item`,className:m(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,N.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,N.jsx)(br,{children:(0,N.jsx)(Pr,{className:`size-4`})})}),(0,N.jsx)(vr,{children:t})]})}function Li({className:e,...t}){return(0,N.jsx)(Er,{"data-slot":`select-separator`,className:m(`pointer-events-none -mx-1 my-1 h-px bg-border`,e),...t})}function Ri({className:e,...t}){return(0,N.jsx)(Sr,{"data-slot":`select-scroll-up-button`,className:m(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,N.jsx)(Lr,{className:`size-4`})})}function zi({className:e,...t}){return(0,N.jsx)(wr,{"data-slot":`select-scroll-down-button`,className:m(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,N.jsx)(Fr,{className:`size-4`})})}function Bi({className:e,icon:t=!1,...n}){return(0,N.jsx)(y,{variant:`ghost`,size:t?`icon-sm`:`sm`,"data-bar":``,className:m(`text-dense font-normal text-lead hover:bg-hover hover:text-ink active:bg-press aria-expanded:bg-press aria-expanded:text-ink aria-pressed:bg-here aria-pressed:text-ink aria-selected:bg-here aria-selected:text-ink`,t?`size-7 [&_svg:not([class*='size-'])]:size-4`:`h-7 gap-1.5 px-2 [&_svg:not([class*='size-'])]:size-3.5`,e),...n})}function Vi({className:e,tone:t=`pencil`,...n}){return(0,N.jsx)(y,{variant:`link`,className:m(`h-auto gap-1 p-0 font-normal underline-offset-2 has-[>svg]:px-0 hover:underline [&_svg:not([class*='size-'])]:size-3`,t===`pencil`?`text-pencil-text`:`text-lead hover:text-ink`,e),...n})}function Hi({className:e,...t}){return(0,N.jsx)(Pi,{size:`sm`,"data-bar":``,className:m(`gap-1.5 px-2 text-dense font-normal text-lead shadow-none data-[size=sm]:h-7 hover:text-ink data-[state=open]:text-ink [&_svg:not([class*='size-'])]:size-3.5`,e),...t})}export{Fr as A,Lt as B,yi as C,zr as D,Br as E,yt as F,ce as G,De as H,st as I,jt as L,nt as M,rt as N,Lr as O,ut as P,Ft as R,Ai as S,ni as T,Ae as U,Ye as V,K as W,Ti as _,Fi as a,ki as b,Pi as c,Ci as d,bi as f,wi as g,Ei as h,Mi as i,Pr as j,Ir as k,Ni as l,Si as m,Hi as n,Ii as o,xi as p,Vi as r,Li as s,Bi as t,vi as u,Di as v,_i as w,ji as x,Oi as y,zt as z};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as t,t as n}from"./d3-selection-COWvaQNI.js";import{a as r,b as i,c as a,it as o,s,y as c}from"./chunk-DSNLSHJZ-DoUgmzGB.js";import{t as l}from"./channel-CVWSV3su.js";import"./chunk-YZO67HFG-DTbcCoGt.js";import{A as u,B as d,C as f,D as p,E as m,F as h,G as g,H as _,I as v,K as y,L as b,M as x,N as S,O as C,P as w,R as T,S as E,T as D,U as O,V as k,W as A,b as j,j as M,k as ee,u as te,w as ne,z as re}from"./chunk-7S6XSTFO-BA6esfFu.js";import"./chunk-AQDTSKZB-BT_vANXs.js";import{t as ie}from"./chunk-5VM5RSS4-ZNzvKenW.js";import{t as ae}from"./chunk-DUW6YSOI-Dgx8z5s3.js";import"./chunk-UHW7PFBP-Cmc0_F5o.js";import{i as oe,n as se,o as ce,r as le,s as ue}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import"./chunk-HAGFOTED-DtnIrCZb.js";import{i as de,r as fe}from"./chunk-ZAUX2LTX-DVwkg-2N.js";import{a as pe,c as me,i as he,l as ge}from"./chunk-WQQL4CDK-Btq2nbF6.js";import{t as _e}from"./graphlib-DS17s2tU.js";function ve(e){return Array.isArray(e)}function ye(e){if(g(e))return e;let t=A(e);if(!be(e))return{};if(ve(e)){let t=Array.from(e);return e.length>0&&typeof e[0]==`string`&&y(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(j(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?Se(r,e):N(r,e),r}if(t===`[object Date]`)return new Date(Number(e));if(t===`[object RegExp]`){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===`[object Symbol]`)return Object(Symbol.prototype.valueOf.call(e));if(t===`[object Map]`){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===`[object Set]`){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===`[object Arguments]`){let t=e,n={};return N(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return Ce(n,e),N(n,e),xe(n,e),n}function be(e){switch(A(e)){case E:case ne:case f:case m:case D:case p:case C:case ee:case x:case u:case M:case S:case w:case h:case v:case b:case T:case re:case _:case O:case d:case k:return!0;default:return!1}}function N(e,t){for(let n in t)y(t,n)&&(e[n]=t[n])}function xe(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r<n.length;r++){let i=n[r];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}function Se(e,t){let n=t.valueOf().length;for(let r in t)y(t,r)&&(Number.isNaN(Number(r))||Number(r)>=n)&&(e[r]=t[r])}function Ce(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}var P=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,15],r=[1,7],i=[1,13],a=[1,14],o=[1,19],s=[1,16],c=[1,17],l=[1,18],u=[8,30],d=[8,10,21,28,29,30,31,39,43,46],f=[1,23],p=[1,24],m=[8,10,15,16,21,28,29,30,31,39,43,46],h=[8,10,15,16,21,27,28,29,30,31,39,43,46],g=[1,49],_={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACELINE`,5:`NL`,7:`SPACE`,8:`EOF`,10:`BLOCK_DIAGRAM_KEY`,15:`LINK`,16:`START_LINK`,17:`LINK_LABEL`,18:`STR`,21:`SPACE_BLOCK`,27:`SIZE`,28:`COLUMNS`,29:`id-block`,30:`end`,31:`NODE_ID`,34:`DIR`,35:`NODE_DSTART`,36:`NODE_DEND`,37:`BLOCK_ARROW_START`,38:`BLOCK_ARROW_END`,39:`classDef`,40:`CLASSDEF_ID`,41:`CLASSDEF_STYLEOPTS`,42:`DEFAULT`,43:`class`,44:`CLASSENTITY_IDS`,45:`STYLECLASS`,46:`style`,47:`STYLE_ENTITY_IDS`,48:`STYLE_DEFINITION_DATA`},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:r.getLogger().debug(`Rule: separator (NL) `);break;case 5:r.getLogger().debug(`Rule: separator (Space) `);break;case 6:r.getLogger().debug(`Rule: separator (EOF) `);break;case 7:r.getLogger().debug(`Rule: hierarchy: `,a[s-1]),r.setHierarchy(a[s-1]);break;case 8:r.getLogger().debug(`Stop NL `);break;case 9:r.getLogger().debug(`Stop EOF `);break;case 10:r.getLogger().debug(`Stop NL2 `);break;case 11:r.getLogger().debug(`Stop EOF2 `);break;case 12:r.getLogger().debug(`Rule: statement: `,a[s]),this.$=typeof a[s].length==`number`?a[s]:[a[s]];break;case 13:r.getLogger().debug(`Rule: statement #2: `,a[s-1]),this.$=[a[s-1]].concat(a[s]);break;case 14:r.getLogger().debug(`Rule: link: `,a[s],e),this.$={edgeTypeStr:a[s],label:``};break;case 15:r.getLogger().debug(`Rule: LABEL link: `,a[s-3],a[s-1],a[s]),this.$={edgeTypeStr:a[s],label:a[s-1]};break;case 18:let t=parseInt(a[s]),n=r.generateId();this.$={id:n,type:`space`,label:``,width:t,children:[]};break;case 23:r.getLogger().debug(`Rule: (nodeStatement link node) `,a[s-2],a[s-1],a[s],` typestr: `,a[s-1].edgeTypeStr);let i=r.edgeStrToEdgeData(a[s-1].edgeTypeStr),o=r.edgeStrToEdgeStartData(a[s-1].edgeTypeStr),c=r.edgeStrToThickness(a[s-1].edgeTypeStr),l=r.edgeStrToPattern(a[s-1].edgeTypeStr);this.$=[{id:a[s-2].id,label:a[s-2].label,type:a[s-2].type,directions:a[s-2].directions},{id:a[s-2].id+`-`+a[s].id,start:a[s-2].id,end:a[s].id,label:a[s-1].label,type:`edge`,thickness:c,pattern:l,directions:a[s].directions,arrowTypeEnd:i,arrowTypeStart:o},{id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions}];break;case 24:r.getLogger().debug(`Rule: nodeStatement (abc88 node size) `,a[s-1],a[s]),this.$={id:a[s-1].id,label:a[s-1].label,type:r.typeStr2Type(a[s-1].typeStr),directions:a[s-1].directions,widthInColumns:parseInt(a[s],10)};break;case 25:r.getLogger().debug(`Rule: nodeStatement (node) `,a[s]),this.$={id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions,widthInColumns:1};break;case 26:r.getLogger().debug(`APA123`,this?this:`na`),r.getLogger().debug(`COLUMNS: `,a[s]),this.$={type:`column-setting`,columns:a[s]===`auto`?-1:parseInt(a[s])};break;case 27:r.getLogger().debug(`Rule: id-block statement : `,a[s-2],a[s-1]),r.generateId(),this.$={...a[s-2],type:`composite`,children:a[s-1]};break;case 28:r.getLogger().debug(`Rule: blockStatement : `,a[s-2],a[s-1],a[s]);let u=r.generateId();this.$={id:u,type:`composite`,label:``,children:a[s-1]};break;case 29:r.getLogger().debug(`Rule: node (NODE_ID separator): `,a[s]),this.$={id:a[s]};break;case 30:r.getLogger().debug(`Rule: node (NODE_ID nodeShapeNLabel separator): `,a[s-1],a[s]),this.$={id:a[s-1],label:a[s].label,typeStr:a[s].typeStr,directions:a[s].directions};break;case 31:r.getLogger().debug(`Rule: dirList: `,a[s]),this.$=[a[s]];break;case 32:r.getLogger().debug(`Rule: dirList: `,a[s-1],a[s]),this.$=[a[s-1]].concat(a[s]);break;case 33:r.getLogger().debug(`Rule: nodeShapeNLabel: `,a[s-2],a[s-1],a[s]),this.$={typeStr:a[s-2]+a[s],label:a[s-1]};break;case 34:r.getLogger().debug(`Rule: BLOCK_ARROW nodeShapeNLabel: `,a[s-3],a[s-2],` #3:`,a[s-1],a[s]),this.$={typeStr:a[s-3]+a[s],label:a[s-2],directions:a[s-1]};break;case 35:case 36:this.$={type:`classDef`,id:a[s-1].trim(),css:a[s].trim()};break;case 37:this.$={type:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:this.$={type:`applyStyles`,id:a[s-1].trim(),stylesStr:a[s].trim()}}},`anonymous`),table:[{9:1,10:[1,2]},{1:[3]},{10:n,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:n,21:r,28:i,29:a,31:o,39:s,43:c,46:l}),t(d,[2,16],{14:22,15:f,16:p}),t(d,[2,17]),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,22]),t(m,[2,25],{27:[1,25]}),t(d,[2,26]),{19:26,26:12,31:o},{10:n,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(h,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:o},{31:[2,14]},{17:[1,36]},t(m,[2,24]),{10:n,11:37,13:4,14:22,15:f,16:p,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(h,[2,30]),{18:[1,43]},{18:[1,44]},t(m,[2,23]),{18:[1,45]},{30:[1,46]},t(d,[2,28]),t(d,[2,35]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{36:[1,47]},{33:48,34:g},{15:[1,50]},t(d,[2,27]),t(h,[2,33]),{38:[1,51]},{33:52,34:g,38:[2,31]},{31:[2,15]},t(h,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as t,t as n}from"./d3-selection-COWvaQNI.js";import{a as r,b as i,c as a,it as o,s,y as c}from"./chunk-DSNLSHJZ-zku9oeG3.js";import{t as l}from"./channel-Bhb-_8v6.js";import"./chunk-YZO67HFG-BLe7PXER.js";import{A as u,B as d,C as f,D as p,E as m,F as h,G as g,H as _,I as v,K as y,L as b,M as x,N as S,O as C,P as w,R as T,S as E,T as D,U as O,V as k,W as A,b as j,j as M,k as ee,u as te,w as ne,z as re}from"./chunk-7S6XSTFO-CgZAazgt.js";import"./chunk-AQDTSKZB-BRU84phF.js";import{t as ie}from"./chunk-5VM5RSS4-ZNzvKenW.js";import{t as ae}from"./chunk-DUW6YSOI-Dgx8z5s3.js";import"./chunk-UHW7PFBP-DrYeJo1e.js";import{i as oe,n as se,o as ce,r as le,s as ue}from"./chunk-J5ZVWO5B-oDCd-gWO.js";import"./chunk-HAGFOTED-CaUkBv_0.js";import{i as de,r as fe}from"./chunk-ZAUX2LTX-ByaeSIre.js";import{a as pe,c as me,i as he,l as ge}from"./chunk-WQQL4CDK-DZ0tyi9F.js";import{t as _e}from"./graphlib-DS17s2tU.js";function ve(e){return Array.isArray(e)}function ye(e){if(g(e))return e;let t=A(e);if(!be(e))return{};if(ve(e)){let t=Array.from(e);return e.length>0&&typeof e[0]==`string`&&y(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(j(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?Se(r,e):N(r,e),r}if(t===`[object Date]`)return new Date(Number(e));if(t===`[object RegExp]`){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===`[object Symbol]`)return Object(Symbol.prototype.valueOf.call(e));if(t===`[object Map]`){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===`[object Set]`){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===`[object Arguments]`){let t=e,n={};return N(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return Ce(n,e),N(n,e),xe(n,e),n}function be(e){switch(A(e)){case E:case ne:case f:case m:case D:case p:case C:case ee:case x:case u:case M:case S:case w:case h:case v:case b:case T:case re:case _:case O:case d:case k:return!0;default:return!1}}function N(e,t){for(let n in t)y(t,n)&&(e[n]=t[n])}function xe(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r<n.length;r++){let i=n[r];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}function Se(e,t){let n=t.valueOf().length;for(let r in t)y(t,r)&&(Number.isNaN(Number(r))||Number(r)>=n)&&(e[r]=t[r])}function Ce(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}var P=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,15],r=[1,7],i=[1,13],a=[1,14],o=[1,19],s=[1,16],c=[1,17],l=[1,18],u=[8,30],d=[8,10,21,28,29,30,31,39,43,46],f=[1,23],p=[1,24],m=[8,10,15,16,21,28,29,30,31,39,43,46],h=[8,10,15,16,21,27,28,29,30,31,39,43,46],g=[1,49],_={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACELINE`,5:`NL`,7:`SPACE`,8:`EOF`,10:`BLOCK_DIAGRAM_KEY`,15:`LINK`,16:`START_LINK`,17:`LINK_LABEL`,18:`STR`,21:`SPACE_BLOCK`,27:`SIZE`,28:`COLUMNS`,29:`id-block`,30:`end`,31:`NODE_ID`,34:`DIR`,35:`NODE_DSTART`,36:`NODE_DEND`,37:`BLOCK_ARROW_START`,38:`BLOCK_ARROW_END`,39:`classDef`,40:`CLASSDEF_ID`,41:`CLASSDEF_STYLEOPTS`,42:`DEFAULT`,43:`class`,44:`CLASSENTITY_IDS`,45:`STYLECLASS`,46:`style`,47:`STYLE_ENTITY_IDS`,48:`STYLE_DEFINITION_DATA`},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:r.getLogger().debug(`Rule: separator (NL) `);break;case 5:r.getLogger().debug(`Rule: separator (Space) `);break;case 6:r.getLogger().debug(`Rule: separator (EOF) `);break;case 7:r.getLogger().debug(`Rule: hierarchy: `,a[s-1]),r.setHierarchy(a[s-1]);break;case 8:r.getLogger().debug(`Stop NL `);break;case 9:r.getLogger().debug(`Stop EOF `);break;case 10:r.getLogger().debug(`Stop NL2 `);break;case 11:r.getLogger().debug(`Stop EOF2 `);break;case 12:r.getLogger().debug(`Rule: statement: `,a[s]),this.$=typeof a[s].length==`number`?a[s]:[a[s]];break;case 13:r.getLogger().debug(`Rule: statement #2: `,a[s-1]),this.$=[a[s-1]].concat(a[s]);break;case 14:r.getLogger().debug(`Rule: link: `,a[s],e),this.$={edgeTypeStr:a[s],label:``};break;case 15:r.getLogger().debug(`Rule: LABEL link: `,a[s-3],a[s-1],a[s]),this.$={edgeTypeStr:a[s],label:a[s-1]};break;case 18:let t=parseInt(a[s]),n=r.generateId();this.$={id:n,type:`space`,label:``,width:t,children:[]};break;case 23:r.getLogger().debug(`Rule: (nodeStatement link node) `,a[s-2],a[s-1],a[s],` typestr: `,a[s-1].edgeTypeStr);let i=r.edgeStrToEdgeData(a[s-1].edgeTypeStr),o=r.edgeStrToEdgeStartData(a[s-1].edgeTypeStr),c=r.edgeStrToThickness(a[s-1].edgeTypeStr),l=r.edgeStrToPattern(a[s-1].edgeTypeStr);this.$=[{id:a[s-2].id,label:a[s-2].label,type:a[s-2].type,directions:a[s-2].directions},{id:a[s-2].id+`-`+a[s].id,start:a[s-2].id,end:a[s].id,label:a[s-1].label,type:`edge`,thickness:c,pattern:l,directions:a[s].directions,arrowTypeEnd:i,arrowTypeStart:o},{id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions}];break;case 24:r.getLogger().debug(`Rule: nodeStatement (abc88 node size) `,a[s-1],a[s]),this.$={id:a[s-1].id,label:a[s-1].label,type:r.typeStr2Type(a[s-1].typeStr),directions:a[s-1].directions,widthInColumns:parseInt(a[s],10)};break;case 25:r.getLogger().debug(`Rule: nodeStatement (node) `,a[s]),this.$={id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions,widthInColumns:1};break;case 26:r.getLogger().debug(`APA123`,this?this:`na`),r.getLogger().debug(`COLUMNS: `,a[s]),this.$={type:`column-setting`,columns:a[s]===`auto`?-1:parseInt(a[s])};break;case 27:r.getLogger().debug(`Rule: id-block statement : `,a[s-2],a[s-1]),r.generateId(),this.$={...a[s-2],type:`composite`,children:a[s-1]};break;case 28:r.getLogger().debug(`Rule: blockStatement : `,a[s-2],a[s-1],a[s]);let u=r.generateId();this.$={id:u,type:`composite`,label:``,children:a[s-1]};break;case 29:r.getLogger().debug(`Rule: node (NODE_ID separator): `,a[s]),this.$={id:a[s]};break;case 30:r.getLogger().debug(`Rule: node (NODE_ID nodeShapeNLabel separator): `,a[s-1],a[s]),this.$={id:a[s-1],label:a[s].label,typeStr:a[s].typeStr,directions:a[s].directions};break;case 31:r.getLogger().debug(`Rule: dirList: `,a[s]),this.$=[a[s]];break;case 32:r.getLogger().debug(`Rule: dirList: `,a[s-1],a[s]),this.$=[a[s-1]].concat(a[s]);break;case 33:r.getLogger().debug(`Rule: nodeShapeNLabel: `,a[s-2],a[s-1],a[s]),this.$={typeStr:a[s-2]+a[s],label:a[s-1]};break;case 34:r.getLogger().debug(`Rule: BLOCK_ARROW nodeShapeNLabel: `,a[s-3],a[s-2],` #3:`,a[s-1],a[s]),this.$={typeStr:a[s-3]+a[s],label:a[s-2],directions:a[s-1]};break;case 35:case 36:this.$={type:`classDef`,id:a[s-1].trim(),css:a[s].trim()};break;case 37:this.$={type:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:this.$={type:`applyStyles`,id:a[s-1].trim(),stylesStr:a[s].trim()}}},`anonymous`),table:[{9:1,10:[1,2]},{1:[3]},{10:n,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:n,21:r,28:i,29:a,31:o,39:s,43:c,46:l}),t(d,[2,16],{14:22,15:f,16:p}),t(d,[2,17]),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,22]),t(m,[2,25],{27:[1,25]}),t(d,[2,26]),{19:26,26:12,31:o},{10:n,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(h,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:o},{31:[2,14]},{17:[1,36]},t(m,[2,24]),{10:n,11:37,13:4,14:22,15:f,16:p,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(h,[2,30]),{18:[1,43]},{18:[1,44]},t(m,[2,23]),{18:[1,45]},{30:[1,46]},t(d,[2,28]),t(d,[2,35]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{36:[1,47]},{33:48,34:g},{15:[1,50]},t(d,[2,27]),t(h,[2,33]),{38:[1,51]},{33:52,34:g,38:[2,31]},{31:[2,15]},t(h,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};_.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as t,t as n}from"./d3-selection-COWvaQNI.js";import{H as r,U as i,_ as a,b as o,c as s,r as l,s as u,v as d,z as f}from"./chunk-DSNLSHJZ-DoUgmzGB.js";import"./chunk-YZO67HFG-DTbcCoGt.js";import{n as p,r as m,v as h}from"./chunk-7S6XSTFO-BA6esfFu.js";import"./chunk-AQDTSKZB-BT_vANXs.js";import"./chunk-UHW7PFBP-Cmc0_F5o.js";import{r as g,s as _}from"./chunk-HAGFOTED-DtnIrCZb.js";import{a as v}from"./chunk-55XCU76K-AMvnFwUg.js";var y=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,24],r=[1,25],i=[1,26],a=[1,27],o=[1,28],s=[1,63],l=[1,64],u=[1,65],d=[1,66],f=[1,67],p=[1,68],m=[1,69],h=[1,29],g=[1,30],_=[1,31],v=[1,32],y=[1,33],b=[1,34],x=[1,35],S=[1,36],C=[1,37],w=[1,38],T=[1,39],E=[1,40],D=[1,41],O=[1,42],k=[1,43],A=[1,44],j=[1,45],M=[1,46],N=[1,47],P=[1,48],F=[1,50],I=[1,51],L=[1,52],R=[1,53],z=[1,54],B=[1,55],V=[1,56],H=[1,57],U=[1,58],W=[1,59],G=[1,60],ee=[14,42],te=[14,34,36,37,38,39,40,41,42,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],ne=[12,14,34,36,37,38,39,40,41,42,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],K=[1,82],q=[1,83],J=[1,84],Y=[1,85],X=[12,14,42],re=[12,14,33,42],ie=[12,14,33,42,76,77,79,80],Z=[12,33],ae=[34,36,37,38,39,40,41,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],oe={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:`error`,6:`direction_tb`,7:`direction_bt`,8:`direction_rl`,9:`direction_lr`,11:`C4_CONTEXT`,12:`NEWLINE`,14:`EOF`,15:`C4_CONTAINER`,16:`C4_COMPONENT`,17:`C4_DYNAMIC`,18:`C4_DEPLOYMENT`,22:`title`,23:`accDescription`,24:`acc_title`,25:`acc_title_value`,26:`acc_descr`,27:`acc_descr_value`,28:`acc_descr_multiline_value`,33:`LBRACE`,34:`ENTERPRISE_BOUNDARY`,36:`SYSTEM_BOUNDARY`,37:`BOUNDARY`,38:`CONTAINER_BOUNDARY`,39:`NODE`,40:`NODE_L`,41:`NODE_R`,42:`RBRACE`,44:`PERSON`,45:`PERSON_EXT`,46:`SYSTEM`,47:`SYSTEM_DB`,48:`SYSTEM_QUEUE`,49:`SYSTEM_EXT`,50:`SYSTEM_EXT_DB`,51:`SYSTEM_EXT_QUEUE`,52:`CONTAINER`,53:`CONTAINER_DB`,54:`CONTAINER_QUEUE`,55:`CONTAINER_EXT`,56:`CONTAINER_EXT_DB`,57:`CONTAINER_EXT_QUEUE`,58:`COMPONENT`,59:`COMPONENT_DB`,60:`COMPONENT_QUEUE`,61:`COMPONENT_EXT`,62:`COMPONENT_EXT_DB`,63:`COMPONENT_EXT_QUEUE`,64:`REL`,65:`BIREL`,66:`REL_U`,67:`REL_D`,68:`REL_L`,69:`REL_R`,70:`REL_B`,71:`REL_INDEX`,72:`UPDATE_EL_STYLE`,73:`UPDATE_REL_STYLE`,74:`UPDATE_LAYOUT_CONFIG`,76:`STR`,77:`STR_KEY`,78:`STR_VALUE`,79:`ATTRIBUTE`,80:`ATTRIBUTE_EMPTY`},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:r.setDirection(`TB`);break;case 4:r.setDirection(`BT`);break;case 5:r.setDirection(`RL`);break;case 6:r.setDirection(`LR`);break;case 8:case 9:case 10:case 11:case 12:r.setC4Type(a[s-3]);break;case 19:r.setTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 20:r.setAccDescription(a[s].substring(15)),this.$=a[s].substring(15);break;case 21:this.$=a[s].trim(),r.setTitle(this.$);break;case 22:case 23:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 28:a[s].splice(2,0,`ENTERPRISE`),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 29:a[s].splice(2,0,`SYSTEM`),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 30:r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 31:a[s].splice(2,0,`CONTAINER`),r.addContainerBoundary(...a[s]),this.$=a[s];break;case 32:r.addDeploymentNode(`node`,...a[s]),this.$=a[s];break;case 33:r.addDeploymentNode(`nodeL`,...a[s]),this.$=a[s];break;case 34:r.addDeploymentNode(`nodeR`,...a[s]),this.$=a[s];break;case 35:r.popBoundaryParseStack();break;case 39:r.addPersonOrSystem(`person`,...a[s]),this.$=a[s];break;case 40:r.addPersonOrSystem(`external_person`,...a[s]),this.$=a[s];break;case 41:r.addPersonOrSystem(`system`,...a[s]),this.$=a[s];break;case 42:r.addPersonOrSystem(`system_db`,...a[s]),this.$=a[s];break;case 43:r.addPersonOrSystem(`system_queue`,...a[s]),this.$=a[s];break;case 44:r.addPersonOrSystem(`external_system`,...a[s]),this.$=a[s];break;case 45:r.addPersonOrSystem(`external_system_db`,...a[s]),this.$=a[s];break;case 46:r.addPersonOrSystem(`external_system_queue`,...a[s]),this.$=a[s];break;case 47:r.addContainer(`container`,...a[s]),this.$=a[s];break;case 48:r.addContainer(`container_db`,...a[s]),this.$=a[s];break;case 49:r.addContainer(`container_queue`,...a[s]),this.$=a[s];break;case 50:r.addContainer(`external_container`,...a[s]),this.$=a[s];break;case 51:r.addContainer(`external_container_db`,...a[s]),this.$=a[s];break;case 52:r.addContainer(`external_container_queue`,...a[s]),this.$=a[s];break;case 53:r.addComponent(`component`,...a[s]),this.$=a[s];break;case 54:r.addComponent(`component_db`,...a[s]),this.$=a[s];break;case 55:r.addComponent(`component_queue`,...a[s]),this.$=a[s];break;case 56:r.addComponent(`external_component`,...a[s]),this.$=a[s];break;case 57:r.addComponent(`external_component_db`,...a[s]),this.$=a[s];break;case 58:r.addComponent(`external_component_queue`,...a[s]),this.$=a[s];break;case 60:r.addRel(`rel`,...a[s]),this.$=a[s];break;case 61:r.addRel(`birel`,...a[s]),this.$=a[s];break;case 62:r.addRel(`rel_u`,...a[s]),this.$=a[s];break;case 63:r.addRel(`rel_d`,...a[s]),this.$=a[s];break;case 64:r.addRel(`rel_l`,...a[s]),this.$=a[s];break;case 65:r.addRel(`rel_r`,...a[s]),this.$=a[s];break;case 66:r.addRel(`rel_b`,...a[s]),this.$=a[s];break;case 67:a[s].splice(0,1),r.addRel(`rel`,...a[s]),this.$=a[s];break;case 68:r.updateElStyle(`update_el_style`,...a[s]),this.$=a[s];break;case 69:r.updateRelStyle(`update_rel_style`,...a[s]),this.$=a[s];break;case 70:r.updateLayoutConfig(`update_layout_config`,...a[s]),this.$=a[s];break;case 71:this.$=[a[s]];break;case 72:a[s].unshift(a[s-1]),this.$=a[s];break;case 73:case 75:this.$=a[s].trim();break;case 74:let e={};e[a[s-1].trim()]=a[s].trim(),this.$=e;break;case 76:this.$=``}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:70,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:71,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:72,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:73,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{14:[1,74]},t(ee,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:l,37:u,38:d,39:f,40:p,41:m,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G}),t(ee,[2,14]),t(te,[2,16],{12:[1,76]}),t(ee,[2,36],{12:[1,77]}),t(ne,[2,19]),t(ne,[2,20]),{25:[1,78]},{27:[1,79]},t(ne,[2,23]),{35:80,75:81,76:K,77:q,79:J,80:Y},{35:86,75:81,76:K,77:q,79:J,80:Y},{35:87,75:81,76:K,77:q,79:J,80:Y},{35:88,75:81,76:K,77:q,79:J,80:Y},{35:89,75:81,76:K,77:q,79:J,80:Y},{35:90,75:81,76:K,77:q,79:J,80:Y},{35:91,75:81,76:K,77:q,79:J,80:Y},{35:92,75:81,76:K,77:q,79:J,80:Y},{35:93,75:81,76:K,77:q,79:J,80:Y},{35:94,75:81,76:K,77:q,79:J,80:Y},{35:95,75:81,76:K,77:q,79:J,80:Y},{35:96,75:81,76:K,77:q,79:J,80:Y},{35:97,75:81,76:K,77:q,79:J,80:Y},{35:98,75:81,76:K,77:q,79:J,80:Y},{35:99,75:81,76:K,77:q,79:J,80:Y},{35:100,75:81,76:K,77:q,79:J,80:Y},{35:101,75:81,76:K,77:q,79:J,80:Y},{35:102,75:81,76:K,77:q,79:J,80:Y},{35:103,75:81,76:K,77:q,79:J,80:Y},{35:104,75:81,76:K,77:q,79:J,80:Y},t(X,[2,59]),{35:105,75:81,76:K,77:q,79:J,80:Y},{35:106,75:81,76:K,77:q,79:J,80:Y},{35:107,75:81,76:K,77:q,79:J,80:Y},{35:108,75:81,76:K,77:q,79:J,80:Y},{35:109,75:81,76:K,77:q,79:J,80:Y},{35:110,75:81,76:K,77:q,79:J,80:Y},{35:111,75:81,76:K,77:q,79:J,80:Y},{35:112,75:81,76:K,77:q,79:J,80:Y},{35:113,75:81,76:K,77:q,79:J,80:Y},{35:114,75:81,76:K,77:q,79:J,80:Y},{35:115,75:81,76:K,77:q,79:J,80:Y},{20:116,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{12:[1,118],33:[1,117]},{35:119,75:81,76:K,77:q,79:J,80:Y},{35:120,75:81,76:K,77:q,79:J,80:Y},{35:121,75:81,76:K,77:q,79:J,80:Y},{35:122,75:81,76:K,77:q,79:J,80:Y},{35:123,75:81,76:K,77:q,79:J,80:Y},{35:124,75:81,76:K,77:q,79:J,80:Y},{35:125,75:81,76:K,77:q,79:J,80:Y},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(ee,[2,15]),t(te,[2,17],{21:22,19:130,22:n,23:r,24:i,26:a,28:o}),t(ee,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:n,23:r,24:i,26:a,28:o,34:s,36:l,37:u,38:d,39:f,40:p,41:m,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G}),t(ne,[2,21]),t(ne,[2,22]),t(X,[2,39]),t(re,[2,71],{75:81,35:132,76:K,77:q,79:J,80:Y}),t(ie,[2,73]),{78:[1,133]},t(ie,[2,75]),t(ie,[2,76]),t(X,[2,40]),t(X,[2,41]),t(X,[2,42]),t(X,[2,43]),t(X,[2,44]),t(X,[2,45]),t(X,[2,46]),t(X,[2,47]),t(X,[2,48]),t(X,[2,49]),t(X,[2,50]),t(X,[2,51]),t(X,[2,52]),t(X,[2,53]),t(X,[2,54]),t(X,[2,55]),t(X,[2,56]),t(X,[2,57]),t(X,[2,58]),t(X,[2,60]),t(X,[2,61]),t(X,[2,62]),t(X,[2,63]),t(X,[2,64]),t(X,[2,65]),t(X,[2,66]),t(X,[2,67]),t(X,[2,68]),t(X,[2,69]),t(X,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(Z,[2,28]),t(Z,[2,29]),t(Z,[2,30]),t(Z,[2,31]),t(Z,[2,32]),t(Z,[2,33]),t(Z,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(te,[2,18]),t(ee,[2,38]),t(re,[2,72]),t(ie,[2,74]),t(X,[2,24]),t(X,[2,35]),t(ae,[2,25]),t(ae,[2,26],{12:[1,138]}),t(ae,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,l=``,u=0,d=0,f=0,p=2,m=1,h=o.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(t,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;o.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){r.length-=2*e,a.length-=e,o.length-=e}e(x,`popStack`);function S(){var e=i.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=r[r.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=s[T]&&s[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],s[T])this.terminals_[k]&&k>p&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(u+1)+`:
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{n as t,t as n}from"./d3-selection-COWvaQNI.js";import{H as r,U as i,_ as a,b as o,c as s,r as l,s as u,v as d,z as f}from"./chunk-DSNLSHJZ-zku9oeG3.js";import"./chunk-YZO67HFG-BLe7PXER.js";import{n as p,r as m,v as h}from"./chunk-7S6XSTFO-CgZAazgt.js";import"./chunk-AQDTSKZB-BRU84phF.js";import"./chunk-UHW7PFBP-DrYeJo1e.js";import{r as g,s as _}from"./chunk-HAGFOTED-CaUkBv_0.js";import{a as v}from"./chunk-55XCU76K-mKuMXpnC.js";var y=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,24],r=[1,25],i=[1,26],a=[1,27],o=[1,28],s=[1,63],l=[1,64],u=[1,65],d=[1,66],f=[1,67],p=[1,68],m=[1,69],h=[1,29],g=[1,30],_=[1,31],v=[1,32],y=[1,33],b=[1,34],x=[1,35],S=[1,36],C=[1,37],w=[1,38],T=[1,39],E=[1,40],D=[1,41],O=[1,42],k=[1,43],A=[1,44],j=[1,45],M=[1,46],N=[1,47],P=[1,48],F=[1,50],I=[1,51],L=[1,52],R=[1,53],z=[1,54],B=[1,55],V=[1,56],H=[1,57],U=[1,58],W=[1,59],G=[1,60],ee=[14,42],te=[14,34,36,37,38,39,40,41,42,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],ne=[12,14,34,36,37,38,39,40,41,42,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],K=[1,82],q=[1,83],J=[1,84],Y=[1,85],X=[12,14,42],re=[12,14,33,42],ie=[12,14,33,42,76,77,79,80],Z=[12,33],ae=[34,36,37,38,39,40,41,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],oe={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:`error`,6:`direction_tb`,7:`direction_bt`,8:`direction_rl`,9:`direction_lr`,11:`C4_CONTEXT`,12:`NEWLINE`,14:`EOF`,15:`C4_CONTAINER`,16:`C4_COMPONENT`,17:`C4_DYNAMIC`,18:`C4_DEPLOYMENT`,22:`title`,23:`accDescription`,24:`acc_title`,25:`acc_title_value`,26:`acc_descr`,27:`acc_descr_value`,28:`acc_descr_multiline_value`,33:`LBRACE`,34:`ENTERPRISE_BOUNDARY`,36:`SYSTEM_BOUNDARY`,37:`BOUNDARY`,38:`CONTAINER_BOUNDARY`,39:`NODE`,40:`NODE_L`,41:`NODE_R`,42:`RBRACE`,44:`PERSON`,45:`PERSON_EXT`,46:`SYSTEM`,47:`SYSTEM_DB`,48:`SYSTEM_QUEUE`,49:`SYSTEM_EXT`,50:`SYSTEM_EXT_DB`,51:`SYSTEM_EXT_QUEUE`,52:`CONTAINER`,53:`CONTAINER_DB`,54:`CONTAINER_QUEUE`,55:`CONTAINER_EXT`,56:`CONTAINER_EXT_DB`,57:`CONTAINER_EXT_QUEUE`,58:`COMPONENT`,59:`COMPONENT_DB`,60:`COMPONENT_QUEUE`,61:`COMPONENT_EXT`,62:`COMPONENT_EXT_DB`,63:`COMPONENT_EXT_QUEUE`,64:`REL`,65:`BIREL`,66:`REL_U`,67:`REL_D`,68:`REL_L`,69:`REL_R`,70:`REL_B`,71:`REL_INDEX`,72:`UPDATE_EL_STYLE`,73:`UPDATE_REL_STYLE`,74:`UPDATE_LAYOUT_CONFIG`,76:`STR`,77:`STR_KEY`,78:`STR_VALUE`,79:`ATTRIBUTE`,80:`ATTRIBUTE_EMPTY`},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:r.setDirection(`TB`);break;case 4:r.setDirection(`BT`);break;case 5:r.setDirection(`RL`);break;case 6:r.setDirection(`LR`);break;case 8:case 9:case 10:case 11:case 12:r.setC4Type(a[s-3]);break;case 19:r.setTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 20:r.setAccDescription(a[s].substring(15)),this.$=a[s].substring(15);break;case 21:this.$=a[s].trim(),r.setTitle(this.$);break;case 22:case 23:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 28:a[s].splice(2,0,`ENTERPRISE`),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 29:a[s].splice(2,0,`SYSTEM`),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 30:r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 31:a[s].splice(2,0,`CONTAINER`),r.addContainerBoundary(...a[s]),this.$=a[s];break;case 32:r.addDeploymentNode(`node`,...a[s]),this.$=a[s];break;case 33:r.addDeploymentNode(`nodeL`,...a[s]),this.$=a[s];break;case 34:r.addDeploymentNode(`nodeR`,...a[s]),this.$=a[s];break;case 35:r.popBoundaryParseStack();break;case 39:r.addPersonOrSystem(`person`,...a[s]),this.$=a[s];break;case 40:r.addPersonOrSystem(`external_person`,...a[s]),this.$=a[s];break;case 41:r.addPersonOrSystem(`system`,...a[s]),this.$=a[s];break;case 42:r.addPersonOrSystem(`system_db`,...a[s]),this.$=a[s];break;case 43:r.addPersonOrSystem(`system_queue`,...a[s]),this.$=a[s];break;case 44:r.addPersonOrSystem(`external_system`,...a[s]),this.$=a[s];break;case 45:r.addPersonOrSystem(`external_system_db`,...a[s]),this.$=a[s];break;case 46:r.addPersonOrSystem(`external_system_queue`,...a[s]),this.$=a[s];break;case 47:r.addContainer(`container`,...a[s]),this.$=a[s];break;case 48:r.addContainer(`container_db`,...a[s]),this.$=a[s];break;case 49:r.addContainer(`container_queue`,...a[s]),this.$=a[s];break;case 50:r.addContainer(`external_container`,...a[s]),this.$=a[s];break;case 51:r.addContainer(`external_container_db`,...a[s]),this.$=a[s];break;case 52:r.addContainer(`external_container_queue`,...a[s]),this.$=a[s];break;case 53:r.addComponent(`component`,...a[s]),this.$=a[s];break;case 54:r.addComponent(`component_db`,...a[s]),this.$=a[s];break;case 55:r.addComponent(`component_queue`,...a[s]),this.$=a[s];break;case 56:r.addComponent(`external_component`,...a[s]),this.$=a[s];break;case 57:r.addComponent(`external_component_db`,...a[s]),this.$=a[s];break;case 58:r.addComponent(`external_component_queue`,...a[s]),this.$=a[s];break;case 60:r.addRel(`rel`,...a[s]),this.$=a[s];break;case 61:r.addRel(`birel`,...a[s]),this.$=a[s];break;case 62:r.addRel(`rel_u`,...a[s]),this.$=a[s];break;case 63:r.addRel(`rel_d`,...a[s]),this.$=a[s];break;case 64:r.addRel(`rel_l`,...a[s]),this.$=a[s];break;case 65:r.addRel(`rel_r`,...a[s]),this.$=a[s];break;case 66:r.addRel(`rel_b`,...a[s]),this.$=a[s];break;case 67:a[s].splice(0,1),r.addRel(`rel`,...a[s]),this.$=a[s];break;case 68:r.updateElStyle(`update_el_style`,...a[s]),this.$=a[s];break;case 69:r.updateRelStyle(`update_rel_style`,...a[s]),this.$=a[s];break;case 70:r.updateLayoutConfig(`update_layout_config`,...a[s]),this.$=a[s];break;case 71:this.$=[a[s]];break;case 72:a[s].unshift(a[s-1]),this.$=a[s];break;case 73:case 75:this.$=a[s].trim();break;case 74:let e={};e[a[s-1].trim()]=a[s].trim(),this.$=e;break;case 76:this.$=``}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:70,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:71,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:72,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:73,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{14:[1,74]},t(ee,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:l,37:u,38:d,39:f,40:p,41:m,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G}),t(ee,[2,14]),t(te,[2,16],{12:[1,76]}),t(ee,[2,36],{12:[1,77]}),t(ne,[2,19]),t(ne,[2,20]),{25:[1,78]},{27:[1,79]},t(ne,[2,23]),{35:80,75:81,76:K,77:q,79:J,80:Y},{35:86,75:81,76:K,77:q,79:J,80:Y},{35:87,75:81,76:K,77:q,79:J,80:Y},{35:88,75:81,76:K,77:q,79:J,80:Y},{35:89,75:81,76:K,77:q,79:J,80:Y},{35:90,75:81,76:K,77:q,79:J,80:Y},{35:91,75:81,76:K,77:q,79:J,80:Y},{35:92,75:81,76:K,77:q,79:J,80:Y},{35:93,75:81,76:K,77:q,79:J,80:Y},{35:94,75:81,76:K,77:q,79:J,80:Y},{35:95,75:81,76:K,77:q,79:J,80:Y},{35:96,75:81,76:K,77:q,79:J,80:Y},{35:97,75:81,76:K,77:q,79:J,80:Y},{35:98,75:81,76:K,77:q,79:J,80:Y},{35:99,75:81,76:K,77:q,79:J,80:Y},{35:100,75:81,76:K,77:q,79:J,80:Y},{35:101,75:81,76:K,77:q,79:J,80:Y},{35:102,75:81,76:K,77:q,79:J,80:Y},{35:103,75:81,76:K,77:q,79:J,80:Y},{35:104,75:81,76:K,77:q,79:J,80:Y},t(X,[2,59]),{35:105,75:81,76:K,77:q,79:J,80:Y},{35:106,75:81,76:K,77:q,79:J,80:Y},{35:107,75:81,76:K,77:q,79:J,80:Y},{35:108,75:81,76:K,77:q,79:J,80:Y},{35:109,75:81,76:K,77:q,79:J,80:Y},{35:110,75:81,76:K,77:q,79:J,80:Y},{35:111,75:81,76:K,77:q,79:J,80:Y},{35:112,75:81,76:K,77:q,79:J,80:Y},{35:113,75:81,76:K,77:q,79:J,80:Y},{35:114,75:81,76:K,77:q,79:J,80:Y},{35:115,75:81,76:K,77:q,79:J,80:Y},{20:116,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{12:[1,118],33:[1,117]},{35:119,75:81,76:K,77:q,79:J,80:Y},{35:120,75:81,76:K,77:q,79:J,80:Y},{35:121,75:81,76:K,77:q,79:J,80:Y},{35:122,75:81,76:K,77:q,79:J,80:Y},{35:123,75:81,76:K,77:q,79:J,80:Y},{35:124,75:81,76:K,77:q,79:J,80:Y},{35:125,75:81,76:K,77:q,79:J,80:Y},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(ee,[2,15]),t(te,[2,17],{21:22,19:130,22:n,23:r,24:i,26:a,28:o}),t(ee,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:n,23:r,24:i,26:a,28:o,34:s,36:l,37:u,38:d,39:f,40:p,41:m,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G}),t(ne,[2,21]),t(ne,[2,22]),t(X,[2,39]),t(re,[2,71],{75:81,35:132,76:K,77:q,79:J,80:Y}),t(ie,[2,73]),{78:[1,133]},t(ie,[2,75]),t(ie,[2,76]),t(X,[2,40]),t(X,[2,41]),t(X,[2,42]),t(X,[2,43]),t(X,[2,44]),t(X,[2,45]),t(X,[2,46]),t(X,[2,47]),t(X,[2,48]),t(X,[2,49]),t(X,[2,50]),t(X,[2,51]),t(X,[2,52]),t(X,[2,53]),t(X,[2,54]),t(X,[2,55]),t(X,[2,56]),t(X,[2,57]),t(X,[2,58]),t(X,[2,60]),t(X,[2,61]),t(X,[2,62]),t(X,[2,63]),t(X,[2,64]),t(X,[2,65]),t(X,[2,66]),t(X,[2,67]),t(X,[2,68]),t(X,[2,69]),t(X,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(Z,[2,28]),t(Z,[2,29]),t(Z,[2,30]),t(Z,[2,31]),t(Z,[2,32]),t(Z,[2,33]),t(Z,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(te,[2,18]),t(ee,[2,38]),t(re,[2,72]),t(ie,[2,74]),t(X,[2,24]),t(X,[2,35]),t(ae,[2,25]),t(ae,[2,26],{12:[1,138]}),t(ae,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,l=``,u=0,d=0,f=0,p=2,m=1,h=o.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(t,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;o.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){r.length-=2*e,a.length-=e,o.length-=e}e(x,`popStack`);function S(){var e=i.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=r[r.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=s[T]&&s[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],s[T])this.terminals_[k]&&k>p&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(u+1)+`:
2
2
  `+g.showPosition()+`
3
3
  Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(u+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:r.push(C),a.push(g.yytext),o.push(g.yylloc),r.push(E[1]),C=null,w?(C=w,w=null):(d=g.yyleng,l=g.yytext,u=g.yylineno,y=g.yylloc,f>0&&f--);break;case 2:if(A=this.productions_[E[1]][1],O.$=a[a.length-A],O._$={first_line:o[o.length-(A||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(A||1)].first_column,last_column:o[o.length-1].last_column},b&&(O._$.range=[o[o.length-(A||1)].range[0],o[o.length-1].range[1]]),D=this.performAction.apply(O,[l,d,u,_.yy,E[1],a,o].concat(h)),D!==void 0)return D;A&&(r=r.slice(0,-1*A*2),a=a.slice(0,-1*A),o=o.slice(0,-1*A)),r.push(this.productions_[E[1]][0]),a.push(O.$),o.push(O._$),j=s[r[r.length-2]][r[r.length-1]],r.push(j);break;case 3:return!0}}return!0},`parse`)};oe.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`