@useinsider/guido 3.2.0-beta.565bfaf → 3.2.0-beta.570fb6d

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 (282) hide show
  1. package/dist/@types/config/schemas.js +1 -1
  2. package/dist/@types/config/validator.js +27 -34
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +76 -81
  5. package/dist/components/organisms/base/Toaster.vue2.js +10 -11
  6. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +12 -12
  7. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +6 -6
  8. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +9 -15
  9. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +31 -40
  10. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +19 -20
  11. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +11 -14
  12. package/dist/components/organisms/header/EditorActions.vue.js +11 -12
  13. package/dist/components/organisms/header/EditorActions.vue2.js +18 -22
  14. package/dist/components/organisms/header/HeaderWrapper.vue2.js +12 -15
  15. package/dist/components/organisms/header/LeftSlot.vue2.js +16 -19
  16. package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -11
  17. package/dist/components/organisms/header/RightSlot.vue2.js +14 -17
  18. package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +11 -12
  19. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +20 -22
  20. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +11 -12
  21. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +38 -41
  22. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +11 -12
  23. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +38 -43
  24. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +18 -21
  25. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +27 -31
  26. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +11 -12
  27. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +27 -29
  28. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +11 -12
  29. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +19 -21
  30. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +8 -9
  31. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +9 -10
  32. package/dist/composables/useActionsApi.js +37 -38
  33. package/dist/composables/useBlocksConfig.js +26 -26
  34. package/dist/composables/useFullStoryBridge.js +13 -0
  35. package/dist/composables/useHtmlCompiler.js +34 -26
  36. package/dist/composables/useHtmlValidator.js +101 -109
  37. package/dist/composables/useHttp.js +30 -30
  38. package/dist/composables/usePartner.js +1 -1
  39. package/dist/composables/useRecommendation.js +14 -15
  40. package/dist/composables/useSave.js +21 -22
  41. package/dist/composables/useStripo.js +47 -42
  42. package/dist/composables/useSyncModuleExtractor.js +31 -29
  43. package/dist/composables/useTimerClone.js +24 -25
  44. package/dist/composables/useTranslations.js +23 -16
  45. package/dist/composables/useValidation.js +7 -8
  46. package/dist/composables/validators/useLiquidValidator.js +13 -13
  47. package/dist/config/compiler/recommendationCompilerRules.js +72 -67
  48. package/dist/config/compiler/unsubscribeCompilerRules.js +38 -37
  49. package/dist/config/compiler/utils/recommendationCompilerUtils.js +36 -34
  50. package/dist/config/migrator/checkboxMigrator.js +20 -21
  51. package/dist/config/migrator/couponBlockMigrator.js +18 -19
  52. package/dist/config/migrator/itemsBlockMigrator.js +87 -89
  53. package/dist/config/migrator/radioButtonMigrator.js +12 -13
  54. package/dist/config/migrator/recommendationMigrator.js +107 -110
  55. package/dist/config/migrator/unsubscribeMigrator.js +10 -11
  56. package/dist/enums/displayConditions.js +78 -82
  57. package/dist/enums/extensions/recommendationBlock.js +41 -95
  58. package/dist/enums/unsubscribe.js +35 -30
  59. package/dist/extensions/Blocks/Checkbox/control.js +23 -23
  60. package/dist/extensions/Blocks/Items/block.js +9 -9
  61. package/dist/extensions/Blocks/Items/controls/button/link.js +14 -14
  62. package/dist/extensions/Blocks/Items/controls/cardComposition.js +89 -97
  63. package/dist/extensions/Blocks/Items/controls/image/link.js +14 -14
  64. package/dist/extensions/Blocks/Items/controls/name/trimming.js +23 -24
  65. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +13 -14
  66. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +44 -47
  67. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +38 -38
  68. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +11 -11
  69. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +38 -40
  70. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +35 -35
  71. package/dist/extensions/Blocks/Items/controls/settingsControl.js +155 -162
  72. package/dist/extensions/Blocks/Items/enums/productEnums.js +21 -14
  73. package/dist/extensions/Blocks/Items/template.js +210 -210
  74. package/dist/extensions/Blocks/RadioButton/control.js +15 -15
  75. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  76. package/dist/extensions/Blocks/Recommendation/controls/button/index.js +36 -36
  77. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +128 -133
  78. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +23 -20
  79. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
  80. package/dist/extensions/Blocks/Recommendation/controls/image/index.js +9 -9
  81. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +19 -20
  82. package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +4 -6
  83. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +84 -90
  84. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +18 -18
  85. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +4 -4
  86. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +35 -36
  87. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +134 -135
  88. package/dist/extensions/Blocks/Recommendation/controls/name/index.js +24 -24
  89. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
  90. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +24 -24
  91. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +24 -24
  92. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +4 -4
  93. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +4 -4
  94. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +24 -24
  95. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +4 -4
  96. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +4 -4
  97. package/dist/extensions/Blocks/Recommendation/controls/price/index.js +24 -24
  98. package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
  99. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +32 -32
  100. package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +18 -20
  101. package/dist/extensions/Blocks/Recommendation/extension.js +31 -32
  102. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +25 -32
  103. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +72 -69
  104. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +22 -23
  105. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +10 -10
  106. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +10 -10
  107. package/dist/extensions/Blocks/Recommendation/templates/index.js +6 -6
  108. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +24 -25
  109. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +11 -11
  110. package/dist/extensions/Blocks/Recommendation/templates/utils.js +45 -47
  111. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
  112. package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +13 -16
  113. package/dist/extensions/Blocks/Unsubscribe/block.js +11 -11
  114. package/dist/extensions/Blocks/Unsubscribe/control.js +11 -13
  115. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +16 -18
  116. package/dist/extensions/Blocks/common-control.js +25 -26
  117. package/dist/extensions/DynamicContent/dynamic-content.js +53 -58
  118. package/dist/guido.css +1 -1
  119. package/dist/library.js +11 -12
  120. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +272 -167
  121. package/dist/node_modules/valibot/dist/index.js +122 -126
  122. package/dist/package.json.js +1 -1
  123. package/dist/services/recommendationApi.js +14 -17
  124. package/dist/services/templateLibraryApi.js +37 -38
  125. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  126. package/dist/src/composables/useActionsApi.d.ts +1 -1
  127. package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
  128. package/dist/src/composables/useHtmlCompiler.d.ts +1 -2
  129. package/dist/src/composables/useTranslations.d.ts +1 -1
  130. package/dist/src/enums/displayConditions.d.ts +1 -5
  131. package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -5
  132. package/dist/src/enums/unsubscribe.d.ts +8 -8
  133. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
  134. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
  135. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
  136. package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
  137. package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
  138. package/dist/src/stores/dynamic-content.d.ts +3 -3
  139. package/dist/static/styles/components/button.css.js +16 -9
  140. package/dist/static/styles/components/loader.css.js +4 -0
  141. package/dist/static/styles/components/narrow-panel.css.js +52 -0
  142. package/dist/stores/config.js +25 -81
  143. package/dist/stores/dynamic-content.js +6 -11
  144. package/dist/stores/onboarding.js +5 -5
  145. package/dist/stores/preview.js +6 -9
  146. package/dist/stores/unsubscribe.js +1 -4
  147. package/dist/utils/dateUtil.js +7 -10
  148. package/dist/utils/genericUtil.js +10 -13
  149. package/dist/utils/pairProductVariables.js +13 -14
  150. package/package.json +8 -5
  151. package/dist/node_modules/lodash-es/_DataView.js +0 -6
  152. package/dist/node_modules/lodash-es/_Hash.js +0 -20
  153. package/dist/node_modules/lodash-es/_ListCache.js +0 -20
  154. package/dist/node_modules/lodash-es/_Map.js +0 -6
  155. package/dist/node_modules/lodash-es/_MapCache.js +0 -20
  156. package/dist/node_modules/lodash-es/_Promise.js +0 -6
  157. package/dist/node_modules/lodash-es/_Set.js +0 -6
  158. package/dist/node_modules/lodash-es/_SetCache.js +0 -13
  159. package/dist/node_modules/lodash-es/_Stack.js +0 -18
  160. package/dist/node_modules/lodash-es/_Symbol.js +0 -5
  161. package/dist/node_modules/lodash-es/_Uint8Array.js +0 -5
  162. package/dist/node_modules/lodash-es/_WeakMap.js +0 -6
  163. package/dist/node_modules/lodash-es/_arrayFilter.js +0 -10
  164. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +0 -20
  165. package/dist/node_modules/lodash-es/_arrayMap.js +0 -8
  166. package/dist/node_modules/lodash-es/_arrayPush.js +0 -8
  167. package/dist/node_modules/lodash-es/_arraySome.js +0 -9
  168. package/dist/node_modules/lodash-es/_assocIndexOf.js +0 -10
  169. package/dist/node_modules/lodash-es/_baseEach.js +0 -6
  170. package/dist/node_modules/lodash-es/_baseFlatten.js +0 -13
  171. package/dist/node_modules/lodash-es/_baseFor.js +0 -5
  172. package/dist/node_modules/lodash-es/_baseForOwn.js +0 -8
  173. package/dist/node_modules/lodash-es/_baseGet.js +0 -11
  174. package/dist/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  175. package/dist/node_modules/lodash-es/_baseGetTag.js +0 -10
  176. package/dist/node_modules/lodash-es/_baseHasIn.js +0 -6
  177. package/dist/node_modules/lodash-es/_baseIsArguments.js +0 -9
  178. package/dist/node_modules/lodash-es/_baseIsEqual.js +0 -8
  179. package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +0 -32
  180. package/dist/node_modules/lodash-es/_baseIsMatch.js +0 -29
  181. package/dist/node_modules/lodash-es/_baseIsNative.js +0 -16
  182. package/dist/node_modules/lodash-es/_baseIsTypedArray.js +0 -12
  183. package/dist/node_modules/lodash-es/_baseIteratee.js +0 -11
  184. package/dist/node_modules/lodash-es/_baseKeys.js +0 -14
  185. package/dist/node_modules/lodash-es/_baseMap.js +0 -11
  186. package/dist/node_modules/lodash-es/_baseMatches.js +0 -12
  187. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
  188. package/dist/node_modules/lodash-es/_baseProperty.js +0 -8
  189. package/dist/node_modules/lodash-es/_basePropertyDeep.js +0 -9
  190. package/dist/node_modules/lodash-es/_baseRange.js +0 -9
  191. package/dist/node_modules/lodash-es/_baseTimes.js +0 -8
  192. package/dist/node_modules/lodash-es/_baseToString.js +0 -18
  193. package/dist/node_modules/lodash-es/_baseTrim.js +0 -8
  194. package/dist/node_modules/lodash-es/_baseUnary.js +0 -8
  195. package/dist/node_modules/lodash-es/_cacheHas.js +0 -6
  196. package/dist/node_modules/lodash-es/_castPath.js +0 -10
  197. package/dist/node_modules/lodash-es/_coreJsData.js +0 -5
  198. package/dist/node_modules/lodash-es/_createBaseEach.js +0 -15
  199. package/dist/node_modules/lodash-es/_createBaseFor.js +0 -13
  200. package/dist/node_modules/lodash-es/_createRange.js +0 -11
  201. package/dist/node_modules/lodash-es/_equalArrays.js +0 -40
  202. package/dist/node_modules/lodash-es/_equalByTag.js +0 -45
  203. package/dist/node_modules/lodash-es/_equalObjects.js +0 -36
  204. package/dist/node_modules/lodash-es/_freeGlobal.js +0 -4
  205. package/dist/node_modules/lodash-es/_getAllKeys.js +0 -9
  206. package/dist/node_modules/lodash-es/_getMapData.js +0 -8
  207. package/dist/node_modules/lodash-es/_getMatchData.js +0 -12
  208. package/dist/node_modules/lodash-es/_getNative.js +0 -9
  209. package/dist/node_modules/lodash-es/_getRawTag.js +0 -15
  210. package/dist/node_modules/lodash-es/_getSymbols.js +0 -10
  211. package/dist/node_modules/lodash-es/_getTag.js +0 -28
  212. package/dist/node_modules/lodash-es/_getValue.js +0 -6
  213. package/dist/node_modules/lodash-es/_hasPath.js +0 -19
  214. package/dist/node_modules/lodash-es/_hashClear.js +0 -7
  215. package/dist/node_modules/lodash-es/_hashDelete.js +0 -7
  216. package/dist/node_modules/lodash-es/_hashGet.js +0 -13
  217. package/dist/node_modules/lodash-es/_hashHas.js +0 -9
  218. package/dist/node_modules/lodash-es/_hashSet.js +0 -9
  219. package/dist/node_modules/lodash-es/_isFlattenable.js +0 -10
  220. package/dist/node_modules/lodash-es/_isIndex.js +0 -8
  221. package/dist/node_modules/lodash-es/_isIterateeCall.js +0 -13
  222. package/dist/node_modules/lodash-es/_isKey.js +0 -12
  223. package/dist/node_modules/lodash-es/_isKeyable.js +0 -7
  224. package/dist/node_modules/lodash-es/_isMasked.js +0 -11
  225. package/dist/node_modules/lodash-es/_isPrototype.js +0 -8
  226. package/dist/node_modules/lodash-es/_isStrictComparable.js +0 -7
  227. package/dist/node_modules/lodash-es/_listCacheClear.js +0 -6
  228. package/dist/node_modules/lodash-es/_listCacheDelete.js +0 -12
  229. package/dist/node_modules/lodash-es/_listCacheGet.js +0 -8
  230. package/dist/node_modules/lodash-es/_listCacheHas.js +0 -7
  231. package/dist/node_modules/lodash-es/_listCacheSet.js +0 -8
  232. package/dist/node_modules/lodash-es/_mapCacheClear.js +0 -13
  233. package/dist/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  234. package/dist/node_modules/lodash-es/_mapCacheGet.js +0 -7
  235. package/dist/node_modules/lodash-es/_mapCacheHas.js +0 -7
  236. package/dist/node_modules/lodash-es/_mapCacheSet.js +0 -8
  237. package/dist/node_modules/lodash-es/_mapToArray.js +0 -9
  238. package/dist/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
  239. package/dist/node_modules/lodash-es/_memoizeCapped.js +0 -11
  240. package/dist/node_modules/lodash-es/_nativeCreate.js +0 -5
  241. package/dist/node_modules/lodash-es/_nativeKeys.js +0 -5
  242. package/dist/node_modules/lodash-es/_nodeUtil.js +0 -11
  243. package/dist/node_modules/lodash-es/_objectToString.js +0 -7
  244. package/dist/node_modules/lodash-es/_overArg.js +0 -8
  245. package/dist/node_modules/lodash-es/_root.js +0 -5
  246. package/dist/node_modules/lodash-es/_setCacheAdd.js +0 -7
  247. package/dist/node_modules/lodash-es/_setCacheHas.js +0 -6
  248. package/dist/node_modules/lodash-es/_setToArray.js +0 -9
  249. package/dist/node_modules/lodash-es/_stackClear.js +0 -7
  250. package/dist/node_modules/lodash-es/_stackDelete.js +0 -7
  251. package/dist/node_modules/lodash-es/_stackGet.js +0 -6
  252. package/dist/node_modules/lodash-es/_stackHas.js +0 -6
  253. package/dist/node_modules/lodash-es/_stackSet.js +0 -17
  254. package/dist/node_modules/lodash-es/_stringToPath.js +0 -10
  255. package/dist/node_modules/lodash-es/_toKey.js +0 -10
  256. package/dist/node_modules/lodash-es/_toSource.js +0 -17
  257. package/dist/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
  258. package/dist/node_modules/lodash-es/eq.js +0 -6
  259. package/dist/node_modules/lodash-es/flatMap.js +0 -8
  260. package/dist/node_modules/lodash-es/get.js +0 -8
  261. package/dist/node_modules/lodash-es/hasIn.js +0 -8
  262. package/dist/node_modules/lodash-es/identity.js +0 -6
  263. package/dist/node_modules/lodash-es/isArguments.js +0 -10
  264. package/dist/node_modules/lodash-es/isArray.js +0 -4
  265. package/dist/node_modules/lodash-es/isArrayLike.js +0 -8
  266. package/dist/node_modules/lodash-es/isBuffer.js +0 -6
  267. package/dist/node_modules/lodash-es/isFunction.js +0 -12
  268. package/dist/node_modules/lodash-es/isLength.js +0 -7
  269. package/dist/node_modules/lodash-es/isObject.js +0 -7
  270. package/dist/node_modules/lodash-es/isObjectLike.js +0 -6
  271. package/dist/node_modules/lodash-es/isSymbol.js +0 -9
  272. package/dist/node_modules/lodash-es/isTypedArray.js +0 -7
  273. package/dist/node_modules/lodash-es/keys.js +0 -9
  274. package/dist/node_modules/lodash-es/map.js +0 -11
  275. package/dist/node_modules/lodash-es/memoize.js +0 -18
  276. package/dist/node_modules/lodash-es/property.js +0 -10
  277. package/dist/node_modules/lodash-es/range.js +0 -5
  278. package/dist/node_modules/lodash-es/stubArray.js +0 -6
  279. package/dist/node_modules/lodash-es/stubFalse.js +0 -6
  280. package/dist/node_modules/lodash-es/toFinite.js +0 -14
  281. package/dist/node_modules/lodash-es/toNumber.js +0 -22
  282. package/dist/node_modules/lodash-es/toString.js +0 -7
