@astrato-io/visualizations 0.6.4 → 0.7.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 (220) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/README.md +32 -2
  3. package/THIRD_PARTY_NOTICES.md +68 -205
  4. package/VISUALIZATION_DEFINITIONS.md +68 -114
  5. package/chunks/Button-BrGKp9Nm.js +110 -0
  6. package/chunks/DefaultPropsProvider-BsfB7QTn.js +257 -0
  7. package/chunks/FieldTypeIcon-Drs6hSJF.js +22 -0
  8. package/chunks/{LinearProgress-CUZ0D8_t.js → LinearProgress-VtfFx2vJ.js} +51 -51
  9. package/chunks/MenuOption-ByRqhRdX.js +3934 -0
  10. package/chunks/Title-CO5dP1ma.js +1691 -0
  11. package/chunks/ToggleButton-KOBAimC1.js +112 -0
  12. package/chunks/app-filter-bar.compiler-TwVTeoj5.js +64 -0
  13. package/chunks/bar.compiler-DuQg8EUb.js +374 -0
  14. package/chunks/builder-DEDvNq1k.js +201 -0
  15. package/chunks/{color-settings-ZIvgNTq1.js → color-rules-CN7TcGrC.js} +2 -6
  16. package/chunks/color-settings-3VRlf_Vw.js +6 -0
  17. package/chunks/colorManipulator-D8Pjy1pf.js +45 -0
  18. package/chunks/coloring-CncX_JRX.js +278 -0
  19. package/chunks/{src-BC7cGcJ-.js → definitions-BPJQTx16.js} +650 -464
  20. package/chunks/{escobar-BGqT1EsE.js → escobar-DRhRMYRE.js} +6282 -4931
  21. package/chunks/event-bus-CrLB-Y8z.js +3 -0
  22. package/chunks/extend-preset-CUFNpmPe.js +4398 -0
  23. package/chunks/filter.compiler-w27dlv0C.js +70 -0
  24. package/chunks/filtering-cc7WqWpg.js +1153 -0
  25. package/chunks/handlers-TOT-7INo.js +12871 -0
  26. package/chunks/icon-picker-styles-CoJmwTRi.js +2246 -0
  27. package/chunks/isEqual-B8loyPsC.js +12 -0
  28. package/chunks/label-format-type-weq1XfcX.js +8 -0
  29. package/chunks/line.compiler-Ct1WhN2p.js +198 -0
  30. package/chunks/logger-DpQtYQnX.js +1163 -0
  31. package/chunks/lookup-BWllin0q.js +36 -0
  32. package/chunks/{metadata-CPXdYoln.js → metadata-WABZrt7Y.js} +1 -1
  33. package/chunks/number.compiler-D8TPly-4.js +53 -0
  34. package/chunks/{src-C0LgoUWY.js → operations-Dh4v1Ovt.js} +7716 -7541
  35. package/chunks/{range-DrzdfBX4.js → range-Bi-7zT0k.js} +2 -2
  36. package/chunks/registry-KervaxqJ.js +31 -0
  37. package/chunks/render-wrappers-OEmtaM8g.js +2 -0
  38. package/chunks/{registry-CExpGJ1N.js → requirements-PAoRaJyb.js} +294 -326
  39. package/chunks/responsive.styles-DSiOGD7u.js +82 -0
  40. package/chunks/shared-Bn4N5QcZ.js +1218 -0
  41. package/chunks/src-77e3mC7i.js +391 -0
  42. package/chunks/standalone-B55oyW6c.js +689 -0
  43. package/chunks/{standalone-CY57qwZ-.js → standalone-BDhPQtzQ.js} +386 -352
  44. package/chunks/{standalone-BDCwI6Hn.js → standalone-BGkmozIb.js} +1108 -953
  45. package/chunks/standalone-BMTCb10X.js +179 -0
  46. package/chunks/standalone-BXKRE_Se.js +468 -0
  47. package/chunks/standalone-Bes8srx1.js +354 -0
  48. package/chunks/standalone-BjZp0QMe.js +2 -0
  49. package/chunks/{standalone-BH5NqDwp.js → standalone-BlMIwpEe.js} +687 -573
  50. package/chunks/{standalone-CCNtaJ7s.js → standalone-C8ZAEutO.js} +44 -43
  51. package/chunks/standalone-C8qAelL4.js +2 -0
  52. package/chunks/standalone-CJvIXsQE.js +743 -0
  53. package/chunks/standalone-CLmGb7nn2.js +355 -0
  54. package/chunks/{ui-D1HQNIBy.js → standalone-CM5XcAN5.js} +15946 -17658
  55. package/chunks/standalone-CXNP6-xD.js +420 -0
  56. package/chunks/{standalone-BYm1UjLr.js → standalone-D5Q5ngsD.js} +59 -57
  57. package/chunks/standalone-DLlyRIE6.js +287 -0
  58. package/chunks/standalone-DMcI1afI.js +396 -0
  59. package/chunks/{standalone-jiz0L2Dg.js → standalone-DN4S1MjT.js} +1113 -1094
  60. package/chunks/{standalone-QJ1kKMnO.js → standalone-DT0wKji7.js} +2 -2
  61. package/chunks/{standalone-D5vnf-9y.js → standalone-DVTJwsTY.js} +1110 -1035
  62. package/chunks/standalone-DW6NT205.js +518 -0
  63. package/chunks/standalone-DYQIQH4c.js +2095 -0
  64. package/chunks/standalone-D__XCp-h.js +1003 -0
  65. package/chunks/standalone-XTgSsTAa.js +354 -0
  66. package/chunks/standalone-XuGksArp.js +68 -0
  67. package/chunks/{standalone-CNyNHKVx.js → standalone-we5D5MIn.js} +176 -172
  68. package/chunks/table.compiler-DMeeHxb6.js +222 -0
  69. package/chunks/useFieldName-Cjn9KCVp.js +7 -0
  70. package/chunks/useSlotProps-DLbQp4lc.js +166 -0
  71. package/chunks/{utils-Ba9T0TqC.js → utils-vdmi_2PK.js} +6266 -6517
  72. package/chunks/{src-DvX5LU9T.js → view-BuwQugKb.js} +2893 -5956
  73. package/chunks/visualization-filters-Cc4KU-l-.js +7455 -0
  74. package/chunks/web-components-DqClFkgO.js +1185 -0
  75. package/chunks/with-html-element-D0uY2zjI.js +7328 -0
  76. package/definitions.js +3 -3
  77. package/docs/operations/astrato-app-filter-bar.md +17 -17
  78. package/docs/operations/bar.md +1006 -1071
  79. package/docs/operations/combo.md +717 -738
  80. package/docs/operations/date-picker.md +27 -27
  81. package/docs/operations/distribution-gauge.md +471 -607
  82. package/docs/operations/dot.md +787 -879
  83. package/docs/operations/filter.md +139 -163
  84. package/docs/operations/gauge.md +491 -627
  85. package/docs/operations/heatMap.md +834 -916
  86. package/docs/operations/histogram.md +166 -180
  87. package/docs/operations/iframe.md +5 -5
  88. package/docs/operations/image.md +16 -16
  89. package/docs/operations/index.md +12 -12
  90. package/docs/operations/line.md +811 -888
  91. package/docs/operations/number.md +470 -536
  92. package/docs/operations/pie.md +825 -958
  93. package/docs/operations/radar.md +599 -679
  94. package/docs/operations/sankey.md +462 -584
  95. package/docs/operations/scatter.md +823 -929
  96. package/docs/operations/shape.md +34 -34
  97. package/docs/operations/simpleTextObject.md +18 -25
  98. package/docs/operations/slider.md +33 -43
  99. package/docs/operations/table.md +1177 -1150
  100. package/docs/operations/tree.md +404 -397
  101. package/docs/operations/treemap.md +595 -673
  102. package/docs/operations/waterfall.md +369 -379
  103. package/docs/operations/word-cloud.md +512 -583
  104. package/getters.js +7 -7
  105. package/index.js +3 -1183
  106. package/metadata.js +18 -18
  107. package/operations.js +13 -13
  108. package/package.json +133 -88
  109. package/render.js +10 -0
  110. package/src/charts/bar.d.ts +1 -0
  111. package/src/charts/combo.d.ts +1 -0
  112. package/src/charts/dot.d.ts +1 -0
  113. package/src/charts/gauge-distribution.d.ts +1 -0
  114. package/src/charts/gauge.d.ts +1 -0
  115. package/src/charts/heat-map.d.ts +1 -0
  116. package/src/charts/histogram.d.ts +1 -0
  117. package/src/charts/line.d.ts +1 -0
  118. package/src/charts/pie.d.ts +1 -0
  119. package/src/charts/radar.d.ts +1 -0
  120. package/src/charts/sankey.d.ts +1 -0
  121. package/src/charts/scatter.d.ts +1 -0
  122. package/src/charts/table.d.ts +1 -0
  123. package/src/charts/tree.d.ts +1 -0
  124. package/src/charts/treemap.d.ts +1 -0
  125. package/src/charts/waterfall.d.ts +1 -0
  126. package/src/charts/word-cloud.d.ts +1 -0
  127. package/src/definitions/index.d.ts +2 -2
  128. package/src/definitions/{shared/lib → model/definitions}/available-fields.d.ts +0 -1
  129. package/src/definitions/{shared/lib/compilers/index.d.ts → model/definitions/compilers/compile.d.ts} +1 -1
  130. package/src/definitions/model/definitions/data-item-resolution.d.ts +19 -0
  131. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1364 -0
  132. package/src/definitions/model/definitions/descriptors/json-schema.d.ts +2 -0
  133. package/src/definitions/model/definitions/diagnostics.d.ts +5 -0
  134. package/src/definitions/model/definitions/field-suggestions.d.ts +2 -0
  135. package/src/definitions/model/definitions/index.d.ts +23 -0
  136. package/src/definitions/{shared/lib → model/definitions}/registry/compile.d.ts +1 -1
  137. package/src/definitions/model/definitions/registry/descriptor-registry.d.ts +3 -0
  138. package/src/definitions/model/definitions/schema-registry.d.ts +660 -0
  139. package/src/definitions/{shared/lib → model/definitions}/schemas/broad-chart.schema.d.ts +1 -1
  140. package/src/definitions/{shared/lib → model/definitions}/schemas/common.schema.d.ts +0 -1
  141. package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
  142. package/src/definitions/{shared/lib → model/definitions}/schemas/object.schema.d.ts +8 -8
  143. package/src/definitions/{shared/lib → model/definitions}/types/compilation.types.d.ts +10 -0
  144. package/src/definitions/{shared/lib → model/definitions}/types/definition.types.d.ts +1 -1
  145. package/src/definitions/model/definitions/types/index.d.ts +3 -0
  146. package/src/definitions/{shared/lib/registry → model/definitions}/validation.d.ts +1 -1
  147. package/src/getters/index.d.ts +3 -3
  148. package/src/index.d.ts +1 -1
  149. package/src/objects/app-filter-bar.d.ts +1 -0
  150. package/src/objects/date-picker.d.ts +1 -0
  151. package/src/objects/filter.d.ts +1 -0
  152. package/src/objects/iframe.d.ts +1 -0
  153. package/src/objects/image.d.ts +1 -0
  154. package/src/objects/number.d.ts +1 -0
  155. package/src/objects/shape.d.ts +1 -0
  156. package/src/objects/slider.d.ts +1 -0
  157. package/src/objects/text.d.ts +1 -0
  158. package/src/operations/index.d.ts +3 -3
  159. package/src/registry/create-visualization-registry.d.ts +5 -0
  160. package/src/render/index.d.ts +34 -0
  161. package/src/runtime/index.d.ts +2 -2
  162. package/src/types.d.ts +9 -4
  163. package/src/web-components/index.d.ts +3 -3
  164. package/chunks/Radio-Ciu-F4CU.js +0 -957
  165. package/chunks/ToggleButton-BCJc3Jlc.js +0 -153
  166. package/chunks/_baseFlatten-DPXPOrea.js +0 -7076
  167. package/chunks/app-filter-bar.compiler-j_CVoWTa.js +0 -55
  168. package/chunks/bar.compiler-oqaPzIut.js +0 -370
  169. package/chunks/coloring-C16AUZEi.js +0 -663
  170. package/chunks/data-item-resolution-1lvYB5ln.js +0 -53
  171. package/chunks/event-bus-KiSiCJrC.js +0 -2683
  172. package/chunks/events-WZut5Ow6.js +0 -4
  173. package/chunks/filter.compiler-CuLtc_02.js +0 -60
  174. package/chunks/filtering-Yq4DEa0t.js +0 -953
  175. package/chunks/gauge-target-type-BkKXAqkX.js +0 -4
  176. package/chunks/grouping-type-BX_9Ix5q.js +0 -3
  177. package/chunks/interfaces-VUY4_yVO.js +0 -8742
  178. package/chunks/line-settings-DfYTUyPz.js +0 -4
  179. package/chunks/line.compiler-BpA_6Tc7.js +0 -188
  180. package/chunks/number.compiler-DbkWcG4S.js +0 -44
  181. package/chunks/pie-uv42Eqal.js +0 -10
  182. package/chunks/requirements-DNhuShLS.js +0 -6
  183. package/chunks/shared-CKDL4hx9.js +0 -1171
  184. package/chunks/src-Cum_2NLV.js +0 -12145
  185. package/chunks/src-Dun_jXtz.js +0 -10295
  186. package/chunks/standalone-87YV_m9n.js +0 -687
  187. package/chunks/standalone-BLVAWLNJ.js +0 -385
  188. package/chunks/standalone-BPomtAVs.js +0 -2
  189. package/chunks/standalone-BXyBcUOQ.js +0 -2
  190. package/chunks/standalone-BllF4rDp.js +0 -383
  191. package/chunks/standalone-BmfMt74U.js +0 -726
  192. package/chunks/standalone-BqWyrnZI.js +0 -281
  193. package/chunks/standalone-C85u7U6I.js +0 -340
  194. package/chunks/standalone-CDQnr6qT.js +0 -345
  195. package/chunks/standalone-CZynjFG7.js +0 -12979
  196. package/chunks/standalone-DFPva_ku.js +0 -299
  197. package/chunks/standalone-DQxxNwF8.js +0 -675
  198. package/chunks/standalone-DS9T0FZ-.js +0 -830
  199. package/chunks/standalone-Dx3MLlrO.js +0 -512
  200. package/chunks/standalone-DzixzZAL.js +0 -411
  201. package/chunks/standalone-lBm9hQ-q.js +0 -179
  202. package/chunks/standalone-rJ45Zfl1.js +0 -68
  203. package/chunks/table.compiler-BrXkm4Fz.js +0 -213
  204. package/chunks/toInteger-DVZr-D1j.js +0 -11
  205. package/chunks/treemap-x_zmJoG7.js +0 -23
  206. package/chunks/types-dVVCsDWD.js +0 -4
  207. package/chunks/useFieldName-oqQ3bvnO.js +0 -7
  208. package/chunks/view-CLqWMV7Z.js +0 -156
  209. package/src/definitions/shared/index.d.ts +0 -5
  210. package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +0 -587
  211. package/src/definitions/shared/lib/registry/index.d.ts +0 -3
  212. package/src/definitions/shared/lib/schemas/index.d.ts +0 -9
  213. package/src/definitions/shared/lib/types/index.d.ts +0 -3
  214. package/src/definitions/{shared/lib → model/definitions}/schemas/app-filter-bar.schema.d.ts +0 -0
  215. package/src/definitions/{shared/lib → model/definitions}/schemas/bar.schema.d.ts +0 -0
  216. package/src/definitions/{shared/lib → model/definitions}/schemas/filter.schema.d.ts +0 -0
  217. package/src/definitions/{shared/lib → model/definitions}/schemas/line.schema.d.ts +0 -0
  218. package/src/definitions/{shared/lib → model/definitions}/schemas/number.schema.d.ts +0 -0
  219. package/src/definitions/{shared/lib → model/definitions}/schemas/table.schema.d.ts +4 -4
  220. /package/src/definitions/{shared/lib → model/definitions}/types/descriptor.types.d.ts +0 -0
