@astrato-io/visualizations 0.10.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/README.md +148 -5
  3. package/THIRD_PARTY_NOTICES.md +494 -0
  4. package/VISUALIZATION_DEFINITIONS.md +9 -146
  5. package/chunks/{Button-Dn3rJrYf.js → Button-CQdoKSXX.js} +3 -3
  6. package/chunks/{CircularProgress-BFeu06Yb.js → CircularProgress-DpT1lwWw.js} +20 -20
  7. package/chunks/FieldTypeIcon-Cg4F9Q5D.js +22 -0
  8. package/chunks/{LinearProgress-ClO6GUjN.js → LinearProgress-B7S0Q26A.js} +14 -14
  9. package/chunks/{MenuOption-Czc34u4q.js → MenuOption-DpKFJxmo.js} +167 -167
  10. package/chunks/{Title-BgYnaVTR.js → Title-m5damhc0.js} +37 -37
  11. package/chunks/{_createAggregator-BMu9uRax.js → _createAggregator-BA8_iU9q.js} +17 -17
  12. package/chunks/{app-filter-bar.compiler-CVir0wkl.js → app-filter-bar.compiler--T4Qz3Wu.js} +8 -8
  13. package/chunks/{bar-layout-C_UgRlVl.js → bar-layout-OFhxn2Go.js} +2 -2
  14. package/chunks/{bar.compiler-DYuFdi9J.js → bar.compiler-hWZBYYvV.js} +71 -69
  15. package/chunks/{builder-C-TKA-My.js → builder-7w_bgV_h.js} +106 -55
  16. package/chunks/{coloring-BtnPiQ_o.js → coloring-Cd6p0GQJ.js} +93 -88
  17. package/chunks/{createSimplePaletteValueFilter--zrZxRV9.js → createSimplePaletteValueFilter-CiJT8s1s.js} +169 -169
  18. package/chunks/defaults-CMFqXvaJ.js +3 -0
  19. package/chunks/{definitions-CT304NDn.js → definitions-DTauTjIX.js} +399 -398
  20. package/chunks/{escobar-CvEV2ES1.js → escobar-CMvphKSK.js} +4949 -4879
  21. package/chunks/{extend-preset-D9-JP92b.js → extend-preset-BpXttHFk.js} +449 -450
  22. package/chunks/{filter.compiler-CXeZznks.js → filter.compiler-DOGFweJz.js} +10 -10
  23. package/chunks/{filtering-8_bFv-jb.js → filtering-NOnDcGbo.js} +241 -241
  24. package/chunks/handlers-CyYFSfhM.js +15393 -0
  25. package/chunks/{icon-picker-styles-BXiJ1SZS.js → icon-picker-styles-DuSERhBU.js} +8 -8
  26. package/chunks/{isEqual-D8Ay63xR.js → isEqual-4f8yUUtC.js} +1 -1
  27. package/chunks/{isFocusVisible-Bu8gGZu5.js → isFocusVisible-Czm70MGc.js} +9 -9
  28. package/chunks/line.compiler-B-4H55_T.js +203 -0
  29. package/chunks/linear-Bq_r9l5S.js +264 -0
  30. package/chunks/{logger-DdZpR7xZ.js → logger-Cioob-QV.js} +74 -73
  31. package/chunks/{lookup-BWllin0q.js → lookup-B3tWH2hX.js} +1 -0
  32. package/chunks/{map.compiler-Q_Y1Pvat.js → map.compiler-Cv5V6EhF.js} +40 -40
  33. package/chunks/measure-axis-label-format-COy8U_dd.js +27 -0
  34. package/chunks/measure-format-default-B_kuGSzi.js +26 -0
  35. package/chunks/{metadata-BQm_TXI1.js → metadata-dGSe5UWy.js} +5 -5
  36. package/chunks/number.compiler-D7nMcEMv.js +57 -0
  37. package/chunks/{operations-DKQWuLL7.js → operations-CgfehCad.js} +11397 -11114
  38. package/chunks/{range-BdhzvYQ_.js → range-Dmwp9kVB.js} +2 -2
  39. package/chunks/{react-dom-BGP4tbXV.js → react-dom-CfuL-m78.js} +82 -82
  40. package/chunks/{render-wrappers-BZpyDnJy.js → render-wrappers--g-zPFBW.js} +1 -1
  41. package/chunks/{requirements-e8Fe96ag.js → requirements-DHayNJ2C.js} +245 -221
  42. package/chunks/{shared-C_2F90xq.js → shared-DoEN9nNM.js} +505 -494
  43. package/chunks/standalone-B3hRGgYi.js +773 -0
  44. package/chunks/{standalone-BkbiH-o8.js → standalone-BPNXgFft.js} +498 -759
  45. package/chunks/standalone-BPTT8XEu.js +424 -0
  46. package/chunks/standalone-BgAeHROc.js +2 -0
  47. package/chunks/{standalone-BE_ONgiG.js → standalone-BkQxag7M.js} +102 -102
  48. package/chunks/{standalone-Cc98Pdr6.js → standalone-Bxa3x6dg.js} +872 -872
  49. package/chunks/standalone-C0If-V6O.js +773 -0
  50. package/chunks/standalone-C1TOyflX.js +287 -0
  51. package/chunks/{standalone-CY_kjarf.js → standalone-CE5PwJN0.js} +18 -18
  52. package/chunks/{standalone-B8ZSqauS.js → standalone-CG7IFN6n.js} +120 -120
  53. package/chunks/{standalone-wOWRCpdn.js → standalone-CKlgGu80.js} +49 -49
  54. package/chunks/standalone-CNf-oA2U.js +355 -0
  55. package/chunks/{standalone-BDrXVxlP.js → standalone-CXPdWFlw.js} +14 -14
  56. package/chunks/{standalone-z0o52o5t.js → standalone-Cf0_5tbu.js} +5567 -5568
  57. package/chunks/{standalone-Cl0TSfqC.js → standalone-DMi4-Vp3.js} +122 -122
  58. package/chunks/{standalone-DNh9NcMa.js → standalone-DTEX67C8.js} +154 -154
  59. package/chunks/{standalone-DHRalbVO.js → standalone-DU46-kYv.js} +279 -279
  60. package/chunks/standalone-Dbn3jSH6.js +690 -0
  61. package/chunks/{standalone-CsoMmE9T.js → standalone-DdcAL_k_.js} +839 -843
  62. package/chunks/standalone-DwCIA0UG.js +1057 -0
  63. package/chunks/standalone-Dz13tl3P.js +357 -0
  64. package/chunks/standalone-H9GFzFk_.js +8377 -0
  65. package/chunks/{standalone-CaTxAydz.js → standalone-MduR0qre.js} +2227 -1000
  66. package/chunks/standalone-ejTz66P3.js +2 -0
  67. package/chunks/{standalone-DflyWtuR.js → standalone-keB-0wK3.js} +216 -216
  68. package/chunks/{standalone-BTY3w_JA.js → standalone-nnkuQd0K.js} +28 -28
  69. package/chunks/standalone-vGGR6Vcn.js +6 -0
  70. package/chunks/{table.compiler-COaHE9VD.js → table.compiler-mS4UvhLT.js} +31 -31
  71. package/chunks/theme-MYp6Rj1J.js +232 -0
  72. package/chunks/{useFieldName-CdnCWzhd.js → useFieldName-AdSak4Ch.js} +1 -1
  73. package/chunks/{utils-DganVptf.js → utils-CUKgR7it.js} +4216 -4070
  74. package/chunks/{view-Bzlros43.js → view-BeYwpcVD.js} +1561 -1561
  75. package/chunks/{visualization-filters-D7i6oh1Z.js → visualization-filters-B9qik5_K.js} +2683 -2342
  76. package/chunks/{with-html-element-CiIhFEa5.js → with-html-element-1GSeLT59.js} +3712 -3682
  77. package/definitions.js +2 -2
  78. package/docs/operations/astrato-app-filter-bar.md +1 -1
  79. package/docs/operations/bar.md +144 -32
  80. package/docs/operations/combo.md +79 -17
  81. package/docs/operations/date-picker.md +4 -4
  82. package/docs/operations/distribution-gauge.md +18 -16
  83. package/docs/operations/dot.md +107 -24
  84. package/docs/operations/filter.md +10 -8
  85. package/docs/operations/gauge.md +20 -18
  86. package/docs/operations/heatMap.md +73 -21
  87. package/docs/operations/histogram.md +45 -12
  88. package/docs/operations/iframe.md +1 -1
  89. package/docs/operations/image.md +1 -1
  90. package/docs/operations/index.md +12 -11
  91. package/docs/operations/line.md +86 -24
  92. package/docs/operations/map.md +5274 -0
  93. package/docs/operations/number.md +10 -9
  94. package/docs/operations/pie.md +23 -21
  95. package/docs/operations/radar.md +13 -11
  96. package/docs/operations/sankey.md +19 -17
  97. package/docs/operations/scatter.md +111 -28
  98. package/docs/operations/shape.md +5 -5
  99. package/docs/operations/simpleTextObject.md +4 -4
  100. package/docs/operations/slider.md +1 -1
  101. package/docs/operations/table.md +27 -25
  102. package/docs/operations/tree.md +5 -3
  103. package/docs/operations/treemap.md +70 -18
  104. package/docs/operations/waterfall.md +40 -7
  105. package/docs/operations/word-cloud.md +69 -17
  106. package/getters.js +3 -3
  107. package/index.js +585 -612
  108. package/metadata.js +2 -2
  109. package/operations.js +25 -18
  110. package/package.json +74 -70
  111. package/src/definitions/index.d.ts +1 -7
  112. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +3 -48
  113. package/src/definitions/model/definitions/schema-registry.d.ts +15 -14
  114. package/src/definitions/model/definitions/schemas/bar.schema.d.ts +3 -3
  115. package/src/definitions/model/definitions/schemas/broad-chart.schema.d.ts +2 -2
  116. package/src/definitions/model/definitions/schemas/common.schema.d.ts +19 -6
  117. package/src/definitions/model/definitions/schemas/index.d.ts +1 -1
  118. package/src/definitions/model/definitions/schemas/line.schema.d.ts +4 -3
  119. package/src/definitions/model/definitions/schemas/number.schema.d.ts +1 -1
  120. package/src/definitions/model/definitions/schemas/table.schema.d.ts +14 -14
  121. package/src/index.d.ts +1 -1
  122. package/src/operations/index.d.ts +11 -1
  123. package/src/types.d.ts +166 -1
  124. package/src/visualization-catalog.d.ts +3 -0
  125. package/styles.css +1 -1
  126. package/chunks/FieldTypeIcon-DrMoGpHJ.js +0 -22
  127. package/chunks/color-rules-DYJL4fIW.js +0 -15
  128. package/chunks/color-settings-DJFoFTip.js +0 -5
  129. package/chunks/defaults-Dtk7fg3C.js +0 -3
  130. package/chunks/handlers-C6CZ0XJA.js +0 -15399
  131. package/chunks/line.compiler-DmHpmQCC.js +0 -198
  132. package/chunks/number.compiler-DQdg6zTy.js +0 -53
  133. package/chunks/standalone-4MsKiqs0.js +0 -355
  134. package/chunks/standalone-B794g9pE.js +0 -1012
  135. package/chunks/standalone-BA2YXyJS.js +0 -422
  136. package/chunks/standalone-BgumbdaJ2.js +0 -357
  137. package/chunks/standalone-Blh4qejk.js +0 -689
  138. package/chunks/standalone-CXY4FpF7.js +0 -773
  139. package/chunks/standalone-DH0xTEes.js +0 -2
  140. package/chunks/standalone-DcnHjNnC.js +0 -2
  141. package/chunks/standalone-DrHdGkY7.js +0 -762
  142. package/chunks/standalone-c_rROMtx.js +0 -287
  143. package/chunks/standalone-drcFLeN6.js +0 -6
@@ -1,67 +1,67 @@
1
1
  import { o as e, t } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Na as n, Oc as r, Tc as i, gc as a, kc as o, ko as s, ws as c } from "./visualization-filters-D7i6oh1Z.js";
