@useinsider/guido 3.21.0 → 3.21.1-beta.18ab939

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 (33) hide show
  1. package/README.md +34 -4
  2. package/dist/components/Guido.vue.js +3 -3
  3. package/dist/components/Guido.vue2.js +118 -108
  4. package/dist/composables/useEditorOpenMetrics.js +164 -0
  5. package/dist/composables/useStripo.js +94 -82
  6. package/dist/config/compiler/htmlCompilerRules.js +1 -1
  7. package/dist/extensions/Blocks/Recommendation/block.js +209 -139
  8. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +18 -23
  9. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +171 -141
  10. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +68 -59
  11. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +249 -248
  12. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +62 -45
  13. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +52 -31
  14. package/dist/guido.css +1 -1
  15. package/dist/library.js +12 -10
  16. package/dist/package.json.js +6 -4
  17. package/dist/public/prefetchRuntime.js +4 -0
  18. package/dist/src/composables/useEditorOpenMetrics.d.ts +27 -0
  19. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +23 -7
  20. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +6 -0
  21. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +5 -2
  22. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +6 -0
  23. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +4 -0
  24. package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +11 -0
  25. package/dist/src/library.d.ts +1 -0
  26. package/dist/src/public/prefetchRuntime.d.ts +1 -0
  27. package/dist/src/utils/runtimePrefetch.d.ts +4 -0
  28. package/dist/src/utils/stripoRuntime.d.ts +2 -0
  29. package/dist/static/stripo-runtime-manifest.json.js +9 -0
  30. package/dist/static/styles/components/tabs.css.js +5 -0
  31. package/dist/utils/runtimePrefetch.js +26 -0
  32. package/dist/utils/stripoRuntime.js +9 -0
  33. package/package.json +7 -2
@@ -1,455 +1,456 @@
1
1
  import { ModificationDescription as C } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { RecommendationBlockId as m } from "../../constants/blockIds.js";
3
- import { CURRENCY_ATTR as b, CSS_CLASS_SKIP_COMPILE as W, MOBILE_CONTAINER_SELECTOR as L, ATTR_DATA_CARD_COMPOSITION as q, DESKTOP_CONTAINER_SELECTOR as w, CONTAINER_SELECTOR as Y, MOBILE_ROW_SELECTOR as k, ATTR_DATA_CUSTOM_ATTRIBUTES as h, ATTR_PRODUCT_ATTR as z, PRODUCT_ATTRIBUTE_PREFIX as M } from "../../constants/selectors.js";
3
+ import { CURRENCY_ATTR as b, CSS_CLASS_SKIP_COMPILE as Y, MOBILE_CONTAINER_SELECTOR as w, ATTR_DATA_CARD_COMPOSITION as q, DESKTOP_CONTAINER_SELECTOR as k, CONTAINER_SELECTOR as z, MOBILE_ROW_SELECTOR as x, ATTR_DATA_CUSTOM_ATTRIBUTES as M, ATTR_PRODUCT_ATTR as J, PRODUCT_ATTRIBUTE_PREFIX as I } from "../../constants/selectors.js";
4
4
  import { RecommendationConfigService as g } from "../../services/configService.js";
5
5
  import { useRecommendationExtensionStore as E } from "../../store/recommendation.js";
