@useinsider/guido 3.1.1 → 3.2.0-beta.066130b
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.
- package/README.md +1 -0
- package/dist/@types/config/schemas.js +66 -54
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +91 -81
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +12 -20
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +51 -36
- package/dist/components/organisms/header/RightSlot.vue.js +10 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +16 -13
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -31
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +23 -22
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +37 -39
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +30 -41
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +15 -14
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +18 -17
- package/dist/composables/useActionsApi.js +4 -4
- package/dist/composables/useFullStoryBridge.js +14 -0
- package/dist/composables/useHtmlCompiler.js +23 -21
- package/dist/composables/useHtmlValidator.js +40 -38
- package/dist/composables/usePreviewMode.js +20 -16
- package/dist/composables/useRibbonOffset.js +21 -0
- package/dist/composables/useSave.js +23 -15
- package/dist/composables/useStripo.js +52 -47
- package/dist/composables/validators/useLiquidValidator.js +42 -0
- package/dist/config/compiler/liquidCompilerRules.js +15 -0
- package/dist/config/compiler/recommendationCompilerRules.js +162 -43
- package/dist/config/compiler/unsubscribeCompilerRules.js +37 -37
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +49 -46
- package/dist/config/i18n/en/tooltips.json.js +2 -1
- package/dist/config/migrator/checkboxMigrator.js +5 -3
- package/dist/config/migrator/radioButtonMigrator.js +14 -12
- package/dist/enums/extensions/recommendationBlock.js +14 -11
- package/dist/enums/onboarding.js +7 -2
- package/dist/enums/recommendation.js +2 -2
- package/dist/extensions/Blocks/CouponBlock/template.js +24 -13
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +38 -38
- package/dist/extensions/Blocks/Items/enums/productEnums.js +19 -7
- package/dist/extensions/Blocks/Recommendation/block.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +27 -11
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +185 -172
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +95 -93
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +75 -73
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +7 -5
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -29
- package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -7
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +3 -1
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +20 -20
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +57 -50
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
- package/dist/extensions/Blocks/Unsubscribe/block.js +11 -11
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +16 -17
- package/dist/extensions/DynamicContent/dynamic-content.js +17 -12
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +15 -15
- package/dist/services/stripoApi.js +9 -9
- package/dist/services/templateLibraryApi.js +48 -46
- package/dist/src/@types/config/index.d.ts +1 -1
- package/dist/src/@types/config/schemas.d.ts +28 -0
- package/dist/src/@types/config/types.d.ts +3 -1
- package/dist/src/@types/generic.d.ts +0 -1
- package/dist/src/@types/save-as-template.d.ts +1 -0
- package/dist/src/composables/useActionsApi.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +12 -0
- package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
- package/dist/src/composables/useRibbonOffset.d.ts +4 -0
- package/dist/src/composables/validators/useLiquidValidator.d.ts +3 -0
- package/dist/src/config/compiler/liquidCompilerRules.d.ts +2 -0
- package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -0
- package/dist/src/enums/onboarding.d.ts +6 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
- package/dist/src/services/templateLibraryApi.d.ts +1 -1
- package/dist/src/stores/config.d.ts +108 -0
- package/dist/src/stores/onboarding.d.ts +4 -0
- package/dist/src/stores/preview.d.ts +3 -0
- package/dist/src/utils/genericUtil.d.ts +1 -1
- package/dist/src/utils/htmlCompiler.d.ts +2 -1
- package/dist/static/styles/base.css.js +7 -2
- package/dist/stores/onboarding.js +4 -0
- package/dist/stores/preview.js +4 -3
- package/dist/utils/genericUtil.js +42 -20
- package/dist/utils/htmlCompiler.js +48 -41
- package/dist/utils/templatePreparation.js +36 -25
- package/dist/utils/tooltipUtils.js +4 -5
- package/package.json +2 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ModificationDescription as p } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import { RecommendationBlockId as
|
|
2
|
+
import { RecommendationBlockId as m } from "../../constants/blockIds.js";
|
|
3
3
|
import { MOBILE_CONTAINER_SELECTOR as P, MOBILE_ROW_SELECTOR as k, CURRENCY_ATTR as y, DESKTOP_CONTAINER_SELECTOR as q, CONTAINER_SELECTOR as $ } from "../../constants/selectors.js";
|
|
4
4
|
import { RecommendationConfigService as E } from "../../services/configService.js";
|
|
5
5
|
import { useRecommendationExtensionStore as C } from "../../store/recommendation.js";
|
|
6
6
|
import { prepareProductRows as T } from "../../templates/index.js";
|
|
7
7
|
import { formatPrice as B } from "../../utils/priceFormatter.js";
|
|
8
8
|
import { isTdNode as v } from "../../utils/tagName.js";
|
|
9
|
-
import { getDefaultProducts as
|
|
9
|
+
import { getDefaultProducts as L, DEFAULT_CARD_COMPOSITION as R, sanitizeImageUrl as j } from "../../templates/utils.js";
|
|
10
10
|
const h = "recommendation-block-v2";
|
|
11
11
|
function M(t) {
|
|
12
12
|
if (!t)
|
|
@@ -16,7 +16,7 @@ function M(t) {
|
|
|
16
16
|
if (e && e.includes(h))
|
|
17
17
|
return t;
|
|
18
18
|
}
|
|
19
|
-
return "querySelector" in t ? t.querySelector(`.${h}`) : null;
|
|
19
|
+
return "querySelector" in t ? t.querySelector(`.${h}`) ?? null : null;
|
|
20
20
|
}
|
|
21
21
|
function g(t) {
|
|
22
22
|
const e = M(t);
|
|
@@ -25,7 +25,7 @@ function g(t) {
|
|
|
25
25
|
const o = e.getAttribute("data-layout");
|
|
26
26
|
return o === "list" || o === "horizontal" ? "list" : "grid";
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function _(t) {
|
|
29
29
|
const e = M(t);
|
|
30
30
|
if (!e || !("getAttribute" in e))
|
|
31
31
|
return R;
|
|
@@ -36,12 +36,12 @@ function b(t, e, o) {
|
|
|
36
36
|
if (!e || !("childNodes" in e))
|
|
37
37
|
return !1;
|
|
38
38
|
const i = e.childNodes().find(
|
|
39
|
-
(
|
|
39
|
+
(l) => "getType" in l && l.getType() === "text"
|
|
40
40
|
);
|
|
41
41
|
return i ? (t.modifyHtml(i).setText(o), !0) : !1;
|
|
42
42
|
}
|
|
43
43
|
function x(t, e) {
|
|
44
|
-
return t && t.length > 0 ? t : e.length > 0 ? e :
|
|
44
|
+
return t && t.length > 0 ? t : e.length > 0 ? e : L();
|
|
45
45
|
}
|
|
46
46
|
function V(t) {
|
|
47
47
|
const { currentNode: e, documentModifier: o } = t;
|
|
@@ -56,7 +56,7 @@ function W(t) {
|
|
|
56
56
|
documentModifier: o,
|
|
57
57
|
products: n,
|
|
58
58
|
layout: i,
|
|
59
|
-
composition:
|
|
59
|
+
composition: l
|
|
60
60
|
} = t;
|
|
61
61
|
if (!e || !("querySelector" in e))
|
|
62
62
|
return;
|
|
@@ -68,9 +68,10 @@ function W(t) {
|
|
|
68
68
|
const s = e.querySelector(k);
|
|
69
69
|
if (!s)
|
|
70
70
|
return;
|
|
71
|
-
const
|
|
71
|
+
const c = C(), a = x(n, c.recommendationProducts), f = l ?? _(e), S = `<td><table class="ins-recommendation-product-container ins-recommendation-mobile-container" width="100%" cellpadding="0" cellspacing="0" border="0">${T(a, r, {
|
|
72
72
|
productsPerRow: u.mobileCardsInRow,
|
|
73
|
-
composition:
|
|
73
|
+
composition: f,
|
|
74
|
+
filterList: c.filterList
|
|
74
75
|
})}</table></td>`;
|
|
75
76
|
o.modifyHtml(s).setInnerHtml(S), o.apply(new p("Updated mobile product rows"));
|
|
76
77
|
}
|
|
@@ -80,7 +81,7 @@ function G(t) {
|
|
|
80
81
|
documentModifier: o,
|
|
81
82
|
afterRegenerate: n,
|
|
82
83
|
products: i,
|
|
83
|
-
layout:
|
|
84
|
+
layout: l,
|
|
84
85
|
composition: r
|
|
85
86
|
} = t;
|
|
86
87
|
if (!e || !("querySelector" in e))
|
|
@@ -88,53 +89,54 @@ function G(t) {
|
|
|
88
89
|
const u = e.querySelector(q) ?? e.querySelector($);
|
|
89
90
|
if (!u)
|
|
90
91
|
return;
|
|
91
|
-
const s = C(),
|
|
92
|
+
const s = C(), c = x(i, s.recommendationProducts), { cardsInRow: a } = s.recommendationConfigs, f = r ?? _(e), d = l ?? g(e), S = T(c, d, {
|
|
92
93
|
productsPerRow: a,
|
|
93
|
-
composition:
|
|
94
|
+
composition: f,
|
|
95
|
+
filterList: s.filterList
|
|
94
96
|
});
|
|
95
97
|
o.modifyHtml(u).setInnerHtml(S).apply(new p("Updated product")), W(t), n == null || n();
|
|
96
98
|
}
|
|
97
99
|
function I(t, e, o, n) {
|
|
98
|
-
const
|
|
100
|
+
const l = `0 ${Math.floor(o / 2)}px`;
|
|
99
101
|
let r = !1;
|
|
100
102
|
return n === "grid" ? Array.from(
|
|
101
103
|
t.querySelectorAll(".attribute-cell")
|
|
102
104
|
).forEach((s) => {
|
|
103
|
-
e.modifyHtml(s).setStyle("padding",
|
|
105
|
+
e.modifyHtml(s).setStyle("padding", l), r = !0;
|
|
104
106
|
}) : Array.from(
|
|
105
107
|
t.querySelectorAll(".product-card-wrapper")
|
|
106
108
|
).forEach((s) => {
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
+
const c = "parentNode" in s ? s.parentNode : null;
|
|
110
|
+
c && v(c) && (e.modifyHtml(c).setStyle("padding", l), r = !0);
|
|
109
111
|
}), r;
|
|
110
112
|
}
|
|
111
113
|
function O(t, e, o) {
|
|
112
114
|
const n = `${o}px`, i = Array.from(t.querySelectorAll(".spacer"));
|
|
113
|
-
let
|
|
115
|
+
let l = !1;
|
|
114
116
|
return i.forEach((r) => {
|
|
115
|
-
e.modifyHtml(r).setStyle("height", n),
|
|
116
|
-
}),
|
|
117
|
+
e.modifyHtml(r).setStyle("height", n), l = !0;
|
|
118
|
+
}), l;
|
|
117
119
|
}
|
|
118
120
|
function Y(t) {
|
|
119
121
|
const { currentNode: e, documentModifier: o } = t;
|
|
120
122
|
if (!e)
|
|
121
123
|
return;
|
|
122
124
|
const n = E.getConfig(e), i = g(e);
|
|
123
|
-
let
|
|
125
|
+
let l = !1;
|
|
124
126
|
const r = e.querySelector(q);
|
|
125
127
|
if (r) {
|
|
126
|
-
|
|
128
|
+
l = I(
|
|
127
129
|
r,
|
|
128
130
|
o,
|
|
129
131
|
n.columnSpacing,
|
|
130
132
|
i
|
|
131
133
|
);
|
|
132
|
-
const
|
|
134
|
+
const c = O(
|
|
133
135
|
r,
|
|
134
136
|
o,
|
|
135
137
|
n.rowSpacing
|
|
136
138
|
);
|
|
137
|
-
|
|
139
|
+
l = l || c;
|
|
138
140
|
}
|
|
139
141
|
const u = e.querySelector(P);
|
|
140
142
|
if (u) {
|
|
@@ -144,23 +146,23 @@ function Y(t) {
|
|
|
144
146
|
n.mobileColumnSpacing,
|
|
145
147
|
i
|
|
146
148
|
);
|
|
147
|
-
|
|
148
|
-
const
|
|
149
|
+
l = l || s;
|
|
150
|
+
const c = O(
|
|
149
151
|
u,
|
|
150
152
|
o,
|
|
151
153
|
n.mobileRowSpacing
|
|
152
154
|
);
|
|
153
|
-
|
|
155
|
+
l = l || c;
|
|
154
156
|
}
|
|
155
|
-
|
|
157
|
+
l && o.apply(new p("Reapply spacing after regeneration"));
|
|
156
158
|
}
|
|
157
159
|
function re(t) {
|
|
158
|
-
const { currentNode: e, documentModifier: o, afterRegenerate: n, products: i, layout:
|
|
160
|
+
const { currentNode: e, documentModifier: o, afterRegenerate: n, products: i, layout: l, composition: r } = t;
|
|
159
161
|
e && G({
|
|
160
162
|
currentNode: e,
|
|
161
163
|
documentModifier: o,
|
|
162
164
|
products: i,
|
|
163
|
-
layout:
|
|
165
|
+
layout: l,
|
|
164
166
|
composition: r,
|
|
165
167
|
afterRegenerate: () => {
|
|
166
168
|
setTimeout(() => {
|
|
@@ -170,7 +172,7 @@ function re(t) {
|
|
|
170
172
|
});
|
|
171
173
|
}
|
|
172
174
|
function ie(t, e) {
|
|
173
|
-
return t.length === e ? t : t.length > e ? t.slice(0, e) : [...t, ...
|
|
175
|
+
return t.length === e ? t : t.length > e ? t.slice(0, e) : [...t, ...L(e - t.length)];
|
|
174
176
|
}
|
|
175
177
|
function D() {
|
|
176
178
|
const t = C(), { currencySettings: e } = t.recommendationConfigs, o = parseInt(e.decimalCount);
|
|
@@ -191,28 +193,28 @@ function A(t, e = "price") {
|
|
|
191
193
|
});
|
|
192
194
|
}
|
|
193
195
|
function F(t) {
|
|
194
|
-
var
|
|
195
|
-
const e = D(), o = ((
|
|
196
|
+
var l, r;
|
|
197
|
+
const e = D(), o = ((l = t.original_price) == null ? void 0 : l[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, n = ((r = t.price) == null ? void 0 : r[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, i = o > 0 ? Math.round((o - n) / o * 100) : 0;
|
|
196
198
|
return i > 0 ? `-${i}%` : "0%";
|
|
197
199
|
}
|
|
198
200
|
function H(t) {
|
|
199
|
-
const { documentModifier: e, product: o, priceEl: n, oldPriceEl: i, omnibusPriceEl:
|
|
201
|
+
const { documentModifier: e, product: o, priceEl: n, oldPriceEl: i, omnibusPriceEl: l, omnibusDiscountEl: r } = t;
|
|
200
202
|
let u = !1;
|
|
201
203
|
if (n && "querySelector" in n) {
|
|
202
|
-
const s = n.querySelector("strong"),
|
|
203
|
-
b(e, s,
|
|
204
|
+
const s = n.querySelector("strong") ?? null, c = A(o, "price");
|
|
205
|
+
b(e, s, c) && (u = !0);
|
|
204
206
|
}
|
|
205
207
|
if (i && "querySelector" in i) {
|
|
206
|
-
const s = i.querySelector("strong"),
|
|
207
|
-
b(e, s,
|
|
208
|
+
const s = i.querySelector("strong") ?? null, c = A(o, "original_price");
|
|
209
|
+
b(e, s, c) && (u = !0);
|
|
208
210
|
}
|
|
209
|
-
if (
|
|
210
|
-
const s =
|
|
211
|
-
b(e, s,
|
|
211
|
+
if (l && "querySelector" in l) {
|
|
212
|
+
const s = l.querySelector(".omnibus-price-value") ?? null, c = A(o, "original_price");
|
|
213
|
+
b(e, s, c) && (u = !0);
|
|
212
214
|
}
|
|
213
215
|
if (r && "querySelector" in r) {
|
|
214
|
-
const s = r.querySelector(".omnibus-discount-value"),
|
|
215
|
-
b(e, s,
|
|
216
|
+
const s = r.querySelector(".omnibus-discount-value") ?? null, c = F(o);
|
|
217
|
+
b(e, s, c) && (u = !0);
|
|
216
218
|
}
|
|
217
219
|
return u;
|
|
218
220
|
}
|
|
@@ -222,33 +224,33 @@ function K(t) {
|
|
|
222
224
|
product: o,
|
|
223
225
|
imageEl: n,
|
|
224
226
|
nameEl: i,
|
|
225
|
-
priceEl:
|
|
227
|
+
priceEl: l,
|
|
226
228
|
oldPriceEl: r,
|
|
227
229
|
omnibusPriceEl: u,
|
|
228
230
|
omnibusDiscountEl: s,
|
|
229
|
-
buttonEl:
|
|
231
|
+
buttonEl: c
|
|
230
232
|
} = t;
|
|
231
233
|
let a = !1;
|
|
232
234
|
if (n && "querySelector" in n) {
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
+
const f = n.querySelector("img");
|
|
236
|
+
f && (e.modifyHtml(f).setAttribute("src", j(o.image_url)).setAttribute("alt", o.name), a = !0);
|
|
235
237
|
const d = n.querySelector("a");
|
|
236
238
|
d && (e.modifyHtml(d).setAttribute("href", o.url), a = !0);
|
|
237
239
|
}
|
|
238
240
|
if (i && "querySelector" in i) {
|
|
239
|
-
const
|
|
240
|
-
b(e,
|
|
241
|
+
const f = i.querySelector("strong") ?? null;
|
|
242
|
+
b(e, f, o.name) && (a = !0);
|
|
241
243
|
}
|
|
242
244
|
if (H({
|
|
243
245
|
documentModifier: e,
|
|
244
246
|
product: o,
|
|
245
|
-
priceEl:
|
|
247
|
+
priceEl: l,
|
|
246
248
|
oldPriceEl: r,
|
|
247
249
|
omnibusPriceEl: u,
|
|
248
250
|
omnibusDiscountEl: s
|
|
249
|
-
}) && (a = !0),
|
|
250
|
-
const
|
|
251
|
-
|
|
251
|
+
}) && (a = !0), c && "querySelector" in c) {
|
|
252
|
+
const f = c.querySelector("a.es-button") || c.querySelector("a");
|
|
253
|
+
f && (e.modifyHtml(f).setAttribute("href", o.url), a = !0);
|
|
252
254
|
}
|
|
253
255
|
return a;
|
|
254
256
|
}
|
|
@@ -259,53 +261,53 @@ function w(t, e, o) {
|
|
|
259
261
|
if (!("querySelectorAll" in t))
|
|
260
262
|
return !1;
|
|
261
263
|
const n = t.querySelectorAll(
|
|
262
|
-
`[esd-extension-block-id="${
|
|
264
|
+
`[esd-extension-block-id="${m.IMAGE}"]`
|
|
263
265
|
), i = t.querySelectorAll(
|
|
264
|
-
`[esd-extension-block-id="${
|
|
265
|
-
),
|
|
266
|
-
`[esd-extension-block-id="${
|
|
266
|
+
`[esd-extension-block-id="${m.NAME}"]`
|
|
267
|
+
), l = t.querySelectorAll(
|
|
268
|
+
`[esd-extension-block-id="${m.PRICE}"]`
|
|
267
269
|
), r = t.querySelectorAll(
|
|
268
|
-
`[esd-extension-block-id="${
|
|
270
|
+
`[esd-extension-block-id="${m.OLD_PRICE}"]`
|
|
269
271
|
), u = t.querySelectorAll(
|
|
270
|
-
`[esd-extension-block-id="${
|
|
272
|
+
`[esd-extension-block-id="${m.OMNIBUS_PRICE}"]`
|
|
271
273
|
), s = t.querySelectorAll(
|
|
272
|
-
`[esd-extension-block-id="${
|
|
273
|
-
),
|
|
274
|
-
`[esd-extension-block-id="${
|
|
274
|
+
`[esd-extension-block-id="${m.OMNIBUS_DISCOUNT}"]`
|
|
275
|
+
), c = t.querySelectorAll(
|
|
276
|
+
`[esd-extension-block-id="${m.BUTTON}"]`
|
|
275
277
|
), a = Math.min(n.length, o.length);
|
|
276
|
-
let
|
|
278
|
+
let f = !1;
|
|
277
279
|
for (let d = 0; d < a; d++) {
|
|
278
280
|
const S = K({
|
|
279
281
|
documentModifier: e,
|
|
280
282
|
product: o[d],
|
|
281
283
|
imageEl: n[d] ?? null,
|
|
282
284
|
nameEl: i[d] ?? null,
|
|
283
|
-
priceEl:
|
|
285
|
+
priceEl: l[d] ?? null,
|
|
284
286
|
oldPriceEl: r[d] ?? null,
|
|
285
287
|
omnibusPriceEl: u[d] ?? null,
|
|
286
288
|
omnibusDiscountEl: s[d] ?? null,
|
|
287
|
-
buttonEl:
|
|
289
|
+
buttonEl: c[d] ?? null
|
|
288
290
|
});
|
|
289
|
-
|
|
291
|
+
f = f || S;
|
|
290
292
|
}
|
|
291
|
-
return
|
|
293
|
+
return f;
|
|
292
294
|
}
|
|
293
|
-
function
|
|
295
|
+
function le(t) {
|
|
294
296
|
const { currentNode: e, documentModifier: o, products: n } = t;
|
|
295
297
|
if (!e || !("querySelectorAll" in e))
|
|
296
298
|
return !1;
|
|
297
299
|
const i = U(e);
|
|
298
300
|
if (!("querySelectorAll" in i) || i.querySelectorAll(
|
|
299
|
-
`[esd-extension-block-id="${
|
|
301
|
+
`[esd-extension-block-id="${m.IMAGE}"]`
|
|
300
302
|
).length !== n.length)
|
|
301
303
|
return !1;
|
|
302
304
|
let r = w(i, o, n);
|
|
303
305
|
const u = g(e), s = E.getConfig(e);
|
|
304
306
|
if (u !== "list" && s.mobileLayoutEnabled && "querySelector" in e) {
|
|
305
|
-
const
|
|
306
|
-
if (
|
|
307
|
+
const c = e.querySelector(P);
|
|
308
|
+
if (c) {
|
|
307
309
|
const a = w(
|
|
308
|
-
|
|
310
|
+
c,
|
|
309
311
|
o,
|
|
310
312
|
n
|
|
311
313
|
);
|
|
@@ -318,40 +320,40 @@ function N(t, e, o) {
|
|
|
318
320
|
if (!("querySelectorAll" in t))
|
|
319
321
|
return !1;
|
|
320
322
|
const n = t.querySelectorAll(
|
|
321
|
-
`[esd-extension-block-id="${
|
|
323
|
+
`[esd-extension-block-id="${m.PRICE}"]`
|
|
322
324
|
), i = t.querySelectorAll(
|
|
323
|
-
`[esd-extension-block-id="${
|
|
324
|
-
),
|
|
325
|
-
`[esd-extension-block-id="${
|
|
325
|
+
`[esd-extension-block-id="${m.OLD_PRICE}"]`
|
|
326
|
+
), l = t.querySelectorAll(
|
|
327
|
+
`[esd-extension-block-id="${m.OMNIBUS_PRICE}"]`
|
|
326
328
|
), r = t.querySelectorAll(
|
|
327
|
-
`[esd-extension-block-id="${
|
|
329
|
+
`[esd-extension-block-id="${m.OMNIBUS_DISCOUNT}"]`
|
|
328
330
|
), u = Math.min(n.length, o.length);
|
|
329
331
|
let s = !1;
|
|
330
|
-
for (let
|
|
332
|
+
for (let c = 0; c < u; c++)
|
|
331
333
|
H({
|
|
332
334
|
documentModifier: e,
|
|
333
|
-
product: o[
|
|
334
|
-
priceEl: n[
|
|
335
|
-
oldPriceEl: i[
|
|
336
|
-
omnibusPriceEl: c
|
|
337
|
-
omnibusDiscountEl: r[
|
|
335
|
+
product: o[c],
|
|
336
|
+
priceEl: n[c] ?? null,
|
|
337
|
+
oldPriceEl: i[c] ?? null,
|
|
338
|
+
omnibusPriceEl: l[c] ?? null,
|
|
339
|
+
omnibusDiscountEl: r[c] ?? null
|
|
338
340
|
}) && (s = !0);
|
|
339
341
|
return s;
|
|
340
342
|
}
|
|
341
|
-
function
|
|
343
|
+
function ce(t) {
|
|
342
344
|
const { currentNode: e, documentModifier: o } = t;
|
|
343
345
|
if (!e || !("querySelectorAll" in e))
|
|
344
346
|
return !1;
|
|
345
347
|
const i = C().recommendationProducts;
|
|
346
348
|
if (i.length === 0)
|
|
347
349
|
return !1;
|
|
348
|
-
const
|
|
349
|
-
let r = N(
|
|
350
|
+
const l = U(e);
|
|
351
|
+
let r = N(l, o, i);
|
|
350
352
|
const u = g(e), s = E.getConfig(e);
|
|
351
353
|
if (u !== "list" && s.mobileLayoutEnabled && "querySelector" in e) {
|
|
352
|
-
const
|
|
353
|
-
if (
|
|
354
|
-
const a = N(
|
|
354
|
+
const c = e.querySelector(P);
|
|
355
|
+
if (c) {
|
|
356
|
+
const a = N(c, o, i);
|
|
355
357
|
r = r || a;
|
|
356
358
|
}
|
|
357
359
|
}
|
|
@@ -361,23 +363,23 @@ function se(t) {
|
|
|
361
363
|
const { currentNode: e, documentModifier: o, currency: n } = t, i = M(e);
|
|
362
364
|
if (!i)
|
|
363
365
|
return;
|
|
364
|
-
const
|
|
366
|
+
const l = n.alignment === "before" ? "0" : "1", r = (u, s) => {
|
|
365
367
|
o.modifyHtml(i).setAttribute(u, s);
|
|
366
368
|
};
|
|
367
|
-
r(y.CURRENCY, n.code), r(y.SYMBOL, n.symbol), r(y.ALIGNMENT,
|
|
369
|
+
r(y.CURRENCY, n.code), r(y.SYMBOL, n.symbol), r(y.ALIGNMENT, l), r(y.THOUSAND_SEPARATOR, n.thousandSeparator), r(y.DECIMAL_SEPARATOR, n.decimalSeparator), r(y.DECIMAL_COUNT, n.decimalCount.toString()), o.apply(new p("Update currency attributes"));
|
|
368
370
|
}
|
|
369
371
|
export {
|
|
370
372
|
ie as adjustProductsToSize,
|
|
371
373
|
A as formatProductPrice,
|
|
372
374
|
M as getBlockElement,
|
|
373
|
-
|
|
375
|
+
_ as getCardComposition,
|
|
374
376
|
g as getCurrentLayout,
|
|
375
377
|
Y as reapplySpacing,
|
|
376
378
|
W as regenerateMobileProductRows,
|
|
377
379
|
G as regenerateProductRows,
|
|
378
380
|
re as regenerateProductRowsWithStyles,
|
|
379
381
|
se as setCurrencyAttributes,
|
|
380
|
-
|
|
381
|
-
|
|
382
|
+
ce as updatePricesInPlace,
|
|
383
|
+
le as updateProductContentInPlace,
|
|
382
384
|
K as updateSingleProductContent
|
|
383
385
|
};
|