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