6
- import { prepareProductRows as x } from "../../templates/index.js";
7
- import { captureStyles as D } from "../../utils/captureStyleTemplates.js";
8
- import { normalizeCompositionKeys as H, normalizeCustomAttrValues as J } from "../../utils/compositionKeys.js";
9
- import { formatPrice as X } from "../../utils/priceFormatter.js";
10
- import { getDefaultProducts as U, DEFAULT_CARD_COMPOSITION as I, sanitizeImageUrl as Q, isSamePrice as Z, toDisplayableAttributeValue as ee } from "../../templates/utils.js";
11
- const O = "recommendation-block-v2";
12
- function P(t) {
13
- if (!t)
6
+ import { prepareProductRows as D } from "../../templates/index.js";
7
+ import { captureStyles as H } from "../../utils/captureStyleTemplates.js";
8
+ import { normalizeCompositionKeys as U, normalizeCustomAttrValues as X } from "../../utils/compositionKeys.js";
9
+ import { formatPrice as Q } from "../../utils/priceFormatter.js";
10
+ import { getDefaultProducts as B, DEFAULT_CARD_COMPOSITION as O, sanitizeImageUrl as Z, isSamePrice as ee, toDisplayableAttributeValue as te } from "../../templates/utils.js";
11
+ const L = "recommendation-block-v2";
12
+ function P(e) {
13
+ if (!e)
14
14
  return null;
15
- if ("getAttribute" in t) {
16
- const e = t.getAttribute("class");
17
- if (e && e.includes(O))
18
- return t;
15
+ if ("getAttribute" in e) {
16
+ const t = e.getAttribute("class");
17
+ if (t && t.includes(L))
18
+ return e;
19
19
  }
20
- return "querySelector" in t ? t.querySelector(`.${O}`) ?? null : null;
20
+ return "querySelector" in e ? e.querySelector(`.${L}`) ?? null : null;
21
21
  }
22
- function te(t) {
23
- const e = P(t);
24
- return !e || !("getAttribute" in e) ? !1 : (e.getAttribute("class") ?? "").split(/\s+/).includes(W);
22
+ function ne(e) {
23
+ const t = P(e);
24
+ return !t || !("getAttribute" in t) ? !1 : (t.getAttribute("class") ?? "").split(/\s+/).includes(Y);
25
25
  }
26
- function T(t) {
27
- const e = P(t);
28
- if (!e || !("getAttribute" in e))
26
+ function T(e) {
27
+ const t = P(e);
28
+ if (!t || !("getAttribute" in t))
29
29
  return "grid";
30
- const n = e.getAttribute("data-layout");
30
+ const n = t.getAttribute("data-layout");
31
31
  return n === "list" || n === "horizontal" ? "list" : "grid";
32
32
  }
33
- function B(t, e = {}) {
34
- const n = P(t);
33
+ function $(e, t = {}) {
34
+ const n = P(e);
35
35
  if (!n || !("getAttribute" in n))
36
- return I;
36
+ return O;
37
37
  const o = n.getAttribute(q);
38
- return o ? H(
38
+ return o ? U(
39
39
  o.split(",").filter(Boolean),
40
40
  n,
41
- e
42
- ) : I;
41
+ t
42
+ ) : O;
43
43
  }
44
- function $(t) {
45
- if (!t || !("childNodes" in t))
44
+ function v(e) {
45
+ if (!e || !("childNodes" in e))
46
46
  return null;
47
- const e = t.childNodes(), n = e.find(
47
+ const t = e.childNodes(), n = t.find(
48
48
  (o) => "getType" in o && o.getType() === "text"
49
49
  );
50
- return n || e.reduce((o, r) => o || !("getType" in r) || r.getType() === "text" ? o : $(r), null);
50
+ return n || t.reduce((o, r) => o || !("getType" in r) || r.getType() === "text" ? o : v(r), null);
51
51
  }
52
- function S(t, e, n) {
53
- const o = $(e);
54
- return !o || "getTextContent" in o && o.getTextContent() === n ? !1 : (t.modifyHtml(o).setText(n), !0);
52
+ function S(e, t, n) {
53
+ const o = v(t);
54
+ return !o || "getTextContent" in o && o.getTextContent() === n ? !1 : (e.modifyHtml(o).setText(n), !0);
55
55
  }
56
- function A(t, e, n, o) {
57
- return "getAttribute" in e && e.getAttribute(n) === o ? !1 : (t.modifyHtml(e).setAttribute(n, o), !0);
56
+ function A(e, t, n, o) {
57
+ return "getAttribute" in t && t.getAttribute(n) === o ? !1 : (e.modifyHtml(t).setAttribute(n, o), !0);
58
58
  }
59
- function v(t, e) {
60
- return t && t.length > 0 ? t : e.length > 0 ? e : U();
59
+ function j(e, t) {
60
+ return e && e.length > 0 ? e : t.length > 0 ? t : B();
61
61
  }
62
- function j(t) {
63
- if (typeof t == "number")
64
- return `0 ${t / 2}px`;
62
+ function F(e) {
63
+ if (typeof e == "number")
64
+ return `0 ${e / 2}px`;
65
65
  }
66
- function ne(t) {
67
- const { currentNode: e, documentModifier: n } = t;
68
- if (!e || !("querySelector" in e))
66
+ function oe(e) {
67
+ const { currentNode: t, documentModifier: n } = e;
68
+ if (!t || !("querySelector" in t))
69
69
  return !1;
70
- const o = e.querySelector(k);
70
+ const o = t.querySelector(x);
71
71
  return o ? (n.modifyHtml(o).setInnerHtml(""), !0) : !1;
72
72
  }
73
- function oe(t) {
74
- return "getOuterHTML" in t && typeof t.getOuterHTML == "function" ? t.getOuterHTML() : "";
73
+ function re(e) {
74
+ return "getOuterHTML" in e && typeof e.getOuterHTML == "function" ? e.getOuterHTML() : "";
75
75
  }
76
- function re(t) {
77
- const e = t.querySelector(".container");
78
- return !e || !("childNodes" in e) ? null : e.childNodes().find((o) => "getTagName" in o && o.getTagName() === "tbody") ?? e.querySelector("tbody") ?? null;
76
+ function ie(e) {
77
+ const t = e.querySelector(".container");
78
+ return !t || !("childNodes" in t) ? null : t.childNodes().find((o) => "getTagName" in o && o.getTagName() === "tbody") ?? t.querySelector("tbody") ?? null;
79
79
  }
80
- function ie(t, e, n) {
81
- const o = re(t);
80
+ function le(e, t, n) {
81
+ const o = ie(e);
82
82
  if (!o || !("childNodes" in o))
83
83
  return;
84
- const r = o.childNodes().map(oe).join(""), s = `<tr class="ins-recommendation-mobile-row">${n}</tr>`;
85
- e.modifyHtml(o).setInnerHtml(r + s), e.apply(new C("Added mobile product row"));
84
+ const r = o.childNodes().map(re).join(""), s = `<tr class="ins-recommendation-mobile-row">${n}</tr>`;
85
+ t.modifyHtml(o).setInnerHtml(r + s), t.apply(new C("Added mobile product row"));
86
86
  }
87
- function F(t, e = {}) {
87
+ function K(e, t = {}) {
88
88
  const {
89
89
  currentNode: n,
90
90
  documentModifier: o,
91
91
  products: r,
92
92
  layout: s,
93
- composition: l
94
- } = t;
93
+ composition: i
94
+ } = e;
95
95
  if (!n || !("querySelector" in n))
96
96
  return !1;
97
- const u = s ?? T(n), i = g.getConfig(n);
98
- if (u === "list" || !i.mobileLayoutEnabled)
99
- return ne({ currentNode: n, documentModifier: o });
100
- const c = E(), a = v(r, c.recommendationProducts), f = l ?? B(n, c.filterList), p = `<td><table class="ins-recommendation-product-container ins-recommendation-mobile-container" width="100%" cellpadding="0" cellspacing="0" border="0">${x(a, u, {
101
- productsPerRow: i.mobileCardsInRow,
102
- composition: f,
103
- filterList: c.filterList,
104
- priceInline: !i.priceMovedToNextLine,
97
+ const u = s ?? T(n), l = g.getConfig(n), c = e.mobileLayoutEnabled ?? l.mobileLayoutEnabled;
98
+ if (u === "list" || !c)
99
+ return oe({ currentNode: n, documentModifier: o });
100
+ const f = E(), a = j(r, f.recommendationProducts), d = i ?? $(n, f.filterList), y = `<td><table class="ins-recommendation-product-container ins-recommendation-mobile-container" width="100%" cellpadding="0" cellspacing="0" border="0">${D(a, u, {
101
+ productsPerRow: l.mobileCardsInRow,
102
+ composition: d,
103
+ filterList: f.filterList,
104
+ priceInline: !l.priceMovedToNextLine,
105
105
  // Match the initial render's gutter so a regeneration never changes block height (SD-143023, #386).
106
- cellPadding: j(i.mobileColumnSpacing),
107
- rowSpacingPx: i.mobileRowSpacing,
108
- ...e
109
- })}</table></td>`, y = n.querySelector(k);
110
- return y ? (o.modifyHtml(y).setInnerHtml(p), !0) : (ie(n, o, p), !1);
106
+ cellPadding: F(l.mobileColumnSpacing),
107
+ rowSpacingPx: l.mobileRowSpacing,
108
+ ...t
109
+ })}</table></td>`, h = n.querySelector(x);
110
+ return h ? (o.modifyHtml(h).setInnerHtml(y), !0) : (le(n, o, y), !1);
111
111
  }
112
- function Te(t) {
113
- F(t, D(t.currentNode)) && t.documentModifier.apply(new C("Updated mobile product rows"));
112
+ function Re(e) {
113
+ K(e, H(e.currentNode)) && e.documentModifier.apply(new C("Updated mobile product rows"));
114
114
  }
115
- function le(t, e = {}) {
115
+ function ce(e, t = {}) {
116
116
  const {
117
117
  currentNode: n,
118
118
  documentModifier: o,
119
119
  products: r,
120
120
  layout: s,
121
- composition: l
122
- } = t;
121
+ composition: i
122
+ } = e;
123
123
  if (!n || !("querySelector" in n))
124
124
  return !1;
125
- const u = n.querySelector(w) ?? n.querySelector(Y);
125
+ const u = n.querySelector(k) ?? n.querySelector(z);
126
126
  if (!u)
127
127
  return !1;
128
- const i = E(), c = v(r, i.recommendationProducts), { cardsInRow: a } = g.getConfig(n), f = l ?? B(n, i.filterList), d = s ?? T(n), p = g.getConfig(n), y = x(c, d, {
129
- productsPerRow: a,
130
- composition: f,
131
- filterList: i.filterList,
128
+ const l = E(), c = j(r, l.recommendationProducts), { cardsInRow: f } = g.getConfig(n), a = i ?? $(n, l.filterList), d = s ?? T(n), p = g.getConfig(n), y = D(c, d, {
129
+ productsPerRow: f,
130
+ composition: a,
131
+ filterList: l.filterList,
132
132
  priceInline: !p.priceMovedToNextLine,
133
133
  // Match the initial render's gutter so a regeneration never changes block height (SD-143023, #386).
134
- cellPadding: j(p.columnSpacing),
134
+ cellPadding: F(p.columnSpacing),
135
135
  rowSpacingPx: p.rowSpacing,
136
- ...e
136
+ ...t
137
137
  });
138
138
  return o.modifyHtml(u).setInnerHtml(y), !0;
139
139
  }
140
- function ce(t) {
141
- if (!t)
140
+ function ue(e) {
141
+ if (!e)
142
142
  return null;
143
143
  try {
144
- const e = JSON.parse(t);
145
- return Array.isArray(e) ? e.map((n) => String(n)) : null;
144
+ const t = JSON.parse(e);
145
+ return Array.isArray(t) ? t.map((n) => String(n)) : null;
146
146
  } catch {
147
147
  return null;
148
148
  }
149
149
  }
150
- function ue(t, e, n) {
151
- const o = P(t);
150
+ function se(e, t, n) {
151
+ const o = P(e);
152
152
  if (n || !o || !("getAttribute" in o))
153
153
  return !1;
154
154
  const r = o.getAttribute(q);
155
155
  if (!r)
156
156
  return !1;
157
- const s = E(), l = r.split(",").filter(Boolean), u = H(l, o, s.filterList), i = [], c = u.join(",") !== l.join(",");
158
- c && i.push([q, u.join(",")]);
159
- const a = ce(
160
- o.getAttribute(h)
161
- ), f = a && J(a, o, s.filterList);
162
- if (a && f && f.join(",") !== a.join(",") && i.push([h, JSON.stringify(f)]), i.length === 0)
157
+ const s = E(), i = r.split(",").filter(Boolean), u = U(i, o, s.filterList), l = [], c = u.join(",") !== i.join(",");
158
+ c && l.push([q, u.join(",")]);
159
+ const f = ue(
160
+ o.getAttribute(M)
161
+ ), a = f && X(f, o, s.filterList);
162
+ if (f && a && a.join(",") !== f.join(",") && l.push([M, JSON.stringify(a)]), l.length === 0)
163
163
  return !1;
164
- if (i.forEach(([d, p]) => {
165
- e.modifyHtml(o).setAttribute(d, p);
166
- }), c && g.hasConfig(t)) {
164
+ if (l.forEach(([d, p]) => {
165
+ t.modifyHtml(o).setAttribute(d, p);
166
+ }), c && g.hasConfig(e)) {
167
167
  const d = {
168
- ...g.getConfig(t),
168
+ ...g.getConfig(e),
169
169
  composition: u
170
170
  };
171
- e.modifyHtml(t).setNodeConfig(d);
171
+ t.modifyHtml(e).setNodeConfig(d);
172
172
  }
173
173
  return !0;
174
174
  }
175
- function Re(t) {
175
+ function qe(e) {
176
176
  const {
177
- currentNode: e,
177
+ currentNode: t,
178
178
  documentModifier: n,
179
179
  afterRegenerate: o,
180
180
  products: r,
181
181
  layout: s,
182
- composition: l,
183
- skipStylePreservation: u
184
- } = t;
185
- if (!e)
182
+ composition: i,
183
+ skipStylePreservation: u,
184
+ description: l
185
+ } = e;
186
+ if (!t)
186
187
  return !1;
187
- const i = u ? {} : D(e), c = {
188
- currentNode: e,
188
+ const c = u ? {} : H(t), f = {
189
+ currentNode: t,
189
190
  documentModifier: n,
190
191
  products: r,
191
192
  layout: s,
192
- composition: l
193
+ composition: i
193
194
  };
194
- let a = le(c, i);
195
- return a = F(c, i) || a, a && (ue(e, n, l), n.apply(new C("Regenerate products with styles"))), o == null || o(), a;
195
+ let a = ce(f, c);
196
+ return a = K(f, c) || a, a && (se(t, n, i), n.apply(new C(l ?? "Regenerate products with styles"))), o == null || o(), a;
196
197
  }
197
- function qe(t, e) {
198
- return t.length === e ? t : t.length > e ? t.slice(0, e) : [...t, ...U(e - t.length)];
198
+ function he(e, t) {
199
+ return e.length === t ? e : e.length > t ? e.slice(0, t) : [...e, ...B(t - e.length)];
199
200
  }
200
- function K() {
201
- const t = E(), { currencySettings: e } = t.recommendationConfigs, n = parseInt(e.decimalCount);
201
+ function V() {
202
+ const e = E(), { currencySettings: t } = e.recommendationConfigs, n = parseInt(t.decimalCount);
202
203
  return {
203
- code: e.value,
204
- symbol: e.symbol,
205
- alignment: e.alignment === "0" ? "before" : "after",
204
+ code: t.value,
205
+ symbol: t.symbol,
206
+ alignment: t.alignment === "0" ? "before" : "after",
206
207
  decimalCount: Number.isNaN(n) ? 2 : n,
207
- decimalSeparator: e.decimalSeparator,
208
- thousandSeparator: e.thousandSeparator
208
+ decimalSeparator: t.decimalSeparator,
209
+ thousandSeparator: t.thousandSeparator
209
210
  };
210
211
  }
211
- function R(t, e = "price") {
212
- const n = K(), o = t[e], r = (o == null ? void 0 : o[n.code]) ?? Object.values(o ?? {})[0] ?? 0;
213
- return X({
212
+ function R(e, t = "price") {
213
+ const n = V(), o = e[t], r = (o == null ? void 0 : o[n.code]) ?? Object.values(o ?? {})[0] ?? 0;
214
+ return Q({
214
215
  price: r,
215
216
  currency: n
216
217
  });
217
218
  }
218
- function se(t) {
219
- var s, l;
220
- const e = K(), n = ((s = t.original_price) == null ? void 0 : s[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, o = ((l = t.price) == null ? void 0 : l[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, r = n > 0 ? Math.round((n - o) / n * 100) : 0;
219
+ function ae(e) {
220
+ var s, i;
221
+ const t = V(), n = ((s = e.original_price) == null ? void 0 : s[t.code]) ?? Object.values(e.original_price ?? {})[0] ?? 0, o = ((i = e.price) == null ? void 0 : i[t.code]) ?? Object.values(e.price ?? {})[0] ?? 0, r = n > 0 ? Math.round((n - o) / n * 100) : 0;
221
222
  return r > 0 ? `-${r}%` : "0%";
222
223
  }
223
- function V(t) {
224
- const { documentModifier: e, product: n, priceEl: o, oldPriceEl: r, omnibusPriceEl: s, omnibusDiscountEl: l } = t;
224
+ function G(e) {
225
+ const { documentModifier: t, product: n, priceEl: o, oldPriceEl: r, omnibusPriceEl: s, omnibusDiscountEl: i } = e;
225
226
  let u = !1;
226
227
  if (o && "querySelector" in o) {
227
- const i = o.querySelector("strong") ?? o.querySelector("p"), c = R(n, "price");
228
- S(e, i ?? null, c) && (u = !0);
228
+ const l = o.querySelector("strong") ?? o.querySelector("p"), c = R(n, "price");
229
+ S(t, l ?? null, c) && (u = !0);
229
230
  }
230
231
  if (r && "querySelector" in r) {
231
- const i = r.querySelector("strong") ?? r.querySelector("p"), c = R(n, "original_price");
232
- S(e, i ?? null, c) && (u = !0), A(e, r, "data-same-price", String(Z(n))) && (u = !0);
232
+ const l = r.querySelector("strong") ?? r.querySelector("p"), c = R(n, "original_price");
233
+ S(t, l ?? null, c) && (u = !0), A(t, r, "data-same-price", String(ee(n))) && (u = !0);
233
234
  }
234
235
  if (s && "querySelector" in s) {
235
- const i = s.querySelector(".omnibus-price-value") ?? null, c = R(n, "original_price");
236
- S(e, i, c) && (u = !0);
236
+ const l = s.querySelector(".omnibus-price-value") ?? null, c = R(n, "original_price");
237
+ S(t, l, c) && (u = !0);
237
238
  }
238
- if (l && "querySelector" in l) {
239
- const i = l.querySelector(".omnibus-discount-value") ?? null, c = se(n);
240
- S(e, i, c) && (u = !0);
239
+ if (i && "querySelector" in i) {
240
+ const l = i.querySelector(".omnibus-discount-value") ?? null, c = ae(n);
241
+ S(t, l, c) && (u = !0);
241
242
  }
242
243
  return u;
243
244
  }
244
- function ae(t) {
245
+ function fe(e) {
245
246
  const {
246
- documentModifier: e,
247
+ documentModifier: t,
247
248
  product: n,
248
249
  imageEl: o,
249
250
  nameEl: r,
250
251
  priceEl: s,
251
- oldPriceEl: l,
252
+ oldPriceEl: i,
252
253
  omnibusPriceEl: u,
253
- omnibusDiscountEl: i,
254
+ omnibusDiscountEl: l,
254
255
  buttonEl: c
255
- } = t;
256
- let a = !1;
256
+ } = e;
257
+ let f = !1;
257
258
  if (o && "querySelector" in o) {
258
- const f = o.querySelector("img");
259
- if (f) {
260
- const p = A(e, f, "src", Q(n.image_url)), y = A(e, f, "alt", n.name);
261
- a = a || p || y;
259
+ const a = o.querySelector("img");
260
+ if (a) {
261
+ const p = A(t, a, "src", Z(n.image_url)), y = A(t, a, "alt", n.name);
262
+ f = f || p || y;
262
263
  }
263
264
  const d = o.querySelector("a");
264
- d && A(e, d, "href", n.url) && (a = !0);
265
+ d && A(t, d, "href", n.url) && (f = !0);
265
266
  }
266
267
  if (r && "querySelector" in r) {
267
- const f = r.querySelector("strong") ?? r.querySelector("p");
268
- S(e, f ?? null, n.name) && (a = !0);
268
+ const a = r.querySelector("strong") ?? r.querySelector("p");
269
+ S(t, a ?? null, n.name) && (f = !0);
269
270
  }
270
- if (V({
271
- documentModifier: e,
271
+ if (G({
272
+ documentModifier: t,
272
273
  product: n,
273
274
  priceEl: s,
274
- oldPriceEl: l,
275
+ oldPriceEl: i,
275
276
  omnibusPriceEl: u,
276
- omnibusDiscountEl: i
277
- }) && (a = !0), c && "querySelector" in c) {
278
- const f = c.querySelector("a.es-button") || c.querySelector("a");
279
- f && A(e, f, "href", n.url) && (a = !0);
277
+ omnibusDiscountEl: l
278
+ }) && (f = !0), c && "querySelector" in c) {
279
+ const a = c.querySelector("a.es-button") || c.querySelector("a");
280
+ a && A(t, a, "href", n.url) && (f = !0);
280
281
  }
281
- return a;
282
+ return f;
282
283
  }
283
- function G(t) {
284
- return "querySelector" in t ? t.querySelector(w) ?? t : t;
284
+ function W(e) {
285
+ return "querySelector" in e ? e.querySelector(k) ?? e : e;
285
286
  }
286
- function fe(t, e) {
287
+ function de(e, t) {
287
288
  var o;
288
289
  let n;
289
- if (t.startsWith(M)) {
290
- const r = t.slice(M.length);
291
- n = (o = e.product_attributes) == null ? void 0 : o[r];
290
+ if (e.startsWith(I)) {
291
+ const r = e.slice(I.length);
292
+ n = (o = t.product_attributes) == null ? void 0 : o[r];
292
293
  } else
293
- n = e[t];
294
- return ee(n) || null;
294
+ n = t[e];
295
+ return te(n) || null;
295
296
  }
296
- function de(t, e, n) {
297
- if (!("querySelectorAll" in t))
297
+ function me(e, t, n) {
298
+ if (!("querySelectorAll" in e))
298
299
  return !1;
299
- const o = t.querySelectorAll(
300
+ const o = e.querySelectorAll(
300
301
  `[esd-extension-block-id="${m.CUSTOM_ATTRIBUTE}"]`
301
302
  );
302
303
  if (o.length === 0)
303
304
  return !1;
304
305
  const r = /* @__PURE__ */ new Map();
305
- o.forEach((l) => {
306
- if (!("getAttribute" in l))
306
+ o.forEach((i) => {
307
+ if (!("getAttribute" in i))
307
308
  return;
308
- const u = l.getAttribute(z);
309
+ const u = i.getAttribute(J);
309
310
  if (!u)
310
311
  return;
311
- const i = r.get(u) ?? [];
312
- i.push(l), r.set(u, i);
312
+ const l = r.get(u) ?? [];
313
+ l.push(i), r.set(u, l);
313
314
  });
314
315
  let s = !1;
315
- return r.forEach((l, u) => {
316
- const i = Math.min(l.length, n.length);
317
- l.slice(0, i).forEach((c, a) => {
316
+ return r.forEach((i, u) => {
317
+ const l = Math.min(i.length, n.length);
318
+ i.slice(0, l).forEach((c, f) => {
318
319
  if (!("querySelector" in c))
319
320
  return;
320
- const f = fe(u, n[a]);
321
- if (f === null)
321
+ const a = de(u, n[f]);
322
+ if (a === null)
322
323
  return;
323
324
  const d = c.querySelector("p") ?? null;
324
- S(e, d, f) && (s = !0);
325
+ S(t, d, a) && (s = !0);
325
326
  });
326
327
  }), s;
327
328
  }
328
- function _(t, e, n) {
329
- if (!("querySelectorAll" in t))
329
+ function _(e, t, n) {
330
+ if (!("querySelectorAll" in e))
330
331
  return !1;
331
- const o = t.querySelectorAll(
332
+ const o = e.querySelectorAll(
332
333
  `[esd-extension-block-id="${m.IMAGE}"]`
333
- ), r = t.querySelectorAll(
334
+ ), r = e.querySelectorAll(
334
335
  `[esd-extension-block-id="${m.NAME}"]`
335
- ), s = t.querySelectorAll(
336
+ ), s = e.querySelectorAll(
336
337
  `[esd-extension-block-id="${m.PRICE}"]`
337
- ), l = t.querySelectorAll(
338
+ ), i = e.querySelectorAll(
338
339
  `[esd-extension-block-id="${m.OLD_PRICE}"]`
339
- ), u = t.querySelectorAll(
340
+ ), u = e.querySelectorAll(
340
341
  `[esd-extension-block-id="${m.OMNIBUS_PRICE}"]`
341
- ), i = t.querySelectorAll(
342
+ ), l = e.querySelectorAll(
342
343
  `[esd-extension-block-id="${m.OMNIBUS_DISCOUNT}"]`
343
- ), c = t.querySelectorAll(
344
+ ), c = e.querySelectorAll(
344
345
  `[esd-extension-block-id="${m.BUTTON}"]`
345
- ), a = Math.min(o.length, n.length);
346
- let f = !1;
347
- for (let d = 0; d < a; d++) {
348
- const p = ae({
349
- documentModifier: e,
346
+ ), f = Math.min(o.length, n.length);
347
+ let a = !1;
348
+ for (let d = 0; d < f; d++) {
349
+ const p = fe({
350
+ documentModifier: t,
350
351
  product: n[d],
351
352
  imageEl: o[d] ?? null,
352
353
  nameEl: r[d] ?? null,
353
354
  priceEl: s[d] ?? null,
354
- oldPriceEl: l[d] ?? null,
355
+ oldPriceEl: i[d] ?? null,
355
356
  omnibusPriceEl: u[d] ?? null,
356
- omnibusDiscountEl: i[d] ?? null,
357
+ omnibusDiscountEl: l[d] ?? null,
357
358
  buttonEl: c[d] ?? null
358
359
  });
359
- f = f || p;
360
+ a = a || p;
360
361
  }
361
- return de(t, e, n) && (f = !0), f;
362
+ return me(e, t, n) && (a = !0), a;
362
363
  }
363
- function he(t) {
364
- const { currentNode: e, documentModifier: n, products: o, onApplied: r } = t;
365
- if (!e || !("querySelectorAll" in e))
364
+ function Me(e) {
365
+ const { currentNode: t, documentModifier: n, products: o, onApplied: r, description: s } = e;
366
+ if (!t || !("querySelectorAll" in t))
366
367
  return !1;
367
- const s = G(e);
368
- if (!("querySelectorAll" in s) || s.querySelectorAll(
368
+ const i = W(t);
369
+ if (!("querySelectorAll" in i) || i.querySelectorAll(
369
370
  `[esd-extension-block-id="${m.IMAGE}"]`
370
371
  ).length !== o.length)
371
372
  return !1;
372
- let u = _(s, n, o);
373
- const i = T(e), c = g.getConfig(e);
374
- if (i !== "list" && c.mobileLayoutEnabled && "querySelector" in e) {
375
- const a = e.querySelector(L);
373
+ let l = _(i, n, o);
374
+ const c = T(t), f = g.getConfig(t);
375
+ if (c !== "list" && f.mobileLayoutEnabled && "querySelector" in t) {
376
+ const a = t.querySelector(w);
376
377
  if (a) {
377
- const f = _(
378
+ const d = _(
378
379
  a,
379
380
  n,
380
381
  o
381
382
  );
382
- u = u || f;
383
+ l = l || d;
383
384
  }
384
385
  }
385
- return u && (n.apply(new C("Updated product content in-place")), r == null || r()), !0;
386
+ return l && (n.apply(new C(s ?? "Updated product content in-place")), r == null || r()), !0;
386
387
  }
387
- function N(t, e, n) {
388
- if (!("querySelectorAll" in t))
388
+ function N(e, t, n) {
389
+ if (!("querySelectorAll" in e))
389
390
  return !1;
390
- const o = t.querySelectorAll(
391
+ const o = e.querySelectorAll(
391
392
  `[esd-extension-block-id="${m.PRICE}"]`
392
- ), r = t.querySelectorAll(
393
+ ), r = e.querySelectorAll(
393
394
  `[esd-extension-block-id="${m.OLD_PRICE}"]`
394
- ), s = t.querySelectorAll(
395
+ ), s = e.querySelectorAll(
395
396
  `[esd-extension-block-id="${m.OMNIBUS_PRICE}"]`
396
- ), l = t.querySelectorAll(
397
+ ), i = e.querySelectorAll(
397
398
  `[esd-extension-block-id="${m.OMNIBUS_DISCOUNT}"]`
398
399
  ), u = Math.min(o.length, n.length);
399
- let i = !1;
400
+ let l = !1;
400
401
  for (let c = 0; c < u; c++)
401
- V({
402
- documentModifier: e,
402
+ G({
403
+ documentModifier: t,
403
404
  product: n[c],
404
405
  priceEl: o[c] ?? null,
405
406
  oldPriceEl: r[c] ?? null,
406
407
  omnibusPriceEl: s[c] ?? null,
407
- omnibusDiscountEl: l[c] ?? null
408
- }) && (i = !0);
409
- return i;
408
+ omnibusDiscountEl: i[c] ?? null
409
+ }) && (l = !0);
410
+ return l;
410
411
  }
411
- function Me(t) {
412
- const { currentNode: e, documentModifier: n } = t;
413
- if (!e || !("querySelectorAll" in e))
412
+ function Ie(e) {
413
+ const { currentNode: t, documentModifier: n } = e;
414
+ if (!t || !("querySelectorAll" in t))
414
415
  return !1;
415
- if (te(e))
416
+ if (ne(t))
416
417
  return !0;
417
418
  const r = E().recommendationProducts;
418
419
  if (r.length === 0)
419
420
  return !1;
420
- const s = G(e);
421
- let l = N(s, n, r);
422
- const u = T(e), i = g.getConfig(e);
423
- if (u !== "list" && i.mobileLayoutEnabled && "querySelector" in e) {
424
- const c = e.querySelector(L);
421
+ const s = W(t);
422
+ let i = N(s, n, r);
423
+ const u = T(t), l = g.getConfig(t);
424
+ if (u !== "list" && l.mobileLayoutEnabled && "querySelector" in t) {
425
+ const c = t.querySelector(w);
425
426
  if (c) {
426
- const a = N(c, n, r);
427
- l = l || a;
427
+ const f = N(c, n, r);
428
+ i = i || f;
428
429
  }
429
430
  }
430
- return l && n.apply(new C("Updated price formatting in-place")), l;
431
+ return i && n.apply(new C("Updated price formatting in-place")), i;
431
432
  }
432
- function Ie(t) {
433
- const { currentNode: e, documentModifier: n, currency: o } = t, r = P(e);
433
+ function Oe(e) {
434
+ const { currentNode: t, documentModifier: n, currency: o } = e, r = P(t);
434
435
  if (!r)
435
436
  return;
436
- const s = o.alignment === "before" ? "0" : "1", l = (u, i) => {
437
- n.modifyHtml(r).setAttribute(u, i);
437
+ const s = o.alignment === "before" ? "0" : "1", i = (u, l) => {
438
+ n.modifyHtml(r).setAttribute(u, l);
438
439
  };
439
- l(b.CURRENCY, o.code), l(b.SYMBOL, o.symbol), l(b.ALIGNMENT, s), l(b.THOUSAND_SEPARATOR, o.thousandSeparator), l(b.DECIMAL_SEPARATOR, o.decimalSeparator), l(b.DECIMAL_COUNT, o.decimalCount.toString()), n.apply(new C("Update currency attributes"));
440
+ i(b.CURRENCY, o.code), i(b.SYMBOL, o.symbol), i(b.ALIGNMENT, s), i(b.THOUSAND_SEPARATOR, o.thousandSeparator), i(b.DECIMAL_SEPARATOR, o.decimalSeparator), i(b.DECIMAL_COUNT, o.decimalCount.toString()), n.apply(new C("Update currency attributes"));
440
441
  }
441
442
  export {
442
- qe as adjustProductsToSize,
443
+ he as adjustProductsToSize,
443
444
  R as formatProductPrice,
444
445
  P as getBlockElement,
445
- B as getCardComposition,
446
+ $ as getCardComposition,
446
447
  T as getCurrentLayout,
447
- re as getMainContainerTbody,
448
- te as isPartnerManagedBlock,
449
- Te as regenerateMobileProductRows,
450
- Re as regenerateProductRowsWithStyles,
451
- Ie as setCurrencyAttributes,
452
- Me as updatePricesInPlace,
453
- he as updateProductContentInPlace,
454
- ae as updateSingleProductContent
448
+ ie as getMainContainerTbody,
449
+ ne as isPartnerManagedBlock,
450
+ Re as regenerateMobileProductRows,
451
+ qe as regenerateProductRowsWithStyles,
452
+ Oe as setCurrencyAttributes,
453
+ Ie as updatePricesInPlace,
454
+ Me as updateProductContentInPlace,
455
+ fe as updateSingleProductContent
455
456
  };