@sisense/sdk-ui-preact 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ai.js CHANGED
@@ -1,4 +1,4 @@
1
- import { P as Le, ff as Ft, fg as Vt, W as se, af as we, ae as $t, cK as Jt, aW as fe, fh as Xt, bK as Kt, bo as Xe, fi as de, a as gt, cE as je, b2 as er, c7 as tr, fj as rr, fk as ar, fl as ir, fm as or, cI as ut, s as ht, aj as mt, aU as ve, r as nr, d as Me, fn as lr, fo as dr, C as ee, z as V, fp as bt, e as b, y as ft, i as k, G as i, a2 as v, ai as O, fq as sr, aI as cr, ar as pr, q as N, bs as te, j as _, aF as Ze, f as S, _ as re, at as xt, a7 as gr, bx as ur, au as hr, F as $, fr as mr, u as ne, Z as Te, fs as br, ac as fr, ft as xr, ag as le, ds as kt, av as We, h as kr, fu as ce, a6 as u, cW as T, J as h, c6 as wr, fv as yr, A as ye, fw as _r, fx as Cr, fy as wt, fz as vr, fA as Mr, ck as Sr, cl as Dr, fB as Ir, fC as Ar, fD as Lr, eq as Tr, cj as Nr, fE as jr, cV as yt, fF as Or, dj as Er, fG as zr, aX as _t, aY as Ct, fH as Rr, cB as Zr, fI as Wr, cS as qr, fJ as Gr } from "./use-common-filters-CJNwlbbh-ce34ca79.js";
1
+ import { P as Le, fi as Ut, fj as Vt, W as se, ag as we, af as $t, cK as Jt, aW as fe, fk as Xt, bK as Kt, bo as Xe, fl as de, E as gt, cE as je, b2 as er, c7 as tr, fm as rr, fn as ar, fo as ir, fp as or, cI as ut, l as ht, ak as mt, ab as ve, o as nr, d as Me, fq as lr, fr as dr, C as ee, z as V, fs as bt, c as b, y as ft, w as k, G as i, a2 as v, aj as O, ft as sr, aJ as cr, as as pr, q as N, bs as te, h as _, aG as Ze, e as S, _ as re, au as xt, a7 as gr, bx as ur, av as hr, F as $, fu as mr, u as ne, Z as Te, fv as br, ad as fr, fw as xr, ah as le, ds as kt, aw as We, f as kr, fx as ce, a6 as u, cW as T, J as h, c6 as wr, fy as yr, A as ye, fz as _r, fA as Cr, fB as wt, fC as vr, fD as Mr, ck as Sr, cl as Dr, fE as Ir, fF as Ar, fG as Lr, eq as Tr, cj as Nr, fH as jr, cV as yt, fI as Or, dj as Er, et as zr, aX as _t, aY as Ct, fJ as Rr, cB as Zr, fK as Wr, cS as qr, fL as Gr } from "./use-common-filters--6cyMg9O-1bb37a64.js";
2
2
  var Pr = Object.defineProperty, Hr = Object.defineProperties, Yr = Object.getOwnPropertyDescriptors, Ke = Object.getOwnPropertySymbols, Br = Object.prototype.hasOwnProperty, Qr = Object.prototype.propertyIsEnumerable, et = (e, t, r) => t in e ? Pr(e, t, {
3
3
  enumerable: !0,
4
4
  configurable: !0,
@@ -31,14 +31,14 @@ class vt extends gt {
31
31
  return t.__serializable = "JaqlElement", t.metadataItem = this.metadataItem, t.type = this.type, t;
32
32
  }
33
33
  }
34
- const Ur = {
34
+ const Fr = {
35
35
  text: Le.TextAttribute,
36
36
  numeric: Le.NumericAttribute,
37
37
  datetime: Le.DateLevel
38
38
  };
39
- function Fr(e) {
39
+ function Ur(e) {
40
40
  var t;
41
- return new vt(e, (t = Ur[e.jaql.datatype]) !== null && t !== void 0 ? t : "numeric");
41
+ return new vt(e, (t = Fr[e.jaql.datatype]) !== null && t !== void 0 ? t : "numeric");
42
42
  }
43
43
  function Mt(e) {
44
44
  const {
@@ -61,7 +61,7 @@ function Mt(e) {
61
61
  title: t.title,
62
62
  panel: e.panel,
63
63
  dataSource: t.datasource
64
- }) : Fr(e);
64
+ }) : Ur(e);
65
65
  }
66
66
  const Vr = (e) => "dashboardOid" in e && "widgetOid" in e;
67
67
  function $r(e) {
@@ -900,7 +900,7 @@ const it = `
900
900
  datasource: s
901
901
  } = a, d = B(A({}, s), {
902
902
  type: s.type || "elasticube"
903
- }), c = Ft(d), g = l.map((j) => ia(j)).map((j) => B(A({}, j), {
903
+ }), c = Ut(d), g = l.map((j) => ia(j)).map((j) => B(A({}, j), {
904
904
  jaql: B(A({}, j.jaql), {
905
905
  datasource: c
906
906
  })
@@ -1380,7 +1380,7 @@ const Ga = (e) => {
1380
1380
  data: t ?? [],
1381
1381
  isLoading: r
1382
1382
  };
1383
- }, Ua = (e, t, r) => {
1383
+ }, Fa = (e, t, r) => {
1384
1384
  const a = ce(), o = Z(), n = qe({
1385
1385
  mutationFn: () => J(void 0, null, function* () {
1386
1386
  if (!(!o || !e))
@@ -1391,7 +1391,7 @@ const Ga = (e) => {
1391
1391
  return re(() => {
1392
1392
  t && n.isIdle && n.mutate();
1393
1393
  }, [t, n]), n;
1394
- }, Fa = (e, t) => {
1394
+ }, Ua = (e, t) => {
1395
1395
  switch (e.responseType = e.responseType.toLowerCase(), e.responseType) {
1396
1396
  case "nlq":
1397
1397
  return {
@@ -1444,7 +1444,7 @@ const Ga = (e) => {
1444
1444
  if (!d)
1445
1445
  return;
1446
1446
  const c = o("ai.errors.unknownResponse");
1447
- a(Fa(d, c));
1447
+ a(Ua(d, c));
1448
1448
  }
1449
1449
  });
1450
1450
  return {
@@ -1463,7 +1463,7 @@ const Ga = (e) => {
1463
1463
  isError: d,
1464
1464
  data: c,
1465
1465
  isSuccess: g
1466
- } = Ua(e, r && !n && !s, t);
1466
+ } = Fa(e, r && !n && !s, t);
1467
1467
  return re(() => {
1468
1468
  g && c && !s && l.saveChatId(c.chatId, e, t);
1469
1469
  }, [c, g, e, t, s, l]), {
@@ -1853,8 +1853,8 @@ function ki({
1853
1853
  var j;
1854
1854
  if ((j = document.getElementById("csdk-chatbot-frame")) != null && j.contains(y.relatedTarget)) {
1855
1855
  const H = (W) => {
1856
- var U;
1857
- document.removeEventListener("mouseup", H), document.removeEventListener("keyup", H), W.type === "mouseup" && ((U = document.getSelection()) == null ? void 0 : U.type) !== "Range" && y.target.focus({
1856
+ var F;
1857
+ document.removeEventListener("mouseup", H), document.removeEventListener("keyup", H), W.type === "mouseup" && ((F = document.getSelection()) == null ? void 0 : F.type) !== "Range" && y.target.focus({
1858
1858
  preventScroll: !0
1859
1859
  });
1860
1860
  };
@@ -2285,15 +2285,15 @@ const Ai = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
2285
2285
  PaperProps: j = {},
2286
2286
  scroll: H = "paper",
2287
2287
  TransitionComponent: W = yr,
2288
- transitionDuration: U = o,
2288
+ transitionDuration: F = o,
2289
2289
  TransitionProps: Ie
2290
- } = r, he = hr(r, Ai), F = V({}, r, {
2290
+ } = r, he = hr(r, Ai), U = V({}, r, {
2291
2291
  disableEscapeKeyDown: p,
2292
2292
  fullScreen: m,
2293
2293
  fullWidth: f,
2294
2294
  maxWidth: w,
2295
2295
  scroll: H
2296
- }), X = Ti(F), ae = $(), Ae = (q) => {
2296
+ }), X = Ti(U), ae = $(), Ae = (q) => {
2297
2297
  ae.current = q.target === q.currentTarget;
2298
2298
  }, ie = (q) => {
2299
2299
  D && D(q), ae.current && (ae.current = null, x && x(q), I && I(q, "backdropClick"));
@@ -2308,7 +2308,7 @@ const Ai = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
2308
2308
  },
2309
2309
  componentsProps: {
2310
2310
  backdrop: V({
2311
- transitionDuration: U,
2311
+ transitionDuration: F,
2312
2312
  as: s
2313
2313
  }, d)
2314
2314
  },
@@ -2317,18 +2317,18 @@ const Ai = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
2317
2317
  open: z,
2318
2318
  ref: t,
2319
2319
  onClick: ie,
2320
- ownerState: F
2320
+ ownerState: U
2321
2321
  }, he, {
2322
2322
  children: /* @__PURE__ */ ne(W, V({
2323
2323
  appear: !0,
2324
2324
  in: z,
2325
- timeout: U,
2325
+ timeout: F,
2326
2326
  role: "presentation"
2327
2327
  }, Ie, {
2328
2328
  children: /* @__PURE__ */ ne(ji, {
2329
2329
  className: Te(X.container),
2330
2330
  onMouseDown: Ae,
2331
- ownerState: F,
2331
+ ownerState: U,
2332
2332
  children: /* @__PURE__ */ ne(Oi, V({
2333
2333
  as: y,
2334
2334
  elevation: 24,
@@ -2337,7 +2337,7 @@ const Ai = ["aria-describedby", "aria-labelledby", "BackdropComponent", "Backdro
2337
2337
  "aria-labelledby": oe
2338
2338
  }, j, {
2339
2339
  className: Te(X.paper, j.className),
2340
- ownerState: F,
2340
+ ownerState: U,
2341
2341
  children: /* @__PURE__ */ ne(qt.Provider, {
2342
2342
  value: E,
2343
2343
  children: c
@@ -2668,7 +2668,7 @@ function qi({
2668
2668
  })
2669
2669
  });
2670
2670
  }
2671
- const Ue = (e) => _t(e.chart.backgroundColor), Gi = ({
2671
+ const Fe = (e) => _t(e.chart.backgroundColor), Gi = ({
2672
2672
  title: e
2673
2673
  }) => {
2674
2674
  const {
@@ -2678,7 +2678,7 @@ const Ue = (e) => _t(e.chart.backgroundColor), Gi = ({
2678
2678
  title: e,
2679
2679
  children: /* @__PURE__ */ i(ue, {
2680
2680
  disableTouchRipple: !0,
2681
- $hoverColor: Ue(t),
2681
+ $hoverColor: Fe(t),
2682
2682
  children: /* @__PURE__ */ i(Zi, {
2683
2683
  fill: t.chart.textColor
2684
2684
  })
@@ -2697,7 +2697,7 @@ const Ue = (e) => _t(e.chart.backgroundColor), Gi = ({
2697
2697
  return /* @__PURE__ */ h(O, {
2698
2698
  children: [/* @__PURE__ */ i(ue, {
2699
2699
  onClick: a,
2700
- $hoverColor: Ue(n),
2700
+ $hoverColor: Fe(n),
2701
2701
  "aria-label": "three dots button",
2702
2702
  children: /* @__PURE__ */ i(qi, {
2703
2703
  fill: n.chart.textColor
@@ -2743,7 +2743,7 @@ const Ue = (e) => _t(e.chart.backgroundColor), Gi = ({
2743
2743
  title: r("ai.preview"),
2744
2744
  children: /* @__PURE__ */ i(ue, {
2745
2745
  onClick: e,
2746
- $hoverColor: Ue(t),
2746
+ $hoverColor: Fe(t),
2747
2747
  children: /* @__PURE__ */ i(Ri, {
2748
2748
  fill: t.chart.textColor
2749
2749
  })
@@ -2872,7 +2872,7 @@ function Qi({
2872
2872
  })]
2873
2873
  });
2874
2874
  }
2875
- function Ui({
2875
+ function Fi({
2876
2876
  theme: e
2877
2877
  }) {
2878
2878
  return /* @__PURE__ */ i("svg", {
@@ -2889,7 +2889,7 @@ function Ui({
2889
2889
  })
2890
2890
  });
2891
2891
  }
2892
- function Fi({
2892
+ function Ui({
2893
2893
  onClick: e,
2894
2894
  disabled: t
2895
2895
  }) {
@@ -2905,7 +2905,7 @@ function Fi({
2905
2905
  onClick: e,
2906
2906
  $hoverColor: r.aiChat.icons.feedbackIcons.hoverColor,
2907
2907
  disabled: t,
2908
- children: /* @__PURE__ */ i(Ui, {
2908
+ children: /* @__PURE__ */ i(Fi, {
2909
2909
  theme: r
2910
2910
  })
2911
2911
  })
@@ -2978,7 +2978,7 @@ function Ki({
2978
2978
  children: [/* @__PURE__ */ i($i, {
2979
2979
  onClick: () => o("up"),
2980
2980
  disabled: r
2981
- }), /* @__PURE__ */ i(Fi, {
2981
+ }), /* @__PURE__ */ i(Ui, {
2982
2982
  onClick: () => o("down"),
2983
2983
  disabled: r
2984
2984
  })]
@@ -3011,7 +3011,7 @@ function Re({
3011
3011
  });
3012
3012
  }
3013
3013
  const eo = 18 * 5;
3014
- function Fe({
3014
+ function Ue({
3015
3015
  text: e
3016
3016
  }) {
3017
3017
  const [t, r] = S(!0), [a, o] = S(!1), {
@@ -3049,7 +3049,7 @@ function to({
3049
3049
  children: o("ai.errors.unexpected")
3050
3050
  }) : /* @__PURE__ */ i(Q, {
3051
3051
  align: "full",
3052
- children: /* @__PURE__ */ i(Fe, {
3052
+ children: /* @__PURE__ */ i(Ue, {
3053
3053
  text: t ?? o("ai.errors.insightsNotAvailable")
3054
3054
  })
3055
3055
  });
@@ -3526,10 +3526,10 @@ function No({
3526
3526
  chatId: H,
3527
3527
  lastError: W
3528
3528
  } = Ja(e, r), {
3529
- mutate: U,
3529
+ mutate: F,
3530
3530
  isLoading: Ie
3531
- } = zt(H), [he, F] = S(!1), [X, ae] = S(!1), Ae = () => F(!0), ie = () => F(!1), oe = () => {
3532
- U(), ie();
3531
+ } = zt(H), [he, U] = S(!1), [X, ae] = S(!1), Ae = () => U(!0), ie = () => U(!1), oe = () => {
3532
+ F(), ie();
3533
3533
  }, E = $(null), q = $(null), Bt = () => {
3534
3534
  if (!(E != null && E.current))
3535
3535
  return;
@@ -3554,7 +3554,7 @@ function No({
3554
3554
  color: p.aiChat.header.textColor
3555
3555
  }),
3556
3556
  style: p.aiChat.header
3557
- }) : null, Ut = N(() => [...new Set(D.filter((L) => L.role === "user").filter((L) => !(x != null && x.includes(L.content))).map((L) => L.content).reverse())].slice(0, c), [D, c, x]);
3557
+ }) : null, Ft = N(() => [...new Set(D.filter((L) => L.role === "user").filter((L) => !(x != null && x.includes(L.content))).map((L) => L.content).reverse())].slice(0, c), [D, c, x]);
3558
3558
  return (W == null ? void 0 : W.message) === l("ai.errors.chatUnavailable") ? /* @__PURE__ */ h(O, {
3559
3559
  children: [d && Ve, /* @__PURE__ */ i(Wt, {
3560
3560
  text: W.message
@@ -3607,7 +3607,7 @@ function No({
3607
3607
  disabled: z || j,
3608
3608
  onClearHistoryClick: Ae,
3609
3609
  suggestions: x || [],
3610
- recentPrompts: Ut,
3610
+ recentPrompts: Ft,
3611
3611
  isLoading: f || j,
3612
3612
  recommendationsError: w,
3613
3613
  onChange: ie
@@ -3773,7 +3773,7 @@ const Bo = /* @__PURE__ */ u("div", {
3773
3773
  })("display:flex;flex-direction:column;justify-content:top;overflow:hidden;height:100%;background-color:", ({
3774
3774
  theme: e
3775
3775
  }) => e.aiChat.dataTopics.backgroundColor, ";");
3776
- function Uo({
3776
+ function Fo({
3777
3777
  dataTopicsList: e,
3778
3778
  onDataTopicClick: t
3779
3779
  }) {
@@ -3804,7 +3804,7 @@ function Uo({
3804
3804
  })]
3805
3805
  });
3806
3806
  }
3807
- function Fo() {
3807
+ function Uo() {
3808
3808
  const [e, t] = S(), [r, a] = S(), {
3809
3809
  data: o,
3810
3810
  fetchStatus: n
@@ -3834,7 +3834,7 @@ function Fo() {
3834
3834
  contextTitle: e,
3835
3835
  contextDetails: s,
3836
3836
  onGoBack: p.length === 1 ? void 0 : () => t(void 0)
3837
- }) : /* @__PURE__ */ i(Uo, {
3837
+ }) : /* @__PURE__ */ i(Fo, {
3838
3838
  dataTopicsList: p,
3839
3839
  onDataTopicClick: (w) => t(w)
3840
3840
  });
@@ -3857,7 +3857,7 @@ const sn = ft({
3857
3857
  height: r,
3858
3858
  theme: o,
3859
3859
  tabIndex: 0,
3860
- children: /* @__PURE__ */ i(Fo, {})
3860
+ children: /* @__PURE__ */ i(Uo, {})
3861
3861
  })
3862
3862
  });
3863
3863
  }), cn = ft({
@@ -3875,7 +3875,7 @@ const sn = ft({
3875
3875
  children: o("ai.errors.unexpected")
3876
3876
  });
3877
3877
  const n = t ?? o("ai.errors.insightsNotAvailable");
3878
- return /* @__PURE__ */ i(Fe, {
3878
+ return /* @__PURE__ */ i(Ue, {
3879
3879
  text: r ? "Loading..." : n
3880
3880
  });
3881
3881
  });
@@ -3936,7 +3936,7 @@ const $o = /* @__PURE__ */ u("div", {
3936
3936
  children: /* @__PURE__ */ i(Vo, {
3937
3937
  theme: r
3938
3938
  })
3939
- }), /* @__PURE__ */ i(Fe, {
3939
+ }), /* @__PURE__ */ i(Ue, {
3940
3940
  text: e
3941
3941
  }), a]
3942
3942
  })