@luzmo/analytics-components-kit 1.0.8 → 1.0.9-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (702) hide show
  1. package/README.md +6 -4
  2. package/components/ad-hoc-slot-content-BwcFfXCV.cjs +20 -0
  3. package/components/ad-hoc-slot-content-hSlT62VS.js +29 -0
  4. package/components/ai-chat/ai-chat-events.d.ts +139 -0
  5. package/components/ai-chat/ai-chat-request.d.ts +25 -0
  6. package/components/ai-chat/ai-chat.d.ts +347 -0
  7. package/components/ai-chat/ai-prompt-types.d.ts +133 -0
  8. package/components/ai-chat/empty-state/ai-chat-empty-state.d.ts +46 -0
  9. package/components/ai-chat/empty-state/index.d.ts +8 -0
  10. package/components/ai-chat/empty-state/types.d.ts +14 -0
  11. package/components/ai-chat/helpers/agent-config.d.ts +12 -0
  12. package/components/ai-chat/helpers/elicitation-template.d.ts +18 -0
  13. package/components/ai-chat/index.cjs +20 -0
  14. package/components/ai-chat/index.d.ts +24 -0
  15. package/components/ai-chat/index.js +29 -0
  16. package/components/ai-chat/session/ai-chat-session-controller.d.ts +60 -0
  17. package/components/ai-chat/session/ai-chat-session-types.d.ts +119 -0
  18. package/components/ai-chat/session/ai-chat-session.d.ts +119 -0
  19. package/components/ai-chat/session/index.d.ts +2 -0
  20. package/components/ai-chat/stream/chunk-extractors.d.ts +29 -0
  21. package/components/ai-chat/stream/index.d.ts +53 -0
  22. package/components/ai-chat/stream/progress.d.ts +3 -0
  23. package/components/ai-chat/stream/registry.d.ts +6 -0
  24. package/components/ai-chat/stream/stream-processor.d.ts +2 -0
  25. package/components/ai-chat/stream/transport.d.ts +26 -0
  26. package/components/ai-chat/stream/types.d.ts +59 -0
  27. package/components/ai-chat/types.d.ts +24 -0
  28. package/components/ai-chat-1OlRpimu.cjs +337 -0
  29. package/components/ai-chat-PesGGOLP.js +4350 -0
  30. package/components/ai-interaction-textarea/ai-interaction-textarea.d.ts +232 -0
  31. package/components/ai-interaction-textarea/index.cjs +20 -0
  32. package/components/ai-interaction-textarea/index.d.ts +10 -0
  33. package/components/ai-interaction-textarea/index.js +28 -0
  34. package/components/ai-interaction-textarea/types.d.ts +12 -0
  35. package/components/ai-interaction-textarea-BXKG2elT.js +820 -0
  36. package/components/ai-interaction-textarea-CmFGJzbb.cjs +99 -0
  37. package/components/{area-chart-options.config-B94ERc30.js → area-chart-options.config-DJnPr93H.js} +1 -1
  38. package/components/{area-chart-positioning.config-Cbeon6-x.cjs → area-chart-positioning.config-C37nmNfP.cjs} +1 -1
  39. package/components/{area-chart-positioning.config-BJK4Q4NL.js → area-chart-positioning.config-CF8Z7PuX.js} +1 -1
  40. package/components/{area-chart-slots.config-DdPO34_g.js → area-chart-slots.config-ClE-gYVY.js} +1 -1
  41. package/components/{bar-chart-options.config-B1C3t6uk.js → bar-chart-options.config-D1x5WPbL.js} +1 -1
  42. package/components/{bar-chart-positioning.config-BnhZQUtb.cjs → bar-chart-positioning.config-C4ii41mE.cjs} +1 -1
  43. package/components/{bar-chart-positioning.config-B4UuSMIW.js → bar-chart-positioning.config-vuRQZsYr.js} +1 -1
  44. package/components/{bar-chart-slots.config-BnbZRLIr.js → bar-chart-slots.config-rMFwFprg.js} +1 -1
  45. package/components/{base-IE9Qxmub.js → base-8L8Jt2vi.js} +3 -2
  46. package/components/base-K-bf6_7X.cjs +20 -0
  47. package/components/{box-plot-options.config-sBfVzPTw.js → box-plot-options.config-CooBIc6N.js} +1 -1
  48. package/components/{box-plot-positioning.config-DsldCFWm.cjs → box-plot-positioning.config-D2LpbgQ_.cjs} +1 -1
  49. package/components/{box-plot-positioning.config-CYk5koLu.js → box-plot-positioning.config-DMIsI9yU.js} +1 -1
  50. package/components/{box-plot-slots.config-D6F2R2dw.js → box-plot-slots.config-DS2UIfRF.js} +1 -1
  51. package/components/{bubble-chart-options.config-DKeBF5A0.js → bubble-chart-options.config-B6aLA_1d.js} +1 -1
  52. package/components/{bubble-chart-positioning.config-BV-T_2cy.cjs → bubble-chart-positioning.config-Btak-zwN.cjs} +1 -1
  53. package/components/{bubble-chart-positioning.config-BSDmuPwq.js → bubble-chart-positioning.config-jYu0Q0Mc.js} +1 -1
  54. package/components/{bubble-chart-slots.config-BJdtdpS0.js → bubble-chart-slots.config-2qy2RqaU.js} +1 -1
  55. package/components/{bullet-chart-options.config-DdTBWTAF.js → bullet-chart-options.config-CBmbmhzI.js} +1 -1
  56. package/components/{bullet-chart-positioning.config-B3GeLs8o.js → bullet-chart-positioning.config-BWHfPPyA.js} +1 -1
  57. package/components/{bullet-chart-positioning.config-BoqQq4g_.cjs → bullet-chart-positioning.config-CwoRVgNS.cjs} +1 -1
  58. package/components/{bullet-chart-slots.config-NeUTKgYI.js → bullet-chart-slots.config-BaMmwIH0.js} +1 -1
  59. package/components/{choropleth-map-options.config-nOE0NWaD.js → choropleth-map-options.config-DWWydGJ3.js} +1 -1
  60. package/components/{choropleth-map-positioning.config-C_I3wf8H.cjs → choropleth-map-positioning.config-DttV0Dk_.cjs} +1 -1
  61. package/components/{choropleth-map-positioning.config-6OT0sZa5.js → choropleth-map-positioning.config-KtxcLW7E.js} +1 -1
  62. package/components/{choropleth-map-slots.config-BbBwTeuw.js → choropleth-map-slots.config-DqOi1kCn.js} +1 -1
  63. package/components/{circle-pack-chart-options.config-CgE8vGP9.js → circle-pack-chart-options.config-D2RCikyA.js} +1 -1
  64. package/components/{circle-pack-chart-positioning.config-D7Oke8BW.cjs → circle-pack-chart-positioning.config-N-rZvQjR.cjs} +1 -1
  65. package/components/{circle-pack-chart-positioning.config-BuuhKB85.js → circle-pack-chart-positioning.config-QBO-pwDr.js} +1 -1
  66. package/components/{circle-pack-chart-slots.config-CJFjalBn.js → circle-pack-chart-slots.config-B7_1p86m.js} +1 -1
  67. package/components/{circular-gauge-options.config-DtNYelhq.js → circular-gauge-options.config-syWQJHKT.js} +1 -1
  68. package/components/{circular-gauge-positioning.config-B_IJzIBn.cjs → circular-gauge-positioning.config-Cf1zuLXa.cjs} +1 -1
  69. package/components/{circular-gauge-positioning.config-DlWvKl0e.js → circular-gauge-positioning.config-DKGmEpFj.js} +1 -1
  70. package/components/{circular-gauge-slots.config-DAKsa5Hq.js → circular-gauge-slots.config-BxjCP1ao.js} +1 -1
  71. package/components/{column-chart-options.config-C2GGiHOI.js → column-chart-options.config-B2LIl9lL.js} +1 -1
  72. package/components/{column-chart-positioning.config-DngsP5So.cjs → column-chart-positioning.config-DcErS56C.cjs} +1 -1
  73. package/components/{column-chart-positioning.config-BLacEiY5.js → column-chart-positioning.config-LkQSNtSH.js} +1 -1
  74. package/components/{column-chart-slots.config-Bpr-WaCi.js → column-chart-slots.config-D6MBTcj4.js} +1 -1
  75. package/components/{combination-chart-options.config-LddX4naq.js → combination-chart-options.config-0ATFph8S.js} +1 -1
  76. package/components/{combination-chart-positioning.config-DxnmzV6O.js → combination-chart-positioning.config-7iAEpO7h.js} +1 -1
  77. package/components/{combination-chart-positioning.config-BVV0Bq-d.cjs → combination-chart-positioning.config-Dzi93oAp.cjs} +1 -1
  78. package/components/{combination-chart-slots.config-u-QLoQQ-.js → combination-chart-slots.config-dYT9lz8M.js} +1 -1
  79. package/components/{conditional-number-options.config-qdX9T4zu.js → conditional-number-options.config-Bv2xONtI.js} +1 -1
  80. package/components/{conditional-number-positioning.config-YEo_yFBu.js → conditional-number-positioning.config-Bse6AKPP.js} +1 -1
  81. package/components/{conditional-number-positioning.config-DfitbPT6.cjs → conditional-number-positioning.config-CTy0zLXu.cjs} +1 -1
  82. package/components/{conditional-number-slots.config-CiLUXRSe.js → conditional-number-slots.config-DtYkqtN8.js} +1 -1
  83. package/components/convert-datasets-to-data-fields-B13rl1an.cjs +20 -0
  84. package/components/convert-datasets-to-data-fields-PmQzeVLG.js +68 -0
  85. package/components/create-lazy-loader-BO_oTDF5.js +31 -0
  86. package/components/create-lazy-loader-DYPgQh0L.cjs +20 -0
  87. package/components/data-field/index.cjs +1 -1
  88. package/components/data-field/index.d.ts +1 -0
  89. package/components/data-field/index.js +1 -1
  90. package/components/data-field-CSm9APdz.js +121 -0
  91. package/components/data-field-D2y4cv9j.cjs +54 -0
  92. package/components/data-field-level/data-field-level.d.ts +40 -0
  93. package/components/data-field-level/helpers/generate-preview.d.ts +9 -0
  94. package/components/data-field-level/index.cjs +20 -0
  95. package/components/data-field-level/index.d.ts +8 -0
  96. package/components/data-field-level/index.js +28 -0
  97. package/components/{data-field-yTJb-R63.js → data-field-level-B0aj8c5M.js} +48 -142
  98. package/components/data-field-level-Llx0Y9m-.cjs +55 -0
  99. package/components/data-field-panel/index.cjs +1 -1
  100. package/components/data-field-panel/index.d.ts +1 -0
  101. package/components/data-field-panel/index.js +1 -1
  102. package/components/{data-field-panel-BWBr1Fog.js → data-field-panel-DpBWJnes.js} +6 -5
  103. package/components/data-field-panel-Dv60lRUC.cjs +87 -0
  104. package/components/data-fields-select/data-fields-select.d.ts +137 -0
  105. package/components/data-fields-select/index.cjs +20 -0
  106. package/components/data-fields-select/index.d.ts +9 -0
  107. package/components/data-fields-select/index.js +28 -0
  108. package/components/data-fields-select/types.d.ts +4 -0
  109. package/components/{data-fields-select-Bb1HXwlO.js → data-fields-select-69TDpIG_.js} +17 -7
  110. package/components/data-fields-select-BHa8THub.cjs +43 -0
  111. package/components/dataset-icon/dataset-icon.d.ts +45 -0
  112. package/components/dataset-icon/index.cjs +20 -0
  113. package/components/dataset-icon/index.d.ts +8 -0
  114. package/components/dataset-icon/index.js +28 -0
  115. package/components/dataset-icon/types.d.ts +11 -0
  116. package/components/dataset-icon-BAV0S4sZ.cjs +64 -0
  117. package/components/dataset-icon-CWT5Ju8w.js +125 -0
  118. package/components/dataset-selector-list/dataset-selector-list.d.ts +106 -0
  119. package/components/dataset-selector-list/index.cjs +20 -0
  120. package/components/dataset-selector-list/index.d.ts +8 -0
  121. package/components/dataset-selector-list/index.js +28 -0
  122. package/components/dataset-selector-list-D5lBv2sD.cjs +75 -0
  123. package/components/dataset-selector-list-DTMXvqfO.js +323 -0
  124. package/components/dataset-selector-row/dataset-selector-row.d.ts +135 -0
  125. package/components/dataset-selector-row/index.cjs +20 -0
  126. package/components/dataset-selector-row/index.d.ts +9 -0
  127. package/components/dataset-selector-row/index.js +28 -0
  128. package/components/dataset-selector-row-gHWsZlrC.cjs +102 -0
  129. package/components/dataset-selector-row-kiHtzZcP.js +427 -0
  130. package/components/{date-comparison-filter-options.config-BSzzAJPM.js → date-comparison-filter-options.config-DgLx-m3L.js} +1 -1
  131. package/components/{date-comparison-filter-slots.config-Cvze969w.js → date-comparison-filter-slots.config-BKZ13uzB.js} +1 -1
  132. package/components/{date-filter-options.config-C6VvDjd8.js → date-filter-options.config-Cbiy0QKd.js} +1 -1
  133. package/components/{date-filter-slots.config-Y8hmQh0S.js → date-filter-slots.config-SzWky1y7.js} +1 -1
  134. package/components/{de-C5CMIy08.js → de-BhKtDR6p.js} +34 -0
  135. package/components/de-DXFLsh4N.cjs +20 -0
  136. package/components/decompose-numeric-format-DGJua3rU.cjs +20 -0
  137. package/components/decompose-numeric-format-DS0j2wa1.js +36 -0
  138. package/components/decorate-DCJt-2rt.cjs +20 -0
  139. package/components/{localized-mixin-DhiGdPMj.js → decorate-DyMgX_Uh.js} +2 -26
  140. package/components/default-acceptable-data-field-types-DFOFWWnT.js +53 -0
  141. package/components/default-acceptable-data-field-types-fPsz64ka.cjs +20 -0
  142. package/components/display-settings/display-settings.d.ts +117 -0
  143. package/components/display-settings/index.cjs +20 -0
  144. package/components/display-settings/index.d.ts +8 -0
  145. package/components/display-settings/index.js +28 -0
  146. package/components/display-settings/types.d.ts +9 -0
  147. package/components/display-settings-DKuvd62j.js +315 -0
  148. package/components/display-settings-DPqTRJ7E.cjs +142 -0
  149. package/components/display-settings-binning/display-settings-binning.d.ts +32 -0
  150. package/components/display-settings-binning/index.cjs +20 -0
  151. package/components/display-settings-binning/index.d.ts +8 -0
  152. package/components/display-settings-binning/index.js +28 -0
  153. package/components/{display-settings-binning-CaE87u3h.js → display-settings-binning-BkCNSkgf.js} +17 -19
  154. package/components/{display-settings-binning-CjvB12ds.cjs → display-settings-binning-DZKo_tBm.cjs} +2 -2
  155. package/components/display-settings-datetime/display-settings-datetime.d.ts +86 -0
  156. package/components/display-settings-datetime/index.cjs +20 -0
  157. package/components/display-settings-datetime/index.d.ts +8 -0
  158. package/components/display-settings-datetime/index.js +28 -0
  159. package/components/{display-settings-datetime-5rq55OAn.js → display-settings-datetime-BTgriFcv.js} +69 -71
  160. package/components/display-settings-datetime-DD7Oh-2T.cjs +217 -0
  161. package/components/display-settings-grand-totals/display-settings-grand-totals.d.ts +29 -0
  162. package/components/display-settings-grand-totals/index.cjs +20 -0
  163. package/components/display-settings-grand-totals/index.d.ts +8 -0
  164. package/components/display-settings-grand-totals/index.js +28 -0
  165. package/components/display-settings-grand-totals-BsIZg67h.cjs +44 -0
  166. package/components/{display-settings-grand-totals-DnKvI34n.js → display-settings-grand-totals-DH7AoyQY.js} +17 -19
  167. package/components/display-settings-numeric/display-settings-numeric.d.ts +82 -0
  168. package/components/display-settings-numeric/helpers/constants.d.ts +19 -0
  169. package/components/display-settings-numeric/index.cjs +20 -0
  170. package/components/display-settings-numeric/index.d.ts +8 -0
  171. package/components/display-settings-numeric/index.js +28 -0
  172. package/components/{display-settings-numeric-B8MCRz-V.js → display-settings-numeric-CkFpOoWU.js} +79 -81
  173. package/components/display-settings-numeric-CsmrnEp2.cjs +190 -0
  174. package/components/display-settings-period-over-period/display-settings-period-over-period.d.ts +76 -0
  175. package/components/display-settings-period-over-period/helpers/constants.d.ts +44 -0
  176. package/components/display-settings-period-over-period/index.cjs +20 -0
  177. package/components/display-settings-period-over-period/index.d.ts +8 -0
  178. package/components/display-settings-period-over-period/index.js +28 -0
  179. package/components/{display-settings-period-over-period-W3dPK8LR.js → display-settings-period-over-period-CdI5wuL_.js} +85 -86
  180. package/components/display-settings-period-over-period-Co37HcSm.cjs +227 -0
  181. package/components/{donut-chart-options.config-CPHgS1Wi.js → donut-chart-options.config-C8wpZzyJ.js} +1 -1
  182. package/components/{donut-chart-positioning.config-QOZXaJmt.cjs → donut-chart-positioning.config-BThtaJEt.cjs} +1 -1
  183. package/components/{donut-chart-positioning.config-fGckMun2.js → donut-chart-positioning.config-D2uG_Irk.js} +1 -1
  184. package/components/{donut-chart-slots.config-DilGk7ju.js → donut-chart-slots.config-fGqtoKZi.js} +1 -1
  185. package/components/{dropdown-filter-options.config-DFJKns3l.js → dropdown-filter-options.config-DkiapYtc.js} +1 -1
  186. package/components/{dropdown-filter-slots.config-7heZtoEY.js → dropdown-filter-slots.config-DPcT6v-9.js} +1 -1
  187. package/components/{en-DdS5q1ZT.js → en-CcLhGxIh.js} +1 -1
  188. package/components/{en-GB-Cn0xDC0K.js → en-GB-DzkdeUQh.js} +1 -1
  189. package/components/en-GB-uxY5qmIM.cjs +20 -0
  190. package/components/{en-US-DdS5q1ZT.js → en-US-CcLhGxIh.js} +1 -1
  191. package/components/{en-CSPDwq2y.cjs → en-US-q_Ruzags.cjs} +1 -1
  192. package/components/{en-US-CSPDwq2y.cjs → en-q_Ruzags.cjs} +1 -1
  193. package/components/es-DK-49nGv.cjs +20 -0
  194. package/components/{es-BCur0-77.js → es-DUENN-m1.js} +34 -0
  195. package/components/{evolution-number-options.config-DT7iGQA8.js → evolution-number-options.config-Ca9ABNVM.js} +1 -1
  196. package/components/{evolution-number-positioning.config-CVIysE4H.js → evolution-number-positioning.config-BtjobZqK.js} +1 -1
  197. package/components/{evolution-number-positioning.config-B7lBArog.cjs → evolution-number-positioning.config-DtYiv9oB.cjs} +1 -1
  198. package/components/{evolution-number-slots.config-noZzIHkT.js → evolution-number-slots.config-CKawNqUS.js} +1 -1
  199. package/components/filter-expression-picker/filter-expression-picker.d.ts +77 -0
  200. package/components/filter-expression-picker/index.cjs +20 -0
  201. package/components/filter-expression-picker/index.d.ts +7 -0
  202. package/components/filter-expression-picker/index.js +28 -0
  203. package/components/filter-expression-picker-C4kE_Thd.js +433 -0
  204. package/components/filter-expression-picker-CU-OfSmI.cjs +40 -0
  205. package/components/filter-item/filter-item.d.ts +142 -0
  206. package/components/filter-item/index.cjs +20 -0
  207. package/components/filter-item/index.d.ts +8 -0
  208. package/components/filter-item/index.js +28 -0
  209. package/components/filter-item-Be6Z7NMz.js +792 -0
  210. package/components/filter-item-CxPrwF-R.cjs +111 -0
  211. package/components/filter-parameter-picker/filter-parameter-picker.d.ts +91 -0
  212. package/components/filter-parameter-picker/filter-parameter-picker.helpers.d.ts +8 -0
  213. package/components/filter-parameter-picker/index.cjs +20 -0
  214. package/components/filter-parameter-picker/index.d.ts +9 -0
  215. package/components/filter-parameter-picker/index.js +28 -0
  216. package/components/filter-parameter-picker/types.d.ts +4 -0
  217. package/components/filter-parameter-picker-Ba8bvoPZ.js +371 -0
  218. package/components/filter-parameter-picker-BtJLCUbT.cjs +124 -0
  219. package/components/filter-value-picker/filter-value-picker.d.ts +72 -0
  220. package/components/filter-value-picker/index.cjs +20 -0
  221. package/components/filter-value-picker/index.d.ts +7 -0
  222. package/components/filter-value-picker/index.js +28 -0
  223. package/components/filter-value-picker-DD206JZl.js +169 -0
  224. package/components/filter-value-picker-Dpua1vcJ.cjs +69 -0
  225. package/components/filter-value-picker-datetime/filter-value-picker-datetime.d.ts +51 -0
  226. package/components/filter-value-picker-datetime/index.cjs +20 -0
  227. package/components/filter-value-picker-datetime/index.d.ts +7 -0
  228. package/components/filter-value-picker-datetime/index.js +28 -0
  229. package/components/filter-value-picker-datetime-Bj0YaPtB.js +159 -0
  230. package/components/filter-value-picker-datetime-DWgI83nJ.cjs +51 -0
  231. package/components/filter-value-picker-hierarchy/filter-value-picker-hierarchy.d.ts +105 -0
  232. package/components/filter-value-picker-hierarchy/index.cjs +20 -0
  233. package/components/filter-value-picker-hierarchy/index.d.ts +7 -0
  234. package/components/filter-value-picker-hierarchy/index.js +28 -0
  235. package/components/filter-value-picker-hierarchy-BEoqkQq0.cjs +54 -0
  236. package/components/filter-value-picker-hierarchy-ZMThNJYm.js +315 -0
  237. package/components/filter-value-picker-numeric/filter-value-picker-numeric.d.ts +89 -0
  238. package/components/filter-value-picker-numeric/index.cjs +20 -0
  239. package/components/filter-value-picker-numeric/index.d.ts +7 -0
  240. package/components/filter-value-picker-numeric/index.js +28 -0
  241. package/components/filter-value-picker-numeric-1Vxp_Vam.cjs +54 -0
  242. package/components/filter-value-picker-numeric-CVaDogFQ.js +236 -0
  243. package/components/filters/filters.d.ts +62 -2
  244. package/components/filters/index.cjs +1 -1
  245. package/components/filters/index.d.ts +2 -1
  246. package/components/filters/index.js +2 -2
  247. package/components/filters/types.d.ts +2 -0
  248. package/components/filters-Cnm0Kwk3.js +926 -0
  249. package/components/filters-Dtbt99BP.cjs +199 -0
  250. package/components/formatter-BeXmurVe.cjs +20 -0
  251. package/components/{period-over-period-condition.const-IOVIrgKJ.js → formatter-Cq5dFCyU.js} +44 -234
  252. package/components/formula/index.cjs +1 -1
  253. package/components/formula/index.js +1 -1
  254. package/components/{formula-CdAkO1za.js → formula-BE9bipho.js} +15 -14
  255. package/components/formula-DGMnKmnR.cjs +45 -0
  256. package/components/formula-codemirror/formula-codemirror.d.ts +79 -0
  257. package/components/formula-codemirror/index.d.ts +7 -0
  258. package/components/formula-codemirror/pills/formula-aggregation/formula-aggregation.d.ts +125 -0
  259. package/components/formula-codemirror/pills/formula-aggregation/index.d.ts +7 -0
  260. package/components/formula-codemirror/pills/formula-empty-argument-pill/formula-empty-argument-pill.d.ts +28 -0
  261. package/components/formula-codemirror/pills/formula-empty-argument-pill/index.d.ts +7 -0
  262. package/components/formula-codemirror/pills/formula-include-exclude-panel.d.ts +38 -0
  263. package/components/formula-codemirror-B14vsZXJ.cjs +215 -0
  264. package/components/{formula-codemirror-jVC8mjQ3.js → formula-codemirror-xfm0QtJN.js} +22 -20
  265. package/components/formula-display-store-8hohve9v.cjs +20 -0
  266. package/components/{formula-display-store-CLAt_fik.js → formula-display-store-JAaWuYNB.js} +239 -274
  267. package/components/formula-draggable-field/formula-draggable-field.d.ts +53 -0
  268. package/components/formula-draggable-field/index.d.ts +8 -0
  269. package/components/formula-draggable-field/types.d.ts +24 -0
  270. package/components/formula-editor/index.cjs +1 -1
  271. package/components/formula-editor/index.d.ts +1 -0
  272. package/components/formula-editor/index.js +4 -3
  273. package/components/formula-editor-CkW-JfyT.cjs +224 -0
  274. package/components/{formula-editor-Bd9F-xdZ.js → formula-editor-DN87mT8q.js} +147 -352
  275. package/components/formula-field/formula-field.d.ts +20 -0
  276. package/components/formula-field/index.cjs +20 -0
  277. package/components/formula-field/index.d.ts +7 -0
  278. package/components/formula-field/index.js +28 -0
  279. package/components/formula-field-B1EMJOfK.js +40 -0
  280. package/components/formula-field-CQYFSBHL.cjs +20 -0
  281. package/components/formula-input-base-BCQXmd1P.cjs +49 -0
  282. package/components/formula-input-base-HL0Fg74x.js +236 -0
  283. package/components/{fr-BnECl1nx.js → fr-CePmGBUH.js} +34 -0
  284. package/components/fr-uE3fb3kc.cjs +20 -0
  285. package/components/{funnel-chart-options.config-D21WdHBI.js → funnel-chart-options.config-CygQsQVD.js} +1 -1
  286. package/components/{funnel-chart-positioning.config-zEqgz9Wz.cjs → funnel-chart-positioning.config-DeLnAGGT.cjs} +1 -1
  287. package/components/{funnel-chart-positioning.config-BGi7ixet.js → funnel-chart-positioning.config-TVzSiV6I.js} +1 -1
  288. package/components/{funnel-chart-slots.config-BWszdEe8.js → funnel-chart-slots.config-CfnSH4Ay.js} +1 -1
  289. package/components/{get-css-variable-B8sJUuig.cjs → get-css-variable-CBXsAxR6.cjs} +1 -1
  290. package/components/{get-css-variable-r1spgqX0.js → get-css-variable-DYnldi15.js} +1 -1
  291. package/components/get-dataset-name-DLjeChNS.js +32 -0
  292. package/components/get-dataset-name-mGNEfkAv.cjs +20 -0
  293. package/components/groupings-CODDxpbZ.js +52 -0
  294. package/components/groupings-DKMq8DgS.cjs +20 -0
  295. package/components/{heat-map-options.config-DkuYkbWu.js → heat-map-options.config-X96sw-BV.js} +1 -1
  296. package/components/{heat-map-positioning.config-CK2DBngE.js → heat-map-positioning.config--wm9l7bB.js} +1 -1
  297. package/components/{heat-map-positioning.config-3dxU6qwG.cjs → heat-map-positioning.config-ddrgZXa9.cjs} +1 -1
  298. package/components/{heat-map-slots.config-Cwun49Qb.js → heat-map-slots.config-D2ypExJQ.js} +1 -1
  299. package/components/{heat-table-options.config-BJP1jVB8.js → heat-table-options.config-D6dA9J97.js} +1 -1
  300. package/components/{heat-table-positioning.config-C55D814C.js → heat-table-positioning.config-CIhhBEMg.js} +1 -1
  301. package/components/{heat-table-positioning.config-CbscS7w1.cjs → heat-table-positioning.config-qMDSRhZR.cjs} +1 -1
  302. package/components/{heat-table-slots.config-nGB_B2mh.js → heat-table-slots.config-B1iOn6ay.js} +1 -1
  303. package/components/{hexbin-map-options.config-Bqp3u2bH.js → hexbin-map-options.config-FK9DrXGD.js} +1 -1
  304. package/components/{hexbin-map-positioning.config-CHecaD9p.cjs → hexbin-map-positioning.config-E_BpcIFy.cjs} +1 -1
  305. package/components/{hexbin-map-positioning.config-9nnyZGzx.js → hexbin-map-positioning.config-S7VYUwVD.js} +1 -1
  306. package/components/{hexbin-map-slots.config-BK-ftozd.js → hexbin-map-slots.config-CC1xZINm.js} +1 -1
  307. package/components/{image-options.config-Cz55iN7J.js → image-options.config-DxF0RSUF.js} +1 -1
  308. package/components/{image-slots.config-kvHutBFK.js → image-slots.config-Ba8NXeCH.js} +1 -1
  309. package/components/index.cjs +1 -840
  310. package/components/index.js +67 -6783
  311. package/components/interactive-viz-item/helpers/chart-helpers.d.ts +7 -0
  312. package/components/interactive-viz-item/index.cjs +20 -0
  313. package/components/interactive-viz-item/index.d.ts +10 -0
  314. package/components/interactive-viz-item/index.js +28 -0
  315. package/components/interactive-viz-item/interactive-viz-item.d.ts +97 -0
  316. package/components/interactive-viz-item/load-config-panel.d.ts +2 -0
  317. package/components/interactive-viz-item/types.d.ts +117 -0
  318. package/components/interactive-viz-item--kqitfEZ.cjs +249 -0
  319. package/components/interactive-viz-item-cdShBZQA.js +722 -0
  320. package/components/item-grid/index.cjs +1 -1
  321. package/components/item-grid/index.js +1 -1
  322. package/components/{item-grid-C2ZvM04g.cjs → item-grid-BfhqMuQA.cjs} +22 -22
  323. package/components/{item-grid-D4xYhMOD.js → item-grid-xCM8AqRH.js} +25 -24
  324. package/components/item-menu/item-list/item-list.d.ts +37 -0
  325. package/components/item-option/index.cjs +1 -1
  326. package/components/item-option/index.js +1 -1
  327. package/components/item-option-B5FraAiv.cjs +269 -0
  328. package/components/{item-option-28BU_oaD.js → item-option-DaAlj_OB.js} +53 -53
  329. package/components/item-option-action-button-group/index.cjs +1 -1
  330. package/components/item-option-action-button-group/index.js +1 -1
  331. package/components/{item-option-action-button-group-D_g6aoYd.js → item-option-action-button-group-4w8ub3cT.js} +2 -2
  332. package/components/item-option-action-button-group-DHu8VjCy.cjs +53 -0
  333. package/components/item-option-base/item-option-base.d.ts +23 -0
  334. package/components/item-option-base-4Bwn-3Fc.cjs +56 -0
  335. package/components/{item-option-base-CxQhI83u.js → item-option-base-BxQUwXzg.js} +2 -2
  336. package/components/item-option-color-palette-picker/index.cjs +1 -1
  337. package/components/item-option-color-palette-picker/index.js +1 -1
  338. package/components/{item-option-color-palette-picker-CRDFqhWx.js → item-option-color-palette-picker-D5nO-Bqb.js} +2 -2
  339. package/components/item-option-color-palette-picker-DrhHKaAK.cjs +40 -0
  340. package/components/item-option-color-picker/index.cjs +1 -1
  341. package/components/item-option-color-picker/index.js +1 -1
  342. package/components/{item-option-color-picker-BJgpBbDp.cjs → item-option-color-picker-Bhv_k1uW.cjs} +2 -2
  343. package/components/{item-option-color-picker-BlkpWjQh.js → item-option-color-picker-CKokPQcS.js} +2 -2
  344. package/components/item-option-color-range/index.cjs +1 -1
  345. package/components/item-option-color-range/index.js +1 -1
  346. package/components/item-option-color-range-CwDkzRcx.cjs +98 -0
  347. package/components/{item-option-color-range-3Wp-Ywz6.js → item-option-color-range-DYsMbFEb.js} +2 -2
  348. package/components/item-option-guidelines/index.cjs +1 -1
  349. package/components/item-option-guidelines/index.js +1 -1
  350. package/components/{item-option-guidelines-CQ_yb7Ar.js → item-option-guidelines-CXl4Yla4.js} +4 -3
  351. package/components/item-option-guidelines-DMjA-h3h.cjs +135 -0
  352. package/components/item-option-multi-language-field/index.cjs +1 -1
  353. package/components/item-option-multi-language-field/index.js +1 -1
  354. package/components/{item-option-multi-language-field-BApbe3pp.cjs → item-option-multi-language-field-C75Hd2fG.cjs} +2 -2
  355. package/components/{item-option-multi-language-field-aLIpQWiQ.js → item-option-multi-language-field-S6Mt3k23.js} +2 -2
  356. package/components/item-option-number-field/index.cjs +1 -1
  357. package/components/item-option-number-field/index.js +1 -1
  358. package/components/{item-option-number-field-B72ZYOAX.cjs → item-option-number-field-Bg5r0IAX.cjs} +2 -2
  359. package/components/{item-option-number-field-Bv5eGoxB.js → item-option-number-field-CALw8q_J.js} +2 -2
  360. package/components/item-option-panel/index.cjs +1 -1
  361. package/components/item-option-panel/index.js +1 -1
  362. package/components/{item-option-panel-A8Jxzwml.cjs → item-option-panel-DBXgOsM4.cjs} +2 -2
  363. package/components/{item-option-panel-kRH7GbzA.js → item-option-panel-v7yUS9hb.js} +4 -4
  364. package/components/item-option-picker/index.cjs +1 -1
  365. package/components/item-option-picker/index.js +1 -1
  366. package/components/{item-option-picker-BuUtW6gD.js → item-option-picker-CZyzd3Nq.js} +2 -2
  367. package/components/{item-option-picker-DOFJ1CnI.cjs → item-option-picker-RFstpFwI.cjs} +2 -2
  368. package/components/item-option-position-picker/index.cjs +1 -1
  369. package/components/item-option-position-picker/index.js +1 -1
  370. package/components/{item-option-position-picker-mf3JQu5q.js → item-option-position-picker-C8cnHEH4.js} +2 -2
  371. package/components/item-option-position-picker-CKHbHHl1.cjs +32 -0
  372. package/components/item-option-positions-number-field/index.cjs +1 -1
  373. package/components/item-option-positions-number-field/index.js +1 -1
  374. package/components/item-option-positions-number-field-BGs3WWaz.cjs +49 -0
  375. package/components/{item-option-positions-number-field-BIBWpagB.js → item-option-positions-number-field-BJTY1qZR.js} +2 -2
  376. package/components/item-option-radio-button-group/index.cjs +1 -1
  377. package/components/item-option-radio-button-group/index.js +1 -1
  378. package/components/{item-option-radio-button-group-B2HYZguB.cjs → item-option-radio-button-group-CN8TLtsV.cjs} +2 -2
  379. package/components/{item-option-radio-button-group-CFnfadK2.js → item-option-radio-button-group-vhm4r4_k.js} +2 -2
  380. package/components/item-option-slider/index.cjs +1 -1
  381. package/components/item-option-slider/index.js +1 -1
  382. package/components/{item-option-slider-CH1l0Ena.js → item-option-slider-CQOKWBZQ.js} +2 -2
  383. package/components/item-option-slider-DbLPhpJd.cjs +33 -0
  384. package/components/item-option-switch/index.cjs +1 -1
  385. package/components/item-option-switch/index.js +1 -1
  386. package/components/{item-option-switch-hUFRE9MC.cjs → item-option-switch-CWpb0nf3.cjs} +2 -2
  387. package/components/{item-option-switch-rqu2ePVU.js → item-option-switch-azZX2vJr.js} +2 -2
  388. package/components/item-option-text-field/index.cjs +1 -1
  389. package/components/item-option-text-field/index.js +1 -1
  390. package/components/{item-option-text-field-CBFMmuK2.js → item-option-text-field-CIM_38yi.js} +2 -2
  391. package/components/{item-option-text-field-C6CocZ5q.cjs → item-option-text-field-CS3Lccda.cjs} +2 -2
  392. package/components/item-options-configs.js +45 -45
  393. package/components/item-slot-drop/index.cjs +1 -1
  394. package/components/item-slot-drop/index.d.ts +2 -0
  395. package/components/item-slot-drop/index.js +1 -1
  396. package/components/item-slot-drop-C8WYPu_w.cjs +91 -0
  397. package/components/{item-slot-drop-DDGclwbP.js → item-slot-drop-DeZ2GvAu.js} +26 -21
  398. package/components/item-slot-drop-panel/index.cjs +1 -1
  399. package/components/item-slot-drop-panel/index.js +1 -1
  400. package/components/item-slot-drop-panel-BcBHDDTT.cjs +57 -0
  401. package/components/{item-slot-drop-panel-Cj6vbgJl.js → item-slot-drop-panel-LpfX7ap0.js} +49 -48
  402. package/components/item-slot-picker/index.cjs +1 -1
  403. package/components/item-slot-picker/index.js +1 -1
  404. package/components/{item-slot-picker-CjQH3MU-.js → item-slot-picker-BSO1ltXC.js} +44 -39
  405. package/components/item-slot-picker-CvySq194.cjs +174 -0
  406. package/components/item-slot-picker-panel/index.cjs +1 -1
  407. package/components/item-slot-picker-panel/index.js +1 -1
  408. package/components/{item-slot-picker-panel-7IFk5QFC.js → item-slot-picker-panel-CsntXcAp.js} +16 -15
  409. package/components/item-slot-picker-panel-DQ_OzMO_.cjs +81 -0
  410. package/components/item-slots-configs.js +45 -45
  411. package/components/{line-chart-options.config-D8gRtfj3.js → line-chart-options.config-C3_RnROS.js} +1 -1
  412. package/components/{line-chart-positioning.config-D5WVvIZT.js → line-chart-positioning.config-CrreArf5.js} +1 -1
  413. package/components/{line-chart-positioning.config-DuXn1WD-.cjs → line-chart-positioning.config-DMe1Ldwk.cjs} +1 -1
  414. package/components/{line-chart-slots.config-C6LEwEwh.js → line-chart-slots.config-CA-I6B6o.js} +1 -1
  415. package/components/load-data-fields-for-datasets-B3XcFFfg.js +42 -0
  416. package/components/load-data-fields-for-datasets-rL24A68g.cjs +20 -0
  417. package/components/localized-mixin-DaLXe5J9.js +45 -0
  418. package/components/localized-mixin-DiUJOd06.cjs +20 -0
  419. package/components/{marker-map-options.config-BE8GnY_T.js → marker-map-options.config-OMdgbAc4.js} +1 -1
  420. package/components/{marker-map-positioning.config-DfN39a-Q.cjs → marker-map-positioning.config-CpI8nCtC.cjs} +1 -1
  421. package/components/{marker-map-positioning.config-D2L7cvCP.js → marker-map-positioning.config-DW9tMO2M.js} +1 -1
  422. package/components/{marker-map-slots.config-Cyk-QFPT.js → marker-map-slots.config-CcGNgr1_.js} +1 -1
  423. package/components/{nl-h9vVAk2e.js → nl-BaZM3WoR.js} +34 -0
  424. package/components/nl-BoEhzeIh.cjs +20 -0
  425. package/components/{ohlc-chart-options.config-xgegn34C.js → ohlc-chart-options.config-CWRI5bXI.js} +1 -1
  426. package/components/{ohlc-chart-positioning.config-DsBuB0VU.cjs → ohlc-chart-positioning.config-9DETh4xy.cjs} +1 -1
  427. package/components/{ohlc-chart-positioning.config-C53dCwaT.js → ohlc-chart-positioning.config-CkX8gyS2.js} +1 -1
  428. package/components/{ohlc-chart-slots.config-CQFi8BIT.js → ohlc-chart-slots.config-Pv0xst-Y.js} +1 -1
  429. package/components/{parallel-coordinates-plot-options.config-BUQLHO1k.js → parallel-coordinates-plot-options.config-DbuNgevO.js} +1 -1
  430. package/components/{parallel-coordinates-plot-positioning.config-aiFzLnnh.cjs → parallel-coordinates-plot-positioning.config-CLDZdGdh.cjs} +1 -1
  431. package/components/{parallel-coordinates-plot-positioning.config-DhoVstsb.js → parallel-coordinates-plot-positioning.config-DTJZLEeT.js} +1 -1
  432. package/components/{parallel-coordinates-plot-slots.config-D5o-5y_j.js → parallel-coordinates-plot-slots.config-GvYC-RXK.js} +1 -1
  433. package/components/period-over-period-condition.const-BZ7j5Z5t.js +29 -0
  434. package/components/period-over-period-condition.const-C1NZ9Bkp.cjs +20 -0
  435. package/components/{pivot-table-options.config-DW9UDipI.js → pivot-table-options.config-CTz4bcGJ.js} +1 -1
  436. package/components/{pivot-table-positioning.config-Bq9BoQWM.cjs → pivot-table-positioning.config-B-SALuVb.cjs} +1 -1
  437. package/components/{pivot-table-positioning.config-Cnai84AH.js → pivot-table-positioning.config-CtSYHD-n.js} +1 -1
  438. package/components/{pivot-table-slots.config-Cl5z3IQo.js → pivot-table-slots.config-BAW0U3nh.js} +1 -1
  439. package/components/{pragmatic-element-adapter-C_7HSvGV.js → pragmatic-element-adapter-D0LRKx5U.js} +75 -74
  440. package/components/{pragmatic-element-adapter-DPWYJiW9.cjs → pragmatic-element-adapter-DdyH32ix.cjs} +4 -4
  441. package/components/{pyramid-chart-options.config-Cbg351Yy.js → pyramid-chart-options.config-C7btzuZj.js} +1 -1
  442. package/components/{pyramid-chart-positioning.config-BeJ5R_Ln.js → pyramid-chart-positioning.config-0Juiava5.js} +1 -1
  443. package/components/{pyramid-chart-positioning.config-D5AKNCPb.cjs → pyramid-chart-positioning.config-BllFtneP.cjs} +1 -1
  444. package/components/{pyramid-chart-slots.config-DNzq2hMx.js → pyramid-chart-slots.config-CsMMyhV3.js} +1 -1
  445. package/components/{radar-chart-options.config-DrNyOkHq.js → radar-chart-options.config-CtA6MpUp.js} +1 -1
  446. package/components/{radar-chart-positioning.config-DsfUBq4B.js → radar-chart-positioning.config-BPbb63S6.js} +1 -1
  447. package/components/{radar-chart-positioning.config-BEIwrzhb.cjs → radar-chart-positioning.config-BY4RKNDi.cjs} +1 -1
  448. package/components/{radar-chart-slots.config-CXgfvAkt.js → radar-chart-slots.config-8Kf_WAFi.js} +1 -1
  449. package/components/{regular-table-options.config-CweBtAvm.js → regular-table-options.config-BRmS77t-.js} +1 -1
  450. package/components/{regular-table-slots.config-DCkw4Xkq.js → regular-table-slots.config-r-N9A-qA.js} +1 -1
  451. package/components/{route-map-options.config-DXHqb8Ve.js → route-map-options.config-C65J81_7.js} +1 -1
  452. package/components/{route-map-positioning.config-CuiRWzbs.js → route-map-positioning.config-D6nZFd8f.js} +1 -1
  453. package/components/{route-map-positioning.config-4Wyvj5OH.cjs → route-map-positioning.config-GQ9AJfej.cjs} +1 -1
  454. package/components/{route-map-slots.config-DJ76FOsJ.js → route-map-slots.config-DMII2UuP.js} +1 -1
  455. package/components/{sankey-diagram-options.config-1lSECht4.js → sankey-diagram-options.config-nQDCRhKs.js} +1 -1
  456. package/components/{sankey-diagram-positioning.config-CZ-zVCQo.cjs → sankey-diagram-positioning.config-DAuj5A08.cjs} +1 -1
  457. package/components/{sankey-diagram-positioning.config-DtN7dARd.js → sankey-diagram-positioning.config-R1EjoR5F.js} +1 -1
  458. package/components/{sankey-diagram-slots.config-BCc8P4j0.js → sankey-diagram-slots.config-DmWIGut0.js} +1 -1
  459. package/components/{scatter-plot-options.config-9zL4v24E.js → scatter-plot-options.config-BplrME7w.js} +1 -1
  460. package/components/{scatter-plot-positioning.config-BXrzdLIc.js → scatter-plot-positioning.config-DGoMnNZy.js} +1 -1
  461. package/components/{scatter-plot-positioning.config-CfAf_FUW.cjs → scatter-plot-positioning.config-o4c-wuRo.cjs} +1 -1
  462. package/components/{scatter-plot-slots.config-BMTdhTZG.js → scatter-plot-slots.config-B7wQVEEj.js} +1 -1
  463. package/components/{search-filter-options.config-B_qQjr68.js → search-filter-options.config-yAz6IIto.js} +1 -1
  464. package/components/{search-filter-slots.config-qCILSYzs.js → search-filter-slots.config-D8-V0BT5.js} +1 -1
  465. package/components/{set-locale-B-GvqA1H.cjs → set-locale-Xh_1AFbC.cjs} +1 -1
  466. package/components/{set-locale-CgCeLPlb.js → set-locale-ydAPif-7.js} +4 -4
  467. package/components/{slicer-filter-options.config-DK62SCMp.js → slicer-filter-options.config-BtGkT2hI.js} +1 -1
  468. package/components/{slicer-filter-positioning.config-CU86hJi6.cjs → slicer-filter-positioning.config-BqpIENEm.cjs} +1 -1
  469. package/components/{slicer-filter-positioning.config-BLGeCJys.js → slicer-filter-positioning.config-D_didkcw.js} +1 -1
  470. package/components/{slicer-filter-slots.config-C9_NdJm4.js → slicer-filter-slots.config-DR0Wg_Zr.js} +1 -1
  471. package/components/{slider-filter-options.config-CP5bXdih.js → slider-filter-options.config-D_yZ_nFz.js} +1 -1
  472. package/components/{slider-filter-slots.config-15eAAGVn.js → slider-filter-slots.config-BUHw-32u.js} +1 -1
  473. package/components/{en-GB-CJR66Ci_.cjs → slot-menu/index.cjs} +1 -1
  474. package/components/slot-menu/index.d.ts +10 -0
  475. package/components/slot-menu/index.js +28 -0
  476. package/components/slot-menu/slot-menu.d.ts +148 -0
  477. package/components/slot-menu/types.d.ts +24 -0
  478. package/components/slot-menu-CUdbaW3K.js +428 -0
  479. package/components/slot-menu-DRx1Ffla.cjs +71 -0
  480. package/components/slot-menu-list/index.cjs +20 -0
  481. package/components/slot-menu-list/index.d.ts +8 -0
  482. package/components/slot-menu-list/index.js +28 -0
  483. package/components/slot-menu-list/slot-menu-list.d.ts +47 -0
  484. package/components/slot-menu-list-DVSxamVa.js +347 -0
  485. package/components/slot-menu-list-DaHzz_ve.cjs +44 -0
  486. package/components/slot-role-classification-2wChhpcq.cjs +20 -0
  487. package/components/slot-role-classification-B8bkGhQ_.js +133 -0
  488. package/components/slots-config-Cd4xAG4H.cjs +20 -0
  489. package/components/slots-config-GlSNH7Gr.js +76 -0
  490. package/components/{speedometer-chart-options.config-dsUupCqm.js → speedometer-chart-options.config-BL7evgzP.js} +1 -1
  491. package/components/{speedometer-chart-positioning.config-Dam0wOqp.js → speedometer-chart-positioning.config-CmxsV4-x.js} +1 -1
  492. package/components/{speedometer-chart-positioning.config-AeMlNxSj.cjs → speedometer-chart-positioning.config-eVUWDhkL.cjs} +1 -1
  493. package/components/{speedometer-chart-slots.config-DfTw7JTF.js → speedometer-chart-slots.config-2Y_x52Gy.js} +1 -1
  494. package/components/{spike-map-options.config-Dh4Ky5ZP.js → spike-map-options.config-DjoTrAsC.js} +1 -1
  495. package/components/{spike-map-positioning.config-9ShV1fUh.cjs → spike-map-positioning.config-B38djRlf.cjs} +1 -1
  496. package/components/{spike-map-positioning.config-BVzewpfi.js → spike-map-positioning.config-Bta7ar9e.js} +1 -1
  497. package/components/{spike-map-slots.config-i-c0F9QM.js → spike-map-slots.config-DJWMFPIR.js} +1 -1
  498. package/components/{strip-plot-options.config-Vw3GoLef.js → strip-plot-options.config-tDmVlu9U.js} +1 -1
  499. package/components/{strip-plot-positioning.config-OHm3LEo3.js → strip-plot-positioning.config-0vlAfmDB.js} +1 -1
  500. package/components/{strip-plot-positioning.config-BVBdHZvL.cjs → strip-plot-positioning.config-atH68L8u.cjs} +1 -1
  501. package/components/{strip-plot-slots.config-BuF7X3xN.js → strip-plot-slots.config-suFyIf5-.js} +1 -1
  502. package/components/{sunburst-chart-options.config-CXOrVmIe.js → sunburst-chart-options.config-Bjue_lQN.js} +1 -1
  503. package/components/{sunburst-chart-positioning.config-BynNbbxB.js → sunburst-chart-positioning.config-B2x6afBV.js} +1 -1
  504. package/components/{sunburst-chart-positioning.config-DQmuKm-N.cjs → sunburst-chart-positioning.config-NFzFNuXB.cjs} +1 -1
  505. package/components/{sunburst-chart-slots.config-Cq-E6kyI.js → sunburst-chart-slots.config-BqVT-h0Z.js} +1 -1
  506. package/components/{symbol-map-options.config-Dultd0tF.js → symbol-map-options.config-Dyeya5Z2.js} +1 -1
  507. package/components/{symbol-map-positioning.config-bQk_pdAr.js → symbol-map-positioning.config-B6v9PFTk.js} +1 -1
  508. package/components/{symbol-map-positioning.config-D6rgxXTO.cjs → symbol-map-positioning.config-DGpmp_N1.cjs} +1 -1
  509. package/components/{symbol-map-slots.config-BfdBHkzN.js → symbol-map-slots.config-Rhpher5o.js} +1 -1
  510. package/components/{text-options.config-BUiRyi3L.js → text-options.config-CXhvzzPF.js} +1 -1
  511. package/components/{text-slots.config-CM_ZaW3p.js → text-slots.config-Dzj4-x2G.js} +1 -1
  512. package/components/{treemap-chart-options.config-6l3HzikF.js → treemap-chart-options.config-BzOCEWog.js} +1 -1
  513. package/components/{treemap-chart-positioning.config-BB1-rZKL.js → treemap-chart-positioning.config-Bf2VNVRQ.js} +1 -1
  514. package/components/{treemap-chart-positioning.config-ZaoIngRn.cjs → treemap-chart-positioning.config-NMULB8UM.cjs} +1 -1
  515. package/components/{treemap-chart-slots.config-CHkGtIOa.js → treemap-chart-slots.config-DRcafVU-.js} +1 -1
  516. package/components/utils/base.cjs +1 -1
  517. package/components/utils/base.js +2 -2
  518. package/components/utils/store.js +1 -1
  519. package/components/utils-SzKvwZ9-.cjs +20 -0
  520. package/components/{utils-ZoJ1cp2P.js → utils-_8LPCz9-.js} +54 -53
  521. package/components/utils.cjs +1 -1
  522. package/components/utils.js +9 -6
  523. package/components/{venn-diagram-options.config-Wi0dQsAu.js → venn-diagram-options.config-BMlduwIp.js} +1 -1
  524. package/components/{venn-diagram-positioning.config-Cb10sStL.cjs → venn-diagram-positioning.config-D4cODPGV.cjs} +1 -1
  525. package/components/{venn-diagram-positioning.config-C9ARqREi.js → venn-diagram-positioning.config-DgOl0Vh-.js} +1 -1
  526. package/components/{venn-diagram-slots.config-DY04aeYK.js → venn-diagram-slots.config-CMDndPVi.js} +1 -1
  527. package/components/{video-options.config-B6pQUPB7.js → video-options.config-DdfSTJEJ.js} +1 -1
  528. package/components/{video-slots.config-C-kXGzo3.js → video-slots.config-Utnn0DBW.js} +1 -1
  529. package/components/viz-item-menu/index.cjs +20 -0
  530. package/components/viz-item-menu/index.d.ts +8 -0
  531. package/components/viz-item-menu/index.js +28 -0
  532. package/components/viz-item-menu/types.d.ts +9 -0
  533. package/components/viz-item-menu/viz-item-menu.d.ts +78 -0
  534. package/components/viz-item-menu-CNHv6qDa.cjs +55 -0
  535. package/components/viz-item-menu-L_j0L08h.js +170 -0
  536. package/components/{wordcloud-chart-options.config-CpMtpG7q.js → wordcloud-chart-options.config-y9Z5I_ZN.js} +1 -1
  537. package/components/{wordcloud-chart-positioning.config-D59ntNtd.js → wordcloud-chart-positioning.config-BP6iqy-N.js} +1 -1
  538. package/components/{wordcloud-chart-positioning.config-DC89_DYc.cjs → wordcloud-chart-positioning.config-DZEkWvb0.cjs} +1 -1
  539. package/components/{wordcloud-chart-slots.config-Cc5F92Tv.js → wordcloud-chart-slots.config-CvabtgbP.js} +1 -1
  540. package/custom-elements.json +18790 -6833
  541. package/deprecated-react/components/ai-chat.component.cjs +1 -0
  542. package/deprecated-react/components/ai-interaction-textarea.component.cjs +1 -0
  543. package/deprecated-react/components/data-field-level.component.cjs +1 -0
  544. package/deprecated-react/components/data-fields-select.component.cjs +1 -0
  545. package/deprecated-react/components/dataset-icon.component.cjs +1 -0
  546. package/deprecated-react/components/dataset-selector-list.component.cjs +1 -0
  547. package/deprecated-react/components/dataset-selector-row.component.cjs +1 -0
  548. package/deprecated-react/components/display-settings-binning.component.cjs +1 -0
  549. package/deprecated-react/components/display-settings-datetime.component.cjs +1 -0
  550. package/deprecated-react/components/display-settings-grand-totals.component.cjs +1 -0
  551. package/deprecated-react/components/display-settings-numeric.component.cjs +1 -0
  552. package/deprecated-react/components/display-settings-period-over-period.component.cjs +1 -0
  553. package/deprecated-react/components/display-settings.component.cjs +1 -0
  554. package/deprecated-react/components/filter-expression-picker.component.cjs +1 -0
  555. package/deprecated-react/components/filter-item.component.cjs +1 -0
  556. package/deprecated-react/components/filter-parameter-picker.component.cjs +1 -0
  557. package/deprecated-react/components/filter-value-picker-datetime.component.cjs +1 -0
  558. package/deprecated-react/components/filter-value-picker-hierarchy.component.cjs +1 -0
  559. package/deprecated-react/components/filter-value-picker-numeric.component.cjs +1 -0
  560. package/deprecated-react/components/filter-value-picker.component.cjs +1 -0
  561. package/deprecated-react/components/formula-field.component.cjs +1 -0
  562. package/deprecated-react/components/interactive-viz-item.component.cjs +1 -0
  563. package/deprecated-react/components/slot-menu-list.component.cjs +1 -0
  564. package/deprecated-react/components/slot-menu.component.cjs +1 -0
  565. package/deprecated-react/components/viz-item-menu.component.cjs +1 -0
  566. package/index.d.ts +25 -0
  567. package/package.json +127 -2
  568. package/react/components/ai-chat.component.ts +45 -0
  569. package/react/components/ai-interaction-textarea.component.ts +30 -0
  570. package/react/components/data-field-level.component.ts +30 -0
  571. package/react/components/data-fields-select.component.ts +27 -0
  572. package/react/components/dataset-icon.component.ts +22 -0
  573. package/react/components/dataset-selector-list.component.ts +27 -0
  574. package/react/components/dataset-selector-row.component.ts +36 -0
  575. package/react/components/display-settings-binning.component.ts +27 -0
  576. package/react/components/display-settings-datetime.component.ts +27 -0
  577. package/react/components/display-settings-grand-totals.component.ts +27 -0
  578. package/react/components/display-settings-numeric.component.ts +27 -0
  579. package/react/components/display-settings-period-over-period.component.ts +27 -0
  580. package/react/components/display-settings.component.ts +33 -0
  581. package/react/components/filter-expression-picker.component.ts +27 -0
  582. package/react/components/filter-item.component.ts +27 -0
  583. package/react/components/filter-parameter-picker.component.ts +33 -0
  584. package/react/components/filter-value-picker-datetime.component.ts +27 -0
  585. package/react/components/filter-value-picker-hierarchy.component.ts +27 -0
  586. package/react/components/filter-value-picker-numeric.component.ts +27 -0
  587. package/react/components/filter-value-picker.component.ts +27 -0
  588. package/react/components/filters.component.ts +1 -1
  589. package/react/components/formula-field.component.ts +30 -0
  590. package/react/components/interactive-viz-item.component.ts +33 -0
  591. package/react/components/slot-menu-list.component.ts +27 -0
  592. package/react/components/slot-menu.component.ts +42 -0
  593. package/react/components/viz-item-menu.component.ts +33 -0
  594. package/react/esm/components/ai-chat.component.d.ts +24 -0
  595. package/react/esm/components/ai-chat.component.js +29 -0
  596. package/react/esm/components/ai-interaction-textarea.component.d.ts +14 -0
  597. package/react/esm/components/ai-interaction-textarea.component.js +19 -0
  598. package/react/esm/components/data-field-level.component.d.ts +14 -0
  599. package/react/esm/components/data-field-level.component.js +19 -0
  600. package/react/esm/components/data-fields-select.component.d.ts +12 -0
  601. package/react/esm/components/data-fields-select.component.js +17 -0
  602. package/react/esm/components/dataset-icon.component.d.ts +8 -0
  603. package/react/esm/components/dataset-icon.component.js +13 -0
  604. package/react/esm/components/dataset-selector-list.component.d.ts +12 -0
  605. package/react/esm/components/dataset-selector-list.component.js +17 -0
  606. package/react/esm/components/dataset-selector-row.component.d.ts +18 -0
  607. package/react/esm/components/dataset-selector-row.component.js +23 -0
  608. package/react/esm/components/display-settings-binning.component.d.ts +12 -0
  609. package/react/esm/components/display-settings-binning.component.js +17 -0
  610. package/react/esm/components/display-settings-datetime.component.d.ts +12 -0
  611. package/react/esm/components/display-settings-datetime.component.js +17 -0
  612. package/react/esm/components/display-settings-grand-totals.component.d.ts +12 -0
  613. package/react/esm/components/display-settings-grand-totals.component.js +17 -0
  614. package/react/esm/components/display-settings-numeric.component.d.ts +12 -0
  615. package/react/esm/components/display-settings-numeric.component.js +17 -0
  616. package/react/esm/components/display-settings-period-over-period.component.d.ts +12 -0
  617. package/react/esm/components/display-settings-period-over-period.component.js +17 -0
  618. package/react/esm/components/display-settings.component.d.ts +16 -0
  619. package/react/esm/components/display-settings.component.js +21 -0
  620. package/react/esm/components/filter-expression-picker.component.d.ts +12 -0
  621. package/react/esm/components/filter-expression-picker.component.js +17 -0
  622. package/react/esm/components/filter-item.component.d.ts +12 -0
  623. package/react/esm/components/filter-item.component.js +17 -0
  624. package/react/esm/components/filter-parameter-picker.component.d.ts +16 -0
  625. package/react/esm/components/filter-parameter-picker.component.js +21 -0
  626. package/react/esm/components/filter-value-picker-datetime.component.d.ts +12 -0
  627. package/react/esm/components/filter-value-picker-datetime.component.js +17 -0
  628. package/react/esm/components/filter-value-picker-hierarchy.component.d.ts +12 -0
  629. package/react/esm/components/filter-value-picker-hierarchy.component.js +17 -0
  630. package/react/esm/components/filter-value-picker-numeric.component.d.ts +12 -0
  631. package/react/esm/components/filter-value-picker-numeric.component.js +17 -0
  632. package/react/esm/components/filter-value-picker.component.d.ts +12 -0
  633. package/react/esm/components/filter-value-picker.component.js +17 -0
  634. package/react/esm/components/filters.component.d.ts +1 -1
  635. package/react/esm/components/filters.component.js +1 -1
  636. package/react/esm/components/formula-field.component.d.ts +14 -0
  637. package/react/esm/components/formula-field.component.js +19 -0
  638. package/react/esm/components/interactive-viz-item.component.d.ts +16 -0
  639. package/react/esm/components/interactive-viz-item.component.js +21 -0
  640. package/react/esm/components/slot-menu-list.component.d.ts +12 -0
  641. package/react/esm/components/slot-menu-list.component.js +17 -0
  642. package/react/esm/components/slot-menu.component.d.ts +22 -0
  643. package/react/esm/components/slot-menu.component.js +27 -0
  644. package/react/esm/components/viz-item-menu.component.d.ts +16 -0
  645. package/react/esm/components/viz-item-menu.component.js +21 -0
  646. package/react/esm/index.d.ts +27 -2
  647. package/react/esm/index.js +102 -2
  648. package/react/index.ts +102 -2
  649. package/react/luzmo-stub.d.ts +140 -0
  650. package/react/package.json +2 -2
  651. package/storybook/inject-global-vars.d.ts +1 -0
  652. package/storybook/register-components.d.ts +57 -0
  653. package/types/agent.types.d.ts +4 -0
  654. package/types/ai-chat.types.d.ts +104 -0
  655. package/types/data-field-events.types.d.ts +7 -0
  656. package/types.d.ts +9 -0
  657. package/utils/create-lazy-loader.d.ts +5 -0
  658. package/utils/filters/filter-text.d.ts +64 -0
  659. package/utils/filters/index.d.ts +1 -0
  660. package/utils/filters/presentation.d.ts +4 -0
  661. package/utils/filters/tests/filter-text.test.d.ts +1 -0
  662. package/utils/formatter/localized-template.d.ts +4 -0
  663. package/utils/formatter/tests/localized-template.test.d.ts +1 -0
  664. package/utils/tests/create-lazy-loader.test.d.ts +1 -0
  665. package/components/base-BtRS5vm6.cjs +0 -20
  666. package/components/data-field-fvlYzmfX.cjs +0 -89
  667. package/components/data-field-panel-Yrqn4L79.cjs +0 -87
  668. package/components/data-fields-select-Cor6sfzL.cjs +0 -41
  669. package/components/de-CdZnQbKI.cjs +0 -20
  670. package/components/display-settings-datetime-B23w7aH4.cjs +0 -217
  671. package/components/display-settings-grand-totals-BZ0nlLhu.cjs +0 -44
  672. package/components/display-settings-numeric-DoScgfRy.cjs +0 -190
  673. package/components/display-settings-period-over-period-C-hp0ZKN.cjs +0 -227
  674. package/components/es-7RD7O4q3.cjs +0 -20
  675. package/components/filters-DndJU6D5.js +0 -2454
  676. package/components/filters-oB9qOk_M.cjs +0 -443
  677. package/components/formula-BFvxm8kj.cjs +0 -45
  678. package/components/formula-codemirror-ucFOD-2a.cjs +0 -215
  679. package/components/formula-display-store-DmT65fUB.cjs +0 -20
  680. package/components/formula-editor-BeZ-fu-7.cjs +0 -253
  681. package/components/fr-CGw2IwXh.cjs +0 -20
  682. package/components/item-option-BQpS6rM_.cjs +0 -269
  683. package/components/item-option-action-button-group-BwBxRLzB.cjs +0 -53
  684. package/components/item-option-base-C6uwowJD.cjs +0 -56
  685. package/components/item-option-color-palette-picker-BjHadiN0.cjs +0 -40
  686. package/components/item-option-color-range-CQo8uThO.cjs +0 -98
  687. package/components/item-option-guidelines-Daf8Ce5z.cjs +0 -135
  688. package/components/item-option-position-picker-Cnis4wLA.cjs +0 -32
  689. package/components/item-option-positions-number-field-B7gI1IKO.cjs +0 -49
  690. package/components/item-option-slider--7hmhi97.cjs +0 -33
  691. package/components/item-slot-drop-hK-rLhwa.cjs +0 -91
  692. package/components/item-slot-drop-panel-CE4f9X6F.cjs +0 -57
  693. package/components/item-slot-picker-Wf50lM5u.cjs +0 -174
  694. package/components/item-slot-picker-panel-Csn1tabr.cjs +0 -81
  695. package/components/load-data-fields-for-datasets-B76UR0sG.js +0 -86
  696. package/components/load-data-fields-for-datasets-DFYeACsu.cjs +0 -20
  697. package/components/localized-mixin-DfpurTYo.cjs +0 -20
  698. package/components/nl-BnzS_ZtB.cjs +0 -20
  699. package/components/period-over-period-condition.const-DDgiXIfR.cjs +0 -20
  700. package/components/slot-menu-1zlmyLVl.js +0 -1060
  701. package/components/slot-menu-BSu8wKLi.cjs +0 -217
  702. package/components/utils-CPIzW8sp.cjs +0 -20
