@sisense/sdk-ui 2.9.0 → 2.10.0

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 (125) hide show
  1. package/dist/ai.cjs +31 -31
  2. package/dist/ai.js +27 -27
  3. package/dist/analytics-composer/node.cjs +3 -1
  4. package/dist/analytics-composer/node.js +514 -378
  5. package/dist/analytics-composer.cjs +1 -1
  6. package/dist/analytics-composer.js +6 -6
  7. package/dist/derive-chart-family-B1on_xkS.cjs +170 -0
  8. package/dist/derive-chart-family-BllGhqsW.js +29469 -0
  9. package/dist/{dimensions-CVJeJ8mi.cjs → dimensions-BYqdB-Q8.cjs} +1 -1
  10. package/dist/{dimensions-B2jz151s.js → dimensions-D-Z9sitz.js} +1 -1
  11. package/dist/execute-query-CABqVn7C.cjs +1 -0
  12. package/dist/{execute-query-agpyzZz6.js → execute-query-CGLL9vXX.js} +269 -247
  13. package/dist/index.cjs +25 -26
  14. package/dist/index.js +7945 -7469
  15. package/dist/index.umd.js +383 -374
  16. package/dist/packages/sdk-ui/src/analytics-composer/new-nlq-translator/common.d.ts +14 -0
  17. package/dist/packages/sdk-ui/src/analytics-composer/new-nlq-translator/translate-dimensions.d.ts +2 -2
  18. package/dist/packages/sdk-ui/src/analytics-composer/new-nlq-translator/translate-filters.d.ts +5 -5
  19. package/dist/packages/sdk-ui/src/analytics-composer/new-nlq-translator/translate-measures.d.ts +3 -3
  20. package/dist/packages/sdk-ui/src/analytics-composer/types.d.ts +12 -0
  21. package/dist/packages/sdk-ui/src/calendar-heatmap-chart.d.ts +12 -0
  22. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/calendar-heatmap-chart-builder.d.ts +8 -0
  23. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/constants.d.ts +87 -0
  24. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/data-options/data-options.d.ts +54 -0
  25. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/data-options/index.d.ts +1 -0
  26. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/data.d.ts +33 -0
  27. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/design-options.d.ts +22 -0
  28. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/highchart-options-builder/highcharts-options-builder.d.ts +8 -0
  29. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/highchart-options-builder/index.d.ts +1 -0
  30. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/highchart-options-builder/options/axes-options.d.ts +12 -0
  31. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/highchart-options-builder/options/chart-options.d.ts +9 -0
  32. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/highchart-options-builder/options/extras-options.d.ts +9 -0
  33. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/highchart-options-builder/options/index.d.ts +7 -0
  34. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/highchart-options-builder/options/legend-options.d.ts +8 -0
  35. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/highchart-options-builder/options/plot-options.d.ts +9 -0
  36. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/highchart-options-builder/options/series-options/calendar-data-generator.d.ts +35 -0
  37. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/highchart-options-builder/options/series-options/index.d.ts +1 -0
  38. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/highchart-options-builder/options/series-options/series-options.d.ts +9 -0
  39. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/highchart-options-builder/options/tooltip-options.d.ts +9 -0
  40. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/renderer/calendar-heatmap-charts-grid.d.ts +26 -0
  41. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/renderer/calendar-heatmap.d.ts +17 -0
  42. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/renderer/calendar-pagination/calendar-pagination.d.ts +30 -0
  43. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/renderer/calendar-pagination/helpers.d.ts +3 -0
  44. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/renderer/calendar-pagination/index.d.ts +1 -0
  45. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/renderer/helpers/data-helpers.d.ts +4 -0
  46. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/renderer/helpers/sizing-helpers.d.ts +25 -0
  47. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/renderer/helpers/view-helpers.d.ts +14 -0
  48. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/renderer/hooks/index.d.ts +4 -0
  49. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/renderer/hooks/use-calendar-heatmap-chart-options.d.ts +55 -0
  50. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/renderer/hooks/use-calendar-heatmap-navigation.d.ts +33 -0
  51. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/renderer/index.d.ts +2 -0
  52. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/calendar-heatmap-chart/types.d.ts +13 -0
  53. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/helpers/data-options.d.ts +5 -1
  54. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/helpers/highchart-options/legend.d.ts +3 -2
  55. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/categoricals/helpers/data-options.d.ts +22 -0
  56. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/categoricals/helpers/data.d.ts +13 -0
  57. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/categoricals/pie-chart/alerts/index.d.ts +5 -0
  58. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/categoricals/pie-chart/data/index.d.ts +15 -0
  59. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/categoricals/pie-chart/data-options/index.d.ts +32 -0
  60. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/categoricals/pie-chart/design-options/index.d.ts +17 -0
  61. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/categoricals/pie-chart/highchart-options/highcharts-options-builder.d.ts +2 -0
  62. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/categoricals/pie-chart/pie-chart-builder.d.ts +2 -0
  63. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/categoricals/pie-chart/types.d.ts +12 -0
  64. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/highcharts-based-chart-renderer/highcharts-based-chart-renderer.d.ts +2 -4
  65. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/highcharts-based-chart-renderer/use-extra-config.d.ts +2 -0
  66. package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/types.d.ts +1 -1
  67. package/dist/packages/sdk-ui/src/chart/restructured-charts/types.d.ts +10 -9
  68. package/dist/packages/sdk-ui/src/chart-data/types.d.ts +2 -1
  69. package/dist/packages/sdk-ui/src/chart-data-options/translate-data-options.d.ts +2 -1
  70. package/dist/packages/sdk-ui/src/chart-data-options/types.d.ts +19 -2
  71. package/dist/packages/sdk-ui/src/chart-data-options/utils.d.ts +4 -4
  72. package/dist/packages/sdk-ui/src/chart-data-options/validate-data-options/validate-categorical-data-options.d.ts +14 -0
  73. package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/series-processor.d.ts +4 -1
  74. package/dist/packages/sdk-ui/src/chart-options-processor/{category-chart-options.d.ts → category-chart-options/category-chart-options.d.ts} +9 -5
  75. package/dist/packages/sdk-ui/src/chart-options-processor/category-chart-options/funnel-chart-options.d.ts +15 -0
  76. package/dist/packages/sdk-ui/src/chart-options-processor/category-chart-options/pie-chart-options.d.ts +15 -0
  77. package/dist/packages/sdk-ui/src/chart-options-processor/category-chart-options/sunburst-chart-options.d.ts +17 -0
  78. package/dist/packages/sdk-ui/src/chart-options-processor/category-chart-options/treemap-chart-options.d.ts +17 -0
  79. package/dist/packages/sdk-ui/src/chart-options-processor/chart-options-service.d.ts +26 -0
  80. package/dist/packages/sdk-ui/src/chart-options-processor/scatter-chart-options.d.ts +3 -3
  81. package/dist/packages/sdk-ui/src/chart-options-processor/style-to-design-options-translator/translate-to-highcharts-options.d.ts +1 -3
  82. package/dist/packages/sdk-ui/src/chart-options-processor/translations/axis-section.d.ts +6 -0
  83. package/dist/packages/sdk-ui/src/chart-options-processor/translations/design-options.d.ts +18 -4
  84. package/dist/packages/sdk-ui/src/chart-options-processor/translations/legend-section.d.ts +28 -14
  85. package/dist/packages/sdk-ui/src/chart-options-processor/translations/pie-series.d.ts +34 -6
  86. package/dist/packages/sdk-ui/src/chart-options-processor/translations/tooltip-utils.d.ts +5 -0
  87. package/dist/packages/sdk-ui/src/chart-options-processor/translations/translations-to-highcharts.d.ts +1 -1
  88. package/dist/packages/sdk-ui/src/chart-options-processor/translations/types.d.ts +50 -6
  89. package/dist/packages/sdk-ui/src/common/formatters/create-date-formatter.d.ts +10 -0
  90. package/dist/packages/sdk-ui/src/common/hooks/useDateFormatter.d.ts +7 -0
  91. package/dist/packages/sdk-ui/src/common/icons/double-arrow-end-icon.d.ts +6 -0
  92. package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/utils.d.ts +0 -19
  93. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/index.d.ts +1 -1
  94. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-filters.d.ts +12 -1
  95. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-formatters.d.ts +18 -0
  96. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-handlers.d.ts +23 -0
  97. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-widget-transforms.d.ts +29 -0
  98. package/dist/packages/sdk-ui/src/index.d.ts +1 -0
  99. package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-utils.d.ts +1 -0
  100. package/dist/packages/sdk-ui/src/pivot-table/formatters/header-cell-formatters/header-cell-value-formatter.d.ts +2 -1
  101. package/dist/packages/sdk-ui/src/pivot-table/formatters/types.d.ts +0 -1
  102. package/dist/packages/sdk-ui/src/polar-chart.d.ts +1 -1
  103. package/dist/packages/sdk-ui/src/props.d.ts +72 -7
  104. package/dist/packages/sdk-ui/src/sisense-chart/types.d.ts +2 -2
  105. package/dist/packages/sdk-ui/src/theme-provider/default-theme-settings.d.ts +1 -0
  106. package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +11 -0
  107. package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +22 -0
  108. package/dist/packages/sdk-ui/src/types.d.ts +254 -16
  109. package/dist/packages/sdk-ui/src/utils/combine-handlers.d.ts +19 -0
  110. package/dist/packages/sdk-ui/src/utils/utility-types/transformer.d.ts +8 -0
  111. package/dist/packages/sdk-ui/src/widget-by-id/types.d.ts +4 -6
  112. package/dist/{types-BYUVZb6u.js → types-BRtWk8uC.js} +1 -1
  113. package/dist/{types-QUSMO7gF.cjs → types-Ds0KtTJF.cjs} +1 -1
  114. package/dist/use-common-filters-D8tEa9zb.js +91245 -0
  115. package/dist/use-common-filters-hw1WKPCY.cjs +844 -0
  116. package/dist/{widget-composer-CGp5yOny.cjs → widget-composer-B7zeAa_D.cjs} +1 -1
  117. package/dist/{widget-composer-BG4HonVl.js → widget-composer-DL0xPtlC.js} +3 -3
  118. package/package.json +9 -9
  119. package/dist/derive-chart-family-BLG1sO1D.js +0 -86946
  120. package/dist/derive-chart-family-QPmz5DJ3.cjs +0 -656
  121. package/dist/execute-query-Cp3se7Yb.cjs +0 -1
  122. package/dist/packages/sdk-ui/src/utils/__development-utils__/highcharts-options-builder-collector.d.ts +0 -61
  123. package/dist/packages/sdk-ui/src/utils/__development-utils__/input-output-collector.d.ts +0 -125
  124. package/dist/use-common-filters-DmdADAhl.cjs +0 -350
  125. package/dist/use-common-filters-wo5IRF5u.js +0 -31972