@@ -1,10 +1,10 @@
1
+ import { useRecommendationExtensionStore as p } from "../../store/recommendation.js";
2
+ import { formatPrice as b } from "../../utils/priceFormatter.js";
3
+ import { sanitizeImageUrl as u, CUSTOM_CELL_HTML as m } from "../utils.js";
4
+ import { ATTR_PRODUCT_ATTR as g, ATTR_PRODUCT_BUTTON as i, ATTR_PRODUCT_IMAGE as c, ATTR_PRODUCT_OMNIBUS_DISCOUNT as f, ATTR_PRODUCT_OMNIBUS_PRICE as T, ATTR_PRODUCT_OLD_PRICE as x, ATTR_PRODUCT_PRICE as _, ATTR_PRODUCT_NAME as R } from "../../constants/selectors.js";
1
5
  import { RecommendationBlockId as o } from "../../constants/blockIds.js";
2
- import { ATTR_PRODUCT_ATTR as u, ATTR_PRODUCT_BUTTON as l, ATTR_PRODUCT_IMAGE as d, ATTR_PRODUCT_OMNIBUS_DISCOUNT as m, ATTR_PRODUCT_OMNIBUS_PRICE as g, ATTR_PRODUCT_OLD_PRICE as f, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_NAME as x } from "../../constants/selectors.js";
3
- import { useRecommendationExtensionStore as _ } from "../../store/recommendation.js";
4
- import { formatPrice as R } from "../../utils/priceFormatter.js";
5
- import { sanitizeImageUrl as C, CUSTOM_CELL_HTML as y } from "../utils.js";
6
- function p() {
7
- const t = _(), { currencySettings: e } = t.recommendationConfigs;
6
+ function l() {
7
+ const t = p(), { currencySettings: e } = t.recommendationConfigs;
8
8
  return {
9
9
  code: e.value,
10
10
  symbol: e.symbol,
@@ -15,29 +15,29 @@ function p() {
15
15
  };
16
16
  }
17
17
  function s(t, e = "price") {
18
- const n = p(), r = t[e], a = (r == null ? void 0 : r[n.code]) ?? Object.values(r ?? {})[0] ?? 0;
19
- return R({
18
+ const n = l(), r = t[e], a = r?.[n.code] ?? Object.values(r ?? {})[0] ?? 0;
19
+ return b({
20
20
  price: a,
21
21
  currency: n
22
22
  });
23
23
  }
24
- const I = {
24
+ const P = {
25
25
  /**
26
26
  * Image cell - left column (120px fixed width)
27
27
  * Has recommendation-attribute-row class and data attributes for Card Composition control
28
28
  */
29
- [d]: (t) => `
29
+ [c]: (t) => `
30
30
  <td
31
31
  width="120"
32
32
  class="esd-block-image product-image-cell recommendation-attribute-row es-p5"
33
33
  esd-extension-block-id="${o.IMAGE}"
34
- data-attribute-type="${d}"
34
+ data-attribute-type="${c}"
35
35
  data-visibility="1"
36
36
  align="center"
37
37
  valign="middle">
38
38
  <a target="_blank" href="${t.url}">
39
39
  <img
40
- src="${C(t.image_url)}"
40
+ src="${u(t.image_url)}"
41
41
  alt="${t.name}"
42
42
  style="display: block; max-width: 100%; height: auto;"
43
43
  class="adapt-img product-image">
@@ -47,7 +47,7 @@ const I = {
47
47
  /**
48
48
  * Name element - row for info cell table
49
49
  */
50
- [x]: (t) => `
50
+ [R]: (t) => `
51
51
  <tr>
52
52
  <td
53
53
  class="esd-block-text product-name"
@@ -62,7 +62,7 @@ const I = {
62
62
  /**
63
63
  * Price element - row for info cell table
64
64
  */
65
- [T]: (t) => `
65
+ [_]: (t) => `
66
66
  <tr>
67
67
  <td
68
68
  class="esd-block-text product-price"
@@ -77,7 +77,7 @@ const I = {
77
77
  /**
78
78
  * Old price element - row for info cell table
79
79
  */
80
- [f]: (t) => `
80
+ [x]: (t) => `
81
81
  <tr>
82
82
  <td
83
83
  class="esd-block-text product-old-price"
@@ -94,7 +94,7 @@ const I = {
94
94
  /**
95
95
  * Omnibus price element - row for info cell table
96
96
  */
97
- [g]: (t) => `
97
+ [T]: (t) => `
98
98
  <tr>
99
99
  <td
100
100
  class="esd-block-text product-omnibus-price"
@@ -113,9 +113,8 @@ const I = {
113
113
  /**
114
114
  * Omnibus discount element - row for info cell table
115
115
  */
116
- [m]: (t) => {
117
- var i, c;
118
- const e = p(), n = ((i = t.original_price) == null ? void 0 : i[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, r = ((c = t.price) == null ? void 0 : c[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, a = n > 0 ? Math.round((n - r) / n * 100) : 0, b = a > 0 ? `-${a}%` : "0%";
116
+ [f]: (t) => {
117
+ const e = l(), n = t.original_price?.[e.code] ?? Object.values(t.original_price ?? {})[0] ?? 0, r = t.price?.[e.code] ?? Object.values(t.price ?? {})[0] ?? 0, a = n > 0 ? Math.round((n - r) / n * 100) : 0, d = a > 0 ? `-${a}%` : "0%";
119
118
  return `
120
119
  <tr>
121
120
  <td
@@ -126,7 +125,7 @@ const I = {
126
125
  align="left">
127
126
  <p contenteditable="false" style="font-size: 12px; color: #666666; margin: 0;">
128
127
  <span class="omnibus-text-before"></span>
129
- <span class="omnibus-discount-value">${b}</span>
128
+ <span class="omnibus-discount-value">${d}</span>
130
129
  <span class="omnibus-text-after"></span>
131
130
  </p>
132
131
  </td>
@@ -137,12 +136,12 @@ const I = {
137
136
  * Button cell - right column (100px fixed width)
138
137
  * Has recommendation-attribute-row class and data attributes for Card Composition control
139
138
  */
140
- [l]: (t) => `
139
+ [i]: (t) => `
141
140
  <td
142
141
  width="100"
143
142
  class="esd-block-button button-cell recommendation-attribute-row product-button es-p5l es-p5r"
144
143
  esd-extension-block-id="${o.BUTTON}"
145
- data-attribute-type="${l}"
144
+ data-attribute-type="${i}"
146
145
  data-visibility="1"
147
146
  align="center"
148
147
  valign="middle">
@@ -169,10 +168,10 @@ const I = {
169
168
  * @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
170
169
  * @param content - Display content for the cell
171
170
  */
172
- [y]: (t, e) => `
171
+ [m]: (t, e) => `
173
172
  <tr>
174
173
  <td
175
- ${u}="${t}"
174
+ ${g}="${t}"
176
175
  class="esd-block-text product-custom-attribute"
177
176
  esd-extension-block-id="${o.CUSTOM_ATTRIBUTE}"
178
177
  align="left">
@@ -182,5 +181,5 @@ const I = {
182
181
  `
183
182
  };
184
183
  export {
185
- I as listElementRenderer
184
+ P as listElementRenderer
186
185
  };
@@ -1,7 +1,7 @@
1
- import { ATTR_PRODUCT_IMAGE as d, ATTR_PRODUCT_BUTTON as a } from "../../constants/selectors.js";
2
- import { DEFAULT_CARD_COMPOSITION as m, spacer as C, buildElementRenderer as b, DEFAULT_CARD_VISIBILITY as T } from "../utils.js";
3
- import { listElementRenderer as R } from "./elementRenderer.js";
4
- function f(r, n, l) {
1
+ import { DEFAULT_CARD_COMPOSITION as b, spacer as m, buildElementRenderer as C, DEFAULT_CARD_VISIBILITY as T } from "../utils.js";
2
+ import { listElementRenderer as f } from "./elementRenderer.js";
3
+ import { ATTR_PRODUCT_IMAGE as a, ATTR_PRODUCT_BUTTON as d } from "../../constants/selectors.js";
4
+ function R(r, n, l) {
5
5
  const t = l ? "" : ' style="display: none;"', o = r.replace(/<tr>/, "").replace(/<\/tr>/, "");
6
6
  return `<tr
7
7
  class="recommendation-attribute-row"
@@ -26,26 +26,26 @@ const y = `
26
26
  </td>
27
27
  </tr>
28
28
  `;
29
- function O(r, n = m, l = {}) {
30
- const t = b(R, n, l), o = t[d](r), c = `
29
+ function O(r, n = b, l = {}) {
30
+ const t = C(f, n, l), o = t[a](r), c = `
31
31
  <td class="product-info-cell" valign="middle" style="padding: 15px;">
32
- <table cellpadding="0" cellspacing="0" role="presentation" width="100%">
32
+ <table cellpadding="0" cellspacing="0" role="presentation" width="100%" style="table-layout: fixed;">
33
33
  <tbody>
34
- ${n.filter((e) => e !== d && e !== a).filter((e) => t[e]).map((e) => {
34
+ ${n.filter((e) => e !== a && e !== d).filter((e) => t[e]).map((e) => {
35
35
  const u = T[e] ?? !0;
36
- return f(t[e](r), e, u);
36
+ return R(t[e](r), e, u);
37
37
  }).join(`
38
38
  `)}
39
39
  </tbody>
40
40
  </table>
41
41
  </td>
42
- `, s = t[a](r), p = o + c + s;
42
+ `, s = t[d](r), p = o + c + s;
43
43
  return y.replace("{-{-PRODUCT_CONTENT-}-}", p);
44
44
  }
45
45
  function D(r, n, l = {}) {
46
46
  return r.map((t, o) => {
47
47
  const i = O(t, n, l);
48
- return o > 0 ? C + i : i;
48
+ return o > 0 ? m + i : i;
49
49
  }).join("");
50
50
  }
51
51
  export {
@@ -1,60 +1,58 @@
1
- import { ATTR_PRODUCT_IMAGE as m, ATTR_PRODUCT_NAME as b, ATTR_PRODUCT_OLD_PRICE as T, ATTR_PRODUCT_PRICE as _, ATTR_PRODUCT_OMNIBUS_PRICE as g, ATTR_PRODUCT_OMNIBUS_DISCOUNT as C, ATTR_PRODUCT_BUTTON as f, ATTR_CUSTOM_PREFIX as u } from "../constants/selectors.js";
2
- function U(t) {
1
+ import { ATTR_PRODUCT_IMAGE as u, ATTR_PRODUCT_NAME as m, ATTR_PRODUCT_OLD_PRICE as b, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as _, ATTR_PRODUCT_OMNIBUS_DISCOUNT as g, ATTR_PRODUCT_BUTTON as C, ATTR_CUSTOM_PREFIX as p } from "../constants/selectors.js";
2
+ function O(t) {
3
3
  return t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
4
4
  }
5
- function R(t, e) {
6
- const n = Object.values(e).find((r) => r.attributeName === t);
7
- return (n == null ? void 0 : n.type) === "defaultAttribute";
5
+ function f(t, e) {
6
+ return Object.values(e).find((r) => r.attributeName === t)?.type === "defaultAttribute";
8
7
  }
9
- function y(t, e) {
10
- return R(t, e) ? t : `product_attribute.${t}`;
8
+ function U(t, e) {
9
+ return f(t, e) ? t : `product_attribute.${t}`;
11
10
  }
12
- const P = Symbol("customCellHtml");
13
- function S(t, e, n = {}) {
14
- const r = t[P];
11
+ const y = Symbol("customCellHtml");
12
+ function E(t, e, n = {}) {
13
+ const r = t[y];
15
14
  if (!r)
16
15
  return { ...t };
17
16
  const l = { ...t };
18
- return e.filter((o) => o.startsWith(u) && !l[o]).forEach((o) => {
19
- const s = o.substring(u.length), a = U(s), D = y(s, n), O = R(s, n);
17
+ return e.filter((o) => o.startsWith(p) && !l[o]).forEach((o) => {
18
+ const s = o.substring(p.length), a = O(s), A = U(s, n), D = f(s, n);
20
19
  l[o] = (d) => {
21
- var p;
22
- const i = O ? d[s] : (p = d.product_attributes) == null ? void 0 : p[s];
20
+ const i = D ? d[s] : d.product_attributes?.[s];
23
21
  let c = a;
24
- return typeof i == "string" ? c = i : typeof i == "number" && (c = String(i)), r(D, c);
22
+ return typeof i == "string" ? c = i : typeof i == "number" && (c = String(i)), r(A, c);
25
23
  };
26
24
  }), l;
27
25
  }
28
- const L = {
26
+ const S = {
29
27
  TITLE: "You May Also Like!"
30
- }, M = [
28
+ }, L = [
29
+ u,
31
30
  m,
32
31
  b,
33
32
  T,
34
33
  _,
35
34
  g,
36
- C,
37
- f
38
- ], $ = {
35
+ C
36
+ ], M = {
37
+ [u]: !0,
39
38
  [m]: !0,
40
- [b]: !0,
41
- [_]: !0,
42
39
  [T]: !0,
40
+ [b]: !0,
41
+ [_]: !1,
43
42
  [g]: !1,
44
- [C]: !1,
45
- [f]: !0
46
- }, h = `
43
+ [C]: !0
44
+ }, P = `
47
45
  <tr>
48
46
  <td class="spacer" style="height: 10px;"></td>
49
47
  </tr>
50
- `, A = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
51
- function w(t) {
52
- return !t || typeof t != "string" || t.trim() === "" ? A : t.startsWith("http://") ? t.replace("http://", "https://") : t;
48
+ `, R = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
49
+ function $(t) {
50
+ return !t || typeof t != "string" || t.trim() === "" ? R : t.startsWith("http://") ? t.replace("http://", "https://") : t;
53
51
  }
54
- function I(t) {
52
+ function h(t) {
55
53
  return {
56
54
  name: "Product Name",
57
- image_url: A,
55
+ image_url: R,
58
56
  price: { USD: 18 },
59
57
  original_price: { USD: 20 },
60
58
  discount: { USD: 2 },
@@ -66,13 +64,13 @@ function I(t) {
66
64
  category: []
67
65
  };
68
66
  }
69
- function N(t = 6) {
67
+ function w(t = 6) {
70
68
  return Array.from(
71
69
  { length: t },
72
- (e, n) => I(String(n + 1))
70
+ (e, n) => h(String(n + 1))
73
71
  );
74
72
  }
75
- function k(t = "grid", e) {
73
+ function N(t = "grid", e) {
76
74
  const n = t === "list" ? `
77
75
  data-layout="list"` : "", r = e ? ` ${e}` : "";
78
76
  return `
@@ -110,7 +108,7 @@ function k(t = "grid", e) {
110
108
  </table>
111
109
  </td>
112
110
  </tr>
113
- ${h}
111
+ ${P}
114
112
  <tr>
115
113
  <td>
116
114
  <table
@@ -149,17 +147,17 @@ function k(t = "grid", e) {
149
147
  `;
150
148
  }
151
149
  export {
152
- P as CUSTOM_CELL_HTML,
153
- L as DEFAULTS,
154
- M as DEFAULT_CARD_COMPOSITION,
155
- $ as DEFAULT_CARD_VISIBILITY,
156
- A as PLACEHOLDER_IMAGE,
157
- S as buildElementRenderer,
158
- k as createBlockTemplate,
159
- N as getDefaultProducts,
160
- R as isDefaultAttribute,
161
- y as resolveProductAttrValue,
162
- w as sanitizeImageUrl,
163
- h as spacer,
164
- U as toDisplayName
150
+ y as CUSTOM_CELL_HTML,
151
+ S as DEFAULTS,
152
+ L as DEFAULT_CARD_COMPOSITION,
153
+ M as DEFAULT_CARD_VISIBILITY,
154
+ R as PLACEHOLDER_IMAGE,
155
+ E as buildElementRenderer,
156
+ N as createBlockTemplate,
157
+ w as getDefaultProducts,
158
+ f as isDefaultAttribute,
159
+ U as resolveProductAttrValue,
160
+ $ as sanitizeImageUrl,
161
+ P as spacer,
162
+ O as toDisplayName
165
163
  };
@@ -1,28 +1,31 @@
1
1
  function l(t) {
2
2
  if (t.length === 0)
3
3
  return "";
4
- const o = t.sort((r, e) => r.filterNumber - e.filterNumber), n = o.map((r) => `[${r.attribute}][${r.operator}][${r.value}]`), [p, ...i] = n;
5
- let u = p;
6
- for (let r = 0; r < i.length; r++) {
4
+ const o = t.sort((r, e) => r.filterNumber - e.filterNumber), u = o.map((r) => {
5
+ const e = r.operator === "||", a = e ? "=" : r.operator, c = e ? decodeURIComponent(r.value).split(",").join("||") : r.value;
6
+ return `[${r.attribute}][${a}][${c}]`;
7
+ }), [s, ...p] = u;
8
+ let n = s;
9
+ for (let r = 0; r < p.length; r++) {
7
10
  const e = o[r].innerGroupOperator;
8
- u += `${e}${i[r]}`;
11
+ n += `${e}${p[r]}`;
9
12
  }
10
- return `(${u})`;
13
+ return `(${n})`;
11
14
  }
12
- function f(t) {
15
+ function G(t) {
13
16
  if (!t || t.length === 0)
14
17
  return "";
15
- const o = t.reduce((r, e) => (r[e.filterGroup] || (r[e.filterGroup] = []), r[e.filterGroup].push(e), r), {}), n = Object.keys(o).map(Number).sort((r, e) => r - e), p = n.map((r) => {
18
+ const o = t.reduce((r, e) => (r[e.filterGroup] || (r[e.filterGroup] = []), r[e.filterGroup].push(e), r), {}), u = Object.keys(o).map(Number).sort((r, e) => r - e), s = u.map((r) => {
16
19
  const e = o[r];
17
20
  return l(e);
18
- }), [i, ...u] = p;
19
- let s = i;
20
- for (let r = 0; r < u.length; r++) {
21
- const e = n[r + 1], c = o[e][0].outerGroupOperator;
22
- s += `${c}${u[r]}`;
21
+ }), [p, ...n] = s;
22
+ let i = p;
23
+ for (let r = 0; r < n.length; r++) {
24
+ const e = u[r + 1], c = o[e][0].outerGroupOperator;
25
+ i += `${c}${n[r]}`;
23
26
  }
24
- return s.trim();
27
+ return i.trim();
25
28
  }
26
29
  export {
27
- f as generateCompleteFilterQuery
30
+ G as generateCompleteFilterQuery
28
31
  };
@@ -1,29 +1,26 @@
1
- import { safeParse as o, object as p, boolean as l, number as i, pipe as c, minLength as f, string as m } from "../../../../node_modules/valibot/dist/index.js";
2
- const e = c(m(), f(1)), s = p({
1
+ import { safeParse as i, object as a, boolean as p, number as n, pipe as l, minLength as c, string as f } from "../../../../node_modules/valibot/dist/index.js";
2
+ const e = l(f(), c(1)), o = a({
3
3
  type: e,
4
4
  attribute: e,
5
5
  operator: e,
6
6
  innerGroupOperator: e,
7
7
  outerGroupOperator: e,
8
8
  value: e,
9
- filterGroup: i(),
10
- filterNumber: i(),
11
- isValid: l()
9
+ filterGroup: n(),
10
+ filterNumber: n(),
11
+ isValid: p()
12
12
  });
13
- function g(t) {
14
- return o(s, t).success;
13
+ function b(t) {
14
+ return i(o, t).success;
15
15
  }
16
- function S(t) {
17
- const r = o(s, t);
16
+ function g(t) {
17
+ const r = i(o, t);
18
18
  return r.success ? /* @__PURE__ */ new Set() : new Set(
19
- r.issues.flatMap((u) => {
20
- var n;
21
- return ((n = u.path) == null ? void 0 : n.map((a) => String(a.key))) ?? [];
22
- })
19
+ r.issues.flatMap((s) => s.path?.map((u) => String(u.key)) ?? [])
23
20
  );
24
21
  }
25
22
  export {
26
- s as FilterSchema,
27
- S as getInvalidFilterFields,
28
- g as isFilterValid
23
+ o as FilterSchema,
24
+ g as getInvalidFilterFields,
25
+ b as isFilterValid
29
26
  };
@@ -3,15 +3,15 @@ var h = (n, i, e) => i in n ? d(n, i, { enumerable: !0, configurable: !0, writab
3
3
  var u = (n, i, e) => h(n, typeof i != "symbol" ? i + "" : i, e);
4
4
  import { PAGE_TYPES as E } from "../../../enums/unsubscribe.js";
5
5
  import { useUnsubscribeStore as c } from "../../../stores/unsubscribe.js";
6
- import { Block as _, BlockCompositionType as S, ModificationDescription as b } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
- import { getDefaultTemplate as L } from "./template.js";
6
+ import { Block as _, BlockCompositionType as S, BlockType as L, ModificationDescription as b } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
+ import { getDefaultTemplate as v } from "./template.js";
8
8
  import { UNSUBSCRIBE_EVENTS as a, DATA_ATTRIBUTES as o } from "./utils/constants.js";
9
9
  import { parsePageList as p } from "./utils/utils.js";
10
- const v = "unsubscribe-block", g = 'a[data-unsubscribe-link="true"]', f = ".unsubscribe-block-v2", T = "{{ins-unsubscribe-link}}", B = {
10
+ const g = "unsubscribe-block", T = 'a[data-unsubscribe-link="true"]', f = ".unsubscribe-block-v2", B = "{{ins-unsubscribe-link}}", C = {
11
11
  [E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
12
12
  [E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
13
13
  };
14
- class R extends _ {
14
+ class I extends _ {
15
15
  constructor() {
16
16
  super();
17
17
  u(this, "selectEventListener", null);
@@ -19,7 +19,7 @@ class R extends _ {
19
19
  u(this, "currentNode");
20
20
  }
21
21
  getId() {
22
- return v;
22
+ return g;
23
23
  }
24
24
  getIcon() {
25
25
  return "unsubscribe-icon";
@@ -34,7 +34,7 @@ class R extends _ {
34
34
  return this.api.translate("Unsubscribe Block Description");
35
35
  }
36
36
  getTemplate() {
37
- return L();
37
+ return v();
38
38
  }
39
39
  onSelect(e) {
40
40
  this.currentNode = e, !("getAttribute" in e && e.getAttribute("data-migration")) && (this._resetStoreState(), this._loadBlockState(e), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
@@ -66,7 +66,7 @@ class R extends _ {
66
66
  try {
67
67
  if (!this.currentNode)
68
68
  return;
69
- this.api.getDocumentModifier().modifyHtml(this.currentNode).delete().apply(new b("Removed unsubscribe block due to cancel"));
69
+ this.api.getDocumentModifier().modifyHtml(this.currentNode).replaceWith(`<${L.EMPTY_CONTAINER}/>`).apply(new b("Removed unsubscribe block due to cancel"));
70
70
  } catch (e) {
71
71
  console.warn("[UnsubscribeBlock] Failed to remove unsubscribe block:", e);
72
72
  }
@@ -77,14 +77,14 @@ class R extends _ {
77
77
  _updateBlock(e, r) {
78
78
  if (!this.currentNode || !("querySelector" in this.currentNode))
79
79
  return;
80
- const s = this.currentNode.querySelector(g);
80
+ const s = this.currentNode.querySelector(T);
81
81
  if (!s)
82
82
  return;
83
83
  const t = this._getMergeTag(e);
84
84
  this.api.getDocumentModifier().modifyHtml(s).setAttribute("href", t).apply(new b(`Updated unsubscribe link to ${t}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(o.PAGE_TYPE, e.toString()).setAttribute(o.PAGE_LIST, r).apply(new b("Updated unsubscribe block metadata"));
85
85
  }
86
86
  _getMergeTag(e) {
87
- return B[e] ?? T;
87
+ return C[e] ?? B;
88
88
  }
89
89
  _openDrawer() {
90
90
  if (!(this.currentNode && this.currentNode.getAttribute("data-unsubscribe-page-type")))
@@ -130,6 +130,6 @@ class R extends _ {
130
130
  }
131
131
  }
132
132
  export {
133
- v as UNSUBSCRIBE_BLOCK_ID,
134
- R as UnsubscribeBlock
133
+ g as UNSUBSCRIBE_BLOCK_ID,
134
+ I as UnsubscribeBlock
135
135
  };
@@ -47,8 +47,7 @@ class B extends T {
47
47
  }), this.valueChangeHandlers = [], this.currentNode = void 0, this.currentPages = void 0, this.currentPreviewIndex = 0, this.lastParsedAttribute = void 0;
48
48
  }
49
49
  get totalTemplates() {
50
- var e;
51
- return ((e = this.currentPages) == null ? void 0 : e.length) ?? 0;
50
+ return this.currentPages?.length ?? 0;
52
51
  }
53
52
  _listenToFormUpdates() {
54
53
  this.valueChangeHandlers.push(
@@ -77,24 +76,23 @@ class B extends T {
77
76
  await l().fetchTemplates(), this._updatePreview(), this._updateCounter();
78
77
  }
79
78
  _updatePreview() {
80
- var e;
81
- if ((e = this.currentPages) != null && e.length)
79
+ if (this.currentPages?.length)
82
80
  try {
83
- const t = this.currentPages[this.currentPreviewIndex], o = l().getThumbnailByTemplateId(t);
81
+ const e = this.currentPages[this.currentPreviewIndex], o = l().getThumbnailByTemplateId(e);
84
82
  if (!o) {
85
- console.warn("[UnsubscribeControl] No thumbnail found for page:", t);
83
+ console.warn("[UnsubscribeControl] No thumbnail found for page:", e);
86
84
  return;
87
85
  }
88
86
  this.api.updateValues({
89
87
  [r.PREVIEW_IMAGE]: o
90
88
  });
91
- } catch (t) {
92
- console.error("[UnsubscribeControl] Failed to update preview:", t);
89
+ } catch (e) {
90
+ console.error("[UnsubscribeControl] Failed to update preview:", e);
93
91
  }
94
92
  }
95
93
  _updateCounter() {
96
- const e = this.currentPreviewIndex + 1, t = this.totalTemplates, c = this.currentPreviewIndex === 0, o = this.currentPreviewIndex >= t - 1;
97
- this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled, c), this.api.setUIEAttribute(r.NEXT_BUTTON, i.BUTTON.disabled, o), this.api.setUIEAttribute(
94
+ const e = this.currentPreviewIndex + 1, t = this.totalTemplates, o = this.currentPreviewIndex === 0, c = this.currentPreviewIndex >= t - 1;
95
+ this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled, o), this.api.setUIEAttribute(r.NEXT_BUTTON, i.BUTTON.disabled, c), this.api.setUIEAttribute(
98
96
  r.COUNTER_TEXT,
99
97
  i.LABEL.text,
100
98
  `${this.api.translate("Showing")} ${e} ${this.api.translate("of")} ${t}`
@@ -135,14 +133,14 @@ class B extends T {
135
133
  </${n.LABEL}>
136
134
  `;
137
135
  }
138
- _getIconButton(e, t, c) {
139
- const o = c ? `${i.BUTTON.disabled}="true"` : "";
136
+ _getIconButton(e, t, o) {
137
+ const c = o ? `${i.BUTTON.disabled}="true"` : "";
140
138
  return `
141
139
  <${n.BUTTON}
142
140
  id="${e}"
143
141
  class="flat-inline flat-white"
144
142
  ${i.BUTTON.name}="${e}"
145
- ${o}
143
+ ${c}
146
144
  >
147
145
  <${n.ICON}
148
146
  src="${t}"
@@ -1,15 +1,15 @@
1
- var n = Object.defineProperty;
2
- var m = (s, i, e) => i in s ? n(s, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[i] = e;
3
- var r = (s, i, e) => m(s, typeof i != "symbol" ? i + "" : i, e);
4
- import { UIElement as l } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- const E = "unsubscribe-preview", c = "img", a = "Unsubscribe page preview", g = "is-loaded";
6
- class d extends l {
1
+ var r = Object.defineProperty;
2
+ var n = (s, e, i) => e in s ? r(s, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[e] = i;
3
+ var t = (s, e, i) => n(s, typeof e != "symbol" ? e + "" : e, i);
4
+ import { UIElement as m } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ const l = "unsubscribe-preview", E = "img", c = "Unsubscribe page preview", a = "is-loaded";
6
+ class u extends m {
7
7
  constructor() {
8
8
  super(...arguments);
9
- r(this, "imgElement");
9
+ t(this, "imgElement");
10
10
  }
11
11
  getId() {
12
- return E;
12
+ return l;
13
13
  }
14
14
  getTemplate() {
15
15
  return `
@@ -17,28 +17,26 @@ class d extends l {
17
17
  <div class="unsubscribe-preview-loader"></div>
18
18
  <img
19
19
  src=""
20
- alt="${a}"
20
+ alt="${c}"
21
21
  class="unsubscribe-preview-image"
22
22
  />
23
23
  </div>
24
24
  `;
25
25
  }
26
- onRender(e) {
27
- this.imgElement = e.querySelector(c);
26
+ onRender(i) {
27
+ this.imgElement = i.querySelector(E);
28
28
  }
29
- setValue(e) {
30
- var t;
31
- this.imgElement && (this.imgElement.src = e, (t = this.imgElement.parentElement) == null || t.classList.add(g));
29
+ setValue(i) {
30
+ this.imgElement && (this.imgElement.src = i, this.imgElement.parentElement?.classList.add(a));
32
31
  }
33
32
  getValue() {
34
- var e;
35
- return ((e = this.imgElement) == null ? void 0 : e.src) ?? "";
33
+ return this.imgElement?.src ?? "";
36
34
  }
37
35
  onDestroy() {
38
36
  this.imgElement = void 0;
39
37
  }
40
38
  }
41
39
  export {
42
- E as PREVIEW_UI_ELEMENT_ID,
43
- d as PreviewUIElement
40
+ l as PREVIEW_UI_ELEMENT_ID,
41
+ u as PreviewUIElement
44
42
  };