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