@marimo-team/frontend 0.19.7-dev0 → 0.19.7-dev10

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 (160) hide show
  1. package/dist/assets/{CellStatus-D1YyNsC9.js → CellStatus-BY4X4uFY.js} +1 -1
  2. package/dist/assets/{ConnectedDataExplorerComponent-KZlvSITY.js → ConnectedDataExplorerComponent-Dj4OQPPM.js} +1 -1
  3. package/dist/assets/{JsonOutput-DlwRx3jE.js → JsonOutput-BH-e3_eJ.js} +7 -7
  4. package/dist/assets/{LazyAnyLanguageCodeMirror-Dr2G5gxJ.js → LazyAnyLanguageCodeMirror-BAZOonTp.js} +2 -2
  5. package/dist/assets/{add-cell-with-ai-DEdol3w0.js → add-cell-with-ai-MmmolUhy.js} +1 -1
  6. package/dist/assets/{add-database-form-0DEJX5nr.js → add-database-form-BkETr5YE.js} +1 -1
  7. package/dist/assets/{agent-panel-DNF472QI.js → agent-panel--GnGst4s.js} +1 -1
  8. package/dist/assets/{any-language-editor-CK5cbqaZ.js → any-language-editor-COlHX8Mm.js} +1 -1
  9. package/dist/assets/{app-config-button-r0SnKeQv.js → app-config-button-D18z5Elr.js} +1 -1
  10. package/dist/assets/{architectureDiagram-VXUJARFQ-BAPTB7Uu.js → architectureDiagram-VXUJARFQ-D1yA5Wi6.js} +1 -1
  11. package/dist/assets/{blockDiagram-VD42YOAC-ByTVsUSZ.js → blockDiagram-VD42YOAC-BGSTD5Hi.js} +1 -1
  12. package/dist/assets/{c4Diagram-YG6GDRKO-CQQT57RB.js → c4Diagram-YG6GDRKO-D-nNJZEX.js} +1 -1
  13. package/dist/assets/{cache-panel-BljwLE9L.js → cache-panel-CMeIPFKa.js} +1 -1
  14. package/dist/assets/{cell-editor-BaPoX5lw.js → cell-editor-Bp2RbXkC.js} +1 -1
  15. package/dist/assets/channel-5ylYMPfW.js +1 -0
  16. package/dist/assets/{chat-display-ZS_L6G-P.js → chat-display-C22D1dT7.js} +1 -1
  17. package/dist/assets/{chat-panel-Chm2DqS8.js → chat-panel-DnbhsdNE.js} +1 -1
  18. package/dist/assets/{chunk-55IACEB6-DvJ_-Ku-.js → chunk-55IACEB6-D-RZ-Wf7.js} +1 -1
  19. package/dist/assets/{chunk-ABZYJK2D-DAD3GlgM.js → chunk-ABZYJK2D-B1_MYIJC.js} +2 -2
  20. package/dist/assets/{chunk-ATLVNIR6-DsKp3Ify.js → chunk-ATLVNIR6-0QlrKyOY.js} +1 -1
  21. package/dist/assets/{chunk-B4BG7PRW-Cv1rtZu-.js → chunk-B4BG7PRW-D9RkXn4K.js} +1 -1
  22. package/dist/assets/{chunk-DI55MBZ5-DpQLXMld.js → chunk-DI55MBZ5-DabwYVi4.js} +1 -1
  23. package/dist/assets/{chunk-EXTU4WIE-GbJyzeBy.js → chunk-EXTU4WIE-BApi5esa.js} +1 -1
  24. package/dist/assets/{chunk-JA3XYJ7Z-BlmyoDCa.js → chunk-JA3XYJ7Z-DlG5XxD_.js} +1 -1
  25. package/dist/assets/{chunk-JZLCHNYA-DBaJpCky.js → chunk-JZLCHNYA-CflvMvb-.js} +1 -1
  26. package/dist/assets/{chunk-N4CR4FBY-DtYoI569.js → chunk-N4CR4FBY-CFrpRZMl.js} +2 -2
  27. package/dist/assets/{chunk-OGVTOU66-DQphfHw1.js → chunk-OGVTOU66-DYMZbUe5.js} +4 -4
  28. package/dist/assets/{chunk-QN33PNHL-C0IBWhei.js → chunk-QN33PNHL-D_XrcfZ2.js} +1 -1
  29. package/dist/assets/{chunk-QXUST7PY-CIxWhn5L.js → chunk-QXUST7PY-DS-Qo1sM.js} +1 -1
  30. package/dist/assets/{chunk-S3R3BYOJ-By1A-M0T.js → chunk-S3R3BYOJ-CAG3u58l.js} +1 -1
  31. package/dist/assets/{chunk-TZMSLE5B-BiNEgT46.js → chunk-TZMSLE5B-q2vYfu0u.js} +1 -1
  32. package/dist/assets/classDiagram-2ON5EDUG-052RdtZV.js +1 -0
  33. package/dist/assets/classDiagram-v2-WZHVMYZB-BgiSq5LY.js +1 -0
  34. package/dist/assets/{code-block-QI2IAROF-Ckkxnyg4.js → code-block-QI2IAROF-DwN_SFll.js} +1 -1
  35. package/dist/assets/{column-preview-DZ--KOk1.js → column-preview-UAPIglWp.js} +1 -1
  36. package/dist/assets/{command-B1zRJT1a.js → command-DB9hJj4r.js} +1 -1
  37. package/dist/assets/{command-palette-DmYvtSUz.js → command-palette-D8p1hX9Z.js} +1 -1
  38. package/dist/assets/{common-C2MMmHt4.js → common-ChOwXql6.js} +1 -1
  39. package/dist/assets/{cose-bilkent-S5V4N54A-B-gjerAi.js → cose-bilkent-S5V4N54A-gby0fxw7.js} +1 -1
  40. package/dist/assets/{dagre-6UL2VRFP-Bnzt4A4J.js → dagre-6UL2VRFP-BMUVLJmR.js} +1 -1
  41. package/dist/assets/dependency-graph-panel-DtW59Uk_.js +4 -0
  42. package/dist/assets/{diagram-PSM6KHXK-CDG_G18X.js → diagram-PSM6KHXK-B9uTT_zK.js} +1 -1
  43. package/dist/assets/{diagram-QEK2KX5R-CPk22-jF.js → diagram-QEK2KX5R-B2c50xFp.js} +1 -1
  44. package/dist/assets/{diagram-S2PKOQOG-BGwcIRrz.js → diagram-S2PKOQOG-DheOQn4c.js} +1 -1
  45. package/dist/assets/{documentation-panel-BxwnSjGK.js → documentation-panel-kCdmA321.js} +1 -1
  46. package/dist/assets/{download-C_slsU-7.js → download-B-eaoq3_.js} +1 -1
  47. package/dist/assets/{edit-page-CHi5vFR5.js → edit-page-D1WRCtHN.js} +6 -6
  48. package/dist/assets/{erDiagram-Q2GNP2WA-C5cEKchg.js → erDiagram-Q2GNP2WA-DmGqeHo_.js} +1 -1
  49. package/dist/assets/{error-panel-BCy5nltz.js → error-panel-CyzwHK7E.js} +1 -1
  50. package/dist/assets/{file-explorer-panel-riLtoV84.js → file-explorer-panel-DwkE_qtH.js} +1 -1
  51. package/dist/assets/{flowDiagram-NV44I4VS-CkUxkQez.js → flowDiagram-NV44I4VS-eCbWz-83.js} +1 -1
  52. package/dist/assets/{form-DyJ8-Zz6.js → form-Cj105R5J.js} +1 -1
  53. package/dist/assets/{ganttDiagram-JELNMOA3-BH4xsWll.js → ganttDiagram-JELNMOA3-3DhMLUJ1.js} +1 -1
  54. package/dist/assets/{gitGraphDiagram-NY62KEGX-I86uT3FX.js → gitGraphDiagram-NY62KEGX-CHcYfg4M.js} +1 -1
  55. package/dist/assets/{glide-data-editor-CFXeoAXC.js → glide-data-editor-DdEo1lIr.js} +1 -1
  56. package/dist/assets/{home-page-CZKnE2XJ.js → home-page-pDErM2B-.js} +1 -1
  57. package/dist/assets/{hooks-DjduWDUD.js → hooks-H-OwMGrs.js} +1 -1
  58. package/dist/assets/index-Wq9bXZSW.js +43 -0
  59. package/dist/assets/{infoDiagram-WHAUD3N6-cXMgF6PV.js → infoDiagram-WHAUD3N6-CFrCP6ci.js} +1 -1
  60. package/dist/assets/{journeyDiagram-XKPGCS4Q-vqg3DbEv.js → journeyDiagram-XKPGCS4Q-CIJje2rA.js} +1 -1
  61. package/dist/assets/{kanban-definition-3W4ZIXB7-BtwSVIt8.js → kanban-definition-3W4ZIXB7-DdU8g-p5.js} +1 -1
  62. package/dist/assets/katex-D_p4uM5H.js +1 -0
  63. package/dist/assets/kiosk-mode-CHV3_vAt.js +1 -0
  64. package/dist/assets/{label-CqyOmxjL.js → label-CNZLffHW.js} +1 -1
  65. package/dist/assets/{layout-CBI2c778.js → layout-1zPURdGQ.js} +1 -1
  66. package/dist/assets/{linear-AjjmB_kQ.js → linear-DV-iHtba.js} +1 -1
  67. package/dist/assets/{logs-panel-C4-6DwM7.js → logs-panel-DJHIYDYG.js} +1 -1
  68. package/dist/assets/{markdown-renderer-DjqhqmES.js → markdown-renderer-DOBdrH5a.js} +1 -1
  69. package/dist/assets/{mermaid-D5KHoN__.js → mermaid-DnXDPJxf.js} +1 -1
  70. package/dist/assets/mermaid-NA5CF7SZ-B5ZNto-r.js +1 -0
  71. package/dist/assets/mermaid.core-BewYXql0.js +1 -0
  72. package/dist/assets/{mermaid.core-iFdtpd1M.js → mermaid.core-DfEfQF14.js} +3 -3
  73. package/dist/assets/{mhchem-CDMfjrnn.js → mhchem-DtmlQa-Y.js} +1 -1
  74. package/dist/assets/{mindmap-definition-VGOIOE7T-bkwq50Hs.js → mindmap-definition-VGOIOE7T-2ehBKsBF.js} +1 -1
  75. package/dist/assets/{name-cell-input-Dc5Oz84d.js → name-cell-input-BfTcj-5o.js} +1 -1
  76. package/dist/assets/{outline-panel-Hazc5lot.js → outline-panel-Dhau5j44.js} +1 -1
  77. package/dist/assets/{packages-panel-B193htcT.js → packages-panel-BynnbKeY.js} +1 -1
  78. package/dist/assets/panel-context-CosC5qvT.js +1 -0
  79. package/dist/assets/{panels-wPsRwJLC.js → panels-HaU4LhEZ.js} +1 -1
  80. package/dist/assets/{pieDiagram-ADFJNKIX-CdLCqSiS.js → pieDiagram-ADFJNKIX-BsZc414q.js} +1 -1
  81. package/dist/assets/popover-QmFlvleQ.js +1 -0
  82. package/dist/assets/{quadrantDiagram-AYHSOK5B-FJc1d940.js → quadrantDiagram-AYHSOK5B-CLX1GT8J.js} +1 -1
  83. package/dist/assets/{react-vega-CI0fuCLO.js → react-vega-DyLUmsUn.js} +1 -1
  84. package/dist/assets/{react-vega-DdONPC3a.js → react-vega-_pepwH5d.js} +1 -1
  85. package/dist/assets/{readonly-python-code-Dr5fAkba.js → readonly-python-code-C2DdcXRg.js} +1 -1
  86. package/dist/assets/{requirementDiagram-UZGBJVZJ-grHisX2O.js → requirementDiagram-UZGBJVZJ-yeDVb1Ta.js} +1 -1
  87. package/dist/assets/{run-page-DiloPKVJ.js → run-page-CQ8VLy0R.js} +1 -1
  88. package/dist/assets/{sankeyDiagram-TZEHDZUN-DArc4irh.js → sankeyDiagram-TZEHDZUN-Vykiiwot.js} +1 -1
  89. package/dist/assets/scratchpad-panel-C4-UFjHS.js +1 -0
  90. package/dist/assets/{secrets-panel-CaBDi8LW.js → secrets-panel-DDg3J4bC.js} +1 -1
  91. package/dist/assets/{sequenceDiagram-WL72ISMW-CiYSca0h.js → sequenceDiagram-WL72ISMW-DUxi_n64.js} +1 -1
  92. package/dist/assets/{session-panel-DVgM22Up.js → session-panel-ZG5hJ3KC.js} +1 -1
  93. package/dist/assets/snippets-panel-C2M1mHGE.js +1 -0
  94. package/dist/assets/{src-Bp_72rVO.js → src-lcGySDV2.js} +1 -1
  95. package/dist/assets/state-Cls1gyOv.js +1 -0
  96. package/dist/assets/{stateDiagram-FKZM4ZOC-D40U7ncF.js → stateDiagram-FKZM4ZOC-DjrqiQMK.js} +1 -1
  97. package/dist/assets/stateDiagram-v2-4FDKWEC3-1PbbhA3u.js +1 -0
  98. package/dist/assets/{terminal-CZ_e8rW4.js → terminal-DrgSlc8W.js} +1 -1
  99. package/dist/assets/{textarea-DzIuH-E_.js → textarea-CkG0KEO5.js} +1 -1
  100. package/dist/assets/{time-DIXLO3Ax.js → time-Cg4-n5Aa.js} +1 -1
  101. package/dist/assets/{timeline-definition-IT6M3QCI-BXeNa69x.js → timeline-definition-IT6M3QCI-CvguHy6N.js} +1 -1
  102. package/dist/assets/{tracing-DsibCERP.js → tracing-Q4K2x4Hf.js} +1 -1
  103. package/dist/assets/{tracing-panel-C9hGUzPk.js → tracing-panel-aC3KCnu3.js} +2 -2
  104. package/dist/assets/{tree-CeX0mTvA.js → tree-BTuIzfAI.js} +1 -1
  105. package/dist/assets/{useAddCell-DveVmvs9.js → useAddCell-CMKRiYC3.js} +1 -1
  106. package/dist/assets/{useCellActionButton-DmwKwroH.js → useCellActionButton-_rAkF3dZ.js} +1 -1
  107. package/dist/assets/{useDeleteCell-D-55qWAK.js → useDeleteCell-DmEhgmlm.js} +1 -1
  108. package/dist/assets/{useDependencyPanelTab-C1afckCJ.js → useDependencyPanelTab-CCDnzcSh.js} +1 -1
  109. package/dist/assets/{useNotebookActions-DaM9w6Je.js → useNotebookActions-DoSNkrRT.js} +1 -1
  110. package/dist/assets/{useSplitCell-Dfn0Ozrw.js → useSplitCell-CG-lGWfZ.js} +1 -1
  111. package/dist/assets/{utilities.esm-CqQATX3k.js → utilities.esm-CygaSUQZ.js} +1 -1
  112. package/dist/assets/{vega-component-D3ylM3tt.js → vega-component-kFSLl5iv.js} +1 -1
  113. package/dist/assets/{write-secret-modal-BL-FoIag.js → write-secret-modal-C_Z81QtW.js} +1 -1
  114. package/dist/assets/{xychartDiagram-PRI3JC2R-Pi_FiTJG.js → xychartDiagram-PRI3JC2R-D9jk-l_A.js} +1 -1
  115. package/dist/index.html +37 -38
  116. package/package.json +5 -5
  117. package/src/components/editor/chrome/panels/dependency-graph-panel.tsx +46 -10
  118. package/src/plugins/impl/plotly/PlotlyPlugin.tsx +11 -66
  119. package/src/plugins/impl/plotly/__tests__/usePlotlyLayout.test.ts +113 -0
  120. package/src/plugins/impl/plotly/usePlotlyLayout.ts +163 -0
  121. package/dist/assets/channel-BftudkVr.js +0 -1
  122. package/dist/assets/classDiagram-2ON5EDUG-pASSDJWu.js +0 -1
  123. package/dist/assets/classDiagram-v2-WZHVMYZB-x3SAPA1o.js +0 -1
  124. package/dist/assets/dependency-graph-panel-DI2T4e0o.js +0 -4
  125. package/dist/assets/index-BI2D29sc.js +0 -43
  126. package/dist/assets/katex-BmeEOSF2.js +0 -1
  127. package/dist/assets/kiosk-mode-CQH06LFg.js +0 -1
  128. package/dist/assets/mermaid-NA5CF7SZ-Rdx8a8Uo.js +0 -1
  129. package/dist/assets/mermaid.core-XIi8b-BS.js +0 -1
  130. package/dist/assets/popover-DtnzNVk-.js +0 -1
  131. package/dist/assets/scratchpad-panel-Bxttzf7V.js +0 -1
  132. package/dist/assets/snippets-panel--0uDwhrb.js +0 -1
  133. package/dist/assets/state-BphSR6sx.js +0 -1
  134. package/dist/assets/stateDiagram-v2-4FDKWEC3-HEpD8xZX.js +0 -1
  135. package/dist/assets/tabs-CHiEPtZV.js +0 -1
  136. /package/dist/assets/{blob-DtJQFQyD.js → blob-Dg_vNTSs.js} +0 -0
  137. /package/dist/assets/{bundle.esm-dxSncdJD.js → bundle.esm-B0Sy2M4C.js} +0 -0
  138. /package/dist/assets/{dist-vjCyCXRJ.js → dist-Ciq1Lh9M.js} +0 -0
  139. /package/dist/assets/{dist-D0NgYwYf.js → dist-Dg7UO_Vw.js} +0 -0
  140. /package/dist/assets/{empty-state-H6r25Wek.js → empty-state-B0XJ9ZUi.js} +0 -0
  141. /package/dist/assets/{es-BJsT6vfZ.js → es-Bu_hpQqq.js} +0 -0
  142. /package/dist/assets/{esm-D2_Kx6xF.js → esm-B3JckBtM.js} +0 -0
  143. /package/dist/assets/{field-86WoveRM.js → field-DhlfpTLG.js} +0 -0
  144. /package/dist/assets/{floating-outline-DqdzWKrn.js → floating-outline-nRtS9jMm.js} +0 -0
  145. /package/dist/assets/{focus-KGgBDCvb.js → focus-BGH9Dxb1.js} +0 -0
  146. /package/dist/assets/{formats-DtJ_484s.js → formats-B9CrBoaO.js} +0 -0
  147. /package/dist/assets/{icons-9QU2Dup7.js → icons-D4lB4En9.js} +0 -0
  148. /package/dist/assets/{katex-dFZM4X_7.js → katex-AwOI3EvM.js} +0 -0
  149. /package/dist/assets/{marked.esm-BZNXs5FA.js → marked.esm-CHnOtnr3.js} +0 -0
  150. /package/dist/assets/{multi-icon-6ulZXArq.js → multi-icon-BOYRpNB_.js} +0 -0
  151. /package/dist/assets/{process-output-DN66BQYe.js → process-output-CqLi63bY.js} +0 -0
  152. /package/dist/assets/{react-resizable-panels.browser.esm-B7ZqbY8M.js → react-resizable-panels.browser.esm-BqxQegSf.js} +0 -0
  153. /package/dist/assets/{renderShortcut-BzTDKVab.js → renderShortcut-DQ1H8wv8.js} +0 -0
  154. /package/dist/assets/{requests-bNszE-ju.js → requests-DiQsDZob.js} +0 -0
  155. /package/dist/assets/{state-D4d80DfQ.js → state-CIznbe1J.js} +0 -0
  156. /package/dist/assets/{table-BatLo2vd.js → table--_20dwBZ.js} +0 -0
  157. /package/dist/assets/{timer-CPT_vXom.js → timer-BEJidwwG.js} +0 -0
  158. /package/dist/assets/{toggle-D-5M3JI_.js → toggle-G1t0cQyf.js} +0 -0
  159. /package/dist/assets/{useAsyncData-Dj1oqsrZ.js → useAsyncData-BJJJOr9W.js} +0 -0
  160. /package/dist/assets/{useDeepCompareMemoize-81gQouTn.js → useDeepCompareMemoize-gzLRYatP.js} +0 -0
