@luzmo/analytics-components-kit 1.0.1-alpha.142 → 1.0.1-alpha.144

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 (185) hide show
  1. package/angular/esm/types/ai-chat.types.d.ts +1 -0
  2. package/angular/types/ai-chat.types.ts +1 -0
  3. package/components/ai-chat/ai-chat.d.ts +8 -1
  4. package/components/ai-chat/index.cjs +1 -1
  5. package/components/ai-chat/index.js +7 -7
  6. package/components/{ai-chat-DlUYd_Cf.js → ai-chat-CEX2VQeq.js} +115 -82
  7. package/components/ai-chat-PZrWiUxE.cjs +90 -0
  8. package/components/ai-interaction-textarea/index.cjs +1 -1
  9. package/components/ai-interaction-textarea/index.js +5 -5
  10. package/components/{ai-interaction-textarea-BGnQbDpJ.cjs → ai-interaction-textarea-CcgFeoIg.cjs} +4 -4
  11. package/components/data-fields-select/index.cjs +1 -1
  12. package/components/data-fields-select/index.js +3 -3
  13. package/components/{data-fields-select-DOFNOn2D.cjs → data-fields-select-Byfdph5v.cjs} +3 -3
  14. package/components/{data-fields-select-0-QPdj3X.js → data-fields-select-dbn1KG3y.js} +2 -2
  15. package/components/dataset-icon/index.cjs +1 -1
  16. package/components/dataset-icon/index.js +1 -1
  17. package/components/{dataset-icon-BbNgugDA.cjs → dataset-icon-C0cID-ra.cjs} +11 -11
  18. package/components/{dataset-icon-x6Q8nhYc.js → dataset-icon-DhF21dXC.js} +6 -6
  19. package/components/dataset-selector-list/index.cjs +1 -1
  20. package/components/dataset-selector-list/index.js +3 -3
  21. package/components/{dataset-selector-list-DO_ExOrO.js → dataset-selector-list-BDSXGUDh.js} +1 -1
  22. package/components/{dataset-selector-list-BdeJlo0u.cjs → dataset-selector-list-CH3lwAjJ.cjs} +1 -1
  23. package/components/dataset-selector-row/index.cjs +1 -1
  24. package/components/dataset-selector-row/index.js +4 -4
  25. package/components/{dataset-selector-row-VsvdrVDf.js → dataset-selector-row-DPyGMP__.js} +2 -2
  26. package/components/{dataset-selector-row-CAlRVIk_.cjs → dataset-selector-row-DdTnaQ6w.cjs} +9 -9
  27. package/components/{de-DEzbbWVL.js → de-DOhCpte6.js} +5 -2
  28. package/components/de-DR0saUbU.cjs +20 -0
  29. package/components/display-settings/index.cjs +1 -1
  30. package/components/display-settings/index.js +3 -3
  31. package/components/{display-settings-BwRkE6i-.js → display-settings-C_ubOOoF.js} +14 -14
  32. package/components/{display-settings-rCBWD_I_.cjs → display-settings-Sh4LWJgN.cjs} +16 -16
  33. package/components/display-settings-binning/index.cjs +1 -1
  34. package/components/display-settings-binning/index.js +3 -3
  35. package/components/{display-settings-binning-C4V_P8mI.cjs → display-settings-binning-C9VF0K9q.cjs} +7 -7
  36. package/components/{display-settings-binning-BXlXiFNV.js → display-settings-binning-DP9oFC6h.js} +2 -2
  37. package/components/display-settings-datetime/index.cjs +1 -1
  38. package/components/display-settings-datetime/index.js +3 -3
  39. package/components/{display-settings-datetime-Db-0j9VZ.cjs → display-settings-datetime-C3LDVEcH.cjs} +38 -38
  40. package/components/{display-settings-datetime-LqM04khP.js → display-settings-datetime-DxBUXAuH.js} +2 -2
  41. package/components/display-settings-grand-totals/index.cjs +1 -1
  42. package/components/display-settings-grand-totals/index.js +3 -3
  43. package/components/{display-settings-grand-totals-BDDMVFrg.js → display-settings-grand-totals-BiGxXuw2.js} +2 -2
  44. package/components/{display-settings-grand-totals-0ihnPMfZ.cjs → display-settings-grand-totals-C3QlInwU.cjs} +5 -5
  45. package/components/display-settings-numeric/index.cjs +1 -1
  46. package/components/display-settings-numeric/index.js +3 -3
  47. package/components/{display-settings-numeric-Cpp9mQCA.js → display-settings-numeric-BvLDL-qP.js} +3 -3
  48. package/components/{display-settings-numeric-CfBT04A7.cjs → display-settings-numeric-CyoTJKZv.cjs} +28 -28
  49. package/components/display-settings-period-over-period/index.cjs +1 -1
  50. package/components/display-settings-period-over-period/index.js +3 -3
  51. package/components/{display-settings-period-over-period-CWOpgJmd.cjs → display-settings-period-over-period-Cdmaf_Rw.cjs} +1 -1
  52. package/components/{display-settings-period-over-period-pxCijPAW.js → display-settings-period-over-period-CvvgRCVH.js} +1 -1
  53. package/components/draggable-data-field/index.cjs +1 -1
  54. package/components/draggable-data-field/index.js +4 -4
  55. package/components/{draggable-data-field-C6ojUWMf.js → draggable-data-field-C_zHA_mn.js} +1 -1
  56. package/components/{draggable-data-field-BsvgQjQY.cjs → draggable-data-field-CbF7N-o7.cjs} +1 -1
  57. package/components/draggable-data-field-level/index.cjs +1 -1
  58. package/components/draggable-data-field-level/index.js +3 -3
  59. package/components/{draggable-data-field-level-CJ-vup34.cjs → draggable-data-field-level-CI1No5x8.cjs} +10 -10
  60. package/components/draggable-data-fields-panel/index.cjs +1 -1
  61. package/components/draggable-data-fields-panel/index.js +5 -5
  62. package/components/{draggable-data-fields-panel-DJPz42xa.js → draggable-data-fields-panel-D7oa6gGZ.js} +1 -1
  63. package/components/{draggable-data-fields-panel-oNEzkow0.cjs → draggable-data-fields-panel-DOdI9NaC.cjs} +1 -1
  64. package/components/droppable-slot/index.cjs +1 -1
  65. package/components/droppable-slot/index.js +6 -6
  66. package/components/{droppable-slot-C8rhDVI-.cjs → droppable-slot-DtFdADiO.cjs} +10 -10
  67. package/components/{droppable-slot-DEpOqyps.js → droppable-slot-oB61SQKO.js} +4 -4
  68. package/components/edit-filters/index.cjs +1 -1
  69. package/components/edit-filters/index.js +10 -10
  70. package/components/{edit-filters-D2oZa0E_.js → edit-filters-B29YfSBe.js} +12 -21
  71. package/components/{edit-filters-pq1q7Eff.cjs → edit-filters-geWHEBCw.cjs} +23 -33
  72. package/components/edit-item/index.cjs +1 -1
  73. package/components/edit-item/index.js +2 -2
  74. package/components/edit-option/index.cjs +1 -1
  75. package/components/edit-option/index.js +2 -2
  76. package/components/edit-option-action-button-group/index.cjs +1 -1
  77. package/components/edit-option-action-button-group/index.js +3 -3
  78. package/components/{edit-option-action-button-group-DlJwTW3A.cjs → edit-option-action-button-group-W34osCsN.cjs} +5 -5
  79. package/components/edit-option-color-palette-picker/index.cjs +1 -1
  80. package/components/edit-option-color-palette-picker/index.js +2 -2
  81. package/components/edit-option-color-picker/index.cjs +1 -1
  82. package/components/edit-option-color-picker/index.js +2 -2
  83. package/components/edit-option-color-range/index.cjs +1 -1
  84. package/components/edit-option-color-range/index.js +3 -3
  85. package/components/{edit-option-color-range-BtahxHzd.js → edit-option-color-range-CmpvQTSG.js} +3 -3
  86. package/components/{edit-option-color-range-DhBp5wlk.cjs → edit-option-color-range-DVYMhG2R.cjs} +15 -15
  87. package/components/edit-option-multi-language-field/index.cjs +1 -1
  88. package/components/edit-option-multi-language-field/index.js +2 -2
  89. package/components/edit-option-number-field/index.cjs +1 -1
  90. package/components/edit-option-number-field/index.js +2 -2
  91. package/components/edit-option-picker/index.cjs +1 -1
  92. package/components/edit-option-picker/index.js +2 -2
  93. package/components/edit-option-position-picker/index.cjs +1 -1
  94. package/components/edit-option-position-picker/index.js +2 -2
  95. package/components/edit-option-positions-number-field/index.cjs +1 -1
  96. package/components/edit-option-positions-number-field/index.js +3 -3
  97. package/components/{edit-option-positions-number-field-DhnxicFl.cjs → edit-option-positions-number-field-CmK8_2ZQ.cjs} +8 -8
  98. package/components/edit-option-radio-button-group/index.cjs +1 -1
  99. package/components/edit-option-radio-button-group/index.js +2 -2
  100. package/components/edit-option-slider/index.cjs +1 -1
  101. package/components/edit-option-slider/index.js +2 -2
  102. package/components/edit-option-switch/index.cjs +1 -1
  103. package/components/edit-option-switch/index.js +2 -2
  104. package/components/edit-option-text-field/index.cjs +1 -1
  105. package/components/edit-option-text-field/index.js +2 -2
  106. package/components/es-CNpZK6tJ.cjs +20 -0
  107. package/components/{es-DIIjhY-_.js → es-cTUhzLmn.js} +5 -2
  108. package/components/filter-expression-picker/index.cjs +1 -1
  109. package/components/filter-expression-picker/index.js +3 -3
  110. package/components/{filter-expression-picker-BKJXpOiw.js → filter-expression-picker-D83ya_dt.js} +1 -1
  111. package/components/{filter-expression-picker-Jcv2KTB6.cjs → filter-expression-picker-wOcgU2No.cjs} +1 -1
  112. package/components/filter-item/index.cjs +1 -1
  113. package/components/filter-item/index.js +9 -9
  114. package/components/{filter-item-RaC0VdlI.js → filter-item-BdnrbMUW.js} +2 -2
  115. package/components/{filter-item-Bqhpikdf.cjs → filter-item-ByKzQ-fl.cjs} +1 -1
  116. package/components/filter-value-picker/index.cjs +1 -1
  117. package/components/filter-value-picker/index.js +6 -6
  118. package/components/{filter-value-picker-C92yj41B.js → filter-value-picker-B2BjJuIa.js} +1 -1
  119. package/components/{filter-value-picker-49_ZrLE2.cjs → filter-value-picker-Co9Vka2J.cjs} +1 -1
  120. package/components/filter-value-picker-datetime/index.cjs +1 -1
  121. package/components/filter-value-picker-datetime/index.js +3 -3
  122. package/components/{filter-value-picker-datetime-CwrpeAdQ.js → filter-value-picker-datetime-BOheBbvB.js} +1 -1
  123. package/components/{filter-value-picker-datetime-f3T5FuxN.cjs → filter-value-picker-datetime-BzMfKPkZ.cjs} +1 -1
  124. package/components/filter-value-picker-hierarchy/index.cjs +1 -1
  125. package/components/filter-value-picker-hierarchy/index.js +3 -3
  126. package/components/{filter-value-picker-hierarchy-BjWbzo8J.js → filter-value-picker-hierarchy-Cwq8GLp4.js} +1 -1
  127. package/components/{filter-value-picker-hierarchy-D6FbH0gw.cjs → filter-value-picker-hierarchy-Dgdj-xqx.cjs} +1 -1
  128. package/components/filter-value-picker-numeric/index.cjs +1 -1
  129. package/components/filter-value-picker-numeric/index.js +3 -3
  130. package/components/{filter-value-picker-numeric-F1XJRVFa.js → filter-value-picker-numeric-CHFRRe1f.js} +1 -1
  131. package/components/{filter-value-picker-numeric-BCfpod5c.cjs → filter-value-picker-numeric-CZrRBHuR.cjs} +1 -1
  132. package/components/fr-DKJHfJgy.cjs +20 -0
  133. package/components/{fr-D9ILwOuz.js → fr-x3aFvlKk.js} +5 -2
  134. package/components/grid/index.cjs +1 -1
  135. package/components/grid/index.js +3 -3
  136. package/components/{grid-BNbbl-9p.cjs → grid-BxeX-SG-.cjs} +31 -31
  137. package/components/{grid-Ca-fxUK1.js → grid-CfCH13sk.js} +20 -20
  138. package/components/index.cjs +1 -1
  139. package/components/index.js +35 -35
  140. package/components/item-data-drop-panel/index.cjs +1 -1
  141. package/components/item-data-drop-panel/index.js +7 -7
  142. package/components/{item-data-drop-panel-BMubV7pj.js → item-data-drop-panel-BNf_N7GH.js} +1 -1
  143. package/components/{item-data-drop-panel-Bt8rKT6s.cjs → item-data-drop-panel-Dcj5Gz29.cjs} +1 -1
  144. package/components/item-data-picker-panel/index.cjs +1 -1
  145. package/components/item-data-picker-panel/index.js +8 -8
  146. package/components/{item-data-picker-panel-DZOIUxuS.cjs → item-data-picker-panel-GD6CRais.cjs} +1 -1
  147. package/components/{item-data-picker-panel-DBK2fVsG.js → item-data-picker-panel-OK_nMbm4.js} +1 -1
  148. package/components/{localized-mixin-DTvVLuXW.cjs → localized-mixin-BmZhC9XV.cjs} +1 -1
  149. package/components/{localized-mixin-cLT0UbaF.js → localized-mixin-CgQFYGOU.js} +1 -1
  150. package/components/{nl-DhD5Rlf7.js → nl-Cv7QXh6s.js} +5 -2
  151. package/components/nl-DtxDWOXH.cjs +20 -0
  152. package/components/{set-locale-Uv6F4uSq.js → set-locale-CRNDDu2d.js} +4 -4
  153. package/components/{set-locale-CKjJZRH6.cjs → set-locale-DjOkyNGu.cjs} +1 -1
  154. package/components/slot-contents-picker/index.cjs +1 -1
  155. package/components/slot-contents-picker/index.js +7 -7
  156. package/components/{slot-contents-picker-Bw_G1BwZ.js → slot-contents-picker-BNWBIypw.js} +4 -4
  157. package/components/{slot-contents-picker-BO5lSTDz.cjs → slot-contents-picker-BjqOUNKU.cjs} +21 -21
  158. package/components/slot-menu/index.cjs +1 -1
  159. package/components/slot-menu/index.js +5 -5
  160. package/components/{slot-menu-DxYruISb.js → slot-menu-B3L8YEnv.js} +2 -2
  161. package/components/{slot-menu-DyC8HQ5E.cjs → slot-menu-DIQ6h6Dz.cjs} +9 -9
  162. package/components/slot-menu-list/index.cjs +1 -1
  163. package/components/slot-menu-list/index.js +3 -3
  164. package/components/{slot-menu-list-Dmb6s6UK.cjs → slot-menu-list-CFCvrPVt.cjs} +3 -3
  165. package/components/utils/base.cjs +1 -1
  166. package/components/utils/base.js +2 -2
  167. package/components/utils.cjs +1 -1
  168. package/components/utils.js +1 -1
  169. package/components/viz-item-menu/index.cjs +1 -1
  170. package/components/viz-item-menu/index.js +3 -3
  171. package/components/{viz-item-menu-D18d77aP.cjs → viz-item-menu-BNgd025g.cjs} +6 -6
  172. package/components/{viz-item-menu-CjA1X_Vg.js → viz-item-menu-_DLQJFWj.js} +2 -2
  173. package/custom-elements.json +19 -0
  174. package/package.json +1 -1
  175. package/types/ai-chat.types.d.ts +1 -0
  176. package/components/ai-chat-rok8ar11.cjs +0 -62
  177. package/components/de-nxCdeqFz.cjs +0 -20
  178. package/components/es-BEBp9Wdb.cjs +0 -20
  179. package/components/fr-BSmOmsww.cjs +0 -20
  180. package/components/nl-BiQ2EuE6.cjs +0 -20
  181. package/components/{ai-interaction-textarea-EdWcPK0w.js → ai-interaction-textarea-B5UE7CIq.js} +1 -1
  182. package/components/{draggable-data-field-level-BTUXWyDq.js → draggable-data-field-level-BQBMnApS.js} +1 -1
  183. package/components/{edit-option-action-button-group-CnsDFlK_.js → edit-option-action-button-group-DNrXatQR.js} +1 -1
  184. package/components/{edit-option-positions-number-field-BX1zqHcV.js → edit-option-positions-number-field-DZtxuvEY.js} +1 -1
  185. package/components/{slot-menu-list-DbZnXcMZ.js → slot-menu-list-BLJxoLeI.js} +1 -1