3
- import { Br as l, Gr as u, Hr as d, Kr as f, Ur as p, Vr as m, Wr as h, Zt as g, _, ci as v, cn as y, f as b, kn as x, on as S, ri as C, sn as w, zr as T } from "./utils-DganVptf.js";
4
- import { s as E } from "./logger-DdZpR7xZ.js";
5
- import { t as ee } from "./FieldTypeIcon-DrMoGpHJ.js";
6
- import { n as D, t as te } from "./typeof-DCq3QgvY.js";
7
- var O = /* @__PURE__ */ e(v()), k = T();
8
- function A({ label: e }) {
9
- return /* @__PURE__ */ (0, k.jsxs)("span", {
2
+ import { Xc as n, al as r, cl as i, ic as a, ll as o, so as s, ss as c } from "./visualization-filters-B9qik5_K.js";
3
+ import { Gr as l, Jr as u, Kr as d, Nn as f, Ur as p, Wr as m, Xr as h, Yr as g, _, dn as v, f as y, fi as b, fn as x, qr as S, si as C, tn as w, un as T } from "./utils-CUKgR7it.js";
4
+ import { s as E } from "./logger-Cioob-QV.js";
5
+ import { t as ee } from "./FieldTypeIcon-Cg4F9Q5D.js";
6
+ import { n as D, t as O } from "./typeof-DCq3QgvY.js";
7
+ var k = /* @__PURE__ */ e(b()), A = p();
8
+ function j({ label: e }) {
9
+ return /* @__PURE__ */ (0, A.jsxs)("span", {
10
10
  className: "astrato-app-filter-bar__loader",
11
11
  role: "status",
12
- children: [/* @__PURE__ */ (0, k.jsx)("span", {
12
+ children: [/* @__PURE__ */ (0, A.jsx)("span", {
13
13
  className: "astrato-app-filter-bar__spinner",
14
14
  "aria-hidden": "true"
15
- }), /* @__PURE__ */ (0, k.jsx)("span", {
15
+ }), /* @__PURE__ */ (0, A.jsx)("span", {
16
16
  className: "astrato-app-filter-bar__sr-only",
17
17
  children: e
18
18
  })]
19
19
  });
20
20
  }
21
- var j = (0, O.forwardRef)(function({ type: e = "button", className: t = "", ...n }, r) {
22
- return /* @__PURE__ */ (0, k.jsx)("button", {
21
+ var M = (0, k.forwardRef)(function({ type: e = "button", className: t = "", ...n }, r) {
22
+ return /* @__PURE__ */ (0, A.jsx)("button", {
23
23
  ...n,
24
24
  type: e,
25
25
  className: `astrato-app-filter-bar__button ${t}`,
26
26
  ref: r
27
27
  });
28
- }), M = (0, O.forwardRef)(function({ className: e = "", ...t }, n) {
29
- return /* @__PURE__ */ (0, k.jsx)("input", {
28
+ }), N = (0, k.forwardRef)(function({ className: e = "", ...t }, n) {
29
+ return /* @__PURE__ */ (0, A.jsx)("input", {
30
30
  ...t,
31
31
  className: `astrato-app-filter-bar__input ${e}`,
32
32
  ref: n
33
33
  });
34
- }), N = (0, O.forwardRef)(function({ className: e = "", ...t }, n) {
35
- return /* @__PURE__ */ (0, k.jsx)("select", {
34
+ }), P = (0, k.forwardRef)(function({ className: e = "", ...t }, n) {
35
+ return /* @__PURE__ */ (0, A.jsx)("select", {
36
36
  ...t,
37
37
  className: `astrato-app-filter-bar__select ${e}`,
38
38
  ref: n
39
39
  });
40
40
  });
41
- (0, O.forwardRef)(function(e, t) {
42
- return /* @__PURE__ */ (0, k.jsx)(M, {
41
+ (0, k.forwardRef)(function(e, t) {
42
+ return /* @__PURE__ */ (0, A.jsx)(N, {
43
43
  ...e,
44
44
  type: "range",
45
45
  ref: t
46
46
  });
47
47
  });
48
- var ne = (0, O.forwardRef)(function(e, t) {
49
- return /* @__PURE__ */ (0, k.jsxs)("div", {
48
+ var te = (0, k.forwardRef)(function(e, t) {
49
+ return /* @__PURE__ */ (0, A.jsxs)("div", {
50
50
  className: "astrato-app-filter-bar__search",
51
- children: [/* @__PURE__ */ (0, k.jsx)(x, { name: "search" }), /* @__PURE__ */ (0, k.jsx)(M, {
51
+ children: [/* @__PURE__ */ (0, A.jsx)(f, { name: "search" }), /* @__PURE__ */ (0, A.jsx)(N, {
52
52
  ...e,
53
53
  type: "search",
54
54
  ref: t
55
55
  })]
56
56
  });
57
57
  });
58
- function P({ actions: e, label: t = "Selection actions", icon: n, align: r = "end", disabled: i = !1 }) {
59
- let a = (0, O.useRef)(null), o = (0, O.useId)(), s = () => {
58
+ function F({ actions: e, label: t = "Selection actions", icon: n, align: r = "end", disabled: i = !1 }) {
59
+ let a = (0, k.useRef)(null), o = (0, k.useId)(), s = () => {
60
60
  a.current?.removeAttribute("open"), a.current?.querySelector("summary")?.focus();
61
61
  };
62
- return (0, O.useEffect)(() => {
62
+ return (0, k.useEffect)(() => {
63
63
  i && a.current?.removeAttribute("open");
64
- }, [i]), /* @__PURE__ */ (0, k.jsxs)("details", {
64
+ }, [i]), /* @__PURE__ */ (0, A.jsxs)("details", {
65
65
  ref: a,
66
66
  className: "astrato-app-filter-bar__menu",
67
67
  "data-align": r,
@@ -89,7 +89,7 @@ function P({ actions: e, label: t = "Selection actions", icon: n, align: r = "en
89
89
  }
90
90
  }
91
91
  },
92
- children: [/* @__PURE__ */ (0, k.jsx)("summary", {
92
+ children: [/* @__PURE__ */ (0, A.jsx)("summary", {
93
93
  className: "astrato-app-filter-bar__button",
94
94
  "aria-label": t,
95
95
  "aria-haspopup": "menu",
@@ -101,13 +101,13 @@ function P({ actions: e, label: t = "Selection actions", icon: n, align: r = "en
101
101
  onClick: (e) => {
102
102
  i && e.preventDefault();
103
103
  },
104
- children: n ? /* @__PURE__ */ (0, k.jsx)(x, { name: n }) : /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: ["Actions ", /* @__PURE__ */ (0, k.jsx)(x, { name: "chevronDown" })] })
105
- }), /* @__PURE__ */ (0, k.jsx)("div", {
104
+ children: n ? /* @__PURE__ */ (0, A.jsx)(f, { name: n }) : /* @__PURE__ */ (0, A.jsxs)(A.Fragment, { children: ["Actions ", /* @__PURE__ */ (0, A.jsx)(f, { name: "chevronDown" })] })
105
+ }), /* @__PURE__ */ (0, A.jsx)("div", {
106
106
  className: "astrato-app-filter-bar__menu-items",
107
107
  id: o,
108
108
  role: "menu",
109
109
  "aria-label": t,
110
- children: e.map(({ label: e, description: t, icon: n, selected: r, disabled: a, onSelect: o }) => /* @__PURE__ */ (0, k.jsxs)(j, {
110
+ children: e.map(({ label: e, description: t, icon: n, selected: r, disabled: a, onSelect: o }) => /* @__PURE__ */ (0, A.jsxs)(M, {
111
111
  role: r === void 0 ? "menuitem" : "menuitemradio",
112
112
  "aria-checked": r,
113
113
  tabIndex: -1,
@@ -116,35 +116,35 @@ function P({ actions: e, label: t = "Selection actions", icon: n, align: r = "en
116
116
  o(), s();
117
117
  },
118
118
  children: [
119
- n && /* @__PURE__ */ (0, k.jsx)(x, { name: n }),
120
- /* @__PURE__ */ (0, k.jsxs)("span", {
119
+ n && /* @__PURE__ */ (0, A.jsx)(f, { name: n }),
120
+ /* @__PURE__ */ (0, A.jsxs)("span", {
121
121
  className: "astrato-app-filter-bar__menu-label",
122
- children: [/* @__PURE__ */ (0, k.jsx)("span", { children: e }), t && /* @__PURE__ */ (0, k.jsx)("small", { children: t })]
122
+ children: [/* @__PURE__ */ (0, A.jsx)("span", { children: e }), t && /* @__PURE__ */ (0, A.jsx)("small", { children: t })]
123
123
  }),
124
- r && /* @__PURE__ */ (0, k.jsx)(x, { name: "check" })
124
+ r && /* @__PURE__ */ (0, A.jsx)(f, { name: "check" })
125
125
  ]
126
126
  }, e))
127
127
  })]
128
128
  });
129
129
  }
130
- function F(e) {
130
+ function I(e) {
131
131
  if (e.key !== "Tab" || e.defaultPrevented) return;
132
132
  let t = e.currentTarget, n = t.ownerDocument.defaultView, r = Array.from(t.querySelectorAll("button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href], summary:not([aria-disabled=\"true\"]), [tabindex=\"0\"]")).filter((e) => e.tabIndex >= 0 && e.getClientRects().length > 0 && n?.getComputedStyle(e).visibility !== "hidden"), i = r[0], a = r[r.length - 1];
133
133
  i ? e.shiftKey && (e.target === i || e.target === t) ? (e.preventDefault(), a.focus()) : !e.shiftKey && (e.target === a || e.target === t) && (e.preventDefault(), i.focus()) : (e.preventDefault(), t.focus());
134
134
  }
135
- function I({ onCloseDialog: e, children: t, ...n }) {
136
- let r = (0, O.useRef)(null);
137
- return (0, O.useLayoutEffect)(() => {
135
+ function L({ onCloseDialog: e, children: t, ...n }) {
136
+ let r = (0, k.useRef)(null);
137
+ return (0, k.useLayoutEffect)(() => {
138
138
  let e = r.current;
139
139
  if (!e) return;
140
140
  let t = e.getRootNode().activeElement;
141
141
  return e.showModal(), () => {
142
142
  e.close(), t?.isConnected && t.focus();
143
143
  };
144
- }, []), /* @__PURE__ */ (0, k.jsx)("dialog", {
144
+ }, []), /* @__PURE__ */ (0, A.jsx)("dialog", {
145
145
  ...n,
146
146
  ref: r,
147
- onKeyDown: F,
147
+ onKeyDown: I,
148
148
  onCancel: (t) => {
149
149
  t.preventDefault(), e();
150
150
  },
@@ -156,64 +156,64 @@ function I({ onCloseDialog: e, children: t, ...n }) {
156
156
  children: t
157
157
  });
158
158
  }
159
- var L = /* @__PURE__ */ t(((e, t) => {
159
+ var R = /* @__PURE__ */ t(((e, t) => {
160
160
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = n;
161
161
  function n(e, t) {
162
162
  if (t.length < e) throw TypeError(e + " argument" + (e > 1 ? "s" : "") + " required, but only " + t.length + " present");
163
163
  }
164
164
  t.exports = e.default;
165
- })), R = /* @__PURE__ */ t(((e, t) => {
165
+ })), z = /* @__PURE__ */ t(((e, t) => {
166
166
  var n = D().default;
167
167
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = a;
168
- var r = n(te()), i = n(L());
168
+ var r = n(O()), i = n(R());
169
169
  function a(e) {
170
170
  return (0, i.default)(1, arguments), e instanceof Date || (0, r.default)(e) === "object" && Object.prototype.toString.call(e) === "[object Date]";
171
171
  }
172
172
  t.exports = e.default;
173
- })), z = /* @__PURE__ */ t(((e, t) => {
173
+ })), B = /* @__PURE__ */ t(((e, t) => {
174
174
  var n = D().default;
175
175
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = a;
176
- var r = n(te()), i = n(L());
176
+ var r = n(O()), i = n(R());
177
177
  function a(e) {
178
178
  (0, i.default)(1, arguments);
179
179
  var t = Object.prototype.toString.call(e);
180
180
  return e instanceof Date || (0, r.default)(e) === "object" && t === "[object Date]" ? new Date(e.getTime()) : typeof e == "number" || t === "[object Number]" ? new Date(e) : ((typeof e == "string" || t === "[object String]") && typeof console < "u" && (console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"), console.warn((/* @__PURE__ */ Error()).stack)), /* @__PURE__ */ new Date(NaN));
181
181
  }
182
182
  t.exports = e.default;
183
- })), re = /* @__PURE__ */ t(((e, t) => {
183
+ })), ne = /* @__PURE__ */ t(((e, t) => {
184
184
  var n = D().default;
185
185
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = o;
186
- var r = n(R()), i = n(z()), a = n(L());
186
+ var r = n(z()), i = n(B()), a = n(R());
187
187
  function o(e) {
188
188
  if ((0, a.default)(1, arguments), !(0, r.default)(e) && typeof e != "number") return !1;
189
189
  var t = (0, i.default)(e);
190
190
  return !isNaN(Number(t));
191
191
  }
192
192
  t.exports = e.default;
193
- })), ie = /* @__PURE__ */ t(((e, t) => {
193
+ })), re = /* @__PURE__ */ t(((e, t) => {
194
194
  var n = D().default;
195
195
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = o;
196
- var r = n(h()), i = n(z()), a = n(L());
196
+ var r = n(u()), i = n(B()), a = n(R());
197
197
  function o(e, t) {
198
198
  (0, a.default)(2, arguments);
199
199
  var n = (0, i.default)(e).getTime(), o = (0, r.default)(t);
200
200
  return new Date(n + o);
201
201
  }
202
202
  t.exports = e.default;
203
- })), B = /* @__PURE__ */ t(((e, t) => {
203
+ })), V = /* @__PURE__ */ t(((e, t) => {
204
204
  var n = D().default;
205
205
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = o;
206
- var r = n(ie()), i = n(L()), a = n(h());
206
+ var r = n(re()), i = n(R()), a = n(u());
207
207
  function o(e, t) {
208
208
  (0, i.default)(2, arguments);
209
209
  var n = (0, a.default)(t);
210
210
  return (0, r.default)(e, -n);
211
211
  }
212
212
  t.exports = e.default;
213
- })), ae = /* @__PURE__ */ t(((e, t) => {
213
+ })), ie = /* @__PURE__ */ t(((e, t) => {
214
214
  var n = D().default;
215
215
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = o;
216
- var r = n(z()), i = n(L()), a = 864e5;
216
+ var r = n(B()), i = n(R()), a = 864e5;
217
217
  function o(e) {
218
218
  (0, i.default)(1, arguments);
219
219
  var t = (0, r.default)(e), n = t.getTime();
@@ -222,20 +222,20 @@ var L = /* @__PURE__ */ t(((e, t) => {
222
222
  return Math.floor(o / a) + 1;
223
223
  }
224
224
  t.exports = e.default;
225
- })), V = /* @__PURE__ */ t(((e, t) => {
225
+ })), H = /* @__PURE__ */ t(((e, t) => {
226
226
  var n = D().default;
227
227
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = a;
228
- var r = n(z()), i = n(L());
228
+ var r = n(B()), i = n(R());
229
229
  function a(e) {
230
230
  (0, i.default)(1, arguments);
231
231
  var t = 1, n = (0, r.default)(e), a = n.getUTCDay(), o = (a < t ? 7 : 0) + a - t;
232
232
  return n.setUTCDate(n.getUTCDate() - o), n.setUTCHours(0, 0, 0, 0), n;
233
233
  }
234
234
  t.exports = e.default;
235
- })), H = /* @__PURE__ */ t(((e, t) => {
235
+ })), U = /* @__PURE__ */ t(((e, t) => {
236
236
  var n = D().default;
237
237
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = o;
238
- var r = n(z()), i = n(L()), a = n(V());
238
+ var r = n(B()), i = n(R()), a = n(H());
239
239
  function o(e) {
240
240
  (0, i.default)(1, arguments);
241
241
  var t = (0, r.default)(e), n = t.getUTCFullYear(), o = /* @__PURE__ */ new Date(0);
@@ -246,10 +246,10 @@ var L = /* @__PURE__ */ t(((e, t) => {
246
246
  return t.getTime() >= s.getTime() ? n + 1 : t.getTime() >= l.getTime() ? n : n - 1;
247
247
  }
248
248
  t.exports = e.default;
249
- })), U = /* @__PURE__ */ t(((e, t) => {
249
+ })), ae = /* @__PURE__ */ t(((e, t) => {
250
250
  var n = D().default;
251
251
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = o;
252
- var r = n(H()), i = n(V()), a = n(L());
252
+ var r = n(U()), i = n(H()), a = n(R());
253
253
  function o(e) {
254
254
  (0, a.default)(1, arguments);
255
255
  var t = (0, r.default)(e), n = /* @__PURE__ */ new Date(0);
@@ -259,7 +259,7 @@ var L = /* @__PURE__ */ t(((e, t) => {
259
259
  })), oe = /* @__PURE__ */ t(((e, t) => {
260
260
  var n = D().default;
261
261
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = c;
262
- var r = n(z()), i = n(V()), a = n(U()), o = n(L()), s = 6048e5;
262
+ var r = n(B()), i = n(H()), a = n(ae()), o = n(R()), s = 6048e5;
263
263
  function c(e) {
264
264
  (0, o.default)(1, arguments);
265
265
  var t = (0, r.default)(e), n = (0, i.default)(t).getTime() - (0, a.default)(t).getTime();
@@ -278,7 +278,7 @@ var L = /* @__PURE__ */ t(((e, t) => {
278
278
  })), se = /* @__PURE__ */ t(((e, t) => {
279
279
  var n = D().default;
280
280
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = s;
281
- var r = n(z()), i = n(L()), a = n(h()), o = W();
281
+ var r = n(B()), i = n(R()), a = n(u()), o = W();
282
282
  function s(e, t) {
283
283
  var n;
284
284
  (0, i.default)(1, arguments);
@@ -288,10 +288,10 @@ var L = /* @__PURE__ */ t(((e, t) => {
288
288
  return l.setUTCDate(l.getUTCDate() - d), l.setUTCHours(0, 0, 0, 0), l;
289
289
  }
290
290
  t.exports = e.default;
291
- })), ce = /* @__PURE__ */ t(((e, t) => {
291
+ })), G = /* @__PURE__ */ t(((e, t) => {
292
292
  var n = D().default;
293
293
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = c;
294
- var r = n(z()), i = n(L()), a = n(se()), o = n(h()), s = W();
294
+ var r = n(B()), i = n(R()), a = n(se()), o = n(u()), s = W();
295
295
  function c(e, t) {
296
296
  var n;
297
297
  (0, i.default)(1, arguments);
@@ -305,10 +305,10 @@ var L = /* @__PURE__ */ t(((e, t) => {
305
305
  return c.getTime() >= p.getTime() ? l + 1 : c.getTime() >= h.getTime() ? l : l - 1;
306
306
  }
307
307
  t.exports = e.default;
308
- })), le = /* @__PURE__ */ t(((e, t) => {
308
+ })), ce = /* @__PURE__ */ t(((e, t) => {
309
309
  var n = D().default;
310
310
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = c;
311
- var r = n(ce()), i = n(L()), a = n(se()), o = n(h()), s = W();
311
+ var r = n(G()), i = n(R()), a = n(se()), o = n(u()), s = W();
312
312
  function c(e, t) {
313
313
  var n;
314
314
  (0, i.default)(1, arguments);
@@ -316,27 +316,27 @@ var L = /* @__PURE__ */ t(((e, t) => {
316
316
  return d.setUTCFullYear(u, 0, l), d.setUTCHours(0, 0, 0, 0), (0, a.default)(d, t);
317
317
  }
318
318
  t.exports = e.default;
319
- })), ue = /* @__PURE__ */ t(((e, t) => {
319
+ })), le = /* @__PURE__ */ t(((e, t) => {
320
320
  var n = D().default;
321
321
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = c;
322
- var r = n(z()), i = n(se()), a = n(le()), o = n(L()), s = 6048e5;
322
+ var r = n(B()), i = n(se()), a = n(ce()), o = n(R()), s = 6048e5;
323
323
  function c(e, t) {
324
324
  (0, o.default)(1, arguments);
325
325
  var n = (0, r.default)(e), c = (0, i.default)(n, t).getTime() - (0, a.default)(n, t).getTime();
326
326
  return Math.round(c / s) + 1;
327
327
  }
328
328
  t.exports = e.default;
329
- })), de = /* @__PURE__ */ t(((e, t) => {
329
+ })), ue = /* @__PURE__ */ t(((e, t) => {
330
330
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = n;
331
331
  function n(e, t) {
332
332
  for (var n = e < 0 ? "-" : "", r = Math.abs(e).toString(); r.length < t;) r = "0" + r;
333
333
  return n + r;
334
334
  }
335
335
  t.exports = e.default;
336
- })), fe = /* @__PURE__ */ t(((e, t) => {
336
+ })), de = /* @__PURE__ */ t(((e, t) => {
337
337
  var n = D().default;
338
338
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0;
339
- var r = n(de());
339
+ var r = n(ue());
340
340
  e.default = {
341
341
  y: function(e, t) {
342
342
  var n = e.getUTCFullYear(), i = n > 0 ? n : 1 - n;
@@ -376,10 +376,10 @@ var L = /* @__PURE__ */ t(((e, t) => {
376
376
  return (0, r.default)(a, t.length);
377
377
  }
378
378
  }, t.exports = e.default;
379
- })), pe = /* @__PURE__ */ t(((e, t) => {
379
+ })), fe = /* @__PURE__ */ t(((e, t) => {
380
380
  var n = D().default;
381
381
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0;
382
- var r = n(ae()), i = n(oe()), a = n(H()), o = n(ue()), s = n(ce()), c = n(de()), l = n(fe()), u = {
382
+ var r = n(ie()), i = n(oe()), a = n(U()), o = n(le()), s = n(G()), c = n(ue()), l = n(de()), u = {
383
383
  am: "am",
384
384
  pm: "pm",
385
385
  midnight: "midnight",
@@ -762,7 +762,7 @@ var L = /* @__PURE__ */ t(((e, t) => {
762
762
  return r + a + n + o;
763
763
  }
764
764
  e.default = d, t.exports = e.default;
765
- })), G = /* @__PURE__ */ t(((e, t) => {
765
+ })), pe = /* @__PURE__ */ t(((e, t) => {
766
766
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0;
767
767
  var n = function(e, t) {
768
768
  switch (e) {
@@ -1356,45 +1356,45 @@ var L = /* @__PURE__ */ t(((e, t) => {
1356
1356
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0, e.default = n(we()).default, t.exports = e.default;
1357
1357
  })), Ee = /* @__PURE__ */ t(((e, t) => {
1358
1358
  var n = D().default;
1359
- Object.defineProperty(e, "__esModule", { value: !0 }), e.default = x;
1360
- var r = n(re()), i = n(B()), a = n(z()), o = n(pe()), s = n(G()), c = n(p()), l = me(), u = n(h()), d = n(L()), f = W(), m = n(Te()), g = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, _ = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, v = /^'([^]*?)'?$/, y = /''/g, b = /[a-zA-Z]/;
1361
- function x(e, t, n) {
1362
- var p, h;
1363
- (0, d.default)(2, arguments);
1364
- var v = String(t), y = (0, f.getDefaultOptions)(), x = n?.locale ?? y.locale ?? m.default, C = (0, u.default)(n?.firstWeekContainsDate ?? (n == null || (p = n.locale) == null ? void 0 : p.options?.firstWeekContainsDate) ?? y.firstWeekContainsDate ?? y.locale?.options?.firstWeekContainsDate ?? 1);
1359
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.default = b;
1360
+ var r = n(ne()), i = n(V()), a = n(B()), o = n(fe()), s = n(pe()), c = n(S()), l = me(), d = n(u()), f = n(R()), p = W(), m = n(Te()), h = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, g = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, _ = /^'([^]*?)'?$/, v = /''/g, y = /[a-zA-Z]/;
1361
+ function b(e, t, n) {
1362
+ var u, _;
1363
+ (0, f.default)(2, arguments);
1364
+ var v = String(t), b = (0, p.getDefaultOptions)(), S = n?.locale ?? b.locale ?? m.default, C = (0, d.default)(n?.firstWeekContainsDate ?? (n == null || (u = n.locale) == null ? void 0 : u.options?.firstWeekContainsDate) ?? b.firstWeekContainsDate ?? b.locale?.options?.firstWeekContainsDate ?? 1);
1365
1365
  if (!(C >= 1 && C <= 7)) throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
1366
- var w = (0, u.default)(n?.weekStartsOn ?? (n == null || (h = n.locale) == null ? void 0 : h.options?.weekStartsOn) ?? y.weekStartsOn ?? y.locale?.options?.weekStartsOn ?? 0);
1366
+ var w = (0, d.default)(n?.weekStartsOn ?? (n == null || (_ = n.locale) == null ? void 0 : _.options?.weekStartsOn) ?? b.weekStartsOn ?? b.locale?.options?.weekStartsOn ?? 0);
1367
1367
  if (!(w >= 0 && w <= 6)) throw RangeError("weekStartsOn must be between 0 and 6 inclusively");
1368
- if (!x.localize) throw RangeError("locale must contain localize property");
1369
- if (!x.formatLong) throw RangeError("locale must contain formatLong property");
1368
+ if (!S.localize) throw RangeError("locale must contain localize property");
1369
+ if (!S.formatLong) throw RangeError("locale must contain formatLong property");
1370
1370
  var T = (0, a.default)(e);
1371
1371
  if (!(0, r.default)(T)) throw RangeError("Invalid time value");
1372
1372
  var E = (0, c.default)(T), ee = (0, i.default)(T, E), D = {
1373
1373
  firstWeekContainsDate: C,
1374
1374
  weekStartsOn: w,
1375
- locale: x,
1375
+ locale: S,
1376
1376
  _originalDate: T
1377
1377
  };
1378
- return v.match(_).map(function(e) {
1378
+ return v.match(g).map(function(e) {
1379
1379
  var t = e[0];
1380
1380
  if (t === "p" || t === "P") {
1381
1381
  var n = s.default[t];
1382
- return n(e, x.formatLong);
1382
+ return n(e, S.formatLong);
1383
1383
  }
1384
1384
  return e;
1385
- }).join("").match(g).map(function(r) {
1385
+ }).join("").match(h).map(function(r) {
1386
1386
  if (r === "''") return "'";
1387
1387
  var i = r[0];
1388
- if (i === "'") return S(r);
1388
+ if (i === "'") return x(r);
1389
1389
  var a = o.default[i];
1390
- if (a) return !(n != null && n.useAdditionalWeekYearTokens) && (0, l.isProtectedWeekYearToken)(r) && (0, l.throwProtectedError)(r, t, String(e)), !(n != null && n.useAdditionalDayOfYearTokens) && (0, l.isProtectedDayOfYearToken)(r) && (0, l.throwProtectedError)(r, t, String(e)), a(ee, r, x.localize, D);
1391
- if (i.match(b)) throw RangeError("Format string contains an unescaped latin alphabet character `" + i + "`");
1390
+ if (a) return !(n != null && n.useAdditionalWeekYearTokens) && (0, l.isProtectedWeekYearToken)(r) && (0, l.throwProtectedError)(r, t, String(e)), !(n != null && n.useAdditionalDayOfYearTokens) && (0, l.isProtectedDayOfYearToken)(r) && (0, l.throwProtectedError)(r, t, String(e)), a(ee, r, S.localize, D);
1391
+ if (i.match(y)) throw RangeError("Format string contains an unescaped latin alphabet character `" + i + "`");
1392
1392
  return r;
1393
1393
  }).join("");
1394
1394
  }
1395
- function S(e) {
1396
- var t = e.match(v);
1397
- return t ? t[1].replace(y, "'") : e;
1395
+ function x(e) {
1396
+ var t = e.match(_);
1397
+ return t ? t[1].replace(v, "'") : e;
1398
1398
  }
1399
1399
  t.exports = e.default;
1400
1400
  }));
@@ -1455,7 +1455,7 @@ var je = 60 * 1e3, Me = {
1455
1455
  }
1456
1456
  };
1457
1457
  function Ne(e, t) {
1458
- var n = e ? u(e, t, !0) / je : t.getTimezoneOffset();
1458
+ var n = e ? g(e, t, !0) / je : t.getTimezoneOffset();
1459
1459
  if (Number.isNaN(n)) throw RangeError("Invalid time zone specified: " + e);
1460
1460
  return n;
1461
1461
  }
@@ -1480,7 +1480,7 @@ var Re = /* @__PURE__ */ e(Ee()), ze = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
1480
1480
  function Be(e, t, n) {
1481
1481
  var r = String(t), i = n || {}, a = r.match(ze);
1482
1482
  if (a) {
1483
- var o = m(i.originalDate || e, i);
1483
+ var o = l(i.originalDate || e, i);
1484
1484
  r = a.reduce(function(e, t) {
1485
1485
  if (t[0] === "'") return e;
1486
1486
  var n = e.indexOf(t), r = e[n - 1] === "'", a = e.replace(t, "'" + Me[t[0]](o, t, null, i) + "'");
@@ -1508,23 +1508,208 @@ var Ve = /* @__PURE__ */ t(((e, t) => {
1508
1508
  })))());
1509
1509
  function Ue(e, t, n, r) {
1510
1510
  var i = (0, He.default)(r);
1511
- return i.timeZone = t, i.originalDate = e, Be(l(e, t), n, i);
1511
+ return i.timeZone = t, i.originalDate = e, Be(m(e, t), n, i);
1512
1512
  }
1513
1513
  function We(e, t, n) {
1514
1514
  if (typeof e == "string" && !e.match(d)) {
1515
1515
  var r = (0, He.default)(n);
1516
- return r.timeZone = t, m(e, r);
1516
+ return r.timeZone = t, l(e, r);
1517
1517
  }
1518
- var i = m(e, n), a = f(i.getFullYear(), i.getMonth(), i.getDate(), i.getHours(), i.getMinutes(), i.getSeconds(), i.getMilliseconds()).getTime(), o = u(t, new Date(a));
1518
+ var i = l(e, n), a = h(i.getFullYear(), i.getMonth(), i.getDate(), i.getHours(), i.getMinutes(), i.getSeconds(), i.getMilliseconds()).getTime(), o = g(t, new Date(a));
1519
1519
  return new Date(a + o);
1520
1520
  }
1521
- var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (e) => q(e) && q(e.associativeListFilter), J = (e) => {
1521
+ var K = E(), Ge = {
1522
+ [K.FilterOperator.Equals]: {
1523
+ label: "Equals",
1524
+ symbol: "="
1525
+ },
1526
+ [K.FilterOperator.NotEquals]: {
1527
+ label: "Excludes",
1528
+ symbol: "≠"
1529
+ },
1530
+ [K.FilterOperator.GT]: {
1531
+ label: "Greater than",
1532
+ symbol: ">"
1533
+ },
1534
+ [K.FilterOperator.GTE]: {
1535
+ label: "Greater than or equal",
1536
+ symbol: "≥"
1537
+ },
1538
+ [K.FilterOperator.LT]: {
1539
+ label: "Less than",
1540
+ symbol: "<"
1541
+ },
1542
+ [K.FilterOperator.LTE]: {
1543
+ label: "Less than or equal",
1544
+ symbol: "≤"
1545
+ },
1546
+ [K.FilterOperator.Between]: {
1547
+ label: "Between",
1548
+ symbol: "↔"
1549
+ },
1550
+ [K.FilterOperator.NotBetween]: {
1551
+ label: "Not between",
1552
+ symbol: "↮"
1553
+ },
1554
+ [K.FilterOperator.InList]: {
1555
+ label: "In list",
1556
+ symbol: "in"
1557
+ },
1558
+ [K.FilterOperator.NotInList]: {
1559
+ label: "Exclude from list",
1560
+ symbol: "not in"
1561
+ },
1562
+ [K.FilterOperator.Contains]: {
1563
+ label: "Contains",
1564
+ symbol: "⊃"
1565
+ },
1566
+ [K.FilterOperator.NotContains]: {
1567
+ label: "Not contains",
1568
+ symbol: "⊅"
1569
+ },
1570
+ [K.FilterOperator.Like]: {
1571
+ label: "Like",
1572
+ symbol: "~"
1573
+ },
1574
+ [K.FilterOperator.NotLike]: {
1575
+ label: "Not like",
1576
+ symbol: "≁"
1577
+ },
1578
+ [K.FilterOperator.Set]: {
1579
+ label: "Is not null",
1580
+ symbol: "∃"
1581
+ },
1582
+ [K.FilterOperator.NotSet]: {
1583
+ label: "Is null",
1584
+ symbol: "∄"
1585
+ },
1586
+ [K.FilterOperator.GeoIntersect]: {
1587
+ label: "Intersects",
1588
+ symbol: "⊗"
1589
+ }
1590
+ }, Ke = [
1591
+ K.FilterOperator.Equals,
1592
+ K.FilterOperator.NotEquals,
1593
+ K.FilterOperator.GT,
1594
+ K.FilterOperator.GTE,
1595
+ K.FilterOperator.LT,
1596
+ K.FilterOperator.LTE,
1597
+ K.FilterOperator.Between
1598
+ ].map((e) => ({
1599
+ operator: e,
1600
+ label: Ge[e].label,
1601
+ arity: e === K.FilterOperator.Between ? 2 : 1
1602
+ })), qe = [
1603
+ K.FilterOperator.Equals,
1604
+ K.FilterOperator.NotEquals,
1605
+ K.FilterOperator.InList,
1606
+ K.FilterOperator.NotInList,
1607
+ K.FilterOperator.Contains,
1608
+ K.FilterOperator.NotContains,
1609
+ K.FilterOperator.Like,
1610
+ K.FilterOperator.NotLike,
1611
+ K.FilterOperator.Set,
1612
+ K.FilterOperator.NotSet
1613
+ ], Je = [
1614
+ K.FilterOperator.Equals,
1615
+ K.FilterOperator.NotEquals,
1616
+ K.FilterOperator.GT,
1617
+ K.FilterOperator.GTE,
1618
+ K.FilterOperator.LT,
1619
+ K.FilterOperator.LTE,
1620
+ K.FilterOperator.Between,
1621
+ K.FilterOperator.NotBetween,
1622
+ K.FilterOperator.InList,
1623
+ K.FilterOperator.NotInList,
1624
+ K.FilterOperator.Set,
1625
+ K.FilterOperator.NotSet
1626
+ ], Ye = (e) => /int|float|decimal|number|numeric|double/i.test(e), Xe = (e) => Ye(e) ? Je : qe, Ze = (e) => e === null ? "null" : String(e), Qe = (e, t, n) => {
1627
+ let r = (n ?? []).filter((e) => typeof e != "object" || !e), i = r.length === 1;
1628
+ return [
1629
+ e,
1630
+ t === K.FilterOperator.InList && i ? "=" : t === K.FilterOperator.NotInList && i ? "≠" : Ge[t]?.symbol ?? t,
1631
+ r.map(Ze).join(", ")
1632
+ ].filter(Boolean).join(" ");
1633
+ }, $e = (e) => Ke.find((t) => t.operator === e)?.arity, et = (e) => [...(Array.isArray(e.intersectFilters) ? e.intersectFilters : []).map((e) => ({
1634
+ kind: "intersect",
1635
+ value: e
1636
+ })), ...(Array.isArray(e.unionFilters) ? e.unionFilters : []).map((e) => ({
1637
+ kind: "union",
1638
+ value: e
1639
+ }))], tt = (e, t) => ({
1640
+ ...e,
1641
+ intersectFilters: t.filter((e) => e.kind === "intersect").map((e) => e.value),
1642
+ unionFilters: t.filter((e) => e.kind === "union").map((e) => e.value)
1643
+ }), nt = () => ({ filterGroup: {
1644
+ filters: [],
1645
+ filterGroups: [],
1646
+ or: !1
1647
+ } }), rt = (e) => et(e).length ? e : {
1648
+ ...e,
1649
+ intersectFilters: [nt()]
1650
+ }, it = (e) => {
1651
+ let t = (e, t) => `${e.value.isNegativeAssociation ? "NOT " : ""}{Set ${t + 1}}`, n = e.map((e, n) => ({
1652
+ entry: e,
1653
+ text: t(e, n)
1654
+ })), r = n.filter(({ entry: e }) => e.kind === "intersect").map(({ text: e }) => e), i = n.filter(({ entry: e }) => e.kind === "union").map(({ text: e }) => e), a = r.join(" AND ");
1655
+ return [i.length && r.length > 1 ? `(${a})` : a, ...i].filter(Boolean).join(" OR ");
1656
+ }, at = (e) => ({
1657
+ or: !0,
1658
+ filterGroups: [],
1659
+ filters: [...new Set(e)].flatMap((e) => [{
1660
+ fieldKey: e,
1661
+ operator: K.FilterOperator.Set,
1662
+ values: null
1663
+ }, {
1664
+ fieldKey: e,
1665
+ operator: K.FilterOperator.NotSet,
1666
+ values: null
1667
+ }])
1668
+ }), ot = (e) => {
1669
+ let t = e.filters ?? [], n = (e, n) => t.some((t) => t.fieldKey === e && t.operator === n && t.values == null), r = new Set(t.map((e) => e.fieldKey));
1670
+ return e.or === !0 && !(e.filterGroups ?? []).length && t.length > 0 && t.length === r.size * 2 && [...r].every((e) => n(e, K.FilterOperator.Set) && n(e, K.FilterOperator.NotSet));
1671
+ }, st = (e) => e.postFilterGroup && ot(e.filterGroup) ? {
1672
+ filters: [],
1673
+ filterGroups: [],
1674
+ or: !1
1675
+ } : e.filterGroup, ct = (e) => (e.filters ?? []).length > 0 || (e.filterGroups ?? []).length > 0, lt = (e) => {
1676
+ let t = e.calculations ?? [];
1677
+ return (e.postFilterGroup?.filters ?? []).flatMap((e) => {
1678
+ let n = t[e.calculationNo - 1], r = n && typeof n == "object" && "itemKey" in n ? n.itemKey : void 0;
1679
+ return typeof r == "string" && r ? [{
1680
+ measureKey: r,
1681
+ operator: e.operator,
1682
+ values: (e.values ?? []).map((e) => Number(e))
1683
+ }] : [];
1684
+ });
1685
+ }, ut = (e) => !(e.postFilterGroup?.filterGroups ?? []).length && lt(e).length === (e.postFilterGroup?.filters ?? []).length, dt = (e, t, n, r) => {
1686
+ if (!ut(e)) return e;
1687
+ let i = { ...e };
1688
+ if (delete i.calculations, delete i.postFilterGroup, !n.length) return {
1689
+ ...i,
1690
+ filterGroup: t
1691
+ };
1692
+ let a = [...new Set(n.map((e) => e.measureKey))], o = n.map((e) => ({
1693
+ calculationNo: a.indexOf(e.measureKey) + 1,
1694
+ operator: e.operator,
1695
+ values: e.values
1696
+ })), s = a.flatMap((e) => r.find((t) => t.key === e)?.aggregatedFieldKeys ?? []), c = lt(e).map((e) => e.measureKey), l = ot(e.filterGroup) && [...new Set(c)].join("\n") === a.join("\n");
1697
+ return {
1698
+ ...i,
1699
+ filterGroup: ct(t) ? t : l ? e.filterGroup : at(s),
1700
+ calculations: a.map((e) => ({ itemKey: e })),
1701
+ postFilterGroup: {
1702
+ filters: o,
1703
+ or: e.postFilterGroup?.or === !0
1704
+ }
1705
+ };
1706
+ }, ft = (e) => !!e.measureKey && $e(e.operator) === e.values.length && e.values.every((e) => Number.isFinite(e)), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), pt = (e) => q(e) && q(e.associativeListFilter), J = (e) => {
1522
1707
  if (!q(e)) return;
1523
1708
  if (typeof e.fieldKey == "string") return e.fieldKey;
1524
1709
  let t = e.field;
1525
1710
  if (!(!q(t) || typeof t.name != "string" || typeof t.view != "string")) return `[${t.view}].[${t.name}]`;
1526
- }, Ke = (e) => {
1527
- if (Ge(e)) return JSON.stringify(["associative", J(e) ?? ""]);
1711
+ }, mt = (e) => {
1712
+ if (pt(e)) return JSON.stringify(["associative", J(e) ?? ""]);
1528
1713
  let t = q(e) ? e : {};
1529
1714
  return JSON.stringify([
1530
1715
  "value",
@@ -1534,7 +1719,7 @@ var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (
1534
1719
  t.operator
1535
1720
  ]);
1536
1721
  }, Y = (e) => {
1537
- if (Ge(e)) return JSON.stringify(["associative", J(e) ?? ""]);
1722
+ if (pt(e)) return JSON.stringify(["associative", J(e) ?? ""]);
1538
1723
  let t = q(e) ? e : {};
1539
1724
  return JSON.stringify([
1540
1725
  "value",
@@ -1542,23 +1727,23 @@ var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (
1542
1727
  t.dateLevel ?? null,
1543
1728
  t.datePart ?? null
1544
1729
  ]);
1545
- }, qe = (e) => {
1730
+ }, ht = (e) => {
1546
1731
  let t = q(e) ? e : {};
1547
1732
  return {
1548
- applied: et(t.applied),
1549
- pending: et(t.pending)
1733
+ applied: St(t.applied),
1734
+ pending: St(t.pending)
1550
1735
  };
1551
- }, Je = (e) => {
1736
+ }, gt = (e) => {
1552
1737
  let t = /* @__PURE__ */ new Map();
1553
1738
  for (let n of e.applied) {
1554
- let e = Ke(n);
1739
+ let e = mt(n);
1555
1740
  t.set(e, {
1556
1741
  identity: e,
1557
1742
  applied: n
1558
1743
  });
1559
1744
  }
1560
1745
  for (let n of e.pending) {
1561
- let e = Ke(n), r = t.get(e);
1746
+ let e = mt(n), r = t.get(e);
1562
1747
  t.set(e, {
1563
1748
  ...r,
1564
1749
  identity: e,
@@ -1566,7 +1751,7 @@ var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (
1566
1751
  });
1567
1752
  }
1568
1753
  return [...t.values()];
1569
- }, Ye = (e) => Je(e).flatMap(({ identity: e, applied: t, pending: n }) => {
1754
+ }, _t = (e) => gt(e).flatMap(({ identity: e, applied: t, pending: n }) => {
1570
1755
  let r = n ?? t;
1571
1756
  return r ? [{
1572
1757
  id: e,
@@ -1574,28 +1759,31 @@ var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (
1574
1759
  applied: t,
1575
1760
  pending: n
1576
1761
  }] : [];
1577
- }), Xe = (e, t = (e) => e === null ? "∅" : String(e)) => {
1578
- if (Ge(e)) return {
1579
- isAssociative: !0,
1580
- isEmpty: !rt(e.associativeListFilter),
1581
- valueCount: 0,
1582
- text: "Related records"
1583
- };
1584
- let n = Array.isArray(e.values) ? e.values : [], r = dt(e), i = n.length, a = e.operator === K.FilterOperator.Set || e.operator === K.FilterOperator.NotSet, o = n.slice(0, 3).map((e) => q(e) ? typeof e.dataType == "string" ? `${e.dataType} filter` : "Value" : t(e));
1762
+ }), vt = (e, t = (e) => e === null ? "∅" : String(e)) => {
1763
+ if (pt(e)) {
1764
+ let t = et(e.associativeListFilter).length;
1765
+ return {
1766
+ isAssociative: !0,
1767
+ isEmpty: !Tt(e.associativeListFilter),
1768
+ valueCount: 0,
1769
+ text: t > 1 ? `Set filter · ${t} sets` : "Set filter"
1770
+ };
1771
+ }
1772
+ let n = Array.isArray(e.values) ? e.values : [], r = Pt(e), i = n.length, a = e.operator === K.FilterOperator.Set || e.operator === K.FilterOperator.NotSet, o = n.slice(0, 3).map((e) => q(e) ? typeof e.dataType == "string" ? `${e.dataType} filter` : "Value" : t(e));
1585
1773
  return {
1586
1774
  isAssociative: !1,
1587
1775
  isEmpty: !r && !a && i === 0,
1588
1776
  valueCount: i,
1589
1777
  text: a ? "Has value" : r ? "Dynamic date" : `${o.join(", ")}${i > 3 ? ` +${i - 3}` : ""}`
1590
1778
  };
1591
- }, Ze = (e) => Ge(e) ? rt(e.associativeListFilter) : e.operator === K.FilterOperator.Set || e.operator === K.FilterOperator.NotSet || dt(e) ? !0 : !Array.isArray(e.values) || e.values.length === 0 ? !1 : e.operator === K.FilterOperator.Between || e.operator === K.FilterOperator.NotBetween ? e.values.length === 2 && ct(e.values[0]) && ct(e.values[1]) : e.operator === K.FilterOperator.Like || e.operator === K.FilterOperator.NotLike ? e.values.length === 1 && typeof e.values[0] == "string" && e.values[0].trim().length > 0 : [K.FilterOperator.InList, K.FilterOperator.NotInList].includes(e.operator) ? e.values.every(st) : e.operator === K.FilterOperator.GeoIntersect ? e.values.length === 1 && lt(e.values[0]) : e.values.length === 1 && st(e.values[0]), Qe = Ze, $e = Xe, et = (e) => Array.isArray(e) ? e.flatMap((e) => {
1779
+ }, yt = (e) => pt(e) ? Tt(e.associativeListFilter) : e.operator === K.FilterOperator.Set || e.operator === K.FilterOperator.NotSet || Pt(e) ? !0 : !Array.isArray(e.values) || e.values.length === 0 ? !1 : e.operator === K.FilterOperator.Between || e.operator === K.FilterOperator.NotBetween ? e.values.length === 2 && jt(e.values[0]) && jt(e.values[1]) : e.operator === K.FilterOperator.Like || e.operator === K.FilterOperator.NotLike ? e.values.length === 1 && typeof e.values[0] == "string" && e.values[0].trim().length > 0 : [K.FilterOperator.InList, K.FilterOperator.NotInList].includes(e.operator) ? e.values.every(At) : e.operator === K.FilterOperator.GeoIntersect ? e.values.length === 1 && Mt(e.values[0]) : e.values.length === 1 && At(e.values[0]), bt = yt, xt = vt, St = (e) => Array.isArray(e) ? e.flatMap((e) => {
1592
1780
  if (!q(e)) return [];
1593
1781
  if (q(e.associativeListFilter)) {
1594
1782
  let t = J(e);
1595
1783
  return t ? [{
1596
1784
  ...e,
1597
1785
  fieldKey: t,
1598
- associativeListFilter: nt(e.associativeListFilter)
1786
+ associativeListFilter: wt(e.associativeListFilter)
1599
1787
  }] : [];
1600
1788
  }
1601
1789
  let t = J(e);
@@ -1604,14 +1792,14 @@ var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (
1604
1792
  ...e,
1605
1793
  fieldKey: t
1606
1794
  };
1607
- return Array.isArray(e.values) && (n.values = e.values.map(tt)), [n];
1608
- }) : [], tt = (e) => {
1795
+ return Array.isArray(e.values) && (n.values = e.values.map(Ct)), [n];
1796
+ }) : [], Ct = (e) => {
1609
1797
  if (e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean") return e;
1610
1798
  if (!q(e) || e.isNull === !0 || "value" in e && e.value === null) return null;
1611
1799
  if ("value" in e && (typeof e.value == "string" || typeof e.value == "number" || typeof e.value == "boolean")) return e.value;
1612
1800
  let t = e;
1613
1801
  return "valueBoolean" in t && t.valueBoolean !== void 0 ? t.valueBoolean : "valueInt" in t && t.valueInt !== void 0 ? t.valueInt : "valueFloat" in t && t.valueFloat !== void 0 ? t.valueFloat : "valueMillisec" in t && t.valueMillisec !== void 0 ? t.valueMillisec : "valueString" in t && t.valueString !== void 0 ? t.valueString : "valueDate" in t && t.valueDate !== void 0 ? t.valueDate : "valueTime" in t && t.valueTime !== void 0 ? t.valueTime : "valueTimeTZ" in t && t.valueTimeTZ !== void 0 ? t.valueTimeTZ : "valueDatetime" in t && t.valueDatetime !== void 0 ? t.valueDatetime : "valueDatetimeTZ" in t && t.valueDatetimeTZ !== void 0 ? t.valueDatetimeTZ : typeof e.dataType == "string" ? e : null;
1614
- }, nt = (e) => {
1802
+ }, wt = (e) => {
1615
1803
  let t = (e) => !q(e) || !q(e.filterGroup) ? e : {
1616
1804
  ...e,
1617
1805
  filterGroup: n(e.filterGroup)
@@ -1620,7 +1808,7 @@ var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (
1620
1808
  ...Array.isArray(e.filters) ? { filters: e.filters.map((e) => {
1621
1809
  if (!q(e)) return e;
1622
1810
  let t = { ...e };
1623
- return Array.isArray(e.values) && (t.values = e.values.map(tt)), t;
1811
+ return Array.isArray(e.values) && (t.values = e.values.map(Ct)), t;
1624
1812
  }) } : {},
1625
1813
  ...Array.isArray(e.filterGroups) ? { filterGroups: e.filterGroups.map((e) => q(e) ? n(e) : e) } : {}
1626
1814
  });
@@ -1629,20 +1817,28 @@ var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (
1629
1817
  ...Array.isArray(e.intersectFilters) ? { intersectFilters: e.intersectFilters.map(t) } : {},
1630
1818
  ...Array.isArray(e.unionFilters) ? { unionFilters: e.unionFilters.map(t) } : {}
1631
1819
  };
1632
- }, rt = (e) => {
1820
+ }, Tt = (e) => {
1633
1821
  if (!q(e) || typeof e.view != "string") return !1;
1634
1822
  let t = [e.intersectFilters, e.unionFilters].filter(Array.isArray).flatMap((e) => e);
1635
- return t.length > 0 && t.every(it);
1636
- }, it = (e) => !q(e) || !q(e.filterGroup) ? !1 : at(e.filterGroup), at = (e) => {
1823
+ return t.length > 0 && t.every(Et);
1824
+ }, Et = (e) => !q(e) || !q(e.filterGroup) ? !1 : Ot(e.filterGroup) && Dt(e), Dt = (e) => {
1825
+ let t = e.postFilterGroup;
1826
+ if (t === void 0) return !0;
1827
+ if (!q(t) || !Array.isArray(t.filters) || Array.isArray(t.filterGroups) && t.filterGroups.length) return !1;
1828
+ if (!t.filters.length) return !0;
1829
+ if (!(Array.isArray(e.calculations) && e.calculations.every(q) && t.filters.every((e) => q(e) && Number.isInteger(e.calculationNo) && Array.isArray(e.values)))) return !1;
1830
+ let n = lt(e);
1831
+ return n.length === t.filters.length && n.every(ft);
1832
+ }, Ot = (e) => {
1637
1833
  let t = Array.isArray(e.filters) ? e.filters : [], n = Array.isArray(e.filterGroups) ? e.filterGroups : [], r = [...t, ...n];
1638
- return r.length > 0 && r.every(ot);
1639
- }, ot = (e) => q(e) ? q(e.filterGroup) ? at(e.filterGroup) : Array.isArray(e.filters) || Array.isArray(e.filterGroups) ? at(e) : typeof e.fieldKey == "string" && typeof e.operator == "string" && Ze(e) : !1, st = (e) => e === null || typeof e == "boolean" ? !0 : typeof e == "number" ? Number.isFinite(e) : typeof e == "string" ? e.trim().length > 0 : q(e) && typeof e.dataType == "string", ct = (e) => e !== null && st(e), lt = (e) => q(e) && e.dataType === "geography" && ut(e.valueGeoMinPoint) && ut(e.valueGeoMaxPoint), ut = (e) => {
1834
+ return r.length > 0 && r.every(kt);
1835
+ }, kt = (e) => q(e) ? q(e.filterGroup) ? Ot(e.filterGroup) : Array.isArray(e.filters) || Array.isArray(e.filterGroups) ? Ot(e) : typeof e.fieldKey == "string" && typeof e.operator == "string" && yt(e) : !1, At = (e) => e === null || typeof e == "boolean" ? !0 : typeof e == "number" ? Number.isFinite(e) : typeof e == "string" ? e.trim().length > 0 : q(e) && typeof e.dataType == "string", jt = (e) => e !== null && At(e), Mt = (e) => q(e) && e.dataType === "geography" && Nt(e.valueGeoMinPoint) && Nt(e.valueGeoMaxPoint), Nt = (e) => {
1640
1836
  if (typeof e != "string") return !1;
1641
1837
  let t = e.trim().split(/[ ,]+/).map(Number);
1642
1838
  if (t.length !== 2 || !t.every(Number.isFinite)) return !1;
1643
1839
  let [n, r] = t;
1644
1840
  return n >= -180 && n <= 180 && r >= -90 && r <= 90;
1645
- }, dt = (e) => {
1841
+ }, Pt = (e) => {
1646
1842
  let t = [
1647
1843
  "year",
1648
1844
  "quarter",
@@ -1660,7 +1856,7 @@ var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (
1660
1856
  if (i && Object.values(K.DynamicDateCalcType).includes(i.type)) return !0;
1661
1857
  let a = e.dynamicDateCalcRange;
1662
1858
  return !!(a && Object.values(K.DynamicDateCalcRangeType).includes(a.type));
1663
- }, ft = (e) => e.dataType === K.FieldType.GEOGRAPHY ? {
1859
+ }, Ft = (e) => e.dataType === K.FieldType.GEOGRAPHY ? {
1664
1860
  fieldKey: e.key,
1665
1861
  operator: K.FilterOperator.GeoIntersect,
1666
1862
  values: [{
@@ -1672,10 +1868,10 @@ var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (
1672
1868
  fieldKey: e.key,
1673
1869
  operator: K.FilterOperator.InList,
1674
1870
  values: []
1675
- }, pt = (e, t) => t ? [e[0] ?? null] : [e[0] ?? null, e[1] ?? null], mt = (e, t) => {
1871
+ }, It = (e, t) => t ? [e[0] ?? null] : [e[0] ?? null, e[1] ?? null], Lt = (e, t) => {
1676
1872
  let n = typeof e == "string" && /\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?\s*(?:Z|[+-]\d{2}(?::?\d{2})?)$/i.test(e);
1677
1873
  return typeof e == "string" && !n ? We(e.replace(" ", "T"), t) : new Date(e);
1678
- }, ht = (e, t, n) => {
1874
+ }, Rt = (e, t, n) => {
1679
1875
  if (e == null || e === "" || typeof e != "number" && typeof e != "string") return "";
1680
1876
  if (t === K.FieldType.TIME) {
1681
1877
  let t = typeof e == "string" && /^(\d{1,2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/.exec(e), n = typeof e == "number" ? e : t ? (Number(t[1]) * 3600 + Number(t[2]) * 60 + Number(t[3] ?? 0)) * 1e3 + Number((t[4] ?? "").padEnd(3, "0")) : Date.parse(String(e));
@@ -1687,9 +1883,9 @@ var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (
1687
1883
  let t = new Date(typeof e == "string" && /^\d{4}-\d{2}-\d{2}$/.test(e) ? `${e}T00:00:00.000Z` : e);
1688
1884
  return Number.isFinite(t.getTime()) ? t.toISOString().slice(0, 10) : "";
1689
1885
  }
1690
- let r = mt(e, n);
1886
+ let r = Lt(e, n);
1691
1887
  return Number.isFinite(r.getTime()) ? Ue(r, n, "yyyy-MM-dd'T'HH:mm:ss.SSS") : "";
1692
- }, gt = (e, t, n) => {
1888
+ }, zt = (e, t, n) => {
1693
1889
  if (!e) return null;
1694
1890
  if (t === K.FieldType.TIME) {
1695
1891
  let [t = "0", n = "0", r = "0"] = e.split(":"), [i = "0", a = "0"] = r.split(".");
@@ -1704,15 +1900,15 @@ var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (
1704
1900
  } catch {
1705
1901
  return null;
1706
1902
  }
1707
- }, _t = (e, t, n) => {
1903
+ }, Bt = (e, t, n) => {
1708
1904
  let r = e.flatMap((e) => {
1709
1905
  if (typeof e != "number" && (typeof e != "string" || !e.trim())) return [];
1710
1906
  let r;
1711
1907
  if (typeof e == "number") r = e;
1712
1908
  else if (t === K.FieldType.DATE) r = Date.parse(e);
1713
- else if (t === K.FieldType.TIMESTAMP || t === K.FieldType.TIMESTAMP_TZ) r = mt(e, n).getTime();
1909
+ else if (t === K.FieldType.TIMESTAMP || t === K.FieldType.TIMESTAMP_TZ) r = Lt(e, n).getTime();
1714
1910
  else if (t === K.FieldType.TIME) {
1715
- let i = gt(ht(e, t, n), t, n);
1911
+ let i = zt(Rt(e, t, n), t, n);
1716
1912
  r = typeof i == "number" ? i : NaN;
1717
1913
  } else r = Number(e);
1718
1914
  return Number.isFinite(r) ? [{
@@ -1721,7 +1917,7 @@ var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (
1721
1917
  }] : [];
1722
1918
  }).sort((e, t) => e.order - t.order);
1723
1919
  return r.length ? [r[0].value, r[r.length - 1].value] : [];
1724
- }, vt = (e) => [
1920
+ }, Vt = (e) => [
1725
1921
  K.FieldType.INT,
1726
1922
  K.FieldType.REAL,
1727
1923
  K.FieldType.FLOAT,
@@ -1731,7 +1927,7 @@ var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (
1731
1927
  K.FieldType.TIME,
1732
1928
  K.FieldType.TIMESTAMP,
1733
1929
  K.FieldType.TIMESTAMP_TZ
1734
- ].includes(e), yt = (e, t) => t.operator === K.FilterOperator.GeoIntersect ? "geo" : [K.FilterOperator.Set, K.FilterOperator.NotSet].includes(t.operator) ? "null" : [K.FilterOperator.Contains, K.FilterOperator.NotContains].includes(t.operator) ? "text" : X(e) && (t.dynamicDate || t.dynamicDateCalc || [K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(t.operator)) ? "date" : t.operator === K.FilterOperator.Like || t.operator === K.FilterOperator.NotLike ? "text" : t.operator === K.FilterOperator.Between || t.operator === K.FilterOperator.NotBetween || t.dynamicDateRange || t.dynamicDateCalcRange ? X(e) ? "date" : "range" : [K.FilterOperator.InList, K.FilterOperator.NotInList].includes(t.operator) ? "list" : [K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(t.operator) && X(e) ? "date" : "scalar", bt = (e) => {
1930
+ ].includes(e), Ht = (e, t) => t.operator === K.FilterOperator.GeoIntersect ? "geo" : [K.FilterOperator.Set, K.FilterOperator.NotSet].includes(t.operator) ? "null" : [K.FilterOperator.Contains, K.FilterOperator.NotContains].includes(t.operator) ? "text" : X(e) && (t.dynamicDate || t.dynamicDateCalc || [K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(t.operator)) ? "date" : t.operator === K.FilterOperator.Like || t.operator === K.FilterOperator.NotLike ? "text" : t.operator === K.FilterOperator.Between || t.operator === K.FilterOperator.NotBetween || t.dynamicDateRange || t.dynamicDateCalcRange ? X(e) ? "date" : "range" : [K.FilterOperator.InList, K.FilterOperator.NotInList].includes(t.operator) ? "list" : [K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(t.operator) && X(e) ? "date" : "scalar", Ut = (e) => {
1735
1931
  if (e === K.FieldType.GEOGRAPHY) return [K.FilterOperator.GeoIntersect];
1736
1932
  if (e === K.FieldType.BOOLEAN) return [
1737
1933
  K.FilterOperator.Equals,
@@ -1747,7 +1943,7 @@ var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (
1747
1943
  K.FilterOperator.Set,
1748
1944
  K.FilterOperator.NotSet
1749
1945
  ];
1750
- return vt(e) || X(e) ? [
1946
+ return Vt(e) || X(e) ? [
1751
1947
  ...t,
1752
1948
  K.FilterOperator.GT,
1753
1949
  K.FilterOperator.GTE,
@@ -1765,15 +1961,15 @@ var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (
1765
1961
  }, Z = (e) => {
1766
1962
  let t = { ...e };
1767
1963
  return delete t.dynamicDate, delete t.dynamicDateCalc, delete t.dynamicDateRange, delete t.dynamicDateCalcRange, t;
1768
- }, xt = (e, t) => ({
1964
+ }, Wt = (e, t) => ({
1769
1965
  ...Z(e),
1770
1966
  values: t
1771
- }), Q = (e) => Array.isArray(e.values) ? e.values : [], $ = (e) => `${typeof e}:${typeof e == "object" && e ? JSON.stringify(e) : String(e)}`, St = (e) => Array.isArray(e.data) ? e.data.map((e) => e[0]) : Object.values(e.data).map((e) => e[0]), Ct = (e, t, n) => {
1967
+ }), Q = (e) => Array.isArray(e.values) ? e.values : [], $ = (e) => `${typeof e}:${typeof e == "object" && e ? JSON.stringify(e) : String(e)}`, Gt = (e) => Array.isArray(e.data) ? e.data.map((e) => e[0]) : Object.values(e.data).map((e) => e[0]), Kt = (e, t, n) => {
1772
1968
  let r = [K.FilterOperator.Contains, K.FilterOperator.NotContains].includes(t.operator), i = [K.FilterOperator.Like, K.FilterOperator.NotLike].includes(t.operator);
1773
1969
  if (!(!r && !i)) return {
1774
1970
  dimensions: [{ fieldKey: e }],
1775
1971
  measures: [],
1776
- filters: [c({
1972
+ filters: [a({
1777
1973
  fieldKey: e,
1778
1974
  operator: r ? K.FilterOperator.Contains : K.FilterOperator.Like,
1779
1975
  values: [String(Q(t)[0] ?? "").trim()],
@@ -1782,7 +1978,7 @@ var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (
1782
1978
  })],
1783
1979
  limit: n
1784
1980
  };
1785
- }, wt = (e) => e === K.FieldType.DATE ? "date" : e === K.FieldType.TIME ? "time" : "datetime-local", Tt = (e) => e.dynamicDateCalcRange ? "preset" : e.dynamicDateRange ? "relative" : e.dynamicDateCalc ? "dynamic-calc" : e.dynamicDate ? "dynamic" : [K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(e.operator) ? "single" : "fixed", Et = (e, t) => {
1981
+ }, qt = (e) => e === K.FieldType.DATE ? "date" : e === K.FieldType.TIME ? "time" : "datetime-local", Jt = (e) => e.dynamicDateCalcRange ? "preset" : e.dynamicDateRange ? "relative" : e.dynamicDateCalc ? "dynamic-calc" : e.dynamicDate ? "dynamic" : [K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(e.operator) ? "single" : "fixed", Yt = (e, t) => {
1786
1982
  let n = Z(e), r = [K.FilterOperator.NotEquals, K.FilterOperator.NotBetween].includes(e.operator), i = [
1787
1983
  K.FilterOperator.Equals,
1788
1984
  K.FilterOperator.NotEquals,
@@ -1828,7 +2024,7 @@ var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (
1828
2024
  values: [null, null]
1829
2025
  };
1830
2026
  };
1831
- function Dt({ filter: e, disabledControls: t, update: n }) {
2027
+ function Xt({ filter: e, disabledControls: t, update: n }) {
1832
2028
  let r = Q(e), i = r[0], a = (i?.valueGeoMinPoint ?? "").split(/[ ,]+/), o = (i?.valueGeoMaxPoint ?? "").split(/[ ,]+/), s = (t, i, s) => {
1833
2029
  let c = t === "min" ? a : o;
1834
2030
  c[i] = s;
@@ -1843,25 +2039,25 @@ function Dt({ filter: e, disabledControls: t, update: n }) {
1843
2039
  values: [d]
1844
2040
  });
1845
2041
  };
1846
- return /* @__PURE__ */ (0, k.jsx)("div", {
2042
+ return /* @__PURE__ */ (0, A.jsx)("div", {
1847
2043
  className: "astrato-app-filter-bar__fieldset",
1848
2044
  "aria-label": "Geographic bounding box",
1849
2045
  children: ["min", "max"].map((e) => {
1850
2046
  let n = e === "min" ? a : o;
1851
- return /* @__PURE__ */ (0, k.jsxs)("div", {
2047
+ return /* @__PURE__ */ (0, A.jsxs)("div", {
1852
2048
  className: "astrato-app-filter-bar__row",
1853
- children: [/* @__PURE__ */ (0, k.jsxs)("label", {
2049
+ children: [/* @__PURE__ */ (0, A.jsxs)("label", {
1854
2050
  className: "astrato-app-filter-bar__label",
1855
- children: [e === "min" ? "Minimum longitude" : "Maximum longitude", /* @__PURE__ */ (0, k.jsx)(M, {
2051
+ children: [e === "min" ? "Minimum longitude" : "Maximum longitude", /* @__PURE__ */ (0, A.jsx)(N, {
1856
2052
  className: "astrato-app-filter-bar__control",
1857
2053
  type: "number",
1858
2054
  value: n[0] ?? "",
1859
2055
  disabled: t,
1860
2056
  onChange: (t) => s(e, 0, t.currentTarget.value)
1861
2057
  })]
1862
- }), /* @__PURE__ */ (0, k.jsxs)("label", {
2058
+ }), /* @__PURE__ */ (0, A.jsxs)("label", {
1863
2059
  className: "astrato-app-filter-bar__label",
1864
- children: [e === "min" ? "Minimum latitude" : "Maximum latitude", /* @__PURE__ */ (0, k.jsx)(M, {
2060
+ children: [e === "min" ? "Minimum latitude" : "Maximum latitude", /* @__PURE__ */ (0, A.jsx)(N, {
1865
2061
  className: "astrato-app-filter-bar__control",
1866
2062
  type: "number",
1867
2063
  value: n[1] ?? "",
@@ -1873,13 +2069,13 @@ function Dt({ filter: e, disabledControls: t, update: n }) {
1873
2069
  })
1874
2070
  });
1875
2071
  }
1876
- var Ot = Object.values(K.DynamicDateCalcRangeType).map((e) => ({
2072
+ var Zt = Object.values(K.DynamicDateCalcRangeType).map((e) => ({
1877
2073
  value: e,
1878
- label: n[e] ?? e
1879
- })), kt = Object.values(K.DynamicDateCalcType).map((e) => ({
2074
+ label: s[e] ?? e
2075
+ })), Qt = Object.values(K.DynamicDateCalcType).map((e) => ({
1880
2076
  value: e,
1881
- label: n[e] ?? e
1882
- })), At = [
2077
+ label: s[e] ?? e
2078
+ })), $t = [
1883
2079
  {
1884
2080
  value: "list",
1885
2081
  label: "Pick values",
@@ -1915,7 +2111,7 @@ var Ot = Object.values(K.DynamicDateCalcRangeType).map((e) => ({
1915
2111
  label: "Geographic bounds",
1916
2112
  icon: "geography"
1917
2113
  }
1918
- ], jt = {
2114
+ ], en = {
1919
2115
  [K.FilterOperator.Equals]: "Equals",
1920
2116
  [K.FilterOperator.NotEquals]: "Does not equal",
1921
2117
  [K.FilterOperator.InList]: "In list",
@@ -1934,15 +2130,15 @@ var Ot = Object.values(K.DynamicDateCalcRangeType).map((e) => ({
1934
2130
  [K.FilterOperator.NotContains]: "Does not contain",
1935
2131
  [K.FilterOperator.GeoIntersect]: "Intersects bounding box"
1936
2132
  };
1937
- function Mt({ field: e, filter: t, editor: n }) {
2133
+ function tn({ field: e, filter: t, editor: n }) {
1938
2134
  let { editorMode: r, disabledControls: i, update: a, valueList: { searchInput: o, setSearchInput: s } } = n, c = Q(t);
1939
- return r === "list" ? /* @__PURE__ */ (0, k.jsx)(ne, {
2135
+ return r === "list" ? /* @__PURE__ */ (0, A.jsx)(te, {
1940
2136
  value: o,
1941
2137
  disabled: i,
1942
2138
  placeholder: "Search values…",
1943
2139
  "aria-label": `Search ${e.name} values`,
1944
2140
  onChange: (e) => s(e.currentTarget.value)
1945
- }) : r === "text" ? /* @__PURE__ */ (0, k.jsx)(M, {
2141
+ }) : r === "text" ? /* @__PURE__ */ (0, A.jsx)(N, {
1946
2142
  className: "astrato-app-filter-bar__control astrato-app-filter-bar__text-query",
1947
2143
  type: "search",
1948
2144
  placeholder: "Match text…",
@@ -1955,46 +2151,46 @@ function Mt({ field: e, filter: t, editor: n }) {
1955
2151
  })
1956
2152
  }) : null;
1957
2153
  }
1958
- function Nt({ field: e, filter: t, editor: n, showAdvancedOperators: r }) {
1959
- let { editorMode: i, disabledControls: a, isSingleSelect: o, isChangingMode: s, switchMode: c, changeOperator: l, changeExclude: u } = n, d = t.operator === K.FilterOperator.NotInList || t.operator === K.FilterOperator.NotLike || t.operator === K.FilterOperator.NotBetween || t.operator === K.FilterOperator.NotEquals || t.operator === K.FilterOperator.NotContains, f = At.filter(({ value: t }) => t === "list" || t === i ? !0 : o ? !1 : t === "text" ? e.dataType !== K.FieldType.BOOLEAN && e.dataType !== K.FieldType.GEOGRAPHY : t === "range" ? vt(e.dataType) : t === "date" && X(e.dataType)), p = At.find(({ value: e }) => e === i) ?? At[0], m = f[(f.findIndex(({ value: e }) => e === i) + 1) % f.length], h = f.length > 1 ? `Filter type: ${p.label}. Switch to ${m.label}` : `Filter type: ${p.label}`, g = i === "list" || i === "text" ? /* @__PURE__ */ (0, k.jsx)(Mt, {
2154
+ function nn({ field: e, filter: t, editor: n, showAdvancedOperators: r }) {
2155
+ let { editorMode: i, disabledControls: a, isSingleSelect: o, isChangingMode: s, switchMode: c, changeOperator: l, changeExclude: u } = n, d = t.operator === K.FilterOperator.NotInList || t.operator === K.FilterOperator.NotLike || t.operator === K.FilterOperator.NotBetween || t.operator === K.FilterOperator.NotEquals || t.operator === K.FilterOperator.NotContains, p = $t.filter(({ value: t }) => t === "list" || t === i ? !0 : o ? !1 : t === "text" ? e.dataType !== K.FieldType.BOOLEAN && e.dataType !== K.FieldType.GEOGRAPHY : t === "range" ? Vt(e.dataType) : t === "date" && X(e.dataType)), m = $t.find(({ value: e }) => e === i) ?? $t[0], h = p[(p.findIndex(({ value: e }) => e === i) + 1) % p.length], g = p.length > 1 ? `Filter type: ${m.label}. Switch to ${h.label}` : `Filter type: ${m.label}`, _ = i === "list" || i === "text" ? /* @__PURE__ */ (0, A.jsx)(tn, {
1960
2156
  field: e,
1961
2157
  filter: t,
1962
2158
  editor: n
1963
2159
  }) : null;
1964
- return /* @__PURE__ */ (0, k.jsx)("header", {
2160
+ return /* @__PURE__ */ (0, A.jsx)("header", {
1965
2161
  className: "astrato-app-filter-bar__editor-options",
1966
- children: r ? /* @__PURE__ */ (0, k.jsx)(N, {
2162
+ children: r ? /* @__PURE__ */ (0, A.jsx)(P, {
1967
2163
  className: "astrato-app-filter-bar__control",
1968
2164
  "aria-label": "Filter operator",
1969
2165
  value: t.operator,
1970
2166
  disabled: a,
1971
2167
  onChange: (e) => l(e.currentTarget.value),
1972
- children: bt(e.dataType).map((e) => /* @__PURE__ */ (0, k.jsx)("option", {
2168
+ children: Ut(e.dataType).map((e) => /* @__PURE__ */ (0, A.jsx)("option", {
1973
2169
  value: e,
1974
- children: jt[e] ?? e
2170
+ children: en[e] ?? e
1975
2171
  }, e))
1976
- }) : /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [
1977
- /* @__PURE__ */ (0, k.jsx)(j, {
2172
+ }) : /* @__PURE__ */ (0, A.jsxs)(A.Fragment, { children: [
2173
+ /* @__PURE__ */ (0, A.jsx)(M, {
1978
2174
  className: "astrato-app-filter-bar__mode-toggle",
1979
2175
  "data-variant": "ghost",
1980
2176
  "data-icon-only": "true",
1981
2177
  "data-mode": i,
1982
- title: h,
1983
- "aria-label": h,
1984
- disabled: a || f.length < 2,
2178
+ title: g,
2179
+ "aria-label": g,
2180
+ disabled: a || p.length < 2,
1985
2181
  "aria-disabled": s || void 0,
1986
2182
  "aria-busy": s,
1987
- onClick: () => void c(m.value),
1988
- children: /* @__PURE__ */ (0, k.jsx)(x, { name: p.icon })
2183
+ onClick: () => void c(h.value),
2184
+ children: /* @__PURE__ */ (0, A.jsx)(f, { name: m.icon })
1989
2185
  }),
1990
- g ?? /* @__PURE__ */ (0, k.jsx)("span", {
2186
+ _ ?? /* @__PURE__ */ (0, A.jsx)("span", {
1991
2187
  className: "astrato-app-filter-bar__mode-label",
1992
- children: p.label
2188
+ children: m.label
1993
2189
  }),
1994
- /* @__PURE__ */ (0, k.jsxs)("label", {
2190
+ /* @__PURE__ */ (0, A.jsxs)("label", {
1995
2191
  className: "astrato-app-filter-bar__exclude",
1996
2192
  "data-active": d,
1997
- children: [/* @__PURE__ */ (0, k.jsx)(M, {
2193
+ children: [/* @__PURE__ */ (0, A.jsx)(N, {
1998
2194
  type: "checkbox",
1999
2195
  checked: d,
2000
2196
  disabled: a || o && i === "list",
@@ -2004,49 +2200,49 @@ function Nt({ field: e, filter: t, editor: n, showAdvancedOperators: r }) {
2004
2200
  ] })
2005
2201
  });
2006
2202
  }
2007
- function Pt({ filter: e, disabledControls: t, update: n }) {
2008
- let r = (t) => n(Et(e, t)), i = e.dynamicDate, a = e.dynamicDateRange;
2009
- return /* @__PURE__ */ (0, k.jsxs)("div", {
2203
+ function rn({ filter: e, disabledControls: t, update: n }) {
2204
+ let r = (t) => n(Yt(e, t)), i = e.dynamicDate, a = e.dynamicDateRange;
2205
+ return /* @__PURE__ */ (0, A.jsxs)("div", {
2010
2206
  className: "astrato-app-filter-bar__fieldset",
2011
2207
  children: [
2012
- /* @__PURE__ */ (0, k.jsxs)("label", {
2208
+ /* @__PURE__ */ (0, A.jsxs)("label", {
2013
2209
  className: "astrato-app-filter-bar__label",
2014
- children: ["Date mode", /* @__PURE__ */ (0, k.jsxs)(N, {
2210
+ children: ["Date mode", /* @__PURE__ */ (0, A.jsxs)(P, {
2015
2211
  className: "astrato-app-filter-bar__control",
2016
- value: Tt(e),
2212
+ value: Jt(e),
2017
2213
  disabled: t,
2018
2214
  onChange: (e) => r(e.currentTarget.value),
2019
2215
  children: [
2020
- /* @__PURE__ */ (0, k.jsx)("option", {
2216
+ /* @__PURE__ */ (0, A.jsx)("option", {
2021
2217
  value: "fixed",
2022
2218
  children: "Fixed range"
2023
2219
  }),
2024
- /* @__PURE__ */ (0, k.jsx)("option", {
2220
+ /* @__PURE__ */ (0, A.jsx)("option", {
2025
2221
  value: "single",
2026
2222
  children: "Specific date"
2027
2223
  }),
2028
- /* @__PURE__ */ (0, k.jsx)("option", {
2224
+ /* @__PURE__ */ (0, A.jsx)("option", {
2029
2225
  value: "dynamic",
2030
2226
  children: "Dynamic date"
2031
2227
  }),
2032
- /* @__PURE__ */ (0, k.jsx)("option", {
2228
+ /* @__PURE__ */ (0, A.jsx)("option", {
2033
2229
  value: "dynamic-calc",
2034
2230
  children: "Dynamic date preset"
2035
2231
  }),
2036
- /* @__PURE__ */ (0, k.jsx)("option", {
2232
+ /* @__PURE__ */ (0, A.jsx)("option", {
2037
2233
  value: "preset",
2038
2234
  children: "Predefined period"
2039
2235
  }),
2040
- /* @__PURE__ */ (0, k.jsx)("option", {
2236
+ /* @__PURE__ */ (0, A.jsx)("option", {
2041
2237
  value: "relative",
2042
2238
  children: "Relative range"
2043
2239
  })
2044
2240
  ]
2045
2241
  })]
2046
2242
  }),
2047
- e.dynamicDateCalcRange && /* @__PURE__ */ (0, k.jsxs)("label", {
2243
+ e.dynamicDateCalcRange && /* @__PURE__ */ (0, A.jsxs)("label", {
2048
2244
  className: "astrato-app-filter-bar__label",
2049
- children: ["Period", /* @__PURE__ */ (0, k.jsx)(N, {
2245
+ children: ["Period", /* @__PURE__ */ (0, A.jsx)(P, {
2050
2246
  className: "astrato-app-filter-bar__control",
2051
2247
  value: e.dynamicDateCalcRange.type,
2052
2248
  disabled: t,
@@ -2054,15 +2250,15 @@ function Pt({ filter: e, disabledControls: t, update: n }) {
2054
2250
  ...e,
2055
2251
  dynamicDateCalcRange: { type: t.currentTarget.value }
2056
2252
  }),
2057
- children: Ot.map(({ value: e, label: t }) => /* @__PURE__ */ (0, k.jsx)("option", {
2253
+ children: Zt.map(({ value: e, label: t }) => /* @__PURE__ */ (0, A.jsx)("option", {
2058
2254
  value: e,
2059
2255
  children: t
2060
2256
  }, e))
2061
2257
  })]
2062
2258
  }),
2063
- e.dynamicDateCalc && /* @__PURE__ */ (0, k.jsxs)("label", {
2259
+ e.dynamicDateCalc && /* @__PURE__ */ (0, A.jsxs)("label", {
2064
2260
  className: "astrato-app-filter-bar__label",
2065
- children: ["Dynamic date", /* @__PURE__ */ (0, k.jsx)(N, {
2261
+ children: ["Dynamic date", /* @__PURE__ */ (0, A.jsx)(P, {
2066
2262
  className: "astrato-app-filter-bar__control",
2067
2263
  value: e.dynamicDateCalc.type,
2068
2264
  disabled: t,
@@ -2070,17 +2266,17 @@ function Pt({ filter: e, disabledControls: t, update: n }) {
2070
2266
  ...e,
2071
2267
  dynamicDateCalc: { type: t.currentTarget.value }
2072
2268
  }),
2073
- children: kt.map(({ value: e, label: t }) => /* @__PURE__ */ (0, k.jsx)("option", {
2269
+ children: Qt.map(({ value: e, label: t }) => /* @__PURE__ */ (0, A.jsx)("option", {
2074
2270
  value: e,
2075
2271
  children: t
2076
2272
  }, e))
2077
2273
  })]
2078
2274
  }),
2079
- i && /* @__PURE__ */ (0, k.jsxs)("div", {
2275
+ i && /* @__PURE__ */ (0, A.jsxs)("div", {
2080
2276
  className: "astrato-app-filter-bar__row",
2081
- children: [/* @__PURE__ */ (0, k.jsxs)("label", {
2277
+ children: [/* @__PURE__ */ (0, A.jsxs)("label", {
2082
2278
  className: "astrato-app-filter-bar__label",
2083
- children: ["Offset", /* @__PURE__ */ (0, k.jsx)(M, {
2279
+ children: ["Offset", /* @__PURE__ */ (0, A.jsx)(N, {
2084
2280
  className: "astrato-app-filter-bar__control",
2085
2281
  type: "number",
2086
2282
  value: i.offset,
@@ -2093,9 +2289,9 @@ function Pt({ filter: e, disabledControls: t, update: n }) {
2093
2289
  }
2094
2290
  })
2095
2291
  })]
2096
- }), /* @__PURE__ */ (0, k.jsxs)("label", {
2292
+ }), /* @__PURE__ */ (0, A.jsxs)("label", {
2097
2293
  className: "astrato-app-filter-bar__label",
2098
- children: ["Unit", /* @__PURE__ */ (0, k.jsx)(N, {
2294
+ children: ["Unit", /* @__PURE__ */ (0, A.jsx)(P, {
2099
2295
  className: "astrato-app-filter-bar__control",
2100
2296
  value: i.part,
2101
2297
  disabled: t,
@@ -2115,19 +2311,19 @@ function Pt({ filter: e, disabledControls: t, update: n }) {
2115
2311
  "hour",
2116
2312
  "minute",
2117
2313
  "second"
2118
- ].map((e) => /* @__PURE__ */ (0, k.jsx)("option", {
2314
+ ].map((e) => /* @__PURE__ */ (0, A.jsx)("option", {
2119
2315
  value: e,
2120
2316
  children: e
2121
2317
  }, e))
2122
2318
  })]
2123
2319
  })]
2124
2320
  }),
2125
- a && /* @__PURE__ */ (0, k.jsxs)("div", {
2321
+ a && /* @__PURE__ */ (0, A.jsxs)("div", {
2126
2322
  className: "astrato-app-filter-bar__row",
2127
2323
  children: [
2128
- /* @__PURE__ */ (0, k.jsxs)("label", {
2324
+ /* @__PURE__ */ (0, A.jsxs)("label", {
2129
2325
  className: "astrato-app-filter-bar__label",
2130
- children: ["Start offset", /* @__PURE__ */ (0, k.jsx)(M, {
2326
+ children: ["Start offset", /* @__PURE__ */ (0, A.jsx)(N, {
2131
2327
  className: "astrato-app-filter-bar__control",
2132
2328
  type: "number",
2133
2329
  value: a.offsetBegin,
@@ -2141,9 +2337,9 @@ function Pt({ filter: e, disabledControls: t, update: n }) {
2141
2337
  })
2142
2338
  })]
2143
2339
  }),
2144
- /* @__PURE__ */ (0, k.jsxs)("label", {
2340
+ /* @__PURE__ */ (0, A.jsxs)("label", {
2145
2341
  className: "astrato-app-filter-bar__label",
2146
- children: ["End offset", /* @__PURE__ */ (0, k.jsx)(M, {
2342
+ children: ["End offset", /* @__PURE__ */ (0, A.jsx)(N, {
2147
2343
  className: "astrato-app-filter-bar__control",
2148
2344
  type: "number",
2149
2345
  value: a.offsetEnd,
@@ -2157,9 +2353,9 @@ function Pt({ filter: e, disabledControls: t, update: n }) {
2157
2353
  })
2158
2354
  })]
2159
2355
  }),
2160
- /* @__PURE__ */ (0, k.jsxs)("label", {
2356
+ /* @__PURE__ */ (0, A.jsxs)("label", {
2161
2357
  className: "astrato-app-filter-bar__label",
2162
- children: ["Unit", /* @__PURE__ */ (0, k.jsx)(N, {
2358
+ children: ["Unit", /* @__PURE__ */ (0, A.jsx)(P, {
2163
2359
  className: "astrato-app-filter-bar__control",
2164
2360
  value: a.part,
2165
2361
  disabled: t,
@@ -2179,7 +2375,7 @@ function Pt({ filter: e, disabledControls: t, update: n }) {
2179
2375
  "hour",
2180
2376
  "minute",
2181
2377
  "second"
2182
- ].map((e) => /* @__PURE__ */ (0, k.jsx)("option", {
2378
+ ].map((e) => /* @__PURE__ */ (0, A.jsx)("option", {
2183
2379
  value: e,
2184
2380
  children: e
2185
2381
  }, e))
@@ -2190,25 +2386,25 @@ function Pt({ filter: e, disabledControls: t, update: n }) {
2190
2386
  ]
2191
2387
  });
2192
2388
  }
2193
- function Ft(e) {
2389
+ function an(e) {
2194
2390
  let { field: t, filter: n, editorMode: r, timeZone: i, disabledControls: a, update: o } = e, s = Q(n);
2195
- return /* @__PURE__ */ (0, k.jsxs)("div", {
2391
+ return /* @__PURE__ */ (0, A.jsxs)("div", {
2196
2392
  className: "astrato-app-filter-bar__values",
2197
- children: [r === "date" && /* @__PURE__ */ (0, k.jsx)(Pt, { ...e }), !n.dynamicDateCalcRange && !n.dynamicDateRange && !n.dynamicDate && !n.dynamicDateCalc && /* @__PURE__ */ (0, k.jsx)("div", {
2393
+ children: [r === "date" && /* @__PURE__ */ (0, A.jsx)(rn, { ...e }), !n.dynamicDateCalcRange && !n.dynamicDateRange && !n.dynamicDate && !n.dynamicDateCalc && /* @__PURE__ */ (0, A.jsx)("div", {
2198
2394
  className: "astrato-app-filter-bar__row astrato-app-filter-bar__range-inputs",
2199
- children: ([K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(n.operator) ? [0] : [0, 1]).map((e) => /* @__PURE__ */ (0, k.jsxs)("label", {
2395
+ children: ([K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(n.operator) ? [0] : [0, 1]).map((e) => /* @__PURE__ */ (0, A.jsxs)("label", {
2200
2396
  className: "astrato-app-filter-bar__label",
2201
- children: [[K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(n.operator) ? "Date" : e === 0 ? "From" : "To", /* @__PURE__ */ (0, k.jsx)(M, {
2397
+ children: [[K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(n.operator) ? "Date" : e === 0 ? "From" : "To", /* @__PURE__ */ (0, A.jsx)(N, {
2202
2398
  className: "astrato-app-filter-bar__control",
2203
- type: r === "date" ? wt(t.dataType) : "number",
2399
+ type: r === "date" ? qt(t.dataType) : "number",
2204
2400
  step: r === "date" && t.dataType !== K.FieldType.DATE ? "0.001" : void 0,
2205
- value: r === "date" ? ht(s[e], t.dataType, i) : String(s[e] ?? ""),
2401
+ value: r === "date" ? Rt(s[e], t.dataType, i) : String(s[e] ?? ""),
2206
2402
  disabled: a,
2207
2403
  onChange: (a) => {
2208
2404
  let c = [s[0] ?? null, s[1] ?? null];
2209
- c[e] = r === "date" ? gt(a.currentTarget.value, t.dataType, i) : a.currentTarget.value === "" ? null : Number(a.currentTarget.value), o({
2405
+ c[e] = r === "date" ? zt(a.currentTarget.value, t.dataType, i) : a.currentTarget.value === "" ? null : Number(a.currentTarget.value), o({
2210
2406
  ...Z(n),
2211
- values: pt(c, [K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(n.operator))
2407
+ values: It(c, [K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(n.operator))
2212
2408
  });
2213
2409
  }
2214
2410
  })]
@@ -2216,11 +2412,11 @@ function Ft(e) {
2216
2412
  })]
2217
2413
  });
2218
2414
  }
2219
- function It({ field: e, filter: t, timeZone: n, disabledControls: r, update: i }) {
2415
+ function on({ field: e, filter: t, timeZone: n, disabledControls: r, update: i }) {
2220
2416
  let a = Q(t);
2221
- return /* @__PURE__ */ (0, k.jsxs)("label", {
2417
+ return /* @__PURE__ */ (0, A.jsxs)("label", {
2222
2418
  className: "astrato-app-filter-bar__label",
2223
- children: ["Value", e.dataType === K.FieldType.BOOLEAN ? /* @__PURE__ */ (0, k.jsxs)(N, {
2419
+ children: ["Value", e.dataType === K.FieldType.BOOLEAN ? /* @__PURE__ */ (0, A.jsxs)(P, {
2224
2420
  className: "astrato-app-filter-bar__control",
2225
2421
  value: a[0] == null ? "" : String(a[0]),
2226
2422
  disabled: r,
@@ -2229,150 +2425,150 @@ function It({ field: e, filter: t, timeZone: n, disabledControls: r, update: i }
2229
2425
  values: [e.currentTarget.value === "" ? null : e.currentTarget.value === "true"]
2230
2426
  }),
2231
2427
  children: [
2232
- /* @__PURE__ */ (0, k.jsx)("option", {
2428
+ /* @__PURE__ */ (0, A.jsx)("option", {
2233
2429
  value: "",
2234
2430
  children: "Choose a value"
2235
2431
  }),
2236
- /* @__PURE__ */ (0, k.jsx)("option", {
2432
+ /* @__PURE__ */ (0, A.jsx)("option", {
2237
2433
  value: "true",
2238
2434
  children: "True"
2239
2435
  }),
2240
- /* @__PURE__ */ (0, k.jsx)("option", {
2436
+ /* @__PURE__ */ (0, A.jsx)("option", {
2241
2437
  value: "false",
2242
2438
  children: "False"
2243
2439
  })
2244
2440
  ]
2245
- }) : /* @__PURE__ */ (0, k.jsx)(M, {
2441
+ }) : /* @__PURE__ */ (0, A.jsx)(N, {
2246
2442
  className: "astrato-app-filter-bar__control",
2247
- type: X(e.dataType) ? wt(e.dataType) : vt(e.dataType) ? "number" : "text",
2443
+ type: X(e.dataType) ? qt(e.dataType) : Vt(e.dataType) ? "number" : "text",
2248
2444
  step: X(e.dataType) && e.dataType !== K.FieldType.DATE ? "0.001" : void 0,
2249
- value: X(e.dataType) ? ht(a[0], e.dataType, n) : String(a[0] ?? ""),
2445
+ value: X(e.dataType) ? Rt(a[0], e.dataType, n) : String(a[0] ?? ""),
2250
2446
  disabled: r,
2251
2447
  onChange: (r) => i({
2252
2448
  ...Z(t),
2253
- values: [X(e.dataType) ? gt(r.currentTarget.value, e.dataType, n) : vt(e.dataType) ? r.currentTarget.value === "" ? null : Number(r.currentTarget.value) : r.currentTarget.value]
2449
+ values: [X(e.dataType) ? zt(r.currentTarget.value, e.dataType, n) : Vt(e.dataType) ? r.currentTarget.value === "" ? null : Number(r.currentTarget.value) : r.currentTarget.value]
2254
2450
  })
2255
2451
  })]
2256
2452
  });
2257
2453
  }
2258
- function Lt({ field: e, filter: t, editor: n, showAdvancedOperators: r }) {
2259
- let i = (0, O.useId)(), { update: a, valuesSelected: o, isSingleSelect: c, disabledControls: l, valueList: u } = n, { values: d, availableValues: f, availableSelectedValues: p, searchQuery: m, hasConnectedFilters: h, showAllValues: g, setShowAllValues: _, sortDirection: v, toggleSortDirection: y, isRefreshingValues: b, isLoadingMore: S, loadMoreError: C, canLoadMore: w, loadMore: T, valueListRef: E, nextPageRef: ee } = u, D = /* @__PURE__ */ (0, k.jsx)(Mt, {
2454
+ function sn({ field: e, filter: t, editor: n, showAdvancedOperators: r }) {
2455
+ let i = (0, k.useId)(), { update: a, valuesSelected: o, isSingleSelect: s, disabledControls: l, valueList: u } = n, { values: d, availableValues: p, availableSelectedValues: m, searchQuery: h, hasConnectedFilters: g, showAllValues: _, setShowAllValues: v, sortDirection: y, toggleSortDirection: b, isRefreshingValues: x, isLoadingMore: S, loadMoreError: C, canLoadMore: w, loadMore: T, valueListRef: E, nextPageRef: ee } = u, D = /* @__PURE__ */ (0, A.jsx)(tn, {
2260
2456
  field: e,
2261
2457
  filter: t,
2262
2458
  editor: n
2263
- }), te = (e) => {
2459
+ }), O = (e) => {
2264
2460
  let n = Q(t), r = $(e), i = o.has(r) ? n.filter((e) => $(e) !== r) : [...n, e];
2265
- a(xt(t, c ? [e] : i));
2266
- }, N = () => {
2461
+ a(Wt(t, s ? [e] : i));
2462
+ }, P = () => {
2267
2463
  let e = new Set(d.map($)), n = Q(t).filter((t) => !e.has($(t)));
2268
- a(xt(t, [...n, ...d]));
2269
- }, ne = () => {
2464
+ a(Wt(t, [...n, ...d]));
2465
+ }, te = () => {
2270
2466
  let e = new Set(d.map($));
2271
- a(xt(t, Q(t).filter((t) => !e.has($(t)))));
2272
- }, F = () => {
2467
+ a(Wt(t, Q(t).filter((t) => !e.has($(t)))));
2468
+ }, I = () => {
2273
2469
  let e = new Set(d.map($)), n = Q(t).filter((t) => !e.has($(t)));
2274
- n.push(...d.filter((e) => !o.has($(e)))), a(xt(t, n));
2275
- }, I = () => a(xt(t, f)), L = Q(t), R = m ? d : [...new Map([...d, ...L].map((e) => [$(e), e])).values()], z = new Set([...f, ...p].map($));
2276
- return /* @__PURE__ */ (0, k.jsxs)("div", {
2470
+ n.push(...d.filter((e) => !o.has($(e)))), a(Wt(t, n));
2471
+ }, L = () => a(Wt(t, p)), R = Q(t), z = h ? d : [...new Map([...d, ...R].map((e) => [$(e), e])).values()], B = new Set([...p, ...m].map($));
2472
+ return /* @__PURE__ */ (0, A.jsxs)("div", {
2277
2473
  className: "astrato-app-filter-bar__list-editor",
2278
2474
  children: [
2279
- r && /* @__PURE__ */ (0, k.jsx)("div", {
2475
+ r && /* @__PURE__ */ (0, A.jsx)("div", {
2280
2476
  className: "astrato-app-filter-bar__search-row",
2281
2477
  children: D
2282
2478
  }),
2283
- /* @__PURE__ */ (0, k.jsxs)("div", {
2479
+ /* @__PURE__ */ (0, A.jsxs)("div", {
2284
2480
  className: "astrato-app-filter-bar__selection-toolbar",
2285
2481
  children: [
2286
- /* @__PURE__ */ (0, k.jsxs)("span", {
2482
+ /* @__PURE__ */ (0, A.jsxs)("span", {
2287
2483
  className: "astrato-app-filter-bar__muted",
2288
2484
  role: "status",
2289
- children: [L.length, " selected"]
2485
+ children: [R.length, " selected"]
2290
2486
  }),
2291
- /* @__PURE__ */ (0, k.jsx)(j, {
2487
+ /* @__PURE__ */ (0, A.jsx)(M, {
2292
2488
  "data-variant": "ghost",
2293
2489
  "data-icon-only": "true",
2294
2490
  disabled: l,
2295
- "aria-label": v === s.Asc ? "Sort descending" : "Sort ascending",
2296
- title: v === s.Asc ? "Sorted ascending. Switch to descending." : "Sorted descending. Switch to ascending.",
2297
- onClick: y,
2298
- children: /* @__PURE__ */ (0, k.jsx)(x, { name: v === s.Asc ? "sortAsc" : "sortDesc" })
2491
+ "aria-label": y === c.Asc ? "Sort descending" : "Sort ascending",
2492
+ title: y === c.Asc ? "Sorted ascending. Switch to descending." : "Sorted descending. Switch to ascending.",
2493
+ onClick: b,
2494
+ children: /* @__PURE__ */ (0, A.jsx)(f, { name: y === c.Asc ? "sortAsc" : "sortDesc" })
2299
2495
  }),
2300
- /* @__PURE__ */ (0, k.jsx)(j, {
2496
+ /* @__PURE__ */ (0, A.jsx)(M, {
2301
2497
  "data-variant": "ghost",
2302
2498
  "aria-label": "Select loaded values",
2303
2499
  title: "Select all values currently loaded in this list",
2304
- disabled: l || c || b || !d.length,
2305
- onClick: N,
2500
+ disabled: l || s || x || !d.length,
2501
+ onClick: P,
2306
2502
  children: "Select all"
2307
2503
  }),
2308
- /* @__PURE__ */ (0, k.jsx)(P, { actions: [
2504
+ /* @__PURE__ */ (0, A.jsx)(F, { actions: [
2309
2505
  {
2310
2506
  label: "Deselect loaded values",
2311
- onSelect: ne,
2312
- disabled: l || c || b || !d.length
2507
+ onSelect: te,
2508
+ disabled: l || s || x || !d.length
2313
2509
  },
2314
2510
  {
2315
2511
  label: "Invert loaded selection",
2316
- onSelect: F,
2317
- disabled: l || c || b || !d.length
2512
+ onSelect: I,
2513
+ disabled: l || s || x || !d.length
2318
2514
  },
2319
2515
  {
2320
2516
  label: "Select loaded available values",
2321
- onSelect: I,
2322
- disabled: l || c || b || !f.length
2517
+ onSelect: L,
2518
+ disabled: l || s || x || !p.length
2323
2519
  },
2324
2520
  {
2325
2521
  label: "Clear values",
2326
- onSelect: () => a(xt(t, [])),
2327
- disabled: l || c || !L.length
2522
+ onSelect: () => a(Wt(t, [])),
2523
+ disabled: l || s || !R.length
2328
2524
  }
2329
2525
  ] })
2330
2526
  ]
2331
2527
  }),
2332
- h && /* @__PURE__ */ (0, k.jsxs)("label", {
2528
+ g && /* @__PURE__ */ (0, A.jsxs)("label", {
2333
2529
  className: "astrato-app-filter-bar__availability",
2334
- children: [/* @__PURE__ */ (0, k.jsx)(M, {
2530
+ children: [/* @__PURE__ */ (0, A.jsx)(N, {
2335
2531
  type: "checkbox",
2336
- checked: g,
2337
- disabled: l || b,
2338
- onChange: (e) => _(e.currentTarget.checked)
2532
+ checked: _,
2533
+ disabled: l || x,
2534
+ onChange: (e) => v(e.currentTarget.checked)
2339
2535
  }), "Include unavailable values"]
2340
2536
  }),
2341
- /* @__PURE__ */ (0, k.jsxs)("div", {
2537
+ /* @__PURE__ */ (0, A.jsxs)("div", {
2342
2538
  className: "astrato-app-filter-bar__value-viewport",
2343
- "data-loading": b,
2344
- children: [/* @__PURE__ */ (0, k.jsxs)("div", {
2539
+ "data-loading": x,
2540
+ children: [/* @__PURE__ */ (0, A.jsxs)("div", {
2345
2541
  className: "astrato-app-filter-bar__value-list",
2346
2542
  ref: E,
2347
- "aria-busy": b,
2543
+ "aria-busy": x,
2348
2544
  children: [
2349
- R.map((e) => {
2545
+ z.map((e) => {
2350
2546
  let t = $(e);
2351
- return /* @__PURE__ */ (0, k.jsxs)("label", {
2547
+ return /* @__PURE__ */ (0, A.jsxs)("label", {
2352
2548
  className: "astrato-app-filter-bar__value",
2353
2549
  "data-selected": o.has(t),
2354
- "data-excluded": h && !z.has(t),
2355
- children: [/* @__PURE__ */ (0, k.jsx)(M, {
2356
- type: c ? "radio" : "checkbox",
2357
- name: c ? i : void 0,
2550
+ "data-excluded": g && !B.has(t),
2551
+ children: [/* @__PURE__ */ (0, A.jsx)(N, {
2552
+ type: s ? "radio" : "checkbox",
2553
+ name: s ? i : void 0,
2358
2554
  checked: o.has(t),
2359
- disabled: l || b,
2360
- onChange: () => te(e)
2361
- }), /* @__PURE__ */ (0, k.jsx)("span", { children: e == null ? "Null" : typeof e == "object" ? "value" in e ? String(e.value) : JSON.stringify(e) : String(e) })]
2555
+ disabled: l || x,
2556
+ onChange: () => O(e)
2557
+ }), /* @__PURE__ */ (0, A.jsx)("span", { children: e == null ? "Null" : typeof e == "object" ? "value" in e ? String(e.value) : JSON.stringify(e) : String(e) })]
2362
2558
  }, t);
2363
2559
  }),
2364
- !R.length && !b && /* @__PURE__ */ (0, k.jsx)("div", {
2560
+ !z.length && !x && /* @__PURE__ */ (0, A.jsx)("div", {
2365
2561
  className: "astrato-app-filter-bar__empty",
2366
2562
  children: "No matching values"
2367
2563
  }),
2368
- w && /* @__PURE__ */ (0, k.jsxs)("div", {
2564
+ w && /* @__PURE__ */ (0, A.jsxs)("div", {
2369
2565
  className: "astrato-app-filter-bar__next-page",
2370
2566
  ref: ee,
2371
- children: [S && /* @__PURE__ */ (0, k.jsx)(A, { label: "Loading more values" }), C && /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [/* @__PURE__ */ (0, k.jsx)("span", {
2567
+ children: [S && /* @__PURE__ */ (0, A.jsx)(j, { label: "Loading more values" }), C && /* @__PURE__ */ (0, A.jsxs)(A.Fragment, { children: [/* @__PURE__ */ (0, A.jsx)("span", {
2372
2568
  role: "alert",
2373
2569
  className: "astrato-app-filter-bar__error",
2374
2570
  children: C
2375
- }), /* @__PURE__ */ (0, k.jsx)(j, {
2571
+ }), /* @__PURE__ */ (0, A.jsx)(M, {
2376
2572
  "data-variant": "ghost",
2377
2573
  disabled: l,
2378
2574
  onClick: () => void T(),
@@ -2380,37 +2576,37 @@ function Lt({ field: e, filter: t, editor: n, showAdvancedOperators: r }) {
2380
2576
  })] })]
2381
2577
  })
2382
2578
  ]
2383
- }), b && /* @__PURE__ */ (0, k.jsx)(A, { label: "Loading values" })]
2579
+ }), x && /* @__PURE__ */ (0, A.jsx)(j, { label: "Loading values" })]
2384
2580
  })
2385
2581
  ]
2386
2582
  });
2387
2583
  }
2388
- var Rt = (e, t) => {
2389
- let n = e.getSelection(), r = Vt(e, n, t), i = n.applied.find(Ge), a = i ? J(i) : void 0;
2584
+ var cn = (e, t) => {
2585
+ let n = e.getSelection(), r = dn(e, n, t), i = n.applied.find(pt), a = i ? J(i) : void 0;
2390
2586
  return {
2391
2587
  connectedFilters: r,
2392
2588
  associativeListFilter: i && a && (a === t || e.areFieldsConnected(t, a)) ? i.associativeListFilter : void 0
2393
2589
  };
2394
- }, zt = async (e, t, n, r) => {
2395
- let i = Jt(qt(r));
2590
+ }, ln = async (e, t, n, r) => {
2591
+ let i = vn(_n(r));
2396
2592
  if (!i.length) return [];
2397
- let { connectedFilters: a, associativeListFilter: o } = Rt(e, t.key), c = Ut(t.key, 0, i.length, s.Asc, [...a, {
2593
+ let { connectedFilters: a, associativeListFilter: o } = cn(e, t.key), s = pn(t.key, 0, i.length, c.Asc, [...a, {
2398
2594
  fieldKey: t.key,
2399
2595
  ...n.dateLevel ? { dateLevel: n.dateLevel } : {},
2400
2596
  ...n.datePart ? { datePart: n.datePart } : {},
2401
2597
  operator: K.FilterOperator.InList,
2402
2598
  values: i
2403
2599
  }], n.dateLevel, n.datePart, o);
2404
- return Kt((await e.query(c)).data);
2405
- }, Bt = async (e, t, n, r) => {
2406
- let { searchQuery: i = null, sortDirection: a, offset: o, limit: s } = r, c = r.availableOffset ?? 0, { connectedFilters: l, associativeListFilter: u } = Rt(e, t.key), d = l.length > 0 || !!u, f = i ? [Wt(t, i)] : [], p = Ut(t.key, o, s, a, f, n.dateLevel, n.datePart), m = Kt((await e.query(p)).data), h = [], g = [], _ = !1;
2600
+ return gn((await e.query(s)).data);
2601
+ }, un = async (e, t, n, r) => {
2602
+ let { searchQuery: i = null, sortDirection: a, offset: o, limit: s } = r, c = r.availableOffset ?? 0, { connectedFilters: l, associativeListFilter: u } = cn(e, t.key), d = l.length > 0 || !!u, f = i ? [mn(t, i)] : [], p = pn(t.key, o, s, a, f, n.dateLevel, n.datePart), m = gn((await e.query(p)).data), h = [], g = [], _ = !1;
2407
2603
  if (d) {
2408
- let r = Ut(t.key, c, s, a, [...l, ...f], n.dateLevel, n.datePart, u);
2409
- if (h = Kt((await e.query(r)).data), _ = h.length >= s, o === 0) {
2410
- let r = Jt(qt(n.values));
2604
+ let r = pn(t.key, c, s, a, [...l, ...f], n.dateLevel, n.datePart, u);
2605
+ if (h = gn((await e.query(r)).data), _ = h.length >= s, o === 0) {
2606
+ let r = vn(_n(n.values));
2411
2607
  if (r.length > 0) {
2412
- let i = await zt(e, t, n, r);
2413
- g = r.filter((e) => !i.some((t) => Yt(e, t)));
2608
+ let i = await ln(e, t, n, r);
2609
+ g = r.filter((e) => !i.some((t) => yn(e, t)));
2414
2610
  }
2415
2611
  }
2416
2612
  }
@@ -2422,7 +2618,7 @@ var Rt = (e, t) => {
2422
2618
  hasMoreAvailable: _,
2423
2619
  hasConnectedFilters: d
2424
2620
  };
2425
- }, Vt = (e, t, n) => t.applied.filter(Ht).filter((t) => t.fieldKey !== n && e.areFieldsConnected(n, t.fieldKey)), Ht = (e) => "operator" in e && "values" in e && typeof e.fieldKey == "string", Ut = (e, t, n, r, i, a, o, s) => ({
2621
+ }, dn = (e, t, n) => t.applied.filter(fn).filter((t) => t.fieldKey !== n && e.areFieldsConnected(n, t.fieldKey)), fn = (e) => "operator" in e && "values" in e && typeof e.fieldKey == "string", pn = (e, t, n, r, i, a, o, s) => ({
2426
2622
  dimensions: [{
2427
2623
  fieldKey: e,
2428
2624
  ...a ? { dateLevel: a } : {},
@@ -2437,9 +2633,9 @@ var Rt = (e, t) => {
2437
2633
  direction: r,
2438
2634
  columnIdx: 0
2439
2635
  }]
2440
- }), Wt = (e, t) => {
2636
+ }), mn = (e, t) => {
2441
2637
  if (t.includes(" ")) {
2442
- let n = t.split(" ").filter((e) => e !== ""), r = Gt(e.dataType) ? n.map(Number).filter((e) => Number.isFinite(e)) : n;
2638
+ let n = t.split(" ").filter((e) => e !== ""), r = hn(e.dataType) ? n.map(Number).filter((e) => Number.isFinite(e)) : n;
2443
2639
  if (r.length > 0) return {
2444
2640
  fieldKey: e.key,
2445
2641
  operator: K.FilterOperator.InList,
@@ -2451,76 +2647,76 @@ var Rt = (e, t) => {
2451
2647
  operator: K.FilterOperator.Like,
2452
2648
  values: [t.toLocaleLowerCase()]
2453
2649
  };
2454
- }, Gt = (e) => [
2650
+ }, hn = (e) => [
2455
2651
  K.FieldType.DECIMAL,
2456
2652
  K.FieldType.FLOAT,
2457
2653
  K.FieldType.INT,
2458
2654
  K.FieldType.REAL
2459
- ].includes(e), Kt = (e) => Array.isArray(e) ? e.map((e) => e[0]) : Object.values(e).map((e) => e[0]), qt = (e) => Array.isArray(e) ? e.filter((e) => e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean") : [], Jt = (e) => [...new Set(e)], Yt = (e, t) => e === t || JSON.stringify(e) === JSON.stringify(t);
2460
- function Xt({ field: e, filter: t, services: n, editorMode: r, disabledControls: i, onError: a }) {
2461
- let [o, c] = (0, O.useState)(""), [l, u] = (0, O.useState)(""), [d, f] = (0, O.useState)([]), [p, m] = (0, O.useState)([]), [h, g] = (0, O.useState)([]), [_, v] = (0, O.useState)(!1), [y, b] = (0, O.useState)(!1), [x, S] = (0, O.useState)(!1), [C, w] = (0, O.useState)(!1), [T, E] = (0, O.useState)(0), [ee, D] = (0, O.useState)(!0), [te, k] = (0, O.useState)(!1), [A, j] = (0, O.useState)(null), [M, N] = (0, O.useState)(s.Asc), [, ne] = (0, O.useState)(0), [P, F] = (0, O.useState)(null), I = (0, O.useRef)(/* @__PURE__ */ new Map()), L = (0, O.useRef)(0), R = (0, O.useRef)(null), z = (0, O.useRef)(null), re = (0, O.useRef)(null), ie = (0, O.useRef)({
2655
+ ].includes(e), gn = (e) => Array.isArray(e) ? e.map((e) => e[0]) : Object.values(e).map((e) => e[0]), _n = (e) => Array.isArray(e) ? e.filter((e) => e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean") : [], vn = (e) => [...new Set(e)], yn = (e, t) => e === t || JSON.stringify(e) === JSON.stringify(t);
2656
+ function bn({ field: e, filter: t, services: n, editorMode: r, disabledControls: i, onError: a }) {
2657
+ let [o, s] = (0, k.useState)(""), [l, u] = (0, k.useState)(""), [d, f] = (0, k.useState)([]), [p, m] = (0, k.useState)([]), [h, g] = (0, k.useState)([]), [_, v] = (0, k.useState)(!1), [y, b] = (0, k.useState)(!1), [x, S] = (0, k.useState)(!1), [C, w] = (0, k.useState)(!1), [T, E] = (0, k.useState)(0), [ee, D] = (0, k.useState)(!0), [O, A] = (0, k.useState)(!1), [j, M] = (0, k.useState)(null), [N, P] = (0, k.useState)(c.Asc), [, te] = (0, k.useState)(0), [F, I] = (0, k.useState)(null), L = (0, k.useRef)(/* @__PURE__ */ new Map()), R = (0, k.useRef)(0), z = (0, k.useRef)(null), B = (0, k.useRef)(null), ne = (0, k.useRef)(null), re = (0, k.useRef)({
2462
2658
  field: e,
2463
2659
  filter: t,
2464
2660
  searchQuery: l,
2465
- sortDirection: M,
2661
+ sortDirection: N,
2466
2662
  showAllValues: C
2467
2663
  });
2468
- ie.current = {
2664
+ re.current = {
2469
2665
  field: e,
2470
2666
  filter: t,
2471
2667
  searchQuery: l,
2472
- sortDirection: M,
2668
+ sortDirection: N,
2473
2669
  showAllValues: C
2474
2670
  };
2475
- let B = JSON.stringify([
2671
+ let V = JSON.stringify([
2476
2672
  e.key,
2477
2673
  e.dataType,
2478
2674
  t.dateLevel,
2479
2675
  t.datePart,
2480
2676
  l,
2481
- M,
2677
+ N,
2482
2678
  C,
2483
- Rt(n, e.key)
2484
- ]), ae = JSON.stringify(Q(t)), V = ee || o !== l, H = x && !C ? y : _;
2485
- (0, O.useEffect)(() => {
2679
+ cn(n, e.key)
2680
+ ]), ie = JSON.stringify(Q(t)), H = ee || o !== l, U = x && !C ? y : _;
2681
+ (0, k.useEffect)(() => {
2486
2682
  let e = setTimeout(() => u(o), 300);
2487
2683
  return () => clearTimeout(e);
2488
- }, [o]), (0, O.useEffect)(() => n.subscribe(() => ne((e) => e + 1)), [n]), (0, O.useEffect)(() => {
2684
+ }, [o]), (0, k.useEffect)(() => n.subscribe(() => te((e) => e + 1)), [n]), (0, k.useEffect)(() => {
2489
2685
  if (r !== "list") return;
2490
- let { field: e, filter: t, searchQuery: i, sortDirection: o, showAllValues: s } = ie.current, c = ++L.current;
2491
- return R.current = null, D(!0), k(!1), j(null), a(null), F(null), I.current.clear(), Bt(n, e, t, {
2686
+ let { field: e, filter: t, searchQuery: i, sortDirection: o, showAllValues: s } = re.current, c = ++R.current;
2687
+ return z.current = null, D(!0), A(!1), M(null), a(null), I(null), L.current.clear(), un(n, e, t, {
2492
2688
  searchQuery: i,
2493
2689
  sortDirection: o,
2494
2690
  offset: 0,
2495
2691
  availableOffset: 0,
2496
2692
  limit: 100
2497
2693
  }).then((e) => {
2498
- if (L.current !== c) return;
2694
+ if (R.current !== c) return;
2499
2695
  let n = e.hasConnectedFilters && !s ? [...e.availableValues, ...e.selectedExcluded] : e.values, r = i ? [] : Q(t);
2500
2696
  f([...new Map([...r, ...n].map((e) => [$(e), e])).values()]), m(e.availableValues);
2501
2697
  let a = new Set(e.selectedExcluded.map($)), o = Q(t).filter((e) => !a.has($(e)));
2502
- g(o), e.availableValues.forEach((e) => I.current.set($(e), !0)), Q(t).forEach((e) => I.current.set($(e), !a.has($(e)))), v(e.hasMore), b(e.hasMoreAvailable), S(e.hasConnectedFilters), E(e.values.length), F(B), z.current && (z.current.scrollTop = 0);
2698
+ g(o), e.availableValues.forEach((e) => L.current.set($(e), !0)), Q(t).forEach((e) => L.current.set($(e), !a.has($(e)))), v(e.hasMore), b(e.hasMoreAvailable), S(e.hasConnectedFilters), E(e.values.length), I(V), B.current && (B.current.scrollTop = 0);
2503
2699
  }).catch((e) => {
2504
- L.current === c && a(e instanceof Error ? e.message : "Could not load filter values.");
2700
+ R.current === c && a(e instanceof Error ? e.message : "Could not load filter values.");
2505
2701
  }).finally(() => {
2506
- L.current === c && D(!1);
2702
+ R.current === c && D(!1);
2507
2703
  }), () => {
2508
- L.current++, R.current = null;
2704
+ R.current++, z.current = null;
2509
2705
  };
2510
2706
  }, [
2511
2707
  r,
2512
2708
  n,
2513
- B,
2709
+ V,
2514
2710
  a
2515
- ]), (0, O.useEffect)(() => {
2516
- if (r !== "list" || P !== B || !x) return;
2517
- let { field: e, filter: t } = ie.current, i = Q(t).filter((e) => !I.current.has($(e)));
2711
+ ]), (0, k.useEffect)(() => {
2712
+ if (r !== "list" || F !== V || !x) return;
2713
+ let { field: e, filter: t } = re.current, i = Q(t).filter((e) => !L.current.has($(e)));
2518
2714
  if (!i.length) return;
2519
2715
  let o = !0;
2520
- return zt(n, e, t, i).then((e) => {
2716
+ return ln(n, e, t, i).then((e) => {
2521
2717
  if (!o) return;
2522
2718
  let t = new Set(e.map($));
2523
- i.forEach((e) => I.current.set($(e), t.has($(e)))), g((t) => [...new Map([...t, ...e].map((e) => [$(e), e])).values()]);
2719
+ i.forEach((e) => L.current.set($(e), t.has($(e)))), g((t) => [...new Map([...t, ...e].map((e) => [$(e), e])).values()]);
2524
2720
  }).catch((e) => {
2525
2721
  o && a(e instanceof Error ? e.message : "Could not check selected value availability.");
2526
2722
  }), () => {
@@ -2529,72 +2725,72 @@ function Xt({ field: e, filter: t, services: n, editorMode: r, disabledControls:
2529
2725
  }, [
2530
2726
  r,
2531
2727
  n,
2532
- B,
2533
- P,
2728
+ V,
2729
+ F,
2534
2730
  x,
2535
- ae,
2731
+ ie,
2536
2732
  a
2537
2733
  ]);
2538
- let U = (0, O.useCallback)(async () => {
2539
- if (r !== "list" || i || V || !H || P !== B || R.current !== null) return;
2540
- let a = ++L.current;
2541
- R.current = a, k(!0), j(null);
2734
+ let ae = (0, k.useCallback)(async () => {
2735
+ if (r !== "list" || i || H || !U || F !== V || z.current !== null) return;
2736
+ let a = ++R.current;
2737
+ z.current = a, A(!0), M(null);
2542
2738
  try {
2543
- let r = await Bt(n, e, t, {
2739
+ let r = await un(n, e, t, {
2544
2740
  searchQuery: l,
2545
- sortDirection: M,
2741
+ sortDirection: N,
2546
2742
  offset: T,
2547
2743
  availableOffset: p.length,
2548
2744
  limit: 100
2549
2745
  });
2550
- if (L.current !== a) return;
2746
+ if (R.current !== a) return;
2551
2747
  f((e) => {
2552
2748
  let t = r.hasConnectedFilters && !C ? r.availableValues : r.values;
2553
2749
  return [...e, ...t.filter((t) => !e.some((e) => $(e) === $(t)))];
2554
- }), m((e) => [...e, ...r.availableValues.filter((t) => !e.some((e) => $(e) === $(t)))]), r.availableValues.forEach((e) => I.current.set($(e), !0)), v(r.hasMore), b(r.hasMoreAvailable), E((e) => e + r.values.length);
2750
+ }), m((e) => [...e, ...r.availableValues.filter((t) => !e.some((e) => $(e) === $(t)))]), r.availableValues.forEach((e) => L.current.set($(e), !0)), v(r.hasMore), b(r.hasMoreAvailable), E((e) => e + r.values.length);
2555
2751
  } catch (e) {
2556
- if (L.current !== a) return;
2557
- j(e instanceof Error ? e.message : "Could not load more filter values.");
2752
+ if (R.current !== a) return;
2753
+ M(e instanceof Error ? e.message : "Could not load more filter values.");
2558
2754
  } finally {
2559
- R.current === a && (R.current = null, k(!1));
2755
+ z.current === a && (z.current = null, A(!1));
2560
2756
  }
2561
2757
  }, [
2562
2758
  r,
2563
2759
  i,
2564
- V,
2565
2760
  H,
2566
- P,
2567
- B,
2761
+ U,
2762
+ F,
2763
+ V,
2568
2764
  n,
2569
2765
  e,
2570
2766
  t,
2571
2767
  l,
2572
- M,
2768
+ N,
2573
2769
  T,
2574
2770
  p.length,
2575
2771
  C
2576
2772
  ]);
2577
- return (0, O.useEffect)(() => {
2578
- let e = z.current, t = re.current;
2579
- if (!e || !t || !H || A || V) return;
2773
+ return (0, k.useEffect)(() => {
2774
+ let e = B.current, t = ne.current;
2775
+ if (!e || !t || !U || j || H) return;
2580
2776
  let n = new IntersectionObserver((e) => {
2581
- e.some((e) => e.isIntersecting) && U();
2777
+ e.some((e) => e.isIntersecting) && ae();
2582
2778
  }, {
2583
2779
  root: e,
2584
2780
  rootMargin: "0px 0px 120px 0px"
2585
2781
  });
2586
2782
  return n.observe(t), () => n.disconnect();
2587
2783
  }, [
2784
+ U,
2785
+ j,
2588
2786
  H,
2589
- A,
2590
- V,
2591
- U
2787
+ ae
2592
2788
  ]), {
2593
2789
  searchInput: o,
2594
2790
  searchQuery: l,
2595
- setSearchInput: c,
2791
+ setSearchInput: s,
2596
2792
  resetSearch: () => {
2597
- c(""), u("");
2793
+ s(""), u("");
2598
2794
  },
2599
2795
  values: d,
2600
2796
  availableValues: p,
@@ -2602,19 +2798,19 @@ function Xt({ field: e, filter: t, services: n, editorMode: r, disabledControls:
2602
2798
  hasConnectedFilters: x,
2603
2799
  showAllValues: C,
2604
2800
  setShowAllValues: w,
2605
- sortDirection: M,
2606
- toggleSortDirection: () => N((e) => e === s.Asc ? s.Desc : s.Asc),
2607
- isRefreshingValues: V,
2608
- isLoadingMore: te,
2609
- loadMoreError: A,
2610
- canLoadMore: H,
2611
- loadMore: U,
2612
- valueListRef: z,
2613
- nextPageRef: re
2801
+ sortDirection: N,
2802
+ toggleSortDirection: () => P((e) => e === c.Asc ? c.Desc : c.Asc),
2803
+ isRefreshingValues: H,
2804
+ isLoadingMore: O,
2805
+ loadMoreError: j,
2806
+ canLoadMore: U,
2807
+ loadMore: ae,
2808
+ valueListRef: B,
2809
+ nextPageRef: ne
2614
2810
  };
2615
2811
  }
2616
- function Zt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 }) {
2617
- let [a, o] = (0, O.useState)(null), [s, c] = (0, O.useState)(!1), l = (0, O.useRef)(0), u = yt(e.dataType, t), d = n.getTimeZone() ?? "UTC", f = i || n.isLocked(e.key), p = (0, O.useMemo)(() => new Set(Q(t).map($)), [t.values]), m = n.isSingleSelect(e.key), h = Xt({
2812
+ function xn({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 }) {
2813
+ let [a, o] = (0, k.useState)(null), [s, c] = (0, k.useState)(!1), l = (0, k.useRef)(0), u = Ht(e.dataType, t), d = n.getTimeZone() ?? "UTC", f = i || n.isLocked(e.key), p = (0, k.useMemo)(() => new Set(Q(t).map($)), [t.values]), m = n.isSingleSelect(e.key), h = bn({
2618
2814
  field: e,
2619
2815
  filter: t,
2620
2816
  services: n,
@@ -2622,9 +2818,9 @@ function Zt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2622
2818
  disabledControls: f,
2623
2819
  onError: o
2624
2820
  });
2625
- (0, O.useEffect)(() => {
2821
+ (0, k.useEffect)(() => {
2626
2822
  l.current++;
2627
- }, [e.key, t]), (0, O.useEffect)(() => () => {
2823
+ }, [e.key, t]), (0, k.useEffect)(() => () => {
2628
2824
  l.current++;
2629
2825
  }, []);
2630
2826
  let g = (e) => {
@@ -2652,7 +2848,7 @@ function Zt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2652
2848
  limit: 501
2653
2849
  });
2654
2850
  if (l.current !== a) return;
2655
- let i = St(r);
2851
+ let i = Gt(r);
2656
2852
  if ((r.meta?.rows ?? i.length) > 500) {
2657
2853
  o("There are too many values in this dynamic date selection to choose individually. Keep the dynamic date filter or narrow it first.");
2658
2854
  return;
@@ -2680,7 +2876,7 @@ function Zt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2680
2876
  limit: 501
2681
2877
  });
2682
2878
  if (l.current !== a) return;
2683
- let i = St(r);
2879
+ let i = Gt(r);
2684
2880
  if ((r.meta?.rows ?? i.length) > 500) {
2685
2881
  o("There are too many values in this dynamic period to select individually. Keep the period filter or narrow it first.");
2686
2882
  return;
@@ -2695,7 +2891,7 @@ function Zt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2695
2891
  }
2696
2892
  return;
2697
2893
  }
2698
- let r = Ct(e.key, t, 501);
2894
+ let r = Kt(e.key, t, 501);
2699
2895
  if (r) {
2700
2896
  if (!String(s[0] ?? "").trim()) {
2701
2897
  g({
@@ -2708,7 +2904,7 @@ function Zt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2708
2904
  try {
2709
2905
  let e = await n.query(r);
2710
2906
  if (l.current !== a) return;
2711
- let i = St(e);
2907
+ let i = Gt(e);
2712
2908
  if ((e.meta?.rows ?? i.length) > 500) {
2713
2909
  o("There are too many matching values to convert. The text filter was kept unchanged.");
2714
2910
  return;
@@ -2736,7 +2932,7 @@ function Zt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2736
2932
  limit: 501
2737
2933
  });
2738
2934
  if (l.current !== a) return;
2739
- let s = St(i);
2935
+ let s = Gt(i);
2740
2936
  if ((i.meta?.rows ?? s.length) > 500) {
2741
2937
  o("There are too many range values to select individually. Keep the range filter or narrow it first.");
2742
2938
  return;
@@ -2793,7 +2989,7 @@ function Zt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2793
2989
  }
2794
2990
  if (r === "range" || r === "date") {
2795
2991
  let r = i ?? (f ? K.FilterOperator.NotBetween : K.FilterOperator.Between), c = [];
2796
- if (s.length >= 2 && (u === "list" || u === "range" || u === "date") && (c = _t(s, e.dataType, d)), c.length !== 2 || c[0] == null || c[1] == null) try {
2992
+ if (s.length >= 2 && (u === "list" || u === "range" || u === "date") && (c = Bt(s, e.dataType, d)), c.length !== 2 || c[0] == null || c[1] == null) try {
2797
2993
  let t = await n.query({
2798
2994
  dimensions: [],
2799
2995
  measures: [{
@@ -2873,49 +3069,49 @@ function Zt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2873
3069
  }
2874
3070
  };
2875
3071
  }
2876
- function Qt({ showAdvancedOperators: e = !1, ...t }) {
2877
- let n = Zt(t), { editorMode: r, timeZone: i, disabledControls: a, update: o, error: s } = n, { field: c, filter: l } = t, u = {
3072
+ function Sn({ showAdvancedOperators: e = !1, ...t }) {
3073
+ let n = xn(t), { editorMode: r, timeZone: i, disabledControls: a, update: o, error: s } = n, { field: c, filter: l } = t, u = {
2878
3074
  field: c,
2879
3075
  filter: l,
2880
3076
  timeZone: i,
2881
3077
  disabledControls: a,
2882
3078
  update: o
2883
3079
  };
2884
- return /* @__PURE__ */ (0, k.jsxs)("section", {
3080
+ return /* @__PURE__ */ (0, A.jsxs)("section", {
2885
3081
  className: "astrato-app-filter-bar__editor",
2886
3082
  "aria-label": `Filter ${c.name}`,
2887
3083
  children: [
2888
- /* @__PURE__ */ (0, k.jsx)(Nt, {
3084
+ /* @__PURE__ */ (0, A.jsx)(nn, {
2889
3085
  field: c,
2890
3086
  filter: l,
2891
3087
  editor: n,
2892
3088
  showAdvancedOperators: e
2893
3089
  }),
2894
- r === "list" && /* @__PURE__ */ (0, k.jsx)(Lt, {
3090
+ r === "list" && /* @__PURE__ */ (0, A.jsx)(sn, {
2895
3091
  field: c,
2896
3092
  filter: l,
2897
3093
  editor: n,
2898
3094
  showAdvancedOperators: e
2899
3095
  }),
2900
- r === "text" && e && /* @__PURE__ */ (0, k.jsxs)("label", {
3096
+ r === "text" && e && /* @__PURE__ */ (0, A.jsxs)("label", {
2901
3097
  className: "astrato-app-filter-bar__label",
2902
- children: ["Match text", /* @__PURE__ */ (0, k.jsx)(Mt, {
3098
+ children: ["Match text", /* @__PURE__ */ (0, A.jsx)(tn, {
2903
3099
  field: c,
2904
3100
  filter: l,
2905
3101
  editor: n
2906
3102
  })]
2907
3103
  }),
2908
- r === "scalar" && /* @__PURE__ */ (0, k.jsx)(It, { ...u }),
2909
- r === "null" && /* @__PURE__ */ (0, k.jsx)("p", {
3104
+ r === "scalar" && /* @__PURE__ */ (0, A.jsx)(on, { ...u }),
3105
+ r === "null" && /* @__PURE__ */ (0, A.jsx)("p", {
2910
3106
  className: "astrato-app-filter-bar__muted",
2911
3107
  children: "This operator matches whether the field has a value."
2912
3108
  }),
2913
- r === "geo" && /* @__PURE__ */ (0, k.jsx)(Dt, { ...u }),
2914
- (r === "range" || r === "date") && /* @__PURE__ */ (0, k.jsx)(Ft, {
3109
+ r === "geo" && /* @__PURE__ */ (0, A.jsx)(Xt, { ...u }),
3110
+ (r === "range" || r === "date") && /* @__PURE__ */ (0, A.jsx)(an, {
2915
3111
  ...u,
2916
3112
  editorMode: r
2917
3113
  }),
2918
- s && /* @__PURE__ */ (0, k.jsx)("p", {
3114
+ s && /* @__PURE__ */ (0, A.jsx)("p", {
2919
3115
  className: "astrato-app-filter-bar__error",
2920
3116
  role: "alert",
2921
3117
  children: s
@@ -2923,160 +3119,692 @@ function Qt({ showAdvancedOperators: e = !1, ...t }) {
2923
3119
  ]
2924
3120
  });
2925
3121
  }
2926
- var $t = (e) => !!e && typeof e == "object" && "fieldKey" in e && "operator" in e, en = (e) => !!e.fieldKey && Qe(e), tn = (e) => {
2927
- let t = e.filters ?? [], n = t.filter($t), r = e.filterGroups ?? [];
2928
- return [...t, ...r].length > 0 && t.length === n.length && n.every(en) && r.every(tn);
2929
- }, nn = (e = []) => ({
2930
- filters: [e[0] ? ft(e[0]) : {
2931
- fieldKey: "",
2932
- operator: K.FilterOperator.InList,
2933
- values: []
3122
+ function Cn(e, t, n) {
3123
+ if (n >= e + t) return 0;
3124
+ if (n <= Math.abs(e - t)) return Math.PI * Math.min(e, t) ** 2;
3125
+ let r = e * e * Math.acos((n * n + e * e - t * t) / (2 * n * e)), i = t * t * Math.acos((n * n + t * t - e * e) / (2 * n * t)), a = .5 * Math.sqrt((-n + e + t) * (n + e - t) * (n - e + t) * (n + e + t));
3126
+ return r + i - a;
3127
+ }
3128
+ function wn(e, t, n) {
3129
+ if (n <= 0) return (e + t) * 1.05;
3130
+ let r = Math.abs(e - t), i = e + t;
3131
+ if (n >= Math.PI * Math.min(e, t) ** 2) return r;
3132
+ for (let a = 0; a < 60; a++) {
3133
+ let a = (r + i) / 2;
3134
+ Cn(e, t, a) > n ? r = a : i = a;
3135
+ }
3136
+ return (r + i) / 2;
3137
+ }
3138
+ function Tn(e, t) {
3139
+ let n = e.map((e) => Math.sqrt(Math.max(e, 0) / Math.PI)), r = (e, r) => wn(n[e], n[r], t(e, r)), i = [{
3140
+ x: 0,
3141
+ y: 0,
3142
+ r: n[0]
3143
+ }];
3144
+ if (n.length > 1 && i.push({
3145
+ x: r(0, 1),
3146
+ y: 0,
3147
+ r: n[1]
3148
+ }), n.length > 2) {
3149
+ let [e, t, a] = [
3150
+ r(0, 1),
3151
+ r(0, 2),
3152
+ r(1, 2)
3153
+ ], o = 1e-9 * (e + t + a);
3154
+ if (e > t + a + o || t > e + a + o || a > e + t + o) return null;
3155
+ let s = e > 0 ? (t * t - a * a + e * e) / (2 * e) : t;
3156
+ i.push({
3157
+ x: s,
3158
+ y: -Math.sqrt(Math.max(0, t * t - s * s)),
3159
+ r: n[2]
3160
+ });
3161
+ }
3162
+ return i;
3163
+ }
3164
+ function En(e, t) {
3165
+ let n = e.map((e, t) => ({
3166
+ kind: e.kind,
3167
+ index: t
3168
+ })), r = n.filter(({ kind: e }) => e === "intersect");
3169
+ return r.length > 0 && r.every(({ index: e }) => t(e)) || n.some(({ kind: e, index: n }) => e === "union" && t(n));
3170
+ }
3171
+ var Dn = (e, t, n) => `${e.toLocaleString()} of ${t.toLocaleString()} ${n} rows`, On = (e) => e <= 3 ? Array.from({ length: 2 ** e - 1 }, (e, t) => t + 1) : Array.from({ length: e }, (e, t) => 1 << t), kn = (e, t, n) => tt(e, t.filter((e, t) => n & 1 << t).map((e) => ({
3172
+ ...e,
3173
+ kind: "intersect"
3174
+ }))), An = (e, t) => ({
3175
+ dimensions: [],
3176
+ measures: [{
3177
+ aggregation: "COUNT",
3178
+ fieldKeys: [e],
3179
+ filters: []
2934
3180
  }],
3181
+ filters: [],
3182
+ ...t ? { associativeListFilter: t } : {}
3183
+ }), jn = 320, Mn = 24, Nn = (e, t) => `${e.value.isNegativeAssociation ? "Not " : ""}Set ${t + 1}`;
3184
+ function Pn({ services: e, fieldKey: t, tableName: n, definition: r }) {
3185
+ let i = JSON.stringify([t, r]), [a, o] = (0, k.useState)(), s = et(r);
3186
+ if ((0, k.useEffect)(() => {
3187
+ let [t, n] = JSON.parse(i), r = et(n), a = On(r.length), s = async (t) => {
3188
+ let { data: n } = await e.query(t), r = Number(Object.values(n)[0]?.[0] ?? 0);
3189
+ if (!Number.isFinite(r)) throw Error("The engine returned no row count.");
3190
+ return r;
3191
+ }, c = !1, l = setTimeout(() => {
3192
+ Promise.all([
3193
+ s(An(t)),
3194
+ s(An(t, n)),
3195
+ ...a.map((e) => s(An(t, kn(n, r, e))))
3196
+ ]).then(([e, t, ...n]) => !c && o({
3197
+ request: i,
3198
+ counts: {
3199
+ all: e,
3200
+ result: t,
3201
+ shared: new Map(a.map((e, t) => [e, n[t]]))
3202
+ }
3203
+ }), (e) => !c && o({
3204
+ request: i,
3205
+ error: e instanceof Error ? e.message : String(e)
3206
+ }));
3207
+ }, 600);
3208
+ return () => {
3209
+ c = !0, clearTimeout(l);
3210
+ };
3211
+ }, [i, e]), a?.request !== i) return /* @__PURE__ */ (0, A.jsx)("span", {
3212
+ className: "astrato-app-filter-bar__muted",
3213
+ children: "Counting each set…"
3214
+ });
3215
+ if (!a.counts) return /* @__PURE__ */ (0, A.jsxs)("p", {
3216
+ className: "astrato-app-filter-bar__error",
3217
+ role: "alert",
3218
+ children: ["Could not count the sets", a.error ? `: ${a.error}` : "."]
3219
+ });
3220
+ let { counts: c } = a, l = s.map(Nn), u = s.map((e, t) => c.shared.get(1 << t) ?? 0), d = s.length <= 3 ? Tn(u, (e, t) => c.shared.get(1 << e | 1 << t) ?? 0) : null, f = s.length <= 3 ? On(s.length).filter((e) => e & e - 1) : [];
3221
+ return /* @__PURE__ */ (0, A.jsxs)("div", {
3222
+ className: "astrato-app-filter-bar__set-venn",
3223
+ children: [d ? /* @__PURE__ */ (0, A.jsx)(Fn, {
3224
+ entries: s,
3225
+ labels: l,
3226
+ sizes: u,
3227
+ circles: d,
3228
+ counts: c
3229
+ }) : /* @__PURE__ */ (0, A.jsx)(In, {
3230
+ labels: l,
3231
+ sizes: u
3232
+ }), /* @__PURE__ */ (0, A.jsxs)("ul", {
3233
+ className: "astrato-app-filter-bar__set-venn-legend",
3234
+ children: [
3235
+ l.map((e, t) => /* @__PURE__ */ (0, A.jsxs)("li", { children: [
3236
+ e,
3237
+ ": ",
3238
+ u[t].toLocaleString()
3239
+ ] }, e)),
3240
+ f.map((e) => /* @__PURE__ */ (0, A.jsxs)("li", { children: [
3241
+ l.filter((t, n) => e & 1 << n).join(" ∩ "),
3242
+ ":",
3243
+ " ",
3244
+ (c.shared.get(e) ?? 0).toLocaleString()
3245
+ ] }, e)),
3246
+ /* @__PURE__ */ (0, A.jsxs)("li", {
3247
+ className: "astrato-app-filter-bar__set-venn-result-text",
3248
+ children: ["Result: ", Dn(c.result, c.all, n)]
3249
+ })
3250
+ ]
3251
+ })]
3252
+ });
3253
+ }
3254
+ function Fn({ entries: e, labels: t, sizes: n, circles: r, counts: i }) {
3255
+ let a = (0, k.useId)().replace(/[^a-zA-Z0-9_-]/g, ""), o = Math.min(...r.map((e) => e.x - e.r)), s = Math.max(...r.map((e) => e.x + e.r)), c = Math.min(...r.map((e) => e.y - e.r)), l = Math.max(...r.map((e) => e.y + e.r)), u = (jn - 2 * Mn) / Math.max(s - o, l - c, 1), d = r.map((e) => ({
3256
+ x: Mn + (e.x - o) * u,
3257
+ y: Mn + (e.y - c) * u,
3258
+ r: Math.max(e.r * u, 2)
3259
+ })), f = Mn * 2 + (l - c) * u, p = {
3260
+ x: d.reduce((e, t) => e + t.x, 0) / d.length,
3261
+ y: d.reduce((e, t) => e + t.y, 0) / d.length
3262
+ }, m = Array.from({ length: 2 ** e.length }, (e, t) => t).filter((t) => En(e, (e) => !!(t & 1 << e))), h = (t, n) => n === e.length ? /* @__PURE__ */ (0, A.jsx)("rect", {
3263
+ x: 0,
3264
+ y: 0,
3265
+ width: jn,
3266
+ height: f,
3267
+ className: "astrato-app-filter-bar__set-venn-result"
3268
+ }) : /* @__PURE__ */ (0, A.jsx)("g", {
3269
+ ...t & 1 << n ? { clipPath: `url(#${a}-in-${n})` } : { mask: `url(#${a}-out-${n})` },
3270
+ children: h(t, n + 1)
3271
+ }), g = t.map((e, t) => `${e} ${n[t]}`).join(", ");
3272
+ return /* @__PURE__ */ (0, A.jsxs)("svg", {
3273
+ className: "astrato-app-filter-bar__set-venn-diagram",
3274
+ viewBox: `0 0 ${jn} ${f}`,
3275
+ role: "img",
3276
+ "aria-label": `${g}; result ${i.result} of ${i.all}`,
3277
+ children: [
3278
+ /* @__PURE__ */ (0, A.jsx)("defs", { children: d.map((e, t) => /* @__PURE__ */ (0, A.jsxs)("g", { children: [/* @__PURE__ */ (0, A.jsx)("clipPath", {
3279
+ id: `${a}-in-${t}`,
3280
+ children: /* @__PURE__ */ (0, A.jsx)("circle", {
3281
+ cx: e.x,
3282
+ cy: e.y,
3283
+ r: e.r
3284
+ })
3285
+ }), /* @__PURE__ */ (0, A.jsxs)("mask", {
3286
+ id: `${a}-out-${t}`,
3287
+ children: [/* @__PURE__ */ (0, A.jsx)("rect", {
3288
+ x: 0,
3289
+ y: 0,
3290
+ width: jn,
3291
+ height: f,
3292
+ fill: "white"
3293
+ }), /* @__PURE__ */ (0, A.jsx)("circle", {
3294
+ cx: e.x,
3295
+ cy: e.y,
3296
+ r: e.r,
3297
+ fill: "black"
3298
+ })]
3299
+ })] }, t)) }),
3300
+ /* @__PURE__ */ (0, A.jsx)("rect", {
3301
+ x: 1,
3302
+ y: 1,
3303
+ width: jn - 2,
3304
+ height: f - 2,
3305
+ rx: 8,
3306
+ className: "astrato-app-filter-bar__set-venn-universe"
3307
+ }),
3308
+ m.map((e) => /* @__PURE__ */ (0, A.jsx)("g", { children: h(e, 0) }, e)),
3309
+ d.map((e, n) => {
3310
+ let r = e.x - p.x, i = e.y - p.y, a = Math.hypot(r, i) || 1, o = d.length > 1 ? e.r * .45 : 0;
3311
+ return /* @__PURE__ */ (0, A.jsxs)("g", { children: [/* @__PURE__ */ (0, A.jsx)("circle", {
3312
+ cx: e.x,
3313
+ cy: e.y,
3314
+ r: e.r,
3315
+ className: "astrato-app-filter-bar__set-venn-circle"
3316
+ }), /* @__PURE__ */ (0, A.jsx)("text", {
3317
+ x: e.x + r / a * o,
3318
+ y: e.y + i / a * o,
3319
+ className: "astrato-app-filter-bar__set-venn-label",
3320
+ children: t[n]
3321
+ })] }, n);
3322
+ })
3323
+ ]
3324
+ });
3325
+ }
3326
+ function In({ labels: e, sizes: t }) {
3327
+ let n = Math.max(...t, 1), r = Math.min(40, (jn - 2 * Mn) / (2 * e.length)), i = t.map((e) => Math.max(Math.sqrt(e / n) * r, 2)), a = 2 * r + 2 * Mn, o = (jn - 2 * Mn) / e.length;
3328
+ return /* @__PURE__ */ (0, A.jsx)("svg", {
3329
+ className: "astrato-app-filter-bar__set-venn-diagram",
3330
+ viewBox: `0 0 ${jn} ${a}`,
3331
+ role: "img",
3332
+ "aria-label": e.map((e, n) => `${e} ${t[n]}`).join(", "),
3333
+ children: i.map((t, n) => /* @__PURE__ */ (0, A.jsxs)("g", { children: [/* @__PURE__ */ (0, A.jsx)("circle", {
3334
+ cx: Mn + o * (n + .5),
3335
+ cy: a / 2,
3336
+ r: t,
3337
+ className: "astrato-app-filter-bar__set-venn-circle"
3338
+ }), /* @__PURE__ */ (0, A.jsx)("text", {
3339
+ x: Mn + o * (n + .5),
3340
+ y: a - 6,
3341
+ className: "astrato-app-filter-bar__set-venn-label",
3342
+ children: e[n]
3343
+ })] }, e[n]))
3344
+ });
3345
+ }
3346
+ var Ln = (e) => !!e && typeof e == "object" && "fieldKey" in e && "operator" in e, Rn = (e) => {
3347
+ let t = e.filters ?? [], n = t.filter(Ln), r = e.filterGroups ?? [];
3348
+ return t.length + r.length > 0 && t.length === n.length && n.every((e) => !!e.fieldKey && bt(e)) && r.every(Rn);
3349
+ }, zn = (e) => {
3350
+ let t = st(e), n = lt(e), r = ut(e) && n.every(ft);
3351
+ return (ct(t) ? Rn(t) : n.length > 0 && ct(e.filterGroup)) && r;
3352
+ }, Bn = (e) => [...(e.filters ?? []).map((e) => e.fieldKey), ...(e.filterGroups ?? []).flatMap(Bn)], Vn = (e) => ({
3353
+ ...e,
3354
+ associativeListFilter: rt(e.associativeListFilter)
3355
+ }), Hn = () => ({
3356
+ filters: [],
2935
3357
  filterGroups: [],
2936
3358
  or: !1
2937
- }), rn = (e, t, n) => e.map((e, r) => r === t ? n(e) : e);
2938
- function an({ group: e, fields: t, services: n, onChange: r, disabled: i }) {
2939
- let a = (t) => r(t(e)), o = (e, t) => {
2940
- a((n) => ({
2941
- ...n,
2942
- filters: (n.filters ?? []).map((n, r) => r === e ? t : n)
2943
- }));
2944
- }, s = (e) => {
2945
- a((t) => ({
2946
- ...t,
2947
- filters: (t.filters ?? []).filter((t, n) => n !== e)
2948
- }));
2949
- }, c = () => {
2950
- a((e) => ({
2951
- ...e,
2952
- filters: [...e.filters ?? [], t[0] ? ft(t[0]) : {
2953
- fieldKey: "",
2954
- operator: K.FilterOperator.InList,
2955
- values: []
2956
- }]
2957
- }));
2958
- }, l = () => {
2959
- a((e) => ({
2960
- ...e,
2961
- filterGroups: [...e.filterGroups ?? [], nn(t)]
2962
- }));
2963
- }, u = (e) => {
2964
- a((t) => ({
2965
- ...t,
2966
- filterGroups: (t.filterGroups ?? []).filter((t, n) => n !== e)
2967
- }));
3359
+ }), Un = (e) => [
3360
+ K.FieldType.DATE,
3361
+ K.FieldType.TIMESTAMP,
3362
+ K.FieldType.TIMESTAMP_TZ,
3363
+ K.FieldType.TIME
3364
+ ].includes(e.dataType), Wn = (e) => Ye(String(e.dataType)), Gn = (e) => Un(e) || e.dataType === K.FieldType.GEOGRAPHY, Kn = (e) => e === K.FilterOperator.InList || e === K.FilterOperator.NotInList, qn = (e) => e === K.FilterOperator.Set || e === K.FilterOperator.NotSet ? 0 : e === K.FilterOperator.Between || e === K.FilterOperator.NotBetween ? 2 : 1, Jn = (e) => e.trim() === "" ? NaN : Number(e);
3365
+ function Yn({ field: e, filter: t, services: n, disabled: r, onChange: i }) {
3366
+ let [a, o] = (0, k.useState)(!1), s = (0, k.useRef)(null), c = (0, k.useRef)(null), l = () => {
3367
+ o(!1), c.current?.focus();
3368
+ };
3369
+ (0, k.useEffect)(() => {
3370
+ if (!a) return;
3371
+ let e = s.current?.ownerDocument ?? document, t = (e) => {
3372
+ (!s.current || !e.composedPath().includes(s.current)) && o(!1);
3373
+ };
3374
+ return e.addEventListener("mousedown", t, !0), () => e.removeEventListener("mousedown", t, !0);
3375
+ }, [a]);
3376
+ let u = t.values ?? [];
3377
+ return /* @__PURE__ */ (0, A.jsxs)("div", {
3378
+ className: "astrato-app-filter-bar__value-dropdown",
3379
+ ref: s,
3380
+ onKeyDown: (e) => {
3381
+ e.key !== "Escape" || !a || (e.preventDefault(), e.stopPropagation(), l());
3382
+ },
3383
+ children: [/* @__PURE__ */ (0, A.jsxs)("button", {
3384
+ type: "button",
3385
+ ref: c,
3386
+ className: "astrato-app-filter-bar__value-trigger",
3387
+ "aria-expanded": a,
3388
+ "aria-label": "Value",
3389
+ disabled: r,
3390
+ onClick: () => o(!a),
3391
+ children: [/* @__PURE__ */ (0, A.jsx)("span", {
3392
+ "data-placeholder": u.length === 0,
3393
+ children: u.length ? u.map((e) => e === null ? "null" : String(e)).join(", ") : "value"
3394
+ }), /* @__PURE__ */ (0, A.jsx)(f, { name: "chevronDown" })]
3395
+ }), a && /* @__PURE__ */ (0, A.jsx)(Xn, {
3396
+ field: e,
3397
+ filter: t,
3398
+ services: n,
3399
+ disabled: r,
3400
+ onChange: i,
3401
+ onClose: l
3402
+ }, e.key)]
3403
+ });
3404
+ }
3405
+ function Xn({ field: e, filter: t, services: n, disabled: r, onChange: i, onClose: a }) {
3406
+ let [o, s] = (0, k.useState)(null), c = bn({
3407
+ field: e,
3408
+ filter: t,
3409
+ services: n,
3410
+ editorMode: "list",
3411
+ disabledControls: r,
3412
+ onError: s
3413
+ }), l = t.values ?? [], u = Kn(t.operator), d = (e) => l.some((t) => t === e), p = (e) => {
3414
+ if (!u) {
3415
+ i([e]), a();
3416
+ return;
3417
+ }
3418
+ i(d(e) ? l.filter((t) => t !== e) : [...l, e]);
2968
3419
  };
2969
- return /* @__PURE__ */ (0, k.jsxs)("div", {
2970
- className: "astrato-app-filter-bar__group",
2971
- "data-operator": e.or ? "or" : "and",
3420
+ return /* @__PURE__ */ (0, A.jsxs)("div", {
3421
+ className: "astrato-app-filter-bar__value-menu",
3422
+ onKeyDown: (e) => {
3423
+ if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
3424
+ let t = c.valueListRef.current, n = t ? Array.from(t.querySelectorAll("[role=\"option\"]")) : [];
3425
+ if (!n.length) return;
3426
+ e.preventDefault();
3427
+ let r = n.indexOf(e.target);
3428
+ n[e.key === "ArrowDown" ? Math.min(r + 1, n.length - 1) : Math.max(r - 1, 0)].focus();
3429
+ },
2972
3430
  children: [
2973
- /* @__PURE__ */ (0, k.jsxs)("div", {
2974
- className: "astrato-app-filter-bar__row",
3431
+ /* @__PURE__ */ (0, A.jsx)(N, {
3432
+ type: "search",
3433
+ className: "astrato-app-filter-bar__control",
3434
+ disabled: r,
3435
+ placeholder: "Search values…",
3436
+ "aria-label": `Search ${e.name} values`,
3437
+ value: c.searchInput,
3438
+ onChange: (e) => c.setSearchInput(e.currentTarget.value)
3439
+ }),
3440
+ /* @__PURE__ */ (0, A.jsxs)("div", {
3441
+ className: "astrato-app-filter-bar__value-options",
3442
+ ref: c.valueListRef,
3443
+ role: "listbox",
3444
+ "aria-multiselectable": u,
2975
3445
  children: [
2976
- /* @__PURE__ */ (0, k.jsxs)("label", {
2977
- className: "astrato-app-filter-bar__label",
2978
- children: ["Match", /* @__PURE__ */ (0, k.jsxs)(N, {
2979
- className: "astrato-app-filter-bar__control",
2980
- value: e.or ? "or" : "and",
2981
- disabled: i,
2982
- onChange: (e) => a((t) => ({
2983
- ...t,
2984
- or: e.currentTarget.value === "or"
2985
- })),
2986
- children: [/* @__PURE__ */ (0, k.jsx)("option", {
2987
- value: "and",
2988
- children: "All conditions (AND)"
2989
- }), /* @__PURE__ */ (0, k.jsx)("option", {
2990
- value: "or",
2991
- children: "Any condition (OR)"
2992
- })]
2993
- })]
2994
- }),
2995
- /* @__PURE__ */ (0, k.jsx)(j, {
2996
- disabled: i,
2997
- onClick: c,
2998
- children: "Add condition"
3446
+ c.values.map((e) => /* @__PURE__ */ (0, A.jsxs)("button", {
3447
+ type: "button",
3448
+ role: "option",
3449
+ "aria-selected": d(e),
3450
+ disabled: r,
3451
+ onClick: () => p(e),
3452
+ children: [u && /* @__PURE__ */ (0, A.jsx)("span", {
3453
+ className: "astrato-app-filter-bar__value-check",
3454
+ "aria-hidden": "true",
3455
+ children: d(e) && /* @__PURE__ */ (0, A.jsx)(f, { name: "check" })
3456
+ }), e === null ? "null" : String(e)]
3457
+ }, e === null ? "∅" : String(e))),
3458
+ !c.values.length && !c.isRefreshingValues && !o && /* @__PURE__ */ (0, A.jsx)("p", {
3459
+ className: "astrato-app-filter-bar__muted",
3460
+ children: "No values"
2999
3461
  }),
3000
- /* @__PURE__ */ (0, k.jsx)(j, {
3001
- disabled: i,
3002
- onClick: l,
3003
- children: "Add nested group"
3004
- })
3462
+ /* @__PURE__ */ (0, A.jsx)("div", { ref: c.nextPageRef })
3005
3463
  ]
3006
3464
  }),
3007
- (e.filters ?? []).map((e, r) => {
3008
- let a = t.find((t) => t.key === e.fieldKey);
3009
- return /* @__PURE__ */ (0, k.jsxs)("div", {
3010
- className: "astrato-app-filter-bar__condition",
3011
- children: [/* @__PURE__ */ (0, k.jsxs)("div", {
3012
- className: "astrato-app-filter-bar__row",
3013
- children: [/* @__PURE__ */ (0, k.jsxs)("label", {
3014
- className: "astrato-app-filter-bar__label",
3015
- children: ["Field", /* @__PURE__ */ (0, k.jsxs)(N, {
3016
- className: "astrato-app-filter-bar__control",
3017
- value: e.fieldKey,
3018
- disabled: i || !t.length,
3019
- onChange: (e) => {
3020
- let n = t.find((t) => t.key === e.currentTarget.value);
3021
- n && o(r, ft(n));
3022
- },
3023
- children: [/* @__PURE__ */ (0, k.jsx)("option", {
3024
- value: "",
3025
- children: "Choose a field"
3026
- }), t.map((e) => /* @__PURE__ */ (0, k.jsx)("option", {
3027
- value: e.key,
3028
- children: e.name
3029
- }, e.key))]
3030
- })]
3031
- }), /* @__PURE__ */ (0, k.jsx)(j, {
3032
- disabled: i,
3033
- "aria-label": "Remove condition",
3034
- onClick: () => s(r),
3035
- children: "Remove"
3036
- })]
3037
- }), a && /* @__PURE__ */ (0, k.jsx)(Qt, {
3038
- field: a,
3039
- filter: e,
3040
- services: n,
3041
- disabled: i,
3042
- showAdvancedOperators: !0,
3043
- onChange: (e) => o(r, e)
3044
- })]
3045
- }, `filter-${r}`);
3465
+ o && /* @__PURE__ */ (0, A.jsx)("p", {
3466
+ className: "astrato-app-filter-bar__error",
3467
+ children: o
3468
+ })
3469
+ ]
3470
+ });
3471
+ }
3472
+ function Zn({ text: e, isOpen: t, disabled: n, onToggle: r, onRemove: i }) {
3473
+ return /* @__PURE__ */ (0, A.jsxs)("div", {
3474
+ className: "astrato-app-filter-bar__chip",
3475
+ "data-open": t,
3476
+ children: [/* @__PURE__ */ (0, A.jsx)("button", {
3477
+ type: "button",
3478
+ className: "astrato-app-filter-bar__chip-text",
3479
+ disabled: n,
3480
+ onClick: r,
3481
+ children: e || /* @__PURE__ */ (0, A.jsx)("span", {
3482
+ className: "astrato-app-filter-bar__chip-placeholder",
3483
+ children: "New filter — click to edit"
3484
+ })
3485
+ }), /* @__PURE__ */ (0, A.jsx)(M, {
3486
+ "data-variant": "ghost",
3487
+ "data-icon-only": "true",
3488
+ "aria-label": "Remove filter",
3489
+ disabled: n,
3490
+ onClick: i,
3491
+ children: /* @__PURE__ */ (0, A.jsx)(f, { name: "close" })
3492
+ })]
3493
+ });
3494
+ }
3495
+ function Qn({ disabled: e, onRemove: t, onDone: n }) {
3496
+ return /* @__PURE__ */ (0, A.jsxs)("div", {
3497
+ className: "astrato-app-filter-bar__chip-actions",
3498
+ children: [/* @__PURE__ */ (0, A.jsx)(M, {
3499
+ "data-variant": "ghost",
3500
+ "data-icon-only": "true",
3501
+ "aria-label": "Remove filter",
3502
+ disabled: e,
3503
+ onClick: t,
3504
+ children: /* @__PURE__ */ (0, A.jsx)(f, { name: "removeCircle" })
3505
+ }), /* @__PURE__ */ (0, A.jsx)(M, {
3506
+ "data-variant": "ghost",
3507
+ "data-icon-only": "true",
3508
+ "aria-label": "Done",
3509
+ disabled: e,
3510
+ onClick: n,
3511
+ children: /* @__PURE__ */ (0, A.jsx)(f, { name: "check" })
3512
+ })]
3513
+ });
3514
+ }
3515
+ function $n({ filter: e, fields: t, services: n, disabled: r, onChange: i, onRemove: a, onDone: o }) {
3516
+ let s = t.find((t) => t.key === e.fieldKey), c = e.values ?? [], l = (t, n) => {
3517
+ let r = [...c];
3518
+ r[t] = s && Wn(s) ? Jn(n) : n, i({
3519
+ ...e,
3520
+ values: r
3521
+ });
3522
+ };
3523
+ return /* @__PURE__ */ (0, A.jsxs)("div", {
3524
+ className: "astrato-app-filter-bar__chip-editor",
3525
+ children: [
3526
+ /* @__PURE__ */ (0, A.jsxs)("div", {
3527
+ className: "astrato-app-filter-bar__chip-editor-row",
3528
+ children: [/* @__PURE__ */ (0, A.jsxs)(P, {
3529
+ className: "astrato-app-filter-bar__control",
3530
+ "aria-label": "Field",
3531
+ value: e.fieldKey,
3532
+ disabled: r,
3533
+ onChange: (e) => {
3534
+ let n = t.find((t) => t.key === e.currentTarget.value);
3535
+ n && i(Ft(n));
3536
+ },
3537
+ children: [/* @__PURE__ */ (0, A.jsx)("option", {
3538
+ value: "",
3539
+ children: "Select a field or dimension"
3540
+ }), t.map((e) => /* @__PURE__ */ (0, A.jsx)("option", {
3541
+ value: e.key,
3542
+ children: e.view ? `${e.view} › ${e.name}` : e.name
3543
+ }, e.key))]
3544
+ }), s && !Gn(s) && /* @__PURE__ */ (0, A.jsx)(P, {
3545
+ className: "astrato-app-filter-bar__control astrato-app-filter-bar__operator",
3546
+ "aria-label": "Operator",
3547
+ value: e.operator,
3548
+ disabled: r,
3549
+ onChange: (t) => {
3550
+ let n = t.currentTarget.value, r = qn(n);
3551
+ i({
3552
+ ...e,
3553
+ operator: n,
3554
+ values: r === 0 ? null : Kn(n) ? c : c.slice(0, r)
3555
+ });
3556
+ },
3557
+ children: Xe(String(s.dataType)).map((e) => /* @__PURE__ */ (0, A.jsxs)("option", {
3558
+ value: e,
3559
+ children: [
3560
+ Ge[e].symbol,
3561
+ " ",
3562
+ Ge[e].label
3563
+ ]
3564
+ }, e))
3565
+ })]
3046
3566
  }),
3047
- (e.filterGroups ?? []).map((e, r) => /* @__PURE__ */ (0, k.jsxs)("div", {
3048
- className: "astrato-app-filter-bar__nested-group",
3049
- children: [/* @__PURE__ */ (0, k.jsxs)("div", {
3050
- className: "astrato-app-filter-bar__row",
3051
- children: [/* @__PURE__ */ (0, k.jsx)("span", {
3052
- className: "astrato-app-filter-bar__muted",
3053
- children: "Nested group"
3054
- }), /* @__PURE__ */ (0, k.jsx)(j, {
3055
- disabled: i,
3056
- "aria-label": "Remove nested group",
3057
- onClick: () => u(r),
3058
- children: "Remove group"
3059
- })]
3060
- }), /* @__PURE__ */ (0, k.jsx)(an, {
3061
- group: e,
3062
- fields: t,
3567
+ s && Gn(s) && /* @__PURE__ */ (0, A.jsx)(Sn, {
3568
+ field: s,
3569
+ filter: e,
3570
+ services: n,
3571
+ disabled: r,
3572
+ showAdvancedOperators: !0,
3573
+ onChange: i
3574
+ }),
3575
+ s && !Gn(s) && qn(e.operator) > 0 && /* @__PURE__ */ (0, A.jsxs)("div", {
3576
+ className: "astrato-app-filter-bar__chip-editor-row",
3577
+ children: [/* @__PURE__ */ (0, A.jsx)("span", {
3578
+ className: "astrato-app-filter-bar__value-label",
3579
+ children: "Value"
3580
+ }), [
3581
+ K.FilterOperator.Equals,
3582
+ K.FilterOperator.NotEquals,
3583
+ K.FilterOperator.InList,
3584
+ K.FilterOperator.NotInList
3585
+ ].includes(e.operator) ? /* @__PURE__ */ (0, A.jsx)(Yn, {
3586
+ field: s,
3587
+ filter: e,
3063
3588
  services: n,
3064
- disabled: i,
3065
- onChange: (e) => a((t) => ({
3066
- ...t,
3067
- filterGroups: (t.filterGroups ?? []).map((t, n) => n === r ? e : t)
3068
- }))
3589
+ disabled: r,
3590
+ onChange: (t) => i({
3591
+ ...e,
3592
+ values: t
3593
+ })
3594
+ }) : Array.from({ length: qn(e.operator) }, (t, n) => /* @__PURE__ */ (0, A.jsx)(N, {
3595
+ type: Wn(s) ? "number" : "text",
3596
+ className: "astrato-app-filter-bar__control",
3597
+ "aria-label": qn(e.operator) === 2 ? n === 0 ? "Min" : "Max" : "Value",
3598
+ placeholder: qn(e.operator) === 2 ? n === 0 ? "min" : "max" : "value",
3599
+ value: typeof c[n] == "number" && !Number.isFinite(c[n]) ? "" : String(c[n] ?? ""),
3600
+ disabled: r,
3601
+ onChange: (e) => l(n, e.currentTarget.value)
3602
+ }, n))]
3603
+ }),
3604
+ /* @__PURE__ */ (0, A.jsx)(Qn, {
3605
+ disabled: r,
3606
+ onRemove: a,
3607
+ onDone: o
3608
+ })
3609
+ ]
3610
+ });
3611
+ }
3612
+ function er({ condition: e, measures: t, disabled: n, onChange: r, onRemove: i, onDone: a }) {
3613
+ let o = Ke.find((t) => t.operator === e.operator)?.arity ?? 1;
3614
+ return /* @__PURE__ */ (0, A.jsxs)("div", {
3615
+ className: "astrato-app-filter-bar__chip-editor",
3616
+ children: [
3617
+ /* @__PURE__ */ (0, A.jsxs)("div", {
3618
+ className: "astrato-app-filter-bar__chip-editor-row",
3619
+ children: [/* @__PURE__ */ (0, A.jsxs)(P, {
3620
+ className: "astrato-app-filter-bar__control",
3621
+ "aria-label": "Measure",
3622
+ value: e.measureKey,
3623
+ disabled: n,
3624
+ onChange: (t) => r({
3625
+ ...e,
3626
+ measureKey: t.currentTarget.value
3627
+ }),
3628
+ children: [!t.some((t) => t.key === e.measureKey) && /* @__PURE__ */ (0, A.jsx)("option", {
3629
+ value: e.measureKey,
3630
+ disabled: !0,
3631
+ children: e.measureKey ? `${e.measureKey} (not available)` : "Select a measure"
3632
+ }), t.map((e) => /* @__PURE__ */ (0, A.jsx)("option", {
3633
+ value: e.key,
3634
+ children: e.name
3635
+ }, e.key))]
3636
+ }), /* @__PURE__ */ (0, A.jsx)(P, {
3637
+ className: "astrato-app-filter-bar__control astrato-app-filter-bar__operator",
3638
+ "aria-label": "Operator",
3639
+ value: e.operator,
3640
+ disabled: n,
3641
+ onChange: (t) => {
3642
+ let n = t.currentTarget.value, i = Ke.find((e) => e.operator === n)?.arity ?? 1;
3643
+ r({
3644
+ ...e,
3645
+ operator: n,
3646
+ values: Array.from({ length: i }, (t, n) => e.values[n] ?? NaN)
3647
+ });
3648
+ },
3649
+ children: Ke.map((e) => /* @__PURE__ */ (0, A.jsxs)("option", {
3650
+ value: e.operator,
3651
+ children: [
3652
+ Ge[e.operator].symbol,
3653
+ " ",
3654
+ e.label
3655
+ ]
3656
+ }, e.operator))
3069
3657
  })]
3070
- }, `group-${r}`))
3658
+ }),
3659
+ /* @__PURE__ */ (0, A.jsxs)("div", {
3660
+ className: "astrato-app-filter-bar__chip-editor-row",
3661
+ children: [/* @__PURE__ */ (0, A.jsx)("span", {
3662
+ className: "astrato-app-filter-bar__value-label",
3663
+ children: "Value"
3664
+ }), Array.from({ length: o }, (t, i) => /* @__PURE__ */ (0, A.jsx)(N, {
3665
+ type: "number",
3666
+ className: "astrato-app-filter-bar__control",
3667
+ "aria-label": o === 2 ? i === 0 ? "Min" : "Max" : "Value",
3668
+ placeholder: o === 2 ? i === 0 ? "min" : "max" : "value",
3669
+ value: Number.isFinite(e.values[i]) ? String(e.values[i]) : "",
3670
+ disabled: n,
3671
+ onChange: (t) => {
3672
+ let n = [...e.values];
3673
+ n[i] = Jn(t.currentTarget.value), r({
3674
+ ...e,
3675
+ values: n
3676
+ });
3677
+ }
3678
+ }, i))]
3679
+ }),
3680
+ /* @__PURE__ */ (0, A.jsx)(Qn, {
3681
+ disabled: n,
3682
+ onRemove: i,
3683
+ onDone: a
3684
+ })
3071
3685
  ]
3072
3686
  });
3073
3687
  }
3074
- function on({ filter: e, fields: t, targetFields: n, services: r, onChange: i, disabled: a = !1 }) {
3075
- let [o, s] = (0, O.useState)(e), [c, l] = (0, O.useState)([]), [u, d] = (0, O.useState)(null), f = n.find((e) => e.key === o.fieldKey), p = o.associativeListFilter;
3076
- (0, O.useEffect)(() => s(e), [e]), (0, O.useEffect)(() => {
3688
+ function tr({ group: e, path: t, fields: n, fieldName: r, services: i, disabled: a, focus: o, onChange: s, onRemove: c }) {
3689
+ let l = e.filters ?? [], u = e.filterGroups ?? [], d = l.length || u.length ? l : [], p = `${t}:new`, m = (t) => s({
3690
+ ...e,
3691
+ filters: t
3692
+ }), h = () => {
3693
+ m([...l, {
3694
+ fieldKey: "",
3695
+ operator: K.FilterOperator.InList,
3696
+ values: []
3697
+ }]), o.setOpenKey(`${t}:${l.length}`);
3698
+ };
3699
+ return /* @__PURE__ */ (0, A.jsxs)("div", {
3700
+ className: "astrato-app-filter-bar__filter-group",
3701
+ children: [/* @__PURE__ */ (0, A.jsx)("button", {
3702
+ type: "button",
3703
+ className: "astrato-app-filter-bar__bracket",
3704
+ "aria-label": `Combine with ${e.or ? "AND" : "OR"}`,
3705
+ disabled: a,
3706
+ onClick: () => s({
3707
+ ...e,
3708
+ or: !e.or
3709
+ }),
3710
+ children: e.or ? "OR" : "AND"
3711
+ }), /* @__PURE__ */ (0, A.jsxs)("div", {
3712
+ className: "astrato-app-filter-bar__filter-group-body",
3713
+ children: [
3714
+ d.map((e, s) => {
3715
+ let c = `${t}:${s}`, u = o.openKey === c;
3716
+ return /* @__PURE__ */ (0, A.jsxs)("div", { children: [/* @__PURE__ */ (0, A.jsx)(Zn, {
3717
+ text: e.fieldKey ? Qe(r(e.fieldKey), e.operator, e.values) : void 0,
3718
+ isOpen: u,
3719
+ disabled: a,
3720
+ onToggle: () => o.setOpenKey(u ? null : c),
3721
+ onRemove: () => {
3722
+ m(l.filter((e, t) => t !== s)), o.setOpenKey(null);
3723
+ }
3724
+ }), u && /* @__PURE__ */ (0, A.jsx)($n, {
3725
+ filter: e,
3726
+ fields: n,
3727
+ services: i,
3728
+ disabled: a,
3729
+ onChange: (e) => m(l.map((t, n) => n === s ? e : t)),
3730
+ onRemove: () => {
3731
+ m(l.filter((e, t) => t !== s)), o.setOpenKey(null);
3732
+ },
3733
+ onDone: () => o.setOpenKey(null)
3734
+ })] }, c);
3735
+ }),
3736
+ !d.length && /* @__PURE__ */ (0, A.jsx)(Zn, {
3737
+ text: void 0,
3738
+ isOpen: !1,
3739
+ disabled: a,
3740
+ onToggle: h,
3741
+ onRemove: () => o.openKey === p && o.setOpenKey(null)
3742
+ }),
3743
+ u.map((c, l) => /* @__PURE__ */ (0, A.jsx)(tr, {
3744
+ group: c,
3745
+ path: `${t}.${l}`,
3746
+ fields: n,
3747
+ fieldName: r,
3748
+ services: i,
3749
+ disabled: a,
3750
+ focus: o,
3751
+ onChange: (t) => s({
3752
+ ...e,
3753
+ filterGroups: u.map((e, n) => n === l ? t : e)
3754
+ }),
3755
+ onRemove: () => {
3756
+ o.setOpenKey(null), s({
3757
+ ...e,
3758
+ filterGroups: u.filter((e, t) => t !== l)
3759
+ });
3760
+ }
3761
+ }, `${t}.${l}`)),
3762
+ /* @__PURE__ */ (0, A.jsxs)("div", {
3763
+ className: "astrato-app-filter-bar__group-actions",
3764
+ children: [
3765
+ /* @__PURE__ */ (0, A.jsxs)(M, {
3766
+ "data-variant": "ghost",
3767
+ disabled: a,
3768
+ onClick: h,
3769
+ children: [/* @__PURE__ */ (0, A.jsx)(f, { name: "plus" }), " Add filter"]
3770
+ }),
3771
+ /* @__PURE__ */ (0, A.jsxs)(M, {
3772
+ "data-variant": "ghost",
3773
+ disabled: a,
3774
+ onClick: () => s({
3775
+ ...e,
3776
+ filterGroups: [...u, Hn()]
3777
+ }),
3778
+ children: [/* @__PURE__ */ (0, A.jsx)(f, { name: "plus" }), " Add group"]
3779
+ }),
3780
+ c && /* @__PURE__ */ (0, A.jsx)(M, {
3781
+ "data-variant": "ghost",
3782
+ disabled: a,
3783
+ onClick: c,
3784
+ children: "Remove group"
3785
+ })
3786
+ ]
3787
+ })
3788
+ ]
3789
+ })]
3790
+ });
3791
+ }
3792
+ function nr({ filter: e, fields: t, targetFields: n, services: r, onChange: i, disabled: a = !1 }) {
3793
+ let [o, s] = (0, k.useState)(() => Vn(e)), [c, l] = (0, k.useState)(), [u, d] = (0, k.useState)(null), [p, m] = (0, k.useState)(0), [h, g] = (0, k.useState)(null), _ = {
3794
+ openKey: h,
3795
+ setOpenKey: g
3796
+ }, v = n.find((e) => e.key === o.fieldKey), y = o.associativeListFilter, b = et(y), x = v?.view ?? y.view, S = [...new Set(n.map((e) => e.view).filter((e) => !!e))];
3797
+ (0, k.useEffect)(() => {
3798
+ s(Vn(e)), g(null);
3799
+ }, [e]);
3800
+ let C = (0, k.useMemo)(() => c?.fieldKey === o.fieldKey ? c.views : [], [c, o.fieldKey]);
3801
+ (0, k.useEffect)(() => {
3077
3802
  let e = !0;
3078
- return l([]), o.fieldKey ? (d(null), r.getAssociatedViews(o.fieldKey).then((t) => {
3079
- e && l(t);
3803
+ return d(null), o.fieldKey ? (l(void 0), r.getAssociatedViews(o.fieldKey).then((t) => {
3804
+ e && l({
3805
+ fieldKey: o.fieldKey,
3806
+ views: t
3807
+ });
3080
3808
  }).catch((t) => {
3081
3809
  e && d(t instanceof Error ? t.message : "Could not load associated views.");
3082
3810
  }), () => {
@@ -3084,159 +3812,319 @@ function on({ filter: e, fields: t, targetFields: n, services: r, onChange: i, d
3084
3812
  }) : () => {
3085
3813
  e = !1;
3086
3814
  };
3087
- }, [o.fieldKey, r]);
3088
- let m = (0, O.useMemo)(() => t.filter((e) => c.includes(e.view ?? "")), [t, c]), h = (e, t) => s((n) => ({
3089
- ...n,
3815
+ }, [
3816
+ o.fieldKey,
3817
+ r,
3818
+ p
3819
+ ]);
3820
+ let w = (0, k.useMemo)(() => t.filter((e) => C.includes(e.view ?? "")), [t, C]), T = (0, k.useMemo)(() => r.getMeasures().filter((e) => e.aggregatedFieldKeys.length > 0 && e.views.some((e) => C.includes(e))), [r, C]), E = (e) => t.find((t) => t.key === e)?.name ?? e, ee = (e) => T.find((t) => t.key === e)?.name ?? e, D = (e) => s({
3821
+ ...o,
3822
+ fieldKey: e?.key ?? "",
3090
3823
  associativeListFilter: {
3091
- ...n.associativeListFilter,
3092
- view: f?.view ?? n.associativeListFilter.view,
3093
- [e]: t
3824
+ ...y,
3825
+ view: e?.view ?? ""
3094
3826
  }
3095
- })), g = (e, t, n) => {
3096
- let r = [...p[e] ?? []];
3097
- r[t] = {
3098
- ...r[t],
3099
- filterGroup: n
3100
- }, h(e, r);
3101
- }, _ = (e) => {
3102
- let t = { filterGroup: nn(m) };
3103
- h(e, [...p[e] ?? [], t]);
3104
- }, v = (e, t) => {
3105
- let n = e === "intersectFilters" ? "unionFilters" : "intersectFilters", r = p[e]?.[t];
3106
- r && s((i) => ({
3107
- ...i,
3108
- associativeListFilter: {
3109
- ...i.associativeListFilter,
3110
- [e]: (i.associativeListFilter[e] ?? []).filter((e, n) => n !== t),
3111
- [n]: [...i.associativeListFilter[n] ?? [], r]
3112
- }
3113
- }));
3114
- }, y = (e, t) => {
3115
- h(e, (p[e] ?? []).filter((e, n) => n !== t));
3116
- }, b = () => i({
3827
+ }), O = (e) => s((t) => ({
3828
+ ...t,
3829
+ associativeListFilter: tt({
3830
+ ...t.associativeListFilter,
3831
+ view: x
3832
+ }, e)
3833
+ })), j = (e, t) => O(b.map((n, r) => r === e ? t : n)), N = (e) => {
3834
+ g(null), O([...b, {
3835
+ kind: e,
3836
+ value: nt()
3837
+ }]);
3838
+ }, te = (e) => Bn(st(e)).filter(Boolean).every((e) => w.some((t) => t.key === e)) && lt(e).every((e) => T.some((t) => t.key === e.measureKey)), F = C.length > 0 && b.some((e) => !te(e.value)), I = !!(o.fieldKey && b.length && C.length) && b.every((e) => zn(e.value) && te(e.value)), L = I && !u, R = () => i({
3117
3839
  ...o,
3118
3840
  associativeListFilter: {
3119
- ...p,
3120
- view: f?.view ?? p.view
3841
+ ...y,
3842
+ view: x
3121
3843
  }
3122
- }), x = !!(p.intersectFilters?.length || p.unionFilters?.length), S = [...p.intersectFilters ?? [], ...p.unionFilters ?? []], C = !!(o.fieldKey && S.length && m.length && !u) && S.every((e) => tn(e.filterGroup)), w = (e, t) => /* @__PURE__ */ (0, k.jsxs)("section", {
3123
- className: "astrato-app-filter-bar__association-list",
3124
- "aria-label": t,
3125
- children: [/* @__PURE__ */ (0, k.jsxs)("div", {
3126
- className: "astrato-app-filter-bar__row",
3127
- children: [/* @__PURE__ */ (0, k.jsx)("h4", {
3128
- className: "astrato-app-filter-bar__field",
3129
- children: t
3130
- }), /* @__PURE__ */ (0, k.jsxs)(j, {
3131
- disabled: a || !m.length,
3132
- onClick: () => _(e),
3133
- children: ["Add ", e === "intersectFilters" ? "intersection" : "union"]
3134
- })]
3135
- }), (p[e] ?? []).map((t, n) => /* @__PURE__ */ (0, k.jsxs)("article", {
3136
- className: "astrato-app-filter-bar__association",
3137
- "data-negative": t.isNegativeAssociation === !0,
3138
- children: [/* @__PURE__ */ (0, k.jsxs)("div", {
3139
- className: "astrato-app-filter-bar__row",
3140
- children: [
3141
- /* @__PURE__ */ (0, k.jsxs)("label", {
3142
- className: "astrato-app-filter-bar__muted",
3143
- children: [/* @__PURE__ */ (0, k.jsx)("input", {
3144
- type: "checkbox",
3145
- checked: t.isNegativeAssociation === !0,
3146
- disabled: a,
3147
- onChange: (t) => {
3148
- let r = t.currentTarget.checked;
3149
- h(e, rn(p[e] ?? [], n, (e) => ({
3150
- ...e,
3151
- isNegativeAssociation: r
3152
- })));
3153
- }
3154
- }), "Exclude this association"]
3155
- }),
3156
- /* @__PURE__ */ (0, k.jsxs)(j, {
3157
- disabled: a,
3158
- onClick: () => v(e, n),
3159
- children: ["Move to ", e === "intersectFilters" ? "union" : "intersection"]
3160
- }),
3161
- /* @__PURE__ */ (0, k.jsx)(j, {
3162
- disabled: a,
3163
- onClick: () => y(e, n),
3164
- children: "Remove"
3165
- })
3166
- ]
3167
- }), /* @__PURE__ */ (0, k.jsx)(an, {
3168
- group: t.filterGroup,
3169
- fields: m,
3170
- services: r,
3171
- disabled: a,
3172
- onChange: (t) => g(e, n, t)
3173
- })]
3174
- }, `${e}-${n}`))]
3175
3844
  });
3176
- return /* @__PURE__ */ (0, k.jsxs)("section", {
3177
- className: "astrato-app-filter-bar__editor",
3178
- "aria-label": "Associative filter",
3845
+ return /* @__PURE__ */ (0, A.jsxs)("section", {
3846
+ className: "astrato-app-filter-bar__editor astrato-app-filter-bar__set-filter",
3847
+ "aria-label": "Set Filter",
3179
3848
  children: [
3180
- /* @__PURE__ */ (0, k.jsxs)("div", {
3181
- className: "astrato-app-filter-bar__fieldset",
3182
- children: [/* @__PURE__ */ (0, k.jsxs)("label", {
3183
- className: "astrato-app-filter-bar__label",
3184
- children: ["Associate from field", /* @__PURE__ */ (0, k.jsxs)(N, {
3185
- className: "astrato-app-filter-bar__control",
3186
- value: o.fieldKey,
3187
- disabled: a || x,
3188
- onChange: (e) => {
3189
- let t = e.currentTarget.value, r = n.find((e) => e.key === t);
3190
- s({
3191
- ...o,
3192
- fieldKey: t,
3193
- associativeListFilter: {
3194
- ...p,
3195
- view: r?.view ?? ""
3196
- }
3197
- });
3198
- },
3199
- children: [/* @__PURE__ */ (0, k.jsx)("option", {
3200
- value: "",
3201
- children: "Choose a field"
3202
- }), n.map((e) => /* @__PURE__ */ (0, k.jsx)("option", {
3203
- value: e.key,
3204
- children: e.name
3205
- }, e.key))]
3206
- })]
3207
- }), /* @__PURE__ */ (0, k.jsx)("p", {
3208
- className: "astrato-app-filter-bar__muted",
3209
- children: f?.view ? `Conditions apply to associated fields from ${f.view}.` : "Choose a field to load its associated views."
3849
+ /* @__PURE__ */ (0, A.jsxs)("div", {
3850
+ className: "astrato-app-filter-bar__section-title",
3851
+ children: ["Set Filter", x ? ` · ${x}` : ""]
3852
+ }),
3853
+ /* @__PURE__ */ (0, A.jsx)("p", {
3854
+ className: "astrato-app-filter-bar__muted",
3855
+ children: "Select entities by matching related rows. Not keeps entities with no matching related rows. Union branches can add entities back."
3856
+ }),
3857
+ /* @__PURE__ */ (0, A.jsxs)("div", {
3858
+ className: "astrato-app-filter-bar__form-row",
3859
+ children: [/* @__PURE__ */ (0, A.jsx)("span", {
3860
+ className: "astrato-app-filter-bar__form-label",
3861
+ children: "Table"
3862
+ }), /* @__PURE__ */ (0, A.jsxs)(P, {
3863
+ className: "astrato-app-filter-bar__control",
3864
+ "aria-label": "Set filter table",
3865
+ value: x,
3866
+ disabled: a,
3867
+ onChange: (e) => D(n.find((t) => t.view === e.currentTarget.value)),
3868
+ children: [/* @__PURE__ */ (0, A.jsx)("option", {
3869
+ value: "",
3870
+ children: "Choose a table"
3871
+ }), S.map((e) => /* @__PURE__ */ (0, A.jsx)("option", {
3872
+ value: e,
3873
+ children: e
3874
+ }, e))]
3210
3875
  })]
3211
3876
  }),
3212
- u && /* @__PURE__ */ (0, k.jsx)("p", {
3877
+ x && /* @__PURE__ */ (0, A.jsxs)("p", {
3878
+ className: "astrato-app-filter-bar__muted",
3879
+ children: [
3880
+ "Applies to every field in ",
3881
+ x,
3882
+ "."
3883
+ ]
3884
+ }),
3885
+ u && /* @__PURE__ */ (0, A.jsxs)("p", {
3213
3886
  className: "astrato-app-filter-bar__error",
3214
3887
  role: "alert",
3215
- children: u
3888
+ children: [
3889
+ u,
3890
+ " ",
3891
+ /* @__PURE__ */ (0, A.jsx)(M, {
3892
+ "data-variant": "ghost",
3893
+ disabled: a,
3894
+ onClick: () => m((e) => e + 1),
3895
+ children: "Retry"
3896
+ })
3897
+ ]
3216
3898
  }),
3217
- o.fieldKey && c.length === 0 && !u && /* @__PURE__ */ (0, k.jsx)("p", {
3218
- className: "astrato-app-filter-bar__muted",
3219
- children: "This field has no associated views."
3899
+ F && /* @__PURE__ */ (0, A.jsxs)("p", {
3900
+ className: "astrato-app-filter-bar__error",
3901
+ role: "alert",
3902
+ children: [
3903
+ "Some filters use fields or measures that ",
3904
+ x,
3905
+ " cannot reach. Replace or remove them."
3906
+ ]
3907
+ }),
3908
+ b.length > 0 && /* @__PURE__ */ (0, A.jsxs)("div", {
3909
+ className: "astrato-app-filter-bar__form-row",
3910
+ children: [/* @__PURE__ */ (0, A.jsx)("span", {
3911
+ className: "astrato-app-filter-bar__form-label",
3912
+ children: "Expression"
3913
+ }), /* @__PURE__ */ (0, A.jsx)("code", { children: it(b) })]
3914
+ }),
3915
+ b.map((e, t) => {
3916
+ let n = `Set ${t + 1}`, i = st(e.value), o = lt(e.value), s = ut(e.value), c = a || !s, l = (n, i) => j(t, {
3917
+ ...e,
3918
+ value: dt(e.value, n, i, r.getMeasures())
3919
+ }), u = `set${t}:measures`, d = () => {
3920
+ l(i, [...o, {
3921
+ measureKey: T[0]?.key ?? "",
3922
+ operator: K.FilterOperator.GT,
3923
+ values: [NaN]
3924
+ }]), g(`${u}:${o.length}`);
3925
+ }, p = e.value.isNegativeAssociation === !0;
3926
+ return /* @__PURE__ */ (0, A.jsxs)("section", {
3927
+ className: "astrato-app-filter-bar__set",
3928
+ "aria-label": n,
3929
+ children: [
3930
+ /* @__PURE__ */ (0, A.jsxs)("div", {
3931
+ className: "astrato-app-filter-bar__set-header",
3932
+ children: [
3933
+ /* @__PURE__ */ (0, A.jsx)("strong", { children: n }),
3934
+ /* @__PURE__ */ (0, A.jsxs)(P, {
3935
+ className: "astrato-app-filter-bar__control",
3936
+ "aria-label": `${n} combination`,
3937
+ value: e.kind,
3938
+ disabled: a,
3939
+ onChange: (n) => {
3940
+ g(null), j(t, {
3941
+ ...e,
3942
+ kind: n.currentTarget.value
3943
+ });
3944
+ },
3945
+ children: [/* @__PURE__ */ (0, A.jsx)("option", {
3946
+ value: "intersect",
3947
+ children: "Intersection (AND)"
3948
+ }), /* @__PURE__ */ (0, A.jsx)("option", {
3949
+ value: "union",
3950
+ children: "Union (OR)"
3951
+ })]
3952
+ }),
3953
+ /* @__PURE__ */ (0, A.jsxs)("button", {
3954
+ type: "button",
3955
+ className: "astrato-app-filter-bar__toggle",
3956
+ "aria-label": `Not ${n}`,
3957
+ "aria-pressed": p,
3958
+ disabled: a,
3959
+ onClick: () => j(t, {
3960
+ ...e,
3961
+ value: {
3962
+ ...e.value,
3963
+ isNegativeAssociation: !p
3964
+ }
3965
+ }),
3966
+ children: [/* @__PURE__ */ (0, A.jsx)("span", {
3967
+ className: "astrato-app-filter-bar__toggle-track",
3968
+ "aria-hidden": "true"
3969
+ }), "Not"]
3970
+ }),
3971
+ /* @__PURE__ */ (0, A.jsx)(M, {
3972
+ "data-variant": "ghost",
3973
+ "data-icon-only": "true",
3974
+ "aria-label": `Remove ${n}`,
3975
+ disabled: a,
3976
+ onClick: () => {
3977
+ g(null), O(b.filter((e, n) => n !== t));
3978
+ },
3979
+ children: /* @__PURE__ */ (0, A.jsx)(f, { name: "trash" })
3980
+ })
3981
+ ]
3982
+ }),
3983
+ !s && /* @__PURE__ */ (0, A.jsxs)("p", {
3984
+ className: "astrato-app-filter-bar__error",
3985
+ role: "alert",
3986
+ children: [n, " has a measure filter this editor cannot read, so it cannot be edited. Remove it to apply."]
3987
+ }),
3988
+ /* @__PURE__ */ (0, A.jsxs)("div", {
3989
+ className: "astrato-app-filter-bar__section-title",
3990
+ children: [n, " filters"]
3991
+ }),
3992
+ /* @__PURE__ */ (0, A.jsx)(tr, {
3993
+ group: i,
3994
+ path: `set${t}:rows`,
3995
+ fields: w,
3996
+ fieldName: E,
3997
+ services: r,
3998
+ disabled: c,
3999
+ focus: _,
4000
+ onChange: (e) => l(e, o)
4001
+ }),
4002
+ /* @__PURE__ */ (0, A.jsx)("div", {
4003
+ className: "astrato-app-filter-bar__sides-and",
4004
+ "aria-hidden": "true",
4005
+ children: /* @__PURE__ */ (0, A.jsx)("span", { children: "AND" })
4006
+ }),
4007
+ /* @__PURE__ */ (0, A.jsxs)("div", {
4008
+ className: "astrato-app-filter-bar__section-title",
4009
+ children: [
4010
+ n,
4011
+ " measure filters",
4012
+ /* @__PURE__ */ (0, A.jsx)("span", {
4013
+ className: "astrato-app-filter-bar__info",
4014
+ title: "Applied after the filters: keeps the values whose measures pass over the rows the filters select.",
4015
+ children: /* @__PURE__ */ (0, A.jsx)(f, { name: "info" })
4016
+ })
4017
+ ]
4018
+ }),
4019
+ /* @__PURE__ */ (0, A.jsxs)("div", {
4020
+ className: "astrato-app-filter-bar__filter-group",
4021
+ children: [/* @__PURE__ */ (0, A.jsx)("span", {
4022
+ className: "astrato-app-filter-bar__bracket",
4023
+ "aria-hidden": "true",
4024
+ children: e.value.postFilterGroup?.or ? "OR" : "AND"
4025
+ }), /* @__PURE__ */ (0, A.jsxs)("div", {
4026
+ className: "astrato-app-filter-bar__filter-group-body",
4027
+ children: [
4028
+ o.map((e, t) => {
4029
+ let n = `${u}:${t}`, r = h === n, a = () => {
4030
+ l(i, o.filter((e, n) => n !== t)), g(null);
4031
+ };
4032
+ return /* @__PURE__ */ (0, A.jsxs)("div", { children: [/* @__PURE__ */ (0, A.jsx)(Zn, {
4033
+ text: e.measureKey ? Qe(ee(e.measureKey), e.operator, e.values.filter((e) => Number.isFinite(e))) : void 0,
4034
+ isOpen: r,
4035
+ disabled: c,
4036
+ onToggle: () => g(r ? null : n),
4037
+ onRemove: a
4038
+ }), r && /* @__PURE__ */ (0, A.jsx)(er, {
4039
+ condition: e,
4040
+ measures: T,
4041
+ disabled: c,
4042
+ onChange: (e) => l(i, o.map((n, r) => r === t ? e : n)),
4043
+ onRemove: a,
4044
+ onDone: () => g(null)
4045
+ })] }, n);
4046
+ }),
4047
+ !o.length && /* @__PURE__ */ (0, A.jsx)(Zn, {
4048
+ text: void 0,
4049
+ isOpen: !1,
4050
+ disabled: c || !T.length,
4051
+ onToggle: d,
4052
+ onRemove: () => void 0
4053
+ }),
4054
+ /* @__PURE__ */ (0, A.jsx)("div", {
4055
+ className: "astrato-app-filter-bar__group-actions",
4056
+ children: /* @__PURE__ */ (0, A.jsxs)(M, {
4057
+ "data-variant": "ghost",
4058
+ disabled: c || !T.length,
4059
+ onClick: d,
4060
+ children: [/* @__PURE__ */ (0, A.jsx)(f, { name: "plus" }), " Add filter"]
4061
+ })
4062
+ })
4063
+ ]
4064
+ })]
4065
+ })
4066
+ ]
4067
+ }, `set-${t}`);
4068
+ }),
4069
+ /* @__PURE__ */ (0, A.jsxs)("div", {
4070
+ className: "astrato-app-filter-bar__set-actions",
4071
+ children: [
4072
+ /* @__PURE__ */ (0, A.jsx)(M, {
4073
+ disabled: a || !o.fieldKey,
4074
+ onClick: () => N("intersect"),
4075
+ children: "Add And set"
4076
+ }),
4077
+ /* @__PURE__ */ (0, A.jsx)(M, {
4078
+ disabled: a || !o.fieldKey,
4079
+ onClick: () => N("union"),
4080
+ children: "Add Or set"
4081
+ }),
4082
+ /* @__PURE__ */ (0, A.jsx)(M, {
4083
+ disabled: a,
4084
+ onClick: () => {
4085
+ g(null), O([nt()].map((e) => ({
4086
+ kind: "intersect",
4087
+ value: e
4088
+ })));
4089
+ },
4090
+ children: "Clear set filter"
4091
+ })
4092
+ ]
4093
+ }),
4094
+ I && v && /* @__PURE__ */ (0, A.jsxs)("div", {
4095
+ className: "astrato-app-filter-bar__form-row",
4096
+ children: [/* @__PURE__ */ (0, A.jsx)("span", {
4097
+ className: "astrato-app-filter-bar__form-label",
4098
+ children: "Sets"
4099
+ }), /* @__PURE__ */ (0, A.jsx)(Pn, {
4100
+ services: r,
4101
+ fieldKey: o.fieldKey,
4102
+ tableName: x,
4103
+ definition: {
4104
+ ...y,
4105
+ view: x
4106
+ }
4107
+ })]
3220
4108
  }),
3221
- w("intersectFilters", "Intersections"),
3222
- w("unionFilters", "Unions"),
3223
- /* @__PURE__ */ (0, k.jsxs)("div", {
4109
+ /* @__PURE__ */ (0, A.jsxs)("div", {
3224
4110
  className: "astrato-app-filter-bar__toolbar",
3225
- children: [/* @__PURE__ */ (0, k.jsx)(j, {
4111
+ children: [/* @__PURE__ */ (0, A.jsx)(M, {
3226
4112
  disabled: a,
3227
- onClick: () => s(e),
3228
- children: "Cancel"
3229
- }), /* @__PURE__ */ (0, k.jsx)(j, {
4113
+ onClick: () => {
4114
+ g(null), s(Vn(e));
4115
+ },
4116
+ children: "Clear"
4117
+ }), /* @__PURE__ */ (0, A.jsx)(M, {
3230
4118
  "data-primary": "true",
3231
- disabled: a || !C,
3232
- onClick: b,
3233
- children: "Update filter"
4119
+ disabled: a || !L,
4120
+ onClick: R,
4121
+ children: "Apply"
3234
4122
  })]
3235
4123
  })
3236
4124
  ]
3237
4125
  });
3238
4126
  }
3239
- var sn = (e, t, n, r) => {
4127
+ var rr = (e, t, n, r) => {
3240
4128
  let i = (e) => Math.max(8, Math.min(e, n.width - t.width - 8)), a = (e) => Math.max(8, Math.min(e, n.height - t.height - 8));
3241
4129
  if (r === "side") {
3242
4130
  let r = e.right + 8, i = e.left - t.width - 8;
@@ -3255,16 +4143,16 @@ var sn = (e, t, n, r) => {
3255
4143
  top: a(s)
3256
4144
  };
3257
4145
  };
3258
- function cn(e, t, n) {
3259
- let r = (0, O.useRef)(null), i = (0, O.useRef)(n);
3260
- return i.current = n, (0, O.useLayoutEffect)(() => {
4146
+ function ir(e, t, n) {
4147
+ let r = (0, k.useRef)(null), i = (0, k.useRef)(n);
4148
+ return i.current = n, (0, k.useLayoutEffect)(() => {
3261
4149
  let n = r.current;
3262
4150
  if (!n) return;
3263
4151
  let a = n.ownerDocument, o = a.defaultView;
3264
4152
  if (!o) return;
3265
4153
  let s = e.closest(".astrato-app-filter-bar"), c = t === "side" ? s : null, l = e.getBoundingClientRect(), u = () => {
3266
4154
  e.isConnected && (l = e.getBoundingClientRect());
3267
- let r = n.getBoundingClientRect(), i = c?.getBoundingClientRect(), { left: a, top: s } = sn(i ? {
4155
+ let r = n.getBoundingClientRect(), i = c?.getBoundingClientRect(), { left: a, top: s } = rr(i ? {
3268
4156
  left: i.left,
3269
4157
  right: i.right,
3270
4158
  top: l.top,
@@ -3293,59 +4181,81 @@ function cn(e, t, n) {
3293
4181
  };
3294
4182
  }, [e, t]), r;
3295
4183
  }
3296
- function ln({ id: e, anchor: t, title: n, subtitle: r, icon: i, className: a = "", placement: o = "bottom", children: s, onClose: c }) {
3297
- return /* @__PURE__ */ (0, k.jsxs)("div", {
3298
- ref: cn(t, o, c),
4184
+ function ar({ title: e, subtitle: t, icon: n, onClose: r }) {
4185
+ return /* @__PURE__ */ (0, A.jsxs)("div", {
4186
+ className: "astrato-app-filter-bar__popover-header",
4187
+ children: [
4188
+ /* @__PURE__ */ (0, A.jsx)("span", {
4189
+ className: "astrato-app-filter-bar__heading-icon",
4190
+ "aria-hidden": "true",
4191
+ children: n ?? /* @__PURE__ */ (0, A.jsx)(f, { name: "filter" })
4192
+ }),
4193
+ /* @__PURE__ */ (0, A.jsxs)("div", {
4194
+ className: "astrato-app-filter-bar__heading",
4195
+ children: [/* @__PURE__ */ (0, A.jsx)("strong", { children: e }), t && /* @__PURE__ */ (0, A.jsx)("span", {
4196
+ className: "astrato-app-filter-bar__muted",
4197
+ children: t
4198
+ })]
4199
+ }),
4200
+ /* @__PURE__ */ (0, A.jsx)(M, {
4201
+ "data-variant": "ghost",
4202
+ "data-icon-only": "true",
4203
+ "aria-label": "Close filter editor",
4204
+ onClick: r,
4205
+ children: /* @__PURE__ */ (0, A.jsx)(f, { name: "close" })
4206
+ })
4207
+ ]
4208
+ });
4209
+ }
4210
+ function or({ id: e, anchor: t, title: n, subtitle: r, icon: i, className: a = "", placement: o = "bottom", children: s, onClose: c }) {
4211
+ return /* @__PURE__ */ (0, A.jsxs)("div", {
4212
+ ref: ir(t, o, c),
3299
4213
  id: e,
3300
4214
  role: "dialog",
3301
4215
  tabIndex: -1,
3302
4216
  "aria-label": n,
3303
4217
  className: `astrato-app-filter-bar__popover ${a}`,
3304
4218
  onKeyDown: (e) => {
3305
- F(e), e.key === "Escape" && (e.preventDefault(), c());
4219
+ I(e), e.key === "Escape" && (e.preventDefault(), c());
3306
4220
  },
3307
- children: [/* @__PURE__ */ (0, k.jsxs)("div", {
3308
- className: "astrato-app-filter-bar__popover-header",
3309
- children: [
3310
- /* @__PURE__ */ (0, k.jsx)("span", {
3311
- className: "astrato-app-filter-bar__heading-icon",
3312
- "aria-hidden": "true",
3313
- children: i ?? /* @__PURE__ */ (0, k.jsx)(x, { name: "filter" })
3314
- }),
3315
- /* @__PURE__ */ (0, k.jsxs)("div", {
3316
- className: "astrato-app-filter-bar__heading",
3317
- children: [/* @__PURE__ */ (0, k.jsx)("strong", { children: n }), r && /* @__PURE__ */ (0, k.jsx)("span", {
3318
- className: "astrato-app-filter-bar__muted",
3319
- children: r
3320
- })]
3321
- }),
3322
- /* @__PURE__ */ (0, k.jsx)(j, {
3323
- "data-variant": "ghost",
3324
- "data-icon-only": "true",
3325
- "aria-label": "Close filter editor",
3326
- onClick: c,
3327
- children: /* @__PURE__ */ (0, k.jsx)(x, { name: "close" })
3328
- })
3329
- ]
4221
+ children: [/* @__PURE__ */ (0, A.jsx)(ar, {
4222
+ title: n,
4223
+ subtitle: r,
4224
+ icon: i,
4225
+ onClose: c
3330
4226
  }), s]
3331
4227
  });
3332
4228
  }
3333
- var un = (e, t, n, r) => {
4229
+ function sr({ id: e, title: t, subtitle: n, icon: r, className: i = "", children: a, onClose: o }) {
4230
+ return /* @__PURE__ */ (0, A.jsxs)(L, {
4231
+ id: e,
4232
+ "aria-label": t,
4233
+ className: `astrato-app-filter-bar__modal ${i}`,
4234
+ onCloseDialog: o,
4235
+ children: [/* @__PURE__ */ (0, A.jsx)(ar, {
4236
+ title: t,
4237
+ subtitle: n,
4238
+ icon: r,
4239
+ onClose: o
4240
+ }), a]
4241
+ });
4242
+ }
4243
+ var cr = (e, t, n, r) => {
3334
4244
  if (e.reduce((e, t) => e + t, 0) + Math.max(0, e.length - 1) * n <= t) return e.length;
3335
4245
  let i = 0, a = 0;
3336
4246
  for (let o = 0; o < e.length; o++) o > 0 && (i += e[o - 1] + n), i + r[e.length - o - 1] <= t && (a = o);
3337
4247
  return a;
3338
- }, dn = (e, t, n = 480, r = 960) => e !== "collapse-button" && e !== "wrap-collapse-button" ? e : t < n ? "button" : e === "wrap-collapse-button" && t >= Math.max(n, r) ? "wrap" : "collapse";
3339
- function fn(e, t, n) {
3340
- let r = (0, O.useRef)(null), [i, a] = (0, O.useState)(0);
3341
- return (0, O.useLayoutEffect)(() => {
4248
+ }, lr = (e, t, n = 480, r = 960) => e !== "collapse-button" && e !== "wrap-collapse-button" ? e : t < n ? "button" : e === "wrap-collapse-button" && t >= Math.max(n, r) ? "wrap" : "collapse";
4249
+ function ur(e, t, n) {
4250
+ let r = (0, k.useRef)(null), [i, a] = (0, k.useState)(0);
4251
+ return (0, k.useLayoutEffect)(() => {
3342
4252
  let t = r.current;
3343
4253
  if (!t || !e) return;
3344
4254
  let n = t.ownerDocument.defaultView;
3345
4255
  if (!n) return;
3346
4256
  let i = Array.from(t.querySelectorAll(":scope > .astrato-app-filter-bar__chip")), o = Array.from(t.querySelectorAll("[data-overflow-count]")), s = () => {
3347
4257
  let e = Number.parseFloat(n.getComputedStyle(t).columnGap) || 0;
3348
- a(un(i.map((e) => e.getBoundingClientRect().width), t.clientWidth, e, o.map((e) => e.getBoundingClientRect().width)));
4258
+ a(cr(i.map((e) => e.getBoundingClientRect().width), t.clientWidth, e, o.map((e) => e.getBoundingClientRect().width)));
3349
4259
  };
3350
4260
  s();
3351
4261
  let c = new n.ResizeObserver(s);
@@ -3359,13 +4269,13 @@ function fn(e, t, n) {
3359
4269
  visibleCount: e ? Math.min(i, n) : n
3360
4270
  };
3361
4271
  }
3362
- function pn(e, t) {
3363
- let n = (0, O.useRef)(null), [r, i] = (0, O.useState)({
4272
+ function dr(e, t) {
4273
+ let n = (0, k.useRef)(null), [r, i] = (0, k.useState)({
3364
4274
  width: 0,
3365
4275
  buttonBreakpoint: 480,
3366
4276
  collapseBreakpoint: 960
3367
4277
  });
3368
- return (0, O.useLayoutEffect)(() => {
4278
+ return (0, k.useLayoutEffect)(() => {
3369
4279
  let e = n.current, r = e?.ownerDocument.defaultView;
3370
4280
  if (!e || !r || !t) return;
3371
4281
  let a = () => {
@@ -3381,10 +4291,10 @@ function pn(e, t) {
3381
4291
  return o.observe(e), () => o.disconnect();
3382
4292
  }, [t, e]), {
3383
4293
  barRef: n,
3384
- overflow: dn(e, r.width, r.buttonBreakpoint, r.collapseBreakpoint)
4294
+ overflow: lr(e, r.width, r.buttonBreakpoint, r.collapseBreakpoint)
3385
4295
  };
3386
4296
  }
3387
- var mn = "grouped-dimension-level-changed", hn = (e, t, n) => e.flatMap((e, n) => t.has(e) ? [n] : []).indexOf(n), gn = (e, t, n) => e.flatMap((e, n) => t.has(e) ? [n] : [])[n], _n = (e) => {
4297
+ var fr = "grouped-dimension-level-changed", pr = (e, t, n) => e.flatMap((e, n) => t.has(e) ? [n] : []).indexOf(n), mr = (e, t, n) => e.flatMap((e, n) => t.has(e) ? [n] : [])[n], hr = (e) => {
3388
4298
  let t = () => {
3389
4299
  let t = e.engine;
3390
4300
  if (!t) return [];
@@ -3399,21 +4309,35 @@ var mn = "grouped-dimension-level-changed", hn = (e, t, n) => e.flatMap((e, n) =
3399
4309
  });
3400
4310
  continue;
3401
4311
  }
3402
- if (!r(e) || !e.dimension?.fieldKey) continue;
4312
+ if (!i(e) || !e.dimension?.fieldKey) continue;
3403
4313
  let t = e.dimension.fieldKey, n = a.get(t);
3404
4314
  if (!s.has(t)) {
3405
- let r = n?.dataType ?? i(e);
3406
- if (!r) continue;
4315
+ let i = n?.dataType ?? r(e);
4316
+ if (!i) continue;
3407
4317
  s.set(t, {
3408
4318
  key: t,
3409
4319
  name: e.name,
3410
4320
  view: n?.view ?? e.dimension.view,
3411
- dataType: r
4321
+ dataType: i
3412
4322
  });
3413
4323
  }
3414
4324
  }
3415
4325
  return [...s.values()];
3416
4326
  }, n = () => {
4327
+ let t = e.engine;
4328
+ return t ? t.getMeasuresList().flatMap((e) => {
4329
+ if (!e || typeof e != "object") return [];
4330
+ let t = e;
4331
+ if (typeof t.key != "string") return [];
4332
+ let n = t.calculation ?? t.measure, r = (Array.isArray(n?.measures) ? n.measures : [n]).flatMap((e) => e && typeof e == "object" && Array.isArray(e.fieldKeys) ? e.fieldKeys.filter((e) => typeof e == "string") : []);
4333
+ return [{
4334
+ key: t.key,
4335
+ name: typeof t.name == "string" ? t.name : t.key,
4336
+ views: Array.isArray(t.views) ? t.views.filter((e) => typeof e == "string") : [],
4337
+ aggregatedFieldKeys: r
4338
+ }];
4339
+ }) : [];
4340
+ }, a = () => {
3417
4341
  let t = e.selection.getActiveSelection(K.FilterType.ALL);
3418
4342
  if (typeof t != "object" || !t) return {
3419
4343
  applied: [],
@@ -3424,114 +4348,114 @@ var mn = "grouped-dimension-level-changed", hn = (e, t, n) => e.flatMap((e, n) =
3424
4348
  applied: Array.isArray(n.applied) ? n.applied : [],
3425
4349
  pending: Array.isArray(n.pending) ? n.pending : []
3426
4350
  };
3427
- }, a = () => qe(n()), s = (e) => {
4351
+ }, s = () => ht(a()), c = (e) => {
3428
4352
  let n = t().find((t) => t.key === e);
3429
4353
  return n?.view ? {
3430
4354
  name: n.name,
3431
4355
  view: n.view,
3432
4356
  fieldKey: e
3433
4357
  } : void 0;
3434
- }, c = (e) => {
4358
+ }, l = (e) => {
3435
4359
  let n = t().find((t) => t.key === e);
3436
4360
  return {
3437
4361
  fieldKey: e,
3438
4362
  name: n?.name ?? "",
3439
4363
  view: n?.view ?? ""
3440
4364
  };
3441
- }, l = (t) => e.selection.isFieldLocked(c(t)), u = (t) => e.selection.getSingleSelectedFields().some((e) => J(e) === t), d = (t, n) => {
4365
+ }, u = (t) => e.selection.isFieldLocked(l(t)), d = (t) => e.selection.getSingleSelectedFields().some((e) => J(e) === t), f = (t, n) => {
3442
4366
  e.selection.setNewSelectionState(t, n);
3443
- }, f = /* @__PURE__ */ new Set(), p = [], m = /* @__PURE__ */ new Map(), h = () => f.forEach((e) => e()), g = () => {
3444
- let n = t(), r = new Map(n.map((e) => [e.key, e])), i = a(), o = /* @__PURE__ */ new Set([
4367
+ }, p = /* @__PURE__ */ new Set(), m = [], h = /* @__PURE__ */ new Map(), g = () => p.forEach((e) => e()), _ = () => {
4368
+ let n = t(), r = new Map(n.map((e) => [e.key, e])), i = s(), a = /* @__PURE__ */ new Set([
3445
4369
  ...n.map((e) => e.key),
3446
4370
  ...i.applied.map((e) => J(e)).filter((e) => !!e),
3447
4371
  ...i.pending.map((e) => J(e)).filter((e) => !!e)
3448
4372
  ]);
3449
- for (let t of o) {
3450
- if (m.has(t)) continue;
4373
+ for (let t of a) {
4374
+ if (h.has(t)) continue;
3451
4375
  let n = r.get(t), i = e.selection.isFieldLocked$({
3452
4376
  fieldKey: t,
3453
4377
  name: n?.name ?? "",
3454
4378
  view: n?.view ?? ""
3455
- }).subscribe(h);
3456
- m.set(t, i);
4379
+ }).subscribe(g);
4380
+ h.set(t, i);
3457
4381
  }
3458
- }, _ = () => {
3459
- p.forEach((e) => e.unsubscribe()), p = [], m.forEach((e) => e.unsubscribe()), m.clear();
3460
- }, v = (t) => {
4382
+ }, v = () => {
4383
+ m.forEach((e) => e.unsubscribe()), m = [], h.forEach((e) => e.unsubscribe()), h.clear();
4384
+ }, y = (t) => {
3461
4385
  let n = () => t();
3462
- if (f.add(n), f.size === 1) try {
3463
- p.push(e.selection.onActiveSelectionChange.subscribe(() => {
3464
- g(), h();
4386
+ if (p.add(n), p.size === 1) try {
4387
+ m.push(e.selection.onActiveSelectionChange.subscribe(() => {
4388
+ _(), g();
3465
4389
  }));
3466
- let t = e.selection.singleSelectFields$?.subscribe(h);
3467
- t && p.push(t);
3468
- let n = e.selection.lockedFields$?.subscribe(h);
3469
- n && p.push(n), p.push(e.getEvents({ type: mn }).subscribe(h)), g();
4390
+ let t = e.selection.singleSelectFields$?.subscribe(g);
4391
+ t && m.push(t);
4392
+ let n = e.selection.lockedFields$?.subscribe(g);
4393
+ n && m.push(n), m.push(e.getEvents({ type: fr }).subscribe(g)), _();
3470
4394
  } catch (e) {
3471
- throw f.delete(n), _(), e;
4395
+ throw p.delete(n), v(), e;
3472
4396
  }
3473
4397
  return () => {
3474
- f.delete(n), f.size === 0 && _();
4398
+ p.delete(n), p.size === 0 && v();
3475
4399
  };
3476
- }, y = (e, t) => {
3477
- let r = J(e);
3478
- if (!r || l(r)) return;
3479
- let i = t === "inherit" ? S() : t, a = n(), o = qe(a), s = Y(e);
3480
- if (!Ge(e) && !Qe(e) && u(r) && [...o.applied, ...o.pending].some((e) => Y(e) === s && Qe(e))) return;
3481
- if (i === "auto") {
3482
- if (!Qe(e)) {
4400
+ }, b = (e, t) => {
4401
+ let n = J(e);
4402
+ if (!n || u(n)) return;
4403
+ let r = t === "inherit" ? w() : t, i = a(), o = ht(i), s = Y(e);
4404
+ if (!pt(e) && !bt(e) && d(n) && [...o.applied, ...o.pending].some((e) => Y(e) === s && bt(e))) return;
4405
+ if (r === "auto") {
4406
+ if (!bt(e)) {
3483
4407
  let e = {
3484
- applied: a.applied.filter((e) => Y(e) !== s),
3485
- pending: a.pending.filter((e) => Y(e) !== s)
4408
+ applied: i.applied.filter((e) => Y(e) !== s),
4409
+ pending: i.pending.filter((e) => Y(e) !== s)
3486
4410
  };
3487
- d(e, K.FilterType.ALL);
4411
+ f(e, K.FilterType.ALL);
3488
4412
  return;
3489
4413
  }
3490
4414
  let t = {
3491
- applied: [...a.applied.filter((e) => Y(e) !== s), e],
3492
- pending: a.pending.filter((e) => Y(e) !== s)
4415
+ applied: [...i.applied.filter((e) => Y(e) !== s), e],
4416
+ pending: i.pending.filter((e) => Y(e) !== s)
3493
4417
  };
3494
- d(t, K.FilterType.ALL);
4418
+ f(t, K.FilterType.ALL);
3495
4419
  return;
3496
4420
  }
3497
4421
  let c = {
3498
- applied: a.applied,
3499
- pending: [...a.pending.filter((e) => Y(e) !== s), e]
4422
+ applied: i.applied,
4423
+ pending: [...i.pending.filter((e) => Y(e) !== s), e]
3500
4424
  };
3501
- d(c, K.FilterType.ALL);
3502
- }, b = (e) => {
4425
+ f(c, K.FilterType.ALL);
4426
+ }, x = (e) => {
3503
4427
  let t = J(e);
3504
- if (!t || l(t) || u(t)) return;
3505
- let r = Ke(e), i = n(), a = {
3506
- applied: i.applied.filter((e) => Ke(e) !== r),
3507
- pending: i.pending.filter((e) => Ke(e) !== r)
4428
+ if (!t || u(t) || d(t)) return;
4429
+ let n = mt(e), r = a(), i = {
4430
+ applied: r.applied.filter((e) => mt(e) !== n),
4431
+ pending: r.pending.filter((e) => mt(e) !== n)
3508
4432
  };
3509
- d(a, K.FilterType.ALL);
3510
- }, x = () => {
4433
+ f(i, K.FilterType.ALL);
4434
+ }, S = () => {
3511
4435
  let n = e.engine;
3512
4436
  if (!n) return [];
3513
- let i = t(), a = new Map(i.map((e) => [e.key, e])), o = n.getGroupedDimensions();
4437
+ let r = t(), a = new Map(r.map((e) => [e.key, e])), o = n.getGroupedDimensions();
3514
4438
  return C(null, n).flatMap((e) => {
3515
- if (!r(e)) return [];
4439
+ if (!i(e)) return [];
3516
4440
  let t = e.dimension, n = t?.group;
3517
4441
  if (!t || !n?.fieldKeys.length) return [];
3518
- let i = n.fieldKeys.map((e) => a.get(e)).filter((e) => !!e);
3519
- if (i.length === 0) return [];
3520
- let s = o[e.id] ?? n.fieldKeys.indexOf(t.fieldKey), c = hn(n.fieldKeys, new Set(a.keys()), s), l = c >= 0 ? c : Math.max(0, i.findIndex((e) => e.key === t.fieldKey));
4442
+ let r = n.fieldKeys.map((e) => a.get(e)).filter((e) => !!e);
4443
+ if (r.length === 0) return [];
4444
+ let s = o[e.id] ?? n.fieldKeys.indexOf(t.fieldKey), c = pr(n.fieldKeys, new Set(a.keys()), s), l = c >= 0 ? c : Math.max(0, r.findIndex((e) => e.key === t.fieldKey));
3521
4445
  return [{
3522
4446
  id: e.id,
3523
4447
  name: e.name,
3524
- fields: i,
4448
+ fields: r,
3525
4449
  selectedIndex: l
3526
4450
  }];
3527
4451
  });
3528
- }, S = () => e.selection.getSelectionMode?.() === "manual" ? "manual" : "auto", w = () => {
4452
+ }, w = () => e.selection.getSelectionMode?.() === "manual" ? "manual" : "auto", T = () => {
3529
4453
  try {
3530
4454
  return e.engine?.capabilities?.associativeFiltering === !0;
3531
4455
  } catch {
3532
4456
  return !1;
3533
4457
  }
3534
- }, T = async (t) => {
4458
+ }, E = async (t) => {
3535
4459
  let n = e.engine;
3536
4460
  if (!n) return [];
3537
4461
  if (n.getAssociatedViews) return n.getAssociatedViews(t);
@@ -3544,74 +4468,75 @@ var mn = "grouped-dimension-level-changed", hn = (e, t, n) => e.flatMap((e, n) =
3544
4468
  };
3545
4469
  return {
3546
4470
  getFields: t,
3547
- getSelection: a,
3548
- subscribe: v,
3549
- select: y,
3550
- remove: b,
4471
+ getMeasures: n,
4472
+ getSelection: s,
4473
+ subscribe: y,
4474
+ select: b,
4475
+ remove: x,
3551
4476
  apply: () => {
3552
- let t = n().pending;
4477
+ let t = a().pending;
3553
4478
  e.selection.confirmSelectionAll(t, {
3554
4479
  overrideValues: !0,
3555
4480
  overrideOperator: !0
3556
4481
  });
3557
4482
  },
3558
4483
  cancel: () => {
3559
- let e = n();
3560
- d({
4484
+ let e = a();
4485
+ f({
3561
4486
  applied: e.applied,
3562
4487
  pending: []
3563
4488
  }, K.FilterType.ALL);
3564
4489
  },
3565
4490
  clear: () => e.selection.clearAllSelection(),
3566
- isLocked: l,
4491
+ isLocked: u,
3567
4492
  isSingleSelect: (t) => e.selection.getSingleSelectedFields().some((e) => J(e) === t),
3568
4493
  canLock: e.selection.canLock === !0,
3569
4494
  toggleLock: (t) => {
3570
- e.selection.toggleFieldLocked(c(t));
4495
+ e.selection.toggleFieldLocked(l(t));
3571
4496
  },
3572
4497
  query: async (t) => {
3573
4498
  if (!e.engine) throw Error("Cannot query filter values without an engine");
3574
4499
  return await e.engine.getData(t);
3575
4500
  },
3576
4501
  areFieldsConnected: (t, n) => {
3577
- let r = s(t), i = s(n);
4502
+ let r = c(t), i = c(n);
3578
4503
  return r && i ? e.engine?.areFieldsConnected(r, i) ?? !1 : !1;
3579
4504
  },
3580
4505
  get supportsAssociativeFiltering() {
3581
- return w();
4506
+ return T();
3582
4507
  },
3583
4508
  getAssociativeFields: async (e, t) => {
3584
- if (!w() || t.aborted) return [];
4509
+ if (!T() || t.aborted) return [];
3585
4510
  let n = e.filter((e) => e.view), r = new Set(n.map((e) => e.view)), i = /* @__PURE__ */ new Set(), a = 0;
3586
4511
  return await Promise.all(Array.from({ length: Math.min(4, n.length) }, async () => {
3587
4512
  for (; !t.aborted && a < n.length;) {
3588
4513
  let e = n[a++];
3589
4514
  try {
3590
- (await T(e.key)).some((e) => r.has(e)) && i.add(e.key);
4515
+ (await E(e.key)).some((e) => r.has(e)) && i.add(e.key);
3591
4516
  } catch {}
3592
4517
  }
3593
- })), t.aborted || !w() ? [] : n.filter((e) => i.has(e.key));
4518
+ })), t.aborted || !T() ? [] : n.filter((e) => i.has(e.key));
3594
4519
  },
3595
- getAssociatedViews: T,
3596
- getSelectionMode: S,
4520
+ getAssociatedViews: E,
4521
+ getSelectionMode: w,
3597
4522
  getTimeZone: () => e.engine?.localeSettings?.timezone,
3598
- getDimensionGroups: x,
3599
- setDimensionGroup: (n, i) => {
4523
+ getDimensionGroups: S,
4524
+ setDimensionGroup: (n, r) => {
3600
4525
  let a = e.engine;
3601
- if (!a || i < 0) return;
3602
- let o = C(null, a).find((e) => r(e) && e.id === n && e.dimension?.group?.fieldKeys), s = o && r(o) ? o.dimension?.group?.fieldKeys : void 0, c = new Map(t().map((e) => [e.key, e])), l = s ? gn(s, new Set(c.keys()), i) : void 0;
3603
- l !== void 0 && e.emitEvent(mn, {
4526
+ if (!a || r < 0) return;
4527
+ let o = C(null, a).find((e) => i(e) && e.id === n && e.dimension?.group?.fieldKeys), s = o && i(o) ? o.dimension?.group?.fieldKeys : void 0, c = new Map(t().map((e) => [e.key, e])), l = s ? mr(s, new Set(c.keys()), r) : void 0;
4528
+ l !== void 0 && e.emitEvent(fr, {
3604
4529
  ...a.getGroupedDimensions(),
3605
4530
  [n]: l
3606
4531
  });
3607
4532
  }
3608
4533
  };
3609
- }, vn = {
4534
+ }, gr = {
3610
4535
  overflow: "auto",
3611
4536
  overscrollBehavior: "contain",
3612
4537
  scrollbarWidth: "thin",
3613
4538
  scrollbarColor: "var(--afb-scrollbar-thumb, var(--afb-border, #e4e4e7)) var(--afb-scrollbar-track, transparent)"
3614
- }, yn = {
4539
+ }, _r = {
3615
4540
  boxSizing: "border-box",
3616
4541
  display: "flex",
3617
4542
  alignItems: "center",
@@ -3813,7 +4738,7 @@ var mn = "grouped-dimension-level-changed", hn = (e, t, n) => e.flatMap((e, n) =
3813
4738
  width: "max-content"
3814
4739
  },
3815
4740
  "& .astrato-app-filter-bar__overflow-list": {
3816
- ...vn,
4741
+ ...gr,
3817
4742
  padding: 4,
3818
4743
  display: "flex",
3819
4744
  flexDirection: "column",
@@ -3896,9 +4821,9 @@ var mn = "grouped-dimension-level-changed", hn = (e, t, n) => e.flatMap((e, n) =
3896
4821
  margin: "8px 0",
3897
4822
  flexBasis: "100%"
3898
4823
  }
3899
- }, bn = {
4824
+ }, vr = {
3900
4825
  "& .astrato-app-filter-bar__modal": {
3901
- ...vn,
4826
+ ...gr,
3902
4827
  inset: 0,
3903
4828
  margin: "auto",
3904
4829
  width: "var(--afb-modal-width, 560px)",
@@ -3919,8 +4844,9 @@ var mn = "grouped-dimension-level-changed", hn = (e, t, n) => e.flatMap((e, n) =
3919
4844
  background: "transparent"
3920
4845
  }
3921
4846
  },
4847
+ "& .astrato-app-filter-bar__modal.astrato-app-filter-bar__set-filter-dialog": { width: "var(--afb-set-filter-width, 720px)" },
3922
4848
  "& .astrato-app-filter-bar__popover": {
3923
- ...vn,
4849
+ ...gr,
3924
4850
  position: "fixed",
3925
4851
  inset: "auto",
3926
4852
  margin: 0,
@@ -3972,7 +4898,7 @@ var mn = "grouped-dimension-level-changed", hn = (e, t, n) => e.flatMap((e, n) =
3972
4898
  },
3973
4899
  "& > span": { fontSize: "0.9em" }
3974
4900
  }
3975
- }, xn = {
4901
+ }, yr = {
3976
4902
  "& .astrato-app-filter-bar__row, & .astrato-app-filter-bar__toolbar": {
3977
4903
  display: "flex",
3978
4904
  flexWrap: "wrap",
@@ -4095,7 +5021,7 @@ var mn = "grouped-dimension-level-changed", hn = (e, t, n) => e.flatMap((e, n) =
4095
5021
  padding: "3px 7px"
4096
5022
  }
4097
5023
  }
4098
- }, Sn = {
5024
+ }, br = {
4099
5025
  "& .astrato-app-filter-bar__menu": {
4100
5026
  position: "relative",
4101
5027
  "& > summary": {
@@ -4153,7 +5079,7 @@ var mn = "grouped-dimension-level-changed", hn = (e, t, n) => e.flatMap((e, n) =
4153
5079
  fontWeight: 400
4154
5080
  }
4155
5081
  }
4156
- }, Cn = {
5082
+ }, xr = {
4157
5083
  "& .astrato-app-filter-bar__values, & .astrato-app-filter-bar__value-list": {
4158
5084
  maxHeight: "var(--afb-list-height, 260px)",
4159
5085
  overflowY: "auto",
@@ -4197,7 +5123,7 @@ var mn = "grouped-dimension-level-changed", hn = (e, t, n) => e.flatMap((e, n) =
4197
5123
  borderRadius: "50%",
4198
5124
  background: "var(--afb-popup-surface, var(--afb-surface, #fff))",
4199
5125
  boxShadow: "0 0 0 6px var(--afb-popup-surface, var(--afb-surface, #fff))",
4200
- animation: `${y({ to: { transform: "rotate(360deg)" } })} 750ms linear infinite`,
5126
+ animation: `${x({ to: { transform: "rotate(360deg)" } })} 750ms linear infinite`,
4201
5127
  "@media (prefers-reduced-motion: reduce)": { animation: "none" }
4202
5128
  },
4203
5129
  "& .astrato-app-filter-bar__sr-only": {
@@ -4237,7 +5163,7 @@ var mn = "grouped-dimension-level-changed", hn = (e, t, n) => e.flatMap((e, n) =
4237
5163
  opacity: .6
4238
5164
  }
4239
5165
  }
4240
- }, wn = {
5166
+ }, Sr = {
4241
5167
  "& .astrato-app-filter-bar__field-option": {
4242
5168
  border: 0,
4243
5169
  background: "transparent",
@@ -4299,7 +5225,7 @@ var mn = "grouped-dimension-level-changed", hn = (e, t, n) => e.flatMap((e, n) =
4299
5225
  width: "100%",
4300
5226
  marginTop: 4
4301
5227
  }
4302
- }, Tn = {
5228
+ }, Cr = {
4303
5229
  "& .astrato-app-filter-bar__editor-footer": {
4304
5230
  display: "flex",
4305
5231
  flexWrap: "wrap",
@@ -4320,455 +5246,756 @@ var mn = "grouped-dimension-level-changed", hn = (e, t, n) => e.flatMap((e, n) =
4320
5246
  padding: 10,
4321
5247
  marginBlock: 8,
4322
5248
  minWidth: 0
4323
- }
4324
- }, En = S({
4325
- ...yn,
4326
- ...bn,
4327
- ...xn,
4328
- ...Sn,
4329
- ...Cn,
4330
- ...wn,
4331
- ...Tn
4332
- }), Dn = /* @__PURE__ */ new Set([
5249
+ },
5250
+ "& .astrato-app-filter-bar__set-filter": {
5251
+ display: "flex",
5252
+ flexDirection: "column",
5253
+ gap: 8
5254
+ },
5255
+ "& .astrato-app-filter-bar__section-title": {
5256
+ display: "flex",
5257
+ alignItems: "center",
5258
+ gap: 6,
5259
+ fontWeight: 600
5260
+ },
5261
+ "& .astrato-app-filter-bar__info": {
5262
+ display: "inline-flex",
5263
+ color: "var(--afb-muted, #71717a)",
5264
+ cursor: "help"
5265
+ },
5266
+ "& .astrato-app-filter-bar__form-row": {
5267
+ display: "grid",
5268
+ gridTemplateColumns: "84px minmax(0, 1fr)",
5269
+ alignItems: "center",
5270
+ gap: 8,
5271
+ "& code": { fontSize: 12 }
5272
+ },
5273
+ "& .astrato-app-filter-bar__form-label": { color: "var(--afb-text, #27272a)" },
5274
+ "& .astrato-app-filter-bar__set": {
5275
+ display: "flex",
5276
+ flexDirection: "column",
5277
+ gap: 8,
5278
+ border: "1px solid var(--afb-border, #e4e4e7)",
5279
+ borderRadius: "var(--afb-control-radius, 7px)",
5280
+ padding: 10,
5281
+ minWidth: 0
5282
+ },
5283
+ "& .astrato-app-filter-bar__set-header": {
5284
+ display: "flex",
5285
+ alignItems: "center",
5286
+ gap: 8,
5287
+ "& select": {
5288
+ width: "auto",
5289
+ flex: "0 1 auto"
5290
+ },
5291
+ "& > button[data-icon-only=\"true\"]": { marginLeft: "auto" }
5292
+ },
5293
+ "& .astrato-app-filter-bar__toggle": {
5294
+ display: "inline-flex",
5295
+ alignItems: "center",
5296
+ gap: 6,
5297
+ padding: "4px 10px",
5298
+ border: "1px solid var(--afb-border, #e4e4e7)",
5299
+ borderRadius: "var(--afb-control-radius, 7px)",
5300
+ background: "transparent",
5301
+ color: "inherit",
5302
+ font: "inherit",
5303
+ cursor: "pointer"
5304
+ },
5305
+ "& .astrato-app-filter-bar__toggle-track": {
5306
+ position: "relative",
5307
+ width: 22,
5308
+ height: 12,
5309
+ borderRadius: 6,
5310
+ border: "1px solid var(--afb-muted, #71717a)",
5311
+ "&::after": {
5312
+ content: "\"\"",
5313
+ position: "absolute",
5314
+ top: 1,
5315
+ left: 1,
5316
+ width: 8,
5317
+ height: 8,
5318
+ borderRadius: "50%",
5319
+ background: "var(--afb-muted, #71717a)"
5320
+ }
5321
+ },
5322
+ "& .astrato-app-filter-bar__toggle[aria-pressed=\"true\"] .astrato-app-filter-bar__toggle-track": {
5323
+ background: "var(--afb-accent, #3f3f46)",
5324
+ borderColor: "var(--afb-accent, #3f3f46)",
5325
+ "&::after": {
5326
+ left: 11,
5327
+ background: "var(--afb-on-accent, #fff)"
5328
+ }
5329
+ },
5330
+ "& .astrato-app-filter-bar__filter-group": {
5331
+ display: "grid",
5332
+ gridTemplateColumns: "18px minmax(0, 1fr)",
5333
+ gap: 8,
5334
+ minWidth: 0
5335
+ },
5336
+ "& .astrato-app-filter-bar__bracket": {
5337
+ writingMode: "vertical-rl",
5338
+ transform: "rotate(180deg)",
5339
+ fontSize: 10,
5340
+ fontWeight: 600,
5341
+ letterSpacing: "0.06em",
5342
+ border: "1px solid var(--afb-border, #e4e4e7)",
5343
+ borderRadius: 4,
5344
+ background: "transparent",
5345
+ color: "inherit",
5346
+ padding: "4px 0",
5347
+ textAlign: "center",
5348
+ cursor: "pointer",
5349
+ "&:is(span)": { cursor: "default" }
5350
+ },
5351
+ "& .astrato-app-filter-bar__filter-group-body": {
5352
+ display: "flex",
5353
+ flexDirection: "column",
5354
+ gap: 6,
5355
+ minWidth: 0
5356
+ },
5357
+ "& .astrato-app-filter-bar__chip": {
5358
+ display: "grid",
5359
+ gridTemplateColumns: "minmax(0, 1fr) auto",
5360
+ alignItems: "center",
5361
+ border: "1px solid var(--afb-border, #e4e4e7)",
5362
+ borderRadius: "var(--afb-control-radius, 7px)",
5363
+ background: "var(--afb-control-surface, #fff)",
5364
+ "&[data-open=\"true\"]": { borderStyle: "dashed" }
5365
+ },
5366
+ "& .astrato-app-filter-bar__chip-text": {
5367
+ border: 0,
5368
+ background: "transparent",
5369
+ textAlign: "left",
5370
+ padding: "6px 10px",
5371
+ font: "inherit",
5372
+ color: "inherit",
5373
+ cursor: "pointer",
5374
+ overflow: "hidden",
5375
+ textOverflow: "ellipsis",
5376
+ whiteSpace: "nowrap"
5377
+ },
5378
+ "& .astrato-app-filter-bar__chip-placeholder": {
5379
+ fontStyle: "italic",
5380
+ color: "var(--afb-muted, #71717a)"
5381
+ },
5382
+ "& .astrato-app-filter-bar__chip-editor": {
5383
+ display: "flex",
5384
+ flexDirection: "column",
5385
+ gap: 6,
5386
+ marginTop: 6,
5387
+ padding: 8,
5388
+ border: "1px solid var(--afb-border, #e4e4e7)",
5389
+ borderRadius: "var(--afb-control-radius, 7px)",
5390
+ boxShadow: "0 4px 12px #0001"
5391
+ },
5392
+ "& .astrato-app-filter-bar__chip-editor-row": {
5393
+ display: "flex",
5394
+ alignItems: "center",
5395
+ gap: 6,
5396
+ "& > select:first-of-type": {
5397
+ flex: "1 1 auto",
5398
+ minWidth: 0
5399
+ },
5400
+ "& > .astrato-app-filter-bar__operator": {
5401
+ width: "auto",
5402
+ flex: "0 0 auto"
5403
+ },
5404
+ "& > input": {
5405
+ flex: "1 1 0",
5406
+ minWidth: 0
5407
+ }
5408
+ },
5409
+ "& .astrato-app-filter-bar__chip-actions": {
5410
+ display: "flex",
5411
+ justifyContent: "space-between"
5412
+ },
5413
+ "& .astrato-app-filter-bar__value-label": {
5414
+ padding: "4px 8px",
5415
+ border: "1px solid var(--afb-border, #e4e4e7)",
5416
+ borderRadius: "var(--afb-control-radius, 7px)",
5417
+ fontSize: 12
5418
+ },
5419
+ "& .astrato-app-filter-bar__value-dropdown": {
5420
+ position: "relative",
5421
+ flex: "1 1 auto",
5422
+ minWidth: 0
5423
+ },
5424
+ "& .astrato-app-filter-bar__value-trigger": {
5425
+ display: "flex",
5426
+ alignItems: "center",
5427
+ justifyContent: "space-between",
5428
+ gap: 6,
5429
+ width: "100%",
5430
+ minHeight: "var(--afb-control-height, 32px)",
5431
+ padding: "4px 8px",
5432
+ border: "1px solid var(--afb-border, #e4e4e7)",
5433
+ borderRadius: "var(--afb-control-radius, 7px)",
5434
+ background: "var(--afb-control-surface, #fff)",
5435
+ color: "inherit",
5436
+ font: "inherit",
5437
+ cursor: "pointer",
5438
+ "& > span": {
5439
+ overflow: "hidden",
5440
+ textOverflow: "ellipsis",
5441
+ whiteSpace: "nowrap"
5442
+ },
5443
+ "& > span[data-placeholder=\"true\"]": { color: "var(--afb-muted, #71717a)" }
5444
+ },
5445
+ "& .astrato-app-filter-bar__value-menu": {
5446
+ position: "absolute",
5447
+ zIndex: 2,
5448
+ top: "calc(100% + 4px)",
5449
+ left: 0,
5450
+ right: 0,
5451
+ padding: 6,
5452
+ border: "1px solid var(--afb-border, #e4e4e7)",
5453
+ borderRadius: "var(--afb-control-radius, 7px)",
5454
+ background: "var(--afb-popup-surface, var(--afb-surface, #fff))",
5455
+ boxShadow: "0 8px 24px #0002"
5456
+ },
5457
+ "& .astrato-app-filter-bar__value-options": {
5458
+ maxHeight: 200,
5459
+ overflowY: "auto",
5460
+ marginTop: 6,
5461
+ display: "flex",
5462
+ flexDirection: "column",
5463
+ "& > button": {
5464
+ display: "flex",
5465
+ alignItems: "center",
5466
+ gap: 6,
5467
+ border: 0,
5468
+ background: "transparent",
5469
+ padding: "5px 6px",
5470
+ textAlign: "left",
5471
+ font: "inherit",
5472
+ color: "inherit",
5473
+ cursor: "pointer",
5474
+ borderRadius: 4,
5475
+ "&:hover, &[aria-selected=\"true\"]": { background: "var(--afb-hover, #f4f4f5)" }
5476
+ }
5477
+ },
5478
+ "& .astrato-app-filter-bar__value-check": {
5479
+ display: "inline-flex",
5480
+ alignItems: "center",
5481
+ justifyContent: "center",
5482
+ flex: "none",
5483
+ width: 14,
5484
+ height: 14,
5485
+ border: "1px solid var(--afb-border, #e4e4e7)",
5486
+ borderRadius: 3
5487
+ },
5488
+ "& .astrato-app-filter-bar__group-actions": {
5489
+ display: "flex",
5490
+ flexWrap: "wrap",
5491
+ gap: 4
5492
+ },
5493
+ "& .astrato-app-filter-bar__sides-and": {
5494
+ display: "flex",
5495
+ alignItems: "center",
5496
+ gap: 8,
5497
+ color: "var(--afb-muted, #71717a)",
5498
+ fontSize: 11,
5499
+ fontWeight: 600,
5500
+ "&::before, &::after": {
5501
+ content: "\"\"",
5502
+ flex: 1,
5503
+ borderTop: "1px solid var(--afb-border, #e4e4e7)"
5504
+ },
5505
+ "& > span": {
5506
+ padding: "2px 6px",
5507
+ border: "1px solid var(--afb-border, #e4e4e7)",
5508
+ borderRadius: 4
5509
+ }
5510
+ },
5511
+ "& .astrato-app-filter-bar__set-actions": {
5512
+ display: "flex",
5513
+ flexWrap: "wrap",
5514
+ gap: 6
5515
+ },
5516
+ "& .astrato-app-filter-bar__form-row:has(> .astrato-app-filter-bar__set-venn)": { alignItems: "start" },
5517
+ "& .astrato-app-filter-bar__set-venn": { minWidth: 0 },
5518
+ "& .astrato-app-filter-bar__set-venn-diagram": {
5519
+ display: "block",
5520
+ width: "100%",
5521
+ maxWidth: 320,
5522
+ height: "auto"
5523
+ },
5524
+ "& .astrato-app-filter-bar__set-venn-universe": {
5525
+ fill: "none",
5526
+ stroke: "var(--afb-border, #e4e4e7)"
5527
+ },
5528
+ "& .astrato-app-filter-bar__set-venn-result": { fill: "color-mix(in srgb, var(--afb-accent, #3f3f46) 14%, transparent)" },
5529
+ "& .astrato-app-filter-bar__set-venn-circle": {
5530
+ fill: "none",
5531
+ stroke: "var(--afb-accent, #3f3f46)",
5532
+ strokeWidth: 1.5
5533
+ },
5534
+ "& .astrato-app-filter-bar__set-venn-label": {
5535
+ fontSize: 11,
5536
+ fill: "var(--afb-muted, #71717a)",
5537
+ textAnchor: "middle",
5538
+ dominantBaseline: "middle"
5539
+ },
5540
+ "& .astrato-app-filter-bar__set-venn-legend": {
5541
+ listStyle: "none",
5542
+ margin: "6px 0 0",
5543
+ padding: 0,
5544
+ display: "flex",
5545
+ flexWrap: "wrap",
5546
+ gap: "4px 8px",
5547
+ fontSize: 11,
5548
+ color: "var(--afb-muted, #71717a)"
5549
+ },
5550
+ "& .astrato-app-filter-bar__set-venn-result-text": { fontWeight: 600 }
5551
+ }, wr = T({
5552
+ ..._r,
5553
+ ...vr,
5554
+ ...yr,
5555
+ ...br,
5556
+ ...xr,
5557
+ ...Sr,
5558
+ ...Cr
5559
+ }), Tr = /* @__PURE__ */ new Set([
4333
5560
  K.FilterOperator.NotInList,
4334
5561
  K.FilterOperator.NotBetween,
4335
5562
  K.FilterOperator.NotLike,
4336
5563
  K.FilterOperator.NotEquals,
4337
5564
  K.FilterOperator.NotContains,
4338
5565
  K.FilterOperator.NotSet
4339
- ]), On = (e, t) => [...e.pending, ...e.applied].find((e) => Y(e) === Y(t));
4340
- function kn() {
4341
- return /* @__PURE__ */ (0, k.jsx)(An, {});
5566
+ ]), Er = (e, t) => [...e.pending, ...e.applied].find((e) => Y(e) === Y(t));
5567
+ function Dr() {
5568
+ return /* @__PURE__ */ (0, A.jsx)(Or, {});
4342
5569
  }
4343
- function An({ isExpanded: e = !1 }) {
4344
- let t = g(), n = _()((e) => e.vSpec), r = b(), i = (0, O.useMemo)(() => _n(t), [t]), [o, s] = (0, O.useState)({
5570
+ function Or({ isExpanded: e = !1 }) {
5571
+ let t = w(), r = _()((e) => e.vSpec), i = y(), a = (0, k.useMemo)(() => hr(t), [t]), [o, s] = (0, k.useState)({
4345
5572
  applied: [],
4346
5573
  pending: []
4347
- }), [c, l] = (0, O.useState)(0), [u, d] = (0, O.useState)(), [f, p] = (0, O.useState)(), [m, h] = (0, O.useState)(), [v, y] = (0, O.useState)(), S = (0, O.useRef)(void 0), [C, T] = (0, O.useState)(""), E = (0, O.useId)(), D = (0, O.useId)(), [te, A] = (0, O.useState)(!1), M = n?.appFilterBarSettings ?? {}, P = () => {
4348
- s(i.getSelection()), l((e) => e + 1);
4349
- }, F = (e) => {
5574
+ }), [c, l] = (0, k.useState)(0), [u, d] = (0, k.useState)(), [p, m] = (0, k.useState)(), [h, g] = (0, k.useState)(), [b, x] = (0, k.useState)(), S = (0, k.useRef)(void 0), [C, T] = (0, k.useState)(""), E = (0, k.useId)(), D = (0, k.useId)(), [O, j] = (0, k.useState)(!1), N = r?.appFilterBarSettings ?? {}, F = () => {
5575
+ s(a.getSelection()), l((e) => e + 1);
5576
+ }, I = (e) => {
4350
5577
  try {
4351
- e(), P(), d(void 0);
5578
+ e(), F(), d(void 0);
4352
5579
  } catch (e) {
4353
5580
  d(e instanceof Error ? e.message : "Could not update filters.");
4354
5581
  }
4355
5582
  };
4356
- (0, O.useEffect)(() => {
5583
+ (0, k.useEffect)(() => {
4357
5584
  let e;
4358
5585
  try {
4359
- P(), e = i.subscribe(P);
5586
+ F(), e = a.subscribe(F);
4360
5587
  } catch (e) {
4361
5588
  d(e instanceof Error ? e.message : "Could not connect to the selection service.");
4362
5589
  }
4363
5590
  return () => e?.();
4364
- }, [i]), (0, O.useEffect)(() => {
4365
- !e && n?.type === a.AppFilterBar && r();
5591
+ }, [a]), (0, k.useEffect)(() => {
5592
+ !e && r?.type === n.AppFilterBar && i();
4366
5593
  }, [
4367
- n,
4368
5594
  r,
4369
- e
4370
- ]), (0, O.useEffect)(() => {
4371
- if (!m) return;
4372
- let e = On(o, m), t = JSON.stringify(e);
4373
- t !== S.current && (S.current = t, e ? h(structuredClone(e)) : (h(void 0), p(void 0)));
4374
- }, [o, m]);
4375
- let L = (0, O.useMemo)(() => i.getFields(), [i, c]), R = (0, O.useMemo)(() => M.showChartBreakdown === !0 ? i.getDimensionGroups().filter((e) => e.fields.length > 1) : [], [
4376
5595
  i,
5596
+ e
5597
+ ]), (0, k.useEffect)(() => {
5598
+ if (!h) return;
5599
+ let e = Er(o, h), t = JSON.stringify(e);
5600
+ t !== S.current && (S.current = t, e ? g(structuredClone(e)) : (g(void 0), m(void 0)));
5601
+ }, [o, h]);
5602
+ let R = (0, k.useMemo)(() => a.getFields(), [a, c]), z = (0, k.useMemo)(() => N.showChartBreakdown === !0 ? a.getDimensionGroups().filter((e) => e.fields.length > 1) : [], [
5603
+ a,
4377
5604
  c,
4378
- M.showChartBreakdown
4379
- ]), z = (0, O.useMemo)(() => new Map(L.map((e) => [e.key, e])), [L]), re = M.selectableFieldKeys?.length ? new Set(M.selectableFieldKeys) : void 0, ie = L.filter((e) => !re || re.has(e.key)), B = JSON.stringify(ie), ae = i.supportsAssociativeFiltering, V = M.enableAssociativeFilter !== !1 && ae, H = f?.kind === "fields", U = ae && v?.services === i && v.fieldMetadata === B ? v.fields : [];
4380
- (0, O.useEffect)(() => {
4381
- if (!H || !V) return;
5605
+ N.showChartBreakdown
5606
+ ]), B = (0, k.useMemo)(() => new Map(R.map((e) => [e.key, e])), [R]), ne = N.selectableFieldKeys?.length ? new Set(N.selectableFieldKeys) : void 0, re = R.filter((e) => !ne || ne.has(e.key)), V = JSON.stringify(re), ie = a.supportsAssociativeFiltering, H = N.enableAssociativeFilter !== !1 && ie, U = p?.kind === "fields", ae = p?.kind === "filter" && h !== void 0 && "associativeListFilter" in h, oe = ae ? sr : or, W = ie && b?.services === a && b.fieldMetadata === V ? b.fields : [];
5607
+ (0, k.useEffect)(() => {
5608
+ if (!U || !H) return;
4382
5609
  let e = new AbortController();
4383
- y(void 0);
4384
- let t = JSON.parse(B);
4385
- return i.getAssociativeFields(t, e.signal).then((t) => {
4386
- e.signal.aborted || y({
4387
- services: i,
4388
- fieldMetadata: B,
5610
+ x(void 0);
5611
+ let t = JSON.parse(V);
5612
+ return a.getAssociativeFields(t, e.signal).then((t) => {
5613
+ e.signal.aborted || x({
5614
+ services: a,
5615
+ fieldMetadata: V,
4389
5616
  fields: t
4390
5617
  });
4391
5618
  }), () => e.abort();
4392
5619
  }, [
4393
- i,
4394
- B,
5620
+ a,
4395
5621
  V,
4396
- H
5622
+ H,
5623
+ U
4397
5624
  ]);
4398
- let oe = ie.filter((e) => `${e.name} ${e.view ?? ""}`.toLocaleLowerCase().includes(C.toLocaleLowerCase().trim())), W = Ye(o), se = e ? "vertical" : M.orientation ?? "horizontal", { barRef: ce, overflow: le } = pn(!e && M.overflow === "button" ? "button" : se === "vertical" ? "wrap" : M.overflow ?? "wrap", !!n);
4399
- (0, O.useEffect)(() => {
4400
- le !== "button" && A(!1), p(void 0), h(void 0);
4401
- }, [le]);
4402
- let { chipsRef: ue, visibleCount: de } = fn(le === "collapse", JSON.stringify(W), W.length), fe = W.length - de, pe = W.slice(de).some((e) => e.pending), G = o.pending.length > 0, me = G && o.pending.every(Qe) && (!m || Qe(m)), he = o.applied.length > 0 || G, ge = () => {
4403
- p(void 0), h(void 0), S.current = void 0;
4404
- }, _e = () => F(() => {
4405
- i.cancel(), ge();
4406
- }), ve = () => F(() => {
4407
- i.apply(), ge();
4408
- }), ye = (e) => z.get(e.fieldKey) ?? {
5625
+ let se = re.filter((e) => `${e.name} ${e.view ?? ""}`.toLocaleLowerCase().includes(C.toLocaleLowerCase().trim())), G = _t(o), ce = e ? "vertical" : N.orientation ?? "horizontal", { barRef: le, overflow: ue } = dr(!e && N.overflow === "button" ? "button" : ce === "vertical" ? "wrap" : N.overflow ?? "wrap", !!r);
5626
+ (0, k.useEffect)(() => {
5627
+ ue !== "button" && j(!1), m(void 0), g(void 0);
5628
+ }, [ue]);
5629
+ let { chipsRef: de, visibleCount: fe } = ur(ue === "collapse", JSON.stringify(G), G.length), pe = G.length - fe, me = G.slice(fe).some((e) => e.pending), he = o.pending.length > 0, ge = he && o.pending.every(bt) && (!h || bt(h)), _e = o.applied.length > 0 || he, ve = () => {
5630
+ m(void 0), g(void 0), S.current = void 0;
5631
+ }, ye = () => I(() => {
5632
+ a.cancel(), ve();
5633
+ }), be = () => I(() => {
5634
+ a.apply(), ve();
5635
+ }), xe = (e) => B.get(e.fieldKey) ?? {
4409
5636
  key: e.fieldKey,
4410
5637
  name: e.fieldKey,
4411
5638
  dataType: K.FieldType.STRING
4412
- }, be = (e, t, n = !1) => {
4413
- S.current = JSON.stringify(On(o, e)), h(structuredClone(e)), p({
5639
+ }, Se = (e, t, n = !1) => {
5640
+ S.current = JSON.stringify(Er(o, e)), g(structuredClone(e)), m({
4414
5641
  kind: "filter",
4415
5642
  anchor: t,
4416
5643
  fromOverflow: n
4417
5644
  });
4418
- }, xe = (e) => {
4419
- if (!f) return;
5645
+ }, Ce = (e) => {
5646
+ if (!p) return;
4420
5647
  let t = o.pending.find((t) => t.fieldKey === e.key && !("associativeListFilter" in t)) ?? o.applied.find((t) => t.fieldKey === e.key && !("associativeListFilter" in t));
4421
- be(t ?? ft(e), f.anchor);
4422
- }, Se = (e) => {
4423
- h(e);
4424
- let t = M.selectionMode ?? "inherit", n = t === "inherit" ? i.getSelectionMode() : t, r = !!On(i.getSelection(), e), a = "operator" in e && ([K.FilterOperator.InList, K.FilterOperator.NotInList].includes(e.operator) && !e.values?.length || [K.FilterOperator.Like, K.FilterOperator.NotLike].includes(e.operator) && !String(e.values?.[0] ?? "").trim());
4425
- (Qe(e) || r && (n === "manual" || a)) && F(() => i.select(e, t)), S.current = JSON.stringify(On(i.getSelection(), e));
4426
- }, Ce = (e, t, n = !1) => {
4427
- let { id: r, filter: a, pending: o } = e, s = ye(a), c = i.isLocked(a.fieldKey), l = i.isSingleSelect(a.fieldKey), u = $e(a, (e) => [
5648
+ Se(t ?? Ft(e), p.anchor);
5649
+ }, we = (e) => {
5650
+ g(e);
5651
+ let t = N.selectionMode ?? "inherit", n = t === "inherit" ? a.getSelectionMode() : t, r = !!Er(a.getSelection(), e), i = "operator" in e && ([K.FilterOperator.InList, K.FilterOperator.NotInList].includes(e.operator) && !e.values?.length || [K.FilterOperator.Like, K.FilterOperator.NotLike].includes(e.operator) && !String(e.values?.[0] ?? "").trim());
5652
+ (bt(e) || r && (n === "manual" || i)) && I(() => a.select(e, t)), S.current = JSON.stringify(Er(a.getSelection(), e));
5653
+ }, Te = (e, t, n = !1) => {
5654
+ let { id: r, filter: i, pending: o } = e, s = xe(i), c = a.isLocked(i.fieldKey), l = a.isSingleSelect(i.fieldKey), u = xt(i, (e) => [
4428
5655
  K.FieldType.DATE,
4429
5656
  K.FieldType.TIME,
4430
5657
  K.FieldType.TIMESTAMP,
4431
5658
  K.FieldType.TIMESTAMP_TZ
4432
- ].includes(s.dataType) && "operator" in a && !a.datePart && (typeof e == "number" || typeof e == "string") ? ht(e, s.dataType, i.getTimeZone() ?? "UTC").replace("T", " ") || String(e) : e === null ? "Null" : String(e)), d = "operator" in a && Dn.has(a.operator), p = f?.kind === "filter" && m && Ke(m) === r;
4433
- return /* @__PURE__ */ (0, k.jsxs)("div", {
5659
+ ].includes(s.dataType) && "operator" in i && !i.datePart && (typeof e == "number" || typeof e == "string") ? Rt(e, s.dataType, a.getTimeZone() ?? "UTC").replace("T", " ") || String(e) : e === null ? "Null" : String(e)), d = "operator" in i && Tr.has(i.operator), m = p?.kind === "filter" && h && mt(h) === r;
5660
+ return /* @__PURE__ */ (0, A.jsxs)("div", {
4434
5661
  className: "astrato-app-filter-bar__chip",
4435
- "data-overflow-hidden": !n && t >= de,
4436
- "aria-hidden": !n && t >= de || void 0,
5662
+ "data-overflow-hidden": !n && t >= fe,
5663
+ "aria-hidden": !n && t >= fe || void 0,
4437
5664
  "data-pending": !!o,
4438
5665
  "data-excluded": d,
4439
5666
  "data-locked": c,
4440
- children: [/* @__PURE__ */ (0, k.jsxs)(j, {
5667
+ children: [/* @__PURE__ */ (0, A.jsxs)(M, {
4441
5668
  "aria-haspopup": "dialog",
4442
5669
  "aria-controls": E,
4443
- "aria-expanded": !!p,
5670
+ "aria-expanded": !!m,
4444
5671
  "aria-label": `${d ? "Not " : ""}${s.name}: ${u.text || "Choose values"}${c ? ", locked" : ""}`,
4445
- onClick: (e) => be(a, n && f ? f.anchor : e.currentTarget, n),
5672
+ onClick: (e) => Se(i, n && p ? p.anchor : e.currentTarget, n),
4446
5673
  title: `${s.name}: ${u.text}`,
4447
5674
  children: [
4448
- /* @__PURE__ */ (0, k.jsx)(x, { name: "filter" }),
4449
- /* @__PURE__ */ (0, k.jsxs)("span", {
5675
+ /* @__PURE__ */ (0, A.jsx)(f, { name: "filter" }),
5676
+ /* @__PURE__ */ (0, A.jsxs)("span", {
4450
5677
  className: "astrato-app-filter-bar__chip-label",
4451
5678
  children: [
4452
- /* @__PURE__ */ (0, k.jsx)("strong", { children: d ? `Not ${s.name}` : s.name }),
4453
- /* @__PURE__ */ (0, k.jsx)("span", {
5679
+ /* @__PURE__ */ (0, A.jsx)("strong", { children: d ? `Not ${s.name}` : s.name }),
5680
+ /* @__PURE__ */ (0, A.jsx)("span", {
4454
5681
  className: "astrato-app-filter-bar__chip-divider",
4455
5682
  "aria-hidden": "true",
4456
5683
  children: "·"
4457
5684
  }),
4458
- /* @__PURE__ */ (0, k.jsx)("span", {
5685
+ /* @__PURE__ */ (0, A.jsx)("span", {
4459
5686
  className: "astrato-app-filter-bar__chip-summary",
4460
5687
  children: u.text || "Choose values"
4461
5688
  })
4462
5689
  ]
4463
5690
  }),
4464
- c && /* @__PURE__ */ (0, k.jsx)("span", {
5691
+ c && /* @__PURE__ */ (0, A.jsx)("span", {
4465
5692
  "aria-label": "Locked",
4466
- children: /* @__PURE__ */ (0, k.jsx)(x, { name: "lock" })
5693
+ children: /* @__PURE__ */ (0, A.jsx)(f, { name: "lock" })
4467
5694
  })
4468
5695
  ]
4469
- }), /* @__PURE__ */ (0, k.jsx)(j, {
5696
+ }), /* @__PURE__ */ (0, A.jsx)(M, {
4470
5697
  "data-icon-only": "true",
4471
5698
  "aria-label": `Remove ${s.name} filter`,
4472
5699
  disabled: c || l,
4473
5700
  onClick: (e) => {
4474
5701
  let t = e.currentTarget.closest(".astrato-app-filter-bar__chip"), n = (t?.nextElementSibling ?? t?.previousElementSibling)?.querySelector("button:not(:disabled)") ?? t?.closest("[role=\"dialog\"], dialog")?.querySelector("button:not(:disabled)");
4475
- F(() => {
4476
- i.remove(a), p ? ge() : n?.focus();
5702
+ I(() => {
5703
+ a.remove(i), m ? ve() : n?.focus();
4477
5704
  });
4478
5705
  },
4479
- children: /* @__PURE__ */ (0, k.jsx)(x, { name: "close" })
5706
+ children: /* @__PURE__ */ (0, A.jsx)(f, { name: "close" })
4480
5707
  })]
4481
5708
  }, r);
4482
5709
  };
4483
- return n ? le === "button" ? /* @__PURE__ */ (0, k.jsxs)("div", {
4484
- ref: ce,
4485
- className: w("astrato-app-filter-bar", En),
5710
+ return r ? ue === "button" ? /* @__PURE__ */ (0, A.jsxs)("div", {
5711
+ ref: le,
5712
+ className: v("astrato-app-filter-bar", wr),
4486
5713
  "data-overflow": "button",
4487
5714
  role: "region",
4488
5715
  "aria-label": "Filters",
4489
- children: [/* @__PURE__ */ (0, k.jsxs)(j, {
5716
+ children: [/* @__PURE__ */ (0, A.jsxs)(M, {
4490
5717
  className: "astrato-app-filter-bar__overflow astrato-app-filter-bar__trigger",
4491
- "data-pending": G,
4492
- "aria-label": `Filters (${W.length})${G ? ", pending changes" : ""}`,
5718
+ "data-pending": he,
5719
+ "aria-label": `Filters (${G.length})${he ? ", pending changes" : ""}`,
4493
5720
  "aria-haspopup": "dialog",
4494
- "aria-expanded": te,
5721
+ "aria-expanded": O,
4495
5722
  "aria-controls": D,
4496
- onClick: () => A(!0),
5723
+ onClick: () => j(!0),
4497
5724
  children: [
4498
- /* @__PURE__ */ (0, k.jsx)(x, { name: "filter" }),
5725
+ /* @__PURE__ */ (0, A.jsx)(f, { name: "filter" }),
4499
5726
  " Filters (",
4500
- W.length,
5727
+ G.length,
4501
5728
  ")"
4502
5729
  ]
4503
- }), te && /* @__PURE__ */ (0, k.jsxs)(I, {
5730
+ }), O && /* @__PURE__ */ (0, A.jsxs)(L, {
4504
5731
  id: D,
4505
5732
  className: "astrato-app-filter-bar__modal",
4506
5733
  "aria-labelledby": `${D}-title`,
4507
- onCloseDialog: () => A(!1),
4508
- children: [/* @__PURE__ */ (0, k.jsxs)("div", {
5734
+ onCloseDialog: () => j(!1),
5735
+ children: [/* @__PURE__ */ (0, A.jsxs)("div", {
4509
5736
  className: "astrato-app-filter-bar__popover-header",
4510
- children: [/* @__PURE__ */ (0, k.jsxs)("strong", {
5737
+ children: [/* @__PURE__ */ (0, A.jsxs)("strong", {
4511
5738
  id: `${D}-title`,
4512
5739
  children: [
4513
5740
  "Filters (",
4514
- W.length,
5741
+ G.length,
4515
5742
  ")"
4516
5743
  ]
4517
- }), /* @__PURE__ */ (0, k.jsx)(j, {
5744
+ }), /* @__PURE__ */ (0, A.jsx)(M, {
4518
5745
  "data-icon-only": "true",
4519
5746
  "data-variant": "ghost",
4520
5747
  "aria-label": "Close filters",
4521
- onClick: () => A(!1),
4522
- children: /* @__PURE__ */ (0, k.jsx)(x, { name: "close" })
5748
+ onClick: () => j(!1),
5749
+ children: /* @__PURE__ */ (0, A.jsx)(f, { name: "close" })
4523
5750
  })]
4524
- }), /* @__PURE__ */ (0, k.jsx)(An, { isExpanded: !0 })]
5751
+ }), /* @__PURE__ */ (0, A.jsx)(Or, { isExpanded: !0 })]
4525
5752
  })]
4526
- }) : /* @__PURE__ */ (0, k.jsxs)("div", {
4527
- ref: ce,
4528
- className: w("astrato-app-filter-bar", En),
5753
+ }) : /* @__PURE__ */ (0, A.jsxs)("div", {
5754
+ ref: le,
5755
+ className: v("astrato-app-filter-bar", wr),
4529
5756
  role: "region",
4530
5757
  tabIndex: -1,
4531
5758
  "aria-label": "Filters",
4532
- "data-selection-mode": M.selectionMode ?? "inherit",
4533
- "data-overflow": le,
4534
- "data-orientation": se,
5759
+ "data-selection-mode": N.selectionMode ?? "inherit",
5760
+ "data-overflow": ue,
5761
+ "data-orientation": ce,
4535
5762
  children: [
4536
- M.enableAddingNewFilters !== !1 && /* @__PURE__ */ (0, k.jsxs)(j, {
4537
- "aria-expanded": f?.kind === "fields",
5763
+ N.enableAddingNewFilters !== !1 && /* @__PURE__ */ (0, A.jsxs)(M, {
5764
+ "aria-expanded": p?.kind === "fields",
4538
5765
  "aria-controls": E,
4539
5766
  "aria-haspopup": "dialog",
4540
5767
  onClick: (e) => {
4541
- T(""), h(void 0), p({
5768
+ T(""), g(void 0), m({
4542
5769
  kind: "fields",
4543
5770
  anchor: e.currentTarget
4544
5771
  });
4545
5772
  },
4546
- children: [/* @__PURE__ */ (0, k.jsx)(x, { name: "plus" }), " New filter"]
5773
+ children: [/* @__PURE__ */ (0, A.jsx)(f, { name: "plus" }), " New filter"]
4547
5774
  }),
4548
- R.length > 0 && /* @__PURE__ */ (0, k.jsxs)(j, {
5775
+ z.length > 0 && /* @__PURE__ */ (0, A.jsxs)(M, {
4549
5776
  "aria-haspopup": "dialog",
4550
5777
  "aria-controls": E,
4551
- "aria-expanded": f?.kind === "groups",
4552
- onClick: (e) => p({
5778
+ "aria-expanded": p?.kind === "groups",
5779
+ onClick: (e) => m({
4553
5780
  kind: "groups",
4554
5781
  anchor: e.currentTarget
4555
5782
  }),
4556
- children: [/* @__PURE__ */ (0, k.jsx)(x, { name: "dimensions" }), " Chart breakdown"]
5783
+ children: [/* @__PURE__ */ (0, A.jsx)(f, { name: "dimensions" }), " Chart breakdown"]
4557
5784
  }),
4558
- /* @__PURE__ */ (0, k.jsxs)("div", {
4559
- ref: ue,
5785
+ /* @__PURE__ */ (0, A.jsxs)("div", {
5786
+ ref: de,
4560
5787
  className: "astrato-app-filter-bar__chips",
4561
5788
  "aria-live": "polite",
4562
5789
  "aria-relevant": "additions removals",
4563
5790
  children: [
4564
- W.map((e, t) => Ce(e, t)),
4565
- le === "collapse" && W.length > 0 && /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [/* @__PURE__ */ (0, k.jsx)("div", {
5791
+ G.map((e, t) => Te(e, t)),
5792
+ ue === "collapse" && G.length > 0 && /* @__PURE__ */ (0, A.jsxs)(A.Fragment, { children: [/* @__PURE__ */ (0, A.jsx)("div", {
4566
5793
  className: "astrato-app-filter-bar__overflow-probes",
4567
5794
  "aria-hidden": "true",
4568
- children: W.map((e, t) => /* @__PURE__ */ (0, k.jsxs)("span", {
5795
+ children: G.map((e, t) => /* @__PURE__ */ (0, A.jsxs)("span", {
4569
5796
  className: "astrato-app-filter-bar__button astrato-app-filter-bar__overflow",
4570
5797
  "data-overflow-count": t + 1,
4571
5798
  children: ["+", t + 1]
4572
5799
  }, e.id))
4573
- }), /* @__PURE__ */ (0, k.jsxs)(j, {
5800
+ }), /* @__PURE__ */ (0, A.jsxs)(M, {
4574
5801
  className: "astrato-app-filter-bar__overflow",
4575
- "data-overflow-hidden": fe === 0,
4576
- "data-pending": pe,
4577
- "aria-hidden": fe === 0 || void 0,
4578
- "aria-label": `${fe} hidden filters${pe ? ", pending changes" : ""}`,
5802
+ "data-overflow-hidden": pe === 0,
5803
+ "data-pending": me,
5804
+ "aria-hidden": pe === 0 || void 0,
5805
+ "aria-label": `${pe} hidden filters${me ? ", pending changes" : ""}`,
4579
5806
  "aria-haspopup": "dialog",
4580
5807
  "aria-controls": E,
4581
- "aria-expanded": f?.kind === "overflow" || !!f?.fromOverflow,
5808
+ "aria-expanded": p?.kind === "overflow" || !!p?.fromOverflow,
4582
5809
  onClick: (e) => {
4583
- h(void 0), p({
5810
+ g(void 0), m({
4584
5811
  kind: "overflow",
4585
5812
  anchor: e.currentTarget
4586
5813
  });
4587
5814
  },
4588
- children: ["+", fe]
5815
+ children: ["+", pe]
4589
5816
  })] }),
4590
- !W.length && /* @__PURE__ */ (0, k.jsxs)("span", {
5817
+ !G.length && /* @__PURE__ */ (0, A.jsxs)("span", {
4591
5818
  className: "astrato-app-filter-bar__empty-bar",
4592
- children: [/* @__PURE__ */ (0, k.jsx)(x, { name: "filter" }), "No active filters"]
5819
+ children: [/* @__PURE__ */ (0, A.jsx)(f, { name: "filter" }), "No active filters"]
4593
5820
  })
4594
5821
  ]
4595
5822
  }),
4596
- /* @__PURE__ */ (0, k.jsxs)("div", {
5823
+ /* @__PURE__ */ (0, A.jsxs)("div", {
4597
5824
  className: "astrato-app-filter-bar__actions",
4598
- children: [G && /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [/* @__PURE__ */ (0, k.jsx)(j, {
4599
- onClick: _e,
5825
+ children: [he && /* @__PURE__ */ (0, A.jsxs)(A.Fragment, { children: [/* @__PURE__ */ (0, A.jsx)(M, {
5826
+ onClick: ye,
4600
5827
  "data-variant": "ghost",
4601
5828
  children: "Cancel"
4602
- }), /* @__PURE__ */ (0, k.jsxs)(j, {
5829
+ }), /* @__PURE__ */ (0, A.jsxs)(M, {
4603
5830
  "data-primary": "true",
4604
- disabled: !me,
4605
- onClick: ve,
4606
- children: [/* @__PURE__ */ (0, k.jsx)(x, { name: "check" }), " Apply"]
4607
- })] }), M.showClearAll !== !1 && he && /* @__PURE__ */ (0, k.jsxs)(j, {
5831
+ disabled: !ge,
5832
+ onClick: be,
5833
+ children: [/* @__PURE__ */ (0, A.jsx)(f, { name: "check" }), " Apply"]
5834
+ })] }), N.showClearAll !== !1 && _e && /* @__PURE__ */ (0, A.jsxs)(M, {
4608
5835
  "data-variant": "ghost",
4609
- onClick: () => F(() => {
4610
- i.clear(), ge();
5836
+ onClick: () => I(() => {
5837
+ a.clear(), ve();
4611
5838
  }),
4612
- children: [/* @__PURE__ */ (0, k.jsx)(x, { name: "reset" }), " Clear all"]
5839
+ children: [/* @__PURE__ */ (0, A.jsx)(f, { name: "reset" }), " Clear all"]
4613
5840
  })]
4614
5841
  }),
4615
- u && /* @__PURE__ */ (0, k.jsx)("div", {
5842
+ u && /* @__PURE__ */ (0, A.jsx)("div", {
4616
5843
  className: "astrato-app-filter-bar__error",
4617
5844
  role: "alert",
4618
5845
  children: u
4619
5846
  }),
4620
- f && (f.kind !== "groups" || R.length > 0) && /* @__PURE__ */ (0, k.jsxs)(ln, {
5847
+ p && (p.kind !== "groups" || z.length > 0) && /* @__PURE__ */ (0, A.jsxs)(oe, {
4621
5848
  id: E,
4622
- anchor: f.anchor,
4623
- placement: se === "vertical" ? "side" : "bottom",
4624
- className: f.kind === "fields" ? "astrato-app-filter-bar__field-picker" : f.kind === "overflow" ? "astrato-app-filter-bar__overflow-popover" : void 0,
4625
- onClose: ge,
4626
- subtitle: f.kind === "groups" ? "Choose the fields shown in your charts" : f.kind === "filter" && m ? ye(m).view : void 0,
4627
- icon: f.kind === "filter" && m ? /* @__PURE__ */ (0, k.jsx)(ee, {
4628
- fieldType: ye(m).dataType,
5849
+ anchor: p.anchor,
5850
+ placement: ce === "vertical" ? "side" : "bottom",
5851
+ className: p.kind === "fields" ? "astrato-app-filter-bar__field-picker" : p.kind === "overflow" ? "astrato-app-filter-bar__overflow-popover" : ae ? "astrato-app-filter-bar__set-filter-dialog" : void 0,
5852
+ onClose: ve,
5853
+ subtitle: p.kind === "groups" ? "Choose the fields shown in your charts" : p.kind === "filter" && h ? xe(h).view : void 0,
5854
+ icon: p.kind === "filter" && h ? /* @__PURE__ */ (0, A.jsx)(ee, {
5855
+ fieldType: xe(h).dataType,
4629
5856
  fill: "currentColor"
4630
- }) : /* @__PURE__ */ (0, k.jsx)(x, { name: f.kind === "groups" ? "dimensions" : "filter" }),
4631
- title: f.kind === "fields" ? "Add filter" : f.kind === "groups" ? "Chart breakdown" : f.kind === "overflow" ? `Filters (${W.length})` : m ? ye(m).name : "Filter",
5857
+ }) : /* @__PURE__ */ (0, A.jsx)(f, { name: p.kind === "groups" ? "dimensions" : "filter" }),
5858
+ title: p.kind === "fields" ? "Add filter" : p.kind === "groups" ? "Chart breakdown" : p.kind === "overflow" ? `Filters (${G.length})` : h ? xe(h).name : "Filter",
4632
5859
  children: [
4633
- f.kind === "overflow" && /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [/* @__PURE__ */ (0, k.jsxs)("div", {
5860
+ p.kind === "overflow" && /* @__PURE__ */ (0, A.jsxs)(A.Fragment, { children: [/* @__PURE__ */ (0, A.jsxs)("div", {
4634
5861
  className: "astrato-app-filter-bar__overflow-list",
4635
- children: [W.map((e, t) => Ce(e, t, !0)), !W.length && /* @__PURE__ */ (0, k.jsx)("p", {
5862
+ children: [G.map((e, t) => Te(e, t, !0)), !G.length && /* @__PURE__ */ (0, A.jsx)("p", {
4636
5863
  className: "astrato-app-filter-bar__muted",
4637
5864
  children: "No active filters"
4638
5865
  })]
4639
- }), G && /* @__PURE__ */ (0, k.jsxs)("div", {
5866
+ }), he && /* @__PURE__ */ (0, A.jsxs)("div", {
4640
5867
  className: "astrato-app-filter-bar__editor-footer",
4641
- children: [/* @__PURE__ */ (0, k.jsx)(j, {
5868
+ children: [/* @__PURE__ */ (0, A.jsx)(M, {
4642
5869
  "data-variant": "ghost",
4643
- onClick: _e,
5870
+ onClick: ye,
4644
5871
  children: "Cancel"
4645
- }), /* @__PURE__ */ (0, k.jsxs)(j, {
5872
+ }), /* @__PURE__ */ (0, A.jsxs)(M, {
4646
5873
  "data-primary": "true",
4647
- disabled: !me,
4648
- onClick: ve,
4649
- children: [/* @__PURE__ */ (0, k.jsx)(x, { name: "check" }), " Apply"]
5874
+ disabled: !ge,
5875
+ onClick: be,
5876
+ children: [/* @__PURE__ */ (0, A.jsx)(f, { name: "check" }), " Apply"]
4650
5877
  })]
4651
5878
  })] }),
4652
- f.kind === "fields" && /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [
4653
- /* @__PURE__ */ (0, k.jsx)(ne, {
5879
+ p.kind === "fields" && /* @__PURE__ */ (0, A.jsxs)(A.Fragment, { children: [
5880
+ /* @__PURE__ */ (0, A.jsx)(te, {
4654
5881
  "aria-label": "Search fields",
4655
5882
  placeholder: "Search fields…",
4656
5883
  value: C,
4657
5884
  onChange: (e) => T(e.target.value)
4658
5885
  }),
4659
- /* @__PURE__ */ (0, k.jsxs)("div", {
5886
+ /* @__PURE__ */ (0, A.jsxs)("div", {
4660
5887
  className: "astrato-app-filter-bar__values",
4661
- children: [oe.map((e) => /* @__PURE__ */ (0, k.jsxs)(j, {
5888
+ children: [se.map((e) => /* @__PURE__ */ (0, A.jsxs)(M, {
4662
5889
  className: "astrato-app-filter-bar__value astrato-app-filter-bar__field-option",
4663
- disabled: i.isLocked(e.key),
5890
+ disabled: a.isLocked(e.key),
4664
5891
  title: e.view ? `${e.name} · ${e.view}` : e.name,
4665
- onClick: () => xe(e),
5892
+ onClick: () => Ce(e),
4666
5893
  children: [
4667
- /* @__PURE__ */ (0, k.jsx)("span", {
5894
+ /* @__PURE__ */ (0, A.jsx)("span", {
4668
5895
  className: "astrato-app-filter-bar__field-icon",
4669
5896
  "aria-hidden": "true",
4670
- children: /* @__PURE__ */ (0, k.jsx)(ee, {
5897
+ children: /* @__PURE__ */ (0, A.jsx)(ee, {
4671
5898
  fieldType: e.dataType,
4672
5899
  fill: "currentColor"
4673
5900
  })
4674
5901
  }),
4675
- /* @__PURE__ */ (0, k.jsxs)("span", {
5902
+ /* @__PURE__ */ (0, A.jsxs)("span", {
4676
5903
  className: "astrato-app-filter-bar__field-name",
4677
- children: [/* @__PURE__ */ (0, k.jsx)("span", {
5904
+ children: [/* @__PURE__ */ (0, A.jsx)("span", {
4678
5905
  className: "astrato-app-filter-bar__field-label",
4679
5906
  children: e.name
4680
- }), /* @__PURE__ */ (0, k.jsx)("small", {
5907
+ }), /* @__PURE__ */ (0, A.jsx)("small", {
4681
5908
  className: "astrato-app-filter-bar__muted",
4682
5909
  children: e.view
4683
5910
  })]
4684
5911
  }),
4685
- /* @__PURE__ */ (0, k.jsx)(x, { name: "chevronRight" })
5912
+ /* @__PURE__ */ (0, A.jsx)(f, { name: "chevronRight" })
4686
5913
  ]
4687
- }, e.key)), !oe.length && /* @__PURE__ */ (0, k.jsx)("p", {
5914
+ }, e.key)), !se.length && /* @__PURE__ */ (0, A.jsx)("p", {
4688
5915
  className: "astrato-app-filter-bar__muted",
4689
5916
  children: "No matching fields"
4690
5917
  })]
4691
5918
  }),
4692
- V && U.length > 0 && /* @__PURE__ */ (0, k.jsxs)(j, {
5919
+ H && W.length > 0 && /* @__PURE__ */ (0, A.jsxs)(M, {
4693
5920
  className: "astrato-app-filter-bar__association-action",
4694
5921
  "data-variant": "ghost",
4695
- onClick: () => be({
4696
- fieldKey: U[0].key,
5922
+ onClick: () => Se({
5923
+ fieldKey: W[0].key,
4697
5924
  associativeListFilter: {
4698
- view: U[0].view ?? "",
5925
+ view: W[0].view ?? "",
4699
5926
  intersectFilters: [],
4700
5927
  unionFilters: []
4701
5928
  }
4702
- }, f.anchor),
4703
- children: [/* @__PURE__ */ (0, k.jsx)(x, { name: "association" }), " New associative filter"]
5929
+ }, p.anchor),
5930
+ children: [/* @__PURE__ */ (0, A.jsx)(f, { name: "association" }), " Add set filter"]
4704
5931
  })
4705
5932
  ] }),
4706
- f.kind === "groups" && R.map((e) => /* @__PURE__ */ (0, k.jsxs)("label", {
5933
+ p.kind === "groups" && z.map((e) => /* @__PURE__ */ (0, A.jsxs)("label", {
4707
5934
  className: "astrato-app-filter-bar__field",
4708
- children: [e.name, /* @__PURE__ */ (0, k.jsx)(N, {
5935
+ children: [e.name, /* @__PURE__ */ (0, A.jsx)(P, {
4709
5936
  value: e.selectedIndex,
4710
- onChange: (t) => F(() => i.setDimensionGroup(e.id, Number(t.target.value))),
4711
- children: e.fields.map((e, t) => /* @__PURE__ */ (0, k.jsx)("option", {
5937
+ onChange: (t) => I(() => a.setDimensionGroup(e.id, Number(t.target.value))),
5938
+ children: e.fields.map((e, t) => /* @__PURE__ */ (0, A.jsx)("option", {
4712
5939
  value: t,
4713
5940
  children: e.name
4714
5941
  }, e.key))
4715
5942
  })]
4716
5943
  }, e.id)),
4717
- f.kind === "filter" && m && /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: ["associativeListFilter" in m ? ae ? /* @__PURE__ */ (0, k.jsx)(on, {
4718
- filter: m,
4719
- fields: ie,
4720
- targetFields: U.some((e) => e.key === m.fieldKey) ? U : [ye(m), ...U],
4721
- services: i,
4722
- onChange: Se,
4723
- disabled: i.isLocked(m.fieldKey)
4724
- }) : /* @__PURE__ */ (0, k.jsx)("p", {
5944
+ p.kind === "filter" && h && /* @__PURE__ */ (0, A.jsxs)(A.Fragment, { children: ["associativeListFilter" in h ? ie ? /* @__PURE__ */ (0, A.jsx)(nr, {
5945
+ filter: h,
5946
+ fields: re,
5947
+ targetFields: W.some((e) => e.key === h.fieldKey) ? W : [xe(h), ...W],
5948
+ services: a,
5949
+ onChange: we,
5950
+ disabled: a.isLocked(h.fieldKey)
5951
+ }) : /* @__PURE__ */ (0, A.jsx)("p", {
4725
5952
  className: "astrato-app-filter-bar__muted",
4726
5953
  children: "Associative filter editing is unavailable in this app."
4727
- }) : /* @__PURE__ */ (0, k.jsx)(Qt, {
4728
- field: ye(m),
4729
- filter: m,
4730
- services: i,
4731
- onChange: Se,
4732
- disabled: i.isLocked(m.fieldKey)
4733
- }), /* @__PURE__ */ (0, k.jsxs)("div", {
5954
+ }) : /* @__PURE__ */ (0, A.jsx)(Sn, {
5955
+ field: xe(h),
5956
+ filter: h,
5957
+ services: a,
5958
+ onChange: we,
5959
+ disabled: a.isLocked(h.fieldKey)
5960
+ }), /* @__PURE__ */ (0, A.jsxs)("div", {
4734
5961
  className: "astrato-app-filter-bar__editor-footer",
4735
5962
  children: [
4736
- f.fromOverflow && /* @__PURE__ */ (0, k.jsx)(j, {
5963
+ p.fromOverflow && /* @__PURE__ */ (0, A.jsx)(M, {
4737
5964
  "data-variant": "ghost",
4738
5965
  onClick: () => {
4739
- h(void 0), p({
5966
+ g(void 0), m({
4740
5967
  kind: "overflow",
4741
- anchor: f.anchor
5968
+ anchor: p.anchor
4742
5969
  });
4743
5970
  },
4744
5971
  children: "All filters"
4745
5972
  }),
4746
- i.canLock && /* @__PURE__ */ (0, k.jsxs)(j, {
5973
+ a.canLock && /* @__PURE__ */ (0, A.jsxs)(M, {
4747
5974
  "data-variant": "ghost",
4748
- onClick: () => F(() => i.toggleLock(m.fieldKey)),
4749
- children: [/* @__PURE__ */ (0, k.jsx)(x, { name: i.isLocked(m.fieldKey) ? "lock" : "unlock" }), i.isLocked(m.fieldKey) ? "Unlock field" : "Lock field"]
5975
+ onClick: () => I(() => a.toggleLock(h.fieldKey)),
5976
+ children: [/* @__PURE__ */ (0, A.jsx)(f, { name: a.isLocked(h.fieldKey) ? "lock" : "unlock" }), a.isLocked(h.fieldKey) ? "Unlock field" : "Lock field"]
4750
5977
  }),
4751
- /* @__PURE__ */ (0, k.jsx)("div", {
5978
+ /* @__PURE__ */ (0, A.jsx)("div", {
4752
5979
  className: "astrato-app-filter-bar__actions",
4753
- children: G ? /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [/* @__PURE__ */ (0, k.jsx)(j, {
5980
+ children: he ? /* @__PURE__ */ (0, A.jsxs)(A.Fragment, { children: [/* @__PURE__ */ (0, A.jsx)(M, {
4754
5981
  "data-variant": "ghost",
4755
- onClick: _e,
5982
+ onClick: ye,
4756
5983
  children: "Cancel"
4757
- }), /* @__PURE__ */ (0, k.jsxs)(j, {
5984
+ }), /* @__PURE__ */ (0, A.jsxs)(M, {
4758
5985
  "data-primary": "true",
4759
- disabled: !me,
5986
+ disabled: !ge,
5987
+ onClick: be,
5988
+ children: [/* @__PURE__ */ (0, A.jsx)(f, { name: "check" }), " Apply"]
5989
+ })] }) : /* @__PURE__ */ (0, A.jsx)(M, {
4760
5990
  onClick: ve,
4761
- children: [/* @__PURE__ */ (0, k.jsx)(x, { name: "check" }), " Apply"]
4762
- })] }) : /* @__PURE__ */ (0, k.jsx)(j, {
4763
- onClick: ge,
4764
5991
  children: "Done"
4765
5992
  })
4766
5993
  })
4767
5994
  ]
4768
5995
  })] })
4769
5996
  ]
4770
- }, `${f.kind}:${m?.fieldKey ?? ""}`)
5997
+ }, `${p.kind}:${h?.fieldKey ?? ""}`)
4771
5998
  ]
4772
5999
  }) : null;
4773
6000
  }
4774
- export { kn as AppFilterBar };
6001
+ export { Dr as AppFilterBar };