drizzle-cube 0.4.11 → 0.4.14

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 (116) hide show
  1. package/README.md +1 -0
  2. package/dist/adapters/express/index.cjs +6 -6
  3. package/dist/adapters/express/index.js +73 -72
  4. package/dist/adapters/fastify/index.cjs +5 -5
  5. package/dist/adapters/fastify/index.js +110 -109
  6. package/dist/adapters/{handler-CQkIwtxp.js → handler-DZnCbydH.js} +719 -272
  7. package/dist/adapters/handler-ZDYlokiM.cjs +25 -0
  8. package/dist/adapters/hono/index.cjs +6 -6
  9. package/dist/adapters/hono/index.js +121 -120
  10. package/dist/adapters/nextjs/index.cjs +5 -5
  11. package/dist/adapters/nextjs/index.js +92 -91
  12. package/dist/client/charts.js +67 -59
  13. package/dist/client/charts.js.map +1 -1
  14. package/dist/client/chunks/{RetentionCombinedChart-CEI8KQ3t.js → RetentionCombinedChart-CLq89aOJ.js} +2 -2
  15. package/dist/client/chunks/{RetentionCombinedChart-CEI8KQ3t.js.map → RetentionCombinedChart-CLq89aOJ.js.map} +1 -1
  16. package/dist/client/chunks/{analysis-builder-BMmWeFPr.js → analysis-builder-C5e52Z3p.js} +419 -411
  17. package/dist/client/chunks/analysis-builder-C5e52Z3p.js.map +1 -0
  18. package/dist/client/chunks/{analysis-builder-shared-D56zYeV0.js → analysis-builder-shared-EnM-8plh.js} +2 -2
  19. package/dist/client/chunks/{analysis-builder-shared-D56zYeV0.js.map → analysis-builder-shared-EnM-8plh.js.map} +1 -1
  20. package/dist/client/chunks/{chart-activity-grid-CE7xGFQo.js → chart-activity-grid-CPGcTSuh.js} +2 -2
  21. package/dist/client/chunks/{chart-activity-grid-CE7xGFQo.js.map → chart-activity-grid-CPGcTSuh.js.map} +1 -1
  22. package/dist/client/chunks/{chart-area-BJAgusst.js → chart-area-ByJQ7NZd.js} +3 -3
  23. package/dist/client/chunks/{chart-area-BJAgusst.js.map → chart-area-ByJQ7NZd.js.map} +1 -1
  24. package/dist/client/chunks/{chart-bar-Blypx8O4.js → chart-bar-dj14frMt.js} +2 -2
  25. package/dist/client/chunks/{chart-bar-Blypx8O4.js.map → chart-bar-dj14frMt.js.map} +1 -1
  26. package/dist/client/chunks/chart-box-plot-ZatBpatq.js +322 -0
  27. package/dist/client/chunks/chart-box-plot-ZatBpatq.js.map +1 -0
  28. package/dist/client/chunks/{chart-bubble-Bf42A1-B.js → chart-bubble-CemotLx-.js} +2 -2
  29. package/dist/client/chunks/{chart-bubble-Bf42A1-B.js.map → chart-bubble-CemotLx-.js.map} +1 -1
  30. package/dist/client/chunks/chart-candlestick-BIR4uGGt.js +269 -0
  31. package/dist/client/chunks/chart-candlestick-BIR4uGGt.js.map +1 -0
  32. package/dist/client/chunks/chart-config-box-plot-D_E_SSc2.js +38 -0
  33. package/dist/client/chunks/chart-config-box-plot-D_E_SSc2.js.map +1 -0
  34. package/dist/client/chunks/chart-config-candlestick-CRCpD43-.js +70 -0
  35. package/dist/client/chunks/chart-config-candlestick-CRCpD43-.js.map +1 -0
  36. package/dist/client/chunks/chart-config-gauge-CQx9w3d4.js +64 -0
  37. package/dist/client/chunks/chart-config-gauge-CQx9w3d4.js.map +1 -0
  38. package/dist/client/chunks/chart-config-measure-profile-ZYaMrtws.js +70 -0
  39. package/dist/client/chunks/chart-config-measure-profile-ZYaMrtws.js.map +1 -0
  40. package/dist/client/chunks/chart-config-waterfall-DTyXV_fo.js +60 -0
  41. package/dist/client/chunks/chart-config-waterfall-DTyXV_fo.js.map +1 -0
  42. package/dist/client/chunks/{chart-data-table-Ba_6tuJw.js → chart-data-table-D5G8nMnb.js} +2 -2
  43. package/dist/client/chunks/{chart-data-table-Ba_6tuJw.js.map → chart-data-table-D5G8nMnb.js.map} +1 -1
  44. package/dist/client/chunks/{chart-funnel-C9kenCpp.js → chart-funnel-dofnhD24.js} +2 -2
  45. package/dist/client/chunks/{chart-funnel-C9kenCpp.js.map → chart-funnel-dofnhD24.js.map} +1 -1
  46. package/dist/client/chunks/chart-gauge-CKJJ8m3b.js +374 -0
  47. package/dist/client/chunks/chart-gauge-CKJJ8m3b.js.map +1 -0
  48. package/dist/client/chunks/{chart-heat-map-CYGemyPB.js → chart-heat-map-BVuPUKHT.js} +2 -2
  49. package/dist/client/chunks/{chart-heat-map-CYGemyPB.js.map → chart-heat-map-BVuPUKHT.js.map} +1 -1
  50. package/dist/client/chunks/{chart-kpi-delta-D9XJoKuA.js → chart-kpi-delta-Dgg2eYRl.js} +3 -3
  51. package/dist/client/chunks/{chart-kpi-delta-D9XJoKuA.js.map → chart-kpi-delta-Dgg2eYRl.js.map} +1 -1
  52. package/dist/client/chunks/{chart-kpi-number-C29Vj2g8.js → chart-kpi-number-DkoO99c1.js} +2 -2
  53. package/dist/client/chunks/{chart-kpi-number-C29Vj2g8.js.map → chart-kpi-number-DkoO99c1.js.map} +1 -1
  54. package/dist/client/chunks/{chart-kpi-text-CgjjrurK.js → chart-kpi-text-1O6_lmz7.js} +3 -3
  55. package/dist/client/chunks/{chart-kpi-text-CgjjrurK.js.map → chart-kpi-text-1O6_lmz7.js.map} +1 -1
  56. package/dist/client/chunks/{chart-line-zi6olZet.js → chart-line-DzyZkugh.js} +3 -3
  57. package/dist/client/chunks/{chart-line-zi6olZet.js.map → chart-line-DzyZkugh.js.map} +1 -1
  58. package/dist/client/chunks/chart-measure-profile-C2IkBG3V.js +114 -0
  59. package/dist/client/chunks/chart-measure-profile-C2IkBG3V.js.map +1 -0
  60. package/dist/client/chunks/{chart-pie-C4SuxKSN.js → chart-pie-akbfRfb9.js} +2 -2
  61. package/dist/client/chunks/{chart-pie-C4SuxKSN.js.map → chart-pie-akbfRfb9.js.map} +1 -1
  62. package/dist/client/chunks/{chart-radar-BW3Z_-Ly.js → chart-radar-BaN-Kjww.js} +2 -2
  63. package/dist/client/chunks/{chart-radar-BW3Z_-Ly.js.map → chart-radar-BaN-Kjww.js.map} +1 -1
  64. package/dist/client/chunks/{chart-radial-bar-0Fa3aeP5.js → chart-radial-bar-DpptEL3s.js} +2 -2
  65. package/dist/client/chunks/{chart-radial-bar-0Fa3aeP5.js.map → chart-radial-bar-DpptEL3s.js.map} +1 -1
  66. package/dist/client/chunks/{chart-sankey-DBghfbg1.js → chart-sankey-CG-3hHmX.js} +2 -2
  67. package/dist/client/chunks/{chart-sankey-DBghfbg1.js.map → chart-sankey-CG-3hHmX.js.map} +1 -1
  68. package/dist/client/chunks/{chart-scatter-DOVu1TNq.js → chart-scatter-l_yTVxF3.js} +2 -2
  69. package/dist/client/chunks/{chart-scatter-DOVu1TNq.js.map → chart-scatter-l_yTVxF3.js.map} +1 -1
  70. package/dist/client/chunks/{chart-sunburst-LfNthFlZ.js → chart-sunburst-KhDcKhmZ.js} +2 -2
  71. package/dist/client/chunks/{chart-sunburst-LfNthFlZ.js.map → chart-sunburst-KhDcKhmZ.js.map} +1 -1
  72. package/dist/client/chunks/{chart-tree-map-DZtQPyWX.js → chart-tree-map-CBbiaBXV.js} +2 -2
  73. package/dist/client/chunks/{chart-tree-map-DZtQPyWX.js.map → chart-tree-map-CBbiaBXV.js.map} +1 -1
  74. package/dist/client/chunks/chart-waterfall-CX3vx_lI.js +191 -0
  75. package/dist/client/chunks/chart-waterfall-CX3vx_lI.js.map +1 -0
  76. package/dist/client/chunks/{charts-core-DmGfleFz.js → charts-core-CU9u_HtL.js} +2 -1
  77. package/dist/client/chunks/charts-core-CU9u_HtL.js.map +1 -0
  78. package/dist/client/chunks/{charts-loader-CH0_S06T.js → charts-loader-AW3T1nv5.js} +58 -42
  79. package/dist/client/chunks/charts-loader-AW3T1nv5.js.map +1 -0
  80. package/dist/client/chunks/{components-ClQziOcT.js → components-BkeSy9xv.js} +4 -4
  81. package/dist/client/chunks/components-BkeSy9xv.js.map +1 -0
  82. package/dist/client/components/AgenticNotebook/AgentChatPanel.d.ts +10 -0
  83. package/dist/client/components/AgenticNotebook/ChatMessage.d.ts +2 -0
  84. package/dist/client/components/AgenticNotebook/index.d.ts +11 -1
  85. package/dist/client/components/LoadingIndicator.d.ts +2 -2
  86. package/dist/client/components/charts/BoxPlotChart.config.d.ts +1 -7
  87. package/dist/client/components/charts/CandlestickChart.config.d.ts +5 -0
  88. package/dist/client/components/charts/CandlestickChart.d.ts +4 -0
  89. package/dist/client/components/charts/GaugeChart.config.d.ts +5 -0
  90. package/dist/client/components/charts/GaugeChart.d.ts +4 -0
  91. package/dist/client/components/charts/MeasureProfileChart.config.d.ts +5 -0
  92. package/dist/client/components/charts/MeasureProfileChart.d.ts +4 -0
  93. package/dist/client/components/charts/WaterfallChart.config.d.ts +5 -0
  94. package/dist/client/components/charts/WaterfallChart.d.ts +4 -0
  95. package/dist/client/components/charts/index.d.ts +4 -0
  96. package/dist/client/components.js +1 -1
  97. package/dist/client/hooks/useAgentChat.d.ts +20 -2
  98. package/dist/client/index.js +685 -612
  99. package/dist/client/index.js.map +1 -1
  100. package/dist/client/styles.css +1 -1
  101. package/dist/client/types.d.ts +19 -1
  102. package/dist/client/utils.js +4 -4
  103. package/dist/client-bundle-stats.html +1 -1
  104. package/dist/server/index.cjs +47 -45
  105. package/dist/server/index.d.ts +37 -0
  106. package/dist/server/index.js +1745 -1298
  107. package/package.json +4 -1
  108. package/dist/adapters/handler-dnkqpznh.cjs +0 -23
  109. package/dist/client/chunks/analysis-builder-BMmWeFPr.js.map +0 -1
  110. package/dist/client/chunks/chart-box-plot-Dja4LS3O.js +0 -313
  111. package/dist/client/chunks/chart-box-plot-Dja4LS3O.js.map +0 -1
  112. package/dist/client/chunks/chart-config-box-plot-D3DA7_pr.js +0 -85
  113. package/dist/client/chunks/chart-config-box-plot-D3DA7_pr.js.map +0 -1
  114. package/dist/client/chunks/charts-core-DmGfleFz.js.map +0 -1
  115. package/dist/client/chunks/charts-loader-CH0_S06T.js.map +0 -1
  116. package/dist/client/chunks/components-ClQziOcT.js.map +0 -1
@@ -1,12 +1,12 @@
1
1
  import { jsxs as t, jsx as e, Fragment as ie } from "react/jsx-runtime";
2
- import { useState as _, useCallback as F, memo as me, useEffect as Y, useRef as Z, useMemo as z, Component as xd, forwardRef as Qc, useImperativeHandle as bd } from "react";
3
- import { u as gd, g as yd } from "./providers-CgxXm6Ll.js";
4
- import { F as vd, E as ac, C as Ct, D as Nd, G as wd, q as Cd, H as Sd, u as Dd, I as kd } from "./analysis-builder-shared-D56zYeV0.js";
5
- import { a0 as Wt, a1 as Td, h as $d, a6 as Ad, $ as Ce, a7 as Gc, a8 as _c, a9 as Hc, aa as Id, ab as St } from "./components-ClQziOcT.js";
6
- import { i as Rd, L as ic } from "./charts-loader-CH0_S06T.js";
2
+ import { useState as _, useCallback as F, memo as me, useEffect as Y, useRef as Z, useMemo as z, Component as xd, forwardRef as Qc, useImperativeHandle as gd } from "react";
3
+ import { u as bd, g as yd } from "./providers-CgxXm6Ll.js";
4
+ import { F as vd, E as ac, C as Ct, D as Nd, G as wd, q as Cd, H as Sd, u as Dd, I as kd } from "./analysis-builder-shared-EnM-8plh.js";
5
+ import { a0 as Wt, a1 as Td, h as $d, a6 as Ad, $ as Ce, a7 as Gc, a8 as _c, a9 as Hc, aa as Id, ab as St } from "./components-BkeSy9xv.js";
6
+ import { i as Rd, L as ic } from "./charts-loader-AW3T1nv5.js";
7
7
  import { useExplainQuery as mt, useExplainAI as Fd } from "../hooks.js";
8
8
  import { a as $, g as nc, h as oc } from "./icons-DAeqv1iX.js";
9
- import { S as ue } from "./charts-core-DmGfleFz.js";
9
+ import { S as ue } from "./charts-core-CU9u_HtL.js";
10
10
  import { p as Ed, q as Od, r as Ld, D as Ut, s as ht, n as Ve, F as Kc } from "./useDirtyStateTracking-Cu1HSjmo.js";
11
11
  import { barChartConfig as Bd } from "./chart-config-bar-C8uzktxl.js";
12
12
  import { lineChartConfig as Pd } from "./chart-config-line-JNagi9tf.js";
@@ -29,14 +29,18 @@ import { sunburstChartConfig as Zd } from "./chart-config-sunburst-BmC0NLTU.js";
29
29
  import { heatmapChartConfig as en } from "./chart-config-heat-map-_wEnTnRA.js";
30
30
  import { retentionHeatmapConfig as tn } from "./RetentionHeatmap.config-BWf_-vdj.js";
31
31
  import { retentionCombinedConfig as cn } from "./RetentionCombinedChart.config-Bbp2ghim.js";
32
- import { boxPlotChartConfig as dn } from "./chart-config-box-plot-D3DA7_pr.js";
33
- import { useChartConfig as nn } from "../charts.js";
32
+ import { boxPlotChartConfig as dn } from "./chart-config-box-plot-D_E_SSc2.js";
33
+ import { waterfallChartConfig as nn } from "./chart-config-waterfall-DTyXV_fo.js";
34
+ import { candlestickChartConfig as rn } from "./chart-config-candlestick-CRCpD43-.js";
35
+ import { measureProfileChartConfig as sn } from "./chart-config-measure-profile-ZYaMrtws.js";
36
+ import { gaugeChartConfig as an } from "./chart-config-gauge-CQx9w3d4.js";
37
+ import { useChartConfig as on } from "../charts.js";
34
38
  import { b as lc, F as uc } from "./flow-utils-CjQZG5qq.js";
35
- import { b as mc, g as rn, c as hc, e as sn, R as fc, a as pc, f as an } from "./retention-CzCo8262.js";
39
+ import { b as mc, g as ln, c as hc, e as un, R as fc, a as pc, f as mn } from "./retention-CzCo8262.js";
36
40
  function ft(r) {
37
41
  return r.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/_/g, " ").replace(/\b\w/g, (d) => d.toUpperCase());
38
42
  }
39
- function on(r) {
43
+ function hn(r) {
40
44
  switch (r) {
41
45
  case "most_dimensions":
42
46
  return "bg-dc-info-bg text-dc-info";
@@ -50,8 +54,8 @@ function on(r) {
50
54
  return "bg-dc-muted-bg text-dc-muted";
51
55
  }
52
56
  }
53
- const ln = ({ analysis: r }) => {
54
- const d = $("info"), i = $("chevronRight"), s = $("warning"), m = $("table"), n = $("link"), x = $("success"), g = $("error"), o = [
57
+ const fn = ({ analysis: r }) => {
58
+ const d = $("info"), i = $("chevronRight"), s = $("warning"), m = $("table"), n = $("link"), x = $("success"), b = $("error"), o = [
55
59
  {
56
60
  label: "Type",
57
61
  value: ft(r.querySummary.queryType)
@@ -104,7 +108,7 @@ const ln = ({ analysis: r }) => {
104
108
  /* @__PURE__ */ t("div", { className: "bg-dc-surface dc:p-3 dc:rounded dc:text-sm", children: [
105
109
  /* @__PURE__ */ t("div", { className: "dc:flex dc:items-center dc:gap-2 dc:mb-2 dc:flex-wrap", children: [
106
110
  /* @__PURE__ */ e("span", { className: "dc:font-mono dc:font-medium text-dc-primary", children: r.primaryCube.selectedCube }),
107
- /* @__PURE__ */ e("span", { className: `dc:text-xs dc:px-2 dc:py-0.5 dc:rounded ${on(r.primaryCube.reason)}`, children: ft(r.primaryCube.reason) })
111
+ /* @__PURE__ */ e("span", { className: `dc:text-xs dc:px-2 dc:py-0.5 dc:rounded ${hn(r.primaryCube.reason)}`, children: ft(r.primaryCube.reason) })
108
112
  ] }),
109
113
  /* @__PURE__ */ e("p", { className: "text-dc-text-secondary dc:text-xs", children: r.primaryCube.explanation }),
110
114
  r.primaryCube.candidates && r.primaryCube.candidates.length > 1 && /* @__PURE__ */ t("details", { className: "dc:mt-2", children: [
@@ -113,7 +117,7 @@ const ln = ({ analysis: r }) => {
113
117
  r.primaryCube.candidates.length,
114
118
  ")"
115
119
  ] }),
116
- /* @__PURE__ */ e("div", { className: "dc:mt-2 dc:space-y-1 dc:ml-2", children: r.primaryCube.candidates.map((l, b) => /* @__PURE__ */ t("div", { className: "dc:text-xs dc:flex dc:items-center dc:gap-2 dc:flex-wrap", children: [
120
+ /* @__PURE__ */ e("div", { className: "dc:mt-2 dc:space-y-1 dc:ml-2", children: r.primaryCube.candidates.map((l, g) => /* @__PURE__ */ t("div", { className: "dc:text-xs dc:flex dc:items-center dc:gap-2 dc:flex-wrap", children: [
117
121
  /* @__PURE__ */ e("span", { className: `dc:font-mono ${l.cubeName === r.primaryCube.selectedCube ? "dc:font-bold text-dc-primary" : "text-dc-text-muted"}`, children: l.cubeName }),
118
122
  /* @__PURE__ */ t("span", { className: "text-dc-text-muted", children: [
119
123
  "dims: ",
@@ -125,10 +129,10 @@ const ln = ({ analysis: r }) => {
125
129
  /* @__PURE__ */ e(x, { className: "dc:w-3 dc:h-3" }),
126
130
  "reachable"
127
131
  ] }) : /* @__PURE__ */ t("span", { className: "text-dc-error dc:flex dc:items-center dc:gap-0.5", children: [
128
- /* @__PURE__ */ e(g, { className: "dc:w-3 dc:h-3" }),
132
+ /* @__PURE__ */ e(b, { className: "dc:w-3 dc:h-3" }),
129
133
  "cannot reach all"
130
134
  ] })
131
- ] }, b)) })
135
+ ] }, g)) })
132
136
  ] })
133
137
  ] })
134
138
  ] }),
@@ -137,7 +141,7 @@ const ln = ({ analysis: r }) => {
137
141
  /* @__PURE__ */ e(n, { className: "dc:w-4 dc:h-4 dc:mr-2" }),
138
142
  "Join Paths"
139
143
  ] }),
140
- /* @__PURE__ */ e("div", { className: "dc:space-y-2", children: r.joinPaths.map((l, b) => /* @__PURE__ */ t("div", { className: "bg-dc-surface dc:p-3 dc:rounded dc:text-sm", children: [
144
+ /* @__PURE__ */ e("div", { className: "dc:space-y-2", children: r.joinPaths.map((l, g) => /* @__PURE__ */ t("div", { className: "bg-dc-surface dc:p-3 dc:rounded dc:text-sm", children: [
141
145
  /* @__PURE__ */ t("div", { className: "dc:flex dc:items-center dc:gap-2 dc:mb-2 dc:flex-wrap", children: [
142
146
  /* @__PURE__ */ e("span", { className: "dc:font-mono text-dc-text-secondary", children: r.primaryCube.selectedCube }),
143
147
  /* @__PURE__ */ e(i, { className: "dc:w-4 dc:h-4 text-dc-text-muted" }),
@@ -198,14 +202,14 @@ const ln = ({ analysis: r }) => {
198
202
  ] }),
199
203
  /* @__PURE__ */ e("div", { className: "dc:mt-1 dc:text-xs text-dc-text-muted dc:ml-2", children: l.visitedCubes.join(" → ") })
200
204
  ] })
201
- ] }, b)) })
205
+ ] }, g)) })
202
206
  ] }),
