@databrainhq/plugin 0.17.9-beta.16 → 0.17.9-beta.17

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 (37) hide show
  1. package/dist/{Accordion-Bb74CQ-z.mjs → Accordion-DsORmK4r.mjs} +1 -1
  2. package/dist/{ChartCardOverlay-7PjIkbse.mjs → ChartCardOverlay-CyLHFHJa.mjs} +15 -12
  3. package/dist/{ChartNavigationProvider-CtSvd6kl.mjs → ChartNavigationProvider-I67YIHce.mjs} +1401 -1401
  4. package/dist/{CreateGlobalFilter-BqFhZ5_I.mjs → CreateGlobalFilter-Da6S3dnu.mjs} +2 -2
  5. package/dist/{CreateMetricV2-Bb5xNRY7.mjs → CreateMetricV2-RNLSJMxN.mjs} +21 -21
  6. package/dist/{HorizontalStackTable-Ci6XWwf-.mjs → HorizontalStackTable-Bg3wERrZ.mjs} +4 -4
  7. package/dist/{Loader-fiz_o6YC.mjs → Loader-BOT4ofJi.mjs} +1 -1
  8. package/dist/{ManageMetricsV2-qyk-SCcL.mjs → ManageMetricsV2-B0mbiFlY.mjs} +4 -4
  9. package/dist/{MetricCardV2-YINjQ5xk.mjs → MetricCardV2-A3PVcIkw.mjs} +10 -10
  10. package/dist/{NoDataFound-CVyRVkzK.mjs → NoDataFound-CEBF6MOr.mjs} +1 -1
  11. package/dist/{NoDataState-Dgm3tkCe.mjs → NoDataState-CmQQi1kw.mjs} +4 -4
  12. package/dist/{Panel-BpByQBce.mjs → Panel-DD-9FoTg.mjs} +1 -1
  13. package/dist/{PivotTableV2-DzIDJiSY.mjs → PivotTableV2-pWrTxupk.mjs} +2 -2
  14. package/dist/{PivotTableV3-B4UiH33n.mjs → PivotTableV3-B6QG_LCW.mjs} +4 -4
  15. package/dist/{Portal-CLz2zya_.mjs → Portal-B4Kj0rIP.mjs} +38 -38
  16. package/dist/{RadioButton-Dz-MsEbj.mjs → RadioButton-DpB36vSj.mjs} +44 -44
  17. package/dist/{ScheduleEmail-D85TAzI5.mjs → ScheduleEmail-gqxwqtp3.mjs} +7 -7
  18. package/dist/{TagInputField-CFrkMoTw.mjs → TagInputField-BbP-qWl4.mjs} +119 -110
  19. package/dist/{TextAreaField-B5Gxdaat.mjs → TextAreaField-C9qNJtxa.mjs} +10 -10
  20. package/dist/{charts-B3jV6aAX.mjs → charts-B2lwO2wF.mjs} +2 -2
  21. package/dist/{chevron-down-jFldnWcP.mjs → chevron-down-DYt-7zTT.mjs} +0 -0
  22. package/dist/{conditionalFormatting-ClTTstDV.mjs → conditionalFormatting-CrVixZL6.mjs} +1 -1
  23. package/dist/{createGlobalFilter.module-C1gmnqpy.mjs → createGlobalFilter.module-D9y4fUa6.mjs} +1 -1
  24. package/dist/{echarts-BwNzdyVe.mjs → echarts-CNq_XyLZ.mjs} +1 -1
  25. package/dist/{loading-state-CWZlWaOv.mjs → loading-state-CF_6fTCn.mjs} +3 -3
  26. package/dist/{metric.mutation-rX2iD9gk.mjs → metric.mutation-Bw7qZhLi.mjs} +37 -37
  27. package/dist/{pluginV3Request-CTFUezaJ.mjs → pluginV3Request-Ctr47kPo.mjs} +14 -14
  28. package/dist/{renderer-BQ-2Ksj0.mjs → renderer-BTvVu5ie.mjs} +6 -6
  29. package/dist/{timeseries-BeWDRXFD.mjs → timeseries-1uk9rCLq.mjs} +1 -1
  30. package/dist/{toTasteAppearance-xPVajb_2.mjs → toTasteAppearance-DyYAwtBW.mjs} +1 -1
  31. package/dist/{useGuesTokenUsageLog-R2_v2Wnd.mjs → useGuesTokenUsageLog-C98YQ6dU.mjs} +1 -1
  32. package/dist/{usePublishArchivedMetrics-C19AAeOY.mjs → usePublishArchivedMetrics-C3suEAda.mjs} +2 -2
  33. package/dist/{useQuery-xw_-DpE2.mjs → useQuery-BlfQIaBR.mjs} +1 -1
  34. package/dist/webcomponents.css +1 -1
  35. package/dist/webcomponents.es.js +1989 -1986
  36. package/dist/webcomponents.umd.js +146 -146
  37. package/package.json +1 -1
@@ -2,21 +2,21 @@ import "react";
2
2
  import "react-dom";
3
3
  import "react-dom/client";
4
4
  import { o as e } from "./rolldown-runtime-C1JUX4Ur.mjs";
5
- import { Ft as t, It as n, Lt as r, Mt as i, o as a, qt as o, r as s, u as c } from "./pluginV3Request-CTFUezaJ.mjs";
6
- import { t as l } from "./jsx-runtime-B0EUnyJj.mjs";
7
- import { A as u, E as d, S as f, _ as p, a as m, b as h, ct as g, d as _, h as v, i as y, l as b, s as x, v as S, x as C, y as w } from "./metric.mutation-rX2iD9gk.mjs";
8
- import { t as T } from "./useQuery-xw_-DpE2.mjs";
9
- import { $ as ee, Aa as E, Ai as te, At as D, B as O, Bi as ne, Bt as re, Ca as k, D as ie, Dt as ae, E as oe, H as se, Ht as ce, J as le, Jt as ue, L as de, Ma as fe, Mt as pe, N as me, Ot as he, P as ge, Pa as A, T as j, U as _e, Ut as M, W as ve, Xt as ye, Y as be, _n as xe, _t as Se, ba as Ce, bt as we, ct as Te, dt as Ee, ei as De, et as Oe, h as ke, hn as Ae, hr as je, ht as Me, it as Ne, j as Pe, ja as Fe, jn as N, k as Ie, ka as Le, lt as Re, na as ze, ni as Be, nt as Ve, ot as He, qt as Ue, s as We, tt as Ge, u as Ke, vn as qe, vt as Je, wr as Ye, xa as Xe, xn as Ze, yn as Qe, yt as $e, z as et } from "./Portal-CLz2zya_.mjs";
10
- import { n as tt } from "./timeseries-BeWDRXFD.mjs";
11
- import { i as nt } from "./text-CtrvkDIo.mjs";
12
- import { i as rt, l as it, p as at, r as ot, s as st, t as ct } from "./RadioButton-Dz-MsEbj.mjs";
13
- import { r as lt } from "./cardActions-BLBLsjcd.mjs";
14
- import { t as ut } from "./createLucideIcon-C-N26TaJ.mjs";
15
- import { t as dt } from "./Switch-Bjta4jTW.mjs";
16
- import * as ft from "react";
17
- import { useCallback as P, useEffect as F, useLayoutEffect as pt, useMemo as I, useRef as L, useState as R } from "react";
5
+ import { It as t, Jt as n, Lt as r, Nt as i, Rt as a, d as o, o as s, r as c, s as l } from "./pluginV3Request-Ctr47kPo.mjs";
6
+ import { t as u } from "./jsx-runtime-B0EUnyJj.mjs";
7
+ import { A as d, E as f, S as p, _ as m, a as ee, b as h, ct as g, d as te, h as _, i as ne, l as v, s as y, v as b, x, y as S } from "./metric.mutation-Bw7qZhLi.mjs";
8
+ import { t as C } from "./useQuery-BlfQIaBR.mjs";
9
+ import { $ as re, Aa as w, Ai as ie, At as T, B as ae, Bi as oe, Bt as se, Ca as E, D as ce, Dt as le, E as ue, H as de, Ht as fe, J as pe, Jt as me, L as he, Ma as ge, Mt as _e, N as ve, Ot as ye, P as D, Pa as O, T as k, U as be, Ut as A, W as xe, Xt as Se, Y as Ce, _n as we, _t as Te, ba as Ee, bt as De, ct as Oe, dt as ke, ei as Ae, et as je, h as j, hn as Me, hr as Ne, ht as Pe, it as Fe, j as Ie, ja as M, jn as Le, k as Re, ka as ze, lt as Be, na as Ve, ni as He, nt as Ue, ot as We, qt as Ge, s as Ke, tt as qe, u as Je, vn as Ye, vt as Xe, wr as Ze, xa as Qe, xn as $e, yn as et, yt as tt, z as nt } from "./Portal-B4Kj0rIP.mjs";
10
+ import { n as rt } from "./timeseries-1uk9rCLq.mjs";
11
+ import { i as it } from "./text-CtrvkDIo.mjs";
12
+ import { i as at, l as ot, p as st, r as ct, s as lt, t as ut } from "./RadioButton-DpB36vSj.mjs";
13
+ import { r as dt } from "./cardActions-BLBLsjcd.mjs";
14
+ import { t as ft } from "./createLucideIcon-C-N26TaJ.mjs";
15
+ import { t as pt } from "./Switch-Bjta4jTW.mjs";
16
+ import * as mt from "react";
17
+ import { useCallback as N, useEffect as P, useLayoutEffect as ht, useMemo as F, useRef as I, useState as L } from "react";
18
18
  //#region src/helpers/sqlUtils/queryWrapping.ts
19
- var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(ht, ""), _t = (e) => `${e?.token || ""}|${+!!e?.isFrontendApp}|${e?.clientId || ""}`, vt = (e, t = {}) => e?.id ? e.drillConfig?.levels?.some((e) => !!e?.filters?.length) ? {
19
+ var R = u(), gt = /* @__PURE__ */ e(ge()), _t = /;\s*$/, vt = (e) => e.replace(_t, ""), yt = (e) => `${e?.token || ""}|${+!!e?.isFrontendApp}|${e?.clientId || ""}`, bt = (e, t = {}) => e?.id ? e.drillConfig?.levels?.some((e) => !!e?.filters?.length) ? {
20
20
  eligible: !1,
21
21
  reason: "drill-filtered"
22
22
  } : e.isEncrypted && !t.isGuestTokenSession ? {
@@ -25,14 +25,14 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
25
25
  } : { eligible: !0 } : {
26
26
  eligible: !1,
27
27
  reason: "no-metric-id"
28
- }, yt = (e, t, n, r = "embed", i) => ({
28
+ }, xt = (e, t, n, r = "embed", i) => ({
29
29
  key: e,
30
30
  externalMetricId: t.id,
31
31
  ...r === "platform" && n ? { clientId: n } : {},
32
32
  ...r === "platform" && t.timezone ? { timezone: t.timezone } : {},
33
33
  ...t.isEncrypted && i ? {
34
- rlsConditions: t.rlsConditions?.length ? E(t.rlsConditions, i) : [],
35
- globalFilters: t.globalFilters?.filters?.length ? E(t.globalFilters, i) : {
34
+ rlsConditions: t.rlsConditions?.length ? w(t.rlsConditions, i) : [],
35
+ globalFilters: t.globalFilters?.filters?.length ? w(t.globalFilters, i) : {
36
36
  tableName: "",
37
37
  filters: []
38
38
  }
@@ -54,7 +54,7 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
54
54
  comparisonCount: t.comparisonCount,
55
55
  drillConfig: t.drillConfig,
56
56
  ...t.isEncrypted && i ? { isEncrypted: !0 } : {}
57
- }), bt = (e) => {
57
+ }), St = (e) => {
58
58
  let t = [];
59
59
  if (typeof e.data == "string") try {
60
60
  t = JSON.parse(e.data);
@@ -74,7 +74,7 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
74
74
  metaData: e.metaData,
75
75
  ...e.error ? { error: e.error } : {}
76
76
  };
77
- }, xt = 45e3, St = 1e3, Ct = 1500, wt = class {
77
+ }, Ct = 45e3, wt = 1e3, Tt = 1500, Et = class {
78
78
  options;
79
79
  queue = [];
80
80
  flushScheduled = !1;
@@ -154,7 +154,7 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
154
154
  }
155
155
  let t = /* @__PURE__ */ new Map();
156
156
  e.forEach((e) => {
157
- let n = _t(e.session), r = t.get(n);
157
+ let n = yt(e.session), r = t.get(n);
158
158
  r ? r.push(e) : t.set(n, [e]);
159
159
  });
160
160
  let n = [];
@@ -183,7 +183,7 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
183
183
  o = await this.options.transport(e.map((e) => e.request), t.signal, e[0]?.session || {}), r = !0, a();
184
184
  } catch (t) {
185
185
  if (r = !0, a(), n) {
186
- let t = new w(this.options.timeoutMs);
186
+ let t = new S(this.options.timeoutMs);
187
187
  e.forEach((e) => {
188
188
  e.reject(t);
189
189
  });
@@ -221,51 +221,51 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
221
221
  this.settleWithFallback(e);
222
222
  return;
223
223
  }
224
- let r = bt(n);
224
+ let r = St(n);
225
225
  e.resolve(r);
226
226
  });
227
227
  }
228
228
  settleWithFallback(e) {
229
229
  e.fallback().then(e.resolve, e.reject);
230
230
  }
