@useinsider/guido 3.28.0-beta.93b3145 → 3.28.0-beta.ea702a6

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.
@@ -3,9 +3,9 @@ import { MinDeviceViewport as C, DefaultPadding as R } from "../enums/recommenda
3
3
  import { useRecommendationExtensionStore as g } from "../extensions/Blocks/Recommendation/store/recommendation.js";
4
4
  import { generateCompleteFilterQuery as b } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
5
5
  import { getPartnerRecommendationParams as h } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
6
- import { sanitizeProductIds as x } from "../extensions/Blocks/Recommendation/utils/productIds.js";
7
- import { useConfigStore as P } from "../stores/config.js";
8
- const B = () => ({
6
+ import { sanitizeProductIds as P } from "../extensions/Blocks/Recommendation/utils/productIds.js";
7
+ import { useConfigStore as S } from "../stores/config.js";
8
+ const M = () => ({
9
9
  calculateCardWidth: ({
10
10
  mobileLeftPadding: s,
11
11
  mobileRightPadding: c,
@@ -24,11 +24,7 @@ const B = () => ({
24
24
  mobileLeftPadding: 0,
25
25
  mobileRightPadding: 0,
26
26
  cardsInRow: 2,
27
- unresponsive: !1,
28
- priceBeforeTextValue: "",
29
- priceAfterTextValue: "",
30
- discountBeforeTextValue: "",
31
- discountAfterTextValue: ""
27
+ unresponsive: !1
32
28
  };
33
29
  const { recommendationConfigs: i } = a, e = i.orientation === "grid" ? "vertical" : "horizontal";
34
30
  return {
@@ -37,16 +33,12 @@ const B = () => ({
37
33
  mobileLeftPadding: 0,
38
34
  mobileRightPadding: 0,
39
35
  cardsInRow: i.cardsInRow,
40
- unresponsive: i.unresponsive,
41
- priceBeforeTextValue: "",
42
- priceAfterTextValue: "",
43
- discountBeforeTextValue: "",
44
- discountAfterTextValue: ""
36
+ unresponsive: i.unresponsive
45
37
  };
46
38
  },
47
39
  buildCampaignUrl: (s, c) => {
48
40
  var l;
49
- const o = g(), a = P(), i = Number(s);
41
+ const o = g(), a = S(), i = Number(s);
50
42
  let e;
51
43
  if (c)
52
44
  e = c;
@@ -78,7 +70,7 @@ const B = () => ({
78
70
  return delete r[s], o.recommendationCampaignUrls = r, "";
79
71
  }
80
72
  const t = new URLSearchParams();
81
- t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", a.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", a.variationId), e.strategy === "manualMerchandising" ? t.set("productId", x(e.productIds)) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
73
+ t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", a.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", a.variationId), e.strategy === "manualMerchandising" ? t.set("productId", P(e.productIds)) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
82
74
  const f = e.filters.filter((r) => r.isValid), m = b(f);
83
75
  m && t.set("filter", m), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(h(a.partnerName, e.strategy)).forEach(([r, n]) => t.set(r, n));
84
76
  const p = decodeURIComponent(t.toString()), u = `${I.RECOMMENDATION_API_URL}/v2/${d}?${p}`;
@@ -86,5 +78,5 @@ const B = () => ({
86
78
  }
87
79
  });
88
80
  export {
89
- B as useRecommendation
81
+ M as useRecommendation
90
82
  };
@@ -1,14 +1,14 @@
1
- import { useRecommendation as N } from "../../composables/useRecommendation.js";
2
- import { DUMMY_IMAGE_MAPPINGS as h, REGEX as d, VerticalOrientation as $, CSS as n, ATTRIBUTES as p, CONDITIONS as A, HTML as g } from "../../enums/recommendation.js";
3
- import { prepareRecommendationBlocks as O } from "./utils/recommendationCompilerUtils.js";
4
- const H = [
1
+ import { useRecommendation as R } from "../../composables/useRecommendation.js";
2
+ import { DUMMY_IMAGE_MAPPINGS as A, REGEX as m, VerticalOrientation as y, CSS as n, CONDITIONS as u, ATTRIBUTES as l, HTML as I } from "../../enums/recommendation.js";
3
+ import { prepareRecommendationBlocks as S } from "./utils/recommendationCompilerUtils.js";
4
+ const f = [
5
5
  {
6
6
  id: "replace-images-with-variable-names",
7
7
  description: "Replacing dummy images with variable names in recommendation module",
8
8
  type: "custom",
9
9
  processor: (t) => {
10
10
  let e = t;
11
- return Object.entries(h).forEach(([, r]) => {
11
+ return Object.entries(A).forEach(([, r]) => {
12
12
  Object.entries(r).forEach(([o, i]) => {
13
13
  e = e.replaceAll(i, `{{${o}}}`);
14
14
  });
@@ -42,17 +42,17 @@ const H = [
42
42
  description: "Adding recommendation unresponsive css",
43
43
  type: "custom",
44
44
  processor: (t) => {
45
- const { calculateCardWidth: e, getRecommendationCampaignData: r } = N();
45
+ const { calculateCardWidth: e, getRecommendationCampaignData: r } = R();
46
46
  let o = t;
47
- const i = o.match(d.ID);
47
+ const i = o.match(m.ID);
48
48
  if (i) {
49
- const s = [];
50
- if (i.forEach((c) => {
51
- const m = /recommendation-id="(.*?)"/i.exec(c), E = m ? m[1].trim() : "", u = r(E);
52
- u.textTrimming && u.orientation === $ && s.push(e(u));
53
- }), s.length) {
54
- const c = `width:${Math.min(...s)}px!important;`;
55
- o = o.replace(n.REGULAR_NAME_HEIGHT, `${n.TRIMMED_NAME_HEIGHT} ${c} ${n.ELLIPSIS}`).replace(n.REGULAR_NAME_CONTAINER_HEIGHT, n.TRIMMED_NAME_CONTAINER_CSS).replace(n.RESPONSIVE_NAME_SIZE, `${n.RESPONSIVE_NAME_HEIGHT} ${c} ${n.ELLIPSIS}`).replace(n.RESPONSIVE_NAME_CONTAINER_HEIGHT, n.TRIMMED_RESPONSIVE_NAME_CONTAINER_CSS);
49
+ const c = [];
50
+ if (i.forEach((s) => {
51
+ const a = /recommendation-id="(.*?)"/i.exec(s), d = a ? a[1].trim() : "", p = r(d);
52
+ p.textTrimming && p.orientation === y && c.push(e(p));
53
+ }), c.length) {
54
+ const s = `width:${Math.min(...c)}px!important;`;
55
+ o = o.replace(n.REGULAR_NAME_HEIGHT, `${n.TRIMMED_NAME_HEIGHT} ${s} ${n.ELLIPSIS}`).replace(n.REGULAR_NAME_CONTAINER_HEIGHT, n.TRIMMED_NAME_CONTAINER_CSS).replace(n.RESPONSIVE_NAME_SIZE, `${n.RESPONSIVE_NAME_HEIGHT} ${s} ${n.ELLIPSIS}`).replace(n.RESPONSIVE_NAME_CONTAINER_HEIGHT, n.TRIMMED_RESPONSIVE_NAME_CONTAINER_CSS);
56
56
  }
57
57
  }
58
58
  return o;
@@ -63,36 +63,24 @@ const H = [
63
63
  id: "prepare-recommendations",
64
64
  description: "Replacing product data with template variables in recommendation blocks",
65
65
  type: "custom",
66
- processor: (t) => O(t),
66
+ processor: (t) => S(t),
67
67
  priority: 48
68
68
  },
69
69
  {
70
70
  id: "add-discount-conditions",
71
71
  description: "Adding discount conditions to the recommendation block",
72
72
  type: "custom",
73
- processor: (t) => {
74
- let e = t;
75
- const r = e.match(d.ATTRIBUTE_PARAGRAPH), { getRecommendationCampaignData: o } = N();
76
- return r !== null && r.forEach((i) => {
77
- const s = i.match(d.CUSTOM_FIELD);
78
- if (!s)
79
- return;
80
- const [c] = s, m = c.match(d.CUSTOM_FIELD_INDEXES_PART), E = c.match(d.CUSTOM_FIELD_NAME_PART), u = i.match(d.ATTRIBUTE_PARAGRAPH_START_TAG);
81
- if (!m || !E || !u)
82
- return;
83
- const [T] = m, [I] = E, [_] = u, b = I.substring(1, I.length - 2), S = _.match(d.COMPOSITION) !== null;
84
- let a = c;
85
- if (S) {
86
- const y = T.substring(2, T.length - 3), l = o(y);
87
- b === p.OMNIBUS_PRICE && (l.priceBeforeTextValue && (a = `${l.priceBeforeTextValue}${a}`), l.priceAfterTextValue && (a = `${a}${l.priceAfterTextValue}`)), b === p.OMNIBUS_DISCOUNT && (l.discountBeforeTextValue && (a = `${l.discountBeforeTextValue}${a}`), l.discountAfterTextValue && (a = `${a}${l.discountAfterTextValue}`));
88
- }
89
- const R = T.substring(2);
90
- let f = "";
91
- b in A.IF && (f = A.IF[b].replaceAll(`{${p.DISCOUNT}}`, `${R}${p.DISCOUNT}`).replaceAll(`{${p.OMNIBUS_DISCOUNT}}`, `${R}${p.OMNIBUS_DISCOUNT}`).replaceAll(`{${p.OMNIBUS_PRICE}}`, `${R}${p.OMNIBUS_PRICE}`));
92
- const M = `${_}${a}${g.PARAGRAPH_END_TAG}`, C = `${f}${S ? M : i}${A.ELSE}${_}${g.PARAGRAPH_END_TAG}${A.END_IF}`;
93
- e = e.replace(i, C);
94
- }), e;
95
- },
73
+ processor: (t) => t.replace(m.ATTRIBUTE_PARAGRAPH, (e) => {
74
+ const r = e.match(m.CUSTOM_FIELD);
75
+ if (!r)
76
+ return e;
77
+ const [o] = r, i = o.match(m.CUSTOM_FIELD_INDEXES_PART), c = o.match(m.CUSTOM_FIELD_NAME_PART), s = e.match(m.ATTRIBUTE_PARAGRAPH_START_TAG);
78
+ if (!i || !c || !s)
79
+ return e;
80
+ const [a] = i, [d] = c, [p] = s, b = d.substring(1, d.length - 2), E = a.substring(2);
81
+ let _ = "";
82
+ return b in u.IF && (_ = u.IF[b].replaceAll(`{${l.DISCOUNT}}`, `${E}${l.DISCOUNT}`).replaceAll(`{${l.OMNIBUS_DISCOUNT}}`, `${E}${l.OMNIBUS_DISCOUNT}`).replaceAll(`{${l.OMNIBUS_PRICE}}`, `${E}${l.OMNIBUS_PRICE}`)), `${_}${e}${u.ELSE}${p}${I.PARAGRAPH_END_TAG}${u.END_IF}`;
83
+ }),
96
84
  priority: 53
97
85
  },
98
86
  {
@@ -147,8 +135,8 @@ const H = [
147
135
  ), e = e.replace(
148
136
  /@media[^{]*max-width\s*:\s*480px[^{]*\{((?:[^{}]*\{[^{}]*\})*[^{}]*)\}/g,
149
137
  (r, o) => {
150
- const i = o.match(/[^{}]+\{[^{}]*\}/g) || [], s = /ins-recommendation|product-image-cell|button-cell|product-info-cell/;
151
- return i.every((m) => s.test(m)) ? "" : r;
138
+ const i = o.match(/[^{}]+\{[^{}]*\}/g) || [], c = /ins-recommendation|product-image-cell|button-cell|product-info-cell/;
139
+ return i.every((a) => c.test(a)) ? "" : r;
152
140
  }
153
141
  )), e;
154
142
  },
@@ -208,5 +196,5 @@ const H = [
208
196
  }
209
197
  ];
210
198
  export {
211
- H as recommendationCompilerRules
199
+ f as recommendationCompilerRules
212
200
  };
@@ -1,122 +1,125 @@
1
- var O = Object.defineProperty;
2
- var x = (r, t, e) => t in r ? O(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
- var w = (r, t, e) => x(r, typeof t != "symbol" ? t + "" : t, e);
4
- import { BLOCK_ID as V } from "../../extensions/Blocks/Items/block.js";
5
- import { hasZeroWidthDeclaration as H, withoutZeroWidth as N } from "../../extensions/Blocks/Items/constants/cardWidth.js";
1
+ var V = Object.defineProperty;
2
+ var N = (o, t, e) => t in o ? V(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
+ var w = (o, t, e) => N(o, typeof t != "symbol" ? t + "" : t, e);
4
+ import { BLOCK_ID as H } from "../../extensions/Blocks/Items/block.js";
5
+ import { hasZeroWidthDeclaration as U, withoutZeroWidth as W } from "../../extensions/Blocks/Items/constants/cardWidth.js";
6
6
  import { ItemInCartOptions as E, DefaultConfigValues as S, SETTINGS_ENUMS as p } from "../../extensions/Blocks/Items/enums/settingsEnums.js";
7
- import { getDefaultTemplate as W } from "../../extensions/Blocks/Items/template.js";
8
- import { useTemplateStore as $ } from "../../stores/template.js";
9
- import { protectLiquid as F, restoreLiquid as U } from "../../utils/liquidProtection.js";
10
- const D = "table.es-left, table.es-right", Y = [
7
+ import { getDefaultTemplate as $ } from "../../extensions/Blocks/Items/template.js";
8
+ import { useTemplateStore as F } from "../../stores/template.js";
9
+ import { protectLiquid as P, restoreLiquid as D } from "../../utils/liquidProtection.js";
10
+ const Y = /\{%-?\s*(\w+)(?:(?!\{%)[\s\S])*?%\}/g, z = [
11
+ /\{%\s*if\s+(ins_apr|browsed_item|purchased_item)_total_product_kind\s*(>|>)\s*\d+\s*%\}/,
12
+ /\{%\s*if\s+(ins_apr|browsed_item|purchased_item)_price_\d+\s*(!=|!=)\s*\1_originalprice_\d+\s*%\}/
13
+ ], G = /esd-custom-display-conditions?="[^"]*"/g, R = "table.es-left, table.es-right", j = [
11
14
  ".es-hidden",
12
15
  ".ins-product-td",
13
16
  "td.esd-cart-items-block",
14
17
  "td.esd-browsed-items-block",
15
18
  "td.esd-purchased-items-block"
16
19
  ].join(", ");
17
- function h(r) {
18
- const t = Number(r.getAttribute("width"));
20
+ function h(o) {
21
+ const t = Number(o.getAttribute("width"));
19
22
  return Number.isFinite(t) && t > 0 ? t : 0;
20
23
  }
21
- function P(r) {
22
- return Array.from(r.children).filter((t) => t.tagName === "TBODY").flatMap((t) => Array.from(t.children)).flatMap((t) => Array.from(t.children).filter((e) => e.tagName === "TD"));
24
+ function k(o) {
25
+ return Array.from(o.children).filter((t) => t.tagName === "TBODY").flatMap((t) => Array.from(t.children)).flatMap((t) => Array.from(t.children).filter((e) => e.tagName === "TD"));
23
26
  }
24
- function z(r) {
25
- var e, i;
26
- let t = (e = r.parentElement) == null ? void 0 : e.closest("table");
27
+ function J(o) {
28
+ var e, u;
29
+ let t = (e = o.parentElement) == null ? void 0 : e.closest("table");
27
30
  for (; t; ) {
28
- const o = h(t);
29
- if (o)
30
- return o;
31
- t = (i = t.parentElement) == null ? void 0 : i.closest("table");
31
+ const a = h(t);
32
+ if (a)
33
+ return a;
34
+ t = (u = t.parentElement) == null ? void 0 : u.closest("table");
32
35
  }
33
36
  return 0;
34
37
  }
35
- function k(r) {
36
- var a, c;
37
- const t = (c = (a = r.parentElement) == null ? void 0 : a.parentElement) == null ? void 0 : c.parentElement, e = t == null ? void 0 : t.parentElement;
38
- if (!t || !e || !t.matches(D) || !h(r))
38
+ function q(o) {
39
+ var c, r;
40
+ const t = (r = (c = o.parentElement) == null ? void 0 : c.parentElement) == null ? void 0 : r.parentElement, e = t == null ? void 0 : t.parentElement;
41
+ if (!t || !e || !t.matches(R) || !h(o))
39
42
  return !1;
40
- const i = P(t), o = i.some((l) => !l.matches(Y) && h(l));
41
- if (!i.includes(r) || o)
43
+ const u = k(t), a = u.some((i) => !i.matches(j) && h(i));
44
+ if (!u.includes(o) || a)
42
45
  return !1;
43
- const u = Array.from(e.children).filter((l) => l.matches(D)).reduce((l, d) => l + Math.max(0, ...P(d).map(h)), 0), n = z(e);
44
- return n > 0 && u <= n;
46
+ const l = Array.from(e.children).filter((i) => i.matches(R)).reduce((i, d) => i + Math.max(0, ...k(d).map(h)), 0), n = J(e);
47
+ return n > 0 && l <= n;
45
48
  }
46
- function j() {
49
+ function Z() {
47
50
  return String(Date.now() + Math.floor(Math.random() * 1e3));
48
51
  }
49
- function R(r) {
50
- return r ? {
52
+ function L(o) {
53
+ return o ? {
51
54
  CartItems: p.ITEMS_TYPE.CART_ITEMS,
52
55
  BrowsedItems: p.ITEMS_TYPE.BROWSED_ITEMS,
53
56
  PurchasedItems: p.ITEMS_TYPE.PURCHASED_ITEMS,
54
57
  CART_ITEMS: p.ITEMS_TYPE.CART_ITEMS,
55
58
  BROWSED_ITEMS: p.ITEMS_TYPE.BROWSED_ITEMS,
56
59
  PURCHASED_ITEMS: p.ITEMS_TYPE.PURCHASED_ITEMS
57
- }[r] || p.ITEMS_TYPE.CART_ITEMS : p.ITEMS_TYPE.CART_ITEMS;
60
+ }[o] || p.ITEMS_TYPE.CART_ITEMS : p.ITEMS_TYPE.CART_ITEMS;
58
61
  }
59
- function J(r) {
60
- return r.classList.contains("esd-browsed-items-block") ? p.ITEMS_TYPE.BROWSED_ITEMS : r.classList.contains("esd-purchased-items-block") ? p.ITEMS_TYPE.PURCHASED_ITEMS : p.ITEMS_TYPE.CART_ITEMS;
62
+ function K(o) {
63
+ return o.classList.contains("esd-browsed-items-block") ? p.ITEMS_TYPE.BROWSED_ITEMS : o.classList.contains("esd-purchased-items-block") ? p.ITEMS_TYPE.PURCHASED_ITEMS : p.ITEMS_TYPE.CART_ITEMS;
61
64
  }
62
- function q(r) {
63
- var a;
64
- const t = (c, l) => c == null ? l : c === "1" || c === "true", e = (c, l) => c || l, i = r["data-type"] || r["data-source"], o = R(i), u = E[o];
65
- let n = r["data-cart_items_select_control_value"] || ((a = u == null ? void 0 : u[0]) == null ? void 0 : a.value) || S.cartItemsSelectControlValue;
65
+ function B(o) {
66
+ var c;
67
+ const t = (r, i) => r == null ? i : r === "1" || r === "true", e = (r, i) => r || i, u = o["data-type"] || o["data-source"], a = L(u), l = E[a];
68
+ let n = o["data-cart_items_select_control_value"] || ((c = l == null ? void 0 : l[0]) == null ? void 0 : c.value) || S.cartItemsSelectControlValue;
66
69
  if (n && !n.includes("{{") && /^\d+$/.test(n)) {
67
- const c = parseInt(n) - 1, l = E[o];
68
- l && l[c] && (n = l[c].value);
70
+ const r = parseInt(n) - 1, i = E[a];
71
+ i && i[r] && (n = i[r].value);
69
72
  }
70
73
  return {
71
74
  initialized: !0,
72
- blockInstanceId: e(r["data-block-instance-id"], j()),
73
- source: o,
74
- type: o,
75
+ blockInstanceId: e(o["data-block-instance-id"], Z()),
76
+ source: a,
77
+ type: a,
75
78
  itemsSelectValue: n,
76
- orientation: r["data-card_orientation_control_value"] || p.ORIENTATION.VERTICAL,
77
- nameTrimming: t(r["data-product_name_control_trim"], !0),
78
- priceHideDiscount: t(r["data-product_price_control_nodup"], !0),
79
- priceFormatted: t(r["data-product_price_control_formated"], !0),
80
- priceSinglePrice: t(r["data-product_price_control_single_price"], !1),
79
+ orientation: o["data-card_orientation_control_value"] || p.ORIENTATION.VERTICAL,
80
+ nameTrimming: t(o["data-product_name_control_trim"], !0),
81
+ priceHideDiscount: t(o["data-product_price_control_nodup"], !0),
82
+ priceFormatted: t(o["data-product_price_control_formated"], !0),
83
+ priceSinglePrice: t(o["data-product_price_control_single_price"], !1),
81
84
  priceCurrencySymbol: e(
82
- r["data-product_price_control_currency_symbol"],
85
+ o["data-product_price_control_currency_symbol"],
83
86
  S.productPriceCurrencySymbolControlValue
84
87
  ),
85
88
  priceCurrencyLocation: e(
86
- r["data-product_price_currency_location"],
89
+ o["data-product_price_currency_location"],
87
90
  S.productPriceCurrencyLocationControlValue
88
91
  ),
89
- priceOrientation: r["data-product_original_price_control_orientation"] || "horizontal",
90
- quantityControlEnabled: t(r["data-product_quantity_control_enabled"], !0),
91
- buttonLink: e(r["data-product_button_link"], S.productButtonLinkControlValue),
92
- imageLink: e(r["data-product_image_link"], S.productImageLinkControlValue),
93
- buttonLabel: e(r["data-product_button_control_label"], "Buy"),
94
- buttonFullWidth: t(r["data-product_button_control_atw"], !0),
95
- imageVisible: t(r["data-product_image_control_enabled"], !0),
96
- nameVisible: t(r["data-product_name_control_enabled"], !0),
97
- quantityVisible: t(r["data-product_quantity_control_enabled"], !0),
98
- priceVisible: t(r["data-product_price_control_enabled"], !0),
99
- originalPriceVisible: t(r["data-product_original_price_control_enabled"], !0),
100
- buttonVisible: t(r["data-product_button_control_enabled"], !0)
92
+ priceOrientation: o["data-product_original_price_control_orientation"] || "horizontal",
93
+ quantityControlEnabled: t(o["data-product_quantity_control_enabled"], !0),
94
+ buttonLink: e(o["data-product_button_link"], S.productButtonLinkControlValue),
95
+ imageLink: e(o["data-product_image_link"], S.productImageLinkControlValue),
96
+ buttonLabel: e(o["data-product_button_control_label"], "Buy"),
97
+ buttonFullWidth: t(o["data-product_button_control_atw"], !0),
98
+ imageVisible: t(o["data-product_image_control_enabled"], !0),
99
+ nameVisible: t(o["data-product_name_control_enabled"], !0),
100
+ quantityVisible: t(o["data-product_quantity_control_enabled"], !0),
101
+ priceVisible: t(o["data-product_price_control_enabled"], !0),
102
+ originalPriceVisible: t(o["data-product_original_price_control_enabled"], !0),
103
+ buttonVisible: t(o["data-product_button_control_enabled"], !0)
101
104
  };
102
105
  }
103
- function Z(r, t) {
106
+ function Q(o, t) {
104
107
  const e = {
105
108
  CART_ITEMS: `{{Abandoned Cart Item (${t}) Image}}`,
106
109
  BROWSED_ITEMS: `{{Browsed Item (${t}) Image}}`,
107
110
  PURCHASED_ITEMS: `{{Purchased Item (${t}) Image}}`
108
111
  };
109
- return e[r] || e.CART_ITEMS;
112
+ return e[o] || e.CART_ITEMS;
110
113
  }
111
- function G(r, t) {
114
+ function X(o, t) {
112
115
  const e = {
113
116
  CART_ITEMS: `{{Abandoned Cart Item (${t}) Url}}`,
114
117
  BROWSED_ITEMS: `{{Browsed Item (${t}) Url}}`,
115
118
  PURCHASED_ITEMS: `{{Purchased Item (${t}) Url}}`
116
119
  };
117
- return e[r] || e.CART_ITEMS;
120
+ return e[o] || e.CART_ITEMS;
118
121
  }
119
- class K {
122
+ class tt {
120
123
  constructor() {
121
124
  w(this, "parser");
122
125
  this.parser = new DOMParser();
@@ -125,41 +128,41 @@ class K {
125
128
  try {
126
129
  if (!this.containsItemsBlock(t))
127
130
  return this.backfillV2ProductTdAttributes(t);
128
- const e = this.removeJinjaConditionals(t), i = this.parser.parseFromString(e, "text/html"), o = i.querySelectorAll(
131
+ const e = this.removeJinjaConditionals(t), u = this.parser.parseFromString(P(e), "text/html"), a = u.querySelectorAll(
129
132
  "td.esd-cart-items-block, td.esd-browsed-items-block, td.esd-purchased-items-block"
130
133
  );
131
- if ($().$patch((a) => {
132
- a.migrations = { ...a.migrations, [V]: o.length };
133
- }), o.length === 0)
134
+ if (F().$patch((c) => {
135
+ c.migrations = { ...c.migrations, [H]: a.length };
136
+ }), a.length === 0)
134
137
  return console.warn("ItemsBlockMigrator: No blocks found with items block selectors"), this.backfillV2ProductTdAttributes(e);
135
- const n = new Set(Array.from(o).filter(k));
136
- return o.forEach((a) => {
137
- const c = this.extractConfiguration(a), l = W({
138
- orientation: c.orientation,
139
- itemsType: c.itemsType,
140
- itemId: c.itemId,
141
- currencySymbol: c.currencySymbol,
142
- currencyLocation: c.currencyLocation,
143
- formattedPrice: c.formattedPrice,
144
- configBlockAttributes: c.configBlockAttributes,
138
+ const n = new Set(Array.from(a).filter(q));
139
+ return a.forEach((c) => {
140
+ const r = this.extractConfiguration(c), i = $({
141
+ orientation: r.orientation,
142
+ itemsType: r.itemsType,
143
+ itemId: r.itemId,
144
+ currencySymbol: r.currencySymbol,
145
+ currencyLocation: r.currencyLocation,
146
+ formattedPrice: r.formattedPrice,
147
+ configBlockAttributes: r.configBlockAttributes,
145
148
  migrate: !0,
146
- nameStyles: c.nameStyles,
147
- buttonStyles: c.buttonStyles,
148
- priceStyles: c.priceStyles,
149
- originalPriceStyles: c.originalPriceStyles,
150
- quantityStyles: c.quantityStyles,
151
- nodeConfig: q(c.configBlockAttributes)
149
+ nameStyles: r.nameStyles,
150
+ buttonStyles: r.buttonStyles,
151
+ priceStyles: r.priceStyles,
152
+ originalPriceStyles: r.originalPriceStyles,
153
+ quantityStyles: r.quantityStyles,
154
+ nodeConfig: B(r.configBlockAttributes)
152
155
  }), s = this.parser.parseFromString(
153
- `<table><tbody><tr>${l}</tr></tbody></table>`,
156
+ `<table><tbody><tr>${i}</tr></tbody></table>`,
154
157
  "text/html"
155
158
  ).querySelector("td");
156
- if (s && a.parentNode) {
157
- const _ = q(c.configBlockAttributes);
159
+ if (s && c.parentNode) {
160
+ const _ = B(r.configBlockAttributes);
158
161
  s.setAttribute("esd-ext-config", JSON.stringify(_)), s.setAttribute("data-type", _.type);
159
162
  const m = s.querySelector("esd-config-block");
160
- m && m.remove(), n.has(a) && (s.setAttribute("width", String(h(a))), s.classList.add("esd-container-frame")), a.parentNode.replaceChild(s, a);
163
+ m && m.remove(), n.has(c) && (s.setAttribute("width", String(h(c))), s.classList.add("esd-container-frame")), c.parentNode.replaceChild(s, c);
161
164
  }
162
- }), this.backfillV2ProductTdAttributes(i.documentElement.outerHTML);
165
+ }), this.backfillV2ProductTdAttributes(D(u.documentElement.outerHTML));
163
166
  } catch (e) {
164
167
  return console.error("ItemsBlockMigrator failed:", e), t;
165
168
  }
@@ -172,24 +175,24 @@ class K {
172
175
  */
173
176
  extractConfiguration(t) {
174
177
  var M;
175
- const e = R(
176
- this.readSelfOrDescendantAttribute(t, "data-type") || J(t)
177
- ), i = this.readSelfOrDescendantAttribute(t, "data-number") || "1", o = parseInt(i) - 1, u = E[e], n = ((M = u == null ? void 0 : u[o]) == null ? void 0 : M.value) || u[0].value, a = this.extractConfigBlockAttributes(t, e, i);
178
- this.applyDomFallbacks(t, a);
179
- const c = t.querySelector('[product-attr="price"]'), l = a["data-product_price_control_currency_symbol"], d = a["data-product_price_currency_location"] || "0", s = a["data-product_price_control_formated"], _ = s !== "false" && s !== "0", A = a["data-card_orientation_control_value"] === "horizontal" ? "horizontal" : "vertical", g = t.querySelector('a[product-attr="name"]'), y = (g == null ? void 0 : g.getAttribute("style")) || void 0, b = t.querySelector('a[product-attr="button"]') ?? t.querySelector('[product-attr="button"]'), I = (b == null ? void 0 : b.getAttribute("style")) || void 0, B = (c == null ? void 0 : c.getAttribute("style")) || void 0, f = t.querySelector("p.original-price") ?? t.querySelector('[product-attr="originalPrice"]'), T = f != null && f.getAttribute("style") ? f : (f == null ? void 0 : f.closest("p")) ?? f, L = (T == null ? void 0 : T.getAttribute("style")) || void 0, C = t.querySelector('[product-attr="quantity"]'), v = (C == null ? void 0 : C.getAttribute("style")) || void 0;
178
+ const e = L(
179
+ this.readSelfOrDescendantAttribute(t, "data-type") || K(t)
180
+ ), u = this.readSelfOrDescendantAttribute(t, "data-number") || "1", a = parseInt(u) - 1, l = E[e], n = ((M = l == null ? void 0 : l[a]) == null ? void 0 : M.value) || l[0].value, c = this.extractConfigBlockAttributes(t, e, u);
181
+ this.applyDomFallbacks(t, c);
182
+ const r = t.querySelector('[product-attr="price"]'), i = c["data-product_price_control_currency_symbol"], d = c["data-product_price_currency_location"] || "0", s = c["data-product_price_control_formated"], _ = s !== "false" && s !== "0", A = c["data-card_orientation_control_value"] === "horizontal" ? "horizontal" : "vertical", g = t.querySelector('a[product-attr="name"]'), y = (g == null ? void 0 : g.getAttribute("style")) || void 0, b = t.querySelector('a[product-attr="button"]') ?? t.querySelector('[product-attr="button"]'), I = (b == null ? void 0 : b.getAttribute("style")) || void 0, v = (r == null ? void 0 : r.getAttribute("style")) || void 0, f = t.querySelector("p.original-price") ?? t.querySelector('[product-attr="originalPrice"]'), T = f != null && f.getAttribute("style") ? f : (f == null ? void 0 : f.closest("p")) ?? f, x = (T == null ? void 0 : T.getAttribute("style")) || void 0, C = t.querySelector('[product-attr="quantity"]'), O = (C == null ? void 0 : C.getAttribute("style")) || void 0;
180
183
  return {
181
184
  orientation: A,
182
185
  itemsType: e,
183
186
  itemId: n,
184
- currencySymbol: l,
187
+ currencySymbol: i,
185
188
  currencyLocation: d,
186
189
  formattedPrice: _,
187
- configBlockAttributes: a,
190
+ configBlockAttributes: c,
188
191
  nameStyles: y,
189
192
  buttonStyles: I,
190
- priceStyles: B,
191
- originalPriceStyles: L,
192
- quantityStyles: v
193
+ priceStyles: v,
194
+ originalPriceStyles: x,
195
+ quantityStyles: O
193
196
  };
194
197
  }
195
198
  /**
@@ -201,7 +204,7 @@ class K {
201
204
  */
202
205
  applyDomFallbacks(t, e) {
203
206
  var A, g;
204
- const i = t.querySelector("esd-config-block"), o = (...y) => !i || y.every((b) => !(i.getAttribute(b) ?? "").trim());
207
+ const u = t.querySelector("esd-config-block"), a = (...y) => !u || y.every((b) => !(u.getAttribute(b) ?? "").trim());
205
208
  Object.entries({
206
209
  image: '[product-attr="imageSrc"]',
207
210
  name: '[product-attr="name"]',
@@ -211,16 +214,16 @@ class K {
211
214
  button: '[product-attr="button"]'
212
215
  }).forEach(([y, b]) => {
213
216
  const I = `data-product_${y}_control_enabled`;
214
- o(I) && (e[I] = t.querySelector(b) ? "true" : "false");
215
- }), o("data-card_orientation_control_value") && (e["data-card_orientation_control_value"] = t.querySelector('[colspan="2"]') ? "vertical" : "horizontal");
216
- const n = t.querySelector('a[product-attr="button"]') ?? t.querySelector('[product-attr="button"]'), a = (A = n == null ? void 0 : n.textContent) == null ? void 0 : A.replace(/\s+/g, " ").trim();
217
- a && o("data-product_button_control_label") && (e["data-product_button_control_label"] = a);
218
- const c = (n == null ? void 0 : n.getAttribute("style")) || "";
219
- o("data-product_button_control_atw") && /display:\s*inline/.test(c) && !/(?:^|;)\s*width\s*:\s*100%/.test(c) && (e["data-product_button_control_atw"] = "false");
220
- const l = t.querySelector('[product-attr="imageSrc"]'), d = l ? this.readImageSize(l) : null, s = (d == null ? void 0 : d.height) ?? (d == null ? void 0 : d.width), _ = (d == null ? void 0 : d.width) ?? (d == null ? void 0 : d.height);
221
- s && o("data-product_image_control_image-height") && (e["data-product_image_control_image-height"] = s), _ && o("data-product_image_control_image-width") && (e["data-product_image_control_image-width"] = _), this.applyPriceDomFallbacks(t, e, o);
217
+ a(I) && (e[I] = t.querySelector(b) ? "true" : "false");
218
+ }), a("data-card_orientation_control_value") && (e["data-card_orientation_control_value"] = t.querySelector('[colspan="2"]') ? "vertical" : "horizontal");
219
+ const n = t.querySelector('a[product-attr="button"]') ?? t.querySelector('[product-attr="button"]'), c = (A = n == null ? void 0 : n.textContent) == null ? void 0 : A.replace(/\s+/g, " ").trim();
220
+ c && a("data-product_button_control_label") && (e["data-product_button_control_label"] = c);
221
+ const r = (n == null ? void 0 : n.getAttribute("style")) || "";
222
+ a("data-product_button_control_atw") && /display:\s*inline/.test(r) && !/(?:^|;)\s*width\s*:\s*100%/.test(r) && (e["data-product_button_control_atw"] = "false");
223
+ const i = t.querySelector('[product-attr="imageSrc"]'), d = i ? this.readImageSize(i) : null, s = (d == null ? void 0 : d.height) ?? (d == null ? void 0 : d.width), _ = (d == null ? void 0 : d.width) ?? (d == null ? void 0 : d.height);
224
+ s && a("data-product_image_control_image-height") && (e["data-product_image_control_image-height"] = s), _ && a("data-product_image_control_image-width") && (e["data-product_image_control_image-width"] = _), this.applyPriceDomFallbacks(t, e, a);
222
225
  const m = ((g = t.querySelector('[product-attr="name"]')) == null ? void 0 : g.getAttribute("style")) || "";
223
- o("data-product_name_control_trim") && /white-space:\s*normal/.test(m) && (e["data-product_name_control_trim"] = "0");
226
+ a("data-product_name_control_trim") && /white-space:\s*normal/.test(m) && (e["data-product_name_control_trim"] = "0");
224
227
  }
225
228
  /**
226
229
  * Carries the price cell's own currency/format attributes into the config attributes when
@@ -229,22 +232,22 @@ class K {
229
232
  * ₺ but reporting USD/before to the settings panel, and the first unrelated price edit wrote
230
233
  * the default back over the real value.
231
234
  */
232
- applyPriceDomFallbacks(t, e, i) {
233
- var l;
234
- const o = t.querySelector('[product-attr="price"]') ?? t.querySelector('[product-attr="originalPrice"]');
235
- if (!o)
235
+ applyPriceDomFallbacks(t, e, u) {
236
+ var i;
237
+ const a = t.querySelector('[product-attr="price"]') ?? t.querySelector('[product-attr="originalPrice"]');
238
+ if (!a)
236
239
  return;
237
- const u = (l = o.getAttribute("data-currency_symbol")) == null ? void 0 : l.trim();
238
- u && i("data-product_price_control_currency_symbol") && (e["data-product_price_control_currency_symbol"] = u);
239
- const n = o.getAttribute("data-curency");
240
- if (n && i("data-product_price_currency_location", "data-product_price_control_curency")) {
240
+ const l = (i = a.getAttribute("data-currency_symbol")) == null ? void 0 : i.trim();
241
+ l && u("data-product_price_control_currency_symbol") && (e["data-product_price_control_currency_symbol"] = l);
242
+ const n = a.getAttribute("data-curency");
243
+ if (n && u("data-product_price_currency_location", "data-product_price_control_curency")) {
241
244
  const d = n === "after" ? "1" : "0";
242
245
  e["data-product_price_currency_location"] = d, e["data-product_price_control_curency"] = d;
243
246
  }
244
- const a = o.getAttribute("data-formated");
245
- a && i("data-product_price_control_formated") && (e["data-product_price_control_formated"] = a);
246
- const c = o.getAttribute("data-single_price");
247
- c && i("data-product_price_control_single_price") && (e["data-product_price_control_single_price"] = c);
247
+ const c = a.getAttribute("data-formated");
248
+ c && u("data-product_price_control_formated") && (e["data-product_price_control_formated"] = c);
249
+ const r = a.getAttribute("data-single_price");
250
+ r && u("data-product_price_control_single_price") && (e["data-product_price_control_single_price"] = r);
248
251
  }
249
252
  /**
250
253
  * Reads an attribute from the block element itself before falling back to a descendant.
@@ -252,8 +255,8 @@ class K {
252
255
  * esd-config-block; when an author deletes the config block only the td's copy survives.
253
256
  */
254
257
  readSelfOrDescendantAttribute(t, e) {
255
- var i;
256
- return t.getAttribute(e) || ((i = t.querySelector(`[${e}]`)) == null ? void 0 : i.getAttribute(e)) || null;
258
+ var u;
259
+ return t.getAttribute(e) || ((u = t.querySelector(`[${e}]`)) == null ? void 0 : u.getAttribute(e)) || null;
257
260
  }
258
261
  /**
259
262
  * Reads the product image's pixel size — `width`/`height` attributes first, then px values
@@ -273,15 +276,15 @@ class K {
273
276
  * to nothing, so only a positive integer counts as an answer.
274
277
  */
275
278
  readImageDimension(t, e) {
276
- var l;
277
- const i = (d) => {
279
+ var i;
280
+ const u = (d) => {
278
281
  const s = (d ?? "").trim().match(/^(\d+(?:\.\d+)?)(?:px)?$/i), _ = s ? Math.floor(parseFloat(s[1])) : 0;
279
282
  return _ > 0 ? String(_) : null;
280
- }, o = i((l = t.getAttribute(e)) == null ? void 0 : l.trim());
281
- if (o)
282
- return o;
283
- const u = t.getAttribute("style") || "", n = new RegExp(`(?:^|;)\\s*${e}:\\s*(\\d+(?:\\.\\d+)?)px`), a = new RegExp(`max-${e}:\\s*(\\d+(?:\\.\\d+)?)px`), c = u.match(n) || u.match(a);
284
- return i(c == null ? void 0 : c[1]);
283
+ }, a = u((i = t.getAttribute(e)) == null ? void 0 : i.trim());
284
+ if (a)
285
+ return a;
286
+ const l = t.getAttribute("style") || "", n = new RegExp(`(?:^|;)\\s*${e}:\\s*(\\d+(?:\\.\\d+)?)px`), c = new RegExp(`max-${e}:\\s*(\\d+(?:\\.\\d+)?)px`), r = l.match(n) || l.match(c);
287
+ return u(r == null ? void 0 : r[1]);
285
288
  }
286
289
  /**
287
290
  * Extracts all data-* attributes from the esd-config-block element
@@ -290,27 +293,27 @@ class K {
290
293
  * @param itemsType - The type of items (CART_ITEMS, BROWSED_ITEMS, PURCHASED_ITEMS)
291
294
  * @param itemNumber - The item number (1-based index)
292
295
  */
293
- extractConfigBlockAttributes(t, e, i) {
294
- const o = t.querySelector("esd-config-block"), u = {};
295
- if (o) {
296
- if (Array.from(o.attributes).forEach((a) => {
297
- a.name.startsWith("data-") && (u[a.name] = a.value);
298
- }), u["data-cart_items_select_control_value"]) {
299
- const a = u["data-cart_items_select_control_value"];
300
- if (/^\d+$/.test(a)) {
301
- const c = parseInt(a) - 1, l = E[e];
302
- l && l[c] && (u["data-cart_items_select_control_value"] = l[c].value);
296
+ extractConfigBlockAttributes(t, e, u) {
297
+ const a = t.querySelector("esd-config-block"), l = {};
298
+ if (a) {
299
+ if (Array.from(a.attributes).forEach((c) => {
300
+ c.name.startsWith("data-") && (l[c.name] = c.value);
301
+ }), l["data-cart_items_select_control_value"]) {
302
+ const c = l["data-cart_items_select_control_value"];
303
+ if (/^\d+$/.test(c)) {
304
+ const r = parseInt(c) - 1, i = E[e];
305
+ i && i[r] && (l["data-cart_items_select_control_value"] = i[r].value);
303
306
  }
304
307
  }
305
- if (u["data-product_price_control_curency"]) {
306
- const a = u["data-product_price_control_curency"];
307
- let c = a;
308
- a === "before" ? c = "0" : a === "after" && (c = "1"), u["data-product_price_control_curency"] = c, u["data-product_price_currency_location"] = c;
308
+ if (l["data-product_price_control_curency"]) {
309
+ const c = l["data-product_price_control_curency"];
310
+ let r = c;
311
+ c === "before" ? r = "0" : c === "after" && (r = "1"), l["data-product_price_control_curency"] = r, l["data-product_price_currency_location"] = r;
309
312
  }
310
- (!u["data-product_price_control_currency_symbol"] || u["data-product_price_control_currency_symbol"].trim() === "") && (u["data-product_price_control_currency_symbol"] = "USD");
313
+ (!l["data-product_price_control_currency_symbol"] || l["data-product_price_control_currency_symbol"].trim() === "") && (l["data-product_price_control_currency_symbol"] = "USD");
311
314
  }
312
- const n = { ...this.getDefaultConfigBlockAttributes(), ...u };
313
- return n["data-type"] = e, n["data-source"] = e, n["data-product_image_link"] = Z(e, i), n["data-product_button_link"] = G(e, i), n;
315
+ const n = { ...this.getDefaultConfigBlockAttributes(), ...l };
316
+ return n["data-type"] = e, n["data-source"] = e, n["data-product_image_link"] = Q(e, u), n["data-product_button_link"] = X(e, u), n;
314
317
  }
315
318
  /**
316
319
  * Returns default esd-config-block attributes based on the old template structure
@@ -385,31 +388,31 @@ class K {
385
388
  backfillV2ProductTdAttributes(t) {
386
389
  if (!t.includes("ins-product-td") || !t.includes("esd-ext-config"))
387
390
  return t;
388
- const e = this.parser.parseFromString(F(t), "text/html");
389
- let i = !1;
390
- const o = Array.from(e.querySelectorAll(".ins-product-td")), u = new Set(o.filter(k));
391
- return o.forEach((n) => {
392
- const a = u.has(n);
393
- !a && n.hasAttribute("width") && (n.removeAttribute("width"), i = !0), !a && n.classList.contains("esd-container-frame") && (n.classList.remove("esd-container-frame"), i = !0), n.querySelectorAll("table.ins-product-wrapper").forEach((_) => {
394
- !a && _.hasAttribute("width") && _.getAttribute("width") !== "100%" && (_.setAttribute("width", "100%"), i = !0);
391
+ const e = this.parser.parseFromString(P(t), "text/html");
392
+ let u = !1;
393
+ const a = Array.from(e.querySelectorAll(".ins-product-td")), l = new Set(a.filter(q));
394
+ return a.forEach((n) => {
395
+ const c = l.has(n);
396
+ !c && n.hasAttribute("width") && (n.removeAttribute("width"), u = !0), !c && n.classList.contains("esd-container-frame") && (n.classList.remove("esd-container-frame"), u = !0), n.querySelectorAll("table.ins-product-wrapper").forEach((_) => {
397
+ !c && _.hasAttribute("width") && _.getAttribute("width") !== "100%" && (_.setAttribute("width", "100%"), u = !0);
395
398
  const m = _.getAttribute("style");
396
- m && H(m) && (_.setAttribute("style", N(m)), _.setAttribute("width", "100%"), i = !0);
399
+ m && U(m) && (_.setAttribute("style", W(m)), _.setAttribute("width", "100%"), u = !0);
397
400
  });
398
- const c = n.getAttribute("esd-ext-config");
399
- let l = null;
401
+ const r = n.getAttribute("esd-ext-config");
402
+ let i = null;
400
403
  try {
401
- l = c ? JSON.parse(c) : null;
404
+ i = r ? JSON.parse(r) : null;
402
405
  } catch {
403
406
  }
404
- if (!l || (!n.getAttribute("data-nodup") && typeof l.priceHideDiscount == "boolean" && (n.setAttribute("data-nodup", String(l.priceHideDiscount)), i = !0), n.getAttribute("data-type")))
407
+ if (!i || (!n.getAttribute("data-nodup") && typeof i.priceHideDiscount == "boolean" && (n.setAttribute("data-nodup", String(i.priceHideDiscount)), u = !0), n.getAttribute("data-type")))
405
408
  return;
406
- const d = l.type || l.source;
409
+ const d = i.type || i.source;
407
410
  if (!d)
408
411
  return;
409
- n.setAttribute("data-type", d), i = !0;
410
- const s = typeof l.itemsSelectValue == "string" ? l.itemsSelectValue.match(/\((\d+)\)/) : null;
412
+ n.setAttribute("data-type", d), u = !0;
413
+ const s = typeof i.itemsSelectValue == "string" ? i.itemsSelectValue.match(/\((\d+)\)/) : null;
411
414
  s && n.getAttribute("data-number") !== s[1] && n.setAttribute("data-number", s[1]);
412
- }), i ? U(e.documentElement.outerHTML) : t;
415
+ }), u ? D(e.documentElement.outerHTML) : t;
413
416
  }
414
417
  /**
415
418
  * Fast check for the presence of any items block (cart / browsed / purchased)
@@ -420,32 +423,28 @@ class K {
420
423
  return t.includes("esd-cart-items-block") || t.includes("esd-browsed-items-block") || t.includes("esd-purchased-items-block");
421
424
  }
422
425
  /**
423
- * Removes Jinja2 conditional statements from HTML
424
- * Handles all items block types:
425
- * - Cart Items: ins_apr_total_product_kind, ins_apr_price_N, ins_apr_originalprice_N
426
- * - Browsed Items: browsed_item_total_product_kind, browsed_item_price_N, browsed_item_originalprice_N
427
- * - Purchased Items: purchased_item_total_product_kind, purchased_item_price_N, purchased_item_originalprice_N
428
- *
429
- * IMPORTANT: Preserves the esd-custom-display-conditions attribute on <body> which
430
- * contains display condition Jinja scripts that should NOT be removed.
426
+ * Removes each Items guard opener together with the endif that closes it, and no other tag.
427
+ * Liquid inside esd-custom-display-condition(s) attribute values is skipped.
431
428
  */
432
429
  removeJinjaConditionals(t) {
433
- const e = "__ESD_DISPLAY_CONDITIONS_PLACEHOLDER__", i = t.match(/esd-custom-display-conditions="[^"]*"/);
434
- let o = i ? t.replace(i[0], e) : t;
435
- return o = o.replace(
436
- /\{%\s*if\s+(ins_apr|browsed_item|purchased_item)_total_product_kind\s*(&gt;|>)\s*\d+\s*%\}/g,
437
- ""
438
- ), o = o.replace(
439
- /\{%\s*if\s+(ins_apr|browsed_item|purchased_item)_price_\d+\s*(!&#61;|!=)\s*\1_originalprice_\d+\s*%\}/g,
440
- ""
441
- ), o = o.replace(/\{%\s*endif\s*%\}/g, ""), i && (o = o.replace(e, i[0])), o = o.replace(/\n\s*\n\s*\n/g, `
430
+ const e = [...t.matchAll(G)].map((l) => ({ start: l.index, end: l.index + l[0].length })), u = [];
431
+ let a = t.replace(Y, (l, n, c) => {
432
+ if (e.some(({ start: r, end: i }) => c >= r && c < i))
433
+ return l;
434
+ if (n === "if") {
435
+ const r = z.some((i) => i.test(l));
436
+ return u.push(r), r ? "" : l;
437
+ }
438
+ return n === "endif" && u.pop() ? "" : l;
439
+ });
440
+ return a = a.replace(/\n\s*\n\s*\n/g, `
442
441
 
443
- `), o;
442
+ `), a;
444
443
  }
445
444
  }
446
- function nt(r) {
447
- return new K().migrate(r);
445
+ function lt(o) {
446
+ return new tt().migrate(o);
448
447
  }
449
448
  export {
450
- nt as migrateItemsBlock
449
+ lt as migrateItemsBlock
451
450
  };
@@ -27,13 +27,12 @@ const e = 20, t = 320, s = "vertical", m = {
27
27
  ID: /recommendation-id="(.*?)"/gi,
28
28
  ATTRIBUTE_PARAGRAPH: /<p[^>]*?product-attr="(discount|omnibus_discount|omnibus_price)"[^>]*>[\S\s]*?<\/p>/gm,
29
29
  ATTRIBUTE_PARAGRAPH_START_TAG: /<p[^>]*?product-attr="(discount|omnibus_discount|omnibus_price)"[^>]*>/gm,
30
- COMPOSITION: /composition="true"/gm,
31
30
  CUSTOM_FIELD: /{{(?:reco_)?[0-9]+_[0-8]_(discount|omnibus_discount|omnibus_price)}}/gm,
32
31
  CUSTOM_FIELD_INDEXES_PART: /{{(?:reco_)?[0-9]+_[0-8]_/gm,
33
32
  CUSTOM_FIELD_NAME_PART: /_(discount|omnibus_discount|omnibus_price)}}/gm
34
- }, o = {
35
- PARAGRAPH_END_TAG: "</p>"
36
33
  }, a = {
34
+ PARAGRAPH_END_TAG: "</p>"
35
+ }, o = {
37
36
  REGULAR_NAME_HEIGHT: ".ext-product-name.ins-vertical p { height:90px!important;",
38
37
  TRIMMED_NAME_HEIGHT: ".ext-product-name.ins-vertical p { height:18px!important;",
39
38
  ELLIPSIS: "text-overflow:ellipsis!important; white-space:nowrap!important;",
@@ -47,10 +46,10 @@ const e = 20, t = 320, s = "vertical", m = {
47
46
  export {
48
47
  i as ATTRIBUTES,
49
48
  _ as CONDITIONS,
50
- a as CSS,
49
+ o as CSS,
51
50
  m as DUMMY_IMAGE_MAPPINGS,
52
51
  e as DefaultPadding,
53
- o as HTML,
52
+ a as HTML,
54
53
  t as MinDeviceViewport,
55
54
  n as REGEX,
56
55
  s as VerticalOrientation
@@ -1,9 +1,9 @@
1
- const o = "3.28.0-beta.93b3145", s = { stripo: { version: "2.86.1" } }, t = {
1
+ const o = "3.28.0-beta.ea702a6", s = { stripo: { version: "2.86.1" } }, a = {
2
2
  version: o,
3
3
  guido: s
4
4
  };
5
5
  export {
6
- t as default,
6
+ a as default,
7
7
  s as guido,
8
8
  o as version
9
9
  };
@@ -8,10 +8,6 @@ type CardWidthParams = {
8
8
  interface CampaignData extends CardWidthParams {
9
9
  textTrimming: boolean;
10
10
  orientation: string;
11
- priceBeforeTextValue: string;
12
- priceAfterTextValue: string;
13
- discountBeforeTextValue: string;
14
- discountAfterTextValue: string;
15
11
  }
16
12
  export declare const useRecommendation: () => {
17
13
  calculateCardWidth: ({ mobileLeftPadding, mobileRightPadding, cardsInRow, unresponsive, }: CardWidthParams) => number;
@@ -33,7 +33,6 @@ export declare const REGEX: {
33
33
  ID: RegExp;
34
34
  ATTRIBUTE_PARAGRAPH: RegExp;
35
35
  ATTRIBUTE_PARAGRAPH_START_TAG: RegExp;
36
- COMPOSITION: RegExp;
37
36
  CUSTOM_FIELD: RegExp;
38
37
  CUSTOM_FIELD_INDEXES_PART: RegExp;
39
38
  CUSTOM_FIELD_NAME_PART: RegExp;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.28.0-beta.93b3145",
3
+ "version": "3.28.0-beta.ea702a6",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",