@useinsider/guido 2.1.0-beta.1d0cd94 → 2.1.0-beta.235b052

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.
Files changed (155) hide show
  1. package/README.md +36 -0
  2. package/dist/@types/config/schemas.js +70 -65
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +69 -58
  5. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +15 -14
  6. package/dist/components/organisms/header/HeaderWrapper.vue.js +9 -9
  7. package/dist/composables/useBlocksConfig.js +26 -16
  8. package/dist/composables/useHtmlValidator.js +114 -104
  9. package/dist/composables/useRecommendation.js +54 -21
  10. package/dist/config/compiler/recommendationCompilerRules.js +45 -39
  11. package/dist/config/compiler/utils/recommendationCompilerUtils.js +121 -0
  12. package/dist/config/migrator/recommendationMigrator.js +2 -2
  13. package/dist/enums/defaults.js +8 -4
  14. package/dist/enums/extensions/recommendationBlock.js +1 -1
  15. package/dist/enums/recommendation.js +16 -15
  16. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +29 -29
  17. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +29 -29
  18. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +31 -29
  19. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +0 -1
  20. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +29 -27
  21. package/dist/extensions/Blocks/Items/settingsPanel.js +10 -15
  22. package/dist/extensions/Blocks/Recommendation/block.js +133 -9
  23. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +4 -0
  24. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +4 -0
  25. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +66 -0
  26. package/dist/extensions/Blocks/Recommendation/constants/layout.js +22 -0
  27. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +21 -0
  28. package/dist/extensions/Blocks/Recommendation/controls/button/index.js +64 -0
  29. package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +80 -0
  30. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +232 -0
  31. package/dist/extensions/Blocks/Recommendation/controls/image/index.js +19 -0
  32. package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +92 -0
  33. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +102 -0
  34. package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +209 -0
  35. package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +52 -0
  36. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +250 -0
  37. package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +70 -0
  38. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +160 -0
  39. package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +67 -0
  40. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +307 -0
  41. package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +21 -0
  42. package/dist/extensions/Blocks/Recommendation/controls/name/index.js +46 -0
  43. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +108 -0
  44. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +44 -0
  45. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +48 -0
  46. package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextAfterControl.js → omnibusDiscount/textAfter.js} +16 -14
  47. package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextBeforeControl.js → omnibusDiscount/textBefore.js} +16 -14
  48. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +48 -0
  49. package/dist/extensions/Blocks/Recommendation/controls/{omnibusPriceTextAfterControl.js → omnibusPrice/textAfter.js} +16 -14
  50. package/dist/extensions/Blocks/Recommendation/controls/{omnibusPriceTextBeforeControl.js → omnibusPrice/textBefore.js} +14 -12
  51. package/dist/extensions/Blocks/Recommendation/controls/price/index.js +44 -0
  52. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +222 -0
  53. package/dist/extensions/Blocks/Recommendation/extension.js +40 -17
  54. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +19 -3
  55. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +13 -4
  56. package/dist/extensions/Blocks/Recommendation/services/configService.js +240 -0
  57. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +21 -10
  58. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +254 -207
  59. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +228 -0
  60. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +251 -0
  61. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +66 -0
  62. package/dist/extensions/Blocks/Recommendation/templates/index.js +12 -0
  63. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +169 -0
  64. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +73 -0
  65. package/dist/extensions/Blocks/Recommendation/templates/utils.js +134 -0
  66. package/dist/extensions/Blocks/Recommendation/types/nodeConfig.js +6 -0
  67. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +9 -9
  68. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +26 -15
  69. package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +29 -0
  70. package/dist/extensions/Blocks/Recommendation/utils/tagName.js +46 -0
  71. package/dist/extensions/Blocks/controlFactories.js +125 -93
  72. package/dist/extensions/ModulesTabIcons/extension.js +17 -0
  73. package/dist/guido.css +1 -1
  74. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +317 -193
  75. package/dist/services/recommendationApi.js +11 -8
  76. package/dist/services/templateLibraryApi.js +16 -13
  77. package/dist/src/@types/config/schemas.d.ts +8 -0
  78. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +1 -1
  79. package/dist/src/composables/useConfig.d.ts +4 -0
  80. package/dist/src/composables/useRecommendation.d.ts +1 -0
  81. package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +17 -0
  82. package/dist/src/enums/defaults.d.ts +4 -0
  83. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +67 -0
  84. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +13 -0
  85. package/dist/src/extensions/Blocks/Recommendation/{constants.d.ts → constants/controlIds.d.ts} +0 -24
  86. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +49 -0
  87. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +13 -0
  88. package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +41 -0
  89. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +35 -0
  90. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +143 -0
  91. package/dist/src/extensions/Blocks/Recommendation/controls/cardBackground/index.d.ts +31 -0
  92. package/dist/src/extensions/Blocks/Recommendation/{cardCompositionControl.d.ts → controls/cardComposition/index.d.ts} +23 -3
  93. package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +35 -0
  94. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +21 -589
  95. package/dist/src/extensions/Blocks/Recommendation/controls/layout/index.d.ts +37 -0
  96. package/dist/src/extensions/Blocks/Recommendation/controls/main/algorithm.d.ts +29 -0
  97. package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +52 -0
  98. package/dist/src/extensions/Blocks/Recommendation/controls/main/filters.d.ts +22 -0
  99. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +79 -0
  100. package/dist/src/extensions/Blocks/Recommendation/controls/main/locale.d.ts +24 -0
  101. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +60 -0
  102. package/dist/src/extensions/Blocks/Recommendation/controls/main/shuffle.d.ts +23 -0
  103. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +221 -0
  104. package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +29 -0
  105. package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +97 -0
  106. package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +34 -0
  107. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +95 -0
  108. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +100 -0
  109. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.d.ts +15 -0
  110. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.d.ts +15 -0
  111. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +100 -0
  112. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.d.ts +15 -0
  113. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.d.ts +15 -0
  114. package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +95 -0
  115. package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +83 -0
  116. package/dist/src/extensions/Blocks/Recommendation/extension.d.ts +9 -0
  117. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +151 -0
  118. package/dist/src/extensions/Blocks/Recommendation/services/index.d.ts +6 -0
  119. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +138 -468
  120. package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +20 -0
  121. package/dist/src/extensions/Blocks/Recommendation/templates/{migrationTemplate.d.ts → grid/migration.d.ts} +11 -4
  122. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +33 -0
  123. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +41 -0
  124. package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +8 -0
  125. package/dist/src/extensions/Blocks/Recommendation/templates/list/migration.d.ts +25 -0
  126. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +18 -0
  127. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +66 -0
  128. package/dist/src/extensions/Blocks/Recommendation/types/index.d.ts +7 -0
  129. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +166 -0
  130. package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +33 -0
  131. package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +113 -0
  132. package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +77 -0
  133. package/dist/src/extensions/ModulesTabIcons/extension.d.ts +2 -0
  134. package/dist/src/stores/config.d.ts +36 -0
  135. package/dist/static/styles/components/notification.css.js +1 -0
  136. package/dist/static/styles/components/version-history.css.js +10 -2
  137. package/dist/static/styles/components/wide-panel.css.js +18 -2
  138. package/dist/static/styles/customEditorStyle.css.js +35 -11
  139. package/dist/utils/pairProductVariables.js +57 -56
  140. package/dist/utils/templatePreparation.js +15 -14
  141. package/package.json +2 -2
  142. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -187
  143. package/dist/extensions/Blocks/Recommendation/constants.js +0 -13
  144. package/dist/extensions/Blocks/Recommendation/control.js +0 -336
  145. package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +0 -68
  146. package/dist/extensions/Blocks/Recommendation/controls/index.js +0 -245
  147. package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +0 -74
  148. package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +0 -188
  149. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +0 -181
  150. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +0 -189
  151. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +0 -209
  152. package/dist/src/extensions/Blocks/Recommendation/control.d.ts +0 -38
  153. package/dist/src/extensions/Blocks/Recommendation/controls/nameTextTrimControl.d.ts +0 -16
  154. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
  155. package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -52
