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