@@ -2,6 +2,7 @@ export interface ChatMessage {
2
2
  id?: string;
3
3
  type: 'user' | 'ai';
4
4
  message: string;
5
+ isError?: boolean;
5
6
  }
6
7
  export interface LuzmoChart {
7
8
  version: string;
@@ -2,6 +2,7 @@ export interface ChatMessage {
2
2
  id?: string;
3
3
  type: 'user' | 'ai';
4
4
  message: string;
5
+ isError?: boolean;
5
6
  }
6
7
 
7
8
  export interface LuzmoChart {
@@ -90,6 +90,11 @@ export declare class LuzmoAiChat extends LuzmoElement {
90
90
  * @default '0.1.0'
91
91
  */
92
92
  apiVersion: string;
93
+ /**
94
+ * Loading message
95
+ * @default null
96
+ */
97
+ loadingMessage: string | null;
93
98
  private _isGeneratingInternal;
94
99
  private _textareaValue;
95
100
  private _generateMessageId;
@@ -101,12 +106,12 @@ export declare class LuzmoAiChat extends LuzmoElement {
101
106
  private _handleErrorResponse;
102
107
  private _processAIResponse;
103
108
  private _handleAPIError;
104
- private _finalizeAIResponse;
105
109
  private _handleDatasetSelected;
106
110
  private _handleDatasetRemoved;
107
111
  private _emitDatasetsChanged;
108
112
  private _handlePromptSubmitted;
109
113
  private _scrollToBottom;
114
+ protected updated(changedProperties: Map<string, unknown>): void;
110
115
  /**
111
116
  * Sanitizes HTML content to prevent XSS attacks while preserving safe formatting
112
117
  * @param htmlContent - The HTML string to sanitize
@@ -114,5 +119,7 @@ export declare class LuzmoAiChat extends LuzmoElement {
114
119
  */
115
120
  private _sanitizeMessage;
116
121
  private _renderMessages;
122
+ private _renderLoadingMessage;
123
+ private _renderPlaceholderMessage;
117
124
  protected render(): TemplateResult;
118
125
  }
@@ -17,4 +17,4 @@
17
17
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18
18
  * SOFTWARE.
19
19
  * */
20
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../base-C_azywlB.cjs`),require(`../focus-visible-3ACCHno4.cjs`),require(`../set-locale-CKjJZRH6.cjs`),require(`../localized-mixin-DTvVLuXW.cjs`);const e=require(`../ai-chat-rok8ar11.cjs`);require(`../dataset-icon-BbNgugDA.cjs`),require(`../data-broker-BUIUM5hr.cjs`),require(`../dataset-selector-list-BdeJlo0u.cjs`),require(`../dataset-selector-row-CAlRVIk_.cjs`),require(`../ai-interaction-textarea-BGnQbDpJ.cjs`),exports.LuzmoAiChat=e.t,exports.buildAiMessageRequest=e.n;
20
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../base-C_azywlB.cjs`),require(`../focus-visible-3ACCHno4.cjs`),require(`../set-locale-DjOkyNGu.cjs`),require(`../localized-mixin-BmZhC9XV.cjs`);const e=require(`../ai-chat-PZrWiUxE.cjs`);require(`../dataset-icon-C0cID-ra.cjs`),require(`../data-broker-BUIUM5hr.cjs`),require(`../dataset-selector-list-CH3lwAjJ.cjs`),require(`../dataset-selector-row-DdTnaQ6w.cjs`),require(`../ai-interaction-textarea-CcgFeoIg.cjs`),exports.LuzmoAiChat=e.t,exports.buildAiMessageRequest=e.n;
@@ -25,12 +25,12 @@
25
25
  })();