@@ -0,0 +1,4350 @@
1
+ /*! * A kit of modern Luzmo Web Components for analytics in your web application.
2
+ *
3
+ * Copyright © 2026 Luzmo
4
+ * All rights reserved.
5
+ * Luzmo web components (“Luzmo Web Components”)
6
+ * must be used according to the Luzmo Terms of Service.
7
+ * This license allows users with a current active Luzmo account
8
+ * to use the Luzmo Web Components. This license terminates
9
+ * automatically if a user no longer has an active Luzmo account.
10
+ * Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
+ * SOFTWARE.
19
+ * */
20
+ import { c as e, d as t, s as n, u as r } from "./ai-interaction-textarea-BXKG2elT.js";
21
+ import { i } from "./base-8L8Jt2vi.js";
22
+ import { t as a } from "./decorate-DyMgX_Uh.js";
23
+ import { msg as o } from "@lit/localize/lit-localize";
24
+ import { luzmoEllipsisVertical as s, luzmoIcon as c, luzmoSpin as l } from "@luzmo/icons";
25
+ import "@luzmo/lucero/button";
26
+ import "@luzmo/lucero/chat-message";
27
+ import "@luzmo/lucero/icon";
28
+ import "@luzmo/lucero/overlay";
29
+ import "@luzmo/lucero/popover";
30
+ import "@luzmo/lucero/progress-steps";
31
+ import { html as u, nothing as d, unsafeCSS as f } from "lit";
32
+ import { property as p, state as m } from "lit/decorators.js";
33
+ import { unsafeHTML as ee } from "lit/directives/unsafe-html.js";
34
+ import "@luzmo/lucero/action-button";
35
+ import "@luzmo/lucero/question-box";
36
+ import { guard as h } from "lit/directives/guard.js";
37
+ import { keyed as te } from "lit/directives/keyed.js";
38
+ //#region node_modules/dompurify/dist/purify.es.mjs
39
+ function ne(e, t) {
40
+ this.v = e, this.k = t;
41
+ }
42
+ function re(e, t) {
43
+ (t == null || t > e.length) && (t = e.length);
44
+ for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
45
+ return r;
46
+ }
47
+ function ie(e) {
48
+ if (Array.isArray(e)) return e;
49
+ }
50
+ function ae(e, t) {
51
+ var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
52
+ if (n != null) {
53
+ var r, i, a, o, s = [], c = !0, l = !1;
54
+ try {
55
+ if (a = (n = n.call(e)).next, t === 0) {
56
+ if (Object(n) !== n) return;
57
+ c = !1;
58
+ } else for (; !(c = (r = a.call(n)).done) && (s.push(r.value), s.length !== t); c = !0);
59
+ } catch (e) {
60
+ l = !0, i = e;
61
+ } finally {
62
+ try {
63
+ if (!c && n.return != null && (o = n.return(), Object(o) !== o)) return;
64
+ } finally {
65
+ if (l) throw i;
66
+ }
67
+ }
68
+ return s;
69
+ }
70
+ }
71
+ function oe() {
72
+ throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
73
+ }
74
+ function se(e, t) {
75
+ return ie(e) || ae(e, t) || ce(e, t) || oe();
76
+ }
77
+ function ce(e, t) {
78
+ if (e) {
79
+ if (typeof e == "string") return re(e, t);
80
+ var n = {}.toString.call(e).slice(8, -1);
81
+ return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? re(e, t) : void 0;
82
+ }
83
+ }
84
+ function g(e) {
85
+ var t, n;
86
+ function r(t, n) {
87
+ try {
88
+ var a = e[t](n), o = a.value, s = o instanceof ne;
89
+ Promise.resolve(s ? o.v : o).then(function(n) {
90
+ if (s) {
91
+ var c = t === "return" && o.k ? t : "next";
92
+ if (!o.k || n.done) return r(c, n);
93
+ n = e[c](n).value;
94
+ }
95
+ i(!!a.done, n);
96
+ }, function(e) {
97
+ r("throw", e);
98
+ });
99
+ } catch (e) {
100
+ i(2, e);
101
+ }
102
+ }
103
+ function i(e, i) {
104
+ e === 2 ? t.reject(i) : t.resolve({
105
+ value: i,
106
+ done: e
107
+ }), (t = t.next) ? r(t.key, t.arg) : n = null;
108
+ }
109
+ this._invoke = function(e, i) {
110
+ return new Promise(function(a, o) {
111
+ var s = {
112
+ key: e,
113
+ arg: i,
114
+ resolve: a,
115
+ reject: o,
116
+ next: null
117
+ };
118
+ n ? n = n.next = s : (t = n = s, r(e, i));
119
+ });
120
+ }, typeof e.return != "function" && (this.return = void 0);
121
+ }
122
+ g.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
123
+ return this;
124
+ }, g.prototype.next = function(e) {
125
+ return this._invoke("next", e);
126
+ }, g.prototype.throw = function(e) {
127
+ return this._invoke("throw", e);
128
+ }, g.prototype.return = function(e) {
129
+ return this._invoke("return", e);
130
+ };
131
+ var le = Object.entries, _ = Object.setPrototypeOf, ue = Object.isFrozen, de = Object.getPrototypeOf, fe = Object.getOwnPropertyDescriptor, v = Object.freeze, y = Object.seal, pe = Object.create, me = typeof Reflect < "u" && Reflect, he = me.apply, ge = me.construct;
132
+ v ||= function(e) {
133
+ return e;
134
+ }, y ||= function(e) {
135
+ return e;
136
+ }, he ||= function(e, t) {
137
+ var n = [...arguments].slice(2);
138
+ return e.apply(t, n);
139
+ }, ge ||= function(e) {
140
+ return new e(...[...arguments].slice(1));
141
+ };
142
+ var _e = C(Array.prototype.forEach);
143
+ Array.prototype.indexOf;
144
+ var ve = C(Array.prototype.lastIndexOf), ye = C(Array.prototype.pop), be = C(Array.prototype.push);
145
+ Array.prototype.slice;
146
+ var xe = C(Array.prototype.splice), Se = Array.isArray, Ce = C(String.prototype.toLowerCase), we = C(String.prototype.toString), Te = C(String.prototype.match), Ee = C(String.prototype.replace), De = C(String.prototype.indexOf), Oe = C(String.prototype.trim), ke = C(Number.prototype.toString), Ae = C(Boolean.prototype.toString), je = typeof BigInt > "u" ? null : C(BigInt.prototype.toString), Me = typeof Symbol > "u" ? null : C(Symbol.prototype.toString), b = C(Object.prototype.hasOwnProperty), Ne = C(Object.prototype.toString), x = C(RegExp.prototype.test), S = Pe(TypeError);
147
+ function C(e) {
148
+ return function(t) {
149
+ t instanceof RegExp && (t.lastIndex = 0);
150
+ var n = [...arguments].slice(1);
151
+ return he(e, t, n);
152
+ };
153
+ }
154
+ function Pe(e) {
155
+ return function() {
156
+ return ge(e, [...arguments]);
157
+ };
158
+ }
159
+ function w(e, t) {
160
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Ce;
161
+ if (_ && _(e, null), !Se(t)) return e;
162
+ let r = t.length;
163
+ for (; r--;) {
164
+ let i = t[r];
165
+ if (typeof i == "string") {
166
+ let e = n(i);
167
+ e !== i && (ue(t) || (t[r] = e), i = e);
168
+ }
169
+ e[i] = !0;
170
+ }
171
+ return e;
172
+ }
173
+ function T(e) {
174
+ for (let t = 0; t < e.length; t++) b(e, t) || (e[t] = null);
175
+ return e;
176
+ }
177
+ function E(e) {
178
+ let t = pe(null);
179
+ for (let r of le(e)) {
180
+ var n = se(r, 2);
181
+ let i = n[0], a = n[1];
182
+ b(e, i) && (Se(a) ? t[i] = T(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = E(a) : t[i] = a);
183
+ }
184
+ return t;
185
+ }
186
+ function Fe(e) {
187
+ switch (typeof e) {
188
+ case "string": return e;
189
+ case "number": return ke(e);
190
+ case "boolean": return Ae(e);
191
+ case "bigint": return je ? je(e) : "0";
192
+ case "symbol": return Me ? Me(e) : "Symbol()";
193
+ case "undefined": return Ne(e);
194
+ case "function":
195
+ case "object": {
196
+ if (e === null) return Ne(e);
197
+ let t = e, n = D(t, "toString");
198
+ if (typeof n == "function") {
199
+ let e = n(t);
200
+ return typeof e == "string" ? e : Ne(e);
201
+ }
202
+ return Ne(e);
203
+ }
204
+ default: return Ne(e);
205
+ }
206
+ }
207
+ function D(e, t) {
208
+ for (; e !== null;) {
209
+ let n = fe(e, t);
210
+ if (n) {
211
+ if (n.get) return C(n.get);
212
+ if (typeof n.value == "function") return C(n.value);
213
+ }
214
+ e = de(e);
215
+ }
216
+ function n() {
217
+ return null;
218
+ }
219
+ return n;
220
+ }
221
+ function Ie(e) {
222
+ try {
223
+ return x(e, ""), !0;
224
+ } catch {
225
+ return !1;
226
+ }
227
+ }
228
+ var Le = v(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), Re = v(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), ze = v([
229
+ "feBlend",
230
+ "feColorMatrix",
231
+ "feComponentTransfer",
232
+ "feComposite",
233
+ "feConvolveMatrix",
234
+ "feDiffuseLighting",
235
+ "feDisplacementMap",
236
+ "feDistantLight",
237
+ "feDropShadow",
238
+ "feFlood",
239
+ "feFuncA",
240
+ "feFuncB",
241
+ "feFuncG",
242
+ "feFuncR",
243
+ "feGaussianBlur",
244
+ "feImage",
245
+ "feMerge",
246
+ "feMergeNode",
247
+ "feMorphology",
248
+ "feOffset",
249
+ "fePointLight",
250
+ "feSpecularLighting",
251
+ "feSpotLight",
252
+ "feTile",
253
+ "feTurbulence"
254
+ ]), Be = v([
255
+ "animate",
256
+ "color-profile",
257
+ "cursor",
258
+ "discard",
259
+ "font-face",
260
+ "font-face-format",
261
+ "font-face-name",
262
+ "font-face-src",
263
+ "font-face-uri",
264
+ "foreignobject",
265
+ "hatch",
266
+ "hatchpath",
267
+ "mesh",
268
+ "meshgradient",
269
+ "meshpatch",
270
+ "meshrow",
271
+ "missing-glyph",
272
+ "script",
273
+ "set",
274
+ "solidcolor",
275
+ "unknown",
276
+ "use"
277
+ ]), Ve = v(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), He = v([
278
+ "maction",
279
+ "maligngroup",
280
+ "malignmark",
281
+ "mlongdiv",
282
+ "mscarries",
283
+ "mscarry",
284
+ "msgroup",
285
+ "mstack",
286
+ "msline",
287
+ "msrow",
288
+ "semantics",
289
+ "annotation",
290
+ "annotation-xml",
291
+ "mprescripts",
292
+ "none"
293
+ ]), Ue = v(["#text"]), We = v(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), Ge = v(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), Ke = v(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), qe = v([
294
+ "xlink:href",
295
+ "xml:id",
296
+ "xlink:title",
297
+ "xml:space",
298
+ "xmlns:xlink"
299
+ ]), Je = y(/{{[\w\W]*|^[\w\W]*}}/g), Ye = y(/<%[\w\W]*|^[\w\W]*%>/g), Xe = y(/\${[\w\W]*/g), Ze = y(/^data-[\-\w.\u00B7-\uFFFF]+$/), Qe = y(/^aria-[\-\w]+$/), $e = y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), et = y(/^(?:\w+script|data):/i), tt = y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), nt = y(/^html$/i), rt = y(/^[a-z][.\w]*(-[.\w]+)+$/i), it = y(/<[/\w!]/g), at = y(/<[/\w]/g), ot = y(/<\/no(script|embed|frames)/i), st = y(/\/>/i), O = {
300
+ element: 1,
301
+ attribute: 2,
302
+ text: 3,
303
+ cdataSection: 4,
304
+ entityReference: 5,
305
+ entityNode: 6,
306
+ processingInstruction: 7,
307
+ comment: 8,
308
+ document: 9,
309
+ documentType: 10,
310
+ documentFragment: 11,
311
+ notation: 12
312
+ }, ct = [
313
+ "style",
314
+ "script",
315
+ "xmp",
316
+ "iframe",
317
+ "noembed",
318
+ "noframes",
319
+ "plaintext",
320
+ "noscript"
321
+ ], lt = v(w({}, ct)), ut = function() {
322
+ let e = {};
323
+ return _e(ct, (t) => {
324
+ e[t] = y(RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
325
+ }), v(e);
326
+ }(), dt = function() {
327
+ return typeof window > "u" ? null : window;
328
+ }, ft = function(e, t) {
329
+ if (typeof e != "object" || typeof e.createPolicy != "function") return null;
330
+ let n = null, r = "data-tt-policy-suffix";
331
+ t && t.hasAttribute(r) && (n = t.getAttribute(r));
332
+ let i = "dompurify" + (n ? "#" + n : "");
333
+ try {
334
+ return e.createPolicy(i, {
335
+ createHTML(e) {
336
+ return e;
337
+ },
338
+ createScriptURL(e) {
339
+ return e;
340
+ }
341
+ });
342
+ } catch {
343
+ return console.warn("TrustedTypes policy " + i + " could not be created."), null;
344
+ }
345
+ }, pt = function() {
346
+ return {
347
+ afterSanitizeAttributes: [],
348
+ afterSanitizeElements: [],
349
+ afterSanitizeShadowDOM: [],
350
+ beforeSanitizeAttributes: [],
351
+ beforeSanitizeElements: [],
352
+ beforeSanitizeShadowDOM: [],
353
+ uponSanitizeAttribute: [],
354
+ uponSanitizeElement: [],
355
+ uponSanitizeShadowNode: []
356
+ };
357
+ }, mt = function(e, t, n, r) {
358
+ return b(e, t) && Se(e[t]) ? w(r.base ? E(r.base) : {}, e[t], r.transform) : n;
359
+ }, ht = function(e, t, n) {
360
+ let r = b(e, t) ? e[t] : void 0;
361
+ return r && typeof r == "object" ? E(r) : n();
362
+ };
363
+ function gt() {
364
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : dt(), t = (e) => gt(e);
365
+ if (t.version = "3.4.16", t.removed = [], !e || !e.document || e.document.nodeType !== O.document || !e.Element) return t.isSupported = !1, t;
366
+ let n = e.document, r = n, i = r.currentScript;
367
+ e.DocumentFragment;
368
+ let a = e.HTMLTemplateElement, o = e.Node, s = e.Element, c = e.NodeFilter;
369
+ e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
370
+ let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = D(d, "cloneNode"), p = D(d, "remove"), m = D(d, "removeAttributeNode"), ee = D(d, "nextSibling"), h = D(d, "childNodes"), te = D(d, "parentNode"), ne = D(d, "shadowRoot"), re = D(d, "attributes"), ie = o && o.prototype ? D(o.prototype, "nodeType") : null, ae = o && o.prototype ? D(o.prototype, "nodeName") : null, oe = o && o.prototype ? D(o.prototype, "ownerDocument") : null, se = function(e) {
371
+ return ie ? ie(e) : e.nodeType;
372
+ }, ce = function(e) {
373
+ return ae ? ae(e) : e.nodeName;
374
+ };
375
+ if (typeof a == "function") {
376
+ let e = n.createElement("template");
377
+ e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
378
+ }
379
+ let g, _ = "", ue, de = !1, fe = 0, me = function() {
380
+ if (fe > 0) throw S("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
381
+ }, he = function(e) {
382
+ me(), fe++;
383
+ try {
384
+ return g.createHTML(e);
385
+ } finally {
386
+ fe--;
387
+ }
388
+ }, ge = function(e) {
389
+ me(), fe++;
390
+ try {
391
+ return g.createScriptURL(e);
392
+ } finally {
393
+ fe--;
394
+ }
395
+ }, ke = function() {
396
+ return de ||= (ue = ft(u, i), !0), ue;
397
+ }, Ae = n, je = Ae.implementation, Me = Ae.createNodeIterator, Ne = Ae.createDocumentFragment, C = Ae.getElementsByTagName, Pe = r.importNode, T = pt();
398
+ t.isSupported = typeof le == "function" && typeof te == "function" && je && je.createHTMLDocument !== void 0;
399
+ let ct = Je, _t = Ye, vt = Xe, yt = Ze, bt = Qe, xt = et, St = tt, k = rt, Ct = $e, A = null, wt = w({}, [
400
+ ...Le,
401
+ ...Re,
402
+ ...ze,
403
+ ...Ve,
404
+ ...Ue
405
+ ]), j = null, Tt = w({}, [
406
+ ...We,
407
+ ...Ge,
408
+ ...Ke,
409
+ ...qe
410
+ ]), M = Object.seal(pe(null, {
411
+ tagNameCheck: {
412
+ writable: !0,
413
+ configurable: !1,
414
+ enumerable: !0,
415
+ value: null
416
+ },
417
+ attributeNameCheck: {
418
+ writable: !0,
419
+ configurable: !1,
420
+ enumerable: !0,
421
+ value: null
422
+ },
423
+ allowCustomizedBuiltInElements: {
424
+ writable: !0,
425
+ configurable: !1,
426
+ enumerable: !0,
427
+ value: !1
428
+ }
429
+ })), Et = null, Dt = null, N = Object.seal(pe(null, {
430
+ tagCheck: {
431
+ writable: !0,
432
+ configurable: !1,
433
+ enumerable: !0,
434
+ value: null
435
+ },
436
+ attributeCheck: {
437
+ writable: !0,
438
+ configurable: !1,
439
+ enumerable: !0,
440
+ value: null
441
+ }
442
+ })), Ot = !0, kt = !0, At = !1, jt = !0, P = !1, F = !0, I = !1, Mt = !1, Nt = null, Pt = null, Ft = !1, L = !1, It = !1, Lt = !1, Rt = !0, zt = !1, Bt = "user-content-", Vt = !0, Ht = !1, R = {}, z = null, Ut = w({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), Wt = null, Gt = w({}, [
443
+ "audio",
444
+ "video",
445
+ "img",
446
+ "source",
447
+ "image",
448
+ "track"
449
+ ]), Kt = null, qt = w({}, [
450
+ "alt",
451
+ "class",
452
+ "for",
453
+ "id",
454
+ "label",
455
+ "name",
456
+ "pattern",
457
+ "placeholder",
458
+ "role",
459
+ "summary",
460
+ "title",
461
+ "value",
462
+ "style",
463
+ "xmlns"
464
+ ]), Jt = "http://www.w3.org/1998/Math/MathML", Yt = "http://www.w3.org/2000/svg", B = "http://www.w3.org/1999/xhtml", Xt = B, Zt = !1, Qt = null, $t = w({}, [
465
+ Jt,
466
+ Yt,
467
+ B
468
+ ], we), en = v([
469
+ "mi",
470
+ "mo",
471
+ "mn",
472
+ "ms",
473
+ "mtext"
474
+ ]), tn = w({}, en), nn = v(["annotation-xml"]), rn = w({}, nn), an = w({}, [
475
+ "title",
476
+ "style",
477
+ "font",
478
+ "a",
479
+ "script"
480
+ ]), on = null, sn = ["application/xhtml+xml", "text/html"], V = null, cn = null, ln = n.createElement("form"), un = function(e) {
481
+ return e instanceof RegExp || e instanceof Function;
482
+ }, dn = function() {
483
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
484
+ if (cn && cn === e) return;
485
+ (!e || typeof e != "object") && (e = {}), e = E(e), on = sn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, V = on === "application/xhtml+xml" ? we : Ce, A = mt(e, "ALLOWED_TAGS", wt, { transform: V }), j = mt(e, "ALLOWED_ATTR", Tt, { transform: V }), Qt = mt(e, "ALLOWED_NAMESPACES", $t, { transform: we }), Kt = mt(e, "ADD_URI_SAFE_ATTR", qt, {
486
+ transform: V,
487
+ base: qt
488
+ }), Wt = mt(e, "ADD_DATA_URI_TAGS", Gt, {
489
+ transform: V,
490
+ base: Gt
491
+ }), z = mt(e, "FORBID_CONTENTS", Ut, { transform: V }), Et = mt(e, "FORBID_TAGS", E({}), { transform: V }), Dt = mt(e, "FORBID_ATTR", E({}), { transform: V }), R = b(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? E(e.USE_PROFILES) : e.USE_PROFILES : !1, Ot = e.ALLOW_ARIA_ATTR !== !1, kt = e.ALLOW_DATA_ATTR !== !1, At = e.ALLOW_UNKNOWN_PROTOCOLS || !1, jt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, P = e.SAFE_FOR_TEMPLATES || !1, F = e.SAFE_FOR_XML !== !1, I = e.WHOLE_DOCUMENT || !1, L = e.RETURN_DOM || !1, It = e.RETURN_DOM_FRAGMENT || !1, Lt = e.RETURN_TRUSTED_TYPE || !1, Ft = e.FORCE_BODY || !1, Rt = e.SANITIZE_DOM !== !1, zt = e.SANITIZE_NAMED_PROPS || !1, Vt = e.KEEP_CONTENT !== !1, Ht = e.IN_PLACE || !1, Ct = Ie(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : $e, Xt = typeof e.NAMESPACE == "string" ? e.NAMESPACE : B, tn = ht(e, "MATHML_TEXT_INTEGRATION_POINTS", () => w({}, en)), rn = ht(e, "HTML_INTEGRATION_POINTS", () => w({}, nn));
492
+ let t = ht(e, "CUSTOM_ELEMENT_HANDLING", () => pe(null));
493
+ if (M = pe(null), b(t, "tagNameCheck") && un(t.tagNameCheck) && (M.tagNameCheck = t.tagNameCheck), b(t, "attributeNameCheck") && un(t.attributeNameCheck) && (M.attributeNameCheck = t.attributeNameCheck), b(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (M.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), y(M), P && (kt = !1), It && (L = !0), R && (A = w({}, Ue), j = pe(null), R.html === !0 && (w(A, Le), w(j, We)), R.svg === !0 && (w(A, Re), w(j, Ge), w(j, qe)), R.svgFilters === !0 && (w(A, ze), w(j, Ge), w(j, qe)), R.mathMl === !0 && (w(A, Ve), w(j, Ke), w(j, qe))), N.tagCheck = null, N.attributeCheck = null, b(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? N.tagCheck = e.ADD_TAGS : Se(e.ADD_TAGS) && (A === wt && (A = E(A)), w(A, e.ADD_TAGS, V))), b(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? N.attributeCheck = e.ADD_ATTR : Se(e.ADD_ATTR) && (j === Tt && (j = E(j)), w(j, e.ADD_ATTR, V))), b(e, "ADD_FORBID_CONTENTS") && Se(e.ADD_FORBID_CONTENTS) && (z === Ut && (z = E(z)), w(z, e.ADD_FORBID_CONTENTS, V)), Vt && (A["#text"] = !0), I && w(A, [
494
+ "html",
495
+ "head",
496
+ "body"
497
+ ]), A.table && (w(A, ["tbody"]), delete Et.tbody), e.TRUSTED_TYPES_POLICY) {
498
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw S("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
499
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw S("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
500
+ let t = g;
501
+ g = e.TRUSTED_TYPES_POLICY;
502
+ try {
503
+ _ = he("");
504
+ } catch (e) {
505
+ throw g = t, e;
506
+ }
507
+ } else e.TRUSTED_TYPES_POLICY === null ? (g = void 0, _ = "") : (g === void 0 && (g = ke()), g && typeof _ == "string" && (_ = he("")));
508
+ v && v(e), cn = e;
509
+ }, fn = w({}, [
510
+ ...Re,
511
+ ...ze,
512
+ ...Be
513
+ ]), pn = w({}, [...Ve, ...He]), mn = function(e, t, n) {
514
+ return t.namespaceURI === B ? e === "svg" : t.namespaceURI === Jt ? e === "svg" && (n === "annotation-xml" || tn[n]) : !!fn[e];
515
+ }, hn = function(e, t, n) {
516
+ return t.namespaceURI === B ? e === "math" : t.namespaceURI === Yt ? e === "math" && rn[n] : !!pn[e];
517
+ }, gn = function(e, t, n) {
518
+ return t.namespaceURI === Yt && !rn[n] || t.namespaceURI === Jt && !tn[n] ? !1 : !pn[e] && (an[e] || !fn[e]);
519
+ }, _n = function(e) {
520
+ let t = te(e);
521
+ (!t || !t.tagName) && (t = {
522
+ namespaceURI: Xt,
523
+ tagName: "template"
524
+ });
525
+ let n = Ce(e.tagName), r = Ce(t.tagName);
526
+ return Qt[e.namespaceURI] ? e.namespaceURI === Yt ? mn(n, t, r) : e.namespaceURI === Jt ? hn(n, t, r) : e.namespaceURI === B ? gn(n, t, r) : !!(on === "application/xhtml+xml" && Qt[e.namespaceURI]) : !1;
527
+ }, H = function(e) {
528
+ be(t.removed, { element: e });
529
+ try {
530
+ te(e).removeChild(e);
531
+ } catch {
532
+ if (p(e), !te(e)) throw S("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
533
+ }
534
+ }, vn = function(e, t, n) {
535
+ try {
536
+ m(e, t);
537
+ } catch {
538
+ try {
539
+ e.removeAttribute(n);
540
+ } catch {}
541
+ }
542
+ }, yn = function(e) {
543
+ xn(e);
544
+ let t = h(e);
545
+ if (t) {
546
+ let e = [];
547
+ _e(t, (t) => {
548
+ be(e, t);
549
+ }), _e(e, (e) => {
550
+ try {
551
+ p(e);
552
+ } catch {}
553
+ });
554
+ }
555
+ let n = re(e);
556
+ if (n) for (let t = n.length - 1; t >= 0; --t) {
557
+ let r = n[t], i = r && r.name;
558
+ typeof i == "string" && vn(e, r, i);
559
+ }
560
+ }, U = function(e, n, r) {
561
+ if (!r) try {
562
+ r = n.getAttributeNode(e);
563
+ } catch {
564
+ r = null;
565
+ }
566
+ be(t.removed, {
567
+ attribute: r || null,
568
+ from: n
569
+ });
570
+ try {
571
+ r ? m(n, r) : n.removeAttribute(e);
572
+ } catch {
573
+ try {
574
+ n.removeAttribute(e);
575
+ } catch {}
576
+ }
577
+ if (e === "is") if (L || It) try {
578
+ H(n);
579
+ } catch {}
580
+ else try {
581
+ n.setAttribute(e, "");
582
+ } catch {}
583
+ }, bn = function(e) {
584
+ let t = re(e);
585
+ if (t) for (let n = t.length - 1; n >= 0; --n) {
586
+ let r = t[n], i = r && r.name;
587
+ typeof i != "string" || j[V(i)] || vn(e, r, i);
588
+ }
589
+ }, xn = function(e) {
590
+ let t = [e];
591
+ for (; t.length > 0;) {
592
+ let e = t.pop();
593
+ se(e) === O.element && bn(e);
594
+ let n = h(e);
595
+ if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
596
+ }
597
+ }, W = function(e, t) {
598
+ return F ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
599
+ }, Sn = function(e) {
600
+ if (!F) return;
601
+ let t = [e];
602
+ for (; t.length > 0;) {
603
+ let e = t.pop(), n = se(e);
604
+ if (n === O.processingInstruction || n === O.comment && x(at, e.data)) {
605
+ try {
606
+ p(e);
607
+ } catch {}
608
+ continue;
609
+ }
610
+ if (n === O.element) {
611
+ let t = e, n = V(ce(e));
612
+ try {
613
+ t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && W("for", n) && t.removeAttribute("for");
614
+ } catch {}
615
+ }
616
+ let r = h(e);
617
+ if (r) for (let e = r.length - 1; e >= 0; --e) t.push(r[e]);
618
+ }
619
+ }, Cn = function(e) {
620
+ let t = null, r = null;
621
+ if (Ft) e = "<remove></remove>" + e;
622
+ else {
623
+ let t = Te(e, /^[\r\n\t ]+/);
624
+ r = t && t[0];
625
+ }
626
+ on === "application/xhtml+xml" && Xt === B && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
627
+ let i = g ? he(e) : e;
628
+ if (Xt === B) try {
629
+ t = new l().parseFromString(i, on);
630
+ } catch {}
631
+ if (!t || !t.documentElement) {
632
+ t = je.createDocument(Xt, "template", null);
633
+ try {
634
+ t.documentElement.innerHTML = Zt ? _ : i;
635
+ } catch {}
636
+ }
637
+ let a = t.body || t.documentElement;
638
+ return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), Xt === B ? C.call(t, I ? "html" : "body")[0] : I ? t.documentElement : a;
639
+ }, wn = function(e) {
640
+ let t = oe ? oe(e) : e.ownerDocument;
641
+ return Me.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
642
+ }, Tn = function(e) {
643
+ return e = Ee(e, ct, " "), e = Ee(e, _t, " "), e = Ee(e, vt, " "), e;
644
+ }, En = function(e) {
645
+ e.normalize();
646
+ let t = oe ? oe(e) : e.ownerDocument, n = Me.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
647
+ for (; r;) r.data = Tn(r.data), r = n.nextNode();
648
+ let i = e.querySelectorAll?.call(e, "template");
649
+ i && _e(i, (e) => {
650
+ K(e.content) && En(e.content);
651
+ });
652
+ }, G = function(e) {
653
+ let t = ae ? ae(e) : null;
654
+ return typeof t != "string" || V(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== re(e) || typeof e.removeAttribute != "function" || typeof e.removeAttributeNode != "function" || typeof e.getAttributeNode != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== ie(e) || e.childNodes !== h(e);
655
+ }, K = function(e) {
656
+ if (!ie || typeof e != "object" || !e) return !1;
657
+ try {
658
+ return ie(e) === O.documentFragment;
659
+ } catch {
660
+ return !1;
661
+ }
662
+ }, q = function(e) {
663
+ if (!ie || typeof e != "object" || !e) return !1;
664
+ try {
665
+ return typeof ie(e) == "number";
666
+ } catch {
667
+ return !1;
668
+ }
669
+ };
670
+ function J(e, n, r) {
671
+ e.length !== 0 && _e(e, (e) => {
672
+ e.call(t, n, r, cn);
673
+ });
674
+ }
675
+ let Y = function(e, t) {
676
+ return !!(F && e.hasChildNodes() && !q(e.firstElementChild) && x(it, e.textContent) && x(it, e.innerHTML) || F && e.namespaceURI === B && lt[t] && (q(e.firstElementChild) || typeof e.textContent == "string" && x(ut[t], e.textContent)) || e.nodeType === O.processingInstruction || F && e.nodeType === O.comment && x(at, e.data));
677
+ }, X = function(e, t) {
678
+ return e instanceof RegExp ? x(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
679
+ }, Dn = function(e, t, n) {
680
+ if (!Et[t] && Mn(t) && X(M.tagNameCheck, t)) return !1;
681
+ if (Vt && !z[t]) {
682
+ let t = te(e), r = h(e);
683
+ if (r && t) {
684
+ let i = r.length;
685
+ for (let a = i - 1; a >= 0; --a) {
686
+ let i = e === n ? f(r[a], !0) : r[a];
687
+ t.insertBefore(i, ee(e));
688
+ }
689
+ }
690
+ }
691
+ return H(e), !0;
692
+ }, Z = function(e, t, n, r) {
693
+ return e.length === 0 ? t : t === n || t === r ? E(t) : t;
694
+ }, On = function(e, t) {
695
+ return e === t || te(e) !== null ? !1 : (Ht && xn(e), !0);
696
+ }, kn = function(e, n) {
697
+ if (J(T.beforeSanitizeElements, e, null), On(e, n)) return !0;
698
+ if (G(e)) return H(e), !0;
699
+ let r = V(ce(e));
700
+ if (A = Z(T.uponSanitizeElement, A, wt, Nt), J(T.uponSanitizeElement, e, {
701
+ tagName: r,
702
+ allowedTags: A
703
+ }), On(e, n)) return !0;
704
+ if (Y(e, r)) return H(e), !0;
705
+ if (Et[r] || !(N.tagCheck instanceof Function && N.tagCheck(r)) && !A[r]) {
706
+ let t = Dn(e, r, n);
707
+ return t === !1 && (J(T.afterSanitizeElements, e, null), On(e, n)) ? !0 : t;
708
+ }
709
+ if (se(e) === O.element && !_n(e) || (r === "noscript" || r === "noembed" || r === "noframes") && x(ot, e.innerHTML)) return H(e), !0;
710
+ if (P && e.nodeType === O.text) {
711
+ let n = Tn(e.textContent);
712
+ e.textContent !== n && (be(t.removed, { element: e.cloneNode() }), e.textContent = n);
713
+ }
714
+ return J(T.afterSanitizeElements, e, null), On(e, n);
715
+ }, An = function(e, t, r) {
716
+ if (Dt[t] || W(t, e) || Rt && (t === "id" || t === "name") && (r in n || r in ln)) return !1;
717
+ let i = j[t] || N.attributeCheck instanceof Function && N.attributeCheck(t, e);
718
+ return kt && x(yt, t) || Ot && x(bt, t) ? !0 : i ? Kt[t] || x(Ct, Ee(r, St, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && De(r, "data:") === 0 && Wt[e] || At && !x(xt, Ee(r, St, "")) ? !0 : !r : Mn(e) && X(M.tagNameCheck, e) && X(M.attributeNameCheck, t, e) || t === "is" && M.allowCustomizedBuiltInElements && X(M.tagNameCheck, r);
719
+ }, jn = w({}, [
720
+ "annotation-xml",
721
+ "color-profile",
722
+ "font-face",
723
+ "font-face-format",
724
+ "font-face-name",
725
+ "font-face-src",
726
+ "font-face-uri",
727
+ "missing-glyph"
728
+ ]), Mn = function(e) {
729
+ return !jn[Ce(e)] && x(k, e);
730
+ }, Nn = function(e, t, n, r) {
731
+ if (g && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
732
+ case "TrustedHTML": return he(r);
733
+ case "TrustedScriptURL": return ge(r);
734
+ }
735
+ return r;
736
+ }, Pn = function(e, t, n, r) {
737
+ try {
738
+ return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), G(e) ? (H(e), !1) : !0;
739
+ } catch {
740
+ return U(t, e), !1;
741
+ }
742
+ }, Fn = function(e, n) {
743
+ if (J(T.beforeSanitizeAttributes, e, null), On(e, n)) return;
744
+ let r = e.attributes;
745
+ if (!r || G(e)) return;
746
+ j = Z(T.uponSanitizeAttribute, j, Tt, Pt);
747
+ let i = {
748
+ attrName: "",
749
+ attrValue: "",
750
+ keepAttr: !0,
751
+ allowedAttributes: j,
752
+ forceKeepAttr: void 0
753
+ }, a = r.length, o = V(e.nodeName);
754
+ for (; a--;) {
755
+ let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = V(s), d = l, f = s === "value" ? d : Oe(d), p = !1;
756
+ if (i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, J(T.uponSanitizeAttribute, e, i), f = i.attrValue, zt && (u === "id" || u === "name") && De(f, Bt) !== 0 && (U(s, e, n), f = Bt + f, p = !0), F && x(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, f)) {
757
+ U(s, e, n);
758
+ continue;
759
+ }
760
+ if (u === "attributename" && Te(f, "href")) {
761
+ U(s, e, n);
762
+ continue;
763
+ }
764
+ if (!i.forceKeepAttr) {
765
+ if (!i.keepAttr) {
766
+ U(s, e, n);
767
+ continue;
768
+ }
769
+ if (!jt && x(st, f)) {
770
+ U(s, e, n);
771
+ continue;
772
+ }
773
+ if (P && (f = Tn(f)), !An(o, u, f)) {
774
+ U(s, e, n);
775
+ continue;
776
+ }
777
+ f = Nn(o, u, c, f), f !== d && Pn(e, s, c, f) && p && ye(t.removed);
778
+ }
779
+ }
780
+ J(T.afterSanitizeAttributes, e, null), On(e, n);
781
+ }, In = function(e) {
782
+ let t = null, n = wn(e);
783
+ for (J(T.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (J(T.uponSanitizeShadowNode, t, null), kn(t, e), Fn(t, e), K(t.content) && In(t.content), se(t) === O.element) {
784
+ let e = ne(t);
785
+ K(e) && (Ln(e), In(e));
786
+ }
787
+ J(T.afterSanitizeShadowDOM, e, null);
788
+ }, Ln = function(e) {
789
+ let t = [{
790
+ node: e,
791
+ shadow: null
792
+ }];
793
+ for (; t.length > 0;) {
794
+ let e = t.pop();
795
+ if (e.shadow) {
796
+ In(e.shadow);
797
+ continue;
798
+ }
799
+ let n = e.node, r = se(n) === O.element, i = h(n);
800
+ if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
801
+ node: i[e],
802
+ shadow: null
803
+ });
804
+ if (r) {
805
+ let e = ae ? ae(n) : null;
806
+ if (typeof e == "string" && V(e) === "template") {
807
+ let e = n.content;
808
+ K(e) && t.push({
809
+ node: e,
810
+ shadow: null
811
+ });
812
+ }
813
+ }
814
+ if (r) {
815
+ let e = ne(n);
816
+ K(e) && t.push({
817
+ node: null,
818
+ shadow: e
819
+ }, {
820
+ node: e,
821
+ shadow: null
822
+ });
823
+ }
824
+ }
825
+ };
826
+ return t.sanitize = function(e) {
827
+ let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
828
+ if (Zt = !e, Zt && (e = "<!-->"), typeof e != "string" && !q(e) && (e = Fe(e), typeof e != "string")) throw S("dirty is not a string, aborting");
829
+ if (!t.isSupported) return e;
830
+ Mt ? (A = Nt, j = Pt) : dn(n), (T.uponSanitizeElement.length > 0 || T.uponSanitizeAttribute.length > 0) && (A = E(A)), T.uponSanitizeAttribute.length > 0 && (j = E(j)), t.removed = [];
831
+ let c = Ht && typeof e != "string" && q(e);
832
+ if (c) {
833
+ Sn(e);
834
+ let t = ce(e);
835
+ if (typeof t == "string") {
836
+ let n = V(t);
837
+ if (!A[n] || Et[n]) throw yn(e), S("root node is forbidden and cannot be sanitized in-place");
838
+ }
839
+ if (G(e)) throw yn(e), S("root node is clobbered and cannot be sanitized in-place");
840
+ try {
841
+ Ln(e);
842
+ } catch (t) {
843
+ throw yn(e), t;
844
+ }
845
+ } else if (q(e)) i = Cn("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === O.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), Ln(i);
846
+ else {
847
+ if (!L && !P && !I && e.indexOf("<") === -1) return g && Lt ? he(e) : e;
848
+ if (i = Cn(e), !i) return L ? null : Lt ? _ : "";
849
+ }
850
+ i && Ft && H(i.firstChild);
851
+ let l = c ? e : i;
852
+ try {
853
+ let e = wn(l);
854
+ for (; o = e.nextNode();) kn(o, l), Fn(o, l), K(o.content) && In(o.content);
855
+ } catch (n) {
856
+ throw c && (yn(e), _e(t.removed, (e) => {
857
+ e.element && xn(e.element);
858
+ })), n;
859
+ }
860
+ if (c) {
861
+ let n = !1;
862
+ if (_e(t.removed, (t) => {
863
+ t.element && (t.element === e && (n = !0), xn(t.element));
864
+ }), n) throw S("a node selected for removal could not be safely returned; refusing to sanitize in place");
865
+ return P && En(e), e;
866
+ }
867
+ if (L) {
868
+ if (P && En(i), It) for (s = Ne.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
869
+ else s = i;
870
+ return (j.shadowroot || j.shadowrootmode) && (s = Pe.call(r, s, !0)), s;
871
+ }
872
+ let u = I ? i.outerHTML : i.innerHTML;
873
+ return I && A["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && x(nt, i.ownerDocument.doctype.name) && (u = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + u), P && (u = Tn(u)), g && Lt ? he(u) : u;
874
+ }, t.setConfig = function() {
875
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
876
+ dn(e), Mt = !0, Nt = A, Pt = j;
877
+ }, t.clearConfig = function() {
878
+ cn = null, Mt = !1, Nt = null, Pt = null, g = ue, _ = "";
879
+ }, t.isValidAttribute = function(e, t, n) {
880
+ cn || dn({});
881
+ let r = V(e), i = V(t);
882
+ return An(r, i, n);
883
+ }, t.addHook = function(e, t) {
884
+ typeof t == "function" && b(T, e) && be(T[e], t);
885
+ }, t.removeHook = function(e, t) {
886
+ if (b(T, e)) {
887
+ if (t !== void 0) {
888
+ let n = ve(T[e], t);
889
+ return n === -1 ? void 0 : xe(T[e], n, 1)[0];
890
+ }
891
+ return ye(T[e]);
892
+ }
893
+ }, t.removeHooks = function(e) {
894
+ b(T, e) && (T[e] = []);
895
+ }, t.removeAllHooks = function() {
896
+ T = pt();
897
+ }, t;
898
+ }
899
+ var _t = gt();
900
+ //#endregion
901
+ //#region node_modules/marked/lib/marked.esm.js
902
+ function vt() {
903
+ return {
904
+ async: !1,
905
+ breaks: !1,
906
+ extensions: null,
907
+ gfm: !0,
908
+ hooks: null,
909
+ pedantic: !1,
910
+ renderer: null,
911
+ silent: !1,
912
+ tokenizer: null,
913
+ walkTokens: null
914
+ };
915
+ }
916
+ var yt = vt();
917
+ function bt(e) {
918
+ yt = e;
919
+ }
920
+ var xt = { exec: () => null };
921
+ function St(e) {
922
+ let t = [];
923
+ return (n) => {
924
+ let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
925
+ return i || (i = e(r), t[r] = i), i;
926
+ };
927
+ }
928
+ function k(e, t = "") {
929
+ let n = typeof e == "string" ? e : e.source, r = {
930
+ replace: (e, t) => {
931
+ let i = typeof t == "string" ? t : t.source;
932
+ return i = i.replace(A.caret, "$1"), n = n.replace(e, i), r;
933
+ },
934
+ getRegex: () => new RegExp(n, t)
935
+ };
936
+ return r;
937
+ }
938
+ var Ct = ((e = "") => {
939
+ try {
940
+ return !!RegExp("(?<=1)(?<!1)" + e);
941
+ } catch {
942
+ return !1;
943
+ }
944
+ })(), A = {
945
+ codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
946
+ outputLinkReplace: /\\([\[\]])/g,
947
+ indentCodeCompensation: /^(\s+)(?:```)/,
948
+ beginningSpace: /^\s+/,
949
+ endingHash: /#$/,
950
+ startingSpaceChar: /^ /,
951
+ endingSpaceChar: / $/,
952
+ nonSpaceChar: /[^ ]/,
953
+ newLineCharGlobal: /\n/g,
954
+ tabCharGlobal: /\t/g,
955
+ multipleSpaceGlobal: /\s+/g,
956
+ blankLine: /^[ \t]*$/,
957
+ doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
958
+ blockquoteStart: /^ {0,3}>/,
959
+ blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
960
+ blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
961
+ listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
962
+ listIsTask: /^\[[ xX]\] +\S/,
963
+ listReplaceTask: /^\[[ xX]\] +/,
964
+ listTaskCheckbox: /\[[ xX]\]/,
965
+ anyLine: /\n.*\n/,
966
+ hrefBrackets: /^<(.*)>$/,
967
+ tableDelimiter: /[:|]/,
968
+ tableAlignChars: /^\||\| *$/g,
969
+ tableRowBlankLine: /\n[ \t]*$/,
970
+ tableAlignRight: /^ *-+: *$/,
971
+ tableAlignCenter: /^ *:-+: *$/,
972
+ tableAlignLeft: /^ *:-+ *$/,
973
+ startATag: /^<a /i,
974
+ endATag: /^<\/a>/i,
975
+ startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
976
+ endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
977
+ startAngleBracket: /^</,
978
+ endAngleBracket: />$/,
979
+ pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
980
+ unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
981
+ escapeTest: /[&<>"']/,
982
+ escapeReplace: /[&<>"']/g,
983
+ escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
984
+ escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
985
+ caret: /(^|[^\[])\^/g,
986
+ percentDecode: /%25/g,
987
+ findPipe: /\|/g,
988
+ splitPipe: / \|/,
989
+ slashPipe: /\\\|/g,
990
+ carriageReturn: /\r\n|\r/g,
991
+ spaceLine: /^ +$/gm,
992
+ notSpaceStart: /^\S*/,
993
+ endingNewline: /\n$/,
994
+ listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
995
+ nextBulletRegex: St((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
996
+ hrRegex: St((e) => RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),
997
+ fencesBeginRegex: St((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
998
+ headingBeginRegex: St((e) => RegExp(`^ {0,${e}}#`)),
999
+ htmlBeginRegex: St((e) => RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`, "i")),
1000
+ blockquoteBeginRegex: St((e) => RegExp(`^ {0,${e}}>`))
1001
+ }, wt = /^(?:[ \t]*(?:\n|$))+/, j = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Tt = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, M = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Et = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Dt = / {0,3}(?:[*+-]|\d{1,9}[.)])/, N = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ot = k(N).replace(/bull/g, Dt).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), kt = k(N).replace(/bull/g, Dt).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), At = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, jt = /^[^\n]+/, P = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, F = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", P).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), I = k(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Dt).getRegex(), Mt = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", Nt = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Pt = k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Nt).replace("tag", Mt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Ft = k(At).replace("hr", M).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Mt).getRegex(), L = {
1002
+ blockquote: k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ft).getRegex(),
1003
+ code: j,
1004
+ def: F,
1005
+ fences: Tt,
1006
+ heading: Et,
1007
+ hr: M,
1008
+ html: Pt,
1009
+ lheading: Ot,
1010
+ list: I,
1011
+ newline: wt,
1012
+ paragraph: Ft,
1013
+ table: xt,
1014
+ text: jt
1015
+ }, It = k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", M).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Mt).getRegex(), Lt = {
1016
+ ...L,
1017
+ lheading: kt,
1018
+ table: It,
1019
+ paragraph: k(At).replace("hr", M).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", It).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Mt).getRegex()
1020
+ }, Rt = {
1021
+ ...L,
1022
+ html: k("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Nt).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
1023
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
1024
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
1025
+ fences: xt,
1026
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
1027
+ paragraph: k(At).replace("hr", M).replace("heading", " *#{1,6} *[^\n]").replace("lheading", Ot).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
1028
+ }, zt = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Bt = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Vt = /^( {2,}|\\)\n(?!\s*$)/, Ht = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, R = /[\p{P}\p{S}]/u, z = /[\s\p{P}\p{S}]/u, Ut = /[^\s\p{P}\p{S}]/u, Wt = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, z).getRegex(), Gt = /(?!~)[\p{P}\p{S}]/u, Kt = /(?!~)[\s\p{P}\p{S}]/u, qt = /(?:[^\s\p{P}\p{S}]|~)/u, Jt = k(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Ct ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Yt = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, B = k(Yt, "u").replace(/punct/g, R).getRegex(), Xt = k(Yt, "u").replace(/punct/g, Gt).getRegex(), Zt = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Qt = k(Zt, "gu").replace(/notPunctSpace/g, Ut).replace(/punctSpace/g, z).replace(/punct/g, R).getRegex(), $t = k(Zt, "gu").replace(/notPunctSpace/g, qt).replace(/punctSpace/g, Kt).replace(/punct/g, Gt).getRegex(), en = k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Ut).replace(/punctSpace/g, z).replace(/punct/g, R).getRegex(), tn = k(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, R).getRegex(), nn = k("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Ut).replace(/punctSpace/g, z).replace(/punct/g, R).getRegex(), rn = k(/\\(punct)/, "gu").replace(/punct/g, R).getRegex(), an = k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), on = k(Nt).replace("(?:-->|$)", "-->").getRegex(), sn = k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", on).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), V = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, cn = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", V).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ln = k(/^!?\[(label)\]\[(ref)\]/).replace("label", V).replace("ref", P).getRegex(), un = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", P).getRegex(), dn = k("reflink|nolink(?!\\()", "g").replace("reflink", ln).replace("nolink", un).getRegex(), fn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, pn = {
1029
+ _backpedal: xt,
1030
+ anyPunctuation: rn,
1031
+ autolink: an,
1032
+ blockSkip: Jt,
1033
+ br: Vt,
1034
+ code: Bt,
1035
+ del: xt,
1036
+ delLDelim: xt,
1037
+ delRDelim: xt,
1038
+ emStrongLDelim: B,
1039
+ emStrongRDelimAst: Qt,
1040
+ emStrongRDelimUnd: en,
1041
+ escape: zt,
1042
+ link: cn,
1043
+ nolink: un,
1044
+ punctuation: Wt,
1045
+ reflink: ln,
1046
+ reflinkSearch: dn,
1047
+ tag: sn,
1048
+ text: Ht,
1049
+ url: xt
1050
+ }, mn = {
1051
+ ...pn,
1052
+ link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", V).getRegex(),
1053
+ reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", V).getRegex()
1054
+ }, hn = {
1055
+ ...pn,
1056
+ emStrongRDelimAst: $t,
1057
+ emStrongLDelim: Xt,
1058
+ delLDelim: tn,
1059
+ delRDelim: nn,
1060
+ url: k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", fn).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
1061
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
1062
+ del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
1063
+ text: k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", fn).getRegex()
1064
+ }, gn = {
1065
+ ...hn,
1066
+ br: k(Vt).replace("{2,}", "*").getRegex(),
1067
+ text: k(hn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
1068
+ }, _n = {
1069
+ normal: L,
1070
+ gfm: Lt,
1071
+ pedantic: Rt
1072
+ }, H = {
1073
+ normal: pn,
1074
+ gfm: hn,
1075
+ breaks: gn,
1076
+ pedantic: mn
1077
+ }, vn = {
1078
+ "&": "&amp;",
1079
+ "<": "&lt;",
1080
+ ">": "&gt;",
1081
+ "\"": "&quot;",
1082
+ "'": "&#39;"
1083
+ }, yn = (e) => vn[e];
1084
+ function U(e, t) {
1085
+ if (t) {
1086
+ if (A.escapeTest.test(e)) return e.replace(A.escapeReplace, yn);
1087
+ } else if (A.escapeTestNoEncode.test(e)) return e.replace(A.escapeReplaceNoEncode, yn);
1088
+ return e;
1089
+ }
1090
+ function bn(e) {
1091
+ try {
1092
+ e = encodeURI(e).replace(A.percentDecode, "%");
1093
+ } catch {
1094
+ return null;
1095
+ }
1096
+ return e;
1097
+ }
1098
+ function xn(e, t) {
1099
+ let n = e.replace(A.findPipe, (e, t, n) => {
1100
+ let r = !1, i = t;
1101
+ for (; --i >= 0 && n[i] === "\\";) r = !r;
1102
+ return r ? "|" : " |";
1103
+ }).split(A.splitPipe), r = 0;
1104
+ if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
1105
+ else for (; n.length < t;) n.push("");
1106
+ for (; r < n.length; r++) n[r] = n[r].trim().replace(A.slashPipe, "|");
1107
+ return n;
1108
+ }
1109
+ function W(e, t, n) {
1110
+ let r = e.length;
1111
+ if (r === 0) return "";
1112
+ let i = 0;
1113
+ for (; i < r;) {
1114
+ let a = e.charAt(r - i - 1);
1115
+ if (a === t && !n) i++;
1116
+ else if (a !== t && n) i++;
1117
+ else break;
1118
+ }
1119
+ return e.slice(0, r - i);
1120
+ }
1121
+ function Sn(e) {
1122
+ let t = e.split("\n"), n = t.length - 1;
1123
+ for (; n >= 0 && A.blankLine.test(t[n]);) n--;
1124
+ return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
1125
+ }
1126
+ function Cn(e, t) {
1127
+ if (e.indexOf(t[1]) === -1) return -1;
1128
+ let n = 0;
1129
+ for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
1130
+ else if (e[r] === t[0]) n++;
1131
+ else if (e[r] === t[1] && (n--, n < 0)) return r;
1132
+ return n > 0 ? -2 : -1;
1133
+ }
1134
+ function wn(e, t = 0) {
1135
+ let n = t, r = "";
1136
+ for (let t of e) if (t === " ") {
1137
+ let e = 4 - n % 4;
1138
+ r += " ".repeat(e), n += e;
1139
+ } else r += t, n++;
1140
+ return r;
1141
+ }
1142
+ function Tn(e, t, n, r, i) {
1143
+ let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1");
1144
+ r.state.inLink = !0;
1145
+ let c = {
1146
+ type: e[0].charAt(0) === "!" ? "image" : "link",
1147
+ raw: n,
1148
+ href: a,
1149
+ title: o,
1150
+ text: s,
1151
+ tokens: r.inlineTokens(s)
1152
+ };
1153
+ return r.state.inLink = !1, c;
1154
+ }
1155
+ function En(e, t, n) {
1156
+ let r = e.match(n.other.indentCodeCompensation);
1157
+ if (r === null) return t;
1158
+ let i = r[1];
1159
+ return t.split("\n").map((e) => {
1160
+ let t = e.match(n.other.beginningSpace);
1161
+ if (t === null) return e;
1162
+ let [r] = t;
1163
+ return r.length >= i.length ? e.slice(i.length) : e;
1164
+ }).join("\n");
1165
+ }
1166
+ var G = class {
1167
+ options;
1168
+ rules;
1169
+ lexer;
1170
+ constructor(e) {
1171
+ this.options = e || yt;
1172
+ }
1173
+ space(e) {
1174
+ let t = this.rules.block.newline.exec(e);
1175
+ if (t && t[0].length > 0) return {
1176
+ type: "space",
1177
+ raw: t[0]
1178
+ };
1179
+ }
1180
+ code(e) {
1181
+ let t = this.rules.block.code.exec(e);
1182
+ if (t) {
1183
+ let e = this.options.pedantic ? t[0] : Sn(t[0]);
1184
+ return {
1185
+ type: "code",
1186
+ raw: e,
1187
+ codeBlockStyle: "indented",
1188
+ text: e.replace(this.rules.other.codeRemoveIndent, "")
1189
+ };
1190
+ }
1191
+ }
1192
+ fences(e) {
1193
+ let t = this.rules.block.fences.exec(e);
1194
+ if (t) {
1195
+ let e = t[0], n = En(e, t[3] || "", this.rules);
1196
+ return {
1197
+ type: "code",
1198
+ raw: e,
1199
+ lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
1200
+ text: n
1201
+ };
1202
+ }
1203
+ }
1204
+ heading(e) {
1205
+ let t = this.rules.block.heading.exec(e);
1206
+ if (t) {
1207
+ let e = t[2].trim();
1208
+ if (this.rules.other.endingHash.test(e)) {
1209
+ let t = W(e, "#");
1210
+ (this.options.pedantic || !t || this.rules.other.endingSpaceChar.test(t)) && (e = t.trim());
1211
+ }
1212
+ return {
1213
+ type: "heading",
1214
+ raw: W(t[0], "\n"),
1215
+ depth: t[1].length,
1216
+ text: e,
1217
+ tokens: this.lexer.inline(e)
1218
+ };
1219
+ }
1220
+ }
1221
+ hr(e) {
1222
+ let t = this.rules.block.hr.exec(e);
1223
+ if (t) return {
1224
+ type: "hr",
1225
+ raw: W(t[0], "\n")
1226
+ };
1227
+ }
1228
+ blockquote(e) {
1229
+ let t = this.rules.block.blockquote.exec(e);
1230
+ if (t) {
1231
+ let e = W(t[0], "\n").split("\n"), n = "", r = "", i = [];
1232
+ for (; e.length > 0;) {
1233
+ let t = !1, a = [], o;
1234
+ for (o = 0; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
1235
+ else if (!t) a.push(e[o]);
1236
+ else break;
1237
+ e = e.slice(o);
1238
+ let s = a.join("\n"), c = s.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
1239
+ n = n ? `${n}
1240
+ ${s}` : s, r = r ? `${r}
1241
+ ${c}` : c;
1242
+ let l = this.lexer.state.top;
1243
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = l, e.length === 0) break;
1244
+ let u = i.at(-1);
1245
+ if (u?.type === "code") break;
1246
+ if (u?.type === "blockquote") {
1247
+ let t = u, a = t.raw + "\n" + e.join("\n"), o = this.blockquote(a);
1248
+ i[i.length - 1] = o, n = n.substring(0, n.length - t.raw.length) + o.raw, r = r.substring(0, r.length - t.text.length) + o.text;
1249
+ break;
1250
+ } else if (u?.type === "list") {
1251
+ let t = u, a = t.raw + "\n" + e.join("\n"), o = this.list(a);
1252
+ i[i.length - 1] = o, n = n.substring(0, n.length - u.raw.length) + o.raw, r = r.substring(0, r.length - t.raw.length) + o.raw, e = a.substring(i.at(-1).raw.length).split("\n");
1253
+ continue;
1254
+ }
1255
+ }
1256
+ return {
1257
+ type: "blockquote",
1258
+ raw: n,
1259
+ tokens: i,
1260
+ text: r
1261
+ };
1262
+ }
1263
+ }
1264
+ list(e) {
1265
+ let t = this.rules.block.list.exec(e);
1266
+ if (t) {
1267
+ let n = t[1].trim(), r = n.length > 1, i = {
1268
+ type: "list",
1269
+ raw: "",
1270
+ ordered: r,
1271
+ start: r ? +n.slice(0, -1) : "",
1272
+ loose: !1,
1273
+ items: []
1274
+ };
1275
+ n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
1276
+ let a = this.rules.other.listItemRegex(n), o = !1;
1277
+ for (; e;) {
1278
+ let n = !1, r = "", s = "";
1279
+ if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
1280
+ r = t[0], e = e.substring(r.length);
1281
+ let c = wn(t[2].split("\n", 1)[0], t[1].length), l = e.split("\n", 1)[0], u = !c.trim(), d = 0;
1282
+ if (this.options.pedantic ? (d = 2, s = c.trimStart()) : u ? d = t[1].length + 1 : (d = c.search(this.rules.other.nonSpaceChar), d = d > 4 ? 1 : d, s = c.slice(d), d += t[1].length), u && this.rules.other.blankLine.test(l) && (r += l + "\n", e = e.substring(l.length + 1), n = !0), !n) {
1283
+ let t = this.rules.other.nextBulletRegex(d), n = this.rules.other.hrRegex(d), i = this.rules.other.fencesBeginRegex(d), a = this.rules.other.headingBeginRegex(d), o = this.rules.other.htmlBeginRegex(d), f = this.rules.other.blockquoteBeginRegex(d);
1284
+ for (; e;) {
1285
+ let p = e.split("\n", 1)[0], m;
1286
+ if (l = p, this.options.pedantic ? (l = l.replace(this.rules.other.listReplaceNesting, " "), m = l) : m = l.replace(this.rules.other.tabCharGlobal, " "), i.test(l) || a.test(l) || o.test(l) || f.test(l) || t.test(l) || n.test(l)) break;
1287
+ if (m.search(this.rules.other.nonSpaceChar) >= d || !l.trim()) s += "\n" + m.slice(d);
1288
+ else {
1289
+ if (u || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(c) || a.test(c) || n.test(c)) break;
1290
+ s += "\n" + l;
1291
+ }
1292
+ u = !l.trim(), r += p + "\n", e = e.substring(p.length + 1), c = m.slice(d);
1293
+ }
1294
+ }
1295
+ i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0)), i.items.push({
1296
+ type: "list_item",
1297
+ raw: r,
1298
+ task: !!this.options.gfm && this.rules.other.listIsTask.test(s),
1299
+ loose: !1,
1300
+ text: s,
1301
+ tokens: []
1302
+ }), i.raw += r;
1303
+ }
1304
+ let s = i.items.at(-1);
1305
+ if (s) s.raw = s.raw.trimEnd(), s.text = s.text.trimEnd();
1306
+ else return;
1307
+ i.raw = i.raw.trimEnd();
1308
+ for (let e of i.items) {
1309
+ this.lexer.state.top = !1, e.tokens = this.lexer.blockTokens(e.text, []);
1310
+ let t = e.tokens[0];
1311
+ if (e.task && (t?.type === "text" || t?.type === "paragraph")) {
1312
+ e.text = e.text.replace(this.rules.other.listReplaceTask, ""), t.raw = t.raw.replace(this.rules.other.listReplaceTask, ""), t.text = t.text.replace(this.rules.other.listReplaceTask, "");
1313
+ for (let e = this.lexer.inlineQueue.length - 1; e >= 0; e--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)) {
1314
+ this.lexer.inlineQueue[e].src = this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask, "");
1315
+ break;
1316
+ }
1317
+ let n = this.rules.other.listTaskCheckbox.exec(e.raw);
1318
+ if (n) {
1319
+ let t = {
1320
+ type: "checkbox",
1321
+ raw: n[0] + " ",
1322
+ checked: n[0] !== "[ ]"
1323
+ };
1324
+ e.checked = t.checked, i.loose ? e.tokens[0] && ["paragraph", "text"].includes(e.tokens[0].type) && "tokens" in e.tokens[0] && e.tokens[0].tokens ? (e.tokens[0].raw = t.raw + e.tokens[0].raw, e.tokens[0].text = t.raw + e.tokens[0].text, e.tokens[0].tokens.unshift(t)) : e.tokens.unshift({
1325
+ type: "paragraph",
1326
+ raw: t.raw,
1327
+ text: t.raw,
1328
+ tokens: [t]
1329
+ }) : e.tokens.unshift(t);
1330
+ }
1331
+ } else e.task &&= !1;
1332
+ if (!i.loose) {
1333
+ let t = e.tokens.filter((e) => e.type === "space");
1334
+ i.loose = t.length > 0 && t.some((e) => this.rules.other.anyLine.test(e.raw));
1335
+ }
1336
+ }
1337
+ if (i.loose) for (let e of i.items) {
1338
+ e.loose = !0;
1339
+ for (let t of e.tokens) t.type === "text" && (t.type = "paragraph");
1340
+ }
1341
+ return i;
1342
+ }
1343
+ }
1344
+ html(e) {
1345
+ let t = this.rules.block.html.exec(e);
1346
+ if (t) {
1347
+ let e = Sn(t[0]);
1348
+ return {
1349
+ type: "html",
1350
+ block: !0,
1351
+ raw: e,
1352
+ pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
1353
+ text: e
1354
+ };
1355
+ }
1356
+ }
1357
+ def(e) {
1358
+ let t = this.rules.block.def.exec(e);
1359
+ if (t) {
1360
+ let e = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
1361
+ return {
1362
+ type: "def",
1363
+ tag: e,
1364
+ raw: W(t[0], "\n"),
1365
+ href: n,
1366
+ title: r
1367
+ };
1368
+ }
1369
+ }
1370
+ table(e) {
1371
+ let t = this.rules.block.table.exec(e);
1372
+ if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
1373
+ let n = xn(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
1374
+ type: "table",
1375
+ raw: W(t[0], "\n"),
1376
+ header: [],
1377
+ align: [],
1378
+ rows: []
1379
+ };
1380
+ if (n.length === r.length) {
1381
+ for (let e of r) this.rules.other.tableAlignRight.test(e) ? a.align.push("right") : this.rules.other.tableAlignCenter.test(e) ? a.align.push("center") : this.rules.other.tableAlignLeft.test(e) ? a.align.push("left") : a.align.push(null);
1382
+ for (let e = 0; e < n.length; e++) a.header.push({
1383
+ text: n[e],
1384
+ tokens: this.lexer.inline(n[e]),
1385
+ header: !0,
1386
+ align: a.align[e]
1387
+ });
1388
+ for (let e of i) a.rows.push(xn(e, a.header.length).map((e, t) => ({
1389
+ text: e,
1390
+ tokens: this.lexer.inline(e),
1391
+ header: !1,
1392
+ align: a.align[t]
1393
+ })));
1394
+ return a;
1395
+ }
1396
+ }
1397
+ lheading(e) {
1398
+ let t = this.rules.block.lheading.exec(e);
1399
+ if (t) {
1400
+ let e = t[1].trim();
1401
+ return {
1402
+ type: "heading",
1403
+ raw: W(t[0], "\n"),
1404
+ depth: t[2].charAt(0) === "=" ? 1 : 2,
1405
+ text: e,
1406
+ tokens: this.lexer.inline(e)
1407
+ };
1408
+ }
1409
+ }
1410
+ paragraph(e) {
1411
+ let t = this.rules.block.paragraph.exec(e);
1412
+ if (t) {
1413
+ let e = t[1].charAt(t[1].length - 1) === "\n" ? t[1].slice(0, -1) : t[1];
1414
+ return {
1415
+ type: "paragraph",
1416
+ raw: t[0],
1417
+ text: e,
1418
+ tokens: this.lexer.inline(e)
1419
+ };
1420
+ }
1421
+ }
1422
+ text(e) {
1423
+ let t = this.rules.block.text.exec(e);
1424
+ if (t) return {
1425
+ type: "text",
1426
+ raw: t[0],
1427
+ text: t[0],
1428
+ tokens: this.lexer.inline(t[0])
1429
+ };
1430
+ }
1431
+ escape(e) {
1432
+ let t = this.rules.inline.escape.exec(e);
1433
+ if (t) return {
1434
+ type: "escape",
1435
+ raw: t[0],
1436
+ text: t[1]
1437
+ };
1438
+ }
1439
+ tag(e) {
1440
+ let t = this.rules.inline.tag.exec(e);
1441
+ if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
1442
+ type: "html",
1443
+ raw: t[0],
1444
+ inLink: this.lexer.state.inLink,
1445
+ inRawBlock: this.lexer.state.inRawBlock,
1446
+ block: !1,
1447
+ text: t[0]
1448
+ };
1449
+ }
1450
+ link(e) {
1451
+ let t = this.rules.inline.link.exec(e);
1452
+ if (t) {
1453
+ let e = t[2].trim();
1454
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e)) {
1455
+ if (!this.rules.other.endAngleBracket.test(e)) return;
1456
+ let t = W(e.slice(0, -1), "\\");
1457
+ if ((e.length - t.length) % 2 == 0) return;
1458
+ } else {
1459
+ let e = Cn(t[2], "()");
1460
+ if (e === -2) return;
1461
+ if (e > -1) {
1462
+ let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
1463
+ t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "";
1464
+ }
1465
+ }
1466
+ let n = t[2], r = "";
1467
+ if (this.options.pedantic) {
1468
+ let e = this.rules.other.pedanticHrefTitle.exec(n);
1469
+ e && (n = e[1], r = e[3]);
1470
+ } else r = t[3] ? t[3].slice(1, -1) : "";
1471
+ return n = n.trim(), this.rules.other.startAngleBracket.test(n) && (n = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? n.slice(1) : n.slice(1, -1)), Tn(t, {
1472
+ href: n && n.replace(this.rules.inline.anyPunctuation, "$1"),
1473
+ title: r && r.replace(this.rules.inline.anyPunctuation, "$1")
1474
+ }, t[0], this.lexer, this.rules);
1475
+ }
1476
+ }
1477
+ reflink(e, t) {
1478
+ let n;
1479
+ if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
1480
+ let e = t[(n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
1481
+ if (!e) {
1482
+ let e = n[0].charAt(0);
1483
+ return {
1484
+ type: "text",
1485
+ raw: e,
1486
+ text: e
1487
+ };
1488
+ }
1489
+ return Tn(n, e, n[0], this.lexer, this.rules);
1490
+ }
1491
+ }
1492
+ emStrong(e, t, n = "") {
1493
+ let r = this.rules.inline.emStrongLDelim.exec(e);
1494
+ if (!(!r || !r[1] && !r[2] && !r[3] && !r[4] || r[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[3]) || !n || this.rules.inline.punctuation.exec(n))) {
1495
+ let n = [...r[0]].length - 1, i, a, o = n, s = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
1496
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = c.exec(t)) !== null;) {
1497
+ if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i) continue;
1498
+ if (a = [...i].length, r[3] || r[4]) {
1499
+ o += a;
1500
+ continue;
1501
+ } else if ((r[5] || r[6]) && n % 3 && !((n + a) % 3)) {
1502
+ s += a;
1503
+ continue;
1504
+ }
1505
+ if (o -= a, o > 0) continue;
1506
+ a = Math.min(a, a + o + s);
1507
+ let t = [...r[0]][0].length, c = e.slice(0, n + r.index + t + a);
1508
+ if (Math.min(n, a) % 2) {
1509
+ let e = c.slice(1, -1);
1510
+ return {
1511
+ type: "em",
1512
+ raw: c,
1513
+ text: e,
1514
+ tokens: this.lexer.inlineTokens(e)
1515
+ };
1516
+ }
1517
+ let l = c.slice(2, -2);
1518
+ return {
1519
+ type: "strong",
1520
+ raw: c,
1521
+ text: l,
1522
+ tokens: this.lexer.inlineTokens(l)
1523
+ };
1524
+ }
1525
+ }
1526
+ }
1527
+ codespan(e) {
1528
+ let t = this.rules.inline.code.exec(e);
1529
+ if (t) {
1530
+ let e = t[2].replace(this.rules.other.newLineCharGlobal, " "), n = this.rules.other.nonSpaceChar.test(e), r = this.rules.other.startingSpaceChar.test(e) && this.rules.other.endingSpaceChar.test(e);
1531
+ return n && r && (e = e.substring(1, e.length - 1)), {
1532
+ type: "codespan",
1533
+ raw: t[0],
1534
+ text: e
1535
+ };
1536
+ }
1537
+ }
1538
+ br(e) {
1539
+ let t = this.rules.inline.br.exec(e);
1540
+ if (t) return {
1541
+ type: "br",
1542
+ raw: t[0]
1543
+ };
1544
+ }
1545
+ del(e, t, n = "") {
1546
+ let r = this.rules.inline.delLDelim.exec(e);
1547
+ if (r && (!r[1] || !n || this.rules.inline.punctuation.exec(n))) {
1548
+ let n = [...r[0]].length - 1, i, a, o = n, s = this.rules.inline.delRDelim;
1549
+ for (s.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = s.exec(t)) !== null;) {
1550
+ if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i || (a = [...i].length, a !== n)) continue;
1551
+ if (r[3] || r[4]) {
1552
+ o += a;
1553
+ continue;
1554
+ }
1555
+ if (o -= a, o > 0) continue;
1556
+ a = Math.min(a, a + o);
1557
+ let t = [...r[0]][0].length, s = e.slice(0, n + r.index + t + a), c = s.slice(n, -n);
1558
+ return {
1559
+ type: "del",
1560
+ raw: s,
1561
+ text: c,
1562
+ tokens: this.lexer.inlineTokens(c)
1563
+ };
1564
+ }
1565
+ }
1566
+ }
1567
+ autolink(e) {
1568
+ let t = this.rules.inline.autolink.exec(e);
1569
+ if (t) {
1570
+ let e, n;
1571
+ return t[2] === "@" ? (e = t[1], n = "mailto:" + e) : (e = t[1], n = e), {
1572
+ type: "link",
1573
+ raw: t[0],
1574
+ text: e,
1575
+ href: n,
1576
+ tokens: [{
1577
+ type: "text",
1578
+ raw: e,
1579
+ text: e
1580
+ }]
1581
+ };
1582
+ }
1583
+ }
1584
+ url(e) {
1585
+ let t;
1586
+ if (t = this.rules.inline.url.exec(e)) {
1587
+ let e, n;
1588
+ if (t[2] === "@") e = t[0], n = "mailto:" + e;
1589
+ else {
1590
+ let r;
1591
+ do
1592
+ r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
1593
+ while (r !== t[0]);
1594
+ e = t[0], n = t[1] === "www." ? "http://" + t[0] : t[0];
1595
+ }
1596
+ return {
1597
+ type: "link",
1598
+ raw: t[0],
1599
+ text: e,
1600
+ href: n,
1601
+ tokens: [{
1602
+ type: "text",
1603
+ raw: e,
1604
+ text: e
1605
+ }]
1606
+ };
1607
+ }
1608
+ }
1609
+ inlineText(e) {
1610
+ let t = this.rules.inline.text.exec(e);
1611
+ if (t) {
1612
+ let e = this.lexer.state.inRawBlock;
1613
+ return {
1614
+ type: "text",
1615
+ raw: t[0],
1616
+ text: t[0],
1617
+ escaped: e
1618
+ };
1619
+ }
1620
+ }
1621
+ }, K = class e {
1622
+ tokens;
1623
+ options;
1624
+ state;
1625
+ inlineQueue;
1626
+ tokenizer;
1627
+ constructor(e) {
1628
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || yt, this.options.tokenizer = this.options.tokenizer || new G(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
1629
+ inLink: !1,
1630
+ inRawBlock: !1,
1631
+ top: !0
1632
+ };
1633
+ let t = {
1634
+ other: A,
1635
+ block: _n.normal,
1636
+ inline: H.normal
1637
+ };
1638
+ this.options.pedantic ? (t.block = _n.pedantic, t.inline = H.pedantic) : this.options.gfm && (t.block = _n.gfm, this.options.breaks ? t.inline = H.breaks : t.inline = H.gfm), this.tokenizer.rules = t;
1639
+ }
1640
+ static get rules() {
1641
+ return {
1642
+ block: _n,
1643
+ inline: H
1644
+ };
1645
+ }
1646
+ static lex(t, n) {
1647
+ return new e(n).lex(t);
1648
+ }
1649
+ static lexInline(t, n) {
1650
+ return new e(n).inlineTokens(t);
1651
+ }
1652
+ lex(e) {
1653
+ e = e.replace(A.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
1654
+ for (let e = 0; e < this.inlineQueue.length; e++) {
1655
+ let t = this.inlineQueue[e];
1656
+ this.inlineTokens(t.src, t.tokens);
1657
+ }
1658
+ return this.inlineQueue = [], this.tokens;
1659
+ }
1660
+ blockTokens(e, t = [], n = !1) {
1661
+ this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(A.tabCharGlobal, " ").replace(A.spaceLine, ""));
1662
+ let r = Infinity;
1663
+ for (; e;) {
1664
+ if (e.length < r) r = e.length;
1665
+ else {
1666
+ this.infiniteLoopError(e.charCodeAt(0));
1667
+ break;
1668
+ }
1669
+ let i;
1670
+ if (this.options.extensions?.block?.some((n) => (i = n.call({ lexer: this }, e, t)) ? (e = e.substring(i.raw.length), t.push(i), !0) : !1)) continue;
1671
+ if (i = this.tokenizer.space(e)) {
1672
+ e = e.substring(i.raw.length);
1673
+ let n = t.at(-1);
1674
+ i.raw.length === 1 && n !== void 0 ? n.raw += "\n" : t.push(i);
1675
+ continue;
1676
+ }
1677
+ if (i = this.tokenizer.code(e)) {
1678
+ e = e.substring(i.raw.length);
1679
+ let n = t.at(-1);
1680
+ n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + i.raw, n.text += "\n" + i.text, this.inlineQueue.at(-1).src = n.text) : t.push(i);
1681
+ continue;
1682
+ }
1683
+ if (i = this.tokenizer.fences(e)) {
1684
+ e = e.substring(i.raw.length), t.push(i);
1685
+ continue;
1686
+ }
1687
+ if (i = this.tokenizer.heading(e)) {
1688
+ e = e.substring(i.raw.length), t.push(i);
1689
+ continue;
1690
+ }
1691
+ if (i = this.tokenizer.hr(e)) {
1692
+ e = e.substring(i.raw.length), t.push(i);
1693
+ continue;
1694
+ }
1695
+ if (i = this.tokenizer.blockquote(e)) {
1696
+ e = e.substring(i.raw.length), t.push(i);
1697
+ continue;
1698
+ }
1699
+ if (i = this.tokenizer.list(e)) {
1700
+ e = e.substring(i.raw.length), t.push(i);
1701
+ continue;
1702
+ }
1703
+ if (i = this.tokenizer.html(e)) {
1704
+ e = e.substring(i.raw.length), t.push(i);
1705
+ continue;
1706
+ }
1707
+ if (i = this.tokenizer.def(e)) {
1708
+ e = e.substring(i.raw.length);
1709
+ let n = t.at(-1);
1710
+ n?.type === "paragraph" || n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + i.raw, n.text += "\n" + i.raw, this.inlineQueue.at(-1).src = n.text) : this.tokens.links[i.tag] || (this.tokens.links[i.tag] = {
1711
+ href: i.href,
1712
+ title: i.title
1713
+ }, t.push(i));
1714
+ continue;
1715
+ }
1716
+ if (i = this.tokenizer.table(e)) {
1717
+ e = e.substring(i.raw.length), t.push(i);
1718
+ continue;
1719
+ }
1720
+ if (i = this.tokenizer.lheading(e)) {
1721
+ e = e.substring(i.raw.length), t.push(i);
1722
+ continue;
1723
+ }
1724
+ let a = e;
1725
+ if (this.options.extensions?.startBlock) {
1726
+ let t = Infinity, n = e.slice(1), r;
1727
+ this.options.extensions.startBlock.forEach((e) => {
1728
+ r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
1729
+ }), t < Infinity && t >= 0 && (a = e.substring(0, t + 1));
1730
+ }
1731
+ if (this.state.top && (i = this.tokenizer.paragraph(a))) {
1732
+ let r = t.at(-1);
1733
+ n && r?.type === "paragraph" ? (r.raw += (r.raw.endsWith("\n") ? "" : "\n") + i.raw, r.text += "\n" + i.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = r.text) : t.push(i), n = a.length !== e.length, e = e.substring(i.raw.length);
1734
+ continue;
1735
+ }
1736
+ if (i = this.tokenizer.text(e)) {
1737
+ e = e.substring(i.raw.length);
1738
+ let n = t.at(-1);
1739
+ n?.type === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + i.raw, n.text += "\n" + i.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = n.text) : t.push(i);
1740
+ continue;
1741
+ }
1742
+ if (e) {
1743
+ this.infiniteLoopError(e.charCodeAt(0));
1744
+ break;
1745
+ }
1746
+ }
1747
+ return this.state.top = !0, t;
1748
+ }
1749
+ inline(e, t = []) {
1750
+ return this.inlineQueue.push({
1751
+ src: e,
1752
+ tokens: t
1753
+ }), t;
1754
+ }
1755
+ inlineTokens(e, t = []) {
1756
+ this.tokenizer.lexer = this;
1757
+ let n = e, r = null;
1758
+ if (this.tokens.links) {
1759
+ let e = Object.keys(this.tokens.links);
1760
+ if (e.length > 0) for (; (r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) !== null;) e.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
1761
+ }
1762
+ for (; (r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) !== null;) n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1763
+ let i;
1764
+ for (; (r = this.tokenizer.rules.inline.blockSkip.exec(n)) !== null;) i = r[2] ? r[2].length : 0, n = n.slice(0, r.index + i) + "[" + "a".repeat(r[0].length - i - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1765
+ n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
1766
+ let a = !1, o = "", s = Infinity;
1767
+ for (; e;) {
1768
+ if (e.length < s) s = e.length;
1769
+ else {
1770
+ this.infiniteLoopError(e.charCodeAt(0));
1771
+ break;
1772
+ }
1773
+ a || (o = ""), a = !1;
1774
+ let r;
1775
+ if (this.options.extensions?.inline?.some((n) => (r = n.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
1776
+ if (r = this.tokenizer.escape(e)) {
1777
+ e = e.substring(r.raw.length), t.push(r);
1778
+ continue;
1779
+ }
1780
+ if (r = this.tokenizer.tag(e)) {
1781
+ e = e.substring(r.raw.length), t.push(r);
1782
+ continue;
1783
+ }
1784
+ if (r = this.tokenizer.link(e)) {
1785
+ e = e.substring(r.raw.length), t.push(r);
1786
+ continue;
1787
+ }
1788
+ if (r = this.tokenizer.reflink(e, this.tokens.links)) {
1789
+ e = e.substring(r.raw.length);
1790
+ let n = t.at(-1);
1791
+ r.type === "text" && n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
1792
+ continue;
1793
+ }
1794
+ if (r = this.tokenizer.emStrong(e, n, o)) {
1795
+ e = e.substring(r.raw.length), t.push(r);
1796
+ continue;
1797
+ }
1798
+ if (r = this.tokenizer.codespan(e)) {
1799
+ e = e.substring(r.raw.length), t.push(r);
1800
+ continue;
1801
+ }
1802
+ if (r = this.tokenizer.br(e)) {
1803
+ e = e.substring(r.raw.length), t.push(r);
1804
+ continue;
1805
+ }
1806
+ if (r = this.tokenizer.del(e, n, o)) {
1807
+ e = e.substring(r.raw.length), t.push(r);
1808
+ continue;
1809
+ }
1810
+ if (r = this.tokenizer.autolink(e)) {
1811
+ e = e.substring(r.raw.length), t.push(r);
1812
+ continue;
1813
+ }
1814
+ if (!this.state.inLink && (r = this.tokenizer.url(e))) {
1815
+ e = e.substring(r.raw.length), t.push(r);
1816
+ continue;
1817
+ }
1818
+ let i = e;
1819
+ if (this.options.extensions?.startInline) {
1820
+ let t = Infinity, n = e.slice(1), r;
1821
+ this.options.extensions.startInline.forEach((e) => {
1822
+ r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
1823
+ }), t < Infinity && t >= 0 && (i = e.substring(0, t + 1));
1824
+ }
1825
+ if (r = this.tokenizer.inlineText(i)) {
1826
+ e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (o = r.raw.slice(-1)), a = !0;
1827
+ let n = t.at(-1);
1828
+ n?.type === "text" ? (n.raw += r.raw, n.text += r.text) : t.push(r);
1829
+ continue;
1830
+ }
1831
+ if (e) {
1832
+ this.infiniteLoopError(e.charCodeAt(0));
1833
+ break;
1834
+ }
1835
+ }
1836
+ return t;
1837
+ }
1838
+ infiniteLoopError(e) {
1839
+ let t = "Infinite loop on byte: " + e;
1840
+ if (this.options.silent) console.error(t);
1841
+ else throw Error(t);
1842
+ }
1843
+ }, q = class {
1844
+ options;
1845
+ parser;
1846
+ constructor(e) {
1847
+ this.options = e || yt;
1848
+ }
1849
+ space(e) {
1850
+ return "";
1851
+ }
1852
+ code({ text: e, lang: t, escaped: n }) {
1853
+ let r = (t || "").match(A.notSpaceStart)?.[0], i = e.replace(A.endingNewline, "") + "\n";
1854
+ return r ? "<pre><code class=\"language-" + U(r) + "\">" + (n ? i : U(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : U(i, !0)) + "</code></pre>\n";
1855
+ }
1856
+ blockquote({ tokens: e }) {
1857
+ return `<blockquote>
1858
+ ${this.parser.parse(e)}</blockquote>
1859
+ `;
1860
+ }
1861
+ html({ text: e }) {
1862
+ return e;
1863
+ }
1864
+ def(e) {
1865
+ return "";
1866
+ }
1867
+ heading({ tokens: e, depth: t }) {
1868
+ return `<h${t}>${this.parser.parseInline(e)}</h${t}>
1869
+ `;
1870
+ }
1871
+ hr(e) {
1872
+ return "<hr>\n";
1873
+ }
1874
+ list(e) {
1875
+ let t = e.ordered, n = e.start, r = "";
1876
+ for (let t = 0; t < e.items.length; t++) {
1877
+ let n = e.items[t];
1878
+ r += this.listitem(n);
1879
+ }
1880
+ let i = t ? "ol" : "ul", a = t && n !== 1 ? " start=\"" + n + "\"" : "";
1881
+ return "<" + i + a + ">\n" + r + "</" + i + ">\n";
1882
+ }
1883
+ listitem(e) {
1884
+ return `<li>${this.parser.parse(e.tokens)}</li>
1885
+ `;
1886
+ }
1887
+ checkbox({ checked: e }) {
1888
+ return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\"> ";
1889
+ }
1890
+ paragraph({ tokens: e }) {
1891
+ return `<p>${this.parser.parseInline(e)}</p>
1892
+ `;
1893
+ }
1894
+ table(e) {
1895
+ let t = "", n = "";
1896
+ for (let t = 0; t < e.header.length; t++) n += this.tablecell(e.header[t]);
1897
+ t += this.tablerow({ text: n });
1898
+ let r = "";
1899
+ for (let t = 0; t < e.rows.length; t++) {
1900
+ let i = e.rows[t];
1901
+ n = "";
1902
+ for (let e = 0; e < i.length; e++) n += this.tablecell(i[e]);
1903
+ r += this.tablerow({ text: n });
1904
+ }
1905
+ return r &&= `<tbody>${r}</tbody>`, "<table>\n<thead>\n" + t + "</thead>\n" + r + "</table>\n";
1906
+ }
1907
+ tablerow({ text: e }) {
1908
+ return `<tr>
1909
+ ${e}</tr>
1910
+ `;
1911
+ }
1912
+ tablecell(e) {
1913
+ let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
1914
+ return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
1915
+ `;
1916
+ }
1917
+ strong({ tokens: e }) {
1918
+ return `<strong>${this.parser.parseInline(e)}</strong>`;
1919
+ }
1920
+ em({ tokens: e }) {
1921
+ return `<em>${this.parser.parseInline(e)}</em>`;
1922
+ }
1923
+ codespan({ text: e }) {
1924
+ return `<code>${U(e, !0)}</code>`;
1925
+ }
1926
+ br(e) {
1927
+ return "<br>";
1928
+ }
1929
+ del({ tokens: e }) {
1930
+ return `<del>${this.parser.parseInline(e)}</del>`;
1931
+ }
1932
+ link({ href: e, title: t, tokens: n }) {
1933
+ let r = this.parser.parseInline(n), i = bn(e);
1934
+ if (i === null) return r;
1935
+ e = i;
1936
+ let a = "<a href=\"" + e + "\"";
1937
+ return t && (a += " title=\"" + U(t) + "\""), a += ">" + r + "</a>", a;
1938
+ }
1939
+ image({ href: e, title: t, text: n, tokens: r }) {
1940
+ r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1941
+ let i = bn(e);
1942
+ if (i === null) return U(n);
1943
+ e = i;
1944
+ let a = `<img src="${e}" alt="${U(n)}"`;
1945
+ return t && (a += ` title="${U(t)}"`), a += ">", a;
1946
+ }
1947
+ text(e) {
1948
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : U(e.text);
1949
+ }
1950
+ }, J = class {
1951
+ strong({ text: e }) {
1952
+ return e;
1953
+ }
1954
+ em({ text: e }) {
1955
+ return e;
1956
+ }
1957
+ codespan({ text: e }) {
1958
+ return e;
1959
+ }
1960
+ del({ text: e }) {
1961
+ return e;
1962
+ }
1963
+ html({ text: e }) {
1964
+ return e;
1965
+ }
1966
+ text({ text: e }) {
1967
+ return e;
1968
+ }
1969
+ link({ text: e }) {
1970
+ return "" + e;
1971
+ }
1972
+ image({ text: e }) {
1973
+ return "" + e;
1974
+ }
1975
+ br() {
1976
+ return "";
1977
+ }
1978
+ checkbox({ raw: e }) {
1979
+ return e;
1980
+ }
1981
+ }, Y = class e {
1982
+ options;
1983
+ renderer;
1984
+ textRenderer;
1985
+ constructor(e) {
1986
+ this.options = e || yt, this.options.renderer = this.options.renderer || new q(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new J();
1987
+ }
1988
+ static parse(t, n) {
1989
+ return new e(n).parse(t);
1990
+ }
1991
+ static parseInline(t, n) {
1992
+ return new e(n).parseInline(t);
1993
+ }
1994
+ parse(e) {
1995
+ this.renderer.parser = this;
1996
+ let t = "";
1997
+ for (let n = 0; n < e.length; n++) {
1998
+ let r = e[n];
1999
+ if (this.options.extensions?.renderers?.[r.type]) {
2000
+ let e = r, n = this.options.extensions.renderers[e.type].call({ parser: this }, e);
2001
+ if (n !== !1 || ![
2002
+ "space",
2003
+ "hr",
2004
+ "heading",
2005
+ "code",
2006
+ "table",
2007
+ "blockquote",
2008
+ "list",
2009
+ "html",
2010
+ "def",
2011
+ "paragraph",
2012
+ "text"
2013
+ ].includes(e.type)) {
2014
+ t += n || "";
2015
+ continue;
2016
+ }
2017
+ }
2018
+ let i = r;
2019
+ switch (i.type) {
2020
+ case "space":
2021
+ t += this.renderer.space(i);
2022
+ break;
2023
+ case "hr":
2024
+ t += this.renderer.hr(i);
2025
+ break;
2026
+ case "heading":
2027
+ t += this.renderer.heading(i);
2028
+ break;
2029
+ case "code":
2030
+ t += this.renderer.code(i);
2031
+ break;
2032
+ case "table":
2033
+ t += this.renderer.table(i);
2034
+ break;
2035
+ case "blockquote":
2036
+ t += this.renderer.blockquote(i);
2037
+ break;
2038
+ case "list":
2039
+ t += this.renderer.list(i);
2040
+ break;
2041
+ case "checkbox":
2042
+ t += this.renderer.checkbox(i);
2043
+ break;
2044
+ case "html":
2045
+ t += this.renderer.html(i);
2046
+ break;
2047
+ case "def":
2048
+ t += this.renderer.def(i);
2049
+ break;
2050
+ case "paragraph":
2051
+ t += this.renderer.paragraph(i);
2052
+ break;
2053
+ case "text":
2054
+ t += this.renderer.text(i);
2055
+ break;
2056
+ default: {
2057
+ let e = "Token with \"" + i.type + "\" type was not found.";
2058
+ if (this.options.silent) return console.error(e), "";
2059
+ throw Error(e);
2060
+ }
2061
+ }
2062
+ }
2063
+ return t;
2064
+ }
2065
+ parseInline(e, t = this.renderer) {
2066
+ this.renderer.parser = this;
2067
+ let n = "";
2068
+ for (let r = 0; r < e.length; r++) {
2069
+ let i = e[r];
2070
+ if (this.options.extensions?.renderers?.[i.type]) {
2071
+ let e = this.options.extensions.renderers[i.type].call({ parser: this }, i);
2072
+ if (e !== !1 || ![
2073
+ "escape",
2074
+ "html",
2075
+ "link",
2076
+ "image",
2077
+ "strong",
2078
+ "em",
2079
+ "codespan",
2080
+ "br",
2081
+ "del",
2082
+ "text"
2083
+ ].includes(i.type)) {
2084
+ n += e || "";
2085
+ continue;
2086
+ }
2087
+ }
2088
+ let a = i;
2089
+ switch (a.type) {
2090
+ case "escape":
2091
+ n += t.text(a);
2092
+ break;
2093
+ case "html":
2094
+ n += t.html(a);
2095
+ break;
2096
+ case "link":
2097
+ n += t.link(a);
2098
+ break;
2099
+ case "image":
2100
+ n += t.image(a);
2101
+ break;
2102
+ case "checkbox":
2103
+ n += t.checkbox(a);
2104
+ break;
2105
+ case "strong":
2106
+ n += t.strong(a);
2107
+ break;
2108
+ case "em":
2109
+ n += t.em(a);
2110
+ break;
2111
+ case "codespan":
2112
+ n += t.codespan(a);
2113
+ break;
2114
+ case "br":
2115
+ n += t.br(a);
2116
+ break;
2117
+ case "del":
2118
+ n += t.del(a);
2119
+ break;
2120
+ case "text":
2121
+ n += t.text(a);
2122
+ break;
2123
+ default: {
2124
+ let e = "Token with \"" + a.type + "\" type was not found.";
2125
+ if (this.options.silent) return console.error(e), "";
2126
+ throw Error(e);
2127
+ }
2128
+ }
2129
+ }
2130
+ return n;
2131
+ }
2132
+ }, X = class {
2133
+ options;
2134
+ block;
2135
+ constructor(e) {
2136
+ this.options = e || yt;
2137
+ }
2138
+ static passThroughHooks = /* @__PURE__ */ new Set([
2139
+ "preprocess",
2140
+ "postprocess",
2141
+ "processAllTokens",
2142
+ "emStrongMask"
2143
+ ]);
2144
+ static passThroughHooksRespectAsync = /* @__PURE__ */ new Set([
2145
+ "preprocess",
2146
+ "postprocess",
2147
+ "processAllTokens"
2148
+ ]);
2149
+ preprocess(e) {
2150
+ return e;
2151
+ }
2152
+ postprocess(e) {
2153
+ return e;
2154
+ }
2155
+ processAllTokens(e) {
2156
+ return e;
2157
+ }
2158
+ emStrongMask(e) {
2159
+ return e;
2160
+ }
2161
+ provideLexer(e = this.block) {
2162
+ return e ? K.lex : K.lexInline;
2163
+ }
2164
+ provideParser(e = this.block) {
2165
+ return e ? Y.parse : Y.parseInline;
2166
+ }
2167
+ }, Dn = new class {
2168
+ defaults = vt();
2169
+ options = this.setOptions;
2170
+ parse = this.parseMarkdown(!0);
2171
+ parseInline = this.parseMarkdown(!1);
2172
+ Parser = Y;
2173
+ Renderer = q;
2174
+ TextRenderer = J;
2175
+ Lexer = K;
2176
+ Tokenizer = G;
2177
+ Hooks = X;
2178
+ constructor(...e) {
2179
+ this.use(...e);
2180
+ }
2181
+ walkTokens(e, t) {
2182
+ let n = [];
2183
+ for (let r of e) switch (n = n.concat(t.call(this, r)), r.type) {
2184
+ case "table": {
2185
+ let e = r;
2186
+ for (let r of e.header) n = n.concat(this.walkTokens(r.tokens, t));
2187
+ for (let r of e.rows) for (let e of r) n = n.concat(this.walkTokens(e.tokens, t));
2188
+ break;
2189
+ }
2190
+ case "list": {
2191
+ let e = r;
2192
+ n = n.concat(this.walkTokens(e.items, t));
2193
+ break;
2194
+ }
2195
+ default: {
2196
+ let e = r;
2197
+ this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
2198
+ let i = e[r].flat(Infinity);
2199
+ n = n.concat(this.walkTokens(i, t));
2200
+ }) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t)));
2201
+ }
2202
+ }
2203
+ return n;
2204
+ }
2205
+ use(...e) {
2206
+ let t = this.defaults.extensions || {
2207
+ renderers: {},
2208
+ childTokens: {}
2209
+ };
2210
+ return e.forEach((e) => {
2211
+ let n = { ...e };
2212
+ if (n.async = this.defaults.async || n.async || !1, e.extensions && (e.extensions.forEach((e) => {
2213
+ if (!e.name) throw Error("extension name required");
2214
+ if ("renderer" in e) {
2215
+ let n = t.renderers[e.name];
2216
+ n ? t.renderers[e.name] = function(...t) {
2217
+ let r = e.renderer.apply(this, t);
2218
+ return r === !1 && (r = n.apply(this, t)), r;
2219
+ } : t.renderers[e.name] = e.renderer;
2220
+ }
2221
+ if ("tokenizer" in e) {
2222
+ if (!e.level || e.level !== "block" && e.level !== "inline") throw Error("extension level must be 'block' or 'inline'");
2223
+ let n = t[e.level];
2224
+ n ? n.unshift(e.tokenizer) : t[e.level] = [e.tokenizer], e.start && (e.level === "block" ? t.startBlock ? t.startBlock.push(e.start) : t.startBlock = [e.start] : e.level === "inline" && (t.startInline ? t.startInline.push(e.start) : t.startInline = [e.start]));
2225
+ }
2226
+ "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
2227
+ }), n.extensions = t), e.renderer) {
2228
+ let t = this.defaults.renderer || new q(this.defaults);
2229
+ for (let n in e.renderer) {
2230
+ if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
2231
+ if (["options", "parser"].includes(n)) continue;
2232
+ let r = n, i = e.renderer[r], a = t[r];
2233
+ t[r] = (...e) => {
2234
+ let n = i.apply(t, e);
2235
+ return n === !1 && (n = a.apply(t, e)), n || "";
2236
+ };
2237
+ }
2238
+ n.renderer = t;
2239
+ }
2240
+ if (e.tokenizer) {
2241
+ let t = this.defaults.tokenizer || new G(this.defaults);
2242
+ for (let n in e.tokenizer) {
2243
+ if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
2244
+ if ([
2245
+ "options",
2246
+ "rules",
2247
+ "lexer"
2248
+ ].includes(n)) continue;
2249
+ let r = n, i = e.tokenizer[r], a = t[r];
2250
+ t[r] = (...e) => {
2251
+ let n = i.apply(t, e);
2252
+ return n === !1 && (n = a.apply(t, e)), n;
2253
+ };
2254
+ }
2255
+ n.tokenizer = t;
2256
+ }
2257
+ if (e.hooks) {
2258
+ let t = this.defaults.hooks || new X();
2259
+ for (let n in e.hooks) {
2260
+ if (!(n in t)) throw Error(`hook '${n}' does not exist`);
2261
+ if (["options", "block"].includes(n)) continue;
2262
+ let r = n, i = e.hooks[r], a = t[r];
2263
+ X.passThroughHooks.has(n) ? t[r] = (e) => {
2264
+ if (this.defaults.async && X.passThroughHooksRespectAsync.has(n)) return (async () => {
2265
+ let n = await i.call(t, e);
2266
+ return a.call(t, n);
2267
+ })();
2268
+ let r = i.call(t, e);
2269
+ return a.call(t, r);
2270
+ } : t[r] = (...e) => {
2271
+ if (this.defaults.async) return (async () => {
2272
+ let n = await i.apply(t, e);
2273
+ return n === !1 && (n = await a.apply(t, e)), n;
2274
+ })();
2275
+ let n = i.apply(t, e);
2276
+ return n === !1 && (n = a.apply(t, e)), n;
2277
+ };
2278
+ }
2279
+ n.hooks = t;
2280
+ }
2281
+ if (e.walkTokens) {
2282
+ let t = this.defaults.walkTokens, r = e.walkTokens;
2283
+ n.walkTokens = function(e) {
2284
+ let n = [];
2285
+ return n.push(r.call(this, e)), t && (n = n.concat(t.call(this, e))), n;
2286
+ };
2287
+ }
2288
+ this.defaults = {
2289
+ ...this.defaults,
2290
+ ...n
2291
+ };
2292
+ }), this;
2293
+ }
2294
+ setOptions(e) {
2295
+ return this.defaults = {
2296
+ ...this.defaults,
2297
+ ...e
2298
+ }, this;
2299
+ }
2300
+ lexer(e, t) {
2301
+ return K.lex(e, t ?? this.defaults);
2302
+ }
2303
+ parser(e, t) {
2304
+ return Y.parse(e, t ?? this.defaults);
2305
+ }
2306
+ parseMarkdown(e) {
2307
+ return (t, n) => {
2308
+ let r = { ...n }, i = {
2309
+ ...this.defaults,
2310
+ ...r
2311
+ }, a = this.onError(!!i.silent, !!i.async);
2312
+ if (this.defaults.async === !0 && r.async === !1) return a(/* @__PURE__ */ Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
2313
+ if (typeof t > "u" || t === null) return a(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
2314
+ if (typeof t != "string") return a(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
2315
+ if (i.hooks && (i.hooks.options = i, i.hooks.block = e), i.async) return (async () => {
2316
+ let n = i.hooks ? await i.hooks.preprocess(t) : t, r = await (i.hooks ? await i.hooks.provideLexer(e) : e ? K.lex : K.lexInline)(n, i), a = i.hooks ? await i.hooks.processAllTokens(r) : r;
2317
+ i.walkTokens && await Promise.all(this.walkTokens(a, i.walkTokens));
2318
+ let o = await (i.hooks ? await i.hooks.provideParser(e) : e ? Y.parse : Y.parseInline)(a, i);
2319
+ return i.hooks ? await i.hooks.postprocess(o) : o;
2320
+ })().catch(a);
2321
+ try {
2322
+ i.hooks && (t = i.hooks.preprocess(t));
2323
+ let n = (i.hooks ? i.hooks.provideLexer(e) : e ? K.lex : K.lexInline)(t, i);
2324
+ i.hooks && (n = i.hooks.processAllTokens(n)), i.walkTokens && this.walkTokens(n, i.walkTokens);
2325
+ let r = (i.hooks ? i.hooks.provideParser(e) : e ? Y.parse : Y.parseInline)(n, i);
2326
+ return i.hooks && (r = i.hooks.postprocess(r)), r;
2327
+ } catch (e) {
2328
+ return a(e);
2329
+ }
2330
+ };
2331
+ }
2332
+ onError(e, t) {
2333
+ return (n) => {
2334
+ if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
2335
+ let e = "<p>An error occurred:</p><pre>" + U(n.message + "", !0) + "</pre>";
2336
+ return t ? Promise.resolve(e) : e;
2337
+ }
2338
+ if (t) return Promise.reject(n);
2339
+ throw n;
2340
+ };
2341
+ }
2342
+ }();
2343
+ function Z(e, t) {
2344
+ return Dn.parse(e, t);
2345
+ }
2346
+ Z.options = Z.setOptions = function(e) {
2347
+ return Dn.setOptions(e), Z.defaults = Dn.defaults, bt(Z.defaults), Z;
2348
+ }, Z.getDefaults = vt, Z.defaults = yt, Z.use = function(...e) {
2349
+ return Dn.use(...e), Z.defaults = Dn.defaults, bt(Z.defaults), Z;
2350
+ }, Z.walkTokens = function(e, t) {
2351
+ return Dn.walkTokens(e, t);
2352
+ }, Z.parseInline = Dn.parseInline, Z.Parser = Y, Z.parser = Y.parse, Z.Renderer = q, Z.TextRenderer = J, Z.Lexer = K, Z.lexer = K.lex, Z.Tokenizer = G, Z.Hooks = X, Z.parse = Z, Z.options, Z.setOptions, Z.use, Z.walkTokens, Z.parseInline, Y.parse, K.lex;
2353
+ //#endregion
2354
+ //#region src/components/ai-chat/ai-chat.module.scss?inline
2355
+ var On = ":host{box-sizing:border-box;flex-direction:column;width:100%;height:100%;display:flex}:host .chat-container{background:var(--luzmo-ai-chat-background,var(--ai-chat-background));border-radius:var(--luzmo-ai-chat-border-radius,var(--ai-chat-border-radius));width:100%;height:100%;min-height:0;padding:var(--luzmo-ai-chat-padding,var(--ai-chat-padding));gap:var(--luzmo-ai-chat-gap,var(--ai-chat-gap));border:var(--luzmo-ai-chat-border,var(--ai-chat-border));box-shadow:var(--luzmo-ai-chat-box-shadow,var(--ai-chat-box-shadow));box-sizing:border-box;flex-direction:column;flex:1;display:flex;overflow:hidden}:host .chat-messages-container{gap:var(--luzmo-ai-chat-gap,var(--ai-chat-gap));flex-direction:column;flex:1;min-height:0;display:flex;overflow:auto}:host .chat-messages-container luzmo-ai-chat-empty-state{flex:1;min-height:0}:host .chat-messages-container::-webkit-scrollbar{width:var(--luzmo-ai-chat-scrollbar-width,var(--ai-chat-scrollbar-width))}:host .chat-messages-container::-webkit-scrollbar-track{background:var(--luzmo-ai-chat-scrollbar-track-background,var(--ai-chat-scrollbar-track-background));border-radius:var(--luzmo-ai-chat-scrollbar-track-border-radius,var(--ai-chat-scrollbar-track-border-radius))}:host .chat-messages-container::-webkit-scrollbar-thumb{background:var(--luzmo-ai-chat-scrollbar-thumb-background,var(--ai-chat-scrollbar-thumb-background));border-radius:var(--luzmo-ai-chat-scrollbar-thumb-border-radius,var(--ai-chat-scrollbar-thumb-border-radius))}:host .chat-messages-container::-webkit-scrollbar-thumb:hover{background:var(--luzmo-ai-chat-scrollbar-thumb-hover-background,var(--ai-chat-scrollbar-thumb-hover-background))}:host .chat-messages-container{scrollbar-width:var(--luzmo-scrollbar-width,thin);scrollbar-color:var(--luzmo-ai-chat-scrollbar-thumb-background,var(--ai-chat-scrollbar-thumb-background)) var(--luzmo-ai-chat-scrollbar-track-background,var(--ai-chat-scrollbar-track-background))}:host luzmo-chat-message{--luzmo-primary:rgba(var(--luzmo-primary-rgb), .08);--chat-message-primary-text-color:var(--luzmo-font-color);--chat-message-primary-border-color:transparent}:host luzmo-chat-message.error{color:var(--luzmo-ai-chat-error-message-color,var(--ai-chat-error-message-color))}:host luzmo-chat-message.cancelled{color:var(--luzmo-ai-chat-cancelled-message-color,var(--ai-chat-cancelled-message-color));font-style:italic}:host .user-message-content{gap:var(--luzmo-spacing-3,8px);flex-direction:column;display:flex}:host .user-message-attachments{gap:var(--luzmo-spacing-2,4px);flex-wrap:wrap;display:flex}:host .user-message-attachment{width:var(--luzmo-ai-chat-user-message-attachment-size,var(--ai-chat-user-message-attachment-size));height:var(--luzmo-ai-chat-user-message-attachment-size,var(--ai-chat-user-message-attachment-size));object-fit:cover;object-position:center;border-radius:var(--luzmo-border-radius-s,4px);pointer-events:none;display:block}:host .user-message-text{white-space:pre-wrap;overflow-wrap:anywhere}:host .markdown-content{line-height:var(--luzmo-ai-chat-markdown-line-height,var(--ai-chat-markdown-line-height))}:host .markdown-content>:first-child{margin-top:0}:host .markdown-content>:last-child{margin-bottom:0}:host .markdown-content p,:host .markdown-content ul,:host .markdown-content ol,:host .markdown-content blockquote,:host .markdown-content pre,:host .markdown-content table{margin:0 0 var(--luzmo-ai-chat-markdown-spacing,var(--ai-chat-markdown-spacing))}:host .markdown-content h1,:host .markdown-content h2,:host .markdown-content h3,:host .markdown-content h4,:host .markdown-content h5,:host .markdown-content h6{margin:var(--luzmo-ai-chat-markdown-heading-spacing,var(--ai-chat-markdown-heading-spacing)) 0 var(--luzmo-ai-chat-markdown-spacing,var(--ai-chat-markdown-spacing));font-weight:var(--luzmo-ai-chat-markdown-heading-font-weight,var(--ai-chat-markdown-heading-font-weight))}:host .markdown-content ul,:host .markdown-content ol{padding-inline-start:var(--luzmo-ai-chat-markdown-list-indent,var(--ai-chat-markdown-list-indent))}:host .markdown-content a{color:var(--luzmo-ai-chat-markdown-link-color,var(--ai-chat-markdown-link-color))}:host .markdown-content code{font-family:var(--luzmo-ai-chat-markdown-code-font-family,var(--ai-chat-markdown-code-font-family));font-size:var(--luzmo-ai-chat-markdown-code-font-size,var(--ai-chat-markdown-code-font-size));background:var(--luzmo-ai-chat-markdown-code-background,var(--ai-chat-markdown-code-background));border-radius:var(--luzmo-ai-chat-markdown-code-border-radius,var(--ai-chat-markdown-code-border-radius));padding:.1em .3em}:host .markdown-content pre{background:var(--luzmo-ai-chat-markdown-code-background,var(--ai-chat-markdown-code-background));border-radius:var(--luzmo-ai-chat-markdown-code-border-radius,var(--ai-chat-markdown-code-border-radius));padding:.75em 1em;overflow-x:auto}:host .markdown-content pre code{background:0 0;padding:0}:host .markdown-content blockquote{border-inline-start:.1875rem solid var(--luzmo-ai-chat-markdown-border-color,var(--ai-chat-markdown-border-color));padding-inline-start:.75rem}:host .markdown-content hr{border:0;border-top:.0625rem solid var(--luzmo-ai-chat-markdown-border-color,var(--ai-chat-markdown-border-color));margin:var(--luzmo-ai-chat-markdown-heading-spacing,var(--ai-chat-markdown-heading-spacing)) 0}:host .markdown-content table{border-collapse:collapse;width:100%}:host .markdown-content th,:host .markdown-content td{border:.0625rem solid var(--luzmo-ai-chat-markdown-border-color,var(--ai-chat-markdown-border-color));text-align:start;padding:.375rem .625rem}:host .markdown-content th{background:var(--luzmo-ai-chat-markdown-table-header-background,var(--ai-chat-markdown-table-header-background));font-weight:600}:host .assistant-message-wrapper{gap:var(--luzmo-ai-chat-assistant-message-actions-margin-top,var(--ai-chat-assistant-message-actions-margin-top));font-family:var(--luzmo-ai-chat-assistant-message-font-family,var(--ai-chat-assistant-message-font-family));font-size:var(--luzmo-ai-chat-assistant-message-font-size,var(--ai-chat-assistant-message-font-size));line-height:var(--luzmo-ai-chat-assistant-message-line-height,var(--ai-chat-assistant-message-line-height));--chat-message-font-family:var(--luzmo-ai-chat-assistant-message-font-family,var(--ai-chat-assistant-message-font-family));--luzmo-chat-message-font-family:var(--luzmo-ai-chat-assistant-message-font-family,var(--ai-chat-assistant-message-font-family));--chat-message-font-size:var(--luzmo-ai-chat-assistant-message-font-size,var(--ai-chat-assistant-message-font-size));--luzmo-chat-message-font-size:var(--luzmo-ai-chat-assistant-message-font-size,var(--ai-chat-assistant-message-font-size));--chat-message-line-height:var(--luzmo-ai-chat-assistant-message-line-height,var(--ai-chat-assistant-message-line-height));--luzmo-chat-message-line-height:var(--luzmo-ai-chat-assistant-message-line-height,var(--ai-chat-assistant-message-line-height));flex-direction:column;display:flex}:host .assistant-message-body{justify-content:space-between;align-items:flex-start;gap:1rem;display:flex}:host .assistant-message-actions{align-items:center;gap:var(--luzmo-ai-chat-assistant-message-actions-gap,var(--ai-chat-assistant-message-actions-gap));flex-wrap:wrap;display:none}:host .assistant-message-actions.assistant-message-actions--has-content{display:flex}:host .assistant-message-actions.assistant-message-actions--confirming{flex-direction:column;align-items:flex-start}:host .assistant-message-actions .assistant-message-action-confirm-message{font-style:var(--luzmo-ai-chat-assistant-message-actions-font-style,var(--ai-chat-assistant-message-actions-font-style));color:var(--luzmo-ai-chat-assistant-message-actions-color,var(--ai-chat-assistant-message-actions-color));white-space:pre-line}:host .assistant-message-actions .assistant-message-action-confirm-controls{align-items:center;gap:var(--luzmo-ai-chat-assistant-message-actions-gap,var(--ai-chat-assistant-message-actions-gap));flex-wrap:wrap;display:flex}:host .assistant-message-actions luzmo-button.assistant-message-action,:host .assistant-message-actions slot::slotted(luzmo-button),:host .assistant-message-actions slot::slotted(button),:host .assistant-message-actions slot::slotted(a),:host .assistant-message-actions slot::slotted(input),:host .assistant-message-actions slot::slotted(select),:host .assistant-message-actions slot::slotted(textarea){font-style:normal}:host .assistant-message-actions slot::slotted(:not(luzmo-button):not(button):not(a):not(input):not(select):not(textarea)){font-style:var(--luzmo-ai-chat-assistant-message-actions-font-style,var(--ai-chat-assistant-message-actions-font-style));color:var(--luzmo-ai-chat-assistant-message-actions-color,var(--ai-chat-assistant-message-actions-color))}:host .assistant-context-menu-trigger{width:var(--luzmo-ai-chat-context-menu-trigger-size,var(--ai-chat-context-menu-trigger-size));height:var(--luzmo-ai-chat-context-menu-trigger-size,var(--ai-chat-context-menu-trigger-size));border:.0625rem solid var(--luzmo-ai-chat-context-menu-trigger-border-color,var(--ai-chat-context-menu-trigger-border-color));border-radius:var(--luzmo-ai-chat-context-menu-trigger-border-radius,var(--ai-chat-context-menu-trigger-border-radius));background:var(--luzmo-ai-chat-context-menu-trigger-background,var(--ai-chat-context-menu-trigger-background));color:var(--luzmo-ai-chat-context-menu-trigger-color,var(--ai-chat-context-menu-trigger-color));cursor:pointer;justify-content:center;align-items:center;padding:0;font-size:.875rem;line-height:1;transition:all .15s;display:inline-flex}:host .assistant-context-menu-trigger:hover{background:var(--luzmo-ai-chat-context-menu-trigger-hover-background,var(--ai-chat-context-menu-trigger-hover-background));border-color:var(--luzmo-ai-chat-context-menu-trigger-hover-border-color,var(--ai-chat-context-menu-trigger-hover-border-color));color:var(--luzmo-ai-chat-context-menu-trigger-hover-color,var(--ai-chat-context-menu-trigger-hover-color))}:host .assistant-context-menu-trigger:disabled{cursor:not-allowed;opacity:.6}:host .assistant-context-menu-trigger:disabled:hover{background:var(--luzmo-ai-chat-context-menu-trigger-background,var(--ai-chat-context-menu-trigger-background));border-color:var(--luzmo-ai-chat-context-menu-trigger-border-color,var(--ai-chat-context-menu-trigger-border-color));color:var(--luzmo-ai-chat-context-menu-trigger-color,var(--ai-chat-context-menu-trigger-color))}:host .assistant-context-menu-item{width:100%;color:var(--luzmo-font-color);text-align:start;cursor:pointer;font-family:var(--luzmo-ai-chat-context-menu-item-font-family,var(--ai-chat-context-menu-item-font-family));background:0 0;border:0;padding:.5rem .75rem}:host .assistant-context-menu-item:hover{background:var(--luzmo-ai-chat-context-menu-item-hover-background,var(--ai-chat-context-menu-item-hover-background))}:host .assistant-context-menu-item:disabled{opacity:.4;cursor:not-allowed}:host .assistant-context-menu-item:disabled:hover{background:0 0}:host luzmo-ai-interaction-textarea{flex-grow:0;flex-shrink:0}:host luzmo-progress-steps{padding:0 .25rem}:host .loading-message{color:var(--luzmo-font-color);align-items:center;gap:.5rem;display:flex}:host .loading-message svg{color:var(--luzmo-ai-chat-loading-message-color,var(--ai-chat-loading-message-color));font-size:var(--luzmo-ai-chat-loading-message-icon-font-size,var(--ai-chat-loading-message-icon-font-size,1rem));justify-content:center;align-items:center;display:flex}:host .loading-message svg.spin{animation:1s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){:host .assistant-context-menu-trigger{transition:none}:host .loading-message svg.spin{animation:none}}:host{--ai-chat-background:var(--luzmo-background-color);--ai-chat-border-radius:0;--ai-chat-padding:0;--ai-chat-gap:1rem;--ai-chat-border:none;--ai-chat-box-shadow:none;--ai-chat-loading-message-color:var(--luzmo-primary);--ai-chat-loading-message-icon-font-size:1rem;--ai-chat-error-message-color:var(--luzmo-danger,#dc3545);--ai-chat-cancelled-message-color:var(--luzmo-font-color-dimmed,var(--luzmo-font-color-extra-dimmed));--ai-chat-scrollbar-width:var(--luzmo-scrollbar-size);--ai-chat-scrollbar-track-background:var(--luzmo-scrollbar-track-background);--ai-chat-scrollbar-track-border-radius:var(--luzmo-scrollbar-track-border-radius);--ai-chat-scrollbar-thumb-background:var(--luzmo-scrollbar-thumb-background);--ai-chat-scrollbar-thumb-border-radius:var(--luzmo-scrollbar-thumb-border-radius);--ai-chat-scrollbar-thumb-hover-background:var(--luzmo-scrollbar-thumb-hover-background);--ai-chat-context-menu-trigger-size:1.5rem;--ai-chat-context-menu-trigger-border-color:var(--luzmo-border-color);--ai-chat-context-menu-trigger-border-radius:.375rem;--ai-chat-context-menu-trigger-background:var(--luzmo-background-color,transparent);--ai-chat-context-menu-trigger-color:var(--luzmo-font-color,#5a5a5a);--ai-chat-context-menu-trigger-hover-background:var(--luzmo-background-color-hover,#4434ff14);--ai-chat-context-menu-trigger-hover-border-color:var(--luzmo-border-color-hover,var(--luzmo-border-color));--ai-chat-context-menu-trigger-hover-color:var(--luzmo-font-color,#5a5a5a);--ai-chat-context-menu-item-hover-background:var(--luzmo-background-color-hover,#4434ff14);--ai-chat-context-menu-item-font-family:var(--luzmo-font-family);--ai-chat-markdown-line-height:1.5;--ai-chat-markdown-spacing:var(--luzmo-spacing-3);--ai-chat-markdown-heading-spacing:var(--luzmo-spacing-4);--ai-chat-markdown-heading-font-weight:var(--luzmo-font-weight-bold);--ai-chat-markdown-list-indent:calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-3));--ai-chat-markdown-link-color:var(--luzmo-primary);--ai-chat-markdown-code-font-family:var(--luzmo-font-family-mono,ui-monospace, monospace);--ai-chat-markdown-code-font-size:.875em;--ai-chat-markdown-code-background:var(--luzmo-background-color-highlight);--ai-chat-markdown-code-border-radius:var(--luzmo-border-radius-s);--ai-chat-markdown-border-color:var(--luzmo-border-color);--ai-chat-markdown-table-header-background:var(--luzmo-background-color-highlight);--ai-chat-assistant-message-actions-gap:var(--luzmo-spacing-2);--ai-chat-assistant-message-actions-margin-top:var(--luzmo-spacing-3);--ai-chat-assistant-message-actions-color:var(--luzmo-font-color-extra-dimmed);--ai-chat-assistant-message-actions-font-style:italic;--ai-chat-assistant-message-font-family:var(--luzmo-font-family);--ai-chat-assistant-message-font-size:var(--luzmo-font-size-s,12px);--ai-chat-assistant-message-line-height:var(--ai-chat-markdown-line-height);--ai-chat-user-message-attachment-size:64px}";
2356
+ //#endregion
2357
+ //#region src/components/ai-chat/helpers/agent-config.ts
2358
+ function kn(e, t) {
2359
+ if (e.agentConfig) {
2360
+ let n = e.agentConfig, r = t ?? kn({
2361
+ ...e,
2362
+ agentConfig: void 0
2363
+ });
2364
+ return n.context === void 0 && n.type === r.type ? {
2365
+ ...r,
2366
+ ...n,
2367
+ context: r.context
2368
+ } : n.context === void 0 ? {
2369
+ ...n,
2370
+ context: null
2371
+ } : n;
2372
+ }
2373
+ switch (e.agent ?? "item") {
2374
+ case "item":
2375
+ default: return {
2376
+ type: "item",
2377
+ context: {
2378
+ chart: e.chart,
2379
+ task: e.task
2380
+ }
2381
+ };
2382
+ case "dashboard": return {
2383
+ type: "dashboard",
2384
+ context: {
2385
+ dashboard: e.dashboard,
2386
+ currentScreenMode: e.currentScreenMode
2387
+ }
2388
+ };
2389
+ case "custom-item": return {
2390
+ type: "custom-item",
2391
+ context: { customItem: e.customItem }
2392
+ };
2393
+ case "analyst": return { type: "analyst" };
2394
+ }
2395
+ }
2396
+ function An(e) {
2397
+ return {
2398
+ chart: null,
2399
+ dashboard: null,
2400
+ customItem: null,
2401
+ currentScreenMode: void 0,
2402
+ task: void 0,
2403
+ ...e.context
2404
+ };
2405
+ }
2406
+ //#endregion
2407
+ //#region src/components/ai-chat/empty-state/ai-chat-empty-state.module.scss?inline
2408
+ var jn = ":host{box-sizing:border-box;width:100%;min-height:0;padding-block:var(--luzmo-ai-chat-empty-state-padding-block,var(--ai-chat-empty-state-padding-block));padding-inline:var(--luzmo-ai-chat-empty-state-padding-inline,var(--ai-chat-empty-state-padding-inline));flex:1;justify-content:center;align-items:center;display:flex}.empty-state{justify-content:center;align-items:center;gap:var(--luzmo-ai-chat-empty-state-header-actions-gap,var(--ai-chat-empty-state-header-actions-gap));width:100%;max-width:var(--luzmo-ai-chat-empty-state-max-width,var(--ai-chat-empty-state-max-width));text-align:center;flex-direction:column;display:flex}.header{flex-direction:column;align-items:center;width:100%;display:flex}.actions{align-items:center;gap:var(--luzmo-ai-chat-empty-state-actions-gap,var(--ai-chat-empty-state-actions-gap));flex-direction:column;width:100%;display:flex}.title{font-family:var(--luzmo-font-family);font-size:var(--luzmo-ai-chat-empty-state-title-font-size,var(--ai-chat-empty-state-title-font-size));font-weight:var(--luzmo-ai-chat-empty-state-title-font-weight,var(--ai-chat-empty-state-title-font-weight));line-height:var(--luzmo-ai-chat-empty-state-title-line-height,var(--ai-chat-empty-state-title-line-height));color:var(--luzmo-ai-chat-empty-state-title-color,var(--ai-chat-empty-state-title-color));text-wrap:balance;margin:0}.subtitle{font-family:var(--luzmo-font-family);font-size:var(--luzmo-ai-chat-empty-state-subtitle-font-size,var(--ai-chat-empty-state-subtitle-font-size));font-weight:var(--luzmo-ai-chat-empty-state-subtitle-font-weight,var(--ai-chat-empty-state-subtitle-font-weight));line-height:var(--luzmo-ai-chat-empty-state-subtitle-line-height,var(--ai-chat-empty-state-subtitle-line-height));color:var(--luzmo-ai-chat-empty-state-subtitle-color,var(--ai-chat-empty-state-subtitle-color));margin:0}.suggestions{justify-content:center;align-items:center;gap:var(--luzmo-ai-chat-empty-state-suggestions-gap,var(--ai-chat-empty-state-suggestions-gap));flex-wrap:wrap;width:100%;display:flex}luzmo-action-button{max-width:100%}:host{--ai-chat-empty-state-header-actions-gap:1.5rem;--ai-chat-empty-state-actions-gap:var(--luzmo-spacing-4);--ai-chat-empty-state-suggestions-gap:var(--luzmo-spacing-3);--ai-chat-empty-state-max-width:22.5rem;--ai-chat-empty-state-padding-block:2rem;--ai-chat-empty-state-padding-inline:var(--luzmo-spacing-5);--ai-chat-empty-state-title-font-size:var(--luzmo-font-size-l);--ai-chat-empty-state-title-font-weight:var(--luzmo-font-weight);--ai-chat-empty-state-title-line-height:1.4;--ai-chat-empty-state-title-color:var(--luzmo-font-color-hard);--ai-chat-empty-state-subtitle-font-size:var(--luzmo-font-size-s);--ai-chat-empty-state-subtitle-font-weight:var(--luzmo-font-weight);--ai-chat-empty-state-subtitle-line-height:var(--luzmo-line-height);--ai-chat-empty-state-subtitle-color:var(--luzmo-font-color-dimmed,var(--luzmo-font-color-extra-dimmed))}", Mn = class extends i {
2409
+ constructor(...e) {
2410
+ super(...e), this.title = o("What can I help you with?", { desc: "Title for the AI chat empty state" }), this.subtitle = "", this.suggestions = [], this.disabled = !1;
2411
+ }
2412
+ static {
2413
+ this.styles = f(jn);
2414
+ }
2415
+ static {
2416
+ this.tagName = "luzmo-ai-chat-empty-state";
2417
+ }
2418
+ _handleSuggestionActivate(e) {
2419
+ if (this.disabled) return;
2420
+ let t = e.prompt ?? e.label;
2421
+ this.dispatchEvent(new CustomEvent("luzmo-suggestion-selected", {
2422
+ detail: {
2423
+ label: e.label,
2424
+ prompt: t,
2425
+ selectedDatasets: e.selectedDatasets
2426
+ },
2427
+ bubbles: !0,
2428
+ composed: !0
2429
+ }));
2430
+ }
2431
+ render() {
2432
+ let e = this.suggestions.length > 0;
2433
+ return u`
2434
+ <section class="empty-state" aria-labelledby="ai-chat-empty-state-title">
2435
+ <header class="header">
2436
+ <h2 id="ai-chat-empty-state-title" class="title">${this.title}</h2>
2437
+ </header>
2438
+
2439
+ ${e ? u`
2440
+ <div class="actions">
2441
+ ${this.subtitle ? u`<p class="subtitle">${this.subtitle}</p>` : d}
2442
+ <div
2443
+ class="suggestions"
2444
+ role="group"
2445
+ aria-label=${o("Prompt suggestions", { desc: "Accessible label for the AI chat empty state suggestion list" })}
2446
+ >
2447
+ ${this.suggestions.map((e) => u`
2448
+ <luzmo-action-button
2449
+ variant="accent"
2450
+ size="s"
2451
+ ?disabled=${this.disabled}
2452
+ @click=${() => this._handleSuggestionActivate(e)}
2453
+ >
2454
+ ${e.label}
2455
+ </luzmo-action-button>
2456
+ `)}
2457
+ </div>
2458
+ </div>
2459
+ ` : d}
2460
+ </section>
2461
+ `;
2462
+ }
2463
+ };
2464
+ //#endregion
2465
+ //#region src/components/ai-chat/empty-state/index.ts
2466
+ a([p({ type: String })], Mn.prototype, "title", void 0), a([p({ type: String })], Mn.prototype, "subtitle", void 0), a([p({ type: Array })], Mn.prototype, "suggestions", void 0), a([p({
2467
+ type: Boolean,
2468
+ reflect: !0
2469
+ })], Mn.prototype, "disabled", void 0), customElements.get("luzmo-ai-chat-empty-state") || customElements.define("luzmo-ai-chat-empty-state", Mn);
2470
+ //#endregion
2471
+ //#region src/components/ai-chat/helpers/elicitation-template.ts
2472
+ var Nn = "answer", Pn = (e) => e.stopPropagation();
2473
+ function Fn(e) {
2474
+ let t = e.content?.[Nn];
2475
+ return typeof t == "string" ? t : void 0;
2476
+ }
2477
+ async function In(e) {
2478
+ e.stopPropagation();
2479
+ let t = e.currentTarget;
2480
+ await t.updateComplete, t.submit();
2481
+ }
2482
+ function Ln({ message: e, state: t, onSubmit: n }) {
2483
+ let r = e.elicitation;
2484
+ if (!r) return d;
2485
+ let i = [{
2486
+ id: Nn,
2487
+ type: "single",
2488
+ title: r.question,
2489
+ required: !0,
2490
+ options: r.options.map((e) => ({
2491
+ value: e,
2492
+ label: e
2493
+ }))
2494
+ }];
2495
+ return te(`${e.id}:${t}`, u`
2496
+ <luzmo-question-box
2497
+ size="s"
2498
+ .questions=${i}
2499
+ .value=${h([r.answer], () => r.answer ? { [Nn]: r.answer } : {})}
2500
+ .labels=${{
2501
+ submit: o("Submit", { desc: "Button that sends the chosen answer to an AI agent question" }),
2502
+ answerTitle: o("Answer", { desc: "Heading above the answer chosen for an AI agent question" }),
2503
+ change: o("Change", { desc: "Button that goes back to pick another answer for an AI agent question" })
2504
+ }}
2505
+ ?readonly=${t === "answered"}
2506
+ ?disabled=${t === "closed"}
2507
+ hide-close
2508
+ hide-skip
2509
+ @luzmo-submit=${n}
2510
+ @input=${Pn}
2511
+ @change=${In}
2512
+ @luzmo-cancel=${Pn}
2513
+ ></luzmo-question-box>
2514
+ `);
2515
+ }
2516
+ //#endregion
2517
+ //#region src/components/ai-chat/ai-chat-request.ts
2518
+ function Rn(e, t) {
2519
+ return `${e.replace(/\/+$/, "")}/${t.replace(/^\/+|\/+$/g, "")}/aiprompt`;
2520
+ }
2521
+ function zn(e) {
2522
+ return e.type === "placeholder" ? null : {
2523
+ ...e,
2524
+ version: e.version || "",
2525
+ title: e.title || e.options?.title,
2526
+ filters: e.filterGroups || [],
2527
+ aichartId: e.aichartId || ""
2528
+ };
2529
+ }
2530
+ function Bn(e, t, n = []) {
2531
+ return [
2532
+ {
2533
+ type: "text",
2534
+ text: e
2535
+ },
2536
+ ...t.map((e) => ({
2537
+ type: "dataset",
2538
+ id: e
2539
+ })),
2540
+ ...n.map((e) => ({
2541
+ type: "image",
2542
+ url: e
2543
+ }))
2544
+ ];
2545
+ }
2546
+ function Vn(e) {
2547
+ return {
2548
+ stream: e.stream ?? !0,
2549
+ response_mode: "mixed",
2550
+ ...e.conversationId ? { conversation_id: e.conversationId } : {},
2551
+ ...e.localeId ? { locale_id: e.localeId } : {}
2552
+ };
2553
+ }
2554
+ function Hn(e, t, n) {
2555
+ return {
2556
+ agent: e,
2557
+ task: t,
2558
+ ...Vn(n)
2559
+ };
2560
+ }
2561
+ function Un(e) {
2562
+ let t = Bn(e.prompt, e.datasetIds, e.attachmentUrls), n = e.chart ? zn(e.chart) : null;
2563
+ return n && t.push({
2564
+ type: "item",
2565
+ value: n
2566
+ }), {
2567
+ ...Hn("item", e.task ?? "generate", e),
2568
+ input: t
2569
+ };
2570
+ }
2571
+ function Wn(e) {
2572
+ let t = Bn(e.prompt, e.datasetIds, e.attachmentUrls);
2573
+ return e.dashboard && t.push({
2574
+ type: "dashboard",
2575
+ value: e.dashboard,
2576
+ ...e.currentScreenMode ? { current_screen_mode: e.currentScreenMode } : {}
2577
+ }), {
2578
+ ...Hn("dashboard", "generate", e),
2579
+ timezone_id: e.timezoneId ?? "UTC",
2580
+ input: t
2581
+ };
2582
+ }
2583
+ function Gn(e) {
2584
+ return {
2585
+ ...Hn("analyst", "generate", e),
2586
+ input: Bn(e.prompt, e.datasetIds, e.attachmentUrls)
2587
+ };
2588
+ }
2589
+ function Kn(e) {
2590
+ let t = Bn(e.prompt, [], e.attachmentUrls);
2591
+ return e.customItem && t.push({
2592
+ type: "custom-item",
2593
+ value: e.customItem
2594
+ }), {
2595
+ ...Hn("custom-item", "generate", e),
2596
+ text_format: "markdown",
2597
+ ...e.internal ? { internal: !0 } : {},
2598
+ input: t
2599
+ };
2600
+ }
2601
+ function qn(e, t) {
2602
+ let n = Bn(t.prompt, t.datasetIds, t.attachmentUrls), r = t.chart ? zn(t.chart) : null;
2603
+ return r && n.push({
2604
+ type: "item",
2605
+ value: r
2606
+ }), t.dashboard && n.push({
2607
+ type: "dashboard",
2608
+ value: t.dashboard,
2609
+ ...t.currentScreenMode ? { current_screen_mode: t.currentScreenMode } : {}
2610
+ }), {
2611
+ agent_id: e,
2612
+ ...Vn(t),
2613
+ input: n
2614
+ };
2615
+ }
2616
+ function Jn(e, t) {
2617
+ if (t.agentId) return qn(t.agentId, t);
2618
+ switch (e) {
2619
+ case "dashboard": return Wn(t);
2620
+ case "analyst": return Gn(t);
2621
+ case "custom-item": return Kn(t);
2622
+ default: return Un(t);
2623
+ }
2624
+ }
2625
+ function Yn(e, n) {
2626
+ let { authKey: r, authToken: i, apiVersion: a = "0.1.0" } = n;
2627
+ return n.attachmentUrls?.length && t(n.attachmentUrls), {
2628
+ key: r,
2629
+ token: i,
2630
+ action: "create",
2631
+ version: a,
2632
+ properties: Jn(e, n)
2633
+ };
2634
+ }
2635
+ function Xn(e, t, n, r = "0.1.0", i = null) {
2636
+ return {
2637
+ key: t,
2638
+ token: n,
2639
+ action: "delete",
2640
+ version: r,
2641
+ properties: {
2642
+ agent: "item",
2643
+ restore_to_message_id: e,
2644
+ ...i ? { conversation_id: i } : {}
2645
+ }
2646
+ };
2647
+ }
2648
+ //#endregion
2649
+ //#region src/components/ai-chat/stream/transport.ts
2650
+ async function Zn(e) {
2651
+ let t = await fetch(e.url, {
2652
+ method: "POST",
2653
+ headers: { "Content-Type": "application/json" },
2654
+ mode: "cors",
2655
+ body: JSON.stringify(e.body),
2656
+ signal: e.signal
2657
+ });
2658
+ if (!t.ok) {
2659
+ let e = await t.json().catch(() => null);
2660
+ throw Error(e?.message || `API request failed with status ${t.status}`);
2661
+ }
2662
+ if (!t.body) throw Error("Response body is not readable");
2663
+ return {
2664
+ body: t.body,
2665
+ conversationId: t.headers.get("x-conversation-id")
2666
+ };
2667
+ }
2668
+ function Qn(e) {
2669
+ let t = e.trim();
2670
+ if (!t || t.startsWith(":") || t.startsWith("event:") || t.startsWith("id:")) return null;
2671
+ let n = t;
2672
+ return n.startsWith("data:") && (n = n.slice(5).trimStart()), !n || n === "[DONE]" ? null : JSON.parse(n);
2673
+ }
2674
+ function $n(e, t) {
2675
+ try {
2676
+ let n = Qn(e);
2677
+ n && t(n);
2678
+ } catch {
2679
+ console.error("Failed to parse stream line");
2680
+ }
2681
+ }
2682
+ async function er(e, t) {
2683
+ let n = e.getReader(), r = new TextDecoder(), i = "";
2684
+ try {
2685
+ for (;;) {
2686
+ let { done: e, value: a } = await n.read();
2687
+ if (e) break;
2688
+ i += r.decode(a, { stream: !0 });
2689
+ let o = i.split(/\r?\n/);
2690
+ i = o.pop() ?? "";
2691
+ for (let e of o) $n(e, t);
2692
+ }
2693
+ i += r.decode();
2694
+ let e = i.trim();
2695
+ e && $n(e, t);
2696
+ } finally {
2697
+ n.releaseLock();
2698
+ }
2699
+ }
2700
+ //#endregion
2701
+ //#region src/components/ai-chat/stream/progress.ts
2702
+ function tr() {
2703
+ return {
2704
+ id: "root",
2705
+ step: "root",
2706
+ status: "pending",
2707
+ children: [{
2708
+ id: "client-init",
2709
+ step: "iqInit",
2710
+ status: "inProgress",
2711
+ description: o("Thinking", { desc: "Label shown in the AI chat progress tree while the assistant starts processing a prompt" })
2712
+ }]
2713
+ };
2714
+ }
2715
+ function nr(e) {
2716
+ let t = e.progress;
2717
+ return typeof t != "object" || !t ? !1 : "id" in t && "step" in t && "status" in t;
2718
+ }
2719
+ //#endregion
2720
+ //#region src/components/ai-chat/stream/chunk-extractors.ts
2721
+ function rr(e) {
2722
+ if (!e || typeof e != "object") return "";
2723
+ let t = e.assistant_message;
2724
+ if (!t || typeof t != "object") return "";
2725
+ if (typeof t.message == "string") return t.message;
2726
+ if (typeof t.text == "string") return t.text;
2727
+ if (typeof t.summary == "string") return t.summary;
2728
+ let n = t.content;
2729
+ return typeof n == "string" ? n : n && typeof n == "object" && typeof n.text == "string" ? n.text : "";
2730
+ }
2731
+ function ir(e) {
2732
+ return e.type === "text_delta" && typeof e.delta == "string" ? e.delta : typeof e.text_delta == "string" ? e.text_delta : typeof e.chunk == "string" ? e.chunk : typeof e.message == "string" ? e.message : typeof e.summary == "string" ? e.summary : "";
2733
+ }
2734
+ function ar(e) {
2735
+ return rr(e.result);
2736
+ }
2737
+ function or(e) {
2738
+ return !!e.done || e.type === "finish" || e.type === "done" || "question" in e;
2739
+ }
2740
+ function sr(e, t) {
2741
+ let n = typeof e.conversation_id == "string" && e.conversation_id || typeof e.conversationId == "string" && e.conversationId;
2742
+ n && t.callbacks.onConversationIdChange(n);
2743
+ }
2744
+ function cr(e) {
2745
+ for (let t of e) if (t && typeof t == "object" && t.type === "item") {
2746
+ let e = t.value;
2747
+ if (e && typeof e == "object") return e;
2748
+ }
2749
+ return null;
2750
+ }
2751
+ function lr(e) {
2752
+ let t = e.chart ?? e.generatedChart;
2753
+ if (t && typeof t == "object") return t;
2754
+ let n = e.aiMessageAssets ?? e.ai_message_assets;
2755
+ if (Array.isArray(n)) {
2756
+ let e = cr(n);
2757
+ if (e) return e;
2758
+ }
2759
+ let r = e.result;
2760
+ if (r && typeof r == "object") {
2761
+ let e = r.assistant_message, t = e?.aiMessageAssets ?? e?.ai_message_assets;
2762
+ if (Array.isArray(t)) return cr(t);
2763
+ }
2764
+ return null;
2765
+ }
2766
+ function ur(e) {
2767
+ for (let t of e) if (t && typeof t == "object" && t.type === "dashboard") {
2768
+ let e = t.value;
2769
+ if (e && typeof e == "object" && Array.isArray(e.views)) return e;
2770
+ }
2771
+ return null;
2772
+ }
2773
+ function dr(e) {
2774
+ for (let t of e) if (t && typeof t == "object" && t.type === "dashboard") {
2775
+ let e = t.name;
2776
+ if (e && typeof e == "object") return e;
2777
+ }
2778
+ }
2779
+ function fr(...e) {
2780
+ return e.find(Array.isArray);
2781
+ }
2782
+ function pr(e) {
2783
+ if (e.views && Array.isArray(e.views)) return e;
2784
+ let t = e.aiMessageAssets ?? e.ai_message_assets;
2785
+ if (Array.isArray(t)) return ur(t);
2786
+ let n = e.result;
2787
+ if (n && typeof n == "object") {
2788
+ let e = n.assistant_message, t = e?.aiMessageAssets ?? e?.ai_message_assets;
2789
+ if (Array.isArray(t)) return ur(t);
2790
+ }
2791
+ return null;
2792
+ }
2793
+ function mr(e) {
2794
+ let t = e.aiMessageAssets ?? e.ai_message_assets, n = e.result?.assistant_message, r = fr(t, n?.aiMessageAssets ?? n?.ai_message_assets);
2795
+ return r ? dr(r) : void 0;
2796
+ }
2797
+ function hr(e) {
2798
+ let t = e.result?.assistant_message;
2799
+ for (let n of [e.aiMessageAssets ?? e.ai_message_assets, t?.aiMessageAssets ?? t?.ai_message_assets]) if (Array.isArray(n)) {
2800
+ for (let e of n) if (e && typeof e == "object" && e.type === "custom-item" && e.value && typeof e.value == "object" && !Array.isArray(e.value)) return e.value;
2801
+ }
2802
+ return null;
2803
+ }
2804
+ //#endregion
2805
+ //#region src/components/ai-chat/stream/stream-processor.ts
2806
+ var gr = /* @__PURE__ */ new Set([
2807
+ "conversation-id",
2808
+ "conversation_id",
2809
+ "keepalive",
2810
+ "ping",
2811
+ "finish",
2812
+ "done"
2813
+ ]);
2814
+ function _r(e, t, n) {
2815
+ return {
2816
+ agent: n.agent,
2817
+ conversationId: t.callbacks.getConversationId(),
2818
+ ...typeof e.messageId == "string" ? { messageId: e.messageId } : {},
2819
+ raw: e
2820
+ };
2821
+ }
2822
+ function Q(e, t, n, r, i) {
2823
+ let a = {
2824
+ ..._r(n, e, t),
2825
+ recognized: !0,
2826
+ type: r,
2827
+ data: i
2828
+ };
2829
+ e.callbacks.onStep(a);
2830
+ }
2831
+ function vr(e, t, n, r, i) {
2832
+ let a = {
2833
+ ..._r(n, e, t),
2834
+ recognized: !1,
2835
+ type: r,
2836
+ data: i
2837
+ };
2838
+ e.callbacks.onStep(a);
2839
+ }
2840
+ function yr(e) {
2841
+ e.state.progressCollapsed || (e.state.progressCollapsed = !0, e.callbacks.onProgressCollapsed(!0));
2842
+ }
2843
+ function br(e, t) {
2844
+ yr(e), e.aiMessage.message = (e.aiMessage.message || "") + t, e.callbacks.onMessageUpdate(e.aiMessage);
2845
+ }
2846
+ function xr(e) {
2847
+ if (!e) return null;
2848
+ let t = e.descriptionMetadata?.decision;
2849
+ if (t === "create" || t === "edit" || t === "question") return t;
2850
+ for (let t of e.children ?? []) {
2851
+ let e = xr(t);
2852
+ if (e) return e;
2853
+ }
2854
+ return null;
2855
+ }
2856
+ function Sr(e, t, n) {
2857
+ if (!nr(e)) return !1;
2858
+ let r = e.progress;
2859
+ if (t.callbacks.onProgress(r), Q(t, n, e, "progress", r), t.state.decision === null) {
2860
+ let i = xr(r);
2861
+ i && (t.state.decision = i, Q(t, n, e, "decision", { decision: i }));
2862
+ }
2863
+ return !0;
2864
+ }
2865
+ function Cr(e) {
2866
+ return !!e.error || e.type === "error" || typeof e.error_text == "string";
2867
+ }
2868
+ function wr(e) {
2869
+ return typeof e.error_text == "string" && e.error_text ? e.error_text : typeof e.error == "string" && e.error ? e.error : o("Something went wrong. Please try again.", { desc: "Generic error message shown in ai chat when the API request fails" });
2870
+ }
2871
+ function Tr(e, t, n) {
2872
+ if (!Cr(e)) return !1;
2873
+ let r = wr(e);
2874
+ return t.aiMessage.message = r, t.aiMessage.isError = !0, delete t.aiMessage.elicitation, t.callbacks.onMessageUpdate(t.aiMessage), Yr(e, t, n, e.error ?? r), !0;
2875
+ }
2876
+ function Er(e) {
2877
+ return typeof e.question == "string" && e.question ? e.question : typeof e.text == "string" && e.text ? e.text : "";
2878
+ }
2879
+ function Dr(e, t, n) {
2880
+ if (e.type !== "interrupt") return !1;
2881
+ let r = Er(e);
2882
+ return r && (t.state.interruptQuestion = r, br(t, r), Q(t, n, e, "interrupt", { question: r })), Yr(e, t, n), !0;
2883
+ }
2884
+ function Or(e) {
2885
+ let t = e.elicitation;
2886
+ if (!t || typeof t != "object") return null;
2887
+ let { question: n, options: r } = t, i = typeof n == "string" ? n.trim() : "", a = Array.isArray(r) ? [...new Set(r.filter((e) => typeof e == "string").map((e) => e.trim()))].filter(Boolean) : [];
2888
+ return i && a.length >= 2 ? {
2889
+ question: i,
2890
+ options: a
2891
+ } : null;
2892
+ }
2893
+ function kr(e, t, n) {
2894
+ if (e.type !== "elicitation") return !1;
2895
+ let r = Or(e);
2896
+ return r ? (yr(t), t.aiMessage.elicitation = r, t.callbacks.onMessageUpdate(t.aiMessage), Q(t, n, e, "elicitation", {
2897
+ question: r.question,
2898
+ options: r.options
2899
+ }), !0) : (vr(t, n, e, "elicitation", e), !0);
2900
+ }
2901
+ function Ar(e) {
2902
+ return typeof e.asset_id == "string" ? e.asset_id : typeof e.asset_type == "string" ? e.asset_type : "default";
2903
+ }
2904
+ function jr(e) {
2905
+ return typeof e.asset_type == "string" ? e.asset_type : "";
2906
+ }
2907
+ function Mr(e) {
2908
+ return {
2909
+ assetType: jr(e),
2910
+ snapshot: {}
2911
+ };
2912
+ }
2913
+ function Nr(e, t) {
2914
+ return {
2915
+ ...e,
2916
+ ...t
2917
+ };
2918
+ }
2919
+ function Pr(e) {
2920
+ let t = e.asset_delta ?? e.delta;
2921
+ return t && typeof t == "object" ? t : null;
2922
+ }
2923
+ function Fr(e, t) {
2924
+ t.state.assets[Ar(e)] = Mr(e);
2925
+ }
2926
+ function Ir(e, t) {
2927
+ let n = Ar(e), r = t.state.assets[n] ?? Mr(e), i = Pr(e);
2928
+ i && (r.snapshot = Nr(r.snapshot, i)), t.state.assets[n] = r;
2929
+ }
2930
+ function Lr(e, t) {
2931
+ let n = e.asset ?? e.value ?? e.asset_delta ?? e.delta;
2932
+ return n && typeof n == "object" ? Nr(t?.snapshot ?? {}, n) : t?.snapshot ?? {};
2933
+ }
2934
+ function Rr(e, t, n) {
2935
+ let r = Ar(e), i = t.state.assets[r], a = i?.assetType || jr(e), o = Lr(e, i);
2936
+ delete t.state.assets[r], Hr(a, o, e, t, n);
2937
+ }
2938
+ function zr(e, t, n) {
2939
+ switch (e.type) {
2940
+ case "asset_start": return Fr(e, t), !0;
2941
+ case "asset_delta": return Ir(e, t), !0;
2942
+ case "asset_end": return Rr(e, t, n), !0;
2943
+ default: return !1;
2944
+ }
2945
+ }
2946
+ function Br(e, t, n, r) {
2947
+ n.state.chartSnapshot = e, n.aiMessage.hasChart = !0, typeof t.messageId == "string" && (n.aiMessage.apiMessageId = t.messageId), n.callbacks.onMessageUpdate(n.aiMessage), Q(n, r, t, "chart", e);
2948
+ }
2949
+ function Vr(e, t, n, r) {
2950
+ n.state.customItemSnapshot = e, Q(n, r, t, "custom-item", e);
2951
+ }
2952
+ function Hr(e, t, n, r, i) {
2953
+ switch (e) {
2954
+ case "dashboard-title": {
2955
+ let e = t.name;
2956
+ e && typeof e == "object" && (r.state.dashboardName = e, Q(r, i, n, "dashboard-title", { name: e }));
2957
+ return;
2958
+ }
2959
+ case "dashboard-layout":
2960
+ Q(r, i, n, "dashboard-layout", t);
2961
+ return;
2962
+ case "dashboard-item":
2963
+ Q(r, i, n, "dashboard-item", {
2964
+ slot: Number(t.slot),
2965
+ chart: t.chart ?? t
2966
+ });
2967
+ return;
2968
+ case "dashboard":
2969
+ r.state.dashboardSnapshot = t;
2970
+ return;
2971
+ default: Ur(e, t, n, r, i);
2972
+ }
2973
+ }
2974
+ function Ur(e, t, n, r, i) {
2975
+ if (i.chartAssetType && e === i.chartAssetType) {
2976
+ Br(t, n, r, i);
2977
+ return;
2978
+ }
2979
+ if (i.dashboardAssetType && e === i.dashboardAssetType) {
2980
+ r.state.dashboardSnapshot = t;
2981
+ return;
2982
+ }
2983
+ if (i.customItemAssetType && e === i.customItemAssetType) {
2984
+ Vr(t, n, r, i);
2985
+ return;
2986
+ }
2987
+ vr(r, i, n, e || "asset", t);
2988
+ }
2989
+ function Wr(e, t, n) {
2990
+ let r = !1;
2991
+ if (n.dashboardAssetType) {
2992
+ let n = pr(e);
2993
+ if (n) {
2994
+ t.state.dashboardSnapshot = n;
2995
+ let i = mr(e);
2996
+ i && (t.state.dashboardName = i), r = !0;
2997
+ }
2998
+ }
2999
+ if (n.chartAssetType && !t.state.chartSnapshot) {
3000
+ let i = lr(e);
3001
+ i && (Br(i, e, t, n), r = !0);
3002
+ }
3003
+ if (n.customItemAssetType && !t.state.customItemSnapshot) {
3004
+ let i = hr(e);
3005
+ i && (Vr(i, e, t, n), r = !0);
3006
+ }
3007
+ return r;
3008
+ }
3009
+ function Gr(e, t, n) {
3010
+ return {
3011
+ ...e,
3012
+ generatedChart: t,
3013
+ conversationId: n.callbacks.getConversationId()
3014
+ };
3015
+ }
3016
+ function Kr(e, t, n) {
3017
+ for (let r of Object.keys(t.state.assets)) {
3018
+ let i = t.state.assets[r];
3019
+ delete t.state.assets[r], !(n.chartAssetType && i.assetType === n.chartAssetType && t.state.chartSnapshot || n.dashboardAssetType && i.assetType === n.dashboardAssetType && t.state.dashboardSnapshot || n.customItemAssetType && i.assetType === n.customItemAssetType && t.state.customItemSnapshot) && Hr(i.assetType, i.snapshot, e, t, n);
3020
+ }
3021
+ }
3022
+ function qr(e, t) {
3023
+ let n = ar(e);
3024
+ !n || t.aiMessage.message === n || (t.aiMessage.message = n, t.callbacks.onMessageUpdate(t.aiMessage));
3025
+ }
3026
+ function Jr(e, t, n) {
3027
+ let r = t.state.dashboardSnapshot ?? (n.dashboardAssetType ? pr(e) : null), i = t.state.chartSnapshot ?? (n.chartAssetType ? lr(e) : null);
3028
+ return {
3029
+ agent: n.agent,
3030
+ conversationId: t.callbacks.getConversationId(),
3031
+ message: t.aiMessage,
3032
+ ...r ? { dashboard: r } : {},
3033
+ ...i ? { chart: Gr(e, i, t) } : {},
3034
+ ...t.state.customItemSnapshot ? { customItem: t.state.customItemSnapshot } : {},
3035
+ ...t.state.dashboardName ? { name: t.state.dashboardName } : {},
3036
+ raw: e
3037
+ };
3038
+ }
3039
+ function Yr(e, t, n, r) {
3040
+ if (!t.state.completed) {
3041
+ if (t.state.completed = !0, Kr(e, t, n), yr(t), r !== void 0) {
3042
+ t.callbacks.onComplete({
3043
+ agent: n.agent,
3044
+ conversationId: t.callbacks.getConversationId(),
3045
+ message: t.aiMessage,
3046
+ error: r,
3047
+ raw: e
3048
+ });
3049
+ return;
3050
+ }
3051
+ qr(e, t), t.callbacks.onComplete(Jr(e, t, n));
3052
+ }
3053
+ }
3054
+ function Xr(e) {
3055
+ return typeof e.type == "string" && e.type ? e.type : typeof e.asset_type == "string" && e.asset_type ? e.asset_type : "";
3056
+ }
3057
+ function Zr(e, t, n) {
3058
+ let r = ir(e);
3059
+ return r ? (t.state.accumulatedText += r, br(t, r), Q(t, n, e, "text", {
3060
+ delta: r,
3061
+ text: t.state.accumulatedText
3062
+ }), !0) : !1;
3063
+ }
3064
+ function Qr(e, t, n, r, i) {
3065
+ if (r || i) return;
3066
+ let a = Xr(e);
3067
+ a && !gr.has(a) && vr(t, n, e, a, e);
3068
+ }
3069
+ function $r(e, t, n) {
3070
+ if (sr(e, t), Sr(e, t, n) || Tr(e, t, n) || Dr(e, t, n) || kr(e, t, n) || zr(e, t, n)) return;
3071
+ let r = Zr(e, t, n), i = Wr(e, t, n), a = r || i, o = or(e);
3072
+ Qr(e, t, n, a, o), o && Yr(e, t, n);
3073
+ }
3074
+ //#endregion
3075
+ //#region src/components/ai-chat/stream/registry.ts
3076
+ function ei(e) {
3077
+ switch (e) {
3078
+ case "dashboard": return {
3079
+ agent: e,
3080
+ dashboardAssetType: "dashboard"
3081
+ };
3082
+ case "item": return {
3083
+ agent: e,
3084
+ chartAssetType: "item"
3085
+ };
3086
+ case "custom-item": return {
3087
+ agent: e,
3088
+ customItemAssetType: "custom-item"
3089
+ };
3090
+ default: return { agent: e };
3091
+ }
3092
+ }
3093
+ function ti(e) {
3094
+ let t = ei(e);
3095
+ return (e, n) => $r(e, n, t);
3096
+ }
3097
+ function ni() {
3098
+ return {
3099
+ progressCollapsed: !1,
3100
+ accumulatedText: "",
3101
+ decision: null,
3102
+ assets: {},
3103
+ dashboardSnapshot: null,
3104
+ dashboardName: void 0,
3105
+ chartSnapshot: null,
3106
+ customItemSnapshot: null,
3107
+ interruptQuestion: null,
3108
+ completed: !1
3109
+ };
3110
+ }
3111
+ //#endregion
3112
+ //#region src/components/ai-chat/session/ai-chat-session.ts
3113
+ function ri() {
3114
+ return `msg-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
3115
+ }
3116
+ var ii = class {
3117
+ constructor(e, t = {}) {
3118
+ this._uiBridgeCallbacks = {}, this._subscribers = /* @__PURE__ */ new Set(), this._state = {
3119
+ messages: [],
3120
+ selectedDatasets: [],
3121
+ isGenerating: !1,
3122
+ progress: null,
3123
+ progressCollapsed: !1,
3124
+ conversationId: null,
3125
+ inflightMessage: null
3126
+ }, this._abortController = null, this._inflightMessage = null, this._receivedProgress = !1, this._config = {
3127
+ apiUrl: "https://api.luzmo.com",
3128
+ apiVersion: "0.1.0",
3129
+ stream: !0,
3130
+ ...e
3131
+ }, e.agentConfig && (this._config.agentConfig = kn(e)), this._hostCallbacks = t, this._state = {
3132
+ ...this._state,
3133
+ messages: e.messages ? [...e.messages] : [],
3134
+ selectedDatasets: e.selectedDatasets ? [...e.selectedDatasets] : [],
3135
+ conversationId: e.conversationId ?? null,
3136
+ isGenerating: e.isGenerating ?? !1,
3137
+ progress: e.progress ?? null,
3138
+ progressCollapsed: e.progressCollapsed ?? !1
3139
+ };
3140
+ }
3141
+ get state() {
3142
+ return this._state;
3143
+ }
3144
+ get isGenerating() {
3145
+ return this._state.isGenerating;
3146
+ }
3147
+ get agentConfig() {
3148
+ return kn(this._config);
3149
+ }
3150
+ subscribe(e) {
3151
+ return this._subscribers.add(e), e(this._state), () => {
3152
+ this._subscribers.delete(e);
3153
+ };
3154
+ }
3155
+ setUiBridge(e) {
3156
+ this._uiBridgeCallbacks = e;
3157
+ }
3158
+ updateConfig(e) {
3159
+ let t = this.agentConfig, n = this._config.agentConfig !== void 0;
3160
+ this._config = {
3161
+ ...this._config,
3162
+ ...e
3163
+ }, e.agentConfig && (this._config.agentConfig = kn(this._config, t));
3164
+ let r = {};
3165
+ if ("conversationId" in e) {
3166
+ let t = e.conversationId ?? null;
3167
+ t !== this._state.conversationId && (r.conversationId = t);
3168
+ }
3169
+ if ("selectedDatasets" in e && e.selectedDatasets) {
3170
+ let t = [...e.selectedDatasets];
3171
+ this._areSelectedDatasetsEqual(t, this._state.selectedDatasets) || (r.selectedDatasets = t);
3172
+ }
3173
+ if ("messages" in e && e.messages) {
3174
+ let t = [...e.messages];
3175
+ this._areChatMessagesEqual(t, this._state.messages) || (r.messages = t);
3176
+ }
3177
+ if ("isGenerating" in e && e.isGenerating !== this._state.isGenerating && (r.isGenerating = e.isGenerating), "progress" in e && (r.progress = e.progress ?? null), "progressCollapsed" in e && e.progressCollapsed !== this._state.progressCollapsed && (r.progressCollapsed = e.progressCollapsed), Object.keys(r).length > 0) this._patchState(r);
3178
+ else if ("agentConfig" in e && (n || this._config.agentConfig !== void 0)) {
3179
+ let e = this.agentConfig;
3180
+ (e.type !== t.type || e.context !== t.context) && this._notifySubscribers();
3181
+ }
3182
+ }
3183
+ setSelectedDatasets(e) {
3184
+ this._patchState({ selectedDatasets: [...e] }), this._emit("onDatasetsChanged", this._state.selectedDatasets);
3185
+ }
3186
+ addDataset(e) {
3187
+ this._state.selectedDatasets.some((t) => t.id === e.id) || (this._patchState({ selectedDatasets: [...this._state.selectedDatasets, e] }), this._emit("onDatasetsChanged", this._state.selectedDatasets));
3188
+ }
3189
+ removeDataset(e) {
3190
+ let t = this._state.selectedDatasets.filter((t) => t.id !== e);
3191
+ t.length !== this._state.selectedDatasets.length && (this._patchState({ selectedDatasets: t }), this._emit("onDatasetsChanged", this._state.selectedDatasets));
3192
+ }
3193
+ isDatasetRequirementMet(e) {
3194
+ return !this._config.requireDataset || this._state.selectedDatasets.length > 0 || !!e;
3195
+ }
3196
+ getAiPromptUrl() {
3197
+ return Rn(this._config.apiUrl ?? "https://api.luzmo.com", this._config.apiVersion ?? "0.1.0");
3198
+ }
3199
+ buildRequestBody(e, t, n = [], r = this._config.agentId, i = {}) {
3200
+ return Yn(this.agentConfig.type, {
3201
+ prompt: e,
3202
+ datasetIds: t,
3203
+ authKey: this._config.authKey,
3204
+ authToken: this._config.authToken,
3205
+ conversationId: this._state.conversationId,
3206
+ agentId: r,
3207
+ chart: this._config.chart ?? null,
3208
+ dashboard: this._config.dashboard ?? null,
3209
+ customItem: this._config.customItem ?? null,
3210
+ currentScreenMode: this._config.currentScreenMode,
3211
+ localeId: this._config.localeId,
3212
+ timezoneId: this._config.timezoneId,
3213
+ task: this._config.task,
3214
+ ...this._config.agentConfig ? An(this.agentConfig) : {},
3215
+ modelPreference: this._config.modelPreference,
3216
+ apiVersion: this._config.apiVersion,
3217
+ stream: this._config.stream,
3218
+ attachmentUrls: n,
3219
+ internal: i.internal
3220
+ });
3221
+ }
3222
+ buildPromptSubmittedDetail(e) {
3223
+ let t = e.attachmentUrls ?? [];
3224
+ return {
3225
+ prompt: e.prompt,
3226
+ selectedDatasets: e.selectedDatasets,
3227
+ datasetIds: e.datasetIds,
3228
+ agent: this.agentConfig.type,
3229
+ request: this.buildRequestBody(e.prompt, e.datasetIds, t, e.agentId, { internal: e.internal }),
3230
+ url: this.getAiPromptUrl(),
3231
+ ...e.signal ? { signal: e.signal } : {},
3232
+ ...e.attachments?.length ? { attachments: e.attachments } : {},
3233
+ ...t.length ? { attachmentUrls: t } : {}
3234
+ };
3235
+ }
3236
+ async _resolveAttachmentUrls(e, i) {
3237
+ if (e.attachmentUrls?.length) return t(e.attachmentUrls), [...e.attachmentUrls];
3238
+ let a = (e.attachments ?? []).map((e) => e.file).filter((e) => !!e);
3239
+ if (a.length === 0) return [];
3240
+ r(a);
3241
+ let o = this._hostCallbacks.uploadAttachments ?? this._uiBridgeCallbacks.uploadAttachments;
3242
+ if (typeof o == "function") return this._normalizeUploadedUrls(await o(a, { signal: i }), a.length);
3243
+ let { authKey: s, authToken: c, apiUrl: l = "https://api.luzmo.com", apiVersion: u = "0.1.0" } = this._config;
3244
+ if (!s || !c) {
3245
+ if (this._hasCallback("onPromptSubmitted")) return [];
3246
+ throw Error("Image attachments require authKey/authToken for built-in upload, or provide uploadAttachments / attachmentUrls.");
3247
+ }
3248
+ return this._normalizeUploadedUrls(await n({
3249
+ files: a,
3250
+ authKey: s,
3251
+ authToken: c,
3252
+ apiUrl: l,
3253
+ apiVersion: u,
3254
+ signal: i
3255
+ }), a.length);
3256
+ }
3257
+ _normalizeUploadedUrls(e, n) {
3258
+ let r = Array.isArray(e) ? e.filter((e) => typeof e == "string" && e.trim().length > 0) : [];
3259
+ if (r.length !== n) throw Error(`Image upload returned ${r.length} URL(s) for ${n} file(s). Return one non-empty signed URL per file, in the same order.`);
3260
+ return t(r), r;
3261
+ }
3262
+ async submit(e) {
3263
+ await this._submit(e);
3264
+ }
3265
+ async _submit(e) {
3266
+ let t = e.datasetIds ?? this._state.selectedDatasets.map((e) => e.id);
3267
+ if (!this.isDatasetRequirementMet(e.agentId)) return !1;
3268
+ this._abortInflight();
3269
+ let n = new AbortController();
3270
+ this._abortController = n;
3271
+ let r;
3272
+ try {
3273
+ r = await this._resolveAttachmentUrls(e, n.signal);
3274
+ } catch (e) {
3275
+ if (this._abortController === n && (this._abortController = null), n.signal.aborted || e.name === "AbortError") return !1;
3276
+ throw e;
3277
+ }
3278
+ if (n.signal.aborted || this._abortController !== n) return !1;
3279
+ let i = {
3280
+ id: e.aiMessageId ?? ri(),
3281
+ type: "ai",
3282
+ message: ""
3283
+ }, a = [...this._state.messages];
3284
+ if (!e.skipUserMessage) {
3285
+ let t = {
3286
+ id: ri(),
3287
+ type: "user",
3288
+ message: e.prompt,
3289
+ ...r.length ? { attachmentUrls: r } : {}
3290
+ };
3291
+ a = [...a, t], this._emit("onMessageSent", t, [...this._state.selectedDatasets]);
3292
+ }
3293
+ a = [...a, i], this._inflightMessage = i, this._receivedProgress = !1, this._patchState({
3294
+ messages: a,
3295
+ isGenerating: !0,
3296
+ progress: tr(),
3297
+ progressCollapsed: !1,
3298
+ inflightMessage: i
3299
+ });
3300
+ let o = t, s = [...this._state.selectedDatasets];
3301
+ if (this._hasCallback("onPromptSubmitted")) {
3302
+ let t = this.buildPromptSubmittedDetail({
3303
+ prompt: e.prompt,
3304
+ selectedDatasets: s,
3305
+ datasetIds: o,
3306
+ signal: n.signal,
3307
+ attachments: e.attachments,
3308
+ attachmentUrls: r,
3309
+ agentId: e.agentId,
3310
+ internal: e.internal
3311
+ });
3312
+ try {
3313
+ await this._invokeCallback("onPromptSubmitted", t);
3314
+ } catch (e) {
3315
+ e.name === "AbortError" ? this.abort() : (this._handleSubmitError(e, i, t.agent), this._finalizeInflightMessage()), this._patchState({ isGenerating: !1 });
3316
+ }
3317
+ return !0;
3318
+ }
3319
+ let c = this.buildRequestBody(e.prompt, t, r, e.agentId, { internal: e.internal }), l = this.agentConfig.type, u = ti(l), d = {
3320
+ aiMessage: i,
3321
+ callbacks: this._createStreamCallbacks(),
3322
+ state: ni()
3323
+ }, f = this._config.fetchStreaming ?? Zn, p = !1;
3324
+ try {
3325
+ let { body: e, conversationId: t } = await f({
3326
+ url: this.getAiPromptUrl(),
3327
+ body: c,
3328
+ signal: n.signal
3329
+ });
3330
+ t && this._setConversationId(t), await er(e, (e) => u(e, d)), p = !0;
3331
+ } catch (e) {
3332
+ e.name !== "AbortError" && (this._handleSubmitError(e, i, l), p = !0);
3333
+ } finally {
3334
+ this._abortController === n && (p ? this._finalizeInflightMessage() : this._discardInflightMessage(), this._patchState({ isGenerating: !1 }), this._abortController = null);
3335
+ }
3336
+ return !0;
3337
+ }
3338
+ async answerElicitation(e, t, n = {}) {
3339
+ let r = this._state.messages.at(-1), i = r?.id === e ? r.elicitation : void 0;
3340
+ if (this._state.isGenerating || !i || i.answer || !i.options.includes(t) || !this.isDatasetRequirementMet(n.agentId)) return !1;
3341
+ let a = (t) => {
3342
+ this._patchState({ messages: this._state.messages.map((n) => n.id === e ? {
3343
+ ...n,
3344
+ elicitation: {
3345
+ ...i,
3346
+ answer: t
3347
+ }
3348
+ } : n) });
3349
+ };
3350
+ a(t);
3351
+ let o = !1;
3352
+ try {
3353
+ o = await this._submit({
3354
+ ...n,
3355
+ prompt: t
3356
+ });
3357
+ } finally {
3358
+ o || a(void 0);
3359
+ }
3360
+ return o;
3361
+ }
3362
+ async restore(e) {
3363
+ let t = this.agentConfig.type;
3364
+ if (t !== "item") return {};
3365
+ let n = Xn(e.restoreToMessageId, this._config.authKey, this._config.authToken, this._config.apiVersion, this._state.conversationId);
3366
+ if (this._patchState({
3367
+ isGenerating: !0,
3368
+ progress: null,
3369
+ progressCollapsed: !1
3370
+ }), this._hasCallback("onRestoreRequested")) {
3371
+ let t = {
3372
+ apiMessageId: e.restoreToMessageId,
3373
+ messageIndex: e.messageIndex,
3374
+ request: n,
3375
+ url: this.getAiPromptUrl()
3376
+ };
3377
+ try {
3378
+ await this._invokeCallback("onRestoreRequested", t);
3379
+ } finally {
3380
+ this._patchState({ isGenerating: !1 });
3381
+ }
3382
+ return {};
3383
+ }
3384
+ try {
3385
+ let r = await fetch(this.getAiPromptUrl(), {
3386
+ method: "POST",
3387
+ headers: { "Content-Type": "application/json" },
3388
+ mode: "cors",
3389
+ body: JSON.stringify(n)
3390
+ });
3391
+ if (!r.ok) {
3392
+ let e = await r.json().catch(() => null);
3393
+ throw Error(e?.message || `API request failed with status ${r.status}`);
3394
+ }
3395
+ let i = await r.json().catch(() => null), a = i?.generatedChart ?? (i ? lr(i) : null), o = {
3396
+ ...typeof i?.message == "string" ? { message: i.message } : {},
3397
+ ...a ? { chart: {
3398
+ ...i,
3399
+ generatedChart: a
3400
+ } } : {}
3401
+ }, s = e.messageIndex >= 0 && e.messageIndex < this._state.messages.length ? this._state.messages.slice(0, e.messageIndex + 1) : this._state.messages;
3402
+ if (o.message && s[e.messageIndex]?.type === "ai" && (s[e.messageIndex] = {
3403
+ ...s[e.messageIndex],
3404
+ message: o.message
3405
+ }), this._patchState({ messages: [...s] }), o.chart || o.message) {
3406
+ let n = s[e.messageIndex], r = n?.type === "ai" ? n : {
3407
+ id: ri(),
3408
+ type: "ai",
3409
+ message: o.message ?? ""
3410
+ };
3411
+ this._emit("onComplete", {
3412
+ agent: t,
3413
+ conversationId: this._state.conversationId,
3414
+ message: r,
3415
+ ...o.chart ? { chart: o.chart } : {},
3416
+ ...i ? { raw: i } : {}
3417
+ });
3418
+ }
3419
+ return o;
3420
+ } finally {
3421
+ this._patchState({ isGenerating: !1 });
3422
+ }
3423
+ }
3424
+ buildRestoreRequest(e) {
3425
+ return Xn(e, this._config.authKey, this._config.authToken, this._config.apiVersion, this._state.conversationId);
3426
+ }
3427
+ abort(e = {}) {
3428
+ this._abortController?.abort(), this._abortController = null, e.notify && this._inflightMessage ? this._markInflightCancelled(e.cancelledMessage) : this._discardInflightMessage(), this._patchState({
3429
+ isGenerating: !1,
3430
+ progress: null,
3431
+ progressCollapsed: !1
3432
+ }), e.notify && this._emit("onPromptStopped");
3433
+ }
3434
+ _abortInflight() {
3435
+ this._abortController?.abort(), this._abortController = null, this._discardInflightMessage();
3436
+ }
3437
+ _createStreamCallbacks() {
3438
+ return {
3439
+ onConversationIdChange: (e) => this._setConversationId(e),
3440
+ onProgress: (e) => {
3441
+ this._receivedProgress = !0, this._patchState({ progress: e });
3442
+ },
3443
+ onProgressCollapsed: (e) => {
3444
+ this._patchState({ progressCollapsed: e });
3445
+ },
3446
+ onMessageUpdate: (e) => {
3447
+ this._inflightMessage = e, this._upsertMessage(e), this._patchState({ inflightMessage: { ...e } });
3448
+ },
3449
+ getConversationId: () => this._state.conversationId,
3450
+ onStep: (e) => {
3451
+ this._emit("onStep", e);
3452
+ },
3453
+ onComplete: (e) => {
3454
+ this._emit("onComplete", e);
3455
+ }
3456
+ };
3457
+ }
3458
+ _setConversationId(e) {
3459
+ this._config = {
3460
+ ...this._config,
3461
+ conversationId: e
3462
+ }, this._patchState({ conversationId: e }), this._emit("onConversationIdChange", e);
3463
+ }
3464
+ _upsertMessage(e) {
3465
+ let t = this._state.messages.findIndex((t) => t.id === e.id);
3466
+ if (t === -1) {
3467
+ this._patchState({ messages: [...this._state.messages, { ...e }] });
3468
+ return;
3469
+ }
3470
+ let n = this._state.messages.map((n, r) => r === t ? { ...e } : n);
3471
+ this._patchState({ messages: n });
3472
+ }
3473
+ _finalizeInflightMessage() {
3474
+ this._inflightMessage && (this._state.progress && this._receivedProgress && (this._inflightMessage.progress = structuredClone(this._state.progress), this._upsertMessage(this._inflightMessage)), this._inflightMessage = null, this._receivedProgress = !1, this._patchState({
3475
+ progress: null,
3476
+ progressCollapsed: !1,
3477
+ inflightMessage: null
3478
+ }));
3479
+ }
3480
+ _removeInflightFromMessages() {
3481
+ this._inflightMessage && this._patchState({ messages: this._state.messages.filter((e) => e.id !== this._inflightMessage.id) });
3482
+ }
3483
+ _markInflightCancelled(e) {
3484
+ this._inflightMessage && (this._inflightMessage.message = e ?? o("Response cancelled.", { desc: "Placeholder shown in ai chat where the assistant reply would appear when the user stops an in-flight response" }), this._inflightMessage.isCancelled = !0, this._inflightMessage.hasChart = !1, delete this._inflightMessage.progress, delete this._inflightMessage.elicitation, this._upsertMessage(this._inflightMessage), this._inflightMessage = null, this._receivedProgress = !1, this._patchState({ inflightMessage: null }));
3485
+ }
3486
+ _discardInflightMessage() {
3487
+ let e = !!(this._inflightMessage || this._state.inflightMessage);
3488
+ this._removeInflightFromMessages(), this._inflightMessage = null, this._receivedProgress = !1, e && this._patchState({ inflightMessage: null });
3489
+ }
3490
+ _handleSubmitError(e, t, n) {
3491
+ t.message = o("Something went wrong. Please try again.", { desc: "Generic error message shown in ai chat when the API request fails" }), t.isError = !0, delete t.progress, delete t.elicitation, this._inflightMessage = t, this._upsertMessage(t), this._patchState({
3492
+ inflightMessage: { ...t },
3493
+ progress: null,
3494
+ progressCollapsed: !1
3495
+ }), this._emit("onComplete", {
3496
+ agent: n,
3497
+ conversationId: this._state.conversationId,
3498
+ message: t,
3499
+ error: e
3500
+ });
3501
+ }
3502
+ _hasCallback(e) {
3503
+ return typeof this._hostCallbacks[e] == "function" || typeof this._uiBridgeCallbacks[e] == "function";
3504
+ }
3505
+ _emit(e, ...t) {
3506
+ this._invokeCallback(e, ...t);
3507
+ }
3508
+ async _invokeCallback(e, ...t) {
3509
+ let n = this._hostCallbacks[e], r = this._uiBridgeCallbacks[e];
3510
+ typeof n == "function" && await n(...t), typeof r == "function" && await r(...t);
3511
+ }
3512
+ _patchState(e) {
3513
+ this._state = {
3514
+ ...this._state,
3515
+ ...e
3516
+ }, this._emit("onStateChange", this._state), this._notifySubscribers();
3517
+ }
3518
+ _notifySubscribers() {
3519
+ for (let e of this._subscribers) e(this._state);
3520
+ }
3521
+ _areSelectedDatasetsEqual(e, t) {
3522
+ return e.length === t.length && e.every((e, n) => e.id === t[n]?.id);
3523
+ }
3524
+ _areChatMessagesEqual(e, t) {
3525
+ return e.length === t.length && e.every((e, n) => {
3526
+ let r = t[n];
3527
+ return e.id === r?.id && e.apiMessageId === r?.apiMessageId && e.type === r?.type && e.message === r?.message && e.isError === r?.isError && e.isCancelled === r?.isCancelled && e.hasChart === r?.hasChart && JSON.stringify(e.progress ?? null) === JSON.stringify(r?.progress ?? null) && JSON.stringify(e.actions ?? null) === JSON.stringify(r?.actions ?? null) && JSON.stringify(e.attachmentUrls ?? null) === JSON.stringify(r?.attachmentUrls ?? null) && JSON.stringify(e.elicitation ?? null) === JSON.stringify(r?.elicitation ?? null);
3528
+ });
3529
+ }
3530
+ };
3531
+ function ai(e, t) {
3532
+ return new ii(e, t);
3533
+ }
3534
+ //#endregion
3535
+ //#region src/components/ai-chat/session/ai-chat-session-controller.ts
3536
+ var oi = class {
3537
+ constructor(e) {
3538
+ this.options = e, this._session = null, this._ownsSession = !1, this._customItemFromProps = !1, this._seededFromProps = !1, this._unsubscribe = null;
3539
+ }
3540
+ get current() {
3541
+ return this._session;
3542
+ }
3543
+ get state() {
3544
+ if (this._session) return this._session.state;
3545
+ let e = this.options.getSeed();
3546
+ return {
3547
+ messages: e.messages,
3548
+ selectedDatasets: e.selectedDatasets,
3549
+ isGenerating: !1,
3550
+ progress: null,
3551
+ progressCollapsed: !1,
3552
+ conversationId: e.conversationId,
3553
+ inflightMessage: null
3554
+ };
3555
+ }
3556
+ get ownsCurrentSession() {
3557
+ return this._ownsSession;
3558
+ }
3559
+ setSession(e) {
3560
+ if (!e) {
3561
+ this._clearSession();
3562
+ return;
3563
+ }
3564
+ this._ownsSession && this._session !== e && this._session?.abort(), this._ownsSession = !1, this._session = e, this._mergeHostElementConfig(e), this._wire(e);
3565
+ }
3566
+ syncProperties(e) {
3567
+ if (!e.has("chatSession")) {
3568
+ if (this._createSessionIfMissing(), this._session) {
3569
+ let t = this.options.getConfig();
3570
+ if (Object.keys(t).some((t) => e.has(t)) && (this._ownsSession ? this._session.updateConfig(t) : this._mergeHostElementConfig(this._session)), e.has("selectedDatasets") && this._ownsSession) {
3571
+ let e = this.options.getSeed().selectedDatasets, t = this._session.state.selectedDatasets;
3572
+ (e.length !== t.length || e.some((e, n) => e.id !== t[n]?.id)) && this._session.updateConfig({ selectedDatasets: e });
3573
+ }
3574
+ }
3575
+ (e.has("messages") || e.has("selectedDatasets")) && this._seedFromPropsOnce();
3576
+ }
3577
+ }
3578
+ requireSession() {
3579
+ return this._createSessionIfMissing(), this._ownsSession ? this._session.updateConfig(this.options.getConfig()) : this._session && this._mergeHostElementConfig(this._session), this._session;
3580
+ }
3581
+ _mergeHostElementConfig(e) {
3582
+ let t = this.options.getConfig(), n = {
3583
+ authKey: t.authKey,
3584
+ authToken: t.authToken,
3585
+ apiUrl: t.apiUrl,
3586
+ apiVersion: t.apiVersion,
3587
+ stream: t.stream,
3588
+ localeId: t.localeId,
3589
+ timezoneId: t.timezoneId,
3590
+ modelPreference: t.modelPreference,
3591
+ requireDataset: t.requireDataset,
3592
+ agent: t.agent
3593
+ };
3594
+ t.agentConfig !== void 0 && (n.agentConfig = t.agentConfig), t.task !== void 0 && (n.task = t.task), t.chart != null && (n.chart = t.chart), t.dashboard != null && (n.dashboard = t.dashboard), t.customItem != null && (this._customItemFromProps = !0), this._customItemFromProps && (n.customItem = t.customItem ?? null), t.currentScreenMode != null && (n.currentScreenMode = t.currentScreenMode), t.conversationId != null && (n.conversationId = t.conversationId), e.updateConfig(n);
3595
+ }
3596
+ connect() {
3597
+ this._session && this._wire(this._session);
3598
+ }
3599
+ teardown() {
3600
+ this._unwire(), this._ownsSession &&= (this._session?.abort(), this._session = null, !1), this._seededFromProps = !1;
3601
+ }
3602
+ _createSessionIfMissing() {
3603
+ if (this._session) return;
3604
+ let e = this.options.getSeed();
3605
+ this._session = ai({
3606
+ ...this.options.getConfig(),
3607
+ messages: e.messages.length > 0 ? [...e.messages] : void 0,
3608
+ selectedDatasets: e.selectedDatasets.length > 0 ? [...e.selectedDatasets] : void 0
3609
+ }), this._ownsSession = !0, this._seededFromProps = e.messages.length > 0 || e.selectedDatasets.length > 0, this._wire(this._session);
3610
+ }
3611
+ _clearSession() {
3612
+ this._unwire(), this._ownsSession && this._session?.abort(), this._session = null, this._ownsSession = !1;
3613
+ }
3614
+ _seedFromPropsOnce() {
3615
+ if (!this._ownsSession || this._seededFromProps) return;
3616
+ let e = this.requireSession(), t = this.options.getSeed(), n = {};
3617
+ e.state.messages.length === 0 && t.messages.length > 0 && (n.messages = [...t.messages]), e.state.selectedDatasets.length === 0 && t.selectedDatasets.length > 0 && (n.selectedDatasets = [...t.selectedDatasets]), Object.keys(n).length > 0 && (e.updateConfig(n), this._seededFromProps = !0);
3618
+ }
3619
+ _wire(e) {
3620
+ this._unwire(), e.setUiBridge(this.options.createDomBridge()), this._unsubscribe = e.subscribe(() => {
3621
+ this.options.onRenderNeeded();
3622
+ });
3623
+ }
3624
+ _unwire() {
3625
+ this._unsubscribe?.(), this._unsubscribe = null;
3626
+ }
3627
+ }, $ = class t extends i {
3628
+ constructor(...e) {
3629
+ super(...e), this.messages = [], this.selectedDatasets = [], this.placeholder = "Describe your change", this.disabled = !1, this.stoppable = !1, this.showAssistantContextMenu = !1, this.authKey = "", this.authToken = "", this.apiUrl = "https://api.luzmo.com", this.appServer = "https://app.luzmo.com", this.includePublicDatasets = !1, this.hideDatasetButton = !1, this.hideDatasetIcons = !1, this.disableDatasetModification = !1, this.hideSelectedDatasets = !1, this.hideAgents = !1, this.disableColumnMentions = !1, this.requireDataset = !1, this.allowImages = !1, this.allowVoiceInput = !1, this.acceptedFileTypes = [], this.agent = "item", this.task = "generate", this.modelPreference = "performance", this.chatSession = null, this.conversationId = null, this.chart = null, this.dashboard = null, this.customItem = null, this.timezoneId = "UTC", this.apiVersion = "0.1.0", this.stream = !0, this.loadingMessage = null, this.cancelledMessage = null, this.initialPrompt = null, this.emptyStateTitle = "", this.emptyStateSubtitle = "", this.emptyStateSuggestions = [], this._textareaValue = "", this._assistantMessageActionsSlotHasContent = !1, this._pendingAssistantMessageAction = null, this._shouldFocusAssistantMessageActionConfirm = !1, this._lastProcessedInitialPrompt = null, this._session = new oi({
3630
+ getConfig: () => this._buildSessionConfig(),
3631
+ getSeed: () => ({
3632
+ messages: this.messages,
3633
+ selectedDatasets: Array.isArray(this.selectedDatasets) ? this.selectedDatasets : [],
3634
+ conversationId: this.conversationId
3635
+ }),
3636
+ createDomBridge: () => this._createDomBridgeCallbacks(),
3637
+ onRenderNeeded: () => {
3638
+ this.requestUpdate(), this.updateComplete.then(() => this._scrollToBottom());
3639
+ }
3640
+ }), this._handleAssistantMessageActionsSlotChange = (e) => {
3641
+ let t = e.target.assignedElements({ flatten: !0 }).length > 0;
3642
+ this._setAssistantMessageActionsSlotHasContent(t);
3643
+ }, this._handleAssistantMessageActionConfirmKeydown = (e) => {
3644
+ e.key !== "Escape" || !this._pendingAssistantMessageAction || (e.preventDefault(), e.stopPropagation(), this._cancelAssistantMessageActionConfirm());
3645
+ };
3646
+ }
3647
+ static {
3648
+ this.styles = f(On);
3649
+ }
3650
+ static {
3651
+ this.tagName = "luzmo-ai-chat";
3652
+ }
3653
+ static {
3654
+ this.assistantMessageActionsSlot = "assistant-message-actions";
3655
+ }
3656
+ get flagOpendata() {
3657
+ return this.includePublicDatasets;
3658
+ }
3659
+ set flagOpendata(e) {
3660
+ this.includePublicDatasets = e;
3661
+ }
3662
+ get session() {
3663
+ return this._session.current;
3664
+ }
3665
+ _getRenderState() {
3666
+ return this._session.state;
3667
+ }
3668
+ _createDomBridgeCallbacks() {
3669
+ return {
3670
+ onMessageSent: (e, t) => {
3671
+ this.dispatchEvent(new CustomEvent("luzmo-message-sent", {
3672
+ detail: {
3673
+ message: e,
3674
+ selectedDatasets: t
3675
+ },
3676
+ bubbles: !0,
3677
+ composed: !0
3678
+ }));
3679
+ },
3680
+ onDatasetsChanged: (e) => {
3681
+ this.dispatchEvent(new CustomEvent("luzmo-datasets-changed", {
3682
+ detail: { selectedDatasets: e },
3683
+ bubbles: !0,
3684
+ composed: !0
3685
+ }));
3686
+ },
3687
+ onConversationIdChange: (e) => this._emitConversationIdChanged(e),
3688
+ onStep: (e) => {
3689
+ this.dispatchEvent(new CustomEvent("luzmo-step", {
3690
+ detail: e,
3691
+ bubbles: !0,
3692
+ composed: !0
3693
+ }));
3694
+ },
3695
+ onComplete: (e) => {
3696
+ this.dispatchEvent(new CustomEvent("luzmo-complete", {
3697
+ detail: e,
3698
+ bubbles: !0,
3699
+ composed: !0
3700
+ }));
3701
+ },
3702
+ onPromptStopped: () => {
3703
+ this.dispatchEvent(new CustomEvent("luzmo-stop", {
3704
+ bubbles: !0,
3705
+ composed: !0
3706
+ }));
3707
+ },
3708
+ ...typeof this.uploadAttachments == "function" ? { uploadAttachments: (e, t) => this.uploadAttachments(e, t) } : {}
3709
+ };
3710
+ }
3711
+ get _pickedAgentId() {
3712
+ if (!this.hideAgents) return this.shadowRoot?.querySelector("luzmo-ai-interaction-textarea")?.selectedAgent?.id;
3713
+ }
3714
+ get _resolvedAcceptedFileTypes() {
3715
+ return this.acceptedFileTypes.length > 0 ? this.acceptedFileTypes : this.allowImages ? [...e] : [];
3716
+ }
3717
+ _buildSessionConfig() {
3718
+ return {
3719
+ agent: this.agent,
3720
+ agentConfig: this.agentConfig,
3721
+ agentId: this.agentId,
3722
+ authKey: this.authKey,
3723
+ authToken: this.authToken,
3724
+ apiUrl: this.apiUrl,
3725
+ apiVersion: this.apiVersion,
3726
+ stream: this.stream,
3727
+ conversationId: this.conversationId,
3728
+ chart: this.chart,
3729
+ dashboard: this.dashboard,
3730
+ customItem: this.customItem,
3731
+ currentScreenMode: this.currentScreenMode,
3732
+ localeId: this.localeId,
3733
+ timezoneId: this.timezoneId,
3734
+ task: this.task,
3735
+ modelPreference: this.modelPreference,
3736
+ requireDataset: this.requireDataset
3737
+ };
3738
+ }
3739
+ _getAgentConfig() {
3740
+ let e = this._session.current?.agentConfig;
3741
+ return this.agentConfig === void 0 && this.chatSession && e ? e : kn(this._buildSessionConfig(), e);
3742
+ }
3743
+ _emitConversationIdChanged(e) {
3744
+ this.conversationId = e, this.dispatchEvent(new CustomEvent("luzmo-conversation-id-changed", {
3745
+ detail: { conversationId: e },
3746
+ bubbles: !0,
3747
+ composed: !0
3748
+ }));
3749
+ }
3750
+ async _restoreViaSession(e, t) {
3751
+ await this._session.requireSession().restore({
3752
+ restoreToMessageId: e,
3753
+ messageIndex: t
3754
+ });
3755
+ }
3756
+ async _handleRestoreState(e, t) {
3757
+ if (e.apiMessageId && this._getAgentConfig().type === "item") try {
3758
+ await this._restoreViaSession(e.apiMessageId, t);
3759
+ } catch (e) {
3760
+ console.error("AI restore error:", e);
3761
+ }
3762
+ }
3763
+ _handleDatasetSelected(e) {
3764
+ this._session.requireSession().addDataset(e.detail);
3765
+ }
3766
+ _handleDatasetRemoved(e) {
3767
+ this._session.requireSession().removeDataset(e.detail.id);
3768
+ }
3769
+ _handleAgentSelected() {
3770
+ this._processInitialPrompt();
3771
+ }
3772
+ async _submitViaSession(e, t = {}) {
3773
+ let n = this._session.requireSession();
3774
+ if (!n.isDatasetRequirementMet(t.agentId)) return !1;
3775
+ this._textareaValue = "";
3776
+ try {
3777
+ return await n.submit({
3778
+ prompt: e,
3779
+ ...t
3780
+ }), !0;
3781
+ } catch (e) {
3782
+ return e.name !== "AbortError" && console.error("AI prompt session error:", e), !1;
3783
+ }
3784
+ }
3785
+ async _handlePromptSubmitted(e) {
3786
+ let t = e.detail.prompt;
3787
+ await this._submitViaSession(t, {
3788
+ ...e.detail.attachments?.length ? { attachments: e.detail.attachments } : {},
3789
+ ...e.detail.attachmentUrls?.length ? { attachmentUrls: e.detail.attachmentUrls } : {},
3790
+ ...e.detail.selectedAgent ? { agentId: e.detail.selectedAgent.id } : {}
3791
+ }) || (this._textareaValue = t);
3792
+ }
3793
+ _handlePromptStopped() {
3794
+ let e = this._session.current;
3795
+ if (this._textareaValue = "", e) {
3796
+ e.abort({
3797
+ notify: !0,
3798
+ cancelledMessage: this.cancelledMessage ?? void 0
3799
+ });
3800
+ return;
3801
+ }
3802
+ this.dispatchEvent(new CustomEvent("luzmo-stop", {
3803
+ bubbles: !0,
3804
+ composed: !0
3805
+ }));
3806
+ }
3807
+ async _handleEmptyStateSuggestionSelected(e) {
3808
+ let { prompt: t, selectedDatasets: n } = e.detail, r = this._session.requireSession();
3809
+ n?.length && r.setSelectedDatasets(n), await this._submitViaSession(t, { agentId: this._pickedAgentId });
3810
+ }
3811
+ async _processInitialPrompt() {
3812
+ if (!this.initialPrompt || this.initialPrompt === this._lastProcessedInitialPrompt) return;
3813
+ let e = this._pickedAgentId;
3814
+ this._session.requireSession().isDatasetRequirementMet(e) && (this._lastProcessedInitialPrompt = this.initialPrompt, await this._submitViaSession(this.initialPrompt, {
3815
+ skipUserMessage: !0,
3816
+ agentId: e
3817
+ }));
3818
+ }
3819
+ connectedCallback() {
3820
+ super.connectedCallback(), this._session.connect();
3821
+ }
3822
+ disconnectedCallback() {
3823
+ super.disconnectedCallback(), this._session.teardown();
3824
+ }
3825
+ _scrollToBottom() {
3826
+ let e = this.shadowRoot?.querySelector(".chat-messages-container");
3827
+ e && requestAnimationFrame(() => {
3828
+ requestAnimationFrame(() => {
3829
+ e.scrollTop = e.scrollHeight;
3830
+ });
3831
+ });
3832
+ }
3833
+ willUpdate(e) {
3834
+ super.willUpdate?.(e), this._syncPendingAssistantMessageAction();
3835
+ }
3836
+ updated(e) {
3837
+ super.updated?.(e), this._syncSession(e), this._handleInitialPromptChange(), e.has("uploadAttachments") && this._session.current?.setUiBridge(this._createDomBridgeCallbacks()), this.updateComplete.then(() => {
3838
+ this._syncAssistantMessageActionsVisibility(), this._focusPendingAssistantMessageActionConfirm();
3839
+ });
3840
+ }
3841
+ _syncSession(e) {
3842
+ if (e.has("chatSession")) {
3843
+ this._session.setSession(this.chatSession);
3844
+ return;
3845
+ }
3846
+ this._session.syncProperties(e);
3847
+ }
3848
+ _handleInitialPromptChange() {
3849
+ this.initialPrompt && this.initialPrompt !== this._lastProcessedInitialPrompt ? this._processInitialPrompt() : this.initialPrompt || (this._lastProcessedInitialPrompt = null);
3850
+ }
3851
+ _renderMarkdown(e) {
3852
+ let t = String(Z.parse(e, { async: !1 }));
3853
+ return _t.sanitize(t, {
3854
+ ALLOWED_TAGS: /* @__PURE__ */ "p.br.strong.em.b.i.u.s.code.pre.blockquote.hr.ul.ol.li.h1.h2.h3.h4.h5.h6.table.thead.tbody.tr.th.td.a".split("."),
3855
+ ALLOWED_ATTR: [
3856
+ "href",
3857
+ "title",
3858
+ "target",
3859
+ "rel"
3860
+ ],
3861
+ ALLOW_DATA_ATTR: !1,
3862
+ FORBID_TAGS: [
3863
+ "script",
3864
+ "style",
3865
+ "iframe",
3866
+ "object",
3867
+ "embed",
3868
+ "link",
3869
+ "form",
3870
+ "input",
3871
+ "button"
3872
+ ],
3873
+ FORBID_ATTR: [
3874
+ "onerror",
3875
+ "onload",
3876
+ "onclick",
3877
+ "onmouseover",
3878
+ "onfocus",
3879
+ "onblur"
3880
+ ]
3881
+ });
3882
+ }
3883
+ _renderProgress() {
3884
+ let { progress: e, progressCollapsed: t } = this._getRenderState();
3885
+ return e?.children?.length ? u`
3886
+ <luzmo-progress-steps
3887
+ .progress=${e}
3888
+ ?collapsed=${t}
3889
+ size="s"
3890
+ ></luzmo-progress-steps>
3891
+ ` : d;
3892
+ }
3893
+ _isLastAiMessageWithProgress(e, t) {
3894
+ for (let n = t.length - 1; n >= 0; n--) if (t[n].type === "ai" && t[n].progress?.children?.length) return t[n].id === e.id;
3895
+ return !1;
3896
+ }
3897
+ _syncAssistantMessageActionsVisibility() {
3898
+ let e = ((this.shadowRoot?.querySelector(`slot[name="${t.assistantMessageActionsSlot}"]`) ?? null)?.assignedElements({ flatten: !0 }).length ?? 0) > 0;
3899
+ this._setAssistantMessageActionsSlotHasContent(e);
3900
+ }
3901
+ _setAssistantMessageActionsSlotHasContent(e) {
3902
+ e !== this._assistantMessageActionsSlotHasContent && (this._assistantMessageActionsSlotHasContent = e);
3903
+ }
3904
+ _isLatestAssistantMessage(e, t) {
3905
+ return !!(t && e === t);
3906
+ }
3907
+ _hasBuiltInAssistantMessageActions(e) {
3908
+ return (e.actions?.length ?? 0) > 0;
3909
+ }
3910
+ _assistantMessageActionsFooterHasContent(e, t) {
3911
+ return this._hasBuiltInAssistantMessageActions(e) || t && this._assistantMessageActionsSlotHasContent;
3912
+ }
3913
+ _syncPendingAssistantMessageAction() {
3914
+ let e = this._pendingAssistantMessageAction;
3915
+ if (!e) return;
3916
+ let { messages: t } = this._getRenderState(), n = t.find((t) => t.id === e.messageId), r = n?.actions?.find((t) => t.id === e.actionId);
3917
+ (!n || !r?.confirm) && (this._pendingAssistantMessageAction = null, this._shouldFocusAssistantMessageActionConfirm = !1);
3918
+ }
3919
+ _getDefaultAssistantMessageActionConfirmMessage() {
3920
+ return o("Are you sure?", { desc: "Default assistant message action confirmation prompt" });
3921
+ }
3922
+ _isAssistantMessageActionConfirming(e) {
3923
+ let t = this._pendingAssistantMessageAction, n = e.id;
3924
+ return !!(t && n && t.messageId === n);
3925
+ }
3926
+ _getPendingAssistantMessageAction(e) {
3927
+ let t = this._pendingAssistantMessageAction, n = e.id;
3928
+ if (!(!t || !n || t.messageId !== n)) return e.actions?.find((e) => e.id === t.actionId);
3929
+ }
3930
+ _handleAssistantMessageAction(e, t) {
3931
+ let n = e.id;
3932
+ n && this.dispatchEvent(new CustomEvent("luzmo-assistant-message-action", {
3933
+ detail: {
3934
+ messageId: n,
3935
+ actionId: t.id,
3936
+ message: e
3937
+ },
3938
+ bubbles: !0,
3939
+ composed: !0
3940
+ }));
3941
+ }
3942
+ _handleAssistantMessageActionClick(e, t) {
3943
+ let n = e.id;
3944
+ if (n) {
3945
+ if (t.confirm) {
3946
+ this._pendingAssistantMessageAction = {
3947
+ messageId: n,
3948
+ actionId: t.id
3949
+ }, this._shouldFocusAssistantMessageActionConfirm = !0;
3950
+ return;
3951
+ }
3952
+ this._handleAssistantMessageAction(e, t);
3953
+ }
3954
+ }
3955
+ _cancelAssistantMessageActionConfirm() {
3956
+ this._pendingAssistantMessageAction = null, this._shouldFocusAssistantMessageActionConfirm = !1;
3957
+ }
3958
+ _confirmAssistantMessageAction(e, t) {
3959
+ this._pendingAssistantMessageAction = null, this._shouldFocusAssistantMessageActionConfirm = !1, this._handleAssistantMessageAction(e, t);
3960
+ }
3961
+ _focusPendingAssistantMessageActionConfirm() {
3962
+ !this._shouldFocusAssistantMessageActionConfirm || !this._pendingAssistantMessageAction || (this._shouldFocusAssistantMessageActionConfirm = !1, (this.shadowRoot?.querySelector("luzmo-button.assistant-message-action-confirm-cancel"))?.focus?.());
3963
+ }
3964
+ _renderBuiltInAssistantMessageAction(e, t) {
3965
+ return u`
3966
+ <luzmo-button
3967
+ class="assistant-message-action"
3968
+ size="xs"
3969
+ variant="neutral"
3970
+ treatment="outline"
3971
+ ?disabled=${this.disabled || t.disabled || !e.id}
3972
+ @click=${() => this._handleAssistantMessageActionClick(e, t)}
3973
+ >
3974
+ ${t.icon ? u`<luzmo-icon slot="icon" .icon=${t.icon} size="xs"></luzmo-icon>` : d}
3975
+ ${t.label}
3976
+ </luzmo-button>
3977
+ `;
3978
+ }
3979
+ _renderAssistantMessageActionConfirm(e) {
3980
+ let t = this._getPendingAssistantMessageAction(e);
3981
+ if (!t) return d;
3982
+ let n = t.confirmMessage ?? this._getDefaultAssistantMessageActionConfirmMessage(), r = this.disabled || t.disabled || !e.id;
3983
+ return u`
3984
+ <span class="assistant-message-action-confirm-message" role="status" aria-live="polite">${n}</span>
3985
+ <div class="assistant-message-action-confirm-controls">
3986
+ <luzmo-button
3987
+ class="assistant-message-action-confirm-cancel"
3988
+ size="xs"
3989
+ variant="neutral"
3990
+ treatment="outline"
3991
+ ?disabled=${this.disabled}
3992
+ @click=${this._cancelAssistantMessageActionConfirm}
3993
+ >
3994
+ ${o("Cancel", { desc: "Cancel assistant message action confirmation" })}
3995
+ </luzmo-button>
3996
+ <luzmo-button
3997
+ class="assistant-message-action-confirm-confirm"
3998
+ size="xs"
3999
+ variant=${t.confirmVariant ?? "negative"}
4000
+ ?disabled=${r}
4001
+ @click=${() => this._confirmAssistantMessageAction(e, t)}
4002
+ >
4003
+ ${t.label}
4004
+ </luzmo-button>
4005
+ </div>
4006
+ `;
4007
+ }
4008
+ _renderAssistantMessageActions(e, n) {
4009
+ let r = e.actions ?? [], i = r.length > 0, a = this._isLatestAssistantMessage(e, n), o = this._isAssistantMessageActionConfirming(e);
4010
+ return !i && !a ? d : u`
4011
+ <div
4012
+ class="assistant-message-actions ${this._assistantMessageActionsFooterHasContent(e, a) ? "assistant-message-actions--has-content" : ""} ${o ? "assistant-message-actions--confirming" : ""}"
4013
+ @keydown=${o ? this._handleAssistantMessageActionConfirmKeydown : d}
4014
+ >
4015
+ ${o ? this._renderAssistantMessageActionConfirm(e) : u`
4016
+ ${r.map((t) => this._renderBuiltInAssistantMessageAction(e, t))}
4017
+ ${a ? u`
4018
+ <slot
4019
+ name=${t.assistantMessageActionsSlot}
4020
+ @slotchange=${this._handleAssistantMessageActionsSlotChange}
4021
+ ></slot>
4022
+ ` : d}
4023
+ `}
4024
+ </div>
4025
+ `;
4026
+ }
4027
+ _renderRestoreMenu(e, t, n, r = !1) {
4028
+ if (!(this._getAgentConfig().type === "item" && this.showAssistantContextMenu && e.hasChart && e.apiMessageId && !e.isError && e.id !== n)) return d;
4029
+ let i = `context-menu-trigger-${e.apiMessageId}`;
4030
+ return u`
4031
+ <div class="assistant-context-menu">
4032
+ <button
4033
+ id=${i}
4034
+ class="assistant-context-menu-trigger"
4035
+ type="button"
4036
+ aria-label=${o("Open restore menu", { desc: "Accessible label for the ai chat restore menu trigger" })}
4037
+ aria-haspopup="menu"
4038
+ ?disabled=${r}
4039
+ >
4040
+ ${c(s)}
4041
+ </button>
4042
+ <luzmo-overlay
4043
+ trigger="${i}@click"
4044
+ placement="bottom-end"
4045
+ >
4046
+ <luzmo-popover>
4047
+ <button
4048
+ class="assistant-context-menu-item"
4049
+ type="button"
4050
+ ?disabled=${r}
4051
+ @click=${() => this._handleRestoreState(e, t)}
4052
+ >
4053
+ ${o("Restore state", { desc: "Context menu action that restores the chart to this message state" })}
4054
+ </button>
4055
+ </luzmo-popover>
4056
+ </luzmo-overlay>
4057
+ </div>
4058
+ `;
4059
+ }
4060
+ _renderMessages() {
4061
+ let { messages: e, inflightMessage: t, isGenerating: n } = this._getRenderState(), r = t !== null, i = e.filter((e) => !t || e.id !== t.id), a = [...i].reverse().find((e) => e.type === "ai"), s = a?.id;
4062
+ return i.map((t) => {
4063
+ let c = !!t.progress?.children?.length, l = c && this._isLastAiMessageWithProgress(t, i), f = c && (r || n || !l), p = c ? u`
4064
+ <luzmo-progress-steps
4065
+ .progress=${t.progress}
4066
+ ?condensed=${f}
4067
+ collapsed
4068
+ no-animate
4069
+ size="s"
4070
+ ></luzmo-progress-steps>
4071
+ ` : d;
4072
+ if (t.type === "user") {
4073
+ let e = t.attachmentUrls ?? [];
4074
+ return u`
4075
+ <luzmo-chat-message
4076
+ avatar-placement="bottom"
4077
+ position="right"
4078
+ variant="primary"
4079
+ size="s"
4080
+ >
4081
+ <div class="user-message-content">
4082
+ ${e.length > 0 ? u`
4083
+ <div class="user-message-attachments">
4084
+ ${e.map((e) => u`
4085
+ <img
4086
+ class="user-message-attachment"
4087
+ src=${e}
4088
+ alt=${o("Attached image", { desc: "Accessible label for an image attached to a user chat message" })}
4089
+ width="64"
4090
+ height="64"
4091
+ />
4092
+ `)}
4093
+ </div>
4094
+ ` : d}
4095
+ <div class="user-message-text">${t.message}</div>
4096
+ </div>
4097
+ </luzmo-chat-message>
4098
+ `;
4099
+ }
4100
+ let m = e.indexOf(t), h = t.isError ? "error" : t.isCancelled ? "cancelled" : "", te = !!t.elicitation && (!t.message.trim() || t.message.trim() === t.elicitation?.question), ne = t.isCancelled ? t.message : te ? d : u`<div class="markdown-content">${ee(this._renderMarkdown(t.message))}</div>`;
4101
+ return u`
4102
+ ${p}
4103
+ <div class="assistant-message-wrapper">
4104
+ <div class="assistant-message-body">
4105
+ <luzmo-chat-message
4106
+ class=${h}
4107
+ role=${t.isError ? "alert" : d}
4108
+ avatar-placement="bottom"
4109
+ position="left"
4110
+ quiet
4111
+ size="s"
4112
+ >
4113
+ ${ne}
4114
+ ${Ln({
4115
+ message: t,
4116
+ state: t.elicitation?.answer ? "answered" : t.id && t === i.at(-1) && !n && !this.disabled ? "open" : "closed",
4117
+ onSubmit: (e) => this._handleElicitationSubmit(t, e)
4118
+ })}
4119
+ </luzmo-chat-message>
4120
+
4121
+ ${this._renderRestoreMenu(t, m, s, r)}
4122
+ </div>
4123
+
4124
+ ${this._renderAssistantMessageActions(t, a)}
4125
+ </div>
4126
+ `;
4127
+ });
4128
+ }
4129
+ async _handleElicitationSubmit(e, t) {
4130
+ t.stopPropagation();
4131
+ let n = t.currentTarget, r = n.parentElement, i = Fn(t.detail), a = !1;
4132
+ if (e.id && i) try {
4133
+ let t = this._session.requireSession().answerElicitation(e.id, i, { agentId: this._pickedAgentId });
4134
+ await this.updateComplete;
4135
+ let n = r?.querySelector("luzmo-question-box[readonly]");
4136
+ await n?.updateComplete, n?.focus(), a = await t;
4137
+ } catch (e) {
4138
+ e.name !== "AbortError" && console.error("AI prompt session error:", e);
4139
+ }
4140
+ a || (n.reset(), await n.updateComplete, n.focus());
4141
+ }
4142
+ _renderStreamingResponse() {
4143
+ let { inflightMessage: e } = this._getRenderState();
4144
+ return e?.message ? u`
4145
+ <luzmo-chat-message
4146
+ avatar-placement="bottom"
4147
+ position="left"
4148
+ quiet
4149
+ size="s"
4150
+ >
4151
+ <div class="markdown-content">${ee(this._renderMarkdown(e.message))}</div>
4152
+ </luzmo-chat-message>
4153
+ ` : d;
4154
+ }
4155
+ _renderLoadingMessage() {
4156
+ let { isGenerating: e, progress: t, inflightMessage: n } = this._getRenderState();
4157
+ if (!e || t?.children?.length || n?.message) return d;
4158
+ let r = this._getAgentConfig(), i = An(r), a = r.type === "dashboard" ? !i.dashboard : i.chart?.type === "placeholder", s = r.type === "dashboard" ? a ? o("Creating dashboard...", { desc: "Label for ai chat creating dashboard message" }) : o("Updating dashboard...", { desc: "Label for ai chat updating dashboard message" }) : a ? o("Creating item...", { desc: "Label for ai chat creating item message" }) : o("Updating item...", { desc: "Label for ai chat updating item message" });
4159
+ return u`
4160
+ <luzmo-chat-message
4161
+ avatar-placement="bottom"
4162
+ position="left"
4163
+ quiet
4164
+ size="s"
4165
+ >
4166
+ <div class="loading-message" role="status" aria-live="polite">
4167
+ <span class="icon-lg">${c(l, { className: "spin" })}</span>
4168
+ <span class="loading-message-text">${this.loadingMessage || s}</span>
4169
+ </div>
4170
+ </luzmo-chat-message>
4171
+ `;
4172
+ }
4173
+ _renderEmptyState() {
4174
+ if (this._getRenderState().messages.length > 0) return d;
4175
+ let e = o("What can I help you with?", { desc: "Title for the AI chat empty state" }), t = this.emptyStateSuggestions.length > 0;
4176
+ return u`
4177
+ <luzmo-ai-chat-empty-state
4178
+ .title=${this.emptyStateTitle || e}
4179
+ .subtitle=${t ? this.emptyStateSubtitle : ""}
4180
+ .suggestions=${this.emptyStateSuggestions}
4181
+ ?disabled=${this.disabled || this._getRenderState().isGenerating}
4182
+ @luzmo-suggestion-selected=${this._handleEmptyStateSuggestionSelected}
4183
+ ></luzmo-ai-chat-empty-state>
4184
+ `;
4185
+ }
4186
+ render() {
4187
+ let { selectedDatasets: e, isGenerating: t } = this._getRenderState();
4188
+ return u`
4189
+ <div class="chat-container" role="region" aria-label=${o("AI Chat", { desc: "Accessible label for AI chat region" })}>
4190
+ <div class="chat-messages-container" role="log" aria-live="polite">
4191
+ ${this._renderEmptyState()}
4192
+ ${this._renderMessages()}
4193
+ ${this._renderProgress()}
4194
+ ${this._renderStreamingResponse()}
4195
+ ${this._renderLoadingMessage()}
4196
+ </div>
4197
+
4198
+ <luzmo-ai-interaction-textarea
4199
+ role="group"
4200
+ aria-label=${o("AI prompt input", { desc: "Accessible label for the ai chat prompt input area" })}
4201
+ .value=${this._textareaValue}
4202
+ .selectedDatasets=${e}
4203
+ .placeholder=${this.placeholder}
4204
+ ?disabled=${this.disabled}
4205
+ ?is-generating=${t}
4206
+ ?stoppable=${this.stoppable}
4207
+ ?hide-dataset-button=${this.hideDatasetButton}
4208
+ ?hide-dataset-icons=${this.hideDatasetIcons}
4209
+ ?disable-dataset-modification=${this.disableDatasetModification}
4210
+ ?hide-selected-datasets=${this.hideSelectedDatasets}
4211
+ ?hide-agents=${this.hideAgents}
4212
+ ?disable-column-mentions=${this.disableColumnMentions}
4213
+ ?require-dataset=${this.requireDataset}
4214
+ ?allow-images=${this.allowImages}
4215
+ ?allow-voice-input=${this.allowVoiceInput}
4216
+ .acceptedFileTypes=${this._resolvedAcceptedFileTypes}
4217
+ .uploadAttachments=${this.uploadAttachments}
4218
+ auth-key=${this.authKey}
4219
+ auth-token=${this.authToken}
4220
+ api-url=${this.apiUrl}
4221
+ api-version=${this.apiVersion}
4222
+ app-server=${this.appServer}
4223
+ ?include-public-datasets=${this.includePublicDatasets}
4224
+ @prompt-submitted=${this._handlePromptSubmitted}
4225
+ @prompt-stopped=${this._handlePromptStopped}
4226
+ @dataset-selected=${this._handleDatasetSelected}
4227
+ @dataset-removed=${this._handleDatasetRemoved}
4228
+ @luzmo-agent-selected=${this._handleAgentSelected}
4229
+ ></luzmo-ai-interaction-textarea>
4230
+ </div>
4231
+ `;
4232
+ }
4233
+ };
4234
+ a([p({ type: Array })], $.prototype, "messages", void 0), a([p({
4235
+ type: Array,
4236
+ attribute: "selected-datasets"
4237
+ })], $.prototype, "selectedDatasets", void 0), a([p({ type: String })], $.prototype, "placeholder", void 0), a([p({
4238
+ type: Boolean,
4239
+ reflect: !0
4240
+ })], $.prototype, "disabled", void 0), a([p({
4241
+ type: Boolean,
4242
+ reflect: !0
4243
+ })], $.prototype, "stoppable", void 0), a([p({
4244
+ type: Boolean,
4245
+ attribute: "show-assistant-context-menu"
4246
+ })], $.prototype, "showAssistantContextMenu", void 0), a([p({
4247
+ type: String,
4248
+ attribute: "auth-key"
4249
+ })], $.prototype, "authKey", void 0), a([p({
4250
+ type: String,
4251
+ attribute: "auth-token"
4252
+ })], $.prototype, "authToken", void 0), a([p({
4253
+ type: String,
4254
+ attribute: "api-url"
4255
+ })], $.prototype, "apiUrl", void 0), a([p({
4256
+ type: String,
4257
+ attribute: "app-server"
4258
+ })], $.prototype, "appServer", void 0), a([p({
4259
+ type: Boolean,
4260
+ reflect: !0,
4261
+ attribute: "include-public-datasets"
4262
+ })], $.prototype, "includePublicDatasets", void 0), a([p({
4263
+ type: Boolean,
4264
+ attribute: "flag-opendata"
4265
+ })], $.prototype, "flagOpendata", null), a([p({
4266
+ type: Boolean,
4267
+ attribute: "hide-dataset-button"
4268
+ })], $.prototype, "hideDatasetButton", void 0), a([p({
4269
+ type: Boolean,
4270
+ attribute: "hide-dataset-icons"
4271
+ })], $.prototype, "hideDatasetIcons", void 0), a([p({
4272
+ type: Boolean,
4273
+ attribute: "disable-dataset-modification"
4274
+ })], $.prototype, "disableDatasetModification", void 0), a([p({
4275
+ type: Boolean,
4276
+ attribute: "hide-selected-datasets"
4277
+ })], $.prototype, "hideSelectedDatasets", void 0), a([p({
4278
+ type: Boolean,
4279
+ reflect: !0,
4280
+ attribute: "hide-agents"
4281
+ })], $.prototype, "hideAgents", void 0), a([p({
4282
+ type: Boolean,
4283
+ attribute: "disable-column-mentions"
4284
+ })], $.prototype, "disableColumnMentions", void 0), a([p({
4285
+ type: Boolean,
4286
+ attribute: "require-dataset"
4287
+ })], $.prototype, "requireDataset", void 0), a([p({
4288
+ type: Boolean,
4289
+ reflect: !0,
4290
+ attribute: "allow-images"
4291
+ })], $.prototype, "allowImages", void 0), a([p({
4292
+ type: Boolean,
4293
+ reflect: !0,
4294
+ attribute: "allow-voice-input"
4295
+ })], $.prototype, "allowVoiceInput", void 0), a([p({
4296
+ type: Array,
4297
+ attribute: "accepted-file-types"
4298
+ })], $.prototype, "acceptedFileTypes", void 0), a([p({ attribute: !1 })], $.prototype, "uploadAttachments", void 0), a([p({ type: String })], $.prototype, "agent", void 0), a([p({ attribute: !1 })], $.prototype, "agentConfig", void 0), a([p({
4299
+ type: String,
4300
+ attribute: "agent-id"
4301
+ })], $.prototype, "agentId", void 0), a([p({ type: String })], $.prototype, "task", void 0), a([p({
4302
+ type: String,
4303
+ attribute: "model-preference"
4304
+ })], $.prototype, "modelPreference", void 0), a([p({ attribute: !1 })], $.prototype, "chatSession", void 0), a([p({
4305
+ type: String,
4306
+ attribute: "conversation-id"
4307
+ })], $.prototype, "conversationId", void 0), a([p({
4308
+ type: Object,
4309
+ attribute: "chart"
4310
+ })], $.prototype, "chart", void 0), a([p({ type: Object })], $.prototype, "dashboard", void 0), a([p({ attribute: !1 })], $.prototype, "customItem", void 0), a([p({
4311
+ type: String,
4312
+ attribute: "current-screen-mode"
4313
+ })], $.prototype, "currentScreenMode", void 0), a([p({
4314
+ type: String,
4315
+ attribute: "locale-id"
4316
+ })], $.prototype, "localeId", void 0), a([p({
4317
+ type: String,
4318
+ attribute: "timezone-id"
4319
+ })], $.prototype, "timezoneId", void 0), a([p({
4320
+ type: String,
4321
+ attribute: "api-version"
4322
+ })], $.prototype, "apiVersion", void 0), a([p({ converter: { fromAttribute: (e) => e !== "false" && e !== null } })], $.prototype, "stream", void 0), a([p({
4323
+ type: String,
4324
+ attribute: "loading-message"
4325
+ })], $.prototype, "loadingMessage", void 0), a([p({
4326
+ type: String,
4327
+ attribute: "cancelled-message"
4328
+ })], $.prototype, "cancelledMessage", void 0), a([p({
4329
+ type: String,
4330
+ attribute: "initial-prompt"
4331
+ })], $.prototype, "initialPrompt", void 0), a([p({
4332
+ type: String,
4333
+ attribute: "empty-state-title"
4334
+ })], $.prototype, "emptyStateTitle", void 0), a([p({
4335
+ type: String,
4336
+ attribute: "empty-state-subtitle"
4337
+ })], $.prototype, "emptyStateSubtitle", void 0), a([p({
4338
+ type: Array,
4339
+ attribute: !1
4340
+ })], $.prototype, "emptyStateSuggestions", void 0), a([m()], $.prototype, "_textareaValue", void 0), a([m()], $.prototype, "_assistantMessageActionsSlotHasContent", void 0), a([m()], $.prototype, "_pendingAssistantMessageAction", void 0);
4341
+ //#endregion
4342
+ //#region src/components/ai-chat/ai-chat-events.ts
4343
+ function si(e) {
4344
+ return e.recognized === !0;
4345
+ }
4346
+ //#endregion
4347
+ //#region src/components/ai-chat/index.ts
4348
+ customElements.get("luzmo-ai-chat") || customElements.define("luzmo-ai-chat", $);
4349
+ //#endregion
4350
+ export { Un as C, Mn as D, Rn as E, Wn as S, zn as T, Xn as _, ai as a, Gn as b, ei as c, pr as d, tr as f, er as g, Qn as h, ii as i, $r as l, Zn as m, $ as n, ni as o, nr as p, oi as r, ti as s, si as t, lr as u, Jn as v, qn as w, Kn as x, Yn as y };