203
207
  r.preAggregations.length > 0 && /* @__PURE__ */ t("div", { className: "dc:border-b border-dc-border dc:pb-3", children: [
204
208
  /* @__PURE__ */ t("h4", { className: "dc:text-sm dc:font-semibold text-dc-text dc:mb-2 dc:flex dc:items-center", children: [
205
209
  /* @__PURE__ */ e(m, { className: "dc:w-4 dc:h-4 dc:mr-2" }),
206
210
  "Pre-Aggregation CTEs"
207
211
  ] }),
208
- /* @__PURE__ */ e("div", { className: "dc:space-y-2", children: r.preAggregations.map((l, b) => /* @__PURE__ */ t("div", { className: "bg-dc-surface dc:p-3 dc:rounded dc:text-sm", children: [
212
+ /* @__PURE__ */ e("div", { className: "dc:space-y-2", children: r.preAggregations.map((l, g) => /* @__PURE__ */ t("div", { className: "bg-dc-surface dc:p-3 dc:rounded dc:text-sm", children: [
209
213
  /* @__PURE__ */ t("div", { className: "dc:flex dc:items-center dc:gap-2 dc:mb-1 dc:flex-wrap", children: [
210
214
  /* @__PURE__ */ e("span", { className: "dc:font-mono dc:font-medium text-dc-text", children: l.cubeName }),
211
215
  /* @__PURE__ */ e("span", { className: "dc:text-xs text-dc-text-muted", children: "as" }),
@@ -222,14 +226,14 @@ const ln = ({ analysis: r }) => {
222
226
  " ",
223
227
  l.joinKeys.map((c) => `${c.sourceColumn}=${c.targetColumn}`).join(", ")
224
228
  ] })
225
- ] }, b)) })
229
+ ] }, g)) })
226
230
  ] }),
227
231
  r.warnings && r.warnings.length > 0 && /* @__PURE__ */ t("div", { children: [
228
232
  /* @__PURE__ */ t("h4", { className: "dc:text-sm dc:font-semibold text-dc-warning dc:mb-2 dc:flex dc:items-center", children: [
229
233
  /* @__PURE__ */ e(s, { className: "dc:w-4 dc:h-4 dc:mr-2" }),
230
234
  "Warnings"
231
235
  ] }),
232
- /* @__PURE__ */ e("ul", { className: "list-disc dc:list-inside dc:text-xs text-dc-warning dc:space-y-1", children: r.warnings.map((l, b) => /* @__PURE__ */ e("li", { children: l }, b)) })
236
+ /* @__PURE__ */ e("ul", { className: "list-disc dc:list-inside dc:text-xs text-dc-warning dc:space-y-1", children: r.warnings.map((l, g) => /* @__PURE__ */ e("li", { children: l }, g)) })
233
237
  ] }),
234
238
  r.cubesInvolved.length > 0 && /* @__PURE__ */ t("div", { className: "dc:text-xs text-dc-text-muted dc:pt-2 dc:border-t border-dc-border", children: [
235
239
  /* @__PURE__ */ e("span", { className: "dc:font-medium", children: "Cubes involved:" }),
@@ -238,7 +242,7 @@ const ln = ({ analysis: r }) => {
238
242
  ] })
239
243
  ] });
240
244
  };
