@astrato-io/visualizations 0.6.5 → 0.8.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 (140) hide show
  1. package/README.md +8 -2
  2. package/THIRD_PARTY_NOTICES.md +2 -229
  3. package/VISUALIZATION_DEFINITIONS.md +68 -114
  4. package/chunks/Button-BrGKp9Nm.js +110 -0
  5. package/chunks/DefaultPropsProvider-BsfB7QTn.js +257 -0
  6. package/chunks/FieldTypeIcon-Drs6hSJF.js +22 -0
  7. package/chunks/{LinearProgress-B1FeWaen.js → LinearProgress-VtfFx2vJ.js} +55 -55
  8. package/chunks/MenuOption-ByRqhRdX.js +3934 -0
  9. package/chunks/Title-CO5dP1ma.js +1691 -0
  10. package/chunks/ToggleButton-KOBAimC1.js +112 -0
  11. package/chunks/{app-filter-bar.compiler-BGJ7HAbr.js → app-filter-bar.compiler-TwVTeoj5.js} +10 -10
  12. package/chunks/{bar.compiler-CT0ZbQKc.js → bar.compiler-DuQg8EUb.js} +84 -84
  13. package/chunks/builder-DEDvNq1k.js +201 -0
  14. package/chunks/{color-settings-ZIvgNTq1.js → color-rules-CN7TcGrC.js} +2 -6
  15. package/chunks/color-settings-3VRlf_Vw.js +6 -0
  16. package/chunks/colorManipulator-D8Pjy1pf.js +45 -0
  17. package/chunks/coloring-CncX_JRX.js +278 -0
  18. package/chunks/{definitions-D3OVqmXl.js → definitions-BPJQTx16.js} +490 -382
  19. package/chunks/{escobar-eDjtGpkC.js → escobar-DRhRMYRE.js} +6067 -4742
  20. package/chunks/event-bus-CrLB-Y8z.js +3 -0
  21. package/chunks/extend-preset-CUFNpmPe.js +4398 -0
  22. package/chunks/{filter.compiler-DBsyRBJt.js → filter.compiler-w27dlv0C.js} +12 -12
  23. package/chunks/{filtering-tqjAyJH5.js → filtering-cc7WqWpg.js} +391 -310
  24. package/chunks/{handlers-VTBfIZYZ.js → handlers-TOT-7INo.js} +3241 -3442
  25. package/chunks/icon-picker-styles-CoJmwTRi.js +2246 -0
  26. package/chunks/isEqual-B8loyPsC.js +12 -0
  27. package/chunks/label-format-type-weq1XfcX.js +8 -0
  28. package/chunks/{line.compiler-CzdM5Ld0.js → line.compiler-Ct1WhN2p.js} +27 -27
  29. package/chunks/logger-DpQtYQnX.js +1163 -0
  30. package/chunks/lookup-BWllin0q.js +36 -0
  31. package/chunks/{metadata-BGElBy5Z.js → metadata-WABZrt7Y.js} +1 -1
  32. package/chunks/{number.compiler-G-R7y16P.js → number.compiler-D8TPly-4.js} +13 -13
  33. package/chunks/{operations-CTNUX6Sy.js → operations-Dh4v1Ovt.js} +9314 -9283
  34. package/chunks/{range-CiwTbMig.js → range-Bi-7zT0k.js} +2 -2
  35. package/chunks/render-wrappers-OEmtaM8g.js +2 -0
  36. package/chunks/{registry-CsQQzukD.js → requirements-Dvd8jqYF.js} +218 -222
  37. package/chunks/responsive.styles-DSiOGD7u.js +82 -0
  38. package/chunks/{shared-CBvcC5YV.js → shared-Bn4N5QcZ.js} +424 -424
  39. package/chunks/src-77e3mC7i.js +391 -0
  40. package/chunks/standalone-B55oyW6c.js +689 -0
  41. package/chunks/{standalone-C3gg736V.js → standalone-BDhPQtzQ.js} +375 -341
  42. package/chunks/{standalone-BMIbT1b2.js → standalone-BGkmozIb.js} +992 -837
  43. package/chunks/standalone-BMTCb10X.js +179 -0
  44. package/chunks/standalone-BXKRE_Se.js +468 -0
  45. package/chunks/standalone-Bes8srx1.js +354 -0
  46. package/chunks/standalone-BjZp0QMe.js +2 -0
  47. package/chunks/{standalone-JuLF-OoH.js → standalone-BlMIwpEe.js} +634 -519
  48. package/chunks/{standalone-C_rYnZ0N.js → standalone-C8ZAEutO.js} +43 -42
  49. package/chunks/standalone-C8qAelL4.js +2 -0
  50. package/chunks/standalone-CJvIXsQE.js +743 -0
  51. package/chunks/standalone-CLmGb7nn2.js +355 -0
  52. package/chunks/standalone-CM5XcAN5.js +52327 -0
  53. package/chunks/standalone-CXNP6-xD.js +420 -0
  54. package/chunks/{standalone-vzBY6q0I2.js → standalone-D5Q5ngsD.js} +57 -55
  55. package/chunks/standalone-DLlyRIE6.js +287 -0
  56. package/chunks/standalone-DMcI1afI.js +396 -0
  57. package/chunks/{standalone-DC-aUgXC.js → standalone-DN4S1MjT.js} +1111 -1092
  58. package/chunks/standalone-DT0wKji7.js +6 -0
  59. package/chunks/standalone-DW6NT205.js +518 -0
  60. package/chunks/standalone-DYQIQH4c.js +2095 -0
  61. package/chunks/standalone-D__XCp-h.js +1003 -0
  62. package/chunks/standalone-XTgSsTAa.js +354 -0
  63. package/chunks/{standalone-v1oxfU20.js → standalone-XuGksArp.js} +20 -20
  64. package/chunks/{standalone-0M4HlmDW2.js → standalone-vBnBS2YC.js} +1047 -964
  65. package/chunks/{standalone-BtSHCp2U2.js → standalone-we5D5MIn.js} +173 -168
  66. package/chunks/{table.compiler-tb914oj3.js → table.compiler-DMeeHxb6.js} +29 -29
  67. package/chunks/useFieldName-Cjn9KCVp.js +7 -0
  68. package/chunks/useSlotProps-DLbQp4lc.js +166 -0
  69. package/chunks/{utils-Bg7K-t6K.js → utils-vdmi_2PK.js} +6271 -7804
  70. package/chunks/{view-Bn83C8d9.js → view-BuwQugKb.js} +2717 -3504
  71. package/chunks/{isEqual-BDxAhUo8.js → visualization-filters-Cc4KU-l-.js} +1887 -1946
  72. package/chunks/with-html-element-D0uY2zjI.js +7328 -0
  73. package/definitions.js +2 -2
  74. package/docs/operations/astrato-app-filter-bar.md +1 -1
  75. package/docs/operations/bar.md +31 -14
  76. package/docs/operations/combo.md +1 -1
  77. package/docs/operations/date-picker.md +3 -3
  78. package/docs/operations/distribution-gauge.md +13 -13
  79. package/docs/operations/dot.md +13 -13
  80. package/docs/operations/filter.md +1 -1
  81. package/docs/operations/gauge.md +13 -13
  82. package/docs/operations/heatMap.md +13 -13
  83. package/docs/operations/histogram.md +1 -1
  84. package/docs/operations/iframe.md +1 -1
  85. package/docs/operations/image.md +1 -1
  86. package/docs/operations/index.md +3 -3
  87. package/docs/operations/line.md +7 -7
  88. package/docs/operations/number.md +1 -1
  89. package/docs/operations/pie.md +13 -13
  90. package/docs/operations/radar.md +7 -7
  91. package/docs/operations/sankey.md +13 -13
  92. package/docs/operations/scatter.md +13 -13
  93. package/docs/operations/shape.md +1 -1
  94. package/docs/operations/simpleTextObject.md +1 -1
  95. package/docs/operations/slider.md +1 -1
  96. package/docs/operations/table.md +18 -1
  97. package/docs/operations/tree.md +51 -37
  98. package/docs/operations/treemap.md +63 -49
  99. package/docs/operations/waterfall.md +1 -1
  100. package/docs/operations/word-cloud.md +13 -13
  101. package/getters.js +7 -7
  102. package/index.js +419 -417
  103. package/metadata.js +17 -18
  104. package/operations.js +13 -13
  105. package/package.json +70 -55
  106. package/src/definitions/index.d.ts +1 -1
  107. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +53 -30
  108. package/src/definitions/model/definitions/index.d.ts +1 -1
  109. package/src/definitions/model/definitions/schema-registry.d.ts +2 -2
  110. package/src/definitions/model/definitions/schemas/object.schema.d.ts +2 -2
  111. package/src/definitions/model/definitions/types/compilation.types.d.ts +10 -0
  112. package/src/definitions/model/definitions/types/index.d.ts +1 -1
  113. package/src/getters/index.d.ts +1 -1
  114. package/src/operations/index.d.ts +1 -1
  115. package/src/types.d.ts +1 -0
  116. package/chunks/ClickAwayListener-BbeNMAvj.js +0 -52
  117. package/chunks/builder-B6dWSIdD.js +0 -12289
  118. package/chunks/coloring-B1XAfg6b.js +0 -664
  119. package/chunks/events-WZut5Ow6.js +0 -4
  120. package/chunks/grouping-type-On4s9Thj.js +0 -3
  121. package/chunks/requirements-DYjZCFyf.js +0 -6
  122. package/chunks/standalone-0ashe9w1.js +0 -411
  123. package/chunks/standalone-B7jax8wa.js +0 -339
  124. package/chunks/standalone-BK0VYU-l.js +0 -463
  125. package/chunks/standalone-BZV5vOwA.js +0 -6
  126. package/chunks/standalone-BhDrWj4p.js +0 -1980
  127. package/chunks/standalone-BvaKdky9.js +0 -344
  128. package/chunks/standalone-BwtM31-f.js +0 -2
  129. package/chunks/standalone-CC1VUjO32.js +0 -299
  130. package/chunks/standalone-CoLrAxRV.js +0 -13198
  131. package/chunks/standalone-DCtRoTWg.js +0 -675
  132. package/chunks/standalone-DUDFTBqL.js +0 -833
  133. package/chunks/standalone-DhZkX9Td.js +0 -2
  134. package/chunks/standalone-DtLElfuM.js +0 -512
  135. package/chunks/standalone-G9Q4Uczu.js +0 -726
  136. package/chunks/standalone-_DeX21JJ.js +0 -383
  137. package/chunks/standalone-gFhKZh8m.js +0 -179
  138. package/chunks/standalone-tDNy-SFH.js +0 -281
  139. package/chunks/ui-DQWtv2iM.js +0 -63551
  140. package/chunks/useFieldName-BvdcoJRl.js +0 -7