@@ -0,0 +1,121 @@
1
+ import { useRecommendation as _ } from "../../../composables/useRecommendation.js";
2
+ function b(e, u, r, o) {
3
+ const n = `{{${e}_${u}_${r}}}`, t = `{{${e}_${u}_currency}}`;
4
+ return o === "before" ? `${t} ${n}` : `${n} ${t}`;
5
+ }
6
+ function p(e, u, r, o, n) {
7
+ switch (u) {
8
+ case "productImage": {
9
+ const t = e.querySelector("img");
10
+ t && (t.setAttribute("src", `{{${r}_${o}_image_url}}`), t.setAttribute("alt", `{{${r}_${o}_name}}`));
11
+ const c = e.querySelector("a");
12
+ c && c.setAttribute("href", `{{${r}_${o}_url}}`);
13
+ break;
14
+ }
15
+ case "productName": {
16
+ const t = e.querySelector("p");
17
+ if (t) {
18
+ const c = t.querySelector("strong") || t;
19
+ c.textContent = `{{${r}_${o}_name}}`;
20
+ }
21
+ break;
22
+ }
23
+ case "productPrice": {
24
+ const t = e.querySelector("p");
25
+ if (t) {
26
+ const c = t.querySelector("strong") || t;
27
+ c.textContent = b(r, o, "price", n);
28
+ }
29
+ break;
30
+ }
31
+ case "productOldPrice": {
32
+ const t = e.querySelector("p");
33
+ if (t) {
34
+ const c = t.querySelector("strong") || t;
35
+ c.textContent = b(
36
+ r,
37
+ o,
38
+ "original_price",
39
+ n
40
+ ), t.setAttribute("product-attr", "discount");
41
+ }
42
+ break;
43
+ }
44
+ case "productButton": {
45
+ const t = e.querySelector("a");
46
+ t && t.setAttribute("href", `{{${r}_${o}_url}}`);
47
+ break;
48
+ }
49
+ case "productOmnibusPrice": {
50
+ const t = e.querySelector(".omnibus-price-value");
51
+ if (t) {
52
+ t.textContent = `{{${r}_${o}_omnibus_price}}`;
53
+ const c = t.closest("p");
54
+ c && (c.setAttribute("product-attr", "omnibus_price"), c.setAttribute("composition", "true"));
55
+ }
56
+ break;
57
+ }
58
+ case "productOmnibusDiscount": {
59
+ const t = e.querySelector(".omnibus-discount-value");
60
+ if (t) {
61
+ t.textContent = `{{${r}_${o}_omnibus_discount}}`;
62
+ const c = t.closest("p");
63
+ c && (c.setAttribute("product-attr", "omnibus_discount"), c.setAttribute("composition", "true"));
64
+ }
65
+ break;
66
+ }
67
+ }
68
+ }
69
+ function $(e, u, r) {
70
+ e.querySelectorAll(".recommendation-product-row").forEach((n, t) => {
71
+ n.querySelectorAll("[data-attribute-type]").forEach((s) => {
72
+ const i = s.getAttribute("data-attribute-type") || "", a = s.querySelectorAll(".attribute-cell");
73
+ a.length > 0 ? a.forEach((l) => {
74
+ p(l, i, u, t, r);
75
+ }) : p(s, i, u, t, r);
76
+ });
77
+ });
78
+ }
79
+ function S(e, u, r) {
80
+ const o = e.querySelectorAll(".recommendation-product-row");
81
+ if (!o.length)
82
+ return;
83
+ const [n] = o, t = n.querySelector("[data-attribute-type]"), c = t ? t.querySelectorAll(".attribute-cell").length : 1;
84
+ o.forEach((s, i) => {
85
+ s.querySelectorAll("[data-attribute-type]").forEach((l) => {
86
+ const f = l.getAttribute("data-attribute-type") || "";
87
+ l.querySelectorAll(".attribute-cell").forEach((y, m) => {
88
+ const A = i * c + m;
89
+ p(y, f, u, A, r);
90
+ });
91
+ });
92
+ });
93
+ }
94
+ function q(e, u, r) {
95
+ e.querySelectorAll(".ins-recommendation-product-container").forEach((n) => {
96
+ S(n, u, r);
97
+ });
98
+ }
99
+ function d(e, u) {
100
+ const r = e.getAttribute("data-layout") || "grid", o = e.getAttribute("currency-alignment") || "after";
101
+ r === "list" ? $(e, u, o) : q(e, u, o);
102
+ }
103
+ function h(e, u) {
104
+ const r = e.match(/<!DOCTYPE[^>]*>/i);
105
+ return (r ? `${r[0]}
106
+ ` : "") + u.documentElement.outerHTML;
107
+ }
108
+ function w(e) {
109
+ const u = e.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), r = new DOMParser().parseFromString(u, "text/html"), o = r.querySelectorAll(".ins-recommendation-v3-block-v2");
110
+ if (!o.length)
111
+ return e;
112
+ const { buildCampaignUrl: n } = _();
113
+ return o.forEach((c) => {
114
+ const s = c.getAttribute("recommendation-id");
115
+ s && (n(s), d(c, s));
116
+ }), h(u, r).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
117
+ }
118
+ export {
119
+ b as formatPriceVariable,
120
+ w as prepareRecommendationBlocks
121
+ };
@@ -1,8 +1,8 @@
1
1
  var h = Object.defineProperty;
