@useinsider/guido 3.23.0-beta.86bed27 → 3.23.0-beta.9f6bfbf
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 +17 -15
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +58 -56
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +11 -11
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +9 -9
- package/dist/composables/useModuleRepair.js +14 -12
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +22 -22
- package/dist/config/migrator/index.js +16 -15
- package/dist/config/migrator/itemsPriceFormatMigrator.js +20 -0
- package/dist/config/migrator/recommendation/compositionMapper.js +56 -49
- package/dist/config/migrator/recommendation/extractors.js +100 -40
- package/dist/config/migrator/recommendation/htmlBuilder.js +285 -207
- package/dist/config/migrator/recommendation/settingsMapper.js +37 -36
- package/dist/config/migrator/recommendation/themeMapper.js +53 -41
- package/dist/config/migrator/recommendationMigrator.js +68 -61
- package/dist/extensions/Blocks/Items/block.js +115 -77
- package/dist/extensions/Blocks/Items/constants/currency.js +59 -14
- package/dist/extensions/Blocks/Items/controls/button/link.js +14 -17
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +14 -17
- package/dist/extensions/Blocks/Items/controls/image/link.js +14 -17
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +9 -10
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +40 -30
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +63 -53
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +31 -31
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +15 -16
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +25 -26
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +42 -32
- package/dist/extensions/Blocks/Items/controls/priceFormat.js +145 -0
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +160 -144
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +1 -1
- package/dist/extensions/Blocks/Items/extension.js +9 -8
- package/dist/extensions/Blocks/Items/items.css.js +19 -0
- package/dist/extensions/Blocks/Items/settingsPanel.js +34 -25
- package/dist/extensions/Blocks/Items/template.js +250 -212
- package/dist/extensions/Blocks/Items/utils/priceFormatOps.js +185 -0
- package/dist/extensions/Blocks/Recommendation/block.js +33 -24
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +3 -3
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +27 -26
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +13 -13
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +165 -175
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +5 -5
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +8 -8
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +15 -15
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +12 -12
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +10 -10
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +1 -1
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +23 -22
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +19 -18
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +82 -91
- package/dist/extensions/Blocks/Recommendation/utils/inlinePriceOrder.js +12 -0
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +3 -2
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +1 -0
- package/dist/extensions/Blocks/common-control.js +62 -55
- package/dist/guido.css +1 -1
- package/dist/package.json.js +2 -2
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/config/migrator/index.d.ts +4 -1
- package/dist/src/config/migrator/itemsPriceFormatMigrator.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +3 -1
- package/dist/src/config/migrator/recommendation/extractors.d.ts +35 -6
- package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +3 -1
- package/dist/src/config/migrator/recommendation/themeMapper.d.ts +3 -1
- package/dist/src/config/migrator/recommendation/types.d.ts +11 -1
- package/dist/src/extensions/Blocks/Items/block.d.ts +6 -9
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +32 -0
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/priceFormat.d.ts +23 -0
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +4 -1
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +3 -0
- package/dist/src/extensions/Blocks/Items/utils/priceFormatOps.d.ts +61 -0
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +5 -10
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +1 -13
- package/dist/src/extensions/Blocks/Recommendation/utils/inlinePriceOrder.d.ts +9 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +2 -19
- package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +12 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +2 -0
- package/dist/src/stores/config.d.ts +20 -0
- package/dist/src/stores/unsubscribe.d.ts +10 -0
- package/dist/src/utils/itemsCurrencyRepair.d.ts +5 -1
- package/dist/stores/unsubscribe.js +33 -29
- package/dist/utils/itemsCurrencyRepair.js +29 -24
- package/dist/utils/pairProductVariables.js +119 -99
- package/package.json +2 -2
|
@@ -1,147 +1,177 @@
|
|
|
1
|
-
import { escapeHtml as
|
|
2
|
-
import { BlockType as
|
|
3
|
-
import { blockCellPadMarker as
|
|
4
|
-
import { ITEMS_CURRENCY_ATTR as
|
|
5
|
-
import { ItemsBlockId as
|
|
6
|
-
import { productPairs as
|
|
7
|
-
import { ItemInCartOptions as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { deriveItemNumber as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { escapeHtml as O } from "../../../utils/htmlEscape.js";
|
|
2
|
+
import { BlockType as P, BlockAttr as x } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
|
+
import { blockCellPadMarker as k, NAME_VERTICAL_MAX_WIDTH as st, nameMaxWidthFor as lt, blockCellPaddingFor as Y } from "./constants/cardLayout.js";
|
|
4
|
+
import { ITEMS_PRICE_FORMAT_ATTR as w, ITEMS_CURRENCY_ATTR as f, currencyPositionFromLocation as rt } from "./constants/currency.js";
|
|
5
|
+
import { ItemsBlockId as A } from "./enums/controlEnums.js";
|
|
6
|
+
import { productPairs as b, templateFirstLine as ct } from "./enums/productEnums.js";
|
|
7
|
+
import { ItemInCartOptions as it, SETTINGS_ENUMS as N, DefaultConfigValues as S } from "./enums/settingsEnums.js";
|
|
8
|
+
import nt from "./layouts/horizontal.html.js";
|
|
9
|
+
import ot from "./layouts/vertical.html.js";
|
|
10
|
+
import { deriveItemNumber as dt, escapeReplacement as X } from "./utils/nodeConfigUtils.js";
|
|
11
|
+
import { formatItemsDummyPrice as pt } from "./utils/priceFormatOps.js";
|
|
12
|
+
let [W] = b.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [M] = b.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [C] = b.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [B] = b.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [K] = b.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
|
|
13
|
+
const F = (e, t) => e.split(";").map((a) => a.trim()).filter((a) => !a.toLowerCase().startsWith(t.toLowerCase())).join("; ").replace(/;\s*$/, ""), V = (e) => F(e, "text-align"), D = (e, t) => {
|
|
14
|
+
const a = new RegExp(`${t}\\s*:\\s*([^;]+)`, "i"), s = e.match(a);
|
|
14
15
|
return s ? s[1].trim() : null;
|
|
15
|
-
},
|
|
16
|
-
var
|
|
17
|
-
const t = (
|
|
16
|
+
}, v = (e) => {
|
|
17
|
+
var a;
|
|
18
|
+
const t = (a = D(e || "", "text-align")) == null ? void 0 : a.toLowerCase();
|
|
18
19
|
return t && ["left", "center", "right", "justify"].includes(t) ? t : "center";
|
|
19
|
-
},
|
|
20
|
-
const s = ["white-space", "overflow", "text-overflow", "max-width"].reduce((
|
|
21
|
-
return [s,
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
}, $t = (e, t, a = st) => {
|
|
21
|
+
const s = ["white-space", "overflow", "text-overflow", "max-width"].reduce((i, o) => F(i, o), e), c = t ? `white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: ${a}` : `max-width: ${a}`;
|
|
22
|
+
return [s, c].map((i) => i.trim().replace(/;\s*$/, "")).filter(Boolean).join("; ");
|
|
23
|
+
}, L = (e) => `<tr>${e}</tr>`, j = (e, t, a, s, c) => c ? { formatedAttr: "", curencyAttr: "", currencySymbolAttr: "", singlePriceAttr: "" } : {
|
|
24
|
+
formatedAttr: `data-formated="${e ? "true" : "false"}"`,
|
|
25
|
+
curencyAttr: `${f.POSITION}="${rt(a)}"`,
|
|
26
|
+
currencySymbolAttr: t ? `${f.SYMBOL}="${t}"` : "",
|
|
27
|
+
singlePriceAttr: `data-single_price="${s ? "true" : "false"}"`
|
|
28
|
+
}, q = (e, t, a, s) => {
|
|
29
|
+
if (s)
|
|
30
|
+
return pt({
|
|
31
|
+
amount: e,
|
|
32
|
+
format: s,
|
|
33
|
+
symbol: t ?? S.productPriceCurrencySymbolControlValue,
|
|
34
|
+
alignment: a ?? S.productPriceCurrencyLocationControlValue
|
|
35
|
+
});
|
|
36
|
+
if (t && t.trim()) {
|
|
37
|
+
const c = `${t.trim()}`;
|
|
38
|
+
return (a || "0") === "1" ? `${e} ${c}` : `${c} ${e}`;
|
|
39
|
+
}
|
|
40
|
+
return e;
|
|
41
|
+
}, ut = (e, t, a, s) => {
|
|
42
|
+
const c = t ?? S.productPriceCurrencySymbolControlValue, i = a ?? S.productPriceCurrencyLocationControlValue;
|
|
43
|
+
return [
|
|
44
|
+
[w.SINGLE_PRICE, s ? "true" : "false"],
|
|
45
|
+
[w.SYMBOL, c],
|
|
46
|
+
[w.ALIGNMENT, i],
|
|
47
|
+
[w.THOUSAND_SEPARATOR, e.thousandSeparator],
|
|
48
|
+
[w.DECIMAL_SEPARATOR, e.decimalSeparator],
|
|
49
|
+
[w.DECIMAL_COUNT, String(e.decimalCount)]
|
|
50
|
+
].map(([o, n]) => `${o}="${O(n)}"`).join(" ");
|
|
51
|
+
}, Et = (e, t, a, s) => {
|
|
52
|
+
const c = a || S.productImageHeight, i = (s == null ? void 0 : s.imageVisible) === !1 ? "display: none; " : "";
|
|
53
|
+
return L(`
|
|
25
54
|
<td class="esd-block-image document-node-component default-block-component selectable ng-star-inserted"
|
|
26
55
|
align="center"
|
|
27
|
-
esd-extension-block-id="${
|
|
56
|
+
esd-extension-block-id="${A.IMAGE}"
|
|
28
57
|
data-slot-1=""
|
|
29
58
|
product-attr="imageSrc"
|
|
30
|
-
data-type="${
|
|
59
|
+
data-type="${e}"
|
|
31
60
|
data-number="${t}"
|
|
32
|
-
style="${
|
|
61
|
+
style="${i}font-size: 0px;">
|
|
33
62
|
<a class="document-node-component ng-star-inserted"
|
|
34
63
|
target="_blank"
|
|
35
64
|
href="#!">
|
|
36
65
|
<img class="adapt-img document-node-component ng-star-inserted"
|
|
37
66
|
style="object-fit: contain;"
|
|
38
|
-
src="${
|
|
67
|
+
src="${W}"
|
|
39
68
|
alt="${M}"
|
|
40
|
-
width="${
|
|
41
|
-
height="${
|
|
69
|
+
width="${c}"
|
|
70
|
+
height="${c}">
|
|
42
71
|
</a>
|
|
43
72
|
</td>
|
|
44
73
|
`);
|
|
45
|
-
},
|
|
46
|
-
<${
|
|
47
|
-
${
|
|
48
|
-
${
|
|
49
|
-
${
|
|
50
|
-
${
|
|
51
|
-
${
|
|
52
|
-
esd-extension-block-id="${
|
|
74
|
+
}, Tt = (e, t) => `
|
|
75
|
+
<${P.BLOCK_IMAGE}
|
|
76
|
+
${x.BLOCK_IMAGE.src}="${W}"
|
|
77
|
+
${x.BLOCK_IMAGE.alt}="${M}"
|
|
78
|
+
${x.BLOCK_IMAGE.href}="#!"
|
|
79
|
+
${x.BLOCK_IMAGE.width}="${S.productImageWidth}"
|
|
80
|
+
${x.BLOCK_IMAGE.height}="${S.productImageWidth}"
|
|
81
|
+
esd-extension-block-id="${A.IMAGE}"
|
|
53
82
|
data-slot-1
|
|
54
83
|
product-attr="imageSrc"
|
|
55
|
-
data-type="${
|
|
84
|
+
data-type="${e}"
|
|
56
85
|
data-number="${t}"
|
|
57
86
|
/>
|
|
58
|
-
`,
|
|
59
|
-
const
|
|
87
|
+
`, _t = (e, t, a, s, c) => {
|
|
88
|
+
const i = lt(c), o = `
|
|
60
89
|
word-wrap: break-word;
|
|
61
90
|
white-space: nowrap;
|
|
62
91
|
overflow: hidden;
|
|
63
92
|
text-overflow: ellipsis;
|
|
64
93
|
width: 100%;
|
|
65
|
-
max-width: ${
|
|
94
|
+
max-width: ${i};
|
|
66
95
|
`;
|
|
67
96
|
if (t) {
|
|
68
|
-
const n =
|
|
69
|
-
|
|
70
|
-
|
|
97
|
+
const n = v(a), r = V(a || o), p = D(r, "font-weight"), l = D(r, "font-style"), $ = p === "bold" || p === "700", T = l === "italic", _ = F(
|
|
98
|
+
F(
|
|
99
|
+
F(r, "font-weight"),
|
|
71
100
|
"font-style"
|
|
72
101
|
),
|
|
73
102
|
"text-decoration"
|
|
74
|
-
), I = (s == null ? void 0 : s.nameVisible) === !1 ? "display: none;" : "display: table-cell;",
|
|
103
|
+
), I = (s == null ? void 0 : s.nameVisible) === !1 ? "display: none;" : "display: table-cell;", u = $t(_, (s == null ? void 0 : s.nameTrimming) ?? !0, i), E = ` style="${O(u)}"`;
|
|
75
104
|
let d = M;
|
|
76
|
-
return
|
|
105
|
+
return $ && (d = `<strong>${d}</strong>`), T && (d = `<em>${d}</em>`), L(`
|
|
77
106
|
<td class="esd-block-text es-p5"
|
|
78
107
|
align="${n}"
|
|
79
108
|
width="100%"
|
|
80
109
|
colspan="2"
|
|
81
|
-
data-type="${
|
|
82
|
-
esd-extension-block-id="${
|
|
110
|
+
data-type="${e}"
|
|
111
|
+
esd-extension-block-id="${A.NAME}"
|
|
83
112
|
style="${I}">
|
|
84
113
|
<p contenteditable="false"
|
|
85
114
|
path="1"
|
|
86
115
|
product-attr="name"
|
|
87
|
-
data-slot-2${
|
|
116
|
+
data-slot-2${E}>
|
|
88
117
|
${d}
|
|
89
118
|
</p>
|
|
90
119
|
</td>
|
|
91
120
|
`);
|
|
92
121
|
}
|
|
93
|
-
return `<${
|
|
122
|
+
return `<${P.BLOCK_TEXT}
|
|
94
123
|
width="100%"
|
|
95
124
|
align="center"
|
|
96
125
|
colspan="2"
|
|
97
126
|
class="es-p5"
|
|
98
|
-
data-type="${
|
|
99
|
-
esd-extension-block-id="${
|
|
127
|
+
data-type="${e}"
|
|
128
|
+
esd-extension-block-id="${A.NAME}"
|
|
100
129
|
>
|
|
101
130
|
<p contenteditable="false"
|
|
102
131
|
product-attr="name"
|
|
103
132
|
data-slot-2
|
|
104
|
-
style="${
|
|
133
|
+
style="${o}">
|
|
105
134
|
${M}
|
|
106
135
|
</p>
|
|
107
|
-
</${
|
|
136
|
+
</${P.BLOCK_TEXT}>
|
|
108
137
|
`;
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
138
|
+
}, It = (e, t, a, s, c, i, o, n, r, p, l) => {
|
|
139
|
+
const $ = q(C, s, c, l), { formatedAttr: T, curencyAttr: _, currencySymbolAttr: I, singlePriceAttr: u } = j(
|
|
140
|
+
a,
|
|
141
|
+
s,
|
|
142
|
+
c,
|
|
143
|
+
n,
|
|
144
|
+
l
|
|
145
|
+
), E = r === N.ORIENTATION.VERTICAL, d = Y(E);
|
|
146
|
+
if (i) {
|
|
147
|
+
const y = V(o || "color: #060606; white-space: nowrap; font-size: 20px;"), h = v(o), R = p ? "" : ' style="display: none;"';
|
|
148
|
+
return L(`
|
|
119
149
|
<td class="esd-block-text items-block-price${d}"
|
|
120
|
-
align="${
|
|
121
|
-
esd-extension-block-id="${
|
|
122
|
-
${
|
|
150
|
+
align="${h}"
|
|
151
|
+
esd-extension-block-id="${A.PRICE}"
|
|
152
|
+
${k(E)}
|
|
123
153
|
width="100%"
|
|
124
|
-
${
|
|
154
|
+
${R}>
|
|
125
155
|
<p product-attr="price"
|
|
126
156
|
contenteditable="false"
|
|
127
157
|
data-slot-4
|
|
128
|
-
data-type="${
|
|
158
|
+
data-type="${e}"
|
|
129
159
|
data-number="${t}"
|
|
130
|
-
${
|
|
160
|
+
${T}
|
|
131
161
|
${_}
|
|
132
162
|
${I}
|
|
163
|
+
${u}
|
|
164
|
+
style="${O(y)}">
|
|
133
165
|
${$}
|
|
134
|
-
style="${b(h)}">
|
|
135
|
-
${e}
|
|
136
166
|
</p>
|
|
137
167
|
</td>
|
|
138
168
|
`);
|
|
139
169
|
}
|
|
140
170
|
return `
|
|
141
|
-
<${
|
|
142
|
-
esd-extension-block-id="${
|
|
171
|
+
<${P.BLOCK_TEXT}
|
|
172
|
+
esd-extension-block-id="${A.PRICE}"
|
|
143
173
|
class="items-block-price ${d}"
|
|
144
|
-
${
|
|
174
|
+
${k(E)}
|
|
145
175
|
width="100%"
|
|
146
176
|
align="center"
|
|
147
177
|
>
|
|
@@ -149,127 +179,128 @@ const L = (a, t) => a.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
149
179
|
product-attr="price"
|
|
150
180
|
contenteditable="false"
|
|
151
181
|
data-slot-4
|
|
152
|
-
data-type="${
|
|
182
|
+
data-type="${e}"
|
|
153
183
|
data-number="${t}"
|
|
154
|
-
${
|
|
184
|
+
${T}
|
|
155
185
|
${_}
|
|
156
186
|
${I}
|
|
157
|
-
${
|
|
187
|
+
${u}
|
|
158
188
|
>
|
|
159
|
-
${
|
|
189
|
+
${$}
|
|
160
190
|
</p>
|
|
161
|
-
</${
|
|
191
|
+
</${P.BLOCK_TEXT}>
|
|
162
192
|
`;
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
${
|
|
193
|
+
}, mt = (e, t, a, s, c, i, o = !0, n, r, p, l) => {
|
|
194
|
+
const $ = q(B, s, c, l), { formatedAttr: T, curencyAttr: _, currencySymbolAttr: I, singlePriceAttr: u } = j(
|
|
195
|
+
a,
|
|
196
|
+
s,
|
|
197
|
+
c,
|
|
198
|
+
r,
|
|
199
|
+
l
|
|
200
|
+
), E = o ? "" : ' style="display: none;"', d = p === N.ORIENTATION.VERTICAL, m = Y(d);
|
|
201
|
+
if (i) {
|
|
202
|
+
const h = V(n || "color: #cc0000; white-space: nowrap; font-size: 19px;"), R = v(n);
|
|
203
|
+
return L(`
|
|
204
|
+
<td class="esd-block-text items-block-price${m}"
|
|
205
|
+
esd-extension-block-id="${A.ORIGINAL_PRICE}"
|
|
206
|
+
${k(d)}
|
|
176
207
|
width="100%"
|
|
177
|
-
align="${
|
|
208
|
+
align="${R}"${E}>
|
|
178
209
|
<p
|
|
179
210
|
product-attr="originalPrice"
|
|
180
211
|
contenteditable="false"
|
|
181
212
|
data-slot-5
|
|
182
|
-
data-type="${
|
|
213
|
+
data-type="${e}"
|
|
183
214
|
data-number="${t}"
|
|
184
|
-
${
|
|
215
|
+
${T}
|
|
185
216
|
${_}
|
|
186
217
|
${I}
|
|
187
|
-
${
|
|
188
|
-
style="${
|
|
189
|
-
<s>${
|
|
218
|
+
${u}
|
|
219
|
+
style="${O(h)}">
|
|
220
|
+
<s>${$}</s>
|
|
190
221
|
</p>
|
|
191
222
|
</td>
|
|
192
223
|
`);
|
|
193
224
|
}
|
|
194
225
|
return `
|
|
195
|
-
<${
|
|
196
|
-
class="items-block-price ${
|
|
197
|
-
esd-extension-block-id="${
|
|
198
|
-
${
|
|
226
|
+
<${P.BLOCK_TEXT}
|
|
227
|
+
class="items-block-price ${m}"
|
|
228
|
+
esd-extension-block-id="${A.ORIGINAL_PRICE}"
|
|
229
|
+
${k(d)}
|
|
199
230
|
width="100%"
|
|
200
231
|
align="center"
|
|
201
|
-
${
|
|
232
|
+
${o ? "" : 'style="display: none;"'}
|
|
202
233
|
>
|
|
203
234
|
<p
|
|
204
235
|
product-attr="originalPrice"
|
|
205
236
|
contenteditable="false"
|
|
206
237
|
data-slot-5
|
|
207
238
|
style="color: #cc0000"
|
|
208
|
-
data-type="${
|
|
239
|
+
data-type="${e}"
|
|
209
240
|
data-number="${t}"
|
|
210
|
-
${
|
|
241
|
+
${T}
|
|
211
242
|
${_}
|
|
212
243
|
${I}
|
|
213
|
-
${
|
|
244
|
+
${u}
|
|
214
245
|
>
|
|
215
|
-
<s>${
|
|
246
|
+
<s>${$}</s>
|
|
216
247
|
</p>
|
|
217
|
-
</${
|
|
248
|
+
</${P.BLOCK_TEXT}>
|
|
218
249
|
`;
|
|
219
|
-
},
|
|
220
|
-
const s =
|
|
250
|
+
}, At = (e = !0, t, a) => {
|
|
251
|
+
const s = e ? "" : 'style="display: none;"';
|
|
221
252
|
if (t) {
|
|
222
|
-
const
|
|
223
|
-
return
|
|
253
|
+
const c = "font-size: 14px;", i = v(a), o = V(a || c);
|
|
254
|
+
return L(`
|
|
224
255
|
<td class="esd-block-text es-p5 document-node-component default-block-component selectable"
|
|
225
|
-
width="100%" align="${
|
|
226
|
-
esd-extension-block-id="${
|
|
256
|
+
width="100%" align="${i}"
|
|
257
|
+
esd-extension-block-id="${A.QUANTITY}"
|
|
227
258
|
${s}>
|
|
228
259
|
<p product-attr="quantity"
|
|
229
260
|
data-slot-3=""
|
|
230
261
|
contenteditable="false"
|
|
231
262
|
width="100%"
|
|
232
263
|
path="1"
|
|
233
|
-
style="${
|
|
234
|
-
${
|
|
264
|
+
style="${O(o)}">
|
|
265
|
+
${K}
|
|
235
266
|
</p>
|
|
236
267
|
</td>
|
|
237
268
|
`);
|
|
238
269
|
}
|
|
239
270
|
return `
|
|
240
|
-
<${
|
|
271
|
+
<${P.BLOCK_TEXT}
|
|
241
272
|
width="100%"
|
|
242
273
|
align="center"
|
|
243
274
|
class="es-p5"
|
|
244
|
-
esd-extension-block-id="${
|
|
245
|
-
${
|
|
275
|
+
esd-extension-block-id="${A.QUANTITY}"
|
|
276
|
+
${e ? "" : 'style="display: none;"'}
|
|
246
277
|
>
|
|
247
278
|
<p
|
|
248
279
|
product-attr="quantity"
|
|
249
280
|
data-slot-3
|
|
250
281
|
contenteditable="false"
|
|
251
282
|
width="100%">
|
|
252
|
-
${
|
|
283
|
+
${K}
|
|
253
284
|
</p>
|
|
254
|
-
</${
|
|
285
|
+
</${P.BLOCK_TEXT}>
|
|
255
286
|
`;
|
|
256
|
-
},
|
|
287
|
+
}, Ot = (e, t, a = "Buy", s, c, i = !0, o = !0) => {
|
|
257
288
|
if (s) {
|
|
258
|
-
const n = D(
|
|
259
|
-
return
|
|
289
|
+
const n = D(c || "", "background") || D(c || "", "background-color"), r = n ? `border-width: 0px; background: ${n};` : "border-width: 0px;", p = i ? "es-fw" : "es-il", l = (c || "").replace("border-width: 0;", ""), T = /(?:^|;)\s*padding(?:-(?:top|right|bottom|left))?\s*:/.test(l) ? "" : " padding: 5px 12px;", I = /(?:^|;)\s*font-family\s*:/.test(l) ? "" : " font-family: inherit;", u = l.trim(), E = u && !u.endsWith(";") ? ";" : "";
|
|
290
|
+
return L(`
|
|
260
291
|
<td class="esd-block-button ins-button default-block-component selectable"
|
|
261
|
-
align="center" width="100%" name="buy-button" caption="${
|
|
262
|
-
esd-extension-block-id="${
|
|
263
|
-
product-attr="button" data-slot-6="" data-type="${
|
|
264
|
-
${
|
|
292
|
+
align="center" width="100%" name="buy-button" caption="${O(a)}"
|
|
293
|
+
esd-extension-block-id="${A.BUTTON}"
|
|
294
|
+
product-attr="button" data-slot-6="" data-type="${e}" data-number="${t}"
|
|
295
|
+
${o ? "" : ' style="display: none;"'}>
|
|
265
296
|
<p style="margin: 0; line-height: unset;">
|
|
266
|
-
<span class="es-button-border ${p}" style="${
|
|
297
|
+
<span class="es-button-border ${p}" style="${O(r)}">
|
|
267
298
|
<a
|
|
268
299
|
class="es-button"
|
|
269
300
|
href="#!"
|
|
270
301
|
target="_blank"
|
|
271
|
-
style="${
|
|
272
|
-
${
|
|
302
|
+
style="${O(u)}${E}${T}${I}">
|
|
303
|
+
${O(a)}
|
|
273
304
|
</a>
|
|
274
305
|
</span>
|
|
275
306
|
</p>
|
|
@@ -277,152 +308,159 @@ const L = (a, t) => a.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
277
308
|
`);
|
|
278
309
|
}
|
|
279
310
|
return `
|
|
280
|
-
<${
|
|
311
|
+
<${P.BLOCK_BUTTON}
|
|
281
312
|
width="100%"
|
|
282
313
|
class="ins-button"
|
|
283
314
|
name="buy-button"
|
|
284
|
-
caption="${
|
|
315
|
+
caption="${O(a)}"
|
|
285
316
|
align="center"
|
|
286
|
-
esd-extension-block-id="${
|
|
317
|
+
esd-extension-block-id="${A.BUTTON}"
|
|
287
318
|
product-attr="button"
|
|
288
319
|
data-slot-6
|
|
289
|
-
data-type="${
|
|
320
|
+
data-type="${e}"
|
|
290
321
|
data-number="${t}"
|
|
291
|
-
>${
|
|
292
|
-
</${
|
|
322
|
+
>${O(a)}
|
|
323
|
+
</${P.BLOCK_BUTTON}>
|
|
293
324
|
`;
|
|
294
|
-
},
|
|
295
|
-
const
|
|
296
|
-
if (
|
|
297
|
-
const n = !
|
|
298
|
-
let
|
|
325
|
+
}, Pt = (e, t, a, s = !0, c = !0) => {
|
|
326
|
+
const i = t === N.ORIENTATION.VERTICAL, o = a === "horizontal";
|
|
327
|
+
if (i) {
|
|
328
|
+
const n = !o, r = n || !c ? "100%" : "50%", p = n || !s ? "100%" : "50%";
|
|
329
|
+
let l = e.replace(
|
|
299
330
|
/<td\s+[^>]*class="([^"]*product-price-class[^"]*)"[^>]*>/gi,
|
|
300
|
-
(
|
|
331
|
+
($) => $.replace(/width="[^"]*"/gi, `width="${r}"`).replace(/width:\s*[^;]+;/gi, `width: ${r};`)
|
|
301
332
|
);
|
|
302
|
-
return
|
|
333
|
+
return l = l.replace(
|
|
303
334
|
/<td\s+[^>]*class="([^"]*product-original-price-class[^"]*)"[^>]*>/gi,
|
|
304
|
-
(
|
|
305
|
-
),
|
|
335
|
+
($) => $.replace(/width="[^"]*"/gi, `width="${p}"`).replace(/width:\s*[^;]+;/gi, `width: ${p};`)
|
|
336
|
+
), l;
|
|
306
337
|
}
|
|
307
|
-
return
|
|
338
|
+
return o ? e : e.replace(
|
|
308
339
|
/<td\s+[^>]*class="[^"]*horizontal-price[^"]*"[^>]*>/gi,
|
|
309
340
|
(n) => /style\s*=\s*"/i.test(n) ? n.replace(/style\s*=\s*"([^"]*)"/i, 'style="display: none; $1"') : n.replace(/>$/, ' style="display: none;">')
|
|
310
341
|
).replace(
|
|
311
342
|
/<td\s+[^>]*class="[^"]*vertical-price[^"]*"[^>]*>/gi,
|
|
312
343
|
(n) => n.replace(/display:\s*none;?/gi, "display: table-cell;")
|
|
313
344
|
);
|
|
314
|
-
},
|
|
345
|
+
}, ht = (e) => e ? `<td align="center"
|
|
315
346
|
esd-extension-block-id="items-block"
|
|
316
|
-
class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block">` :
|
|
317
|
-
const
|
|
347
|
+
class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block">` : ct, Q = (e, t, a, s, c, i, o, n, r, p, l, $, T, _ = "horizontal", I, u, E, d, m) => {
|
|
348
|
+
const y = p !== void 0 ? ` data-nodup="${p}"` : "", h = `data-type="${t}" data-number="${a}"`, R = m ? ` ${X(
|
|
349
|
+
ut(m, o, n, d)
|
|
350
|
+
)}` : "", U = `${h} data-orientation="${s}"${y}${R}`, g = r == null ? void 0 : r["data-product_image_control_image-height"], G = i ? Et(t, a, g, l) : Tt(t, a), J = (l == null ? void 0 : l.buttonLabel) || "Buy", Z = (l == null ? void 0 : l.buttonFullWidth) !== void 0 ? l.buttonFullWidth : !0, tt = t === N.ITEMS_TYPE.BROWSED_ITEMS ? !1 : l == null ? void 0 : l.quantityControlEnabled, et = (l == null ? void 0 : l.buttonVisible) !== void 0 ? l.buttonVisible : (r == null ? void 0 : r["data-product_button_control_enabled"]) !== "false", H = (l == null ? void 0 : l.priceVisible) !== void 0 ? l.priceVisible : (r == null ? void 0 : r["data-product_price_control_enabled"]) !== "false", z = (l == null ? void 0 : l.originalPriceVisible) !== void 0 ? l.originalPriceVisible : (r == null ? void 0 : r["data-product_original_price_control_enabled"]) !== "false", at = e.replace("{-{-TEMPLATE_FIRST_LINE-}-}", ht(i)).replace("{-{-PRODUCT_IMAGE-}-}", G).replace("{-{-PRODUCT_NAME-}-}", _t(t, i, $, l, s)).replaceAll(
|
|
318
351
|
"{-{-PRODUCT_PRICE-}-}",
|
|
319
|
-
|
|
352
|
+
X(It(
|
|
320
353
|
t,
|
|
321
|
-
|
|
354
|
+
a,
|
|
355
|
+
c,
|
|
322
356
|
o,
|
|
323
|
-
i,
|
|
324
357
|
n,
|
|
325
|
-
|
|
358
|
+
i,
|
|
326
359
|
I,
|
|
327
360
|
d,
|
|
328
361
|
s,
|
|
329
|
-
|
|
362
|
+
H,
|
|
363
|
+
m
|
|
330
364
|
))
|
|
331
365
|
).replaceAll(
|
|
332
366
|
"{-{-PRODUCT_ORIGINAL_PRICE-}-}",
|
|
333
|
-
|
|
367
|
+
X(mt(
|
|
334
368
|
t,
|
|
335
|
-
|
|
369
|
+
a,
|
|
370
|
+
c,
|
|
336
371
|
o,
|
|
337
|
-
i,
|
|
338
372
|
n,
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
373
|
+
i,
|
|
374
|
+
z,
|
|
375
|
+
u,
|
|
342
376
|
d,
|
|
343
|
-
s
|
|
377
|
+
s,
|
|
378
|
+
m
|
|
344
379
|
))
|
|
345
|
-
).replace("{-{-PRODUCT_QUANTITY-}-}",
|
|
380
|
+
).replace("{-{-PRODUCT_QUANTITY-}-}", At(tt, i, E)).replace(
|
|
346
381
|
"{-{-PRODUCT_BUTTON-}-}",
|
|
347
|
-
|
|
382
|
+
Ot(t, a, J, i, T, Z, et)
|
|
348
383
|
).replace(
|
|
349
384
|
/<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
|
|
350
|
-
`<td$1 ${
|
|
385
|
+
`<td$1 ${U}>`
|
|
351
386
|
);
|
|
352
|
-
return
|
|
353
|
-
|
|
387
|
+
return Pt(
|
|
388
|
+
at,
|
|
354
389
|
s,
|
|
355
390
|
_,
|
|
356
|
-
|
|
357
|
-
|
|
391
|
+
H,
|
|
392
|
+
z
|
|
358
393
|
);
|
|
359
394
|
};
|
|
360
|
-
function
|
|
361
|
-
orientation:
|
|
362
|
-
itemsType: t =
|
|
363
|
-
itemId:
|
|
395
|
+
function gt({
|
|
396
|
+
orientation: e,
|
|
397
|
+
itemsType: t = N.ITEMS_TYPE.CART_ITEMS,
|
|
398
|
+
itemId: a,
|
|
364
399
|
currencySymbol: s,
|
|
365
|
-
currencyLocation:
|
|
366
|
-
migrate:
|
|
367
|
-
formattedPrice:
|
|
400
|
+
currencyLocation: c,
|
|
401
|
+
migrate: i = !1,
|
|
402
|
+
formattedPrice: o = !0,
|
|
368
403
|
configBlockAttributes: n,
|
|
369
404
|
nodeConfig: r,
|
|
370
405
|
nameStyles: p,
|
|
371
|
-
buttonStyles:
|
|
372
|
-
priceStyles:
|
|
373
|
-
originalPriceStyles:
|
|
406
|
+
buttonStyles: l,
|
|
407
|
+
priceStyles: $,
|
|
408
|
+
originalPriceStyles: T,
|
|
374
409
|
quantityStyles: _,
|
|
375
|
-
priceOrientation: I
|
|
410
|
+
priceOrientation: I,
|
|
411
|
+
priceFormat: u
|
|
376
412
|
}) {
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
const
|
|
380
|
-
|
|
381
|
-
const
|
|
382
|
-
return
|
|
383
|
-
|
|
413
|
+
const E = it[t].findIndex((G) => G.value === a), d = dt(a, t), m = (r == null ? void 0 : r.priceSinglePrice) ?? (n == null ? void 0 : n["data-product_price_control_single_price"]) === "1" ?? !1;
|
|
414
|
+
W = b.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[E >= 0 ? E : 0], M = b.PAIRS_FOR_EXTENSION.name[t].DEFAULT[E >= 0 ? E : 0];
|
|
415
|
+
const y = b.PAIRS_FOR_EXTENSION.price[t], h = b.PAIRS_FOR_EXTENSION.originalPrice[t], R = o && !u;
|
|
416
|
+
m ? (C = R ? y.DEFAULT_SINGLE_PRICE_FORMATTED : y.DEFAULT_SINGLE_PRICE, B = R ? h.DEFAULT_SINGLE_PRICE_FORMATTED : h.DEFAULT_SINGLE_PRICE) : (C = R ? y.DEFAULT_PRICE_FORMATTED : y.DEFAULT_PRICE, B = R ? h.DEFAULT_PRICE_FORMATTED : h.DEFAULT_PRICE), K = b.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT;
|
|
417
|
+
const U = I || (r == null ? void 0 : r.priceOrientation) || "horizontal", g = (r == null ? void 0 : r.priceHideDiscount) ?? S.productPriceHideDiscountControlValue === "1";
|
|
418
|
+
return e === N.ORIENTATION.VERTICAL ? Q(
|
|
419
|
+
ot,
|
|
384
420
|
t,
|
|
385
|
-
|
|
386
|
-
|
|
421
|
+
d,
|
|
422
|
+
e,
|
|
423
|
+
o,
|
|
387
424
|
i,
|
|
388
|
-
c,
|
|
389
425
|
s,
|
|
390
|
-
|
|
426
|
+
c,
|
|
391
427
|
n,
|
|
392
|
-
String(
|
|
428
|
+
String(g),
|
|
393
429
|
// nodup
|
|
394
430
|
r,
|
|
395
431
|
p,
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
432
|
+
l,
|
|
433
|
+
U,
|
|
434
|
+
$,
|
|
435
|
+
T,
|
|
400
436
|
_,
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
437
|
+
m,
|
|
438
|
+
u
|
|
439
|
+
) : Q(
|
|
440
|
+
nt,
|
|
404
441
|
t,
|
|
405
|
-
|
|
406
|
-
|
|
442
|
+
d,
|
|
443
|
+
e,
|
|
444
|
+
o,
|
|
407
445
|
i,
|
|
408
|
-
c,
|
|
409
446
|
s,
|
|
410
|
-
|
|
447
|
+
c,
|
|
411
448
|
n,
|
|
412
|
-
String(
|
|
449
|
+
String(g),
|
|
413
450
|
// nodup
|
|
414
451
|
r,
|
|
415
452
|
p,
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
453
|
+
l,
|
|
454
|
+
U,
|
|
455
|
+
$,
|
|
456
|
+
T,
|
|
420
457
|
_,
|
|
421
|
-
|
|
458
|
+
m,
|
|
459
|
+
u
|
|
422
460
|
);
|
|
423
461
|
}
|
|
424
462
|
export {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
463
|
+
Pt as applyPriceOrientationStyles,
|
|
464
|
+
gt as getDefaultTemplate,
|
|
465
|
+
L as wrapInTableRow
|
|
428
466
|
};
|