@@ -1,20 +1,20 @@
1
- var Ce = Object.defineProperty, Re = Object.defineProperties;
2
- var Ie = Object.getOwnPropertyDescriptors;
3
- var W = Object.getOwnPropertySymbols;
4
- var Ne = Object.prototype.hasOwnProperty, Te = Object.prototype.propertyIsEnumerable;
5
- var H = (e, t, r) => t in e ? Ce(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, y = (e, t) => {
1
+ var Ie = Object.defineProperty, Te = Object.defineProperties;
2
+ var Me = Object.getOwnPropertyDescriptors;
3
+ var X = Object.getOwnPropertySymbols;
4
+ var ke = Object.prototype.hasOwnProperty, Ne = Object.prototype.propertyIsEnumerable;
5
+ var Z = (e, t, r) => t in e ? Ie(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, y = (e, t) => {
6
6
  for (var r in t || (t = {}))
7
- Ne.call(t, r) && H(e, r, t[r]);
8
- if (W)
9
- for (var r of W(t))
10
- Te.call(t, r) && H(e, r, t[r]);
7
+ ke.call(t, r) && Z(e, r, t[r]);
8
+ if (X)
9
+ for (var r of X(t))
10
+ Ne.call(t, r) && Z(e, r, t[r]);
11
11
  return e;
12
- }, N = (e, t) => Re(e, Ie(t));
13
- import { f as Me, J as Oe } from "../types-BYUVZb6u.js";
14
- import { b as Ir, E as Nr, a as Tr, i as Mr, e as Or, d as Sr } from "../types-BYUVZb6u.js";
15
- import { bU as Se, bV as Pe, bW as ke, bX as _e, bY as $e, a4 as se, bZ as xe, ah as Ve, b_ as Be, bd as Le, aG as Ue, bg as Ke, be as Qe, aP as qe, bc as Ye, bf as Je, e as We, d as He, l as Xe, b$ as Ge, c0 as Ze, c1 as je, c2 as ve, c3 as et, c4 as tt, c5 as rt, c6 as st, c7 as it, c8 as nt, aE as at, c9 as ot, ca as lt, S as ct, i as ut, cb as ft, c as mt, cc as dt, cd as pt, ce as gt, O as yt, ae as X, aF as bt, cf as wt, v as ht, u as At } from "../execute-query-agpyzZz6.js";
16
- import { i as Dt, b as Et, D as zt, d as Ft } from "../dimensions-B2jz151s.js";
17
- class Ct {
12
+ }, T = (e, t) => Te(e, Me(t));
13
+ import { f as Pe, J as Oe } from "../types-BRtWk8uC.js";
14
+ import { b as Mr, E as kr, a as Nr, i as Pr, e as Or, d as Sr } from "../types-BRtWk8uC.js";
15
+ import { bU as Se, bV as Le, bW as _e, bX as xe, bY as Ve, at as ne, bZ as Be, as as Ue, b_ as Ke, b5 as Qe, au as qe, b8 as He, b6 as Ye, aH as We, b4 as Xe, b7 as Ze, e as je, d as Ge, l as Je, b$ as ve, c0 as et, c1 as tt, c2 as rt, c3 as st, c4 as nt, c5 as it, c6 as at, c7 as ot, c8 as lt, ao as ct, c9 as ut, ca as ft, S as mt, i as dt, cb as ie, c as ae, cc as pt, cd as gt, ce as yt, aD as bt, ah as j, ar as ht, cf as wt, v as At, u as Et } from "../execute-query-CGLL9vXX.js";
16
+ import { i as Dt, b as zt, D as Ft, d as Ct } from "../dimensions-D-Z9sitz.js";
17
+ class Rt {
18
18
  constructor() {
19
19
  this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
20
20
  }
@@ -31,9 +31,9 @@ class Ct {
31
31
  this.keyToValue.clear(), this.valueToKey.clear();
32
32
  }
33
33
  }
34
- class ie {
34
+ class oe {
35
35
  constructor(t) {
36
- this.generateIdentifier = t, this.kv = new Ct();
36
+ this.generateIdentifier = t, this.kv = new Rt();
37
37
  }
38
38
  register(t, r) {
39
39
  this.kv.getByValue(t) || (r || (r = this.generateIdentifier(t)), this.kv.set(r, t));
@@ -48,7 +48,7 @@ class ie {
48
48
  return this.kv.getByKey(t);
49
49
  }
50
50
  }
51
- class Rt extends ie {
51
+ class $t extends oe {
52
52
  constructor() {
53
53
  super((t) => t.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
54
54
  }
@@ -67,21 +67,21 @@ function It(e) {
67
67
  e.hasOwnProperty(r) && t.push(e[r]);
68
68
  return t;
69
69
  }
70
- function Nt(e, t) {
70
+ function Tt(e, t) {
71
71
  const r = It(e);
72
72
  if ("find" in r)
73
73
  return r.find(t);
74
74
  const s = r;
75
- for (let i = 0; i < s.length; i++) {
76
- const n = s[i];
77
- if (t(n))
78
- return n;
75
+ for (let n = 0; n < s.length; n++) {
76
+ const i = s[n];
77
+ if (t(i))
78
+ return i;
79
79
  }
80
80
  }
81
- function A(e, t) {
81
+ function E(e, t) {
82
82
  Object.entries(e).forEach(([r, s]) => t(s, r));
83
83
  }
84
- function T(e, t) {
84
+ function M(e, t) {
85
85
  return e.indexOf(t) !== -1;
86
86
  }
87
87
  function G(e, t) {
@@ -91,7 +91,7 @@ function G(e, t) {
91
91
  return s;
92
92
  }
93
93
  }
94
- class Tt {
94
+ class Mt {
95
95
  constructor() {
96
96
  this.transfomers = {};
97
97
  }
@@ -99,26 +99,26 @@ class Tt {
99
99
  this.transfomers[t.name] = t;
100
100
  }
101
101
  findApplicable(t) {
102
- return Nt(this.transfomers, (r) => r.isApplicable(t));
102
+ return Tt(this.transfomers, (r) => r.isApplicable(t));
103
103
  }
104
104
  findByName(t) {
105
105
  return this.transfomers[t];
106
106
  }
107
107
  }
108
- const Mt = (e) => Object.prototype.toString.call(e).slice(8, -1), ne = (e) => typeof e == "undefined", Ot = (e) => e === null, F = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, P = (e) => F(e) && Object.keys(e).length === 0, g = (e) => Array.isArray(e), St = (e) => typeof e == "string", Pt = (e) => typeof e == "number" && !isNaN(e), kt = (e) => typeof e == "boolean", _t = (e) => e instanceof RegExp, C = (e) => e instanceof Map, R = (e) => e instanceof Set, ae = (e) => Mt(e) === "Symbol", $t = (e) => e instanceof Date && !isNaN(e.valueOf()), xt = (e) => e instanceof Error, Z = (e) => typeof e == "number" && isNaN(e), Vt = (e) => kt(e) || Ot(e) || ne(e) || Pt(e) || St(e) || ae(e), Bt = (e) => typeof e == "bigint", Lt = (e) => e === 1 / 0 || e === -1 / 0, Ut = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), Kt = (e) => e instanceof URL, oe = (e) => e.replace(/\./g, "\\."), S = (e) => e.map(String).map(oe).join("."), z = (e) => {
108
+ const kt = (e) => Object.prototype.toString.call(e).slice(8, -1), le = (e) => typeof e == "undefined", Nt = (e) => e === null, C = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, O = (e) => C(e) && Object.keys(e).length === 0, g = (e) => Array.isArray(e), Pt = (e) => typeof e == "string", Ot = (e) => typeof e == "number" && !isNaN(e), St = (e) => typeof e == "boolean", Lt = (e) => e instanceof RegExp, R = (e) => e instanceof Map, $ = (e) => e instanceof Set, ce = (e) => kt(e) === "Symbol", _t = (e) => e instanceof Date && !isNaN(e.valueOf()), xt = (e) => e instanceof Error, J = (e) => typeof e == "number" && isNaN(e), Vt = (e) => St(e) || Nt(e) || le(e) || Ot(e) || Pt(e) || ce(e), Bt = (e) => typeof e == "bigint", Ut = (e) => e === 1 / 0 || e === -1 / 0, Kt = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), Qt = (e) => e instanceof URL, ue = (e) => e.replace(/\./g, "\\."), P = (e) => e.map(String).map(ue).join("."), F = (e) => {
109
109
  const t = [];
110
110
  let r = "";
111
- for (let i = 0; i < e.length; i++) {
112
- let n = e.charAt(i);
113
- if (n === "\\" && e.charAt(i + 1) === ".") {
114
- r += ".", i++;
111
+ for (let n = 0; n < e.length; n++) {
112
+ let i = e.charAt(n);
113
+ if (i === "\\" && e.charAt(n + 1) === ".") {
114
+ r += ".", n++;
115
115
  continue;
116
116
  }
117
- if (n === ".") {
117
+ if (i === ".") {
118
118
  t.push(r), r = "";
119
119
  continue;
120
120
  }
121
- r += n;
121
+ r += i;
122
122
  }
123
123
  const s = r;
124
124
  return t.push(s), t;
@@ -131,11 +131,11 @@ function d(e, t, r, s) {
131
131
  untransform: s
132
132
  };
133
133
  }
134
- const le = [
135
- d(ne, "undefined", () => null, () => {
134
+ const fe = [
135
+ d(le, "undefined", () => null, () => {
136
136
  }),
137
137
  d(Bt, "bigint", (e) => e.toString(), (e) => typeof BigInt != "undefined" ? BigInt(e) : (console.error("Please add a BigInt polyfill."), e)),
138
- d($t, "Date", (e) => e.toISOString(), (e) => new Date(e)),
138
+ d(_t, "Date", (e) => e.toISOString(), (e) => new Date(e)),
139
139
  d(xt, "Error", (e, t) => {
140
140
  const r = {
141
141
  name: e.name,
@@ -150,24 +150,24 @@ const le = [
150
150
  r[s] = e[s];
151
151
  }), r;
152
152
  }),
153
- d(_t, "regexp", (e) => "" + e, (e) => {
153
+ d(Lt, "regexp", (e) => "" + e, (e) => {
154
154
  const t = e.slice(1, e.lastIndexOf("/")), r = e.slice(e.lastIndexOf("/") + 1);
155
155
  return new RegExp(t, r);
156
156
  }),
157
157
  d(
158
- R,
158
+ $,
159
159
  "set",
160
160
  // (sets only exist in es6+)
161
161
  // eslint-disable-next-line es5/no-es6-methods
162
162
  (e) => [...e.values()],
163
163
  (e) => new Set(e)
164
164
  ),
165
- d(C, "map", (e) => [...e.entries()], (e) => new Map(e)),
166
- d((e) => Z(e) || Lt(e), "number", (e) => Z(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
165
+ d(R, "map", (e) => [...e.entries()], (e) => new Map(e)),
166
+ d((e) => J(e) || Ut(e), "number", (e) => J(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
167
167
  d((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
168
- d(Kt, "URL", (e) => e.toString(), (e) => new URL(e))
168
+ d(Qt, "URL", (e) => e.toString(), (e) => new URL(e))
169
169
  ];
170
- function M(e, t, r, s) {
170
+ function k(e, t, r, s) {
171
171
  return {
172
172
  isApplicable: e,
173
173
  annotation: t,
@@ -175,12 +175,12 @@ function M(e, t, r, s) {
175
175
  untransform: s
176
176
  };
177
177
  }
178
- const ce = M((e, t) => ae(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, r) => {
178
+ const me = k((e, t) => ce(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, r) => {
179
179
  const s = r.symbolRegistry.getValue(t[1]);
180
180
  if (!s)
181
181
  throw new Error("Trying to deserialize unknown symbol");
182
182
  return s;
183
- }), Qt = [
183
+ }), qt = [
184
184
  Int8Array,
185
185
  Uint8Array,
186
186
  Int16Array,
@@ -190,71 +190,71 @@ const ce = M((e, t) => ae(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t)
190
190
  Float32Array,
191
191
  Float64Array,
192
192
  Uint8ClampedArray
193
- ].reduce((e, t) => (e[t.name] = t, e), {}), ue = M(Ut, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
194
- const r = Qt[t[1]];
193
+ ].reduce((e, t) => (e[t.name] = t, e), {}), de = k(Kt, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
194
+ const r = qt[t[1]];
195
195
  if (!r)
196
196
  throw new Error("Trying to deserialize unknown typed array");
197
197
  return new r(e);
198
198
  });
199
- function fe(e, t) {
199
+ function pe(e, t) {
200
200
  return e != null && e.constructor ? !!t.classRegistry.getIdentifier(e.constructor) : !1;
201
201
  }
202
- const me = M(fe, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)], (e, t) => {
202
+ const ge = k(pe, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)], (e, t) => {
203
203
  const r = t.classRegistry.getAllowedProps(e.constructor);
204
204
  if (!r)
205
205
  return y({}, e);
206
206
  const s = {};
207
- return r.forEach((i) => {
208
- s[i] = e[i];
207
+ return r.forEach((n) => {
208
+ s[n] = e[n];
209
209
  }), s;
210
210
  }, (e, t, r) => {
211
211
  const s = r.classRegistry.getValue(t[1]);
212
212
  if (!s)
213
213
  throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
214
214
  return Object.assign(Object.create(s.prototype), e);
215
- }), de = M((e, t) => !!t.customTransformerRegistry.findApplicable(e), (e, t) => ["custom", t.customTransformerRegistry.findApplicable(e).name], (e, t) => t.customTransformerRegistry.findApplicable(e).serialize(e), (e, t, r) => {
215
+ }), ye = k((e, t) => !!t.customTransformerRegistry.findApplicable(e), (e, t) => ["custom", t.customTransformerRegistry.findApplicable(e).name], (e, t) => t.customTransformerRegistry.findApplicable(e).serialize(e), (e, t, r) => {
216
216
  const s = r.customTransformerRegistry.findByName(t[1]);
217
217
  if (!s)
218
218
  throw new Error("Trying to deserialize unknown custom value");
219
219
  return s.deserialize(e);
220
- }), qt = [me, ce, de, ue], j = (e, t) => {
221
- const r = G(qt, (i) => i.isApplicable(e, t));
220
+ }), Ht = [ge, me, ye, de], v = (e, t) => {
221
+ const r = G(Ht, (n) => n.isApplicable(e, t));
222
222
  if (r)
223
223
  return {
224
224
  value: r.transform(e, t),
225
225
  type: r.annotation(e, t)
226
226
  };
227
- const s = G(le, (i) => i.isApplicable(e, t));
227
+ const s = G(fe, (n) => n.isApplicable(e, t));
228
228
  if (s)
229
229
  return {
230
230
  value: s.transform(e, t),
231
231
  type: s.annotation
232
232
  };
233
- }, pe = {};
234
- le.forEach((e) => {
235
- pe[e.annotation] = e;
233
+ }, be = {};
234
+ fe.forEach((e) => {
235
+ be[e.annotation] = e;
236
236
  });
237
237
  const Yt = (e, t, r) => {
238
238
  if (g(t))
239
239
  switch (t[0]) {
240
240
  case "symbol":
241
- return ce.untransform(e, t, r);
242
- case "class":
243
241
  return me.untransform(e, t, r);
242
+ case "class":
243
+ return ge.untransform(e, t, r);
244
244
  case "custom":
245
- return de.untransform(e, t, r);
245
+ return ye.untransform(e, t, r);
246
246
  case "typed-array":
247
- return ue.untransform(e, t, r);
247
+ return de.untransform(e, t, r);
248
248
  default:
249
249
  throw new Error("Unknown transformation: " + t);
250
250
  }
251
251
  else {
252
- const s = pe[t];
252
+ const s = be[t];
253
253
  if (!s)
254
254
  throw new Error("Unknown transformation: " + t);
255
255
  return s.untransform(e, r);
256
256
  }
257
- }, h = (e, t) => {
257
+ }, w = (e, t) => {
258
258
  if (t > e.size)
259
259
  throw new Error("index out of bounds");
260
260
  const r = e.keys();
@@ -262,234 +262,234 @@ const Yt = (e, t, r) => {
262
262
  r.next(), t--;
263
263
  return r.next().value;
264
264
  };
265
- function ge(e) {
266
- if (T(e, "__proto__"))
265
+ function he(e) {
266
+ if (M(e, "__proto__"))
267
267
  throw new Error("__proto__ is not allowed as a property");
268
- if (T(e, "prototype"))
268
+ if (M(e, "prototype"))
269
269
  throw new Error("prototype is not allowed as a property");
270
- if (T(e, "constructor"))
270
+ if (M(e, "constructor"))
271
271
  throw new Error("constructor is not allowed as a property");
272
272
  }
273
- const Jt = (e, t) => {
274
- ge(t);
273
+ const Wt = (e, t) => {
274
+ he(t);
275
275
  for (let r = 0; r < t.length; r++) {
276
276
  const s = t[r];
277
- if (R(e))
278
- e = h(e, +s);
279
- else if (C(e)) {
280
- const i = +s, n = +t[++r] == 0 ? "key" : "value", o = h(e, i);
281
- switch (n) {
277
+ if ($(e))
278
+ e = w(e, +s);
279
+ else if (R(e)) {
280
+ const n = +s, i = +t[++r] == 0 ? "key" : "value", a = w(e, n);
281
+ switch (i) {
282
282
  case "key":
283
- e = o;
283
+ e = a;
284
284
  break;
285
285
  case "value":
286
- e = e.get(o);
286
+ e = e.get(a);
287
287
  break;
288
288
  }
289
289
  } else
290
290
  e = e[s];
291
291
  }
292
292
  return e;
293
- }, k = (e, t, r) => {
294
- if (ge(t), t.length === 0)
293
+ }, S = (e, t, r) => {
294
+ if (he(t), t.length === 0)
295
295
  return r(e);
296
296
  let s = e;
297
- for (let n = 0; n < t.length - 1; n++) {
298
- const o = t[n];
297
+ for (let i = 0; i < t.length - 1; i++) {
298
+ const a = t[i];
299
299
  if (g(s)) {
300
- const l = +o;
301
- s = s[l];
302
- } else if (F(s))
300
+ const o = +a;
303
301
  s = s[o];
304
- else if (R(s)) {
305
- const l = +o;
306
- s = h(s, l);
307
- } else if (C(s)) {
308
- if (n === t.length - 2)
302
+ } else if (C(s))
303
+ s = s[a];
304
+ else if ($(s)) {
305
+ const o = +a;
306
+ s = w(s, o);
307
+ } else if (R(s)) {
308
+ if (i === t.length - 2)
309
309
  break;
310
- const u = +o, I = +t[++n] == 0 ? "key" : "value", w = h(s, u);
310
+ const c = +a, I = +t[++i] == 0 ? "key" : "value", h = w(s, c);
311
311
  switch (I) {
312
312
  case "key":
313
- s = w;
313
+ s = h;
314
314
  break;
315
315
  case "value":
316
- s = s.get(w);
316
+ s = s.get(h);
317
317
  break;
318
318
  }
319
319
  }
320
320
  }
321
- const i = t[t.length - 1];
322
- if (g(s) ? s[+i] = r(s[+i]) : F(s) && (s[i] = r(s[i])), R(s)) {
323
- const n = h(s, +i), o = r(n);
324
- n !== o && (s.delete(n), s.add(o));
321
+ const n = t[t.length - 1];
322
+ if (g(s) ? s[+n] = r(s[+n]) : C(s) && (s[n] = r(s[n])), $(s)) {
323
+ const i = w(s, +n), a = r(i);
324
+ i !== a && (s.delete(i), s.add(a));
325
325
  }
326
- if (C(s)) {
327
- const n = +t[t.length - 2], o = h(s, n);
328
- switch (+i == 0 ? "key" : "value") {
326
+ if (R(s)) {
327
+ const i = +t[t.length - 2], a = w(s, i);
328
+ switch (+n == 0 ? "key" : "value") {
329
329
  case "key": {
330
- const u = r(o);
331
- s.set(u, s.get(o)), u !== o && s.delete(o);
330
+ const c = r(a);
331
+ s.set(c, s.get(a)), c !== a && s.delete(a);
332
332
  break;
333
333
  }
334
334
  case "value": {
335
- s.set(o, r(s.get(o)));
335
+ s.set(a, r(s.get(a)));
336
336
  break;
337
337
  }
338
338
  }
339
339
  }
340
340
  return e;
341
341
  };
342
- function _(e, t, r = []) {
342
+ function L(e, t, r = []) {
343
343
  if (!e)
344
344
  return;
345
345
  if (!g(e)) {
346
- A(e, (n, o) => _(n, t, [...r, ...z(o)]));
346
+ E(e, (i, a) => L(i, t, [...r, ...F(a)]));
347
347
  return;
348
348
  }
349
- const [s, i] = e;
350
- i && A(i, (n, o) => {
351
- _(n, t, [...r, ...z(o)]);
349
+ const [s, n] = e;
350
+ n && E(n, (i, a) => {
351
+ L(i, t, [...r, ...F(a)]);
352
352
  }), t(s, r);
353
353
  }
354
- function Wt(e, t, r) {
355
- return _(t, (s, i) => {
356
- e = k(e, i, (n) => Yt(n, s, r));
354
+ function Xt(e, t, r) {
355
+ return L(t, (s, n) => {
356
+ e = S(e, n, (i) => Yt(i, s, r));
357
357
  }), e;
358
358
  }
359
- function Ht(e, t) {
360
- function r(s, i) {
361
- const n = Jt(e, z(i));
362
- s.map(z).forEach((o) => {
363
- e = k(e, o, () => n);
359
+ function Zt(e, t) {
360
+ function r(s, n) {
361
+ const i = Wt(e, F(n));
362
+ s.map(F).forEach((a) => {
363
+ e = S(e, a, () => i);
364
364
  });
365
365
  }
366
366
  if (g(t)) {
367
- const [s, i] = t;
368
- s.forEach((n) => {
369
- e = k(e, z(n), () => e);
370
- }), i && A(i, r);
367
+ const [s, n] = t;
368
+ s.forEach((i) => {
369
+ e = S(e, F(i), () => e);
370
+ }), n && E(n, r);
371
371
  } else
372
- A(t, r);
372
+ E(t, r);
373
373
  return e;
374
374
  }
375
- const Xt = (e, t) => F(e) || g(e) || C(e) || R(e) || fe(e, t);
375
+ const jt = (e, t) => C(e) || g(e) || R(e) || $(e) || pe(e, t);
376
376
  function Gt(e, t, r) {
377
377
  const s = r.get(e);
378
378
  s ? s.push(t) : r.set(e, [t]);
379
379
  }
380
- function Zt(e, t) {
380
+ function Jt(e, t) {
381
381
  const r = {};
382
382
  let s;
383
- return e.forEach((i) => {
384
- if (i.length <= 1)
383
+ return e.forEach((n) => {
384
+ if (n.length <= 1)
385
385
  return;
386
- t || (i = i.map((l) => l.map(String)).sort((l, u) => l.length - u.length));
387
- const [n, ...o] = i;
388
- n.length === 0 ? s = o.map(S) : r[S(n)] = o.map(S);
389
- }), s ? P(r) ? [s] : [s, r] : P(r) ? void 0 : r;
390
- }
391
- const ye = (e, t, r, s, i = [], n = [], o = /* @__PURE__ */ new Map()) => {
392
- var J;
393
- const l = Vt(e);
394
- if (!l) {
395
- Gt(e, i, t);
396
- const p = o.get(e);
386
+ t || (n = n.map((o) => o.map(String)).sort((o, c) => o.length - c.length));
387
+ const [i, ...a] = n;
388
+ i.length === 0 ? s = a.map(P) : r[P(i)] = a.map(P);
389
+ }), s ? O(r) ? [s] : [s, r] : O(r) ? void 0 : r;
390
+ }
391
+ const we = (e, t, r, s, n = [], i = [], a = /* @__PURE__ */ new Map()) => {
392
+ var W;
393
+ const o = Vt(e);
394
+ if (!o) {
395
+ Gt(e, n, t);
396
+ const p = a.get(e);
397
397
  if (p)
398
398
  return s ? {
399
399
  transformedValue: null
400
400
  } : p;
401
401
  }
402
- if (!Xt(e, r)) {
403
- const p = j(e, r), m = p ? {
402
+ if (!jt(e, r)) {
403
+ const p = v(e, r), m = p ? {
404
404
  transformedValue: p.value,
405
405
  annotations: [p.type]
406
406
  } : {
407
407
  transformedValue: e
408
408
  };
409
- return l || o.set(e, m), m;
409
+ return o || a.set(e, m), m;
410
410
  }
411
- if (T(n, e))
411
+ if (M(i, e))
412
412
  return {
413
413
  transformedValue: null
414
414
  };
415
- const u = j(e, r), I = (J = u == null ? void 0 : u.value) != null ? J : e, w = g(I) ? [] : {}, D = {};
416
- A(I, (p, m) => {
415
+ const c = v(e, r), I = (W = c == null ? void 0 : c.value) != null ? W : e, h = g(I) ? [] : {}, D = {};
416
+ E(I, (p, m) => {
417
417
  if (m === "__proto__" || m === "constructor" || m === "prototype")
418
418
  throw new Error(`Detected property ${m}. This is a prototype pollution risk, please remove it from your object.`);
419
- const E = ye(p, t, r, s, [...i, m], [...n, e], o);
420
- w[m] = E.transformedValue, g(E.annotations) ? D[m] = E.annotations : F(E.annotations) && A(E.annotations, (ze, Fe) => {
421
- D[oe(m) + "." + Fe] = ze;
419
+ const z = we(p, t, r, s, [...n, m], [...i, e], a);
420
+ h[m] = z.transformedValue, g(z.annotations) ? D[m] = z.annotations : C(z.annotations) && E(z.annotations, (Re, $e) => {
421
+ D[ue(m) + "." + $e] = Re;
422
422
  });
423
423
  });
424
- const Y = P(D) ? {
425
- transformedValue: w,
426
- annotations: u ? [u.type] : void 0
424
+ const Y = O(D) ? {
425
+ transformedValue: h,
426
+ annotations: c ? [c.type] : void 0
427
427
  } : {
428
- transformedValue: w,
429
- annotations: u ? [u.type, D] : D
428
+ transformedValue: h,
429
+ annotations: c ? [c.type, D] : D
430
430
  };
431
- return l || o.set(e, Y), Y;
431
+ return o || a.set(e, Y), Y;
432
432
  };
433
- function be(e) {
433
+ function Ae(e) {
434
434
  return Object.prototype.toString.call(e).slice(8, -1);
435
435
  }
436
- function v(e) {
437
- return be(e) === "Array";
436
+ function ee(e) {
437
+ return Ae(e) === "Array";
438
438
  }
439
- function jt(e) {
440
- if (be(e) !== "Object")
439
+ function vt(e) {
440
+ if (Ae(e) !== "Object")
441
441
  return !1;
442
442
  const t = Object.getPrototypeOf(e);
443
443
  return !!t && t.constructor === Object && t === Object.prototype;
444
444
  }
445
- function vt(e, t, r, s, i) {
446
- const n = {}.propertyIsEnumerable.call(s, t) ? "enumerable" : "nonenumerable";
447
- n === "enumerable" && (e[t] = r), i && n === "nonenumerable" && Object.defineProperty(e, t, {
445
+ function er(e, t, r, s, n) {
446
+ const i = {}.propertyIsEnumerable.call(s, t) ? "enumerable" : "nonenumerable";
447
+ i === "enumerable" && (e[t] = r), n && i === "nonenumerable" && Object.defineProperty(e, t, {
448
448
  value: r,
449
449
  enumerable: !1,
450
450
  writable: !0,
451
451
  configurable: !0
452
452
  });
453
453
  }
454
- function $(e, t = {}) {
455
- if (v(e))
456
- return e.map((i) => $(i, t));
457
- if (!jt(e))
454
+ function _(e, t = {}) {
455
+ if (ee(e))
456
+ return e.map((n) => _(n, t));
457
+ if (!vt(e))
458
458
  return e;
459
459
  const r = Object.getOwnPropertyNames(e), s = Object.getOwnPropertySymbols(e);
460
- return [...r, ...s].reduce((i, n) => {
461
- if (v(t.props) && !t.props.includes(n))
462
- return i;
463
- const o = e[n], l = $(o, t);
464
- return vt(i, n, l, e, t.nonenumerable), i;
460
+ return [...r, ...s].reduce((n, i) => {
461
+ if (ee(t.props) && !t.props.includes(i))
462
+ return n;
463
+ const a = e[i], o = _(a, t);
464
+ return er(n, i, o, e, t.nonenumerable), n;
465
465
  }, {});
466
466
  }
467
- class a {
467
+ class l {
468
468
  /**
469
469
  * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
470
470
  */
471
471
  constructor({ dedupe: t = !1 } = {}) {
472
- this.classRegistry = new Rt(), this.symbolRegistry = new ie((r) => {
472
+ this.classRegistry = new $t(), this.symbolRegistry = new oe((r) => {
473
473
  var s;
474
474
  return (s = r.description) != null ? s : "";
475
- }), this.customTransformerRegistry = new Tt(), this.allowedErrorProps = [], this.dedupe = t;
475
+ }), this.customTransformerRegistry = new Mt(), this.allowedErrorProps = [], this.dedupe = t;
476
476
  }
477
477
  serialize(t) {
478
- const r = /* @__PURE__ */ new Map(), s = ye(t, r, this, this.dedupe), i = {
478
+ const r = /* @__PURE__ */ new Map(), s = we(t, r, this, this.dedupe), n = {
479
479
  json: s.transformedValue
480
480
  };
481
- s.annotations && (i.meta = N(y({}, i.meta), {
481
+ s.annotations && (n.meta = T(y({}, n.meta), {
482
482
  values: s.annotations
483
483
  }));
484
- const n = Zt(r, this.dedupe);
485
- return n && (i.meta = N(y({}, i.meta), {
486
- referentialEqualities: n
487
- })), i;
484
+ const i = Jt(r, this.dedupe);
485
+ return i && (n.meta = T(y({}, n.meta), {
486
+ referentialEqualities: i
487
+ })), n;
488
488
  }
489
489
  deserialize(t) {
490
490
  const { json: r, meta: s } = t;
491
- let i = $(r);
492
- return s != null && s.values && (i = Wt(i, s.values, this)), s != null && s.referentialEqualities && (i = Ht(i, s.referentialEqualities)), i;
491
+ let n = _(r);
492
+ return s != null && s.values && (n = Xt(n, s.values, this)), s != null && s.referentialEqualities && (n = Zt(n, s.referentialEqualities)), n;
493
493
  }
494
494
  stringify(t) {
495
495
  return JSON.stringify(this.serialize(t));
@@ -512,16 +512,16 @@ class a {
512
512
  this.allowedErrorProps.push(...t);
513
513
  }
514
514
  }
515
- a.defaultInstance = new a();
516
- a.serialize = a.defaultInstance.serialize.bind(a.defaultInstance);
517
- a.deserialize = a.defaultInstance.deserialize.bind(a.defaultInstance);
518
- a.stringify = a.defaultInstance.stringify.bind(a.defaultInstance);
519
- a.parse = a.defaultInstance.parse.bind(a.defaultInstance);
520
- a.registerClass = a.defaultInstance.registerClass.bind(a.defaultInstance);
521
- a.registerSymbol = a.defaultInstance.registerSymbol.bind(a.defaultInstance);
522
- a.registerCustom = a.defaultInstance.registerCustom.bind(a.defaultInstance);
523
- a.allowErrorProps = a.defaultInstance.allowErrorProps.bind(a.defaultInstance);
524
- const b = (e) => e === void 0 ? ct.None : e, er = (e) => new Oe(e.metadataItem, e.type), x = (e) => new We(e.name, e.expression, e.type, e.description, b(e.sort), e.dataSource, e.composeCode), V = (e) => new He(e.name, e.expression, e.granularity, e.format, e.description, b(e.sort), e.dataSource, e.composeCode), f = (e) => {
515
+ l.defaultInstance = new l();
516
+ l.serialize = l.defaultInstance.serialize.bind(l.defaultInstance);
517
+ l.deserialize = l.defaultInstance.deserialize.bind(l.defaultInstance);
518
+ l.stringify = l.defaultInstance.stringify.bind(l.defaultInstance);
519
+ l.parse = l.defaultInstance.parse.bind(l.defaultInstance);
520
+ l.registerClass = l.defaultInstance.registerClass.bind(l.defaultInstance);
521
+ l.registerSymbol = l.defaultInstance.registerSymbol.bind(l.defaultInstance);
522
+ l.registerCustom = l.defaultInstance.registerCustom.bind(l.defaultInstance);
523
+ l.allowErrorProps = l.defaultInstance.allowErrorProps.bind(l.defaultInstance);
524
+ const b = (e) => e === void 0 ? mt.None : e, tr = (e) => new Oe(e.metadataItem, e.type), x = (e) => new je(e.name, e.expression, e.type, e.description, b(e.sort), e.dataSource, e.composeCode), V = (e) => new Ge(e.name, e.expression, e.granularity, e.format, e.description, b(e.sort), e.dataSource, e.composeCode), f = (e) => {
525
525
  switch (e.__serializable) {
526
526
  case "DimensionalAttribute":
527
527
  return x(e);
@@ -530,16 +530,16 @@ const b = (e) => e === void 0 ? ct.None : e, er = (e) => new Oe(e.metadataItem,
530
530
  default:
531
531
  return e;
532
532
  }
533
- }, we = (e) => new zt(e.name, e.expression, e.attributes.map(f), e.dimensions.map(tr), e.type, e.description, b(e.sort), e.dataSource, e.composeCode, e.defaultAttribute ? f(e.defaultAttribute) : void 0), he = (e) => new Ft(e.name, e.expression, e.description, b(e.sort), e.dataSource, e.composeCode), tr = (e) => {
533
+ }, Ee = (e) => new Ft(e.name, e.expression, e.attributes.map(f), e.dimensions.map(rr), e.type, e.description, b(e.sort), e.dataSource, e.composeCode, e.defaultAttribute ? f(e.defaultAttribute) : void 0), De = (e) => new Ct(e.name, e.expression, e.description, b(e.sort), e.dataSource, e.composeCode), rr = (e) => {
534
534
  switch (e.__serializable) {
535
535
  case "DimensionalDimension":
536
- return we(e);
536
+ return Ee(e);
537
537
  case "DimensionalDateDimension":
538
- return he(e);
538
+ return De(e);
539
539
  default:
540
540
  return e;
541
541
  }
542
- }, B = (e) => new Xe(e.name, f(e.attribute), e.aggregation, e.format, e.description, b(e.sort), e.dataSource, e.composeCode), L = (e) => {
542
+ }, B = (e) => new Je(e.name, f(e.attribute), e.aggregation, e.format, e.description, b(e.sort), e.dataSource, e.composeCode), U = (e) => {
543
543
  const t = Object.fromEntries(Object.entries(e.context).map(([r, s]) => {
544
544
  if (s && typeof s == "object" && "__serializable" in s)
545
545
  switch (s.__serializable) {
@@ -561,7 +561,7 @@ const b = (e) => e === void 0 ? ct.None : e, er = (e) => new Oe(e.metadataItem,
561
561
  case "DimensionalCalculatedMeasure":
562
562
  return [
563
563
  r,
564
- L(s)
564
+ U(s)
565
565
  ];
566
566
  default:
567
567
  return [
@@ -574,303 +574,439 @@ const b = (e) => e === void 0 ? ct.None : e, er = (e) => new Oe(e.metadataItem,
574
574
  s
575
575
  ];
576
576
  }));
577
- return new Ge(e.name, e.expression, t, e.format, e.description, b(e.sort), e.dataSource, e.composeCode);
578
- }, Ae = (e) => new Ze(e.name, f(e.attribute), e.format, e.description, b(e.sort), e.dataSource, e.composeCode), ee = (e) => {
577
+ return new ve(e.name, e.expression, t, e.format, e.description, b(e.sort), e.dataSource, e.composeCode);
578
+ }, ze = (e) => new et(e.name, f(e.attribute), e.format, e.description, b(e.sort), e.dataSource, e.composeCode), te = (e) => {
579
579
  switch (e.__serializable) {
580
580
  case "DimensionalBaseMeasure":
581
581
  return B(e);
582
582
  case "DimensionalCalculatedMeasure":
583
- return L(e);
583
+ return U(e);
584
584
  case "DimensionalMeasureTemplate":
585
- return Ae(e);
585
+ return ze(e);
586
586
  default:
587
587
  return e;
588
588
  }
589
- }, c = (e) => {
589
+ }, u = (e) => {
590
590
  switch (e.__serializable) {
591
591
  case "MembersFilter":
592
- return new lt(f(e.attribute), e.members, e.config.backgroundFilter ? N(y({}, e.config), {
593
- backgroundFilter: c(e.config.backgroundFilter)
592
+ return new ft(f(e.attribute), e.members, e.config.backgroundFilter ? T(y({}, e.config), {
593
+ backgroundFilter: u(e.config.backgroundFilter)
594
594
  }) : e.config, e.composeCode);
595
595
  case "LogicalAttributeFilter":
596
- return new ot(e.filters.map((r) => c(r)), e.operator, e.config, e.composeCode);
596
+ return new ut(e.filters.map((r) => u(r)), e.operator, e.config, e.composeCode);
597
597
  case "CascadingFilter":
598
- return new at(e._filters.map((r) => c(r)), e.config, e.composeCode);
598
+ return new ct(e._filters.map((r) => u(r)), e.config, e.composeCode);
599
599
  case "ExcludeFilter":
600
- return new nt(c(e.filter), e.input ? c(e.input) : void 0, e.config, e.composeCode);
600
+ return new lt(u(e.filter), e.input ? u(e.input) : void 0, e.config, e.composeCode);
601
601
  case "MeasureFilter":
602
- return new it(f(e.attribute), ee(e.measure), e.operatorA, e.valueA, e.operatorB, e.valueB, e.config, e.composeCode);
602
+ return new ot(f(e.attribute), te(e.measure), e.operatorA, e.valueA, e.operatorB, e.valueB, e.config, e.composeCode);
603
603
  case "RankingFilter":
604
- return new st(f(e.attribute), ee(e.measure), e.operator, e.count, e.config, e.composeCode);
604
+ return new at(f(e.attribute), te(e.measure), e.operator, e.count, e.config, e.composeCode);
605
605
  case "NumericFilter":
606
- return new rt(f(e.attribute), e.operatorA, e.valueA, e.operatorB, e.valueB, e.config, e.composeCode);
606
+ return new it(f(e.attribute), e.operatorA, e.valueA, e.operatorB, e.valueB, e.config, e.composeCode);
607
607
  case "TextFilter":
608
- return new tt(f(e.attribute), e.operatorA, e.valueA, e.config, e.composeCode);
608
+ return new nt(f(e.attribute), e.operatorA, e.valueA, e.config, e.composeCode);
609
609
  case "DateRangeFilter": {
610
610
  const { valueA: r, valueB: s } = e;
611
- return new et(f(e.attribute), r, s, e.config, e.composeCode);
611
+ return new st(f(e.attribute), r, s, e.config, e.composeCode);
612
612
  }
613
613
  case "RelativeDateFilter":
614
- return new ve(f(e.attribute), e.offset, e.count, e.operator, e.anchor, e.config, e.composeCode);
614
+ return new rt(f(e.attribute), e.offset, e.count, e.operator, e.anchor, e.config, e.composeCode);
615
615
  case "CustomFilter":
616
- return new je(f(e.attribute), e.jaqlExpression, e.config, e.composeCode);
616
+ return new tt(f(e.attribute), e.jaqlExpression, e.config, e.composeCode);
617
617
  default:
618
618
  return e;
619
619
  }
620
620
  };
621
- a.registerCustom({
622
- isApplicable: Me,
621
+ l.registerCustom({
622
+ isApplicable: Pe,
623
623
  serialize: (e) => e.serialize(),
624
- deserialize: (e) => er(e)
624
+ deserialize: (e) => tr(e)
625
625
  }, "JaqlElement");
626
- a.registerCustom({
626
+ l.registerCustom({
627
627
  isApplicable: Se,
628
628
  serialize: (e) => e.serialize(),
629
629
  deserialize: (e) => x(e)
630
630
  }, "DimensionalAttribute");
631
- a.registerCustom({
632
- isApplicable: Pe,
631
+ l.registerCustom({
632
+ isApplicable: Le,
633
633
  serialize: (e) => e.serialize(),
634
634
  deserialize: (e) => V(e)
635
635
  }, "DimensionalLevelAttribute");
636
- a.registerCustom({
636
+ l.registerCustom({
637
637
  isApplicable: Dt,
638
638
  serialize: (e) => e.serialize(),
639
- deserialize: (e) => we(e)
639
+ deserialize: (e) => Ee(e)
640
640
  }, "DimensionalDimension");
641
- a.registerCustom({
642
- isApplicable: Et,
641
+ l.registerCustom({
642
+ isApplicable: zt,
643
643
  serialize: (e) => e.serialize(),
644
- deserialize: (e) => he(e)
644
+ deserialize: (e) => De(e)
645
645
  }, "DimensionalDateDimension");
646
- a.registerCustom({
647
- isApplicable: ke,
646
+ l.registerCustom({
647
+ isApplicable: _e,
648
648
  serialize: (e) => e.serialize(),
649
649
  deserialize: (e) => B(e)
650
650
  }, "DimensionalBaseMeasure");
651
- a.registerCustom({
652
- isApplicable: _e,
651
+ l.registerCustom({
652
+ isApplicable: xe,
653
653
  serialize: (e) => e.serialize(),
654
- deserialize: (e) => L(e)
654
+ deserialize: (e) => U(e)
655
655
  }, "DimensionalCalculatedMeasure");
656
- a.registerCustom({
657
- isApplicable: $e,
656
+ l.registerCustom({
657
+ isApplicable: Ve,
658
658
  serialize: (e) => e.serialize(),
659
- deserialize: (e) => Ae(e)
659
+ deserialize: (e) => ze(e)
660
660
  }, "DimensionalMeasureTemplate");
661
- a.registerCustom({
662
- isApplicable: se,
661
+ l.registerCustom({
662
+ isApplicable: ne,
663
663
  serialize: (e) => e.serialize(),
664
- deserialize: (e) => c(e)
664
+ deserialize: (e) => u(e)
665
665
  }, "MembersFilter");
666
- a.registerCustom({
667
- isApplicable: xe,
666
+ l.registerCustom({
667
+ isApplicable: Be,
668
668
  serialize: (e) => e.serialize(),
669
- deserialize: (e) => c(e)
669
+ deserialize: (e) => u(e)
670
670
  }, "LogicalAttributeFilter");
671
- a.registerCustom({
672
- isApplicable: Ve,
671
+ l.registerCustom({
672
+ isApplicable: Ue,
673
673
  serialize: (e) => e.serialize(),
674
- deserialize: (e) => c(e)
674
+ deserialize: (e) => u(e)
675
675
  }, "CascadingFilter");
676
- a.registerCustom({
677
- isApplicable: Be,
676
+ l.registerCustom({
677
+ isApplicable: Ke,
678
678
  serialize: (e) => e.serialize(),
679
- deserialize: (e) => c(e)
679
+ deserialize: (e) => u(e)
680
680
  }, "ExcludeFilter");
681
- a.registerCustom({
682
- isApplicable: Le,
681
+ l.registerCustom({
682
+ isApplicable: Qe,
683
683
  serialize: (e) => e.serialize(),
684
- deserialize: (e) => c(e)
684
+ deserialize: (e) => u(e)
685
685
  }, "MeasureFilter");
686
- a.registerCustom({
687
- isApplicable: Ue,
686
+ l.registerCustom({
687
+ isApplicable: qe,
688
688
  serialize: (e) => e.serialize(),
689
- deserialize: (e) => c(e)
689
+ deserialize: (e) => u(e)
690
690
  }, "RankingFilter");
691
- a.registerCustom({
692
- isApplicable: Ke,
691
+ l.registerCustom({
692
+ isApplicable: He,
693
693
  serialize: (e) => e.serialize(),
694
- deserialize: (e) => c(e)
694
+ deserialize: (e) => u(e)
695
695
  }, "NumericFilter");
696
- a.registerCustom({
697
- isApplicable: Qe,
696
+ l.registerCustom({
697
+ isApplicable: Ye,
698
698
  serialize: (e) => e.serialize(),
699
- deserialize: (e) => c(e)
699
+ deserialize: (e) => u(e)
700
700
  }, "TextFilter");
701
- a.registerCustom({
702
- isApplicable: qe,
701
+ l.registerCustom({
702
+ isApplicable: We,
703
703
  serialize: (e) => e.serialize(),
704
- deserialize: (e) => c(e)
704
+ deserialize: (e) => u(e)
705
705
  }, "DateRangeFilter");
706
- a.registerCustom({
707
- isApplicable: Ye,
706
+ l.registerCustom({
707
+ isApplicable: Xe,
708
708
  serialize: (e) => e.serialize(),
709
- deserialize: (e) => c(e)
709
+ deserialize: (e) => u(e)
710
710
  }, "RelativeDateFilter");
711
- a.registerCustom({
712
- isApplicable: Je,
711
+ l.registerCustom({
712
+ isApplicable: Ze,
713
713
  serialize: (e) => e.serialize(),
714
- deserialize: (e) => c(e)
714
+ deserialize: (e) => u(e)
715
715
  }, "CustomFilter");
716
- const Er = a;
717
- function rr(e) {
716
+ const Cr = l, A = "DM.";
717
+ function sr(e) {
718
718
  return typeof e == "object" && e !== null && "function" in e && "args" in e;
719
719
  }
720
- function U(e) {
721
- return e.every(rr);
722
- }
723
720
  function K(e) {
724
- return "attribute" in e && "config" in e;
721
+ return e.every(sr);
725
722
  }
726
723
  function Q(e) {
724
+ return "attribute" in e && "config" in e;
725
+ }
726
+ function q(e) {
727
727
  return "left" in e && "right" in e && "operator" in e;
728
728
  }
729
- function sr(e) {
730
- return !K(e) && !Q(e);
729
+ function nr(e) {
730
+ return !Q(e) && !q(e);
731
731
  }
732
- function q(e, t) {
732
+ function H(e, t) {
733
733
  const r = {}, s = e !== "" ? e + "." : "";
734
- for (const i in t)
735
- if (typeof t[`${i}`] == "function")
736
- r[`${s}${i}`] = t[`${i}`];
737
- else if (typeof t[`${i}`] == "object") {
738
- const n = q("", t[`${i}`]);
739
- for (const o in n)
740
- r[`${s}${i}.${o}`] = n[`${o}`];
734
+ for (const n in t)
735
+ if (typeof t[`${n}`] == "function")
736
+ r[`${s}${n}`] = t[`${n}`];
737
+ else if (typeof t[`${n}`] == "object") {
738
+ const i = H("", t[`${n}`]);
739
+ for (const a in i)
740
+ r[`${s}${n}.${a}`] = i[`${a}`];
741
741
  }
742
742
  return r;
743
743
  }
744
- const te = q("measureFactory", dt), re = q("filterFactory", pt);
744
+ const re = H("measureFactory", pt), se = H("filterFactory", gt);
745
745
  function ir(e, t) {
746
746
  const s = e.split(".")[0];
747
- if (s === "filterFactory" && re[`${e}`])
747
+ if (s === "filterFactory" && se[`${e}`])
748
+ return se[`${e}`](...t);
749
+ if (s === "measureFactory" && re[`${e}`])
748
750
  return re[`${e}`](...t);
749
- if (s === "measureFactory" && te[`${e}`])
750
- return te[`${e}`](...t);
751
751
  throw new Error(`Function "${e}" not found in filterFactory or measureFactory.`);
752
752
  }
753
- function nr(e) {
753
+ function ar(e) {
754
754
  const t = e.split(".");
755
- if (t.length < 3 || t[0] !== "DM")
756
- throw new Error(`Invalid attribute name format: "${e}". Expected format: "DM.TableName.ColumnName[.Level]".`);
755
+ if (t.length < 3 || `${t[0]}.` !== A)
756
+ throw new Error(`Invalid attribute name format: "${e}". Expected format: "${A}TableName.ColumnName[.Level]".`);
757
757
  const r = t[1], s = t[2];
758
- let i;
759
- return t.length === 4 && (i = t[3]), {
758
+ let n;
759
+ return t.length === 4 && (n = t[3]), {
760
760
  tableName: r,
761
761
  columnName: s,
762
- level: i
762
+ level: n
763
763
  };
764
764
  }
765
- function ar(e, t) {
766
- const { tableName: r, columnName: s, level: i } = nr(e), n = t.find((l) => l.name === r);
767
- if (!n)
765
+ function or(e, t) {
766
+ const { tableName: r, columnName: s, level: n } = ar(e), i = t.find((o) => o.name === r);
767
+ if (!i)
768
768
  throw new Error(`Table "${r}" not found in the data model.`);
769
- const o = n.columns.find((l) => l.name === s);
770
- if (!o)
769
+ const a = i.columns.find((o) => o.name === s);
770
+ if (!a)
771
771
  throw new Error(`Column "${s}" not found in table "${r}".`);
772
- if (i) {
773
- if (o.dataType !== ft.DATETIME)
774
- throw new Error(`Invalid date level "${i}" in attribute "${e}". Column "${r}.${s}" is not a datetime column.`);
775
- const l = mt.all;
776
- if (!l.includes(i))
777
- throw new Error(`Invalid date level "${i}" in attribute "${e}". Valid levels are: ${l.join(", ")}.`);
772
+ if (n) {
773
+ if (a.dataType !== ie.DATETIME)
774
+ throw new Error(`Invalid date level "${n}" in attribute "${e}". Column "${r}.${s}" is not a datetime column.`);
775
+ const o = ae.all;
776
+ if (!o.includes(n))
777
+ throw new Error(`Invalid date level "${n}" in attribute "${e}". Valid levels are: ${o.join(", ")}.`);
778
+ }
779
+ return {
780
+ field: a,
781
+ level: n
782
+ };
783
+ }
784
+ function lr(e, t) {
785
+ if (e.startsWith(A)) return {
786
+ isLikelyAttribute: !0,
787
+ suggestion: e
788
+ };
789
+ const r = e.split(".");
790
+ if (r.length === 2) {
791
+ const [s, n] = r, i = t.some((a) => a.name === s && a.columns.some((o) => o.name === n));
792
+ return i ? {
793
+ isLikelyAttribute: i,
794
+ suggestion: `${A}${e}`
795
+ } : {
796
+ isLikelyAttribute: !1
797
+ };
798
+ }
799
+ if (r.length === 3) {
800
+ const [s, n, i] = r, a = t.find((c) => c.name === s);
801
+ if (!a)
802
+ return {
803
+ isLikelyAttribute: !1
804
+ };
805
+ const o = a.columns.find((c) => c.name === n);
806
+ return o ? o.dataType === ie.DATETIME && ae.all.includes(i) ? {
807
+ isLikelyAttribute: !0,
808
+ suggestion: `${A}${e}`
809
+ } : {
810
+ isLikelyAttribute: !1
811
+ } : {
812
+ isLikelyAttribute: !1
813
+ };
778
814
  }
779
815
  return {
780
- field: o,
781
- level: i
816
+ isLikelyAttribute: !1
782
817
  };
783
818
  }
784
- function De(e, t, r) {
785
- const { field: s, level: i } = ar(e, r);
786
- return ut({
819
+ function Fe(e, t, r) {
820
+ const { field: s, level: n } = or(e, r);
821
+ return dt({
787
822
  expression: s.expression,
788
823
  dataType: s.dataType,
789
- granularity: i,
824
+ granularity: n,
790
825
  format: void 0,
791
826
  sort: void 0,
792
827
  dataSource: t
793
828
  });
794
829
  }
795
- function or(e, t, r) {
796
- return typeof e == "object" && e !== null && !Array.isArray(e) && "function" in e && "args" in e ? O(e, t, r) : typeof e == "string" && e.startsWith("DM.") ? De(e, t, r) : e;
830
+ function cr(e, t, r) {
831
+ if (typeof e == "object" && e !== null && !Array.isArray(e) && "function" in e && "args" in e)
832
+ return N(e, t, r);
833
+ if (typeof e == "string") {
834
+ if (e.startsWith(A))
835
+ return Fe(e, t, r);
836
+ const { isLikelyAttribute: s, suggestion: n } = lr(e, r);
837
+ if (s)
838
+ throw new Error(`Invalid attribute format: "${e}". Did you mean "${n}"?`);
839
+ }
840
+ return e;
797
841
  }
798
- function O(e, t, r) {
799
- const { function: s, args: i } = e, n = i.map((o) => or(o, t, r));
800
- return ir(s, n);
842
+ function N(e, t, r) {
843
+ const { function: s, args: n } = e, i = n.map((a) => cr(a, t, r));
844
+ return ir(s, i);
801
845
  }
802
- function Ee(e) {
846
+ function Ce(e) {
803
847
  const { attribute: t, config: r } = e;
804
- if (se(e) && gt(t)) {
848
+ if (ne(e) && yt(t)) {
805
849
  const { granularity: s } = t;
806
- return yt(t, e.members.map((i) => s === "Years" && !isNaN(Number(i)) ? `${i}-01-01T00:00:00` : i), r);
850
+ return bt(t, e.members.map((n) => s === "Years" && !isNaN(Number(n)) ? `${n}-01-01T00:00:00` : n), r);
807
851
  }
808
852
  return e;
809
853
  }
810
- function lr(e) {
854
+ function ur(e) {
811
855
  let t = [];
812
856
  for (const r of e)
813
- Q(r) ? t = X(r, t) : t = X([
814
- Ee(r)
857
+ q(r) ? t = j(r, t) : t = j([
858
+ Ce(r)
815
859
  ], t);
816
860
  return t != null ? t : [];
817
861
  }
818
- const cr = (e, t, r) => {
819
- const s = e.map((i) => {
820
- const n = O(i, t, r);
821
- if (!Q(n) && !K(n))
822
- throw new Error("Invalid filter JSON");
823
- return n;
824
- });
825
- return lr(s);
826
- }, ur = (e, t, r) => {
827
- if (!e)
828
- return [];
829
- if (!U(e))
830
- throw new Error('Invalid filters JSON. Expected an array of function calls with "function" and "args" properties.');
831
- return cr(e, t, r);
832
- }, fr = (e, t, r) => e.map((s) => {
833
- const i = O(s, t, r);
834
- if (!K(i))
835
- throw new Error("Invalid filter JSON");
836
- return Ee(i);
837
- }), mr = (e, t, r) => {
838
- if (!e)
839
- return [];
840
- if (!U(e))
841
- throw new Error('Invalid highlights JSON. Expected an array of function calls with "function" and "args" properties.');
842
- return fr(e, t, r);
862
+ const fr = (e, t, r) => {
863
+ const s = [], n = [];
864
+ return e.forEach((i, a) => {
865
+ try {
866
+ const o = N(i, t, r);
867
+ !q(o) && !Q(o) ? n.push(`Filter ${a + 1} (${i.function}): Invalid filter JSON`) : s.push(o);
868
+ } catch (o) {
869
+ const c = o instanceof Error ? o.message : "Unknown error";
870
+ n.push(`Filter ${a + 1} (${i.function}): ${c}`);
871
+ }
872
+ }), n.length > 0 ? {
873
+ success: !1,
874
+ errors: n
875
+ } : {
876
+ success: !0,
877
+ data: ur(s)
878
+ };
879
+ }, mr = (e, t, r) => e ? K(e) ? fr(e, t, r) : {
880
+ success: !1,
881
+ errors: [
882
+ 'Invalid filters JSON. Expected an array of function calls with "function" and "args" properties.'
883
+ ]
884
+ } : {
885
+ success: !0,
886
+ data: []
887
+ }, dr = (e, t, r) => {
888
+ const s = [], n = [];
889
+ return e.forEach((i, a) => {
890
+ try {
891
+ const o = N(i, t, r);
892
+ Q(o) ? s.push(Ce(o)) : n.push(`Highlight ${a + 1} (${i.function}): Invalid filter JSON`);
893
+ } catch (o) {
894
+ const c = o instanceof Error ? o.message : "Unknown error";
895
+ n.push(`Highlight ${a + 1} (${i.function}): ${c}`);
896
+ }
897
+ }), n.length > 0 ? {
898
+ success: !1,
899
+ errors: n
900
+ } : {
901
+ success: !0,
902
+ data: s
903
+ };
904
+ }, pr = (e, t, r) => e ? K(e) ? dr(e, t, r) : {
905
+ success: !1,
906
+ errors: [
907
+ 'Invalid highlights JSON. Expected an array of function calls with "function" and "args" properties.'
908
+ ]
909
+ } : {
910
+ success: !0,
911
+ data: []
843
912
  };
844
- function dr(e) {
913
+ function gr(e) {
845
914
  return e.every((t) => typeof t == "string");
846
915
  }
847
- const pr = (e, t, r) => {
916
+ const yr = (e, t, r) => {
848
917
  if (!e)
849
- return [];
850
- if (!dr(e))
851
- throw new Error("Invalid dimensions JSON. Expected an array of strings.");
852
- return e.map((s) => De(s, t, r));
853
- }, gr = (e, t, r) => e.map((s) => {
854
- const i = O(s, t, r);
855
- if (!sr(i))
856
- throw new Error("Invalid measure JSON");
857
- return i;
858
- }), yr = (e, t, r) => {
859
- if (!e)
860
- return [];
861
- if (!U(e))
862
- throw new Error('Invalid measures JSON. Expected an array of function calls with "function" and "args" properties.');
863
- return gr(e, t, r);
864
- }, zr = (e, t, r) => y({
865
- dataSource: bt(t),
866
- dimensions: pr(e.dimensions, t, r),
867
- measures: yr(e.measures, t, r),
868
- filters: ur(e.filters, t, r)
869
- }, e.highlights && {
870
- highlights: mr(e.highlights, t, r)
871
- });
872
- function br(e) {
873
- const { filters: t, relations: r } = At(e.filters || []);
918
+ return {
919
+ success: !0,
920
+ data: []
921
+ };
922
+ if (!gr(e))
923
+ return {
924
+ success: !1,
925
+ errors: [
926
+ "Invalid dimensions JSON. Expected an array of strings."
927
+ ]
928
+ };
929
+ const s = [], n = [];
930
+ return e.forEach((i, a) => {
931
+ try {
932
+ const o = Fe(i, t, r);
933
+ s.push(o);
934
+ } catch (o) {
935
+ const c = o instanceof Error ? o.message : "Unknown error";
936
+ n.push(`Dimension ${a + 1} ("${i}"): ${c}`);
937
+ }
938
+ }), n.length > 0 ? {
939
+ success: !1,
940
+ errors: n
941
+ } : {
942
+ success: !0,
943
+ data: s
944
+ };
945
+ }, br = (e, t, r) => {
946
+ const s = [], n = [];
947
+ return e.forEach((i, a) => {
948
+ try {
949
+ const o = N(i, t, r);
950
+ nr(o) ? s.push(o) : n.push(`Measure ${a + 1} (${i.function}): Invalid measure JSON`);
951
+ } catch (o) {
952
+ const c = o instanceof Error ? o.message : "Unknown error";
953
+ n.push(`Measure ${a + 1} (${i.function}): ${c}`);
954
+ }
955
+ }), n.length > 0 ? {
956
+ success: !1,
957
+ errors: n
958
+ } : {
959
+ success: !0,
960
+ data: s
961
+ };
962
+ }, hr = (e, t, r) => e ? K(e) ? br(e, t, r) : {
963
+ success: !1,
964
+ errors: [
965
+ 'Invalid measures JSON. Expected an array of function calls with "function" and "args" properties.'
966
+ ]
967
+ } : {
968
+ success: !0,
969
+ data: []
970
+ };
971
+ function wr(e) {
972
+ const t = {}, r = [];
973
+ for (const s in e) {
974
+ const n = e[`${s}`], i = n();
975
+ if (i.success)
976
+ t[`${s}`] = i.data;
977
+ else {
978
+ const a = i.errors.map((o) => `[${s}] ${o}`);
979
+ r.push(...a);
980
+ }
981
+ }
982
+ return r.length > 0 ? {
983
+ success: !1,
984
+ errors: r
985
+ } : {
986
+ success: !0,
987
+ data: t
988
+ };
989
+ }
990
+ const Rr = (e, t, r) => {
991
+ const s = {
992
+ dimensions: () => yr(e.dimensions || [], t, r),
993
+ measures: () => hr(e.measures || [], t, r),
994
+ filters: () => mr(e.filters || [], t, r)
995
+ };
996
+ e.highlights && (s.highlights = () => pr(e.highlights || [], t, r));
997
+ const n = wr(s);
998
+ if (!n.success) {
999
+ const a = `Translation failed with ${n.errors.length} error(s):
1000
+ ${n.errors.join(`
1001
+ `)}`;
1002
+ throw new Error(a);
1003
+ }
1004
+ return y({
1005
+ dataSource: ht(t)
1006
+ }, n.data);
1007
+ };
1008
+ function Ar(e) {
1009
+ const { filters: t, relations: r } = Et(e.filters || []);
874
1010
  return {
875
1011
  dataSource: e.dataSource,
876
1012
  dimensions: e.dimensions,
@@ -880,18 +1016,18 @@ function br(e) {
880
1016
  highlights: e.highlights
881
1017
  };
882
1018
  }
883
- function Fr(e, t, r = !1) {
884
- const s = br(e), i = wt(s, t);
885
- return ht(i, r);
1019
+ function $r(e, t, r = !1) {
1020
+ const s = Ar(e), n = wt(s, t);
1021
+ return At(n, r);
886
1022
  }
887
1023
  export {
888
- Er as CustomSuperJSON,
889
- Ir as EMPTY_EXPANDED_QUERY_MODEL,
890
- Nr as EMPTY_SIMPLE_QUERY_MODEL,
891
- Tr as isByIdDashboardCodeParams,
892
- Mr as isByIdWidgetCodeParams,
1024
+ Cr as CustomSuperJSON,
1025
+ Mr as EMPTY_EXPANDED_QUERY_MODEL,
1026
+ kr as EMPTY_SIMPLE_QUERY_MODEL,
1027
+ Nr as isByIdDashboardCodeParams,
1028
+ Pr as isByIdWidgetCodeParams,
893
1029
  Or as isClientSideDashboardCodeParams,
894
1030
  Sr as isClientSideWidgetCodeParams,
895
- zr as translateQueryJSON,
896
- Fr as translateQueryToJaql
1031
+ Rr as translateQueryJSON,
1032
+ $r as translateQueryToJaql
897
1033
  };