2
2
  var T = (A, e, t) => e in A ? h(A, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : A[e] = t;
3
3
  var m = (A, e, t) => T(A, typeof e != "symbol" ? e + "" : e, t);
4
- import P, { prepareProductRows as S } from "../../extensions/Blocks/Recommendation/templates/migrationTemplate.js";
5
- import { getDefaultProducts as q } from "../../extensions/Blocks/Recommendation/templates/templateUtils.js";
4
+ import P, { prepareProductRows as S } from "../../extensions/Blocks/Recommendation/templates/grid/migration.js";
5
+ import { getDefaultProducts as q } from "../../extensions/Blocks/Recommendation/templates/utils.js";
6
6
  class w {
7
7
  constructor() {
8
8
  m(this, "parser");
@@ -1,8 +1,12 @@
1
- const t = {
1
+ const e = {
2
2
  transactional: 2
3
- }, o = 2, T = 13;
3
+ }, o = 2, t = 13, s = {
4
+ SAVED_MODULES: "savedModules",
5
+ DEFAULT_MODULES: "defaultModules"
6
+ };
4
7
  export {
5
8
  o as EditorType,
6
- T as MAX_DEFAULT_TEMPLATE_ID,
7
- t as TemplateTypes
9
+ t as MAX_DEFAULT_TEMPLATE_ID,
10
+ s as ModuleFolderDefaults,
11
+ e as TemplateTypes
8
12
  };
@@ -1,5 +1,5 @@
1
1
  const s = {
2
- RECOMMENDATION_API_URL: "http://recommendationv2.api.useinsider.com"
2
+ RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com"
3
3
  }, i = [
4
4
  { id: 11, key: "similarViewed", name: "Viewed Together", path: "viewed-together" },
5
5
  { id: 12, key: "similarBought", name: "Purchased Together", path: "purchased-together" },
@@ -1,4 +1,4 @@
1
- const s = 20, e = 320, t = {
1
+ const e = 20, s = 320, t = "vertical", m = {
2
2
  CART_ABANDONMENT: {
3
3
  ins_apr_img_1: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_1.png",
4
4
  ins_apr_img_2: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_2.png",
@@ -15,7 +15,7 @@ const s = 20, e = 320, t = {
15
15
  DISCOUNT: "discount",
16
16
  OMNIBUS_DISCOUNT: "omnibus_discount",
17
17
  OMNIBUS_PRICE: "omnibus_price"
18
- }, m = {
18
+ }, _ = {
19
19
  IF: {
20
20
  discount: `{% if {${i.DISCOUNT}} != "0%" and {${i.DISCOUNT}} != "" %}`,
21
21
  omnibus_discount: `{% if {${i.DISCOUNT}} != "0%" and {${i.DISCOUNT}} != "" and {${i.OMNIBUS_DISCOUNT}} != "0%" and {${i.OMNIBUS_DISCOUNT}} != "" %}`,
@@ -23,17 +23,17 @@ const s = 20, e = 320, t = {
23
23
  },
24
24
  ELSE: "{% else %}",
25
25
  END_IF: "{% endif %}"
26
- }, _ = {
27
- ID: /ins-recommendation-v3-campaign-id="(.*?)"/gi,
28
- ATTRIBUTE_PARAGRAPH: /<p[^>]*?product-attr="(discount|omnibus_discount|omnibus_price)">[\S\s]*?<\/p>/gm,
29
- ATTRIBUTE_PARAGRAPH_START_TAG: /<p[^>]*?product-attr="(discount|omnibus_discount|omnibus_price)">/gm,
26
+ }, a = {
27
+ ID: /recommendation-id="(.*?)"/gi,
28
+ ATTRIBUTE_PARAGRAPH: /<p[^>]*?product-attr="(discount|omnibus_discount|omnibus_price)"[^>]*>[\S\s]*?<\/p>/gm,
29
+ ATTRIBUTE_PARAGRAPH_START_TAG: /<p[^>]*?product-attr="(discount|omnibus_discount|omnibus_price)"[^>]*>/gm,
30
30
  COMPOSITION: /composition="true"/gm,
31
31
  CUSTOM_FIELD: /{{[0-9]+_[0-8]_(discount|omnibus_discount|omnibus_price)}}/gm,
32
32
  CUSTOM_FIELD_INDEXES_PART: /{{[0-9]+_[0-8]_/gm,
33
33
  CUSTOM_FIELD_NAME_PART: /_(discount|omnibus_discount|omnibus_price)}}/gm
34
- }, a = {
35
- PARAGRAPH_END_TAG: "</p>"
36
34
  }, n = {
35
+ PARAGRAPH_END_TAG: "</p>"
36
+ }, o = {
37
37
  REGULAR_NAME_HEIGHT: ".ext-product-name.ins-vertical p { height:90px!important;",
38
38
  TRIMMED_NAME_HEIGHT: ".ext-product-name.ins-vertical p { height:18px!important;",
39
39
  ELLIPSIS: "text-overflow:ellipsis!important; white-space:nowrap!important;",
@@ -46,11 +46,12 @@ const s = 20, e = 320, t = {
46
46
  };
47
47
  export {
48
48
  i as ATTRIBUTES,
49
- m as CONDITIONS,
50
- n as CSS,
51
- t as DUMMY_IMAGE_MAPPINGS,
52
- s as DefaultPadding,
53
- a as HTML,
54
- e as MinDeviceViewport,
55
- _ as REGEX
49
+ _ as CONDITIONS,
50
+ o as CSS,
51
+ m as DUMMY_IMAGE_MAPPINGS,
52
+ e as DefaultPadding,
53
+ n as HTML,
54
+ s as MinDeviceViewport,
55
+ a as REGEX,
56
+ t as VerticalOrientation
56
57
  };
@@ -1,50 +1,50 @@
1
- import { currencyLocationMaps as p } from "../../../../../enums/extensions/recommendationBlock.js";
2
- import { UEAttr as y, ModificationDescription as R } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
3
- import { CommonControl as L } from "../../../common-control.js";
4
- import { ItemsBlockControlId as u } from "../../enums/controlEnums.js";
5
- import { getItemsBlockConfig as l, setItemsBlockConfig as N, escapeReplacement as I } from "../../utils/nodeConfigUtils.js";
6
- const T = u.PRICE_CURRENCY_LOCATION, i = {
1
+ import { currencyLocationMaps as u } from "../../../../../enums/extensions/recommendationBlock.js";
2
+ import { UEAttr as R, ModificationDescription as L } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
3
+ import { CommonControl as N } from "../../../common-control.js";
4
+ import { ItemsBlockControlId as m } from "../../enums/controlEnums.js";
5
+ import { getItemsBlockConfig as C, setItemsBlockConfig as I, escapeReplacement as T } from "../../utils/nodeConfigUtils.js";
6
+ const E = m.PRICE_CURRENCY_LOCATION, c = {
7
7
  CURRENCY_LOCATION: "currencyLocation"
8
8
  };
9
- class $ extends L {
9
+ class A extends N {
10
10
  getId() {
11
- return T;
11
+ return E;
12
12
  }
13
13
  getTemplate() {
14
14
  return `
15
- <div class="container ${u.PRICE_CURRENCY_LOCATION}">
15
+ <div class="container ${m.PRICE_CURRENCY_LOCATION}">
16
16
  ${this._getCurrencyLocation()}
17
17
  </div>
18
18
  `;
19
19
  }
20
20
  onRender() {
21
- const e = l(this.currentNode);
22
- this.api.setUIEAttribute(i.CURRENCY_LOCATION, y.SELECTPICKER.items, p), this.api.updateValues({ [i.CURRENCY_LOCATION]: (e == null ? void 0 : e.priceCurrencyLocation) ?? "0" }), this.api.onValueChanged(i.CURRENCY_LOCATION, (t) => {
21
+ const e = C(this.currentNode);
22
+ this.api.setUIEAttribute(c.CURRENCY_LOCATION, R.SELECTPICKER.items, u), this.api.updateValues({ [c.CURRENCY_LOCATION]: (e == null ? void 0 : e.priceCurrencyLocation) ?? "0" }), this.api.onValueChanged(c.CURRENCY_LOCATION, (t) => {
23
23
  this._onCurrencyLocationChange(t);
24
24
  });
25
25
  }
26
26
  onTemplateNodeUpdated(e) {
27
27
  super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
28
- const t = l(this.currentNode);
29
- this.api.updateValues({ [i.CURRENCY_LOCATION]: (t == null ? void 0 : t.priceCurrencyLocation) ?? "0" });
28
+ const t = C(this.currentNode);
29
+ this.api.updateValues({ [c.CURRENCY_LOCATION]: (t == null ? void 0 : t.priceCurrencyLocation) ?? "0" });
30
30
  });
31
31
  }
32
32
  _onCurrencyLocationChange(e) {
33
- if (console.debug("Currency location changed to: ", e), N(this.currentNode, this.api, { priceCurrencyLocation: e }), !this.currentNode)
33
+ if (console.debug("Currency location changed to: ", e), I(this.currentNode, this.api, { priceCurrencyLocation: e }), !this.currentNode)
34
34
  return;
35
35
  const t = this._getPriceBlocks();
36
36
  if (!t || t.length === 0)
37
37
  return;
38
- const r = l(this.currentNode), n = e || "0", o = (r == null ? void 0 : r.priceCurrencySymbol) ?? "";
39
- t.forEach((s) => {
40
- const c = this._getParagraph(s);
41
- if (!c)
38
+ const r = C(this.currentNode), n = e || "0", o = (r == null ? void 0 : r.priceCurrencySymbol) ?? "", i = this.api.getDocumentModifier();
39
+ t.forEach((a) => {
40
+ const s = this._getParagraph(a);
41
+ if (!s)
42
42
  return;
43
- const m = c.getInnerHTML().trim() || "", a = c.getInnerText().trim() || "", C = (o == null ? void 0 : o.trim()) || "", h = this._removeCurrencySymbol(a, C), d = this._detectSymbolInText(a) || C, g = this._buildPriceContent(h, d, n), _ = m.replace(a, I(g));
44
- this.api.getDocumentModifier().modifyHtml(c).setInnerHtml(_).apply(new R(
45
- `Updated currency location to ${n === "1" ? "after" : "before"}`
46
- ));
47
- });
43
+ const h = s.getInnerHTML().trim() || "", l = s.getInnerText().trim() || "", p = (o == null ? void 0 : o.trim()) || "", d = this._removeCurrencySymbol(l, p), g = this._detectSymbolInText(l) || p, _ = this._buildPriceContent(d, g, n), y = h.replace(l, T(_));
44
+ i.modifyHtml(s).setInnerHtml(y);
45
+ }), i.apply(new L(
46
+ `Updated currency location to ${n === "1" ? "after" : "before"}`
47
+ ));
48
48
  }
49
49
  _getPriceBlocks() {
50
50
  var e, t;
@@ -65,8 +65,8 @@ class $ extends L {
65
65
  } else {
66
66
  const o = r.match(/([^0-9.,\s]+)/);
67
67
  if (o && o[1]) {
68
- const s = o[1].trim(), c = new RegExp(`\\s*${this._escapeRegex(s)}\\s*`);
69
- n = r.replace(c, "").trim();
68
+ const i = o[1].trim(), a = new RegExp(`\\s*${this._escapeRegex(i)}\\s*`);
69
+ n = r.replace(a, "").trim();
70
70
  }
71
71
  }
72
72
  return n;
@@ -83,15 +83,15 @@ class $ extends L {
83
83
  ${this._GuTwoColumns([
84
84
  this._GuLabel({ text: "Currency Location" }),
85
85
  this._GuSelect({
86
- name: i.CURRENCY_LOCATION,
86
+ name: c.CURRENCY_LOCATION,
87
87
  placeholder: "",
88
- options: p
88
+ options: u
89
89
  })
90
90
  ])}
91
91
  `;
92
92
  }
93
93
  }
94
94
  export {
95
- T as CONTROL_BLOCK_ID,
96
- $ as PriceCurrencyLocationControl
95
+ E as CONTROL_BLOCK_ID,
96
+ A as PriceCurrencyLocationControl
97
97
  };
@@ -1,14 +1,14 @@
1
- var b = Object.defineProperty;
2
- var R = (s, c, e) => c in s ? b(s, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[c] = e;
3
- var h = (s, c, e) => R(s, typeof c != "symbol" ? c + "" : c, e);
4
- import { ModificationDescription as N } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as B } from "../../../common-control.js";
1
+ var R = Object.defineProperty;
2
+ var N = (s, c, e) => c in s ? R(s, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[c] = e;
3
+ var h = (s, c, e) => N(s, typeof c != "symbol" ? c + "" : c, e);
4
+ import { ModificationDescription as B } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { CommonControl as E } from "../../../common-control.js";
6
6
  import { ItemsBlockControlId as y } from "../../enums/controlEnums.js";
7
- import { getItemsBlockConfig as m, setItemsBlockConfig as E, escapeReplacement as x } from "../../utils/nodeConfigUtils.js";
8
- const I = y.PRICE_CURRENCY_SYMBOL, p = {
7
+ import { getItemsBlockConfig as p, setItemsBlockConfig as x, escapeReplacement as f } from "../../utils/nodeConfigUtils.js";
8
+ const I = y.PRICE_CURRENCY_SYMBOL, u = {
9
9
  CURRENCY_SYMBOL: "currencySymbol"
10
10
  };
11
- class O extends B {
11
+ class P extends E {
12
12
  constructor() {
13
13
  super(...arguments);
14
14
  h(this, "originalPriceContents", /* @__PURE__ */ new Map());
@@ -24,8 +24,8 @@ class O extends B {
24
24
  `;
25
25
  }
26
26
  onRender() {
27
- const e = m(this.currentNode);
28
- this.api.updateValues({ [p.CURRENCY_SYMBOL]: (e == null ? void 0 : e.priceCurrencySymbol) ?? "" }), this._storeOriginalContents(), this.api.onValueChanged(p.CURRENCY_SYMBOL, (t) => {
27
+ const e = p(this.currentNode);
28
+ this.api.updateValues({ [u.CURRENCY_SYMBOL]: (e == null ? void 0 : e.priceCurrencySymbol) ?? "" }), this._storeOriginalContents(), this.api.onValueChanged(u.CURRENCY_SYMBOL, (t) => {
29
29
  this._onCurrencySymbolChange(t);
30
30
  });
31
31
  }
@@ -34,42 +34,42 @@ class O extends B {
34
34
  }
35
35
  onTemplateNodeUpdated(e) {
36
36
  super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
37
- const t = m(this.currentNode);
38
- this.api.updateValues({ [p.CURRENCY_SYMBOL]: (t == null ? void 0 : t.priceCurrencySymbol) ?? "" }), this._storeOriginalContents();
37
+ const t = p(this.currentNode);
38
+ this.api.updateValues({ [u.CURRENCY_SYMBOL]: (t == null ? void 0 : t.priceCurrencySymbol) ?? "" }), this._storeOriginalContents();
39
39
  });
40
40
  }
41
41
  _onCurrencySymbolChange(e) {
42
- var i;
42
+ var a;
43
43
  console.debug("Currency symbol changed to: ", e);
44
- const t = m(this.currentNode), o = ((i = t == null ? void 0 : t.priceCurrencySymbol) == null ? void 0 : i.trim()) || "";
45
- if (E(this.currentNode, this.api, { priceCurrencySymbol: e }), !this.currentNode)
44
+ const t = p(this.currentNode), o = ((a = t == null ? void 0 : t.priceCurrencySymbol) == null ? void 0 : a.trim()) || "";
45
+ if (x(this.currentNode, this.api, { priceCurrencySymbol: e }), !this.currentNode)
46
46
  return;
47
47
  const r = this._getPriceBlocks();
48
48
  if (!r || r.length === 0)
49
49
  return;
50
- const n = (e == null ? void 0 : e.trim()) || "", l = (t == null ? void 0 : t.priceCurrencyLocation) ?? "0";
51
- r.forEach((u) => {
52
- const a = this._getParagraph(u);
53
- if (!a)
50
+ const n = (e == null ? void 0 : e.trim()) || "", l = (t == null ? void 0 : t.priceCurrencyLocation) ?? "0", i = this.api.getDocumentModifier();
51
+ r.forEach((d) => {
52
+ const m = this._getParagraph(d);
53
+ if (!m)
54
54
  return;
55
- const d = a.getInnerHTML().trim() || "", C = a.getInnerText().trim() || "", g = this._removeCurrencySymbol(C, o), _ = this._buildPriceContent(g, n, l), S = d.replace(C, x(_));
56
- this.api.getDocumentModifier().modifyHtml(a).setInnerHtml(S).apply(new N(
57
- `Updated currency symbol to ${n || "removed"}`
58
- ));
59
- });
55
+ const g = m.getInnerHTML().trim() || "", C = m.getInnerText().trim() || "", _ = this._removeCurrencySymbol(C, o), S = this._buildPriceContent(_, n, l), b = g.replace(C, f(S));
56
+ i.modifyHtml(m).setInnerHtml(b);
57
+ }), i.apply(new B(
58
+ `Updated currency symbol to ${n || "removed"}`
59
+ ));
60
60
  }
61
61
  _storeOriginalContents() {
62
62
  if (!this.currentNode)
63
63
  return;
64
- const e = m(this.currentNode);
64
+ const e = p(this.currentNode);
65
65
  this.currentNode.querySelectorAll(
66
66
  ".items-block-price"
67
67
  ).forEach((o) => {
68
68
  var n;
69
69
  const r = o.querySelector("p");
70
70
  if (r && !this.originalPriceContents.has(r)) {
71
- const l = r.getInnerText() || "", i = ((n = e == null ? void 0 : e.priceCurrencySymbol) == null ? void 0 : n.trim()) || "", u = this._removeCurrencySymbol(l, i);
72
- this.originalPriceContents.set(r, u);
71
+ const l = r.getInnerText() || "", i = ((n = e == null ? void 0 : e.priceCurrencySymbol) == null ? void 0 : n.trim()) || "", a = this._removeCurrencySymbol(l, i);
72
+ this.originalPriceContents.set(r, a);
73
73
  }
74
74
  });
75
75
  }
@@ -106,7 +106,7 @@ class O extends B {
106
106
  ${this._GuTwoColumns([
107
107
  this._GuLabel({ text: "Currency Symbol" }),
108
108
  this._GuTextInput({
109
- name: p.CURRENCY_SYMBOL,
109
+ name: u.CURRENCY_SYMBOL,
110
110
  placeholder: "Enter Currency Symbol",
111
111
  className: "es-180w"
112
112
  })
@@ -116,5 +116,5 @@ class O extends B {
116
116
  }
117
117
  export {
118
118
  I as CONTROL_BLOCK_ID,
119
- O as PriceCurrencySymbolControl
119
+ P as PriceCurrencySymbolControl
120
120
  };
@@ -1,63 +1,65 @@
1
- import { ModificationDescription as A, UIElementType as P, UEAttr as C } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { CommonControl as L } from "../../../common-control.js";
3
- import { ItemsBlockControlId as p, ItemsBlockId as _ } from "../../enums/controlEnums.js";
1
+ import { ModificationDescription as L, UIElementType as P, UEAttr as D } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { CommonControl as h } from "../../../common-control.js";
3
+ import { ItemsBlockControlId as R, ItemsBlockId as _ } from "../../enums/controlEnums.js";
4
4
  import { productPairs as I } from "../../enums/productEnums.js";
5
- import { getItemsBlockConfig as d, setItemsBlockConfig as D, escapeReplacement as h } from "../../utils/nodeConfigUtils.js";
6
- const g = p.PRICE_FORMATTED_PRICE, s = {
5
+ import { getItemsBlockConfig as d, setItemsBlockConfig as u, escapeReplacement as O } from "../../utils/nodeConfigUtils.js";
6
+ const g = R.PRICE_FORMATTED_PRICE, s = {
7
7
  FORMATTED_PRICE: "formattedPrice"
8
8
  };
9
- class $ extends L {
9
+ class k extends h {
10
10
  getId() {
11
11
  return g;
12
12
  }
13
13
  getTemplate() {
14
14
  return `
15
- <div class="container ${p.PRICE_FORMATTED_PRICE}">
15
+ <div class="container ${R.PRICE_FORMATTED_PRICE}">
16
16
  ${this._getFormattedPrice()}
17
17
  </div>
18
18
  `;
19
19
  }
20
20
  onRender() {
21
- const e = d(this.currentNode);
22
- this.api.updateValues({ [s.FORMATTED_PRICE]: (e == null ? void 0 : e.priceFormatted) ?? !0 }), this.api.onValueChanged(s.FORMATTED_PRICE, (t) => {
23
- this._onFormattedPriceChange(t);
21
+ const t = d(this.currentNode);
22
+ this.api.updateValues({ [s.FORMATTED_PRICE]: (t == null ? void 0 : t.priceFormatted) ?? !0 }), this.api.onValueChanged(s.FORMATTED_PRICE, (e) => {
23
+ this._onFormattedPriceChange(e);
24
24
  });
25
25
  }
26
- onTemplateNodeUpdated(e) {
27
- super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
28
- const t = d(this.currentNode);
29
- this.api.updateValues({ [s.FORMATTED_PRICE]: (t == null ? void 0 : t.priceFormatted) ?? !0 });
26
+ onTemplateNodeUpdated(t) {
27
+ super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(() => {
28
+ const e = d(this.currentNode);
29
+ this.api.updateValues({ [s.FORMATTED_PRICE]: (e == null ? void 0 : e.priceFormatted) ?? !0 });
30
30
  });
31
31
  }
32
- _onFormattedPriceChange(e) {
33
- if (console.debug("Formatted price changed to: ", e), D(this.currentNode, this.api, { priceFormatted: e }), !this.currentNode)
32
+ _onFormattedPriceChange(t) {
33
+ if (console.debug("Formatted price changed to: ", t), u(this.currentNode, this.api, { priceFormatted: t }), !this.currentNode)
34
34
  return;
35
- const t = d(this.currentNode), n = (t == null ? void 0 : t.type) ?? "CART_ITEMS", i = (t == null ? void 0 : t.priceSinglePrice) ?? !1, r = I.PAIRS_FOR_EXTENSION.price[n], o = I.PAIRS_FOR_EXTENSION.originalPrice[n], [E, R] = e ? [
35
+ const e = d(this.currentNode), n = (e == null ? void 0 : e.type) ?? "CART_ITEMS", i = (e == null ? void 0 : e.priceSinglePrice) ?? !1, r = I.PAIRS_FOR_EXTENSION.price[n], c = I.PAIRS_FOR_EXTENSION.originalPrice[n], [p, m] = t ? [
36
36
  i ? r.DEFAULT_SINGLE_PRICE : r.DEFAULT_PRICE,
37
37
  i ? r.DEFAULT_SINGLE_PRICE_FORMATTED : r.DEFAULT_PRICE_FORMATTED
38
38
  ] : [
39
39
  i ? r.DEFAULT_SINGLE_PRICE_FORMATTED : r.DEFAULT_PRICE_FORMATTED,
40
40
  i ? r.DEFAULT_SINGLE_PRICE : r.DEFAULT_PRICE
41
- ], l = i ? o.DEFAULT_SINGLE_PRICE : o.DEFAULT_PRICE, T = i ? o.DEFAULT_SINGLE_PRICE_FORMATTED : o.DEFAULT_PRICE_FORMATTED, [m, F] = e ? [l, T] : [T, l], c = this.currentNode.closest(".items-block");
42
- ((c == null ? void 0 : c.querySelectorAll(
41
+ ], l = i ? c.DEFAULT_SINGLE_PRICE : c.DEFAULT_PRICE, T = i ? c.DEFAULT_SINGLE_PRICE_FORMATTED : c.DEFAULT_PRICE_FORMATTED, [F, A] = t ? [l, T] : [T, l], o = this.currentNode.closest(".items-block"), C = (o == null ? void 0 : o.querySelectorAll(
43
42
  `[esd-extension-block-id="${_.PRICE}"]`
44
- )) || []).forEach((a) => {
45
- this._updatePriceBlock(a, E, R, e, "price");
46
- }), ((c == null ? void 0 : c.querySelectorAll(
43
+ )) || [], E = this.api.getDocumentModifier();
44
+ C.forEach((a) => {
45
+ this._updatePriceBlock(E, a, p, m);
46
+ }), ((o == null ? void 0 : o.querySelectorAll(
47
47
  `[esd-extension-block-id="${_.ORIGINAL_PRICE}"]`
48
48
  )) || []).forEach((a) => {
49
- this._updatePriceBlock(a, m, F, e, "original price");
50
- });
49
+ this._updatePriceBlock(E, a, F, A);
50
+ }), E.apply(new L(
51
+ `Updated price to ${t ? "formatted" : "unformatted"}`
52
+ ));
51
53
  }
52
- _updatePriceBlock(e, t, n, i, r) {
53
- const o = e.getInnerHTML().trim().replace(t, h(n)), E = `Updated ${r} to ${i ? "formatted" : "unformatted"}`;
54
- this.api.getDocumentModifier().modifyHtml(e).setInnerHtml(o).apply(new A(E));
54
+ _updatePriceBlock(t, e, n, i) {
55
+ const r = e.getInnerHTML().trim().replace(n, O(i));
56
+ t.modifyHtml(e).setInnerHtml(r);
55
57
  }
56
58
  _getFormattedPrice() {
57
59
  return `
58
60
  <div class="display-flex align-items-center justify-content-between">
59
61
  <${P.LABEL}
60
- ${C.LABEL.text}="${this.api.translate("Formatted Price (e.g. $9.90)")}"
62
+ ${D.LABEL.text}="${this.api.translate("Formatted Price (e.g. $9.90)")}"
61
63
  >
62
64
  </${P.LABEL}>
63
65
  ${this._GuToggle(s.FORMATTED_PRICE)}
@@ -67,5 +69,5 @@ class $ extends L {
67
69
  }
68
70
  export {
69
71
  g as CONTROL_BLOCK_ID,
70
- $ as PriceFormattedPriceControl
72
+ k as PriceFormattedPriceControl
71
73
  };
@@ -33,7 +33,6 @@ class C extends r {
33
33
  }
34
34
  _getHideDiscount() {
35
35
  return `
36
-
37
36
  <div class="display-flex align-items-center justify-content-between">
38
37
  <${o.LABEL}
39
38
  ${d.LABEL.text}="${this.api.translate("Hide if same as discounted ")}"
@@ -1,18 +1,18 @@
1
- import { ModificationDescription as P, UIElementType as _, UEAttr as S } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { CommonControl as m } from "../../../common-control.js";
3
- import { ItemsBlockControlId as T, ItemsBlockId as g } from "../../enums/controlEnums.js";
4
- import { productPairs as R } from "../../enums/productEnums.js";
5
- import { getItemsBlockConfig as I, setItemsBlockConfig as u, escapeReplacement as A } from "../../utils/nodeConfigUtils.js";
6
- const h = T.PRICE_SINGLE_PRICE, l = {
1
+ import { ModificationDescription as m, UIElementType as _, UEAttr as A } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { CommonControl as h } from "../../../common-control.js";
3
+ import { ItemsBlockControlId as L, ItemsBlockId as R } from "../../enums/controlEnums.js";
4
+ import { productPairs as T } from "../../enums/productEnums.js";
5
+ import { getItemsBlockConfig as I, setItemsBlockConfig as u, escapeReplacement as N } from "../../utils/nodeConfigUtils.js";
6
+ const D = L.PRICE_SINGLE_PRICE, l = {
7
7
  SINGLE_PRICE: "singlePrice"
8
8
  };
9
- class M extends m {
9
+ class y extends h {
10
10
  getId() {
11
- return h;
11
+ return D;
12
12
  }
13
13
  getTemplate() {
14
14
  return `
15
- <div class="container ${T.PRICE_SINGLE_PRICE}">
15
+ <div class="container ${L.PRICE_SINGLE_PRICE}">
16
16
  ${this._getSinglePrice()}
17
17
  </div>
18
18
  `;
@@ -32,34 +32,36 @@ class M extends m {
32
32
  _onSinglePriceChange(e) {
33
33
  if (console.debug("Single price changed to: ", e), u(this.currentNode, this.api, { priceSinglePrice: e }), !this.currentNode)
34
34
  return;
35
- const t = I(this.currentNode), n = (t == null ? void 0 : t.type) ?? "CART_ITEMS", r = (t == null ? void 0 : t.priceFormatted) ?? !1, i = R.PAIRS_FOR_EXTENSION.price[n], c = R.PAIRS_FOR_EXTENSION.originalPrice[n], [E, d] = e ? [
35
+ const t = I(this.currentNode), o = (t == null ? void 0 : t.type) ?? "CART_ITEMS", r = (t == null ? void 0 : t.priceFormatted) ?? !1, i = T.PAIRS_FOR_EXTENSION.price[o], c = T.PAIRS_FOR_EXTENSION.originalPrice[o], [P, p] = e ? [
36
36
  r ? i.DEFAULT_PRICE_FORMATTED : i.DEFAULT_PRICE,
37
37
  r ? i.DEFAULT_SINGLE_PRICE_FORMATTED : i.DEFAULT_SINGLE_PRICE
38
38
  ] : [
39
39
  r ? i.DEFAULT_SINGLE_PRICE_FORMATTED : i.DEFAULT_SINGLE_PRICE,
40
40
  r ? i.DEFAULT_PRICE_FORMATTED : i.DEFAULT_PRICE
41
- ], a = r ? c.DEFAULT_PRICE_FORMATTED : c.DEFAULT_PRICE, s = r ? c.DEFAULT_SINGLE_PRICE_FORMATTED : c.DEFAULT_SINGLE_PRICE, [L, C] = e ? [a, s] : [s, a], o = this.currentNode.closest(".items-block");
42
- ((o == null ? void 0 : o.querySelectorAll(
43
- `[esd-extension-block-id="${g.PRICE}"]`
44
- )) || []).forEach((p) => {
45
- this._updatePriceBlock(p, E, d, e, "price");
46
- }), ((o == null ? void 0 : o.querySelectorAll(
47
- `[esd-extension-block-id="${g.ORIGINAL_PRICE}"]`
48
- )) || []).forEach((p) => {
49
- this._updatePriceBlock(p, L, C, e, "original price");
50
- });
41
+ ], s = r ? c.DEFAULT_PRICE_FORMATTED : c.DEFAULT_PRICE, d = r ? c.DEFAULT_SINGLE_PRICE_FORMATTED : c.DEFAULT_SINGLE_PRICE, [g, C] = e ? [s, d] : [d, s], n = this.currentNode.closest(".items-block"), S = (n == null ? void 0 : n.querySelectorAll(
42
+ `[esd-extension-block-id="${R.PRICE}"]`
43
+ )) || [], E = this.api.getDocumentModifier();
44
+ S.forEach((a) => {
45
+ this._updatePriceBlock(E, a, P, p, e);
46
+ }), ((n == null ? void 0 : n.querySelectorAll(
47
+ `[esd-extension-block-id="${R.ORIGINAL_PRICE}"]`
48
+ )) || []).forEach((a) => {
49
+ this._updatePriceBlock(E, a, g, C, e);
50
+ }), E.apply(new m(
51
+ `Updated price to ${e ? "single" : "total"} price`
52
+ ));
51
53
  }
52
- _updatePriceBlock(e, t, n, r, i) {
53
- const c = e.getInnerHTML().trim().replace(t, A(n)), E = `Updated ${i} to ${r ? "single" : "total"} price`;
54
- this.api.getDocumentModifier().modifyHtml(e).setInnerHtml(c).apply(new P(E)), e.querySelectorAll('[product-attr="price"], [product-attr="originalPrice"]').forEach((s) => {
55
- this.api.getDocumentModifier().modifyHtml(s).setAttribute("data-single_price", r ? "true" : "false").apply(new P("Update single price attribute"));
54
+ _updatePriceBlock(e, t, o, r, i) {
55
+ const c = t.getInnerHTML().trim().replace(o, N(r));
56
+ e.modifyHtml(t).setInnerHtml(c), t.querySelectorAll('[product-attr="price"], [product-attr="originalPrice"]').forEach((s) => {
57
+ e.modifyHtml(s).setAttribute("data-single_price", i ? "true" : "false");
56
58
  });
57
59
  }
58
60
  _getSinglePrice() {
59
61
  return `
60
62
  <div class="display-flex align-items-center justify-content-between">
61
63
  <${_.LABEL}
62
- ${S.LABEL.text}="${this.api.translate("Show Single Product Price")}"
64
+ ${A.LABEL.text}="${this.api.translate("Show Single Product Price")}"
63
65
  >
64
66
  </${_.LABEL}>
65
67
  ${this._GuToggle(l.SINGLE_PRICE)}
@@ -68,6 +70,6 @@ class M extends m {
68
70
  }
69
71
  }
70
72
  export {
71
- h as CONTROL_BLOCK_ID,
72
- M as PriceSinglePriceControl
73
+ D as CONTROL_BLOCK_ID,
74
+ y as PriceSinglePriceControl
73
75
  };