@@ -0,0 +1,420 @@
1
+ import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
+ import { $i as t, Ds as n, Ua as r, Us as i, Wa as a, Xa as o, da as s, fa as c, is as l, mr as u, ws as d, zi as f, zr as p, zt as m } from "./visualization-filters-Cc4KU-l-.js";
3
+ import { Ei as h, F as g, L as _, N as v, U as y, Xt as b, bn as x, dn as S, ri as C } from "./utils-vdmi_2PK.js";
4
+ import { Am as w, km as T } from "./handlers-TOT-7INo.js";
5
+ import "./logger-DpQtYQnX.js";
6
+ import { Et as E, F as D, Gt as O, I as ee, It as te, Lt as ne, Mt as k, Pt as re, Vt as ie, Wt as A, Yt as ae, _n as j, an as M, bt as N, cn as P, et as oe, fn as F, i as se, in as ce, rn as I, t as le, un as L, vn as R, yt as z } from "./escobar-DRhRMYRE.js";
7
+ import { t as B } from "./coloring-CncX_JRX.js";
8
+ import { t as V } from "./debounce-fn-CUixuz45.js";
9
+ import { t as H } from "./set-coloring-datafield-B3uIS1Pe.js";
10
+ import { t as U } from "./builder-DEDvNq1k.js";
11
+ var W = 100, G = (e, t, n) => {
12
+ let r = e.element.getBoundingClientRect(), i = {
13
+ x: t.clientX - r.left,
14
+ y: t.clientY - r.top
15
+ };
16
+ return e.chart?.shapesAt(i, {
17
+ components: [{
18
+ key: n,
19
+ opts: { propagation: "stop" }
20
+ }],
21
+ propagation: "stop"
22
+ })?.[0];
23
+ }, ue = (e, t) => {
24
+ let n = null, r = V((r, i) => {
25
+ let a = G(r, i, e);
26
+ !a && n && (t(e, "mouseleave", n.key, i, n), n = null), a?.data?._ID && n?.data?._ID && a.data._ID !== n.data._ID && (t(e, "mouseleave", n.key, i, n), n = null), a && (t(e, "mousemove", a.key, i, a), n = a);
27
+ }, W), i = V((r) => {
28
+ n &&= (t(e, "mouseleave", n.key, r, n), null);
29
+ }, W);
30
+ return {
31
+ type: "native",
32
+ key: "action-events-interaction",
33
+ events: {
34
+ click(n) {
35
+ let r = G(this, n, e);
36
+ r && t(e, "click", r.key, n, r);
37
+ },
38
+ mousemove(e) {
39
+ r(this, e);
40
+ },
41
+ mouseleave(e) {
42
+ i(e);
43
+ }
44
+ }
45
+ };
46
+ }, K = /* @__PURE__ */ e(h()), de = a.Rectangle, q = (e) => ({
47
+ shape: e?.heatMapSettings?.shape ?? de,
48
+ minSize: e?.heatMapSettings?.minSize ?? .1,
49
+ maxSize: e?.heatMapSettings?.maxSize ?? 1
50
+ }), fe = (e, t, n, r, i, a, o, s) => {
51
+ let c = [], { shape: l } = q(e), u = `${R.Point}-${l}`;
52
+ if ((e?.enableEmitEvents ?? !1) && s) {
53
+ let e = ue(u, s);
54
+ c.push(e);
55
+ }
56
+ return {
57
+ ...n,
58
+ interactions: n.interactions ? [...n.interactions, ...c] : [...c]
59
+ };
60
+ }, pe = (e, t, n) => {
61
+ let r = e.dimensions.filter(p), i = r.filter((e) => e.role === s.HEAT_MAP_HORIZONTAL), a = r.filter((e) => e.role === s.HEAT_MAP_VERTICAL), o = i[0], c = a[0], [l, u] = ne([{
62
+ showAxisTooltip: e?.axes?.dimension?.showAxisTooltip,
63
+ formatter: o?.formatter,
64
+ scale: M(e),
65
+ key: k.Dimension,
66
+ settings: { direction: re(e) }
67
+ }, {
68
+ showAxisTooltip: e?.axes?.secondaryDimension?.showAxisTooltip,
69
+ formatter: c?.formatter,
70
+ scale: P.YAxisScale,
71
+ key: k.DimensionSec,
72
+ settings: {
73
+ direction: te(e),
74
+ isVerticalDimension: !0
75
+ }
76
+ }]);
77
+ return {
78
+ ...n,
79
+ components: [...n.components ?? [], ...l],
80
+ interactions: [...n.interactions ?? [], ...u]
81
+ };
82
+ }, me = (e, n, r, i, a, c, l, d) => {
83
+ let f = [], m = [], h = [];
84
+ if (d) {
85
+ let e = ie(R.Text, d);
86
+ h.push(e);
87
+ }
88
+ let g = e.dimensions.filter((e) => e.role === s.HEAT_MAP_HORIZONTAL), _ = g.filter(p), v = e.dimensions.filter((e) => e.role === s.HEAT_MAP_VERTICAL), y = v.filter(p), b = {
89
+ ...n.axis.dimension,
90
+ ...n.fonts
91
+ }, x = {
92
+ ...n.axis.measure,
93
+ ...n.fonts
94
+ }, S = _[0], C = y[0], w = e.measures.filter((e) => e.role === t.HEAT_MAP_COLOR), T = w.filter(p), E = {};
95
+ if (S) {
96
+ let t = e.axes?.dimension || E, n = t.secondaryAxis ? o.Top : o.Bottom;
97
+ if (f.push(A(P.XAxisScale, t, b, n, S.formatter, c)), t.showAxisName) {
98
+ let r = u(g, e.enableAlternate, c?.isPrintMode);
99
+ m.push(O(_, r, n, b, t.colors?.title, t.axisTitle ? t.axisTitle : I(S, l), t.titleFontSize));
100
+ }
101
+ }
102
+ if (C) {
103
+ let t = e.axes?.secondaryDimension || E, n = t.secondaryAxis ? o.Right : o.Left;
104
+ if (f.push(A(P.YAxisScale, t, b, n, C.formatter, c)), t.showAxisName) {
105
+ let r = u(v, e.enableAlternate, c?.isPrintMode);
106
+ m.push(O(y, r, n, b, t.colors?.title, t.axisTitle ? t.axisTitle : I(C, l), t.titleFontSize));
107
+ }
108
+ }
109
+ if (w.length > 1) {
110
+ let t = e.axes?.primaryMeasure || {}, n = u(w, e.enableAlternate, c?.isPrintMode);
111
+ m.push(O(T, n, o.Right, x, t.colors?.title, t.axisTitle, t.titleFontSize));
112
+ }
113
+ return {
114
+ ...r,
115
+ components: [
116
+ ...r.components,
117
+ ...f,
118
+ ...m
119
+ ],
120
+ interactions: [...r.interactions ?? [], ...h]
121
+ };
122
+ }, he = /* @__PURE__ */ e(m()), ge = (e) => (t, n) => t.value === e ? -1 : +(n.value === e), _e = (e) => (t, n) => t.value === e ? 1 : n.value === e ? -1 : 0, J = (e, t = 0) => (n, r) => {
123
+ let i = e ? n[e] : n, a = e ? r[e] : r;
124
+ return i.value !== a.value && i.value === null ? -t : i.value !== a.value && a.value === null ? t : i.value === a.value ? 0 : i.value < a.value ? -t : t;
125
+ }, ve = (e) => (t, n) => {
126
+ let r = 0;
127
+ for (let i = 0; i < e.length; i++) if (r = e[i](t, n), r !== 0) return r;
128
+ return r;
129
+ }, ye = (e) => {
130
+ let t = e.aggregation?.funcName;
131
+ return t && [
132
+ "SUM",
133
+ "MIN",
134
+ "MAX",
135
+ "AVG"
136
+ ].includes(t) ? t.toLowerCase() : t === "COUNT" ? "sum" : "avg";
137
+ }, Y = (e, t, n) => {
138
+ let a = n?.sortingOrder ?? [], o = a.findIndex((t) => i(t.dataItem) === i(e));
139
+ if (o < 0) return;
140
+ let s = a[o], c = a.slice(0, o).filter((e) => e.fieldType === "measure");
141
+ if (s) {
142
+ let e, a = [];
143
+ n?.topN?.enabled && n.topN.showOthers && ((0, he.default)(n.topN.dimensionIdx) || n.topN.dimensionIdx === t) && (e = n.topN.othersPosition === w.First ? ge(n.topN.othersLabel?.stringLabel ?? "Others") : n.topN.othersPosition === w.Last ? _e(n.topN.othersLabel?.stringLabel ?? "Others") : void 0, e && a.push(e));
144
+ let o = {};
145
+ return c.forEach((e, t) => {
146
+ let n = `m${t}`;
147
+ a.push(J(n, e.sortDirection === r.Asc ? 1 : -1)), o[n] = {
148
+ field: i(e.dataItem),
149
+ reduce: ye(e.dataItem)
150
+ };
151
+ }), a.push(J("", s.sortDirection === r.Asc ? 1 : -1)), {
152
+ props: o,
153
+ sort: ve(a)
154
+ };
155
+ }
156
+ }, be = (e, r, a) => {
157
+ let o = e.dimensions.filter(p), c = e.measures.filter(p), l = o.filter((e) => e.role === s.HEAT_MAP_HORIZONTAL), u = o.filter((e) => e.role === s.HEAT_MAP_VERTICAL), d = c.filter((e) => e.role === t.HEAT_MAP_COLOR), f = c.filter((e) => e.role === t.HEAT_MAP_SIZE), m = l[0], h = u[0], g = d[0], _ = f[0], { coloring: v } = e || {}, y = v?.fieldId;
158
+ e.coloring?.type === n.Gradient && (y ||= i(g.dataItem)), y && z(a, 0, { color: { field: y } });
159
+ let b = E(H(e, y ?? null), r, {});
160
+ if (m) {
161
+ let t = Y(m.dataItem, 0, e.querySettings);
162
+ b[P.XAxisScale] = {
163
+ data: {
164
+ extract: {
165
+ field: i(m.dataItem),
166
+ trackBy: (e) => e,
167
+ reduce: "first",
168
+ props: t?.props
169
+ },
170
+ sort: t?.sort
171
+ },
172
+ type: F.Band
173
+ };
174
+ }
175
+ if (h) {
176
+ let t = Y(h.dataItem, 1, e.querySettings);
177
+ b[P.YAxisScale] = {
178
+ data: {
179
+ extract: {
180
+ field: i(h.dataItem),
181
+ trackBy: (e) => e,
182
+ reduce: "first",
183
+ props: t?.props
184
+ },
185
+ sort: t?.sort
186
+ },
187
+ type: F.Band
188
+ };
189
+ }
190
+ let x = i(g.dataItem);
191
+ if (b[x] = { data: { field: x } }, _) {
192
+ let e = i(_.dataItem);
193
+ b[e] = {
194
+ type: F.Linear,
195
+ data: { extract: { field: e } }
196
+ };
197
+ }
198
+ return {
199
+ ...a,
200
+ scales: b
201
+ };
202
+ }, X = /* @__PURE__ */ function(e) {
203
+ return e.measure = "measure", e.group = "group", e.size = "size", e;
204
+ }({}), xe = (e, n, r) => {
205
+ let a = e.dimensions.filter(p), o = e.measures.filter(p), c = ee((e.supportingMeasures ?? []).filter(p)), l = a.filter((e) => e.role === s.HEAT_MAP_HORIZONTAL), u = a.filter((e) => e.role === s.HEAT_MAP_VERTICAL), d = o.filter((e) => e.role === t.HEAT_MAP_COLOR), f = o.filter((e) => e.role === t.HEAT_MAP_SIZE);
206
+ if (!a.length) return r;
207
+ let m = l[0], h = u[0], g = d[0], _ = f[0], v = i(g?.dataItem), y = i(_?.dataItem), b = i(m?.dataItem), x = i(h?.dataItem), S = {
208
+ measure: { field: v },
209
+ group: { field: x },
210
+ size: _ ? { field: y } : void 0,
211
+ secondColorOverwrite: { field: x },
212
+ ...c
213
+ };
214
+ v && (S[v] = { field: v }), y && (S[y] = { field: y });
215
+ let C = [{
216
+ key: P.Collection,
217
+ data: { extract: [{
218
+ field: b,
219
+ props: S
220
+ }] }
221
+ }];
222
+ return {
223
+ ...r,
224
+ collections: C
225
+ };
226
+ }, Se = (e, r, a, o, s, c) => {
227
+ let l = e.measures.filter(p), u = l.filter((e) => e.role === t.HEAT_MAP_COLOR), d = l.filter((e) => e.role === t.HEAT_MAP_SIZE), f = u[0], m = d[0], { shape: h, minSize: g, maxSize: _ } = q(e), v = _;
228
+ m && (v = (e) => e.resources.scale(i(m.dataItem))(e.datum.size.value) * (_ - g) + g);
229
+ let y = new B(e, r, s?.[0]?.itemsNotAffectedByFiltering), b = {
230
+ type: R.Point,
231
+ key: `${R.Point}-${h}`,
232
+ data: { collection: P.Collection },
233
+ settings: {
234
+ x: { scale: P.XAxisScale },
235
+ y: {
236
+ scale: P.YAxisScale,
237
+ ref: X.group
238
+ },
239
+ fill: y.getColorDefinition({
240
+ ref: "color",
241
+ overwriteSources: [
242
+ y.MAIN_FIELD,
243
+ "secondColorOverwrite",
244
+ "color"
245
+ ],
246
+ dataItemId: e.coloring?.type === n.Single ? i(f?.dataItem) : null
247
+ }),
248
+ shape: h,
249
+ size: v
250
+ },
251
+ animations: {
252
+ enabled: !0,
253
+ presetId: "simple-opacity"
254
+ },
255
+ brush: ae(["", X.group], c, void 0, j.AndSubset)
256
+ };
257
+ return {
258
+ ...a,
259
+ components: [...a.components, b]
260
+ };
261
+ }, Z = {
262
+ top: 0,
263
+ bottom: 0,
264
+ left: 2,
265
+ right: 2
266
+ }, Ce = (e, t, n, r) => {
267
+ let a;
268
+ return i(e.dataItem) === i(n.dataItem) ? a = r?.measure : i(t.dataItem) === i(n.dataItem) && (a = r?.size), a ? a.value === null ? "-" : a.label ?? "" : "";
269
+ }, we = (e, t, n, r) => {
270
+ if (i(e.dataItem) === i(n.dataItem)) return r.measure?.value;
271
+ if (i(t.dataItem) === i(n.dataItem)) return r.size?.value;
272
+ }, Te = (e, n, r) => {
273
+ let i, o = e.measures.filter(p), s = o.filter((e) => e.role === t.HEAT_MAP_COLOR), l = o.filter((e) => e.role === t.HEAT_MAP_SIZE), u = s[0], d = l[0], { shape: f } = q(e), m;
274
+ switch (f) {
275
+ case a.Circle:
276
+ m = L.Circle;
277
+ break;
278
+ case a.Square:
279
+ case a.Rectangle:
280
+ case a.Bar:
281
+ m = L.Rect;
282
+ break;
283
+ default: m = L.Path;
284
+ }
285
+ if (u?.dataLabels?.show) i = u;
286
+ else if (d?.dataLabels?.show) i = d;
287
+ else return r;
288
+ let h = {
289
+ type: R.Labels,
290
+ key: "heat-map-label",
291
+ settings: { sources: [{
292
+ component: `${R.Point}-${f}`,
293
+ selector: m,
294
+ strategy: {
295
+ type: "bar",
296
+ settings: {
297
+ direction: "right",
298
+ fontFamily: n.fonts.general.fontFamily,
299
+ fontSize: ce(i.dataLabels?.size),
300
+ labels: [{
301
+ label({ data: e, formatter: t }) {
302
+ if (!e) return "";
303
+ let n = Ce(u, d, i, e);
304
+ if (c(i.formatter)) {
305
+ let t = we(u, d, i, e);
306
+ return t === null ? "-" : t === void 0 ? "" : S(i.formatter.format, i.formatter)(t, void 0, e);
307
+ }
308
+ return i.formatter && typeof t == "function" && n && n !== "-" ? t(i.formatter)(n) : n;
309
+ },
310
+ placements: [{
311
+ position: T.Inside,
312
+ fill: "#fff",
313
+ align: .5,
314
+ justify: .5,
315
+ padding: Z
316
+ }, {
317
+ position: T.Inside,
318
+ fill: "#000",
319
+ align: .5,
320
+ justify: .5,
321
+ padding: Z
322
+ }]
323
+ }]
324
+ }
325
+ }
326
+ }] },
327
+ animations: {
328
+ enabled: !0,
329
+ presetId: "chart-labels"
330
+ }
331
+ };
332
+ return {
333
+ ...r,
334
+ components: [...r?.components ?? [], h]
335
+ };
336
+ }, Q = (e, t, n) => {
337
+ let { shape: r } = q(e), i = `${R.Point}-${r}`;
338
+ return oe(e, t, n, {
339
+ filter: (e) => e.filter((e) => e.key === i),
340
+ placement: {
341
+ type: "pointer",
342
+ area: "target"
343
+ }
344
+ });
345
+ }, Ee = class extends D {
346
+ constructor() {
347
+ super([
348
+ xe,
349
+ be,
350
+ me,
351
+ Se,
352
+ N,
353
+ Q,
354
+ Te,
355
+ pe,
356
+ fe
357
+ ]);
358
+ }
359
+ preCompile(e) {
360
+ let n = e.dimensions.filter(p), r = e.measures.filter(p), i = n.filter((e) => e.role === s.HEAT_MAP_HORIZONTAL), a = n.filter((e) => e.role === s.HEAT_MAP_VERTICAL), o = r.filter((e) => e.role === t.HEAT_MAP_COLOR), c = i[0], l = a[0], u = o[0];
361
+ if (!c || !l || !u) throw Error("Charts w/o horizontal or vertical dimension or color measure are not supported ATM.");
362
+ }
363
+ }, De = ({ id: e, clientX: t, clientY: n, vBackendAPI: r, ...i }) => {
364
+ let { top: a, left: o } = r.daedalus.convertCoordinatesToContainerPosition(t, n);
365
+ U({
366
+ id: e,
367
+ top: a,
368
+ left: o,
369
+ ...i
370
+ }, { vBackendAPI: r });
371
+ }, $ = (e, t, n, r, a) => {
372
+ let o, s, [c, l, u, d] = r, f = c.name, p = l.name, m = u.name, h = n.data.value, g = n.data.group.value, _ = n.data.measure.value;
373
+ if (d) {
374
+ let e = i(d);
375
+ o = n.data[e].value, s = d.name;
376
+ }
377
+ De({
378
+ id: e,
379
+ clientX: t.clientX,
380
+ clientY: t.clientY,
381
+ xAxisValue: h,
382
+ yAxisValue: g,
383
+ measureColorValue: _,
384
+ measureSizeValue: o,
385
+ xAxisName: f,
386
+ yAxisName: p,
387
+ measureColorName: m,
388
+ measureSizeName: s,
389
+ vBackendAPI: a
390
+ });
391
+ }, Oe = (e) => U({ id: "onCellLeave" }, { vBackendAPI: e }), ke = () => {
392
+ let e = x(), t = _(), n = y();
393
+ return (0, K.useCallback)((r, i, a, o, s) => {
394
+ let c;
395
+ switch (i) {
396
+ case "click":
397
+ r === R.Text ? c = le(r, n, o, a) : s?.key && o && $("onCellClick", o, s, t, e);
398
+ break;
399
+ case "mousemove":
400
+ if (!o || !s) break;
401
+ $("onCellHover", o, s, t, e);
402
+ break;
403
+ case "mouseleave":
404
+ Oe(e);
405
+ break;
406
+ }
407
+ c && e.emitEvent(c.action, c.payload);
408
+ }, [e, t]);
409
+ }, Ae = C(), je = b(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
410
+ let a = v(), [o] = (0, K.useState)(() => new Ee()), s = g(), c = ke();
411
+ if (!e || !l(e) || !r) return null;
412
+ let u = t || f, p = o.compile(e, u, n, r, i, d.HeatMap, a, s, c);
413
+ return p ? /* @__PURE__ */ (0, Ae.jsx)(se, {
414
+ config: i,
415
+ definition: p,
416
+ size: r,
417
+ vSpec: e
418
+ }) : null;
419
+ });
420
+ export { je as HeatMapChart };
@@ -1,23 +1,25 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Aa as t, Ta as n } from "./isEqual-BDxAhUo8.js";
3
- import { $t as r, Cn as i, Ei as a, Fn as o, G as s, Yi as c, a as l, d as u, q as d, ta as f, zr as p } from "./utils-Bg7K-t6K.js";
4
- import { t as m } from "./events-WZut5Ow6.js";
5
- var h = /* @__PURE__ */ e(c());
6
- h.forwardRef(function(e, t) {
7
- return h.createElement("img", {
2
+ import { Hi as t, Ji as n, ss as r } from "./visualization-filters-Cc4KU-l-.js";
3
+ import { An as i, Ei as a, Ti as o, W as s, Xt as c, a as l, bn as u, d, ri as f, wr as p } from "./utils-vdmi_2PK.js";
4
+ import { l as m } from "./logger-DpQtYQnX.js";
5
+ var h = /* @__PURE__ */ function(e) {
6
+ return e.OpenMediaPicker = "OPEN_MEDIA_PICKER", e.OpenMediaPickerResult = "OPEN_MEDIA_PICKER_RESULT", e.OPEN_TOP_BAR = "OPEN_TOP_BAR", e.OPEN_CREATE_BOOKMARK_WINDOW = "OPEN_CREATE_BOOKMARK_WINDOW", e;
7
+ }({}), g = /* @__PURE__ */ e(a());
8
+ g.forwardRef(function(e, t) {
9
+ return g.createElement("img", {
8
10
  ...e,
9
11
  ref: t,
10
12
  src: "data:image/svg+xml,%3Csvg%20width%3D%22177%22%20height%3D%22177%22%20viewBox%3D%220%200%20177%20177%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cpath%20d%3D%22M177%2041.2427V164.357C177%20167.71%20175.668%20170.926%20173.297%20173.297C170.926%20175.668%20167.71%20177%20164.357%20177H12.6429C9.28976%20177%206.074%20175.668%203.70301%20173.297C1.33201%20170.926%200%20167.71%200%20164.357V12.6429C0%209.28976%201.33201%206.074%203.70301%203.70301C6.074%201.33201%209.28976%200%2012.6429%200L135.757%200C139.11%200%20152.289%2016.5319%20154.66%2018.9029C157.031%2021.2739%20177%2037.8896%20177%2041.2427Z%22%20fill%3D%22%23F2F2F2%22%2F%3E%0A%20%20%3Cmask%20id%3D%22mask0%22%20mask-type%3D%22alpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%2225%22%20y%3D%2225%22%20width%3D%22127%22%20height%3D%22127%22%3E%0A%20%20%20%20%3Crect%20x%3D%2225.2857%22%20y%3D%2225.2857%22%20width%3D%22126.429%22%20height%3D%22126.429%22%20fill%3D%22%23F2F2F2%22%2F%3E%0A%20%20%3C%2Fmask%3E%0A%20%20%3Cg%20mask%3D%22url(%23mask0)%22%3E%0A%20%20%20%20%3Cpath%20d%3D%22M135.703%20147.315L126.644%20123.059L90.9439%2027.4276C90.4703%2026.1541%2089.227%2025.2857%2087.8653%2025.2857C86.4444%2025.2857%2085.201%2026.0962%2084.7274%2027.3118L61.2231%2083.9847L44.3497%2069.7441C43.3432%2068.8758%2041.8631%2068.7021%2040.679%2069.281C39.4949%2069.8599%2038.7252%2071.0756%2038.8436%2072.407L42.3367%20130.469C42.3959%20131.685%2043.1656%20132.727%2044.2905%20133.248C45.4154%20133.769%2046.7179%20133.595%2047.7244%20132.901L80.287%20108.645L130.493%20150.904C131.144%20151.425%20131.914%20151.714%20132.683%20151.714C133.335%20151.714%20133.986%20151.541%20134.578%20151.135C135.703%20150.267%20136.236%20148.704%20135.703%20147.315ZM58.5589%2090.4103L48.0796%20115.65L45.9482%2079.8167L58.5589%2090.4103ZM53.2896%20120.454L63.8873%2094.9257L75.0178%20104.304L53.2896%20120.454ZM66.5515%2088.5L87.6284%2037.616L104.324%2082.3638L80.4055%20100.136L66.5515%2088.5ZM85.6155%20104.593L106.752%2088.8474L120.369%20125.259L125.046%20137.763L85.6155%20104.593Z%22%20fill%3D%22%23BDBDBD%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%20%20%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M137.419%200H135.757V28.5999C135.757%2031.953%20137.089%2035.1687%20139.46%2037.5397C141.831%2039.9107%20145.047%2041.2427%20148.4%2041.2427H177V39.581L137.419%200Z%22%20fill%3D%22%23E0E0E0%22%2F%3E%0A%3C%2Fsvg%3E%0A"
11
13
  });
12
14
  });
13
- var g = "data:image/svg+xml,%3Csvg%20width%3D%22177%22%20height%3D%22177%22%20viewBox%3D%220%200%20177%20177%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cpath%20d%3D%22M177%2041.2427V164.357C177%20167.71%20175.668%20170.926%20173.297%20173.297C170.926%20175.668%20167.71%20177%20164.357%20177H12.6429C9.28976%20177%206.074%20175.668%203.70301%20173.297C1.33201%20170.926%200%20167.71%200%20164.357V12.6429C0%209.28976%201.33201%206.074%203.70301%203.70301C6.074%201.33201%209.28976%200%2012.6429%200L135.757%200C139.11%200%20152.289%2016.5319%20154.66%2018.9029C157.031%2021.2739%20177%2037.8896%20177%2041.2427Z%22%20fill%3D%22%23F2F2F2%22%2F%3E%0A%20%20%3Cmask%20id%3D%22mask0%22%20mask-type%3D%22alpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%2225%22%20y%3D%2225%22%20width%3D%22127%22%20height%3D%22127%22%3E%0A%20%20%20%20%3Crect%20x%3D%2225.2857%22%20y%3D%2225.2857%22%20width%3D%22126.429%22%20height%3D%22126.429%22%20fill%3D%22%23F2F2F2%22%2F%3E%0A%20%20%3C%2Fmask%3E%0A%20%20%3Cg%20mask%3D%22url(%23mask0)%22%3E%0A%20%20%20%20%3Cpath%20d%3D%22M135.703%20147.315L126.644%20123.059L90.9439%2027.4276C90.4703%2026.1541%2089.227%2025.2857%2087.8653%2025.2857C86.4444%2025.2857%2085.201%2026.0962%2084.7274%2027.3118L61.2231%2083.9847L44.3497%2069.7441C43.3432%2068.8758%2041.8631%2068.7021%2040.679%2069.281C39.4949%2069.8599%2038.7252%2071.0756%2038.8436%2072.407L42.3367%20130.469C42.3959%20131.685%2043.1656%20132.727%2044.2905%20133.248C45.4154%20133.769%2046.7179%20133.595%2047.7244%20132.901L80.287%20108.645L130.493%20150.904C131.144%20151.425%20131.914%20151.714%20132.683%20151.714C133.335%20151.714%20133.986%20151.541%20134.578%20151.135C135.703%20150.267%20136.236%20148.704%20135.703%20147.315ZM58.5589%2090.4103L48.0796%20115.65L45.9482%2079.8167L58.5589%2090.4103ZM53.2896%20120.454L63.8873%2094.9257L75.0178%20104.304L53.2896%20120.454ZM66.5515%2088.5L87.6284%2037.616L104.324%2082.3638L80.4055%20100.136L66.5515%2088.5ZM85.6155%20104.593L106.752%2088.8474L120.369%20125.259L125.046%20137.763L85.6155%20104.593Z%22%20fill%3D%22%23BDBDBD%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%20%20%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M137.419%200H135.757V28.5999C135.757%2031.953%20137.089%2035.1687%20139.46%2037.5397C141.831%2039.9107%20145.047%2041.2427%20148.4%2041.2427H177V39.581L137.419%200Z%22%20fill%3D%22%23E0E0E0%22%2F%3E%0A%3C%2Fsvg%3E%0A", _ = (e, t, n) => t?.imageSettings.image?.mediaItemId ? e.daedalus.mediaApi.getUrl(t?.imageSettings.image?.mediaItemId) : t?.imageSettings.image?.imageUrl ? t?.imageSettings.image?.imageUrl : t?.imageSettings.image?.imageVariable && n?.[t?.imageSettings.image?.imageVariable]?.value ? `${n?.[t?.imageSettings.image?.imageVariable]?.value}` : "", v = (e, n, r) => ({
14
- imageSrc: _(e, n, r),
15
- imageFit: n?.imageSettings.image?.imageFit ?? t.Contain,
16
- opacity: n?.imageSettings.opacity ?? 1,
17
- saturation: n?.imageSettings.saturation ?? 1,
18
- blur: n?.imageSettings.blur ?? 0,
19
- shadow: n?.imageSettings.shadow ?? !1
20
- }), y = s({
15
+ var _ = "data:image/svg+xml,%3Csvg%20width%3D%22177%22%20height%3D%22177%22%20viewBox%3D%220%200%20177%20177%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cpath%20d%3D%22M177%2041.2427V164.357C177%20167.71%20175.668%20170.926%20173.297%20173.297C170.926%20175.668%20167.71%20177%20164.357%20177H12.6429C9.28976%20177%206.074%20175.668%203.70301%20173.297C1.33201%20170.926%200%20167.71%200%20164.357V12.6429C0%209.28976%201.33201%206.074%203.70301%203.70301C6.074%201.33201%209.28976%200%2012.6429%200L135.757%200C139.11%200%20152.289%2016.5319%20154.66%2018.9029C157.031%2021.2739%20177%2037.8896%20177%2041.2427Z%22%20fill%3D%22%23F2F2F2%22%2F%3E%0A%20%20%3Cmask%20id%3D%22mask0%22%20mask-type%3D%22alpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%2225%22%20y%3D%2225%22%20width%3D%22127%22%20height%3D%22127%22%3E%0A%20%20%20%20%3Crect%20x%3D%2225.2857%22%20y%3D%2225.2857%22%20width%3D%22126.429%22%20height%3D%22126.429%22%20fill%3D%22%23F2F2F2%22%2F%3E%0A%20%20%3C%2Fmask%3E%0A%20%20%3Cg%20mask%3D%22url(%23mask0)%22%3E%0A%20%20%20%20%3Cpath%20d%3D%22M135.703%20147.315L126.644%20123.059L90.9439%2027.4276C90.4703%2026.1541%2089.227%2025.2857%2087.8653%2025.2857C86.4444%2025.2857%2085.201%2026.0962%2084.7274%2027.3118L61.2231%2083.9847L44.3497%2069.7441C43.3432%2068.8758%2041.8631%2068.7021%2040.679%2069.281C39.4949%2069.8599%2038.7252%2071.0756%2038.8436%2072.407L42.3367%20130.469C42.3959%20131.685%2043.1656%20132.727%2044.2905%20133.248C45.4154%20133.769%2046.7179%20133.595%2047.7244%20132.901L80.287%20108.645L130.493%20150.904C131.144%20151.425%20131.914%20151.714%20132.683%20151.714C133.335%20151.714%20133.986%20151.541%20134.578%20151.135C135.703%20150.267%20136.236%20148.704%20135.703%20147.315ZM58.5589%2090.4103L48.0796%20115.65L45.9482%2079.8167L58.5589%2090.4103ZM53.2896%20120.454L63.8873%2094.9257L75.0178%20104.304L53.2896%20120.454ZM66.5515%2088.5L87.6284%2037.616L104.324%2082.3638L80.4055%20100.136L66.5515%2088.5ZM85.6155%20104.593L106.752%2088.8474L120.369%20125.259L125.046%20137.763L85.6155%20104.593Z%22%20fill%3D%22%23BDBDBD%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%20%20%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M137.419%200H135.757V28.5999C135.757%2031.953%20137.089%2035.1687%20139.46%2037.5397C141.831%2039.9107%20145.047%2041.2427%20148.4%2041.2427H177V39.581L137.419%200Z%22%20fill%3D%22%23E0E0E0%22%2F%3E%0A%3C%2Fsvg%3E%0A", v = (e, t, n) => t?.imageSettings.image?.mediaItemId ? e.daedalus.mediaApi.getUrl(t?.imageSettings.image?.mediaItemId) : t?.imageSettings.image?.imageUrl ? t?.imageSettings.image?.imageUrl : t?.imageSettings.image?.imageVariable && n?.[t?.imageSettings.image?.imageVariable]?.value ? `${n?.[t?.imageSettings.image?.imageVariable]?.value}` : "", y = (e, t, r) => ({
16
+ imageSrc: v(e, t, r),
17
+ imageFit: t?.imageSettings.image?.imageFit ?? n.Contain,
18
+ opacity: t?.imageSettings.opacity ?? 1,
19
+ saturation: t?.imageSettings.saturation ?? 1,
20
+ blur: t?.imageSettings.blur ?? 0,
21
+ shadow: t?.imageSettings.shadow ?? !1
22
+ }), b = s({
21
23
  singleImageContainer: {
22
24
  display: "flex",
23
25
  height: "100%",
@@ -35,19 +37,19 @@ var g = "data:image/svg+xml,%3Csvg%20width%3D%22177%22%20height%3D%22177%22%20vi
35
37
  }
36
38
  },
37
39
  addGalleryButton: {
38
- ...d.normal14,
40
+ ...o.normal14,
39
41
  padding: "10px 20px",
40
- background: n.white,
42
+ background: t.white,
41
43
  borderRadius: 4,
42
- border: `1px solid ${n.grey3}`,
43
- color: n.secondaryPurple,
44
+ border: `1px solid ${t.grey3}`,
45
+ color: t.secondaryPurple,
44
46
  cursor: "pointer",
45
47
  display: "flex",
46
48
  justifyContent: "center",
47
49
  alignItems: "center"
48
50
  },
49
51
  buttonIcon: { marginRight: 5 }
50
- }), b = s({
52
+ }), x = s({
51
53
  mainContainer: {
52
54
  display: "flex",
53
55
  flexDirection: "column",
@@ -75,24 +77,24 @@ var g = "data:image/svg+xml,%3Csvg%20width%3D%22177%22%20height%3D%22177%22%20vi
75
77
  "&.fill": { objectFit: "fill" },
76
78
  "&.none": { objectFit: "none" }
77
79
  }
78
- }), x = a(), S = (e) => o({
79
- contain: e === t.Contain,
80
- cover: e === t.Cover,
81
- fill: e === t.Fill,
82
- none: e === t.None
83
- }), C = ({ imageSrc: e, imageFit: t, opacity: n, saturation: r, blur: i, shadow: a, onLoadCallback: s }) => {
84
- let c = b(), l = a ? "drop-shadow(0px 3px 6px rgba(0,0,0,0.25))" : "";
85
- return /* @__PURE__ */ (0, x.jsx)("div", {
80
+ }), S = f(), C = (e) => i({
81
+ contain: e === n.Contain,
82
+ cover: e === n.Cover,
83
+ fill: e === n.Fill,
84
+ none: e === n.None
85
+ }), w = ({ imageSrc: e, imageFit: t, opacity: n, saturation: r, blur: a, shadow: o, onLoadCallback: s }) => {
86
+ let c = x(), l = o ? "drop-shadow(0px 3px 6px rgba(0,0,0,0.25))" : "";
87
+ return /* @__PURE__ */ (0, S.jsx)("div", {
86
88
  className: c.mainContainer,
87
- children: /* @__PURE__ */ (0, x.jsx)("div", {
89
+ children: /* @__PURE__ */ (0, S.jsx)("div", {
88
90
  className: c.imageContainer,
89
- children: /* @__PURE__ */ (0, x.jsx)("img", {
90
- className: o({
91
+ children: /* @__PURE__ */ (0, S.jsx)("img", {
92
+ className: i({
91
93
  [c.image]: !0,
92
- [S(t)]: !0
94
+ [C(t)]: !0
93
95
  }),
94
96
  style: {
95
- filter: `blur(${i}px) saturate(${r}) ${l}`,
97
+ filter: `blur(${a}px) saturate(${r}) ${l}`,
96
98
  opacity: n
97
99
  },
98
100
  alt: "",
@@ -103,38 +105,38 @@ var g = "data:image/svg+xml,%3Csvg%20width%3D%22177%22%20height%3D%22177%22%20vi
103
105
  })
104
106
  })
105
107
  });
106
- }, w = r(({ vSpec: e }) => {
107
- let t = i(), r = y(), { variablesDict: a } = l(), o = v(t, e, a), s = u();
108
- return (0, h.useEffect)(() => {
109
- (!e || !o.imageSrc) && t.daedalus.objectCapabilities.editable && s();
110
- }, [e, o.imageSrc]), !e || !o.imageSrc ? t.daedalus.objectCapabilities.editable ? /* @__PURE__ */ (0, x.jsx)("div", {
111
- className: r.previewImageContainer,
112
- children: /* @__PURE__ */ (0, x.jsxs)("button", {
108
+ }, T = c(({ vSpec: e }) => {
109
+ let n = u(), i = b(), { variablesDict: a } = l(), o = e && r(e) ? y(n, e, a) : null, s = d();
110
+ return (0, g.useEffect)(() => {
111
+ !o?.imageSrc && n.daedalus.objectCapabilities.editable && s();
112
+ }, [e, o?.imageSrc]), o?.imageSrc ? /* @__PURE__ */ (0, S.jsx)("div", {
113
+ className: i.singleImageContainer,
114
+ children: /* @__PURE__ */ (0, S.jsx)(w, {
115
+ ...o,
116
+ onLoadCallback: s
117
+ })
118
+ }) : n.daedalus.objectCapabilities.editable ? /* @__PURE__ */ (0, S.jsx)("div", {
119
+ className: i.previewImageContainer,
120
+ children: /* @__PURE__ */ (0, S.jsxs)("button", {
113
121
  "data-testid": "open-media-gallery-button",
114
- className: r.addGalleryButton,
122
+ className: i.addGalleryButton,
115
123
  onClick: () => {
116
- t.emitEvent(f.SET_PROPERTY_PANEL_OBJECT_TAB, "ITEM"), t.emitEvent(m.OpenMediaPicker);
124
+ n.emitEvent(m.SET_PROPERTY_PANEL_OBJECT_TAB, "ITEM"), n.emitEvent(h.OpenMediaPicker);
117
125
  },
118
- children: [/* @__PURE__ */ (0, x.jsx)(p, {
119
- fill: n.mainDarkNavy,
126
+ children: [/* @__PURE__ */ (0, S.jsx)(p, {
127
+ fill: t.mainDarkNavy,
120
128
  size: 16,
121
- className: r.buttonIcon
129
+ className: i.buttonIcon
122
130
  }), "Add from the Gallery"]
123
131
  })
124
- }) : /* @__PURE__ */ (0, x.jsx)("div", {
125
- className: r.previewImageContainer,
126
- children: /* @__PURE__ */ (0, x.jsx)("img", {
127
- src: g,
132
+ }) : /* @__PURE__ */ (0, S.jsx)("div", {
133
+ className: i.previewImageContainer,
134
+ children: /* @__PURE__ */ (0, S.jsx)("img", {
135
+ src: _,
128
136
  alt: "no image",
129
137
  onLoad: s,
130
138
  onError: s
131
139
  })
132
- }) : /* @__PURE__ */ (0, x.jsx)("div", {
133
- className: r.singleImageContainer,
134
- children: /* @__PURE__ */ (0, x.jsx)(C, {
135
- ...o,
136
- onLoadCallback: s
137
- })
138
140
  });
139
141
  });
140
- export { w as Image };
142
+ export { T as Image };