@@ -1 +1 @@
1
- import{n as o,r as s}from"./src-faGJHwXX.js";import{c as w}from"./chunk-ABZYJK2D-DAD3GlgM.js";var x=o((t,i,e,a)=>{t.attr("class",e);let{width:h,height:r,x:n,y:g}=c(t,i);w(t,r,h,a);let d=l(n,g,h,r,i);t.attr("viewBox",d),s.debug(`viewBox configured: ${d} with padding: ${i}`)},"setupViewPortForSVG"),c=o((t,i)=>{var a;let e=((a=t.node())==null?void 0:a.getBBox())||{width:0,height:0,x:0,y:0};return{width:e.width+i*2,height:e.height+i*2,x:e.x,y:e.y}},"calculateDimensionsWithPadding"),l=o((t,i,e,a,h)=>`${t-h} ${i-h} ${e} ${a}`,"createViewBox");export{x as t};
1
+ import{n as o,r as s}from"./src-faGJHwXX.js";import{c as w}from"./chunk-ABZYJK2D-B1_MYIJC.js";var x=o((t,i,e,a)=>{t.attr("class",e);let{width:h,height:r,x:n,y:g}=c(t,i);w(t,r,h,a);let d=l(n,g,h,r,i);t.attr("viewBox",d),s.debug(`viewBox configured: ${d} with padding: ${i}`)},"setupViewPortForSVG"),c=o((t,i)=>{var a;let e=((a=t.node())==null?void 0:a.getBBox())||{width:0,height:0,x:0,y:0};return{width:e.width+i*2,height:e.height+i*2,x:e.x,y:e.y}},"calculateDimensionsWithPadding"),l=o((t,i,e,a,h)=>`${t-h} ${i-h} ${e} ${a}`,"createViewBox");export{x as t};
@@ -1,4 +1,4 @@
1
- import{u as G}from"./src-Bp_72rVO.js";import{_ as J,a as lt,i as dt,n as pt,o as ct,p as ht,r as ft,t as mt,u as yt,v as K}from"./step-D7xg1Moj.js";import{t as gt}from"./line-x4bpd_8D.js";import{g as S,v as kt,y as ut}from"./chunk-S3R3BYOJ-By1A-M0T.js";import{n as f,r as m}from"./src-faGJHwXX.js";import{b as O,h as xt}from"./chunk-ABZYJK2D-DAD3GlgM.js";import{n as R,r as v,t as bt}from"./chunk-HN2XXSSU-xW6J7MXn.js";import{t as wt}from"./chunk-CVBHYZKI-B6tT645I.js";import{i as Mt,n as Lt}from"./chunk-ATLVNIR6-DsKp3Ify.js";import{n as _t}from"./chunk-JA3XYJ7Z-BlmyoDCa.js";import{d as $t,r as A}from"./chunk-JZLCHNYA-DBaJpCky.js";var St=f((r,t,a,s,n,i)=>{t.arrowTypeStart&&tt(r,"start",t.arrowTypeStart,a,s,n,i),t.arrowTypeEnd&&tt(r,"end",t.arrowTypeEnd,a,s,n,i)},"addEdgeMarkers"),Ot={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},tt=f((r,t,a,s,n,i,e)=>{var l;let o=Ot[a];if(!o){m.warn(`Unknown arrow type: ${a}`);return}let h=`${n}_${i}-${o.type}${t==="start"?"Start":"End"}`;if(e&&e.trim()!==""){let d=`${h}_${e.replace(/[^\dA-Za-z]/g,"_")}`;if(!document.getElementById(d)){let p=document.getElementById(h);if(p){let c=p.cloneNode(!0);c.id=d,c.querySelectorAll("path, circle, line").forEach(x=>{x.setAttribute("stroke",e),o.fill&&x.setAttribute("fill",e)}),(l=p.parentNode)==null||l.appendChild(c)}}r.attr(`marker-${t}`,`url(${s}#${d})`)}else r.attr(`marker-${t}`,`url(${s}#${h})`)},"addEdgeMarker"),U=new Map,u=new Map,Et=f(()=>{U.clear(),u.clear()},"clear"),q=f(r=>r?r.reduce((t,a)=>t+";"+a,""):"","getLabelStyles"),Pt=f(async(r,t)=>{let a=xt(O().flowchart.htmlLabels),{labelStyles:s}=Mt(t);t.labelStyle=s;let n=await _t(r,t.label,{style:t.labelStyle,useHtmlLabels:a,addSvgBackground:!0,isNode:!1});m.info("abc82",t,t.labelType);let i=r.insert("g").attr("class","edgeLabel"),e=i.insert("g").attr("class","label").attr("data-id",t.id);e.node().appendChild(n);let o=n.getBBox();if(a){let l=n.children[0],d=G(n);o=l.getBoundingClientRect(),d.attr("width",o.width),d.attr("height",o.height)}e.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),U.set(t.id,i),t.width=o.width,t.height=o.height;let h;if(t.startLabelLeft){let l=await A(t.startLabelLeft,q(t.labelStyle)),d=r.insert("g").attr("class","edgeTerminals"),p=d.insert("g").attr("class","inner");h=p.node().appendChild(l);let c=l.getBBox();p.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),u.get(t.id)||u.set(t.id,{}),u.get(t.id).startLeft=d,T(h,t.startLabelLeft)}if(t.startLabelRight){let l=await A(t.startLabelRight,q(t.labelStyle)),d=r.insert("g").attr("class","edgeTerminals"),p=d.insert("g").attr("class","inner");h=d.node().appendChild(l),p.node().appendChild(l);let c=l.getBBox();p.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),u.get(t.id)||u.set(t.id,{}),u.get(t.id).startRight=d,T(h,t.startLabelRight)}if(t.endLabelLeft){let l=await A(t.endLabelLeft,q(t.labelStyle)),d=r.insert("g").attr("class","edgeTerminals"),p=d.insert("g").attr("class","inner");h=p.node().appendChild(l);let c=l.getBBox();p.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),d.node().appendChild(l),u.get(t.id)||u.set(t.id,{}),u.get(t.id).endLeft=d,T(h,t.endLabelLeft)}if(t.endLabelRight){let l=await A(t.endLabelRight,q(t.labelStyle)),d=r.insert("g").attr("class","edgeTerminals"),p=d.insert("g").attr("class","inner");h=p.node().appendChild(l);let c=l.getBBox();p.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),d.node().appendChild(l),u.get(t.id)||u.set(t.id,{}),u.get(t.id).endRight=d,T(h,t.endLabelRight)}return n},"insertEdgeLabel");function T(r,t){O().flowchart.htmlLabels&&r&&(r.style.width=t.length*9+"px",r.style.height="12px")}f(T,"setTerminalWidth");var Tt=f((r,t)=>{m.debug("Moving label abc88 ",r.id,r.label,U.get(r.id),t);let a=t.updatedPath?t.updatedPath:t.originalPath,{subGraphTitleTotalMargin:s}=wt(O());if(r.label){let n=U.get(r.id),i=r.x,e=r.y;if(a){let o=S.calcLabelPosition(a);m.debug("Moving label "+r.label+" from (",i,",",e,") to (",o.x,",",o.y,") abc88"),t.updatedPath&&(i=o.x,e=o.y)}n.attr("transform",`translate(${i}, ${e+s/2})`)}if(r.startLabelLeft){let n=u.get(r.id).startLeft,i=r.x,e=r.y;if(a){let o=S.calcTerminalLabelPosition(r.arrowTypeStart?10:0,"start_left",a);i=o.x,e=o.y}n.attr("transform",`translate(${i}, ${e})`)}if(r.startLabelRight){let n=u.get(r.id).startRight,i=r.x,e=r.y;if(a){let o=S.calcTerminalLabelPosition(r.arrowTypeStart?10:0,"start_right",a);i=o.x,e=o.y}n.attr("transform",`translate(${i}, ${e})`)}if(r.endLabelLeft){let n=u.get(r.id).endLeft,i=r.x,e=r.y;if(a){let o=S.calcTerminalLabelPosition(r.arrowTypeEnd?10:0,"end_left",a);i=o.x,e=o.y}n.attr("transform",`translate(${i}, ${e})`)}if(r.endLabelRight){let n=u.get(r.id).endRight,i=r.x,e=r.y;if(a){let o=S.calcTerminalLabelPosition(r.arrowTypeEnd?10:0,"end_right",a);i=o.x,e=o.y}n.attr("transform",`translate(${i}, ${e})`)}},"positionEdgeLabel"),Xt=f((r,t)=>{let a=r.x,s=r.y,n=Math.abs(t.x-a),i=Math.abs(t.y-s),e=r.width/2,o=r.height/2;return n>=e||i>=o},"outsideNode"),Yt=f((r,t,a)=>{m.debug(`intersection calc abc89:
1
+ import{u as G}from"./src-lcGySDV2.js";import{_ as J,a as lt,i as dt,n as pt,o as ct,p as ht,r as ft,t as mt,u as yt,v as K}from"./step-D7xg1Moj.js";import{t as gt}from"./line-x4bpd_8D.js";import{g as S,v as kt,y as ut}from"./chunk-S3R3BYOJ-CAG3u58l.js";import{n as f,r as m}from"./src-faGJHwXX.js";import{b as O,h as xt}from"./chunk-ABZYJK2D-B1_MYIJC.js";import{n as R,r as v,t as bt}from"./chunk-HN2XXSSU-xW6J7MXn.js";import{t as wt}from"./chunk-CVBHYZKI-B6tT645I.js";import{i as Mt,n as Lt}from"./chunk-ATLVNIR6-0QlrKyOY.js";import{n as _t}from"./chunk-JA3XYJ7Z-DlG5XxD_.js";import{d as $t,r as A}from"./chunk-JZLCHNYA-CflvMvb-.js";var St=f((r,t,a,s,n,i)=>{t.arrowTypeStart&&tt(r,"start",t.arrowTypeStart,a,s,n,i),t.arrowTypeEnd&&tt(r,"end",t.arrowTypeEnd,a,s,n,i)},"addEdgeMarkers"),Ot={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},tt=f((r,t,a,s,n,i,e)=>{var l;let o=Ot[a];if(!o){m.warn(`Unknown arrow type: ${a}`);return}let h=`${n}_${i}-${o.type}${t==="start"?"Start":"End"}`;if(e&&e.trim()!==""){let d=`${h}_${e.replace(/[^\dA-Za-z]/g,"_")}`;if(!document.getElementById(d)){let p=document.getElementById(h);if(p){let c=p.cloneNode(!0);c.id=d,c.querySelectorAll("path, circle, line").forEach(x=>{x.setAttribute("stroke",e),o.fill&&x.setAttribute("fill",e)}),(l=p.parentNode)==null||l.appendChild(c)}}r.attr(`marker-${t}`,`url(${s}#${d})`)}else r.attr(`marker-${t}`,`url(${s}#${h})`)},"addEdgeMarker"),U=new Map,u=new Map,Et=f(()=>{U.clear(),u.clear()},"clear"),q=f(r=>r?r.reduce((t,a)=>t+";"+a,""):"","getLabelStyles"),Pt=f(async(r,t)=>{let a=xt(O().flowchart.htmlLabels),{labelStyles:s}=Mt(t);t.labelStyle=s;let n=await _t(r,t.label,{style:t.labelStyle,useHtmlLabels:a,addSvgBackground:!0,isNode:!1});m.info("abc82",t,t.labelType);let i=r.insert("g").attr("class","edgeLabel"),e=i.insert("g").attr("class","label").attr("data-id",t.id);e.node().appendChild(n);let o=n.getBBox();if(a){let l=n.children[0],d=G(n);o=l.getBoundingClientRect(),d.attr("width",o.width),d.attr("height",o.height)}e.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),U.set(t.id,i),t.width=o.width,t.height=o.height;let h;if(t.startLabelLeft){let l=await A(t.startLabelLeft,q(t.labelStyle)),d=r.insert("g").attr("class","edgeTerminals"),p=d.insert("g").attr("class","inner");h=p.node().appendChild(l);let c=l.getBBox();p.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),u.get(t.id)||u.set(t.id,{}),u.get(t.id).startLeft=d,T(h,t.startLabelLeft)}if(t.startLabelRight){let l=await A(t.startLabelRight,q(t.labelStyle)),d=r.insert("g").attr("class","edgeTerminals"),p=d.insert("g").attr("class","inner");h=d.node().appendChild(l),p.node().appendChild(l);let c=l.getBBox();p.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),u.get(t.id)||u.set(t.id,{}),u.get(t.id).startRight=d,T(h,t.startLabelRight)}if(t.endLabelLeft){let l=await A(t.endLabelLeft,q(t.labelStyle)),d=r.insert("g").attr("class","edgeTerminals"),p=d.insert("g").attr("class","inner");h=p.node().appendChild(l);let c=l.getBBox();p.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),d.node().appendChild(l),u.get(t.id)||u.set(t.id,{}),u.get(t.id).endLeft=d,T(h,t.endLabelLeft)}if(t.endLabelRight){let l=await A(t.endLabelRight,q(t.labelStyle)),d=r.insert("g").attr("class","edgeTerminals"),p=d.insert("g").attr("class","inner");h=p.node().appendChild(l);let c=l.getBBox();p.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),d.node().appendChild(l),u.get(t.id)||u.set(t.id,{}),u.get(t.id).endRight=d,T(h,t.endLabelRight)}return n},"insertEdgeLabel");function T(r,t){O().flowchart.htmlLabels&&r&&(r.style.width=t.length*9+"px",r.style.height="12px")}f(T,"setTerminalWidth");var Tt=f((r,t)=>{m.debug("Moving label abc88 ",r.id,r.label,U.get(r.id),t);let a=t.updatedPath?t.updatedPath:t.originalPath,{subGraphTitleTotalMargin:s}=wt(O());if(r.label){let n=U.get(r.id),i=r.x,e=r.y;if(a){let o=S.calcLabelPosition(a);m.debug("Moving label "+r.label+" from (",i,",",e,") to (",o.x,",",o.y,") abc88"),t.updatedPath&&(i=o.x,e=o.y)}n.attr("transform",`translate(${i}, ${e+s/2})`)}if(r.startLabelLeft){let n=u.get(r.id).startLeft,i=r.x,e=r.y;if(a){let o=S.calcTerminalLabelPosition(r.arrowTypeStart?10:0,"start_left",a);i=o.x,e=o.y}n.attr("transform",`translate(${i}, ${e})`)}if(r.startLabelRight){let n=u.get(r.id).startRight,i=r.x,e=r.y;if(a){let o=S.calcTerminalLabelPosition(r.arrowTypeStart?10:0,"start_right",a);i=o.x,e=o.y}n.attr("transform",`translate(${i}, ${e})`)}if(r.endLabelLeft){let n=u.get(r.id).endLeft,i=r.x,e=r.y;if(a){let o=S.calcTerminalLabelPosition(r.arrowTypeEnd?10:0,"end_left",a);i=o.x,e=o.y}n.attr("transform",`translate(${i}, ${e})`)}if(r.endLabelRight){let n=u.get(r.id).endRight,i=r.x,e=r.y;if(a){let o=S.calcTerminalLabelPosition(r.arrowTypeEnd?10:0,"end_right",a);i=o.x,e=o.y}n.attr("transform",`translate(${i}, ${e})`)}},"positionEdgeLabel"),Xt=f((r,t)=>{let a=r.x,s=r.y,n=Math.abs(t.x-a),i=Math.abs(t.y-s),e=r.width/2,o=r.height/2;return n>=e||i>=o},"outsideNode"),Yt=f((r,t,a)=>{m.debug(`intersection calc abc89:
2
2
  outsidePoint: ${JSON.stringify(t)}
3
3
  insidePoint : ${JSON.stringify(a)}
4
4
  node : x:${r.x} y:${r.y} w:${r.width} h:${r.height}`);let s=r.x,n=r.y,i=Math.abs(s-a.x),e=r.width/2,o=a.x<t.x?e-i:e+i,h=r.height/2,l=Math.abs(t.y-a.y),d=Math.abs(t.x-a.x);if(Math.abs(n-t.y)*e>Math.abs(s-t.x)*h){let p=a.y<t.y?t.y-h-n:n-h-t.y;o=d*p/l;let c={x:a.x<t.x?a.x+o:a.x-d+o,y:a.y<t.y?a.y+l-p:a.y-l+p};return o===0&&(c.x=t.x,c.y=t.y),d===0&&(c.x=t.x),l===0&&(c.y=t.y),m.debug(`abc89 top/bottom calc, Q ${l}, q ${p}, R ${d}, r ${o}`,c),c}else{o=a.x<t.x?t.x-e-s:s-e-t.x;let p=l*o/d,c=a.x<t.x?a.x+d-o:a.x-d+o,x=a.y<t.y?a.y+p:a.y-p;return m.debug(`sides calc abc89, Q ${l}, q ${p}, R ${d}, r ${o}`,{_x:c,_y:x}),o===0&&(c=t.x,x=t.y),d===0&&(c=t.x),l===0&&(x=t.y),{x:c,y:x}}},"intersection"),rt=f((r,t)=>{m.warn("abc88 cutPathAtIntersect",r,t);let a=[],s=r[0],n=!1;return r.forEach(i=>{if(m.info("abc88 checking point",i,t),!Xt(t,i)&&!n){let e=Yt(t,s,i);m.debug("abc88 inside",i,s,e),m.debug("abc88 intersection",e,t);let o=!1;a.forEach(h=>{o||(o=h.x===e.x&&h.y===e.y)}),a.some(h=>h.x===e.x&&h.y===e.y)?m.warn("abc88 no intersect",e,a):a.push(e),n=!0}else m.warn("abc88 outside",i,s),s=i,n||a.push(i)}),m.debug("returning points",a),a},"cutPathAtIntersect");function at(r){let t=[],a=[];for(let s=1;s<r.length-1;s++){let n=r[s-1],i=r[s],e=r[s+1];(n.x===i.x&&i.y===e.y&&Math.abs(i.x-e.x)>5&&Math.abs(i.y-n.y)>5||n.y===i.y&&i.x===e.x&&Math.abs(i.x-n.x)>5&&Math.abs(i.y-e.y)>5)&&(t.push(i),a.push(s))}return{cornerPoints:t,cornerPointPositions:a}}f(at,"extractCornerPoints");var et=f(function(r,t,a){let s=t.x-r.x,n=t.y-r.y,i=a/Math.sqrt(s*s+n*n);return{x:t.x-i*s,y:t.y-i*n}},"findAdjacentPoint"),Wt=f(function(r){let{cornerPointPositions:t}=at(r),a=[];for(let s=0;s<r.length;s++)if(t.includes(s)){let n=r[s-1],i=r[s+1],e=r[s],o=et(n,e,5),h=et(i,e,5),l=h.x-o.x,d=h.y-o.y;a.push(o);let p=Math.sqrt(2)*2,c={x:e.x,y:e.y};Math.abs(i.x-n.x)>10&&Math.abs(i.y-n.y)>=10?(m.debug("Corner point fixing",Math.abs(i.x-n.x),Math.abs(i.y-n.y)),c=e.x===o.x?{x:l<0?o.x-5+p:o.x+5-p,y:d<0?o.y-p:o.y+p}:{x:l<0?o.x-p:o.x+p,y:d<0?o.y-5+p:o.y+5-p}):m.debug("Corner point skipping fixing",Math.abs(i.x-n.x),Math.abs(i.y-n.y)),a.push(c,h)}else a.push(r[s]);return a},"fixCorners"),Ht=f((r,t,a)=>{let s=r-t-a,n=Math.floor(s/4);return`0 ${t} ${Array(n).fill("2 2").join(" ")} ${a}`},"generateDashArray"),Ct=f(function(r,t,a,s,n,i,e,o=!1){var V;let{handDrawnSeed:h}=O(),l=t.points,d=!1,p=n;var c=i;let x=[];for(let k in t.cssCompiledStyles)Lt(k)||x.push(t.cssCompiledStyles[k]);m.debug("UIO intersect check",t.points,c.x,p.x),c.intersect&&p.intersect&&!o&&(l=l.slice(1,t.points.length-1),l.unshift(p.intersect(l[0])),m.debug("Last point UIO",t.start,"-->",t.end,l[l.length-1],c,c.intersect(l[l.length-1])),l.push(c.intersect(l[l.length-1])));let _=btoa(JSON.stringify(l));t.toCluster&&(m.info("to cluster abc88",a.get(t.toCluster)),l=rt(t.points,a.get(t.toCluster).node),d=!0),t.fromCluster&&(m.debug("from cluster abc88",a.get(t.fromCluster),JSON.stringify(l,null,2)),l=rt(l.reverse(),a.get(t.fromCluster).node).reverse(),d=!0);let w=l.filter(k=>!Number.isNaN(k.y));w=Wt(w);let y=J;switch(y=K,t.curve){case"linear":y=K;break;case"basis":y=J;break;case"cardinal":y=ht;break;case"bumpX":y=kt;break;case"bumpY":y=ut;break;case"catmullRom":y=yt;break;case"monotoneX":y=lt;break;case"monotoneY":y=ct;break;case"natural":y=dt;break;case"step":y=ft;break;case"stepAfter":y=mt;break;case"stepBefore":y=pt;break;default:y=J}let{x:X,y:Y}=bt(t),N=gt().x(X).y(Y).curve(y),b;switch(t.thickness){case"normal":b="edge-thickness-normal";break;case"thick":b="edge-thickness-thick";break;case"invisible":b="edge-thickness-invisible";break;default:b="edge-thickness-normal"}switch(t.pattern){case"solid":b+=" edge-pattern-solid";break;case"dotted":b+=" edge-pattern-dotted";break;case"dashed":b+=" edge-pattern-dashed";break;default:b+=" edge-pattern-solid"}let g,L=t.curve==="rounded"?it(nt(w,t),5):N(w),M=Array.isArray(t.style)?t.style:[t.style],W=M.find(k=>k==null?void 0:k.startsWith("stroke:")),H=!1;if(t.look==="handDrawn"){let k=$t.svg(r);Object.assign([],w);let C=k.path(L,{roughness:.3,seed:h});b+=" transition",g=G(C).select("path").attr("id",t.id).attr("class"," "+b+(t.classes?" "+t.classes:"")).attr("style",M?M.reduce((B,z)=>B+";"+z,""):"");let E=g.attr("d");g.attr("d",E),r.node().appendChild(g.node())}else{let k=x.join(";"),C=M?M.reduce((P,j)=>P+j+";",""):"",E="";t.animate&&(E=" edge-animation-fast"),t.animation&&(E=" edge-animation-"+t.animation);let B=(k?k+";"+C+";":C)+";"+(M?M.reduce((P,j)=>P+";"+j,""):"");g=r.append("path").attr("d",L).attr("id",t.id).attr("class"," "+b+(t.classes?" "+t.classes:"")+(E??"")).attr("style",B),W=(V=B.match(/stroke:([^;]+)/))==null?void 0:V[1],H=t.animate===!0||!!t.animation||k.includes("animation");let z=g.node(),F=typeof z.getTotalLength=="function"?z.getTotalLength():0,Z=v[t.arrowTypeStart]||0,I=v[t.arrowTypeEnd]||0;if(t.look==="neo"&&!H){let P=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?Ht(F,Z,I):`0 ${Z} ${F-Z-I} ${I}`}; stroke-dashoffset: 0;`;g.attr("style",P+g.attr("style"))}}g.attr("data-edge",!0),g.attr("data-et","edge"),g.attr("data-id",t.id),g.attr("data-points",_),t.showPoints&&w.forEach(k=>{r.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",k.x).attr("cy",k.y)});let $="";(O().flowchart.arrowMarkerAbsolute||O().state.arrowMarkerAbsolute)&&($=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,$=$.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),m.info("arrowTypeStart",t.arrowTypeStart),m.info("arrowTypeEnd",t.arrowTypeEnd),St(g,t,$,e,s,W);let st=Math.floor(l.length/2),ot=l[st];S.isLabelCoordinateInPath(ot,g.attr("d"))||(d=!0);let Q={};return d&&(Q.updatedPath=l),Q.originalPath=t.points,Q},"insertEdge");function it(r,t){if(r.length<2)return"";let a="",s=r.length,n=1e-5;for(let i=0;i<s;i++){let e=r[i],o=r[i-1],h=r[i+1];if(i===0)a+=`M${e.x},${e.y}`;else if(i===s-1)a+=`L${e.x},${e.y}`;else{let l=e.x-o.x,d=e.y-o.y,p=h.x-e.x,c=h.y-e.y,x=Math.hypot(l,d),_=Math.hypot(p,c);if(x<n||_<n){a+=`L${e.x},${e.y}`;continue}let w=l/x,y=d/x,X=p/_,Y=c/_,N=w*X+y*Y,b=Math.max(-1,Math.min(1,N)),g=Math.acos(b);if(g<n||Math.abs(Math.PI-g)<n){a+=`L${e.x},${e.y}`;continue}let L=Math.min(t/Math.sin(g/2),x/2,_/2),M=e.x-w*L,W=e.y-y*L,H=e.x+X*L,$=e.y+Y*L;a+=`L${M},${W}`,a+=`Q${e.x},${e.y} ${H},${$}`}}return a}f(it,"generateRoundedPath");function D(r,t){if(!r||!t)return{angle:0,deltaX:0,deltaY:0};let a=t.x-r.x,s=t.y-r.y;return{angle:Math.atan2(s,a),deltaX:a,deltaY:s}}f(D,"calculateDeltaAndAngle");function nt(r,t){let a=r.map(n=>({...n}));if(r.length>=2&&R[t.arrowTypeStart]){let n=R[t.arrowTypeStart],i=r[0],e=r[1],{angle:o}=D(i,e),h=n*Math.cos(o),l=n*Math.sin(o);a[0].x=i.x+h,a[0].y=i.y+l}let s=r.length;if(s>=2&&R[t.arrowTypeEnd]){let n=R[t.arrowTypeEnd],i=r[s-1],e=r[s-2],{angle:o}=D(e,i),h=n*Math.cos(o),l=n*Math.sin(o);a[s-1].x=i.x-h,a[s-1].y=i.y-l}return a}f(nt,"applyMarkerOffsetsToPoints");var Bt=f((r,t,a,s)=>{t.forEach(n=>{zt[n](r,a,s)})},"insertMarkers"),zt={extension:f((r,t,a)=>{m.trace("Making markers for ",a),r.append("defs").append("marker").attr("id",a+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),composition:f((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),aggregation:f((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),dependency:f((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),r.append("defs").append("marker").attr("id",a+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),lollipop:f((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),r.append("defs").append("marker").attr("id",a+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),point:f((r,t,a)=>{r.append("marker").attr("id",a+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),circle:f((r,t,a)=>{r.append("marker").attr("id",a+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),cross:f((r,t,a)=>{r.append("marker").attr("id",a+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),r.append("marker").attr("id",a+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),barb:f((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),only_one:f((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),r.append("defs").append("marker").attr("id",a+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),zero_or_one:f((r,t,a)=>{let s=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),s.append("path").attr("d","M9,0 L9,18");let n=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),n.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),one_or_more:f((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),r.append("defs").append("marker").attr("id",a+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),zero_or_more:f((r,t,a)=>{let s=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),s.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");let n=r.append("defs").append("marker").attr("id",a+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),n.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),requirement_arrow:f((r,t,a)=>{r.append("defs").append("marker").attr("id",a+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
@@ -1,2 +1,2 @@
1
- var g;import{t as V}from"./merge-BBX6ug-N.js";import{t as $}from"./memoize-DN0TMY36.js";import{u as Z}from"./src-Bp_72rVO.js";import{_ as tt,a as et,c as rt,d as it,f as nt,g as at,h as ot,i as st,l as lt,m as ct,n as ht,o as ut,p as ft,r as dt,s as gt,t as xt,u as pt,v as yt}from"./step-D7xg1Moj.js";import{n as s,r as y}from"./src-faGJHwXX.js";import{F as mt,f as vt,m as v,r as A,s as M}from"./chunk-ABZYJK2D-DAD3GlgM.js";import{t as _t}from"./dist-BA8xhrl2.js";var E=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function N(e){return new E(e,!0)}function P(e){return new E(e,!1)}var $t=_t(),Mt="\u200B",bt={curveBasis:tt,curveBasisClosed:at,curveBasisOpen:ot,curveBumpX:N,curveBumpY:P,curveBundle:ct,curveCardinalClosed:nt,curveCardinalOpen:it,curveCardinal:ft,curveCatmullRomClosed:lt,curveCatmullRomOpen:rt,curveCatmullRom:pt,curveLinear:yt,curveLinearClosed:gt,curveMonotoneX:et,curveMonotoneY:ut,curveNatural:st,curveStep:dt,curveStepAfter:xt,curveStepBefore:ht},wt=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,St=s(function(e,t){let r=D(e,/(?:init\b)|(?:initialize\b)/),i={};if(Array.isArray(r)){let o=r.map(l=>l.args);mt(o),i=A(i,[...o])}else i=r.args;if(!i)return;let a=vt(e,t),n="config";return i[n]!==void 0&&(a==="flowchart-v2"&&(a="flowchart"),i[a]=i[n],delete i[n]),i},"detectInit"),D=s(function(e,t=null){var r,i;try{let a=RegExp(`[%]{2}(?![{]${wt.source})(?=[}][%]{2}).*
1
+ var g;import{t as V}from"./merge-BBX6ug-N.js";import{t as $}from"./memoize-DN0TMY36.js";import{u as Z}from"./src-lcGySDV2.js";import{_ as tt,a as et,c as rt,d as it,f as nt,g as at,h as ot,i as st,l as lt,m as ct,n as ht,o as ut,p as ft,r as dt,s as gt,t as xt,u as pt,v as yt}from"./step-D7xg1Moj.js";import{n as s,r as y}from"./src-faGJHwXX.js";import{F as mt,f as vt,m as v,r as A,s as M}from"./chunk-ABZYJK2D-B1_MYIJC.js";import{t as _t}from"./dist-BA8xhrl2.js";var E=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function N(e){return new E(e,!0)}function P(e){return new E(e,!1)}var $t=_t(),Mt="\u200B",bt={curveBasis:tt,curveBasisClosed:at,curveBasisOpen:ot,curveBumpX:N,curveBumpY:P,curveBundle:ct,curveCardinalClosed:nt,curveCardinalOpen:it,curveCardinal:ft,curveCatmullRomClosed:lt,curveCatmullRomOpen:rt,curveCatmullRom:pt,curveLinear:yt,curveLinearClosed:gt,curveMonotoneX:et,curveMonotoneY:ut,curveNatural:st,curveStep:dt,curveStepAfter:xt,curveStepBefore:ht},wt=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,St=s(function(e,t){let r=D(e,/(?:init\b)|(?:initialize\b)/),i={};if(Array.isArray(r)){let o=r.map(l=>l.args);mt(o),i=A(i,[...o])}else i=r.args;if(!i)return;let a=vt(e,t),n="config";return i[n]!==void 0&&(a==="flowchart-v2"&&(a="flowchart"),i[a]=i[n],delete i[n]),i},"detectInit"),D=s(function(e,t=null){var r,i;try{let a=RegExp(`[%]{2}(?![{]${wt.source})(?=[}][%]{2}).*
2
2
  `,"ig");e=e.trim().replace(a,"").replace(/'/gm,'"'),y.debug(`Detecting diagram directive${t===null?"":" type:"+t} based on the text:${e}`);let n,o=[];for(;(n=v.exec(e))!==null;)if(n.index===v.lastIndex&&v.lastIndex++,n&&!t||t&&((r=n[1])==null?void 0:r.match(t))||t&&((i=n[2])==null?void 0:i.match(t))){let l=n[1]?n[1]:n[2],c=n[3]?n[3].trim():n[4]?JSON.parse(n[4].trim()):null;o.push({type:l,args:c})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(a){return y.error(`ERROR: ${a.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),Ct=s(function(e){return e.replace(v,"")},"removeDirectives"),It=s(function(e,t){for(let[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function b(e,t){return e?bt[`curve${e.charAt(0).toUpperCase()+e.slice(1)}`]??t:t}s(b,"interpolateToCurve");function H(e,t){let r=e.trim();if(r)return t.securityLevel==="loose"?r:(0,$t.sanitizeUrl)(r)}s(H,"formatUrl");var Tt=s((e,...t)=>{let r=e.split("."),i=r.length-1,a=r[i],n=window;for(let o=0;o<i;o++)if(n=n[r[o]],!n){y.error(`Function name: ${e} not found in window`);return}n[a](...t)},"runFunc");function w(e,t){return!e||!t?0:Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}s(w,"distance");function L(e){let t,r=0;return e.forEach(i=>{r+=w(i,t),t=i}),S(e,r/2)}s(L,"traverseEdge");function R(e){return e.length===1?e[0]:L(e)}s(R,"calcLabelPosition");var O=s((e,t=2)=>{let r=10**t;return Math.round(e*r)/r},"roundNumber"),S=s((e,t)=>{let r,i=t;for(let a of e){if(r){let n=w(a,r);if(n===0)return r;if(n<i)i-=n;else{let o=i/n;if(o<=0)return r;if(o>=1)return{x:a.x,y:a.y};if(o>0&&o<1)return{x:O((1-o)*r.x+o*a.x,5),y:O((1-o)*r.y+o*a.y,5)}}}r=a}throw Error("Could not find a suitable point for the given distance")},"calculatePoint"),Bt=s((e,t,r)=>{y.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());let i=S(t,25),a=e?10:5,n=Math.atan2(t[0].y-i.y,t[0].x-i.x),o={x:0,y:0};return o.x=Math.sin(n)*a+(t[0].x+i.x)/2,o.y=-Math.cos(n)*a+(t[0].y+i.y)/2,o},"calcCardinalityPosition");function j(e,t,r){let i=structuredClone(r);y.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();let a=S(i,25+e),n=10+e*.5,o=Math.atan2(i[0].y-a.y,i[0].x-a.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(o+Math.PI)*n+(i[0].x+a.x)/2,l.y=-Math.cos(o+Math.PI)*n+(i[0].y+a.y)/2):t==="end_right"?(l.x=Math.sin(o-Math.PI)*n+(i[0].x+a.x)/2-5,l.y=-Math.cos(o-Math.PI)*n+(i[0].y+a.y)/2-5):t==="end_left"?(l.x=Math.sin(o)*n+(i[0].x+a.x)/2-5,l.y=-Math.cos(o)*n+(i[0].y+a.y)/2-5):(l.x=Math.sin(o)*n+(i[0].x+a.x)/2,l.y=-Math.cos(o)*n+(i[0].y+a.y)/2),l}s(j,"calcTerminalLabelPosition");function C(e){let t="",r="";for(let i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}s(C,"getStylesFromArray");var k=0,U=s(()=>(k++,"id-"+Math.random().toString(36).substr(2,12)+"-"+k),"generateId");function G(e){let t="";for(let r=0;r<e;r++)t+="0123456789abcdef".charAt(Math.floor(Math.random()*16));return t}s(G,"makeRandomHex");var J=s(e=>G(e.length),"random"),Wt=s(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),Ft=s(function(e,t){let r=t.text.replace(M.lineBreakRegex," "),[,i]=_(t.fontSize),a=e.append("text");a.attr("x",t.x),a.attr("y",t.y),a.style("text-anchor",t.anchor),a.style("font-family",t.fontFamily),a.style("font-size",i),a.style("font-weight",t.fontWeight),a.attr("fill",t.fill),t.class!==void 0&&a.attr("class",t.class);let n=a.append("tspan");return n.attr("x",t.x+t.textMargin*2),n.attr("fill",t.fill),n.text(r),a},"drawSimpleText"),X=$((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),M.lineBreakRegex.test(e)))return e;let i=e.split(" ").filter(Boolean),a=[],n="";return i.forEach((o,l)=>{let c=d(`${o} `,r),h=d(n,r);if(c>t){let{hyphenatedStrings:u,remainingWord:x}=zt(o,t,"-",r);a.push(n,...u),n=x}else h+c>=t?(a.push(n),n=o):n=[n,o].filter(Boolean).join(" ");l+1===i.length&&a.push(n)}),a.filter(o=>o!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),zt=$((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);let a=[...e],n=[],o="";return a.forEach((l,c)=>{let h=`${o}${l}`;if(d(h,i)>=t){let u=c+1,x=a.length===u,p=`${h}${r}`;n.push(x?h:p),o=""}else o=h}),{hyphenatedStrings:n,remainingWord:o}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function I(e,t){return T(e,t).height}s(I,"calculateTextHeight");function d(e,t){return T(e,t).width}s(d,"calculateTextWidth");var T=$((e,t)=>{let{fontSize:r=12,fontFamily:i="Arial",fontWeight:a=400}=t;if(!e)return{width:0,height:0};let[,n]=_(r),o=["sans-serif",i],l=e.split(M.lineBreakRegex),c=[],h=Z("body");if(!h.remove)return{width:0,height:0,lineHeight:0};let u=h.append("svg");for(let x of o){let p=0,f={width:0,height:0,lineHeight:0};for(let Q of l){let F=Wt();F.text=Q||"\u200B";let z=Ft(u,F).style("font-size",n).style("font-weight",a).style("font-family",x),m=(z._groups||z)[0][0].getBBox();if(m.width===0&&m.height===0)throw Error("svg element not in render tree");f.width=Math.round(Math.max(f.width,m.width)),p=Math.round(m.height),f.height+=p,f.lineHeight=Math.round(Math.max(f.lineHeight,p))}c.push(f)}return u.remove(),c[isNaN(c[1].height)||isNaN(c[1].width)||isNaN(c[1].lineHeight)||c[0].height>c[1].height&&c[0].width>c[1].width&&c[0].lineHeight>c[1].lineHeight?0:1]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),At=(g=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},s(g,"InitIDGenerator"),g),B,Et=s(function(e){return B||(B=document.createElement("div")),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),B.innerHTML=e,unescape(B.textContent)},"entityDecode");function Y(e){return"str"in e}s(Y,"isDetailedError");var Nt=s((e,t,r,i)=>{var n;if(!i)return;let a=(n=e.node())==null?void 0:n.getBBox();a&&e.append("text").text(i).attr("text-anchor","middle").attr("x",a.x+a.width/2).attr("y",-r).attr("class",t)},"insertTitle"),_=s(e=>{if(typeof e=="number")return[e,e+"px"];let t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function W(e,t){return V({},e,t)}s(W,"cleanAndMerge");var Pt={assignWithDepth:A,wrapLabel:X,calculateTextHeight:I,calculateTextWidth:d,calculateTextDimensions:T,cleanAndMerge:W,detectInit:St,detectDirective:D,isSubstringInArray:It,interpolateToCurve:b,calcLabelPosition:R,calcCardinalityPosition:Bt,calcTerminalLabelPosition:j,formatUrl:H,getStylesFromArray:C,generateId:U,random:J,runFunc:Tt,entityDecode:Et,insertTitle:Nt,isLabelCoordinateInPath:K,parseFontSize:_,InitIDGenerator:At},Dt=s(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){let i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"\uFB02\xB0\xB0"+i+"\xB6\xDF":"\uFB02\xB0"+i+"\xB6\xDF"}),t},"encodeEntities"),Ht=s(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),Lt=s((e,t,{counter:r=0,prefix:i,suffix:a},n)=>n||`${i?`${i}_`:""}${e}_${t}_${r}${a?`_${a}`:""}`,"getEdgeId");function q(e){return e??null}s(q,"handleUndefinedAttr");function K(e,t){let r=Math.round(e.x),i=Math.round(e.y),a=t.replace(/(\d+\.\d+)/g,n=>Math.round(parseFloat(n)).toString());return a.includes(r.toString())||a.includes(i.toString())}s(K,"isLabelCoordinateInPath");export{X as _,Ht as a,Lt as c,b as d,Y as f,Pt as g,Ct as h,W as i,C as l,J as m,I as n,Dt as o,_ as p,d as r,U as s,Mt as t,q as u,N as v,P as y};
@@ -1 +1 @@
1
- import{n as l}from"./src-faGJHwXX.js";import{k as n}from"./chunk-ABZYJK2D-DAD3GlgM.js";import{t as d}from"./dist-BA8xhrl2.js";var x=d(),o=l((s,t)=>{let a=s.append("rect");if(a.attr("x",t.x),a.attr("y",t.y),a.attr("fill",t.fill),a.attr("stroke",t.stroke),a.attr("width",t.width),a.attr("height",t.height),t.name&&a.attr("name",t.name),t.rx&&a.attr("rx",t.rx),t.ry&&a.attr("ry",t.ry),t.attrs!==void 0)for(let r in t.attrs)a.attr(r,t.attrs[r]);return t.class&&a.attr("class",t.class),a},"drawRect"),h=l((s,t)=>{o(s,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"}).lower()},"drawBackgroundRect"),c=l((s,t)=>{let a=t.text.replace(n," "),r=s.append("text");r.attr("x",t.x),r.attr("y",t.y),r.attr("class","legend"),r.style("text-anchor",t.anchor),t.class&&r.attr("class",t.class);let e=r.append("tspan");return e.attr("x",t.x+t.textMargin*2),e.text(a),r},"drawText"),p=l((s,t,a,r)=>{let e=s.append("image");e.attr("x",t),e.attr("y",a);let i=(0,x.sanitizeUrl)(r);e.attr("xlink:href",i)},"drawImage"),y=l((s,t,a,r)=>{let e=s.append("use");e.attr("x",t),e.attr("y",a);let i=(0,x.sanitizeUrl)(r);e.attr("xlink:href",`#${i}`)},"drawEmbeddedImage"),g=l(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),m=l(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj");export{c as a,o as i,y as n,g as o,p as r,m as s,h as t};
1
+ import{n as l}from"./src-faGJHwXX.js";import{k as n}from"./chunk-ABZYJK2D-B1_MYIJC.js";import{t as d}from"./dist-BA8xhrl2.js";var x=d(),o=l((s,t)=>{let a=s.append("rect");if(a.attr("x",t.x),a.attr("y",t.y),a.attr("fill",t.fill),a.attr("stroke",t.stroke),a.attr("width",t.width),a.attr("height",t.height),t.name&&a.attr("name",t.name),t.rx&&a.attr("rx",t.rx),t.ry&&a.attr("ry",t.ry),t.attrs!==void 0)for(let r in t.attrs)a.attr(r,t.attrs[r]);return t.class&&a.attr("class",t.class),a},"drawRect"),h=l((s,t)=>{o(s,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"}).lower()},"drawBackgroundRect"),c=l((s,t)=>{let a=t.text.replace(n," "),r=s.append("text");r.attr("x",t.x),r.attr("y",t.y),r.attr("class","legend"),r.style("text-anchor",t.anchor),t.class&&r.attr("class",t.class);let e=r.append("tspan");return e.attr("x",t.x+t.textMargin*2),e.text(a),r},"drawText"),p=l((s,t,a,r)=>{let e=s.append("image");e.attr("x",t),e.attr("y",a);let i=(0,x.sanitizeUrl)(r);e.attr("xlink:href",i)},"drawImage"),y=l((s,t,a,r)=>{let e=s.append("use");e.attr("x",t),e.attr("y",a);let i=(0,x.sanitizeUrl)(r);e.attr("xlink:href",`#${i}`)},"drawEmbeddedImage"),g=l(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),m=l(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj");export{c as a,o as i,y as n,g as o,p as r,m as s,h as t};
@@ -0,0 +1 @@
1
+ import"./purify.es-N-2faAGj.js";import"./marked.esm-CHnOtnr3.js";import"./src-lcGySDV2.js";import"./chunk-S3R3BYOJ-CAG3u58l.js";import{n as t}from"./src-faGJHwXX.js";import"./chunk-ABZYJK2D-B1_MYIJC.js";import"./chunk-HN2XXSSU-xW6J7MXn.js";import"./chunk-CVBHYZKI-B6tT645I.js";import"./chunk-ATLVNIR6-0QlrKyOY.js";import"./dist-BA8xhrl2.js";import"./chunk-JA3XYJ7Z-DlG5XxD_.js";import"./chunk-JZLCHNYA-CflvMvb-.js";import"./chunk-QXUST7PY-DS-Qo1sM.js";import"./chunk-N4CR4FBY-CFrpRZMl.js";import"./chunk-FMBD7UC4-DYXO3edG.js";import"./chunk-55IACEB6-D-RZ-Wf7.js";import"./chunk-QN33PNHL-D_XrcfZ2.js";import{i,n as o,r as m,t as p}from"./chunk-B4BG7PRW-D9RkXn4K.js";var a={parser:o,get db(){return new p},renderer:m,styles:i,init:t(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{a as diagram};
@@ -0,0 +1 @@
1
+ import"./purify.es-N-2faAGj.js";import"./marked.esm-CHnOtnr3.js";import"./src-lcGySDV2.js";import"./chunk-S3R3BYOJ-CAG3u58l.js";import{n as t}from"./src-faGJHwXX.js";import"./chunk-ABZYJK2D-B1_MYIJC.js";import"./chunk-HN2XXSSU-xW6J7MXn.js";import"./chunk-CVBHYZKI-B6tT645I.js";import"./chunk-ATLVNIR6-0QlrKyOY.js";import"./dist-BA8xhrl2.js";import"./chunk-JA3XYJ7Z-DlG5XxD_.js";import"./chunk-JZLCHNYA-CflvMvb-.js";import"./chunk-QXUST7PY-DS-Qo1sM.js";import"./chunk-N4CR4FBY-CFrpRZMl.js";import"./chunk-FMBD7UC4-DYXO3edG.js";import"./chunk-55IACEB6-D-RZ-Wf7.js";import"./chunk-QN33PNHL-D_XrcfZ2.js";import{i,n as o,r as m,t as p}from"./chunk-B4BG7PRW-D9RkXn4K.js";var a={parser:o,get db(){return new p},renderer:m,styles:i,init:t(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{a as diagram};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-OKVWEBnZ.js","./angular-html-BqeXm_3M.js","./html-Bz1QLM72.js","./css-xi2XX7Oh.js","./javascript-DgAW-dkP.js","./angular-ts-BIRRYsa7.js","./scss-B9q1Ycvh.js","./apl-D89nlt3r.js","./json-CdDqxu0N.js","./xml-CmKMNcqy.js","./java-B5fxTROr.js","./astro-CjefMLzo.js","./postcss-Bdp-ioMS.js","./tsx-xlMEuxtQ.js","./typescript-DAlbup0L.js","./blade-C8Y-ujne.js","./html-derivative-CWtHbpe8.js","./sql-HYiT1H9d.js","./bsl-DTJwR2Lj.js","./sdbl-B0Yf9V5G.js","./c-iRBcYuSn.js","./c-B0sc7wbk.js","./cairo-D1ogmZMK.js","./python-GH_mL2fV.js","./cmake-CbujdZpI.js","./cmake-B-3s70IL.js","./cobol-DcIidm82.js","./coffee-5DFMhSBl.js","./cpp-BRiTgQM2.js","./cpp-ButBmjz6.js","./glsl-DZDdueIl.js","./regexp-QwV8aHth.js","./crystal-DjnXLfjs.js","./shellscript-CkXVEK14.js","./csharp-DIGSFj_e.js","./csharp-5LNI6iDS.js","./css-BsEWHSCn.js","./diff-y8lnZMmD.js","./diff-DPcVaaVw.js","./edge-Ci3eSGFz.js","./elixir-W0RBPVS-.js","./elm-C7b2aJq3.js","./erb-r3C7bA9H.js","./ruby-Dh6KaFMR.js","./graphql-CfOz-fSn.js","./jsx-Ds6NZiun.js","./haml-CHc_eRmq.js","./lua-BbH09Iv3.js","./yaml-gd-fI6BI.js","./erlang-yLn-8onD.js","./markdown-DroiuUZL.js","./fortran-fixed-form-OBD5ulQv.js","./fortran-free-form-BDe2V9k1.js","./fortran-free-form-g8Lzga6K.js","./fsharp-BTMwKGsE.js","./gdresource-B6pXclxl.js","./gdscript-BU0D7NXT.js","./gdshader-Bm2eQm_D.js","./gdscript-CPqD-zPC.js","./gdshader-DO5IkfXs.js","./git-commit-ClJTi5G-.js","./git-rebase-DwdtIL6I.js","./glimmer-js-B9ocDpQc.js","./glimmer-ts-BNujtAQa.js","./glsl-D-ItHUmD.js","./go-DyIs3qQk.js","./go-CBmpUsEL.js","./graphql-ea2rX4Pn.js","./hack-BnX-rsnc.js","./haml-B8pvwVU8.js","./handlebars-CV3XdPcE.js","./haxe-B6aOIwam.js","./haxe-CiC_VUE1.js","./hlsl--1ChKHXm.js","./hlsl-4BS-QYIt.js","./html-BwxSLDuz.js","./html-derivative-Dl8qqS-O.js","./http-SM9PQ4p3.js","./hxml-BewqP3XB.js","./java-BvFubqPm.js","./javascript-Bai85G8g.js","./jinja-B0tm6Ng1.js","./jison-DJ5B-y0A.js","./json-Bk31jFSV.js","./jsx-DARzpZIA.js","./julia-CTbxlJE3.js","./r-CpeNqXZC.js","./latex-4Accjnw5.js","./tex-_irDT5ET.js","./less-BEv9dydD.js","./less-BQiVuzTN.js","./liquid-CCS7f-BT.js","./lua-CT29upRv.js","./markdown-B5dUEZKJ.js","./marko-Cip_Po2S.js","./mdc-CYEL6kBx.js","./nginx-b0P6EqEr.js","./nim-2LoM9u8F.js","./perl-BMO4-Wia.js","./php-NuTACPfp.js","./php-dabBNyWz.js","./postcss-DjoFGpXH.js","./pug-w6c6UB24.js","./python-CNXv2KWA.js","./qml-DrwtSjfx.js","./r-D6Z0BB-w.js","./razor-B4wA7jBD.js","./regexp-DlTnRo5X.js","./rst-ftZ-oDhd.js","./ruby-BBBmfZso.js","./sas-epRrdRwP.js","./scss-B2xSI_mm.js","./sdbl-v_PBVpFd.js","./shaderlab-CfxIQFYg.js","./shellscript-9NbB6rUg.js","./shellsession-BhZwmtTx.js","./soy-D40oJbOR.js","./sparql-CJElaVsv.js","./turtle-DaGtFj8Y.js","./sql-CS8vCjQ-.js","./stata-DfVau2QO.js","./stylus-DEqyykkC.js","./stylus-Kok2mVTF.js","./svelte-CNe2JkA7.js","./templ-Dk-lmfRg.js","./tex-BTh7fu2c.js","./ts-tags-DsSBybUC.js","./tsx-B7QHGODT.js","./turtle-epRxag87.js","./twig-CaF5hrLR.js","./typescript-BThuMR9H.js","./vue-DlNI5OYp.js","./vue-DqwiwKMh.js","./vue-html-2SFryLhG.js","./vue-vine-DC6NkOTk.js","./xml-C9-klnEl.js","./xsl-Dhl_QCID.js","./yaml-ClzXjtB1.js"])))=>i.map(i=>d[i]);
2
- var nu=Object.defineProperty;var iu=Object.getPrototypeOf;var su=Reflect.get;var mn=k=>{throw TypeError(k)};var ou=(k,x,T)=>x in k?nu(k,x,{enumerable:!0,configurable:!0,writable:!0,value:T}):k[x]=T;var f=(k,x,T)=>ou(k,typeof x!="symbol"?x+"":x,T),lr=(k,x,T)=>x.has(k)||mn("Cannot "+T);var M=(k,x,T)=>(lr(k,x,"read from private field"),T?T.call(k):x.get(k)),we=(k,x,T)=>x.has(k)?mn("Cannot add the same private member more than once"):x instanceof WeakSet?x.add(k):x.set(k,T),z=(k,x,T,Ue)=>(lr(k,x,"write to private field"),Ue?Ue.call(k,T):x.set(k,T),T),ur=(k,x,T)=>(lr(k,x,"access private method"),T);var dn=(k,x,T)=>su(iu(k),T,x);import{s as _n}from"./chunk-LvLJmgfZ.js";import{t as lu}from"./react-BGmjiNul.js";import{t as uu}from"./jsx-runtime-DN_bIXfG.js";import"./cjs-Bj40p_Np.js";import{t as c}from"./preload-helper-BW0IMuFq.js";import{a as cr,c as cu,d as pu,f as hu,l as mu,m as du,n as _u,o as pr,p as fn,s as gn,t as fu,u as gu,__tla as yu}from"./chunk-OGVTOU66-DQphfHw1.js";import"./katex-dFZM4X_7.js";import"./marked.esm-BZNXs5FA.js";let yn,wu=Promise.all([(()=>{try{return yu}catch{}})()]).then(async()=>{var ee,U,se,te,_e,fe,ge,je,mr,oe;var k=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function x(e){return T(e)}function T(e){return Array.isArray(e)?Ue(e):e instanceof RegExp?e:typeof e=="object"?An(e):e}function Ue(e){let t=[];for(let r=0,a=e.length;r<a;r++)t[r]=T(e[r]);return t}function An(e){let t={};for(let r in e)t[r]=T(e[r]);return t}function dr(e,...t){return t.forEach(r=>{for(let a in r)e[a]=r[a]}),e}function _r(e){let t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?_r(e.substring(0,e.length-1)):e.substr(~t+1)}var Et=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Fe=class{static hasCaptures(e){return e===null?!1:(Et.lastIndex=0,Et.test(e))}static replaceCaptures(e,t,r){return e.replace(Et,(a,n,i,s)=>{let l=r[parseInt(n||i,10)];if(l){let o=t.substring(l.start,l.end);for(;o[0]===".";)o=o.substring(1);switch(s){case"downcase":return o.toLowerCase();case"upcase":return o.toUpperCase();default:return o}}else return a})}};function fr(e,t){return e<t?-1:e>t?1:0}function gr(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let r=e.length,a=t.length;if(r===a){for(let n=0;n<r;n++){let i=fr(e[n],t[n]);if(i!==0)return i}return 0}return r-a}function yr(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function wr(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Er=class{constructor(e){f(this,"cache",new Map);this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},We=class{constructor(e,t,r){f(this,"_cachedMatchRoot",new Er(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=r}static createFromRawTheme(e,t){return this.createFromParsedTheme(xn(e),t)}static createFromParsedTheme(e,t){return Sn(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,r=this._cachedMatchRoot.get(t).find(a=>Cn(e.parent,a.parentScopes));return r?new br(r.fontStyle,r.foreground,r.background):null}},bt=class wt{constructor(t,r){this.parent=t,this.scopeName=r}static push(t,r){for(let a of r)t=new wt(t,a);return t}static from(...t){let r=null;for(let a=0;a<t.length;a++)r=new wt(r,t[a]);return r}push(t){return new wt(this,t)}getSegments(){let t=this,r=[];for(;t;)r.push(t.scopeName),t=t.parent;return r.reverse(),r}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){let r=[],a=this;for(;a&&a!==t;)r.push(a.scopeName),a=a.parent;return a===t?r.reverse():void 0}};function Cn(e,t){if(t.length===0)return!0;for(let r=0;r<t.length;r++){let a=t[r],n=!1;if(a===">"){if(r===t.length-1)return!1;a=t[++r],n=!0}for(;e&&!In(e.scopeName,a);){if(n)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function In(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var br=class{constructor(e,t,r){this.fontStyle=e,this.foregroundId=t,this.backgroundId=r}};function xn(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,r=[],a=0;for(let n=0,i=t.length;n<i;n++){let s=t[n];if(!s.settings)continue;let l;if(typeof s.scope=="string"){let p=s.scope;p=p.replace(/^[,]+/,""),p=p.replace(/[,]+$/,""),l=p.split(",")}else l=Array.isArray(s.scope)?s.scope:[""];let o=-1;if(typeof s.settings.fontStyle=="string"){o=0;let p=s.settings.fontStyle.split(" ");for(let m=0,d=p.length;m<d;m++)switch(p[m]){case"italic":o|=1;break;case"bold":o|=2;break;case"underline":o|=4;break;case"strikethrough":o|=8;break}}let u=null;typeof s.settings.foreground=="string"&&yr(s.settings.foreground)&&(u=s.settings.foreground);let h=null;typeof s.settings.background=="string"&&yr(s.settings.background)&&(h=s.settings.background);for(let p=0,m=l.length;p<m;p++){let d=l[p].trim().split(" "),_=d[d.length-1],y=null;d.length>1&&(y=d.slice(0,d.length-1),y.reverse()),r[a++]=new Ln(_,y,n,o,u,h)}}return r}var Ln=class{constructor(e,t,r,a,n,i){this.scope=e,this.parentScopes=t,this.index=r,this.fontStyle=a,this.foreground=n,this.background=i}},V=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(V||{});function Sn(e,t){e.sort((o,u)=>{let h=fr(o.scope,u.scope);return h!==0||(h=gr(o.parentScopes,u.parentScopes),h!==0)?h:o.index-u.index});let r=0,a="#000000",n="#ffffff";for(;e.length>=1&&e[0].scope==="";){let o=e.shift();o.fontStyle!==-1&&(r=o.fontStyle),o.foreground!==null&&(a=o.foreground),o.background!==null&&(n=o.background)}let i=new Tn(t),s=new br(r,i.getId(a),i.getId(n)),l=new Rn(new kt(0,null,-1,0,0),[]);for(let o=0,u=e.length;o<u;o++){let h=e[o];l.insert(0,h.scope,h.parentScopes,h.fontStyle,i.getId(h.foreground),i.getId(h.background))}return new We(i,s,l)}var Tn=class{constructor(e){f(this,"_isFrozen");f(this,"_lastColorId");f(this,"_id2color");f(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,r=e.length;t<r;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Pn=Object.freeze([]),kt=class wn{constructor(t,r,a,n,i){f(this,"scopeDepth");f(this,"parentScopes");f(this,"fontStyle");f(this,"foreground");f(this,"background");this.scopeDepth=t,this.parentScopes=r||Pn,this.fontStyle=a,this.foreground=n,this.background=i}clone(){return new wn(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let r=[];for(let a=0,n=t.length;a<n;a++)r[a]=t[a].clone();return r}acceptOverwrite(t,r,a,n){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,r!==-1&&(this.fontStyle=r),a!==0&&(this.foreground=a),n!==0&&(this.background=n)}},Rn=class hr{constructor(t,r=[],a={}){f(this,"_rulesWithParentScopes");this._mainRule=t,this._children=a,this._rulesWithParentScopes=r}static _cmpBySpecificity(t,r){if(t.scopeDepth!==r.scopeDepth)return r.scopeDepth-t.scopeDepth;let a=0,n=0;for(;t.parentScopes[a]===">"&&a++,r.parentScopes[n]===">"&&n++,!(a>=t.parentScopes.length||n>=r.parentScopes.length);){let i=r.parentScopes[n].length-t.parentScopes[a].length;if(i!==0)return i;a++,n++}return r.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let a=t.indexOf("."),n,i;if(a===-1?(n=t,i=""):(n=t.substring(0,a),i=t.substring(a+1)),this._children.hasOwnProperty(n))return this._children[n].match(i)}let r=this._rulesWithParentScopes.concat(this._mainRule);return r.sort(hr._cmpBySpecificity),r}insert(t,r,a,n,i,s){if(r===""){this._doInsertHere(t,a,n,i,s);return}let l=r.indexOf("."),o,u;l===-1?(o=r,u=""):(o=r.substring(0,l),u=r.substring(l+1));let h;this._children.hasOwnProperty(o)?h=this._children[o]:(h=new hr(this._mainRule.clone(),kt.cloneArr(this._rulesWithParentScopes)),this._children[o]=h),h.insert(t+1,u,a,n,i,s)}_doInsertHere(t,r,a,n,i){if(r===null){this._mainRule.acceptOverwrite(t,a,n,i);return}for(let s=0,l=this._rulesWithParentScopes.length;s<l;s++){let o=this._rulesWithParentScopes[s];if(gr(o.parentScopes,r)===0){o.acceptOverwrite(t,a,n,i);return}}a===-1&&(a=this._mainRule.fontStyle),n===0&&(n=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new kt(t,r,a,n,i))}},Ee=class W{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){let r=W.getLanguageId(t),a=W.getTokenType(t),n=W.getFontStyle(t),i=W.getForeground(t),s=W.getBackground(t);console.log({languageId:r,tokenType:a,fontStyle:n,foreground:i,background:s})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!=0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,r,a,n,i,s,l){let o=W.getLanguageId(t),u=W.getTokenType(t),h=W.containsBalancedBrackets(t)?1:0,p=W.getFontStyle(t),m=W.getForeground(t),d=W.getBackground(t);return r!==0&&(o=r),a!==8&&(u=a),n!==null&&(h=n?1:0),i!==-1&&(p=i),s!==0&&(m=s),l!==0&&(d=l),(o<<0|u<<8|h<<10|p<<11|m<<15|d<<24)>>>0}};function Eu(e){return e}function bu(e){return e}function He(e,t){let r=[],a=On(e),n=a.next();for(;n!==null;){let o=0;if(n.length===2&&n.charAt(1)===":"){switch(n.charAt(0)){case"R":o=1;break;case"L":o=-1;break;default:console.log(`Unknown priority ${n} in scope selector`)}n=a.next()}let u=s();if(r.push({matcher:u,priority:o}),n!==",")break;n=a.next()}return r;function i(){if(n==="-"){n=a.next();let o=i();return u=>!!o&&!o(u)}if(n==="("){n=a.next();let o=l();return n===")"&&(n=a.next()),o}if(kr(n)){let o=[];do o.push(n),n=a.next();while(kr(n));return u=>t(o,u)}return null}function s(){let o=[],u=i();for(;u;)o.push(u),u=i();return h=>o.every(p=>p(h))}function l(){let o=[],u=s();for(;u&&(o.push(u),n==="|"||n===",");){do n=a.next();while(n==="|"||n===",");u=s()}return h=>o.some(p=>p(h))}}function kr(e){return!!e&&!!e.match(/[\w\.:]+/)}function On(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,r=t.exec(e);return{next:()=>{if(!r)return null;let a=r[0];return r=t.exec(e),a}}}function Ar(e){typeof e.dispose=="function"&&e.dispose()}var Pe=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},vn=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Nn=class{constructor(){f(this,"_references",[]);f(this,"_seenReferenceKeys",new Set);f(this,"visitedRule",new Set)}get references(){return this._references}add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Dn=class{constructor(e,t){f(this,"seenFullScopeRequests",new Set);f(this,"seenPartialScopeRequests",new Set);f(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Pe(this.initialScopeName)]}processQueue(){let e=this.Q;this.Q=[];let t=new Nn;for(let r of e)Vn(r,this.initialScopeName,this.repo,t);for(let r of t.references)if(r instanceof Pe){if(this.seenFullScopeRequests.has(r.scopeName))continue;this.seenFullScopeRequests.add(r.scopeName),this.Q.push(r)}else{if(this.seenFullScopeRequests.has(r.scopeName)||this.seenPartialScopeRequests.has(r.toKey()))continue;this.seenPartialScopeRequests.add(r.toKey()),this.Q.push(r)}}};function Vn(e,t,r,a){let n=r.lookup(e.scopeName);if(!n){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let i=r.lookup(t);e instanceof Pe?qe({baseGrammar:i,selfGrammar:n},a):At(e.ruleName,{baseGrammar:i,selfGrammar:n,repository:n.repository},a);let s=r.injections(e.scopeName);if(s)for(let l of s)a.add(new Pe(l))}function At(e,t,r){if(t.repository&&t.repository[e]){let a=t.repository[e];ze([a],t,r)}}function qe(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&ze(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&ze(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function ze(e,t,r){for(let a of e){if(r.visitedRule.has(a))continue;r.visitedRule.add(a);let n=a.repository?dr({},t.repository,a.repository):t.repository;Array.isArray(a.patterns)&&ze(a.patterns,{...t,repository:n},r);let i=a.include;if(!i)continue;let s=Cr(i);switch(s.kind){case 0:qe({...t,selfGrammar:t.baseGrammar},r);break;case 1:qe(t,r);break;case 2:At(s.ruleName,{...t,repository:n},r);break;case 3:case 4:let l=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(l){let o={baseGrammar:t.baseGrammar,selfGrammar:l,repository:n};s.kind===4?At(s.ruleName,o,r):qe(o,r)}else s.kind===4?r.add(new vn(s.scopeName,s.ruleName)):r.add(new Pe(s.scopeName));break}}}var $n=class{constructor(){f(this,"kind",0)}},Mn=class{constructor(){f(this,"kind",1)}},Gn=class{constructor(e){f(this,"kind",2);this.ruleName=e}},Bn=class{constructor(e){f(this,"kind",3);this.scopeName=e}},jn=class{constructor(e,t){f(this,"kind",4);this.scopeName=e,this.ruleName=t}};function Cr(e){if(e==="$base")return new $n;if(e==="$self")return new Mn;let t=e.indexOf("#");return t===-1?new Bn(e):t===0?new Gn(e.substring(1)):new jn(e.substring(0,t),e.substring(t+1))}var Un=/\\(\d+)/,Ir=/\\(\d+)/g,Fn=-1,xr=-2;function ku(e){return e}function Au(e){return e}var Re=class{constructor(e,t,r,a){f(this,"$location");f(this,"id");f(this,"_nameIsCapturing");f(this,"_name");f(this,"_contentNameIsCapturing");f(this,"_contentName");this.$location=e,this.id=t,this._name=r||null,this._nameIsCapturing=Fe.hasCaptures(this._name),this._contentName=a||null,this._contentNameIsCapturing=Fe.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${_r(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Fe.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Fe.replaceCaptures(this._contentName,e,t)}},Wn=class extends Re{constructor(t,r,a,n,i){super(t,r,a,n);f(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(t,r){throw Error("Not supported!")}compile(t,r){throw Error("Not supported!")}compileAG(t,r,a,n){throw Error("Not supported!")}},Hn=class extends Re{constructor(t,r,a,n,i){super(t,r,a,null);f(this,"_match");f(this,"captures");f(this,"_cachedCompiledPatterns");this._match=new Oe(n,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns=(this._cachedCompiledPatterns.dispose(),null))}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,r){r.push(this._match)}compile(t,r){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,r,a,n){return this._getCachedCompiledPatterns(t).compileAG(t,a,n)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ve,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Lr=class extends Re{constructor(t,r,a,n,i){super(t,r,a,n);f(this,"hasMissingPatterns");f(this,"patterns");f(this,"_cachedCompiledPatterns");this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns=(this._cachedCompiledPatterns.dispose(),null))}collectPatterns(t,r){for(let a of this.patterns)t.getRule(a).collectPatterns(t,r)}compile(t,r){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,r,a,n){return this._getCachedCompiledPatterns(t).compileAG(t,a,n)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ve,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ct=class extends Re{constructor(t,r,a,n,i,s,l,o,u,h){super(t,r,a,n);f(this,"_begin");f(this,"beginCaptures");f(this,"_end");f(this,"endHasBackReferences");f(this,"endCaptures");f(this,"applyEndPatternLast");f(this,"hasMissingPatterns");f(this,"patterns");f(this,"_cachedCompiledPatterns");this._begin=new Oe(i,this.id),this.beginCaptures=s,this._end=new Oe(l||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=o,this.applyEndPatternLast=u||!1,this.patterns=h.patterns,this.hasMissingPatterns=h.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns=(this._cachedCompiledPatterns.dispose(),null))}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,r){return this._end.resolveBackReferences(t,r)}collectPatterns(t,r){r.push(this._begin)}compile(t,r){return this._getCachedCompiledPatterns(t,r).compile(t)}compileAG(t,r,a,n){return this._getCachedCompiledPatterns(t,r).compileAG(t,a,n)}_getCachedCompiledPatterns(t,r){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ve;for(let a of this.patterns)t.getRule(a).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,r):this._cachedCompiledPatterns.setSource(0,r)),this._cachedCompiledPatterns}},Xe=class extends Re{constructor(t,r,a,n,i,s,l,o,u){super(t,r,a,n);f(this,"_begin");f(this,"beginCaptures");f(this,"whileCaptures");f(this,"_while");f(this,"whileHasBackReferences");f(this,"hasMissingPatterns");f(this,"patterns");f(this,"_cachedCompiledPatterns");f(this,"_cachedCompiledWhilePatterns");this._begin=new Oe(i,this.id),this.beginCaptures=s,this.whileCaptures=o,this._while=new Oe(l,xr),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns=(this._cachedCompiledPatterns.dispose(),null)),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns=(this._cachedCompiledWhilePatterns.dispose(),null))}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,r){return this._while.resolveBackReferences(t,r)}collectPatterns(t,r){r.push(this._begin)}compile(t,r){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,r,a,n){return this._getCachedCompiledPatterns(t).compileAG(t,a,n)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ve;for(let r of this.patterns)t.getRule(r).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,r){return this._getCachedCompiledWhilePatterns(t,r).compile(t)}compileWhileAG(t,r,a,n){return this._getCachedCompiledWhilePatterns(t,r).compileAG(t,a,n)}_getCachedCompiledWhilePatterns(t,r){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new ve,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,r||"\uFFFF"),this._cachedCompiledWhilePatterns}},Sr=class ${static createCaptureRule(t,r,a,n,i){return t.registerRule(s=>new Wn(r,s,a,n,i))}static getCompiledRuleId(t,r,a){return t.id||r.registerRule(n=>{if(t.id=n,t.match)return new Hn(t.$vscodeTextmateLocation,t.id,t.name,t.match,$._compileCaptures(t.captures,r,a));if(t.begin===void 0){t.repository&&(a=dr({},a,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Lr(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,$._compilePatterns(i,r,a))}return t.while?new Xe(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,$._compileCaptures(t.beginCaptures||t.captures,r,a),t.while,$._compileCaptures(t.whileCaptures||t.captures,r,a),$._compilePatterns(t.patterns,r,a)):new Ct(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,$._compileCaptures(t.beginCaptures||t.captures,r,a),t.end,$._compileCaptures(t.endCaptures||t.captures,r,a),t.applyEndPatternLast,$._compilePatterns(t.patterns,r,a))}),t.id}static _compileCaptures(t,r,a){let n=[];if(t){let i=0;for(let s in t){if(s==="$vscodeTextmateLocation")continue;let l=parseInt(s,10);l>i&&(i=l)}for(let s=0;s<=i;s++)n[s]=null;for(let s in t){if(s==="$vscodeTextmateLocation")continue;let l=parseInt(s,10),o=0;t[s].patterns&&(o=$.getCompiledRuleId(t[s],r,a)),n[l]=$.createCaptureRule(r,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,o)}}return n}static _compilePatterns(t,r,a){let n=[];if(t)for(let i=0,s=t.length;i<s;i++){let l=t[i],o=-1;if(l.include){let u=Cr(l.include);switch(u.kind){case 0:case 1:o=$.getCompiledRuleId(a[l.include],r,a);break;case 2:let h=a[u.ruleName];h&&(o=$.getCompiledRuleId(h,r,a));break;case 3:case 4:let p=u.scopeName,m=u.kind===4?u.ruleName:null,d=r.getExternalGrammar(p,a);if(d)if(m){let _=d.repository[m];_&&(o=$.getCompiledRuleId(_,r,d.repository))}else o=$.getCompiledRuleId(d.repository.$self,r,d.repository);break}}else o=$.getCompiledRuleId(l,r,a);if(o!==-1){let u=r.getRule(o),h=!1;if((u instanceof Lr||u instanceof Ct||u instanceof Xe)&&u.hasMissingPatterns&&u.patterns.length===0&&(h=!0),h)continue;n.push(o)}}return{patterns:n,hasMissingPatterns:(t?t.length:0)!==n.length}}},Oe=class En{constructor(t,r){f(this,"source");f(this,"ruleId");f(this,"hasAnchor");f(this,"hasBackReferences");f(this,"_anchorCache");if(t&&typeof t=="string"){let a=t.length,n=0,i=[],s=!1;for(let l=0;l<a;l++)if(t.charAt(l)==="\\"&&l+1<a){let o=t.charAt(l+1);o==="z"?(i.push(t.substring(n,l)),i.push("$(?!\\n)(?<!\\n)"),n=l+2):(o==="A"||o==="G")&&(s=!0),l++}this.hasAnchor=s,n===0?this.source=t:(i.push(t.substring(n,a)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=r,typeof this.source=="string"?this.hasBackReferences=Un.test(this.source):this.hasBackReferences=!1}clone(){return new En(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,r){if(typeof this.source!="string")throw Error("This method should only be called if the source is a string");let a=r.map(n=>t.substring(n.start,n.end));return Ir.lastIndex=0,this.source.replace(Ir,(n,i)=>wr(a[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw Error("This method should only be called if the source is a string");let t=[],r=[],a=[],n=[],i,s,l,o;for(i=0,s=this.source.length;i<s;i++)l=this.source.charAt(i),t[i]=l,r[i]=l,a[i]=l,n[i]=l,l==="\\"&&i+1<s&&(o=this.source.charAt(i+1),o==="A"?(t[i+1]="\uFFFF",r[i+1]="\uFFFF",a[i+1]="A",n[i+1]="A"):o==="G"?(t[i+1]="\uFFFF",r[i+1]="G",a[i+1]="\uFFFF",n[i+1]="G"):(t[i+1]=o,r[i+1]=o,a[i+1]=o,n[i+1]=o),i++);return{A0_G0:t.join(""),A0_G1:r.join(""),A1_G0:a.join(""),A1_G1:n.join("")}}resolveAnchors(t,r){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?r?this._anchorCache.A1_G1:this._anchorCache.A1_G0:r?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},ve=class{constructor(){f(this,"_items");f(this,"_hasAnchors");f(this,"_cached");f(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached=(this._cached.dispose(),null)),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){return this._cached||(this._cached=new Tr(e,this._items.map(t=>t.source),this._items.map(t=>t.ruleId))),this._cached}compileAG(e,t,r){return this._hasAnchors?t?r?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G0):r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,r){return new Tr(e,this._items.map(a=>a.resolveAnchors(t,r)),this._items.map(a=>a.ruleId))}},Tr=class{constructor(e,t,r){f(this,"scanner");this.regExps=t,this.rules=r,this.scanner=e.createOnigScanner(t)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){let e=[];for(let t=0,r=this.rules.length;t<r;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
2
+ var nu=Object.defineProperty;var iu=Object.getPrototypeOf;var su=Reflect.get;var mn=k=>{throw TypeError(k)};var ou=(k,x,T)=>x in k?nu(k,x,{enumerable:!0,configurable:!0,writable:!0,value:T}):k[x]=T;var f=(k,x,T)=>ou(k,typeof x!="symbol"?x+"":x,T),lr=(k,x,T)=>x.has(k)||mn("Cannot "+T);var M=(k,x,T)=>(lr(k,x,"read from private field"),T?T.call(k):x.get(k)),we=(k,x,T)=>x.has(k)?mn("Cannot add the same private member more than once"):x instanceof WeakSet?x.add(k):x.set(k,T),z=(k,x,T,Ue)=>(lr(k,x,"write to private field"),Ue?Ue.call(k,T):x.set(k,T),T),ur=(k,x,T)=>(lr(k,x,"access private method"),T);var dn=(k,x,T)=>su(iu(k),T,x);import{s as _n}from"./chunk-LvLJmgfZ.js";import{t as lu}from"./react-BGmjiNul.js";import{t as uu}from"./jsx-runtime-DN_bIXfG.js";import"./cjs-Bj40p_Np.js";import{t as c}from"./preload-helper-BW0IMuFq.js";import{a as cr,c as cu,d as pu,f as hu,l as mu,m as du,n as _u,o as pr,p as fn,s as gn,t as fu,u as gu,__tla as yu}from"./chunk-OGVTOU66-DYMZbUe5.js";import"./katex-AwOI3EvM.js";import"./marked.esm-CHnOtnr3.js";let yn,wu=Promise.all([(()=>{try{return yu}catch{}})()]).then(async()=>{var ee,U,se,te,_e,fe,ge,je,mr,oe;var k=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function x(e){return T(e)}function T(e){return Array.isArray(e)?Ue(e):e instanceof RegExp?e:typeof e=="object"?An(e):e}function Ue(e){let t=[];for(let r=0,a=e.length;r<a;r++)t[r]=T(e[r]);return t}function An(e){let t={};for(let r in e)t[r]=T(e[r]);return t}function dr(e,...t){return t.forEach(r=>{for(let a in r)e[a]=r[a]}),e}function _r(e){let t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?_r(e.substring(0,e.length-1)):e.substr(~t+1)}var Et=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Fe=class{static hasCaptures(e){return e===null?!1:(Et.lastIndex=0,Et.test(e))}static replaceCaptures(e,t,r){return e.replace(Et,(a,n,i,s)=>{let l=r[parseInt(n||i,10)];if(l){let o=t.substring(l.start,l.end);for(;o[0]===".";)o=o.substring(1);switch(s){case"downcase":return o.toLowerCase();case"upcase":return o.toUpperCase();default:return o}}else return a})}};function fr(e,t){return e<t?-1:e>t?1:0}function gr(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let r=e.length,a=t.length;if(r===a){for(let n=0;n<r;n++){let i=fr(e[n],t[n]);if(i!==0)return i}return 0}return r-a}function yr(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function wr(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Er=class{constructor(e){f(this,"cache",new Map);this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},We=class{constructor(e,t,r){f(this,"_cachedMatchRoot",new Er(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=r}static createFromRawTheme(e,t){return this.createFromParsedTheme(xn(e),t)}static createFromParsedTheme(e,t){return Sn(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,r=this._cachedMatchRoot.get(t).find(a=>Cn(e.parent,a.parentScopes));return r?new br(r.fontStyle,r.foreground,r.background):null}},bt=class wt{constructor(t,r){this.parent=t,this.scopeName=r}static push(t,r){for(let a of r)t=new wt(t,a);return t}static from(...t){let r=null;for(let a=0;a<t.length;a++)r=new wt(r,t[a]);return r}push(t){return new wt(this,t)}getSegments(){let t=this,r=[];for(;t;)r.push(t.scopeName),t=t.parent;return r.reverse(),r}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){let r=[],a=this;for(;a&&a!==t;)r.push(a.scopeName),a=a.parent;return a===t?r.reverse():void 0}};function Cn(e,t){if(t.length===0)return!0;for(let r=0;r<t.length;r++){let a=t[r],n=!1;if(a===">"){if(r===t.length-1)return!1;a=t[++r],n=!0}for(;e&&!In(e.scopeName,a);){if(n)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function In(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var br=class{constructor(e,t,r){this.fontStyle=e,this.foregroundId=t,this.backgroundId=r}};function xn(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,r=[],a=0;for(let n=0,i=t.length;n<i;n++){let s=t[n];if(!s.settings)continue;let l;if(typeof s.scope=="string"){let p=s.scope;p=p.replace(/^[,]+/,""),p=p.replace(/[,]+$/,""),l=p.split(",")}else l=Array.isArray(s.scope)?s.scope:[""];let o=-1;if(typeof s.settings.fontStyle=="string"){o=0;let p=s.settings.fontStyle.split(" ");for(let m=0,d=p.length;m<d;m++)switch(p[m]){case"italic":o|=1;break;case"bold":o|=2;break;case"underline":o|=4;break;case"strikethrough":o|=8;break}}let u=null;typeof s.settings.foreground=="string"&&yr(s.settings.foreground)&&(u=s.settings.foreground);let h=null;typeof s.settings.background=="string"&&yr(s.settings.background)&&(h=s.settings.background);for(let p=0,m=l.length;p<m;p++){let d=l[p].trim().split(" "),_=d[d.length-1],y=null;d.length>1&&(y=d.slice(0,d.length-1),y.reverse()),r[a++]=new Ln(_,y,n,o,u,h)}}return r}var Ln=class{constructor(e,t,r,a,n,i){this.scope=e,this.parentScopes=t,this.index=r,this.fontStyle=a,this.foreground=n,this.background=i}},V=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(V||{});function Sn(e,t){e.sort((o,u)=>{let h=fr(o.scope,u.scope);return h!==0||(h=gr(o.parentScopes,u.parentScopes),h!==0)?h:o.index-u.index});let r=0,a="#000000",n="#ffffff";for(;e.length>=1&&e[0].scope==="";){let o=e.shift();o.fontStyle!==-1&&(r=o.fontStyle),o.foreground!==null&&(a=o.foreground),o.background!==null&&(n=o.background)}let i=new Tn(t),s=new br(r,i.getId(a),i.getId(n)),l=new Rn(new kt(0,null,-1,0,0),[]);for(let o=0,u=e.length;o<u;o++){let h=e[o];l.insert(0,h.scope,h.parentScopes,h.fontStyle,i.getId(h.foreground),i.getId(h.background))}return new We(i,s,l)}var Tn=class{constructor(e){f(this,"_isFrozen");f(this,"_lastColorId");f(this,"_id2color");f(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,r=e.length;t<r;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Pn=Object.freeze([]),kt=class wn{constructor(t,r,a,n,i){f(this,"scopeDepth");f(this,"parentScopes");f(this,"fontStyle");f(this,"foreground");f(this,"background");this.scopeDepth=t,this.parentScopes=r||Pn,this.fontStyle=a,this.foreground=n,this.background=i}clone(){return new wn(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let r=[];for(let a=0,n=t.length;a<n;a++)r[a]=t[a].clone();return r}acceptOverwrite(t,r,a,n){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,r!==-1&&(this.fontStyle=r),a!==0&&(this.foreground=a),n!==0&&(this.background=n)}},Rn=class hr{constructor(t,r=[],a={}){f(this,"_rulesWithParentScopes");this._mainRule=t,this._children=a,this._rulesWithParentScopes=r}static _cmpBySpecificity(t,r){if(t.scopeDepth!==r.scopeDepth)return r.scopeDepth-t.scopeDepth;let a=0,n=0;for(;t.parentScopes[a]===">"&&a++,r.parentScopes[n]===">"&&n++,!(a>=t.parentScopes.length||n>=r.parentScopes.length);){let i=r.parentScopes[n].length-t.parentScopes[a].length;if(i!==0)return i;a++,n++}return r.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let a=t.indexOf("."),n,i;if(a===-1?(n=t,i=""):(n=t.substring(0,a),i=t.substring(a+1)),this._children.hasOwnProperty(n))return this._children[n].match(i)}let r=this._rulesWithParentScopes.concat(this._mainRule);return r.sort(hr._cmpBySpecificity),r}insert(t,r,a,n,i,s){if(r===""){this._doInsertHere(t,a,n,i,s);return}let l=r.indexOf("."),o,u;l===-1?(o=r,u=""):(o=r.substring(0,l),u=r.substring(l+1));let h;this._children.hasOwnProperty(o)?h=this._children[o]:(h=new hr(this._mainRule.clone(),kt.cloneArr(this._rulesWithParentScopes)),this._children[o]=h),h.insert(t+1,u,a,n,i,s)}_doInsertHere(t,r,a,n,i){if(r===null){this._mainRule.acceptOverwrite(t,a,n,i);return}for(let s=0,l=this._rulesWithParentScopes.length;s<l;s++){let o=this._rulesWithParentScopes[s];if(gr(o.parentScopes,r)===0){o.acceptOverwrite(t,a,n,i);return}}a===-1&&(a=this._mainRule.fontStyle),n===0&&(n=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new kt(t,r,a,n,i))}},Ee=class W{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){let r=W.getLanguageId(t),a=W.getTokenType(t),n=W.getFontStyle(t),i=W.getForeground(t),s=W.getBackground(t);console.log({languageId:r,tokenType:a,fontStyle:n,foreground:i,background:s})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!=0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,r,a,n,i,s,l){let o=W.getLanguageId(t),u=W.getTokenType(t),h=W.containsBalancedBrackets(t)?1:0,p=W.getFontStyle(t),m=W.getForeground(t),d=W.getBackground(t);return r!==0&&(o=r),a!==8&&(u=a),n!==null&&(h=n?1:0),i!==-1&&(p=i),s!==0&&(m=s),l!==0&&(d=l),(o<<0|u<<8|h<<10|p<<11|m<<15|d<<24)>>>0}};function Eu(e){return e}function bu(e){return e}function He(e,t){let r=[],a=On(e),n=a.next();for(;n!==null;){let o=0;if(n.length===2&&n.charAt(1)===":"){switch(n.charAt(0)){case"R":o=1;break;case"L":o=-1;break;default:console.log(`Unknown priority ${n} in scope selector`)}n=a.next()}let u=s();if(r.push({matcher:u,priority:o}),n!==",")break;n=a.next()}return r;function i(){if(n==="-"){n=a.next();let o=i();return u=>!!o&&!o(u)}if(n==="("){n=a.next();let o=l();return n===")"&&(n=a.next()),o}if(kr(n)){let o=[];do o.push(n),n=a.next();while(kr(n));return u=>t(o,u)}return null}function s(){let o=[],u=i();for(;u;)o.push(u),u=i();return h=>o.every(p=>p(h))}function l(){let o=[],u=s();for(;u&&(o.push(u),n==="|"||n===",");){do n=a.next();while(n==="|"||n===",");u=s()}return h=>o.some(p=>p(h))}}function kr(e){return!!e&&!!e.match(/[\w\.:]+/)}function On(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,r=t.exec(e);return{next:()=>{if(!r)return null;let a=r[0];return r=t.exec(e),a}}}function Ar(e){typeof e.dispose=="function"&&e.dispose()}var Pe=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},vn=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Nn=class{constructor(){f(this,"_references",[]);f(this,"_seenReferenceKeys",new Set);f(this,"visitedRule",new Set)}get references(){return this._references}add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Dn=class{constructor(e,t){f(this,"seenFullScopeRequests",new Set);f(this,"seenPartialScopeRequests",new Set);f(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Pe(this.initialScopeName)]}processQueue(){let e=this.Q;this.Q=[];let t=new Nn;for(let r of e)Vn(r,this.initialScopeName,this.repo,t);for(let r of t.references)if(r instanceof Pe){if(this.seenFullScopeRequests.has(r.scopeName))continue;this.seenFullScopeRequests.add(r.scopeName),this.Q.push(r)}else{if(this.seenFullScopeRequests.has(r.scopeName)||this.seenPartialScopeRequests.has(r.toKey()))continue;this.seenPartialScopeRequests.add(r.toKey()),this.Q.push(r)}}};function Vn(e,t,r,a){let n=r.lookup(e.scopeName);if(!n){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let i=r.lookup(t);e instanceof Pe?qe({baseGrammar:i,selfGrammar:n},a):At(e.ruleName,{baseGrammar:i,selfGrammar:n,repository:n.repository},a);let s=r.injections(e.scopeName);if(s)for(let l of s)a.add(new Pe(l))}function At(e,t,r){if(t.repository&&t.repository[e]){let a=t.repository[e];ze([a],t,r)}}function qe(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&ze(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&ze(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function ze(e,t,r){for(let a of e){if(r.visitedRule.has(a))continue;r.visitedRule.add(a);let n=a.repository?dr({},t.repository,a.repository):t.repository;Array.isArray(a.patterns)&&ze(a.patterns,{...t,repository:n},r);let i=a.include;if(!i)continue;let s=Cr(i);switch(s.kind){case 0:qe({...t,selfGrammar:t.baseGrammar},r);break;case 1:qe(t,r);break;case 2:At(s.ruleName,{...t,repository:n},r);break;case 3:case 4:let l=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(l){let o={baseGrammar:t.baseGrammar,selfGrammar:l,repository:n};s.kind===4?At(s.ruleName,o,r):qe(o,r)}else s.kind===4?r.add(new vn(s.scopeName,s.ruleName)):r.add(new Pe(s.scopeName));break}}}var $n=class{constructor(){f(this,"kind",0)}},Mn=class{constructor(){f(this,"kind",1)}},Gn=class{constructor(e){f(this,"kind",2);this.ruleName=e}},Bn=class{constructor(e){f(this,"kind",3);this.scopeName=e}},jn=class{constructor(e,t){f(this,"kind",4);this.scopeName=e,this.ruleName=t}};function Cr(e){if(e==="$base")return new $n;if(e==="$self")return new Mn;let t=e.indexOf("#");return t===-1?new Bn(e):t===0?new Gn(e.substring(1)):new jn(e.substring(0,t),e.substring(t+1))}var Un=/\\(\d+)/,Ir=/\\(\d+)/g,Fn=-1,xr=-2;function ku(e){return e}function Au(e){return e}var Re=class{constructor(e,t,r,a){f(this,"$location");f(this,"id");f(this,"_nameIsCapturing");f(this,"_name");f(this,"_contentNameIsCapturing");f(this,"_contentName");this.$location=e,this.id=t,this._name=r||null,this._nameIsCapturing=Fe.hasCaptures(this._name),this._contentName=a||null,this._contentNameIsCapturing=Fe.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${_r(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Fe.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Fe.replaceCaptures(this._contentName,e,t)}},Wn=class extends Re{constructor(t,r,a,n,i){super(t,r,a,n);f(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(t,r){throw Error("Not supported!")}compile(t,r){throw Error("Not supported!")}compileAG(t,r,a,n){throw Error("Not supported!")}},Hn=class extends Re{constructor(t,r,a,n,i){super(t,r,a,null);f(this,"_match");f(this,"captures");f(this,"_cachedCompiledPatterns");this._match=new Oe(n,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns=(this._cachedCompiledPatterns.dispose(),null))}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,r){r.push(this._match)}compile(t,r){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,r,a,n){return this._getCachedCompiledPatterns(t).compileAG(t,a,n)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ve,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Lr=class extends Re{constructor(t,r,a,n,i){super(t,r,a,n);f(this,"hasMissingPatterns");f(this,"patterns");f(this,"_cachedCompiledPatterns");this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns=(this._cachedCompiledPatterns.dispose(),null))}collectPatterns(t,r){for(let a of this.patterns)t.getRule(a).collectPatterns(t,r)}compile(t,r){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,r,a,n){return this._getCachedCompiledPatterns(t).compileAG(t,a,n)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ve,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ct=class extends Re{constructor(t,r,a,n,i,s,l,o,u,h){super(t,r,a,n);f(this,"_begin");f(this,"beginCaptures");f(this,"_end");f(this,"endHasBackReferences");f(this,"endCaptures");f(this,"applyEndPatternLast");f(this,"hasMissingPatterns");f(this,"patterns");f(this,"_cachedCompiledPatterns");this._begin=new Oe(i,this.id),this.beginCaptures=s,this._end=new Oe(l||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=o,this.applyEndPatternLast=u||!1,this.patterns=h.patterns,this.hasMissingPatterns=h.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns=(this._cachedCompiledPatterns.dispose(),null))}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,r){return this._end.resolveBackReferences(t,r)}collectPatterns(t,r){r.push(this._begin)}compile(t,r){return this._getCachedCompiledPatterns(t,r).compile(t)}compileAG(t,r,a,n){return this._getCachedCompiledPatterns(t,r).compileAG(t,a,n)}_getCachedCompiledPatterns(t,r){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ve;for(let a of this.patterns)t.getRule(a).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,r):this._cachedCompiledPatterns.setSource(0,r)),this._cachedCompiledPatterns}},Xe=class extends Re{constructor(t,r,a,n,i,s,l,o,u){super(t,r,a,n);f(this,"_begin");f(this,"beginCaptures");f(this,"whileCaptures");f(this,"_while");f(this,"whileHasBackReferences");f(this,"hasMissingPatterns");f(this,"patterns");f(this,"_cachedCompiledPatterns");f(this,"_cachedCompiledWhilePatterns");this._begin=new Oe(i,this.id),this.beginCaptures=s,this.whileCaptures=o,this._while=new Oe(l,xr),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns=(this._cachedCompiledPatterns.dispose(),null)),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns=(this._cachedCompiledWhilePatterns.dispose(),null))}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,r){return this._while.resolveBackReferences(t,r)}collectPatterns(t,r){r.push(this._begin)}compile(t,r){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,r,a,n){return this._getCachedCompiledPatterns(t).compileAG(t,a,n)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ve;for(let r of this.patterns)t.getRule(r).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,r){return this._getCachedCompiledWhilePatterns(t,r).compile(t)}compileWhileAG(t,r,a,n){return this._getCachedCompiledWhilePatterns(t,r).compileAG(t,a,n)}_getCachedCompiledWhilePatterns(t,r){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new ve,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,r||"\uFFFF"),this._cachedCompiledWhilePatterns}},Sr=class ${static createCaptureRule(t,r,a,n,i){return t.registerRule(s=>new Wn(r,s,a,n,i))}static getCompiledRuleId(t,r,a){return t.id||r.registerRule(n=>{if(t.id=n,t.match)return new Hn(t.$vscodeTextmateLocation,t.id,t.name,t.match,$._compileCaptures(t.captures,r,a));if(t.begin===void 0){t.repository&&(a=dr({},a,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Lr(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,$._compilePatterns(i,r,a))}return t.while?new Xe(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,$._compileCaptures(t.beginCaptures||t.captures,r,a),t.while,$._compileCaptures(t.whileCaptures||t.captures,r,a),$._compilePatterns(t.patterns,r,a)):new Ct(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,$._compileCaptures(t.beginCaptures||t.captures,r,a),t.end,$._compileCaptures(t.endCaptures||t.captures,r,a),t.applyEndPatternLast,$._compilePatterns(t.patterns,r,a))}),t.id}static _compileCaptures(t,r,a){let n=[];if(t){let i=0;for(let s in t){if(s==="$vscodeTextmateLocation")continue;let l=parseInt(s,10);l>i&&(i=l)}for(let s=0;s<=i;s++)n[s]=null;for(let s in t){if(s==="$vscodeTextmateLocation")continue;let l=parseInt(s,10),o=0;t[s].patterns&&(o=$.getCompiledRuleId(t[s],r,a)),n[l]=$.createCaptureRule(r,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,o)}}return n}static _compilePatterns(t,r,a){let n=[];if(t)for(let i=0,s=t.length;i<s;i++){let l=t[i],o=-1;if(l.include){let u=Cr(l.include);switch(u.kind){case 0:case 1:o=$.getCompiledRuleId(a[l.include],r,a);break;case 2:let h=a[u.ruleName];h&&(o=$.getCompiledRuleId(h,r,a));break;case 3:case 4:let p=u.scopeName,m=u.kind===4?u.ruleName:null,d=r.getExternalGrammar(p,a);if(d)if(m){let _=d.repository[m];_&&(o=$.getCompiledRuleId(_,r,d.repository))}else o=$.getCompiledRuleId(d.repository.$self,r,d.repository);break}}else o=$.getCompiledRuleId(l,r,a);if(o!==-1){let u=r.getRule(o),h=!1;if((u instanceof Lr||u instanceof Ct||u instanceof Xe)&&u.hasMissingPatterns&&u.patterns.length===0&&(h=!0),h)continue;n.push(o)}}return{patterns:n,hasMissingPatterns:(t?t.length:0)!==n.length}}},Oe=class En{constructor(t,r){f(this,"source");f(this,"ruleId");f(this,"hasAnchor");f(this,"hasBackReferences");f(this,"_anchorCache");if(t&&typeof t=="string"){let a=t.length,n=0,i=[],s=!1;for(let l=0;l<a;l++)if(t.charAt(l)==="\\"&&l+1<a){let o=t.charAt(l+1);o==="z"?(i.push(t.substring(n,l)),i.push("$(?!\\n)(?<!\\n)"),n=l+2):(o==="A"||o==="G")&&(s=!0),l++}this.hasAnchor=s,n===0?this.source=t:(i.push(t.substring(n,a)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=r,typeof this.source=="string"?this.hasBackReferences=Un.test(this.source):this.hasBackReferences=!1}clone(){return new En(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,r){if(typeof this.source!="string")throw Error("This method should only be called if the source is a string");let a=r.map(n=>t.substring(n.start,n.end));return Ir.lastIndex=0,this.source.replace(Ir,(n,i)=>wr(a[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw Error("This method should only be called if the source is a string");let t=[],r=[],a=[],n=[],i,s,l,o;for(i=0,s=this.source.length;i<s;i++)l=this.source.charAt(i),t[i]=l,r[i]=l,a[i]=l,n[i]=l,l==="\\"&&i+1<s&&(o=this.source.charAt(i+1),o==="A"?(t[i+1]="\uFFFF",r[i+1]="\uFFFF",a[i+1]="A",n[i+1]="A"):o==="G"?(t[i+1]="\uFFFF",r[i+1]="G",a[i+1]="\uFFFF",n[i+1]="G"):(t[i+1]=o,r[i+1]=o,a[i+1]=o,n[i+1]=o),i++);return{A0_G0:t.join(""),A0_G1:r.join(""),A1_G0:a.join(""),A1_G1:n.join("")}}resolveAnchors(t,r){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?r?this._anchorCache.A1_G1:this._anchorCache.A1_G0:r?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},ve=class{constructor(){f(this,"_items");f(this,"_hasAnchors");f(this,"_cached");f(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached=(this._cached.dispose(),null)),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){return this._cached||(this._cached=new Tr(e,this._items.map(t=>t.source),this._items.map(t=>t.ruleId))),this._cached}compileAG(e,t,r){return this._hasAnchors?t?r?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G0):r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,r){return new Tr(e,this._items.map(a=>a.resolveAnchors(t,r)),this._items.map(a=>a.ruleId))}},Tr=class{constructor(e,t,r){f(this,"scanner");this.regExps=t,this.rules=r,this.scanner=e.createOnigScanner(t)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){let e=[];for(let t=0,r=this.rules.length;t<r;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
3
3
  `)}findNextMatchSync(e,t,r){let a=this.scanner.findNextMatchSync(e,t,r);return a?{ruleId:this.rules[a.index],captureIndices:a.captureIndices}:null}},It=class{constructor(e,t){this.languageId=e,this.tokenType=t}},qn=(ee=class{constructor(t,r){f(this,"_defaultAttributes");f(this,"_embeddedLanguagesMatcher");f(this,"_getBasicScopeAttributes",new Er(t=>new It(this._scopeToLanguage(t),this._toStandardTokenType(t))));this._defaultAttributes=new It(t,8),this._embeddedLanguagesMatcher=new zn(Object.entries(r||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?ee._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){let r=t.match(ee.STANDARD_TOKEN_TYPE_REGEXP);if(!r)return 8;switch(r[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw Error("Unexpected match for standard token type!")}},f(ee,"_NULL_SCOPE_METADATA",new It(0,0)),f(ee,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),ee),zn=class{constructor(e){f(this,"values");f(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([r,a])=>wr(r));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<"u"&&{}.VSCODE_TEXTMATE_DEBUG;var Pr=!1,Rr=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Or(e,t,r,a,n,i,s,l){let o=t.content.length,u=!1,h=-1;if(s){let d=Xn(e,t,r,a,n,i);n=d.stack,a=d.linePos,r=d.isFirstLine,h=d.anchorPosition}let p=Date.now();for(;!u;){if(l!==0&&Date.now()-p>l)return new Rr(n,!0);m()}return new Rr(n,!1);function m(){let d=Qn(e,t,r,a,n,h);if(!d){i.produce(n,o),u=!0;return}let _=d.captureIndices,y=d.matchedRuleId,E=_&&_.length>0?_[0].end>a:!1;if(y===Fn){let g=n.getRule(e);i.produce(n,_[0].start),n=n.withContentNameScopesList(n.nameScopesList),Ne(e,t,r,n,i,g.endCaptures,_),i.produce(n,_[0].end);let w=n;if(n=n.parent,h=w.getAnchorPos(),!E&&w.getEnterPos()===a){n=w,i.produce(n,o),u=!0;return}}else{let g=e.getRule(y);i.produce(n,_[0].start);let w=n,b=g.getName(t.content,_),C=n.contentNameScopesList.pushAttributed(b,e);if(n=n.push(y,a,h,_[0].end===o,null,C,C),g instanceof Ct){let I=g;Ne(e,t,r,n,i,I.beginCaptures,_),i.produce(n,_[0].end),h=_[0].end;let S=I.getContentName(t.content,_),L=C.pushAttributed(S,e);if(n=n.withContentNameScopesList(L),I.endHasBackReferences&&(n=n.withEndRule(I.getEndWithResolvedBackReferences(t.content,_))),!E&&w.hasSameRuleAs(n)){n=n.pop(),i.produce(n,o),u=!0;return}}else if(g instanceof Xe){let I=g;Ne(e,t,r,n,i,I.beginCaptures,_),i.produce(n,_[0].end),h=_[0].end;let S=I.getContentName(t.content,_),L=C.pushAttributed(S,e);if(n=n.withContentNameScopesList(L),I.whileHasBackReferences&&(n=n.withEndRule(I.getWhileWithResolvedBackReferences(t.content,_))),!E&&w.hasSameRuleAs(n)){n=n.pop(),i.produce(n,o),u=!0;return}}else if(Ne(e,t,r,n,i,g.captures,_),i.produce(n,_[0].end),n=n.pop(),!E){n=n.safePop(),i.produce(n,o),u=!0;return}}_[0].end>a&&(a=_[0].end,r=!1)}}function Xn(e,t,r,a,n,i){let s=n.beginRuleCapturedEOL?0:-1,l=[];for(let o=n;o;o=o.pop()){let u=o.getRule(e);u instanceof Xe&&l.push({rule:u,stack:o})}for(let o=l.pop();o;o=l.pop()){let{ruleScanner:u,findOptions:h}=Kn(o.rule,e,o.stack.endRule,r,a===s),p=u.findNextMatchSync(t,a,h);if(p){if(p.ruleId!==xr){n=o.stack.pop();break}p.captureIndices&&p.captureIndices.length&&(i.produce(o.stack,p.captureIndices[0].start),Ne(e,t,r,o.stack,i,o.rule.whileCaptures,p.captureIndices),i.produce(o.stack,p.captureIndices[0].end),s=p.captureIndices[0].end,p.captureIndices[0].end>a&&(a=p.captureIndices[0].end,r=!1))}else{n=o.stack.pop();break}}return{stack:n,linePos:a,anchorPosition:s,isFirstLine:r}}function Qn(e,t,r,a,n,i){let s=Jn(e,t,r,a,n,i),l=e.getInjections();if(l.length===0)return s;let o=Zn(l,e,t,r,a,n,i);if(!o)return s;if(!s)return o;let u=s.captureIndices[0].start,h=o.captureIndices[0].start;return h<u||o.priorityMatch&&h===u?o:s}function Jn(e,t,r,a,n,i){let{ruleScanner:s,findOptions:l}=vr(n.getRule(e),e,n.endRule,r,a===i),o=s.findNextMatchSync(t,a,l);return o?{captureIndices:o.captureIndices,matchedRuleId:o.ruleId}:null}function Zn(e,t,r,a,n,i,s){let l=Number.MAX_VALUE,o=null,u,h=0,p=i.contentNameScopesList.getScopeNames();for(let m=0,d=e.length;m<d;m++){let _=e[m];if(!_.matcher(p))continue;let{ruleScanner:y,findOptions:E}=vr(t.getRule(_.ruleId),t,null,a,n===s),g=y.findNextMatchSync(r,n,E);if(!g)continue;let w=g.captureIndices[0].start;if(!(w>=l)&&(l=w,o=g.captureIndices,u=g.ruleId,h=_.priority,l===n))break}return o?{priorityMatch:h===-1,captureIndices:o,matchedRuleId:u}:null}function vr(e,t,r,a,n){return Pr?{ruleScanner:e.compile(t,r),findOptions:Nr(a,n)}:{ruleScanner:e.compileAG(t,r,a,n),findOptions:0}}function Kn(e,t,r,a,n){return Pr?{ruleScanner:e.compileWhile(t,r),findOptions:Nr(a,n)}:{ruleScanner:e.compileWhileAG(t,r,a,n),findOptions:0}}function Nr(e,t){let r=0;return e||(r|=1),t||(r|=4),r}function Ne(e,t,r,a,n,i,s){if(i.length===0)return;let l=t.content,o=Math.min(i.length,s.length),u=[],h=s[0].end;for(let p=0;p<o;p++){let m=i[p];if(m===null)continue;let d=s[p];if(d.length===0)continue;if(d.start>h)break;for(;u.length>0&&u[u.length-1].endPos<=d.start;)n.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?n.produceFromScopes(u[u.length-1].scopes,d.start):n.produce(a,d.start),m.retokenizeCapturedWithRuleId){let y=m.getName(l,s),E=a.contentNameScopesList.pushAttributed(y,e),g=m.getContentName(l,s),w=E.pushAttributed(g,e),b=a.push(m.retokenizeCapturedWithRuleId,d.start,-1,!1,null,E,w),C=e.createOnigString(l.substring(0,d.end));Or(e,C,r&&d.start===0,d.start,b,n,!1,0),Ar(C);continue}let _=m.getName(l,s);if(_!==null){let y=(u.length>0?u[u.length-1].scopes:a.contentNameScopesList).pushAttributed(_,e);u.push(new Yn(y,d.end))}}for(;u.length>0;)n.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var Yn=class{constructor(e,t){f(this,"scopes");f(this,"endPos");this.scopes=e,this.endPos=t}};function ei(e,t,r,a,n,i,s,l){return new ri(e,t,r,a,n,i,s,l)}function Dr(e,t,r,a,n){let i=He(t,Qe),s=Sr.getCompiledRuleId(r,a,n.repository);for(let l of i)e.push({debugSelector:t,matcher:l.matcher,ruleId:s,grammar:n,priority:l.priority})}function Qe(e,t){if(t.length<e.length)return!1;let r=0;return e.every(a=>{for(let n=r;n<t.length;n++)if(ti(t[n],a))return r=n+1,!0;return!1})}function ti(e,t){if(!e)return!1;if(e===t)return!0;let r=t.length;return e.length>r&&e.substr(0,r)===t&&e[r]==="."}var ri=class{constructor(e,t,r,a,n,i,s,l){f(this,"_rootId");f(this,"_lastRuleId");f(this,"_ruleId2desc");f(this,"_includedGrammars");f(this,"_grammarRepository");f(this,"_grammar");f(this,"_injections");f(this,"_basicScopeAttributesProvider");f(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=i,this._onigLib=l,this._basicScopeAttributesProvider=new qn(r,a),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=Vr(t,null),this._injections=null,this._tokenTypeMatchers=[],n)for(let o of Object.keys(n)){let u=He(o,Qe);for(let h of u)this._tokenTypeMatchers.push({matcher:h.matcher,type:n[o]})}}get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:n=>n===this._rootScopeName?this._grammar:this.getExternalGrammar(n),injections:n=>this._grammarRepository.injections(n)},t=[],r=this._rootScopeName,a=e.lookup(r);if(a){let n=a.injections;if(n)for(let s in n)Dr(t,s,n[s],this,a);let i=this._grammarRepository.injections(r);i&&i.forEach(s=>{let l=this.getExternalGrammar(s);if(l){let o=l.injectionSelector;o&&Dr(t,o,l,this,l)}})}return t.sort((n,i)=>n.priority-i.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,r=e(t);return this._ruleId2desc[t]=r,r}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let r=this._grammarRepository.lookup(e);if(r)return this._includedGrammars[e]=Vr(r,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,r=0){let a=this._tokenize(e,t,!1,r);return{tokens:a.lineTokens.getResult(a.ruleStack,a.lineLength),ruleStack:a.ruleStack,stoppedEarly:a.stoppedEarly}}tokenizeLine2(e,t,r=0){let a=this._tokenize(e,t,!0,r);return{tokens:a.lineTokens.getBinaryResult(a.ruleStack,a.lineLength),ruleStack:a.ruleStack,stoppedEarly:a.stoppedEarly}}_tokenize(e,t,r,a){this._rootId===-1&&(this._rootId=Sr.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let n;if(!t||t===xt.NULL){n=!0;let u=this._basicScopeAttributesProvider.getDefaultAttributes(),h=this.themeProvider.getDefaults(),p=Ee.set(0,u.languageId,u.tokenType,null,h.fontStyle,h.foregroundId,h.backgroundId),m=this.getRule(this._rootId).getName(null,null),d;d=m?De.createRootAndLookUpScopeName(m,p,this):De.createRoot("unknown",p),t=new xt(null,this._rootId,-1,-1,!1,null,d,d)}else n=!1,t.reset();e+=`
4
4
  `;let i=this.createOnigString(e),s=i.content.length,l=new ni(r,e,this._tokenTypeMatchers,this.balancedBracketSelectors),o=Or(this,i,n,0,t,l,!0,a);return Ar(i),{lineLength:s,lineTokens:l,ruleStack:o.stack,stoppedEarly:o.stoppedEarly}}};function Vr(e,t){return e=x(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var De=class Q{constructor(t,r,a){this.parent=t,this.scopePath=r,this.tokenAttributes=a}static fromExtension(t,r){let a=t,n=(t==null?void 0:t.scopePath)??null;for(let i of r)n=bt.push(n,i.scopeNames),a=new Q(a,n,i.encodedTokenAttributes);return a}static createRoot(t,r){return new Q(null,new bt(null,t),r)}static createRootAndLookUpScopeName(t,r,a){let n=a.getMetadataForScope(t),i=new bt(null,t),s=a.themeProvider.themeMatch(i);return new Q(null,i,Q.mergeAttributes(r,n,s))}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Q.equals(this,t)}static equals(t,r){do{if(t===r||!t&&!r)return!0;if(!t||!r||t.scopeName!==r.scopeName||t.tokenAttributes!==r.tokenAttributes)return!1;t=t.parent,r=r.parent}while(!0)}static mergeAttributes(t,r,a){let n=-1,i=0,s=0;return a!==null&&(n=a.fontStyle,i=a.foregroundId,s=a.backgroundId),Ee.set(t,r.languageId,r.tokenType,null,n,i,s)}pushAttributed(t,r){if(t===null)return this;if(t.indexOf(" ")===-1)return Q._pushAttributed(this,t,r);let a=t.split(/ /g),n=this;for(let i of a)n=Q._pushAttributed(n,i,r);return n}static _pushAttributed(t,r,a){let n=a.getMetadataForScope(r),i=t.scopePath.push(r),s=a.themeProvider.themeMatch(i);return new Q(t,i,Q.mergeAttributes(t.tokenAttributes,n,s))}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){var n;let r=[],a=this;for(;a&&a!==t;)r.push({encodedTokenAttributes:a.tokenAttributes,scopeNames:a.scopePath.getExtensionIfDefined(((n=a.parent)==null?void 0:n.scopePath)??null)}),a=a.parent;return a===t?r.reverse():void 0}},xt=(U=class{constructor(t,r,a,n,i,s,l,o){f(this,"_stackElementBrand");f(this,"_enterPos");f(this,"_anchorPos");f(this,"depth");this.parent=t,this.ruleId=r,this.beginRuleCapturedEOL=i,this.endRule=s,this.nameScopesList=l,this.contentNameScopesList=o,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=a,this._anchorPos=n}equals(t){return t===null?!1:U._equals(this,t)}static _equals(t,r){return t===r?!0:this._structuralEquals(t,r)?De.equals(t.contentNameScopesList,r.contentNameScopesList):!1}static _structuralEquals(t,r){do{if(t===r||!t&&!r)return!0;if(!t||!r||t.depth!==r.depth||t.ruleId!==r.ruleId||t.endRule!==r.endRule)return!1;t=t.parent,r=r.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){U._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,r,a,n,i,s,l){return new U(this,t,r,a,n,i,s,l)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){let t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,r){var a,n;return this.parent&&(r=this.parent._writeString(t,r)),t[r++]=`(${this.ruleId}, ${(a=this.nameScopesList)==null?void 0:a.toString()}, ${(n=this.contentNameScopesList)==null?void 0:n.toString()})`,r}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new U(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let r=this;for(;r&&r._enterPos===t._enterPos;){if(r.ruleId===t.ruleId)return!0;r=r.parent}return!1}toStateStackFrame(){var t,r,a;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((r=this.nameScopesList)==null?void 0:r.getExtensionIfDefined(((t=this.parent)==null?void 0:t.nameScopesList)??null))??[],contentNameScopesList:((a=this.contentNameScopesList)==null?void 0:a.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(t,r){let a=De.fromExtension((t==null?void 0:t.nameScopesList)??null,r.nameScopesList);return new U(t,r.ruleId,r.enterPos??-1,r.anchorPos??-1,r.beginRuleCapturedEOL,r.endRule,a,De.fromExtension(a,r.contentNameScopesList))}},f(U,"NULL",new U(null,0,0,0,!1,null,null,null)),U),ai=class{constructor(e,t){f(this,"balancedBracketScopes");f(this,"unbalancedBracketScopes");f(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(r=>r==="*"?(this.allowAny=!0,[]):He(r,Qe).map(a=>a.matcher)),this.unbalancedBracketScopes=t.flatMap(r=>He(r,Qe).map(a=>a.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},ni=class{constructor(e,t,r,a){f(this,"_emitBinaryTokens");f(this,"_lineText");f(this,"_tokens");f(this,"_binaryTokens");f(this,"_lastTokenEndIndex");f(this,"_tokenTypeOverrides");this.balancedBracketSelectors=a,this._emitBinaryTokens=e,this._tokenTypeOverrides=r,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){var a;if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=(e==null?void 0:e.tokenAttributes)??0,i=!1;if((a=this.balancedBracketSelectors)!=null&&a.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let s=(e==null?void 0:e.getScopeNames())??[];for(let l of this._tokenTypeOverrides)l.matcher(s)&&(n=Ee.set(n,0,l.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(s))}if(i&&(n=Ee.set(n,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let r=(e==null?void 0:e.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:r}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let r=new Uint32Array(this._binaryTokens.length);for(let a=0,n=this._binaryTokens.length;a<n;a++)r[a]=this._binaryTokens[a];return r}},ii=class{constructor(e,t){f(this,"_grammars",new Map);f(this,"_rawGrammars",new Map);f(this,"_injectionGrammars",new Map);f(this,"_theme");this._onigLib=t,this._theme=e}dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,r,a,n){if(!this._grammars.has(e)){let i=this._rawGrammars.get(e);if(!i)return null;this._grammars.set(e,ei(e,i,t,r,a,n,this,this._onigLib))}return this._grammars.get(e)}},si=class{constructor(e){f(this,"_options");f(this,"_syncRegistry");f(this,"_ensureGrammarCache");this._options=e,this._syncRegistry=new ii(We.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(We.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,r){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:r})}loadGrammarWithConfiguration(e,t,r){return this._loadGrammar(e,t,r.embeddedLanguages,r.tokenTypes,new ai(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,r,a,n){let i=new Dn(this._syncRegistry,e);for(;i.Q.length>0;)i.Q.map(s=>this._loadSingleGrammar(s.scopeName)),i.processQueue();return this._grammarForScopeName(e,t,r,a,n)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,r)}}addGrammar(e,t=[],r=0,a=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,r,a)}_grammarForScopeName(e,t=0,r=null,a=null,n=null){return this._syncRegistry.grammarForScopeName(e,t,r,a,n)}},Lt=xt.NULL,oi=/["&'<>`]/g,li=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ui=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,ci=/[|\\{}()[\]^$+*?.]/g,$r=new WeakMap;function pi(e,t){if(e=e.replace(t.subset?hi(t.subset):oi,a),t.subset||t.escapeOnly)return e;return e.replace(li,r).replace(ui,a);function r(n,i,s){return t.format((n.charCodeAt(0)-55296)*1024+n.charCodeAt(1)-56320+65536,s.charCodeAt(i+2),t)}function a(n,i,s){return t.format(n.charCodeAt(0),s.charCodeAt(i+1),t)}}function hi(e){let t=$r.get(e);return t||(t=mi(e),$r.set(e,t)),t}function mi(e){let t=[],r=-1;for(;++r<e.length;)t.push(e[r].replace(ci,"\\$&"));return RegExp("(?:"+t.join("|")+")","g")}var di=/[\dA-Fa-f]/;function _i(e,t,r){let a="&#x"+e.toString(16).toUpperCase();return r&&t&&!di.test(String.fromCharCode(t))?a:a+";"}var fi=/\d/;function gi(e,t,r){let a="&#"+String(e);return r&&t&&!fi.test(String.fromCharCode(t))?a:a+";"}const yi="AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml".split("."),St={nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",fnof:"\u0192",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",bull:"\u2022",hellip:"\u2026",prime:"\u2032",Prime:"\u2033",oline:"\u203E",frasl:"\u2044",weierp:"\u2118",image:"\u2111",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",quot:'"',amp:"&",lt:"<",gt:">",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",permil:"\u2030",lsaquo:"\u2039",rsaquo:"\u203A",euro:"\u20AC"},wi=["cent","copy","divide","gt","lt","not","para","times"];var Mr={}.hasOwnProperty,Tt={},Je;for(Je in St)Mr.call(St,Je)&&(Tt[St[Je]]=Je);var Ei=/[^\dA-Za-z]/;function bi(e,t,r,a){let n=String.fromCharCode(e);if(Mr.call(Tt,n)){let i=Tt[n],s="&"+i;return r&&yi.includes(i)&&!wi.includes(i)&&(!a||t&&t!==61&&Ei.test(String.fromCharCode(t)))?s:s+";"}return""}function ki(e,t,r){let a=_i(e,t,r.omitOptionalSemicolons),n;if((r.useNamedReferences||r.useShortestReferences)&&(n=bi(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!n)&&r.useShortestReferences){let i=gi(e,t,r.omitOptionalSemicolons);i.length<a.length&&(a=i)}return n&&(!r.useShortestReferences||n.length<a.length)?n:a}function be(e,t){return pi(e,Object.assign({format:ki},t))}var Ai=/^>|^->|<!--|-->|--!>|<!-$/g,Ci=[">"],Ii=["<",">"];function xi(e,t,r,a){return a.settings.bogusComments?"<?"+be(e.value,Object.assign({},a.settings.characterReferences,{subset:Ci}))+">":"<!--"+e.value.replace(Ai,n)+"-->";function n(i){return be(i,Object.assign({},a.settings.characterReferences,{subset:Ii}))}}function Li(e,t,r,a){return"<!"+(a.settings.upperDoctype?"DOCTYPE":"doctype")+(a.settings.tightDoctype?"":" ")+"html>"}const R=Br(1),Gr=Br(-1);var Si=[];function Br(e){return t;function t(r,a,n){let i=r?r.children:Si,s=(a||0)+e,l=i[s];if(!n)for(;l&&pr(l);)s+=e,l=i[s];return l}}var Ti={}.hasOwnProperty;function jr(e){return t;function t(r,a,n){return Ti.call(e,r.tagName)&&e[r.tagName](r,a,n)}}const Pt=jr({body:Ri,caption:Rt,colgroup:Rt,dd:Di,dt:Ni,head:Rt,html:Pi,li:vi,optgroup:Vi,option:$i,p:Oi,rp:Ur,rt:Ur,tbody:Gi,td:Fr,tfoot:Bi,th:Fr,thead:Mi,tr:ji});function Rt(e,t,r){let a=R(r,t,!0);return!a||a.type!=="comment"&&!(a.type==="text"&&pr(a.value.charAt(0)))}function Pi(e,t,r){let a=R(r,t);return!a||a.type!=="comment"}function Ri(e,t,r){let a=R(r,t);return!a||a.type!=="comment"}function Oi(e,t,r){let a=R(r,t);return a?a.type==="element"&&(a.tagName==="address"||a.tagName==="article"||a.tagName==="aside"||a.tagName==="blockquote"||a.tagName==="details"||a.tagName==="div"||a.tagName==="dl"||a.tagName==="fieldset"||a.tagName==="figcaption"||a.tagName==="figure"||a.tagName==="footer"||a.tagName==="form"||a.tagName==="h1"||a.tagName==="h2"||a.tagName==="h3"||a.tagName==="h4"||a.tagName==="h5"||a.tagName==="h6"||a.tagName==="header"||a.tagName==="hgroup"||a.tagName==="hr"||a.tagName==="main"||a.tagName==="menu"||a.tagName==="nav"||a.tagName==="ol"||a.tagName==="p"||a.tagName==="pre"||a.tagName==="section"||a.tagName==="table"||a.tagName==="ul"):!r||!(r.type==="element"&&(r.tagName==="a"||r.tagName==="audio"||r.tagName==="del"||r.tagName==="ins"||r.tagName==="map"||r.tagName==="noscript"||r.tagName==="video"))}function vi(e,t,r){let a=R(r,t);return!a||a.type==="element"&&a.tagName==="li"}function Ni(e,t,r){let a=R(r,t);return!!(a&&a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd"))}function Di(e,t,r){let a=R(r,t);return!a||a.type==="element"&&(a.tagName==="dt"||a.tagName==="dd")}function Ur(e,t,r){let a=R(r,t);return!a||a.type==="element"&&(a.tagName==="rp"||a.tagName==="rt")}function Vi(e,t,r){let a=R(r,t);return!a||a.type==="element"&&a.tagName==="optgroup"}function $i(e,t,r){let a=R(r,t);return!a||a.type==="element"&&(a.tagName==="option"||a.tagName==="optgroup")}function Mi(e,t,r){let a=R(r,t);return!!(a&&a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot"))}function Gi(e,t,r){let a=R(r,t);return!a||a.type==="element"&&(a.tagName==="tbody"||a.tagName==="tfoot")}function Bi(e,t,r){return!R(r,t)}function ji(e,t,r){let a=R(r,t);return!a||a.type==="element"&&a.tagName==="tr"}function Fr(e,t,r){let a=R(r,t);return!a||a.type==="element"&&(a.tagName==="td"||a.tagName==="th")}const Ui=jr({body:Hi,colgroup:qi,head:Wi,html:Fi,tbody:zi});function Fi(e){let t=R(e,-1);return!t||t.type!=="comment"}function Wi(e){let t=new Set;for(let a of e.children)if(a.type==="element"&&(a.tagName==="base"||a.tagName==="title")){if(t.has(a.tagName))return!1;t.add(a.tagName)}let r=e.children[0];return!r||r.type==="element"}function Hi(e){let t=R(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&pr(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function qi(e,t,r){let a=Gr(r,t),n=R(e,-1,!0);return r&&a&&a.type==="element"&&a.tagName==="colgroup"&&Pt(a,r.children.indexOf(a),r)?!1:!!(n&&n.type==="element"&&n.tagName==="col")}function zi(e,t,r){let a=Gr(r,t),n=R(e,-1);return r&&a&&a.type==="element"&&(a.tagName==="thead"||a.tagName==="tbody")&&Pt(a,r.children.indexOf(a),r)?!1:!!(n&&n.type==="element"&&n.tagName==="tr")}var Ze={name:[[`
5
5
  \f\r &/=>`.split(""),`
@@ -1 +1 @@
1
- import{s as L}from"./chunk-LvLJmgfZ.js";import{u as K}from"./useEvent-DlWF5OMa.js";import{t as R}from"./react-BGmjiNul.js";import{An as U,dr as V,jn as W,pr as O,w as Y}from"./cells-CmJW_FeD.js";import{t as D}from"./compiler-runtime-DeeZ7FnK.js";import{t as X}from"./useLifecycle-CmDXEyIC.js";import{o as Z}from"./utils-Czt8B2GX.js";import{t as ee}from"./jsx-runtime-DN_bIXfG.js";import{r as M,t as z}from"./button-B8cGZzP5.js";import{t as x}from"./cn-C1rgT0yh.js";import{G as te}from"./JsonOutput-DlwRx3jE.js";import{r as ae}from"./requests-C0HaHO6a.js";import{t as se}from"./createLucideIcon-CW2xpJ57.js";import{h as re}from"./select-D9lTzMzP.js";import{t as ne}from"./chevron-right-CqEd11Di.js";import{n as le,t as oe}from"./spinner-C1czjtp7.js";import{r as ce}from"./useTheme-BSVRc0kJ.js";import{t as $}from"./tooltip-CvjcEpZC.js";import{t as ie}from"./context-BAYdLMF_.js";import{r as me}from"./numbers-C9_R_vlY.js";import{t as de}from"./copy-icon-jWsqdLn1.js";import{t as pe}from"./useInstallPackage-RldLPyJs.js";import{n as ue}from"./es-BJsT6vfZ.js";import{o as xe}from"./focus-KGgBDCvb.js";var I=se("square-plus",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),h=D(),l=L(ee(),1);const he=o=>{let e=(0,h.c)(4),{isExpanded:a}=o,s=a&&"rotate-90",t;e[0]===s?t=e[1]:(t=x("h-3 w-3 transition-transform",s),e[0]=s,e[1]=t);let r;return e[2]===t?r=e[3]:(r=(0,l.jsx)(ne,{className:t}),e[2]=t,e[3]=r),r},fe=o=>{let e=(0,h.c)(5),{children:a,className:s}=o,t;e[0]===s?t=e[1]:(t=x("flex gap-1.5 items-center font-bold py-1.5 text-muted-foreground bg-(--slate-2) text-sm",s),e[0]=s,e[1]=t);let r;return e[2]!==a||e[3]!==t?(r=(0,l.jsx)("div",{className:t,children:a}),e[2]=a,e[3]=t,e[4]=r):r=e[4],r},ge=o=>{let e=(0,h.c)(5),{content:a,className:s}=o,t;e[0]===s?t=e[1]:(t=x("text-sm text-muted-foreground py-1",s),e[0]=s,e[1]=t);let r;return e[2]!==a||e[3]!==t?(r=(0,l.jsx)("div",{className:t,children:a}),e[2]=a,e[3]=t,e[4]=r):r=e[4],r},ye=o=>{let e=(0,h.c)(6),{error:a,className:s}=o,t;e[0]===s?t=e[1]:(t=x("text-sm bg-red-50 dark:bg-red-900 text-red-600 dark:text-red-50 flex items-center gap-2 p-2 h-8",s),e[0]=s,e[1]=t);let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,l.jsx)(re,{className:"h-4 w-4 mt-0.5"}),e[2]=r):r=e[2];let n;return e[3]!==a.message||e[4]!==t?(n=(0,l.jsxs)("div",{className:t,children:[r,a.message]}),e[3]=a.message,e[4]=t,e[5]=n):n=e[5],n},be=o=>{let e=(0,h.c)(6),{message:a,className:s}=o,t;e[0]===s?t=e[1]:(t=x("text-sm bg-blue-50 dark:bg-(--accent) text-blue-500 dark:text-blue-50 flex items-center gap-2 p-2 h-8",s),e[0]=s,e[1]=t);let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,l.jsx)(le,{className:"h-4 w-4 animate-spin"}),e[2]=r):r=e[2];let n;return e[3]!==a||e[4]!==t?(n=(0,l.jsxs)("div",{className:t,children:[r,a]}),e[3]=a,e[4]=t,e[5]=n):n=e[5],n},E=o=>{let e=(0,h.c)(5),{children:a,className:s}=o,t;e[0]===s?t=e[1]:(t=x("flex flex-col gap-2 relative",s),e[0]=s,e[1]=t);let r;return e[2]!==a||e[3]!==t?(r=(0,l.jsx)("div",{className:t,children:a}),e[2]=a,e[3]=t,e[4]=r):r=e[4],r},_e=o=>{let e=(0,h.c)(6),{columnName:a,dataType:s}=o,t=U[s],r=`w-4 h-4 p-0.5 rounded-sm stroke-card-foreground ${W(s)}`,n;e[0]!==t||e[1]!==r?(n=(0,l.jsx)(t,{className:r}),e[0]=t,e[1]=r,e[2]=n):n=e[2];let c;return e[3]!==a||e[4]!==n?(c=(0,l.jsxs)("div",{className:"flex flex-row items-center gap-1.5",children:[n,a]}),e[3]=a,e[4]=n,e[5]=c):c=e[5],c};var je=D(),Ne=L(R(),1);const ke=o=>{let e=(0,je.c)(13),{packages:a,showMaxPackages:s,className:t,onInstall:r}=o,{handleInstallPackages:n}=pe();if(!a||a.length===0)return null;let c;e[0]!==n||e[1]!==r||e[2]!==a?(c=()=>{n(a,r)},e[0]=n,e[1]=r,e[2]=a,e[3]=c):c=e[3];let i;e[4]===t?i=e[5]:(i=x("ml-2",t),e[4]=t,e[5]=i);let d;e[6]!==a||e[7]!==s?(d=s?a.slice(0,s).join(", "):a.join(", "),e[6]=a,e[7]=s,e[8]=d):d=e[8];let p;return e[9]!==c||e[10]!==i||e[11]!==d?(p=(0,l.jsxs)(z,{variant:"outline",size:"xs",onClick:c,className:i,children:["Install"," ",d]}),e[9]=c,e[10]=i,e[11]=d,e[12]=p):p=e[12],p};var Q=D();const ve=o=>{let e=(0,Q.c)(53),{table:a,column:s,preview:t,onAddColumnChart:r,sqlTableContext:n}=o,{theme:c}=ce(),{previewDatasetColumn:i}=ae(),{locale:d}=ie(),p;e[0]!==s.name||e[1]!==i||e[2]!==n||e[3]!==a.name||e[4]!==a.source||e[5]!==a.source_type?(p=()=>{i({source:a.source,tableName:a.name,columnName:s.name,sourceType:a.source_type,fullyQualifiedTableName:n?`${n.database}.${n.schema}.${a.name}`:a.name})},e[0]=s.name,e[1]=i,e[2]=n,e[3]=a.name,e[4]=a.source,e[5]=a.source_type,e[6]=p):p=e[6];let u=p,y;if(e[7]!==t||e[8]!==u||e[9]!==a.source_type?(y=()=>{t||a.source_type==="connection"||a.source_type==="catalog"||u()},e[7]=t,e[8]=u,e[9]=a.source_type,e[10]=y):y=e[10],X(y),a.source_type==="connection"){let m=s.name,H=s.external_type,f;e[11]!==s.name||e[12]!==r||e[13]!==n||e[14]!==a?(f=M.stopPropagation(()=>{r(O({table:a,columnName:s.name,sqlTableContext:n}))}),e[11]=s.name,e[12]=r,e[13]=n,e[14]=a,e[15]=f):f=e[15];let P;e[16]===Symbol.for("react.memo_cache_sentinel")?(P=(0,l.jsx)(I,{className:"h-3 w-3 mr-1"}),e[16]=P):P=e[16];let g;e[17]===f?g=e[18]:(g=(0,l.jsxs)(z,{variant:"outline",size:"xs",onClick:f,children:[P," Add SQL cell"]}),e[17]=f,e[18]=g);let T;return e[19]!==s.external_type||e[20]!==s.name||e[21]!==g?(T=(0,l.jsxs)("span",{className:"text-xs text-muted-foreground gap-2 flex items-center justify-between pl-7",children:[m," (",H,")",g]}),e[19]=s.external_type,e[20]=s.name,e[21]=g,e[22]=T):T=e[22],T}if(a.source_type==="catalog"){let m;return e[23]!==s.external_type||e[24]!==s.name?(m=(0,l.jsxs)("span",{className:"text-xs text-muted-foreground gap-2 flex items-center justify-between pl-7",children:[s.name," (",s.external_type,")"]}),e[23]=s.external_type,e[24]=s.name,e[25]=m):m=e[25],m}if(!t){let m;return e[26]===Symbol.for("react.memo_cache_sentinel")?(m=(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"Loading..."}),e[26]=m):m=e[26],m}let b;e[27]!==t.error||e[28]!==t.missing_packages||e[29]!==u?(b=t.error&&G({error:t.error,missingPackages:t.missing_packages,refetchPreview:u}),e[27]=t.error,e[28]=t.missing_packages,e[29]=u,e[30]=b):b=e[30];let _=b,j;e[31]!==s.type||e[32]!==d||e[33]!==t.stats?(j=t.stats&&J({stats:t.stats,dataType:s.type,locale:d}),e[31]=s.type,e[32]=d,e[33]=t.stats,e[34]=j):j=e[34];let N=j,k;e[35]!==t.chart_spec||e[36]!==c?(k=t.chart_spec&&B(t.chart_spec,c),e[35]=t.chart_spec,e[36]=c,e[37]=k):k=e[37];let v=k,w;e[38]!==t.chart_code||e[39]!==a.source_type?(w=t.chart_code&&a.source_type==="local"&&(0,l.jsx)(F,{chartCode:t.chart_code}),e[38]=t.chart_code,e[39]=a.source_type,e[40]=w):w=e[40];let A=w,C;e[41]!==s.name||e[42]!==r||e[43]!==n||e[44]!==a?(C=a.source_type==="duckdb"&&(0,l.jsx)($,{content:"Add SQL cell",delayDuration:400,children:(0,l.jsx)(z,{variant:"outline",size:"icon",className:"z-10 bg-background absolute right-1 -top-1",onClick:M.stopPropagation(()=>{r(O({table:a,columnName:s.name,sqlTableContext:n}))}),children:(0,l.jsx)(I,{className:"h-3 w-3"})})}),e[41]=s.name,e[42]=r,e[43]=n,e[44]=a,e[45]=C):C=e[45];let q=C;if(!_&&!N&&!v){let m;return e[46]===Symbol.for("react.memo_cache_sentinel")?(m=(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"No data"}),e[46]=m):m=e[46],m}let S;return e[47]!==A||e[48]!==q||e[49]!==v||e[50]!==_||e[51]!==N?(S=(0,l.jsxs)(E,{children:[_,A,q,v,N]}),e[47]=A,e[48]=q,e[49]=v,e[50]=_,e[51]=N,e[52]=S):S=e[52],S};function G({error:o,missingPackages:e,refetchPreview:a}){return(0,l.jsxs)("div",{className:"text-xs text-muted-foreground p-2 border border-border rounded flex items-center justify-between",children:[(0,l.jsx)("span",{children:o}),e&&(0,l.jsx)(ke,{packages:e,showMaxPackages:1,className:"w-32",onInstall:a})]})}function J({stats:o,dataType:e,locale:a}){return(0,l.jsx)("div",{className:"gap-x-16 gap-y-1 grid grid-cols-2-fit border rounded p-2 empty:hidden",children:Object.entries(o).map(([s,t])=>t==null?null:(0,l.jsxs)("div",{className:"flex items-center gap-1 group",children:[(0,l.jsx)("span",{className:"text-xs min-w-[60px] capitalize",children:V(s,e)}),(0,l.jsx)("span",{className:"text-xs font-bold text-muted-foreground tracking-wide",children:me(t,a)}),(0,l.jsx)(de,{className:"h-3 w-3 invisible group-hover:visible",value:String(t)})]},s))})}var we=(0,l.jsx)("div",{className:"flex justify-center",children:(0,l.jsx)(oe,{className:"size-4"})});function B(o,e){return(0,l.jsx)(Ne.Suspense,{fallback:we,children:(0,l.jsx)(te,{spec:(a=>({...a,background:"transparent",config:{...a.config,background:"transparent"}}))(JSON.parse(o)),options:{theme:e==="dark"?"dark":"vox",height:100,width:"container",actions:!1,renderer:"canvas"}})})}const F=o=>{let e=(0,Q.c)(10),{chartCode:a}=o,s=K(Z),t=xe(),{createNewCell:r}=Y(),n;e[0]!==s||e[1]!==r||e[2]!==t?(n=u=>{u.includes("alt")&&ue({autoInstantiate:s,createNewCell:r,fromCellId:t}),r({code:u,before:!1,cellId:t??"__end__"})},e[0]=s,e[1]=r,e[2]=t,e[3]=n):n=e[3];let c=n,i;e[4]!==a||e[5]!==c?(i=M.stopPropagation(()=>c(a)),e[4]=a,e[5]=c,e[6]=i):i=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=(0,l.jsx)(I,{className:"h-3 w-3"}),e[7]=d):d=e[7];let p;return e[8]===i?p=e[9]:(p=(0,l.jsx)($,{content:"Add chart to notebook",delayDuration:400,children:(0,l.jsx)(z,{variant:"outline",size:"icon",className:"z-10 bg-background absolute right-1 -top-0.5",onClick:i,children:d})}),e[8]=i,e[9]=p),p};export{J as a,fe as c,be as d,he as f,G as i,ge as l,ve as n,_e as o,I as p,B as r,E as s,F as t,ye as u};
1
+ import{s as L}from"./chunk-LvLJmgfZ.js";import{u as K}from"./useEvent-DlWF5OMa.js";import{t as R}from"./react-BGmjiNul.js";import{An as U,dr as V,jn as W,pr as O,w as Y}from"./cells-CmJW_FeD.js";import{t as D}from"./compiler-runtime-DeeZ7FnK.js";import{t as X}from"./useLifecycle-CmDXEyIC.js";import{o as Z}from"./utils-Czt8B2GX.js";import{t as ee}from"./jsx-runtime-DN_bIXfG.js";import{r as M,t as z}from"./button-B8cGZzP5.js";import{t as x}from"./cn-C1rgT0yh.js";import{G as te}from"./JsonOutput-BH-e3_eJ.js";import{r as ae}from"./requests-C0HaHO6a.js";import{t as se}from"./createLucideIcon-CW2xpJ57.js";import{h as re}from"./select-D9lTzMzP.js";import{t as ne}from"./chevron-right-CqEd11Di.js";import{n as le,t as oe}from"./spinner-C1czjtp7.js";import{r as ce}from"./useTheme-BSVRc0kJ.js";import{t as $}from"./tooltip-CvjcEpZC.js";import{t as ie}from"./context-BAYdLMF_.js";import{r as me}from"./numbers-C9_R_vlY.js";import{t as de}from"./copy-icon-jWsqdLn1.js";import{t as pe}from"./useInstallPackage-RldLPyJs.js";import{n as ue}from"./es-Bu_hpQqq.js";import{o as xe}from"./focus-BGH9Dxb1.js";var I=se("square-plus",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),h=D(),l=L(ee(),1);const he=o=>{let e=(0,h.c)(4),{isExpanded:a}=o,s=a&&"rotate-90",t;e[0]===s?t=e[1]:(t=x("h-3 w-3 transition-transform",s),e[0]=s,e[1]=t);let r;return e[2]===t?r=e[3]:(r=(0,l.jsx)(ne,{className:t}),e[2]=t,e[3]=r),r},fe=o=>{let e=(0,h.c)(5),{children:a,className:s}=o,t;e[0]===s?t=e[1]:(t=x("flex gap-1.5 items-center font-bold py-1.5 text-muted-foreground bg-(--slate-2) text-sm",s),e[0]=s,e[1]=t);let r;return e[2]!==a||e[3]!==t?(r=(0,l.jsx)("div",{className:t,children:a}),e[2]=a,e[3]=t,e[4]=r):r=e[4],r},ge=o=>{let e=(0,h.c)(5),{content:a,className:s}=o,t;e[0]===s?t=e[1]:(t=x("text-sm text-muted-foreground py-1",s),e[0]=s,e[1]=t);let r;return e[2]!==a||e[3]!==t?(r=(0,l.jsx)("div",{className:t,children:a}),e[2]=a,e[3]=t,e[4]=r):r=e[4],r},ye=o=>{let e=(0,h.c)(6),{error:a,className:s}=o,t;e[0]===s?t=e[1]:(t=x("text-sm bg-red-50 dark:bg-red-900 text-red-600 dark:text-red-50 flex items-center gap-2 p-2 h-8",s),e[0]=s,e[1]=t);let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,l.jsx)(re,{className:"h-4 w-4 mt-0.5"}),e[2]=r):r=e[2];let n;return e[3]!==a.message||e[4]!==t?(n=(0,l.jsxs)("div",{className:t,children:[r,a.message]}),e[3]=a.message,e[4]=t,e[5]=n):n=e[5],n},be=o=>{let e=(0,h.c)(6),{message:a,className:s}=o,t;e[0]===s?t=e[1]:(t=x("text-sm bg-blue-50 dark:bg-(--accent) text-blue-500 dark:text-blue-50 flex items-center gap-2 p-2 h-8",s),e[0]=s,e[1]=t);let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,l.jsx)(le,{className:"h-4 w-4 animate-spin"}),e[2]=r):r=e[2];let n;return e[3]!==a||e[4]!==t?(n=(0,l.jsxs)("div",{className:t,children:[r,a]}),e[3]=a,e[4]=t,e[5]=n):n=e[5],n},E=o=>{let e=(0,h.c)(5),{children:a,className:s}=o,t;e[0]===s?t=e[1]:(t=x("flex flex-col gap-2 relative",s),e[0]=s,e[1]=t);let r;return e[2]!==a||e[3]!==t?(r=(0,l.jsx)("div",{className:t,children:a}),e[2]=a,e[3]=t,e[4]=r):r=e[4],r},_e=o=>{let e=(0,h.c)(6),{columnName:a,dataType:s}=o,t=U[s],r=`w-4 h-4 p-0.5 rounded-sm stroke-card-foreground ${W(s)}`,n;e[0]!==t||e[1]!==r?(n=(0,l.jsx)(t,{className:r}),e[0]=t,e[1]=r,e[2]=n):n=e[2];let c;return e[3]!==a||e[4]!==n?(c=(0,l.jsxs)("div",{className:"flex flex-row items-center gap-1.5",children:[n,a]}),e[3]=a,e[4]=n,e[5]=c):c=e[5],c};var je=D(),Ne=L(R(),1);const ke=o=>{let e=(0,je.c)(13),{packages:a,showMaxPackages:s,className:t,onInstall:r}=o,{handleInstallPackages:n}=pe();if(!a||a.length===0)return null;let c;e[0]!==n||e[1]!==r||e[2]!==a?(c=()=>{n(a,r)},e[0]=n,e[1]=r,e[2]=a,e[3]=c):c=e[3];let i;e[4]===t?i=e[5]:(i=x("ml-2",t),e[4]=t,e[5]=i);let d;e[6]!==a||e[7]!==s?(d=s?a.slice(0,s).join(", "):a.join(", "),e[6]=a,e[7]=s,e[8]=d):d=e[8];let p;return e[9]!==c||e[10]!==i||e[11]!==d?(p=(0,l.jsxs)(z,{variant:"outline",size:"xs",onClick:c,className:i,children:["Install"," ",d]}),e[9]=c,e[10]=i,e[11]=d,e[12]=p):p=e[12],p};var Q=D();const ve=o=>{let e=(0,Q.c)(53),{table:a,column:s,preview:t,onAddColumnChart:r,sqlTableContext:n}=o,{theme:c}=ce(),{previewDatasetColumn:i}=ae(),{locale:d}=ie(),p;e[0]!==s.name||e[1]!==i||e[2]!==n||e[3]!==a.name||e[4]!==a.source||e[5]!==a.source_type?(p=()=>{i({source:a.source,tableName:a.name,columnName:s.name,sourceType:a.source_type,fullyQualifiedTableName:n?`${n.database}.${n.schema}.${a.name}`:a.name})},e[0]=s.name,e[1]=i,e[2]=n,e[3]=a.name,e[4]=a.source,e[5]=a.source_type,e[6]=p):p=e[6];let u=p,y;if(e[7]!==t||e[8]!==u||e[9]!==a.source_type?(y=()=>{t||a.source_type==="connection"||a.source_type==="catalog"||u()},e[7]=t,e[8]=u,e[9]=a.source_type,e[10]=y):y=e[10],X(y),a.source_type==="connection"){let m=s.name,H=s.external_type,f;e[11]!==s.name||e[12]!==r||e[13]!==n||e[14]!==a?(f=M.stopPropagation(()=>{r(O({table:a,columnName:s.name,sqlTableContext:n}))}),e[11]=s.name,e[12]=r,e[13]=n,e[14]=a,e[15]=f):f=e[15];let P;e[16]===Symbol.for("react.memo_cache_sentinel")?(P=(0,l.jsx)(I,{className:"h-3 w-3 mr-1"}),e[16]=P):P=e[16];let g;e[17]===f?g=e[18]:(g=(0,l.jsxs)(z,{variant:"outline",size:"xs",onClick:f,children:[P," Add SQL cell"]}),e[17]=f,e[18]=g);let T;return e[19]!==s.external_type||e[20]!==s.name||e[21]!==g?(T=(0,l.jsxs)("span",{className:"text-xs text-muted-foreground gap-2 flex items-center justify-between pl-7",children:[m," (",H,")",g]}),e[19]=s.external_type,e[20]=s.name,e[21]=g,e[22]=T):T=e[22],T}if(a.source_type==="catalog"){let m;return e[23]!==s.external_type||e[24]!==s.name?(m=(0,l.jsxs)("span",{className:"text-xs text-muted-foreground gap-2 flex items-center justify-between pl-7",children:[s.name," (",s.external_type,")"]}),e[23]=s.external_type,e[24]=s.name,e[25]=m):m=e[25],m}if(!t){let m;return e[26]===Symbol.for("react.memo_cache_sentinel")?(m=(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"Loading..."}),e[26]=m):m=e[26],m}let b;e[27]!==t.error||e[28]!==t.missing_packages||e[29]!==u?(b=t.error&&G({error:t.error,missingPackages:t.missing_packages,refetchPreview:u}),e[27]=t.error,e[28]=t.missing_packages,e[29]=u,e[30]=b):b=e[30];let _=b,j;e[31]!==s.type||e[32]!==d||e[33]!==t.stats?(j=t.stats&&J({stats:t.stats,dataType:s.type,locale:d}),e[31]=s.type,e[32]=d,e[33]=t.stats,e[34]=j):j=e[34];let N=j,k;e[35]!==t.chart_spec||e[36]!==c?(k=t.chart_spec&&B(t.chart_spec,c),e[35]=t.chart_spec,e[36]=c,e[37]=k):k=e[37];let v=k,w;e[38]!==t.chart_code||e[39]!==a.source_type?(w=t.chart_code&&a.source_type==="local"&&(0,l.jsx)(F,{chartCode:t.chart_code}),e[38]=t.chart_code,e[39]=a.source_type,e[40]=w):w=e[40];let A=w,C;e[41]!==s.name||e[42]!==r||e[43]!==n||e[44]!==a?(C=a.source_type==="duckdb"&&(0,l.jsx)($,{content:"Add SQL cell",delayDuration:400,children:(0,l.jsx)(z,{variant:"outline",size:"icon",className:"z-10 bg-background absolute right-1 -top-1",onClick:M.stopPropagation(()=>{r(O({table:a,columnName:s.name,sqlTableContext:n}))}),children:(0,l.jsx)(I,{className:"h-3 w-3"})})}),e[41]=s.name,e[42]=r,e[43]=n,e[44]=a,e[45]=C):C=e[45];let q=C;if(!_&&!N&&!v){let m;return e[46]===Symbol.for("react.memo_cache_sentinel")?(m=(0,l.jsx)("span",{className:"text-xs text-muted-foreground",children:"No data"}),e[46]=m):m=e[46],m}let S;return e[47]!==A||e[48]!==q||e[49]!==v||e[50]!==_||e[51]!==N?(S=(0,l.jsxs)(E,{children:[_,A,q,v,N]}),e[47]=A,e[48]=q,e[49]=v,e[50]=_,e[51]=N,e[52]=S):S=e[52],S};function G({error:o,missingPackages:e,refetchPreview:a}){return(0,l.jsxs)("div",{className:"text-xs text-muted-foreground p-2 border border-border rounded flex items-center justify-between",children:[(0,l.jsx)("span",{children:o}),e&&(0,l.jsx)(ke,{packages:e,showMaxPackages:1,className:"w-32",onInstall:a})]})}function J({stats:o,dataType:e,locale:a}){return(0,l.jsx)("div",{className:"gap-x-16 gap-y-1 grid grid-cols-2-fit border rounded p-2 empty:hidden",children:Object.entries(o).map(([s,t])=>t==null?null:(0,l.jsxs)("div",{className:"flex items-center gap-1 group",children:[(0,l.jsx)("span",{className:"text-xs min-w-[60px] capitalize",children:V(s,e)}),(0,l.jsx)("span",{className:"text-xs font-bold text-muted-foreground tracking-wide",children:me(t,a)}),(0,l.jsx)(de,{className:"h-3 w-3 invisible group-hover:visible",value:String(t)})]},s))})}var we=(0,l.jsx)("div",{className:"flex justify-center",children:(0,l.jsx)(oe,{className:"size-4"})});function B(o,e){return(0,l.jsx)(Ne.Suspense,{fallback:we,children:(0,l.jsx)(te,{spec:(a=>({...a,background:"transparent",config:{...a.config,background:"transparent"}}))(JSON.parse(o)),options:{theme:e==="dark"?"dark":"vox",height:100,width:"container",actions:!1,renderer:"canvas"}})})}const F=o=>{let e=(0,Q.c)(10),{chartCode:a}=o,s=K(Z),t=xe(),{createNewCell:r}=Y(),n;e[0]!==s||e[1]!==r||e[2]!==t?(n=u=>{u.includes("alt")&&ue({autoInstantiate:s,createNewCell:r,fromCellId:t}),r({code:u,before:!1,cellId:t??"__end__"})},e[0]=s,e[1]=r,e[2]=t,e[3]=n):n=e[3];let c=n,i;e[4]!==a||e[5]!==c?(i=M.stopPropagation(()=>c(a)),e[4]=a,e[5]=c,e[6]=i):i=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=(0,l.jsx)(I,{className:"h-3 w-3"}),e[7]=d):d=e[7];let p;return e[8]===i?p=e[9]:(p=(0,l.jsx)($,{content:"Add chart to notebook",delayDuration:400,children:(0,l.jsx)(z,{variant:"outline",size:"icon",className:"z-10 bg-background absolute right-1 -top-0.5",onClick:i,children:d})}),e[8]=i,e[9]=p),p};export{J as a,fe as c,be as d,he as f,G as i,ge as l,ve as n,_e as o,I as p,B as r,E as s,F as t,ye as u};
@@ -1 +1 @@
1
- import{s as fe}from"./chunk-LvLJmgfZ.js";import{t as De}from"./react-BGmjiNul.js";import{G as Pe}from"./cells-CmJW_FeD.js";import{t as $e}from"./compiler-runtime-DeeZ7FnK.js";import{n as V}from"./useEventListener-COkmyg1v.js";import{t as Le}from"./jsx-runtime-DN_bIXfG.js";import{t as P}from"./cn-C1rgT0yh.js";import{lt as Fe}from"./input-Bkl2Yfmh.js";import{f as $}from"./Combination-D1TsGrBC.js";import{c as Ke,n as Oe,o as Ve,t as qe}from"./menu-items-9PZrU2e0.js";import{_ as ze,g as Be,h as Ge,p as He}from"./alert-dialog-jcHA5geR.js";import{n as Ue,t as Te}from"./dialog-CF5DtF1E.js";import{t as A}from"./dist-D0NgYwYf.js";var pe=1,We=.9,Je=.8,Qe=.17,ee=.1,te=.999,Xe=.9999,Ye=.99,Ze=/[\\\/_+.#"@\[\(\{&]/,et=/[\\\/_+.#"@\[\(\{&]/g,tt=/[\s-]/,ve=/[\s-]/g;function re(t,r,e,n,a,l,o){if(l===r.length)return a===t.length?pe:Ye;var m=`${a},${l}`;if(o[m]!==void 0)return o[m];for(var p=n.charAt(l),c=e.indexOf(p,a),f=0,v,y,x,I;c>=0;)v=re(t,r,e,n,c+1,l+1,o),v>f&&(c===a?v*=pe:Ze.test(t.charAt(c-1))?(v*=Je,x=t.slice(a,c-1).match(et),x&&a>0&&(v*=te**+x.length)):tt.test(t.charAt(c-1))?(v*=We,I=t.slice(a,c-1).match(ve),I&&a>0&&(v*=te**+I.length)):(v*=Qe,a>0&&(v*=te**+(c-a))),t.charAt(c)!==r.charAt(l)&&(v*=Xe)),(v<ee&&e.charAt(c-1)===n.charAt(l+1)||n.charAt(l+1)===n.charAt(l)&&e.charAt(c-1)!==n.charAt(l))&&(y=re(t,r,e,n,c+1,l+2,o),y*ee>v&&(v=y*ee)),v>f&&(f=v),c=e.indexOf(p,c+1);return o[m]=f,f}function he(t){return t.toLowerCase().replace(ve," ")}function rt(t,r,e){return t=e&&e.length>0?`${t+" "+e.join(" ")}`:t,re(t,r,he(t),he(r),0,0,{})}var u=fe(De(),1),q='[cmdk-group=""]',ae='[cmdk-group-items=""]',at='[cmdk-group-heading=""]',ge='[cmdk-item=""]',be=`${ge}:not([aria-disabled="true"])`,ne="cmdk-item-select",L="data-value",nt=(t,r,e)=>rt(t,r,e),we=u.createContext(void 0),z=()=>u.useContext(we),ye=u.createContext(void 0),le=()=>u.useContext(ye),xe=u.createContext(void 0),ke=u.forwardRef((t,r)=>{let e=F(()=>({search:"",value:t.value??t.defaultValue??"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),n=F(()=>new Set),a=F(()=>new Map),l=F(()=>new Map),o=F(()=>new Set),m=Se(t),{label:p,children:c,value:f,onValueChange:v,filter:y,shouldFilter:x,loop:I,disablePointerSelection:Me=!1,vimBindings:H=!0,...B}=t,U=$(),T=$(),K=$(),b=u.useRef(null),N=pt();M(()=>{if(f!==void 0){let i=f.trim();e.current.value=i,S.emit()}},[f]),M(()=>{N(6,ue)},[]);let S=u.useMemo(()=>({subscribe:i=>(o.current.add(i),()=>o.current.delete(i)),snapshot:()=>e.current,setState:(i,d,h)=>{var R;var s,g,w;if(!Object.is(e.current[i],d)){if(e.current[i]=d,i==="search")X(),J(),N(1,Q);else if(i==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let C=document.getElementById(K);C?C.focus():(s=document.getElementById(U))==null||s.focus()}if(N(7,()=>{var C;e.current.selectedItemId=(C=D())==null?void 0:C.id,S.emit()}),h||N(5,ue),((R=m.current)==null?void 0:R.value)!==void 0){let C=d??"";(w=(g=m.current).onValueChange)==null||w.call(g,C);return}}S.emit()}},emit:()=>{o.current.forEach(i=>i())}}),[]),W=u.useMemo(()=>({value:(i,d,h)=>{var s;d!==((s=l.current.get(i))==null?void 0:s.value)&&(l.current.set(i,{value:d,keywords:h}),e.current.filtered.items.set(i,oe(d,h)),N(2,()=>{J(),S.emit()}))},item:(i,d)=>(n.current.add(i),d&&(a.current.has(d)?a.current.get(d).add(i):a.current.set(d,new Set([i]))),N(3,()=>{X(),J(),e.current.value||Q(),S.emit()}),()=>{l.current.delete(i),n.current.delete(i),e.current.filtered.items.delete(i);let h=D();N(4,()=>{X(),(h==null?void 0:h.getAttribute("id"))===i&&Q(),S.emit()})}),group:i=>(a.current.has(i)||a.current.set(i,new Set),()=>{l.current.delete(i),a.current.delete(i)}),filter:()=>m.current.shouldFilter,label:p||t["aria-label"],getDisablePointerSelection:()=>m.current.disablePointerSelection,listId:U,inputId:K,labelId:T,listInnerRef:b}),[]);function oe(i,d){var s;let h=((s=m.current)==null?void 0:s.filter)??nt;return i?h(i,e.current.search,d):0}function J(){if(!e.current.search||m.current.shouldFilter===!1)return;let i=e.current.filtered.items,d=[];e.current.filtered.groups.forEach(s=>{let g=a.current.get(s),w=0;g.forEach(R=>{let C=i.get(R);w=Math.max(C,w)}),d.push([s,w])});let h=b.current;O().sort((s,g)=>{let w=s.getAttribute("id"),R=g.getAttribute("id");return(i.get(R)??0)-(i.get(w)??0)}).forEach(s=>{let g=s.closest(ae);g?g.appendChild(s.parentElement===g?s:s.closest(`${ae} > *`)):h.appendChild(s.parentElement===h?s:s.closest(`${ae} > *`))}),d.sort((s,g)=>g[1]-s[1]).forEach(s=>{var w;let g=(w=b.current)==null?void 0:w.querySelector(`${q}[${L}="${encodeURIComponent(s[0])}"]`);g==null||g.parentElement.appendChild(g)})}function Q(){var d;let i=(d=O().find(h=>h.getAttribute("aria-disabled")!=="true"))==null?void 0:d.getAttribute(L);S.setState("value",i||void 0)}function X(){var d,h;if(!e.current.search||m.current.shouldFilter===!1){e.current.filtered.count=n.current.size;return}e.current.filtered.groups=new Set;let i=0;for(let s of n.current){let g=oe(((d=l.current.get(s))==null?void 0:d.value)??"",((h=l.current.get(s))==null?void 0:h.keywords)??[]);e.current.filtered.items.set(s,g),g>0&&i++}for(let[s,g]of a.current)for(let w of g)if(e.current.filtered.items.get(w)>0){e.current.filtered.groups.add(s);break}e.current.filtered.count=i}function ue(){var h,s;var i;let d=D();d&&(((h=d.parentElement)==null?void 0:h.firstChild)===d&&((i=(s=d.closest(q))==null?void 0:s.querySelector(at))==null||i.scrollIntoView({block:"nearest"})),d.scrollIntoView({block:"nearest"}))}function D(){var i;return(i=b.current)==null?void 0:i.querySelector(`${ge}[aria-selected="true"]`)}function O(){var i;return Array.from(((i=b.current)==null?void 0:i.querySelectorAll(be))||[])}function Y(i){let d=O()[i];d&&S.setState("value",d.getAttribute(L))}function Z(i){var d;let h=D(),s=O(),g=s.findIndex(R=>R===h),w=s[g+i];(d=m.current)!=null&&d.loop&&(w=g+i<0?s[s.length-1]:g+i===s.length?s[0]:s[g+i]),w&&S.setState("value",w.getAttribute(L))}function ce(i){var s;let d=(s=D())==null?void 0:s.closest(q),h;for(;d&&!h;)d=i>0?mt(d,q):ft(d,q),h=d==null?void 0:d.querySelector(be);h?S.setState("value",h.getAttribute(L)):Z(i)}let se=()=>Y(O().length-1),de=i=>{i.preventDefault(),i.metaKey?se():i.altKey?ce(1):Z(1)},me=i=>{i.preventDefault(),i.metaKey?Y(0):i.altKey?ce(-1):Z(-1)};return u.createElement(A.div,{ref:r,tabIndex:-1,...B,"cmdk-root":"",onKeyDown:i=>{var d;(d=B.onKeyDown)==null||d.call(B,i);let h=i.nativeEvent.isComposing||i.keyCode===229;if(!(i.defaultPrevented||h))switch(i.key){case"n":case"j":H&&i.ctrlKey&&de(i);break;case"ArrowDown":de(i);break;case"p":case"k":H&&i.ctrlKey&&me(i);break;case"ArrowUp":me(i);break;case"Home":i.preventDefault(),Y(0);break;case"End":i.preventDefault(),se();break;case"Enter":{i.preventDefault();let s=D();if(s){let g=new Event(ne);s.dispatchEvent(g)}}}}},u.createElement("label",{"cmdk-label":"",htmlFor:W.inputId,id:W.labelId,style:ht},p),G(t,i=>u.createElement(ye.Provider,{value:S},u.createElement(we.Provider,{value:W},i))))}),lt=u.forwardRef((t,r)=>{var K;let e=$(),n=u.useRef(null),a=u.useContext(xe),l=z(),o=Se(t),m=((K=o.current)==null?void 0:K.forceMount)??(a==null?void 0:a.forceMount);M(()=>{if(!m)return l.item(e,a==null?void 0:a.id)},[m]);let p=Ne(e,n,[t.value,t.children,n],t.keywords),c=le(),f=_(b=>b.value&&b.value===p.current),v=_(b=>m||l.filter()===!1?!0:b.search?b.filtered.items.get(e)>0:!0);u.useEffect(()=>{let b=n.current;if(!(!b||t.disabled))return b.addEventListener(ne,y),()=>b.removeEventListener(ne,y)},[v,t.onSelect,t.disabled]);function y(){var b,N;x(),(N=(b=o.current).onSelect)==null||N.call(b,p.current)}function x(){c.setState("value",p.current,!0)}if(!v)return null;let{disabled:I,value:Me,onSelect:H,forceMount:B,keywords:U,...T}=t;return u.createElement(A.div,{ref:V(n,r),...T,id:e,"cmdk-item":"",role:"option","aria-disabled":!!I,"aria-selected":!!f,"data-disabled":!!I,"data-selected":!!f,onPointerMove:I||l.getDisablePointerSelection()?void 0:x,onClick:I?void 0:y},t.children)}),it=u.forwardRef((t,r)=>{let{heading:e,children:n,forceMount:a,...l}=t,o=$(),m=u.useRef(null),p=u.useRef(null),c=$(),f=z(),v=_(x=>a||f.filter()===!1?!0:x.search?x.filtered.groups.has(o):!0);M(()=>f.group(o),[]),Ne(o,m,[t.value,t.heading,p]);let y=u.useMemo(()=>({id:o,forceMount:a}),[a]);return u.createElement(A.div,{ref:V(m,r),...l,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},e&&u.createElement("div",{ref:p,"cmdk-group-heading":"","aria-hidden":!0,id:c},e),G(t,x=>u.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":e?c:void 0},u.createElement(xe.Provider,{value:y},x))))}),ot=u.forwardRef((t,r)=>{let{alwaysRender:e,...n}=t,a=u.useRef(null),l=_(o=>!o.search);return!e&&!l?null:u.createElement(A.div,{ref:V(a,r),...n,"cmdk-separator":"",role:"separator"})}),ut=u.forwardRef((t,r)=>{let{onValueChange:e,...n}=t,a=t.value!=null,l=le(),o=_(c=>c.search),m=_(c=>c.selectedItemId),p=z();return u.useEffect(()=>{t.value!=null&&l.setState("search",t.value)},[t.value]),u.createElement(A.input,{ref:r,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":p.listId,"aria-labelledby":p.labelId,"aria-activedescendant":m,id:p.inputId,type:"text",value:a?t.value:o,onChange:c=>{a||l.setState("search",c.target.value),e==null||e(c.target.value)}})}),Ee=u.forwardRef((t,r)=>{let{children:e,label:n="Suggestions",...a}=t,l=u.useRef(null),o=u.useRef(null),m=_(c=>c.selectedItemId),p=z();return u.useEffect(()=>{if(o.current&&l.current){let c=o.current,f=l.current,v,y=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let x=c.offsetHeight;f.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return y.observe(c),()=>{cancelAnimationFrame(v),y.unobserve(c)}}},[]),u.createElement(A.div,{ref:V(l,r),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":m,"aria-label":n,id:p.listId},G(t,c=>u.createElement("div",{ref:V(o,p.listInnerRef),"cmdk-list-sizer":""},c)))}),ct=u.forwardRef((t,r)=>{let{open:e,onOpenChange:n,overlayClassName:a,contentClassName:l,container:o,...m}=t;return u.createElement(ze,{open:e,onOpenChange:n},u.createElement(Be,{container:o},u.createElement(Ge,{"cmdk-overlay":"",className:a}),u.createElement(He,{"aria-label":t.label,"cmdk-dialog":"",className:l},u.createElement(ke,{ref:r,...m}))))}),st=u.forwardRef((t,r)=>_(e=>e.filtered.count===0)?u.createElement(A.div,{ref:r,...t,"cmdk-empty":"",role:"presentation"}):null),dt=u.forwardRef((t,r)=>{let{progress:e,children:n,label:a="Loading...",...l}=t;return u.createElement(A.div,{ref:r,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},G(t,o=>u.createElement("div",{"aria-hidden":!0},o)))}),k=Object.assign(ke,{List:Ee,Item:lt,Input:ut,Group:it,Separator:ot,Dialog:ct,Empty:st,Loading:dt});function mt(t,r){let e=t.nextElementSibling;for(;e;){if(e.matches(r))return e;e=e.nextElementSibling}}function ft(t,r){let e=t.previousElementSibling;for(;e;){if(e.matches(r))return e;e=e.previousElementSibling}}function Se(t){let r=u.useRef(t);return M(()=>{r.current=t}),r}var M=typeof window>"u"?u.useEffect:u.useLayoutEffect;function F(t){let r=u.useRef();return r.current===void 0&&(r.current=t()),r}function _(t){let r=le(),e=()=>t(r.snapshot());return u.useSyncExternalStore(r.subscribe,e,e)}function Ne(t,r,e,n=[]){let a=u.useRef(),l=z();return M(()=>{var o;let m=(()=>{var c;for(let f of e){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(c=f.current.textContent)==null?void 0:c.trim():a.current}})(),p=n.map(c=>c.trim());l.value(t,m,p),(o=r.current)==null||o.setAttribute(L,m),a.current=m}),a}var pt=()=>{let[t,r]=u.useState(),e=F(()=>new Map);return M(()=>{e.current.forEach(n=>n()),e.current=new Map},[t]),(n,a)=>{e.current.set(n,a),r({})}};function vt(t){let r=t.type;return typeof r=="function"?r(t.props):"render"in r?r.render(t.props):t}function G({asChild:t,children:r},e){return t&&u.isValidElement(r)?u.cloneElement(vt(r),{ref:r.ref},e(r.props.children)):e(r)}var ht={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},j=$e(),E=fe(Le(),1),ie=u.forwardRef((t,r)=>{let e=(0,j.c)(9),n,a;e[0]===t?(n=e[1],a=e[2]):({className:n,...a}=t,e[0]=t,e[1]=n,e[2]=a);let l;e[3]===n?l=e[4]:(l=P("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",n),e[3]=n,e[4]=l);let o;return e[5]!==a||e[6]!==r||e[7]!==l?(o=(0,E.jsx)(k,{ref:r,className:l,...a}),e[5]=a,e[6]=r,e[7]=l,e[8]=o):o=e[8],o});ie.displayName=k.displayName;var gt=t=>{let r=(0,j.c)(8),e,n;r[0]===t?(e=r[1],n=r[2]):({children:e,...n}=t,r[0]=t,r[1]=e,r[2]=n);let a;r[3]===e?a=r[4]:(a=(0,E.jsx)(Ue,{className:"overflow-hidden p-0 shadow-2xl",usePortal:!0,children:(0,E.jsx)(ie,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})}),r[3]=e,r[4]=a);let l;return r[5]!==n||r[6]!==a?(l=(0,E.jsx)(Te,{...n,children:a}),r[5]=n,r[6]=a,r[7]=l):l=r[7],l},Ie=u.forwardRef((t,r)=>{let e=(0,j.c)(19),n,a,l,o;e[0]===t?(n=e[1],a=e[2],l=e[3],o=e[4]):({className:n,icon:a,rootClassName:o,...l}=t,e[0]=t,e[1]=n,e[2]=a,e[3]=l,e[4]=o);let m;e[5]===o?m=e[6]:(m=P("flex items-center border-b px-3",o),e[5]=o,e[6]=m);let p;e[7]===a?p=e[8]:(p=a===null?null:(0,E.jsx)(Fe,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e[7]=a,e[8]=p);let c;e[9]===n?c=e[10]:(c=P("placeholder:text-foreground-muted flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",n),e[9]=n,e[10]=c);let f;e[11]!==l||e[12]!==r||e[13]!==c?(f=(0,E.jsx)(k.Input,{ref:r,className:c,...l}),e[11]=l,e[12]=r,e[13]=c,e[14]=f):f=e[14];let v;return e[15]!==m||e[16]!==p||e[17]!==f?(v=(0,E.jsxs)("div",{className:m,"cmdk-input-wrapper":"",children:[p,f]}),e[15]=m,e[16]=p,e[17]=f,e[18]=v):v=e[18],v});Ie.displayName=k.Input.displayName;var Ce=u.forwardRef((t,r)=>{let e=(0,j.c)(9),n,a;e[0]===t?(n=e[1],a=e[2]):({className:n,...a}=t,e[0]=t,e[1]=n,e[2]=a);let l;e[3]===n?l=e[4]:(l=P("max-h-[300px] overflow-y-auto overflow-x-hidden",n),e[3]=n,e[4]=l);let o;return e[5]!==a||e[6]!==r||e[7]!==l?(o=(0,E.jsx)(k.List,{ref:r,className:l,...a}),e[5]=a,e[6]=r,e[7]=l,e[8]=o):o=e[8],o});Ce.displayName=k.List.displayName;var Re=u.forwardRef((t,r)=>{let e=(0,j.c)(3),n;return e[0]!==t||e[1]!==r?(n=(0,E.jsx)(k.Empty,{ref:r,className:"py-6 text-center text-sm",...t}),e[0]=t,e[1]=r,e[2]=n):n=e[2],n});Re.displayName=k.Empty.displayName;var Ae=u.forwardRef((t,r)=>{let e=(0,j.c)(9),n,a;e[0]===t?(n=e[1],a=e[2]):({className:n,...a}=t,e[0]=t,e[1]=n,e[2]=a);let l;e[3]===n?l=e[4]:(l=P("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",n),e[3]=n,e[4]=l);let o;return e[5]!==a||e[6]!==r||e[7]!==l?(o=(0,E.jsx)(k.Group,{ref:r,className:l,...a}),e[5]=a,e[6]=r,e[7]=l,e[8]=o):o=e[8],o});Ae.displayName=k.Group.displayName;var _e=u.forwardRef((t,r)=>{let e=(0,j.c)(9),n,a;e[0]===t?(n=e[1],a=e[2]):({className:n,...a}=t,e[0]=t,e[1]=n,e[2]=a);let l;e[3]===n?l=e[4]:(l=Ke({className:n}),e[3]=n,e[4]=l);let o;return e[5]!==a||e[6]!==r||e[7]!==l?(o=(0,E.jsx)(k.Separator,{ref:r,className:l,...a}),e[5]=a,e[6]=r,e[7]=l,e[8]=o):o=e[8],o});_e.displayName=k.Separator.displayName;var je=u.forwardRef((t,r)=>{let e=(0,j.c)(17),n,a,l,o,m;if(e[0]!==r||e[1]!==t){let{className:c,variant:f,inset:v,...y}=t;n=k.Item,a=r,e[7]!==c||e[8]!==v||e[9]!==f?(l=P(Ve({variant:f,inset:v}).replace(qe,"data-[disabled=false]:pointer-events-all data-[disabled=false]:opacity-100 data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50"),c),e[7]=c,e[8]=v,e[9]=f,e[10]=l):l=e[10],o=y,m=Pe.htmlEscape(y.value),e[0]=r,e[1]=t,e[2]=n,e[3]=a,e[4]=l,e[5]=o,e[6]=m}else n=e[2],a=e[3],l=e[4],o=e[5],m=e[6];let p;return e[11]!==n||e[12]!==a||e[13]!==l||e[14]!==o||e[15]!==m?(p=(0,E.jsx)(n,{ref:a,className:l,...o,value:m}),e[11]=n,e[12]=a,e[13]=l,e[14]=o,e[15]=m,e[16]=p):p=e[16],p});je.displayName=k.Item.displayName;var bt=Oe;export{Ie as a,_e as c,Ae as i,bt as l,gt as n,je as o,Re as r,Ce as s,ie as t,Ee as u};
1
+ import{s as fe}from"./chunk-LvLJmgfZ.js";import{t as De}from"./react-BGmjiNul.js";import{G as Pe}from"./cells-CmJW_FeD.js";import{t as $e}from"./compiler-runtime-DeeZ7FnK.js";import{n as V}from"./useEventListener-COkmyg1v.js";import{t as Le}from"./jsx-runtime-DN_bIXfG.js";import{t as P}from"./cn-C1rgT0yh.js";import{lt as Fe}from"./input-Bkl2Yfmh.js";import{f as $}from"./Combination-D1TsGrBC.js";import{c as Ke,n as Oe,o as Ve,t as qe}from"./menu-items-9PZrU2e0.js";import{_ as ze,g as Be,h as Ge,p as He}from"./alert-dialog-jcHA5geR.js";import{n as Ue,t as Te}from"./dialog-CF5DtF1E.js";import{t as A}from"./dist-Dg7UO_Vw.js";var pe=1,We=.9,Je=.8,Qe=.17,ee=.1,te=.999,Xe=.9999,Ye=.99,Ze=/[\\\/_+.#"@\[\(\{&]/,et=/[\\\/_+.#"@\[\(\{&]/g,tt=/[\s-]/,ve=/[\s-]/g;function re(t,r,e,n,a,l,o){if(l===r.length)return a===t.length?pe:Ye;var m=`${a},${l}`;if(o[m]!==void 0)return o[m];for(var p=n.charAt(l),c=e.indexOf(p,a),f=0,v,y,x,I;c>=0;)v=re(t,r,e,n,c+1,l+1,o),v>f&&(c===a?v*=pe:Ze.test(t.charAt(c-1))?(v*=Je,x=t.slice(a,c-1).match(et),x&&a>0&&(v*=te**+x.length)):tt.test(t.charAt(c-1))?(v*=We,I=t.slice(a,c-1).match(ve),I&&a>0&&(v*=te**+I.length)):(v*=Qe,a>0&&(v*=te**+(c-a))),t.charAt(c)!==r.charAt(l)&&(v*=Xe)),(v<ee&&e.charAt(c-1)===n.charAt(l+1)||n.charAt(l+1)===n.charAt(l)&&e.charAt(c-1)!==n.charAt(l))&&(y=re(t,r,e,n,c+1,l+2,o),y*ee>v&&(v=y*ee)),v>f&&(f=v),c=e.indexOf(p,c+1);return o[m]=f,f}function he(t){return t.toLowerCase().replace(ve," ")}function rt(t,r,e){return t=e&&e.length>0?`${t+" "+e.join(" ")}`:t,re(t,r,he(t),he(r),0,0,{})}var u=fe(De(),1),q='[cmdk-group=""]',ae='[cmdk-group-items=""]',at='[cmdk-group-heading=""]',ge='[cmdk-item=""]',be=`${ge}:not([aria-disabled="true"])`,ne="cmdk-item-select",L="data-value",nt=(t,r,e)=>rt(t,r,e),we=u.createContext(void 0),z=()=>u.useContext(we),ye=u.createContext(void 0),le=()=>u.useContext(ye),xe=u.createContext(void 0),ke=u.forwardRef((t,r)=>{let e=F(()=>({search:"",value:t.value??t.defaultValue??"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),n=F(()=>new Set),a=F(()=>new Map),l=F(()=>new Map),o=F(()=>new Set),m=Se(t),{label:p,children:c,value:f,onValueChange:v,filter:y,shouldFilter:x,loop:I,disablePointerSelection:Me=!1,vimBindings:H=!0,...B}=t,U=$(),T=$(),K=$(),b=u.useRef(null),N=pt();M(()=>{if(f!==void 0){let i=f.trim();e.current.value=i,S.emit()}},[f]),M(()=>{N(6,ue)},[]);let S=u.useMemo(()=>({subscribe:i=>(o.current.add(i),()=>o.current.delete(i)),snapshot:()=>e.current,setState:(i,d,h)=>{var R;var s,g,w;if(!Object.is(e.current[i],d)){if(e.current[i]=d,i==="search")X(),J(),N(1,Q);else if(i==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let C=document.getElementById(K);C?C.focus():(s=document.getElementById(U))==null||s.focus()}if(N(7,()=>{var C;e.current.selectedItemId=(C=D())==null?void 0:C.id,S.emit()}),h||N(5,ue),((R=m.current)==null?void 0:R.value)!==void 0){let C=d??"";(w=(g=m.current).onValueChange)==null||w.call(g,C);return}}S.emit()}},emit:()=>{o.current.forEach(i=>i())}}),[]),W=u.useMemo(()=>({value:(i,d,h)=>{var s;d!==((s=l.current.get(i))==null?void 0:s.value)&&(l.current.set(i,{value:d,keywords:h}),e.current.filtered.items.set(i,oe(d,h)),N(2,()=>{J(),S.emit()}))},item:(i,d)=>(n.current.add(i),d&&(a.current.has(d)?a.current.get(d).add(i):a.current.set(d,new Set([i]))),N(3,()=>{X(),J(),e.current.value||Q(),S.emit()}),()=>{l.current.delete(i),n.current.delete(i),e.current.filtered.items.delete(i);let h=D();N(4,()=>{X(),(h==null?void 0:h.getAttribute("id"))===i&&Q(),S.emit()})}),group:i=>(a.current.has(i)||a.current.set(i,new Set),()=>{l.current.delete(i),a.current.delete(i)}),filter:()=>m.current.shouldFilter,label:p||t["aria-label"],getDisablePointerSelection:()=>m.current.disablePointerSelection,listId:U,inputId:K,labelId:T,listInnerRef:b}),[]);function oe(i,d){var s;let h=((s=m.current)==null?void 0:s.filter)??nt;return i?h(i,e.current.search,d):0}function J(){if(!e.current.search||m.current.shouldFilter===!1)return;let i=e.current.filtered.items,d=[];e.current.filtered.groups.forEach(s=>{let g=a.current.get(s),w=0;g.forEach(R=>{let C=i.get(R);w=Math.max(C,w)}),d.push([s,w])});let h=b.current;O().sort((s,g)=>{let w=s.getAttribute("id"),R=g.getAttribute("id");return(i.get(R)??0)-(i.get(w)??0)}).forEach(s=>{let g=s.closest(ae);g?g.appendChild(s.parentElement===g?s:s.closest(`${ae} > *`)):h.appendChild(s.parentElement===h?s:s.closest(`${ae} > *`))}),d.sort((s,g)=>g[1]-s[1]).forEach(s=>{var w;let g=(w=b.current)==null?void 0:w.querySelector(`${q}[${L}="${encodeURIComponent(s[0])}"]`);g==null||g.parentElement.appendChild(g)})}function Q(){var d;let i=(d=O().find(h=>h.getAttribute("aria-disabled")!=="true"))==null?void 0:d.getAttribute(L);S.setState("value",i||void 0)}function X(){var d,h;if(!e.current.search||m.current.shouldFilter===!1){e.current.filtered.count=n.current.size;return}e.current.filtered.groups=new Set;let i=0;for(let s of n.current){let g=oe(((d=l.current.get(s))==null?void 0:d.value)??"",((h=l.current.get(s))==null?void 0:h.keywords)??[]);e.current.filtered.items.set(s,g),g>0&&i++}for(let[s,g]of a.current)for(let w of g)if(e.current.filtered.items.get(w)>0){e.current.filtered.groups.add(s);break}e.current.filtered.count=i}function ue(){var h,s;var i;let d=D();d&&(((h=d.parentElement)==null?void 0:h.firstChild)===d&&((i=(s=d.closest(q))==null?void 0:s.querySelector(at))==null||i.scrollIntoView({block:"nearest"})),d.scrollIntoView({block:"nearest"}))}function D(){var i;return(i=b.current)==null?void 0:i.querySelector(`${ge}[aria-selected="true"]`)}function O(){var i;return Array.from(((i=b.current)==null?void 0:i.querySelectorAll(be))||[])}function Y(i){let d=O()[i];d&&S.setState("value",d.getAttribute(L))}function Z(i){var d;let h=D(),s=O(),g=s.findIndex(R=>R===h),w=s[g+i];(d=m.current)!=null&&d.loop&&(w=g+i<0?s[s.length-1]:g+i===s.length?s[0]:s[g+i]),w&&S.setState("value",w.getAttribute(L))}function ce(i){var s;let d=(s=D())==null?void 0:s.closest(q),h;for(;d&&!h;)d=i>0?mt(d,q):ft(d,q),h=d==null?void 0:d.querySelector(be);h?S.setState("value",h.getAttribute(L)):Z(i)}let se=()=>Y(O().length-1),de=i=>{i.preventDefault(),i.metaKey?se():i.altKey?ce(1):Z(1)},me=i=>{i.preventDefault(),i.metaKey?Y(0):i.altKey?ce(-1):Z(-1)};return u.createElement(A.div,{ref:r,tabIndex:-1,...B,"cmdk-root":"",onKeyDown:i=>{var d;(d=B.onKeyDown)==null||d.call(B,i);let h=i.nativeEvent.isComposing||i.keyCode===229;if(!(i.defaultPrevented||h))switch(i.key){case"n":case"j":H&&i.ctrlKey&&de(i);break;case"ArrowDown":de(i);break;case"p":case"k":H&&i.ctrlKey&&me(i);break;case"ArrowUp":me(i);break;case"Home":i.preventDefault(),Y(0);break;case"End":i.preventDefault(),se();break;case"Enter":{i.preventDefault();let s=D();if(s){let g=new Event(ne);s.dispatchEvent(g)}}}}},u.createElement("label",{"cmdk-label":"",htmlFor:W.inputId,id:W.labelId,style:ht},p),G(t,i=>u.createElement(ye.Provider,{value:S},u.createElement(we.Provider,{value:W},i))))}),lt=u.forwardRef((t,r)=>{var K;let e=$(),n=u.useRef(null),a=u.useContext(xe),l=z(),o=Se(t),m=((K=o.current)==null?void 0:K.forceMount)??(a==null?void 0:a.forceMount);M(()=>{if(!m)return l.item(e,a==null?void 0:a.id)},[m]);let p=Ne(e,n,[t.value,t.children,n],t.keywords),c=le(),f=_(b=>b.value&&b.value===p.current),v=_(b=>m||l.filter()===!1?!0:b.search?b.filtered.items.get(e)>0:!0);u.useEffect(()=>{let b=n.current;if(!(!b||t.disabled))return b.addEventListener(ne,y),()=>b.removeEventListener(ne,y)},[v,t.onSelect,t.disabled]);function y(){var b,N;x(),(N=(b=o.current).onSelect)==null||N.call(b,p.current)}function x(){c.setState("value",p.current,!0)}if(!v)return null;let{disabled:I,value:Me,onSelect:H,forceMount:B,keywords:U,...T}=t;return u.createElement(A.div,{ref:V(n,r),...T,id:e,"cmdk-item":"",role:"option","aria-disabled":!!I,"aria-selected":!!f,"data-disabled":!!I,"data-selected":!!f,onPointerMove:I||l.getDisablePointerSelection()?void 0:x,onClick:I?void 0:y},t.children)}),it=u.forwardRef((t,r)=>{let{heading:e,children:n,forceMount:a,...l}=t,o=$(),m=u.useRef(null),p=u.useRef(null),c=$(),f=z(),v=_(x=>a||f.filter()===!1?!0:x.search?x.filtered.groups.has(o):!0);M(()=>f.group(o),[]),Ne(o,m,[t.value,t.heading,p]);let y=u.useMemo(()=>({id:o,forceMount:a}),[a]);return u.createElement(A.div,{ref:V(m,r),...l,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},e&&u.createElement("div",{ref:p,"cmdk-group-heading":"","aria-hidden":!0,id:c},e),G(t,x=>u.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":e?c:void 0},u.createElement(xe.Provider,{value:y},x))))}),ot=u.forwardRef((t,r)=>{let{alwaysRender:e,...n}=t,a=u.useRef(null),l=_(o=>!o.search);return!e&&!l?null:u.createElement(A.div,{ref:V(a,r),...n,"cmdk-separator":"",role:"separator"})}),ut=u.forwardRef((t,r)=>{let{onValueChange:e,...n}=t,a=t.value!=null,l=le(),o=_(c=>c.search),m=_(c=>c.selectedItemId),p=z();return u.useEffect(()=>{t.value!=null&&l.setState("search",t.value)},[t.value]),u.createElement(A.input,{ref:r,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":p.listId,"aria-labelledby":p.labelId,"aria-activedescendant":m,id:p.inputId,type:"text",value:a?t.value:o,onChange:c=>{a||l.setState("search",c.target.value),e==null||e(c.target.value)}})}),Ee=u.forwardRef((t,r)=>{let{children:e,label:n="Suggestions",...a}=t,l=u.useRef(null),o=u.useRef(null),m=_(c=>c.selectedItemId),p=z();return u.useEffect(()=>{if(o.current&&l.current){let c=o.current,f=l.current,v,y=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let x=c.offsetHeight;f.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return y.observe(c),()=>{cancelAnimationFrame(v),y.unobserve(c)}}},[]),u.createElement(A.div,{ref:V(l,r),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":m,"aria-label":n,id:p.listId},G(t,c=>u.createElement("div",{ref:V(o,p.listInnerRef),"cmdk-list-sizer":""},c)))}),ct=u.forwardRef((t,r)=>{let{open:e,onOpenChange:n,overlayClassName:a,contentClassName:l,container:o,...m}=t;return u.createElement(ze,{open:e,onOpenChange:n},u.createElement(Be,{container:o},u.createElement(Ge,{"cmdk-overlay":"",className:a}),u.createElement(He,{"aria-label":t.label,"cmdk-dialog":"",className:l},u.createElement(ke,{ref:r,...m}))))}),st=u.forwardRef((t,r)=>_(e=>e.filtered.count===0)?u.createElement(A.div,{ref:r,...t,"cmdk-empty":"",role:"presentation"}):null),dt=u.forwardRef((t,r)=>{let{progress:e,children:n,label:a="Loading...",...l}=t;return u.createElement(A.div,{ref:r,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},G(t,o=>u.createElement("div",{"aria-hidden":!0},o)))}),k=Object.assign(ke,{List:Ee,Item:lt,Input:ut,Group:it,Separator:ot,Dialog:ct,Empty:st,Loading:dt});function mt(t,r){let e=t.nextElementSibling;for(;e;){if(e.matches(r))return e;e=e.nextElementSibling}}function ft(t,r){let e=t.previousElementSibling;for(;e;){if(e.matches(r))return e;e=e.previousElementSibling}}function Se(t){let r=u.useRef(t);return M(()=>{r.current=t}),r}var M=typeof window>"u"?u.useEffect:u.useLayoutEffect;function F(t){let r=u.useRef();return r.current===void 0&&(r.current=t()),r}function _(t){let r=le(),e=()=>t(r.snapshot());return u.useSyncExternalStore(r.subscribe,e,e)}function Ne(t,r,e,n=[]){let a=u.useRef(),l=z();return M(()=>{var o;let m=(()=>{var c;for(let f of e){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(c=f.current.textContent)==null?void 0:c.trim():a.current}})(),p=n.map(c=>c.trim());l.value(t,m,p),(o=r.current)==null||o.setAttribute(L,m),a.current=m}),a}var pt=()=>{let[t,r]=u.useState(),e=F(()=>new Map);return M(()=>{e.current.forEach(n=>n()),e.current=new Map},[t]),(n,a)=>{e.current.set(n,a),r({})}};function vt(t){let r=t.type;return typeof r=="function"?r(t.props):"render"in r?r.render(t.props):t}function G({asChild:t,children:r},e){return t&&u.isValidElement(r)?u.cloneElement(vt(r),{ref:r.ref},e(r.props.children)):e(r)}var ht={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},j=$e(),E=fe(Le(),1),ie=u.forwardRef((t,r)=>{let e=(0,j.c)(9),n,a;e[0]===t?(n=e[1],a=e[2]):({className:n,...a}=t,e[0]=t,e[1]=n,e[2]=a);let l;e[3]===n?l=e[4]:(l=P("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",n),e[3]=n,e[4]=l);let o;return e[5]!==a||e[6]!==r||e[7]!==l?(o=(0,E.jsx)(k,{ref:r,className:l,...a}),e[5]=a,e[6]=r,e[7]=l,e[8]=o):o=e[8],o});ie.displayName=k.displayName;var gt=t=>{let r=(0,j.c)(8),e,n;r[0]===t?(e=r[1],n=r[2]):({children:e,...n}=t,r[0]=t,r[1]=e,r[2]=n);let a;r[3]===e?a=r[4]:(a=(0,E.jsx)(Ue,{className:"overflow-hidden p-0 shadow-2xl",usePortal:!0,children:(0,E.jsx)(ie,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})}),r[3]=e,r[4]=a);let l;return r[5]!==n||r[6]!==a?(l=(0,E.jsx)(Te,{...n,children:a}),r[5]=n,r[6]=a,r[7]=l):l=r[7],l},Ie=u.forwardRef((t,r)=>{let e=(0,j.c)(19),n,a,l,o;e[0]===t?(n=e[1],a=e[2],l=e[3],o=e[4]):({className:n,icon:a,rootClassName:o,...l}=t,e[0]=t,e[1]=n,e[2]=a,e[3]=l,e[4]=o);let m;e[5]===o?m=e[6]:(m=P("flex items-center border-b px-3",o),e[5]=o,e[6]=m);let p;e[7]===a?p=e[8]:(p=a===null?null:(0,E.jsx)(Fe,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e[7]=a,e[8]=p);let c;e[9]===n?c=e[10]:(c=P("placeholder:text-foreground-muted flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",n),e[9]=n,e[10]=c);let f;e[11]!==l||e[12]!==r||e[13]!==c?(f=(0,E.jsx)(k.Input,{ref:r,className:c,...l}),e[11]=l,e[12]=r,e[13]=c,e[14]=f):f=e[14];let v;return e[15]!==m||e[16]!==p||e[17]!==f?(v=(0,E.jsxs)("div",{className:m,"cmdk-input-wrapper":"",children:[p,f]}),e[15]=m,e[16]=p,e[17]=f,e[18]=v):v=e[18],v});Ie.displayName=k.Input.displayName;var Ce=u.forwardRef((t,r)=>{let e=(0,j.c)(9),n,a;e[0]===t?(n=e[1],a=e[2]):({className:n,...a}=t,e[0]=t,e[1]=n,e[2]=a);let l;e[3]===n?l=e[4]:(l=P("max-h-[300px] overflow-y-auto overflow-x-hidden",n),e[3]=n,e[4]=l);let o;return e[5]!==a||e[6]!==r||e[7]!==l?(o=(0,E.jsx)(k.List,{ref:r,className:l,...a}),e[5]=a,e[6]=r,e[7]=l,e[8]=o):o=e[8],o});Ce.displayName=k.List.displayName;var Re=u.forwardRef((t,r)=>{let e=(0,j.c)(3),n;return e[0]!==t||e[1]!==r?(n=(0,E.jsx)(k.Empty,{ref:r,className:"py-6 text-center text-sm",...t}),e[0]=t,e[1]=r,e[2]=n):n=e[2],n});Re.displayName=k.Empty.displayName;var Ae=u.forwardRef((t,r)=>{let e=(0,j.c)(9),n,a;e[0]===t?(n=e[1],a=e[2]):({className:n,...a}=t,e[0]=t,e[1]=n,e[2]=a);let l;e[3]===n?l=e[4]:(l=P("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",n),e[3]=n,e[4]=l);let o;return e[5]!==a||e[6]!==r||e[7]!==l?(o=(0,E.jsx)(k.Group,{ref:r,className:l,...a}),e[5]=a,e[6]=r,e[7]=l,e[8]=o):o=e[8],o});Ae.displayName=k.Group.displayName;var _e=u.forwardRef((t,r)=>{let e=(0,j.c)(9),n,a;e[0]===t?(n=e[1],a=e[2]):({className:n,...a}=t,e[0]=t,e[1]=n,e[2]=a);let l;e[3]===n?l=e[4]:(l=Ke({className:n}),e[3]=n,e[4]=l);let o;return e[5]!==a||e[6]!==r||e[7]!==l?(o=(0,E.jsx)(k.Separator,{ref:r,className:l,...a}),e[5]=a,e[6]=r,e[7]=l,e[8]=o):o=e[8],o});_e.displayName=k.Separator.displayName;var je=u.forwardRef((t,r)=>{let e=(0,j.c)(17),n,a,l,o,m;if(e[0]!==r||e[1]!==t){let{className:c,variant:f,inset:v,...y}=t;n=k.Item,a=r,e[7]!==c||e[8]!==v||e[9]!==f?(l=P(Ve({variant:f,inset:v}).replace(qe,"data-[disabled=false]:pointer-events-all data-[disabled=false]:opacity-100 data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50"),c),e[7]=c,e[8]=v,e[9]=f,e[10]=l):l=e[10],o=y,m=Pe.htmlEscape(y.value),e[0]=r,e[1]=t,e[2]=n,e[3]=a,e[4]=l,e[5]=o,e[6]=m}else n=e[2],a=e[3],l=e[4],o=e[5],m=e[6];let p;return e[11]!==n||e[12]!==a||e[13]!==l||e[14]!==o||e[15]!==m?(p=(0,E.jsx)(n,{ref:a,className:l,...o,value:m}),e[11]=n,e[12]=a,e[13]=l,e[14]=o,e[15]=m,e[16]=p):p=e[16],p});je.displayName=k.Item.displayName;var bt=Oe;export{Ie as a,_e as c,Ae as i,bt as l,gt as n,je as o,Re as r,Ce as s,ie as t,Ee as u};
@@ -1 +1 @@
1
- import{s as z}from"./chunk-LvLJmgfZ.js";import{l as X,u as B}from"./useEvent-DlWF5OMa.js";import{t as Y}from"./react-BGmjiNul.js";import{Wr as Z}from"./cells-CmJW_FeD.js";import"./react-dom-C9fstfnp.js";import{t as U}from"./compiler-runtime-DeeZ7FnK.js";import"./tooltip-CrRUCOBw.js";import{a as ee,i as le,l as te}from"./hotkeys-uKX61F1_.js";import{p as ie,v as ae,y as oe}from"./utils-Czt8B2GX.js";import"./config-CENq_7Pd.js";import{i as re}from"./switch-C5jvDmuG.js";import{t as ne}from"./useEventListener-COkmyg1v.js";import{t as pe}from"./jsx-runtime-DN_bIXfG.js";import"./dist-CAcX026F.js";import"./JsonOutput-DlwRx3jE.js";import"./cjs-Bj40p_Np.js";import"./main-CwSdzVhm.js";import"./useNonce-EAuSVK-5.js";import{r as se}from"./requests-C0HaHO6a.js";import"./layout-CBI2c778.js";import"./download-C_slsU-7.js";import{t as de}from"./useCellActionButton-DmwKwroH.js";import"./markdown-renderer-DjqhqmES.js";import{i as me,t as he}from"./useNotebookActions-DaM9w6Je.js";import{f as ce}from"./state-BphSR6sx.js";import"./dist-HGZzCB0y.js";import"./dist-CVj-_Iiz.js";import"./dist-BVf1IY4_.js";import"./dist-Cq_4nPfh.js";import"./dist-RKnr9SNh.js";import"./Combination-D1TsGrBC.js";import"./dates-CdsE1R40.js";import"./popover-DtnzNVk-.js";import"./share-CXQVxivL.js";import"./vega-loader.browser-C8wT63Va.js";import"./defaultLocale-BLUna9fQ.js";import"./defaultLocale-DzliDDTm.js";import"./purify.es-N-2faAGj.js";import{a as ye,c as fe,i as L,l as W,n as ue,o as J,r as be,s as ge}from"./command-B1zRJT1a.js";import"./chunk-OGVTOU66-DQphfHw1.js";import"./katex-dFZM4X_7.js";import"./marked.esm-BZNXs5FA.js";import"./es-BJsT6vfZ.js";import{r as ke}from"./focus-KGgBDCvb.js";import{t as K}from"./renderShortcut-BzTDKVab.js";import"./esm-D2_Kx6xF.js";import"./name-cell-input-Dc5Oz84d.js";import"./multi-icon-6ulZXArq.js";import"./dist-cDyKKhtR.js";import"./dist-CsayQVA2.js";import"./dist-CebZ69Am.js";import"./dist-gkLBSkCp.js";import"./dist-ClsPkyB_.js";import"./dist-BZPaM2NB.js";import"./dist-CAJqQUSI.js";import"./dist-CGGpiWda.js";import"./dist-BsIAU6bk.js";import"./esm-BranOiPJ.js";var Ce=U(),je=z(Y(),1);function xe(e,l){let t=(0,Ce.c)(11),n;t[0]===l?n=t[1]:(n=new Z(l),t[0]=l,t[1]=n);let p=n,r;t[2]!==e||t[3]!==p?(r=()=>p.get(e),t[2]=e,t[3]=p,t[4]=r):r=t[4];let[m,g]=(0,je.useState)(r),i;t[5]!==e||t[6]!==p?(i=k=>{g(k),p.set(e,k)},t[5]=e,t[6]=p,t[7]=i):i=t[7];let f=i,h;return t[8]!==f||t[9]!==m?(h=[m,f],t[8]=f,t[9]=m,t[10]=h):h=t[10],h}var ve=U(),we=3;function Se(){let e=(0,ve.c)(7),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0];let[t,n]=xe("marimo:commands",l),p;e[1]!==t||e[2]!==n?(p=m=>{n(_e([m,...t]).slice(0,we))},e[1]=t,e[2]=n,e[3]=p):p=e[3];let r;return e[4]!==t||e[5]!==p?(r={recentCommands:t,addRecentCommand:p},e[4]=t,e[5]=p,e[6]=r):r=e[6],r}function _e(e){return[...new Set(e)]}function Q(e){return e.dropdown!==void 0}function V(e,l=""){return e.flatMap(t=>t.label?Q(t)?V(t.dropdown,`${l+t.label} > `):{...t,label:l+t.label}:[])}var He=U();function Ae(){let e=(0,He.c)(75),[l,t]=oe(),[n,p]=ae(),{saveAppConfig:r,saveUserConfig:m}=se(),g;e[0]!==m||e[1]!==t?(g=async d=>{await m({config:d}).then(()=>{t(c=>({...c,...d}))})},e[0]=m,e[1]=t,e[2]=g):g=e[2];let i=g,f;e[3]!==r||e[4]!==p?(f=async d=>{await r({config:d}).then(()=>{p(d)})},e[3]=r,e[4]=p,e[5]=f):f=e[5];let h=f,k;if(e[6]!==n||e[7]!==l.completion||e[8]!==l.display||e[9]!==l.keymap||e[10]!==h||e[11]!==i){let d;e[13]===n?d=e[14]:(d=T=>T!==n.width,e[13]=n,e[14]=d);let c;e[15]!==n||e[16]!==h?(c=T=>({label:`App config > Set width=${T}`,handle:()=>{h({...n,width:T})}}),e[15]=n,e[16]=h,e[17]=c):c=e[17];let H;e[18]!==l.display||e[19]!==i?(H={label:"Config > Set theme: dark",handle:()=>{i({display:{...l.display,theme:"dark"}})}},e[18]=l.display,e[19]=i,e[20]=H):H=e[20];let C;e[21]!==l.display||e[22]!==i?(C={label:"Config > Set theme: light",handle:()=>{i({display:{...l.display,theme:"light"}})}},e[21]=l.display,e[22]=i,e[23]=C):C=e[23];let A;e[24]!==l.display||e[25]!==i?(A={label:"Config > Set theme: system",handle:()=>{i({display:{...l.display,theme:"system"}})}},e[24]=l.display,e[25]=i,e[26]=A):A=e[26];let R=l.keymap.preset==="vim",M;e[27]!==l.keymap||e[28]!==i?(M=()=>{i({keymap:{...l.keymap,preset:"vim"}})},e[27]=l.keymap,e[28]=i,e[29]=M):M=e[29];let N;e[30]!==R||e[31]!==M?(N={label:"Config > Switch keymap to VIM",hidden:R,handle:M},e[30]=R,e[31]=M,e[32]=N):N=e[32];let D=l.keymap.preset==="default",j;e[33]!==l.keymap||e[34]!==i?(j=()=>{i({keymap:{...l.keymap,preset:"default"}})},e[33]=l.keymap,e[34]=i,e[35]=j):j=e[35];let u;e[36]!==D||e[37]!==j?(u={label:"Config > Switch keymap to default (current: VIM)",hidden:D,handle:j},e[36]=D,e[37]=j,e[38]=u):u=e[38];let x;e[39]!==l.completion||e[40]!==i?(x=()=>{i({completion:{...l.completion,copilot:!1}})},e[39]=l.completion,e[40]=i,e[41]=x):x=e[41];let v=l.completion.copilot!=="github",$;e[42]!==x||e[43]!==v?($={label:"Config > Disable GitHub Copilot",handle:x,hidden:v},e[42]=x,e[43]=v,e[44]=$):$=e[44];let w;e[45]!==l.completion||e[46]!==i?(w=()=>{i({completion:{...l.completion,copilot:"github"}})},e[45]=l.completion,e[46]=i,e[47]=w):w=e[47];let P=l.completion.copilot==="github",q;e[48]!==w||e[49]!==P?(q={label:"Config > Enable GitHub Copilot",handle:w,hidden:P},e[48]=w,e[49]=P,e[50]=q):q=e[50];let G=!l.display.reference_highlighting,S;e[51]!==l.display||e[52]!==i?(S=()=>{i({display:{...l.display,reference_highlighting:!1}})},e[51]=l.display,e[52]=i,e[53]=S):S=e[53];let b;e[54]!==G||e[55]!==S?(b={label:"Config > Disable reference highlighting",hidden:G,handle:S},e[54]=G,e[55]=S,e[56]=b):b=e[56];let y;e[57]!==l.display||e[58]!==i?(y=()=>{i({display:{...l.display,reference_highlighting:!0}})},e[57]=l.display,e[58]=i,e[59]=y):y=e[59];let E;e[60]!==l.display.reference_highlighting||e[61]!==y?(E={label:"Config > Enable reference highlighting",hidden:l.display.reference_highlighting,handle:y},e[60]=l.display.reference_highlighting,e[61]=y,e[62]=E):E=e[62];let o=l.display.cell_output==="above",a;e[63]!==l.display||e[64]!==i?(a=()=>{i({display:{...l.display,cell_output:"above"}})},e[63]=l.display,e[64]=i,e[65]=a):a=e[65];let F;e[66]!==o||e[67]!==a?(F={label:"Config > Set cell output area: above",hidden:o,handle:a},e[66]=o,e[67]=a,e[68]=F):F=e[68];let _=l.display.cell_output==="below",I;e[69]!==l.display||e[70]!==i?(I=()=>{i({display:{...l.display,cell_output:"below"}})},e[69]=l.display,e[70]=i,e[71]=I):I=e[71];let O;e[72]!==_||e[73]!==I?(O={label:"Config > Set cell output area: below",hidden:_,handle:I},e[72]=_,e[73]=I,e[74]=O):O=e[74],k=[...ce().filter(d).map(c),H,C,A,N,u,$,q,b,E,F,O].filter(Me),e[6]=n,e[7]=l.completion,e[8]=l.display,e[9]=l.keymap,e[10]=h,e[11]=i,e[12]=k}else k=e[12];return k}function Me(e){return!e.hidden}var Ne=U(),s=z(pe(),1),De=()=>{let e=(0,Ne.c)(37),[l,t]=X(me),n=re(),p=B(ke),r=B(ie),m;e[0]===p?m=e[1]:(m={cell:p},e[0]=p,e[1]=m);let g=de(m).flat();g=V(g);let i=Ae(),f=he();f=[...V(f),...V(i)];let h=f.filter(Ee),k=ee.keyBy(h,Fe),{recentCommands:d,addRecentCommand:c}=Se(),H;e[2]===d?H=e[3]:(H=new Set(d),e[2]=d,e[3]=H);let C=H,A;e[4]!==r||e[5]!==t?(A=o=>{te(r.getHotkey("global.commandPalette").key)(o)&&(o.preventDefault(),t(Ie))},e[4]=r,e[5]=t,e[6]=A):A=e[6],ne(document,"keydown",A);let R;e[7]!==c||e[8]!==r||e[9]!==n||e[10]!==t?(R=(o,a)=>{let F=n[o];if(!F)return null;let _=r.getHotkey(o);return(0,s.jsxs)(J,{disabled:a.disabled,onSelect:()=>{c(o),t(!1),requestAnimationFrame(()=>{F()})},value:_.name,children:[(0,s.jsxs)("span",{children:[_.name,a.tooltip&&(0,s.jsx)("span",{className:"ml-2",children:a.tooltip})]}),(0,s.jsx)(W,{children:(0,s.jsx)(K,{shortcut:_.key})})]},o)},e[7]=c,e[8]=r,e[9]=n,e[10]=t,e[11]=R):R=e[11];let M=R,N;e[12]!==c||e[13]!==r||e[14]!==t?(N=o=>{let{label:a,handle:F,props:_,hotkey:I}=o,O=_===void 0?{}:_;return(0,s.jsxs)(J,{disabled:O.disabled,onSelect:()=>{c(a),t(!1),requestAnimationFrame(()=>{F()})},value:a,children:[(0,s.jsxs)("span",{children:[a,O.tooltip&&(0,s.jsxs)("span",{className:"ml-2",children:["(",O.tooltip,")"]})]}),I&&(0,s.jsx)(W,{children:(0,s.jsx)(K,{shortcut:r.getHotkey(I).key})})]},a)},e[12]=c,e[13]=r,e[14]=t,e[15]=N):N=e[15];let D=N,j=ue,u;e[16]===Symbol.for("react.memo_cache_sentinel")?(u=(0,s.jsx)(ye,{placeholder:"Type to search..."}),e[16]=u):u=e[16];let x=ge,v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=(0,s.jsx)(be,{children:"No results found."}),e[17]=v):v=e[17];let $=d.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L,{heading:"Recently Used",children:d.map(o=>{let a=k[o];return le(o)?M(o,{disabled:a==null?void 0:a.disabled,tooltip:a==null?void 0:a.tooltip}):a&&!Q(a)?D({label:a.label,handle:a.handleHeadless||a.handle,props:{disabled:a.disabled,tooltip:a.tooltip}}):null})}),(0,s.jsx)(fe,{})]}),w=L,P=r.iterate().map(o=>{if(C.has(o))return null;let a=k[o];return M(o,{disabled:a==null?void 0:a.disabled,tooltip:a==null?void 0:a.tooltip})}),q=h.map(o=>C.has(o.label)?null:D({label:o.label,handle:o.handleHeadless||o.handle,props:{disabled:o.disabled,tooltip:o.tooltip}})),G;e[18]!==C||e[19]!==D?(G=o=>C.has(o.label)?null:D({label:`Cell > ${o.label}`,handle:o.handleHeadless||o.handle,props:{disabled:o.disabled,tooltip:o.tooltip}}),e[18]=C,e[19]=D,e[20]=G):G=e[20];let S=g.map(G),b;e[21]!==w||e[22]!==q||e[23]!==S||e[24]!==P?(b=(0,s.jsxs)(w,{heading:"Commands",children:[P,q,S]}),e[21]=w,e[22]=q,e[23]=S,e[24]=P,e[25]=b):b=e[25];let y;e[26]!==x||e[27]!==b||e[28]!==v||e[29]!==$?(y=(0,s.jsxs)(x,{children:[v,$,b]}),e[26]=x,e[27]=b,e[28]=v,e[29]=$,e[30]=y):y=e[30];let E;return e[31]!==j||e[32]!==l||e[33]!==t||e[34]!==y||e[35]!==u?(E=(0,s.jsxs)(j,{open:l,onOpenChange:t,children:[u,y]}),e[31]=j,e[32]=l,e[33]=t,e[34]=y,e[35]=u,e[36]=E):E=e[36],E};function Ee(e){return!e.hotkey}function Fe(e){return e.label}function Ie(e){return!e}export{De as default};
1
+ import{s as z}from"./chunk-LvLJmgfZ.js";import{l as X,u as B}from"./useEvent-DlWF5OMa.js";import{t as Y}from"./react-BGmjiNul.js";import{Wr as Z}from"./cells-CmJW_FeD.js";import"./react-dom-C9fstfnp.js";import{t as U}from"./compiler-runtime-DeeZ7FnK.js";import"./tooltip-CrRUCOBw.js";import{a as ee,i as le,l as te}from"./hotkeys-uKX61F1_.js";import{p as ie,v as ae,y as oe}from"./utils-Czt8B2GX.js";import"./config-CENq_7Pd.js";import{i as re}from"./switch-C5jvDmuG.js";import{t as ne}from"./useEventListener-COkmyg1v.js";import{t as pe}from"./jsx-runtime-DN_bIXfG.js";import"./dist-CAcX026F.js";import"./JsonOutput-BH-e3_eJ.js";import"./cjs-Bj40p_Np.js";import"./main-CwSdzVhm.js";import"./useNonce-EAuSVK-5.js";import{r as se}from"./requests-C0HaHO6a.js";import"./layout-1zPURdGQ.js";import"./download-B-eaoq3_.js";import{t as de}from"./useCellActionButton-_rAkF3dZ.js";import"./markdown-renderer-DOBdrH5a.js";import{i as me,t as he}from"./useNotebookActions-DoSNkrRT.js";import{f as ce}from"./state-Cls1gyOv.js";import"./dist-HGZzCB0y.js";import"./dist-CVj-_Iiz.js";import"./dist-BVf1IY4_.js";import"./dist-Cq_4nPfh.js";import"./dist-RKnr9SNh.js";import"./Combination-D1TsGrBC.js";import"./dates-CdsE1R40.js";import"./popover-QmFlvleQ.js";import"./share-CXQVxivL.js";import"./vega-loader.browser-C8wT63Va.js";import"./defaultLocale-BLUna9fQ.js";import"./defaultLocale-DzliDDTm.js";import"./purify.es-N-2faAGj.js";import{a as ye,c as fe,i as L,l as W,n as ue,o as J,r as be,s as ge}from"./command-DB9hJj4r.js";import"./chunk-OGVTOU66-DYMZbUe5.js";import"./katex-AwOI3EvM.js";import"./marked.esm-CHnOtnr3.js";import"./es-Bu_hpQqq.js";import{r as ke}from"./focus-BGH9Dxb1.js";import{t as K}from"./renderShortcut-DQ1H8wv8.js";import"./esm-B3JckBtM.js";import"./name-cell-input-BfTcj-5o.js";import"./multi-icon-BOYRpNB_.js";import"./dist-cDyKKhtR.js";import"./dist-CsayQVA2.js";import"./dist-CebZ69Am.js";import"./dist-gkLBSkCp.js";import"./dist-ClsPkyB_.js";import"./dist-BZPaM2NB.js";import"./dist-CAJqQUSI.js";import"./dist-CGGpiWda.js";import"./dist-BsIAU6bk.js";import"./esm-BranOiPJ.js";var Ce=U(),je=z(Y(),1);function xe(e,l){let t=(0,Ce.c)(11),n;t[0]===l?n=t[1]:(n=new Z(l),t[0]=l,t[1]=n);let p=n,r;t[2]!==e||t[3]!==p?(r=()=>p.get(e),t[2]=e,t[3]=p,t[4]=r):r=t[4];let[m,g]=(0,je.useState)(r),i;t[5]!==e||t[6]!==p?(i=k=>{g(k),p.set(e,k)},t[5]=e,t[6]=p,t[7]=i):i=t[7];let f=i,h;return t[8]!==f||t[9]!==m?(h=[m,f],t[8]=f,t[9]=m,t[10]=h):h=t[10],h}var ve=U(),we=3;function Se(){let e=(0,ve.c)(7),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0];let[t,n]=xe("marimo:commands",l),p;e[1]!==t||e[2]!==n?(p=m=>{n(_e([m,...t]).slice(0,we))},e[1]=t,e[2]=n,e[3]=p):p=e[3];let r;return e[4]!==t||e[5]!==p?(r={recentCommands:t,addRecentCommand:p},e[4]=t,e[5]=p,e[6]=r):r=e[6],r}function _e(e){return[...new Set(e)]}function Q(e){return e.dropdown!==void 0}function V(e,l=""){return e.flatMap(t=>t.label?Q(t)?V(t.dropdown,`${l+t.label} > `):{...t,label:l+t.label}:[])}var He=U();function Ae(){let e=(0,He.c)(75),[l,t]=oe(),[n,p]=ae(),{saveAppConfig:r,saveUserConfig:m}=se(),g;e[0]!==m||e[1]!==t?(g=async d=>{await m({config:d}).then(()=>{t(c=>({...c,...d}))})},e[0]=m,e[1]=t,e[2]=g):g=e[2];let i=g,f;e[3]!==r||e[4]!==p?(f=async d=>{await r({config:d}).then(()=>{p(d)})},e[3]=r,e[4]=p,e[5]=f):f=e[5];let h=f,k;if(e[6]!==n||e[7]!==l.completion||e[8]!==l.display||e[9]!==l.keymap||e[10]!==h||e[11]!==i){let d;e[13]===n?d=e[14]:(d=T=>T!==n.width,e[13]=n,e[14]=d);let c;e[15]!==n||e[16]!==h?(c=T=>({label:`App config > Set width=${T}`,handle:()=>{h({...n,width:T})}}),e[15]=n,e[16]=h,e[17]=c):c=e[17];let H;e[18]!==l.display||e[19]!==i?(H={label:"Config > Set theme: dark",handle:()=>{i({display:{...l.display,theme:"dark"}})}},e[18]=l.display,e[19]=i,e[20]=H):H=e[20];let C;e[21]!==l.display||e[22]!==i?(C={label:"Config > Set theme: light",handle:()=>{i({display:{...l.display,theme:"light"}})}},e[21]=l.display,e[22]=i,e[23]=C):C=e[23];let A;e[24]!==l.display||e[25]!==i?(A={label:"Config > Set theme: system",handle:()=>{i({display:{...l.display,theme:"system"}})}},e[24]=l.display,e[25]=i,e[26]=A):A=e[26];let R=l.keymap.preset==="vim",M;e[27]!==l.keymap||e[28]!==i?(M=()=>{i({keymap:{...l.keymap,preset:"vim"}})},e[27]=l.keymap,e[28]=i,e[29]=M):M=e[29];let N;e[30]!==R||e[31]!==M?(N={label:"Config > Switch keymap to VIM",hidden:R,handle:M},e[30]=R,e[31]=M,e[32]=N):N=e[32];let D=l.keymap.preset==="default",j;e[33]!==l.keymap||e[34]!==i?(j=()=>{i({keymap:{...l.keymap,preset:"default"}})},e[33]=l.keymap,e[34]=i,e[35]=j):j=e[35];let u;e[36]!==D||e[37]!==j?(u={label:"Config > Switch keymap to default (current: VIM)",hidden:D,handle:j},e[36]=D,e[37]=j,e[38]=u):u=e[38];let x;e[39]!==l.completion||e[40]!==i?(x=()=>{i({completion:{...l.completion,copilot:!1}})},e[39]=l.completion,e[40]=i,e[41]=x):x=e[41];let v=l.completion.copilot!=="github",$;e[42]!==x||e[43]!==v?($={label:"Config > Disable GitHub Copilot",handle:x,hidden:v},e[42]=x,e[43]=v,e[44]=$):$=e[44];let w;e[45]!==l.completion||e[46]!==i?(w=()=>{i({completion:{...l.completion,copilot:"github"}})},e[45]=l.completion,e[46]=i,e[47]=w):w=e[47];let P=l.completion.copilot==="github",q;e[48]!==w||e[49]!==P?(q={label:"Config > Enable GitHub Copilot",handle:w,hidden:P},e[48]=w,e[49]=P,e[50]=q):q=e[50];let G=!l.display.reference_highlighting,S;e[51]!==l.display||e[52]!==i?(S=()=>{i({display:{...l.display,reference_highlighting:!1}})},e[51]=l.display,e[52]=i,e[53]=S):S=e[53];let b;e[54]!==G||e[55]!==S?(b={label:"Config > Disable reference highlighting",hidden:G,handle:S},e[54]=G,e[55]=S,e[56]=b):b=e[56];let y;e[57]!==l.display||e[58]!==i?(y=()=>{i({display:{...l.display,reference_highlighting:!0}})},e[57]=l.display,e[58]=i,e[59]=y):y=e[59];let E;e[60]!==l.display.reference_highlighting||e[61]!==y?(E={label:"Config > Enable reference highlighting",hidden:l.display.reference_highlighting,handle:y},e[60]=l.display.reference_highlighting,e[61]=y,e[62]=E):E=e[62];let o=l.display.cell_output==="above",a;e[63]!==l.display||e[64]!==i?(a=()=>{i({display:{...l.display,cell_output:"above"}})},e[63]=l.display,e[64]=i,e[65]=a):a=e[65];let F;e[66]!==o||e[67]!==a?(F={label:"Config > Set cell output area: above",hidden:o,handle:a},e[66]=o,e[67]=a,e[68]=F):F=e[68];let _=l.display.cell_output==="below",I;e[69]!==l.display||e[70]!==i?(I=()=>{i({display:{...l.display,cell_output:"below"}})},e[69]=l.display,e[70]=i,e[71]=I):I=e[71];let O;e[72]!==_||e[73]!==I?(O={label:"Config > Set cell output area: below",hidden:_,handle:I},e[72]=_,e[73]=I,e[74]=O):O=e[74],k=[...ce().filter(d).map(c),H,C,A,N,u,$,q,b,E,F,O].filter(Me),e[6]=n,e[7]=l.completion,e[8]=l.display,e[9]=l.keymap,e[10]=h,e[11]=i,e[12]=k}else k=e[12];return k}function Me(e){return!e.hidden}var Ne=U(),s=z(pe(),1),De=()=>{let e=(0,Ne.c)(37),[l,t]=X(me),n=re(),p=B(ke),r=B(ie),m;e[0]===p?m=e[1]:(m={cell:p},e[0]=p,e[1]=m);let g=de(m).flat();g=V(g);let i=Ae(),f=he();f=[...V(f),...V(i)];let h=f.filter(Ee),k=ee.keyBy(h,Fe),{recentCommands:d,addRecentCommand:c}=Se(),H;e[2]===d?H=e[3]:(H=new Set(d),e[2]=d,e[3]=H);let C=H,A;e[4]!==r||e[5]!==t?(A=o=>{te(r.getHotkey("global.commandPalette").key)(o)&&(o.preventDefault(),t(Ie))},e[4]=r,e[5]=t,e[6]=A):A=e[6],ne(document,"keydown",A);let R;e[7]!==c||e[8]!==r||e[9]!==n||e[10]!==t?(R=(o,a)=>{let F=n[o];if(!F)return null;let _=r.getHotkey(o);return(0,s.jsxs)(J,{disabled:a.disabled,onSelect:()=>{c(o),t(!1),requestAnimationFrame(()=>{F()})},value:_.name,children:[(0,s.jsxs)("span",{children:[_.name,a.tooltip&&(0,s.jsx)("span",{className:"ml-2",children:a.tooltip})]}),(0,s.jsx)(W,{children:(0,s.jsx)(K,{shortcut:_.key})})]},o)},e[7]=c,e[8]=r,e[9]=n,e[10]=t,e[11]=R):R=e[11];let M=R,N;e[12]!==c||e[13]!==r||e[14]!==t?(N=o=>{let{label:a,handle:F,props:_,hotkey:I}=o,O=_===void 0?{}:_;return(0,s.jsxs)(J,{disabled:O.disabled,onSelect:()=>{c(a),t(!1),requestAnimationFrame(()=>{F()})},value:a,children:[(0,s.jsxs)("span",{children:[a,O.tooltip&&(0,s.jsxs)("span",{className:"ml-2",children:["(",O.tooltip,")"]})]}),I&&(0,s.jsx)(W,{children:(0,s.jsx)(K,{shortcut:r.getHotkey(I).key})})]},a)},e[12]=c,e[13]=r,e[14]=t,e[15]=N):N=e[15];let D=N,j=ue,u;e[16]===Symbol.for("react.memo_cache_sentinel")?(u=(0,s.jsx)(ye,{placeholder:"Type to search..."}),e[16]=u):u=e[16];let x=ge,v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=(0,s.jsx)(be,{children:"No results found."}),e[17]=v):v=e[17];let $=d.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L,{heading:"Recently Used",children:d.map(o=>{let a=k[o];return le(o)?M(o,{disabled:a==null?void 0:a.disabled,tooltip:a==null?void 0:a.tooltip}):a&&!Q(a)?D({label:a.label,handle:a.handleHeadless||a.handle,props:{disabled:a.disabled,tooltip:a.tooltip}}):null})}),(0,s.jsx)(fe,{})]}),w=L,P=r.iterate().map(o=>{if(C.has(o))return null;let a=k[o];return M(o,{disabled:a==null?void 0:a.disabled,tooltip:a==null?void 0:a.tooltip})}),q=h.map(o=>C.has(o.label)?null:D({label:o.label,handle:o.handleHeadless||o.handle,props:{disabled:o.disabled,tooltip:o.tooltip}})),G;e[18]!==C||e[19]!==D?(G=o=>C.has(o.label)?null:D({label:`Cell > ${o.label}`,handle:o.handleHeadless||o.handle,props:{disabled:o.disabled,tooltip:o.tooltip}}),e[18]=C,e[19]=D,e[20]=G):G=e[20];let S=g.map(G),b;e[21]!==w||e[22]!==q||e[23]!==S||e[24]!==P?(b=(0,s.jsxs)(w,{heading:"Commands",children:[P,q,S]}),e[21]=w,e[22]=q,e[23]=S,e[24]=P,e[25]=b):b=e[25];let y;e[26]!==x||e[27]!==b||e[28]!==v||e[29]!==$?(y=(0,s.jsxs)(x,{children:[v,$,b]}),e[26]=x,e[27]=b,e[28]=v,e[29]=$,e[30]=y):y=e[30];let E;return e[31]!==j||e[32]!==l||e[33]!==t||e[34]!==y||e[35]!==u?(E=(0,s.jsxs)(j,{open:l,onOpenChange:t,children:[u,y]}),e[31]=j,e[32]=l,e[33]=t,e[34]=y,e[35]=u,e[36]=E):E=e[36],E};function Ee(e){return!e.hotkey}function Fe(e){return e.label}function Ie(e){return!e}export{De as default};