@luzmo/analytics-components-kit 1.0.1-alpha.143 → 1.0.1-alpha.145
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.
- package/angular/esm/types/ai-chat.types.d.ts +4 -0
- package/angular/tsconfig.json +3 -0
- package/angular/types/ai-chat.types.ts +6 -0
- package/components/ai-chat/ai-chat-streaming.d.ts +14 -0
- package/components/ai-chat/ai-chat.d.ts +37 -5
- package/components/ai-chat/index.cjs +1 -1
- package/components/ai-chat/index.d.ts +3 -0
- package/components/ai-chat/index.js +6 -6
- package/components/ai-chat/request-contract.d.ts +1 -0
- package/components/ai-chat-BGgOjOjv.cjs +113 -0
- package/components/{ai-chat-CvRO-iWK.js → ai-chat-DreqkkBA.js} +260 -103
- package/components/ai-interaction-textarea/index.cjs +1 -1
- package/components/ai-interaction-textarea/index.js +3 -3
- package/components/data-fields-select/index.cjs +1 -1
- package/components/data-fields-select/index.js +3 -3
- package/components/{data-fields-select-Dc1pByjy.js → data-fields-select-CHOKEMb2.js} +1 -1
- package/components/{data-fields-select-BB9jMIZt.cjs → data-fields-select-_WjjNpcl.cjs} +1 -1
- package/components/dataset-selector-list/index.cjs +1 -1
- package/components/dataset-selector-list/index.js +2 -2
- package/components/{dataset-selector-list-DlXb_jK4.js → dataset-selector-list-C5FvwP-r.js} +1 -1
- package/components/{dataset-selector-list-CFdVv3iN.cjs → dataset-selector-list-DYsi3LBF.cjs} +1 -1
- package/components/dataset-selector-row/index.cjs +1 -1
- package/components/dataset-selector-row/index.js +3 -3
- package/components/{dataset-selector-row-Bxu3lzqR.js → dataset-selector-row-BKIFTyJl.js} +1 -1
- package/components/{dataset-selector-row-Bsq7KGfS.cjs → dataset-selector-row-Qwz9WmR4.cjs} +1 -1
- package/components/{de-DURun-dA.js → de-DOhCpte6.js} +5 -5
- package/components/de-DR0saUbU.cjs +20 -0
- package/components/display-settings/index.cjs +1 -1
- package/components/display-settings/index.js +2 -2
- package/components/display-settings-binning/index.cjs +1 -1
- package/components/display-settings-binning/index.js +3 -3
- package/components/{display-settings-binning-CJSWcOkS.js → display-settings-binning-B58LCqmn.js} +1 -1
- package/components/{display-settings-binning-BkPQ6M08.cjs → display-settings-binning-Bte25mmH.cjs} +1 -1
- package/components/display-settings-datetime/index.cjs +1 -1
- package/components/display-settings-datetime/index.js +3 -3
- package/components/{display-settings-datetime-HErjCVVJ.cjs → display-settings-datetime-DAL8zjtk.cjs} +1 -1
- package/components/{display-settings-datetime-iI-W9K_T.js → display-settings-datetime-DxSNsem7.js} +1 -1
- package/components/display-settings-grand-totals/index.cjs +1 -1
- package/components/display-settings-grand-totals/index.js +3 -3
- package/components/{display-settings-grand-totals-CeOhzDtp.cjs → display-settings-grand-totals-NWow1vhX.cjs} +1 -1
- package/components/{display-settings-grand-totals-D-BMS_hC.js → display-settings-grand-totals-Poa2qL3U.js} +1 -1
- package/components/display-settings-numeric/index.cjs +1 -1
- package/components/display-settings-numeric/index.js +3 -3
- package/components/{display-settings-numeric-pc4CUJWx.js → display-settings-numeric-CTaS1NhY.js} +1 -1
- package/components/{display-settings-numeric-D3cQ5CNK.cjs → display-settings-numeric-eG0gr9Jn.cjs} +1 -1
- package/components/display-settings-period-over-period/index.cjs +1 -1
- package/components/display-settings-period-over-period/index.js +3 -3
- package/components/{display-settings-period-over-period-Cazylizf.js → display-settings-period-over-period-D9r-6vbW.js} +1 -1
- package/components/{display-settings-period-over-period-lYLbMfrq.cjs → display-settings-period-over-period-DjB0K-Zj.cjs} +1 -1
- package/components/draggable-data-field/index.cjs +1 -1
- package/components/draggable-data-field/index.js +3 -3
- package/components/{draggable-data-field-BAZsLoRm.js → draggable-data-field-BIWzuhyP.js} +1 -1
- package/components/{draggable-data-field-uCJzFo7I.cjs → draggable-data-field-Cez4-c6O.cjs} +1 -1
- package/components/draggable-data-field-level/index.cjs +1 -1
- package/components/draggable-data-field-level/index.js +2 -2
- package/components/draggable-data-fields-panel/index.cjs +1 -1
- package/components/draggable-data-fields-panel/index.js +4 -4
- package/components/{draggable-data-fields-panel-Bu5H_7MY.cjs → draggable-data-fields-panel-B0DzaGsv.cjs} +1 -1
- package/components/{draggable-data-fields-panel-C5NIJ12I.js → draggable-data-fields-panel-C3IwyVQh.js} +1 -1
- package/components/droppable-slot/index.cjs +1 -1
- package/components/droppable-slot/index.js +3 -3
- package/components/{droppable-slot-CMWxuHys.js → droppable-slot-BEKnuzJd.js} +1 -1
- package/components/{droppable-slot-Chxv3_Va.cjs → droppable-slot-CHtF9RZo.cjs} +1 -1
- package/components/edit-filters/index.cjs +1 -1
- package/components/edit-filters/index.js +10 -10
- package/components/{edit-filters-wgGKeSp-.js → edit-filters-BHiGSnrn.js} +6 -15
- package/components/{edit-filters-lNJfW7v6.cjs → edit-filters-CoVNGAfA.cjs} +3 -13
- package/components/edit-item/index.cjs +1 -1
- package/components/edit-item/index.js +2 -2
- package/components/edit-option/index.cjs +1 -1
- package/components/edit-option/index.js +2 -2
- package/components/edit-option-action-button-group/index.cjs +1 -1
- package/components/edit-option-action-button-group/index.js +2 -2
- package/components/edit-option-color-palette-picker/index.cjs +1 -1
- package/components/edit-option-color-palette-picker/index.js +2 -2
- package/components/edit-option-color-picker/index.cjs +1 -1
- package/components/edit-option-color-picker/index.js +2 -2
- package/components/edit-option-color-range/index.cjs +1 -1
- package/components/edit-option-color-range/index.js +2 -2
- package/components/edit-option-multi-language-field/index.cjs +1 -1
- package/components/edit-option-multi-language-field/index.js +2 -2
- package/components/edit-option-number-field/index.cjs +1 -1
- package/components/edit-option-number-field/index.js +2 -2
- package/components/edit-option-picker/index.cjs +1 -1
- package/components/edit-option-picker/index.js +2 -2
- package/components/edit-option-position-picker/index.cjs +1 -1
- package/components/edit-option-position-picker/index.js +2 -2
- package/components/edit-option-positions-number-field/index.cjs +1 -1
- package/components/edit-option-positions-number-field/index.js +2 -2
- package/components/edit-option-radio-button-group/index.cjs +1 -1
- package/components/edit-option-radio-button-group/index.js +2 -2
- package/components/edit-option-slider/index.cjs +1 -1
- package/components/edit-option-slider/index.js +2 -2
- package/components/edit-option-switch/index.cjs +1 -1
- package/components/edit-option-switch/index.js +2 -2
- package/components/edit-option-text-field/index.cjs +1 -1
- package/components/edit-option-text-field/index.js +2 -2
- package/components/{es-Dkzx8miN.js → es-CjgYaJJY.js} +6 -5
- package/components/es-D8zLt69A.cjs +20 -0
- package/components/filter-expression-picker/index.cjs +1 -1
- package/components/filter-expression-picker/index.js +3 -3
- package/components/{filter-expression-picker-B4x6ubd5.js → filter-expression-picker-Bbu8Bd25.js} +1 -1
- package/components/{filter-expression-picker-BP78A8JD.cjs → filter-expression-picker-Dc3K44W0.cjs} +1 -1
- package/components/filter-item/index.cjs +1 -1
- package/components/filter-item/index.js +9 -9
- package/components/{filter-item-DCVew0eE.cjs → filter-item-C7i8LLr-.cjs} +1 -1
- package/components/{filter-item-fLvnKrE1.js → filter-item-DmzZL5Wr.js} +2 -2
- package/components/filter-value-picker/index.cjs +1 -1
- package/components/filter-value-picker/index.js +6 -6
- package/components/{filter-value-picker-BPC88xE_.cjs → filter-value-picker-CwQLOgTl.cjs} +1 -1
- package/components/{filter-value-picker-CLajA3W8.js → filter-value-picker-Vq-PfjoU.js} +1 -1
- package/components/filter-value-picker-datetime/index.cjs +1 -1
- package/components/filter-value-picker-datetime/index.js +3 -3
- package/components/{filter-value-picker-datetime-C_tPd_73.cjs → filter-value-picker-datetime-By3czRqA.cjs} +1 -1
- package/components/{filter-value-picker-datetime-DP4M57KA.js → filter-value-picker-datetime-Cf60JAgg.js} +1 -1
- package/components/filter-value-picker-hierarchy/index.cjs +1 -1
- package/components/filter-value-picker-hierarchy/index.js +3 -3
- package/components/{filter-value-picker-hierarchy-CowyNbHg.js → filter-value-picker-hierarchy-CL1YmeY9.js} +1 -1
- package/components/{filter-value-picker-hierarchy-BRID5j_G.cjs → filter-value-picker-hierarchy-CpvItjbb.cjs} +1 -1
- package/components/filter-value-picker-numeric/index.cjs +1 -1
- package/components/filter-value-picker-numeric/index.js +3 -3
- package/components/{filter-value-picker-numeric-D8MiGBfv.js → filter-value-picker-numeric-CDUGCKAy.js} +1 -1
- package/components/{filter-value-picker-numeric-BgMq1FT5.cjs → filter-value-picker-numeric-Dq143AGo.cjs} +1 -1
- package/components/fr-DKJHfJgy.cjs +20 -0
- package/components/{fr-BxxnKM9J.js → fr-x3aFvlKk.js} +5 -5
- package/components/grid/index.cjs +1 -1
- package/components/grid/index.js +3 -3
- package/components/{grid-1ZLTyUUM.cjs → grid-By5MAIqI.cjs} +9 -8
- package/components/{grid-Dka6HAFu.js → grid-DN9I7DDY.js} +9 -8
- package/components/index.cjs +1 -1
- package/components/index.js +27 -27
- package/components/item-data-drop-panel/index.cjs +1 -1
- package/components/item-data-drop-panel/index.js +4 -4
- package/components/{item-data-drop-panel-DCdT8u3S.js → item-data-drop-panel-hXvAIkBq.js} +1 -1
- package/components/{item-data-drop-panel-BNQmmouC.cjs → item-data-drop-panel-jxlsaggu.cjs} +1 -1
- package/components/item-data-picker-panel/index.cjs +1 -1
- package/components/item-data-picker-panel/index.js +5 -5
- package/components/{item-data-picker-panel-D8YWBbZZ.js → item-data-picker-panel-C7wyaWko.js} +1 -1
- package/components/{item-data-picker-panel-DOsGE-Xc.cjs → item-data-picker-panel-sWJGFZ7e.cjs} +1 -1
- package/components/{localized-mixin-Cxbtsznk.cjs → localized-mixin-BhUvOsd7.cjs} +1 -1
- package/components/{localized-mixin-DluVAteK.js → localized-mixin-HngLqDZn.js} +1 -1
- package/components/{nl-DDQ-Saw3.js → nl-Cv7QXh6s.js} +5 -5
- package/components/nl-DtxDWOXH.cjs +20 -0
- package/components/{set-locale-DmVKN5NY.js → set-locale-C3o6ooUV.js} +4 -4
- package/components/{set-locale-BbhzBfZV.cjs → set-locale-CdlBx8s9.cjs} +1 -1
- package/components/slot-contents-picker/index.cjs +1 -1
- package/components/slot-contents-picker/index.js +4 -4
- package/components/{slot-contents-picker--QucgYkS.js → slot-contents-picker-G3JVFgG1.js} +1 -1
- package/components/{slot-contents-picker-CQQuh9fg.cjs → slot-contents-picker-vO7GDwhF.cjs} +1 -1
- package/components/slot-menu/index.cjs +1 -1
- package/components/slot-menu/index.js +2 -2
- package/components/slot-menu-list/index.cjs +1 -1
- package/components/slot-menu-list/index.js +2 -2
- package/components/utils/base.cjs +1 -1
- package/components/utils/base.js +2 -2
- package/components/utils.cjs +1 -1
- package/components/utils.js +1 -1
- package/components/viz-item-menu/index.cjs +1 -1
- package/components/viz-item-menu/index.js +3 -3
- package/components/{viz-item-menu-CO7XfqyI.js → viz-item-menu-BX_S-XUm.js} +1 -1
- package/components/{viz-item-menu-BZp_MMRO.cjs → viz-item-menu-CGhptlJg.cjs} +1 -1
- package/custom-elements.json +173 -10
- package/package.json +1 -1
- package/types/ai-chat.types.d.ts +4 -0
- package/components/ai-chat-Boiu1Zce.cjs +0 -89
- package/components/de-D71oQ28U.cjs +0 -20
- package/components/es-BVpCQVYE.cjs +0 -20
- package/components/fr-DW5eOlYL.cjs +0 -20
- package/components/nl-CNyDzCqx.cjs +0 -20
|
@@ -22,7 +22,8 @@ import { t as __decorate } from "./decorate-Da6S_xrw.js";
|
|
|
22
22
|
import { msg } from "@lit/localize/lit-localize";
|
|
23
23
|
import { luzmoIcon, luzmoSpin } from "@luzmo/icons";
|
|
24
24
|
import "@luzmo/lucero/chat-message";
|
|
25
|
-
import
|
|
25
|
+
import "@luzmo/lucero/progress-steps";
|
|
26
|
+
import { html, nothing, unsafeCSS } from "lit";
|
|
26
27
|
import { property, state } from "lit/decorators.js";
|
|
27
28
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
28
29
|
var { entries, setPrototypeOf, isFrozen, getPrototypeOf, getOwnPropertyDescriptor } = Object, { freeze, seal, create } = Object, { apply, construct } = typeof Reflect < "u" && Reflect;
|
|
@@ -217,7 +218,7 @@ var html$1 = freeze(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.a
|
|
|
217
218
|
function createDOMPurify() {
|
|
218
219
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal(), t = (e) => createDOMPurify(e);
|
|
219
220
|
if (t.version = "3.3.1", t.removed = [], !e || !e.document || e.document.nodeType !== NODE_TYPE.document || !e.Element) return t.isSupported = !1, t;
|
|
220
|
-
let { document: n } = e, r = n, i = r.currentScript, { DocumentFragment: a, HTMLTemplateElement: o, Node: s, Element: c, NodeFilter: l, NamedNodeMap:
|
|
221
|
+
let { document: n } = e, r = n, i = r.currentScript, { DocumentFragment: a, HTMLTemplateElement: o, Node: s, Element: c, NodeFilter: l, NamedNodeMap: u = 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");
|
|
221
222
|
if (typeof o == "function") {
|
|
222
223
|
let e = n.createElement("template");
|
|
223
224
|
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
@@ -267,7 +268,7 @@ function createDOMPurify() {
|
|
|
267
268
|
enumerable: !0,
|
|
268
269
|
value: null
|
|
269
270
|
}
|
|
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,
|
|
271
|
+
})), 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, st = !0, L = !1, R = {}, z = null, B = addToSet({}, [
|
|
271
272
|
"annotation-xml",
|
|
272
273
|
"audio",
|
|
273
274
|
"colgroup",
|
|
@@ -293,14 +294,14 @@ function createDOMPurify() {
|
|
|
293
294
|
"title",
|
|
294
295
|
"video",
|
|
295
296
|
"xmp"
|
|
296
|
-
]),
|
|
297
|
+
]), ct = null, lt = addToSet({}, [
|
|
297
298
|
"audio",
|
|
298
299
|
"video",
|
|
299
300
|
"img",
|
|
300
301
|
"source",
|
|
301
302
|
"image",
|
|
302
303
|
"track"
|
|
303
|
-
]),
|
|
304
|
+
]), V = null, ut = addToSet({}, [
|
|
304
305
|
"alt",
|
|
305
306
|
"class",
|
|
306
307
|
"for",
|
|
@@ -336,7 +337,7 @@ function createDOMPurify() {
|
|
|
336
337
|
}, vt = function() {
|
|
337
338
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
338
339
|
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,
|
|
340
|
+
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, V = objectHasOwnProperty(e, "ADD_URI_SAFE_ATTR") ? addToSet(clone(ut), e.ADD_URI_SAFE_ATTR, Y) : ut, ct = objectHasOwnProperty(e, "ADD_DATA_URI_TAGS") ? addToSet(clone(lt), e.ADD_DATA_URI_TAGS, Y) : lt, z = objectHasOwnProperty(e, "FORBID_CONTENTS") ? addToSet({}, e.FORBID_CONTENTS, Y) : B, T = objectHasOwnProperty(e, "FORBID_TAGS") ? addToSet({}, e.FORBID_TAGS, Y) : clone({}), E = objectHasOwnProperty(e, "FORBID_ATTR") ? addToSet({}, e.FORBID_ATTR, Y) : clone({}), R = 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, st = e.KEEP_CONTENT !== !1, L = 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), R && (S = addToSet({}, text), C = [], R.html === !0 && (addToSet(S, html$1), addToSet(C, html$2)), R.svg === !0 && (addToSet(S, svg$1), addToSet(C, svg), addToSet(C, xml)), R.svgFilters === !0 && (addToSet(S, svgFilters), addToSet(C, svg), addToSet(C, xml)), R.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(V, e.ADD_URI_SAFE_ATTR, Y), e.FORBID_CONTENTS && (z === B && (z = clone(z)), addToSet(z, e.FORBID_CONTENTS, Y)), e.ADD_FORBID_CONTENTS && (z === B && (z = clone(z)), addToSet(z, e.ADD_FORBID_CONTENTS, Y)), st && (S["#text"] = !0), j && addToSet(S, [
|
|
340
341
|
"html",
|
|
341
342
|
"head",
|
|
342
343
|
"body"
|
|
@@ -407,7 +408,7 @@ function createDOMPurify() {
|
|
|
407
408
|
}, Ct = function(e) {
|
|
408
409
|
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);
|
|
409
410
|
}, wt = function(e) {
|
|
410
|
-
return e instanceof Re && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof
|
|
411
|
+
return e instanceof Re && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof u) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
|
|
411
412
|
}, Tt = function(e) {
|
|
412
413
|
return typeof s == "function" && e instanceof s;
|
|
413
414
|
};
|
|
@@ -426,7 +427,7 @@ function createDOMPurify() {
|
|
|
426
427
|
}), 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;
|
|
427
428
|
if (!(D.tagCheck instanceof Function && D.tagCheck(r)) && (!S[r] || T[r])) {
|
|
428
429
|
if (!T[r] && Ot(r) && (w.tagNameCheck instanceof RegExp && regExpTest(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r))) return !1;
|
|
429
|
-
if (
|
|
430
|
+
if (st && !z[r]) {
|
|
430
431
|
let t = m(e) || e.parentNode, n = Ue(e) || e.childNodes;
|
|
431
432
|
if (n && t) {
|
|
432
433
|
let r = n.length;
|
|
@@ -450,7 +451,7 @@ function createDOMPurify() {
|
|
|
450
451
|
if (!(O && !E[t] && regExpTest(Je, t)) && !(nt && regExpTest(Ye, t)) && !(D.attributeCheck instanceof Function && D.attributeCheck(t, e))) {
|
|
451
452
|
if (!C[t] || E[t]) {
|
|
452
453
|
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;
|
|
453
|
-
} else if (!
|
|
454
|
+
} else if (!V[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;
|
|
454
455
|
}
|
|
455
456
|
return !0;
|
|
456
457
|
}, Ot = function(e) {
|
|
@@ -523,7 +524,7 @@ function createDOMPurify() {
|
|
|
523
524
|
if (e = e.toString(), typeof e != "string") throw typeErrorCreate("dirty is not a string, aborting");
|
|
524
525
|
} else throw typeErrorCreate("toString is not a function");
|
|
525
526
|
if (!t.isSupported) return e;
|
|
526
|
-
if (M || vt(n), t.removed = [], typeof e == "string" && (
|
|
527
|
+
if (M || vt(n), t.removed = [], typeof e == "string" && (L = !1), L) {
|
|
527
528
|
if (e.nodeName) {
|
|
528
529
|
let t = Y(e.nodeName);
|
|
529
530
|
if (!S[t] || T[t]) throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
|
|
@@ -534,9 +535,9 @@ function createDOMPurify() {
|
|
|
534
535
|
if (i = St(e), !i) return P ? null : I ? g : "";
|
|
535
536
|
}
|
|
536
537
|
i && N && Z(i.firstChild);
|
|
537
|
-
let u = Ct(
|
|
538
|
+
let u = Ct(L ? e : i);
|
|
538
539
|
for (; c = u.nextNode();) Et(c), kt(c), c.content instanceof a && At(c.content);
|
|
539
|
-
if (
|
|
540
|
+
if (L) return e;
|
|
540
541
|
if (P) {
|
|
541
542
|
if (F) for (l = Ge.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
|
|
542
543
|
else l = i;
|
|
@@ -570,7 +571,67 @@ function createDOMPurify() {
|
|
|
570
571
|
v = _createHooksMap();
|
|
571
572
|
}, t;
|
|
572
573
|
}
|
|
573
|
-
var purify = createDOMPurify()
|
|
574
|
+
var purify = createDOMPurify();
|
|
575
|
+
function createInitialProgress() {
|
|
576
|
+
return {
|
|
577
|
+
id: "root",
|
|
578
|
+
step: "root",
|
|
579
|
+
status: "pending",
|
|
580
|
+
children: [{
|
|
581
|
+
id: "client-init",
|
|
582
|
+
step: "iqInit",
|
|
583
|
+
status: "inProgress",
|
|
584
|
+
description: "Thinking"
|
|
585
|
+
}]
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
function hasProgressChunk(e) {
|
|
589
|
+
let t = e.progress;
|
|
590
|
+
return typeof t != "object" || !t ? !1 : "id" in t && "step" in t && "status" in t;
|
|
591
|
+
}
|
|
592
|
+
async function fetchStreamingResponse(e) {
|
|
593
|
+
let t = await fetch(e.url, {
|
|
594
|
+
method: "POST",
|
|
595
|
+
headers: { "Content-Type": "application/json" },
|
|
596
|
+
mode: "cors",
|
|
597
|
+
body: JSON.stringify(e.body),
|
|
598
|
+
signal: e.signal
|
|
599
|
+
});
|
|
600
|
+
if (!t.ok) {
|
|
601
|
+
let e = await t.json().catch(() => null);
|
|
602
|
+
throw Error(e?.message || `API request failed with status ${t.status}`);
|
|
603
|
+
}
|
|
604
|
+
if (!t.body) throw Error("Response body is not readable");
|
|
605
|
+
return {
|
|
606
|
+
body: t.body,
|
|
607
|
+
conversationId: t.headers.get("x-conversation-id")
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
async function readNdjsonStream(e, t) {
|
|
611
|
+
let n = e.getReader(), r = new TextDecoder(), i = "";
|
|
612
|
+
try {
|
|
613
|
+
for (;;) {
|
|
614
|
+
let { done: e, value: a } = await n.read();
|
|
615
|
+
if (e) break;
|
|
616
|
+
i += r.decode(a, { stream: !0 });
|
|
617
|
+
let o = i.split("\n");
|
|
618
|
+
i = o.pop() ?? "";
|
|
619
|
+
for (let e of o) if (e.trim()) try {
|
|
620
|
+
t(JSON.parse(e));
|
|
621
|
+
} catch {
|
|
622
|
+
console.error("Failed to parse NDJSON line:", e);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
if (i += r.decode(), i.trim()) try {
|
|
626
|
+
t(JSON.parse(i));
|
|
627
|
+
} catch {
|
|
628
|
+
console.error("Failed to parse final NDJSON buffer:", i);
|
|
629
|
+
}
|
|
630
|
+
} finally {
|
|
631
|
+
n.releaseLock();
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
var 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 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)}}: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)}";
|
|
574
635
|
function buildAiMessageRequest(e) {
|
|
575
636
|
let { prompt: t, datasetIds: n, authKey: r, authToken: i, conversationId: a, chart: o, modelPreference: s, apiVersion: c = "0.1.0" } = e;
|
|
576
637
|
return {
|
|
@@ -587,9 +648,11 @@ function buildAiMessageRequest(e) {
|
|
|
587
648
|
},
|
|
588
649
|
options: {
|
|
589
650
|
available_datasets: n,
|
|
651
|
+
stream: !0,
|
|
590
652
|
...n.length > 0 ? { dataset_id: n[0] } : {},
|
|
591
|
-
...o ? { chart: {
|
|
653
|
+
...o && o.type !== "placeholder" ? { chart: {
|
|
592
654
|
...o,
|
|
655
|
+
version: o.version || "",
|
|
593
656
|
title: o.title || o.options.title,
|
|
594
657
|
filters: o.filterGroups || [],
|
|
595
658
|
aichartId: o.aichartId || ""
|
|
@@ -600,7 +663,7 @@ function buildAiMessageRequest(e) {
|
|
|
600
663
|
}
|
|
601
664
|
var LuzmoAiChat = class extends LuzmoElement {
|
|
602
665
|
constructor(...e) {
|
|
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 = "";
|
|
666
|
+
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.initialPrompt = null, this.progress = null, this.progressCollapsed = !1, this._progress = null, this._progressCollapsed = !1, this._isGeneratingInternal = !1, this._textareaValue = "", this._abortController = null, this._inflightAiMessage = null, this._lastProcessedInitialPrompt = null, this._receivedProgress = !1;
|
|
604
667
|
}
|
|
605
668
|
static {
|
|
606
669
|
this.styles = unsafeCSS(ai_chat_module_default);
|
|
@@ -623,18 +686,71 @@ var LuzmoAiChat = class extends LuzmoElement {
|
|
|
623
686
|
apiVersion: this.apiVersion
|
|
624
687
|
});
|
|
625
688
|
}
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
689
|
+
_finalizeInflightMessage() {
|
|
690
|
+
this._inflightAiMessage &&= (this._progress && this._receivedProgress && (this._inflightAiMessage.progress = structuredClone(this._progress), this._updateMessage(this._inflightAiMessage)), this._progress = null, this._progressCollapsed = !1, this._receivedProgress = !1, null);
|
|
691
|
+
}
|
|
692
|
+
async _sendStreamingMessage(e, t) {
|
|
693
|
+
this._abortController && (this._abortController.abort(), this._inflightAiMessage && !this._inflightAiMessage.message && (this.messages = this.messages.filter((e) => e.id !== this._inflightAiMessage.id))), this._finalizeInflightMessage(), this._inflightAiMessage = t;
|
|
694
|
+
let n = new AbortController();
|
|
695
|
+
this._abortController = n, this._progress = createInitialProgress(), this._progressCollapsed = !1, this._receivedProgress = !1;
|
|
696
|
+
let r = !1;
|
|
697
|
+
try {
|
|
698
|
+
let { body: i, conversationId: a } = await fetchStreamingResponse({
|
|
699
|
+
url: `${this.apiUrl}/${this.apiVersion}/aimessage`,
|
|
700
|
+
body: e,
|
|
701
|
+
signal: n.signal
|
|
702
|
+
});
|
|
703
|
+
a && (this.conversationId = a), await readNdjsonStream(i, (e) => this._processStreamChunk(e, t)), r = !0;
|
|
704
|
+
} finally {
|
|
705
|
+
this._abortController === n && (r ? this._finalizeInflightMessage() : this._inflightAiMessage = null, this._isGeneratingInternal = !1, this._abortController = null);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
_processStreamChunk(e, t) {
|
|
709
|
+
if (hasProgressChunk(e) && (this._receivedProgress = !0, this._progress = e.progress), e.error) {
|
|
710
|
+
t.message = e.error, t.isError = !0, this._updateMessage(t), this._progress = null, this._progressCollapsed = !1, this.dispatchEvent(new CustomEvent("luzmo-response-received", {
|
|
711
|
+
detail: {
|
|
712
|
+
message: t,
|
|
713
|
+
done: !0
|
|
714
|
+
},
|
|
715
|
+
bubbles: !0,
|
|
716
|
+
composed: !0
|
|
717
|
+
}));
|
|
718
|
+
return;
|
|
636
719
|
}
|
|
637
|
-
|
|
720
|
+
let n = e.chart ?? e.generatedChart;
|
|
721
|
+
if (n) {
|
|
722
|
+
let r = {
|
|
723
|
+
...e,
|
|
724
|
+
generatedChart: n,
|
|
725
|
+
conversationId: this.conversationId
|
|
726
|
+
};
|
|
727
|
+
this.dispatchEvent(new CustomEvent("luzmo-chart-generated", {
|
|
728
|
+
detail: { aiSampleChart: r },
|
|
729
|
+
bubbles: !0,
|
|
730
|
+
composed: !0
|
|
731
|
+
}));
|
|
732
|
+
let i = typeof e.chunk == "string" && e.chunk || typeof e.message == "string" && e.message;
|
|
733
|
+
i && (t.message = (t.message || "") + i), this._updateMessage(t), (e.done || "question" in e) && (this._progressCollapsed = !0, t.message && this.dispatchEvent(new CustomEvent("luzmo-response-received", {
|
|
734
|
+
detail: {
|
|
735
|
+
message: t,
|
|
736
|
+
done: !0
|
|
737
|
+
},
|
|
738
|
+
bubbles: !0,
|
|
739
|
+
composed: !0
|
|
740
|
+
})));
|
|
741
|
+
return;
|
|
742
|
+
}
|
|
743
|
+
let r = typeof e.chunk == "string" && e.chunk || typeof e.message == "string" && e.message || "";
|
|
744
|
+
r && (this._progressCollapsed ||= !0, t.message = (t.message || "") + r, this._updateMessage(t));
|
|
745
|
+
let i = e.done || "question" in e;
|
|
746
|
+
i && (this._progressCollapsed = !0), (r || i && t.message) && this.dispatchEvent(new CustomEvent("luzmo-response-received", {
|
|
747
|
+
detail: {
|
|
748
|
+
message: t,
|
|
749
|
+
done: !!i
|
|
750
|
+
},
|
|
751
|
+
bubbles: !0,
|
|
752
|
+
composed: !0
|
|
753
|
+
}));
|
|
638
754
|
}
|
|
639
755
|
_addUserMessage(e, t) {
|
|
640
756
|
let n = {
|
|
@@ -651,6 +767,9 @@ var LuzmoAiChat = class extends LuzmoElement {
|
|
|
651
767
|
composed: !0
|
|
652
768
|
}));
|
|
653
769
|
}
|
|
770
|
+
_updateMessage(e) {
|
|
771
|
+
this.messages = this.messages.map((t) => t.id === e.id ? { ...e } : t);
|
|
772
|
+
}
|
|
654
773
|
_prepareForAIResponse() {
|
|
655
774
|
this._isGeneratingInternal = !0;
|
|
656
775
|
let e = {
|
|
@@ -660,48 +779,20 @@ var LuzmoAiChat = class extends LuzmoElement {
|
|
|
660
779
|
};
|
|
661
780
|
return this.messages = [...this.messages, e], e;
|
|
662
781
|
}
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
})));
|
|
678
|
-
}
|
|
679
|
-
_handleErrorResponse(e, t) {
|
|
680
|
-
let n = null;
|
|
681
|
-
if (e.functionResponse?.error) {
|
|
682
|
-
let t = e.functionResponse.explanation;
|
|
683
|
-
t && typeof t == "string" && (n = e.functionResponse.explanation);
|
|
684
|
-
} else n = e.functionResponse;
|
|
685
|
-
n ||= e.message || e.error || e.clarificationQuestion || null, n && (t.message = n, this.messages = [...this.messages.slice(0, -1), { ...t }]), this.dispatchEvent(new CustomEvent("luzmo-response-received", {
|
|
686
|
-
detail: {
|
|
687
|
-
message: t,
|
|
688
|
-
done: !0
|
|
689
|
-
},
|
|
690
|
-
bubbles: !0,
|
|
691
|
-
composed: !0
|
|
692
|
-
}));
|
|
693
|
-
}
|
|
694
|
-
_processAIResponse(e, t) {
|
|
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);
|
|
696
|
-
}
|
|
697
|
-
_handleAPIError(e) {
|
|
698
|
-
console.error("AI Chart Generation Error:", e);
|
|
699
|
-
let t = {
|
|
700
|
-
id: this._generateMessageId(),
|
|
701
|
-
type: "ai",
|
|
702
|
-
message: `${e instanceof Error ? e.message : "Unknown error"}`
|
|
703
|
-
};
|
|
704
|
-
this.messages = [...this.messages, t], this.dispatchEvent(new CustomEvent("luzmo-response-received", {
|
|
782
|
+
_handleAPIError(e, t) {
|
|
783
|
+
console.error("AI Chart Generation Error:", e), this._progress = null, this._progressCollapsed = !1;
|
|
784
|
+
let r = msg("Something went wrong. Please try again.", { desc: "Generic error message shown in ai chat when the API request fails" });
|
|
785
|
+
if (t) t.message = r, t.isError = !0, delete t.progress, this._updateMessage(t);
|
|
786
|
+
else {
|
|
787
|
+
let e = {
|
|
788
|
+
id: this._generateMessageId(),
|
|
789
|
+
type: "ai",
|
|
790
|
+
message: r,
|
|
791
|
+
isError: !0
|
|
792
|
+
};
|
|
793
|
+
this.messages = [...this.messages, e], t = e;
|
|
794
|
+
}
|
|
795
|
+
this.dispatchEvent(new CustomEvent("luzmo-response-received", {
|
|
705
796
|
detail: {
|
|
706
797
|
message: t,
|
|
707
798
|
error: e
|
|
@@ -742,16 +833,42 @@ var LuzmoAiChat = class extends LuzmoElement {
|
|
|
742
833
|
}));
|
|
743
834
|
return;
|
|
744
835
|
}
|
|
745
|
-
let a =
|
|
836
|
+
let a = this._prepareForAIResponse();
|
|
746
837
|
try {
|
|
747
|
-
|
|
748
|
-
this._processAIResponse(e, a);
|
|
838
|
+
await this._sendStreamingMessage(i, a);
|
|
749
839
|
} catch (e) {
|
|
750
|
-
this._handleAPIError(e);
|
|
751
|
-
} finally {
|
|
752
|
-
this._isGeneratingInternal = !1;
|
|
840
|
+
e.name !== "AbortError" && this._handleAPIError(e, a);
|
|
753
841
|
}
|
|
754
842
|
}
|
|
843
|
+
async _processInitialPrompt() {
|
|
844
|
+
if (!this.initialPrompt || this.initialPrompt === this._lastProcessedInitialPrompt) return;
|
|
845
|
+
this._lastProcessedInitialPrompt = this.initialPrompt;
|
|
846
|
+
let e = this.selectedDatasets.map((e) => e.id), t = this._buildRequestBody(this.initialPrompt, e), n = `${this.apiUrl}/${this.apiVersion}/aimessage`;
|
|
847
|
+
if (this.requestMode === "external") {
|
|
848
|
+
let r = {
|
|
849
|
+
prompt: this.initialPrompt,
|
|
850
|
+
selectedDatasets: this.selectedDatasets,
|
|
851
|
+
datasetIds: e,
|
|
852
|
+
request: t,
|
|
853
|
+
url: n
|
|
854
|
+
};
|
|
855
|
+
this.dispatchEvent(new CustomEvent("luzmo-prompt-submitted", {
|
|
856
|
+
detail: r,
|
|
857
|
+
bubbles: !0,
|
|
858
|
+
composed: !0
|
|
859
|
+
}));
|
|
860
|
+
return;
|
|
861
|
+
}
|
|
862
|
+
let r = this._prepareForAIResponse();
|
|
863
|
+
try {
|
|
864
|
+
await this._sendStreamingMessage(t, r);
|
|
865
|
+
} catch (e) {
|
|
866
|
+
e.name !== "AbortError" && this._handleAPIError(e, r);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
disconnectedCallback() {
|
|
870
|
+
super.disconnectedCallback(), this._abortController?.abort(), this._abortController = null, this._finalizeInflightMessage(), this._isGeneratingInternal = !1;
|
|
871
|
+
}
|
|
755
872
|
_scrollToBottom() {
|
|
756
873
|
let e = this.shadowRoot?.querySelector(".chat-messages-container");
|
|
757
874
|
e && requestAnimationFrame(() => {
|
|
@@ -761,7 +878,7 @@ var LuzmoAiChat = class extends LuzmoElement {
|
|
|
761
878
|
});
|
|
762
879
|
}
|
|
763
880
|
updated(e) {
|
|
764
|
-
super.updated?.(e), e.has("messages") && this.updateComplete.then(() => this._scrollToBottom());
|
|
881
|
+
super.updated?.(e), (e.has("messages") || e.has("_progress") || e.has("progress")) && this.updateComplete.then(() => this._scrollToBottom()), this.initialPrompt && this.initialPrompt !== this._lastProcessedInitialPrompt ? this._processInitialPrompt() : this.initialPrompt || (this._lastProcessedInitialPrompt = null);
|
|
765
882
|
}
|
|
766
883
|
_sanitizeMessage(e) {
|
|
767
884
|
return purify.sanitize(e, {
|
|
@@ -808,8 +925,26 @@ var LuzmoAiChat = class extends LuzmoElement {
|
|
|
808
925
|
]
|
|
809
926
|
});
|
|
810
927
|
}
|
|
928
|
+
_renderProgress() {
|
|
929
|
+
let e = this.requestMode === "external" ? this.progress : this._progress, t = this.requestMode === "external" ? this.progressCollapsed : this._progressCollapsed;
|
|
930
|
+
return e?.children?.length ? html`
|
|
931
|
+
<luzmo-progress-steps
|
|
932
|
+
.progress=${e}
|
|
933
|
+
?collapsed=${t}
|
|
934
|
+
size="s"
|
|
935
|
+
></luzmo-progress-steps>
|
|
936
|
+
` : nothing;
|
|
937
|
+
}
|
|
811
938
|
_renderMessages() {
|
|
812
|
-
return this.messages.
|
|
939
|
+
return this.messages.filter((e) => !this._inflightAiMessage || e.id !== this._inflightAiMessage.id).map((e) => {
|
|
940
|
+
let t = e.progress?.children?.length ? html`
|
|
941
|
+
<luzmo-progress-steps
|
|
942
|
+
.progress=${e.progress}
|
|
943
|
+
collapsed
|
|
944
|
+
size="s"
|
|
945
|
+
></luzmo-progress-steps>
|
|
946
|
+
` : nothing;
|
|
947
|
+
return e.type === "user" ? html`
|
|
813
948
|
<luzmo-chat-message
|
|
814
949
|
avatar-placement="bottom"
|
|
815
950
|
position="right"
|
|
@@ -818,32 +953,46 @@ var LuzmoAiChat = class extends LuzmoElement {
|
|
|
818
953
|
>
|
|
819
954
|
${e.message}
|
|
820
955
|
</luzmo-chat-message>
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
956
|
+
` : html`
|
|
957
|
+
${t}
|
|
958
|
+
<luzmo-chat-message
|
|
959
|
+
class=${e.isError ? "error" : ""}
|
|
960
|
+
avatar-placement="bottom"
|
|
961
|
+
position="left"
|
|
962
|
+
quiet
|
|
963
|
+
size="s"
|
|
964
|
+
>
|
|
965
|
+
${unsafeHTML(this._sanitizeMessage(e.message))}
|
|
966
|
+
</luzmo-chat-message>
|
|
967
|
+
`;
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
_renderStreamingResponse() {
|
|
971
|
+
return this._inflightAiMessage?.message ? html`
|
|
972
|
+
<luzmo-chat-message
|
|
973
|
+
avatar-placement="bottom"
|
|
974
|
+
position="left"
|
|
975
|
+
quiet
|
|
976
|
+
size="s"
|
|
977
|
+
>
|
|
978
|
+
${unsafeHTML(this._sanitizeMessage(this._inflightAiMessage.message))}
|
|
979
|
+
</luzmo-chat-message>
|
|
980
|
+
` : nothing;
|
|
831
981
|
}
|
|
832
982
|
_renderLoadingMessage() {
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
</
|
|
844
|
-
</
|
|
845
|
-
|
|
846
|
-
|
|
983
|
+
let e = this.requestMode === "external" ? this.isGenerating : this._isGeneratingInternal, t = this.requestMode === "external" ? this.progress : this._progress;
|
|
984
|
+
return !e || t?.children?.length ? nothing : html`
|
|
985
|
+
<luzmo-chat-message
|
|
986
|
+
avatar-placement="bottom"
|
|
987
|
+
position="left"
|
|
988
|
+
quiet
|
|
989
|
+
size="s"
|
|
990
|
+
>
|
|
991
|
+
<div class="loading-message">
|
|
992
|
+
<span class="icon-lg">${luzmoIcon(luzmoSpin, { className: "spin" })}</span>
|
|
993
|
+
<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>
|
|
994
|
+
</div>
|
|
995
|
+
</luzmo-chat-message>
|
|
847
996
|
`;
|
|
848
997
|
}
|
|
849
998
|
_renderPlaceholderMessage() {
|
|
@@ -856,7 +1005,7 @@ var LuzmoAiChat = class extends LuzmoElement {
|
|
|
856
1005
|
quiet
|
|
857
1006
|
size="s"
|
|
858
1007
|
>
|
|
859
|
-
${msg("Describe how you want to edit this
|
|
1008
|
+
${msg("Describe how you want to edit this item…", { desc: "Label for ai chat placeholder message" })}
|
|
860
1009
|
</luzmo-chat-message>
|
|
861
1010
|
`;
|
|
862
1011
|
}
|
|
@@ -867,6 +1016,8 @@ var LuzmoAiChat = class extends LuzmoElement {
|
|
|
867
1016
|
<div class="chat-messages-container">
|
|
868
1017
|
${this._renderPlaceholderMessage()}
|
|
869
1018
|
${this._renderMessages()}
|
|
1019
|
+
${this._renderProgress()}
|
|
1020
|
+
${this._renderStreamingResponse()}
|
|
870
1021
|
${this._renderLoadingMessage()}
|
|
871
1022
|
</div>
|
|
872
1023
|
|
|
@@ -938,5 +1089,11 @@ __decorate([property({ type: Array })], LuzmoAiChat.prototype, "messages", void
|
|
|
938
1089
|
})], LuzmoAiChat.prototype, "apiVersion", void 0), __decorate([property({
|
|
939
1090
|
type: String,
|
|
940
1091
|
attribute: "loading-message"
|
|
941
|
-
})], LuzmoAiChat.prototype, "loadingMessage", void 0), __decorate([
|
|
942
|
-
|
|
1092
|
+
})], LuzmoAiChat.prototype, "loadingMessage", void 0), __decorate([property({
|
|
1093
|
+
type: String,
|
|
1094
|
+
attribute: "initial-prompt"
|
|
1095
|
+
})], LuzmoAiChat.prototype, "initialPrompt", void 0), __decorate([property({ type: Object })], LuzmoAiChat.prototype, "progress", void 0), __decorate([property({
|
|
1096
|
+
type: Boolean,
|
|
1097
|
+
attribute: "progress-collapsed"
|
|
1098
|
+
})], LuzmoAiChat.prototype, "progressCollapsed", void 0), __decorate([state()], LuzmoAiChat.prototype, "_progress", void 0), __decorate([state()], LuzmoAiChat.prototype, "_progressCollapsed", 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);
|
|
1099
|
+
export { hasProgressChunk as a, fetchStreamingResponse as i, buildAiMessageRequest as n, readNdjsonStream as o, createInitialProgress as r, LuzmoAiChat as t };
|
|
@@ -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(`../set-locale-
|
|
20
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../set-locale-CdlBx8s9.cjs`),require(`../dataset-icon-C0cID-ra.cjs`),require(`../data-broker-BUIUM5hr.cjs`),require(`../dataset-selector-list-DYsi3LBF.cjs`),require(`../dataset-selector-row-Qwz9WmR4.cjs`);const e=require(`../ai-interaction-textarea-CcgFeoIg.cjs`);Object.defineProperty(exports,`LuzmoAiInteractionTextarea`,{enumerable:!0,get:function(){return e.t}});
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
e.setAttribute("data-luzmo-vars", ""), e.textContent = "html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-background-color-alt-1: rgb(250, 250, 250);--luzmo-background-color-alt-2: rgb(239, 239, 239);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-color-disabled);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-scrollbar-size: 6px;--luzmo-scrollbar-width: thin;--luzmo-scrollbar-track-background: transparent;--luzmo-scrollbar-track-border-radius: var(--luzmo-border-radius-s);--luzmo-scrollbar-thumb-background: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-scrollbar-thumb-border-radius: var(--luzmo-border-radius-s);--luzmo-scrollbar-thumb-hover-background: rgba(var(--luzmo-border-color-rgb), 0.4);--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-secondary-outline: rgba(255, 0, 255, 0.2);--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-color-informative: #1a77e9;--luzmo-color-informative-rgb: 26, 119, 233;--luzmo-color-disabled: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}", document.head.appendChild(e);
|
|
24
24
|
}
|
|
25
25
|
})();
|
|
26
|
-
import "../set-locale-
|
|
26
|
+
import "../set-locale-C3o6ooUV.js";
|
|
27
27
|
import "../dataset-icon-DhF21dXC.js";
|
|
28
28
|
import "../data-broker-cLR-t5LM.js";
|
|
29
|
-
import "../dataset-selector-list-
|
|
30
|
-
import "../dataset-selector-row-
|
|
29
|
+
import "../dataset-selector-list-C5FvwP-r.js";
|
|
30
|
+
import "../dataset-selector-row-BKIFTyJl.js";
|
|
31
31
|
import { t as LuzmoAiInteractionTextarea } from "../ai-interaction-textarea-B5UE7CIq.js";
|
|
32
32
|
export { LuzmoAiInteractionTextarea };
|
|
@@ -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(`../set-locale-
|
|
20
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../set-locale-CdlBx8s9.cjs`),require(`../localized-mixin-BhUvOsd7.cjs`),require(`../periods.const-CX2ZWWrf.cjs`),require(`../calculate-data-field-icon-BhiGlh0u.cjs`);const e=require(`../data-fields-select-_WjjNpcl.cjs`);Object.defineProperty(exports,`LuzmoDataFieldsSelect`,{enumerable:!0,get:function(){return e.t}});
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
e.setAttribute("data-luzmo-vars", ""), e.textContent = "html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-background-color-alt-1: rgb(250, 250, 250);--luzmo-background-color-alt-2: rgb(239, 239, 239);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-color-disabled);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-scrollbar-size: 6px;--luzmo-scrollbar-width: thin;--luzmo-scrollbar-track-background: transparent;--luzmo-scrollbar-track-border-radius: var(--luzmo-border-radius-s);--luzmo-scrollbar-thumb-background: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-scrollbar-thumb-border-radius: var(--luzmo-border-radius-s);--luzmo-scrollbar-thumb-hover-background: rgba(var(--luzmo-border-color-rgb), 0.4);--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-secondary-outline: rgba(255, 0, 255, 0.2);--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-color-informative: #1a77e9;--luzmo-color-informative-rgb: 26, 119, 233;--luzmo-color-disabled: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}", document.head.appendChild(e);
|
|
24
24
|
}
|
|
25
25
|
})();
|
|
26
|
-
import "../set-locale-
|
|
27
|
-
import "../localized-mixin-
|
|
26
|
+
import "../set-locale-C3o6ooUV.js";
|
|
27
|
+
import "../localized-mixin-HngLqDZn.js";
|
|
28
28
|
import "../periods.const-Ch6SfeaG.js";
|
|
29
29
|
import "../calculate-data-field-icon-CY7Y6fn1.js";
|
|
30
|
-
import { t as LuzmoDataFieldsSelect } from "../data-fields-select-
|
|
30
|
+
import { t as LuzmoDataFieldsSelect } from "../data-fields-select-CHOKEMb2.js";
|
|
31
31
|
export { LuzmoDataFieldsSelect };
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* SOFTWARE.
|
|
19
19
|
* */
|
|
20
20
|
import { t as __decorate } from "./decorate-Da6S_xrw.js";
|
|
21
|
-
import { t as LocalizedMixin } from "./localized-mixin-
|
|
21
|
+
import { t as LocalizedMixin } from "./localized-mixin-HngLqDZn.js";
|
|
22
22
|
import { t as localize } from "./localize-Dlt3EN5i.js";
|
|
23
23
|
import { n as DATETIME_LEVELS } from "./periods.const-Ch6SfeaG.js";
|
|
24
24
|
import { t as calculateDataFieldIcon } from "./calculate-data-field-icon-CY7Y6fn1.js";
|