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