26
26
  import "../base-rg2x95aL.js";
27
27
  import "../focus-visible-D1pJhWEh.js";
28
- import "../set-locale-Uv6F4uSq.js";
29
- import "../localized-mixin-cLT0UbaF.js";
30
- import { n as buildAiMessageRequest, t as LuzmoAiChat } from "../ai-chat-DlUYd_Cf.js";
31
- import "../dataset-icon-x6Q8nhYc.js";
28
+ import "../set-locale-CRNDDu2d.js";
29
+ import "../localized-mixin-CgQFYGOU.js";
30
+ import { n as buildAiMessageRequest, t as LuzmoAiChat } from "../ai-chat-CEX2VQeq.js";
31
+ import "../dataset-icon-DhF21dXC.js";
32
32
  import "../data-broker-cLR-t5LM.js";
33
- import "../dataset-selector-list-DO_ExOrO.js";
34
- import "../dataset-selector-row-VsvdrVDf.js";
35
- import "../ai-interaction-textarea-EdWcPK0w.js";
33
+ import "../dataset-selector-list-BDSXGUDh.js";
34
+ import "../dataset-selector-row-DPyGMP__.js";
35
+ import "../ai-interaction-textarea-B5UE7CIq.js";
36
36
  export { LuzmoAiChat, buildAiMessageRequest };
@@ -19,6 +19,8 @@
19
19
  * */
20
20
  import { i as LuzmoElement } from "./base-rg2x95aL.js";
21
21
  import { t as __decorate } from "./decorate-Da6S_xrw.js";
22
+ import { msg } from "@lit/localize/lit-localize";
23
+ import { luzmoIcon, luzmoSpin } from "@luzmo/icons";
22
24
  import "@luzmo/lucero/chat-message";
23
25
  import { html, unsafeCSS } from "lit";
24
26
  import { property, state } from "lit/decorators.js";