@@ -0,0 +1,1153 @@
1
+ import { o as e, t } from "./rolldown-runtime-DleVn1XH.js";
2
+ import { Cr as n, D as r, Ei as i, Fi as a, Hi as o, Hn as s, Pi as c, St as l, _t as u, ar as d, da as f, hn as p, un as m, uo as h, ut as g, vt as _, zi as v } from "./visualization-filters-Cc4KU-l-.js";
3
+ import { $r as y, An as b, Ei as x, G as S, Qr as C, Si as w, Ti as T, W as E, Yr as D, d as O, fn as k, it as A, qr as j, ri as M, tr as N, ur as P, ut as ee, wi as te } from "./utils-vdmi_2PK.js";
4
+ import { s as ne } from "./logger-DpQtYQnX.js";
5
+ import { r as F, s as I, u as re } from "./MenuOption-ByRqhRdX.js";
6
+ import { t as ie } from "./LinearProgress-VtfFx2vJ.js";
7
+ import { d as L, f as R, l as z, u as B } from "./responsive.styles-DSiOGD7u.js";
8
+ var V = (e, t, n) => Math.ceil(t) + Math.ceil(n) >= Math.floor(e) && n > 0;
9
+ function ae(e) {
10
+ let { theme: t, name: n, props: r } = e;
11
+ return !t || !t.components || !t.components[n] || !t.components[n].defaultProps ? r : A(t.components[n].defaultProps, r);
12
+ }
13
+ function oe({ props: e, name: t, defaultTheme: n, themeId: r }) {
14
+ let i = ee(n);
15
+ return r && (i = i[r] || i), ae({
16
+ theme: i,
17
+ name: t,
18
+ props: e
19
+ });
20
+ }
21
+ var se = /* @__PURE__ */ t(((e, t) => {
22
+ var n = r(), i = u();
23
+ function a(e, t) {
24
+ return e && n(e, t, i);
25
+ }
26
+ t.exports = a;
27
+ })), ce = /* @__PURE__ */ t(((e, t) => {
28
+ var n = _();
29
+ function r(e, t) {
30
+ return function(r, i) {
31
+ if (r == null) return r;
32
+ if (!n(r)) return e(r, i);
33
+ for (var a = r.length, o = t ? a : -1, s = Object(r); (t ? o-- : ++o < a) && i(s[o], o, s) !== !1;);
34
+ return r;
35
+ };
36
+ }
37
+ t.exports = r;
38
+ })), le = /* @__PURE__ */ t(((e, t) => {
39
+ var n = se();
40
+ t.exports = ce()(n);
41
+ })), H = ne(), U = /* @__PURE__ */ e(x()), W = M(), ue = ({ r: e, g: t, b: n, a: r }) => `rgba(${e},${t},${n},${r ?? 1})`, de = (e) => {
42
+ let [t, n, r, i] = e.replace("rgba(", "").replace("rgb(", "").replace(")", "").replaceAll(" ", "").split(",").map((e) => +e);
43
+ return {
44
+ r: t,
45
+ g: n,
46
+ b: r,
47
+ a: i ?? 1
48
+ };
49
+ }, G = (e, t = !0) => /^#([0-9a-f]{3}){1,2}$/i.test(String(e)) || t && /^#([0-9a-f]{4}){1,2}$/i.test(String(e)), K = (e = "") => e.length < 7 ? e.split("").map((e) => e === "#" ? e : e + e).join("") : e, fe = (e) => {
50
+ let t = K(e);
51
+ return {
52
+ r: parseInt(t.slice(1, 3), 16),
53
+ g: parseInt(t.slice(3, 5), 16),
54
+ b: parseInt(t.slice(5, 7), 16),
55
+ a: pe(t)
56
+ };
57
+ }, pe = (e) => {
58
+ if (!e) return 1;
59
+ if (typeof e == "string") {
60
+ if (G(e)) {
61
+ let t = K(e);
62
+ return t.length === 7 ? 1 : Math.round(parseInt(t.slice(-2), 16) / 255 * 100) / 100;
63
+ }
64
+ let [, , , t] = e.substring(5, e.length - 1).replaceAll(" ", "").split(",");
65
+ return Number(t) || 1;
66
+ }
67
+ return e.a ?? 1;
68
+ }, me = /* @__PURE__ */ t(((e, t) => {
69
+ function n(e, t, n, r) {
70
+ for (var i = -1, a = e == null ? 0 : e.length; ++i < a;) {
71
+ var o = e[i];
72
+ t(r, o, n(o), e);
73
+ }
74
+ return r;
75
+ }
76
+ t.exports = n;
77
+ })), he = /* @__PURE__ */ t(((e, t) => {
78
+ var n = le();
79
+ function r(e, t, r, i) {
80
+ return n(e, function(e, n, a) {
81
+ t(i, e, r(e), a);
82
+ }), i;
83
+ }
84
+ t.exports = r;
85
+ })), ge = /* @__PURE__ */ t(((e, t) => {
86
+ var n = me(), r = he(), i = g(), a = l();
87
+ function o(e, t) {
88
+ return function(o, s) {
89
+ var c = a(o) ? n : r, l = t ? t() : {};
90
+ return c(o, e, i(s, 2), l);
91
+ };
92
+ }
93
+ t.exports = o;
94
+ })), _e = /* @__PURE__ */ t(((e, t) => {
95
+ t.exports = ge()(function(e, t, n) {
96
+ e[+!n].push(t);
97
+ }, function() {
98
+ return [[], []];
99
+ });
100
+ })), q = (e, t) => t && !d(t) ? String(k(t, e)) : e === !0 ? "True" : e === !1 ? "False" : e === null ? "-" : String(e), ve = /* @__PURE__ */ e(_e()), ye = (e, t) => {
101
+ let [n, r] = (0, ve.default)(e, (e) => t.indexOf(e.dimension) !== -1);
102
+ return [n, r];
103
+ }, be = (e) => {
104
+ let t = e?.dimensions.filter((e) => e.role === f.FILTER_DIMENSION);
105
+ return [(t?.length ? t : e?.dimensions.slice(0, 1) ?? []).map(xe).join(" - ") || "Sample", e?.measures[0] && e?.filterSettings?.showMeasureLabel ? ` | ${xe(e?.measures[0])}` : null];
106
+ };
107
+ function xe(e) {
108
+ return p(e) || e.label || e.dataItem?.name || "";
109
+ }
110
+ var Se = (e) => async (t) => {
111
+ t.preventDefault(), t.stopPropagation(), e((t.clipboardData.getData("Text") || await navigator.clipboard.readText()).replaceAll("\r\n", " ").replaceAll("\r", " ").replaceAll("\n", " "));
112
+ }, Ce = (e) => {
113
+ if (!e.length) return [];
114
+ if (e.length === 1) return [e[0], e[0]];
115
+ let t = Infinity, n = -Infinity;
116
+ return e.forEach((e) => {
117
+ t > e && (t = e), n < e && (n = e);
118
+ }), [t, n];
119
+ }, we = n("getToRangeSelectionHandler", "#cbacba"), Te = (e, t) => async () => {
120
+ let n = e.selection.getActiveSelection(H.FilterType.VALUE), r = structuredClone(n), i = r.applied.find((e) => e.field.name === t.name && e.field.view === t.view);
121
+ if (i ||= r.pending.find((e) => e.field.name === t.name && e.field.view === t.view), !i) {
122
+ let n = H.FilterOperator.Between;
123
+ r.pending.push({
124
+ operator: n,
125
+ field: w(e.engine, t),
126
+ values: []
127
+ }), e.selection.setNewSelectionState(r);
128
+ return;
129
+ }
130
+ if (i.operator = i.operator === H.FilterOperator.InList ? H.FilterOperator.Between : H.FilterOperator.NotBetween, (i.values ?? []).length === 0) {
131
+ e.selection.declineSelection(i), e.selection.removeSelection(i);
132
+ let n = {
133
+ dimensions: [],
134
+ measures: [{
135
+ fieldKeys: [t.key],
136
+ aggregation: "MIN",
137
+ filters: []
138
+ }, {
139
+ fieldKeys: [t.key],
140
+ aggregation: "MAX",
141
+ filters: []
142
+ }]
143
+ }, a = e.engine;
144
+ if (!a) {
145
+ we.error("There is no data engine available");
146
+ return;
147
+ }
148
+ let { data: o } = await a.getData(n), s = typeof o[0][0] == "number" ? o[0][0] : null, c = typeof o[0][1] == "number" ? o[0][1] : null;
149
+ if (s === null || c === null) {
150
+ we.error("There is something wrong with the min/max data");
151
+ return;
152
+ }
153
+ return i.values = [s, c], e.selection.setNewSelectionState(r, H.FilterType.VALUE), i.operator;
154
+ }
155
+ return i.values = Ce(i.values), e.selection.setNewSelectionState(r, H.FilterType.VALUE), i.operator;
156
+ }, J = n("getToValueSelectionHandler", "#cbacba"), Ee = m(s()), De = (e, t, n, r, i) => async () => {
157
+ let a = n ?? Ee, o = e.selection.getActiveSelection(H.FilterType.VALUE), s = structuredClone(o), c = s.pending.find((e) => e.field.name === t.name && e.field.view === t.view);
158
+ if (c ||= s.applied.find((e) => e.field.name === t.name && e.field.view === t.view), !c) {
159
+ J.warn("There was no selection connected to clicked field!", JSON.stringify(t));
160
+ return;
161
+ }
162
+ if (r) return c.operator = H.FilterOperator.InList, c.values = [], delete c.dynamicDateRange, delete c.dynamicDateCalcRange, e.selection.setNewSelectionState(s, H.FilterType.VALUE), c.operator;
163
+ if ([H.FilterOperator.InList, H.FilterOperator.NotInList].includes(c.operator)) return c.operator;
164
+ if ([H.FilterOperator.Like, H.FilterOperator.NotLike].includes(c.operator)) {
165
+ let n = c.values;
166
+ if (c.operator = c.operator === H.FilterOperator.Like ? H.FilterOperator.InList : H.FilterOperator.NotInList, n?.length) {
167
+ let r = {
168
+ dimensions: [{ fieldKey: t.key }],
169
+ limit: a + 1,
170
+ measures: [],
171
+ filters: [{
172
+ fieldKey: t.key,
173
+ operator: H.FilterOperator.Like,
174
+ values: n
175
+ }]
176
+ }, o = e.engine;
177
+ if (!o) {
178
+ J.error("There is no data engine available");
179
+ return;
180
+ }
181
+ let { data: l, meta: u } = await o.getData(r);
182
+ if (u.rows >= a + 1) return c.values = [], e.selection.setNewSelectionState(s, H.FilterType.VALUE), i?.(c.operator, String(n[0] ?? "")), c.operator;
183
+ c.values = Object.values(l).flat();
184
+ }
185
+ return e.selection.setNewSelectionState(s, H.FilterType.VALUE), c.operator;
186
+ }
187
+ c.operator = c.operator === H.FilterOperator.Between ? H.FilterOperator.InList : H.FilterOperator.NotInList;
188
+ let l = {
189
+ dimensions: [{ fieldKey: t.key }],
190
+ limit: a,
191
+ measures: [],
192
+ filters: []
193
+ };
194
+ c.values && (l.filters?.push({
195
+ fieldKey: t.key,
196
+ operator: H.FilterOperator.Between,
197
+ values: c.values
198
+ }), l.limit = a + 1);
199
+ let u = e.engine;
200
+ if (!u) {
201
+ J.error("There is no data engine available");
202
+ return;
203
+ }
204
+ let { data: d, meta: f } = await u.getData(l);
205
+ return f.rows >= a + 1 ? (e.daedalus.emitEvent(H.AstratoEvents.SHOW_GLOBAL_NOTIFICATION, {
206
+ type: "warn",
207
+ message: "Cannot change the selection type, because too many values would have to be selected!"
208
+ }), c.operator) : (c.values = Object.values(d).flat(), e.selection.setNewSelectionState(s, H.FilterType.VALUE), c.operator);
209
+ }, Oe = (e, t) => (n) => {
210
+ let r = e.selection.getActiveSelection(H.FilterType.VALUE), i = structuredClone(r), a = n?.trim() ? [n.trim()] : [""], o = i.applied.find((e) => e.field.name === t.name && e.field.view === t.view);
211
+ if (o ||= i.pending.find((e) => e.field.name === t.name && e.field.view === t.view), !o) {
212
+ let n = H.FilterOperator.Like;
213
+ return i.pending.push({
214
+ operator: n,
215
+ field: w(e.engine, t),
216
+ values: a
217
+ }), e.selection.setNewSelectionState(i), n;
218
+ }
219
+ return o.operator === H.FilterOperator.InList ? (o.operator = H.FilterOperator.Like, o.values = a) : o.operator === H.FilterOperator.NotInList ? (o.operator = H.FilterOperator.NotLike, o.values = a) : (o.operator = o.operator === H.FilterOperator.NotLike ? H.FilterOperator.NotLike : H.FilterOperator.Like, o.values = a.length ? a : o.values), e.selection.setNewSelectionState(i, H.FilterType.VALUE), o.operator;
220
+ }, Y = (e, t) => ({
221
+ fontFamily: a(t, e?.fontFamily) ?? void 0,
222
+ fontStyle: e?.italic ? "italic" : "normal",
223
+ fontWeight: e?.bold ? "bold" : "normal",
224
+ textDecoration: `${e?.underlined ? "underline" : ""} ${e?.strikethrough ? "line-through" : ""}`,
225
+ color: c(t, e?.fontColor)
226
+ }), ke = (e) => e === h.Line ? "solid" : "dashed", X = (e, t) => {
227
+ let { backgroundColor: n, borderColor: r, borderEnabled: a, borderRadius: o, borderStyle: s, borderWidth: c } = {
228
+ ...i,
229
+ ...e
230
+ }, l = "0px";
231
+ return a && (l = `${o}px`, t && (l = `${o}px ${o}px 0 0`)), {
232
+ backgroundColor: n,
233
+ border: a ? `${c}px ${ke(s)} ${r}` : "none",
234
+ borderRadius: l
235
+ };
236
+ };
237
+ function Ae(e) {
238
+ return {
239
+ boxSizing: "border-box",
240
+ alignItems: "center",
241
+ cursor: "pointer",
242
+ height: 24,
243
+ padding: "3px 6px",
244
+ border: `1px solid ${o.grey4}`,
245
+ borderRadius: 16,
246
+ display: "flex",
247
+ marginRight: 4,
248
+ flexShrink: 0,
249
+ backgroundColor: o.mainBrightPink,
250
+ color: o.white,
251
+ ...T.bold11,
252
+ ...T.overflowEllipsis,
253
+ "&:hover": { borderColor: o.grey2 },
254
+ ...e && {
255
+ [R.md]: {
256
+ height: 20,
257
+ padding: "2px 6px",
258
+ ...T.bold10
259
+ },
260
+ [R.sm]: {
261
+ height: 16,
262
+ padding: "1px 4px",
263
+ ...T.normal10
264
+ },
265
+ [R.xs]: {
266
+ height: 12,
267
+ padding: "0px 4px",
268
+ fontSize: 8,
269
+ lineHeight: "10px"
270
+ }
271
+ }
272
+ };
273
+ }
274
+ var Z = (0, U.createContext)({});
275
+ U.forwardRef(function(e, t) {
276
+ return U.createElement("img", {
277
+ ...e,
278
+ ref: t,
279
+ src: "data:image/svg+xml,%3Csvg%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M28.2534%2028.2533L27.2134%2027.2133L24.0001%2024L17.8801%2017.88L4.78677%204.78666L3.74677%203.74666C3.22677%203.22666%202.38677%203.22666%201.86677%203.74666C1.33344%204.26666%201.33344%205.10666%201.85344%205.62666L4.0001%207.77333V25.3333C4.0001%2026.8%205.2001%2028%206.66677%2028H24.2268L26.3734%2030.1467C26.8934%2030.6667%2027.7334%2030.6667%2028.2534%2030.1467C28.7734%2029.6267%2028.7734%2028.7733%2028.2534%2028.2533ZM8.02677%2024C7.46677%2024%207.1601%2023.36%207.50677%2022.92L10.8268%2018.6533C11.0934%2018.32%2011.6001%2018.3067%2011.8668%2018.64L14.6668%2022.0133L16.2268%2020L20.2268%2024H8.02677ZM28.0001%2024.2267L7.77344%203.99999H25.3334C26.8001%203.99999%2028.0001%205.19999%2028.0001%206.66666V24.2267Z%22%20fill%3D%22%23BDBDBD%22%2F%3E%0A%3C%2Fsvg%3E%0A"
280
+ });
281
+ });
282
+ var je = (e, t) => typeof e == "number" && typeof t == "number" ? e / t : 0, Me = (e, t, n, r, i, a) => {
283
+ let o = "";
284
+ if (e) {
285
+ t && (o += `${t}: `);
286
+ let r = q(e, n);
287
+ o += r;
288
+ }
289
+ if (r) {
290
+ e && (o += " | "), i && (o += `${i}: `);
291
+ let t = q(r, a);
292
+ o += t;
293
+ }
294
+ return o;
295
+ }, Ne = E({ iconContainer: {
296
+ width: 16,
297
+ flexShrink: 0
298
+ } }), Pe = ({ disabled: e, isApplied: t, isSelected: n, isNot: r, fontColor: i }) => {
299
+ let a = Ne(), s = i ?? (t ? o.mainDarkNavy : void 0);
300
+ return /* @__PURE__ */ (0, W.jsxs)("div", {
301
+ className: a.iconContainer,
302
+ style: { opacity: e ? .25 : void 0 },
303
+ children: [n && r ? /* @__PURE__ */ (0, W.jsx)(j, { fill: o.mainBrightPink }) : null, n && !r ? /* @__PURE__ */ (0, W.jsx)(y, { fill: s }) : null]
304
+ });
305
+ }, Fe = (e) => {
306
+ let { r: t, g: n, b: r, a: i } = G(e) ? fe(e) : de(e), a = (i ?? 1) * .6;
307
+ return ue({
308
+ r: t,
309
+ g: n,
310
+ b: r,
311
+ a: a < 0 ? 0 : a
312
+ });
313
+ }, Ie = E({
314
+ progressBar: {
315
+ height: "100%",
316
+ borderRadius: "4px",
317
+ position: "absolute",
318
+ bottom: 1,
319
+ top: 1
320
+ },
321
+ progressBarSelectedOrApplied: { color: o.mainDarkNavy },
322
+ labelsContainer: {
323
+ display: "flex",
324
+ flexDirection: "row",
325
+ justifyContent: "space-between",
326
+ alignItems: "center",
327
+ width: "100%",
328
+ height: "100%",
329
+ overflow: "hidden",
330
+ position: "relative",
331
+ "&:hover": {
332
+ color: o.mainDarkNavy,
333
+ "& > div": { backgroundColor: o.grey5 }
334
+ }
335
+ },
336
+ label: ({ responsive: e, fontSize: t }) => ({
337
+ ...T.normal11,
338
+ ...T.overflowEllipsis,
339
+ color: "inherit",
340
+ marginRight: "5px",
341
+ height: "100%",
342
+ zIndex: 1,
343
+ display: "inline-flex",
344
+ alignItems: "center",
345
+ ...t ? {
346
+ fontSize: `${t}px`,
347
+ lineHeight: 1.2,
348
+ ...e && {
349
+ [R.md]: { fontSize: `min(${t * z.md}px, 14px)` },
350
+ [R.sm]: { fontSize: `min(${t * z.sm}px, 12px)` },
351
+ [R.xs]: {
352
+ fontSize: `min(${t * z.xs}px, 10px)`,
353
+ fontWeight: "normal !important"
354
+ }
355
+ }
356
+ } : B(e)
357
+ }),
358
+ dimensionLabel: {
359
+ paddingLeft: 4,
360
+ flexGrow: 1,
361
+ flexShrink: 0
362
+ },
363
+ measuresLabel: {
364
+ flexGrow: 0,
365
+ flexShrink: 1
366
+ },
367
+ rowDisabled: { color: o.grey3 }
368
+ }), Le = ({ dimensionDisplayValue: e, measuresLabel: t, showLabelProgress: n, isSelected: r, isApplied: i, strikethrough: a, disabled: s, searchTerm: c, barWidth: l, fontStyle: u, progressColor: d = o.lightBlue, textAlign: f, responsive: p, fontSize: m }) => {
369
+ let h = Ie({
370
+ responsive: p,
371
+ fontSize: m
372
+ }), g = S()?.astrato ?? v, _ = {
373
+ ...Y({
374
+ ...u,
375
+ strikethrough: u?.strikethrough || a
376
+ }, g),
377
+ ...f ? {
378
+ textAlign: f,
379
+ justifyContent: f === "right" ? "flex-end" : f === "center" ? "center" : "flex-start"
380
+ } : {}
381
+ }, y = r || i ? d : Fe(d);
382
+ return /* @__PURE__ */ (0, W.jsxs)("div", {
383
+ className: b({
384
+ [h.labelsContainer]: !0,
385
+ [h.progressBarSelectedOrApplied]: r || i
386
+ }),
387
+ children: [
388
+ n && /* @__PURE__ */ (0, W.jsx)("div", {
389
+ style: {
390
+ width: `${l * 100}%`,
391
+ backgroundColor: y
392
+ },
393
+ className: b({
394
+ [h.progressBar]: !0,
395
+ [h.rowDisabled]: s
396
+ }),
397
+ "data-testid": "item-list-label-progress"
398
+ }),
399
+ /* @__PURE__ */ (0, W.jsx)("span", {
400
+ style: _,
401
+ className: b(h.label, h.dimensionLabel),
402
+ title: e,
403
+ children: /* @__PURE__ */ (0, W.jsx)(F, {
404
+ phrase: c ?? "",
405
+ children: e ?? ""
406
+ })
407
+ }),
408
+ /* @__PURE__ */ (0, W.jsx)("span", {
409
+ style: _,
410
+ className: b(h.label, h.measuresLabel),
411
+ children: t
412
+ })
413
+ ]
414
+ });
415
+ }, Re = E({
416
+ rowWrapper: (e) => ({
417
+ cursor: "pointer",
418
+ userSelect: "none",
419
+ display: "flex",
420
+ flexDirection: "row",
421
+ alignItems: "center",
422
+ height: "32px",
423
+ boxSizing: "border-box",
424
+ borderRadius: 6,
425
+ paddingRight: 8,
426
+ ...e && {
427
+ [R.md]: {
428
+ height: "24px",
429
+ paddingRight: 6
430
+ },
431
+ [R.sm]: {
432
+ height: "16px",
433
+ paddingRight: 4
434
+ },
435
+ [R.xs]: {
436
+ height: "12px",
437
+ paddingRight: 2
438
+ }
439
+ }
440
+ }),
441
+ checkboxWrapper: (e) => ({
442
+ display: "flex",
443
+ alignItems: "center",
444
+ flexShrink: 0,
445
+ marginRight: 6,
446
+ ...e && {
447
+ [R.md]: {
448
+ "& input[type=\"checkbox\"], & svg": {
449
+ width: "14px !important",
450
+ height: "14px !important"
451
+ },
452
+ "& > div, & > div > div": { height: "14px" }
453
+ },
454
+ [R.sm]: {
455
+ "& input[type=\"checkbox\"], & svg": {
456
+ width: "11px !important",
457
+ height: "11px !important"
458
+ },
459
+ "& > div, & > div > div": { height: "11px" }
460
+ },
461
+ [R.xs]: {
462
+ "& input[type=\"checkbox\"], & svg": {
463
+ width: "10px !important",
464
+ height: "10px !important"
465
+ },
466
+ "& > div, & > div > div": { height: "10px" }
467
+ }
468
+ }
469
+ }),
470
+ rowSelected: { backgroundColor: "var(--filter-hover-color)" },
471
+ rowHover: { "&:hover": { backgroundColor: "var(--filter-hover-color)" } },
472
+ rowApplied: {
473
+ backgroundColor: "initial",
474
+ "& > div > span": { color: `${o.mainDarkNavy} !important` }
475
+ },
476
+ rowDisabled: { "& span": { color: `${o.grey3} !important` } }
477
+ }), Q = ({ selected: e, applied: t, disabled: n, hoverColor: r, onSelect: i, showProgressBar: a, showCheckbox: s, showSelectionIcon: c = !0, checkboxState: l = "none", fontSize: u, searchTerm: d, doneRenderingCallback: f, dimensionValue: p, dimensionFormatter: m, imageValue: h, measure1Value: g, measure1Label: _, measure1Formatter: v, measure2Value: y, measure2Label: x, measure2Formatter: S, maxValue: C, imageFit: w, fontStyle: T, progressBarColor: E, responsive: D }) => {
478
+ let O = Re(D), k = (0, U.useContext)(Z), A = (k.pendingOperator ?? k.appliedOperator) === H.FilterOperator.NotInList, j = !!h, M = a && g !== void 0 && !y, N = q(p, m), P = Me(g, _, v, y, x, S);
479
+ return (0, U.useEffect)(() => {
480
+ j || f?.();
481
+ }, []), /* @__PURE__ */ (0, W.jsxs)("div", {
482
+ tabIndex: 0,
483
+ role: "button",
484
+ onClick: i,
485
+ "data-testid": `big-list-item-dimension-${p}`,
486
+ className: b({
487
+ [O.rowWrapper]: !0,
488
+ [O.rowHover]: !M,
489
+ [O.rowSelected]: !M && e,
490
+ [O.rowApplied]: t && !n,
491
+ [O.rowDisabled]: n
492
+ }),
493
+ style: { "--filter-hover-color": r ?? o.grey5 },
494
+ children: [
495
+ s ? /* @__PURE__ */ (0, W.jsx)("div", {
496
+ "aria-hidden": !0,
497
+ style: { pointerEvents: "none" },
498
+ className: O.checkboxWrapper,
499
+ children: /* @__PURE__ */ (0, W.jsx)(I, {
500
+ value: l,
501
+ onChange: () => void 0,
502
+ testId: `dimension-${p}-checkbox`
503
+ })
504
+ }) : null,
505
+ j && /* @__PURE__ */ (0, W.jsx)("img", {
506
+ alt: "",
507
+ width: 32,
508
+ height: 32,
509
+ src: h,
510
+ onError: (e) => {
511
+ e.currentTarget.src = "data:image/svg+xml,%3Csvg%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M28.2534%2028.2533L27.2134%2027.2133L24.0001%2024L17.8801%2017.88L4.78677%204.78666L3.74677%203.74666C3.22677%203.22666%202.38677%203.22666%201.86677%203.74666C1.33344%204.26666%201.33344%205.10666%201.85344%205.62666L4.0001%207.77333V25.3333C4.0001%2026.8%205.2001%2028%206.66677%2028H24.2268L26.3734%2030.1467C26.8934%2030.6667%2027.7334%2030.6667%2028.2534%2030.1467C28.7734%2029.6267%2028.7734%2028.7733%2028.2534%2028.2533ZM8.02677%2024C7.46677%2024%207.1601%2023.36%207.50677%2022.92L10.8268%2018.6533C11.0934%2018.32%2011.6001%2018.3067%2011.8668%2018.64L14.6668%2022.0133L16.2268%2020L20.2268%2024H8.02677ZM28.0001%2024.2267L7.77344%203.99999H25.3334C26.8001%203.99999%2028.0001%205.19999%2028.0001%206.66666V24.2267Z%22%20fill%3D%22%23BDBDBD%22%2F%3E%0A%3C%2Fsvg%3E%0A", f?.();
512
+ },
513
+ style: {
514
+ borderRadius: 6,
515
+ marginRight: 8,
516
+ objectFit: `${w ?? "contain"}`
517
+ },
518
+ "data-testid": `big-list-item-dimension-${p}-image`,
519
+ onLoad: f,
520
+ loading: "lazy"
521
+ }),
522
+ /* @__PURE__ */ (0, W.jsx)(Le, {
523
+ dimensionDisplayValue: N,
524
+ measuresLabel: P,
525
+ showLabelProgress: M,
526
+ progressColor: E,
527
+ isApplied: t,
528
+ isSelected: e,
529
+ strikethrough: A && t && e,
530
+ disabled: n,
531
+ searchTerm: d,
532
+ barWidth: je(g, C),
533
+ fontStyle: T,
534
+ responsive: D,
535
+ fontSize: u
536
+ }),
537
+ !s && c ? /* @__PURE__ */ (0, W.jsx)(Pe, {
538
+ disabled: n,
539
+ isApplied: t,
540
+ isSelected: e,
541
+ isNot: A,
542
+ fontColor: T?.fontColor ?? void 0
543
+ }) : null
544
+ ]
545
+ });
546
+ }, ze = (e) => {
547
+ let t = [...e].sort((e, t) => Be(e?.measure1 ?? void 0, t?.measure1 ?? void 0)), n = t.length > 0 ? t[0] : null;
548
+ return typeof n?.measure1 == "number" ? n : null;
549
+ }, Be = (e, t) => {
550
+ if (e && t) {
551
+ if (e < t) return 1;
552
+ if (e > t) return -1;
553
+ } else if (e && !t) return -1;
554
+ return 0;
555
+ }, Ve = ({ filterValues: e, onItemClick: t, selectedValues: n, appliedValues: r, searchTerm: i, vSpec: a, hoverColor: o }) => {
556
+ let s = (0, U.useRef)(e.length), c = O(), l = () => {
557
+ --s.current, s.current === 0 && c();
558
+ };
559
+ if (!a?.dimensions[0]?.dataItem) return null;
560
+ let u = a.dimensions[0]?.formatter, d = a.dimensions[1]?.imageFit, f = a.measures[0]?.formatter, p = a.measures[1]?.formatter, [m, h] = ye(e, r), g = (e, r) => {
561
+ switch (!0) {
562
+ case n.includes(e.dimension):
563
+ t(e.dimension);
564
+ break;
565
+ case e.disabled: break;
566
+ default: t(e.dimension, { shift: r.shiftKey ? [...m, ...h].reduce((e, t) => (t.disabled || e.push(t.dimension), e), []) : null });
567
+ }
568
+ }, _ = ze(e), v = s.current > 0 ? l : void 0;
569
+ return /* @__PURE__ */ (0, W.jsxs)(W.Fragment, { children: [m.map((e) => /* @__PURE__ */ (0, W.jsx)(Q, {
570
+ searchTerm: i,
571
+ disabled: !!e.disabled,
572
+ onSelect: (t) => g(e, t),
573
+ showProgressBar: a.filterSettings?.showProgressBar,
574
+ selected: n.indexOf(e.dimension) !== -1,
575
+ applied: !0,
576
+ hoverColor: o,
577
+ dimensionValue: e.dimension,
578
+ dimensionFormatter: u,
579
+ imageValue: e.image ?? void 0,
580
+ measure1Value: e.measure1,
581
+ measure1Label: a.measures[0]?.filterValueLabel,
582
+ measure1Formatter: f,
583
+ measure2Value: e.measure2,
584
+ measure2Label: a.measures[1]?.filterValueLabel,
585
+ measure2Formatter: p,
586
+ maxValue: _?.measure1,
587
+ imageFit: d,
588
+ doneRenderingCallback: v,
589
+ fontStyle: a.filterSettings?.fontStyle,
590
+ progressBarColor: a.filterSettings?.filterStyle?.progressBarColor,
591
+ responsive: a.filterSettings?.responsive
592
+ }, String(e.dimension))), h.map((e) => /* @__PURE__ */ (0, W.jsx)(Q, {
593
+ searchTerm: i,
594
+ disabled: !!e.disabled,
595
+ onSelect: (t) => g(e, t),
596
+ showProgressBar: a.filterSettings?.showProgressBar,
597
+ selected: n.indexOf(e.dimension) !== -1,
598
+ applied: !1,
599
+ hoverColor: o,
600
+ dimensionValue: e.dimension,
601
+ dimensionFormatter: u,
602
+ imageValue: e.image ?? void 0,
603
+ measure1Value: e.measure1,
604
+ measure1Label: a.measures[0]?.filterValueLabel,
605
+ measure1Formatter: f,
606
+ measure2Value: e.measure2,
607
+ measure2Label: a.measures[1]?.filterValueLabel,
608
+ measure2Formatter: p,
609
+ maxValue: _?.measure1,
610
+ imageFit: d,
611
+ doneRenderingCallback: v,
612
+ fontStyle: a.filterSettings?.fontStyle,
613
+ progressBarColor: a.filterSettings?.filterStyle?.progressBarColor,
614
+ responsive: a.filterSettings?.responsive
615
+ }, String(e.dimension)))] });
616
+ }, He = E({
617
+ rowWrapper: (e) => ({
618
+ userSelect: "none",
619
+ display: "flex",
620
+ flexDirection: "row",
621
+ alignItems: "center",
622
+ justifyContent: "space-between",
623
+ boxSizing: "border-box",
624
+ height: 28,
625
+ padding: 4,
626
+ borderRadius: 5,
627
+ ...e && {
628
+ [R.md]: { height: 24 },
629
+ [R.sm]: {
630
+ height: 20,
631
+ padding: "2px 4px"
632
+ },
633
+ [R.xs]: {
634
+ height: 16,
635
+ padding: "1px 4px"
636
+ }
637
+ },
638
+ "& > span": {
639
+ flexShrink: 0,
640
+ maxWidth: "100%",
641
+ ...T.overflowEllipsis
642
+ }
643
+ }),
644
+ rowWrapperClickable: {
645
+ "&:hover": { backgroundColor: "var(--filter-hover-color)" },
646
+ cursor: "pointer"
647
+ },
648
+ rowWrapperStartAligned: { justifyContent: "flex-start" },
649
+ rowSelected: {
650
+ backgroundColor: "var(--filter-hover-color)",
651
+ "& > span": { maxWidth: "calc(100% - 20px)" }
652
+ },
653
+ rowApplied: {
654
+ backgroundColor: "initial",
655
+ "& > span": {
656
+ color: `${o.mainDarkNavy} !important`,
657
+ maxWidth: "calc(100% - 20px)"
658
+ }
659
+ },
660
+ rowDisabled: { "& span": { color: `${o.grey3} !important` } },
661
+ label: (e) => ({ ...B(e) })
662
+ }), $ = ({ selected: e, applied: t, disabled: n, hoverColor: r, dimensionValue: i, dimensionFormatter: a, searchTerm: s, onSelect: c, fontStyle: l, responsive: u, showCheckbox: d, showSelectionIcon: f = !0, checkboxState: p = "none", alignContentStart: m, fontSize: h }) => {
663
+ let g = He(u), _ = S()?.astrato ?? v, y = q(i, a), x = (0, U.useContext)(Z), C = (x.pendingOperator ?? x.appliedOperator) === H.FilterOperator.NotInList, w = C && t && e, T = Y({
664
+ ...l,
665
+ strikethrough: w
666
+ }, _);
667
+ return /* @__PURE__ */ (0, W.jsxs)("div", {
668
+ tabIndex: 0,
669
+ role: "button",
670
+ onClick: c,
671
+ "data-testid": `small-list-item-dimension-${i}`,
672
+ className: b({
673
+ [g.rowWrapper]: !0,
674
+ [g.rowWrapperClickable]: !!c,
675
+ [g.rowWrapperStartAligned]: m,
676
+ [g.rowSelected]: e,
677
+ [g.rowApplied]: t && !e,
678
+ [g.rowDisabled]: n
679
+ }),
680
+ style: { "--filter-hover-color": r ?? o.grey5 },
681
+ children: [
682
+ d ? /* @__PURE__ */ (0, W.jsx)("div", {
683
+ "aria-hidden": !0,
684
+ style: {
685
+ display: "flex",
686
+ alignItems: "center",
687
+ flexShrink: 0,
688
+ marginRight: 6,
689
+ pointerEvents: "none"
690
+ },
691
+ children: /* @__PURE__ */ (0, W.jsx)(I, {
692
+ value: p,
693
+ onChange: () => void 0
694
+ })
695
+ }) : null,
696
+ /* @__PURE__ */ (0, W.jsx)("span", {
697
+ className: g.label,
698
+ style: {
699
+ ...T,
700
+ ...h ? {
701
+ fontSize: h,
702
+ lineHeight: "14px"
703
+ } : {}
704
+ },
705
+ children: /* @__PURE__ */ (0, W.jsx)(F, {
706
+ phrase: s ?? "",
707
+ children: y ?? ""
708
+ })
709
+ }),
710
+ d ? null : /* @__PURE__ */ (0, W.jsx)(Pe, {
711
+ disabled: n,
712
+ isApplied: t,
713
+ isSelected: f && e,
714
+ isNot: C,
715
+ fontColor: l?.fontColor ?? void 0
716
+ })
717
+ ]
718
+ });
719
+ }, Ue = ({ filterValues: e, onItemClick: t, selectedValues: n, appliedValues: r, searchTerm: i, vSpec: a, hoverColor: o }) => {
720
+ let s = a.dimensions[0]?.formatter;
721
+ if (!a?.dimensions[0]?.dataItem) return null;
722
+ let [c, l] = ye(e, r), u = (e, r) => {
723
+ switch (!0) {
724
+ case n.includes(e.dimension):
725
+ t(e.dimension);
726
+ break;
727
+ case e.disabled: break;
728
+ default: t(e.dimension, { shift: r.shiftKey ? [...c, ...l].reduce((e, t) => (t.disabled || e.push(t.dimension), e), []) : null });
729
+ }
730
+ };
731
+ return /* @__PURE__ */ (0, W.jsxs)(W.Fragment, { children: [c.map((e) => /* @__PURE__ */ (0, W.jsx)($, {
732
+ searchTerm: i,
733
+ disabled: !!e.disabled,
734
+ dimensionValue: e.dimension,
735
+ dimensionFormatter: s,
736
+ onSelect: (t) => u(e, t),
737
+ selected: n.indexOf(e.dimension) !== -1,
738
+ applied: !0,
739
+ hoverColor: o,
740
+ fontStyle: a.filterSettings?.fontStyle,
741
+ responsive: a.filterSettings?.responsive
742
+ }, `applied-${e.dimension}`)), l.map((e) => /* @__PURE__ */ (0, W.jsx)($, {
743
+ searchTerm: i,
744
+ disabled: !!e.disabled,
745
+ dimensionValue: e.dimension,
746
+ dimensionFormatter: s,
747
+ onSelect: (t) => u(e, t),
748
+ selected: n.indexOf(e.dimension) !== -1,
749
+ applied: !1,
750
+ hoverColor: o,
751
+ fontStyle: a.filterSettings?.fontStyle,
752
+ responsive: a.filterSettings?.responsive
753
+ }, `not-applied-${e.dimension}`))] });
754
+ }, We = E({ dropdownContainer: {
755
+ overflow: "hidden",
756
+ backdropFilter: "blur(1.25px)",
757
+ zIndex: 1500
758
+ } }), Ge = ({ children: e, filterStyle: t, isLocked: n }) => {
759
+ let r = We(), i = X(t, n);
760
+ return /* @__PURE__ */ (0, W.jsx)("div", {
761
+ className: r.dropdownContainer,
762
+ style: i,
763
+ children: e
764
+ });
765
+ }, Ke = E({ root: {
766
+ background: o.grey5,
767
+ height: 2,
768
+ "& .MuiLinearProgress-bar": { background: o.mainDarkNavy }
769
+ } }), qe = ({ loading: e }) => {
770
+ let t = Ke();
771
+ return e ? /* @__PURE__ */ (0, W.jsx)(ie, {
772
+ className: t.root,
773
+ "data-testid": "filter-search-progress"
774
+ }) : null;
775
+ }, Je = E({
776
+ dropdownButton: (e) => ({
777
+ cursor: "pointer",
778
+ display: "flex",
779
+ flexDirection: "row",
780
+ alignItems: "center",
781
+ justifyContent: "space-between",
782
+ padding: 8,
783
+ height: "min(40px, 100%)",
784
+ backdropFilter: "blur(1.25px)",
785
+ "&:hover, &:focus": {
786
+ boxShadow: "0px 2px 4px rgba(0, 0, 0, 0.1)",
787
+ outline: "none"
788
+ },
789
+ ...e && {
790
+ [R.lg]: { height: "min(28px, 100%)" },
791
+ [R.md]: {
792
+ padding: "0 4px",
793
+ height: "min(24px, 100%)"
794
+ },
795
+ [R.sm]: {
796
+ padding: "0 2px",
797
+ height: "min(20px, 100%)"
798
+ },
799
+ [R.xs]: {
800
+ padding: 0,
801
+ height: "min(16px, 100%)"
802
+ }
803
+ }
804
+ }),
805
+ headerTitlesContainer: {
806
+ color: o.grey1,
807
+ display: "flex",
808
+ alignItems: "center",
809
+ width: "100%",
810
+ minWidth: 0
811
+ },
812
+ title: (e) => ({
813
+ fontWeight: "bold !important",
814
+ flexShrink: 1,
815
+ minWidth: 0,
816
+ ...T.overflowEllipsis,
817
+ ...B(e)
818
+ }),
819
+ measureTitle: {
820
+ ...T.overflowEllipsis,
821
+ minWidth: 0,
822
+ flexShrink: 1,
823
+ whiteSpaceCollapse: "preserve"
824
+ },
825
+ valuesLabel: {
826
+ ...T.overflowEllipsis,
827
+ paddingLeft: 4,
828
+ fontWeight: "bold !important",
829
+ minWidth: 0,
830
+ flexShrink: 1
831
+ },
832
+ expandIcon: (e) => ({
833
+ display: "flex",
834
+ flexDirection: "row",
835
+ alignItems: "center",
836
+ boxSizing: "border-box",
837
+ ...e && L
838
+ }),
839
+ notPart: (e) => ({ ...Ae(e) })
840
+ }), Ye = ({ dimensionTitle: e, measureTitle: t, isOpen: n, onToggle: r, dimensionFormatter: i, selectedValues: a = [], fontStyle: o, filterStyle: s, responsive: c, isLocked: l }) => {
841
+ let u = S()?.astrato ?? v, d = Je(c), f = (0, U.useContext)(Z), p = (f.pendingOperator ?? f.appliedOperator) === H.FilterOperator.NotInList, m = {
842
+ button: X(s),
843
+ label: Y(o, u)
844
+ }, h = m.label.color, g = (e) => String(typeof e == "boolean" ? e : i ? k(i, e) : e), _ = [...a].sort().slice(0, 15).map(g).join(", "), y = a.length > 0;
845
+ return /* @__PURE__ */ (0, W.jsxs)("div", {
846
+ role: "button",
847
+ tabIndex: 0,
848
+ "data-testid": "filter-header-dropdown",
849
+ className: d.dropdownButton,
850
+ onClick: (e) => {
851
+ e.currentTarget.blur(), r?.();
852
+ },
853
+ onKeyUp: (e) => {
854
+ (e.key === "Enter" || e.key === " ") && (e.stopPropagation(), e.preventDefault(), r?.());
855
+ },
856
+ style: m.button,
857
+ children: [/* @__PURE__ */ (0, W.jsxs)("div", {
858
+ className: d.headerTitlesContainer,
859
+ style: { color: h },
860
+ children: [
861
+ l && /* @__PURE__ */ (0, W.jsx)(P, {
862
+ fill: "currentColor",
863
+ style: { marginRight: 8 }
864
+ }),
865
+ p && /* @__PURE__ */ (0, W.jsx)("div", {
866
+ className: d.notPart,
867
+ children: "NOT"
868
+ }),
869
+ /* @__PURE__ */ (0, W.jsx)("div", {
870
+ className: d.title,
871
+ style: m.label,
872
+ children: e
873
+ }),
874
+ /* @__PURE__ */ (0, W.jsxs)("div", {
875
+ className: d.title,
876
+ style: {
877
+ ...m.label,
878
+ display: "flex"
879
+ },
880
+ children: [/* @__PURE__ */ (0, W.jsx)("span", {
881
+ className: d.measureTitle,
882
+ children: t
883
+ }), y && /* @__PURE__ */ (0, W.jsxs)("div", {
884
+ className: d.valuesLabel,
885
+ children: [" ", _]
886
+ })]
887
+ })
888
+ ]
889
+ }), /* @__PURE__ */ (0, W.jsx)("div", {
890
+ className: d.expandIcon,
891
+ style: { color: h },
892
+ children: n ? /* @__PURE__ */ (0, W.jsx)(D, {
893
+ size: 24,
894
+ fill: "currentColor"
895
+ }) : /* @__PURE__ */ (0, W.jsx)(C, {
896
+ size: 24,
897
+ fill: "currentColor"
898
+ })
899
+ })]
900
+ });
901
+ }, Xe = E({
902
+ headerListbox: (e) => ({
903
+ height: 36,
904
+ margin: "0 12px 8px",
905
+ display: "flex",
906
+ alignItems: "center",
907
+ boxSizing: "border-box",
908
+ ...e && {
909
+ [R.md]: {
910
+ height: 32,
911
+ margin: "0 12px 6px"
912
+ },
913
+ [R.sm]: {
914
+ height: 28,
915
+ margin: "0 12px 4px"
916
+ },
917
+ [R.xs]: {
918
+ height: 24,
919
+ margin: "0 12px"
920
+ }
921
+ }
922
+ }),
923
+ headerListboxSearch: { flexGrow: 1 },
924
+ headerTitlesContainer: {
925
+ minWidth: 0,
926
+ color: o.grey1,
927
+ cursor: "pointer",
928
+ flexGrow: 1,
929
+ flexShrink: 1,
930
+ display: "flex",
931
+ alignItems: "center"
932
+ },
933
+ title: (e) => ({
934
+ ...T.overflowEllipsis,
935
+ fontWeight: "bold !important",
936
+ ...B(e)
937
+ }),
938
+ iconButton: (e) => ({
939
+ ...e && L,
940
+ cursor: "pointer",
941
+ display: "inline-flex",
942
+ alignItems: "center",
943
+ justifyContent: "center",
944
+ minWidth: 22,
945
+ width: 22,
946
+ height: 22,
947
+ padding: 0,
948
+ border: "none",
949
+ borderRadius: 6,
950
+ backgroundColor: "transparent",
951
+ color: "inherit",
952
+ lineHeight: 0,
953
+ "&:hover": { boxShadow: "inset 0 0 0 1px currentColor" },
954
+ "&:focus": { outline: "none" },
955
+ ...e && {
956
+ [R.md]: {
957
+ minWidth: 20,
958
+ width: 20,
959
+ height: 20,
960
+ borderRadius: 5
961
+ },
962
+ [R.sm]: {
963
+ minWidth: 16,
964
+ width: 16,
965
+ height: 16,
966
+ borderRadius: 4
967
+ },
968
+ [R.xs]: {
969
+ minWidth: 12,
970
+ width: 12,
971
+ height: 12,
972
+ borderRadius: 3
973
+ }
974
+ }
975
+ }),
976
+ notPart: (e) => ({ ...Ae(e) })
977
+ }), Ze = ({ children: e, dimensionTitle: t, measureTitle: n, searchEnabled: r, searchTerm: i, onSearchChange: a, onApplySearched: o, fontStyle: s, vTheme: c = v, isNotEnabled: l, responsive: u, isLocked: d }) => {
978
+ let f = Xe(u), p = Y(s, c), m = p.color, [h, g] = (0, U.useState)(!1);
979
+ (0, U.useEffect)(() => {
980
+ !r && i && a("");
981
+ }, [r]);
982
+ let _ = () => {
983
+ r && g(!0);
984
+ }, y = () => {
985
+ a(""), g(!1);
986
+ }, b = () => {
987
+ o();
988
+ };
989
+ return r ? /* @__PURE__ */ (0, W.jsx)("div", {
990
+ "data-testid": "filter-header-title",
991
+ className: f.headerListbox,
992
+ style: { color: m },
993
+ children: h ? /* @__PURE__ */ (0, W.jsxs)(W.Fragment, { children: [/* @__PURE__ */ (0, W.jsx)(re, {
994
+ responsive: u,
995
+ autoFocus: !0,
996
+ className: f.headerListboxSearch,
997
+ "data-testid": "filter-search-input",
998
+ onChange: (e) => {
999
+ a(e.target.value);
1000
+ },
1001
+ style: {
1002
+ color: m,
1003
+ borderColor: m
1004
+ },
1005
+ onPaste: Se(a),
1006
+ onKeyDown: (e) => {
1007
+ switch (e.key) {
1008
+ case "Enter":
1009
+ b();
1010
+ break;
1011
+ case "Escape":
1012
+ y(), a("");
1013
+ break;
1014
+ }
1015
+ },
1016
+ value: i
1017
+ }), e] }) : /* @__PURE__ */ (0, W.jsxs)(W.Fragment, { children: [
1018
+ /* @__PURE__ */ (0, W.jsx)("button", {
1019
+ "data-testid": "filter-header-show-search-button",
1020
+ onClick: _,
1021
+ className: f.iconButton,
1022
+ style: { marginRight: 8 },
1023
+ children: /* @__PURE__ */ (0, W.jsx)(N, {
1024
+ fill: "currentColor",
1025
+ size: 20
1026
+ })
1027
+ }),
1028
+ d && /* @__PURE__ */ (0, W.jsx)(P, {
1029
+ fill: "currentColor",
1030
+ style: { marginRight: 8 }
1031
+ }),
1032
+ /* @__PURE__ */ (0, W.jsxs)("div", {
1033
+ onClick: _,
1034
+ className: f.headerTitlesContainer,
1035
+ children: [
1036
+ l && /* @__PURE__ */ (0, W.jsx)("div", {
1037
+ className: f.notPart,
1038
+ children: "NOT"
1039
+ }),
1040
+ /* @__PURE__ */ (0, W.jsx)("span", {
1041
+ className: f.title,
1042
+ style: p,
1043
+ children: t
1044
+ }),
1045
+ /* @__PURE__ */ (0, W.jsx)("span", {
1046
+ className: f.title,
1047
+ style: {
1048
+ ...p,
1049
+ whiteSpaceCollapse: "preserve"
1050
+ },
1051
+ children: n
1052
+ })
1053
+ ]
1054
+ }),
1055
+ e
1056
+ ] })
1057
+ }) : /* @__PURE__ */ (0, W.jsxs)("div", {
1058
+ "data-testid": "filter-header-title",
1059
+ className: f.headerListbox,
1060
+ style: { color: m },
1061
+ children: [/* @__PURE__ */ (0, W.jsxs)("div", {
1062
+ className: f.headerTitlesContainer,
1063
+ children: [
1064
+ l && /* @__PURE__ */ (0, W.jsx)("div", {
1065
+ className: f.notPart,
1066
+ children: "NOT"
1067
+ }),
1068
+ /* @__PURE__ */ (0, W.jsx)("span", {
1069
+ className: f.title,
1070
+ style: p,
1071
+ children: t
1072
+ }),
1073
+ /* @__PURE__ */ (0, W.jsx)("span", {
1074
+ className: f.title,
1075
+ style: {
1076
+ ...p,
1077
+ whiteSpaceCollapse: "preserve"
1078
+ },
1079
+ children: n
1080
+ })
1081
+ ]
1082
+ }), e]
1083
+ });
1084
+ }, Qe = E({
1085
+ container: ({ responsive: e, isDropdown: t }) => ({
1086
+ margin: 0,
1087
+ padding: 0,
1088
+ ...!t && {
1089
+ height: "calc(100% - 44px)",
1090
+ ...e && {
1091
+ [R.sm]: { height: "calc(100% - 36px)" },
1092
+ [R.xs]: { height: "calc(100% - 32px)" }
1093
+ }
1094
+ }
1095
+ }),
1096
+ scrollContainer: ({ responsive: e }) => ({
1097
+ ...te.propertiesPanel,
1098
+ padding: "0 12px",
1099
+ ...e && {
1100
+ [R.md]: { padding: "0 8px" },
1101
+ [R.sm]: { padding: "0 6px" },
1102
+ [R.xs]: { padding: "0 4px" }
1103
+ }
1104
+ })
1105
+ }), $e = ({ children: e, loadMoreData: t, isDropdown: n = !1, hasSearch: r = !1, responsive: i }) => {
1106
+ let a = Qe({
1107
+ responsive: i,
1108
+ isDropdown: n
1109
+ });
1110
+ return /* @__PURE__ */ (0, W.jsx)("div", {
1111
+ className: a.container,
1112
+ "data-testid": "list-container",
1113
+ style: {
1114
+ paddingTop: n && !r ? 8 : void 0,
1115
+ paddingBottom: n ? 8 : void 0
1116
+ },
1117
+ children: /* @__PURE__ */ (0, W.jsx)("div", {
1118
+ className: a.scrollContainer,
1119
+ style: {
1120
+ height: n ? void 0 : "100%",
1121
+ maxHeight: n ? 330 - (r ? 40 : 0) : void 0
1122
+ },
1123
+ onScroll: (e) => {
1124
+ let { scrollHeight: n, clientHeight: r, scrollTop: i } = e.currentTarget;
1125
+ V(n, r, i) && t();
1126
+ },
1127
+ children: e
1128
+ })
1129
+ });
1130
+ }, et = E({
1131
+ mainFilterContainer: {
1132
+ width: "100%",
1133
+ height: "100%",
1134
+ overflow: "hidden"
1135
+ },
1136
+ blurBackground: { backdropFilter: "blur(1.25px)" },
1137
+ noBorder: { border: "none !important" }
1138
+ }), tt = ({ children: e, noBorder: t, blurBackground: n, filterStyle: r, fontSize: i }) => {
1139
+ let a = et(), o = X(r);
1140
+ return /* @__PURE__ */ (0, W.jsx)("div", {
1141
+ className: b({
1142
+ [a.mainFilterContainer]: !0,
1143
+ [a.noBorder]: t,
1144
+ [a.blurBackground]: n
1145
+ }),
1146
+ style: {
1147
+ ...o,
1148
+ fontSize: i ? `${i}px` : void 0
1149
+ },
1150
+ children: e
1151
+ });
1152
+ };
1153
+ export { oe as _, qe as a, $ as c, Z as d, Oe as f, be as g, Se as h, Ye as i, Ve as l, Te as m, $e as n, Ge as o, De as p, Ze as r, Ue as s, tt as t, Q as u, V as v };