231
- }, Tt = "dbnMetricBatch", Et = "@dbn:metricQueryBatch", Dt = () => {
231
+ }, Dt = "dbnMetricBatch", Ot = "@dbn:metricQueryBatch", kt = () => {
232
232
  try {
233
- let e = window.localStorage.getItem(Et);
233
+ let e = window.localStorage.getItem(Ot);
234
234
  if (e === "on" || e === "off") return e;
235
235
  } catch {}
236
236
  return null;
237
- }, Ot = (e) => {
237
+ }, z = (e) => {
238
238
  try {
239
- e === null ? window.localStorage.removeItem(Et) : window.localStorage.setItem(Et, e);
239
+ e === null ? window.localStorage.removeItem(Ot) : window.localStorage.setItem(Ot, e);
240
240
  } catch {}
241
- }, B = () => {
241
+ }, At = () => {
242
242
  try {
243
- let e = new URLSearchParams(window.location.search).get(Tt);
244
- (e === "on" || e === "off") && Ot(e);
243
+ let e = new URLSearchParams(window.location.search).get(Dt);
244
+ (e === "on" || e === "off") && z(e);
245
245
  } catch {}
246
- }, kt = () => typeof window > "u" || window.dbn?.disableMetricQueryBatch ? "off" : (B(), Dt() ?? "auto"), V = () => kt() !== "off", At = /* @__PURE__ */ new Set(), jt = () => {
246
+ }, B = () => typeof window > "u" || window.dbn?.disableMetricQueryBatch ? "off" : (At(), kt() ?? "auto"), jt = () => B() !== "off", Mt = /* @__PURE__ */ new Set(), Nt = () => {
247
247
  let e;
248
- return At.forEach((t) => {
248
+ return Mt.forEach((t) => {
249
249
  if (!e) try {
250
250
  let n = t();
251
251
  n && Object.keys(n).length && (e = n);
252
252
  } catch {}
253
253
  }), e;
254
- }, Mt = "/hasuraActions/externalMetricQueryBatch", Nt = "/api/v3/metric/queryBatch", Pt = [
254
+ }, Pt = "/hasuraActions/externalMetricQueryBatch", Ft = "/api/v3/metric/queryBatch", It = [
255
255
  404,
256
256
  405,
257
257
  501
258
- ], Ft = [
258
+ ], Lt = [
259
259
  200,
260
260
  400,
261
261
  401,
262
262
  403
263
- ], It = (e) => !!e.token || !!(e.isFrontendApp && e.clientId), Lt = (e = {}) => typeof window > "u" || typeof fetch != "function" || window.dbn?.isEnableProxyAuth ? null : It(e) ? "embed" : jt() ? "platform" : null, Rt = (e = "platform") => `${window.dbn?.baseUrl || c}${e === "embed" ? Nt : Mt}`, zt = async (e, t, n = {}) => {
264
- let r = Lt(n);
265
- if (!r) throw new p("No credentials available for batched queries");
263
+ ], Rt = (e) => !!e.token || !!(e.isFrontendApp && e.clientId), zt = (e = {}) => typeof window > "u" || typeof fetch != "function" || window.dbn?.isEnableProxyAuth ? null : Rt(e) ? "embed" : Nt() ? "platform" : null, Bt = (e = "platform") => `${window.dbn?.baseUrl || o}${e === "embed" ? Ft : Pt}`, Vt = async (e, t, n = {}) => {
264
+ let r = zt(n);
265
+ if (!r) throw new m("No credentials available for batched queries");
266
266
  let i;
267
- if (r === "embed") i = await a({
268
- path: Nt,
267
+ if (r === "embed") i = await s({
268
+ path: Ft,
269
269
  method: "POST",
270
270
  signal: t,
271
271
  token: n.token,
@@ -275,9 +275,9 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
275
275
  throwOnHttpError: !1
276
276
  });
277
277
  else {
278
- let n = jt();
279
- if (!n) throw new p("No access token available for batched queries");
280
- i = await fetch(Rt(r), {
278
+ let n = Nt();
279
+ if (!n) throw new m("No access token available for batched queries");
280
+ i = await fetch(Bt(r), {
281
281
  method: "POST",
282
282
  signal: t,
283
283
  headers: {
@@ -288,57 +288,57 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
288
288
  body: JSON.stringify({ input: { input: { requests: e } } })
289
289
  });
290
290
  }
291
- if (Pt.includes(i.status)) throw new S(`Batch endpoint responded ${i.status}`);
292
- let o;
291
+ if (It.includes(i.status)) throw new b(`Batch endpoint responded ${i.status}`);
292
+ let a;
293
293
  try {
294
- o = await i.json();
294
+ a = await i.json();
295
295
  } catch {
296
- throw new S("Batch endpoint returned a non-JSON body");
296
+ throw new b("Batch endpoint returned a non-JSON body");
297
297
  }
298
- let s = o?.error && typeof o.error == "object" ? o.error : void 0;
299
- if (s && Ft.includes(i.status)) throw new p(s.message || "Unauthorized request!");
300
- if (i.status === 401 || i.status === 403) throw new p(`Batch endpoint responded ${i.status}`);
301
- if (!i.ok) throw Error(o?.message || `Batch request failed with status ${i.status}`);
302
- if (!Array.isArray(o?.results) && typeof o?.error != "string") throw new S("Batch endpoint response did not match the expected shape");
303
- return o;
304
- }, Bt = null, Vt = () => (Bt ||= new wt({
305
- transport: zt,
298
+ let o = a?.error && typeof a.error == "object" ? a.error : void 0;
299
+ if (o && Lt.includes(i.status)) throw new m(o.message || "Unauthorized request!");
300
+ if (i.status === 401 || i.status === 403) throw new m(`Batch endpoint responded ${i.status}`);
301
+ if (!i.ok) throw Error(a?.message || `Batch request failed with status ${i.status}`);
302
+ if (!Array.isArray(a?.results) && typeof a?.error != "string") throw new b("Batch endpoint response did not match the expected shape");
303
+ return a;
304
+ }, Ht = null, Ut = () => (Ht ||= new Et({
305
+ transport: Vt,
306
306
  coalesceWindowMs: 500,
307
- coalesceIdleMs: St,
308
- coalesceMaxWaitMs: Ct
309
- }), Bt), Ht = async ({ payload: e, savedMetricQuery: t, dbName: n, savedMetricIdentifiers: r, clientId: i, key: a, hints: o, session: s, single: c }) => {
310
- t !== void 0 && xe(t, "metric.query", n), qe(r);
311
- let l = Ze(e);
312
- if (!V()) return c(l);
313
- let u = Lt(s);
314
- if (!u || !vt(l, o).eligible) return c(l);
307
+ coalesceIdleMs: wt,
308
+ coalesceMaxWaitMs: Tt
309
+ }), Ht), Wt = async ({ payload: e, savedMetricQuery: t, dbName: n, savedMetricIdentifiers: r, clientId: i, key: a, hints: o, session: s, single: c }) => {
310
+ t !== void 0 && we(t, "metric.query", n), Ye(r);
311
+ let l = $e(e);
312
+ if (!jt()) return c(l);
313
+ let u = zt(s);
314
+ if (!u || !bt(l, o).eligible) return c(l);
315
315
  let d = {
316
- request: yt(a, l, i, u, s?.token),
316
+ request: xt(a, l, i, u, s?.token),
317
317
  fallback: () => c(l),
318
318
  session: s
319
319
  };
320
- return Vt().enqueue(d);
321
- }, Ut = 134217728, Wt = /* @__PURE__ */ new WeakMap(), Gt = (e, t = /* @__PURE__ */ new WeakSet()) => {
320
+ return Ut().enqueue(d);
321
+ }, Gt = 134217728, Kt = /* @__PURE__ */ new WeakMap(), qt = (e, t = /* @__PURE__ */ new WeakSet()) => {
322
322
  if (e == null) return 0;
323
323
  if (typeof e == "string") return e.length * 2;
324
324
  if (typeof e == "number" || typeof e == "bigint") return 8;
325
325
  if (typeof e == "boolean") return 4;
326
326
  if (typeof e != "object") return 0;
327
- let n = e, r = Wt.get(n);
327
+ let n = e, r = Kt.get(n);
328
328
  if (r !== void 0) return r;
329
329
  if (t.has(n)) return 0;
330
330
  t.add(n);
331
331
  let i = 32;
332
- if (Array.isArray(e)) for (let n of e) i += 8 + Gt(n, t);
333
- else for (let [n, r] of Object.entries(e)) i += n.length * 2 + 8 + Gt(r, t);
334
- return Wt.set(n, i), i;
335
- }, Kt = (e, { maxEntries: n = 128, maxBytes: r = Ut } = {}) => {
332
+ if (Array.isArray(e)) for (let n of e) i += 8 + qt(n, t);
333
+ else for (let [n, r] of Object.entries(e)) i += n.length * 2 + 8 + qt(r, t);
334
+ return Kt.set(n, i), i;
335
+ }, Jt = (e, { maxEntries: n = 128, maxBytes: r = Gt } = {}) => {
336
336
  let i = e.getQueryCache().findAll({
337
337
  queryKey: [t],
338
338
  type: "inactive"
339
339
  }).map((e) => ({
340
340
  query: e,
341
- bytes: Gt(e.state.data)
341
+ bytes: qt(e.state.data)
342
342
  })).sort((e, t) => e.query.state.dataUpdatedAt - t.query.state.dataUpdatedAt), a = i.reduce((e, t) => e + t.bytes, 0);
343
343
  for (; i.length > n || a > r && i.length > 1;) {
344
344
  let t = i.shift();
@@ -349,11 +349,11 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
349
349
  type: "inactive"
350
350
  });
351
351
  }
352
- }, qt = /* @__PURE__ */ new WeakSet(), Jt = (e) => {
353
- if (qt.has(e)) return;
354
- qt.add(e);
352
+ }, Yt = /* @__PURE__ */ new WeakSet(), Xt = (e) => {
353
+ if (Yt.has(e)) return;
354
+ Yt.add(e);
355
355
  let t = () => {
356
- qt.delete(e), Kt(e);
356
+ Yt.delete(e), Jt(e);
357
357
  }, n = globalThis.scheduler;
358
358
  if (typeof n?.postTask == "function") {
359
359
  n.postTask(t, { priority: "background" });
@@ -364,165 +364,165 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
364
364
  return;
365
365
  }
366
366
  setTimeout(t, 0);
367
- }, Yt = "dbn:metric-query:guest-principal:v1", Xt = (e) => e ? mt.default.HmacSHA256(e, Yt).toString(mt.default.enc.Hex) : void 0, H = ({ queryName: e, data: t, clientId: n, isFrontendApp: r, token: i, isFullScreen: a }) => [
367
+ }, Zt = "dbn:metric-query:guest-principal:v1", Qt = (e) => e ? gt.default.HmacSHA256(e, Zt).toString(gt.default.enc.Hex) : void 0, $t = ({ queryName: e, data: t, clientId: n, isFrontendApp: r, token: i, isFullScreen: a }) => [
368
368
  e,
369
369
  t,
370
370
  n,
371
371
  r,
372
- i ? { guestPrincipal: Xt(i) } : void 0,
372
+ i ? { guestPrincipal: Qt(i) } : void 0,
373
373
  a
374
- ], Zt = ({ clientId: e, data: n, token: r, isFrontendApp: i, isFullScreen: a = "", batchHints: s, savedMetricQuery: c, savedMetricIdentifiers: l, dbName: d, timeoutMs: f = xt }, p) => {
375
- let m = g(), _ = !!n.id && !p?.isDisableQuery && (!i || !!e), y = H({
374
+ ], en = ({ clientId: e, data: r, token: i, isFrontendApp: a, isFullScreen: o = "", batchHints: s, savedMetricQuery: c, savedMetricIdentifiers: l, dbName: u, timeoutMs: f = Ct }, p) => {
375
+ let m = g(), ee = !!r.id && !p?.isDisableQuery && (!a || !!e), te = $t({
376
376
  queryName: t,
377
- data: n,
377
+ data: r,
378
378
  clientId: e,
379
- isFrontendApp: i,
380
- token: r,
381
- isFullScreen: a
379
+ isFrontendApp: a,
380
+ token: i,
381
+ isFullScreen: o
382
382
  });
383
- F(() => {
384
- C("metric-query-enabled-state", {
385
- isQueryEnabled: _,
386
- hasMetricId: !!n.id,
383
+ P(() => {
384
+ x("metric-query-enabled-state", {
385
+ isQueryEnabled: ee,
386
+ hasMetricId: !!r.id,
387
387
  isDisableQuery: !!p?.isDisableQuery,
388
- isFrontendApp: i,
388
+ isFrontendApp: a,
389
389
  hasClientId: !!e,
390
- hasToken: !!r,
391
- isFullScreen: a,
392
- payload: u(n)
390
+ hasToken: !!i,
391
+ isFullScreen: o,
392
+ payload: d(r)
393
393
  });
394
394
  }, [
395
- _,
396
- n,
395
+ ee,
396
+ r,
397
397
  p?.isDisableQuery,
398
- i,
398
+ a,
399
399
  e,
400
- r,
401
- a
400
+ i,
401
+ o
402
402
  ]);
403
- let b = (t) => {
404
- let s = t || n;
405
- return C("metric-query-fetch-start", {
406
- path: o,
403
+ let ne = (t) => {
404
+ let s = t || r;
405
+ return x("metric-query-fetch-start", {
406
+ path: n,
407
407
  clientId: e,
408
- isFrontendApp: i,
409
- hasToken: !!r,
410
- isFullScreen: a,
411
- payload: u(s)
412
- }), v(o, {
408
+ isFrontendApp: a,
409
+ hasToken: !!i,
410
+ isFullScreen: o,
411
+ payload: d(s)
412
+ }), _(n, {
413
413
  method: "POST",
414
414
  data: {
415
415
  ...s || {},
416
- ...!i && r ? {
417
- ...Array.isArray(s?.rlsConditions) && s.rlsConditions.length ? { rlsConditions: E(s.rlsConditions, r) } : { rlsConditions: [] },
418
- ...typeof s?.globalFilters == "object" && s.globalFilters !== null && "filters" in s.globalFilters && Array.isArray(s.globalFilters.filters) && s.globalFilters.filters.length ? { globalFilters: E(s.globalFilters, r) } : { globalFilters: {
416
+ ...!a && i ? {
417
+ ...Array.isArray(s?.rlsConditions) && s.rlsConditions.length ? { rlsConditions: w(s.rlsConditions, i) } : { rlsConditions: [] },
418
+ ...typeof s?.globalFilters == "object" && s.globalFilters !== null && "filters" in s.globalFilters && Array.isArray(s.globalFilters.filters) && s.globalFilters.filters.length ? { globalFilters: w(s.globalFilters, i) } : { globalFilters: {
419
419
  tableName: "",
420
420
  filters: []
421
421
  } }
422
422
  } : {}
423
423
  },
424
- isFrontend: i,
424
+ isFrontend: a,
425
425
  clientId: e,
426
- token: r,
426
+ token: i,
427
427
  timeoutMs: f
428
428
  });
429
- }, x = T({
430
- queryKey: y,
431
- queryFn: () => (C("metric-query-dispatch", {
432
- metricId: n?.id,
433
- payload: u(n)
434
- }), Ht({
435
- payload: n,
429
+ }, v = C({
430
+ queryKey: te,
431
+ queryFn: () => (x("metric-query-dispatch", {
432
+ metricId: r?.id,
433
+ payload: d(r)
434
+ }), Wt({
435
+ payload: r,
436
436
  savedMetricQuery: c,
437
437
  savedMetricIdentifiers: l,
438
- dbName: d,
438
+ dbName: u,
439
439
  clientId: e,
440
- key: `${n?.id || "metric"}::${JSON.stringify(n)}::${e || ""}`,
440
+ key: `${r?.id || "metric"}::${JSON.stringify(r)}::${e || ""}`,
441
441
  hints: {
442
442
  ...s || {},
443
- isGuestTokenSession: !i && !!r
443
+ isGuestTokenSession: !a && !!i
444
444
  },
445
445
  session: {
446
- token: r,
447
- isFrontendApp: i,
446
+ token: i,
447
+ isFrontendApp: a,
448
448
  clientId: e
449
449
  },
450
- single: b
450
+ single: ne
451
451
  })),
452
- enabled: _,
453
- meta: r ? { persist: !1 } : void 0,
452
+ enabled: ee,
453
+ meta: i ? { persist: !1 } : void 0,
454
454
  retry: (e, t) => !h(t) && e < 2,
455
455
  staleTime: 3e5,
456
456
  gcTime: 3e5
457
- }), S = L(n);
458
- S.current = n;
459
- let w = L(p);
460
- return w.current = p, F(() => {
461
- if (!x.isSuccess) return;
462
- let e = x.data;
463
- C("metric-query-success", {
464
- payload: u(S.current),
457
+ }), y = I(r);
458
+ y.current = r;
459
+ let b = I(p);
460
+ return b.current = p, P(() => {
461
+ if (!v.isSuccess) return;
462
+ let e = v.data;
463
+ x("metric-query-success", {
464
+ payload: d(y.current),
465
465
  responseDataType: typeof e?.data,
466
466
  responseRowCount: Array.isArray(e?.data) ? e?.data?.length : void 0,
467
467
  totalRecords: e?.totalRecords
468
- }), w.current?.onSuccess?.(e), Jt(m);
468
+ }), b.current?.onSuccess?.(e), Xt(m);
469
469
  }, [
470
- x.isSuccess,
471
- x.data,
470
+ v.isSuccess,
471
+ v.data,
472
472
  m
473
- ]), F(() => () => Jt(m), [m]), F(() => {
474
- if (!x.isSuccess && !x.isError) return;
475
- let e = x.data, t = x.error;
476
- C("metric-query-settled", {
477
- payload: u(S.current),
473
+ ]), P(() => () => Xt(m), [m]), P(() => {
474
+ if (!v.isSuccess && !v.isError) return;
475
+ let e = v.data, t = v.error;
476
+ x("metric-query-settled", {
477
+ payload: d(y.current),
478
478
  hasError: !!t,
479
479
  errorMessage: t instanceof Error ? t.message : t?.message,
480
480
  responseDataType: typeof e?.data,
481
481
  responseRowCount: Array.isArray(e?.data) ? e?.data?.length : void 0
482
- }), w.current?.onSettled?.(e, t);
482
+ }), b.current?.onSettled?.(e, t);
483
483
  }, [
484
- x.isSuccess,
485
- x.isError,
486
- x.data,
487
- x.error
488
- ]), x;
489
- }, Qt = ({ workspaceId: e, token: t, isFrontend: r, encryptedClientId: i }) => v(`${n}?id=${e}`, {
484
+ v.isSuccess,
485
+ v.isError,
486
+ v.data,
487
+ v.error
488
+ ]), v;
489
+ }, V = async ({ workspaceId: e, token: t, isFrontend: n, encryptedClientId: i }) => (n && await l(), _(`${r}?id=${e}`, {
490
490
  method: "GET",
491
- token: t || "",
492
- isFrontend: r,
491
+ token: n ? "" : t || "",
492
+ isFrontend: n,
493
493
  clientId: i
494
- }), $t = (e, t, n, i) => {
495
- let { token: a } = A(), o = t || a || "";
496
- return T({
494
+ })), tn = (e, t, n, r) => {
495
+ let { token: i } = O(), o = n ? "" : t || i || "";
496
+ return C({
497
497
  queryKey: [
498
- r,
498
+ a,
499
499
  e,
500
500
  {
501
501
  token: o,
502
502
  isFrontendApp: !!n,
503
- encryptedClientId: i
503
+ encryptedClientId: r
504
504
  }
505
505
  ],
506
506
  meta: { persist: !1 },
507
- queryFn: () => Qt({
507
+ queryFn: () => V({
508
508
  workspaceId: e,
509
509
  token: o,
510
510
  isFrontend: n,
511
- encryptedClientId: i
511
+ encryptedClientId: r
512
512
  }),
513
513
  enabled: !!e
514
514
  });
515
- }, U = ({ language: e, translationDictionary: t }) => !e || !t ? !1 : Object.values(t).some((t) => !!t?.[e]), en = ({ language: e, translationDictionary: t }) => !U({
515
+ }, nn = ({ language: e, translationDictionary: t }) => !e || !t ? !1 : Object.values(t).some((t) => !!t?.[e]), rn = ({ language: e, translationDictionary: t }) => !nn({
516
516
  language: e,
517
517
  translationDictionary: t
518
- }), tn = ({ language: e, tableLimit: t, translationDictionary: n }) => en({
518
+ }), an = ({ language: e, tableLimit: t, translationDictionary: n }) => rn({
519
519
  language: e,
520
520
  translationDictionary: n
521
521
  }) ? {
522
522
  limit: String(t.limit),
523
523
  offset: String(t.offset)
524
- } : {}, nn = ({ language: e, search: t, searchColumns: n, translationDictionary: r }) => {
525
- if (!en({
524
+ } : {}, on = ({ language: e, search: t, searchColumns: n, translationDictionary: r }) => {
525
+ if (!rn({
526
526
  language: e,
527
527
  translationDictionary: r
528
528
  })) return {};
@@ -531,13 +531,13 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
531
531
  search: i && a ? i : void 0,
532
532
  searchColumns: i && a ? n : void 0
533
533
  };
534
- }, rn = ({ currentSearchValue: e, nextValue: t, shouldUseServerSideSearch: n, tableLimit: r }) => {
534
+ }, sn = ({ currentSearchValue: e, nextValue: t, shouldUseServerSideSearch: n, tableLimit: r }) => {
535
535
  let i = String(t).trim() !== (e || "").trim(), a = r.offset !== 0;
536
536
  return {
537
537
  shouldResetPageOffset: a,
538
538
  shouldSetTablePending: a || n && i
539
539
  };
540
- }, an = ({ isPythonMode: e, search: t, shouldUseServerSideSearch: n }) => e ? !0 : !n, on = ({ columnName: e, disableDownloadUnderlyingDataNoFilters: t, isLoading: n, isSingleValueChart: r }) => !n && !t && !!(e || r), sn = ({ isPrev: e, nextOffset: t, prev: n, resetValue: r }) => r === void 0 ? t === void 0 ? {
540
+ }, cn = ({ isPythonMode: e, search: t, shouldUseServerSideSearch: n }) => e ? !0 : !n, ln = ({ columnName: e, disableDownloadUnderlyingDataNoFilters: t, isLoading: n, isSingleValueChart: r }) => !n && !t && !!(e || r), un = ({ isPrev: e, nextOffset: t, prev: n, resetValue: r }) => r === void 0 ? t === void 0 ? {
541
541
  limit: n.limit,
542
542
  offset: e ? Math.max(n.offset - n.limit, 0) : n.offset + n.limit
543
543
  } : {
@@ -546,15 +546,15 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
546
546
  } : {
547
547
  limit: r,
548
548
  offset: 0
549
- }, cn = (e) => e == null ? e : M(e.toString()), ln = (e, t) => [...e ?? [], ...t ?? []].some((e) => !!e?.columnName && e.value !== void 0), un = (e = []) => e.filter((e) => e?.columnName && e.value !== void 0), W = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => {
550
- let o = un(n);
549
+ }, dn = (e) => e == null ? e : A(e.toString()), fn = (e, t) => [...e ?? [], ...t ?? []].some((e) => !!e?.columnName && e.value !== void 0), H = (e = []) => e.filter((e) => e?.columnName && e.value !== void 0), pn = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => {
550
+ let o = H(n);
551
551
  return i || !e || a === void 0 ? o : [...o.filter((t) => t.columnName !== e || String(t.value) !== String(a)), {
552
552
  columnName: e,
553
553
  dataType: t,
554
554
  expressionSql: r,
555
555
  value: a
556
556
  }];
557
- }, dn = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => W({
557
+ }, mn = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => pn({
558
558
  columnName: e,
559
559
  dataType: t,
560
560
  drillFilters: n,
@@ -565,179 +565,179 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
565
565
  columnName: e.columnName,
566
566
  dataType: e.dataType,
567
567
  expressionSql: e.expressionSql,
568
- value: cn(e.value)
569
- })), fn = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => W({
568
+ value: dn(e.value)
569
+ })), hn = ({ columnName: e, dataType: t, drillFilters: n = [], expressionSql: r, isSingleValueChart: i, value: a }) => pn({
570
570
  columnName: e,
571
571
  dataType: t,
572
572
  drillFilters: n,
573
573
  expressionSql: r,
574
574
  isSingleValueChart: i,
575
575
  value: a
576
- }), pn = ({ query: e, limit: t, offset: n, dbName: r }) => {
577
- let i = je === r?.toLowerCase(), a = [Be, De].includes(r?.toLowerCase() || ""), o = te === r?.toLowerCase(), s = (e) => n ? `OFFSET ${n} LIMIT ${e}` : `LIMIT ${e}`, c = gt(e), l = (c?.toLowerCase() ?? "").includes("order"), u = parseInt(t, 10);
576
+ }), gn = ({ query: e, limit: t, offset: n, dbName: r }) => {
577
+ let i = Ne === r?.toLowerCase(), a = [He, Ae].includes(r?.toLowerCase() || ""), o = ie === r?.toLowerCase(), s = (e) => n ? `OFFSET ${n} LIMIT ${e}` : `LIMIT ${e}`, c = vt(e), l = (c?.toLowerCase() ?? "").includes("order"), u = parseInt(t, 10);
578
578
  if (c?.toLowerCase().includes("limit")) {
579
579
  let e = parseInt(c?.toLowerCase().split("limit")?.[1]?.trim() ?? "0", 10), r = n ? t : Math.min(e, u);
580
580
  o ? (c = c.replace(`limit ${e}`, s(r)), c = c.replace(`LIMIT ${e}`, s(r))) : a || i ? (c = c.replace(`limit ${e}`, `${l || i || o ? "" : "order by(select null)"} ${`offset ${n || 0} rows`} fetch next ${r} rows only`), c = c.replace(`LIMIT ${e}`, `${l || i || o ? "" : " ORDER BY(SELECT NULL) "} OFFSET ${n || 0} ROWS FETCH NEXT ${r} ROWS ONLY`)) : (c = c.replace(`limit ${e}`, `limit ${r} ${n ? `OFFSET ${n}` : ""}`), c = c.replace(`LIMIT ${e}`, `LIMIT ${r} ${n ? `OFFSET ${n}` : ""}`));
581
581
  } else c?.toLowerCase().includes("fetch") || c?.toLowerCase().includes("limit") || (r?.toLowerCase() === "mssql" || r?.toLowerCase() === "athena" || r?.toLowerCase() === "microsoft fabric" ? c += ` ${l || i || o ? "" : " ORDER BY(SELECT NULL) "} ${`offset ${n || 0} rows`} fetch next ${u} rows only` : c += o ? ` ${s(u)}` : ` limit ${u} ${n ? `OFFSET ${n}` : ""}`);
582
582
  return c;
583
- }, mn = (e) => {
583
+ }, _n = (e) => {
584
584
  try {
585
585
  return JSON.stringify(e);
586
586
  } catch {
587
587
  return String(Date.now()) + ":" + Math.random().toString(36).slice(2);
588
588
  }
589
- }, hn = (e, t) => {
589
+ }, vn = (e, t) => {
590
590
  let n = t?.data, r = typeof t?.totalRecords == "number" ? t.totalRecords : 0, i = n && Array.isArray(n) && n.length ? n : [];
591
591
  e.forEach((e) => {
592
592
  e.setTotalRecords?.(r), e.setData(i), e.setLoading(!1);
593
593
  });
594
- }, gn = (e) => {
594
+ }, yn = (e) => {
595
595
  e.forEach((e) => {
596
596
  e.onError?.(), e.setData([]), e.setLoading(!1), e.setTotalRecords?.(0);
597
597
  });
598
- }, _n = ({ datasourceId: e, clientName: t, dbName: n, tenancyType: r, values: i, query: a, companyId: o, workspaceId: s, metricId: c, dashboardId: l, token: u, isFrontendApp: d, encryptedClientId: f, globalFilters: p, isAllClient: m, rlsConditions: h, dataMartRelationships: g, customSql: _, isEnableCustomSQL: v, drillFilters: y }) => {
599
- let { mutateAsync: x } = b(), { data: S } = $t(s, void 0, d, f), C = S?.weekStartDay === "sunday" ? "sunday" : "monday", w = L(/* @__PURE__ */ new Map()), T = L({
598
+ }, bn = ({ datasourceId: e, clientName: t, dbName: n, tenancyType: r, values: i, query: a, companyId: o, workspaceId: s, metricId: c, dashboardId: l, token: u, isFrontendApp: d, encryptedClientId: f, globalFilters: p, isAllClient: m, rlsConditions: ee, dataMartRelationships: h, customSql: g, isEnableCustomSQL: te, drillFilters: _ }) => {
599
+ let { mutateAsync: ne } = v(), { data: y } = tn(s, void 0, d, f), b = y?.weekStartDay === "sunday" ? "sunday" : "monday", x = I(/* @__PURE__ */ new Map()), S = I({
600
600
  token: u,
601
601
  epoch: 0
602
602
  });
603
- T.current.token !== u && (T.current = {
603
+ S.current.token !== u && (S.current = {
604
604
  token: u,
605
- epoch: T.current.epoch + 1
605
+ epoch: S.current.epoch + 1
606
606
  });
607
- let ee = T.current.epoch;
608
- return F(() => {
609
- let e = w.current;
607
+ let C = S.current.epoch;
608
+ return P(() => {
609
+ let e = x.current;
610
610
  return () => {
611
611
  e.clear();
612
612
  };
613
- }, []), { getUnderlyingData: P(({ columnName: b, dataType: S, expressionSql: T, value: E, setData: te, setLoading: D, isSingleValueChart: O, clientColumnType: ne, limit: re, offset: k, search: ie, searchColumns: ae, setTotalRecords: oe, pointFilters: se, onError: ce, withoutFilters: le }) => {
614
- let ue = r === "MULTI_DATABASE" && t || "", de = v && _ ? _ : re !== void 0 || k !== void 0 ? a : pn({
613
+ }, []), { getUnderlyingData: N(({ columnName: v, dataType: y, expressionSql: S, value: re, setData: w, setLoading: ie, isSingleValueChart: T, clientColumnType: ae, limit: oe, offset: se, search: E, searchColumns: ce, setTotalRecords: le, pointFilters: ue, onError: de, withoutFilters: fe }) => {
614
+ let pe = r === "MULTI_DATABASE" && t || "", me = te && g ? g : oe !== void 0 || se !== void 0 ? a : gn({
615
615
  query: a,
616
616
  limit: "5000",
617
617
  dbName: n
618
- }), fe = le ? {
618
+ }), he = fe ? {
619
619
  ...p,
620
620
  filters: p.filters.filter((e) => e.isVariableFilter)
621
- } : p, pe = h, me = Je({
622
- clientColumnType: ne,
623
- query: de || "",
621
+ } : p, ge = ee, _e = Xe({
622
+ clientColumnType: ae,
623
+ query: me || "",
624
624
  dbName: n,
625
- rlsConditions: pe,
625
+ rlsConditions: ge,
626
626
  tenancyLevel: r || "TABLE",
627
627
  clientId: t,
628
- globalFilters: fe,
628
+ globalFilters: he,
629
629
  values: i,
630
630
  isAllClient: m,
631
- dataMartRelationships: g,
632
- weekStartDay: C
633
- }), he = O && !v ? at(me) : me, ge = ln(y, se) ? dn({
634
- columnName: b,
635
- dataType: S,
636
- drillFilters: se?.length ? [...y ?? [], ...se] : y,
637
- expressionSql: T,
638
- isSingleValueChart: O,
639
- value: E
640
- }) : [], A = {
641
- columnName: O ? void 0 : b,
631
+ dataMartRelationships: h,
632
+ weekStartDay: b
633
+ }), ve = T && !te ? st(_e) : _e, ye = fn(_, ue) ? mn({
634
+ columnName: v,
635
+ dataType: y,
636
+ drillFilters: ue?.length ? [..._ ?? [], ...ue] : _,
637
+ expressionSql: S,
638
+ isSingleValueChart: T,
639
+ value: re
640
+ }) : [], D = {
641
+ columnName: T ? void 0 : v,
642
642
  companyId: o,
643
- query: Fe(he, o),
644
- dataType: O ? void 0 : S,
645
- expressionSql: O ? void 0 : T,
646
- value: O ? void 0 : cn(E),
647
- drillFilters: ge.length ? ge : void 0,
643
+ query: M(ve, o),
644
+ dataType: T ? void 0 : y,
645
+ expressionSql: T ? void 0 : S,
646
+ value: T ? void 0 : dn(re),
647
+ drillFilters: ye.length ? ye : void 0,
648
648
  workspaceId: s,
649
649
  metricId: c,
650
650
  dashboardId: l,
651
- isCustomSql: v && !!_,
652
- databaseName: ue,
651
+ isCustomSql: te && !!g,
652
+ databaseName: pe,
653
653
  datasourceId: e,
654
- limit: re,
655
- offset: k,
656
- search: ie,
657
- searchColumns: ae,
658
- globalFilters: fe,
659
- rlsConditions: pe,
654
+ limit: oe,
655
+ offset: se,
656
+ search: E,
657
+ searchColumns: ce,
658
+ globalFilters: he,
659
+ rlsConditions: ge,
660
660
  filterValues: i,
661
- isSingleValueChart: O && !v
661
+ isSingleValueChart: T && !te
662
662
  };
663
- te([]), D(!0);
664
- let j = mn({
665
- columnName: A.columnName,
666
- value: A.value,
667
- dataType: A.dataType,
668
- expressionSql: A.expressionSql,
669
- drillFilters: A.drillFilters,
670
- limit: A.limit,
671
- offset: A.offset,
672
- search: A.search,
673
- searchColumns: A.searchColumns,
674
- finalQuery: he,
675
- companyId: A.companyId,
676
- workspaceId: A.workspaceId,
677
- metricId: A.metricId,
678
- dashboardId: A.dashboardId,
679
- datasourceId: A.datasourceId,
680
- databaseName: A.databaseName,
681
- isCustomSql: A.isCustomSql,
682
- isSingleValueChart: O,
683
- principal: `${+!!d}|${f || ""}|${ee}`
684
- }), _e = {
685
- setData: te,
686
- setLoading: D,
687
- setTotalRecords: oe,
688
- onError: ce
689
- }, M = w.current.get(j);
690
- if (M) {
691
- M.subscribers.add(_e);
663
+ w([]), ie(!0);
664
+ let O = _n({
665
+ columnName: D.columnName,
666
+ value: D.value,
667
+ dataType: D.dataType,
668
+ expressionSql: D.expressionSql,
669
+ drillFilters: D.drillFilters,
670
+ limit: D.limit,
671
+ offset: D.offset,
672
+ search: D.search,
673
+ searchColumns: D.searchColumns,
674
+ finalQuery: ve,
675
+ companyId: D.companyId,
676
+ workspaceId: D.workspaceId,
677
+ metricId: D.metricId,
678
+ dashboardId: D.dashboardId,
679
+ datasourceId: D.datasourceId,
680
+ databaseName: D.databaseName,
681
+ isCustomSql: D.isCustomSql,
682
+ isSingleValueChart: T,
683
+ principal: `${+!!d}|${f || ""}|${C}`
684
+ }), k = {
685
+ setData: w,
686
+ setLoading: ie,
687
+ setTotalRecords: le,
688
+ onError: de
689
+ }, be = x.current.get(O);
690
+ if (be) {
691
+ be.subscribers.add(k);
692
692
  return;
693
693
  }
694
- let ve = /* @__PURE__ */ new Set([_e]);
695
- w.current.set(j, { subscribers: ve }), x({
696
- data: A,
694
+ let A = /* @__PURE__ */ new Set([k]);
695
+ x.current.set(O, { subscribers: A }), ne({
696
+ data: D,
697
697
  token: u || "",
698
698
  isFrontendApp: d,
699
699
  encryptedClientId: d && f || ""
700
700
  }).then((e) => {
701
- let t = w.current.get(j);
702
- w.current.delete(j), hn(t?.subscribers ?? ve, e);
701
+ let t = x.current.get(O);
702
+ x.current.delete(O), vn(t?.subscribers ?? A, e);
703
703
  }).catch(() => {
704
- let e = w.current.get(j);
705
- w.current.delete(j), gn(e?.subscribers ?? ve);
704
+ let e = x.current.get(O);
705
+ x.current.delete(O), yn(e?.subscribers ?? A);
706
706
  });
707
707
  }, [
708
708
  t,
709
709
  o,
710
- _,
711
710
  g,
711
+ h,
712
712
  e,
713
713
  n,
714
- y,
714
+ _,
715
715
  p,
716
716
  m,
717
- v,
717
+ te,
718
718
  c,
719
719
  l,
720
720
  u,
721
721
  d,
722
722
  f,
723
- ee,
723
+ C,
724
724
  a,
725
- h,
725
+ ee,
726
726
  r,
727
- x,
727
+ ne,
728
728
  i,
729
- C,
729
+ b,
730
730
  s
731
731
  ]) };
732
- }, vn = [
732
+ }, xn = [
733
733
  "backend-cap",
734
734
  "metric-limit",
735
735
  "client-window",
736
736
  "chart-coverage"
737
- ], yn = (e) => typeof e == "string" && vn.includes(e), bn = (e) => typeof e == "number" && Number.isFinite(e) && e >= 0, G = (e) => e.of === null ? Infinity : Math.max(0, e.of - e.at), K = (e) => {
738
- let t = e[0], n = G(t);
737
+ ], Sn = (e) => typeof e == "string" && xn.includes(e), U = (e) => typeof e == "number" && Number.isFinite(e) && e >= 0, W = (e) => e.of === null ? Infinity : Math.max(0, e.of - e.at), Cn = (e) => {
738
+ let t = e[0], n = W(t);
739
739
  for (let r = 1; r < e.length; r += 1) {
740
- let i = G(e[r]);
740
+ let i = W(e[r]);
741
741
  i > n && (t = e[r], n = i);
742
742
  }
743
743
  return {
@@ -746,11 +746,11 @@ var z = l(), mt = /* @__PURE__ */ e(fe()), ht = /;\s*$/, gt = (e) => e.replace(h
746
746
  by: t.by,
747
747
  stages: e
748
748
  };
749
- }, xn = (e) => ({
749
+ }, wn = (e) => ({
750
750
  rows: e,
751
751
  truncated: null
752
752
  });
753
- function Sn(e, t, n) {
753
+ function Tn(e, t, n) {
754
754
  let r = e.rows.length, i = n.length;
755
755
  if (i >= r) return e;
756
756
  let a = {
@@ -760,42 +760,42 @@ function Sn(e, t, n) {
760
760
  };
761
761
  return {
762
762
  rows: n,
763
- truncated: K(e.truncated ? [...e.truncated.stages, a] : [a])
763
+ truncated: Cn(e.truncated ? [...e.truncated.stages, a] : [a])
764
764
  };
765
765
  }
766
- function Cn(e, t) {
766
+ function En(e, t) {
767
767
  if (!e || typeof e != "object") return null;
768
768
  let n = e, r = Array.isArray(n.stages) ? n.stages : [], i = [];
769
769
  for (let e of r) {
770
770
  if (!e || typeof e != "object") continue;
771
771
  let { by: t, at: n, of: r } = e;
772
- yn(t) && bn(n) && i.push({
772
+ Sn(t) && U(n) && i.push({
773
773
  by: t,
774
774
  at: n,
775
- of: bn(r) ? r : null
775
+ of: U(r) ? r : null
776
776
  });
777
777
  }
778
778
  if (!i.length) {
779
- if (!yn(n.by) || !bn(n.at)) return null;
779
+ if (!Sn(n.by) || !U(n.at)) return null;
780
780
  i.push({
781
781
  by: n.by,
782
782
  at: n.at,
783
- of: bn(n.of) ? n.of : null
783
+ of: U(n.of) ? n.of : null
784
784
  });
785
785
  }
786
- if (bn(t)) {
786
+ if (U(t)) {
787
787
  let e = i[i.length - 1];
788
788
  e.at !== t && (i[i.length - 1] = {
789
789
  ...e,
790
790
  at: t
791
791
  });
792
792
  }
793
- return K(i);
793
+ return Cn(i);
794
794
  }
795
- function wn(e, t = (e) => e.toLocaleString()) {
795
+ function Dn(e, t = (e) => e.toLocaleString()) {
796
796
  return e ? e.of === null ? `Displaying the first ${t(e.at)} rows` : `Displaying ${t(e.at)} of ${t(e.of)}` : null;
797
797
  }
798
- var Tn = {
798
+ var G = {
799
799
  timeSeriesSettingsContainer: "_timeSeriesSettingsContainer_dnv9l_8",
800
800
  timeSeriesSettingsType: "_timeSeriesSettingsType_dnv9l_12",
801
801
  featToggle: "_featToggle_dnv9l_16",
@@ -803,7 +803,7 @@ var Tn = {
803
803
  dynamicFormat: "_dynamicFormat_dnv9l_24",
804
804
  wrapper: "_wrapper_dnv9l_27",
805
805
  inputWrapper: "_inputWrapper_dnv9l_30"
806
- }, q = [
806
+ }, On = [
807
807
  {
808
808
  value: "line",
809
809
  label: "line"
@@ -824,7 +824,7 @@ var Tn = {
824
824
  value: "combo",
825
825
  label: "combo"
826
826
  }
827
- ], J = [
827
+ ], K = [
828
828
  {
829
829
  value: "Daily",
830
830
  label: "Daily"
@@ -845,7 +845,7 @@ var Tn = {
845
845
  value: "Yearly",
846
846
  label: "Yearly"
847
847
  }
848
- ], En = ({ onChange: e, settings: { groupBySettings: t, seriesType: n }, yAxisList: r, onChangeTimeseriesFormat: i, globalFilterOptions: a }) => {
848
+ ], kn = ({ onChange: e, settings: { groupBySettings: t, seriesType: n }, yAxisList: r, onChangeTimeseriesFormat: i, globalFilterOptions: a }) => {
849
849
  let o = (n, r) => {
850
850
  if (t?.options?.[n]?.split("____").length) {
851
851
  let i = `${t?.options?.[n]?.split("____")?.[0]}____${r}`, a = `${t?.options?.[n]?.split("____")?.[0]}`;
@@ -869,16 +869,16 @@ var Tn = {
869
869
  }));
870
870
  }
871
871
  };
872
- return /* @__PURE__ */ (0, z.jsxs)("div", {
873
- className: Tn.timeSeriesSettingsContainer,
872
+ return /* @__PURE__ */ (0, R.jsxs)("div", {
873
+ className: G.timeSeriesSettingsContainer,
874
874
  children: [
875
- /* @__PURE__ */ (0, z.jsx)(ce, {
875
+ /* @__PURE__ */ (0, R.jsx)(fe, {
876
876
  variant: "heading-5",
877
877
  children: "Time Series Settings"
878
878
  }),
879
- /* @__PURE__ */ (0, z.jsx)(j, {
879
+ /* @__PURE__ */ (0, R.jsx)(k, {
880
880
  label: "Series Type",
881
- options: q,
881
+ options: On,
882
882
  selectedOption: {
883
883
  value: n?.[0]?.type || "bar",
884
884
  label: n?.[0]?.type || "bar"
@@ -895,14 +895,14 @@ var Tn = {
895
895
  menuWidth: "100%",
896
896
  buttonWidth: "100%"
897
897
  }),
898
- /* @__PURE__ */ (0, z.jsx)(ce, {
898
+ /* @__PURE__ */ (0, R.jsx)(fe, {
899
899
  variant: "body-text-2",
900
900
  children: "Group format"
901
901
  }),
902
- /* @__PURE__ */ (0, z.jsxs)("div", {
903
- className: Tn.timeSeriesSettingsType,
902
+ /* @__PURE__ */ (0, R.jsxs)("div", {
903
+ className: G.timeSeriesSettingsType,
904
904
  children: [
905
- /* @__PURE__ */ (0, z.jsx)(ct, {
905
+ /* @__PURE__ */ (0, R.jsx)(ut, {
906
906
  "data-testid": "group-default",
907
907
  id: "group-default",
908
908
  type: "radio",
@@ -914,21 +914,21 @@ var Tn = {
914
914
  ...e.groupBySettings,
915
915
  value: "monthly",
916
916
  isDynamic: !1,
917
- options: J?.map((e) => e.value),
917
+ options: K?.map((e) => e.value),
918
918
  isGlobalFilter: !1,
919
919
  globalFilterOption: {
920
920
  label: "",
921
921
  value: ""
922
922
  }
923
923
  }
924
- })), i?.(J?.[2]));
924
+ })), i?.(K?.[2]));
925
925
  },
926
926
  name: "isDynamic",
927
927
  label: "Default",
928
928
  defaultChecked: !t.isDynamic && !t.isGlobalFilter,
929
929
  checked: !t.isDynamic && !t.isGlobalFilter
930
930
  }),
931
- /* @__PURE__ */ (0, z.jsx)(ct, {
931
+ /* @__PURE__ */ (0, R.jsx)(ut, {
932
932
  "data-testid": "group-dynamic",
933
933
  id: "group-dynamic",
934
934
  type: "radio",
@@ -944,7 +944,7 @@ var Tn = {
944
944
  ...e.groupBySettings,
945
945
  value: "monthly",
946
946
  isDynamic: !0,
947
- options: J?.map((e) => e.value),
947
+ options: K?.map((e) => e.value),
948
948
  fillXAxis: !1,
949
949
  isGlobalFilter: !1,
950
950
  globalFilterOption: {
@@ -952,10 +952,10 @@ var Tn = {
952
952
  value: ""
953
953
  }
954
954
  }
955
- })), i?.(J?.[2]));
955
+ })), i?.(K?.[2]));
956
956
  }
957
957
  }),
958
- /* @__PURE__ */ (0, z.jsx)(ct, {
958
+ /* @__PURE__ */ (0, R.jsx)(ut, {
959
959
  "data-testid": "group-global-filters",
960
960
  id: "group-global-filters",
961
961
  type: "radio",
@@ -971,7 +971,7 @@ var Tn = {
971
971
  ...e.groupBySettings,
972
972
  value: "daily",
973
973
  isDynamic: !1,
974
- options: J?.map((e) => e.value),
974
+ options: K?.map((e) => e.value),
975
975
  fillXAxis: !1,
976
976
  isGlobalFilter: !0,
977
977
  globalFilterOption: {
@@ -979,17 +979,17 @@ var Tn = {
979
979
  value: ""
980
980
  }
981
981
  }
982
- })), i?.(J?.[0]));
982
+ })), i?.(K?.[0]));
983
983
  }
984
984
  })
985
985
  ]
986
986
  }),
987
- t.isDynamic ? /* @__PURE__ */ (0, z.jsxs)("div", {
988
- className: Tn.dynamicFormat,
989
- children: [/* @__PURE__ */ (0, z.jsx)(D, {
987
+ t.isDynamic ? /* @__PURE__ */ (0, R.jsxs)("div", {
988
+ className: G.dynamicFormat,
989
+ children: [/* @__PURE__ */ (0, R.jsx)(T, {
990
990
  buttonWidth: "100%",
991
991
  menuWidth: "100%",
992
- options: J,
992
+ options: K,
993
993
  selectedOption: t.options?.map((e) => e.split("____").length ? {
994
994
  value: e.split("____")[0],
995
995
  label: e.split("____")[0]
@@ -1006,15 +1006,15 @@ var Tn = {
1006
1006
  value: Array.isArray(t) && t.length ? t[0].value : "monthly",
1007
1007
  options: t?.map((e) => e.value) || ["monthly"],
1008
1008
  fillXAxis: ![
1009
- Xe.daily,
1010
- Xe.weekly,
1011
- Xe.yearly
1009
+ Qe.daily,
1010
+ Qe.weekly,
1011
+ Qe.yearly
1012
1012
  ].includes(Array.isArray(t) && t.length ? t[0].value : "monthly") && e.groupBySettings.fillXAxis
1013
1013
  }
1014
- })), i?.(t?.[0] || J?.[2]);
1014
+ })), i?.(t?.[0] || K?.[2]);
1015
1015
  },
1016
1016
  isShowSelectedOptions: !0
1017
- }), t.options?.map((e, t) => /* @__PURE__ */ (0, z.jsx)(re, {
1017
+ }), t.options?.map((e, t) => /* @__PURE__ */ (0, R.jsx)(se, {
1018
1018
  label: e.split("____").length > 1 ? e.split("____")[0] : e,
1019
1019
  type: "text",
1020
1020
  value: e.split("____").length > 1 ? e.split("____")[1] : e,
@@ -1023,8 +1023,8 @@ var Tn = {
1023
1023
  o(t, e.target.value);
1024
1024
  }
1025
1025
  }))]
1026
- }) : /* @__PURE__ */ (0, z.jsxs)(z.Fragment, { children: [
1027
- t?.isGlobalFilter && /* @__PURE__ */ (0, z.jsxs)(z.Fragment, { children: [/* @__PURE__ */ (0, z.jsx)(j, {
1026
+ }) : /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [
1027
+ t?.isGlobalFilter && /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [/* @__PURE__ */ (0, R.jsx)(k, {
1028
1028
  label: "Dashboard Filter",
1029
1029
  menuWidth: "100%",
1030
1030
  buttonWidth: "100%",
@@ -1043,14 +1043,14 @@ var Tn = {
1043
1043
  }
1044
1044
  }));
1045
1045
  }
1046
- }), !!t?.globalFilterOption?.presetDateOptions?.length && /* @__PURE__ */ (0, z.jsx)(ke, {
1046
+ }), !!t?.globalFilterOption?.presetDateOptions?.length && /* @__PURE__ */ (0, R.jsx)(j, {
1047
1047
  direction: "col",
1048
1048
  className: "dbn:gap-3",
1049
- children: J?.map((n) => /* @__PURE__ */ (0, z.jsxs)(ke, {
1049
+ children: K?.map((n) => /* @__PURE__ */ (0, R.jsxs)(j, {
1050
1050
  className: "dbn:w-full dbn:gap-2",
1051
1051
  alignItems: "center",
1052
1052
  justify: "between",
1053
- children: [/* @__PURE__ */ (0, z.jsx)(Ke, {
1053
+ children: [/* @__PURE__ */ (0, R.jsx)(Je, {
1054
1054
  checked: !!t?.formatWithValue?.find((e) => e.format === n.value && e.isEnable),
1055
1055
  onChange: ({ target: { checked: t } }) => {
1056
1056
  e((e) => ({
@@ -1066,9 +1066,9 @@ var Tn = {
1066
1066
  }));
1067
1067
  },
1068
1068
  label: n.value
1069
- }), /* @__PURE__ */ (0, z.jsx)("div", {
1069
+ }), /* @__PURE__ */ (0, R.jsx)("div", {
1070
1070
  className: "dbn:w-full",
1071
- children: /* @__PURE__ */ (0, z.jsx)(j, {
1071
+ children: /* @__PURE__ */ (0, R.jsx)(k, {
1072
1072
  placeholder: "Select a Filter Value",
1073
1073
  menuWidth: "100%",
1074
1074
  buttonWidth: "100%",
@@ -1095,12 +1095,12 @@ var Tn = {
1095
1095
  })]
1096
1096
  }))
1097
1097
  })] }),
1098
- /* @__PURE__ */ (0, z.jsx)(j, {
1098
+ /* @__PURE__ */ (0, R.jsx)(k, {
1099
1099
  label: "Format Type",
1100
1100
  menuWidth: "100%",
1101
1101
  buttonWidth: "100%",
1102
- options: J,
1103
- selectedOption: J?.find((e) => e.value?.toLowerCase() === t?.value?.toLowerCase()) || J?.[2],
1102
+ options: K,
1103
+ selectedOption: K?.find((e) => e.value?.toLowerCase() === t?.value?.toLowerCase()) || K?.[2],
1104
1104
  onChange: (t) => {
1105
1105
  e((e) => ({
1106
1106
  ...e,
@@ -1111,9 +1111,9 @@ var Tn = {
1111
1111
  })), i?.(t);
1112
1112
  }
1113
1113
  }),
1114
- [Xe.month, Xe.quarter].includes(t?.value?.toLowerCase()) && /* @__PURE__ */ (0, z.jsxs)("div", {
1115
- className: Tn.featToggle,
1116
- children: [/* @__PURE__ */ (0, z.jsx)(dt, {
1114
+ [Qe.month, Qe.quarter].includes(t?.value?.toLowerCase()) && /* @__PURE__ */ (0, R.jsxs)("div", {
1115
+ className: G.featToggle,
1116
+ children: [/* @__PURE__ */ (0, R.jsx)(pt, {
1117
1117
  name: "fill axis",
1118
1118
  enabled: t.fillXAxis,
1119
1119
  onChange: () => e((e) => ({
@@ -1123,12 +1123,12 @@ var Tn = {
1123
1123
  fillXAxis: !e.groupBySettings.fillXAxis
1124
1124
  }
1125
1125
  }))
1126
- }), /* @__PURE__ */ (0, z.jsxs)("span", {
1126
+ }), /* @__PURE__ */ (0, R.jsxs)("span", {
1127
1127
  className: "dbn:flex dbn:gap-2 dbn:items-center",
1128
- children: [/* @__PURE__ */ (0, z.jsx)(ce, {
1128
+ children: [/* @__PURE__ */ (0, R.jsx)(fe, {
1129
1129
  variant: "body-text-2",
1130
1130
  children: "Fill X-axis"
1131
- }), /* @__PURE__ */ (0, z.jsx)(pe, {
1131
+ }), /* @__PURE__ */ (0, R.jsx)(_e, {
1132
1132
  position: "top",
1133
1133
  iconConfig: {
1134
1134
  size: "xs",
@@ -1142,15 +1142,15 @@ var Tn = {
1142
1142
  ] })
1143
1143
  ]
1144
1144
  });
1145
- }, Dn = [
1145
+ }, An = [
1146
1146
  "dashboardId",
1147
1147
  "configId",
1148
1148
  "embed",
1149
1149
  "isDbn"
1150
- ], On = (e) => `dbn.${e}.`, kn = "drill.", An = (e) => {
1150
+ ], jn = (e) => `dbn.${e}.`, Mn = "drill.", Nn = (e) => {
1151
1151
  let t = encodeURIComponent(e.levelIndex);
1152
1152
  return e.filters?.length ? `${t}~${e.filters.map((e) => `${encodeURIComponent(e.columnName)}:${encodeURIComponent(String(e.value ?? ""))}`).join("|")}` : t;
1153
- }, jn = (e) => {
1153
+ }, Pn = (e) => {
1154
1154
  if (!e) return null;
1155
1155
  let t = e.indexOf("~"), n = t === -1 ? e : e.slice(0, t), r = decodeURIComponent(n);
1156
1156
  return r ? t === -1 ? {
@@ -1168,18 +1168,18 @@ var Tn = {
1168
1168
  } : null;
1169
1169
  }).filter((e) => e !== null)
1170
1170
  } : null;
1171
- }, Mn = (e, t) => {
1171
+ }, q = (e, t) => {
1172
1172
  if (!t) return {};
1173
- let n = `${On(t)}${kn}`, r = {};
1173
+ let n = `${jn(t)}${Mn}`, r = {};
1174
1174
  return new URLSearchParams(e).forEach((e, t) => {
1175
1175
  if (!t.startsWith(n)) return;
1176
- let i = t.slice(n.length), a = jn(e);
1176
+ let i = t.slice(n.length), a = Pn(e);
1177
1177
  i && a && (r[i] = a);
1178
1178
  }), r;
1179
- }, Y = ({ currentSearch: e, dashboardId: t, entries: n, legacyGlobals: r = {}, namespaced: i = !0 }) => {
1179
+ }, Fn = ({ currentSearch: e, dashboardId: t, entries: n, legacyGlobals: r = {}, namespaced: i = !0 }) => {
1180
1180
  if (!i) {
1181
1181
  let e = new URLSearchParams();
1182
- return Dn.forEach((n) => {
1182
+ return An.forEach((n) => {
1183
1183
  let i = r[n];
1184
1184
  if (n === "dashboardId") {
1185
1185
  e.set(n, t ?? "");
@@ -1192,7 +1192,7 @@ var Tn = {
1192
1192
  }
1193
1193
  let a = new URLSearchParams(e);
1194
1194
  if (!t) return a;
1195
- let o = On(t), s = [];
1195
+ let o = jn(t), s = [];
1196
1196
  return a.forEach((e, t) => {
1197
1197
  t.startsWith(o) && s.push(t);
1198
1198
  }), s.forEach((e) => {
@@ -1200,7 +1200,7 @@ var Tn = {
1200
1200
  }), n.forEach(({ key: e, value: t }) => {
1201
1201
  a.set(`${o}${e}`, t);
1202
1202
  }), a;
1203
- }, Nn = (e, t) => {
1203
+ }, In = (e, t) => {
1204
1204
  let n = e?.levels;
1205
1205
  if (!e || !n?.length) return null;
1206
1206
  let r = n.findIndex((e) => e?.index === t.levelIndex);
@@ -1216,8 +1216,8 @@ var Tn = {
1216
1216
  filters: n > r ? [] : e?.filters
1217
1217
  })
1218
1218
  };
1219
- }, Pn = (e, t) => {
1220
- let n = new URLSearchParams(e), r = {}, i = {}, a = t ? On(t) : null, o = (e, t, n) => {
1219
+ }, Ln = (e, t) => {
1220
+ let n = new URLSearchParams(e), r = {}, i = {}, a = t ? jn(t) : null, o = (e, t, n) => {
1221
1221
  let r = n.includes(";;") ? n.split(";;") : n, i = e[t];
1222
1222
  if (i === void 0) {
1223
1223
  e[t] = r;
@@ -1240,25 +1240,25 @@ var Tn = {
1240
1240
  };
1241
1241
  //#endregion
1242
1242
  //#region src/core/metric-builder/crossFilter.ts
1243
- function Fn(e, t, n) {
1243
+ function Rn(e, t, n) {
1244
1244
  return t === "DATABASE" ? `${n}.${e?.split(".").slice(1).join(".")}` : e;
1245
1245
  }
1246
- var In = (e) => {
1246
+ var zn = (e) => {
1247
1247
  let t = e?.table?.schemaName, n = e?.table?.tableName;
1248
1248
  if (t && n) return `${t}.${n}`;
1249
- }, X = (e) => typeof e == "string" && !!e.trim(), Ln = (e, t) => t?.find((t) => t?.alias === e || t?.name === e), Rn = ({ columnName: e, selectedDims: t }) => {
1250
- if (!X(e)) return;
1249
+ }, J = (e) => typeof e == "string" && !!e.trim(), Bn = (e, t) => t?.find((t) => t?.alias === e || t?.name === e), Vn = ({ columnName: e, selectedDims: t }) => {
1250
+ if (!J(e)) return;
1251
1251
  if (!t?.length) return e;
1252
- let n = Ln(e, t);
1253
- if (n && In(n)) return X(n.name) ? n.name : e;
1254
- }, zn = "This filter column is no longer available. Refresh the metric and select a column before filtering.", Bn = ({ columnName: e, rowFilters: t, selectedDims: n, requiresSchemaMetadata: r = !1 }) => {
1252
+ let n = Bn(e, t);
1253
+ if (n && zn(n)) return J(n.name) ? n.name : e;
1254
+ }, Hn = "This filter column is no longer available. Refresh the metric and select a column before filtering.", Un = ({ columnName: e, rowFilters: t, selectedDims: n, requiresSchemaMetadata: r = !1 }) => {
1255
1255
  let i = t?.length ? t.map((e) => e.columnName) : e === void 0 ? [] : [e];
1256
- return i.some((e) => !X(e)) || (t?.length || r) && !n?.length || i.some((e) => !!n?.length && !Rn({
1256
+ return i.some((e) => !J(e)) || (t?.length || r) && !n?.length || i.some((e) => !!n?.length && !Vn({
1257
1257
  columnName: e,
1258
1258
  selectedDims: n
1259
- })) ? zn : void 0;
1259
+ })) ? Hn : void 0;
1260
1260
  };
1261
- function Vn(e) {
1261
+ function Y(e) {
1262
1262
  let t = e.value === null || e.value === void 0, n = t ? "null" : e.value;
1263
1263
  return {
1264
1264
  columnName: e.columnName,
@@ -1266,7 +1266,7 @@ function Vn(e) {
1266
1266
  isAddOnMetrics: !0,
1267
1267
  name: "cross-filter",
1268
1268
  options: [n],
1269
- tableName: Fn(e.tableName, e.tenancyLevel, e.clientId),
1269
+ tableName: Rn(e.tableName, e.tenancyLevel, e.clientId),
1270
1270
  value: [n],
1271
1271
  ...t ? { filterVariant: {
1272
1272
  label: "IN",
@@ -1274,17 +1274,17 @@ function Vn(e) {
1274
1274
  } } : {}
1275
1275
  };
1276
1276
  }
1277
- function Hn({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filterValue: i, columnName: a, rowFilters: o, selectedDims: s, activeLevelTableName: c, tenancyLevel: l, clientId: u }) {
1277
+ function Wn({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filterValue: i, columnName: a, rowFilters: o, selectedDims: s, activeLevelTableName: c, tenancyLevel: l, clientId: u }) {
1278
1278
  if (t || n) return [];
1279
- let d = i != null && X(a);
1279
+ let d = i != null && J(a);
1280
1280
  if (!((d || o?.length) && r)) return [];
1281
1281
  if (o?.length) {
1282
1282
  let t = o.map((e) => {
1283
- let t = Rn({
1283
+ let t = Vn({
1284
1284
  columnName: e?.columnName,
1285
1285
  selectedDims: s
1286
- }), n = In(t ? Ln(e.columnName, s) : void 0);
1287
- if (n && t) return Vn({
1286
+ }), n = zn(t ? Bn(e.columnName, s) : void 0);
1287
+ if (n && t) return Y({
1288
1288
  columnName: t,
1289
1289
  value: e?.value,
1290
1290
  tableName: n,
@@ -1295,11 +1295,11 @@ function Hn({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filter
1295
1295
  return [...e || [], ...t];
1296
1296
  }
1297
1297
  if (d) {
1298
- let t = Rn({
1298
+ let t = Vn({
1299
1299
  columnName: a,
1300
1300
  selectedDims: s
1301
1301
  });
1302
- return t ? [...e || [], Vn({
1302
+ return t ? [...e || [], Y({
1303
1303
  columnName: t,
1304
1304
  value: i,
1305
1305
  tableName: c,
@@ -1309,42 +1309,42 @@ function Hn({ existing: e, isReset: t, levelIndex: n, hasCurrentLevel: r, filter
1309
1309
  }
1310
1310
  return [];
1311
1311
  }
1312
- var Z = /* @__PURE__ */ new Set([
1313
- k.progressBar,
1314
- k.progressBarV2,
1315
- k.linearGauge,
1316
- k.linearGaugeV2,
1317
- k.gauge,
1318
- k.gaugeV2
1312
+ var Gn = /* @__PURE__ */ new Set([
1313
+ E.progressBar,
1314
+ E.progressBarV2,
1315
+ E.linearGauge,
1316
+ E.linearGaugeV2,
1317
+ E.gauge,
1318
+ E.gaugeV2
1319
1319
  ]);
1320
- function Un({ runtimeEnabled: e, metricEnabled: t }) {
1320
+ function Kn({ runtimeEnabled: e, metricEnabled: t }) {
1321
1321
  return !!e || !!t;
1322
1322
  }
1323
- function Wn({ chartType: e, isDrillEnabled: t, dimensions: n, drilledLevel: r, drillLevels: i }) {
1324
- if (e && Z.has(e)) return "terminal";
1323
+ function qn({ chartType: e, isDrillEnabled: t, dimensions: n, drilledLevel: r, drillLevels: i }) {
1324
+ if (e && Gn.has(e)) return "terminal";
1325
1325
  if (!t || (n?.length ?? 0) === r) return "none";
1326
1326
  let a = i || [];
1327
1327
  return a[a.length - 1]?.isEnable ? "none" : "drill";
1328
1328
  }
1329
- function Gn({ chartType: e, params: t, rowFilters: n, dimensions: r }) {
1330
- return e === k.table ? {
1329
+ function Jn({ chartType: e, params: t, rowFilters: n, dimensions: r }) {
1330
+ return e === E.table ? {
1331
1331
  name: n?.find((e) => r?.some((t) => e?.columnName === t))?.value,
1332
1332
  rowFilters: n
1333
1333
  } : t;
1334
1334
  }
1335
- function Kn(e, t) {
1336
- if (!X(e)) return !1;
1337
- let n = Ln(e, t);
1338
- return !!n && !!In(n);
1335
+ function X(e, t) {
1336
+ if (!J(e)) return !1;
1337
+ let n = Bn(e, t);
1338
+ return !!n && !!zn(n);
1339
1339
  }
1340
- function qn({ existing: e, columnName: t, value: n, mode: r = "only", selectedDims: i, tenancyLevel: a, clientId: o }) {
1341
- if (!X(t) || n === void 0) return e || [];
1342
- let s = Ln(t, i), c = Rn({
1340
+ function Yn({ existing: e, columnName: t, value: n, mode: r = "only", selectedDims: i, tenancyLevel: a, clientId: o }) {
1341
+ if (!J(t) || n === void 0) return e || [];
1342
+ let s = Bn(t, i), c = Vn({
1343
1343
  columnName: t,
1344
1344
  selectedDims: i
1345
- }), l = In(s);
1345
+ }), l = zn(s);
1346
1346
  if (!l || !c) return e || [];
1347
- let u = Vn({
1347
+ let u = Y({
1348
1348
  columnName: c,
1349
1349
  value: n,
1350
1350
  tableName: l,
@@ -1361,50 +1361,50 @@ function qn({ existing: e, columnName: t, value: n, mode: r = "only", selectedDi
1361
1361
  }
1362
1362
  //#endregion
1363
1363
  //#region src/core/metric-builder/drillPoint.ts
1364
- var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !== ""), Yn = (e) => !!e.columnName && Jn(e.value), Xn = (e, t) => ({
1364
+ var Xn = "Empty", Zn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !== ""), Qn = (e) => !!e.columnName && Zn(e.value), $n = (e, t) => ({
1365
1365
  columnName: e,
1366
1366
  value: t,
1367
1367
  ...t === null ? { operator: "isNull" } : {}
1368
- }), Zn = (e, t = (e) => e) => {
1368
+ }), er = (e, t = (e) => e) => {
1369
1369
  let n = e?.dimensions || [], r = [], i = [];
1370
1370
  return n.forEach((e) => {
1371
- if (!Yn(e)) {
1371
+ if (!Qn(e)) {
1372
1372
  e.columnName && i.push(e);
1373
1373
  return;
1374
1374
  }
1375
- r.push(t(Xn(e.columnName, e.value)));
1375
+ r.push(t($n(e.columnName, e.value)));
1376
1376
  }), {
1377
1377
  filters: r,
1378
1378
  skipped: i
1379
1379
  };
1380
- }, Qn = (e) => (e?.dimensions || []).filter((e) => e.value !== void 0).map((e) => ({
1380
+ }, tr = (e) => (e?.dimensions || []).filter((e) => e.value !== void 0).map((e) => ({
1381
1381
  label: e.label || e.columnName,
1382
1382
  value: e.formatted ?? (e.value === null ? "Empty" : String(e.value)),
1383
1383
  role: e.role
1384
- })), $n = (e) => {
1384
+ })), nr = (e) => {
1385
1385
  let t = e?.measure;
1386
1386
  if (t && t.value !== void 0) return t.formatted ?? String(t.value ?? "Empty");
1387
1387
  let n = (e?.dimensions || []).find((e) => e.value !== void 0);
1388
1388
  if (n) return n.formatted ?? String(n.value ?? "Empty");
1389
- }, er = (e) => {
1389
+ }, rr = (e) => {
1390
1390
  if (e !== void 0) return e === null ? null : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? e : String(e);
1391
- }, tr = (e) => e === void 0 ? void 0 : e === null ? Q : String(e), nr = (e, t) => {
1392
- let n = tr(e);
1391
+ }, ir = (e) => e === void 0 ? void 0 : e === null ? Xn : String(e), ar = (e, t) => {
1392
+ let n = ir(e);
1393
1393
  if (!t || typeof e != "number") return n;
1394
1394
  try {
1395
1395
  return t(e) || n;
1396
1396
  } catch {
1397
1397
  return n;
1398
1398
  }
1399
- }, rr = ({ params: e, axisDimension: t, seriesDimension: n, measure: r, formatMeasure: i }) => {
1399
+ }, or = ({ params: e, axisDimension: t, seriesDimension: n, measure: r, formatMeasure: i }) => {
1400
1400
  let a = e?.rowFilters;
1401
1401
  if (a?.length) return {
1402
1402
  dimensions: a.filter((e) => !!e?.columnName).map((e) => {
1403
- let t = er(e.value);
1403
+ let t = rr(e.value);
1404
1404
  return {
1405
1405
  columnName: e.columnName,
1406
1406
  value: t,
1407
- formatted: tr(t),
1407
+ formatted: ir(t),
1408
1408
  role: "row"
1409
1409
  };
1410
1410
  }),
@@ -1412,33 +1412,33 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
1412
1412
  };
1413
1413
  let o = [];
1414
1414
  if (t?.columnName) {
1415
- let n = er(e?.name);
1415
+ let n = rr(e?.name);
1416
1416
  o.push({
1417
1417
  columnName: t.columnName,
1418
1418
  label: t.label,
1419
1419
  value: n,
1420
- formatted: tr(n),
1420
+ formatted: ir(n),
1421
1421
  role: "axis"
1422
1422
  });
1423
1423
  }
1424
1424
  if (n?.columnName) {
1425
- let t = er(e?.seriesName);
1425
+ let t = rr(e?.seriesName);
1426
1426
  o.push({
1427
1427
  columnName: n.columnName,
1428
1428
  label: n.label,
1429
1429
  value: t,
1430
- formatted: tr(t),
1430
+ formatted: ir(t),
1431
1431
  role: "series"
1432
1432
  });
1433
1433
  }
1434
- let s = er(e?.value), c = { dimensions: o }, l = n?.columnName ? r?.columnName : r?.columnName ?? er(e?.seriesName);
1434
+ let s = rr(e?.value), c = { dimensions: o }, l = n?.columnName ? r?.columnName : r?.columnName ?? rr(e?.seriesName);
1435
1435
  return (s !== void 0 || l) && (c.measure = {
1436
1436
  columnName: typeof l == "string" ? l : void 0,
1437
1437
  label: r?.label,
1438
1438
  value: s,
1439
- formatted: nr(s, i)
1439
+ formatted: ar(s, i)
1440
1440
  }), c;
1441
- }, ir = [
1441
+ }, sr = [
1442
1442
  {
1443
1443
  value: "day",
1444
1444
  label: "Day"
@@ -1459,22 +1459,22 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
1459
1459
  value: "year",
1460
1460
  label: "Year"
1461
1461
  }
1462
- ], ar = (e, t) => `${t} of ${e}`, or = (e, t) => {
1462
+ ], cr = (e, t) => `${t} of ${e}`, lr = (e, t) => {
1463
1463
  let n = e?.alias || e?.name || "", r = {
1464
1464
  ...e,
1465
1465
  timeGrain: t,
1466
- alias: ar(n, t),
1466
+ alias: cr(n, t),
1467
1467
  label: `${e?.label || n} (by ${t})`,
1468
1468
  type: e?.type === "HELPER_FUNCTION" ? "DEFAULT" : e?.type
1469
1469
  };
1470
1470
  return delete r.helperFunction, delete r.functionConfiguration, r;
1471
- }, sr = /* @__PURE__ */ new Set([
1471
+ }, ur = /* @__PURE__ */ new Set([
1472
1472
  "date",
1473
1473
  "datetime",
1474
1474
  "timestamp",
1475
1475
  "timestamptz",
1476
1476
  "time"
1477
- ]), cr = /* @__PURE__ */ new Set([
1477
+ ]), dr = /* @__PURE__ */ new Set([
1478
1478
  "number",
1479
1479
  "int",
1480
1480
  "integer",
@@ -1485,24 +1485,24 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
1485
1485
  "decimal",
1486
1486
  "numeric",
1487
1487
  "real"
1488
- ]), lr = /* @__PURE__ */ new Set([
1488
+ ]), fr = /* @__PURE__ */ new Set([
1489
1489
  "nullable",
1490
1490
  "lowcardinality",
1491
1491
  "array"
1492
- ]), ur = (e) => {
1492
+ ]), pr = (e) => {
1493
1493
  let t = e;
1494
1494
  for (let e = 0; e < 4; e += 1) {
1495
1495
  let e = /^([a-z_]+)\((.*)\)$/.exec(t);
1496
- if (!e || !lr.has(e[1])) break;
1496
+ if (!e || !fr.has(e[1])) break;
1497
1497
  t = e[2].trim();
1498
1498
  }
1499
1499
  return t = t.split("(")[0].trim(), t.split(/\s+/)[0] || "";
1500
- }, dr = (e) => {
1500
+ }, Z = (e) => {
1501
1501
  let t = (e || "").toLowerCase().trim();
1502
1502
  if (!t) return "text";
1503
- let n = ur(t);
1504
- return n ? sr.has(n) ? "date" : cr.has(n) ? "number" : n === "boolean" || n === "bool" ? "boolean" : /^(timestamp|datetime)([_a-z0-9]*)$/.test(n) ? "date" : /^u?int(eger)?[0-9]*$/.test(n) || /^(float|double|real)[0-9]*$/.test(n) || /^(decimal|numeric)[0-9]*$/.test(n) || /^u?(big|small|tiny|medium)int[0-9]*$/.test(n) ? "number" : "text" : "text";
1505
- }, fr = (e) => {
1503
+ let n = pr(t);
1504
+ return n ? ur.has(n) ? "date" : dr.has(n) ? "number" : n === "boolean" || n === "bool" ? "boolean" : /^(timestamp|datetime)([_a-z0-9]*)$/.test(n) ? "date" : /^u?int(eger)?[0-9]*$/.test(n) || /^(float|double|real)[0-9]*$/.test(n) || /^(decimal|numeric)[0-9]*$/.test(n) || /^u?(big|small|tiny|medium)int[0-9]*$/.test(n) ? "number" : "text" : "text";
1505
+ }, mr = (e) => {
1506
1506
  let t = (e || "").trim(), n = t.lastIndexOf(".");
1507
1507
  return n < 0 ? {
1508
1508
  schema: "",
@@ -1511,7 +1511,7 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
1511
1511
  schema: t.slice(0, n),
1512
1512
  name: t.slice(n + 1)
1513
1513
  };
1514
- }, pr = (e) => (e || "").trim().toLowerCase().replace(/\s+/g, "_"), mr = (e) => {
1514
+ }, Q = (e) => (e || "").trim().toLowerCase().replace(/\s+/g, "_"), hr = (e) => {
1515
1515
  let t = e?.table;
1516
1516
  if (!t?.name) return [];
1517
1517
  let n = [{
@@ -1519,10 +1519,10 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
1519
1519
  alias: t.alias || t.name,
1520
1520
  schema: t.schema || "",
1521
1521
  isBaseTable: !0
1522
- }], r = /* @__PURE__ */ new Set([pr(t.name)]);
1522
+ }], r = /* @__PURE__ */ new Set([Q(t.name)]);
1523
1523
  return (t.joins || []).forEach((e) => {
1524
1524
  if (!e?.name) return;
1525
- let t = pr(e.name);
1525
+ let t = Q(e.name);
1526
1526
  r.has(t) || (r.add(t), n.push({
1527
1527
  name: e.name,
1528
1528
  alias: e.alias || e.name,
@@ -1530,7 +1530,7 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
1530
1530
  isBaseTable: !1
1531
1531
  }));
1532
1532
  }), n;
1533
- }, hr = (e, t) => ({
1533
+ }, gr = (e, t) => ({
1534
1534
  id: "",
1535
1535
  columns: (t?.columns || []).map((e) => e?.name || e?.as || "").filter(Boolean),
1536
1536
  columnsWithDataType: [],
@@ -1541,7 +1541,7 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
1541
1541
  label: t?.label,
1542
1542
  clientColumn: t?.clientColumn,
1543
1543
  wildcard: t?.wildcard
1544
- }), gr = ({ column: e, reachable: t, subsetTable: n, index: r = 0 }) => {
1544
+ }), _r = ({ column: e, reachable: t, subsetTable: n, index: r = 0 }) => {
1545
1545
  let i = e?.name || e?.as || "", a = e?.as || e?.name || "";
1546
1546
  return {
1547
1547
  alias: a,
@@ -1551,21 +1551,21 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
1551
1551
  datatype: e?.datatype || "",
1552
1552
  draggableItemData: {
1553
1553
  column: e,
1554
- table: hr(t, n)
1554
+ table: gr(t, n)
1555
1555
  },
1556
1556
  index: r,
1557
1557
  isApplyTimezone: e?.isApplyTimezone,
1558
1558
  name: i,
1559
1559
  parentAlias: t.alias,
1560
1560
  sql: e?.sql || "",
1561
- table: hr(t, n),
1561
+ table: gr(t, n),
1562
1562
  transform: e?.transform || "original",
1563
1563
  type: e?.isCustomColumn ? "CUSTOM" : "DEFAULT",
1564
1564
  allowAggregate: e?.allowAggregate,
1565
1565
  defaultAggregation: e?.defaultAggregation,
1566
1566
  defaultSort: e?.defaultSort
1567
1567
  };
1568
- }, _r = ({ subset: e, configuration: t, usedAliases: n = [], currentDepth: r = 0, hasDateLevel: i = !1, isCustomSql: a = !1 }) => {
1568
+ }, vr = ({ subset: e, configuration: t, usedAliases: n = [], currentDepth: r = 0, hasDateLevel: i = !1, isCustomSql: a = !1 }) => {
1569
1569
  if (a) return {
1570
1570
  groups: [],
1571
1571
  unavailableReason: "custom-sql"
@@ -1579,19 +1579,19 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
1579
1579
  groups: [],
1580
1580
  unavailableReason: "no-subset"
1581
1581
  };
1582
- let s = mr(t);
1582
+ let s = hr(t);
1583
1583
  if (!s.length) return {
1584
1584
  groups: [],
1585
1585
  unavailableReason: "no-reachable-columns"
1586
1586
  };
1587
1587
  let c = /* @__PURE__ */ new Map();
1588
1588
  o.forEach((e) => {
1589
- let { name: t } = fr(e?.tableName);
1590
- t && c.set(pr(t), e), e?.wildcard && c.set(pr(e.wildcard), e);
1589
+ let { name: t } = mr(e?.tableName);
1590
+ t && c.set(Q(t), e), e?.wildcard && c.set(Q(e.wildcard), e);
1591
1591
  });
1592
1592
  let l = new Set(n.filter(Boolean).map((e) => e.trim().toLowerCase())), u = !1, d = [];
1593
1593
  return s.forEach((e) => {
1594
- let t = c.get(pr(e.name)), n = t?.columns || [];
1594
+ let t = c.get(Q(e.name)), n = t?.columns || [];
1595
1595
  if (!n.length) return;
1596
1596
  let r = [], a = /* @__PURE__ */ new Set();
1597
1597
  n.forEach((n, o) => {
@@ -1600,13 +1600,13 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
1600
1600
  u = !0;
1601
1601
  let c = s.trim().toLowerCase();
1602
1602
  if (a.has(c) || (a.add(c), l.has(c))) return;
1603
- let d = dr(n?.datatype) === "date";
1603
+ let d = Z(n?.datatype) === "date";
1604
1604
  d && i || r.push({
1605
- key: `${pr(e.name)}.${c}`,
1605
+ key: `${Q(e.name)}.${c}`,
1606
1606
  label: n?.label || s,
1607
- datatype: dr(n?.datatype),
1607
+ datatype: Z(n?.datatype),
1608
1608
  isDate: d,
1609
- column: gr({
1609
+ column: _r({
1610
1610
  column: n,
1611
1611
  reachable: e,
1612
1612
  subsetTable: t,
@@ -1623,7 +1623,7 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
1623
1623
  groups: [],
1624
1624
  unavailableReason: u ? "all-dimensions-used" : "no-reachable-columns"
1625
1625
  };
1626
- }, vr = ({ selectedDims: e, usedAliases: t = [] }) => {
1626
+ }, yr = ({ selectedDims: e, usedAliases: t = [] }) => {
1627
1627
  let n = new Set(t.filter(Boolean).map((e) => e.trim().toLowerCase())), r = [], i = /* @__PURE__ */ new Set();
1628
1628
  return (e || []).forEach((e) => {
1629
1629
  let t = e?.alias;
@@ -1632,8 +1632,8 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
1632
1632
  i.has(a) || (i.add(a), !n.has(a) && r.push({
1633
1633
  key: `metric.${a}`,
1634
1634
  label: e?.label || t,
1635
- datatype: dr(e?.datatype),
1636
- isDate: dr(e?.datatype) === "date",
1635
+ datatype: Z(e?.datatype),
1636
+ isDate: Z(e?.datatype) === "date",
1637
1637
  column: e
1638
1638
  }));
1639
1639
  }), r.length ? { groups: [{
@@ -1645,7 +1645,7 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
1645
1645
  groups: [],
1646
1646
  unavailableReason: e?.length ? "all-dimensions-used" : "no-reachable-columns"
1647
1647
  };
1648
- }, yr = ({ dimension: e, measures: t, index: n, chartSettings: r, parentFilters: i = [] }) => ({
1648
+ }, br = ({ dimension: e, measures: t, index: n, chartSettings: r, parentFilters: i = [] }) => ({
1649
1649
  name: e?.alias || "",
1650
1650
  index: n,
1651
1651
  isEnable: !0,
@@ -1656,7 +1656,7 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
1656
1656
  dimensions: [e],
1657
1657
  measures: t || [],
1658
1658
  filters: i
1659
- }), br = ({ selectedDims: e, selectedMetrics: t, chartSettings: n, drilldownChartSettings: r, makeIndex: i }) => (e || []).map((e, a) => {
1659
+ }), xr = ({ selectedDims: e, selectedMetrics: t, chartSettings: n, drilldownChartSettings: r, makeIndex: i }) => (e || []).map((e, a) => {
1660
1660
  let o = r?.find((t) => t?.name === e?.alias)?.chartSettings;
1661
1661
  return {
1662
1662
  name: e?.alias || `Drill Level ${a + 1}`,
@@ -1667,10 +1667,10 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
1667
1667
  measures: t || [],
1668
1668
  filters: []
1669
1669
  };
1670
- }), xr = (e) => (e || []).map((e) => e?.alias || "").filter((e) => !!e), Sr = (e) => e?.value === null ? {
1670
+ }), Sr = (e) => (e || []).map((e) => e?.alias || "").filter((e) => !!e), Cr = (e) => e?.value === null ? {
1671
1671
  ...e,
1672
1672
  operator: "isNull"
1673
- } : e, Cr = ({ config: e, clickedLevelIndex: t, isReset: n, clickedValue: r, rowFilters: i, adhocDescent: a, enrichFilter: o = (e) => e }) => {
1673
+ } : e, wr = ({ config: e, clickedLevelIndex: t, isReset: n, clickedValue: r, rowFilters: i, adhocDescent: a, enrichFilter: o = (e) => e }) => {
1674
1674
  let s = e?.levels || [], c = s.find((e) => t ? e?.index === t : e?.isEnable), l = s.findIndex((e) => t ? e?.index === t : e?.isEnable), u = l >= 0 && l < s.length - 1, d = u ? s[l + 1] : s[0], f = c?.dimensions?.[0]?.alias, p = i || [];
1675
1675
  if (!c || n) return {
1676
1676
  config: {
@@ -1702,7 +1702,7 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
1702
1702
  outcome: "jump"
1703
1703
  };
1704
1704
  if (a) {
1705
- let t = a.parentFilters || [], n = typeof r == "string" && r.trim() === "", i = r != null && !n && !!a.columnName, l = (e) => e.filter((e) => Jn(e.value)), u = l(a.pointFilters ?? []), d = l(p.map(Sr).map(o)), f = u.length ? [...t, ...u] : d.length ? [...t, ...d] : i ? [...t, o({
1705
+ let t = a.parentFilters || [], n = typeof r == "string" && r.trim() === "", i = r != null && !n && !!a.columnName, l = (e) => e.filter((e) => Zn(e.value)), u = l(a.pointFilters ?? []), d = l(p.map(Cr).map(o)), f = u.length ? [...t, ...u] : d.length ? [...t, ...d] : i ? [...t, o({
1706
1706
  columnName: a.columnName,
1707
1707
  value: r
1708
1708
  })] : t;
@@ -1726,7 +1726,7 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
1726
1726
  ...e,
1727
1727
  levels: s.map((e) => e?.index === d?.index ? {
1728
1728
  ...e,
1729
- filters: u ? [...c?.filters || [], ...p.length ? p.map(Sr).map(o) : [o({
1729
+ filters: u ? [...c?.filters || [], ...p.length ? p.map(Cr).map(o) : [o({
1730
1730
  columnName: f,
1731
1731
  value: r
1732
1732
  })]] : [],
@@ -1754,22 +1754,22 @@ var Q = "Empty", Jn = (e) => e !== void 0 && (typeof e != "string" || e.trim() !
1754
1754
  },
1755
1755
  outcome: "stay"
1756
1756
  };
1757
- }, wr = {
1757
+ }, Tr = {
1758
1758
  "no-subset": "no-subset",
1759
1759
  "no-reachable-columns": "no-reachable-columns",
1760
1760
  "all-dimensions-used": "all-dimensions-used",
1761
1761
  "max-depth-reached": "max-depth-reached",
1762
1762
  "custom-sql": "custom-sql"
1763
- }, Tr = ({ position: e, hasAuthoredNextLevel: t, pool: n, canDrillIntoAnyDimension: r }) => {
1763
+ }, Er = ({ position: e, hasAuthoredNextLevel: t, pool: n, canDrillIntoAnyDimension: r }) => {
1764
1764
  if (t) return "underlying-data-not-permitted";
1765
1765
  if (r) {
1766
1766
  if (n?.groups?.length) return "underlying-data-not-permitted";
1767
- if (n?.unavailableReason) return wr[n.unavailableReason];
1767
+ if (n?.unavailableReason) return Tr[n.unavailableReason];
1768
1768
  if (e.currentDepth >= 3) return "max-depth-reached";
1769
1769
  }
1770
1770
  return "hierarchy-exhausted";
1771
1771
  };
1772
- function Er(e) {
1772
+ function Dr(e) {
1773
1773
  if (e.resultState === "failed") return {
1774
1774
  kind: "none",
1775
1775
  reason: "query-failed"
@@ -1788,10 +1788,10 @@ function Er(e) {
1788
1788
  isOpenInNewTab: t.isOpenInNewTab
1789
1789
  } : e.canViewUnderlyingData ? { kind: "viewRecords" } : {
1790
1790
  kind: "none",
1791
- reason: Tr(e)
1791
+ reason: Er(e)
1792
1792
  };
1793
1793
  }
1794
- var Dr = {
1794
+ var Or = {
1795
1795
  "hierarchy-exhausted": {
1796
1796
  title: "There is nothing further to break this down by",
1797
1797
  body: "This is the whole breakdown this chart is set up for."
@@ -1833,7 +1833,7 @@ var Dr = {
1833
1833
  body: "Try again, or go back a step."
1834
1834
  }
1835
1835
  };
1836
- function Or(e) {
1836
+ function kr(e) {
1837
1837
  switch (e.kind) {
1838
1838
  case "viewRecords": return {
1839
1839
  title: "Look at the rows behind this",
@@ -1850,27 +1850,27 @@ function Or(e) {
1850
1850
  body: "Another chart is set up to pick up from what you picked here.",
1851
1851
  cta: "Open chart"
1852
1852
  };
1853
- default: return Dr[e.reason];
1853
+ default: return Or[e.reason];
1854
1854
  }
1855
1855
  }
1856
1856
  //#endregion
1857
1857
  //#region src/components/MetricList/components/FullScreenView/fullscreenDrillState.ts
1858
- var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, jr = (e) => Array.isArray(e), Mr = (e, t) => ({
1858
+ var Ar = "__dbnFullscreenDrillState", jr = (e) => typeof e == "object" && !!e, Mr = (e) => Array.isArray(e), Nr = (e, t) => ({
1859
1859
  ...e,
1860
1860
  ...t,
1861
1861
  metric: {
1862
1862
  ...e.metric,
1863
- [kr]: t
1863
+ [Ar]: t
1864
1864
  }
1865
- }), Nr = (e, t = {}) => {
1866
- let n = Ar(e) && Ar(e.__dbnFullscreenDrillState) ? e[kr] : {};
1865
+ }), Pr = (e, t = {}) => {
1866
+ let n = jr(e) && jr(e.__dbnFullscreenDrillState) ? e[Ar] : {};
1867
1867
  return {
1868
1868
  drilledLevel: t.drilledLevel ?? (typeof n.drilledLevel == "number" ? n.drilledLevel : void 0),
1869
- drillFilters: t.drillFilters ?? (jr(n.drillFilters) ? n.drillFilters : void 0),
1869
+ drillFilters: t.drillFilters ?? (Mr(n.drillFilters) ? n.drillFilters : void 0),
1870
1870
  drillType: t.drillType ?? (typeof n.drillType == "string" ? n.drillType : void 0),
1871
- underlyingDataDrillFilters: t.underlyingDataDrillFilters ?? (jr(n.underlyingDataDrillFilters) ? n.underlyingDataDrillFilters : void 0)
1871
+ underlyingDataDrillFilters: t.underlyingDataDrillFilters ?? (Mr(n.underlyingDataDrillFilters) ? n.underlyingDataDrillFilters : void 0)
1872
1872
  };
1873
- }, Pr = (e, t) => {
1873
+ }, Fr = (e, t) => {
1874
1874
  if (!e || e.isEnableGroupBy === !1 || t.drilledLevel === void 0 && t.drillFilters === void 0 && t.drillType === void 0 && t.underlyingDataDrillFilters === void 0) return e;
1875
1875
  let n = e.configV2?.levels;
1876
1876
  if (!n?.length) return t.drillType === void 0 ? e : {
@@ -1892,15 +1892,15 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
1892
1892
  }))
1893
1893
  }
1894
1894
  };
1895
- }, Fr = (e, t, n) => n?.length ? {
1895
+ }, Ir = (e, t, n) => n?.length ? {
1896
1896
  ...e,
1897
1897
  [t]: n
1898
- } : Object.fromEntries(Object.entries(e).filter(([e]) => e !== t)), Ir = ({ metricId: e, filters: t, onChange: n }) => {
1898
+ } : Object.fromEntries(Object.entries(e).filter(([e]) => e !== t)), Lr = ({ metricId: e, filters: t, onChange: n }) => {
1899
1899
  e && n?.(e, t);
1900
- }, Lr = (e) => e.find(([, e, t]) => !Array.isArray(e) || !t && e.length === 0)?.[0], Rr = (e, t) => {
1900
+ }, Rr = (e) => e.find(([, e, t]) => !Array.isArray(e) || !t && e.length === 0)?.[0], zr = (e, t) => {
1901
1901
  let n = e?.chartType, r = n === "pivotV2" || n === "pivot table 2";
1902
1902
  if (!r && n !== "pivotV3" && n !== "pivot table 3") return { renderEmpty: !1 };
1903
- let i = Lr(r ? [
1903
+ let i = Rr(r ? [
1904
1904
  ["chartOptions.pivotTableSettings2.dimensions", e?.pivotTableSettings2?.dimensions],
1905
1905
  [
1906
1906
  "chartOptions.pivotTableSettings2.headers",
@@ -1918,7 +1918,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
1918
1918
  renderEmpty: !0,
1919
1919
  missingField: i
1920
1920
  };
1921
- let a = t?.newDatasetSettings, o = Lr([
1921
+ let a = t?.newDatasetSettings, o = Rr([
1922
1922
  ["datasetMetricSettings.newDatasetSettings.selectedDims", a?.selectedDims],
1923
1923
  ["datasetMetricSettings.newDatasetSettings.selectedMetrics", a?.selectedMetrics],
1924
1924
  [
@@ -1931,28 +1931,28 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
1931
1931
  renderEmpty: !0,
1932
1932
  missingField: o
1933
1933
  } : { renderEmpty: !1 };
1934
- }, zr = (e, t) => !(!e || e.isLoading !== !0 || e.key !== t || e.data?.data?.length), Br = ({ clientId: e, guestToken: t, isFrontendApp: n }) => JSON.stringify({
1934
+ }, Br = (e, t) => !(!e || e.isLoading !== !0 || e.key !== t || e.data?.data?.length), Vr = ({ clientId: e, guestToken: t, isFrontendApp: n }) => JSON.stringify({
1935
1935
  clientId: e,
1936
1936
  guestToken: t || "",
1937
1937
  isFrontendApp: n
1938
- }), Vr = ({ query: e, clientId: t, isFrontendApp: n }) => JSON.stringify({
1938
+ }), Hr = ({ query: e, clientId: t, isFrontendApp: n }) => JSON.stringify({
1939
1939
  query: e,
1940
1940
  tenant: {
1941
1941
  clientId: t,
1942
1942
  isFrontendApp: n
1943
1943
  }
1944
- }), Hr = (e, t) => e?.includes(t) ? e : [...e || [], t], Ur = (e, t) => e?.includes(t) ? e.filter((e) => e !== t) : e, Wr = (e, t) => !!(e && e.data?.data === t.data && e.data?.name === t.name && e.data?.description === t.description && e.isLoading === t.isLoading && e.key === t.key), Gr = ({ metric: e, isAllClient: t, tenancyLevel: n, appliedMetricFilters: r, firstLoadAppliedMetricFilters: i, tableColumnFilters: a, chartSettings: o, isPythonMode: s, globalFilters: c, filterValues: l, tableLimit: u, calendarType: d, comparisonCount: f, datasourceId: p, drillConfig: m, isFrontendApp: h, guestToken: g }) => ({
1944
+ }), Ur = (e, t) => e?.includes(t) ? e : [...e || [], t], Wr = (e, t) => e?.includes(t) ? e.filter((e) => e !== t) : e, Gr = (e, t) => !!(e && e.data?.data === t.data && e.data?.name === t.name && e.data?.description === t.description && e.isLoading === t.isLoading && e.key === t.key), Kr = ({ metric: e, isAllClient: t, tenancyLevel: n, appliedMetricFilters: r, firstLoadAppliedMetricFilters: i, tableColumnFilters: a, chartSettings: o, isPythonMode: s, globalFilters: c, filterValues: l, tableLimit: u, calendarType: d, comparisonCount: f, datasourceId: p, drillConfig: m, isFrontendApp: ee, guestToken: h }) => ({
1945
1945
  isAllClient: t,
1946
1946
  id: e?.id,
1947
1947
  tenancyLevel: n,
1948
- rlsConditions: [...(r?.length ? r : i) || [], ...o?.tableSettings?.isServerSidePagination && o?.chartType === k.table ? a.map((e) => e.condition).filter((e) => $e(e)) : []],
1948
+ rlsConditions: [...(r?.length ? r : i) || [], ...o?.tableSettings?.isServerSidePagination && o?.chartType === E.table ? a.map((e) => e.condition).filter((e) => tt(e)) : []],
1949
1949
  globalFilters: s ? void 0 : {
1950
1950
  ...c,
1951
1951
  filters: c?.filters?.filter((e) => Array.isArray(e?.value) ? e?.value?.length : e)
1952
1952
  },
1953
1953
  filterValues: s ? void 0 : l,
1954
- limit: o?.tableSettings?.isServerSidePagination && o?.chartType === k.table ? Math.min(u.limit, 1e3) : void 0,
1955
- offset: o?.tableSettings?.isServerSidePagination && o?.chartType === k.table ? u.offset : void 0,
1954
+ limit: o?.tableSettings?.isServerSidePagination && o?.chartType === E.table ? Math.min(u.limit, 1e3) : void 0,
1955
+ offset: o?.tableSettings?.isServerSidePagination && o?.chartType === E.table ? u.offset : void 0,
1956
1956
  disableStringify: !0,
1957
1957
  pivotHeaders: o?.pivotTableSettings2?.headers || [],
1958
1958
  timeseriesSettings: s ? void 0 : {
@@ -1963,35 +1963,35 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
1963
1963
  chartSeriesField: o?.seriesField !== "ungrouped" && o?.seriesField && o?.isDynamicSeries ? o?.seriesField : void 0,
1964
1964
  comparisonCount: f,
1965
1965
  dynamicXAxis: {
1966
- isEnable: !!(o?.dynamicXAxis?.isEnabled || o?.enduserMeasureAndDimensions?.isEnabled) && ne.includes(o?.chartType || ""),
1966
+ isEnable: !!(o?.dynamicXAxis?.isEnabled || o?.enduserMeasureAndDimensions?.isEnabled) && oe.includes(o?.chartType || ""),
1967
1967
  xaxis: o?.xAxis || "",
1968
1968
  customField: o?.dynamicXAxis?.selectedOption?.column
1969
1969
  },
1970
1970
  dbId: p,
1971
1971
  elementSettings: e?.elementSettings?.metricExpression,
1972
1972
  drillConfig: m,
1973
- isEncrypted: !(h || !g)
1974
- }), Kr = (e) => {
1973
+ isEncrypted: !(ee || !h)
1974
+ }), qr = (e) => {
1975
1975
  let t = e.object.customTable?.query;
1976
1976
  return e.object.wId ? !t || !t.includes("{{") : !1;
1977
- }, qr = (e, t) => e.customTable ? "" : e.tableName ? Fe(e.tableName, t) : e.tableName, Jr = (e, t) => {
1978
- if (!e.customColumnSql) return e.columnName ? Fe(e.columnName, t) : e.columnName;
1979
- }, Yr = (e) => {
1977
+ }, Jr = (e, t) => e.customTable ? "" : e.tableName ? M(e.tableName, t) : e.tableName, Yr = (e, t) => {
1978
+ if (!e.customColumnSql) return e.columnName ? M(e.columnName, t) : e.columnName;
1979
+ }, Xr = (e) => {
1980
1980
  let { object: t } = e, n = t.wId;
1981
1981
  return {
1982
1982
  ...t,
1983
- tableName: qr(t, n),
1984
- columnName: Jr(t, n),
1985
- filter: t.filter?.length ? E(t.filter, n) : [],
1983
+ tableName: Jr(t, n),
1984
+ columnName: Yr(t, n),
1985
+ filter: t.filter?.length ? w(t.filter, n) : [],
1986
1986
  customTable: t.customTable?.query ? {
1987
- query: Fe(t.customTable.query, n),
1988
- alias: Fe(t.customTable.alias, n)
1987
+ query: M(t.customTable.query, n),
1988
+ alias: M(t.customTable.alias, n)
1989
1989
  } : t.customTable
1990
1990
  };
1991
- }, Xr = async (e, t, n) => {
1992
- if (Kr(e)) try {
1991
+ }, Zr = async (e, t, n) => {
1992
+ if (qr(e)) try {
1993
1993
  let r = await t({
1994
- data: Yr(e),
1994
+ data: Xr(e),
1995
1995
  encryptedClientId: n.isFrontendApp ? n.encryptedClientId || "" : n.clientId || "",
1996
1996
  isFrontendApp: !!n.isFrontendApp,
1997
1997
  token: n.token || ""
@@ -2000,7 +2000,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
2000
2000
  } catch {
2001
2001
  return;
2002
2002
  }
2003
- }, Zr = async ({ entries: e, fetchColumnValues: t, ctx: n, onSeed: r, onResolved: i, onLoading: a, onSettle: o, isCancelled: s }) => {
2003
+ }, Qr = async ({ entries: e, fetchColumnValues: t, ctx: n, onSeed: r, onResolved: i, onLoading: a, onSettle: o, isCancelled: s }) => {
2004
2004
  a(!0);
2005
2005
  let c = {};
2006
2006
  e?.forEach((e) => {
@@ -2011,24 +2011,24 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
2011
2011
  if (s()) return;
2012
2012
  let o = e[r];
2013
2013
  a(!0);
2014
- let c = await Xr(o, t, n);
2014
+ let c = await Zr(o, t, n);
2015
2015
  if (s()) return;
2016
2016
  c !== void 0 && i(o.element.name, c);
2017
2017
  }
2018
2018
  } finally {
2019
2019
  o();
2020
2020
  }
2021
- }, Qr = "Could not generate this metric summary. Try again.", $r = 1500, ei = /* @__PURE__ */ new Map(), ti = (e, t) => {
2022
- ei.get(e) === t && ei.delete(e), t.abandonTimer && clearTimeout(t.abandonTimer), t.abandonTimer = void 0;
2023
- }, ni = (e) => {
2024
- ei.forEach((t, n) => {
2025
- t.settledAt !== void 0 && e - t.settledAt >= 3e4 && ti(n, t);
2026
- }), !(ei.size <= 24) && [...ei.entries()].filter(([, e]) => e.settledAt !== void 0).sort(([, e], [, t]) => (e.settledAt ?? 0) - (t.settledAt ?? 0)).slice(0, Math.max(0, ei.size - 24)).forEach(([e, t]) => {
2027
- ti(e, t);
2021
+ }, $r = "Could not generate this metric summary. Try again.", ei = 1500, ti = /* @__PURE__ */ new Map(), ni = (e, t) => {
2022
+ ti.get(e) === t && ti.delete(e), t.abandonTimer && clearTimeout(t.abandonTimer), t.abandonTimer = void 0;
2023
+ }, ri = (e) => {
2024
+ ti.forEach((t, n) => {
2025
+ t.settledAt !== void 0 && e - t.settledAt >= 3e4 && ni(n, t);
2026
+ }), !(ti.size <= 24) && [...ti.entries()].filter(([, e]) => e.settledAt !== void 0).sort(([, e], [, t]) => (e.settledAt ?? 0) - (t.settledAt ?? 0)).slice(0, Math.max(0, ti.size - 24)).forEach(([e, t]) => {
2027
+ ni(e, t);
2028
2028
  });
2029
- }, ri = (e, t, n = Date.now) => {
2030
- ni(n());
2031
- let r = ei.get(e);
2029
+ }, ii = (e, t, n = Date.now) => {
2030
+ ri(n());
2031
+ let r = ti.get(e);
2032
2032
  if (r) r.abandonTimer && (clearTimeout(r.abandonTimer), r.abandonTimer = void 0);
2033
2033
  else {
2034
2034
  let i = new AbortController(), a = {
@@ -2037,74 +2037,74 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
2037
2037
  promise: Promise.resolve()
2038
2038
  };
2039
2039
  a.promise = t(i.signal).then((e) => (a.settledAt = n(), e), (t) => {
2040
- throw ti(e, a), t;
2041
- }), a.promise.catch(() => void 0), ei.set(e, a), r = a;
2040
+ throw ni(e, a), t;
2041
+ }), a.promise.catch(() => void 0), ti.set(e, a), r = a;
2042
2042
  }
2043
2043
  let i = r;
2044
2044
  i.holders += 1;
2045
2045
  let a = !1, o = () => {
2046
2046
  a || (a = !0, --i.holders, !(i.holders > 0 || i.settledAt !== void 0) && (i.abandonTimer ||= setTimeout(() => {
2047
- i.abandonTimer = void 0, !(i.holders > 0) && (i.controller.abort(), ti(e, i));
2048
- }, $r)));
2047
+ i.abandonTimer = void 0, !(i.holders > 0) && (i.controller.abort(), ni(e, i));
2048
+ }, ei)));
2049
2049
  };
2050
2050
  return {
2051
2051
  promise: i.promise,
2052
2052
  release: o,
2053
2053
  abort: () => {
2054
- o(), i.controller.abort(), ti(e, i);
2054
+ o(), i.controller.abort(), ni(e, i);
2055
2055
  }
2056
2056
  };
2057
- }, ii = {
2057
+ }, ai = {
2058
2058
  status: "idle",
2059
2059
  summary: "",
2060
2060
  error: "",
2061
2061
  empty: !1
2062
- }, ai = {
2063
- ...ii,
2064
- status: "failed",
2065
- error: Qr
2066
2062
  }, oi = {
2063
+ ...ai,
2064
+ status: "failed",
2065
+ error: $r
2066
+ }, si = {
2067
2067
  status: "done",
2068
2068
  summary: "",
2069
2069
  error: "There is no data to summarize.",
2070
2070
  empty: !0
2071
- }, si = () => {
2072
- let [e, t] = R(ii), n = L(null), r = L(null), i = P(() => {
2071
+ }, ci = () => {
2072
+ let [e, t] = L(ai), n = I(null), r = I(null), i = N(() => {
2073
2073
  let e = r.current;
2074
- r.current = null, n.current = null, e?.abort(), t(ii);
2075
- }, []), a = P(() => {
2074
+ r.current = null, n.current = null, e?.abort(), t(ai);
2075
+ }, []), a = N(() => {
2076
2076
  let e = r.current;
2077
- r.current = null, e?.abort(), t(ii);
2078
- }, []), o = P((e, i) => {
2077
+ r.current = null, e?.abort(), t(ai);
2078
+ }, []), o = N((e, i) => {
2079
2079
  if (n.current === e) return;
2080
2080
  if (n.current = e, r.current?.release(), r.current = null, !i) {
2081
- t(oi);
2081
+ t(si);
2082
2082
  return;
2083
2083
  }
2084
2084
  t({
2085
- ...ii,
2085
+ ...ai,
2086
2086
  status: "running"
2087
2087
  });
2088
- let a = ri(e, async (e) => {
2088
+ let a = ii(e, async (e) => {
2089
2089
  try {
2090
2090
  let t = await i(e), n = t && typeof t == "object" && "summary" in t && typeof t.summary == "string" ? t.summary.trim() : "";
2091
2091
  return n ? {
2092
- ...ii,
2092
+ ...ai,
2093
2093
  status: "done",
2094
2094
  summary: n
2095
- } : oi;
2095
+ } : si;
2096
2096
  } catch (e) {
2097
- if (s(e)) throw e;
2098
- return ai;
2097
+ if (c(e)) throw e;
2098
+ return oi;
2099
2099
  }
2100
2100
  });
2101
2101
  r.current = a, a.promise.then((e) => {
2102
2102
  r.current === a && t(e);
2103
2103
  }, (e) => {
2104
- r.current === a && t(s(e) ? ii : ai);
2104
+ r.current === a && t(c(e) ? ai : oi);
2105
2105
  });
2106
2106
  }, []);
2107
- return F(() => () => {
2107
+ return P(() => () => {
2108
2108
  r.current?.release(), r.current = null, n.current = null;
2109
2109
  }, []), {
2110
2110
  state: e,
@@ -2116,102 +2116,102 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
2116
2116
  if (!e) return null;
2117
2117
  let t = new Date(e);
2118
2118
  return t instanceof Date && !Number.isNaN(t.getTime()) ? t : null;
2119
- }, ci = (e) => N(e || {}) ? {
2119
+ }, li = (e) => Le(e || {}) ? {
2120
2120
  startTime: e?.startTime,
2121
2121
  endTime: e?.endTime,
2122
2122
  isTimeFilter: !0
2123
- } : {}, li = ({ option: e, value: t }) => ({
2123
+ } : {}, ui = ({ option: e, value: t }) => ({
2124
2124
  startDate: $(e?.fromDate) ?? $(e?.startDate) ?? void 0,
2125
2125
  endDate: $(e?.toDate) ?? $(e?.endDate) ?? void 0,
2126
- ...ci(e),
2126
+ ...li(e),
2127
2127
  value: t,
2128
2128
  label: t
2129
- }), ui = (e, t) => {
2129
+ }), di = (e, t) => {
2130
2130
  if (typeof e == "object" && e) return Reflect.get(e, t);
2131
- }, di = [], fi = [], pi = [], mi = (e, t) => {
2131
+ }, fi = [], pi = [], mi = [], hi = (e, t) => {
2132
2132
  let n = t?.configV2?.levels?.find((e) => e?.isEnable)?.chartSettings;
2133
2133
  return n ? {
2134
2134
  ...e,
2135
2135
  ...n
2136
2136
  } : e;
2137
- }, hi = ({ raw: e, selectedDims: t, selectedMetrics: n, datasetSettings: r, integrationName: i, isPythonMode: a }) => {
2137
+ }, gi = ({ raw: e, selectedDims: t, selectedMetrics: n, datasetSettings: r, integrationName: i, isPythonMode: a }) => {
2138
2138
  let o;
2139
2139
  if (typeof e == "string") try {
2140
2140
  o = JSON.parse(e);
2141
2141
  } catch {
2142
- return di;
2142
+ return fi;
2143
2143
  }
2144
2144
  else if (Array.isArray(e)) o = e;
2145
- else return di;
2146
- if (o = oe(o || [], t || [], n || []), !Array.isArray(o)) return di;
2145
+ else return fi;
2146
+ if (o = ue(o || [], t || [], n || []), !Array.isArray(o)) return fi;
2147
2147
  let s = o;
2148
2148
  if (i?.toLowerCase() === "redshift" && !a) {
2149
- let e = r?.selectedMetrics || [], t = [...((r?.selectedDims)?.filter((e) => !nt(e?.alias)) || [])?.map((e) => e.alias), ...e?.map((e) => e.alias)];
2150
- s = Ge(t, o);
2149
+ let e = r?.selectedMetrics || [], t = [...((r?.selectedDims)?.filter((e) => !it(e?.alias)) || [])?.map((e) => e.alias), ...e?.map((e) => e.alias)];
2150
+ s = qe(t, o);
2151
2151
  }
2152
- let c = he(s);
2153
- return !Array.isArray(c) || !c.length ? di : c;
2154
- }, gi = ({ metric: e, globalFilters: t = {
2152
+ let c = ye(s);
2153
+ return !Array.isArray(c) || !c.length ? fi : c;
2154
+ }, _i = ({ metric: e, globalFilters: t = {
2155
2155
  tableName: "",
2156
2156
  filters: []
2157
- }, rlsFilters: n, clientId: r, tenancyLevel: a, isInternalApp: o, appFilters: s, setCrossDashboardFilters: c, crossDashboardFilters: l, enableCrossFilter: p, metricFilterOptions: h, isAllClient: g, isFrontendApp: v, guestToken: b, encryptedClientId: S, dashboardId: w, workspaceId: T, metricStore: E, setMetricStore: te, summaryReferencedMetricIds: D, onServerEvent: re, clientColumnType: ce, datasourceId: fe, appliedCardMetricFilters: pe, onMetricFiltersChange: A, language: j, translationDictionary: M, calendarType: ye, setLoadedCardMetadata: xe, isRulePending: De = !1, setSettledCardIds: ke, drillUrlState: Ae, isFullScreen: je, setMetricMetadata: Fe, viewMetricData: N, generatingPdf: Be, dataMartTables: Ge, isDisableQuery: Ke = !1, token: qe, drilledLevel: Xe, drillFilters: Ze, drillType: nt, underlyingDataDrillFilters: at }) => {
2158
- let [ct, lt] = R(!1), [ut, dt] = R(!0), ft = _(), [z, mt] = R(null), { state: ht, start: gt, stop: _t, reset: vt } = si(), yt = ht.summary, bt = ht.error, xt = ht.empty, St = ht.status === "running", Ct = L(null), wt = L(null), [Tt, Et] = R({
2157
+ }, rlsFilters: n, clientId: r, tenancyLevel: a, isInternalApp: o, appFilters: s, setCrossDashboardFilters: c, crossDashboardFilters: l, enableCrossFilter: u, metricFilterOptions: m, isAllClient: h, isFrontendApp: g, guestToken: _, encryptedClientId: v, dashboardId: b, workspaceId: S, metricStore: C, setMetricStore: w, summaryReferencedMetricIds: ie, onServerEvent: T, clientColumnType: se, datasourceId: fe, appliedCardMetricFilters: ge, onMetricFiltersChange: _e, language: O, translationDictionary: k, calendarType: A, setLoadedCardMetadata: Se, isRulePending: we = !1, setSettledCardIds: Ae, drillUrlState: j, isFullScreen: Me, setMetricMetadata: Ne, viewMetricData: M, generatingPdf: Le, dataMartTables: He, isDisableQuery: qe = !1, token: Je, drilledLevel: Ye, drillFilters: Qe, drillType: $e, underlyingDataDrillFilters: it }) => {
2158
+ let [st, ut] = L(!1), [dt, ft] = L(!0), pt = te(), [mt, R] = L(null), { state: gt, start: _t, stop: vt, reset: yt } = ci(), bt = gt.summary, xt = gt.error, St = gt.empty, Ct = gt.status === "running", wt = I(null), Tt = I(null), [Et, Dt] = L({
2159
2159
  limit: parseInt(e?.chartOptions?.tableSettings?.defaultRowSize || "100", 10),
2160
2160
  offset: 0
2161
- }), [Dt, Ot] = R(0), [B, kt] = R(0), [V, At] = R(e?.rlsConditions || []), [jt, Mt] = R([]), [Nt, Pt] = R(!1), [Ft, It] = R(), [Lt, Rt] = R(""), [zt, Bt] = R([]), [Vt, Ht] = R({
2161
+ }), [Ot, kt] = L(0), [z, At] = L(0), [B, jt] = L(e?.rlsConditions || []), [Mt, Nt] = L([]), [Pt, Ft] = L(!1), [It, Lt] = L(), [Rt, zt] = L(""), [Bt, Vt] = L([]), [Ht, Ut] = L({
2162
2162
  isOpen: !1,
2163
2163
  report: "",
2164
2164
  isLoading: !1
2165
- }), [Ut, Wt] = R(!1), [Gt, Kt] = R([]), qt = Ze ?? [], Jt = L(qt), Yt = L(at), Xt = Pr(e?.drillDownSettings, {
2166
- drilledLevel: Xe,
2167
- drillFilters: Ze,
2168
- drillType: nt,
2169
- underlyingDataDrillFilters: at
2170
- }), [H, Qt] = R(qt), [U, en] = R(Xt ?? {
2165
+ }), [Wt, Gt] = L(!1), [Kt, qt] = L([]), Jt = Qe ?? [], Yt = I(Jt), Xt = I(it), Zt = Fr(e?.drillDownSettings, {
2166
+ drilledLevel: Ye,
2167
+ drillFilters: Qe,
2168
+ drillType: $e,
2169
+ underlyingDataDrillFilters: it
2170
+ }), [Qt, $t] = L(Jt), [V, nn] = L(Zt ?? {
2171
2171
  isEnableGroupBy: !1,
2172
2172
  isEnableCrossFilter: !1,
2173
2173
  drillType: ""
2174
- }), tn = Un({
2175
- runtimeEnabled: p,
2174
+ }), rn = Kn({
2175
+ runtimeEnabled: u,
2176
2176
  metricEnabled: e?.drillDownSettings?.isEnableCrossFilter
2177
- }), [nn, rn] = R([]), [an, on] = R([]), [sn, cn] = R(!1), [ln, un] = R(!1), [W, dn] = R([]), fn = L(A);
2178
- fn.current = A;
2179
- let pn = P((t) => {
2180
- dn((n) => {
2177
+ }), [an, on] = L([]), [sn, cn] = L([]), [ln, un] = L(!1), [dn, fn] = L(!1), [H, pn] = L([]), mn = I(_e);
2178
+ mn.current = _e;
2179
+ let hn = N((t) => {
2180
+ pn((n) => {
2181
2181
  let r = typeof t == "function" ? t(n) : t;
2182
- return Ir({
2182
+ return Lr({
2183
2183
  metricId: e?.id,
2184
2184
  filters: r,
2185
- onChange: fn.current
2185
+ onChange: mn.current
2186
2186
  }), r;
2187
2187
  });
2188
- }, [e?.id]), [mn, hn] = R({}), [gn, vn] = R(!1), [yn, bn] = R(null), [G, K] = R(mi(e?.chartOptions, e?.drillDownSettings)), xn = L(""), [Sn, Tn] = R({
2188
+ }, [e?.id]), [gn, _n] = L({}), [vn, yn] = L(!1), [xn, Sn] = L(null), [U, W] = L(hi(e?.chartOptions, e?.drillDownSettings)), Cn = I(""), [wn, Tn] = L({
2189
2189
  data: [],
2190
2190
  error: "",
2191
2191
  isLoading: !1,
2192
2192
  currentValue: ""
2193
- }), q = I(() => !!e?.datasetMetricSettings?.newDatasetSettings?.isPythonMode, [e?.datasetMetricSettings?.newDatasetSettings?.isPythonMode]), En = P((e) => $e(e) ? !0 : e?.isAddOnMetrics && e?.datatype === "date" ? !1 : !!(e?.isAddOnMetrics && e?.client?.isEnable && e?.client?.columnName && e?.client?.as && !g && r), [r, g]), Dn = I(() => e?.externalDashboardMetrics?.[0]?.externalDashboard?.companyWorkspace?.datamart?.datamartRelationships || [], [e]), On = I(() => {
2193
+ }), G = F(() => !!e?.datasetMetricSettings?.newDatasetSettings?.isPythonMode, [e?.datasetMetricSettings?.newDatasetSettings?.isPythonMode]), On = N((e) => tt(e) ? !0 : e?.isAddOnMetrics && e?.datatype === "date" ? !1 : !!(e?.isAddOnMetrics && e?.client?.isEnable && e?.client?.columnName && e?.client?.as && !h && r), [r, h]), kn = F(() => e?.externalDashboardMetrics?.[0]?.externalDashboard?.companyWorkspace?.datamart?.datamartRelationships || [], [e]), An = F(() => {
2194
2194
  let e = {};
2195
2195
  if (n?.values) for (let t in n.values) {
2196
2196
  let r = `${t}_variable`;
2197
2197
  e[r] = n.values[t];
2198
2198
  }
2199
2199
  return e;
2200
- }, [n?.values]), kn = I(() => {
2200
+ }, [n?.values]), jn = F(() => {
2201
2201
  let t = e?.datasetMetricSettings?.newDatasetSettings?.selectedMainTable;
2202
- return (Ge?.find((e) => e.tableName === t?.tableName))?.customColumnFields?.map((n) => ({
2202
+ return (He?.find((e) => e.tableName === t?.tableName))?.customColumnFields?.map((n) => ({
2203
2203
  value: n?.columnName,
2204
2204
  label: n?.columnName,
2205
2205
  isCustomField: !0,
2206
2206
  column: {
2207
- uniqueId: me(10),
2207
+ uniqueId: ve(10),
2208
2208
  alias: n?.columnName,
2209
2209
  configType: "DIMENSION",
2210
2210
  datatype: n?.datatype,
2211
2211
  dropType: "DIMENSION",
2212
2212
  index: 1e3,
2213
2213
  name: n?.columnName,
2214
- parentAlias: `${be(t?.schemaName, e?.companyIntegration?.name || "")}_${t?.tableName?.replaceAll(" ", "_")?.replace("*", "_")}`,
2214
+ parentAlias: `${Ce(t?.schemaName, e?.companyIntegration?.name || "")}_${t?.tableName?.replaceAll(" ", "_")?.replace("*", "_")}`,
2215
2215
  table: e?.datasetMetricSettings?.newDatasetSettings?.selectedMainTable,
2216
2216
  type: "DEFAULT",
2217
2217
  draggableItemData: {
@@ -2229,129 +2229,129 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
2229
2229
  }, [
2230
2230
  e?.datasetMetricSettings?.newDatasetSettings?.selectedMainTable,
2231
2231
  e?.companyIntegration?.name,
2232
- Ge
2233
- ]), jn = I(() => (e?.drillDownSettings?.isEnableGroupBy ? V || [] : [...V?.length ? V : [], ...l || []]).filter((e) => e.isAddOnMetrics).map((e) => o ? {
2232
+ He
2233
+ ]), Mn = F(() => (e?.drillDownSettings?.isEnableGroupBy ? B || [] : [...B?.length ? B : [], ...l || []]).filter((e) => e.isAddOnMetrics).map((e) => o ? {
2234
2234
  ...e,
2235
- dimensionColumn: G?.xAxis || "",
2236
- measureColumn: G?.yAxisList?.[0] || "",
2235
+ dimensionColumn: U?.xAxis || "",
2236
+ measureColumn: U?.yAxisList?.[0] || "",
2237
2237
  options: e.datatype === "date" ? e.options : [],
2238
2238
  variableOptions: e.datatype === "date" ? e.variableOptions : []
2239
2239
  } : {
2240
2240
  ...e,
2241
- dimensionColumn: G?.xAxis || "",
2242
- measureColumn: G?.yAxisList?.[0] || "",
2243
- value: e.isAppFilter ? e.datatype === "date" ? ve(s?.values?.[e.name], e?.datePresetOptions || e?.presetDateOptions) || (e?.options)?.find((t) => t.name === (s?.values?.[e.name] ?? e.value)) : s?.values?.[e.name] ?? e.value : e.value,
2244
- options: e.datatype === "date" ? e?.options?.map((t) => ye === "ind" && e.datatype === "date" ? {
2241
+ dimensionColumn: U?.xAxis || "",
2242
+ measureColumn: U?.yAxisList?.[0] || "",
2243
+ value: e.isAppFilter ? e.datatype === "date" ? xe(s?.values?.[e.name], e?.datePresetOptions || e?.presetDateOptions) || (e?.options)?.find((t) => t.name === (s?.values?.[e.name] ?? e.value)) : s?.values?.[e.name] ?? e.value : e.value,
2244
+ options: e.datatype === "date" ? e?.options?.map((t) => A === "ind" && e.datatype === "date" ? {
2245
2245
  ...t,
2246
2246
  isFiscal: !0
2247
2247
  } : t) : [],
2248
2248
  variableOptions: e.datatype === "date" ? e.variableOptions : []
2249
- }).filter((e) => En(e)), [
2249
+ }).filter((e) => On(e)), [
2250
2250
  s?.values,
2251
- ye,
2252
- G?.xAxis,
2253
- G?.yAxisList,
2251
+ A,
2252
+ U?.xAxis,
2253
+ U?.yAxisList,
2254
2254
  l,
2255
2255
  o,
2256
2256
  e?.drillDownSettings?.isEnableGroupBy,
2257
- V,
2258
- En
2259
- ]), Mn = I(() => JSON.stringify(jt), [jt]), Y = I(() => ({
2260
- ...Gr({
2257
+ B,
2258
+ On
2259
+ ]), Pn = F(() => JSON.stringify(Mt), [Mt]), q = F(() => ({
2260
+ ...Kr({
2261
2261
  metric: e,
2262
- isAllClient: g,
2262
+ isAllClient: h,
2263
2263
  tenancyLevel: a,
2264
- appliedMetricFilters: W,
2265
- firstLoadAppliedMetricFilters: jn,
2266
- tableColumnFilters: jt,
2267
- chartSettings: G,
2268
- isPythonMode: q,
2264
+ appliedMetricFilters: H,
2265
+ firstLoadAppliedMetricFilters: Mn,
2266
+ tableColumnFilters: Mt,
2267
+ chartSettings: U,
2268
+ isPythonMode: G,
2269
2269
  globalFilters: t,
2270
- filterValues: On,
2271
- tableLimit: Tt,
2272
- calendarType: ye,
2273
- comparisonCount: B,
2270
+ filterValues: An,
2271
+ tableLimit: Et,
2272
+ calendarType: A,
2273
+ comparisonCount: z,
2274
2274
  datasourceId: fe,
2275
- drillConfig: U?.configV2,
2276
- isFrontendApp: v,
2277
- guestToken: b
2275
+ drillConfig: V?.configV2,
2276
+ isFrontendApp: g,
2277
+ guestToken: _
2278
2278
  }),
2279
- dashboardId: w
2279
+ dashboardId: b
2280
2280
  }), [
2281
- G,
2282
- g,
2281
+ U,
2282
+ h,
2283
2283
  e,
2284
- W,
2285
- jn,
2286
- q,
2287
- On,
2288
2284
  H,
2285
+ Mn,
2286
+ G,
2287
+ An,
2288
+ Qt,
2289
2289
  a,
2290
2290
  t,
2291
- Tt,
2292
- B,
2293
- ne,
2291
+ Et,
2292
+ z,
2293
+ oe,
2294
2294
  fe,
2295
- ye,
2296
- U?.configV2,
2295
+ A,
2296
+ V?.configV2,
2297
+ _,
2298
+ g,
2297
2299
  b,
2298
- v,
2299
- w,
2300
- Mn
2301
- ]), Pn = I(() => JSON.stringify(Y), [Y]), Fn = Rr(G, e?.datasetMetricSettings), In = e?.datasetMetricSettings, X = Qe(In), Ln = Ke || Fn.renderEmpty || !!X, Rn = v ? S || "" : r || "", zn = I(() => Vr({
2302
- query: Y,
2303
- clientId: Rn,
2304
- isFrontendApp: v
2300
+ Pn
2301
+ ]), Fn = F(() => JSON.stringify(q), [q]), Ln = zr(U, e?.datasetMetricSettings), Rn = e?.datasetMetricSettings, zn = et(Rn), J = qe || Ln.renderEmpty || !!zn, Bn = g ? v || "" : r || "", Vn = F(() => Hr({
2302
+ query: q,
2303
+ clientId: Bn,
2304
+ isFrontendApp: g
2305
2305
  }), [
2306
- Rn,
2307
- v,
2308
- Y
2309
- ]), Vn = I(() => Br({
2310
- clientId: Rn,
2311
- guestToken: b,
2312
- isFrontendApp: v
2306
+ Bn,
2307
+ g,
2308
+ q
2309
+ ]), Hn = F(() => Vr({
2310
+ clientId: Bn,
2311
+ guestToken: _,
2312
+ isFrontendApp: g
2313
2313
  }), [
2314
- Rn,
2315
- b,
2316
- v
2314
+ Bn,
2315
+ _,
2316
+ g
2317
2317
  ]);
2318
- F(() => {
2319
- C("metric-query-payload-prepared", {
2318
+ P(() => {
2319
+ x("metric-query-payload-prepared", {
2320
2320
  metricId: e?.id,
2321
2321
  metricName: e?.name,
2322
- chartType: G?.chartType,
2323
- payload: u(Y)
2322
+ chartType: U?.chartType,
2323
+ payload: d(q)
2324
2324
  });
2325
2325
  }, [
2326
- Y,
2326
+ q,
2327
2327
  e?.id,
2328
2328
  e?.name,
2329
- G?.chartType
2329
+ U?.chartType
2330
2330
  ]);
2331
- let { data: Z, isLoading: Wn, error: Gn, refetch: Kn } = Zt({
2332
- data: Y,
2333
- clientId: v ? S || "" : r,
2334
- token: b,
2335
- isFrontendApp: v,
2336
- isFullScreen: je,
2337
- savedMetricQuery: e?.isMetric === !1 || !e?.query ? void 0 : Le(e?.query, e?.companyId),
2338
- savedMetricIdentifiers: In,
2331
+ let { data: Y, isLoading: Gn, error: qn, refetch: Jn } = en({
2332
+ data: q,
2333
+ clientId: g ? v || "" : r,
2334
+ token: _,
2335
+ isFrontendApp: g,
2336
+ isFullScreen: Me,
2337
+ savedMetricQuery: e?.isMetric === !1 || !e?.query ? void 0 : ze(e?.query, e?.companyId),
2338
+ savedMetricIdentifiers: Rn,
2339
2339
  dbName: e?.companyIntegration?.name || e?.integrationName,
2340
2340
  batchHints: {
2341
- chartType: G?.chartType,
2342
- isEnableComparisonFilter: !!G?.isEnableComparisonFilter,
2343
- isMultiDimension: !!G?.isMultiDimension,
2344
- isDynamicSeries: !!G?.isDynamicSeries,
2345
- seriesField: G?.seriesField,
2341
+ chartType: U?.chartType,
2342
+ isEnableComparisonFilter: !!U?.isEnableComparisonFilter,
2343
+ isMultiDimension: !!U?.isMultiDimension,
2344
+ isDynamicSeries: !!U?.isDynamicSeries,
2345
+ seriesField: U?.seriesField,
2346
2346
  isDataMartQuery: !!(e?.datasetMetricSettings)?.newDatasetSettings?.isDataMartQuery
2347
2347
  }
2348
2348
  }, {
2349
- isDisableQuery: Ln,
2349
+ isDisableQuery: J,
2350
2350
  onSuccess: (e) => {
2351
- let t = Se(e);
2352
- if (xe && t?.error?.code !== "E1001") {
2353
- let e = Y?.id, n = !!t?.length && (G?.chartType !== k.singleValue || t?.[0]?.[G?.singleValue || ""] != null);
2354
- xe?.((t) => {
2351
+ let t = Te(e);
2352
+ if (Se && t?.error?.code !== "E1001") {
2353
+ let e = q?.id, n = !!t?.length && (U?.chartType !== E.singleValue || t?.[0]?.[U?.singleValue || ""] != null);
2354
+ Se?.((t) => {
2355
2355
  let r = t?.find((t) => t?.id === e);
2356
2356
  return r && r.isDataFound === n ? t : [...t?.filter((t) => t?.id !== e) || [], {
2357
2357
  id: e,
@@ -2361,75 +2361,75 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
2361
2361
  }
2362
2362
  },
2363
2363
  onSettled: () => {
2364
- let e = Y?.id;
2365
- ke && e && ke((t) => Hr(t, e));
2364
+ let e = q?.id;
2365
+ Ae && e && Ae((t) => Ur(t, e));
2366
2366
  }
2367
- }), Q = I(() => hi({
2368
- raw: Z?.data,
2367
+ }), X = F(() => gi({
2368
+ raw: Y?.data,
2369
2369
  selectedDims: (e?.datasetMetricSettings)?.newDatasetSettings?.selectedDims,
2370
2370
  selectedMetrics: (e?.datasetMetricSettings)?.newDatasetSettings?.selectedMetrics,
2371
2371
  datasetSettings: e?.datasetMetricSettings?.newDatasetSettings,
2372
2372
  integrationName: e?.companyIntegration?.name,
2373
- isPythonMode: q
2373
+ isPythonMode: G
2374
2374
  }), [
2375
- Z,
2375
+ Y,
2376
2376
  e?.datasetMetricSettings,
2377
2377
  e?.companyIntegration?.name,
2378
- q
2379
- ]), Jn = I(() => Cn(Z?.metaData?.truncation, Q.length), [Z, Q]), Yn = I(() => wn(Jn), [Jn]);
2380
- F(() => {
2381
- let t = X || Gn;
2378
+ G
2379
+ ]), Xn = F(() => En(Y?.metaData?.truncation, X.length), [Y, X]), Zn = F(() => Dn(Xn), [Xn]);
2380
+ P(() => {
2381
+ let t = zn || qn;
2382
2382
  if (!t) return;
2383
- let n = t instanceof Error ? t.message : ui(t, "message"), r = ui(t, "context");
2384
- C("metric-query-error-observed", {
2383
+ let n = t instanceof Error ? t.message : di(t, "message"), r = di(t, "context");
2384
+ x("metric-query-error-observed", {
2385
2385
  metricId: e?.id,
2386
2386
  metricName: e?.name,
2387
- chartType: G?.chartType,
2387
+ chartType: U?.chartType,
2388
2388
  message: n,
2389
2389
  context: r,
2390
- payload: u(Y)
2390
+ payload: d(q)
2391
2391
  });
2392
2392
  }, [
2393
- X,
2394
- Gn,
2393
+ zn,
2394
+ qn,
2395
2395
  e?.id,
2396
2396
  e?.name,
2397
- G?.chartType
2398
- ]), F(() => {
2399
- let e = Y?.id;
2400
- Ln && ke && e && ke((t) => Hr(t, e));
2397
+ U?.chartType
2398
+ ]), P(() => {
2399
+ let e = q?.id;
2400
+ J && Ae && e && Ae((t) => Ur(t, e));
2401
2401
  }, [
2402
- Ln,
2403
- Y?.id,
2404
- ke
2405
- ]), F(() => {
2406
- let e = Y?.id;
2407
- !Ln && ke && e && ke((t) => Ur(t, e));
2402
+ J,
2403
+ q?.id,
2404
+ Ae
2405
+ ]), P(() => {
2406
+ let e = q?.id;
2407
+ !J && Ae && e && Ae((t) => Wr(t, e));
2408
2408
  }, [
2409
- Ln,
2410
- Pn,
2411
- ke
2409
+ J,
2410
+ Fn,
2411
+ Ae
2412
2412
  ]);
2413
- let { data: Xn } = $t(T, void 0, v, S), Qn = I(() => Xn?.weekStartDay === "sunday" ? "sunday" : "monday", [Xn]), { mutate: $n } = y(), { mutateAsync: er } = m(), tr = I(() => JSON.stringify({
2414
- metricViewFilters: N?.metricViewFilters || [],
2415
- xAxisSettings: N?.xAxisSettings || [],
2416
- yAxisSettings: N?.yAxisSettings || []
2413
+ let { data: Qn } = tn(S, void 0, g, v), $n = F(() => Qn?.weekStartDay === "sunday" ? "sunday" : "monday", [Qn]), { mutate: tr } = ne(), { mutateAsync: nr } = ee(), rr = F(() => JSON.stringify({
2414
+ metricViewFilters: M?.metricViewFilters || [],
2415
+ xAxisSettings: M?.xAxisSettings || [],
2416
+ yAxisSettings: M?.yAxisSettings || []
2417
2417
  }), [
2418
- N?.metricViewFilters,
2419
- N?.xAxisSettings,
2420
- N?.yAxisSettings
2421
- ]), nr = I(() => JSON.stringify(pe || []), [pe]), rr = L(N);
2422
- rr.current = N;
2423
- let ir = L(pe);
2424
- ir.current = pe;
2425
- let ar = L(e?.id);
2426
- ar.current = e?.id, F(() => {
2427
- let t = rr.current, n = ir.current, i = ar.current, o = xn.current !== tr, s = [...t?.metricViewFilters?.find((e) => e.id === i)?.filters?.filter((e) => !n?.find((t) => e?.name === t?.name)) || [], ...n || []];
2428
- At((t) => {
2418
+ M?.metricViewFilters,
2419
+ M?.xAxisSettings,
2420
+ M?.yAxisSettings
2421
+ ]), ir = F(() => JSON.stringify(ge || []), [ge]), ar = I(M);
2422
+ ar.current = M;
2423
+ let or = I(ge);
2424
+ or.current = ge;
2425
+ let sr = I(e?.id);
2426
+ sr.current = e?.id, P(() => {
2427
+ let t = ar.current, n = or.current, i = sr.current, o = Cn.current !== rr, s = [...t?.metricViewFilters?.find((e) => e.id === i)?.filters?.filter((e) => !n?.find((t) => e?.name === t?.name)) || [], ...n || []];
2428
+ jt((t) => {
2429
2429
  let n = e?.rlsConditions?.map((e) => {
2430
2430
  let n = t?.find((t) => t.name === e.name && t.datatype === e.datatype && t.tableName === e.tableName && t.columnName === e.columnName), i = e;
2431
- if (h) {
2432
- let e = vi(i, h);
2431
+ if (m) {
2432
+ let e = yi(i, m);
2433
2433
  if (e) {
2434
2434
  let t = i.datatype === "date" ? e.options?.find((t) => t.name === e.value) : void 0;
2435
2435
  i = {
@@ -2444,7 +2444,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
2444
2444
  maxDate: $(e.maxDate) ?? void 0,
2445
2445
  fromDate: $(e.fromDate) ?? void 0,
2446
2446
  toDate: $(e.toDate) ?? void 0,
2447
- ...ci(e)
2447
+ ...li(e)
2448
2448
  })) : e.options,
2449
2449
  variableOptions: i.datatype === "date" ? e.options?.map((e) => ({
2450
2450
  range: e.range,
@@ -2454,7 +2454,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
2454
2454
  maxDate: $(e.maxDate) ?? void 0,
2455
2455
  fromDate: $(e.fromDate) ?? void 0,
2456
2456
  toDate: $(e.toDate) ?? void 0,
2457
- ...ci(e),
2457
+ ...li(e),
2458
2458
  value: e.name,
2459
2459
  label: e.name
2460
2460
  })) : e.options?.map((e) => ({
@@ -2464,7 +2464,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
2464
2464
  selectedVariableValue: e.value ? i.datatype === "string" ? {
2465
2465
  value: e.value,
2466
2466
  label: e.value
2467
- } : li({
2467
+ } : ui({
2468
2468
  option: t,
2469
2469
  value: e.value
2470
2470
  }) : i.selectedVariableValue
@@ -2485,7 +2485,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
2485
2485
  ...i?.selectedDropdownValue === void 0 && n?.selectedDropdownValue !== void 0 ? { selectedDropdownValue: n.selectedDropdownValue } : {},
2486
2486
  ...i?.selectedVariableValue === void 0 && n?.selectedVariableValue !== void 0 ? { selectedVariableValue: n.selectedVariableValue } : {}
2487
2487
  }), i?.datatype === "date" && i?.options?.find((e) => e.range === "Custom Date") && i?.isEnableDynamicDate && i?.dynamicDate?.value) {
2488
- let e = de(ze?.find((e) => e.value === i?.dynamicDate?.value)?.count || 0), t = We(e), n = We(e);
2488
+ let e = he(Ve?.find((e) => e.value === i?.dynamicDate?.value)?.count || 0), t = Ke(e), n = Ke(e);
2489
2489
  i = {
2490
2490
  ...i,
2491
2491
  options: i?.options?.map((r) => r.range === "Custom Date" ? {
@@ -2501,178 +2501,178 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
2501
2501
  tableName: `${r}.${e.tableName.split(".").slice(1).join(".")}`
2502
2502
  } : i;
2503
2503
  }) || [];
2504
- return ie(t || [], n || []) ? t : n || [];
2504
+ return ce(t || [], n || []) ? t : n || [];
2505
2505
  });
2506
2506
  }, [
2507
2507
  e?.rlsConditions,
2508
- h,
2508
+ m,
2509
2509
  a,
2510
2510
  r,
2511
- nr,
2512
- tr
2513
- ]), F(() => {
2514
- xn.current = tr;
2515
- }, [tr]), F(() => {
2511
+ ir,
2512
+ rr
2513
+ ]), P(() => {
2514
+ Cn.current = rr;
2515
+ }, [rr]), P(() => {
2516
2516
  let e;
2517
- return Wn ? dt(!0) : e = setTimeout(() => {
2518
- dt(!1);
2517
+ return Gn ? ft(!0) : e = setTimeout(() => {
2518
+ ft(!1);
2519
2519
  }, 300), () => clearTimeout(e);
2520
- }, [Wn]), F(() => {
2521
- e?.id && Fe && !q && e?.isMetric && Fe?.((t) => {
2520
+ }, [Gn]), P(() => {
2521
+ e?.id && Ne && !G && e?.isMetric && Ne?.((t) => {
2522
2522
  let n = {
2523
- filters: [...W || [], ...G?.tableSettings?.isServerSidePagination && G?.chartType === k.table ? jt?.map((e) => e.condition)?.filter((e) => $e(e)) : []],
2523
+ filters: [...H || [], ...U?.tableSettings?.isServerSidePagination && U?.chartType === E.table ? Mt?.map((e) => e.condition)?.filter((e) => tt(e)) : []],
2524
2524
  xAxisSettings: {
2525
- isEnable: !!(G?.dynamicXAxis?.isEnabled || G?.enduserMeasureAndDimensions?.isEnabled) && ne.includes(G?.chartType || ""),
2526
- xaxis: G?.xAxis || ""
2525
+ isEnable: !!(U?.dynamicXAxis?.isEnabled || U?.enduserMeasureAndDimensions?.isEnabled) && oe.includes(U?.chartType || ""),
2526
+ xaxis: U?.xAxis || ""
2527
2527
  },
2528
2528
  yAxisSettings: {
2529
- isEnable: !(G?.dynamicYAxis?.isEnabled && G?.dynamicYAxis?.selectedOption && !Array.isArray(G?.dynamicYAxis?.selectedOption)),
2530
- yAxis: G?.dynamicYAxis?.selectedOption || ""
2529
+ isEnable: !(U?.dynamicYAxis?.isEnabled && U?.dynamicYAxis?.selectedOption && !Array.isArray(U?.dynamicYAxis?.selectedOption)),
2530
+ yAxis: U?.dynamicYAxis?.selectedOption || ""
2531
2531
  },
2532
2532
  id: e?.id,
2533
2533
  metricRequestData: {
2534
- isAllClient: g,
2535
- timeseriesSettings: q ? void 0 : {
2536
- format: G?.timeSeriesSettings?.groupBySettings?.value?.toLowerCase() || "monthly",
2537
- seriesField: G?.seriesField || "",
2538
- isFiscal: ye === "ind"
2534
+ isAllClient: h,
2535
+ timeseriesSettings: G ? void 0 : {
2536
+ format: U?.timeSeriesSettings?.groupBySettings?.value?.toLowerCase() || "monthly",
2537
+ seriesField: U?.seriesField || "",
2538
+ isFiscal: A === "ind"
2539
2539
  }
2540
2540
  }
2541
2541
  }, r = t?.find((t) => t.id === e?.id);
2542
- return r && ie(r, n) ? t : [...t?.filter((t) => t.id !== e?.id) || [], n];
2542
+ return r && ce(r, n) ? t : [...t?.filter((t) => t.id !== e?.id) || [], n];
2543
2543
  });
2544
2544
  }, [
2545
2545
  e?.id,
2546
2546
  e?.isMetric,
2547
- W,
2548
- G?.timeSeriesSettings,
2549
- G?.seriesField,
2550
- q,
2551
- ye,
2552
- g,
2553
- jt,
2554
- G?.tableSettings?.isServerSidePagination,
2555
- G?.chartType,
2556
- G?.dynamicYAxis,
2557
- G?.dynamicXAxis
2558
- ]), F(() => {
2547
+ H,
2548
+ U?.timeSeriesSettings,
2549
+ U?.seriesField,
2550
+ G,
2551
+ A,
2552
+ h,
2553
+ Mt,
2554
+ U?.tableSettings?.isServerSidePagination,
2555
+ U?.chartType,
2556
+ U?.dynamicYAxis,
2557
+ U?.dynamicXAxis
2558
+ ]), P(() => {
2559
2559
  if (e?.drillDownSettings?.isEnableGroupBy) {
2560
2560
  let t = e?.datasetMetricSettings;
2561
- if (!e?.drillDownSettings?.configV2 && !U?.configV2 && t?.newDatasetSettings?.selectedMetrics?.length && t?.newDatasetSettings?.selectedDims?.length) {
2561
+ if (!e?.drillDownSettings?.configV2 && !V?.configV2 && t?.newDatasetSettings?.selectedMetrics?.length && t?.newDatasetSettings?.selectedDims?.length) {
2562
2562
  let n = {
2563
2563
  ...e?.drillDownSettings || {},
2564
2564
  configV2: {
2565
2565
  isEnable: !!e?.drillDownSettings?.isEnableGroupBy,
2566
- levels: br({
2566
+ levels: xr({
2567
2567
  selectedDims: t?.newDatasetSettings?.selectedDims,
2568
2568
  selectedMetrics: t?.newDatasetSettings?.selectedMetrics,
2569
- chartSettings: G,
2569
+ chartSettings: U,
2570
2570
  drilldownChartSettings: e?.drillDownSettings?.drilldownChartSettings,
2571
- makeIndex: () => me(4)
2571
+ makeIndex: () => ve(4)
2572
2572
  })
2573
2573
  }
2574
2574
  };
2575
- en(() => Pr(n, {
2576
- drilledLevel: Xe,
2577
- drillFilters: Ze,
2578
- drillType: nt,
2579
- underlyingDataDrillFilters: at
2575
+ nn(() => Fr(n, {
2576
+ drilledLevel: Ye,
2577
+ drillFilters: Qe,
2578
+ drillType: $e,
2579
+ underlyingDataDrillFilters: it
2580
2580
  }) ?? n);
2581
- } else U?.isEnableGroupBy || en(e?.drillDownSettings);
2581
+ } else V?.isEnableGroupBy || nn(e?.drillDownSettings);
2582
2582
  }
2583
2583
  }, [
2584
2584
  e?.drillDownSettings?.isEnableGroupBy,
2585
2585
  e?.drillDownSettings?.configV2,
2586
2586
  e?.datasetMetricSettings,
2587
- G,
2588
- Ze,
2589
- Xe,
2590
- nt,
2591
- at
2587
+ U,
2588
+ Qe,
2589
+ Ye,
2590
+ $e,
2591
+ it
2592
2592
  ]);
2593
- let or = L(!1);
2594
- F(() => {
2595
- if (or.current) return;
2596
- let t = Ae?.position;
2597
- if (!Ae?.enabled || !t || !e?.id) return;
2598
- let n = U?.configV2;
2593
+ let cr = I(!1);
2594
+ P(() => {
2595
+ if (cr.current) return;
2596
+ let t = j?.position;
2597
+ if (!j?.enabled || !t || !e?.id) return;
2598
+ let n = V?.configV2;
2599
2599
  if (!n?.levels?.length) return;
2600
- or.current = !0;
2601
- let r = Nn(n, t);
2600
+ cr.current = !0;
2601
+ let r = In(n, t);
2602
2602
  if (!r) return;
2603
- en((e) => ({
2603
+ nn((e) => ({
2604
2604
  ...e,
2605
2605
  configV2: r
2606
2606
  }));
2607
2607
  let i = r.levels?.find((e) => e?.isEnable);
2608
- i?.chartSettings && K((e) => ({
2608
+ i?.chartSettings && W((e) => ({
2609
2609
  ...e,
2610
2610
  ...i.chartSettings
2611
- })), C("drill-restored-from-url", {
2611
+ })), x("drill-restored-from-url", {
2612
2612
  metricId: e?.id,
2613
2613
  levelIndex: t.levelIndex,
2614
2614
  filterCount: t.filters?.length || 0
2615
2615
  });
2616
2616
  }, [
2617
- Ae?.enabled,
2618
- Ae?.position,
2619
- U?.configV2,
2617
+ j?.enabled,
2618
+ j?.position,
2619
+ V?.configV2,
2620
2620
  e?.id
2621
2621
  ]);
2622
- let sr = L(void 0);
2623
- F(() => {
2624
- if (!Ae?.enabled || !Ae.onChange || !e?.id) return;
2625
- let t = U?.configV2?.levels || [], n = t.findIndex((e) => e?.isEnable), r = n >= 0 ? t[n] : void 0, i = n > 0 && r?.index ? An({
2622
+ let lr = I(void 0);
2623
+ P(() => {
2624
+ if (!j?.enabled || !j.onChange || !e?.id) return;
2625
+ let t = V?.configV2?.levels || [], n = t.findIndex((e) => e?.isEnable), r = n >= 0 ? t[n] : void 0, i = n > 0 && r?.index ? Nn({
2626
2626
  levelIndex: r.index,
2627
2627
  filters: (r.filters || []).filter((e) => e?.columnName).map((e) => ({
2628
2628
  columnName: String(e.columnName),
2629
2629
  value: String(e.value ?? "")
2630
2630
  }))
2631
2631
  }) : null;
2632
- sr.current !== i && (sr.current = i, Ae.onChange(e.id, i));
2632
+ lr.current !== i && (lr.current = i, j.onChange(e.id, i));
2633
2633
  }, [
2634
- Ae?.enabled,
2635
- Ae?.onChange,
2636
- U?.configV2,
2634
+ j?.enabled,
2635
+ j?.onChange,
2636
+ V?.configV2,
2637
2637
  e?.id
2638
2638
  ]);
2639
- let { mutateAsync: cr } = x(), lr = I(() => JSON.stringify(t?.filters), [t?.filters]), ur = I(() => {
2639
+ let { mutateAsync: ur } = y(), dr = F(() => JSON.stringify(t?.filters), [t?.filters]), fr = F(() => {
2640
2640
  let n = e?.datasetMetricSettings?.metricVariables || [];
2641
2641
  if (!n || !Array.isArray(n) || !n?.length) return [];
2642
2642
  let i = [];
2643
2643
  for (let o = 0; o < n?.length; o++) {
2644
2644
  let s = n[o], c = s.type.value === "custom" && s.customQuery && s.customColumnName, l = c ? {
2645
- query: Je({
2645
+ query: Xe({
2646
2646
  query: s?.customQuery || "",
2647
2647
  tenancyLevel: a,
2648
2648
  clientId: r,
2649
- isAllClient: g,
2650
- clientColumnType: ce || "STRING",
2649
+ isAllClient: h,
2650
+ clientColumnType: se || "STRING",
2651
2651
  dbName: e?.companyIntegration?.name,
2652
- rlsConditions: W?.filter((e) => e.isVariableFilter),
2652
+ rlsConditions: H?.filter((e) => e.isVariableFilter),
2653
2653
  globalFilters: {
2654
2654
  ...t,
2655
2655
  filters: t?.filters?.filter((e) => e?.isVariableFilter && !!(Array.isArray(e?.value) ? e?.value?.length : e))
2656
2656
  },
2657
- weekStartDay: Qn
2657
+ weekStartDay: $n
2658
2658
  }),
2659
- alias: Ye
2660
- } : void 0, u = s.dependOnOptions?.length ? W?.filter((e) => s.dependOnOptions.some((t) => t.type === "metric" && t.filter?.value === e.name && t.column)) : [], d = s.dependOnOptions?.length ? t?.filters?.filter((e) => Array.isArray(e?.value) ? e?.value?.length : e && s.dependOnOptions.some((t) => t.type === "dashboard" && t.filter?.value === e.label && t.column)) : [], f = u?.map((e) => {
2661
- let t = ue(e);
2659
+ alias: Ze
2660
+ } : void 0, u = s.dependOnOptions?.length ? H?.filter((e) => s.dependOnOptions.some((t) => t.type === "metric" && t.filter?.value === e.name && t.column)) : [], d = s.dependOnOptions?.length ? t?.filters?.filter((e) => Array.isArray(e?.value) ? e?.value?.length : e && s.dependOnOptions.some((t) => t.type === "dashboard" && t.filter?.value === e.label && t.column)) : [], f = u?.map((e) => {
2661
+ let t = me(e);
2662
2662
  return e.datatype === "date" && t === void 0 ? null : {
2663
2663
  columnName: s.dependOnOptions.find((t) => e.name === t.filter?.value)?.column || "",
2664
2664
  value: t,
2665
2665
  as: e.datatype
2666
2666
  };
2667
2667
  }).filter(Boolean), p = d?.map((e) => {
2668
- let t = e.as === "date" ? Ue(e) : we(e?.value);
2668
+ let t = e.as === "date" ? Ge(e) : De(e?.value);
2669
2669
  return e.as === "date" && t === void 0 ? null : {
2670
2670
  columnName: s.dependOnOptions.find((t) => e.label === t.filter?.value)?.column || "",
2671
2671
  value: t,
2672
2672
  as: e.as
2673
2673
  };
2674
2674
  }).filter(Boolean);
2675
- s.isClientScoped && r && ce && !g && a === "TABLE" && s.clientColumn?.name?.value && s.clientColumn?.datatype?.value && f.push({
2675
+ s.isClientScoped && r && se && !h && a === "TABLE" && s.clientColumn?.name?.value && s.clientColumn?.datatype?.value && f.push({
2676
2676
  columnName: s.clientColumn?.name?.value,
2677
2677
  value: r,
2678
2678
  as: s.clientColumn?.datatype?.value
@@ -2680,7 +2680,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
2680
2680
  let m = [...f, ...p];
2681
2681
  i.push({
2682
2682
  object: {
2683
- wId: T,
2683
+ wId: S,
2684
2684
  tableName: c ? "" : s?.table?.value,
2685
2685
  columnName: c ? s?.customColumnName || "" : s?.column?.value || "",
2686
2686
  filter: m,
@@ -2696,29 +2696,29 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
2696
2696
  return i;
2697
2697
  }, [
2698
2698
  e?.datasetMetricSettings?.metricVariables,
2699
- lr,
2700
- W,
2701
- ce,
2702
- T,
2699
+ dr,
2700
+ H,
2701
+ se,
2702
+ S,
2703
2703
  a,
2704
2704
  r,
2705
- g,
2705
+ h,
2706
2706
  fe
2707
- ]), dr = I(() => JSON.stringify(ur), [ur]), fr = L(null), pr = L(0), mr = L({
2707
+ ]), pr = F(() => JSON.stringify(fr), [fr]), Z = I(null), mr = I(0), Q = I({
2708
2708
  clientId: r,
2709
- encryptedClientId: S,
2710
- isFrontendApp: v,
2711
- token: qe
2709
+ encryptedClientId: v,
2710
+ isFrontendApp: g,
2711
+ token: Je
2712
2712
  });
2713
- mr.current.clientId = r, mr.current.encryptedClientId = S, mr.current.isFrontendApp = v, mr.current.token = qe;
2714
- let hr = L(cr);
2715
- hr.current = cr, F(() => {
2716
- pr.current += 1;
2717
- let e = pr.current, t = () => pr.current !== e;
2718
- if (ur?.length) {
2719
- let { clientId: e, encryptedClientId: n, isFrontendApp: r, token: i } = mr.current;
2720
- Zr({
2721
- entries: ur,
2713
+ Q.current.clientId = r, Q.current.encryptedClientId = v, Q.current.isFrontendApp = g, Q.current.token = Je;
2714
+ let hr = I(ur);
2715
+ hr.current = ur, P(() => {
2716
+ mr.current += 1;
2717
+ let e = mr.current, t = () => mr.current !== e;
2718
+ if (fr?.length) {
2719
+ let { clientId: e, encryptedClientId: n, isFrontendApp: r, token: i } = Q.current;
2720
+ Qr({
2721
+ entries: fr,
2722
2722
  fetchColumnValues: hr.current,
2723
2723
  ctx: {
2724
2724
  clientId: e,
@@ -2726,132 +2726,132 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
2726
2726
  isFrontendApp: r,
2727
2727
  token: i
2728
2728
  },
2729
- onSeed: (e) => hn(e),
2730
- onResolved: (e, t) => hn((n) => ({
2729
+ onSeed: (e) => _n(e),
2730
+ onResolved: (e, t) => _n((n) => ({
2731
2731
  ...n,
2732
2732
  [e]: t
2733
2733
  })),
2734
- onLoading: (e) => lt(e),
2734
+ onLoading: (e) => ut(e),
2735
2735
  onSettle: () => {
2736
- fr.current && clearTimeout(fr.current), fr.current = setTimeout(() => {
2737
- fr.current = null, lt(!1);
2736
+ Z.current && clearTimeout(Z.current), Z.current = setTimeout(() => {
2737
+ Z.current = null, ut(!1);
2738
2738
  }, 200);
2739
2739
  },
2740
2740
  isCancelled: t
2741
2741
  }).catch(() => {});
2742
2742
  }
2743
2743
  return () => {
2744
- pr.current += 1, fr.current &&= (clearTimeout(fr.current), null);
2744
+ mr.current += 1, Z.current &&= (clearTimeout(Z.current), null);
2745
2745
  };
2746
- }, [dr]);
2747
- let gr = I(() => (e?.datasetMetricSettings)?.newDatasetSettings?.selectedDims?.[0]?.name, [e]);
2748
- I(() => se(e?.datasetMetricSettings?.selectedDimensions?.[H.length < e?.datasetMetricSettings?.selectedDimensions?.length ? H.length : 0] || ""), [e?.datasetMetricSettings, H]);
2749
- let _r = I(() => e?.drillDownSettings?.isEnableGroupBy ? V || [] : [...V?.length ? V : [], ...l || []], [
2746
+ }, [pr]);
2747
+ let gr = F(() => (e?.datasetMetricSettings)?.newDatasetSettings?.selectedDims?.[0]?.name, [e]);
2748
+ F(() => de(e?.datasetMetricSettings?.selectedDimensions?.[Qt.length < e?.datasetMetricSettings?.selectedDimensions?.length ? Qt.length : 0] || ""), [e?.datasetMetricSettings, Qt]);
2749
+ let _r = F(() => e?.drillDownSettings?.isEnableGroupBy ? B || [] : [...B?.length ? B : [], ...l || []], [
2750
2750
  l,
2751
2751
  e?.drillDownSettings?.isEnableGroupBy,
2752
- V
2753
- ]), vr = P((e = []) => e.filter((e) => e.isAddOnMetrics).map((e) => o ? {
2752
+ B
2753
+ ]), vr = N((e = []) => e.filter((e) => e.isAddOnMetrics).map((e) => o ? {
2754
2754
  ...e,
2755
- dimensionColumn: G?.xAxis || "",
2756
- measureColumn: G?.yAxisList?.[0] || "",
2755
+ dimensionColumn: U?.xAxis || "",
2756
+ measureColumn: U?.yAxisList?.[0] || "",
2757
2757
  options: e.datatype === "date" ? e.options : [],
2758
2758
  variableOptions: e.datatype === "date" ? e.variableOptions : []
2759
2759
  } : {
2760
2760
  ...e,
2761
- dimensionColumn: G?.xAxis || "",
2762
- measureColumn: G?.yAxisList?.[0] || "",
2763
- value: e.isAppFilter ? e.datatype === "date" ? ve(s?.values?.[e.name], e?.datePresetOptions || e?.presetDateOptions) || (e?.options)?.find((t) => t.name === (s?.values?.[e.name] ?? e.value)) : s?.values?.[e.name] ?? e.value : e.value,
2764
- options: e.datatype === "date" ? e?.options?.map((t) => ye === "ind" && e.datatype === "date" ? {
2761
+ dimensionColumn: U?.xAxis || "",
2762
+ measureColumn: U?.yAxisList?.[0] || "",
2763
+ value: e.isAppFilter ? e.datatype === "date" ? xe(s?.values?.[e.name], e?.datePresetOptions || e?.presetDateOptions) || (e?.options)?.find((t) => t.name === (s?.values?.[e.name] ?? e.value)) : s?.values?.[e.name] ?? e.value : e.value,
2764
+ options: e.datatype === "date" ? e?.options?.map((t) => A === "ind" && e.datatype === "date" ? {
2765
2765
  ...t,
2766
2766
  isFiscal: !0
2767
2767
  } : t) : [],
2768
2768
  variableOptions: e.datatype === "date" ? e.variableOptions : []
2769
- }).filter((e) => En(e)), [
2769
+ }).filter((e) => On(e)), [
2770
2770
  s?.values,
2771
- ye,
2772
- G?.xAxis,
2773
- G?.yAxisList,
2771
+ A,
2772
+ U?.xAxis,
2773
+ U?.yAxisList,
2774
2774
  o,
2775
- En
2775
+ On
2776
2776
  ]);
2777
- I(() => vr(_r), [vr, _r]), F(() => {
2778
- _r?.some((e) => e.isAddOnMetrics) ? pn(vr(_r)) : pn([]);
2777
+ F(() => vr(_r), [vr, _r]), P(() => {
2778
+ _r?.some((e) => e.isAddOnMetrics) ? hn(vr(_r)) : hn([]);
2779
2779
  }, [vr, _r]);
2780
- let xr = I(() => G?.chartType === k.singleValue && !!G?.customSettings?.comparisonValueShow && !!G?.customSettings?.comparisonTimeGrain && !!G?.customSettings?.comparisonTimePeriod && !!G?.singleValue, [G]);
2781
- F(() => {
2782
- let t = Z;
2780
+ let yr = F(() => U?.chartType === E.singleValue && !!U?.customSettings?.comparisonValueShow && !!U?.customSettings?.comparisonTimeGrain && !!U?.customSettings?.comparisonTimePeriod && !!U?.singleValue, [U]);
2781
+ P(() => {
2782
+ let t = Y;
2783
2783
  if (Tn({
2784
2784
  data: [],
2785
2785
  error: "",
2786
2786
  isLoading: !1,
2787
2787
  currentValue: ""
2788
- }), G?.chartType === k.table) {
2788
+ }), U?.chartType === E.table) {
2789
2789
  let e = t?.totalRecords;
2790
- typeof e == "number" && Ot(e);
2790
+ typeof e == "number" && kt(e);
2791
2791
  }
2792
- if (C("metric-query-response-applied", {
2792
+ if (x("metric-query-response-applied", {
2793
2793
  metricId: e?.id,
2794
2794
  metricName: e?.name,
2795
- chartType: G?.chartType,
2796
- rowCount: Q?.length || 0,
2797
- columns: Object.keys(Q?.[0] || {}),
2795
+ chartType: U?.chartType,
2796
+ rowCount: X?.length || 0,
2797
+ columns: Object.keys(X?.[0] || {}),
2798
2798
  totalRecords: t?.totalRecords,
2799
- truncation: Jn,
2800
- drillConfig: d(U?.configV2)
2799
+ truncation: Xn,
2800
+ drillConfig: f(V?.configV2)
2801
2801
  }), e?.datasetMetricSettings?.isUseRawSQL) {
2802
- let e = Object.keys(Q?.[0] || {});
2803
- K((t) => ({
2802
+ let e = Object.keys(X?.[0] || {});
2803
+ W((t) => ({
2804
2804
  ...t,
2805
2805
  yAxisList: e.length ? e : t?.yAxisList || []
2806
2806
  }));
2807
2807
  }
2808
2808
  let n = t?.metaData;
2809
- on(_e(n?.groupbyColumnList)), Ht((e) => ({
2809
+ cn(be(n?.groupbyColumnList)), Ut((e) => ({
2810
2810
  ...e,
2811
2811
  report: "",
2812
2812
  isLoading: e?.isLoading,
2813
2813
  isOpen: e?.isOpen
2814
2814
  }));
2815
2815
  }, [
2816
- Z,
2816
+ Y,
2817
2817
  e?.datasetMetricSettings,
2818
- Q,
2819
- Jn
2820
- ]), F(() => {
2821
- e?.datasetMetricSettings?.createdSorts?.length ? vn(!0) : vn(!1);
2822
- }, [e?.datasetMetricSettings?.createdSorts?.length]), F(() => {
2823
- G?.chartType === k.timeSeries && G?.timeSeriesSettings?.groupBySettings?.value && !q && K((e) => ({
2818
+ X,
2819
+ Xn
2820
+ ]), P(() => {
2821
+ e?.datasetMetricSettings?.createdSorts?.length ? yn(!0) : yn(!1);
2822
+ }, [e?.datasetMetricSettings?.createdSorts?.length]), P(() => {
2823
+ U?.chartType === E.timeSeries && U?.timeSeriesSettings?.groupBySettings?.value && !G && W((e) => ({
2824
2824
  ...e,
2825
- xAxis: `${G?.timeSeriesSettings?.groupBySettings?.value?.toLowerCase()} of ${gr}`
2825
+ xAxis: `${U?.timeSeriesSettings?.groupBySettings?.value?.toLowerCase()} of ${gr}`
2826
2826
  }));
2827
2827
  }, [
2828
- Q,
2829
- G?.chartType,
2830
- G?.timeSeriesSettings,
2831
- q
2832
- ]), F(() => {
2833
- if (G?.isEnableComparisonFilter && [k.line].includes(G?.chartType)) {
2834
- let t = e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics || [], n = Object?.keys(Q?.[0] || {});
2835
- K((e) => ({
2828
+ X,
2829
+ U?.chartType,
2830
+ U?.timeSeriesSettings,
2831
+ G
2832
+ ]), P(() => {
2833
+ if (U?.isEnableComparisonFilter && [E.line].includes(U?.chartType)) {
2834
+ let t = e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics || [], n = Object?.keys(X?.[0] || {});
2835
+ W((e) => ({
2836
2836
  ...e,
2837
2837
  yAxisList: [...n.filter((e) => t?.some((t) => e.startsWith(t.alias)))]
2838
2838
  }));
2839
2839
  }
2840
2840
  }, [
2841
- Q,
2842
- G?.isEnableComparisonFilter,
2843
- B,
2844
- G?.chartType
2841
+ X,
2842
+ U?.isEnableComparisonFilter,
2843
+ z,
2844
+ U?.chartType
2845
2845
  ]);
2846
- let Sr = P((t, n, r, a, o, s) => {
2847
- f("metric-filter-applied", {
2846
+ let Sr = N((t, n, r, a, o, s) => {
2847
+ p("metric-filter-applied", {
2848
2848
  metricId: e?.id,
2849
2849
  hasCustomValue: !!a,
2850
2850
  hasStringValues: !!o?.length,
2851
2851
  stringValueCount: o?.length || 0,
2852
2852
  hasTimeGrain: !!s,
2853
- rlsConditionCount: V?.length || 0
2854
- }), re?.(i, e?.id), At(a ? (e) => e?.map((e) => e.name === t ? {
2853
+ rlsConditionCount: B?.length || 0
2854
+ }), T?.(i, e?.id), jt(a ? (e) => e?.map((e) => e.name === t ? {
2855
2855
  ...e,
2856
2856
  value: n,
2857
2857
  options: e.options?.map((e) => n === e.name ? {
@@ -2869,7 +2869,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
2869
2869
  label: n,
2870
2870
  endDate: a.endDate,
2871
2871
  startDate: a.startDate,
2872
- ...ci(a),
2872
+ ...li(a),
2873
2873
  timeGrainValue: s
2874
2874
  }
2875
2875
  } : e) : o ? (e) => e?.map((e) => e.name === t ? {
@@ -2888,68 +2888,68 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
2888
2888
  label: r || n
2889
2889
  }
2890
2890
  } : e));
2891
- }, []), wr = P((t) => {
2892
- t?.event && t?.event?.event?.preventDefault(), C("chart-click-params-captured", {
2891
+ }, []), Cr = N((t) => {
2892
+ t?.event && t?.event?.event?.preventDefault(), x("chart-click-params-captured", {
2893
2893
  metricId: e?.id,
2894
2894
  metricName: e?.name,
2895
- chartType: G?.chartType,
2895
+ chartType: U?.chartType,
2896
2896
  name: t?.name,
2897
2897
  value: t?.value,
2898
2898
  seriesName: t?.seriesName,
2899
2899
  dataIndex: t?.dataIndex,
2900
- drillConfig: d(U?.configV2)
2901
- }), It(t);
2900
+ drillConfig: f(V?.configV2)
2901
+ }), Lt(t);
2902
2902
  }, [
2903
2903
  e?.id,
2904
2904
  e?.name,
2905
- G?.chartType,
2906
- U?.configV2
2907
- ]), Tr = I(() => Array.isArray(Q) && Q.length && Ft?.name ? Q?.map((e) => Object.entries(e).find(([, e]) => (typeof e == "number" && typeof Ft?.name == "string" ? e?.toString() : e) === Ft.name)?.[0]).filter((e) => e)[0] : "", [Q, Ft?.name]), Er = I(() => {
2905
+ U?.chartType,
2906
+ V?.configV2
2907
+ ]), Tr = F(() => Array.isArray(X) && X.length && It?.name ? X?.map((e) => Object.entries(e).find(([, e]) => (typeof e == "number" && typeof It?.name == "string" ? e?.toString() : e) === It.name)?.[0]).filter((e) => e)[0] : "", [X, It?.name]), Er = F(() => {
2908
2908
  let t = e?.datasetMetricSettings?.newDatasetSettings;
2909
2909
  return {
2910
2910
  selectedDims: t?.selectedDims,
2911
2911
  selectedMetrics: t?.selectedMetrics,
2912
- levelDimensions: U?.configV2?.levels?.flatMap((e) => e?.dimensions || []) || []
2912
+ levelDimensions: V?.configV2?.levels?.flatMap((e) => e?.dimensions || []) || []
2913
2913
  };
2914
- }, [U?.configV2?.levels, e?.datasetMetricSettings]), Dr = P((e) => Ie({
2914
+ }, [V?.configV2?.levels, e?.datasetMetricSettings]), Dr = N((e) => Re({
2915
2915
  filter: e,
2916
2916
  ...Er
2917
- }), [Er]), kr = I(() => {
2918
- if (Yt.current !== void 0 && H === Jt.current) return Yt.current;
2919
- let e = U?.configV2?.levels?.find((e) => e?.isEnable)?.filters || [];
2920
- return (e.length ? e : H).map(Dr);
2917
+ }), [Er]), Or = F(() => {
2918
+ if (Xt.current !== void 0 && Qt === Yt.current) return Xt.current;
2919
+ let e = V?.configV2?.levels?.find((e) => e?.isEnable)?.filters || [];
2920
+ return (e.length ? e : Qt).map(Dr);
2921
2921
  }, [
2922
- U?.configV2?.levels,
2923
- H,
2922
+ V?.configV2?.levels,
2923
+ Qt,
2924
2924
  Dr,
2925
- Jt,
2926
- Yt
2927
- ]), Ar = I(() => Te({
2925
+ Yt,
2926
+ Xt
2927
+ ]), Ar = F(() => Oe({
2928
2928
  columnName: Tr,
2929
2929
  ...Er
2930
- }), [Tr, Er]), { getUnderlyingData: jr } = _n({
2930
+ }), [Tr, Er]), { getUnderlyingData: jr } = bn({
2931
2931
  clientName: r,
2932
2932
  dbName: e?.companyIntegration?.name,
2933
2933
  tenancyType: a,
2934
- values: On,
2934
+ values: An,
2935
2935
  companyId: e?.companyId,
2936
- query: Le(e?.query, e?.companyId),
2937
- workspaceId: T,
2936
+ query: ze(e?.query, e?.companyId),
2937
+ workspaceId: S,
2938
2938
  metricId: e?.id,
2939
- dashboardId: w,
2940
- rlsConditions: W,
2939
+ dashboardId: b,
2940
+ rlsConditions: H,
2941
2941
  globalFilters: t,
2942
- isAllClient: !!g,
2943
- dataMartRelationships: Dn,
2942
+ isAllClient: !!h,
2943
+ dataMartRelationships: kn,
2944
2944
  customSql: e?.clickActions?.underlyingData?.sql,
2945
- isEnableCustomSQL: G?.chartType === k.singleValue && e?.clickActions?.underlyingData?.isEnable && e?.clickActions?.underlyingData?.sql,
2945
+ isEnableCustomSQL: U?.chartType === E.singleValue && e?.clickActions?.underlyingData?.isEnable && e?.clickActions?.underlyingData?.sql,
2946
2946
  datasourceId: fe,
2947
- drillFilters: kr,
2948
- token: qe || "",
2949
- isFrontendApp: v,
2950
- encryptedClientId: v ? S || "" : r || ""
2947
+ drillFilters: Or,
2948
+ token: Je || "",
2949
+ isFrontendApp: g,
2950
+ encryptedClientId: g ? v || "" : r || ""
2951
2951
  }), Mr = async (t, n, i, o, s, u) => {
2952
- C("drill-config-change-start", {
2952
+ x("drill-config-change-start", {
2953
2953
  metricId: e?.id,
2954
2954
  metricName: e?.name,
2955
2955
  clickedLevelIndex: i,
@@ -2957,21 +2957,21 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
2957
2957
  clickName: n?.name,
2958
2958
  clickValue: n?.value,
2959
2959
  rowFilters: n?.rowFilters,
2960
- incomingConfig: d(t),
2961
- stateConfig: d(U?.configV2)
2960
+ incomingConfig: f(t),
2961
+ stateConfig: f(V?.configV2)
2962
2962
  });
2963
- let f = e?.datasetMetricSettings;
2964
- if (!t || !f?.newDatasetSettings?.configuration || !e?.companyIntegration?.name) {
2965
- C("drill-config-change-skipped", {
2963
+ let d = e?.datasetMetricSettings;
2964
+ if (!t || !d?.newDatasetSettings?.configuration || !e?.companyIntegration?.name) {
2965
+ x("drill-config-change-skipped", {
2966
2966
  metricId: e?.id,
2967
- hasStateConfig: !!U?.configV2,
2967
+ hasStateConfig: !!V?.configV2,
2968
2968
  hasIncomingConfig: !!t,
2969
- hasDatasetConfiguration: !!f?.newDatasetSettings?.configuration,
2969
+ hasDatasetConfiguration: !!d?.newDatasetSettings?.configuration,
2970
2970
  integrationName: e?.companyIntegration?.name
2971
2971
  });
2972
2972
  return;
2973
2973
  }
2974
- let p = n?.name, m = (t?.levels || []).find((e) => i ? e?.index === i : e?.isEnable), h = m?.dimensions?.[0]?.alias, g = n?.rowFilters || [], { config: _, outcome: v } = Cr({
2974
+ let p = n?.name, m = (t?.levels || []).find((e) => i ? e?.index === i : e?.isEnable), ee = m?.dimensions?.[0]?.alias, h = n?.rowFilters || [], { config: g, outcome: te } = wr({
2975
2975
  config: t,
2976
2976
  clickedLevelIndex: i,
2977
2977
  isReset: o,
@@ -2980,105 +2980,105 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
2980
2980
  adhocDescent: u,
2981
2981
  enrichFilter: Dr
2982
2982
  });
2983
- if (C("drill-config-level-change-resolved", {
2983
+ if (x("drill-config-level-change-resolved", {
2984
2984
  metricId: e?.id,
2985
2985
  clickedLevelIndex: i,
2986
- outcome: v,
2986
+ outcome: te,
2987
2987
  filterValue: p,
2988
2988
  rowFilters: n?.rowFilters,
2989
- resolvedConfig: d(_)
2990
- }), v === "unrepresentable") {
2991
- mt(Or({
2989
+ resolvedConfig: f(g)
2990
+ }), te === "unrepresentable") {
2991
+ R(kr({
2992
2992
  kind: "none",
2993
2993
  reason: "blank-value"
2994
2994
  }));
2995
2995
  return;
2996
2996
  }
2997
- mt(null);
2998
- let y = _, b = [...s || [], ...nn], x = b.length ? [...f?.newDatasetSettings?.selectedDims || [], ...b] : f?.newDatasetSettings?.selectedDims;
2999
- y = Ne({
3000
- config: y,
3001
- selectedDims: x,
3002
- selectedMetrics: f?.newDatasetSettings?.selectedMetrics,
3003
- previousSelectedDims: x,
3004
- previousSelectedMetrics: f?.newDatasetSettings?.selectedMetrics
3005
- }) || y;
3006
- let S = y?.levels?.find((e) => e?.isEnable), w = !!y?.levels?.[y?.levels?.length - 1]?.isEnable, T = y?.levels?.[0]?.isEnable, ee = S?.chartSettings || G, E = ee?.chartType === k.table, te = [...S?.dimensions?.map((e) => e.alias) || [], ...S?.measures?.map((e) => e.alias) || []], D = {
3007
- ...ee,
3008
- xAxis: S?.dimensions?.[0]?.alias || "",
3009
- yAxisList: w && !ee?.chartType || E ? te : S?.measures?.map((e) => e.alias) || [],
3010
- chartType: w && !ee?.chartType ? k.table : ee?.chartType
3011
- }, O = `${S?.dimensions?.[0]?.table?.schemaName}.${S?.dimensions?.[0]?.table?.tableName}`;
3012
- if (C("drill-config-next-state-ready", {
2997
+ R(null);
2998
+ let _ = g, ne = [...s || [], ...an], v = ne.length ? [...d?.newDatasetSettings?.selectedDims || [], ...ne] : d?.newDatasetSettings?.selectedDims;
2999
+ _ = Fe({
3000
+ config: _,
3001
+ selectedDims: v,
3002
+ selectedMetrics: d?.newDatasetSettings?.selectedMetrics,
3003
+ previousSelectedDims: v,
3004
+ previousSelectedMetrics: d?.newDatasetSettings?.selectedMetrics
3005
+ }) || _;
3006
+ let y = _?.levels?.find((e) => e?.isEnable), b = !!_?.levels?.[_?.levels?.length - 1]?.isEnable, S = _?.levels?.[0]?.isEnable, C = y?.chartSettings || U, re = C?.chartType === E.table, w = [...y?.dimensions?.map((e) => e.alias) || [], ...y?.measures?.map((e) => e.alias) || []], ie = {
3007
+ ...C,
3008
+ xAxis: y?.dimensions?.[0]?.alias || "",
3009
+ yAxisList: b && !C?.chartType || re ? w : y?.measures?.map((e) => e.alias) || [],
3010
+ chartType: b && !C?.chartType ? E.table : C?.chartType
3011
+ }, T = `${y?.dimensions?.[0]?.table?.schemaName}.${y?.dimensions?.[0]?.table?.tableName}`;
3012
+ if (x("drill-config-next-state-ready", {
3013
3013
  metricId: e?.id,
3014
3014
  activeLevel: {
3015
- index: S?.index,
3016
- name: S?.name,
3017
- filters: S?.filters
3015
+ index: y?.index,
3016
+ name: y?.name,
3017
+ filters: y?.filters
3018
3018
  },
3019
- isLastLevel: w,
3020
- isFirstLevelActive: T,
3021
- chartType: D?.chartType,
3022
- xAxis: D?.xAxis,
3023
- yAxisList: D?.yAxisList,
3024
- tableColumns: te,
3025
- updatedConfig: d(y)
3026
- }), en((e) => ({
3019
+ isLastLevel: b,
3020
+ isFirstLevelActive: S,
3021
+ chartType: ie?.chartType,
3022
+ xAxis: ie?.xAxis,
3023
+ yAxisList: ie?.yAxisList,
3024
+ tableColumns: w,
3025
+ updatedConfig: f(_)
3026
+ }), nn((e) => ({
3027
3027
  ...e,
3028
3028
  configV2: {
3029
- ...y || {},
3030
- levels: y?.levels?.map((e) => e.index === S?.index ? {
3029
+ ..._ || {},
3030
+ levels: _?.levels?.map((e) => e.index === y?.index ? {
3031
3031
  ...e,
3032
- chartSettings: D
3032
+ chartSettings: ie
3033
3033
  } : e) || []
3034
3034
  }
3035
- })), K((e) => D), C("drill-config-state-committed", {
3035
+ })), W((e) => ie), x("drill-config-state-committed", {
3036
3036
  metricId: e?.id,
3037
- chartType: D?.chartType,
3038
- activeLevelIndex: S?.index,
3039
- drillConfig: d(y)
3040
- }), tn) {
3041
- let t = Hn({
3037
+ chartType: ie?.chartType,
3038
+ activeLevelIndex: y?.index,
3039
+ drillConfig: f(_)
3040
+ }), rn) {
3041
+ let t = Wn({
3042
3042
  existing: l,
3043
3043
  isReset: o,
3044
3044
  levelIndex: i,
3045
3045
  hasCurrentLevel: !!m,
3046
3046
  filterValue: p,
3047
- columnName: h,
3048
- rowFilters: g,
3049
- selectedDims: f?.newDatasetSettings?.selectedDims,
3050
- activeLevelTableName: O,
3047
+ columnName: ee,
3048
+ rowFilters: h,
3049
+ selectedDims: d?.newDatasetSettings?.selectedDims,
3050
+ activeLevelTableName: T,
3051
3051
  tenancyLevel: a,
3052
3052
  clientId: r
3053
- }), n = !o && !i ? Bn({
3054
- columnName: h,
3055
- rowFilters: g,
3056
- selectedDims: f?.newDatasetSettings?.selectedDims
3053
+ }), n = !o && !i ? Un({
3054
+ columnName: ee,
3055
+ rowFilters: h,
3056
+ selectedDims: d?.newDatasetSettings?.selectedDims
3057
3057
  }) : void 0;
3058
- C("drill-cross-filter-state-committed", {
3058
+ x("drill-cross-filter-state-committed", {
3059
3059
  metricId: e?.id,
3060
3060
  crossFilterCount: t?.length || 0,
3061
3061
  drillCrossFilters: t
3062
- }), n ? mt({
3062
+ }), n ? R({
3063
3063
  title: "Filter unavailable",
3064
3064
  body: n
3065
3065
  }) : c?.(t);
3066
3066
  }
3067
3067
  }, Nr = ({ columnName: t, value: n, mode: i = "only" }) => {
3068
- if (!tn) return;
3069
- let o = e?.datasetMetricSettings, s = Bn({
3068
+ if (!rn) return;
3069
+ let o = e?.datasetMetricSettings, s = Un({
3070
3070
  columnName: t,
3071
3071
  selectedDims: o?.newDatasetSettings?.selectedDims,
3072
3072
  requiresSchemaMetadata: !0
3073
3073
  });
3074
3074
  if (s) {
3075
- mt({
3075
+ R({
3076
3076
  title: "Filter unavailable",
3077
3077
  body: s
3078
3078
  });
3079
3079
  return;
3080
3080
  }
3081
- let u = qn({
3081
+ let u = Yn({
3082
3082
  existing: l,
3083
3083
  columnName: t,
3084
3084
  value: n,
@@ -3087,28 +3087,28 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3087
3087
  tenancyLevel: a,
3088
3088
  clientId: r
3089
3089
  });
3090
- C("point-cross-filter-committed", {
3090
+ x("point-cross-filter-committed", {
3091
3091
  metricId: e?.id,
3092
3092
  columnName: t,
3093
3093
  mode: i,
3094
3094
  crossFilterCount: u?.length || 0
3095
3095
  }), c?.(u);
3096
- }, Fr = ({ columnName: t, value: n, mode: i = "only" }) => {
3096
+ }, Pr = ({ columnName: t, value: n, mode: i = "only" }) => {
3097
3097
  if (!e?.id) return;
3098
- let o = e?.datasetMetricSettings, s = Bn({
3098
+ let o = e?.datasetMetricSettings, s = Un({
3099
3099
  columnName: t,
3100
3100
  selectedDims: o?.newDatasetSettings?.selectedDims,
3101
3101
  requiresSchemaMetadata: !0
3102
3102
  });
3103
3103
  if (s) {
3104
- mt({
3104
+ R({
3105
3105
  title: "Filter unavailable",
3106
3106
  body: s
3107
3107
  });
3108
3108
  return;
3109
3109
  }
3110
- let c = qn({
3111
- existing: pe,
3110
+ let c = Yn({
3111
+ existing: ge,
3112
3112
  columnName: t,
3113
3113
  value: n,
3114
3114
  mode: i,
@@ -3116,57 +3116,57 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3116
3116
  tenancyLevel: a,
3117
3117
  clientId: r
3118
3118
  });
3119
- C("metric-filter-committed", {
3119
+ x("metric-filter-committed", {
3120
3120
  metricId: e?.id,
3121
3121
  columnName: t,
3122
3122
  mode: i,
3123
3123
  filterCount: c?.length || 0
3124
- }), A?.(e.id, c);
3125
- }, Lr = async (t, n) => {
3126
- C("drill-down-handler-start", {
3124
+ }), _e?.(e.id, c);
3125
+ }, Ir = async (t, n) => {
3126
+ x("drill-down-handler-start", {
3127
3127
  metricId: e?.id,
3128
3128
  metricName: e?.name,
3129
3129
  paramsName: t?.name,
3130
3130
  paramsValue: t?.value,
3131
3131
  paramsSeriesName: t?.seriesName,
3132
3132
  rowFilters: t?.rowFilters || n,
3133
- drillConfig: d(U?.configV2)
3134
- }), await Mr(U?.configV2, t), C("drill-down-handler-complete", {
3133
+ drillConfig: f(V?.configV2)
3134
+ }), await Mr(V?.configV2, t), x("drill-down-handler-complete", {
3135
3135
  metricId: e?.id,
3136
3136
  metricName: e?.name
3137
3137
  });
3138
- }, Kr = async ({ dimension: t, params: n, point: r }) => {
3138
+ }, Rr = async ({ dimension: t, params: n, point: r }) => {
3139
3139
  if (!t?.alias) return;
3140
- let i = e?.datasetMetricSettings, a = U?.configV2, o = a?.levels || [], s = o.findIndex((e) => e?.isEnable), c = (s >= 0 ? o.slice(0, s + 1) : []).map((e) => ({
3140
+ let i = e?.datasetMetricSettings, a = V?.configV2, o = a?.levels || [], s = o.findIndex((e) => e?.isEnable), c = (s >= 0 ? o.slice(0, s + 1) : []).map((e) => ({
3141
3141
  ...e,
3142
3142
  isEnable: !1
3143
- })), l = yr({
3143
+ })), l = br({
3144
3144
  dimension: t,
3145
3145
  measures: i?.newDatasetSettings?.selectedMetrics || [],
3146
- index: me(4),
3147
- chartSettings: G
3146
+ index: ve(4),
3147
+ chartSettings: U
3148
3148
  }), u = {
3149
3149
  ...a || {},
3150
3150
  isEnable: !0,
3151
3151
  levels: [...c, l]
3152
- }, f = c[c.length - 1], p = {
3153
- columnName: f?.dimensions?.[0]?.alias || i?.newDatasetSettings?.selectedDims?.[0]?.alias,
3154
- parentFilters: f?.filters || [],
3155
- pointFilters: Zn(r, Dr).filters
3152
+ }, d = c[c.length - 1], p = {
3153
+ columnName: d?.dimensions?.[0]?.alias || i?.newDatasetSettings?.selectedDims?.[0]?.alias,
3154
+ parentFilters: d?.filters || [],
3155
+ pointFilters: er(r, Dr).filters
3156
3156
  };
3157
- C("adhoc-drill-start", {
3157
+ x("adhoc-drill-start", {
3158
3158
  metricId: e?.id,
3159
3159
  dimensionAlias: t?.alias,
3160
3160
  clickedValue: n?.name,
3161
3161
  seededConfig: !a,
3162
- drillConfig: d(u)
3163
- }), rn((e) => e.some((e) => e?.alias === t?.alias) ? e : [...e, t]), en((e) => ({
3162
+ drillConfig: f(u)
3163
+ }), on((e) => e.some((e) => e?.alias === t?.alias) ? e : [...e, t]), nn((e) => ({
3164
3164
  ...e,
3165
3165
  isEnableGroupBy: !0,
3166
3166
  configV2: u
3167
3167
  })), await Mr(u, n, void 0, !1, [t], p);
3168
3168
  }, qr = ({ filters: n, nextLevel: i, currentValue: a }) => {
3169
- let o = e?.datasetMetricSettings?.newDatasetSettings, s = o?.configuration, c = o?.selectedDims || [], l = o?.selectedMetrics || [], u = e?.datasetMetricSettings?.createdSorts || [], { headerColumns: d, nonHeaderColumns: f } = c.reduce((e, t) => (G?.pivotTableSettings2?.headers?.includes(t.alias) ? e.headerColumns.push(t) : e.nonHeaderColumns.push(t), e), {
3169
+ let o = e?.datasetMetricSettings?.newDatasetSettings, s = o?.configuration, c = o?.selectedDims || [], l = o?.selectedMetrics || [], u = e?.datasetMetricSettings?.createdSorts || [], { headerColumns: d, nonHeaderColumns: f } = c.reduce((e, t) => (U?.pivotTableSettings2?.headers?.includes(t.alias) ? e.headerColumns.push(t) : e.nonHeaderColumns.push(t), e), {
3170
3170
  headerColumns: [],
3171
3171
  nonHeaderColumns: []
3172
3172
  }), p = n?.map((e) => `${e.columnName};;${e.value}`).join(";;");
@@ -3177,8 +3177,8 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3177
3177
  isLoading: !0,
3178
3178
  currentValue: a
3179
3179
  }));
3180
- let m = f.slice(0, i), h = n?.map((e) => {
3181
- let t = c.find((t) => t.alias === e.columnName || O(t) === e.columnName);
3180
+ let m = f.slice(0, i), ee = n?.map((e) => {
3181
+ let t = c.find((t) => t.alias === e.columnName || ae(t) === e.columnName);
3182
3182
  if (t) return {
3183
3183
  alias: t.alias || "",
3184
3184
  columnName: t.name,
@@ -3189,32 +3189,32 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3189
3189
  value: e.value,
3190
3190
  relationOperator: "AND"
3191
3191
  };
3192
- }).filter((e) => e), g = [
3192
+ }).filter((e) => e), h = [
3193
3193
  ...m,
3194
3194
  ...l,
3195
3195
  ...d
3196
- ], { aggregates: _, dimensions: y } = et(g), x = Pe(u), C = st(x, g), w = {
3196
+ ], { aggregates: te, dimensions: ne } = nt(h), y = Ie(u), b = lt(y, h), x = {
3197
3197
  ...s,
3198
- dimensions: y,
3199
- aggregates: _,
3200
- filters: [...s.filters, ...h],
3201
- orders: C,
3198
+ dimensions: ne,
3199
+ aggregates: te,
3200
+ filters: [...s.filters, ...ee],
3201
+ orders: b,
3202
3202
  isApplyGlobalFilter: !0,
3203
3203
  isApplyMetricFilter: !0,
3204
3204
  globalFilters: t,
3205
- rlsConditions: W
3205
+ rlsConditions: H
3206
3206
  };
3207
- $n({
3207
+ tr({
3208
3208
  data: {
3209
- configuration: w,
3210
- id: T,
3209
+ configuration: x,
3210
+ id: S,
3211
3211
  datasourceId: fe,
3212
3212
  dashboardId: "",
3213
3213
  isCreateMetric: !0
3214
3214
  },
3215
- clientId: v ? S || "" : r,
3216
- token: b || "",
3217
- isFrontendApp: v
3215
+ clientId: g ? v || "" : r,
3216
+ token: _ || "",
3217
+ isFrontendApp: g
3218
3218
  }, { onSuccess(t) {
3219
3219
  let n = t?.error, r = t?.data;
3220
3220
  if (n?.message) Tn((e) => ({
@@ -3224,7 +3224,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3224
3224
  currentValue: ""
3225
3225
  }));
3226
3226
  else {
3227
- let t = oe(Array.isArray(r) ? r : [], c, l), n = he(t);
3227
+ let t = ue(Array.isArray(r) ? r : [], c, l), n = ye(t);
3228
3228
  Tn((e) => ({
3229
3229
  data: [...e.data, {
3230
3230
  key: p,
@@ -3233,80 +3233,80 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3233
3233
  error: "",
3234
3234
  isLoading: !1,
3235
3235
  currentValue: ""
3236
- })), K((t) => ({
3236
+ })), W((t) => ({
3237
3237
  ...t,
3238
3238
  pivotTableSettings2: {
3239
- ...G?.pivotTableSettings2,
3240
- dimensions: ge(f, e?.companyIntegration?.name || ""),
3241
- headers: ge(d, e?.companyIntegration?.name || "")
3239
+ ...U?.pivotTableSettings2,
3240
+ dimensions: D(f, e?.companyIntegration?.name || ""),
3241
+ headers: D(d, e?.companyIntegration?.name || "")
3242
3242
  }
3243
3243
  }));
3244
3244
  }
3245
3245
  } });
3246
- }, Jr = P(async (t, n) => {
3247
- C("drill-level-click-handler-start", {
3246
+ }, Jr = N(async (t, n) => {
3247
+ x("drill-level-click-handler-start", {
3248
3248
  metricId: e?.id,
3249
3249
  metricName: e?.name,
3250
3250
  clickedLevelIndex: t,
3251
3251
  isReset: !!n,
3252
- drillConfig: d(U?.configV2)
3253
- }), n && rn([]), mt(null), await Mr(U?.configV2, void 0, t, n), C("drill-level-click-handler-complete", {
3252
+ drillConfig: f(V?.configV2)
3253
+ }), n && on([]), R(null), await Mr(V?.configV2, void 0, t, n), x("drill-level-click-handler-complete", {
3254
3254
  metricId: e?.id,
3255
3255
  metricName: e?.name,
3256
3256
  clickedLevelIndex: t,
3257
3257
  isReset: !!n
3258
3258
  });
3259
3259
  }, [
3260
- U?.configV2,
3260
+ V?.configV2,
3261
3261
  e?.id,
3262
3262
  e?.name
3263
- ]), Yr = P((e) => {
3264
- if (e) At((e) => [...e?.filter((e) => e.group !== `${B}`)]), kt((e) => e - 1);
3263
+ ]), Yr = N((e) => {
3264
+ if (e) jt((e) => [...e?.filter((e) => e.group !== `${z}`)]), At((e) => e - 1);
3265
3265
  else {
3266
- let e = V.filter((e) => !e?.group)?.map((e) => ({
3266
+ let e = B.filter((e) => !e?.group)?.map((e) => ({
3267
3267
  ...e,
3268
- name: `${e?.name}_${B + 1}`,
3269
- group: `${B + 1}`,
3268
+ name: `${e?.name}_${z + 1}`,
3269
+ group: `${z + 1}`,
3270
3270
  dependOn: e.dependOn ? {
3271
- value: `${e.dependOn?.value}_${B + 1}`,
3272
- label: `${e.dependOn?.label}_${B + 1}`,
3271
+ value: `${e.dependOn?.value}_${z + 1}`,
3272
+ label: `${e.dependOn?.label}_${z + 1}`,
3273
3273
  customColumnName: e.dependOn?.customColumnName
3274
3274
  } : void 0,
3275
3275
  dependOns: e?.dependOns?.map((e) => ({
3276
- value: `${e?.value}_${B + 1}`,
3277
- label: `${e?.label}_${B + 1}`,
3276
+ value: `${e?.value}_${z + 1}`,
3277
+ label: `${e?.label}_${z + 1}`,
3278
3278
  customColumnName: e?.customColumnName
3279
3279
  })) || []
3280
3280
  }));
3281
- e.length && (At((t) => [...t, ...e]), kt((e) => e + 1));
3281
+ e.length && (jt((t) => [...t, ...e]), At((e) => e + 1));
3282
3282
  }
3283
- }, [V]), Xr = P(async () => {
3284
- Vt.report ? Ht((e) => ({
3283
+ }, [B]), Xr = N(async () => {
3284
+ Ht.report ? Ut((e) => ({
3285
3285
  ...e,
3286
3286
  isOpen: !0
3287
- })) : (Ht({
3287
+ })) : (Ut({
3288
3288
  report: "",
3289
3289
  isLoading: !0,
3290
3290
  isOpen: !0
3291
- }), await er({
3291
+ }), await nr({
3292
3292
  data: {
3293
- data: Q,
3294
- wId: T
3293
+ data: X,
3294
+ wId: S
3295
3295
  },
3296
- clientId: v ? S || "" : r,
3297
- token: b || "",
3298
- isFrontendApp: v
3296
+ clientId: g ? v || "" : r,
3297
+ token: _ || "",
3298
+ isFrontendApp: g
3299
3299
  }, {
3300
3300
  onSuccess(e) {
3301
3301
  let t = e?.content;
3302
- Ht((e) => ({
3302
+ Ut((e) => ({
3303
3303
  ...e,
3304
3304
  report: t || "",
3305
3305
  isLoading: !1
3306
3306
  }));
3307
3307
  },
3308
3308
  onError() {
3309
- Ht((e) => ({
3309
+ Ut((e) => ({
3310
3310
  ...e,
3311
3311
  report: "",
3312
3312
  isLoading: !1
@@ -3314,85 +3314,85 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3314
3314
  }
3315
3315
  }));
3316
3316
  }, [
3317
- Q,
3317
+ X,
3318
3318
  r,
3319
+ g,
3320
+ _,
3319
3321
  v,
3320
- b,
3321
- S,
3322
3322
  r,
3323
- Vt
3324
- ]), Qr = I(() => {
3325
- let t = e?.datasetMetricSettings?.newDatasetSettings, n = t?.configuration, r = Me(Q || []), i = r, a = t?.selectedDims?.some((e) => Oe(e?.datatype)) || ee(Q?.[0] || ""), o = t?.selectedDims?.length > 1 && t?.selectedMetrics?.length > 0, s = [
3326
- k.pivot,
3327
- k.pivotV2,
3328
- k.pivotV3,
3329
- k.timeSeries,
3330
- k.treeMap,
3331
- k.indianMap,
3332
- k.geoBarMap,
3333
- k.geoMap,
3334
- k.geoScatterMap,
3335
- k.worldMap
3323
+ Ht
3324
+ ]), Zr = F(() => {
3325
+ let t = e?.datasetMetricSettings?.newDatasetSettings, n = t?.configuration, r = Pe(X || []), i = r, a = t?.selectedDims?.some((e) => je(e?.datatype)) || re(X?.[0] || ""), o = t?.selectedDims?.length > 1 && t?.selectedMetrics?.length > 0, s = [
3326
+ E.pivot,
3327
+ E.pivotV2,
3328
+ E.pivotV3,
3329
+ E.timeSeries,
3330
+ E.treeMap,
3331
+ E.indianMap,
3332
+ E.geoBarMap,
3333
+ E.geoMap,
3334
+ E.geoScatterMap,
3335
+ E.worldMap
3336
3336
  ], c = !!n?.aggregates?.length && !!n?.dimensions?.length;
3337
- return c && a && (i = [...r?.filter((e) => !s?.includes(e)), ...s]), c && !a && (i = [...r?.filter((e) => !s?.includes(e)), ...s?.filter((e) => e !== k.timeSeries)]), !c && a && (i = [...r?.filter((e) => !s?.includes(e)), k.timeSeries]), !c && !a && (i = r?.filter((e) => !s?.includes(e))), U?.isEnableGroupBy && U?.configV2 && (i = i?.filter((e) => Ce?.includes(e))), o || (i = i?.filter((e) => e !== k.bubbleV2)), i;
3337
+ return c && a && (i = [...r?.filter((e) => !s?.includes(e)), ...s]), c && !a && (i = [...r?.filter((e) => !s?.includes(e)), ...s?.filter((e) => e !== E.timeSeries)]), !c && a && (i = [...r?.filter((e) => !s?.includes(e)), E.timeSeries]), !c && !a && (i = r?.filter((e) => !s?.includes(e))), V?.isEnableGroupBy && V?.configV2 && (i = i?.filter((e) => Ee?.includes(e))), o || (i = i?.filter((e) => e !== E.bubbleV2)), i;
3338
3338
  }, [
3339
- Q,
3340
- G?.xAxis,
3341
- U?.isEnableGroupBy,
3342
- U?.configV2,
3339
+ X,
3340
+ U?.xAxis,
3341
+ V?.isEnableGroupBy,
3342
+ V?.configV2,
3343
3343
  e?.datasetMetricSettings?.newDatasetSettings?.configuration?.aggregates,
3344
3344
  e?.datasetMetricSettings?.newDatasetSettings?.configuration?.dimensions
3345
3345
  ]), $r = (t) => {
3346
- let n = e?.datasetMetricSettings?.newDatasetSettings, r = n?.configuration, i = n?.selectedDims || [], a = n?.selectedMetrics || [], o = e?.companyIntegration?.name, s = G?.enduserMeasureAndDimensions?.isEnabled;
3347
- Re({
3348
- chartAggregateColumns: le(ge(a?.filter((e) => e.configType === "AGGREGATE" && s ? G?.enduserMeasureAndDimensions?.measures?.some((t) => t.value === e.alias) : !0) || [], o), Q || []),
3349
- chartDimensions: le(ge(i?.filter((e) => !s || G?.enduserMeasureAndDimensions?.dimensions?.some((t) => t.value === e.alias)) || [], o), Q || []),
3350
- chartMetrics: le(ge(a?.filter((e) => !s || G?.enduserMeasureAndDimensions?.measures?.some((t) => t.value === e.alias)) || [], o), Q || []),
3351
- chartSettings: G,
3352
- chartTimeColumns: ge(i?.filter((e) => Oe(e.datatype)), o),
3346
+ let n = e?.datasetMetricSettings?.newDatasetSettings, r = n?.configuration, i = n?.selectedDims || [], a = n?.selectedMetrics || [], o = e?.companyIntegration?.name, s = U?.enduserMeasureAndDimensions?.isEnabled;
3347
+ Be({
3348
+ chartAggregateColumns: pe(D(a?.filter((e) => e.configType === "AGGREGATE" && s ? U?.enduserMeasureAndDimensions?.measures?.some((t) => t.value === e.alias) : !0) || [], o), X || []),
3349
+ chartDimensions: pe(D(i?.filter((e) => !s || U?.enduserMeasureAndDimensions?.dimensions?.some((t) => t.value === e.alias)) || [], o), X || []),
3350
+ chartMetrics: pe(D(a?.filter((e) => !s || U?.enduserMeasureAndDimensions?.measures?.some((t) => t.value === e.alias)) || [], o), X || []),
3351
+ chartSettings: U,
3352
+ chartTimeColumns: D(i?.filter((e) => je(e.datatype)), o),
3353
3353
  chartType: t,
3354
3354
  configAggregates: r?.aggregates,
3355
3355
  configuration: n?.configuration,
3356
3356
  dbName: o,
3357
3357
  pivotHeaderColumns: [],
3358
- resultData: Q || [],
3359
- setChartSettings: K
3358
+ resultData: X || [],
3359
+ setChartSettings: W
3360
3360
  });
3361
- }, ei = I(() => ae(V.filter((e) => e.group && e.isAddOnMetrics && !e.isHiddenInUi && !e.isAppFilter), "group"), [V]), ti = I(() => G?.customSettings?.comparisonValueShow && G?.chartType === k.singleValue ? t?.filters?.find((e) => e?.as === "date") : void 0, [
3362
- G?.customSettings?.comparisonValueShow,
3363
- G?.chartType,
3361
+ }, ei = F(() => le(B.filter((e) => e.group && e.isAddOnMetrics && !e.isHiddenInUi && !e.isAppFilter), "group"), [B]), ti = F(() => U?.customSettings?.comparisonValueShow && U?.chartType === E.singleValue ? t?.filters?.find((e) => e?.as === "date") : void 0, [
3362
+ U?.customSettings?.comparisonValueShow,
3363
+ U?.chartType,
3364
3364
  t?.filters?.find((e) => e?.as === "date")
3365
3365
  ]);
3366
- F(() => {
3367
- Q?.length && an.length ? cn(!0) : cn(!1);
3366
+ P(() => {
3367
+ X?.length && sn.length ? un(!0) : un(!1);
3368
3368
  }, [
3369
- Q,
3370
- an.length,
3369
+ X,
3370
+ sn.length,
3371
3371
  e?.integrationName,
3372
3372
  e?.query
3373
3373
  ]);
3374
- let ni = I(() => e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.some((e) => e.configType === "AGGREGATE") && e?.datasetMetricSettings?.newDatasetSettings?.selectedDims?.map((e) => ({
3374
+ let ni = F(() => e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.some((e) => e.configType === "AGGREGATE") && e?.datasetMetricSettings?.newDatasetSettings?.selectedDims?.map((e) => ({
3375
3375
  value: e.alias,
3376
3376
  label: e.alias
3377
- })) || [], [e?.datasetMetricSettings?.newDatasetSettings]), ri = I(() => e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.map((e) => ({
3377
+ })) || [], [e?.datasetMetricSettings?.newDatasetSettings]), ri = F(() => e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics?.map((e) => ({
3378
3378
  value: e?.alias || e?.name,
3379
3379
  label: e?.alias || e?.name
3380
- })) || [], [e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics]), { metricFilters: ii, leftPositionedMetricFilters: ai, rightPositionedMetricFilters: oi } = I(() => {
3381
- let t = yi({
3382
- rlsConditions: V,
3383
- isFrontendApp: v
3384
- }), n = rt({
3380
+ })) || [], [e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics]), { metricFilters: ii, leftPositionedMetricFilters: ai, rightPositionedMetricFilters: oi } = F(() => {
3381
+ let t = bi({
3382
+ rlsConditions: B,
3383
+ isFrontendApp: g
3384
+ }), n = at({
3385
3385
  metric: e,
3386
- isAllClient: g,
3386
+ isAllClient: h,
3387
3387
  tenancyLevel: a
3388
- }) || e?.isCreatedByClient && a !== "DATABASE" ? ot({
3388
+ }) || e?.isCreatedByClient && a !== "DATABASE" ? ct({
3389
3389
  filters: t,
3390
3390
  clientId: r,
3391
- isAllClient: g,
3392
- clientColumnType: ce,
3393
- dataMartTables: Ge
3391
+ isAllClient: h,
3392
+ clientColumnType: se,
3393
+ dataMartTables: He
3394
3394
  }) : t, i = n.filter((e) => e.isAddOnMetrics);
3395
- Be && (i = i.filter((e) => $e(e, !0)));
3395
+ Le && (i = i.filter((e) => tt(e, !0)));
3396
3396
  let o = [], s = [];
3397
3397
  return i.forEach((e) => {
3398
3398
  e.position === "top-right" ? s.push(e) : o.push(e);
@@ -3402,67 +3402,67 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3402
3402
  rightPositionedMetricFilters: s
3403
3403
  };
3404
3404
  }, [
3405
- V,
3406
- v,
3407
- Be,
3405
+ B,
3406
+ g,
3407
+ Le,
3408
3408
  e?.isCreatedByClient,
3409
3409
  e?.isAutomaticClientScopeEnabled,
3410
3410
  a,
3411
3411
  r,
3412
- g,
3413
- ce,
3414
- Ge
3415
- ]), di = [
3416
- k.pie,
3417
- k.doughnut,
3418
- k.rose,
3419
- k.funnel,
3420
- k.singleValue,
3421
- k.table,
3422
- k.pivot,
3423
- k.horizontalStackTable,
3424
- k.geoBarMap,
3425
- k.geoMap,
3426
- k.geoScatterMap,
3427
- k.sankey,
3428
- k.timeSeries,
3429
- k.geoBarMap,
3430
- k.geoMap,
3431
- k.geoScatterMap,
3432
- k.worldMap,
3433
- k.boxplot,
3434
- k.timeSeries,
3435
- k.gantt
3436
- ].includes(G?.chartType) || (G?.isMultiDimension || G?.isDynamicSeries) && G?.seriesField !== "ungrouped", gi = P((t) => {
3412
+ h,
3413
+ se,
3414
+ He
3415
+ ]), si = [
3416
+ E.pie,
3417
+ E.doughnut,
3418
+ E.rose,
3419
+ E.funnel,
3420
+ E.singleValue,
3421
+ E.table,
3422
+ E.pivot,
3423
+ E.horizontalStackTable,
3424
+ E.geoBarMap,
3425
+ E.geoMap,
3426
+ E.geoScatterMap,
3427
+ E.sankey,
3428
+ E.timeSeries,
3429
+ E.geoBarMap,
3430
+ E.geoMap,
3431
+ E.geoScatterMap,
3432
+ E.worldMap,
3433
+ E.boxplot,
3434
+ E.timeSeries,
3435
+ E.gantt
3436
+ ].includes(U?.chartType) || (U?.isMultiDimension || U?.isDynamicSeries) && U?.seriesField !== "ungrouped", fi = N((t) => {
3437
3437
  let n = e?.dataSecuritySettings?.csvColumns || [];
3438
3438
  return t?.length ? t?.map((e) => {
3439
3439
  let t = {};
3440
3440
  for (let r in e) n?.includes(r) || (t[r] = e[r]);
3441
3441
  return t;
3442
3442
  }) : [];
3443
- }, [e?.dataSecuritySettings]), bi = I(() => gi(Q), [Q, gi]);
3444
- F(() => {
3445
- G || (K(e?.chartOptions), Et({
3443
+ }, [e?.dataSecuritySettings]), _i = F(() => fi(X), [X, fi]);
3444
+ P(() => {
3445
+ U || (W(e?.chartOptions), Dt({
3446
3446
  limit: parseInt(e?.chartOptions?.tableSettings?.defaultRowSize || "100", 10),
3447
3447
  offset: 0
3448
3448
  }));
3449
- }, [e?.chartOptions, G]), F(() => {
3450
- G?.tableSettings?.isServerSidePagination && G?.chartType === k.table && Et({
3451
- limit: parseInt(G?.tableSettings?.defaultRowSize || "100", 10),
3449
+ }, [e?.chartOptions, U]), P(() => {
3450
+ U?.tableSettings?.isServerSidePagination && U?.chartType === E.table && Dt({
3451
+ limit: parseInt(U?.tableSettings?.defaultRowSize || "100", 10),
3452
3452
  offset: 0
3453
3453
  });
3454
3454
  }, [
3455
- G?.tableSettings?.isServerSidePagination,
3456
- G?.chartType,
3457
- G?.tableSettings?.defaultRowSize
3455
+ U?.tableSettings?.isServerSidePagination,
3456
+ U?.chartType,
3457
+ U?.tableSettings?.defaultRowSize
3458
3458
  ]);
3459
- let xi = L(t);
3460
- xi.current = t, F(() => {
3461
- if (G?.chartType === k.timeSeries && G?.timeSeriesSettings?.groupBySettings?.isGlobalFilter && gr) {
3462
- let e = xi.current?.filters?.find((e) => e.label === G?.timeSeriesSettings?.groupBySettings?.globalFilterOption?.value)?.value;
3459
+ let xi = I(t);
3460
+ xi.current = t, P(() => {
3461
+ if (U?.chartType === E.timeSeries && U?.timeSeriesSettings?.groupBySettings?.isGlobalFilter && gr) {
3462
+ let e = xi.current?.filters?.find((e) => e.label === U?.timeSeriesSettings?.groupBySettings?.globalFilterOption?.value)?.value;
3463
3463
  if ((typeof e == "string" || typeof e == "object" && e?.value) && e) {
3464
- let t = typeof e == "string" ? we(e)?.toLowerCase() : G?.timeSeriesSettings?.groupBySettings?.formatWithValue?.find((t) => t.value === we(e?.value))?.format?.toLowerCase() || "";
3465
- J?.find((e) => e?.value?.toLowerCase() === t) && K((e) => ({
3464
+ let t = typeof e == "string" ? De(e)?.toLowerCase() : U?.timeSeriesSettings?.groupBySettings?.formatWithValue?.find((t) => t.value === De(e?.value))?.format?.toLowerCase() || "";
3465
+ K?.find((e) => e?.value?.toLowerCase() === t) && W((e) => ({
3466
3466
  ...e,
3467
3467
  timeSeriesSettings: {
3468
3468
  ...e?.timeSeriesSettings,
@@ -3471,109 +3471,109 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3471
3471
  value: t
3472
3472
  }
3473
3473
  },
3474
- xAxis: q ? e.xAxis : `${t} of ${gr}`
3474
+ xAxis: G ? e.xAxis : `${t} of ${gr}`
3475
3475
  }));
3476
3476
  }
3477
3477
  }
3478
3478
  }, [
3479
- lr,
3480
- G?.chartType,
3481
- G?.timeSeriesSettings?.groupBySettings?.isGlobalFilter,
3482
- G?.timeSeriesSettings?.groupBySettings?.globalFilterOption,
3479
+ dr,
3480
+ U?.chartType,
3481
+ U?.timeSeriesSettings?.groupBySettings?.isGlobalFilter,
3482
+ U?.timeSeriesSettings?.groupBySettings?.globalFilterOption,
3483
3483
  gr
3484
- ]), F(() => {
3485
- G?.isDynamicSeries && (G?.seriesOptions?.includes("ungrouped") ? G?.ungroupedAlias ? bn(G?.seriesOptions?.map((e) => e === "ungrouped" ? {
3484
+ ]), P(() => {
3485
+ U?.isDynamicSeries && (U?.seriesOptions?.includes("ungrouped") ? U?.ungroupedAlias ? Sn(U?.seriesOptions?.map((e) => e === "ungrouped" ? {
3486
3486
  value: e,
3487
- label: G?.ungroupedAlias
3487
+ label: U?.ungroupedAlias
3488
3488
  } : {
3489
3489
  value: e,
3490
3490
  label: e
3491
- })) : bn(G?.seriesOptions?.map((e) => ({
3491
+ })) : Sn(U?.seriesOptions?.map((e) => ({
3492
3492
  value: e,
3493
3493
  label: e
3494
- }))) : bn([...G?.seriesOptions?.map((e) => ({
3494
+ }))) : Sn([...U?.seriesOptions?.map((e) => ({
3495
3495
  value: e,
3496
3496
  label: e
3497
3497
  })) ?? []]));
3498
3498
  }, [
3499
- G?.seriesOptions,
3500
- G?.isDynamicSeries,
3501
- G?.ungroupedAlias
3499
+ U?.seriesOptions,
3500
+ U?.isDynamicSeries,
3501
+ U?.ungroupedAlias
3502
3502
  ]);
3503
- let [Si, Ci] = R(!1), wi = (e) => {
3503
+ let [Si, Ci] = L(!1), wi = (e) => {
3504
3504
  e.key === "Control" && Ci(!0);
3505
3505
  }, Ti = (e) => {
3506
3506
  e.key === "Control" && Ci(!1);
3507
3507
  };
3508
- F(() => {
3509
- Q?.length && Bt(Object.keys(Q?.[0] || {}));
3510
- }, [Q?.length]), F(() => (G?.customSettings?.chartZoom?.isZoomEnabled && (window.addEventListener("keydown", wi), window.addEventListener("keyup", Ti)), () => {
3508
+ P(() => {
3509
+ X?.length && Vt(Object.keys(X?.[0] || {}));
3510
+ }, [X?.length]), P(() => (U?.customSettings?.chartZoom?.isZoomEnabled && (window.addEventListener("keydown", wi), window.addEventListener("keyup", Ti)), () => {
3511
3511
  window.removeEventListener("keydown", wi), window.removeEventListener("keyup", Ti);
3512
3512
  }), []);
3513
- let Ei = I(() => {
3513
+ let Ei = F(() => {
3514
3514
  let e = !1;
3515
- if (Q?.length) {
3516
- let t = G?.singleValue;
3517
- e = Q[0][t] === null && G?.chartType === k.singleValue;
3515
+ if (X?.length) {
3516
+ let t = U?.singleValue;
3517
+ e = X[0][t] === null && U?.chartType === E.singleValue;
3518
3518
  }
3519
3519
  return e;
3520
3520
  }, [
3521
- Q?.length,
3522
- G?.singleValue,
3523
- G?.chartType === k.singleValue
3524
- ]), Di = I(() => tt({
3525
- chartOptions: G,
3526
- data: Q || []
3521
+ X?.length,
3522
+ U?.singleValue,
3523
+ U?.chartType === E.singleValue
3524
+ ]), Di = F(() => rt({
3525
+ chartOptions: U,
3526
+ data: X || []
3527
3527
  }), [
3528
- Q,
3529
- G?.xAxis,
3530
- G?.yAxisList,
3531
- G?.dynamicXAxis?.isEnabled,
3532
- G?.chartType,
3533
- G?.seriesField,
3534
- G?.customSettings?.cumulativeBar,
3535
- G?.isGroupXAxis,
3536
- G?.timeSeriesSettings?.seriesType[0],
3537
- G?.timeSeriesSettings?.groupBySettings?.fillXAxis
3538
- ]), Oi = I(() => Ee({
3539
- text: He(e?.name || "", mn) || "",
3540
- selectedLanguage: j,
3541
- translationDictionary: M
3528
+ X,
3529
+ U?.xAxis,
3530
+ U?.yAxisList,
3531
+ U?.dynamicXAxis?.isEnabled,
3532
+ U?.chartType,
3533
+ U?.seriesField,
3534
+ U?.customSettings?.cumulativeBar,
3535
+ U?.isGroupXAxis,
3536
+ U?.timeSeriesSettings?.seriesType[0],
3537
+ U?.timeSeriesSettings?.groupBySettings?.fillXAxis
3538
+ ]), Oi = F(() => ke({
3539
+ text: We(e?.name || "", gn) || "",
3540
+ selectedLanguage: O,
3541
+ translationDictionary: k
3542
3542
  }), [
3543
3543
  e?.name,
3544
- mn,
3545
- M,
3546
- j
3547
- ]), ki = I(() => Ee({
3548
- text: He(e?.longDescription || "", mn) || "",
3549
- selectedLanguage: j,
3550
- translationDictionary: M
3544
+ gn,
3545
+ k,
3546
+ O
3547
+ ]), ki = F(() => ke({
3548
+ text: We(e?.longDescription || "", gn) || "",
3549
+ selectedLanguage: O,
3550
+ translationDictionary: k
3551
3551
  }), [
3552
3552
  e?.longDescription,
3553
- mn,
3554
- j,
3555
- M
3556
- ]), Ai = I(() => Ee({
3557
- text: He(e?.description || "", mn) || "",
3558
- selectedLanguage: j,
3559
- translationDictionary: M
3553
+ gn,
3554
+ O,
3555
+ k
3556
+ ]), Ai = F(() => ke({
3557
+ text: We(e?.description || "", gn) || "",
3558
+ selectedLanguage: O,
3559
+ translationDictionary: k
3560
3560
  }), [
3561
3561
  e?.description,
3562
- mn,
3563
- j,
3564
- M
3565
- ]), ji = I(() => Ee({
3566
- text: He(e?.footNote || "", mn) || "",
3567
- selectedLanguage: j,
3568
- translationDictionary: M
3562
+ gn,
3563
+ O,
3564
+ k
3565
+ ]), ji = F(() => ke({
3566
+ text: We(e?.footNote || "", gn) || "",
3567
+ selectedLanguage: O,
3568
+ translationDictionary: k
3569
3569
  }), [
3570
3570
  e?.footNote,
3571
- mn,
3572
- j,
3573
- M
3574
- ]), Mi = I(() => `${Q?.[0]?.dbn_metric_expression_data || "No Data Found"}`, [Q]), Ni = I(() => e?.rlsConditions?.map((e) => {
3571
+ gn,
3572
+ O,
3573
+ k
3574
+ ]), Mi = F(() => `${X?.[0]?.dbn_metric_expression_data || "No Data Found"}`, [X]), Ni = F(() => e?.rlsConditions?.map((e) => {
3575
3575
  if (e?.datatype === "date" && e?.options?.find((e) => e.range === "Custom Date") && e?.isEnableDynamicDate && e?.dynamicDate?.value) {
3576
- let t = de(ze?.find((t) => t.value === e?.dynamicDate?.value)?.count || 0), n = We(t), r = We(t);
3576
+ let t = he(Ve?.find((t) => t.value === e?.dynamicDate?.value)?.count || 0), n = Ke(t), r = Ke(t);
3577
3577
  return {
3578
3578
  ...e,
3579
3579
  options: e?.options?.map((e) => e.range === "Custom Date" ? {
@@ -3586,9 +3586,9 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3586
3586
  }
3587
3587
  return e;
3588
3588
  }), [e?.rlsConditions]);
3589
- pt(() => {
3590
- if (Wn && te?.((t) => {
3591
- if (zr(t?.get(e?.id), zn)) return t;
3589
+ ht(() => {
3590
+ if (Gn && w?.((t) => {
3591
+ if (Br(t?.get(e?.id), Vn)) return t;
3592
3592
  let n = new Map(t);
3593
3593
  return n.set(e?.id, {
3594
3594
  data: {
@@ -3596,18 +3596,18 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3596
3596
  name: "",
3597
3597
  description: ""
3598
3598
  },
3599
- isLoading: Wn,
3600
- key: zn
3599
+ isLoading: Gn,
3600
+ key: Vn
3601
3601
  }), n;
3602
- }), Z?.data && E) {
3603
- let t = _i(e?.id, D) ? Z?.data : void 0;
3604
- te?.((n) => {
3605
- if (Wr(n?.get(e?.id), {
3602
+ }), Y?.data && C) {
3603
+ let t = vi(e?.id, ie) ? Y?.data : void 0;
3604
+ w?.((n) => {
3605
+ if (Gr(n?.get(e?.id), {
3606
3606
  data: t,
3607
3607
  name: e?.name || "",
3608
3608
  description: e?.description || "",
3609
- isLoading: Wn,
3610
- key: zn
3609
+ isLoading: Gn,
3610
+ key: Vn
3611
3611
  })) return n;
3612
3612
  let r = new Map(n);
3613
3613
  return r.set(e?.id, {
@@ -3616,22 +3616,22 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3616
3616
  name: e?.name || "",
3617
3617
  description: e?.description || ""
3618
3618
  },
3619
- isLoading: Wn,
3620
- key: zn
3619
+ isLoading: Gn,
3620
+ key: Vn
3621
3621
  }), r;
3622
3622
  });
3623
3623
  }
3624
3624
  }, [
3625
- Z?.data,
3626
- Wn,
3627
- zn
3625
+ Y?.data,
3626
+ Gn,
3627
+ Vn
3628
3628
  ]);
3629
- let Pi = L(e?.id);
3629
+ let Pi = I(e?.id);
3630
3630
  Pi.current = e?.id;
3631
- let Fi = L(E);
3632
- Fi.current = E;
3633
- let Ii = L(te);
3634
- Ii.current = te, F(() => () => {
3631
+ let Fi = I(C);
3632
+ Fi.current = C;
3633
+ let Ii = I(w);
3634
+ Ii.current = w, P(() => () => {
3635
3635
  let e = Pi.current, t = Fi.current, n = Ii.current;
3636
3636
  e && t && n && t.get(e)?.data?.data && n((t) => {
3637
3637
  let n = t.get(e);
@@ -3646,30 +3646,30 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3646
3646
  }), r;
3647
3647
  });
3648
3648
  }, []);
3649
- let Li = !!e?.elementSettings?.summary?.metricList?.length, [Ri, zi] = R(0);
3650
- F(() => {
3651
- let e = E?.subscribe;
3649
+ let Li = !!e?.elementSettings?.summary?.metricList?.length, [Ri, zi] = L(0);
3650
+ P(() => {
3651
+ let e = C?.subscribe;
3652
3652
  if (Li && typeof e == "function") return e(() => zi((e) => e + 1));
3653
- }, [E, Li]), pt(() => {
3654
- Ct.current !== Vn && (Ct.current = Vn, vt());
3655
- }, [Vn, vt]);
3656
- let Bi = () => !!e?.elementSettings?.summary?.metricList?.some((e) => E?.get(e.value)?.isLoading === !0);
3657
- pt(() => {
3653
+ }, [C, Li]), ht(() => {
3654
+ wt.current !== Hn && (wt.current = Hn, yt());
3655
+ }, [Hn, yt]);
3656
+ let Bi = () => !!e?.elementSettings?.summary?.metricList?.some((e) => C?.get(e.value)?.isLoading === !0);
3657
+ ht(() => {
3658
3658
  let t = e?.elementSettings?.summary;
3659
- if (!t?.metricList?.length || !E?.get(e?.id)) return;
3660
- let n = t.metricList.map((e) => E.get(e.value));
3659
+ if (!t?.metricList?.length || !C?.get(e?.id)) return;
3660
+ let n = t.metricList.map((e) => C.get(e.value));
3661
3661
  if (n.some((e) => e?.isLoading)) return;
3662
3662
  let i = JSON.stringify({
3663
3663
  keys: n.map((e) => [e?.key, !!e?.data?.data?.length]),
3664
3664
  prompt: t.summaryPrompt,
3665
3665
  id: e?.id,
3666
- identity: Vn
3666
+ identity: Hn
3667
3667
  }), a = n.map((e) => ({
3668
3668
  data: e?.data?.data || [],
3669
3669
  metricName: e?.data?.name,
3670
3670
  metricDescription: e?.data?.description
3671
3671
  })), o = a.every((e) => e.data.length > 0);
3672
- gt(i, o ? (i) => ft.mutateAsync({
3672
+ _t(i, o ? (i) => pt.mutateAsync({
3673
3673
  signal: i,
3674
3674
  data: {
3675
3675
  metricData: a,
@@ -3678,43 +3678,43 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3678
3678
  filters: n.map((e) => e?.key).join("###"),
3679
3679
  name: e?.name,
3680
3680
  description: e?.description,
3681
- workspaceId: T
3681
+ workspaceId: S
3682
3682
  },
3683
- token: b || "",
3684
- clientId: v ? S || "" : r,
3685
- isFrontendApp: v
3683
+ token: _ || "",
3684
+ clientId: g ? v || "" : r,
3685
+ isFrontendApp: g
3686
3686
  }) : void 0);
3687
3687
  }, [
3688
3688
  e?.elementSettings,
3689
3689
  e?.id,
3690
3690
  e?.name,
3691
3691
  e?.description,
3692
- E,
3692
+ C,
3693
3693
  Ri,
3694
- Vn,
3695
- gt,
3696
- ft,
3697
- T,
3698
- b,
3699
- v,
3694
+ Hn,
3695
+ _t,
3696
+ pt,
3700
3697
  S,
3698
+ _,
3699
+ g,
3700
+ v,
3701
3701
  r
3702
- ]), F(() => {
3703
- let e = it(G?.customSettings?.comboAxisSettings || []), t = e?.flatMap((e) => e?.measures), n = G?.yAxisList?.every((e) => t?.includes(e));
3704
- if (G?.yAxisList?.length && G?.yAxisList?.length !== t?.length && !t?.length && [
3705
- k.combo,
3706
- k.timeSeries,
3707
- k.horizontalCombo
3708
- ].includes(G?.chartType || "")) {
3709
- let e = G?.yAxisList?.filter((e) => !G?.comboBarList?.includes(e))?.filter((e) => !t?.includes(e)), n = G?.customSettings?.comboStackAxisSymbols?.name || "", r = G?.customSettings?.comboLabelFormatter?.find((e) => e.axis === (n || "stack"))?.formatter, i = G?.comboBarList?.join(" and "), a = G?.customSettings?.comboLabelFormatter?.find((e) => e.axis === i)?.formatter;
3710
- K((t) => ({
3702
+ ]), P(() => {
3703
+ let e = ot(U?.customSettings?.comboAxisSettings || []), t = e?.flatMap((e) => e?.measures), n = U?.yAxisList?.every((e) => t?.includes(e));
3704
+ if (U?.yAxisList?.length && U?.yAxisList?.length !== t?.length && !t?.length && [
3705
+ E.combo,
3706
+ E.timeSeries,
3707
+ E.horizontalCombo
3708
+ ].includes(U?.chartType || "")) {
3709
+ let e = U?.yAxisList?.filter((e) => !U?.comboBarList?.includes(e))?.filter((e) => !t?.includes(e)), n = U?.customSettings?.comboStackAxisSymbols?.name || "", r = U?.customSettings?.comboLabelFormatter?.find((e) => e.axis === (n || "stack"))?.formatter, i = U?.comboBarList?.join(" and "), a = U?.customSettings?.comboLabelFormatter?.find((e) => e.axis === i)?.formatter;
3710
+ W((t) => ({
3711
3711
  ...t,
3712
3712
  customSettings: {
3713
3713
  ...t.customSettings,
3714
- comboAxisSettings: it([
3714
+ comboAxisSettings: ot([
3715
3715
  ...t.customSettings?.comboAxisSettings || [],
3716
3716
  ...e?.map((e) => {
3717
- let t = G?.customSettings?.comboLabelFormatter?.find((t) => t.axis === e)?.formatter, n = G?.customSettings?.comboAxisSymbols?.find((t) => t.name === e);
3717
+ let t = U?.customSettings?.comboLabelFormatter?.find((t) => t.axis === e)?.formatter, n = U?.customSettings?.comboAxisSymbols?.find((t) => t.name === e);
3718
3718
  return {
3719
3719
  axis: e,
3720
3720
  measures: [e],
@@ -3722,36 +3722,36 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3722
3722
  axis: e,
3723
3723
  type: "line"
3724
3724
  }],
3725
- numberFormatter: G?.customSettings?.numberFormatter,
3725
+ numberFormatter: U?.customSettings?.numberFormatter,
3726
3726
  labelFormatter: t,
3727
3727
  prefix: n?.prefix || "",
3728
3728
  suffix: n?.suffix || "",
3729
3729
  isEnableLabelFormatter: !!t?.length
3730
3730
  };
3731
3731
  }),
3732
- ...G?.comboBarList?.length && (G?.customSettings?.isCombineBarAxis || G?.customSettings?.isStackBar) ? [{
3733
- axis: G?.customSettings?.isStackBar && n || i,
3734
- measures: G?.comboBarList,
3735
- chartTypes: G?.comboBarList?.map((e) => ({
3732
+ ...U?.comboBarList?.length && (U?.customSettings?.isCombineBarAxis || U?.customSettings?.isStackBar) ? [{
3733
+ axis: U?.customSettings?.isStackBar && n || i,
3734
+ measures: U?.comboBarList,
3735
+ chartTypes: U?.comboBarList?.map((e) => ({
3736
3736
  axis: e,
3737
3737
  type: "bar"
3738
3738
  })),
3739
- isEnableStackBar: G?.customSettings?.isStackBar,
3740
- numberFormatter: G?.customSettings?.numberFormatter,
3741
- ...G?.customSettings?.isStackBar ? {
3742
- prefix: G?.customSettings?.comboStackAxisSymbols?.prefix || "",
3743
- suffix: G?.customSettings?.comboStackAxisSymbols?.suffix || "",
3739
+ isEnableStackBar: U?.customSettings?.isStackBar,
3740
+ numberFormatter: U?.customSettings?.numberFormatter,
3741
+ ...U?.customSettings?.isStackBar ? {
3742
+ prefix: U?.customSettings?.comboStackAxisSymbols?.prefix || "",
3743
+ suffix: U?.customSettings?.comboStackAxisSymbols?.suffix || "",
3744
3744
  labelFormatter: r,
3745
3745
  isEnableLabelFormatter: !!r?.length
3746
3746
  } : {
3747
- prefix: G?.customSettings?.combinedAxisPrefix || "",
3748
- suffix: G?.customSettings?.combinedAxisSuffix || "",
3747
+ prefix: U?.customSettings?.combinedAxisPrefix || "",
3748
+ suffix: U?.customSettings?.combinedAxisSuffix || "",
3749
3749
  labelFormatter: a,
3750
3750
  isEnableLabelFormatter: !!a?.length
3751
3751
  }
3752
3752
  }] : [],
3753
- ...G?.comboBarList?.length && !G?.customSettings?.isCombineBarAxis && !G?.customSettings?.isStackBar ? G?.comboBarList?.map((e) => {
3754
- let t = G?.customSettings?.comboLabelFormatter?.find((t) => t.axis === e)?.formatter, n = G?.customSettings?.comboAxisSymbols?.find((t) => t.name === e);
3753
+ ...U?.comboBarList?.length && !U?.customSettings?.isCombineBarAxis && !U?.customSettings?.isStackBar ? U?.comboBarList?.map((e) => {
3754
+ let t = U?.customSettings?.comboLabelFormatter?.find((t) => t.axis === e)?.formatter, n = U?.customSettings?.comboAxisSymbols?.find((t) => t.name === e);
3755
3755
  return {
3756
3756
  axis: e,
3757
3757
  measures: [e],
@@ -3759,7 +3759,7 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3759
3759
  axis: e,
3760
3760
  type: "bar"
3761
3761
  }],
3762
- numberFormatter: G?.customSettings?.numberFormatter,
3762
+ numberFormatter: U?.customSettings?.numberFormatter,
3763
3763
  labelFormatter: t,
3764
3764
  prefix: n?.prefix || "",
3765
3765
  suffix: n?.suffix || "",
@@ -3778,29 +3778,29 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3778
3778
  comboBarList: []
3779
3779
  }));
3780
3780
  }
3781
- if (t?.length && G?.yAxisList?.length && (G?.yAxisList?.length !== t?.length || G?.yAxisList?.length === t?.length && !n) && [
3782
- k.combo,
3783
- k.timeSeries,
3784
- k.horizontalCombo
3785
- ].includes(G?.chartType || "")) {
3786
- let e = G?.yAxisList?.filter((e) => !t?.includes(e));
3787
- (t?.filter((e) => !G?.yAxisList?.includes(e)))?.forEach((e) => {
3788
- let t = G?.customSettings?.comboAxisSettings?.find((t) => t.measures?.includes(e)), n = t?.axis, r = (t?.measures?.length || 0) > 1;
3789
- K((t) => ({
3781
+ if (t?.length && U?.yAxisList?.length && (U?.yAxisList?.length !== t?.length || U?.yAxisList?.length === t?.length && !n) && [
3782
+ E.combo,
3783
+ E.timeSeries,
3784
+ E.horizontalCombo
3785
+ ].includes(U?.chartType || "")) {
3786
+ let e = U?.yAxisList?.filter((e) => !t?.includes(e));
3787
+ (t?.filter((e) => !U?.yAxisList?.includes(e)))?.forEach((e) => {
3788
+ let t = U?.customSettings?.comboAxisSettings?.find((t) => t.measures?.includes(e)), n = t?.axis, r = (t?.measures?.length || 0) > 1;
3789
+ W((t) => ({
3790
3790
  ...t,
3791
3791
  customSettings: {
3792
3792
  ...t.customSettings,
3793
- comboAxisSettings: it(r ? t.customSettings?.comboAxisSettings?.map((t) => t.axis === n ? {
3793
+ comboAxisSettings: ot(r ? t.customSettings?.comboAxisSettings?.map((t) => t.axis === n ? {
3794
3794
  ...t,
3795
3795
  measures: t?.measures?.filter((t) => t !== e)
3796
3796
  } : t)?.filter((e) => e?.measures?.length) || [] : t.customSettings?.comboAxisSettings?.filter((e) => e.axis !== n && e?.measures?.length) || [])
3797
3797
  }
3798
3798
  }));
3799
- }), e?.length && K((t) => ({
3799
+ }), e?.length && W((t) => ({
3800
3800
  ...t,
3801
3801
  customSettings: {
3802
3802
  ...t.customSettings,
3803
- comboAxisSettings: it([...t.customSettings?.comboAxisSettings || [], ...e?.map((e) => ({
3803
+ comboAxisSettings: ot([...t.customSettings?.comboAxisSettings || [], ...e?.map((e) => ({
3804
3804
  axis: e,
3805
3805
  measures: [e],
3806
3806
  chartTypes: [{
@@ -3811,11 +3811,11 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3811
3811
  }
3812
3812
  }));
3813
3813
  }
3814
- t?.length && G?.yAxisList?.length && G?.yAxisList?.length === t?.length && n && [
3815
- k.combo,
3816
- k.timeSeries,
3817
- k.horizontalCombo
3818
- ].includes(G?.chartType || "") && G?.customSettings?.comboAxisSettings?.length !== e?.length && K((t) => ({
3814
+ t?.length && U?.yAxisList?.length && U?.yAxisList?.length === t?.length && n && [
3815
+ E.combo,
3816
+ E.timeSeries,
3817
+ E.horizontalCombo
3818
+ ].includes(U?.chartType || "") && U?.customSettings?.comboAxisSettings?.length !== e?.length && W((t) => ({
3819
3819
  ...t,
3820
3820
  customSettings: {
3821
3821
  ...t?.customSettings,
@@ -3823,43 +3823,43 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3823
3823
  }
3824
3824
  }));
3825
3825
  }, [
3826
- G?.yAxisList,
3827
- G?.customSettings?.comboAxisSettings,
3828
- G?.comboBarList,
3829
- G?.customSettings?.isCombineBarAxis,
3830
- G?.customSettings?.isStackBar,
3831
- G?.customSettings?.comboStackAxisSymbols?.name,
3832
- G?.customSettings?.comboStackAxisSymbols?.prefix,
3833
- G?.customSettings?.comboStackAxisSymbols?.suffix,
3834
- G?.customSettings?.comboLabelFormatter,
3835
- G?.customSettings?.comboAxisSymbols,
3836
- G?.customSettings?.numberFormatter,
3837
- G?.customSettings?.combinedAxisPrefix,
3838
- G?.customSettings?.combinedAxisSuffix,
3839
- G?.chartType
3840
- ]), F(() => {
3841
- G?.yAxisList?.length && G?.yAxisList?.length < 5 && G?.chartType === k.boxplot && K((e) => ({
3826
+ U?.yAxisList,
3827
+ U?.customSettings?.comboAxisSettings,
3828
+ U?.comboBarList,
3829
+ U?.customSettings?.isCombineBarAxis,
3830
+ U?.customSettings?.isStackBar,
3831
+ U?.customSettings?.comboStackAxisSymbols?.name,
3832
+ U?.customSettings?.comboStackAxisSymbols?.prefix,
3833
+ U?.customSettings?.comboStackAxisSymbols?.suffix,
3834
+ U?.customSettings?.comboLabelFormatter,
3835
+ U?.customSettings?.comboAxisSymbols,
3836
+ U?.customSettings?.numberFormatter,
3837
+ U?.customSettings?.combinedAxisPrefix,
3838
+ U?.customSettings?.combinedAxisSuffix,
3839
+ U?.chartType
3840
+ ]), P(() => {
3841
+ U?.yAxisList?.length && U?.yAxisList?.length < 5 && U?.chartType === E.boxplot && W((e) => ({
3842
3842
  ...e,
3843
- chartType: k.line
3844
- })), !G?.yAxisList?.length && G?.chartType === k.funnelV2 && K((e) => ({
3843
+ chartType: E.line
3844
+ })), !U?.yAxisList?.length && U?.chartType === E.funnelV2 && W((e) => ({
3845
3845
  ...e,
3846
- chartType: k.singleValue
3846
+ chartType: E.singleValue
3847
3847
  }));
3848
- }, [G?.chartType, G?.yAxisList?.length]);
3848
+ }, [U?.chartType, U?.yAxisList?.length]);
3849
3849
  let Vi = ({ columnAlias: t, value: n, isClear: r = !1 }) => {
3850
3850
  let i = e?.datasetMetricSettings;
3851
- i && Ve({
3851
+ i && Ue({
3852
3852
  columnAlias: t,
3853
3853
  datasetSettings: i,
3854
- setTableColumnFilters: Mt,
3854
+ setTableColumnFilters: Nt,
3855
3855
  value: n,
3856
3856
  isClear: r
3857
3857
  });
3858
3858
  };
3859
- F(() => {
3860
- if (!G?.dynamicYAxis?.isEnabled || !G?.dynamicYAxis?.selectedOption || Array.isArray(G?.dynamicYAxis?.selectedOption)) return;
3861
- let e = G?.dynamicYAxis?.selectedOption;
3862
- K((t) => ({
3859
+ P(() => {
3860
+ if (!U?.dynamicYAxis?.isEnabled || !U?.dynamicYAxis?.selectedOption || Array.isArray(U?.dynamicYAxis?.selectedOption)) return;
3861
+ let e = U?.dynamicYAxis?.selectedOption;
3862
+ W((t) => ({
3863
3863
  ...t,
3864
3864
  dynamicYAxis: {
3865
3865
  ...t?.dynamicYAxis,
@@ -3867,14 +3867,14 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3867
3867
  },
3868
3868
  yAxisList: [e?.value]
3869
3869
  }));
3870
- }, [G?.dynamicYAxis?.selectedOption, G?.dynamicYAxis?.isEnabled]), F(() => {
3871
- let t = N?.yAxisSettings?.find((t) => t?.yAxisSettings?.isEnable && t?.id === e?.id && t?.yAxisSettings?.yAxis && Array.isArray(t?.yAxisSettings?.yAxis) && t?.yAxisSettings?.yAxis?.length > 0), n = N?.xAxisSettings?.find((t) => t?.xAxisSettings?.isEnable && t?.id === e?.id && t?.xAxisSettings?.xaxis), r = U?.configV2?.levels?.length ? U : e?.drillDownSettings, i = mi(e?.chartOptions, r), a = i !== e?.chartOptions;
3872
- if (!G?.dynamicYAxis?.isEnabled && !G?.dynamicXAxis?.isEnabled && !a || !t && !n && !a) {
3873
- K((t) => e?.chartOptions || t);
3870
+ }, [U?.dynamicYAxis?.selectedOption, U?.dynamicYAxis?.isEnabled]), P(() => {
3871
+ let t = M?.yAxisSettings?.find((t) => t?.yAxisSettings?.isEnable && t?.id === e?.id && t?.yAxisSettings?.yAxis && Array.isArray(t?.yAxisSettings?.yAxis) && t?.yAxisSettings?.yAxis?.length > 0), n = M?.xAxisSettings?.find((t) => t?.xAxisSettings?.isEnable && t?.id === e?.id && t?.xAxisSettings?.xaxis), r = V?.configV2?.levels?.length ? V : e?.drillDownSettings, i = hi(e?.chartOptions, r), a = i !== e?.chartOptions;
3872
+ if (!U?.dynamicYAxis?.isEnabled && !U?.dynamicXAxis?.isEnabled && !a || !t && !n && !a) {
3873
+ W((t) => e?.chartOptions || t);
3874
3874
  return;
3875
3875
  }
3876
3876
  let o = t?.yAxisSettings?.yAxis?.[0];
3877
- K((e) => {
3877
+ W((e) => {
3878
3878
  let t = a ? {
3879
3879
  ...e,
3880
3880
  ...i
@@ -3897,18 +3897,18 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3897
3897
  };
3898
3898
  });
3899
3899
  }, [
3900
- N?.yAxisSettings,
3900
+ M?.yAxisSettings,
3901
3901
  e?.id,
3902
- N?.xAxisSettings,
3903
- G?.dynamicYAxis?.isEnabled,
3904
- G?.dynamicXAxis?.isEnabled,
3905
- U,
3906
- U?.configV2?.isEnable,
3907
- U?.configV2?.levels,
3902
+ M?.xAxisSettings,
3903
+ U?.dynamicYAxis?.isEnabled,
3904
+ U?.dynamicXAxis?.isEnabled,
3905
+ V,
3906
+ V?.configV2?.isEnable,
3907
+ V?.configV2?.levels,
3908
3908
  e?.chartOptions,
3909
3909
  e?.drillDownSettings
3910
- ]), F(() => {
3911
- G?.customSettings?.isShowDuration && G?.chartType === k.gantt && !G?.customSettings?.ganttTooltipKeys?.includes("Duration") && K((e) => ({
3910
+ ]), P(() => {
3911
+ U?.customSettings?.isShowDuration && U?.chartType === E.gantt && !U?.customSettings?.ganttTooltipKeys?.includes("Duration") && W((e) => ({
3912
3912
  ...e,
3913
3913
  customSettings: {
3914
3914
  ...e?.customSettings,
@@ -3916,56 +3916,56 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3916
3916
  }
3917
3917
  }));
3918
3918
  }, [
3919
- G?.customSettings?.isShowDuration,
3920
- G?.chartType,
3921
- G?.customSettings?.ganttTooltipKeys
3919
+ U?.customSettings?.isShowDuration,
3920
+ U?.chartType,
3921
+ U?.customSettings?.ganttTooltipKeys
3922
3922
  ]);
3923
- let Hi = I(() => e?.datasetMetricSettings?.selectedDimensions?.map((e) => se(e || "none")) || pi, [e?.datasetMetricSettings?.selectedDimensions]);
3923
+ let Hi = F(() => e?.datasetMetricSettings?.selectedDimensions?.map((e) => de(e || "none")) || mi, [e?.datasetMetricSettings?.selectedDimensions]);
3924
3924
  return {
3925
- drillBlockedNotice: z,
3926
- dismissDrillBlockedNotice: () => mt(null),
3927
- elementSummary: yt,
3928
- elementSummaryError: bt,
3929
- elementSummaryEmpty: xt,
3930
- isLoadingSummary: St,
3931
- stopSummary: _t,
3925
+ drillBlockedNotice: mt,
3926
+ dismissDrillBlockedNotice: () => R(null),
3927
+ elementSummary: bt,
3928
+ elementSummaryError: xt,
3929
+ elementSummaryEmpty: St,
3930
+ isLoadingSummary: Ct,
3931
+ stopSummary: vt,
3932
3932
  isMetricListLoading: Bi,
3933
3933
  onDrillLevelClick: Jr,
3934
- onDrillDown: Lr,
3934
+ onDrillDown: Ir,
3935
3935
  onFilterDashboardTo: Nr,
3936
- onFilterMetricTo: Fr,
3937
- handleChartClick: wr,
3938
- dataDb: Q,
3939
- truncation: Jn,
3940
- truncationNotice: Yn,
3936
+ onFilterMetricTo: Pr,
3937
+ handleChartClick: Cr,
3938
+ dataDb: X,
3939
+ truncation: Xn,
3940
+ truncationNotice: Zn,
3941
3941
  getUnderlyingData: jr,
3942
3942
  onChangeFilterValue: Sr,
3943
- isShowChartPopup: Nt,
3944
- setShowChartPopup: Pt,
3943
+ isShowChartPopup: Pt,
3944
+ setShowChartPopup: Ft,
3945
3945
  columnName: Tr,
3946
- chartParams: Ft,
3947
- isQueryLoading: !X && (Wn || ct || ut || De && (!Q?.length || Ei)),
3946
+ chartParams: It,
3947
+ isQueryLoading: !zn && (Gn || st || dt || we && (!X?.length || Ei)),
3948
3948
  isSingleValueNull: Ei,
3949
- dynamicOptions: yn,
3950
- chartSettings: G,
3951
- setChartSettings: K,
3949
+ dynamicOptions: xn,
3950
+ chartSettings: U,
3951
+ setChartSettings: W,
3952
3952
  isEnableZoom: Si,
3953
- filterValues: On,
3954
- containerRef: wt,
3955
- drilledLevel: H.length,
3953
+ filterValues: An,
3954
+ containerRef: Tt,
3955
+ drilledLevel: Qt.length,
3956
3956
  dimensions: Hi,
3957
- rlsConditions: V,
3958
- setRlsConditions: At,
3959
- setTableLimit: Et,
3960
- isEnableNextBtn: Dt > Tt?.limit + Tt?.offset,
3961
- isEnablePrevBtn: Tt?.offset !== 0,
3957
+ rlsConditions: B,
3958
+ setRlsConditions: jt,
3959
+ setTableLimit: Dt,
3960
+ isEnableNextBtn: Ot > Et?.limit + Et?.offset,
3961
+ isEnablePrevBtn: Et?.offset !== 0,
3962
3962
  paginationInfo: {
3963
- limit: Tt?.limit,
3964
- offset: Tt?.offset,
3965
- totalRecords: Dt
3963
+ limit: Et?.limit,
3964
+ offset: Et?.offset,
3965
+ totalRecords: Ot
3966
3966
  },
3967
3967
  onChangePage: (e, t, n) => {
3968
- Et(t ? {
3968
+ Dt(t ? {
3969
3969
  limit: t,
3970
3970
  offset: 0
3971
3971
  } : (t) => {
@@ -3976,13 +3976,13 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3976
3976
  };
3977
3977
  });
3978
3978
  },
3979
- isExternalChart: G?.tableSettings?.isServerSidePagination && G?.chartType === k.table,
3980
- isEnablePivotTable: sn,
3981
- groupByList: an,
3979
+ isExternalChart: U?.tableSettings?.isServerSidePagination && U?.chartType === E.table,
3980
+ isEnablePivotTable: ln,
3981
+ groupByList: sn,
3982
3982
  hasNumberKeys: !0,
3983
3983
  isEnableGauge: !0,
3984
3984
  updateFilter: (e) => {
3985
- At((t) => t?.map((t) => t.name === e.name && t.datatype === e.datatype && t.tableName === e.tableName && t.columnName === e.columnName ? {
3985
+ jt((t) => t?.map((t) => t.name === e.name && t.datatype === e.datatype && t.tableName === e.tableName && t.columnName === e.columnName ? {
3986
3986
  ...t,
3987
3987
  isAddOnMetrics: !t.isAddOnMetrics
3988
3988
  } : t));
@@ -3990,64 +3990,64 @@ var kr = "__dbnFullscreenDrillState", Ar = (e) => typeof e == "object" && !!e, j
3990
3990
  metricFilters: ii,
3991
3991
  leftPositionedMetricFilters: ai,
3992
3992
  rightPositionedMetricFilters: oi,
3993
- drillFilters: H,
3993
+ drillFilters: Qt,
3994
3994
  underlyingDataColumnMetadata: Ar,
3995
- underlyingDataDrillFilters: kr,
3996
- drillType: U?.drillType,
3997
- tableResultsDownloadData: bi,
3998
- filterCsvColumns: gi,
3999
- appliedMetricFilters: W,
3995
+ underlyingDataDrillFilters: Or,
3996
+ drillType: V?.drillType,
3997
+ tableResultsDownloadData: _i,
3998
+ filterCsvColumns: fi,
3999
+ appliedMetricFilters: H,
4000
4000
  pivotHeaderOptions: ni,
4001
- pivotDrillState: Sn,
4001
+ pivotDrillState: wn,
4002
4002
  onDrillPivotTable: qr,
4003
4003
  legendData: Di,
4004
4004
  timeseriesDimension: gr,
4005
- isPythonMode: q,
4006
- sortOrder: Lt,
4007
- setSortOrder: Rt,
4008
- isNotFirstRender: Ut,
4009
- setNotFirstRender: Wt,
4010
- isSorted: gn,
4011
- isInavlidForSort: di,
4005
+ isPythonMode: G,
4006
+ sortOrder: Rt,
4007
+ setSortOrder: zt,
4008
+ isNotFirstRender: Wt,
4009
+ setNotFirstRender: Gt,
4010
+ isSorted: vn,
4011
+ isInavlidForSort: si,
4012
4012
  onAddComparison: Yr,
4013
4013
  groupedRlsConditions: ei,
4014
4014
  onGenerateMetricSummary: Xr,
4015
- summary: Vt,
4016
- setSummary: Ht,
4017
- dataMartRelationships: Dn,
4015
+ summary: Ht,
4016
+ setSummary: Ut,
4017
+ dataMartRelationships: kn,
4018
4018
  onChartChange: $r,
4019
- isCompareValue: xr,
4020
- isShowChartPropertyPanel: ln,
4021
- setShowChartPropertyPanel: un,
4022
- columnList: zt,
4023
- variables: mn,
4019
+ isCompareValue: yr,
4020
+ isShowChartPropertyPanel: dn,
4021
+ setShowChartPropertyPanel: fn,
4022
+ columnList: Bt,
4023
+ variables: gn,
4024
4024
  metricName: Oi,
4025
4025
  longDescription: ki,
4026
4026
  footNote: ji,
4027
4027
  description: Ai,
4028
- drilldownCols: Gt,
4028
+ drilldownCols: Kt,
4029
4029
  switchMeasureOptions: ri,
4030
4030
  metricExpressionResult: Mi,
4031
4031
  dateFilter: ti,
4032
- drillDownSettings: U,
4033
- onDrillIntoDimension: Kr,
4034
- adhocDrillDims: nn,
4035
- enabledCharts: Qr,
4036
- tableColumnFilters: jt,
4032
+ drillDownSettings: V,
4033
+ onDrillIntoDimension: Rr,
4034
+ adhocDrillDims: an,
4035
+ enabledCharts: Zr,
4036
+ tableColumnFilters: Mt,
4037
4037
  onChangePaginationColumnFilters: Vi,
4038
- queryError: X || Gn || Z?.error,
4039
- queryPermissionDenied: !!Gn?.isBatchAuth,
4040
- refetchMetricData: Kn,
4041
- customSwitchXAxis: kn,
4042
- savedMetricFilters: Ni || fi
4038
+ queryError: zn || qn || Y?.error,
4039
+ queryPermissionDenied: !!qn?.isBatchAuth,
4040
+ refetchMetricData: Jn,
4041
+ customSwitchXAxis: jn,
4042
+ savedMetricFilters: Ni || pi
4043
4043
  };
4044
4044
  };
4045
- function _i(e, t) {
4045
+ function vi(e, t) {
4046
4046
  return t === void 0 || t.has(e);
4047
4047
  }
4048
4048
  //#endregion
4049
4049
  //#region src/helpers/getValidRlsConditionOptions.ts
4050
- var vi = (e, t) => {
4050
+ var yi = (e, t) => {
4051
4051
  if (!t?.[e.name]) return;
4052
4052
  let n = t?.[e.name]?.defaultOption?.toString(), r = (t?.[e.name]?.options)?.filter((t) => {
4053
4053
  if (t == null) return !1;
@@ -4065,7 +4065,7 @@ var vi = (e, t) => {
4065
4065
  "last",
4066
4066
  "this",
4067
4067
  "custom"
4068
- ].includes(e || "") || n && !ye({
4068
+ ].includes(e || "") || n && !Se({
4069
4069
  endDate: t.endDate ?? t.toDate,
4070
4070
  endTime: t.endTime,
4071
4071
  startDate: t.startDate ?? t.fromDate,
@@ -4094,16 +4094,16 @@ var vi = (e, t) => {
4094
4094
  }) ? n : void 0,
4095
4095
  options: r
4096
4096
  };
4097
- }, yi = ({ rlsConditions: e, isFrontendApp: t }) => e.filter((e) => (t || !e.isAppFilter) && !e.isHiddenInUi), bi = (e) => !!e && e !== "null" && e !== "undefined", xi = (e) => {
4097
+ }, bi = ({ rlsConditions: e, isFrontendApp: t }) => e.filter((e) => (t || !e.isAppFilter) && !e.isHiddenInUi), xi = (e) => !!e && e !== "null" && e !== "undefined", Si = (e) => {
4098
4098
  if (e == null) return null;
4099
4099
  let t = typeof e == "string" ? e : String(e);
4100
4100
  return t.length ? t : null;
4101
- }, Si = ({ config: e, value: t, carryFilters: n = [] }) => {
4101
+ }, Ci = ({ config: e, value: t, carryFilters: n = [] }) => {
4102
4102
  if (!e?.isEnable) return {
4103
4103
  ok: !1,
4104
4104
  reason: "disabled"
4105
4105
  };
4106
- if (!bi(e.dashboardId)) return {
4106
+ if (!xi(e.dashboardId)) return {
4107
4107
  ok: !1,
4108
4108
  reason: "no_destination"
4109
4109
  };
@@ -4112,7 +4112,7 @@ var vi = (e, t) => {
4112
4112
  ok: !1,
4113
4113
  reason: "no_target_filter"
4114
4114
  };
4115
- let i = xi(t);
4115
+ let i = Si(t);
4116
4116
  if (i === null) return {
4117
4117
  ok: !1,
4118
4118
  reason: "no_value"
@@ -4124,7 +4124,7 @@ var vi = (e, t) => {
4124
4124
  a.forEach((e) => {
4125
4125
  o.set(e.column, e.value);
4126
4126
  });
4127
- let s = `/externalDashboard/${encodeURIComponent(e.dashboardId)}/?${o.toString()}`, c = lt(s, { routeType: "internal" });
4127
+ let s = `/externalDashboard/${encodeURIComponent(e.dashboardId)}/?${o.toString()}`, c = dt(s, { routeType: "internal" });
4128
4128
  return c.ok ? {
4129
4129
  ok: !0,
4130
4130
  intent: {
@@ -4141,7 +4141,7 @@ var vi = (e, t) => {
4141
4141
  navigation: c.code
4142
4142
  }
4143
4143
  };
4144
- }, Ci = (e, t) => {
4144
+ }, wi = (e, t) => {
4145
4145
  let n = (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? e : null, { params: r, rowFilters: i } = t, a = e?.valueColumn?.trim();
4146
4146
  if (a) {
4147
4147
  let e = (i ?? []).find((e) => e?.columnName === a);
@@ -4150,7 +4150,7 @@ var vi = (e, t) => {
4150
4150
  if (r && r.name !== void 0 && r.name !== null) return n(r.name);
4151
4151
  let o = (i ?? []).find((e) => e?.value !== void 0 && e?.value !== null);
4152
4152
  return o ? n(o.value) : null;
4153
- }, wi = ut("triangle-alert", [
4153
+ }, Ti = ft("triangle-alert", [
4154
4154
  ["path", {
4155
4155
  d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
4156
4156
  key: "wmoenq"
@@ -4166,70 +4166,70 @@ var vi = (e, t) => {
4166
4166
  ]);
4167
4167
  //#endregion
4168
4168
  //#region src/charts/filteredEmptyState.ts
4169
- function Ti(e) {
4169
+ function Ei(e) {
4170
4170
  let t = e?.datasetMetricSettings?.newDatasetSettings?.selectedMetrics, n = t?.length === 1 && typeof t[0]?.label == "string" && t[0].label.trim() ? t[0].label.trim().toLowerCase() : "data";
4171
4171
  return {
4172
4172
  title: `No ${n} in this selection.`,
4173
4173
  hint: `Loosen the period, ${n} basis, or filters.`
4174
4174
  };
4175
4175
  }
4176
- var Ei = {
4176
+ var Di = {
4177
4177
  notice: "_notice_vwpz7_1",
4178
4178
  icon: "_icon_vwpz7_15"
4179
- }, Di = ({ text: e }) => e ? /* @__PURE__ */ (0, z.jsxs)("div", {
4180
- className: Ei.notice,
4179
+ }, Oi = ({ text: e }) => e ? /* @__PURE__ */ (0, R.jsxs)("div", {
4180
+ className: Di.notice,
4181
4181
  role: "status",
4182
4182
  "data-testid": "custom-sql-filter-notice",
4183
- children: [/* @__PURE__ */ (0, z.jsx)(wi, {
4184
- className: Ei.icon,
4183
+ children: [/* @__PURE__ */ (0, R.jsx)(Ti, {
4184
+ className: Di.icon,
4185
4185
  "aria-hidden": "true"
4186
- }), /* @__PURE__ */ (0, z.jsx)("span", { children: e })]
4187
- }) : null, Oi = (e) => {
4186
+ }), /* @__PURE__ */ (0, R.jsx)("span", { children: e })]
4187
+ }) : null, ki = (e) => {
4188
4188
  let t = e.value ?? e.selectedVariableValue?.value;
4189
4189
  return Array.isArray(t) ? t.length > 0 : typeof t == "string" ? t.trim().length > 0 : t != null;
4190
- }, ki = (e) => {
4190
+ }, Ai = (e) => {
4191
4191
  let t = e.label ?? e.name ?? e.column;
4192
4192
  return typeof t == "string" && t.trim() ? t.trim() : "Filter";
4193
- }, Ai = ({ isCustomSqlMetric: e, query: t, metricId: n, filters: r }) => {
4193
+ }, ji = ({ isCustomSqlMetric: e, query: t, metricId: n, filters: r }) => {
4194
4194
  if (!e) return [];
4195
- let i = Ae(t || "");
4195
+ let i = Me(t || "");
4196
4196
  return (r || []).flatMap((e) => {
4197
4197
  let t = e.restrictedMetrics?.some((e) => e.value === n);
4198
- if (!e.isVariableFilter || e.isFilterApplied === !1 || e.isHiddenInUi || t || !Oi(e)) return [];
4198
+ if (!e.isVariableFilter || e.isFilterApplied === !1 || e.isHiddenInUi || t || !ki(e)) return [];
4199
4199
  let r = (e.variableStrings || []).filter(Boolean), a = r.filter((e) => !i.includes(e));
4200
4200
  return r.length > 0 && a.length === 0 ? [] : [{
4201
- label: ki(e),
4201
+ label: Ai(e),
4202
4202
  missingVariables: a
4203
4203
  }];
4204
4204
  });
4205
- }, ji = (e) => e.length === 1 ? e[0] : e.length === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")}, and ${e.at(-1)}`, Mi = (e) => {
4206
- let t = Ai(e);
4205
+ }, Mi = (e) => e.length === 1 ? e[0] : e.length === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")}, and ${e.at(-1)}`, Ni = (e) => {
4206
+ let t = ji(e);
4207
4207
  if (!t.length) return null;
4208
4208
  let n = [...new Set(t.flatMap((e) => e.missingVariables))], r = t.length === 1 ? `${t[0].label} is not applied to this custom SQL metric.` : `${t.length} filters are not applied to this custom SQL metric.`;
4209
- return n.length ? `${r} Add ${ji(n)} to the metric SQL.` : `${r} Configure matching filter variables in the metric SQL.`;
4210
- }, Ni = ({ chart: e, valueColumn: t, isDrillEnabled: n, drilledLevel: r, dimensionCount: i, params: a, passAllData: o }) => {
4209
+ return n.length ? `${r} Add ${Mi(n)} to the metric SQL.` : `${r} Configure matching filter variables in the metric SQL.`;
4210
+ }, Pi = ({ chart: e, valueColumn: t, isDrillEnabled: n, drilledLevel: r, dimensionCount: i, params: a, passAllData: o }) => {
4211
4211
  let s = e?.chartType;
4212
- return s === k.table || s === k.singleValue || n && r === i ? o ? a?.reduce((e, t) => (e[t.columnName] = t.value, e), {}) : a?.find((e) => e.columnName === t)?.value : [k.sankey, k.treeMap].includes(s) ? o ? {
4212
+ return s === E.table || s === E.singleValue || n && r === i ? o ? a?.reduce((e, t) => (e[t.columnName] = t.value, e), {}) : a?.find((e) => e.columnName === t)?.value : [E.sankey, E.treeMap].includes(s) ? o ? {
4213
4213
  name: a?.name,
4214
4214
  value: a?.value
4215
4215
  } : a?.value : o ? {
4216
4216
  name: a?.name,
4217
4217
  value: a?.value,
4218
4218
  columnName: a?.seriesName
4219
- } : t === e?.xAxis || s === k.gauge && t === e?.gaugeSettings?.dimensions?.join(", ") ? a?.name : a?.seriesName === t || s === k.gauge && t === e?.gaugeSettings?.metric || [k.funnel].includes(s) ? a?.value : null;
4220
- }, Pi = (e, t, n) => !e || t === n, Fi = ({ chart: e, chartWithMetric: t, chartWithDashboard: n, isDrillEnabled: r, drilledLevel: i, dimensionCount: a, isLastConfiguredDrillLevel: o, isTableRedirectAllowed: s = !0 }) => {
4221
- let c = Pi(r, i, a), l = c || !!o, u = !!e?.isEnable && l && s, d = e?.routeType === "user";
4219
+ } : t === e?.xAxis || s === E.gauge && t === e?.gaugeSettings?.dimensions?.join(", ") ? a?.name : a?.seriesName === t || s === E.gauge && t === e?.gaugeSettings?.metric || [E.funnel].includes(s) ? a?.value : null;
4220
+ }, Fi = (e, t, n) => !e || t === n, Ii = ({ chart: e, chartWithMetric: t, chartWithDashboard: n, isDrillEnabled: r, drilledLevel: i, dimensionCount: a, isLastConfiguredDrillLevel: o, isTableRedirectAllowed: s = !0 }) => {
4221
+ let c = Fi(r, i, a), l = c || !!o, u = !!e?.isEnable && l && s, d = e?.routeType === "user";
4222
4222
  return {
4223
4223
  navigate: u && !d,
4224
4224
  host: u && d,
4225
4225
  openNestedMetric: !!t?.isEnable && c,
4226
4226
  openDashboard: !!n?.isEnable && l
4227
4227
  };
4228
- }, Ii = ft.createContext({
4228
+ }, Li = mt.createContext({
4229
4229
  navigate: null,
4230
4230
  carryFilters: []
4231
- }), Li = [], Ri = ({ children: e, isEnabled: t = !1, onNavigate: n, carryFilters: r }) => {
4232
- let i = r?.length ? r : Li, a = ft.useMemo(() => ({
4231
+ }), Ri = [], zi = ({ children: e, isEnabled: t = !1, onNavigate: n, carryFilters: r }) => {
4232
+ let i = r?.length ? r : Ri, a = mt.useMemo(() => ({
4233
4233
  navigate: t && n ? n : null,
4234
4234
  carryFilters: i
4235
4235
  }), [
@@ -4237,25 +4237,25 @@ var Ei = {
4237
4237
  n,
4238
4238
  i
4239
4239
  ]);
4240
- return /* @__PURE__ */ (0, z.jsx)(Ii.Provider, {
4240
+ return /* @__PURE__ */ (0, R.jsx)(Li.Provider, {
4241
4241
  value: a,
4242
4242
  children: e
4243
4243
  });
4244
- }, zi = () => {
4245
- let { navigate: e, carryFilters: t } = ft.useContext(Ii), n = ft.useCallback((n, r) => {
4244
+ }, Bi = () => {
4245
+ let { navigate: e, carryFilters: t } = mt.useContext(Li), n = mt.useCallback((n, r) => {
4246
4246
  if (!e) return !1;
4247
4247
  let i = n?.clickActions?.chartWithDashboard;
4248
4248
  if (!i?.isEnable) return !1;
4249
- let a = Si({
4249
+ let a = Ci({
4250
4250
  config: i,
4251
- value: Ci(i, r),
4251
+ value: wi(i, r),
4252
4252
  carryFilters: t
4253
4253
  });
4254
4254
  return a.ok ? (e(a.intent), !0) : (typeof a.reason == "object" && a.reason.code === "unsafe_target" && console.warn(`[chartNavigation] dashboard navigation rejected: ${a.reason.navigation}`), !1);
4255
4255
  }, [e, t]);
4256
4256
  return e ? n : null;
4257
- }, Bi = (e) => {
4257
+ }, Vi = (e) => {
4258
4258
  if (typeof e == "function") return (t) => e(t);
4259
4259
  };
4260
4260
  //#endregion
4261
- export { rr as A, En as B, xr as C, Qn as D, Q as E, kn as F, en as G, wn as H, Y as I, tn as J, sn as K, On as L, Kn as M, Un as N, $n as O, Wn as P, $t as Q, Pn as R, vr as S, or as T, Sn as U, xn as V, on as W, nn as X, rn as Y, an as Z, Mr as _, Ni as a, ir as b, Ti as c, yi as d, gi as f, Pr as g, Nr as h, Fi as i, Gn as j, Zn as k, wi as l, Fr as m, Bi as n, Mi as o, Qr as p, fn as q, zi as r, Di as s, Ri as t, Si as u, Er as v, dr as w, _r as x, Or as y, Mn as z };
4261
+ export { or as A, kn as B, Sr as C, tr as D, Xn as E, Mn as F, rn as G, Dn as H, Fn as I, an as J, un as K, jn as L, X as M, Kn as N, nr as O, qn as P, tn as Q, Ln as R, yr as S, lr as T, Tn as U, wn as V, ln as W, on as X, sn as Y, cn as Z, Nr as _, Pi as a, sr as b, Ei as c, bi as d, _i as f, Fr as g, Pr as h, Ii as i, Jn as j, er as k, Ti as l, Ir as m, Vi as n, Ni as o, $r as p, hn as q, Bi as r, Oi as s, zi as t, Ci as u, Dr as v, Z as w, vr as x, kr as y, q as z };