241
- async function un(r, d, i = "/api/ai/generate") {
245
+ async function pn(r, d, i = "/api/ai/generate") {
242
246
  const s = {
243
247
  text: d
244
248
  // Send only the user's prompt, server handles system prompt
@@ -252,7 +256,7 @@ async function un(r, d, i = "/api/ai/generate") {
252
256
  body: JSON.stringify(s)
253
257
  });
254
258
  if (console.log("📥 Client: Proxy response"), console.log(" Status:", n.status), console.log(" Status Text:", n.statusText), !n.ok) {
255
- let g = `Failed to generate content: ${n.status} ${n.statusText}`;
259
+ let b = `Failed to generate content: ${n.status} ${n.statusText}`;
256
260
  try {
257
261
  const o = await n.json();
258
262
  if (console.error("❌ Client: Proxy error:", o), n.status === 429 && o.error === "Daily quota exceeded")
@@ -261,29 +265,29 @@ async function un(r, d, i = "/api/ai/generate") {
261
265
 
262
266
  ${o.suggestion || "Add your own Gemini API key for unlimited access."}`
263
267
  );
264
- o.error && (g = o.message || o.error, o.suggestion && (g += `
268
+ o.error && (b = o.message || o.error, o.suggestion && (b += `
265
269
 
266
270
  💡 ${o.suggestion}`));
267
271
  } catch {
268
272
  try {
269
273
  const o = await n.text();
270
- console.error("❌ Client: Proxy text error:", o), g = o || g;
274
+ console.error("❌ Client: Proxy text error:", o), b = o || b;
271
275
  } catch {
272
276
  console.error("❌ Client: Could not parse error response");
273
277
  }
274
278
  }
275
- throw new Error(g);
279
+ throw new Error(b);
276
280
  }
277
281
  const x = await n.json();
278
282
  return console.log("✅ Client: Successfully generated content"), x;
279
283
  }
280
- function mn(r) {
284
+ function xn(r) {
281
285
  return (r.query || "").replace(/```json\s*/g, "").replace(/```\s*/g, "").replace(/^\s*```.*\n/gm, "").trim();
282
286
  }
283
- function hn(r) {
287
+ function gn(r) {
284
288
  return typeof r == "object" && r !== null && "funnel" in r && typeof r.funnel == "object";
285
289
  }
286
- function fn({
290
+ function bn({
287
291
  state: r,
288
292
  setState: d,
289
293
  chartType: i,
@@ -291,10 +295,10 @@ function fn({
291
295
  chartConfig: m,
292
296
  setChartConfig: n,
293
297
  displayConfig: x,
294
- setDisplayConfig: g,
298
+ setDisplayConfig: b,
295
299
  setUserManuallySelectedChart: o,
296
300
  setActiveView: l,
297
- aiEndpoint: b = "/api/ai",
301
+ aiEndpoint: g = "/api/ai",
298
302
  analysisType: c,
299
303
  setAnalysisType: h,
300
304
  loadFunnelFromServerQuery: N,
@@ -342,13 +346,13 @@ function fn({
342
346
  if (A.userPrompt.trim()) {
343
347
  B((p) => ({ ...p, isGenerating: !0, error: null }));
344
348
  try {
345
- const p = await un(
349
+ const p = await pn(
346
350
  "",
347
351
  // API key not needed for server-side AI
348
352
  A.userPrompt,
349
- b
350
- ), L = mn(p), P = JSON.parse(L), S = "query" in P && P.query ? P.query : P, v = "chartType" in P ? P.chartType : void 0, T = "chartConfig" in P ? P.chartConfig : void 0;
351
- if (hn(S))
353
+ g
354
+ ), L = xn(p), P = JSON.parse(L), S = "query" in P && P.query ? P.query : P, v = "chartType" in P ? P.chartType : void 0, T = "chartConfig" in P ? P.chartConfig : void 0;
355
+ if (gn(S))
352
356
  if (h && N) {
353
357
  h("funnel"), N(S), s("funnel"), o(!0), T && n(T), l("chart"), B((M) => ({
354
358
  ...M,
@@ -393,7 +397,7 @@ function fn({
393
397
  }));
394
398
  }
395
399
  }
396
- }, [A.userPrompt, b, d, s, o, n, l, c, h, N]), w = F(() => {
400
+ }, [A.userPrompt, g, d, s, o, n, l, c, h, N]), w = F(() => {
397
401
  B({
398
402
  isOpen: !1,
399
403
  userPrompt: "",
@@ -409,7 +413,7 @@ function fn({
409
413
  metrics: A.previousState.metrics,
410
414
  breakdowns: A.previousState.breakdowns,
411
415
  filters: A.previousState.filters
412
- })), s(A.previousState.chartType), n(A.previousState.chartConfig), g(A.previousState.displayConfig), h && A.previousState.analysisType && h(A.previousState.analysisType)), B({
416
+ })), s(A.previousState.chartType), n(A.previousState.chartConfig), b(A.previousState.displayConfig), h && A.previousState.analysisType && h(A.previousState.analysisType)), B({
413
417
  isOpen: !1,
414
418
  userPrompt: "",
415
419
  isGenerating: !1,
@@ -418,7 +422,7 @@ function fn({
418
422
  previousState: null,
419
423
  previousConfig: null
420
424
  });
421
- }, [A.previousState, A.previousConfig, d, s, n, g, h, R]);
425
+ }, [A.previousState, A.previousConfig, d, s, n, b, h, R]);
422
426
  return {
423
427
  aiState: A,
424
428
  handleOpenAI: u,
@@ -429,13 +433,13 @@ function fn({
429
433
  handleCancelAI: D
430
434
  };
431
435
  }
432
- function pn({
436
+ function yn({
433
437
  isValidQuery: r,
434
438
  getAnalysisConfig: d
435
439
  }) {
436
440
  const [i, s] = _("idle"), m = F(async () => {
437
441
  if (!r) return;
438
- const n = d(), { encoded: x, queryOnly: g } = vd(n);
442
+ const n = d(), { encoded: x, queryOnly: b } = vd(n);
439
443
  if (!x)
440
444
  return;
441
445
  const o = `${window.location.origin}${window.location.pathname}#share=${x}`;
@@ -445,7 +449,7 @@ function pn({
445
449
  const l = document.createElement("textarea");
446
450
  l.value = o, document.body.appendChild(l), l.select(), document.execCommand("copy"), document.body.removeChild(l);
447
451
  }
448
- s(g ? "copied-no-chart" : "copied"), setTimeout(() => {
452
+ s(b ? "copied-no-chart" : "copied"), setTimeout(() => {
449
453
  s("idle");
450
454
  }, 2e3);
451
455
  }, [r, d]);
@@ -454,7 +458,7 @@ function pn({
454
458
  handleShare: m
455
459
  };
456
460
  }
457
- function xn(r, d, i) {
461
+ function vn(r, d, i) {
458
462
  const s = [];
459
463
  if (s.push("# Query Execution Plan"), s.push(""), d && (s.push("## Cube Query"), s.push(""), s.push("```json"), s.push(JSON.stringify(d, null, 2)), s.push("```"), s.push("")), s.push("## Query Summary"), s.push(""), s.push(`- **Cubes:** ${r.cubesInvolved.join(", ")}`), s.push(`- **Query Type:** ${r.querySummary.queryType.replace(/_/g, " ")}`), s.push(`- **Joins:** ${r.querySummary.joinCount}`), s.push(`- **CTEs:** ${r.querySummary.cteCount}`), s.push(""), s.push("## Primary Cube Selection"), s.push(""), s.push(`**Selected:** ${r.primaryCube.selectedCube}`), s.push(`**Reason:** ${r.primaryCube.reason.replace(/_/g, " ")}`), s.push(`**Explanation:** ${r.primaryCube.explanation}`), s.push(""), r.primaryCube.candidates && r.primaryCube.candidates.length > 1) {
460
464
  s.push("### Candidates Considered"), s.push(""), s.push("| Cube | Dimensions | Joins | Can Reach All |"), s.push("|------|------------|-------|---------------|");
@@ -472,7 +476,7 @@ function xn(r, d, i) {
472
476
  if (s.push(`**Selection strategy:** ${m.selection.strategy}`), typeof m.selection.selectedRank == "number" && s.push(`**Selected rank:** #${m.selection.selectedRank}`), typeof m.selection.selectedScore == "number" && s.push(`**Selected score:** ${m.selection.selectedScore}`), m.selection.preferredCubes && m.selection.preferredCubes.length > 0 && s.push(`**Preferred cubes:** ${m.selection.preferredCubes.join(", ")}`), m.selection.candidates && m.selection.candidates.length > 0) {
473
477
  s.push("**Path scoring candidates:**");
474
478
  for (const n of m.selection.candidates.slice(0, 5)) {
475
- const x = n.path.length > 0 ? `${n.path[0].fromCube} → ${n.path.map((g) => g.toCube).join(" → ")}` : r.primaryCube.selectedCube;
479
+ const x = n.path.length > 0 ? `${n.path[0].fromCube} → ${n.path.map((b) => b.toCube).join(" → ")}` : r.primaryCube.selectedCube;
476
480
  s.push(
477
481
  `- #${n.rank} score=${n.score} (preferredJoin=${n.scoreBreakdown.preferredJoinBonus}, preferredCube=${n.scoreBreakdown.preferredCubeBonus}, lengthPenalty=${n.scoreBreakdown.lengthPenalty}) ${x}`
478
482
  );
@@ -508,17 +512,17 @@ function xn(r, d, i) {
508
512
  return i?.sql && (s.push("## Generated SQL"), s.push(""), s.push("```sql"), s.push(i.sql), s.push("```")), s.join(`
509
513
  `);
510
514
  }
511
- const bn = me(function({
515
+ const Nn = me(function({
512
516
  executionStatus: d,
513
517
  executionResults: i,
514
518
  executionError: s,
515
519
  totalRowCount: m,
516
520
  resultsStale: n = !1,
517
521
  chartType: x = "line",
518
- chartConfig: g = {},
522
+ chartConfig: b = {},
519
523
  displayConfig: o = {},
520
524
  colorPalette: l,
521
- currentPaletteName: b,
525
+ currentPaletteName: g,
522
526
  onColorPaletteChange: c,
523
527
  allQueries: h,
524
528
  funnelExecutedQueries: N,
@@ -568,7 +572,7 @@ const bn = me(function({
568
572
  // Query warnings from server
569
573
  warnings: we
570
574
  }) {
571
- const ae = ee === "funnel" || pe, fe = ee === "flow", he = ee === "retention", [be, Ie] = _(!1), [ge, Ae] = _(0), [Re, Se] = _(!1), [Ye, Pe] = _(!1), [O, Q] = _(!1), [J, ce] = _("idle");
575
+ const ae = ee === "funnel" || pe, fe = ee === "flow", he = ee === "retention", [ge, Ie] = _(!1), [be, Ae] = _(0), [Re, Se] = _(!1), [Ye, Pe] = _(!1), [O, Q] = _(!1), [J, ce] = _("idle");
572
576
  Y(() => {
573
577
  const C = (H) => {
574
578
  H.key === "Shift" && Pe(!0);
@@ -581,16 +585,16 @@ const bn = me(function({
581
585
  }, []);
582
586
  const xe = Ye && O;
583
587
  Y(() => {
584
- a.length > 0 && ge >= a.length && Ae(a.length - 1);
585
- }, [a.length, ge]);
586
- const De = a[ge] || {
588
+ a.length > 0 && be >= a.length && Ae(a.length - 1);
589
+ }, [a.length, be]);
590
+ const De = a[be] || {
587
591
  sql: null,
588
592
  analysis: null,
589
593
  loading: !1,
590
594
  error: null
591
- }, ke = De.sql, Te = De.analysis, Me = De.loading, qe = De.error, ye = N?.[ge] ?? h?.[ge] ?? null, je = !!(N?.length && N[ge]), Je = F(() => {
595
+ }, ke = De.sql, Te = De.analysis, Me = De.loading, qe = De.error, ye = N?.[be] ?? h?.[be] ?? null, je = !!(N?.length && N[be]), Je = F(() => {
592
596
  if (!Te) return;
593
- const C = xn(Te, ye, ke);
597
+ const C = vn(Te, ye, ke);
594
598
  navigator.clipboard.writeText(C).then(() => {
595
599
  ce("copied"), setTimeout(() => ce("idle"), 2e3);
596
600
  });
@@ -639,7 +643,7 @@ const bn = me(function({
639
643
  } = Fd();
640
644
  Y(() => {
641
645
  Xe();
642
- }, [ge, Xe]), Y(() => {
646
+ }, [be, Xe]), Y(() => {
643
647
  Ze();
644
648
  }, [W, Ze]), Y(() => {
645
649
  et();
@@ -672,7 +676,7 @@ const bn = me(function({
672
676
  /* @__PURE__ */ e("div", { className: "dc:text-xs text-dc-text-muted", children: "Running your query against the cube API" })
673
677
  ] }) }), Ne = () => /* @__PURE__ */ t("div", { className: "dc:h-full dc:flex dc:flex-col", children: [
674
678
  Jt(),
675
- /* @__PURE__ */ e("div", { className: "dc:flex-1 dc:flex dc:items-center dc:justify-center dc:p-4", children: be ? /* @__PURE__ */ e("div", { className: "dc:w-full dc:h-full dc:overflow-auto", children: Yt() }) : /* @__PURE__ */ t("div", { className: "dc:text-center dc:max-w-md", children: [
679
+ /* @__PURE__ */ e("div", { className: "dc:flex-1 dc:flex dc:items-center dc:justify-center dc:p-4", children: ge ? /* @__PURE__ */ e("div", { className: "dc:w-full dc:h-full dc:overflow-auto", children: Yt() }) : /* @__PURE__ */ t("div", { className: "dc:text-center dc:max-w-md", children: [
676
680
  /* @__PURE__ */ e(at, { className: "dc:w-12 dc:h-12 dc:mx-auto text-dc-error dc:mb-4" }),
677
681
  /* @__PURE__ */ e("div", { className: "dc:text-sm dc:font-semibold text-dc-text dc:mb-2", children: "Query Execution Failed" }),
678
682
  /* @__PURE__ */ e("div", { className: "dc:text-sm text-dc-text-secondary dc:mb-4", children: "There was an error executing your query. Please check the query and try again." }),
@@ -740,7 +744,7 @@ const bn = me(function({
740
744
  {
741
745
  chartType: C,
742
746
  data: he && de ? de : i,
743
- chartConfig: g,
747
+ chartConfig: b,
744
748
  displayConfig: o,
745
749
  colorPalette: l,
746
750
  queryObject: ve,
@@ -759,7 +763,7 @@ const bn = me(function({
759
763
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
760
764
  Ce,
761
765
  {
762
- code: JSON.stringify(g, null, 2),
766
+ code: JSON.stringify(b, null, 2),
763
767
  language: "json",
764
768
  title: "Chart Config",
765
769
  height: "16rem"
@@ -849,7 +853,7 @@ const bn = me(function({
849
853
  "button",
850
854
  {
851
855
  onClick: () => Ae(K),
852
- className: `dc:px-3 dc:py-1 dc:text-xs dc:font-medium dc:transition-colors dc:border-r dc:last:border-r-0 border-dc-border ${ge === K ? "bg-dc-accent text-white" : "bg-dc-bg text-dc-text-secondary hover:bg-dc-bg-secondary"}`,
856
+ className: `dc:px-3 dc:py-1 dc:text-xs dc:font-medium dc:transition-colors dc:border-r dc:last:border-r-0 border-dc-border ${be === K ? "bg-dc-accent text-white" : "bg-dc-bg text-dc-text-secondary hover:bg-dc-bg-secondary"}`,
853
857
  children: [
854
858
  "Q",
855
859
  K + 1,
@@ -880,7 +884,7 @@ const bn = me(function({
880
884
  }
881
885
  )
882
886
  ] }),
883
- Me ? /* @__PURE__ */ e("div", { className: "bg-dc-surface-secondary dc:border border-dc-border dc:rounded dc:p-3 text-dc-text-muted dc:text-sm", children: "Loading..." }) : Te ? /* @__PURE__ */ e("div", { className: "bg-dc-surface-secondary dc:border border-dc-border dc:rounded dc:p-3", children: /* @__PURE__ */ e(ln, { analysis: Te }) }) : /* @__PURE__ */ e("div", { className: "bg-dc-surface-secondary dc:border border-dc-border dc:rounded dc:p-3 text-dc-text-muted dc:text-sm", children: qe ? "Analysis unavailable due to error" : "Add metrics to see analysis" })
887
+ Me ? /* @__PURE__ */ e("div", { className: "bg-dc-surface-secondary dc:border border-dc-border dc:rounded dc:p-3 text-dc-text-muted dc:text-sm", children: "Loading..." }) : Te ? /* @__PURE__ */ e("div", { className: "bg-dc-surface-secondary dc:border border-dc-border dc:rounded dc:p-3", children: /* @__PURE__ */ e(fn, { analysis: Te }) }) : /* @__PURE__ */ e("div", { className: "bg-dc-surface-secondary dc:border border-dc-border dc:rounded dc:p-3 text-dc-text-muted dc:text-sm", children: qe ? "Analysis unavailable due to error" : "Add metrics to see analysis" })
884
888
  ] }),
885
889
  /* @__PURE__ */ e("div", { children: ye ? /* @__PURE__ */ t(ie, { children: [
886
890
  /* @__PURE__ */ e(
@@ -892,7 +896,7 @@ const bn = me(function({
892
896
  height: "16rem"
893
897
  }
894
898
  ),
895
- je && ge > 0 && /* @__PURE__ */ t("div", { className: "dc:mt-1 dc:text-xs text-dc-text-muted", children: [
899
+ je && be > 0 && /* @__PURE__ */ t("div", { className: "dc:mt-1 dc:text-xs text-dc-text-muted", children: [
896
900
  /* @__PURE__ */ e("span", { className: "text-dc-accent", children: "ℹ" }),
897
901
  " This query includes an IN filter with binding key values from the previous step"
898
902
  ] })
@@ -927,7 +931,7 @@ const bn = me(function({
927
931
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
928
932
  Ce,
929
933
  {
930
- code: JSON.stringify(g, null, 2),
934
+ code: JSON.stringify(b, null, 2),
931
935
  language: "json",
932
936
  title: "Chart Config",
933
937
  height: "16rem"
@@ -1222,7 +1226,7 @@ const bn = me(function({
1222
1226
  ] }) : d === "error" ? "Query failed" : d === "loading" ? "Executing..." : "No results" })
1223
1227
  ] }),
1224
1228
  /* @__PURE__ */ t("div", { className: "dc:flex dc:items-center dc:gap-2", children: [
1225
- C && k === "table" && !be && B && /* @__PURE__ */ t(
1229
+ C && k === "table" && !ge && B && /* @__PURE__ */ t(
1226
1230
  "select",
1227
1231
  {
1228
1232
  value: A,
@@ -1251,7 +1255,7 @@ const bn = me(function({
1251
1255
  c && C && /* @__PURE__ */ e(
1252
1256
  Ad,
1253
1257
  {
1254
- currentPalette: b || "default",
1258
+ currentPalette: g || "default",
1255
1259
  onPaletteChange: c
1256
1260
  }
1257
1261
  ),
@@ -1305,12 +1309,12 @@ const bn = me(function({
1305
1309
  /* @__PURE__ */ t(
1306
1310
  "button",
1307
1311
  {
1308
- onClick: () => Ie(!be),
1309
- className: `dc:p-1.5 dc:rounded dc:transition-colors dc:relative ${be ? "bg-dc-primary text-white" : "text-dc-text-secondary hover:text-dc-text hover:bg-dc-surface-hover"}`,
1310
- title: be ? "Hide debug info" : "Show debug info",
1312
+ onClick: () => Ie(!ge),
1313
+ className: `dc:p-1.5 dc:rounded dc:transition-colors dc:relative ${ge ? "bg-dc-primary text-white" : "text-dc-text-secondary hover:text-dc-text hover:bg-dc-surface-hover"}`,
1314
+ title: ge ? "Hide debug info" : "Show debug info",
1311
1315
  children: [
1312
1316
  /* @__PURE__ */ e(it, { className: "dc:w-4 dc:h-4" }),
1313
- (s || a.some((K) => K.error)) && !be && /* @__PURE__ */ e("span", { className: "dc:absolute dc:-top-0.5 dc:-right-0.5 dc:w-2 dc:h-2 bg-dc-danger-bg0 dc:rounded-full" })
1317
+ (s || a.some((K) => K.error)) && !ge && /* @__PURE__ */ e("span", { className: "dc:absolute dc:-top-0.5 dc:-right-0.5 dc:w-2 dc:h-2 bg-dc-danger-bg0 dc:rounded-full" })
1314
1318
  ]
1315
1319
  }
1316
1320
  )
@@ -1362,8 +1366,8 @@ const bn = me(function({
1362
1366
  Jt(),
1363
1367
  ud(),
1364
1368
  md(),
1365
- /* @__PURE__ */ e("div", { className: "dc:flex-1 dc:min-h-0 dc:relative dc:overflow-auto", children: be ? Yt() : k === "chart" ? /* @__PURE__ */ e("div", { className: "dc:p-4 dc:h-full", children: nd() }) : fe ? /* @__PURE__ */ e("div", { className: "dc:h-full", children: od() }, "table-flow") : lt ? /* @__PURE__ */ e("div", { className: "dc:h-full", children: sc(U) }, `table-${U}`) : /* @__PURE__ */ e("div", { className: "dc:h-full", children: sc() }, "table-single") }),
1366
- !be && /* @__PURE__ */ e("div", { className: "dc:px-4 dc:py-3 dc:border-t border-dc-border bg-dc-surface dc:flex dc:justify-center dc:flex-shrink-0", children: /* @__PURE__ */ t("div", { className: "dc:flex dc:items-center bg-dc-surface-secondary dc:border border-dc-border dc:rounded-md dc:overflow-hidden", children: [
1369
+ /* @__PURE__ */ e("div", { className: "dc:flex-1 dc:min-h-0 dc:relative dc:overflow-auto", children: ge ? Yt() : k === "chart" ? /* @__PURE__ */ e("div", { className: "dc:p-4 dc:h-full", children: nd() }) : fe ? /* @__PURE__ */ e("div", { className: "dc:h-full", children: od() }, "table-flow") : lt ? /* @__PURE__ */ e("div", { className: "dc:h-full", children: sc(U) }, `table-${U}`) : /* @__PURE__ */ e("div", { className: "dc:h-full", children: sc() }, "table-single") }),
1370
+ !ge && /* @__PURE__ */ e("div", { className: "dc:px-4 dc:py-3 dc:border-t border-dc-border bg-dc-surface dc:flex dc:justify-center dc:flex-shrink-0", children: /* @__PURE__ */ t("div", { className: "dc:flex dc:items-center bg-dc-surface-secondary dc:border border-dc-border dc:rounded-md dc:overflow-hidden", children: [
1367
1371
  /* @__PURE__ */ t(
1368
1372
  "button",
1369
1373
  {
@@ -1423,7 +1427,7 @@ const bn = me(function({
1423
1427
  ] }) })
1424
1428
  ] }) : /* @__PURE__ */ t("div", { className: "dc:h-full dc:flex dc:flex-col", children: [
1425
1429
  Jt(),
1426
- /* @__PURE__ */ e("div", { className: "dc:flex-1 dc:min-h-0 dc:relative dc:overflow-auto", children: be ? Yt() : dd() })
1430
+ /* @__PURE__ */ e("div", { className: "dc:flex-1 dc:min-h-0 dc:relative dc:overflow-auto", children: ge ? Yt() : dd() })
1427
1431
  ] }), Ee = z(() => {
1428
1432
  if (i === null) return !1;
1429
1433
  if (!Array.isArray(i)) return !0;
@@ -1459,17 +1463,17 @@ const bn = me(function({
1459
1463
  }
1460
1464
  )
1461
1465
  ] });
1462
- }), gn = me(function({
1466
+ }), wn = me(function({
1463
1467
  metric: d,
1464
1468
  fieldMeta: i,
1465
1469
  onRemove: s,
1466
1470
  sortDirection: m,
1467
1471
  sortPriority: n,
1468
1472
  onToggleSort: x,
1469
- index: g,
1473
+ index: b,
1470
1474
  isDragging: o,
1471
1475
  onDragStart: l,
1472
- onDragEnd: b
1476
+ onDragEnd: g
1473
1477
  }) {
1474
1478
  const c = $("close"), h = $("chevronUp"), N = $("chevronDown"), k = $("chevronUpDown"), R = i?.type || "count", A = nc(R) || $("measure"), B = i?.shortTitle || i?.title || d.field.split(".").pop() || d.field, u = d.field.split(".")[0], a = () => {
1475
1479
  switch (m) {
@@ -1489,14 +1493,14 @@ const bn = me(function({
1489
1493
  default:
1490
1494
  return "Click to sort ascending";
1491
1495
  }
1492
- }, y = typeof g == "number" && l && b;
1496
+ }, y = typeof b == "number" && l && g;
1493
1497
  return /* @__PURE__ */ t(
1494
1498
  "div",
1495
1499
  {
1496
1500
  className: `dc:flex dc:items-center dc:gap-2 dc:p-2 bg-dc-surface-secondary dc:rounded-lg dc:group hover:bg-dc-surface-tertiary dc:transition-all dc:duration-150 ${y ? "dc:cursor-grab dc:active:cursor-grabbing" : ""} ${o ? "dc:opacity-30" : ""}`,
1497
1501
  draggable: y ? !0 : void 0,
1498
- onDragStart: y ? (w) => l(w, g) : void 0,
1499
- onDragEnd: y ? b : void 0,
1502
+ onDragStart: y ? (w) => l(w, b) : void 0,
1503
+ onDragEnd: y ? g : void 0,
1500
1504
  children: [
1501
1505
  /* @__PURE__ */ e("span", { className: "dc:w-6 dc:h-6 dc:flex dc:items-center dc:justify-center dc:rounded bg-dc-measure text-dc-measure-text dc:flex-shrink-0", children: A && /* @__PURE__ */ e(A, { className: "dc:w-4 dc:h-4" }) }),
1502
1506
  /* @__PURE__ */ t("div", { className: "dc:flex-1 dc:min-w-0", children: [
@@ -1531,13 +1535,13 @@ const bn = me(function({
1531
1535
  ]
1532
1536
  }
1533
1537
  );
1534
- }), yn = $("add");
1535
- function vn(r, d) {
1538
+ }), Cn = $("add");
1539
+ function Sn(r, d) {
1536
1540
  if (!d?.cubes) return null;
1537
1541
  const [i] = r.split("."), s = d.cubes.find((m) => m.name === i);
1538
1542
  return s && s.measures?.find((m) => m.name === r) || null;
1539
1543
  }
1540
- function Nn(r) {
1544
+ function Dn(r) {
1541
1545
  switch (r) {
1542
1546
  case null:
1543
1547
  return "asc";
@@ -1549,20 +1553,20 @@ function Nn(r) {
1549
1553
  return "asc";
1550
1554
  }
1551
1555
  }
1552
- const wn = me(function({
1556
+ const kn = me(function({
1553
1557
  metrics: d,
1554
1558
  schema: i,
1555
1559
  onAdd: s,
1556
1560
  onRemove: m,
1557
1561
  order: n,
1558
1562
  onOrderChange: x,
1559
- onReorder: g
1563
+ onReorder: b
1560
1564
  }) {
1561
- const [o, l] = _(null), [b, c] = _(null), h = Z(null), N = Z(null), k = z(() => n ? Object.keys(n) : [], [n]), R = z(() => d.map((p, L) => {
1565
+ const [o, l] = _(null), [g, c] = _(null), h = Z(null), N = Z(null), k = z(() => n ? Object.keys(n) : [], [n]), R = z(() => d.map((p, L) => {
1562
1566
  const P = n?.[p.field] || null, S = P ? k.indexOf(p.field) + 1 : void 0;
1563
1567
  return {
1564
1568
  metric: p,
1565
- fieldMeta: vn(p.field, i),
1569
+ fieldMeta: Sn(p.field, i),
1566
1570
  sortDirection: P,
1567
1571
  sortPriority: S,
1568
1572
  index: L
@@ -1594,28 +1598,28 @@ const wn = me(function({
1594
1598
  }, []), f = F((p) => {
1595
1599
  p.preventDefault(), p.stopPropagation();
1596
1600
  const L = h.current, P = N.current;
1597
- if (l(null), c(null), h.current = null, N.current = null, L === null || P === null || !g)
1601
+ if (l(null), c(null), h.current = null, N.current = null, L === null || P === null || !b)
1598
1602
  return;
1599
1603
  const S = P > L ? P - 1 : P;
1600
- S !== L && g(L, S);
1601
- }, [g]), y = F((p) => {
1604
+ S !== L && b(L, S);
1605
+ }, [b]), y = F((p) => {
1602
1606
  const L = p.relatedTarget;
1603
1607
  (!L || !p.currentTarget.contains(L)) && c(null);
1604
1608
  }, []), w = F((p) => {
1605
- if (o === null || b === null) return "";
1609
+ if (o === null || g === null) return "";
1606
1610
  const L = 40;
1607
1611
  if (p === o) return "";
1608
- if (o < b) {
1609
- if (p > o && p < b)
1612
+ if (o < g) {
1613
+ if (p > o && p < g)
1610
1614
  return "";
1611
- if (p === b - 1)
1615
+ if (p === g - 1)
1612
1616
  return `translateY(-${L / 2}px)`;
1613
- if (p >= b)
1617
+ if (p >= g)
1614
1618
  return `translateY(${L / 2}px)`;
1615
- } else if (p >= b && p < o)
1619
+ } else if (p >= g && p < o)
1616
1620
  return `translateY(${L / 2}px)`;
1617
1621
  return "";
1618
- }, [o, b]), D = F((p) => o === null || b === null ? !1 : p === b, [o, b]);
1622
+ }, [o, g]), D = F((p) => o === null || g === null ? !1 : p === g, [o, g]);
1619
1623
  return /* @__PURE__ */ t("div", { children: [
1620
1624
  /* @__PURE__ */ t(
1621
1625
  "button",
@@ -1625,7 +1629,7 @@ const wn = me(function({
1625
1629
  title: "Add metric",
1626
1630
  children: [
1627
1631
  /* @__PURE__ */ e(ue, { children: "Metrics" }),
1628
- /* @__PURE__ */ e(yn, { className: "dc:w-5 dc:h-5 text-dc-text-secondary group-hover:text-dc-primary dc:transition-colors" })
1632
+ /* @__PURE__ */ e(Cn, { className: "dc:w-5 dc:h-5 text-dc-text-secondary group-hover:text-dc-primary dc:transition-colors" })
1629
1633
  ]
1630
1634
  }
1631
1635
  ),
@@ -1633,9 +1637,9 @@ const wn = me(function({
1633
1637
  "div",
1634
1638
  {
1635
1639
  className: "dc:space-y-2",
1636
- onDragLeave: g ? y : void 0,
1637
- onDragOver: g ? (p) => p.preventDefault() : void 0,
1638
- onDrop: g ? f : void 0,
1640
+ onDragLeave: b ? y : void 0,
1641
+ onDragOver: b ? (p) => p.preventDefault() : void 0,
1642
+ onDrop: b ? f : void 0,
1639
1643
  children: [
1640
1644
  R.map(({ metric: p, fieldMeta: L, sortDirection: P, sortPriority: S, index: v }) => {
1641
1645
  const T = w(v), E = D(v);
@@ -1647,12 +1651,12 @@ const wn = me(function({
1647
1651
  transform: T,
1648
1652
  transition: o !== null ? "transform 0.15s ease-out" : "none"
1649
1653
  },
1650
- onDragOver: g ? (M) => a(M, v) : void 0,
1651
- onDrop: g ? f : void 0,
1654
+ onDragOver: b ? (M) => a(M, v) : void 0,
1655
+ onDrop: b ? f : void 0,
1652
1656
  children: [
1653
1657
  E && /* @__PURE__ */ e("div", { className: "dc:absolute dc:-top-5 dc:left-0 dc:right-0 dc:flex dc:items-center dc:justify-center dc:pointer-events-none dc:z-10", children: /* @__PURE__ */ e("div", { className: "dc:h-0.5 dc:w-full bg-dc-primary dc:rounded-full" }) }),
1654
1658
  /* @__PURE__ */ e(
1655
- gn,
1659
+ wn,
1656
1660
  {
1657
1661
  metric: p,
1658
1662
  fieldMeta: L,
@@ -1660,13 +1664,13 @@ const wn = me(function({
1660
1664
  sortDirection: P,
1661
1665
  sortPriority: S,
1662
1666
  onToggleSort: x ? () => {
1663
- const M = Nn(P);
1667
+ const M = Dn(P);
1664
1668
  x(p.field, M);
1665
1669
  } : void 0,
1666
1670
  index: v,
1667
1671
  isDragging: o === v,
1668
- onDragStart: g ? B : void 0,
1669
- onDragEnd: g ? u : void 0
1672
+ onDragStart: b ? B : void 0,
1673
+ onDragEnd: b ? u : void 0
1670
1674
  }
1671
1675
  )
1672
1676
  ]
@@ -1674,8 +1678,8 @@ const wn = me(function({
1674
1678
  p.id
1675
1679
  );
1676
1680
  }),
1677
- g && o !== null && b === d.length && /* @__PURE__ */ e("div", { className: "dc:relative dc:h-2", children: /* @__PURE__ */ e("div", { className: "dc:absolute dc:top-0 dc:left-0 dc:right-0 dc:flex dc:items-center dc:justify-center dc:pointer-events-none dc:z-10", children: /* @__PURE__ */ e("div", { className: "dc:h-0.5 dc:w-full bg-dc-primary dc:rounded-full" }) }) }),
1678
- g && d.length > 0 && o !== null && /* @__PURE__ */ e(
1681
+ b && o !== null && g === d.length && /* @__PURE__ */ e("div", { className: "dc:relative dc:h-2", children: /* @__PURE__ */ e("div", { className: "dc:absolute dc:top-0 dc:left-0 dc:right-0 dc:flex dc:items-center dc:justify-center dc:pointer-events-none dc:z-10", children: /* @__PURE__ */ e("div", { className: "dc:h-0.5 dc:w-full bg-dc-primary dc:rounded-full" }) }) }),
1682
+ b && d.length > 0 && o !== null && /* @__PURE__ */ e(
1679
1683
  "div",
1680
1684
  {
1681
1685
  className: "dc:h-8",
@@ -1691,7 +1695,7 @@ const wn = me(function({
1691
1695
  }
1692
1696
  )
1693
1697
  ] });
1694
- }), Cn = [
1698
+ }), Tn = [
1695
1699
  { value: "hour", label: "Hour" },
1696
1700
  { value: "day", label: "Day" },
1697
1701
  { value: "week", label: "Week" },
@@ -1705,16 +1709,16 @@ const wn = me(function({
1705
1709
  onGranularityChange: m,
1706
1710
  onComparisonToggle: n,
1707
1711
  comparisonDisabled: x,
1708
- sortDirection: g,
1712
+ sortDirection: b,
1709
1713
  sortPriority: o,
1710
1714
  onToggleSort: l,
1711
- index: b,
1715
+ index: g,
1712
1716
  isDragging: c,
1713
1717
  onDragStart: h,
1714
1718
  onDragEnd: N
1715
1719
  }) {
1716
1720
  const k = $("dimension"), R = $("timeDimension"), A = $("close"), B = $("chevronUp"), u = $("chevronDown"), a = $("chevronUpDown"), f = i?.shortTitle || i?.title || d.field.split(".").pop() || d.field, y = d.field.split(".")[0], w = d.isTimeDimension ? R : k, D = () => {
1717
- switch (g) {
1721
+ switch (b) {
1718
1722
  case "asc":
1719
1723
  return B ? /* @__PURE__ */ e(B, { className: "dc:w-4 dc:h-4" }) : "↑";
1720
1724
  case "desc":
@@ -1723,7 +1727,7 @@ const wn = me(function({
1723
1727
  return a ? /* @__PURE__ */ e(a, { className: "dc:w-4 dc:h-4" }) : "⇅";
1724
1728
  }
1725
1729
  }, p = () => {
1726
- switch (g) {
1730
+ switch (b) {
1727
1731
  case "asc":
1728
1732
  return "Sorted ascending (click for descending)";
1729
1733
  case "desc":
@@ -1731,13 +1735,13 @@ const wn = me(function({
1731
1735
  default:
1732
1736
  return "Click to sort ascending";
1733
1737
  }
1734
- }, L = typeof b == "number" && h && N;
1738
+ }, L = typeof g == "number" && h && N;
1735
1739
  return /* @__PURE__ */ t(
1736
1740
  "div",
1737
1741
  {
1738
1742
  className: `dc:flex dc:items-center dc:gap-2 dc:p-2 bg-dc-surface-secondary dc:rounded-lg dc:group hover:bg-dc-surface-tertiary dc:transition-all dc:duration-150 ${L ? "dc:cursor-grab dc:active:cursor-grabbing" : ""} ${c ? "dc:opacity-30" : ""}`,
1739
1743
  draggable: L ? !0 : void 0,
1740
- onDragStart: L ? (P) => h(P, b) : void 0,
1744
+ onDragStart: L ? (P) => h(P, g) : void 0,
1741
1745
  onDragEnd: L ? N : void 0,
1742
1746
  children: [
1743
1747
  /* @__PURE__ */ e("span", { className: `dc:w-6 dc:h-6 dc:flex dc:items-center dc:justify-center dc:rounded dc:flex-shrink-0 ${d.isTimeDimension ? "bg-dc-time-dimension text-dc-time-dimension-text" : "bg-dc-dimension text-dc-dimension-text"}`, children: /* @__PURE__ */ e(w, { className: "dc:w-4 dc:h-4" }) }),
@@ -1752,7 +1756,7 @@ const wn = me(function({
1752
1756
  onChange: (P) => m(P.target.value),
1753
1757
  onClick: (P) => P.stopPropagation(),
1754
1758
  className: "dc:text-xs bg-dc-surface dc:border border-dc-border dc:rounded dc:px-2 dc:py-1 text-dc-text dc:focus:outline-none dc:focus:ring-1 focus:ring-dc-primary dc:flex-shrink-0",
1755
- children: Cn.map((P) => /* @__PURE__ */ e("option", { value: P.value, children: P.label }, P.value))
1759
+ children: Tn.map((P) => /* @__PURE__ */ e("option", { value: P.value, children: P.label }, P.value))
1756
1760
  }
1757
1761
  ),
1758
1762
  d.isTimeDimension && n && /* @__PURE__ */ e(
@@ -1771,11 +1775,11 @@ const wn = me(function({
1771
1775
  "button",
1772
1776
  {
1773
1777
  onClick: l,
1774
- className: `dc:p-1 dc:transition-opacity dc:flex-shrink-0 dc:flex dc:items-center dc:gap-0.5 ${g ? "dc:opacity-100 text-dc-primary" : "dc:opacity-100 dc:sm:opacity-0 dc:sm:group-hover:opacity-100 text-dc-text-muted hover:text-dc-primary"}`,
1778
+ className: `dc:p-1 dc:transition-opacity dc:flex-shrink-0 dc:flex dc:items-center dc:gap-0.5 ${b ? "dc:opacity-100 text-dc-primary" : "dc:opacity-100 dc:sm:opacity-0 dc:sm:group-hover:opacity-100 text-dc-text-muted hover:text-dc-primary"}`,
1775
1779
  title: p(),
1776
1780
  children: [
1777
1781
  D(),
1778
- g && o && /* @__PURE__ */ t("span", { className: "dc:text-xs dc:font-medium", children: [
1782
+ b && o && /* @__PURE__ */ t("span", { className: "dc:text-xs dc:font-medium", children: [
1779
1783
  "(",
1780
1784
  o,
1781
1785
  ")"
@@ -1795,13 +1799,13 @@ const wn = me(function({
1795
1799
  ]
1796
1800
  }
1797
1801
  );
1798
- }), Sn = $("add");
1799
- function Dn(r, d) {
1802
+ }), $n = $("add");
1803
+ function An(r, d) {
1800
1804
  if (!d?.cubes) return null;
1801
1805
  const [i] = r.split("."), s = d.cubes.find((m) => m.name === i);
1802
1806
  return s && s.dimensions?.find((m) => m.name === r) || null;
1803
1807
  }
1804
- function kn(r) {
1808
+ function In(r) {
1805
1809
  switch (r) {
1806
1810
  case null:
1807
1811
  return "asc";
@@ -1820,20 +1824,20 @@ const zc = me(function({
1820
1824
  onRemove: m,
1821
1825
  onGranularityChange: n,
1822
1826
  onComparisonToggle: x,
1823
- order: g,
1827
+ order: b,
1824
1828
  onOrderChange: o,
1825
1829
  onReorder: l
1826
1830
  }) {
1827
- const [b, c] = _(null), [h, N] = _(null), k = Z(null), R = Z(null), A = z(() => g ? Object.keys(g) : [], [g]), B = z(() => d.find((v) => v.isTimeDimension && v.enableComparison)?.id || null, [d]), u = z(() => d.map((S, v) => {
1828
- const T = g?.[S.field] || null, E = T ? A.indexOf(S.field) + 1 : void 0;
1831
+ const [g, c] = _(null), [h, N] = _(null), k = Z(null), R = Z(null), A = z(() => b ? Object.keys(b) : [], [b]), B = z(() => d.find((v) => v.isTimeDimension && v.enableComparison)?.id || null, [d]), u = z(() => d.map((S, v) => {
1832
+ const T = b?.[S.field] || null, E = T ? A.indexOf(S.field) + 1 : void 0;
1829
1833
  return {
1830
1834
  breakdown: S,
1831
- fieldMeta: Dn(S.field, i),
1835
+ fieldMeta: An(S.field, i),
1832
1836
  sortDirection: T,
1833
1837
  sortPriority: E,
1834
1838
  index: v
1835
1839
  };
1836
- }), [d, i, g, A]), a = Z(null), f = F((S, v) => {
1840
+ }), [d, i, b, A]), a = Z(null), f = F((S, v) => {
1837
1841
  c(v), k.current = v, S.dataTransfer.effectAllowed = "move", S.dataTransfer.setData("text/plain", JSON.stringify({ type: "breakdown", index: v, field: d[v].field }));
1838
1842
  const T = S.currentTarget, E = T.cloneNode(!0);
1839
1843
  E.style.cssText = `
@@ -1868,20 +1872,20 @@ const zc = me(function({
1868
1872
  const v = S.relatedTarget;
1869
1873
  (!v || !S.currentTarget.contains(v)) && N(null);
1870
1874
  }, []), L = F((S) => {
1871
- if (b === null || h === null) return "";
1875
+ if (g === null || h === null) return "";
1872
1876
  const v = 40;
1873
- if (S === b) return "";
1874
- if (b < h) {
1875
- if (S > b && S < h)
1877
+ if (S === g) return "";
1878
+ if (g < h) {
1879
+ if (S > g && S < h)
1876
1880
  return "";
1877
1881
  if (S === h - 1)
1878
1882
  return `translateY(-${v / 2}px)`;
1879
1883
  if (S >= h)
1880
1884
  return `translateY(${v / 2}px)`;
1881
- } else if (S >= h && S < b)
1885
+ } else if (S >= h && S < g)
1882
1886
  return `translateY(${v / 2}px)`;
1883
1887
  return "";
1884
- }, [b, h]), P = F((S) => b === null || h === null ? !1 : S === h, [b, h]);
1888
+ }, [g, h]), P = F((S) => g === null || h === null ? !1 : S === h, [g, h]);
1885
1889
  return /* @__PURE__ */ t("div", { children: [
1886
1890
  /* @__PURE__ */ t(
1887
1891
  "button",
@@ -1891,7 +1895,7 @@ const zc = me(function({
1891
1895
  title: "Add breakdown",
1892
1896
  children: [
1893
1897
  /* @__PURE__ */ e(ue, { children: "Breakdown" }),
1894
- /* @__PURE__ */ e(Sn, { className: "dc:w-5 dc:h-5 text-dc-text-secondary group-hover:text-dc-primary dc:transition-colors" })
1898
+ /* @__PURE__ */ e($n, { className: "dc:w-5 dc:h-5 text-dc-text-secondary group-hover:text-dc-primary dc:transition-colors" })
1895
1899
  ]
1896
1900
  }
1897
1901
  ),
@@ -1911,7 +1915,7 @@ const zc = me(function({
1911
1915
  className: "dc:relative",
1912
1916
  style: {
1913
1917
  transform: j,
1914
- transition: b !== null ? "transform 0.15s ease-out" : "none"
1918
+ transition: g !== null ? "transform 0.15s ease-out" : "none"
1915
1919
  },
1916
1920
  onDragOver: l ? (U) => w(U, M) : void 0,
1917
1921
  onDrop: l ? D : void 0,
@@ -1929,11 +1933,11 @@ const zc = me(function({
1929
1933
  sortDirection: T,
1930
1934
  sortPriority: E,
1931
1935
  onToggleSort: o ? () => {
1932
- const U = kn(T);
1936
+ const U = In(T);
1933
1937
  o(S.field, U);
1934
1938
  } : void 0,
1935
1939
  index: M,
1936
- isDragging: b === M,
1940
+ isDragging: g === M,
1937
1941
  onDragStart: l ? f : void 0,
1938
1942
  onDragEnd: l ? y : void 0
1939
1943
  }
@@ -1943,8 +1947,8 @@ const zc = me(function({
1943
1947
  S.id
1944
1948
  );
1945
1949
  }),
1946
- l && b !== null && h === d.length && /* @__PURE__ */ e("div", { className: "dc:relative dc:h-2", children: /* @__PURE__ */ e("div", { className: "dc:absolute dc:top-0 dc:left-0 dc:right-0 dc:flex dc:items-center dc:justify-center dc:pointer-events-none dc:z-10", children: /* @__PURE__ */ e("div", { className: "dc:h-0.5 dc:w-full bg-dc-primary dc:rounded-full" }) }) }),
1947
- l && d.length > 0 && b !== null && /* @__PURE__ */ e(
1950
+ l && g !== null && h === d.length && /* @__PURE__ */ e("div", { className: "dc:relative dc:h-2", children: /* @__PURE__ */ e("div", { className: "dc:absolute dc:top-0 dc:left-0 dc:right-0 dc:flex dc:items-center dc:justify-center dc:pointer-events-none dc:z-10", children: /* @__PURE__ */ e("div", { className: "dc:h-0.5 dc:w-full bg-dc-primary dc:rounded-full" }) }) }),
1951
+ l && d.length > 0 && g !== null && /* @__PURE__ */ e(
1948
1952
  "div",
1949
1953
  {
1950
1954
  className: "dc:h-8",
@@ -1960,15 +1964,15 @@ const zc = me(function({
1960
1964
  }
1961
1965
  )
1962
1966
  ] });
1963
- }), xc = $("close"), Xt = $("chevronDown"), Tn = $("dimension"), $n = $("timeDimension"), An = $("measure");
1964
- function In({
1967
+ }), xc = $("close"), Xt = $("chevronDown"), Rn = $("dimension"), Fn = $("timeDimension"), En = $("measure");
1968
+ function On({
1965
1969
  filter: r,
1966
1970
  schema: d,
1967
1971
  onSave: i,
1968
1972
  onCancel: s,
1969
1973
  anchorElement: m
1970
1974
  }) {
1971
- const [n, x] = _(r), [g, o] = _(!1), [l, b] = _(!1), [c, h] = _(!1), [N, k] = _("this_month"), [R, A] = _(1), [B, u] = _(""), [a, f] = _(null), [y, w] = _(-1), D = Z(null), p = Z(null), L = Ed(B, 300), P = Gc(n.member, d), S = P?.field.type || "string", v = S === "time", T = P?.fieldType === "measure", E = P?.fieldType === "dimension", M = _c(n.member, d), j = Kc[n.operator], q = Od(S), U = v && n.operator === "inDateRange", re = F(() => ["equals", "notEquals", "in", "notIn"].includes(n.operator) && E && !v, [n.operator, E, v])(), {
1975
+ const [n, x] = _(r), [b, o] = _(!1), [l, g] = _(!1), [c, h] = _(!1), [N, k] = _("this_month"), [R, A] = _(1), [B, u] = _(""), [a, f] = _(null), [y, w] = _(-1), D = Z(null), p = Z(null), L = Ed(B, 300), P = Gc(n.member, d), S = P?.field.type || "string", v = S === "time", T = P?.fieldType === "measure", E = P?.fieldType === "dimension", M = _c(n.member, d), j = Kc[n.operator], q = Od(S), U = v && n.operator === "inDateRange", re = F(() => ["equals", "notEquals", "in", "notIn"].includes(n.operator) && E && !v, [n.operator, E, v])(), {
1972
1976
  values: ee,
1973
1977
  loading: pe,
1974
1978
  error: W,
@@ -1989,7 +1993,7 @@ function In({
1989
1993
  });
1990
1994
  }, [m]), Y(() => {
1991
1995
  const O = (Q) => {
1992
- D.current && !D.current.contains(Q.target) && (o(!1), b(!1), h(!1));
1996
+ D.current && !D.current.contains(Q.target) && (o(!1), g(!1), h(!1));
1993
1997
  };
1994
1998
  return document.addEventListener("mousedown", O), () => document.removeEventListener("mousedown", O);
1995
1999
  }, []), Y(() => {
@@ -2032,7 +2036,7 @@ function In({
2032
2036
  }), o(!1);
2033
2037
  }, [n.member]), te = F((O, Q) => {
2034
2038
  const J = Q?.shiftKey ?? !1, ce = n.values || [];
2035
- j?.supportsMultipleValues ? (ce.includes(O) ? x({ ...n, values: ce.filter((xe) => xe !== O) }) : x({ ...n, values: [...ce, O] }), J || b(!1)) : (x({ ...n, values: [O] }), b(!1)), u(""), w(-1);
2039
+ j?.supportsMultipleValues ? (ce.includes(O) ? x({ ...n, values: ce.filter((xe) => xe !== O) }) : x({ ...n, values: [...ce, O] }), J || g(!1)) : (x({ ...n, values: [O] }), g(!1)), u(""), w(-1);
2036
2040
  }, [n, j?.supportsMultipleValues]), X = F((O) => {
2037
2041
  const Q = (n.values || []).filter((J) => J !== O);
2038
2042
  x({ ...n, values: Q });
@@ -2053,7 +2057,7 @@ function In({
2053
2057
  O.preventDefault(), y >= 0 && y < ee.length && te(ee[y], { shiftKey: O.shiftKey });
2054
2058
  break;
2055
2059
  case "Escape":
2056
- O.preventDefault(), b(!1), w(-1);
2060
+ O.preventDefault(), g(!1), w(-1);
2057
2061
  break;
2058
2062
  }
2059
2063
  }, [l, ee, y, te]), de = F((O) => {
@@ -2085,19 +2089,19 @@ function In({
2085
2089
  const Q = Ve(N, O);
2086
2090
  x({ ...n, dateRange: Q });
2087
2091
  }
2088
- }, [n, N]), be = F((O) => {
2092
+ }, [n, N]), ge = F((O) => {
2089
2093
  const Q = O.target.value, ce = (Array.isArray(n.dateRange) ? n.dateRange : [n.dateRange || "", ""])[1] || Q;
2090
2094
  x({ ...n, dateRange: [Q, ce] });
2091
2095
  }, [n]), Ie = F((O) => {
2092
2096
  const Q = O.target.value, ce = (Array.isArray(n.dateRange) ? n.dateRange : ["", n.dateRange || ""])[0] || Q;
2093
2097
  x({ ...n, dateRange: [ce, Q] });
2094
- }, [n]), ge = q.find((O) => O.operator === n.operator)?.label || n.operator, Ae = Ut.find((O) => O.value === N)?.label || "Select range", Re = v ? $n : T ? An : Tn, Se = () => j?.requiresValues ? U ? /* @__PURE__ */ t("div", { className: "dc:space-y-2", children: [
2098
+ }, [n]), be = q.find((O) => O.operator === n.operator)?.label || n.operator, Ae = Ut.find((O) => O.value === N)?.label || "Select range", Re = v ? Fn : T ? En : Rn, Se = () => j?.requiresValues ? U ? /* @__PURE__ */ t("div", { className: "dc:space-y-2", children: [
2095
2099
  /* @__PURE__ */ t("div", { className: "dc:relative", children: [
2096
2100
  /* @__PURE__ */ t(
2097
2101
  "button",
2098
2102
  {
2099
2103
  onClick: () => {
2100
- o(!1), b(!1), h(!c);
2104
+ o(!1), g(!1), h(!c);
2101
2105
  },
2102
2106
  className: "dc:w-full dc:flex dc:items-center dc:justify-between dc:text-left dc:text-sm dc:border border-dc-border dc:rounded dc:px-3 dc:py-2 bg-dc-surface text-dc-text hover:bg-dc-surface-hover",
2103
2107
  children: [
@@ -2136,7 +2140,7 @@ function In({
2136
2140
  {
2137
2141
  type: "date",
2138
2142
  value: Array.isArray(n.dateRange) ? n.dateRange[0] : "",
2139
- onChange: be,
2143
+ onChange: ge,
2140
2144
  className: "dc:flex-1 dc:text-sm dc:border border-dc-border dc:rounded dc:px-2 dc:py-2 bg-dc-surface text-dc-text"
2141
2145
  }
2142
2146
  ),
@@ -2214,7 +2218,7 @@ function In({
2214
2218
  "button",
2215
2219
  {
2216
2220
  onClick: () => {
2217
- o(!1), h(!1), b(!l);
2221
+ o(!1), h(!1), g(!l);
2218
2222
  },
2219
2223
  className: "dc:w-full dc:flex dc:items-center dc:justify-between dc:text-left dc:text-sm dc:border border-dc-border dc:rounded dc:px-3 dc:py-2 bg-dc-surface text-dc-text hover:bg-dc-surface-hover",
2220
2224
  children: [
@@ -2313,16 +2317,16 @@ function In({
2313
2317
  "button",
2314
2318
  {
2315
2319
  onClick: () => {
2316
- b(!1), h(!1), o(!g);
2320
+ g(!1), h(!1), o(!b);
2317
2321
  },
2318
2322
  className: "dc:w-full dc:flex dc:items-center dc:justify-between dc:text-left dc:text-sm dc:border border-dc-border dc:rounded dc:px-3 dc:py-2 bg-dc-surface text-dc-text hover:bg-dc-surface-hover",
2319
2323
  children: [
2320
- /* @__PURE__ */ e("span", { className: "dc:truncate", children: ge }),
2321
- /* @__PURE__ */ e(Xt, { className: `dc:w-4 dc:h-4 text-dc-text-muted dc:shrink-0 dc:ml-2 dc:transition-transform ${g ? "dc:rotate-180" : ""}` })
2324
+ /* @__PURE__ */ e("span", { className: "dc:truncate", children: be }),
2325
+ /* @__PURE__ */ e(Xt, { className: `dc:w-4 dc:h-4 text-dc-text-muted dc:shrink-0 dc:ml-2 dc:transition-transform ${b ? "dc:rotate-180" : ""}` })
2322
2326
  ]
2323
2327
  }
2324
2328
  ),
2325
- g && /* @__PURE__ */ e("div", { className: "dc:absolute dc:z-[60] dc:left-0 dc:right-0 dc:mt-1 bg-dc-surface dc:border border-dc-border dc:rounded dc:shadow-lg dc:max-h-48 dc:overflow-y-auto", children: q.map((O) => /* @__PURE__ */ e(
2329
+ b && /* @__PURE__ */ e("div", { className: "dc:absolute dc:z-[60] dc:left-0 dc:right-0 dc:mt-1 bg-dc-surface dc:border border-dc-border dc:rounded dc:shadow-lg dc:max-h-48 dc:overflow-y-auto", children: q.map((O) => /* @__PURE__ */ e(
2326
2330
  "button",
2327
2331
  {
2328
2332
  onClick: () => G(O.operator),
@@ -2362,21 +2366,21 @@ function In({
2362
2366
  }
2363
2367
  ) });
2364
2368
  }
2365
- const bc = $("close"), Rn = $("dimension"), Fn = $("timeDimension"), En = $("measure");
2369
+ const gc = $("close"), Ln = $("dimension"), Bn = $("timeDimension"), Pn = $("measure");
2366
2370
  function Yc({
2367
2371
  filter: r,
2368
2372
  schema: d,
2369
2373
  onRemove: i,
2370
2374
  onUpdate: s
2371
2375
  }) {
2372
- const [m, n] = _(!1), x = Z(null), g = Gc(r.member, d), l = (g?.field.type || "string") === "time", b = g?.fieldType === "measure", c = _c(r.member, d), h = Kc[r.operator], N = h?.label || r.operator, k = On(r, h), R = l ? Fn : b ? En : Rn;
2376
+ const [m, n] = _(!1), x = Z(null), b = Gc(r.member, d), l = (b?.field.type || "string") === "time", g = b?.fieldType === "measure", c = _c(r.member, d), h = Kc[r.operator], N = h?.label || r.operator, k = Mn(r, h), R = l ? Bn : g ? Pn : Ln;
2373
2377
  return /* @__PURE__ */ t(ie, { children: [
2374
2378
  /* @__PURE__ */ t(
2375
2379
  "div",
2376
2380
  {
2377
2381
  className: "dc:flex dc:items-start dc:gap-2 dc:px-2 dc:py-1.5 bg-dc-surface-secondary dc:rounded-lg dc:group hover:bg-dc-surface-tertiary dc:transition-all dc:duration-150 dc:w-full",
2378
2382
  children: [
2379
- /* @__PURE__ */ e("span", { className: `dc:w-6 dc:h-6 dc:flex dc:items-center dc:justify-center dc:rounded ${l ? "bg-dc-time-dimension" : b ? "bg-dc-measure" : "bg-dc-dimension"} ${l ? "text-dc-time-dimension-text" : b ? "text-dc-measure-text" : "text-dc-dimension-text"} dc:flex-shrink-0 dc:mt-0.5`, children: R && /* @__PURE__ */ e(R, { className: "dc:w-4 dc:h-4" }) }),
2383
+ /* @__PURE__ */ e("span", { className: `dc:w-6 dc:h-6 dc:flex dc:items-center dc:justify-center dc:rounded ${l ? "bg-dc-time-dimension" : g ? "bg-dc-measure" : "bg-dc-dimension"} ${l ? "text-dc-time-dimension-text" : g ? "text-dc-measure-text" : "text-dc-dimension-text"} dc:flex-shrink-0 dc:mt-0.5`, children: R && /* @__PURE__ */ e(R, { className: "dc:w-4 dc:h-4" }) }),
2380
2384
  /* @__PURE__ */ e(
2381
2385
  "button",
2382
2386
  {
@@ -2397,14 +2401,14 @@ function Yc({
2397
2401
  onClick: i,
2398
2402
  className: "dc:p-1 text-dc-text-muted hover:text-dc-danger dc:opacity-100 dc:sm:opacity-0 dc:sm:group-hover:opacity-100 dc:transition-opacity dc:flex-shrink-0 dc:mt-0.5",
2399
2403
  title: "Remove filter",
2400
- children: bc && /* @__PURE__ */ e(bc, { className: "dc:w-4 dc:h-4" })
2404
+ children: gc && /* @__PURE__ */ e(gc, { className: "dc:w-4 dc:h-4" })
2401
2405
  }
2402
2406
  )
2403
2407
  ]
2404
2408
  }
2405
2409
  ),
2406
2410
  m && /* @__PURE__ */ e(
2407
- In,
2411
+ On,
2408
2412
  {
2409
2413
  filter: r,
2410
2414
  schema: d,
@@ -2417,7 +2421,7 @@ function Yc({
2417
2421
  )
2418
2422
  ] });
2419
2423
  }
2420
- function On(r, d) {
2424
+ function Mn(r, d) {
2421
2425
  if (!d?.requiresValues)
2422
2426
  return "";
2423
2427
  if (r.dateRange)
@@ -2425,11 +2429,11 @@ function On(r, d) {
2425
2429
  const i = r.values || [];
2426
2430
  return i.length === 0 ? "(empty)" : i.length === 1 ? String(i[0]) : i.length === 2 ? `${i[0]}, ${i[1]}` : `${i[0]}, ${i[1]}, +${i.length - 2} more`;
2427
2431
  }
2428
- const Ln = $("add"), Bn = $("close");
2429
- function Pn(r) {
2432
+ const qn = $("add"), jn = $("close");
2433
+ function Qn(r) {
2430
2434
  return "member" in r && typeof r.member == "string";
2431
2435
  }
2432
- function Mn(r) {
2436
+ function Gn(r) {
2433
2437
  return "type" in r && (r.type === "and" || r.type === "or");
2434
2438
  }
2435
2439
  function Jc({
@@ -2441,14 +2445,14 @@ function Jc({
2441
2445
  depth: n = 0,
2442
2446
  hideRemoveButton: x = !1
2443
2447
  }) {
2444
- const [g, o] = _(!1), l = Z(null);
2448
+ const [b, o] = _(!1), l = Z(null);
2445
2449
  Y(() => {
2446
2450
  const f = (y) => {
2447
2451
  l.current && !l.current.contains(y.target) && o(!1);
2448
2452
  };
2449
2453
  return document.addEventListener("mousedown", f), () => document.removeEventListener("mousedown", f);
2450
2454
  }, []);
2451
- const b = F(() => {
2455
+ const g = F(() => {
2452
2456
  const f = r.type === "and" ? "or" : "and";
2453
2457
  i({ ...r, type: f });
2454
2458
  }, [r, i]), c = F((f, y) => {
@@ -2471,7 +2475,7 @@ function Jc({
2471
2475
  /* @__PURE__ */ e(
2472
2476
  "button",
2473
2477
  {
2474
- onClick: b,
2478
+ onClick: g,
2475
2479
  className: `dc:px-2 dc:py-0.5 dc:text-xs dc:font-semibold dc:rounded dc:transition-colors ${r.type === "and" ? "bg-dc-info-bg text-dc-info dc:hover:opacity-80" : "bg-dc-warning-bg text-dc-warning dc:hover:opacity-80"}`,
2476
2480
  title: `Click to switch to ${r.type === "and" ? "OR" : "AND"}`,
2477
2481
  children: r.type.toUpperCase()
@@ -2488,13 +2492,13 @@ function Jc({
2488
2492
  /* @__PURE__ */ e(
2489
2493
  "button",
2490
2494
  {
2491
- onClick: () => o(!g),
2495
+ onClick: () => o(!b),
2492
2496
  className: "dc:p-1 text-dc-text-secondary hover:text-dc-primary hover:bg-dc-surface-hover dc:rounded dc:transition-colors",
2493
2497
  title: "Add condition",
2494
- children: /* @__PURE__ */ e(Ln, { className: "dc:w-4 dc:h-4" })
2498
+ children: /* @__PURE__ */ e(qn, { className: "dc:w-4 dc:h-4" })
2495
2499
  }
2496
2500
  ),
2497
- g && /* @__PURE__ */ t("div", { className: "dc:absolute dc:right-0 dc:mt-1 dc:z-40 bg-dc-surface dc:border border-dc-border dc:rounded dc:shadow-lg dc:py-1 dc:min-w-[120px]", children: [
2501
+ b && /* @__PURE__ */ t("div", { className: "dc:absolute dc:right-0 dc:mt-1 dc:z-40 bg-dc-surface dc:border border-dc-border dc:rounded dc:shadow-lg dc:py-1 dc:min-w-[120px]", children: [
2498
2502
  /* @__PURE__ */ e(
2499
2503
  "button",
2500
2504
  {
@@ -2527,7 +2531,7 @@ function Jc({
2527
2531
  onClick: s,
2528
2532
  className: "dc:p-1 text-dc-text-muted hover:text-dc-danger dc:transition-colors",
2529
2533
  title: "Remove group",
2530
- children: /* @__PURE__ */ e(Bn, { className: "dc:w-4 dc:h-4" })
2534
+ children: /* @__PURE__ */ e(jn, { className: "dc:w-4 dc:h-4" })
2531
2535
  }
2532
2536
  )
2533
2537
  ] })
@@ -2542,7 +2546,7 @@ function Jc({
2542
2546
  children: "Add a filter"
2543
2547
  }
2544
2548
  )
2545
- ] }) : r.filters.map((f, y) => Pn(f) ? /* @__PURE__ */ e(
2549
+ ] }) : r.filters.map((f, y) => Qn(f) ? /* @__PURE__ */ e(
2546
2550
  Yc,
2547
2551
  {
2548
2552
  filter: f,
@@ -2551,7 +2555,7 @@ function Jc({
2551
2555
  onRemove: () => h(y)
2552
2556
  },
2553
2557
  `filter-${y}`
2554
- ) : Mn(f) ? /* @__PURE__ */ e(
2558
+ ) : Gn(f) ? /* @__PURE__ */ e(
2555
2559
  Jc,
2556
2560
  {
2557
2561
  group: f,
@@ -2565,7 +2569,7 @@ function Jc({
2565
2569
  ) : null) })
2566
2570
  ] });
2567
2571
  }
2568
- const qn = $("add");
2572
+ const _n = $("add");
2569
2573
  function Dt(r) {
2570
2574
  return "member" in r && typeof r.member == "string";
2571
2575
  }
@@ -2606,7 +2610,7 @@ function ze({
2606
2610
  onFieldDropped: s,
2607
2611
  dimensionsOnly: m = !1
2608
2612
  }) {
2609
- const [n, x] = _(!1), [g, o] = _(!1), l = Z([]), b = Wc(r), c = F((w) => {
2613
+ const [n, x] = _(!1), [b, o] = _(!1), l = Z([]), g = Wc(r), c = F((w) => {
2610
2614
  w.preventDefault(), w.stopPropagation(), o(!0);
2611
2615
  }, []), h = F((w) => {
2612
2616
  w.preventDefault(), w.stopPropagation(), o(!1);
@@ -2688,14 +2692,14 @@ function ze({
2688
2692
  children: [
2689
2693
  /* @__PURE__ */ t(ue, { children: [
2690
2694
  "Filter",
2691
- b > 0 && /* @__PURE__ */ t("span", { className: "dc:ml-1.5 dc:text-xs dc:font-normal text-dc-text-muted dc:normal-case dc:tracking-normal", children: [
2695
+ g > 0 && /* @__PURE__ */ t("span", { className: "dc:ml-1.5 dc:text-xs dc:font-normal text-dc-text-muted dc:normal-case dc:tracking-normal", children: [
2692
2696
  "(",
2693
- b,
2697
+ g,
2694
2698
  ")"
2695
2699
  ] })
2696
2700
  ] }),
2697
2701
  /* @__PURE__ */ t("div", { className: "dc:flex dc:items-center dc:gap-2", children: [
2698
- b > 0 && /* @__PURE__ */ e(
2702
+ g > 0 && /* @__PURE__ */ e(
2699
2703
  "span",
2700
2704
  {
2701
2705
  role: "button",
@@ -2710,7 +2714,7 @@ function ze({
2710
2714
  children: "Clear all"
2711
2715
  }
2712
2716
  ),
2713
- /* @__PURE__ */ e(qn, { className: "dc:w-5 dc:h-5 text-dc-text-secondary group-hover:text-dc-primary dc:transition-colors" })
2717
+ /* @__PURE__ */ e(_n, { className: "dc:w-5 dc:h-5 text-dc-text-secondary group-hover:text-dc-primary dc:transition-colors" })
2714
2718
  ] })
2715
2719
  ]
2716
2720
  }
@@ -2721,8 +2725,8 @@ function ze({
2721
2725
  onDragOver: s ? c : void 0,
2722
2726
  onDragLeave: s ? h : void 0,
2723
2727
  onDrop: s ? N : void 0,
2724
- className: `dc:p-2 dc:-mx-2 dc:rounded-lg dc:border-2 dc:border-dashed dc:transition-all ${g ? "border-dc-primary bg-dc-primary/5" : "border-transparent"}`,
2725
- children: r.length === 0 ? /* @__PURE__ */ e("p", { className: `dc:text-sm ${g ? "text-dc-primary dc:font-medium" : "text-dc-text-muted"}`, children: g ? "Drop to add filter" : "No filters applied" }) : /* @__PURE__ */ e("div", { className: "dc:flex dc:flex-wrap dc:gap-2", children: r.map((w, D) => y(w, D)) })
2728
+ className: `dc:p-2 dc:-mx-2 dc:rounded-lg dc:border-2 dc:border-dashed dc:transition-all ${b ? "border-dc-primary bg-dc-primary/5" : "border-transparent"}`,
2729
+ children: r.length === 0 ? /* @__PURE__ */ e("p", { className: `dc:text-sm ${b ? "text-dc-primary dc:font-medium" : "text-dc-text-muted"}`, children: b ? "Drop to add filter" : "No filters applied" }) : /* @__PURE__ */ e("div", { className: "dc:flex dc:flex-wrap dc:gap-2", children: r.map((w, D) => y(w, D)) })
2726
2730
  }
2727
2731
  ),
2728
2732
  /* @__PURE__ */ e(
@@ -2740,8 +2744,8 @@ function ze({
2740
2744
  )
2741
2745
  ] });
2742
2746
  }
2743
- const jn = $("close"), Qn = $("dimension"), Gn = $("timeDimension"), _n = $("measure");
2744
- function Hn({
2747
+ const Hn = $("close"), Kn = $("dimension"), Vn = $("timeDimension"), zn = $("measure");
2748
+ function Yn({
2745
2749
  config: r,
2746
2750
  fields: d,
2747
2751
  onDrop: i,
@@ -2749,10 +2753,10 @@ function Hn({
2749
2753
  onDragStart: m,
2750
2754
  onDragEnd: n,
2751
2755
  onDragOver: x,
2752
- onReorder: g,
2756
+ onReorder: b,
2753
2757
  draggedItem: o,
2754
2758
  getFieldMeta: l,
2755
- yAxisAssignment: b,
2759
+ yAxisAssignment: g,
2756
2760
  onYAxisAssignmentChange: c
2757
2761
  }) {
2758
2762
  const { key: h, label: N, description: k, mandatory: R, maxItems: A, emptyText: B } = r, [u, a] = _(null), [f, y] = _(!1), [w, D] = _(!1), p = Z(null), L = Z(null), P = Z(d);
@@ -2789,8 +2793,8 @@ function Hn({
2789
2793
  }
2790
2794
  I.stopPropagation();
2791
2795
  const X = o.fromIndex, oe = G > X ? G - 1 : G;
2792
- g && oe !== X && g(X, oe, h), a(null), S.current = null, D(!1);
2793
- }, [o, h, g]), U = F((I, G) => {
2796
+ b && oe !== X && b(X, oe, h), a(null), S.current = null, D(!1);
2797
+ }, [o, h, b]), U = F((I, G) => {
2794
2798
  const te = L.current;
2795
2799
  if (te && p.current === G) {
2796
2800
  const X = te.getBoundingClientRect();
@@ -2821,9 +2825,9 @@ function Hn({
2821
2825
  };
2822
2826
  }, W = (I) => {
2823
2827
  if (I.type === "measure") {
2824
- const G = nc(I.measureType || "count") || _n;
2828
+ const G = nc(I.measureType || "count") || zn;
2825
2829
  return /* @__PURE__ */ e("span", { className: "dc:w-6 dc:h-6 dc:flex dc:items-center dc:justify-center dc:rounded bg-dc-measure text-dc-measure-text dc:flex-shrink-0", children: /* @__PURE__ */ e(G, { className: "dc:w-4 dc:h-4" }) });
2826
- } else return I.type === "timeDimension" ? /* @__PURE__ */ e("span", { className: "dc:w-6 dc:h-6 dc:flex dc:items-center dc:justify-center dc:rounded bg-dc-time-dimension text-dc-time-dimension-text dc:flex-shrink-0", children: /* @__PURE__ */ e(Gn, { className: "dc:w-4 dc:h-4" }) }) : /* @__PURE__ */ e("span", { className: "dc:w-6 dc:h-6 dc:flex dc:items-center dc:justify-center dc:rounded bg-dc-dimension text-dc-dimension-text dc:flex-shrink-0", children: /* @__PURE__ */ e(Qn, { className: "dc:w-4 dc:h-4" }) });
2830
+ } else return I.type === "timeDimension" ? /* @__PURE__ */ e("span", { className: "dc:w-6 dc:h-6 dc:flex dc:items-center dc:justify-center dc:rounded bg-dc-time-dimension text-dc-time-dimension-text dc:flex-shrink-0", children: /* @__PURE__ */ e(Vn, { className: "dc:w-4 dc:h-4" }) }) : /* @__PURE__ */ e("span", { className: "dc:w-6 dc:h-6 dc:flex dc:items-center dc:justify-center dc:rounded bg-dc-dimension text-dc-dimension-text dc:flex-shrink-0", children: /* @__PURE__ */ e(Kn, { className: "dc:w-4 dc:h-4" }) });
2827
2831
  };
2828
2832
  return /* @__PURE__ */ t("div", { className: "dc:mb-3", children: [
2829
2833
  /* @__PURE__ */ t("div", { className: "dc:mb-2", children: [
@@ -2903,12 +2907,12 @@ function Hn({
2903
2907
  type: "button",
2904
2908
  onClick: (le) => {
2905
2909
  le.stopPropagation();
2906
- const we = b?.[I] || "left";
2910
+ const we = g?.[I] || "left";
2907
2911
  c(I, we === "left" ? "right" : "left");
2908
2912
  },
2909
- className: `dc:px-1.5 dc:py-0.5 dc:text-xs dc:font-medium dc:rounded dc:transition-colors dc:flex-shrink-0 ${(b?.[I] || "left") === "left" ? "bg-dc-info-bg text-dc-info dc:hover:opacity-80" : "bg-dc-accent-bg text-dc-accent dc:hover:opacity-80"}`,
2910
- title: `Y-Axis: ${(b?.[I] || "left") === "left" ? "Left" : "Right"} (click to toggle)`,
2911
- children: (b?.[I] || "left") === "left" ? "L" : "R"
2913
+ className: `dc:px-1.5 dc:py-0.5 dc:text-xs dc:font-medium dc:rounded dc:transition-colors dc:flex-shrink-0 ${(g?.[I] || "left") === "left" ? "bg-dc-info-bg text-dc-info dc:hover:opacity-80" : "bg-dc-accent-bg text-dc-accent dc:hover:opacity-80"}`,
2914
+ title: `Y-Axis: ${(g?.[I] || "left") === "left" ? "Left" : "Right"} (click to toggle)`,
2915
+ children: (g?.[I] || "left") === "left" ? "L" : "R"
2912
2916
  }
2913
2917
  ),
2914
2918
  /* @__PURE__ */ e(
@@ -2918,7 +2922,7 @@ function Hn({
2918
2922
  onClick: () => s(I, h),
2919
2923
  className: "dc:p-1 text-dc-text-muted hover:text-dc-danger dc:opacity-0 dc:group-hover:opacity-100 dc:transition-opacity dc:flex-shrink-0",
2920
2924
  title: `Remove from ${N}`,
2921
- children: /* @__PURE__ */ e(jn, { className: "dc:w-4 dc:h-4" })
2925
+ children: /* @__PURE__ */ e(Hn, { className: "dc:w-4 dc:h-4" })
2922
2926
  }
2923
2927
  )
2924
2928
  ]
@@ -2974,12 +2978,16 @@ const dc = {
2974
2978
  heatmap: en,
2975
2979
  retentionHeatmap: tn,
2976
2980
  retentionCombined: cn,
2977
- boxPlot: dn
2981
+ boxPlot: dn,
2982
+ waterfall: nn,
2983
+ candlestick: rn,
2984
+ measureProfile: sn,
2985
+ gauge: an
2978
2986
  };
2979
2987
  function pt(r) {
2980
2988
  return dc[r]?.label || r;
2981
2989
  }
2982
- function gc({
2990
+ function bc({
2983
2991
  selectedType: r,
2984
2992
  onTypeChange: d,
2985
2993
  className: i = "",
@@ -2987,21 +2995,21 @@ function gc({
2987
2995
  availability: m,
2988
2996
  excludeTypes: n = []
2989
2997
  }) {
2990
- const [x, g] = _(!1), o = z(
2998
+ const [x, b] = _(!1), o = z(
2991
2999
  () => Object.keys(dc).filter((c) => !n.includes(c)).sort((c, h) => pt(c).localeCompare(pt(h))),
2992
3000
  [n]
2993
- ), l = oc(r), b = pt(r);
3001
+ ), l = oc(r), g = pt(r);
2994
3002
  return /* @__PURE__ */ t("div", { className: `${i} dc:relative`, children: [
2995
3003
  /* @__PURE__ */ t(
2996
3004
  "button",
2997
3005
  {
2998
3006
  type: "button",
2999
- onClick: () => g(!x),
3007
+ onClick: () => b(!x),
3000
3008
  className: "dc:w-full dc:flex dc:items-center dc:justify-between dc:px-3 dc:py-2 dc:border border-dc-border dc:rounded-md bg-dc-surface hover:bg-dc-surface-hover focus:outline-hidden dc:focus:ring-2 focus:ring-dc-accent focus:border-dc-accent",
3001
3009
  children: [
3002
3010
  /* @__PURE__ */ t("div", { className: "dc:flex dc:items-center dc:space-x-2", children: [
3003
3011
  l && /* @__PURE__ */ e(l, { className: "dc:h-5 dc:w-5 text-dc-text-secondary" }),
3004
- /* @__PURE__ */ e("span", { className: "dc:text-sm dc:font-medium text-dc-text", children: b })
3012
+ /* @__PURE__ */ e("span", { className: "dc:text-sm dc:font-medium text-dc-text", children: g })
3005
3013
  ] }),
3006
3014
  /* @__PURE__ */ e(
3007
3015
  "svg",
@@ -3023,7 +3031,7 @@ function gc({
3023
3031
  {
3024
3032
  type: "button",
3025
3033
  onClick: () => {
3026
- a && (d(c), g(!1));
3034
+ a && (d(c), b(!1));
3027
3035
  },
3028
3036
  disabled: !a,
3029
3037
  className: `
@@ -3060,8 +3068,8 @@ function gc({
3060
3068
  }) }) }) })
3061
3069
  ] });
3062
3070
  }
3063
- const Kn = $("measure"), Vn = $("dimension"), zn = $("timeDimension");
3064
- function Yn({
3071
+ const Jn = $("measure"), Wn = $("dimension"), Un = $("timeDimension");
3072
+ function Xn({
3065
3073
  chartType: r,
3066
3074
  chartConfig: d,
3067
3075
  metrics: i,
@@ -3069,34 +3077,34 @@ function Yn({
3069
3077
  schema: m,
3070
3078
  chartAvailability: n,
3071
3079
  onChartTypeChange: x,
3072
- onChartConfigChange: g
3080
+ onChartConfigChange: b
3073
3081
  }) {
3074
- const [o, l] = _(null), b = z(
3082
+ const [o, l] = _(null), g = z(
3075
3083
  () => ({
3076
3084
  measures: i.map((v) => v.field),
3077
3085
  dimensions: s.filter((v) => !v.isTimeDimension).map((v) => v.field),
3078
3086
  timeDimensions: s.filter((v) => v.isTimeDimension).map((v) => v.field)
3079
3087
  }),
3080
3088
  [i, s]
3081
- ), { config: c, loaded: h } = nn(r), N = c.skipQuery === !0, k = F((v) => {
3089
+ ), { config: c, loaded: h } = on(r), N = c.skipQuery === !0, k = F((v) => {
3082
3090
  const T = d[v];
3083
3091
  return Array.isArray(T) ? T : typeof T == "string" ? [T] : [];
3084
3092
  }, [d]);
3085
3093
  Y(() => {
3086
3094
  if (!h) return;
3087
3095
  const v = [
3088
- ...b.dimensions,
3089
- ...b.timeDimensions,
3090
- ...b.measures
3096
+ ...g.dimensions,
3097
+ ...g.timeDimensions,
3098
+ ...g.measures
3091
3099
  ];
3092
3100
  let T = !1;
3093
3101
  const E = { ...d };
3094
3102
  c.dropZones.forEach((M) => {
3095
3103
  const j = k(M.key), q = j.filter((U) => v.includes(U));
3096
3104
  q.length !== j.length && (T = !0, q.length === 0 ? delete E[M.key] : M.maxItems === 1 ? E[M.key] = q[0] : E[M.key] = q);
3097
- }), T && g(E);
3098
- }, [b, d, c.dropZones, g, k, h]);
3099
- const R = (v) => b.measures.includes(v) ? "measure" : b.timeDimensions.includes(v) ? "timeDimension" : "dimension", A = (v) => {
3105
+ }), T && b(E);
3106
+ }, [g, d, c.dropZones, b, k, h]);
3107
+ const R = (v) => g.measures.includes(v) ? "measure" : g.timeDimensions.includes(v) ? "timeDimension" : "dimension", A = (v) => {
3100
3108
  if (!m?.cubes) return null;
3101
3109
  const [T] = v.split("."), E = m.cubes.find((q) => q.name === T);
3102
3110
  if (!E) return null;
@@ -3147,7 +3155,7 @@ function Yn({
3147
3155
  [M]: pe === 1 ? "right" : "left"
3148
3156
  });
3149
3157
  }
3150
- l(null), g(q);
3158
+ l(null), b(q);
3151
3159
  }, w = (v, T) => {
3152
3160
  const E = { ...d }, M = E[T];
3153
3161
  if (Array.isArray(M)) {
@@ -3158,16 +3166,16 @@ function Yn({
3158
3166
  const { [v]: j, ...q } = E.yAxisAssignment;
3159
3167
  E.yAxisAssignment = Object.keys(q).length > 0 ? q : void 0;
3160
3168
  }
3161
- g(E);
3169
+ b(E);
3162
3170
  }, D = (v, T, E) => {
3163
3171
  const M = { ...d }, j = M[E];
3164
3172
  if (Array.isArray(j) && j.length > 1 && v !== T) {
3165
3173
  const q = [...j], [U] = q.splice(v, 1);
3166
- q.splice(T, 0, U), M[E] = q, l(null), g(M);
3174
+ q.splice(T, 0, U), M[E] = q, l(null), b(M);
3167
3175
  }
3168
3176
  }, p = F(
3169
3177
  (v, T) => {
3170
- g({
3178
+ b({
3171
3179
  ...d,
3172
3180
  yAxisAssignment: {
3173
3181
  ...d.yAxisAssignment,
@@ -3175,14 +3183,14 @@ function Yn({
3175
3183
  }
3176
3184
  });
3177
3185
  },
3178
- [d, g]
3186
+ [d, b]
3179
3187
  );
3180
3188
  if (!h)
3181
3189
  return /* @__PURE__ */ t("div", { className: "dc:space-y-6", children: [
3182
3190
  /* @__PURE__ */ t("div", { children: [
3183
3191
  /* @__PURE__ */ e(ue, { className: "dc:mb-2", children: "Chart Type" }),
3184
3192
  /* @__PURE__ */ e(
3185
- gc,
3193
+ bc,
3186
3194
  {
3187
3195
  selectedType: r,
3188
3196
  onTypeChange: x,
@@ -3199,16 +3207,16 @@ function Yn({
3199
3207
  return c.dropZones.forEach((T) => {
3200
3208
  k(T.key).forEach((E) => v.add(E));
3201
3209
  }), o && o.fromAxis !== "available" && v.add(o.field), {
3202
- dimensions: b.dimensions.filter((T) => !v.has(T)),
3203
- timeDimensions: b.timeDimensions.filter((T) => !v.has(T)),
3204
- measures: b.measures.filter((T) => !v.has(T))
3210
+ dimensions: g.dimensions.filter((T) => !v.has(T)),
3211
+ timeDimensions: g.timeDimensions.filter((T) => !v.has(T)),
3212
+ measures: g.measures.filter((T) => !v.has(T))
3205
3213
  };
3206
3214
  })(), S = P.dimensions.length > 0 || P.timeDimensions.length > 0 || P.measures.length > 0;
3207
3215
  return /* @__PURE__ */ t("div", { className: "dc:space-y-6", children: [
3208
3216
  /* @__PURE__ */ t("div", { children: [
3209
3217
  /* @__PURE__ */ e(ue, { className: "dc:mb-2", children: "Chart Type" }),
3210
3218
  /* @__PURE__ */ e(
3211
- gc,
3219
+ bc,
3212
3220
  {
3213
3221
  selectedType: r,
3214
3222
  onTypeChange: x,
@@ -3221,7 +3229,7 @@ function Yn({
3221
3229
  !N && c.dropZones.length > 0 && /* @__PURE__ */ t("div", { children: [
3222
3230
  /* @__PURE__ */ e(ue, { className: "dc:mb-2", children: "Chart Configuration" }),
3223
3231
  /* @__PURE__ */ e("div", { className: "dc:space-y-1", children: c.dropZones.map((v) => /* @__PURE__ */ e(
3224
- Hn,
3232
+ Yn,
3225
3233
  {
3226
3234
  config: v,
3227
3235
  fields: k(v.key),
@@ -3246,7 +3254,7 @@ function Yn({
3246
3254
  ] }),
3247
3255
  /* @__PURE__ */ e("div", { className: "dc:border-2 dc:border-dashed border-dc-border dc:rounded-lg dc:p-2 bg-dc-surface-secondary", children: /* @__PURE__ */ t("div", { className: "dc:space-y-2", children: [
3248
3256
  P.measures.map((v) => {
3249
- const T = B(v), E = o && o.field === v && o.fromAxis === "available", M = nc(T.measureType || "count") || Kn;
3257
+ const T = B(v), E = o && o.field === v && o.fromAxis === "available", M = nc(T.measureType || "count") || Jn;
3250
3258
  return /* @__PURE__ */ t(
3251
3259
  "div",
3252
3260
  {
@@ -3277,7 +3285,7 @@ function Yn({
3277
3285
  className: `dc:flex dc:items-center dc:gap-2 dc:p-2 bg-dc-surface dc:rounded-lg hover:bg-dc-surface-tertiary dc:transition-colors dc:cursor-move ${E ? "dc:opacity-50 dc:cursor-grabbing" : ""}`,
3278
3286
  title: v,
3279
3287
  children: [
3280
- /* @__PURE__ */ e("span", { className: "dc:w-6 dc:h-6 dc:flex dc:items-center dc:justify-center dc:rounded bg-dc-dimension text-dc-dimension-text dc:flex-shrink-0", children: /* @__PURE__ */ e(Vn, { className: "dc:w-4 dc:h-4" }) }),
3288
+ /* @__PURE__ */ e("span", { className: "dc:w-6 dc:h-6 dc:flex dc:items-center dc:justify-center dc:rounded bg-dc-dimension text-dc-dimension-text dc:flex-shrink-0", children: /* @__PURE__ */ e(Wn, { className: "dc:w-4 dc:h-4" }) }),
3281
3289
  /* @__PURE__ */ t("div", { className: "dc:flex-1 dc:min-w-0", children: [
3282
3290
  /* @__PURE__ */ e("div", { className: "dc:text-sm text-dc-text dc:truncate", children: T.shortTitle }),
3283
3291
  /* @__PURE__ */ e("div", { className: "dc:text-xs text-dc-text-muted dc:truncate", children: T.cubeName })
@@ -3298,7 +3306,7 @@ function Yn({
3298
3306
  className: `dc:flex dc:items-center dc:gap-2 dc:p-2 bg-dc-surface dc:rounded-lg hover:bg-dc-surface-tertiary dc:transition-colors dc:cursor-move ${E ? "dc:opacity-50 dc:cursor-grabbing" : ""}`,
3299
3307
  title: v,
3300
3308
  children: [
3301
- /* @__PURE__ */ e("span", { className: "dc:w-6 dc:h-6 dc:flex dc:items-center dc:justify-center dc:rounded bg-dc-time-dimension text-dc-time-dimension-text dc:flex-shrink-0", children: /* @__PURE__ */ e(zn, { className: "dc:w-4 dc:h-4" }) }),
3309
+ /* @__PURE__ */ e("span", { className: "dc:w-6 dc:h-6 dc:flex dc:items-center dc:justify-center dc:rounded bg-dc-time-dimension text-dc-time-dimension-text dc:flex-shrink-0", children: /* @__PURE__ */ e(Un, { className: "dc:w-4 dc:h-4" }) }),
3302
3310
  /* @__PURE__ */ t("div", { className: "dc:flex-1 dc:min-w-0", children: [
3303
3311
  /* @__PURE__ */ e("div", { className: "dc:text-sm text-dc-text dc:truncate", children: T.shortTitle }),
3304
3312
  /* @__PURE__ */ e("div", { className: "dc:text-xs text-dc-text-muted dc:truncate", children: T.cubeName })
@@ -3310,17 +3318,17 @@ function Yn({
3310
3318
  })
3311
3319
  ] }) })
3312
3320
  ] }),
3313
- !N && b.measures.length === 0 && b.dimensions.length === 0 && b.timeDimensions.length === 0 && /* @__PURE__ */ e("div", { className: "dc:text-center text-dc-text-muted dc:text-sm dc:py-4", children: /* @__PURE__ */ e("p", { children: "Add metrics and breakdowns in the Query tab to configure your chart." }) })
3321
+ !N && g.measures.length === 0 && g.dimensions.length === 0 && g.timeDimensions.length === 0 && /* @__PURE__ */ e("div", { className: "dc:text-center text-dc-text-muted dc:text-sm dc:py-4", children: /* @__PURE__ */ e("p", { children: "Add metrics and breakdowns in the Query tab to configure your chart." }) })
3314
3322
  ] });
3315
3323
  }
3316
- const yc = $("chevronDown"), vc = $("check"), Nc = $("search"), Jn = me(function({
3324
+ const yc = $("chevronDown"), vc = $("check"), Nc = $("search"), Zn = me(function({
3317
3325
  bindingKey: d,
3318
3326
  onChange: i,
3319
3327
  schema: s,
3320
3328
  disabled: m = !1,
3321
3329
  className: n = ""
3322
3330
  }) {
3323
- const [x, g] = _(!1), [o, l] = _(""), b = Z(null), c = Z(null), h = z(() => Ct(s), [s]), N = z(() => {
3331
+ const [x, b] = _(!1), [o, l] = _(""), g = Z(null), c = Z(null), h = z(() => Ct(s), [s]), N = z(() => {
3324
3332
  const f = {};
3325
3333
  for (const y of h)
3326
3334
  f[y.cube] || (f[y.cube] = []), f[y.cube].push(y);
@@ -3337,7 +3345,7 @@ const yc = $("chevronDown"), vc = $("check"), Nc = $("search"), Jn = me(function
3337
3345
  return y;
3338
3346
  }, [N, o]), R = F(
3339
3347
  (f) => {
3340
- i({ dimension: f }), g(!1), l("");
3348
+ i({ dimension: f }), b(!1), l("");
3341
3349
  },
3342
3350
  [i]
3343
3351
  ), A = F(
@@ -3348,7 +3356,7 @@ const yc = $("chevronDown"), vc = $("check"), Nc = $("search"), Jn = me(function
3348
3356
  );
3349
3357
  Y(() => {
3350
3358
  function f(y) {
3351
- b.current && !b.current.contains(y.target) && (g(!1), l(""));
3359
+ g.current && !g.current.contains(y.target) && (b(!1), l(""));
3352
3360
  }
3353
3361
  if (x)
3354
3362
  return document.addEventListener("mousedown", f), () => document.removeEventListener("mousedown", f);
@@ -3359,12 +3367,12 @@ const yc = $("chevronDown"), vc = $("check"), Nc = $("search"), Jn = me(function
3359
3367
  (f) => d ? typeof d.dimension == "string" ? d.dimension === f : d.dimension.some((y) => y.dimension === f) : !1,
3360
3368
  [d]
3361
3369
  ), u = Nd(d), a = d?.dimension !== null && d?.dimension !== void 0;
3362
- return /* @__PURE__ */ e("div", { className: n, children: /* @__PURE__ */ t("div", { ref: b, className: "dc:relative", children: [
3370
+ return /* @__PURE__ */ e("div", { className: n, children: /* @__PURE__ */ t("div", { ref: g, className: "dc:relative", children: [
3363
3371
  /* @__PURE__ */ t(
3364
3372
  "button",
3365
3373
  {
3366
3374
  type: "button",
3367
- onClick: () => !m && g(!x),
3375
+ onClick: () => !m && b(!x),
3368
3376
  disabled: m,
3369
3377
  className: `
3370
3378
  dc:flex dc:items-center dc:justify-between dc:w-full dc:px-2 dc:py-1 dc:text-xs
@@ -3435,46 +3443,46 @@ const yc = $("chevronDown"), vc = $("check"), Nc = $("search"), Jn = me(function
3435
3443
  /* @__PURE__ */ e("div", { className: "dc:px-3 dc:py-2 dc:border-t border-dc-border dc:text-xs text-dc-text-muted", children: "Select a dimension that identifies entities across funnel steps (e.g., user ID, order ID)" })
3436
3444
  ] })
3437
3445
  ] }) });
3438
- }), Wn = $("chartBar"), Un = $("chartFunnel"), Xn = $("chartSankey"), Zn = $("chartRetention"), er = [
3446
+ }), er = $("chartBar"), tr = $("chartFunnel"), cr = $("chartSankey"), dr = $("chartRetention"), nr = [
3439
3447
  {
3440
3448
  type: "query",
3441
3449
  label: "Query",
3442
3450
  description: "Standard analysis (single or multi-query)",
3443
- icon: Wn
3451
+ icon: er
3444
3452
  },
3445
3453
  {
3446
3454
  type: "funnel",
3447
3455
  label: "Funnel",
3448
3456
  description: "Sequential conversion analysis",
3449
- icon: Un
3457
+ icon: tr
3450
3458
  },
3451
3459
  {
3452
3460
  type: "flow",
3453
3461
  label: "Flow",
3454
3462
  description: "Bidirectional path analysis with Sankey visualization",
3455
- icon: Xn
3463
+ icon: cr
3456
3464
  },
3457
3465
  {
3458
3466
  type: "retention",
3459
3467
  label: "Retention",
3460
3468
  description: "Cohort-based retention analysis over time periods",
3461
- icon: Zn
3469
+ icon: dr
3462
3470
  }
3463
- ], tr = me(function({
3471
+ ], rr = me(function({
3464
3472
  value: d,
3465
3473
  onChange: i,
3466
3474
  disabled: s = !1,
3467
3475
  schema: m
3468
3476
  }) {
3469
- const n = z(() => m?.cubes?.some((g) => g.meta?.eventStream) ?? !1, [m]), x = z(() => er.filter((g) => g.type === "query" ? !0 : n), [n]);
3470
- return /* @__PURE__ */ e("div", { className: "dc:flex dc:items-center dc:gap-0.5 dc:p-1.5 dc:border-b border-dc-border bg-dc-surface", children: x.map((g) => {
3471
- const o = d === g.type, l = g.icon;
3477
+ const n = z(() => m?.cubes?.some((b) => b.meta?.eventStream) ?? !1, [m]), x = z(() => nr.filter((b) => b.type === "query" ? !0 : n), [n]);
3478
+ return /* @__PURE__ */ e("div", { className: "dc:flex dc:items-center dc:gap-0.5 dc:p-1.5 dc:border-b border-dc-border bg-dc-surface", children: x.map((b) => {
3479
+ const o = d === b.type, l = b.icon;
3472
3480
  return /* @__PURE__ */ t(
3473
3481
  "button",
3474
3482
  {
3475
- onClick: () => !s && i(g.type),
3483
+ onClick: () => !s && i(b.type),
3476
3484
  disabled: s,
3477
- title: g.description,
3485
+ title: b.description,
3478
3486
  className: `
3479
3487
  dc:flex dc:items-center dc:gap-1 dc:px-2 dc:py-1.5 dc:rounded-md dc:text-sm dc:font-medium
3480
3488
  dc:transition-colors dc:duration-150
@@ -3483,14 +3491,14 @@ const yc = $("chevronDown"), vc = $("check"), Nc = $("search"), Jn = me(function
3483
3491
  `,
3484
3492
  children: [
3485
3493
  /* @__PURE__ */ e(l, { className: "dc:h-4 dc:w-4 dc:flex-shrink-0" }),
3486
- /* @__PURE__ */ e("span", { className: "dc:truncate", children: g.label })
3494
+ /* @__PURE__ */ e("span", { className: "dc:truncate", children: b.label })
3487
3495
  ]
3488
3496
  },
3489
- g.type
3497
+ b.type
3490
3498
  );
3491
3499
  }) });
3492
- }), bt = $("chevronDown"), wc = $("chevronRight"), gt = $("check"), Cc = $("search"), cr = $("dimension"), dr = $("link"), nr = $("timeDimension");
3493
- function rr(r) {
3500
+ }), gt = $("chevronDown"), wc = $("chevronRight"), bt = $("check"), Cc = $("search"), sr = $("dimension"), ar = $("link"), ir = $("timeDimension");
3501
+ function or(r) {
3494
3502
  return r?.cubes ? r.cubes.filter((d) => d.meta?.eventStream).map((d) => ({
3495
3503
  cube: d.name,
3496
3504
  dimension: d.name,
@@ -3499,7 +3507,7 @@ function rr(r) {
3499
3507
  eventStream: d.meta?.eventStream
3500
3508
  })) : [];
3501
3509
  }
3502
- function sr(r) {
3510
+ function lr(r) {
3503
3511
  if (!r?.cubes) return [];
3504
3512
  const d = [];
3505
3513
  for (const i of r.cubes)
@@ -3518,16 +3526,16 @@ const Zt = me(function({
3518
3526
  icon: m,
3519
3527
  options: n,
3520
3528
  onChange: x,
3521
- helpText: g
3529
+ helpText: b
3522
3530
  }) {
3523
- const [o, l] = _(!1), [b, c] = _(""), h = Z(null), N = Z(null), k = z(() => {
3531
+ const [o, l] = _(!1), [g, c] = _(""), h = Z(null), N = Z(null), k = z(() => {
3524
3532
  const a = {};
3525
3533
  for (const f of n)
3526
3534
  a[f.cube] || (a[f.cube] = []), a[f.cube].push(f);
3527
3535
  return a;
3528
3536
  }, [n]), R = z(() => {
3529
- if (!b.trim()) return k;
3530
- const a = b.toLowerCase(), f = {};
3537
+ if (!g.trim()) return k;
3538
+ const a = g.toLowerCase(), f = {};
3531
3539
  for (const [y, w] of Object.entries(k)) {
3532
3540
  const D = w.filter(
3533
3541
  (p) => p.label.toLowerCase().includes(a) || p.dimension.toLowerCase().includes(a) || y.toLowerCase().includes(a)
@@ -3535,7 +3543,7 @@ const Zt = me(function({
3535
3543
  D.length > 0 && (f[y] = D);
3536
3544
  }
3537
3545
  return f;
3538
- }, [k, b]), A = F(
3546
+ }, [k, g]), A = F(
3539
3547
  (a) => {
3540
3548
  x(a), l(!1), c("");
3541
3549
  },
@@ -3588,8 +3596,8 @@ const Zt = me(function({
3588
3596
  children: "×"
3589
3597
  }
3590
3598
  ),
3591
- bt && /* @__PURE__ */ e(
3592
- bt,
3599
+ gt && /* @__PURE__ */ e(
3600
+ gt,
3593
3601
  {
3594
3602
  className: `dc:w-4 dc:h-4 text-dc-text-muted dc:transition-transform ${o ? "dc:rotate-180" : ""}`
3595
3603
  }
@@ -3606,7 +3614,7 @@ const Zt = me(function({
3606
3614
  {
3607
3615
  ref: N,
3608
3616
  type: "text",
3609
- value: b,
3617
+ value: g,
3610
3618
  onChange: (a) => c(a.target.value),
3611
3619
  placeholder: "Search...",
3612
3620
  className: "dc:w-full dc:pl-8 dc:pr-3 dc:py-1.5 dc:text-sm bg-dc-surface-secondary dc:border border-dc-border dc:rounded text-dc-text placeholder:text-dc-text-muted dc:focus:outline-none dc:focus:ring-1 focus:ring-dc-primary"
@@ -3626,30 +3634,30 @@ const Zt = me(function({
3626
3634
  `,
3627
3635
  children: [
3628
3636
  /* @__PURE__ */ e("span", { children: y.label }),
3629
- d === y.dimension && gt && /* @__PURE__ */ e(gt, { className: "dc:w-4 dc:h-4" })
3637
+ d === y.dimension && bt && /* @__PURE__ */ e(bt, { className: "dc:w-4 dc:h-4" })
3630
3638
  ]
3631
3639
  },
3632
3640
  y.dimension
3633
3641
  ))
3634
3642
  ] }, a)) }),
3635
- /* @__PURE__ */ e("div", { className: "dc:px-3 dc:py-2 dc:border-t border-dc-border dc:text-xs text-dc-text-muted", children: g })
3643
+ /* @__PURE__ */ e("div", { className: "dc:px-3 dc:py-2 dc:border-t border-dc-border dc:text-xs text-dc-text-muted", children: b })
3636
3644
  ] })
3637
3645
  ] })
3638
3646
  ] });
3639
- }), ar = me(function({
3647
+ }), ur = me(function({
3640
3648
  selectedCube: d,
3641
3649
  bindingKey: i,
3642
3650
  timeDimension: s,
3643
3651
  schema: m,
3644
3652
  onCubeChange: n,
3645
3653
  onBindingKeyChange: x,
3646
- onTimeDimensionChange: g
3654
+ onTimeDimensionChange: b
3647
3655
  }) {
3648
- const o = z(() => rr(m), [m]), l = z(() => {
3656
+ const o = z(() => or(m), [m]), l = z(() => {
3649
3657
  const u = Ct(m);
3650
3658
  return d ? u.filter((a) => a.cube === d) : [];
3651
- }, [m, d]), b = z(() => {
3652
- const u = sr(m);
3659
+ }, [m, d]), g = z(() => {
3660
+ const u = lr(m);
3653
3661
  return d ? u.filter((a) => a.cube === d) : [];
3654
3662
  }, [m, d]), c = !!(d && i && s), [h, N] = _(!1), k = Z(!1);
3655
3663
  Y(() => {
@@ -3659,9 +3667,9 @@ const Zt = me(function({
3659
3667
  const u = m.cubes?.find((a) => a.name === d);
3660
3668
  if (u?.meta?.eventStream) {
3661
3669
  const a = u.meta.eventStream;
3662
- !i && a.bindingKey && x({ dimension: a.bindingKey }), !s && a.timeDimension && g(a.timeDimension);
3670
+ !i && a.bindingKey && x({ dimension: a.bindingKey }), !s && a.timeDimension && b(a.timeDimension);
3663
3671
  }
3664
- }, [d, m, i, s, x, g]);
3672
+ }, [d, m, i, s, x, b]);
3665
3673
  const R = i?.dimension ? typeof i.dimension == "string" ? i.dimension : i.dimension[0]?.dimension || null : null, A = F(
3666
3674
  (u) => {
3667
3675
  x(u ? { dimension: u } : null);
@@ -3677,9 +3685,9 @@ const Zt = me(function({
3677
3685
  className: "dc:flex dc:items-center dc:justify-between dc:w-full dc:px-4 dc:py-2.5 hover:bg-dc-surface-hover dc:transition-colors",
3678
3686
  children: [
3679
3687
  /* @__PURE__ */ t("div", { className: "dc:flex dc:items-center dc:gap-2", children: [
3680
- h ? wc && /* @__PURE__ */ e(wc, { className: "dc:w-4 dc:h-4 text-dc-text-muted" }) : bt && /* @__PURE__ */ e(bt, { className: "dc:w-4 dc:h-4 text-dc-text-muted" }),
3688
+ h ? wc && /* @__PURE__ */ e(wc, { className: "dc:w-4 dc:h-4 text-dc-text-muted" }) : gt && /* @__PURE__ */ e(gt, { className: "dc:w-4 dc:h-4 text-dc-text-muted" }),
3681
3689
  /* @__PURE__ */ e(ue, { className: "dc:mb-0", children: "Configuration" }),
3682
- c && /* @__PURE__ */ e("span", { className: "dc:flex dc:items-center dc:gap-1 dc:text-xs text-dc-success", children: gt && /* @__PURE__ */ e(gt, { className: "dc:w-3.5 dc:h-3.5" }) })
3690
+ c && /* @__PURE__ */ e("span", { className: "dc:flex dc:items-center dc:gap-1 dc:text-xs text-dc-success", children: bt && /* @__PURE__ */ e(bt, { className: "dc:w-3.5 dc:h-3.5" }) })
3683
3691
  ] }),
3684
3692
  h && c && /* @__PURE__ */ e("span", { className: "dc:text-xs text-dc-text-muted dc:truncate dc:max-w-[200px]", children: B })
3685
3693
  ]
@@ -3692,7 +3700,7 @@ const Zt = me(function({
3692
3700
  value: d,
3693
3701
  label: "Cube",
3694
3702
  placeholder: "Select event stream cube",
3695
- icon: cr,
3703
+ icon: sr,
3696
3704
  options: o,
3697
3705
  onChange: n,
3698
3706
  helpText: "Select a cube configured for funnel analysis"
@@ -3704,7 +3712,7 @@ const Zt = me(function({
3704
3712
  value: R,
3705
3713
  label: "Binding Key",
3706
3714
  placeholder: d ? "Select binding key" : "Select cube first",
3707
- icon: dr,
3715
+ icon: ar,
3708
3716
  options: l,
3709
3717
  onChange: A,
3710
3718
  helpText: "Entity that connects steps (e.g., user ID, order ID)"
@@ -3716,9 +3724,9 @@ const Zt = me(function({
3716
3724
  value: s,
3717
3725
  label: "Time Dimension",
3718
3726
  placeholder: d ? "Select time dimension" : "Select cube first",
3719
- icon: nr,
3720
- options: b,
3721
- onChange: g,
3727
+ icon: ir,
3728
+ options: g,
3729
+ onChange: b,
3722
3730
  helpText: "Timestamp field for step ordering"
3723
3731
  }
3724
3732
  )
@@ -3735,17 +3743,17 @@ const Zt = me(function({
3735
3743
  { value: "P14D", label: "14 days" },
3736
3744
  { value: "P30D", label: "30 days" },
3737
3745
  { value: "P90D", label: "90 days" }
3738
- ], ir = me(function({
3746
+ ], mr = me(function({
3739
3747
  step: d,
3740
3748
  stepIndex: i,
3741
3749
  isActive: s,
3742
3750
  canRemove: m,
3743
3751
  schema: n,
3744
3752
  onSelect: x,
3745
- onRemove: g,
3753
+ onRemove: b,
3746
3754
  onUpdate: o
3747
3755
  }) {
3748
- const [l, b] = _(!1), [c, h] = _(!1), [N, k] = _(d.name), R = Z(null), A = Z(null);
3756
+ const [l, g] = _(!1), [c, h] = _(!1), [N, k] = _(d.name), R = Z(null), A = Z(null);
3749
3757
  Y(() => {
3750
3758
  k(d.name);
3751
3759
  }, [d.name]), Y(() => {
@@ -3764,12 +3772,12 @@ const Zt = me(function({
3764
3772
  []
3765
3773
  ), u = F(
3766
3774
  (p) => {
3767
- p.key === "Enter" ? p.currentTarget.blur() : p.key === "Escape" && (k(d.name), b(!1));
3775
+ p.key === "Enter" ? p.currentTarget.blur() : p.key === "Escape" && (k(d.name), g(!1));
3768
3776
  },
3769
3777
  [d.name]
3770
3778
  ), a = F(() => {
3771
3779
  const p = N.trim();
3772
- p !== d.name && o({ name: p || `Step ${i + 1}` }), b(!1);
3780
+ p !== d.name && o({ name: p || `Step ${i + 1}` }), g(!1);
3773
3781
  }, [N, d.name, o, i]), f = F(
3774
3782
  (p) => {
3775
3783
  o({ timeToConvert: p || void 0 }), h(!1);
@@ -3819,7 +3827,7 @@ const Zt = me(function({
3819
3827
  "button",
3820
3828
  {
3821
3829
  onClick: (p) => {
3822
- p.stopPropagation(), b(!0);
3830
+ p.stopPropagation(), g(!0);
3823
3831
  },
3824
3832
  className: "dc:flex-1 dc:text-left dc:text-sm dc:font-medium text-dc-text hover:text-dc-primary dc:truncate",
3825
3833
  title: "Click to edit name",
@@ -3830,7 +3838,7 @@ const Zt = me(function({
3830
3838
  "button",
3831
3839
  {
3832
3840
  onClick: (p) => {
3833
- p.stopPropagation(), g();
3841
+ p.stopPropagation(), b();
3834
3842
  },
3835
3843
  className: "dc:p-1 dc:rounded hover:bg-dc-danger-bg text-dc-text-muted hover:text-dc-error dc:transition-colors",
3836
3844
  title: "Remove step",
@@ -3914,26 +3922,26 @@ const Zt = me(function({
3914
3922
  ]
3915
3923
  }
3916
3924
  );
3917
- }), Ic = $("add"), or = me(function({
3925
+ }), Ic = $("add"), hr = me(function({
3918
3926
  steps: d,
3919
3927
  activeStepIndex: i,
3920
3928
  schema: s,
3921
3929
  onAddStep: m,
3922
3930
  onRemoveStep: n,
3923
3931
  onUpdateStep: x,
3924
- onSelectStep: g,
3932
+ onSelectStep: b,
3925
3933
  onReorderSteps: o
3926
3934
  }) {
3927
- const [l, b] = _(null), [c, h] = _(null), N = F((u) => {
3928
- b(u);
3935
+ const [l, g] = _(null), [c, h] = _(null), N = F((u) => {
3936
+ g(u);
3929
3937
  }, []), k = F((u, a) => {
3930
3938
  u.preventDefault(), l !== null && l !== a && h(a);
3931
3939
  }, [l]), R = F(() => {
3932
3940
  h(null);
3933
3941
  }, []), A = F((u, a) => {
3934
- u.preventDefault(), l !== null && l !== a && o(l, a), b(null), h(null);
3942
+ u.preventDefault(), l !== null && l !== a && o(l, a), g(null), h(null);
3935
3943
  }, [l, o]), B = F(() => {
3936
- b(null), h(null);
3944
+ g(null), h(null);
3937
3945
  }, []);
3938
3946
  return /* @__PURE__ */ t("div", { className: "dc:space-y-4", children: [
3939
3947
  /* @__PURE__ */ e("div", { className: "dc:flex dc:items-center dc:justify-between", children: /* @__PURE__ */ t(ue, { children: [
@@ -3968,14 +3976,14 @@ const Zt = me(function({
3968
3976
  onDragEnd: B,
3969
3977
  className: `dc:transition-all ${l === a ? "dc:opacity-50" : ""} ${c === a ? "dc:border-t-2 border-dc-primary dc:pt-1" : ""}`,
3970
3978
  children: /* @__PURE__ */ e(
3971
- ir,
3979
+ mr,
3972
3980
  {
3973
3981
  step: u,
3974
3982
  stepIndex: a,
3975
3983
  isActive: a === i,
3976
3984
  canRemove: d.length > 1,
3977
3985
  schema: s,
3978
- onSelect: () => g(a),
3986
+ onSelect: () => b(a),
3979
3987
  onRemove: () => n(a),
3980
3988
  onUpdate: (f) => x(a, f)
3981
3989
  }
@@ -3996,17 +4004,17 @@ const Zt = me(function({
3996
4004
  ),
3997
4005
  d.length === 1 && /* @__PURE__ */ e("p", { className: "dc:text-xs text-dc-warning dc:text-center", children: "Add at least one more step to create a valid funnel" })
3998
4006
  ] });
3999
- }), lr = me(function({
4007
+ }), fr = me(function({
4000
4008
  funnelCube: d,
4001
4009
  funnelSteps: i,
4002
4010
  activeFunnelStepIndex: s,
4003
4011
  funnelTimeDimension: m,
4004
4012
  funnelBindingKey: n,
4005
4013
  schema: x,
4006
- onCubeChange: g,
4014
+ onCubeChange: b,
4007
4015
  onAddStep: o,
4008
4016
  onRemoveStep: l,
4009
- onUpdateStep: b,
4017
+ onUpdateStep: g,
4010
4018
  onSelectStep: c,
4011
4019
  onReorderSteps: h,
4012
4020
  onTimeDimensionChange: N,
@@ -4041,26 +4049,26 @@ const Zt = me(function({
4041
4049
  ] }),
4042
4050
  a === "steps" ? /* @__PURE__ */ t("div", { className: "dc:flex dc:flex-col dc:flex-1 dc:min-h-0", children: [
4043
4051
  /* @__PURE__ */ e(
4044
- ar,
4052
+ ur,
4045
4053
  {
4046
4054
  selectedCube: d,
4047
4055
  bindingKey: n,
4048
4056
  timeDimension: m,
4049
4057
  schema: x,
4050
- onCubeChange: g,
4058
+ onCubeChange: b,
4051
4059
  onBindingKeyChange: k,
4052
4060
  onTimeDimensionChange: N
4053
4061
  }
4054
4062
  ),
4055
4063
  /* @__PURE__ */ e("div", { className: "dc:flex-1 dc:min-h-0 dc:overflow-auto dc:p-4 dc:pb-24", children: /* @__PURE__ */ e(
4056
- or,
4064
+ hr,
4057
4065
  {
4058
4066
  steps: i,
4059
4067
  activeStepIndex: s,
4060
4068
  schema: x,
4061
4069
  onAddStep: o,
4062
4070
  onRemoveStep: l,
4063
- onUpdateStep: b,
4071
+ onUpdateStep: g,
4064
4072
  onSelectStep: c,
4065
4073
  onReorderSteps: h
4066
4074
  }
@@ -4075,8 +4083,8 @@ const Zt = me(function({
4075
4083
  }
4076
4084
  ) }) : null
4077
4085
  ] });
4078
- }), yt = $("chevronDown"), Rc = $("chevronRight"), vt = $("check"), Fc = $("search"), ur = $("dimension"), mr = $("link"), hr = $("timeDimension"), fr = $("dimension");
4079
- function pr(r) {
4086
+ }), yt = $("chevronDown"), Rc = $("chevronRight"), vt = $("check"), Fc = $("search"), pr = $("dimension"), xr = $("link"), gr = $("timeDimension"), br = $("dimension");
4087
+ function yr(r) {
4080
4088
  return r?.cubes ? r.cubes.filter((d) => d.meta?.eventStream).map((d) => ({
4081
4089
  cube: d.name,
4082
4090
  dimension: d.name,
@@ -4084,7 +4092,7 @@ function pr(r) {
4084
4092
  eventStream: d.meta?.eventStream
4085
4093
  })) : [];
4086
4094
  }
4087
- function xr(r) {
4095
+ function vr(r) {
4088
4096
  if (!r?.cubes) return [];
4089
4097
  const d = [];
4090
4098
  for (const i of r.cubes)
@@ -4096,7 +4104,7 @@ function xr(r) {
4096
4104
  });
4097
4105
  return d;
4098
4106
  }
4099
- function br(r) {
4107
+ function Nr(r) {
4100
4108
  if (!r?.cubes) return [];
4101
4109
  const d = [];
4102
4110
  for (const i of r.cubes)
@@ -4115,16 +4123,16 @@ const xt = me(function({
4115
4123
  icon: m,
4116
4124
  options: n,
4117
4125
  onChange: x,
4118
- helpText: g
4126
+ helpText: b
4119
4127
  }) {
4120
- const [o, l] = _(!1), [b, c] = _(""), h = Z(null), N = Z(null), k = z(() => {
4128
+ const [o, l] = _(!1), [g, c] = _(""), h = Z(null), N = Z(null), k = z(() => {
4121
4129
  const a = {};
4122
4130
  for (const f of n)
4123
4131
  a[f.cube] || (a[f.cube] = []), a[f.cube].push(f);
4124
4132
  return a;
4125
4133
  }, [n]), R = z(() => {
4126
- if (!b.trim()) return k;
4127
- const a = b.toLowerCase(), f = {};
4134
+ if (!g.trim()) return k;
4135
+ const a = g.toLowerCase(), f = {};
4128
4136
  for (const [y, w] of Object.entries(k)) {
4129
4137
  const D = w.filter(
4130
4138
  (p) => p.label.toLowerCase().includes(a) || p.dimension.toLowerCase().includes(a) || y.toLowerCase().includes(a)
@@ -4132,7 +4140,7 @@ const xt = me(function({
4132
4140
  D.length > 0 && (f[y] = D);
4133
4141
  }
4134
4142
  return f;
4135
- }, [k, b]), A = F(
4143
+ }, [k, g]), A = F(
4136
4144
  (a) => {
4137
4145
  x(a), l(!1), c("");
4138
4146
  },
@@ -4203,7 +4211,7 @@ const xt = me(function({
4203
4211
  {
4204
4212
  ref: N,
4205
4213
  type: "text",
4206
- value: b,
4214
+ value: g,
4207
4215
  onChange: (a) => c(a.target.value),
4208
4216
  placeholder: "Search...",
4209
4217
  className: "dc:w-full dc:pl-8 dc:pr-3 dc:py-1.5 dc:text-sm bg-dc-surface-secondary dc:border border-dc-border dc:rounded text-dc-text placeholder:text-dc-text-muted dc:focus:outline-none dc:focus:ring-1 focus:ring-dc-primary"
@@ -4229,29 +4237,29 @@ const xt = me(function({
4229
4237
  y.dimension
4230
4238
  ))
4231
4239
  ] }, a)) }),
4232
- /* @__PURE__ */ e("div", { className: "dc:px-3 dc:py-2 dc:border-t border-dc-border dc:text-xs text-dc-text-muted", children: g })
4240
+ /* @__PURE__ */ e("div", { className: "dc:px-3 dc:py-2 dc:border-t border-dc-border dc:text-xs text-dc-text-muted", children: b })
4233
4241
  ] })
4234
4242
  ] })
4235
4243
  ] });
4236
- }), gr = me(function({
4244
+ }), wr = me(function({
4237
4245
  selectedCube: d,
4238
4246
  bindingKey: i,
4239
4247
  timeDimension: s,
4240
4248
  eventDimension: m,
4241
4249
  schema: n,
4242
4250
  onCubeChange: x,
4243
- onBindingKeyChange: g,
4251
+ onBindingKeyChange: b,
4244
4252
  onTimeDimensionChange: o,
4245
4253
  onEventDimensionChange: l
4246
4254
  }) {
4247
- const b = z(() => pr(n), [n]), c = z(() => {
4255
+ const g = z(() => yr(n), [n]), c = z(() => {
4248
4256
  const y = Ct(n);
4249
4257
  return d ? y.filter((w) => w.cube === d) : [];
4250
4258
  }, [n, d]), h = z(() => {
4251
- const y = xr(n);
4259
+ const y = vr(n);
4252
4260
  return d ? y.filter((w) => w.cube === d) : [];
4253
4261
  }, [n, d]), N = z(() => {
4254
- const y = br(n);
4262
+ const y = Nr(n);
4255
4263
  return d ? y.filter((w) => w.cube === d) : [];
4256
4264
  }, [n, d]), k = !!(d && i && s && m), [R, A] = _(!1), B = Z(!1);
4257
4265
  Y(() => {
@@ -4261,15 +4269,15 @@ const xt = me(function({
4261
4269
  const y = n.cubes?.find((w) => w.name === d);
4262
4270
  if (y?.meta?.eventStream) {
4263
4271
  const w = y.meta.eventStream;
4264
- !i && w.bindingKey && g({ dimension: w.bindingKey }), !s && w.timeDimension && o(w.timeDimension);
4272
+ !i && w.bindingKey && b({ dimension: w.bindingKey }), !s && w.timeDimension && o(w.timeDimension);
4265
4273
  }
4266
- }, [d, n, i, s, g, o]);
4274
+ }, [d, n, i, s, b, o]);
4267
4275
  const u = i?.dimension ? typeof i.dimension == "string" ? i.dimension : i.dimension[0]?.dimension || null : null, a = F(
4268
4276
  (y) => {
4269
- g(y ? { dimension: y } : null);
4277
+ b(y ? { dimension: y } : null);
4270
4278
  },
4271
- [g]
4272
- ), f = b.find((y) => y.dimension === d)?.label || d;
4279
+ [b]
4280
+ ), f = g.find((y) => y.dimension === d)?.label || d;
4273
4281
  return /* @__PURE__ */ t("div", { className: "bg-dc-surface-secondary dc:border-b border-dc-border", children: [
4274
4282
  /* @__PURE__ */ t(
4275
4283
  "button",
@@ -4294,8 +4302,8 @@ const xt = me(function({
4294
4302
  value: d,
4295
4303
  label: "Cube",
4296
4304
  placeholder: "Select event stream cube",
4297
- icon: ur,
4298
- options: b,
4305
+ icon: pr,
4306
+ options: g,
4299
4307
  onChange: x,
4300
4308
  helpText: "Select a cube configured for flow analysis"
4301
4309
  }
@@ -4306,7 +4314,7 @@ const xt = me(function({
4306
4314
  value: u,
4307
4315
  label: "Binding Key",
4308
4316
  placeholder: d ? "Select binding key" : "Select cube first",
4309
- icon: mr,
4317
+ icon: xr,
4310
4318
  options: c,
4311
4319
  onChange: a,
4312
4320
  helpText: "Entity that links events together (e.g., user ID)"
@@ -4318,7 +4326,7 @@ const xt = me(function({
4318
4326
  value: s,
4319
4327
  label: "Time Dimension",
4320
4328
  placeholder: d ? "Select time dimension" : "Select cube first",
4321
- icon: hr,
4329
+ icon: gr,
4322
4330
  options: h,
4323
4331
  onChange: o,
4324
4332
  helpText: "Timestamp field for event ordering"
@@ -4330,7 +4338,7 @@ const xt = me(function({
4330
4338
  value: m,
4331
4339
  label: "Event Dimension",
4332
4340
  placeholder: d ? "Select event dimension" : "Select cube first",
4333
- icon: fr,
4341
+ icon: br,
4334
4342
  options: N,
4335
4343
  onChange: l,
4336
4344
  helpText: "Dimension that categorizes events (node labels in Sankey)"
@@ -4338,17 +4346,17 @@ const xt = me(function({
4338
4346
  )
4339
4347
  ] })
4340
4348
  ] });
4341
- }), yr = me(function({
4349
+ }), Cr = me(function({
4342
4350
  flowCube: d,
4343
4351
  flowBindingKey: i,
4344
4352
  flowTimeDimension: s,
4345
4353
  eventDimension: m,
4346
4354
  startingStep: n,
4347
4355
  stepsBefore: x,
4348
- stepsAfter: g,
4356
+ stepsAfter: b,
4349
4357
  joinStrategy: o = "auto",
4350
4358
  schema: l,
4351
- onCubeChange: b,
4359
+ onCubeChange: g,
4352
4360
  onBindingKeyChange: c,
4353
4361
  onTimeDimensionChange: h,
4354
4362
  onEventDimensionChange: N,
@@ -4393,14 +4401,14 @@ const xt = me(function({
4393
4401
  ] }),
4394
4402
  D === "config" ? /* @__PURE__ */ t("div", { className: "dc:flex dc:flex-col dc:flex-1 dc:min-h-0", children: [
4395
4403
  /* @__PURE__ */ e(
4396
- gr,
4404
+ wr,
4397
4405
  {
4398
4406
  selectedCube: d,
4399
4407
  bindingKey: i,
4400
4408
  timeDimension: s,
4401
4409
  eventDimension: m,
4402
4410
  schema: l,
4403
- onCubeChange: b,
4411
+ onCubeChange: g,
4404
4412
  onBindingKeyChange: c,
4405
4413
  onTimeDimensionChange: h,
4406
4414
  onEventDimensionChange: N
@@ -4486,16 +4494,16 @@ const xt = me(function({
4486
4494
  type: "range",
4487
4495
  min: uc,
4488
4496
  max: lc,
4489
- value: g,
4497
+ value: b,
4490
4498
  onChange: (S) => A(parseInt(S.target.value, 10)),
4491
4499
  className: "dc:flex-1"
4492
4500
  }
4493
4501
  ),
4494
- /* @__PURE__ */ e("span", { className: "dc:w-6 dc:text-sm dc:font-medium text-dc-text dc:text-center", children: g })
4502
+ /* @__PURE__ */ e("span", { className: "dc:w-6 dc:text-sm dc:font-medium text-dc-text dc:text-center", children: b })
4495
4503
  ] })
4496
4504
  ] })
4497
4505
  ] }),
4498
- (u !== "sunburst" && x >= 4 || g >= 4) && /* @__PURE__ */ e("div", { className: "dc:mt-3 dc:px-3 dc:py-2 bg-dc-warning-bg dc:rounded dc:border border-dc-warning dc:text-xs text-dc-warning", children: "High step depth (4-5) may impact query performance on large datasets." })
4506
+ (u !== "sunburst" && x >= 4 || b >= 4) && /* @__PURE__ */ e("div", { className: "dc:mt-3 dc:px-3 dc:py-2 bg-dc-warning-bg dc:rounded dc:border border-dc-warning dc:text-xs text-dc-warning", children: "High step depth (4-5) may impact query performance on large datasets." })
4499
4507
  ] }),
4500
4508
  /* @__PURE__ */ t("div", { children: [
4501
4509
  /* @__PURE__ */ e(ue, { children: "Join Strategy" }),
@@ -4525,8 +4533,8 @@ const xt = me(function({
4525
4533
  }
4526
4534
  ) }) : null
4527
4535
  ] });
4528
- }), Be = $("chevronDown"), Ec = $("chevronRight"), Nt = $("check"), Oc = $("search"), vr = $("dimension"), Nr = $("link"), wr = $("timeDimension"), Lc = $("timeDimension");
4529
- function Cr(r) {
4536
+ }), Be = $("chevronDown"), Ec = $("chevronRight"), Nt = $("check"), Oc = $("search"), Sr = $("dimension"), Dr = $("link"), kr = $("timeDimension"), Lc = $("timeDimension");
4537
+ function Tr(r) {
4530
4538
  return r?.cubes ? r.cubes.filter((d) => d.meta?.eventStream).map((d) => ({
4531
4539
  cube: d.name,
4532
4540
  dimension: d.name,
@@ -4534,7 +4542,7 @@ function Cr(r) {
4534
4542
  eventStream: d.meta?.eventStream
4535
4543
  })) : [];
4536
4544
  }
4537
- function Sr(r) {
4545
+ function $r(r) {
4538
4546
  if (!r?.cubes) return [];
4539
4547
  const d = [];
4540
4548
  for (const i of r.cubes)
@@ -4556,16 +4564,16 @@ const ec = me(function({
4556
4564
  icon: m,
4557
4565
  options: n,
4558
4566
  onChange: x,
4559
- helpText: g
4567
+ helpText: b
4560
4568
  }) {
4561
- const [o, l] = _(!1), [b, c] = _(""), h = Z(null), N = Z(null), k = z(() => {
4569
+ const [o, l] = _(!1), [g, c] = _(""), h = Z(null), N = Z(null), k = z(() => {
4562
4570
  const a = {};
4563
4571
  for (const f of n)
4564
4572
  a[f.cube] || (a[f.cube] = []), a[f.cube].push(f);
4565
4573
  return a;
4566
4574
  }, [n]), R = z(() => {
4567
- if (!b.trim()) return k;
4568
- const a = b.toLowerCase(), f = {};
4575
+ if (!g.trim()) return k;
4576
+ const a = g.toLowerCase(), f = {};
4569
4577
  for (const [y, w] of Object.entries(k)) {
4570
4578
  const D = w.filter(
4571
4579
  (p) => p.label.toLowerCase().includes(a) || p.dimension.toLowerCase().includes(a) || y.toLowerCase().includes(a)
@@ -4573,7 +4581,7 @@ const ec = me(function({
4573
4581
  D.length > 0 && (f[y] = D);
4574
4582
  }
4575
4583
  return f;
4576
- }, [k, b]), A = F(
4584
+ }, [k, g]), A = F(
4577
4585
  (a) => {
4578
4586
  x(a), l(!1), c("");
4579
4587
  },
@@ -4644,7 +4652,7 @@ const ec = me(function({
4644
4652
  {
4645
4653
  ref: N,
4646
4654
  type: "text",
4647
- value: b,
4655
+ value: g,
4648
4656
  onChange: (a) => c(a.target.value),
4649
4657
  placeholder: "Search...",
4650
4658
  className: "dc:w-full dc:pl-8 dc:pr-3 dc:py-1.5 dc:text-sm bg-dc-surface-secondary dc:border border-dc-border dc:rounded text-dc-text placeholder:text-dc-text-muted dc:focus:outline-none dc:focus:ring-1 focus:ring-dc-primary"
@@ -4670,17 +4678,17 @@ const ec = me(function({
4670
4678
  y.dimension
4671
4679
  ))
4672
4680
  ] }, a)) }),
4673
- /* @__PURE__ */ e("div", { className: "dc:px-3 dc:py-2 dc:border-t border-dc-border dc:text-xs text-dc-text-muted", children: g })
4681
+ /* @__PURE__ */ e("div", { className: "dc:px-3 dc:py-2 dc:border-t border-dc-border dc:text-xs text-dc-text-muted", children: b })
4674
4682
  ] })
4675
4683
  ] })
4676
4684
  ] });
4677
- }), Dr = me(function({
4685
+ }), Ar = me(function({
4678
4686
  dateRange: d,
4679
4687
  onDateRangeChange: i
4680
4688
  }) {
4681
- const s = d ?? { start: "", end: "" }, m = s.start ?? "", n = s.end ?? "", [x, g] = _(!1), [o, l] = _(
4689
+ const s = d ?? { start: "", end: "" }, m = s.start ?? "", n = s.end ?? "", [x, b] = _(!1), [o, l] = _(
4682
4690
  () => m && n ? mc(s) : "last_3_months"
4683
- ), [b, c] = _(m), [h, N] = _(n), k = Z(null);
4691
+ ), [g, c] = _(m), [h, N] = _(n), k = Z(null);
4684
4692
  Y(() => {
4685
4693
  const u = d?.start ?? "", a = d?.end ?? "";
4686
4694
  c(u), N(a), u && a && l(mc({ start: u, end: a }));
@@ -4688,17 +4696,17 @@ const ec = me(function({
4688
4696
  const R = F(
4689
4697
  (u) => {
4690
4698
  if (l(u), u !== "custom") {
4691
- const a = rn(u);
4692
- i(a), c(a.start), N(a.end), g(!1);
4699
+ const a = ln(u);
4700
+ i(a), c(a.start), N(a.end), b(!1);
4693
4701
  }
4694
4702
  },
4695
4703
  [i]
4696
4704
  ), A = F(() => {
4697
- b && h && (i({ start: b, end: h }), l("custom"), g(!1));
4698
- }, [b, h, i]);
4705
+ g && h && (i({ start: g, end: h }), l("custom"), b(!1));
4706
+ }, [g, h, i]);
4699
4707
  Y(() => {
4700
4708
  function u(a) {
4701
- k.current && !k.current.contains(a.target) && g(!1);
4709
+ k.current && !k.current.contains(a.target) && b(!1);
4702
4710
  }
4703
4711
  if (x)
4704
4712
  return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
@@ -4720,7 +4728,7 @@ const ec = me(function({
4720
4728
  "button",
4721
4729
  {
4722
4730
  type: "button",
4723
- onClick: () => g(!x),
4731
+ onClick: () => b(!x),
4724
4732
  className: `
4725
4733
  dc:flex dc:items-center dc:justify-between dc:w-full dc:px-2.5 dc:py-1.5 dc:text-sm
4726
4734
  bg-dc-surface dc:border border-dc-border dc:rounded
@@ -4756,7 +4764,7 @@ const ec = me(function({
4756
4764
  "input",
4757
4765
  {
4758
4766
  type: "date",
4759
- value: b,
4767
+ value: g,
4760
4768
  onChange: (u) => {
4761
4769
  c(u.target.value), l("custom");
4762
4770
  },
@@ -4781,7 +4789,7 @@ const ec = me(function({
4781
4789
  {
4782
4790
  type: "button",
4783
4791
  onClick: A,
4784
- disabled: !b || !h,
4792
+ disabled: !g || !h,
4785
4793
  className: "dc:w-full dc:px-3 dc:py-1.5 dc:text-xs bg-dc-primary text-white dc:rounded hover:bg-dc-primary-hover dc:disabled:opacity-50 dc:disabled:cursor-not-allowed dc:transition-colors",
4786
4794
  children: "Apply Custom Range"
4787
4795
  }
@@ -4790,7 +4798,7 @@ const ec = me(function({
4790
4798
  ] })
4791
4799
  ] })
4792
4800
  ] });
4793
- }), kr = me(function({
4801
+ }), Ir = me(function({
4794
4802
  selectedCube: d = null,
4795
4803
  bindingKey: i = null,
4796
4804
  timeDimension: s = null,
@@ -4798,16 +4806,16 @@ const ec = me(function({
4798
4806
  schema: n = null,
4799
4807
  onCubeChange: x = () => {
4800
4808
  },
4801
- onBindingKeyChange: g = () => {
4809
+ onBindingKeyChange: b = () => {
4802
4810
  },
4803
4811
  onTimeDimensionChange: o = () => {
4804
4812
  }
4805
4813
  }) {
4806
- const l = z(() => Cr(n), [n]), b = z(() => {
4814
+ const l = z(() => Tr(n), [n]), g = z(() => {
4807
4815
  const f = Ct(n);
4808
4816
  return d ? f.filter((y) => y.cube === d) : [];
4809
4817
  }, [n, d]), c = z(() => {
4810
- const f = Sr(n);
4818
+ const f = $r(n);
4811
4819
  return d ? f.filter((y) => y.cube === d) : [];
4812
4820
  }, [n, d]), h = !!(d && i?.dimension && s && m?.start && m?.end), [N, k] = _(!1), R = Z(!1);
4813
4821
  Y(() => {
@@ -4815,9 +4823,9 @@ const ec = me(function({
4815
4823
  }, [h]);
4816
4824
  const A = i?.dimension ? typeof i.dimension == "string" ? i.dimension : i.dimension[0]?.dimension || null : null, B = F(
4817
4825
  (f) => {
4818
- g(f ? { dimension: f } : null);
4826
+ b(f ? { dimension: f } : null);
4819
4827
  },
4820
- [g]
4828
+ [b]
4821
4829
  ), u = l.find((f) => f.dimension === d)?.label || d, a = m?.start ? `${wt(m.start)} - ${wt(m.end)}` : "";
4822
4830
  return /* @__PURE__ */ t("div", { className: "bg-dc-surface-secondary dc:border-b border-dc-border", children: [
4823
4831
  /* @__PURE__ */ t(
@@ -4847,7 +4855,7 @@ const ec = me(function({
4847
4855
  value: d,
4848
4856
  label: "Cube",
4849
4857
  placeholder: "Select cube",
4850
- icon: vr,
4858
+ icon: Sr,
4851
4859
  options: l,
4852
4860
  onChange: x,
4853
4861
  helpText: "Select the cube containing your user events"
@@ -4859,8 +4867,8 @@ const ec = me(function({
4859
4867
  value: A,
4860
4868
  label: "Binding Key",
4861
4869
  placeholder: d ? "Select user identifier" : "Select cube first",
4862
- icon: Nr,
4863
- options: b,
4870
+ icon: Dr,
4871
+ options: g,
4864
4872
  onChange: B,
4865
4873
  helpText: "Dimension that identifies entities across events (e.g., user ID, customer ID)"
4866
4874
  }
@@ -4871,7 +4879,7 @@ const ec = me(function({
4871
4879
  value: s,
4872
4880
  label: "Timestamp",
4873
4881
  placeholder: d ? "Select timestamp" : "Select cube first",
4874
- icon: wr,
4882
+ icon: kr,
4875
4883
  options: c,
4876
4884
  onChange: o,
4877
4885
  helpText: "Timestamp field for cohort entry and activity"
@@ -4880,7 +4888,7 @@ const ec = me(function({
4880
4888
  ] })
4881
4889
  ] });
4882
4890
  });
4883
- function Tr(r) {
4891
+ function Rr(r) {
4884
4892
  return !r || !Array.isArray(r) ? [] : r.map((d) => ({
4885
4893
  id: d.field,
4886
4894
  // Use field as id
@@ -4891,17 +4899,17 @@ function Tr(r) {
4891
4899
  enableComparison: !1
4892
4900
  }));
4893
4901
  }
4894
- const $r = me(function({
4902
+ const Fr = me(function({
4895
4903
  retentionCube: d = null,
4896
4904
  retentionBindingKey: i = null,
4897
4905
  retentionTimeDimension: s = null,
4898
4906
  retentionDateRange: m = { start: "", end: "" },
4899
4907
  retentionCohortFilters: n = [],
4900
4908
  retentionActivityFilters: x = [],
4901
- retentionBreakdowns: g = [],
4909
+ retentionBreakdowns: b = [],
4902
4910
  retentionViewGranularity: o = "week",
4903
4911
  retentionPeriods: l = 12,
4904
- retentionType: b = "classic",
4912
+ retentionType: g = "classic",
4905
4913
  schema: c = null,
4906
4914
  onCubeChange: h = () => {
4907
4915
  },
@@ -4940,8 +4948,8 @@ const $r = me(function({
4940
4948
  ...c,
4941
4949
  cubes: c.cubes?.filter((W) => W.name === d) || []
4942
4950
  }, [c, d]), U = z(
4943
- () => Tr(g),
4944
- [g]
4951
+ () => Rr(b),
4952
+ [b]
4945
4953
  ), re = F(
4946
4954
  (W) => {
4947
4955
  f(W);
@@ -4974,7 +4982,7 @@ const $r = me(function({
4974
4982
  ] }),
4975
4983
  E === "config" ? /* @__PURE__ */ t("div", { className: "dc:flex dc:flex-col dc:flex-1 dc:min-h-0", children: [
4976
4984
  /* @__PURE__ */ e(
4977
- kr,
4985
+ Ir,
4978
4986
  {
4979
4987
  selectedCube: d,
4980
4988
  bindingKey: i,
@@ -4991,7 +4999,7 @@ const $r = me(function({
4991
4999
  /* @__PURE__ */ e(ue, { children: "Date Range" }),
4992
5000
  /* @__PURE__ */ e("p", { className: "dc:text-xs text-dc-text-muted dc:mb-3", children: "Select the date range for cohort entry. Users who first appear within this range will be analyzed." }),
4993
5001
  /* @__PURE__ */ e(
4994
- Dr,
5002
+ Ar,
4995
5003
  {
4996
5004
  dateRange: m,
4997
5005
  onDateRangeChange: R
@@ -5044,7 +5052,7 @@ const $r = me(function({
5044
5052
  /* @__PURE__ */ t("div", { className: "dc:space-y-4", children: [
5045
5053
  /* @__PURE__ */ t("div", { children: [
5046
5054
  /* @__PURE__ */ e("label", { className: "dc:block dc:text-xs dc:font-medium text-dc-text-muted dc:mb-1", children: "Period Granularity" }),
5047
- /* @__PURE__ */ e("div", { className: "dc:flex dc:gap-2", children: sn.map((W) => /* @__PURE__ */ e(
5055
+ /* @__PURE__ */ e("div", { className: "dc:flex dc:gap-2", children: un.map((W) => /* @__PURE__ */ e(
5048
5056
  "button",
5049
5057
  {
5050
5058
  type: "button",
@@ -5081,12 +5089,12 @@ const $r = me(function({
5081
5089
  ] }),
5082
5090
  /* @__PURE__ */ t("div", { children: [
5083
5091
  /* @__PURE__ */ e("label", { className: "dc:block dc:text-xs dc:font-medium text-dc-text-muted dc:mb-1", children: "Retention Type" }),
5084
- /* @__PURE__ */ e("div", { className: "dc:flex dc:gap-2", children: an.map((W) => /* @__PURE__ */ e(
5092
+ /* @__PURE__ */ e("div", { className: "dc:flex dc:gap-2", children: mn.map((W) => /* @__PURE__ */ e(
5085
5093
  "button",
5086
5094
  {
5087
5095
  type: "button",
5088
5096
  onClick: () => D(W.value),
5089
- className: `dc:flex-1 dc:px-3 dc:py-2 dc:rounded-md dc:border dc:text-sm dc:transition-colors ${b === W.value ? "border-dc-primary bg-dc-primary/10 text-dc-primary" : "border-dc-border bg-dc-surface hover:bg-dc-surface-hover text-dc-text"}`,
5097
+ className: `dc:flex-1 dc:px-3 dc:py-2 dc:rounded-md dc:border dc:text-sm dc:transition-colors ${g === W.value ? "border-dc-primary bg-dc-primary/10 text-dc-primary" : "border-dc-border bg-dc-surface hover:bg-dc-surface-hover text-dc-text"}`,
5090
5098
  children: /* @__PURE__ */ t("div", { className: "dc:flex dc:flex-col dc:items-center dc:gap-0.5", children: [
5091
5099
  /* @__PURE__ */ e("span", { className: "dc:font-medium", children: W.label }),
5092
5100
  /* @__PURE__ */ e("span", { className: "dc:text-[10px] dc:font-normal text-dc-text-muted", children: W.description })
@@ -5108,17 +5116,17 @@ const $r = me(function({
5108
5116
  }
5109
5117
  ) }) : null
5110
5118
  ] });
5111
- }), Bc = $("add"), Ar = $("close"), tc = $("info"), cc = $("warning"), Pc = $("link"), Ir = me(function({
5119
+ }), Bc = $("add"), Er = $("close"), tc = $("info"), cc = $("warning"), Pc = $("link"), Or = me(function({
5112
5120
  metrics: d,
5113
5121
  breakdowns: i,
5114
5122
  filters: s,
5115
5123
  schema: m,
5116
5124
  activeTab: n,
5117
5125
  onActiveTabChange: x,
5118
- onAddMetric: g,
5126
+ onAddMetric: b,
5119
5127
  onRemoveMetric: o,
5120
5128
  onReorderMetrics: l,
5121
- onAddBreakdown: b,
5129
+ onAddBreakdown: g,
5122
5130
  onRemoveBreakdown: c,
5123
5131
  onBreakdownGranularityChange: h,
5124
5132
  onBreakdownComparisonToggle: N,
@@ -5165,9 +5173,9 @@ const $r = me(function({
5165
5173
  activeFunnelStepIndex: ae = 0,
5166
5174
  funnelTimeDimension: fe,
5167
5175
  onFunnelCubeChange: he,
5168
- onAddFunnelStep: be,
5176
+ onAddFunnelStep: ge,
5169
5177
  onRemoveFunnelStep: Ie,
5170
- onUpdateFunnelStep: ge,
5178
+ onUpdateFunnelStep: be,
5171
5179
  onSelectFunnelStep: Ae,
5172
5180
  onReorderFunnelSteps: Re,
5173
5181
  onFunnelTimeDimensionChange: Se,
@@ -5234,15 +5242,15 @@ const $r = me(function({
5234
5242
  }, [U]), ot = (V) => ve ? Fe ? `S${V + 1}` : `Q${V + 1}` : "Query";
5235
5243
  return /* @__PURE__ */ t("div", { className: "dc:h-full dc:flex dc:flex-col bg-dc-surface", children: [
5236
5244
  de && /* @__PURE__ */ e(
5237
- tr,
5245
+ rr,
5238
5246
  {
5239
5247
  value: oe,
5240
5248
  onChange: de,
5241
5249
  schema: m
5242
5250
  }
5243
5251
  ),
5244
- $e && he && be && Ie && ge && Ae && Re && Se && X ? /* @__PURE__ */ e(
5245
- lr,
5252
+ $e && he && ge && Ie && be && Ae && Re && Se && X ? /* @__PURE__ */ e(
5253
+ fr,
5246
5254
  {
5247
5255
  funnelCube: le,
5248
5256
  funnelSteps: we,
@@ -5251,9 +5259,9 @@ const $r = me(function({
5251
5259
  funnelBindingKey: te ?? null,
5252
5260
  schema: m,
5253
5261
  onCubeChange: he,
5254
- onAddStep: be,
5262
+ onAddStep: ge,
5255
5263
  onRemoveStep: Ie,
5256
- onUpdateStep: ge,
5264
+ onUpdateStep: be,
5257
5265
  onSelectStep: Ae,
5258
5266
  onReorderSteps: Re,
5259
5267
  onTimeDimensionChange: Se,
@@ -5266,7 +5274,7 @@ const $r = me(function({
5266
5274
  ) : at && Me && qe && ye && je && Je && We && Ue && xe ? (
5267
5275
  /* Flow Mode - dedicated UI when analysisType === 'flow' */
5268
5276
  /* @__PURE__ */ e(
5269
- yr,
5277
+ Cr,
5270
5278
  {
5271
5279
  flowCube: O ?? null,
5272
5280
  flowBindingKey: Q ?? null,
@@ -5295,7 +5303,7 @@ const $r = me(function({
5295
5303
  ) : Qe ? (
5296
5304
  /* Retention Mode - dedicated UI when analysisType === 'retention' (simplified Mixpanel-style) */
5297
5305
  /* @__PURE__ */ e(
5298
- $r,
5306
+ Fr,
5299
5307
  {
5300
5308
  retentionCube: Xe ?? null,
5301
5309
  retentionBindingKey: At ?? null,
@@ -5332,7 +5340,7 @@ const $r = me(function({
5332
5340
  }),
5333
5341
  onRetentionTypeChange: nt ?? (() => {
5334
5342
  }),
5335
- onOpenFieldModal: b,
5343
+ onOpenFieldModal: g,
5336
5344
  chartType: a,
5337
5345
  displayConfig: rt,
5338
5346
  colorPalette: w,
@@ -5359,7 +5367,7 @@ const $r = me(function({
5359
5367
  className: "dc:p-0.5 dc:rounded hover:bg-dc-danger-bg hover:text-dc-error dc:transition-colors dc:ml-0.5",
5360
5368
  title: "Remove query",
5361
5369
  "aria-label": `Remove ${ot(ne)}`,
5362
- children: /* @__PURE__ */ e(Ar, { className: "dc:w-3 dc:h-3" })
5370
+ children: /* @__PURE__ */ e(Er, { className: "dc:w-3 dc:h-3" })
5363
5371
  }
5364
5372
  )
5365
5373
  ]
@@ -5440,7 +5448,7 @@ const $r = me(function({
5440
5448
  }
5441
5449
  ),
5442
5450
  Fe && X && /* @__PURE__ */ e(
5443
- Jn,
5451
+ Zn,
5444
5452
  {
5445
5453
  bindingKey: te ?? null,
5446
5454
  onChange: X,
@@ -5471,11 +5479,11 @@ const $r = me(function({
5471
5479
  ] }),
5472
5480
  /* @__PURE__ */ e("div", { className: "dc:flex-1 dc:overflow-auto dc:p-4", children: n === "query" ? /* @__PURE__ */ t("div", { className: "dc:space-y-6", children: [
5473
5481
  /* @__PURE__ */ e(
5474
- wn,
5482
+ kn,
5475
5483
  {
5476
5484
  metrics: d,
5477
5485
  schema: m,
5478
- onAdd: g,
5486
+ onAdd: b,
5479
5487
  onRemove: o,
5480
5488
  order: B,
5481
5489
  onOrderChange: u,
@@ -5516,7 +5524,7 @@ const $r = me(function({
5516
5524
  {
5517
5525
  breakdowns: i,
5518
5526
  schema: m,
5519
- onAdd: b,
5527
+ onAdd: g,
5520
5528
  onRemove: c,
5521
5529
  onGranularityChange: h,
5522
5530
  onComparisonToggle: N,
@@ -5537,7 +5545,7 @@ const $r = me(function({
5537
5545
  ] }) : n === "chart" ? (
5538
5546
  /* Chart Tab Content - use combined metrics/breakdowns in multi-query mode */
5539
5547
  /* @__PURE__ */ e(
5540
- Yn,
5548
+ Xn,
5541
5549
  {
5542
5550
  chartType: a,
5543
5551
  chartConfig: f,
@@ -5563,8 +5571,8 @@ const $r = me(function({
5563
5571
  ) : null })
5564
5572
  ] })
5565
5573
  ] });
5566
- }), Mc = $("sparkles"), Rr = $("error");
5567
- function Fr({
5574
+ }), Mc = $("sparkles"), Lr = $("error");
5575
+ function Br({
5568
5576
  userPrompt: r,
5569
5577
  onPromptChange: d,
5570
5578
  isGenerating: i,
@@ -5572,7 +5580,7 @@ function Fr({
5572
5580
  hasGeneratedQuery: m,
5573
5581
  onGenerate: n,
5574
5582
  onAccept: x,
5575
- onCancel: g
5583
+ onCancel: b
5576
5584
  }) {
5577
5585
  const o = F(
5578
5586
  (l) => {
@@ -5604,7 +5612,7 @@ function Fr({
5604
5612
  /* @__PURE__ */ e(
5605
5613
  "button",
5606
5614
  {
5607
- onClick: g,
5615
+ onClick: b,
5608
5616
  className: "dc:px-3 dc:py-1 dc:text-xs dc:font-medium text-dc-text-secondary hover:text-dc-text bg-dc-surface hover:bg-dc-surface-hover dc:border border-dc-border dc:rounded dc:transition-colors",
5609
5617
  children: m ? "Cancel" : "Close"
5610
5618
  }
@@ -5645,7 +5653,7 @@ function Fr({
5645
5653
  ) })
5646
5654
  ] }),
5647
5655
  s && /* @__PURE__ */ t("div", { className: "dc:mt-3 dc:flex dc:items-start dc:gap-2 dc:p-3 bg-dc-error-bg dc:border border-dc-error-border dc:rounded-md", children: [
5648
- /* @__PURE__ */ e(Rr, { className: "dc:w-4 dc:h-4 text-dc-error dc:mt-0.5 dc:flex-shrink-0" }),
5656
+ /* @__PURE__ */ e(Lr, { className: "dc:w-4 dc:h-4 text-dc-error dc:mt-0.5 dc:flex-shrink-0" }),
5649
5657
  /* @__PURE__ */ e("div", { className: "dc:text-sm text-dc-error", children: s })
5650
5658
  ] }),
5651
5659
  m && !s && /* @__PURE__ */ e("div", { className: "dc:mt-3 dc:p-3 bg-dc-success-bg dc:border border-dc-success-border dc:rounded-md", children: /* @__PURE__ */ t("div", { className: "dc:text-sm text-dc-success", children: [
@@ -5662,7 +5670,7 @@ function Fr({
5662
5670
  );
5663
5671
  }
5664
5672
  const qc = $("warning"), jc = $("refresh");
5665
- class Er extends xd {
5673
+ class Pr extends xd {
5666
5674
  constructor(d) {
5667
5675
  super(d), this.state = {
5668
5676
  hasError: !1,
@@ -5743,13 +5751,13 @@ const Zc = Qc(
5743
5751
  hideSettings: m = !1,
5744
5752
  hideShare: n = !1,
5745
5753
  onQueryChange: x,
5746
- onChartConfigChange: g
5754
+ onChartConfigChange: b
5747
5755
  }, o) => {
5748
- const { meta: l } = gd(), { features: b } = yd(), c = Dd({
5756
+ const { meta: l } = bd(), { features: g } = yd(), c = Dd({
5749
5757
  initialData: i,
5750
5758
  externalColorPalette: s,
5751
5759
  onQueryChange: x,
5752
- onChartConfigChange: g
5760
+ onChartConfigChange: b
5753
5761
  }), h = kd(), {
5754
5762
  aiState: N,
5755
5763
  handleOpenAI: k,
@@ -5758,7 +5766,7 @@ const Zc = Qc(
5758
5766
  handleGenerateAI: B,
5759
5767
  handleAcceptAI: u,
5760
5768
  handleCancelAI: a
5761
- } = fn({
5769
+ } = bn({
5762
5770
  state: c.queryState,
5763
5771
  setState: (D) => {
5764
5772
  h.getState().updateQueryState(c.activeQueryIndex, (L) => {
@@ -5780,7 +5788,7 @@ const Zc = Qc(
5780
5788
  setUserManuallySelectedChart: () => {
5781
5789
  },
5782
5790
  setActiveView: c.actions.setActiveView,
5783
- aiEndpoint: b?.aiEndpoint,
5791
+ aiEndpoint: g?.aiEndpoint,
5784
5792
  // Funnel mode support
5785
5793
  analysisType: c.analysisType,
5786
5794
  setAnalysisType: c.actions.setAnalysisType,
@@ -5806,7 +5814,7 @@ const Zc = Qc(
5806
5814
  }), {
5807
5815
  shareButtonState: f,
5808
5816
  handleShare: y
5809
- } = pn({
5817
+ } = yn({
5810
5818
  isValidQuery: c.isValidQuery,
5811
5819
  getAnalysisConfig: () => h.getState().save()
5812
5820
  }), w = z(() => c.analysisType === "funnel" ? c.funnelSteps.length > 0 || c.funnelCube !== null || c.funnelBindingKey !== null || c.funnelTimeDimension !== null : c.queryState.metrics.length > 0 || c.queryState.breakdowns.length > 0 || c.queryState.filters.length > 0, [
@@ -5819,7 +5827,7 @@ const Zc = Qc(
5819
5827
  c.queryState.breakdowns.length,
5820
5828
  c.queryState.filters.length
5821
5829
  ]);
5822
- return bd(
5830
+ return gd(
5823
5831
  o,
5824
5832
  () => ({
5825
5833
  getQueryConfig: c.getQueryConfig,
@@ -5863,7 +5871,7 @@ const Zc = Qc(
5863
5871
  children: [
5864
5872
  /* @__PURE__ */ t("div", { className: "dc:h-[60vh] dc:lg:h-auto dc:lg:flex-1 dc:min-w-0 dc:border-b dc:lg:border-b-0 dc:lg:border-r border-dc-border dc:overflow-auto dc:flex dc:flex-col", children: [
5865
5873
  N.isOpen && /* @__PURE__ */ e(
5866
- Fr,
5874
+ Br,
5867
5875
  {
5868
5876
  userPrompt: N.userPrompt,
5869
5877
  onPromptChange: A,
@@ -5876,7 +5884,7 @@ const Zc = Qc(
5876
5884
  }
5877
5885
  ),
5878
5886
  /* @__PURE__ */ e("div", { className: "dc:flex-1 dc:overflow-auto", children: /* @__PURE__ */ e(
5879
- bn,
5887
+ Nn,
5880
5888
  {
5881
5889
  executionStatus: c.executionStatus,
5882
5890
  executionResults: c.executionResults,
@@ -5907,7 +5915,7 @@ const Zc = Qc(
5907
5915
  needsRefresh: c.needsRefresh,
5908
5916
  onClearClick: c.actions.clearCurrentMode,
5909
5917
  canClear: w,
5910
- enableAI: b?.enableAI !== !1,
5918
+ enableAI: g?.enableAI !== !1,
5911
5919
  isAIOpen: N.isOpen,
5912
5920
  onAIToggle: N.isOpen ? R : k,
5913
5921
  queryCount: c.queryStates.length,
@@ -5929,12 +5937,12 @@ const Zc = Qc(
5929
5937
  ) })
5930
5938
  ] }),
5931
5939
  /* @__PURE__ */ e("div", { className: "dc:w-full dc:lg:w-96 dc:flex-shrink-0 dc:lg:h-full dc:overflow-auto dc:lg:overflow-hidden", children: /* @__PURE__ */ e(
5932
- Er,
5940
+ Pr,
5933
5941
  {
5934
5942
  analysisType: c.analysisType,
5935
5943
  onSwitchToSafeMode: () => c.actions.setAnalysisType("query"),
5936
5944
  children: /* @__PURE__ */ e(
5937
- Ir,
5945
+ Or,
5938
5946
  {
5939
5947
  metrics: c.queryState.metrics,
5940
5948
  breakdowns: c.effectiveBreakdowns,
@@ -6067,7 +6075,7 @@ const Zc = Qc(
6067
6075
  }
6068
6076
  );
6069
6077
  Zc.displayName = "AnalysisBuilderInner";
6070
- const Or = Qc(
6078
+ const Mr = Qc(
6071
6079
  (r, d) => {
6072
6080
  const {
6073
6081
  initialQuery: i,
@@ -6075,10 +6083,10 @@ const Or = Qc(
6075
6083
  initialAnalysisType: m,
6076
6084
  initialFunnelState: n,
6077
6085
  initialFlowState: x,
6078
- initialRetentionState: g,
6086
+ initialRetentionState: b,
6079
6087
  disableLocalStorage: o = !1,
6080
6088
  ...l
6081
- } = r, b = wd(), c = b ? Cd(b) : null, h = c?.activeView, N = c?.analysisType, k = (() => {
6089
+ } = r, g = wd(), c = g ? Cd(g) : null, h = c?.activeView, N = c?.analysisType, k = (() => {
6082
6090
  if (!c || c.analysisType !== "funnel") return;
6083
6091
  const u = "funnel" in c.query ? c.query.funnel : null;
6084
6092
  if (!u) return;
@@ -6148,16 +6156,16 @@ const Or = Qc(
6148
6156
  initialAnalysisType: m || N,
6149
6157
  initialFunnelState: n || k,
6150
6158
  initialFlowState: x || R,
6151
- initialRetentionState: g || A,
6159
+ initialRetentionState: b || A,
6152
6160
  initialActiveView: h,
6153
- disableLocalStorage: o || !!i || !!n || !!x || !!g || !!b,
6154
- children: /* @__PURE__ */ e(Zc, { ref: d, ...l, hideShare: !!i || !!n || !!x || !!g })
6161
+ disableLocalStorage: o || !!i || !!n || !!x || !!b || !!g,
6162
+ children: /* @__PURE__ */ e(Zc, { ref: d, ...l, hideShare: !!i || !!n || !!x || !!b })
6155
6163
  }
6156
6164
  );
6157
6165
  }
6158
6166
  );
6159
- Or.displayName = "AnalysisBuilder";
6167
+ Mr.displayName = "AnalysisBuilder";
6160
6168
  export {
6161
- Or as default
6169
+ Mr as default
6162
6170
  };
6163
- //# sourceMappingURL=analysis-builder-BMmWeFPr.js.map
6171
+ //# sourceMappingURL=analysis-builder-C5e52Z3p.js.map