@useinsider/guido 2.0.0-beta.e68b206 → 2.0.0-beta.ecd6540

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