@@ -215,7 +217,7 @@ var html$1 = freeze(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.a
215
217
  function createDOMPurify() {
216
218
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal(), t = (e) => createDOMPurify(e);
217
219
  if (t.version = "3.3.1", t.removed = [], !e || !e.document || e.document.nodeType !== NODE_TYPE.document || !e.Element) return t.isSupported = !1, t;
218
- let { document: n } = e, r = n, i = r.currentScript, { DocumentFragment: a, HTMLTemplateElement: o, Node: c, Element: l, NodeFilter: u, NamedNodeMap: d = e.NamedNodeMap || e.MozNamedAttrMap, HTMLFormElement: Re, DOMParser: ze, trustedTypes: f } = e, p = l.prototype, Be = lookupGetter(p, "cloneNode"), Ve = lookupGetter(p, "remove"), He = lookupGetter(p, "nextSibling"), Ue = lookupGetter(p, "childNodes"), m = lookupGetter(p, "parentNode");
220
+ let { document: n } = e, r = n, i = r.currentScript, { DocumentFragment: a, HTMLTemplateElement: o, Node: s, Element: c, NodeFilter: l, NamedNodeMap: d = e.NamedNodeMap || e.MozNamedAttrMap, HTMLFormElement: Re, DOMParser: ze, trustedTypes: f } = e, p = c.prototype, Be = lookupGetter(p, "cloneNode"), Ve = lookupGetter(p, "remove"), He = lookupGetter(p, "nextSibling"), Ue = lookupGetter(p, "childNodes"), m = lookupGetter(p, "parentNode");
219
221
  if (typeof o == "function") {
220
222
  let e = n.createElement("template");
221
223
  e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
@@ -265,7 +267,7 @@ function createDOMPurify() {
265
267
  enumerable: !0,
266
268
  value: null
267
269
  }
268
- })), nt = !0, O = !0, rt = !1, it = !0, k = !1, A = !0, j = !1, M = !1, N = !1, P = !1, F = !1, I = !1, at = !0, ot = !1, L = !0, R = !1, z = {}, B = null, st = addToSet({}, [
270
+ })), nt = !0, O = !0, rt = !1, it = !0, k = !1, A = !0, j = !1, M = !1, N = !1, P = !1, F = !1, I = !1, at = !0, ot = !1, L = !0, R = !1, z = {}, B = null, V = addToSet({}, [
269
271
  "annotation-xml",
270
272
  "audio",
271
273
  "colgroup",
@@ -291,14 +293,14 @@ function createDOMPurify() {
291
293
  "title",
292
294
  "video",
293
295
  "xmp"
294
- ]), ct = null, lt = addToSet({}, [
296
+ ]), st = null, ct = addToSet({}, [
295
297
  "audio",
296
298
  "video",
297
299
  "img",
298
300
  "source",
299
301
  "image",
300
302
  "track"
301
- ]), ut = null, dt = addToSet({}, [
303
+ ]), lt = null, ut = addToSet({}, [
302
304
  "alt",
303
305
  "class",
304
306
  "for",
@@ -313,28 +315,28 @@ function createDOMPurify() {
313
315
  "value",
314
316
  "style",
315
317
  "xmlns"
316
- ]), V = "http://www.w3.org/1998/Math/MathML", H = "http://www.w3.org/2000/svg", U = "http://www.w3.org/1999/xhtml", W = U, ft = !1, pt = null, mt = addToSet({}, [
317
- V,
318
+ ]), H = "http://www.w3.org/1998/Math/MathML", U = "http://www.w3.org/2000/svg", W = "http://www.w3.org/1999/xhtml", G = W, dt = !1, ft = null, pt = addToSet({}, [
318
319
  H,
319
- U
320
- ], stringToString), G = addToSet({}, [
320
+ U,
321
+ W
322
+ ], stringToString), K = addToSet({}, [
321
323
  "mi",
322
324
  "mo",
323
325
  "mn",
324
326
  "ms",
325
327
  "mtext"
326
- ]), K = addToSet({}, ["annotation-xml"]), ht = addToSet({}, [
328
+ ]), q = addToSet({}, ["annotation-xml"]), mt = addToSet({}, [
327
329
  "title",
328
330
  "style",
329
331
  "font",
330
332
  "a",
331
333
  "script"
332
- ]), q = null, gt = ["application/xhtml+xml", "text/html"], J = null, Y = null, _t = n.createElement("form"), vt = function(e) {
334
+ ]), J = null, ht = ["application/xhtml+xml", "text/html"], Y = null, X = null, gt = n.createElement("form"), _t = function(e) {
333
335
  return e instanceof RegExp || e instanceof Function;
334
- }, yt = function() {
336
+ }, vt = function() {
335
337
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
336
- if (!(Y && Y === e)) {
337
- if ((!e || typeof e != "object") && (e = {}), e = clone(e), q = gt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, J = q === "application/xhtml+xml" ? stringToString : stringToLowerCase, S = objectHasOwnProperty(e, "ALLOWED_TAGS") ? addToSet({}, e.ALLOWED_TAGS, J) : et, C = objectHasOwnProperty(e, "ALLOWED_ATTR") ? addToSet({}, e.ALLOWED_ATTR, J) : tt, pt = objectHasOwnProperty(e, "ALLOWED_NAMESPACES") ? addToSet({}, e.ALLOWED_NAMESPACES, stringToString) : mt, ut = objectHasOwnProperty(e, "ADD_URI_SAFE_ATTR") ? addToSet(clone(dt), e.ADD_URI_SAFE_ATTR, J) : dt, ct = objectHasOwnProperty(e, "ADD_DATA_URI_TAGS") ? addToSet(clone(lt), e.ADD_DATA_URI_TAGS, J) : lt, B = objectHasOwnProperty(e, "FORBID_CONTENTS") ? addToSet({}, e.FORBID_CONTENTS, J) : st, T = objectHasOwnProperty(e, "FORBID_TAGS") ? addToSet({}, e.FORBID_TAGS, J) : clone({}), E = objectHasOwnProperty(e, "FORBID_ATTR") ? addToSet({}, e.FORBID_ATTR, J) : clone({}), z = objectHasOwnProperty(e, "USE_PROFILES") ? e.USE_PROFILES : !1, nt = e.ALLOW_ARIA_ATTR !== !1, O = e.ALLOW_DATA_ATTR !== !1, rt = e.ALLOW_UNKNOWN_PROTOCOLS || !1, it = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, k = e.SAFE_FOR_TEMPLATES || !1, A = e.SAFE_FOR_XML !== !1, j = e.WHOLE_DOCUMENT || !1, P = e.RETURN_DOM || !1, F = e.RETURN_DOM_FRAGMENT || !1, I = e.RETURN_TRUSTED_TYPE || !1, N = e.FORCE_BODY || !1, at = e.SANITIZE_DOM !== !1, ot = e.SANITIZE_NAMED_PROPS || !1, L = e.KEEP_CONTENT !== !1, R = e.IN_PLACE || !1, $e = e.ALLOWED_URI_REGEXP || IS_ALLOWED_URI, W = e.NAMESPACE || U, G = e.MATHML_TEXT_INTEGRATION_POINTS || G, K = e.HTML_INTEGRATION_POINTS || K, w = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && vt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (w.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && vt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (w.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (w.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), k && (O = !1), F && (P = !0), z && (S = addToSet({}, text), C = [], z.html === !0 && (addToSet(S, html$1), addToSet(C, html$2)), z.svg === !0 && (addToSet(S, svg$1), addToSet(C, svg), addToSet(C, xml)), z.svgFilters === !0 && (addToSet(S, svgFilters), addToSet(C, svg), addToSet(C, xml)), z.mathMl === !0 && (addToSet(S, mathMl$1), addToSet(C, mathMl), addToSet(C, xml))), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? D.tagCheck = e.ADD_TAGS : (S === et && (S = clone(S)), addToSet(S, e.ADD_TAGS, J))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? D.attributeCheck = e.ADD_ATTR : (C === tt && (C = clone(C)), addToSet(C, e.ADD_ATTR, J))), e.ADD_URI_SAFE_ATTR && addToSet(ut, e.ADD_URI_SAFE_ATTR, J), e.FORBID_CONTENTS && (B === st && (B = clone(B)), addToSet(B, e.FORBID_CONTENTS, J)), e.ADD_FORBID_CONTENTS && (B === st && (B = clone(B)), addToSet(B, e.ADD_FORBID_CONTENTS, J)), L && (S["#text"] = !0), j && addToSet(S, [
338
+ if (!(X && X === e)) {
339
+ if ((!e || typeof e != "object") && (e = {}), e = clone(e), J = ht.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Y = J === "application/xhtml+xml" ? stringToString : stringToLowerCase, S = objectHasOwnProperty(e, "ALLOWED_TAGS") ? addToSet({}, e.ALLOWED_TAGS, Y) : et, C = objectHasOwnProperty(e, "ALLOWED_ATTR") ? addToSet({}, e.ALLOWED_ATTR, Y) : tt, ft = objectHasOwnProperty(e, "ALLOWED_NAMESPACES") ? addToSet({}, e.ALLOWED_NAMESPACES, stringToString) : pt, lt = objectHasOwnProperty(e, "ADD_URI_SAFE_ATTR") ? addToSet(clone(ut), e.ADD_URI_SAFE_ATTR, Y) : ut, st = objectHasOwnProperty(e, "ADD_DATA_URI_TAGS") ? addToSet(clone(ct), e.ADD_DATA_URI_TAGS, Y) : ct, B = objectHasOwnProperty(e, "FORBID_CONTENTS") ? addToSet({}, e.FORBID_CONTENTS, Y) : V, T = objectHasOwnProperty(e, "FORBID_TAGS") ? addToSet({}, e.FORBID_TAGS, Y) : clone({}), E = objectHasOwnProperty(e, "FORBID_ATTR") ? addToSet({}, e.FORBID_ATTR, Y) : clone({}), z = objectHasOwnProperty(e, "USE_PROFILES") ? e.USE_PROFILES : !1, nt = e.ALLOW_ARIA_ATTR !== !1, O = e.ALLOW_DATA_ATTR !== !1, rt = e.ALLOW_UNKNOWN_PROTOCOLS || !1, it = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, k = e.SAFE_FOR_TEMPLATES || !1, A = e.SAFE_FOR_XML !== !1, j = e.WHOLE_DOCUMENT || !1, P = e.RETURN_DOM || !1, F = e.RETURN_DOM_FRAGMENT || !1, I = e.RETURN_TRUSTED_TYPE || !1, N = e.FORCE_BODY || !1, at = e.SANITIZE_DOM !== !1, ot = e.SANITIZE_NAMED_PROPS || !1, L = e.KEEP_CONTENT !== !1, R = e.IN_PLACE || !1, $e = e.ALLOWED_URI_REGEXP || IS_ALLOWED_URI, G = e.NAMESPACE || W, K = e.MATHML_TEXT_INTEGRATION_POINTS || K, q = e.HTML_INTEGRATION_POINTS || q, w = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && _t(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (w.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && _t(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (w.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (w.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), k && (O = !1), F && (P = !0), z && (S = addToSet({}, text), C = [], z.html === !0 && (addToSet(S, html$1), addToSet(C, html$2)), z.svg === !0 && (addToSet(S, svg$1), addToSet(C, svg), addToSet(C, xml)), z.svgFilters === !0 && (addToSet(S, svgFilters), addToSet(C, svg), addToSet(C, xml)), z.mathMl === !0 && (addToSet(S, mathMl$1), addToSet(C, mathMl), addToSet(C, xml))), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? D.tagCheck = e.ADD_TAGS : (S === et && (S = clone(S)), addToSet(S, e.ADD_TAGS, Y))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? D.attributeCheck = e.ADD_ATTR : (C === tt && (C = clone(C)), addToSet(C, e.ADD_ATTR, Y))), e.ADD_URI_SAFE_ATTR && addToSet(lt, e.ADD_URI_SAFE_ATTR, Y), e.FORBID_CONTENTS && (B === V && (B = clone(B)), addToSet(B, e.FORBID_CONTENTS, Y)), e.ADD_FORBID_CONTENTS && (B === V && (B = clone(B)), addToSet(B, e.ADD_FORBID_CONTENTS, Y)), L && (S["#text"] = !0), j && addToSet(S, [
338
340
  "html",
339
341
  "head",
340
342
  "body"
@@ -343,28 +345,28 @@ function createDOMPurify() {
343
345
  if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
344
346
  h = e.TRUSTED_TYPES_POLICY, g = h.createHTML("");
345
347
  } else h === void 0 && (h = _createTrustedTypesPolicy(f, i)), h !== null && typeof g == "string" && (g = h.createHTML(""));
346
- freeze && freeze(e), Y = e;
348
+ freeze && freeze(e), X = e;
347
349
  }
348
- }, bt = addToSet({}, [
350
+ }, yt = addToSet({}, [
349
351
  ...svg$1,
350
352
  ...svgFilters,
351
353
  ...svgDisallowed
352
- ]), xt = addToSet({}, [...mathMl$1, ...mathMlDisallowed]), St = function(e) {
354
+ ]), bt = addToSet({}, [...mathMl$1, ...mathMlDisallowed]), xt = function(e) {
353
355
  let t = m(e);
354
356
  (!t || !t.tagName) && (t = {
355
- namespaceURI: W,
357
+ namespaceURI: G,
356
358
  tagName: "template"
357
359
  });
358
360
  let n = stringToLowerCase(e.tagName), r = stringToLowerCase(t.tagName);
359
- return pt[e.namespaceURI] ? e.namespaceURI === H ? t.namespaceURI === U ? n === "svg" : t.namespaceURI === V ? n === "svg" && (r === "annotation-xml" || G[r]) : !!bt[n] : e.namespaceURI === V ? t.namespaceURI === U ? n === "math" : t.namespaceURI === H ? n === "math" && K[r] : !!xt[n] : e.namespaceURI === U ? t.namespaceURI === H && !K[r] || t.namespaceURI === V && !G[r] ? !1 : !xt[n] && (ht[n] || !bt[n]) : !!(q === "application/xhtml+xml" && pt[e.namespaceURI]) : !1;
360
- }, X = function(e) {
361
+ return ft[e.namespaceURI] ? e.namespaceURI === U ? t.namespaceURI === W ? n === "svg" : t.namespaceURI === H ? n === "svg" && (r === "annotation-xml" || K[r]) : !!yt[n] : e.namespaceURI === H ? t.namespaceURI === W ? n === "math" : t.namespaceURI === U ? n === "math" && q[r] : !!bt[n] : e.namespaceURI === W ? t.namespaceURI === U && !q[r] || t.namespaceURI === H && !K[r] ? !1 : !bt[n] && (mt[n] || !yt[n]) : !!(J === "application/xhtml+xml" && ft[e.namespaceURI]) : !1;
362
+ }, Z = function(e) {
361
363
  arrayPush(t.removed, { element: e });
362
364
  try {
363
365
  m(e).removeChild(e);
364
366
  } catch {
365
367
  Ve(e);
366
368
  }
367
- }, Z = function(e, n) {
369
+ }, Q = function(e, n) {
368
370
  try {
369
371
  arrayPush(t.removed, {
370
372
  attribute: n.getAttributeNode(e),
@@ -377,51 +379,51 @@ function createDOMPurify() {
377
379
  });
378
380
  }
379
381
  if (n.removeAttribute(e), e === "is") if (P || F) try {
380
- X(n);
382
+ Z(n);
381
383
  } catch {}
382
384
  else try {
383
385
  n.setAttribute(e, "");
384
386
  } catch {}
385
- }, Ct = function(e) {
387
+ }, St = function(e) {
386
388
  let t = null, r = null;
387
389
  if (N) e = "<remove></remove>" + e;
388
390
  else {
389
391
  let t = stringMatch(e, /^[\r\n\t ]+/);
390
392
  r = t && t[0];
391
393
  }
392
- q === "application/xhtml+xml" && W === U && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
394
+ J === "application/xhtml+xml" && G === W && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
393
395
  let i = h ? h.createHTML(e) : e;
394
- if (W === U) try {
395
- t = new ze().parseFromString(i, q);
396
+ if (G === W) try {
397
+ t = new ze().parseFromString(i, J);
396
398
  } catch {}
397
399
  if (!t || !t.documentElement) {
398
- t = _.createDocument(W, "template", null);
400
+ t = _.createDocument(G, "template", null);
399
401
  try {
400
- t.documentElement.innerHTML = ft ? g : i;
402
+ t.documentElement.innerHTML = dt ? g : i;
401
403
  } catch {}
402
404
  }
403
405
  let a = t.body || t.documentElement;
404
- return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), W === U ? Ke.call(t, j ? "html" : "body")[0] : j ? t.documentElement : a;
406
+ return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), G === W ? Ke.call(t, j ? "html" : "body")[0] : j ? t.documentElement : a;
407
+ }, Ct = function(e) {
408
+ return We.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
405
409
  }, wt = function(e) {
406
- return We.call(e.ownerDocument || e, e, u.SHOW_ELEMENT | u.SHOW_COMMENT | u.SHOW_TEXT | u.SHOW_PROCESSING_INSTRUCTION | u.SHOW_CDATA_SECTION, null);
407
- }, Q = function(e) {
408
410
  return e instanceof Re && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof d) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
409
411
  }, Tt = function(e) {
410
- return typeof c == "function" && e instanceof c;
412
+ return typeof s == "function" && e instanceof s;
411
413
  };
412
414
  function $(e, n, r) {
413
415
  arrayForEach(e, (e) => {
414
- e.call(t, n, r, Y);
416
+ e.call(t, n, r, X);
415
417
  });
416
418
  }
417
419
  let Et = function(e) {
418
420
  let n = null;
419
- if ($(v.beforeSanitizeElements, e, null), Q(e)) return X(e), !0;
420
- let r = J(e.nodeName);
421
+ if ($(v.beforeSanitizeElements, e, null), wt(e)) return Z(e), !0;
422
+ let r = Y(e.nodeName);
421
423
  if ($(v.uponSanitizeElement, e, {
422
424
  tagName: r,
423
425
  allowedTags: S
424
- }), A && e.hasChildNodes() && !Tt(e.firstElementChild) && regExpTest(/<[/\w!]/g, e.innerHTML) && regExpTest(/<[/\w!]/g, e.textContent) || e.nodeType === NODE_TYPE.progressingInstruction || A && e.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, e.data)) return X(e), !0;
426
+ }), A && e.hasChildNodes() && !Tt(e.firstElementChild) && regExpTest(/<[/\w!]/g, e.innerHTML) && regExpTest(/<[/\w!]/g, e.textContent) || e.nodeType === NODE_TYPE.progressingInstruction || A && e.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, e.data)) return Z(e), !0;
425
427
  if (!(D.tagCheck instanceof Function && D.tagCheck(r)) && (!S[r] || T[r])) {
426
428
  if (!T[r] && Ot(r) && (w.tagNameCheck instanceof RegExp && regExpTest(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r))) return !1;
427
429
  if (L && !B[r]) {
@@ -434,9 +436,9 @@ function createDOMPurify() {
434
436
  }
435
437
  }
436
438
  }
437
- return X(e), !0;
439
+ return Z(e), !0;
438
440
  }
439
- return e instanceof l && !St(e) || (r === "noscript" || r === "noembed" || r === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, e.innerHTML) ? (X(e), !0) : (k && e.nodeType === NODE_TYPE.text && (n = e.textContent, arrayForEach([
441
+ return e instanceof c && !xt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, e.innerHTML) ? (Z(e), !0) : (k && e.nodeType === NODE_TYPE.text && (n = e.textContent, arrayForEach([
440
442
  y,
441
443
  b,
442
444
  x
@@ -444,11 +446,11 @@ function createDOMPurify() {
444
446
  n = stringReplace(n, e, " ");
445
447
  }), e.textContent !== n && (arrayPush(t.removed, { element: e.cloneNode() }), e.textContent = n)), $(v.afterSanitizeElements, e, null), !1);
446
448
  }, Dt = function(e, t, r) {
447
- if (at && (t === "id" || t === "name") && (r in n || r in _t)) return !1;
449
+ if (at && (t === "id" || t === "name") && (r in n || r in gt)) return !1;
448
450
  if (!(O && !E[t] && regExpTest(Je, t)) && !(nt && regExpTest(Ye, t)) && !(D.attributeCheck instanceof Function && D.attributeCheck(t, e))) {
449
451
  if (!C[t] || E[t]) {
450
452
  if (!(Ot(e) && (w.tagNameCheck instanceof RegExp && regExpTest(w.tagNameCheck, e) || w.tagNameCheck instanceof Function && w.tagNameCheck(e)) && (w.attributeNameCheck instanceof RegExp && regExpTest(w.attributeNameCheck, t) || w.attributeNameCheck instanceof Function && w.attributeNameCheck(t, e)) || t === "is" && w.allowCustomizedBuiltInElements && (w.tagNameCheck instanceof RegExp && regExpTest(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r)))) return !1;
451
- } else if (!ut[t] && !regExpTest($e, stringReplace(r, Ze, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && stringIndexOf(r, "data:") === 0 && ct[e]) && !(rt && !regExpTest(Xe, stringReplace(r, Ze, ""))) && r) return !1;
453
+ } else if (!lt[t] && !regExpTest($e, stringReplace(r, Ze, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && stringIndexOf(r, "data:") === 0 && st[e]) && !(rt && !regExpTest(Xe, stringReplace(r, Ze, ""))) && r) return !1;
452
454
  }
453
455
  return !0;
454
456
  }, Ot = function(e) {
@@ -456,7 +458,7 @@ function createDOMPurify() {
456
458
  }, kt = function(e) {
457
459
  $(v.beforeSanitizeAttributes, e, null);
458
460
  let { attributes: n } = e;
459
- if (!n || Q(e)) return;
461
+ if (!n || wt(e)) return;
460
462
  let r = {
461
463
  attrName: "",
462
464
  attrValue: "",
@@ -465,22 +467,22 @@ function createDOMPurify() {
465
467
  forceKeepAttr: void 0
466
468
  }, i = n.length;
467
469
  for (; i--;) {
468
- let { name: a, namespaceURI: o, value: s } = n[i], c = J(a), l = s, u = a === "value" ? l : stringTrim(l);
469
- if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, $(v.uponSanitizeAttribute, e, r), u = r.attrValue, ot && (c === "id" || c === "name") && (Z(a, e), u = "user-content-" + u), A && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, u)) {
470
- Z(a, e);
470
+ let { name: a, namespaceURI: o, value: s } = n[i], c = Y(a), l = s, u = a === "value" ? l : stringTrim(l);
471
+ if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, $(v.uponSanitizeAttribute, e, r), u = r.attrValue, ot && (c === "id" || c === "name") && (Q(a, e), u = "user-content-" + u), A && regExpTest(/((--!?|])>)|<\/(style|title|textarea)/i, u)) {
472
+ Q(a, e);
471
473
  continue;
472
474
  }
473
475
  if (c === "attributename" && stringMatch(u, "href")) {
474
- Z(a, e);
476
+ Q(a, e);
475
477
  continue;
476
478
  }
477
479
  if (r.forceKeepAttr) continue;
478
480
  if (!r.keepAttr) {
479
- Z(a, e);
481
+ Q(a, e);
480
482
  continue;
481
483
  }
482
484
  if (!it && regExpTest(/\/>/i, u)) {
483
- Z(a, e);
485
+ Q(a, e);
484
486
  continue;
485
487
  }
486
488
  k && arrayForEach([
@@ -490,9 +492,9 @@ function createDOMPurify() {
490
492
  ], (e) => {
491
493
  u = stringReplace(u, e, " ");
492
494
  });
493
- let d = J(e.nodeName);
495
+ let d = Y(e.nodeName);
494
496
  if (!Dt(d, c, u)) {
495
- Z(a, e);
497
+ Q(a, e);
496
498
  continue;
497
499
  }
498
500
  if (h && typeof f == "object" && typeof f.getAttributeType == "function" && !o) switch (f.getAttributeType(d, c)) {
@@ -504,36 +506,36 @@ function createDOMPurify() {
504
506
  break;
505
507
  }
506
508
  if (u !== l) try {
507
- o ? e.setAttributeNS(o, a, u) : e.setAttribute(a, u), Q(e) ? X(e) : arrayPop(t.removed);
509
+ o ? e.setAttributeNS(o, a, u) : e.setAttribute(a, u), wt(e) ? Z(e) : arrayPop(t.removed);
508
510
  } catch {
509
- Z(a, e);
511
+ Q(a, e);
510
512
  }
511
513
  }
512
514
  $(v.afterSanitizeAttributes, e, null);
513
515
  }, At = function e(t) {
514
- let n = null, r = wt(t);
516
+ let n = null, r = Ct(t);
515
517
  for ($(v.beforeSanitizeShadowDOM, t, null); n = r.nextNode();) $(v.uponSanitizeShadowNode, n, null), Et(n), kt(n), n.content instanceof a && e(n.content);
516
518
  $(v.afterSanitizeShadowDOM, t, null);
517
519
  };
518
520
  return t.sanitize = function(e) {
519
- let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, s = null, l = null;
520
- if (ft = !e, ft && (e = "<!-->"), typeof e != "string" && !Tt(e)) if (typeof e.toString == "function") {
521
+ let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, c = null, l = null;
522
+ if (dt = !e, dt && (e = "<!-->"), typeof e != "string" && !Tt(e)) if (typeof e.toString == "function") {
521
523
  if (e = e.toString(), typeof e != "string") throw typeErrorCreate("dirty is not a string, aborting");
522
524
  } else throw typeErrorCreate("toString is not a function");
523
525
  if (!t.isSupported) return e;
524
- if (M || yt(n), t.removed = [], typeof e == "string" && (R = !1), R) {
526
+ if (M || vt(n), t.removed = [], typeof e == "string" && (R = !1), R) {
525
527
  if (e.nodeName) {
526
- let t = J(e.nodeName);
528
+ let t = Y(e.nodeName);
527
529
  if (!S[t] || T[t]) throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
528
530
  }
529
- } else if (e instanceof c) i = Ct("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === NODE_TYPE.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o);
531
+ } else if (e instanceof s) i = St("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === NODE_TYPE.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o);
530
532
  else {
531
533
  if (!P && !k && !j && e.indexOf("<") === -1) return h && I ? h.createHTML(e) : e;
532
- if (i = Ct(e), !i) return P ? null : I ? g : "";
534
+ if (i = St(e), !i) return P ? null : I ? g : "";
533
535
  }
534
- i && N && X(i.firstChild);
535
- let u = wt(R ? e : i);
536
- for (; s = u.nextNode();) Et(s), kt(s), s.content instanceof a && At(s.content);
536
+ i && N && Z(i.firstChild);
537
+ let u = Ct(R ? e : i);
538
+ for (; c = u.nextNode();) Et(c), kt(c), c.content instanceof a && At(c.content);
537
539
  if (R) return e;
538
540
  if (P) {
539
541
  if (F) for (l = Ge.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
@@ -549,11 +551,11 @@ function createDOMPurify() {
549
551
  d = stringReplace(d, e, " ");
550
552
  }), h && I ? h.createHTML(d) : d;
551
553
  }, t.setConfig = function() {
552
- yt(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), M = !0;
554
+ vt(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), M = !0;
553
555
  }, t.clearConfig = function() {
554
- Y = null, M = !1;
556
+ X = null, M = !1;
555
557
  }, t.isValidAttribute = function(e, t, n) {
556
- return Y || yt({}), Dt(J(e), J(t), n);
558
+ return X || vt({}), Dt(Y(e), Y(t), n);
557
559
  }, t.addHook = function(e, t) {
558
560
  typeof t == "function" && arrayPush(v[e], t);
559
561
  }, t.removeHook = function(e, t) {
@@ -568,7 +570,7 @@ function createDOMPurify() {
568
570
  v = _createHooksMap();
569
571
  }, t;
570
572
  }
571
- var purify = createDOMPurify(), ai_chat_module_default = ":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 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-ai-interaction-textarea{flex-grow:0;flex-shrink:0}:host{--ai-chat-background:var(--luzmo-background-color);--ai-chat-border-radius:0;--ai-chat-padding:0;--ai-chat-gap:1rem;--ai-chat-max-height:none;--ai-chat-messages-flex:1;--ai-chat-border:none;--ai-chat-box-shadow:none}";
573
+ var purify = createDOMPurify(), ai_chat_module_default = ":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 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-ai-interaction-textarea{flex-grow:0;flex-shrink:0}: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)}}:host{--ai-chat-background:var(--luzmo-background-color);--ai-chat-border-radius:0;--ai-chat-padding:0;--ai-chat-gap:1rem;--ai-chat-max-height:none;--ai-chat-messages-flex:1;--ai-chat-border:none;--ai-chat-box-shadow:none;--ai-chat-loading-message-color:var(--luzmo-primary);--ai-chat-error-message-color:var(--luzmo-danger,#dc3545)}";
572
574
  function buildAiMessageRequest(e) {
573
575
  let { prompt: t, datasetIds: n, authKey: r, authToken: i, conversationId: a, chart: o, modelPreference: s, apiVersion: c = "0.1.0" } = e;
574
576
  return {
@@ -598,7 +600,7 @@ function buildAiMessageRequest(e) {
598
600
  }
599
601
  var LuzmoAiChat = class extends LuzmoElement {
600
602
  constructor(...e) {
601
- super(...e), this.messages = [], this.selectedDatasets = [], this.placeholder = "Describe your change", this.disabled = !1, this.showAssistantContextMenu = !1, this.authKey = "", this.authToken = "", this.apiUrl = "https://api.luzmo.com", this.appServer = "https://app.luzmo.com", this.flagOpendata = !1, this.hideDatasetButton = !1, this.modelPreference = "performance", this.requestMode = "internal", this.isGenerating = !1, this.conversationId = null, this.chart = null, this.apiVersion = "0.1.0", this._isGeneratingInternal = !1, this._textareaValue = "";
603
+ super(...e), this.messages = [], this.selectedDatasets = [], this.placeholder = "Describe your change", this.disabled = !1, this.showAssistantContextMenu = !1, this.authKey = "", this.authToken = "", this.apiUrl = "https://api.luzmo.com", this.appServer = "https://app.luzmo.com", this.flagOpendata = !1, this.hideDatasetButton = !1, this.modelPreference = "performance", this.requestMode = "internal", this.isGenerating = !1, this.conversationId = null, this.chart = null, this.apiVersion = "0.1.0", this.loadingMessage = null, this._isGeneratingInternal = !1, this._textareaValue = "";
602
604
  }
603
605
  static {
604
606
  this.styles = unsafeCSS(ai_chat_module_default);
@@ -634,7 +636,7 @@ var LuzmoAiChat = class extends LuzmoElement {
634
636
  }
635
637
  return await n.json();
636
638
  }
637
- async _addUserMessage(e, t) {
639
+ _addUserMessage(e, t) {
638
640
  let n = {
639
641
  id: this._generateMessageId(),
640
642
  type: "user",
@@ -647,7 +649,7 @@ var LuzmoAiChat = class extends LuzmoElement {
647
649
  },
648
650
  bubbles: !0,
649
651
  composed: !0
650
- })), await this.updateComplete, this._scrollToBottom();
652
+ }));
651
653
  }
652
654
  _prepareForAIResponse() {
653
655
  this._isGeneratingInternal = !0;
@@ -692,14 +694,8 @@ var LuzmoAiChat = class extends LuzmoElement {
692
694
  _processAIResponse(e, t) {
693
695
  e.generatedChart === void 0 ? (e.functionResponse?.error !== void 0 || typeof e.functionResponse == "string" || e.clarificationQuestion === "string") && this._handleErrorResponse(e, t) : this._handleChartResponse(e, t);
694
696
  }
695
- _handleAPIError(e) {
696
- console.error("AI Chart Generation Error:", e);
697
- let t = {
698
- id: this._generateMessageId(),
699
- type: "ai",
700
- message: `${e instanceof Error ? e.message : "Unknown error"}`
701
- };
702
- this.messages = [...this.messages, t], this.dispatchEvent(new CustomEvent("luzmo-response-received", {
697
+ _handleAPIError(e, t) {
698
+ t.message = msg("Something went wrong. Please try again.", { desc: "Generic error message shown in ai chat when the API request fails" }), t.isError = !0, this.messages = [...this.messages.slice(0, -1), { ...t }], this.dispatchEvent(new CustomEvent("luzmo-response-received", {
703
699
  detail: {
704
700
  message: t,
705
701
  error: e
@@ -708,9 +704,6 @@ var LuzmoAiChat = class extends LuzmoElement {
708
704
  composed: !0
709
705
  }));
710
706
  }
711
- async _finalizeAIResponse() {
712
- this._isGeneratingInternal = !1, await this.updateComplete, this._scrollToBottom();
713
- }
714
707
  _handleDatasetSelected(e) {
715
708
  let t = e.detail;
716
709
  this.selectedDatasets.some((e) => e.id === t.id) || (this.selectedDatasets = [...this.selectedDatasets, t], this._emitDatasetsChanged());
@@ -728,7 +721,7 @@ var LuzmoAiChat = class extends LuzmoElement {
728
721
  }
729
722
  async _handlePromptSubmitted(e) {
730
723
  let { prompt: t, selectedDatasets: n } = e.detail, r = n.map((e) => e.id), i = this._buildRequestBody(t, r);
731
- if (await this._addUserMessage(t, n), this.requestMode === "external") {
724
+ if (this._addUserMessage(t, n), this.requestMode === "external") {
732
725
  let e = {
733
726
  prompt: t,
734
727
  selectedDatasets: n,
@@ -748,9 +741,9 @@ var LuzmoAiChat = class extends LuzmoElement {
748
741
  let e = await this._sendMessage(i);
749
742
  this._processAIResponse(e, a);
750
743
  } catch (e) {
751
- this._handleAPIError(e);
744
+ this._handleAPIError(e, a);
752
745
  } finally {
753
- await this._finalizeAIResponse();
746
+ this._isGeneratingInternal = !1;
754
747
  }
755
748
  }
756
749
  _scrollToBottom() {
@@ -761,6 +754,9 @@ var LuzmoAiChat = class extends LuzmoElement {
761
754
  });
762
755
  });
763
756
  }
757
+ updated(e) {
758
+ super.updated?.(e), e.has("messages") && this.updateComplete.then(() => this._scrollToBottom());
759
+ }
764
760
  _sanitizeMessage(e) {
765
761
  return purify.sanitize(e, {
766
762
  ALLOWED_TAGS: [
@@ -818,6 +814,7 @@ var LuzmoAiChat = class extends LuzmoElement {
818
814
  </luzmo-chat-message>
819
815
  ` : html`
820
816
  <luzmo-chat-message
817
+ class=${e.isError ? "error" : ""}
821
818
  avatar-placement="bottom"
822
819
  position="left"
823
820
  quiet
@@ -827,12 +824,45 @@ var LuzmoAiChat = class extends LuzmoElement {
827
824
  </luzmo-chat-message>
828
825
  `);
829
826
  }
827
+ _renderLoadingMessage() {
828
+ return this.isGenerating || this._isGeneratingInternal ? html`
829
+ <luzmo-chat-message
830
+ avatar-placement="bottom"
831
+ position="left"
832
+ quiet
833
+ size="s"
834
+ >
835
+ <div class="loading-message">
836
+ <span class="icon-lg">${luzmoIcon(luzmoSpin, { className: "spin" })}</span>
837
+ <span class="loading-message-text">${this.loadingMessage || (this.chart?.type === "placeholder" ? msg("Creating item...", { desc: "Label for ai chat creating item message" }) : msg("Updating item...", { desc: "Label for ai chat updating item message" }))}</span>
838
+ </div>
839
+ </luzmo-chat-message>
840
+ ` : html`
841
+
842
+ `;
843
+ }
844
+ _renderPlaceholderMessage() {
845
+ return this.messages.length > 0 ? html`
846
+
847
+ ` : html`
848
+ <luzmo-chat-message
849
+ avatar-placement="bottom"
850
+ position="left"
851
+ quiet
852
+ size="s"
853
+ >
854
+ ${msg("Describe how you want to edit this item…", { desc: "Label for ai chat placeholder message" })}
855
+ </luzmo-chat-message>
856
+ `;
857
+ }
830
858
  render() {
831
859
  let e = this.requestMode === "external" ? this.isGenerating : this._isGeneratingInternal;
832
860
  return html`
833
861
  <div class="chat-container">
834
862
  <div class="chat-messages-container">
863
+ ${this._renderPlaceholderMessage()}
835
864
  ${this._renderMessages()}
865
+ ${this._renderLoadingMessage()}
836
866
  </div>
837
867
 
838
868
  <luzmo-ai-interaction-textarea
@@ -900,5 +930,8 @@ __decorate([property({ type: Array })], LuzmoAiChat.prototype, "messages", void
900
930
  })], LuzmoAiChat.prototype, "chart", void 0), __decorate([property({
901
931
  type: String,
902
932
  attribute: "api-version"
903
- })], LuzmoAiChat.prototype, "apiVersion", void 0), __decorate([state()], LuzmoAiChat.prototype, "_isGeneratingInternal", void 0), __decorate([state()], LuzmoAiChat.prototype, "_textareaValue", void 0), customElements.get("luzmo-ai-chat") || customElements.define("luzmo-ai-chat", LuzmoAiChat);
933
+ })], LuzmoAiChat.prototype, "apiVersion", void 0), __decorate([property({
934
+ type: String,
935
+ attribute: "loading-message"
936
+ })], LuzmoAiChat.prototype, "loadingMessage", void 0), __decorate([state()], LuzmoAiChat.prototype, "_isGeneratingInternal", void 0), __decorate([state()], LuzmoAiChat.prototype, "_textareaValue", void 0), customElements.get("luzmo-ai-chat") || customElements.define("luzmo-ai-chat", LuzmoAiChat);
904
937
  export { buildAiMessageRequest as n, LuzmoAiChat as t };