@useinsider/guido 3.2.0-beta.8b0bc0c → 3.2.0-beta.8e8f902

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 (290) hide show
  1. package/README.md +25 -1
  2. package/dist/@types/config/schemas.js +38 -36
  3. package/dist/@types/config/validator.js +34 -27
  4. package/dist/components/Guido.vue.js +4 -4
  5. package/dist/components/Guido.vue2.js +88 -82
  6. package/dist/components/organisms/AutoSaveController.vue.js +17 -0
  7. package/dist/components/organisms/AutoSaveController.vue2.js +13 -0
  8. package/dist/components/organisms/base/Toaster.vue2.js +11 -10
  9. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +12 -12
  10. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +6 -6
  11. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +15 -9
  12. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +40 -31
  13. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +20 -19
  14. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +14 -11
  15. package/dist/components/organisms/header/AutoSaveToggle.vue.js +22 -0
  16. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
  17. package/dist/components/organisms/header/EditorActions.vue.js +12 -11
  18. package/dist/components/organisms/header/EditorActions.vue2.js +22 -18
  19. package/dist/components/organisms/header/HeaderWrapper.vue2.js +15 -12
  20. package/dist/components/organisms/header/LeftSlot.vue2.js +19 -16
  21. package/dist/components/organisms/header/MiddleSlot.vue2.js +11 -14
  22. package/dist/components/organisms/header/RightSlot.vue.js +8 -8
  23. package/dist/components/organisms/header/RightSlot.vue2.js +17 -13
  24. package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +12 -11
  25. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -29
  26. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +13 -12
  27. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +44 -40
  28. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +13 -12
  29. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +50 -47
  30. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +21 -18
  31. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +31 -27
  32. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +13 -12
  33. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +35 -44
  34. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +12 -11
  35. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +23 -20
  36. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +9 -8
  37. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +10 -9
  38. package/dist/composables/useActionsApi.js +38 -37
  39. package/dist/composables/useAutoSave.js +71 -0
  40. package/dist/composables/useBlocksConfig.js +26 -26
  41. package/dist/composables/useFullStoryBridge.js +9 -8
  42. package/dist/composables/useHtmlCompiler.js +26 -34
  43. package/dist/composables/useHtmlValidator.js +109 -101
  44. package/dist/composables/useHttp.js +30 -30
  45. package/dist/composables/usePartner.js +1 -1
  46. package/dist/composables/useRecommendation.js +15 -14
  47. package/dist/composables/useRibbonOffset.js +21 -0
  48. package/dist/composables/useSave.js +22 -21
  49. package/dist/composables/useStripo.js +50 -53
  50. package/dist/composables/useSyncModuleExtractor.js +29 -31
  51. package/dist/composables/useTimerClone.js +25 -24
  52. package/dist/composables/useTranslations.js +16 -23
  53. package/dist/composables/useValidation.js +8 -7
  54. package/dist/composables/validators/useLiquidValidator.js +13 -13
  55. package/dist/config/compiler/unsubscribeCompilerRules.js +41 -37
  56. package/dist/config/compiler/utils/recommendationCompilerUtils.js +11 -10
  57. package/dist/config/migrator/checkboxMigrator.js +21 -20
  58. package/dist/config/migrator/couponBlockMigrator.js +19 -18
  59. package/dist/config/migrator/itemsBlockMigrator.js +89 -87
  60. package/dist/config/migrator/radioButtonMigrator.js +13 -12
  61. package/dist/config/migrator/recommendationMigrator.js +109 -106
  62. package/dist/config/migrator/unsubscribeMigrator.js +11 -10
  63. package/dist/enums/onboarding.js +7 -2
  64. package/dist/enums/unsubscribe.js +34 -27
  65. package/dist/extensions/Blocks/Items/block.js +9 -9
  66. package/dist/extensions/Blocks/Items/controls/button/link.js +14 -14
  67. package/dist/extensions/Blocks/Items/controls/cardComposition.js +97 -89
  68. package/dist/extensions/Blocks/Items/controls/image/link.js +14 -14
  69. package/dist/extensions/Blocks/Items/controls/name/trimming.js +24 -23
  70. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +14 -13
  71. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +47 -44
  72. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +38 -38
  73. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +11 -11
  74. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +40 -38
  75. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +35 -35
  76. package/dist/extensions/Blocks/Items/controls/settingsControl.js +162 -155
  77. package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
  78. package/dist/extensions/Blocks/Items/template.js +210 -210
  79. package/dist/extensions/Blocks/Recommendation/controls/button/index.js +36 -36
  80. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +133 -128
  81. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +9 -9
  82. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +10 -10
  83. package/dist/extensions/Blocks/Recommendation/controls/image/index.js +9 -9
  84. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +18 -17
  85. package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +6 -4
  86. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +90 -82
  87. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +18 -18
  88. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +4 -4
  89. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +36 -35
  90. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +135 -134
  91. package/dist/extensions/Blocks/Recommendation/controls/name/index.js +24 -24
  92. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +10 -10
  93. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +24 -24
  94. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +24 -24
  95. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +4 -4
  96. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +4 -4
  97. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +24 -24
  98. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +4 -4
  99. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +4 -4
  100. package/dist/extensions/Blocks/Recommendation/controls/price/index.js +24 -24
  101. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +32 -32
  102. package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +20 -18
  103. package/dist/extensions/Blocks/Recommendation/extension.js +32 -31
  104. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +16 -8
  105. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +56 -55
  106. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +23 -22
  107. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +10 -10
  108. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +10 -10
  109. package/dist/extensions/Blocks/Recommendation/templates/index.js +6 -6
  110. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +25 -24
  111. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +1 -1
  112. package/dist/extensions/Blocks/Recommendation/templates/utils.js +47 -45
  113. package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +16 -13
  114. package/dist/extensions/Blocks/Unsubscribe/control.js +13 -11
  115. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +18 -16
  116. package/dist/extensions/Blocks/common-control.js +26 -25
  117. package/dist/extensions/DynamicContent/dynamic-content.js +58 -53
  118. package/dist/guido.css +1 -1
  119. package/dist/library.js +12 -11
  120. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +286 -262
  121. package/dist/node_modules/lodash-es/_DataView.js +6 -0
  122. package/dist/node_modules/lodash-es/_Hash.js +20 -0
  123. package/dist/node_modules/lodash-es/_ListCache.js +20 -0
  124. package/dist/node_modules/lodash-es/_Map.js +6 -0
  125. package/dist/node_modules/lodash-es/_MapCache.js +20 -0
  126. package/dist/node_modules/lodash-es/_Promise.js +6 -0
  127. package/dist/node_modules/lodash-es/_Set.js +6 -0
  128. package/dist/node_modules/lodash-es/_SetCache.js +13 -0
  129. package/dist/node_modules/lodash-es/_Stack.js +18 -0
  130. package/dist/node_modules/lodash-es/_Symbol.js +5 -0
  131. package/dist/node_modules/lodash-es/_Uint8Array.js +5 -0
  132. package/dist/node_modules/lodash-es/_WeakMap.js +6 -0
  133. package/dist/node_modules/lodash-es/_arrayFilter.js +10 -0
  134. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +20 -0
  135. package/dist/node_modules/lodash-es/_arrayMap.js +8 -0
  136. package/dist/node_modules/lodash-es/_arrayPush.js +8 -0
  137. package/dist/node_modules/lodash-es/_arraySome.js +9 -0
  138. package/dist/node_modules/lodash-es/_assocIndexOf.js +10 -0
  139. package/dist/node_modules/lodash-es/_baseEach.js +6 -0
  140. package/dist/node_modules/lodash-es/_baseFlatten.js +13 -0
  141. package/dist/node_modules/lodash-es/_baseFor.js +5 -0
  142. package/dist/node_modules/lodash-es/_baseForOwn.js +8 -0
  143. package/dist/node_modules/lodash-es/_baseGet.js +11 -0
  144. package/dist/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  145. package/dist/node_modules/lodash-es/_baseGetTag.js +10 -0
  146. package/dist/node_modules/lodash-es/_baseHasIn.js +6 -0
  147. package/dist/node_modules/lodash-es/_baseIsArguments.js +9 -0
  148. package/dist/node_modules/lodash-es/_baseIsEqual.js +8 -0
  149. package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +32 -0
  150. package/dist/node_modules/lodash-es/_baseIsMatch.js +29 -0
  151. package/dist/node_modules/lodash-es/_baseIsNative.js +16 -0
  152. package/dist/node_modules/lodash-es/_baseIsTypedArray.js +12 -0
  153. package/dist/node_modules/lodash-es/_baseIteratee.js +11 -0
  154. package/dist/node_modules/lodash-es/_baseKeys.js +14 -0
  155. package/dist/node_modules/lodash-es/_baseMap.js +11 -0
  156. package/dist/node_modules/lodash-es/_baseMatches.js +12 -0
  157. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
  158. package/dist/node_modules/lodash-es/_baseProperty.js +8 -0
  159. package/dist/node_modules/lodash-es/_basePropertyDeep.js +9 -0
  160. package/dist/node_modules/lodash-es/_baseRange.js +9 -0
  161. package/dist/node_modules/lodash-es/_baseTimes.js +8 -0
  162. package/dist/node_modules/lodash-es/_baseToString.js +18 -0
  163. package/dist/node_modules/lodash-es/_baseTrim.js +8 -0
  164. package/dist/node_modules/lodash-es/_baseUnary.js +8 -0
  165. package/dist/node_modules/lodash-es/_cacheHas.js +6 -0
  166. package/dist/node_modules/lodash-es/_castPath.js +10 -0
  167. package/dist/node_modules/lodash-es/_coreJsData.js +5 -0
  168. package/dist/node_modules/lodash-es/_createBaseEach.js +15 -0
  169. package/dist/node_modules/lodash-es/_createBaseFor.js +13 -0
  170. package/dist/node_modules/lodash-es/_createRange.js +11 -0
  171. package/dist/node_modules/lodash-es/_equalArrays.js +40 -0
  172. package/dist/node_modules/lodash-es/_equalByTag.js +45 -0
  173. package/dist/node_modules/lodash-es/_equalObjects.js +36 -0
  174. package/dist/node_modules/lodash-es/_freeGlobal.js +4 -0
  175. package/dist/node_modules/lodash-es/_getAllKeys.js +9 -0
  176. package/dist/node_modules/lodash-es/_getMapData.js +8 -0
  177. package/dist/node_modules/lodash-es/_getMatchData.js +12 -0
  178. package/dist/node_modules/lodash-es/_getNative.js +9 -0
  179. package/dist/node_modules/lodash-es/_getRawTag.js +15 -0
  180. package/dist/node_modules/lodash-es/_getSymbols.js +10 -0
  181. package/dist/node_modules/lodash-es/_getTag.js +28 -0
  182. package/dist/node_modules/lodash-es/_getValue.js +6 -0
  183. package/dist/node_modules/lodash-es/_hasPath.js +19 -0
  184. package/dist/node_modules/lodash-es/_hashClear.js +7 -0
  185. package/dist/node_modules/lodash-es/_hashDelete.js +7 -0
  186. package/dist/node_modules/lodash-es/_hashGet.js +13 -0
  187. package/dist/node_modules/lodash-es/_hashHas.js +9 -0
  188. package/dist/node_modules/lodash-es/_hashSet.js +9 -0
  189. package/dist/node_modules/lodash-es/_isFlattenable.js +10 -0
  190. package/dist/node_modules/lodash-es/_isIndex.js +8 -0
  191. package/dist/node_modules/lodash-es/_isIterateeCall.js +13 -0
  192. package/dist/node_modules/lodash-es/_isKey.js +12 -0
  193. package/dist/node_modules/lodash-es/_isKeyable.js +7 -0
  194. package/dist/node_modules/lodash-es/_isMasked.js +11 -0
  195. package/dist/node_modules/lodash-es/_isPrototype.js +8 -0
  196. package/dist/node_modules/lodash-es/_isStrictComparable.js +7 -0
  197. package/dist/node_modules/lodash-es/_listCacheClear.js +6 -0
  198. package/dist/node_modules/lodash-es/_listCacheDelete.js +12 -0
  199. package/dist/node_modules/lodash-es/_listCacheGet.js +8 -0
  200. package/dist/node_modules/lodash-es/_listCacheHas.js +7 -0
  201. package/dist/node_modules/lodash-es/_listCacheSet.js +8 -0
  202. package/dist/node_modules/lodash-es/_mapCacheClear.js +13 -0
  203. package/dist/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  204. package/dist/node_modules/lodash-es/_mapCacheGet.js +7 -0
  205. package/dist/node_modules/lodash-es/_mapCacheHas.js +7 -0
  206. package/dist/node_modules/lodash-es/_mapCacheSet.js +8 -0
  207. package/dist/node_modules/lodash-es/_mapToArray.js +9 -0
  208. package/dist/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
  209. package/dist/node_modules/lodash-es/_memoizeCapped.js +11 -0
  210. package/dist/node_modules/lodash-es/_nativeCreate.js +5 -0
  211. package/dist/node_modules/lodash-es/_nativeKeys.js +5 -0
  212. package/dist/node_modules/lodash-es/_nodeUtil.js +11 -0
  213. package/dist/node_modules/lodash-es/_objectToString.js +7 -0
  214. package/dist/node_modules/lodash-es/_overArg.js +8 -0
  215. package/dist/node_modules/lodash-es/_root.js +5 -0
  216. package/dist/node_modules/lodash-es/_setCacheAdd.js +7 -0
  217. package/dist/node_modules/lodash-es/_setCacheHas.js +6 -0
  218. package/dist/node_modules/lodash-es/_setToArray.js +9 -0
  219. package/dist/node_modules/lodash-es/_stackClear.js +7 -0
  220. package/dist/node_modules/lodash-es/_stackDelete.js +7 -0
  221. package/dist/node_modules/lodash-es/_stackGet.js +6 -0
  222. package/dist/node_modules/lodash-es/_stackHas.js +6 -0
  223. package/dist/node_modules/lodash-es/_stackSet.js +17 -0
  224. package/dist/node_modules/lodash-es/_stringToPath.js +10 -0
  225. package/dist/node_modules/lodash-es/_toKey.js +10 -0
  226. package/dist/node_modules/lodash-es/_toSource.js +17 -0
  227. package/dist/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
  228. package/dist/node_modules/lodash-es/eq.js +6 -0
  229. package/dist/node_modules/lodash-es/flatMap.js +8 -0
  230. package/dist/node_modules/lodash-es/get.js +8 -0
  231. package/dist/node_modules/lodash-es/hasIn.js +8 -0
  232. package/dist/node_modules/lodash-es/identity.js +6 -0
  233. package/dist/node_modules/lodash-es/isArguments.js +10 -0
  234. package/dist/node_modules/lodash-es/isArray.js +4 -0
  235. package/dist/node_modules/lodash-es/isArrayLike.js +8 -0
  236. package/dist/node_modules/lodash-es/isBuffer.js +6 -0
  237. package/dist/node_modules/lodash-es/isFunction.js +12 -0
  238. package/dist/node_modules/lodash-es/isLength.js +7 -0
  239. package/dist/node_modules/lodash-es/isObject.js +7 -0
  240. package/dist/node_modules/lodash-es/isObjectLike.js +6 -0
  241. package/dist/node_modules/lodash-es/isSymbol.js +9 -0
  242. package/dist/node_modules/lodash-es/isTypedArray.js +7 -0
  243. package/dist/node_modules/lodash-es/keys.js +9 -0
  244. package/dist/node_modules/lodash-es/map.js +11 -0
  245. package/dist/node_modules/lodash-es/memoize.js +18 -0
  246. package/dist/node_modules/lodash-es/property.js +10 -0
  247. package/dist/node_modules/lodash-es/range.js +5 -0
  248. package/dist/node_modules/lodash-es/stubArray.js +6 -0
  249. package/dist/node_modules/lodash-es/stubFalse.js +6 -0
  250. package/dist/node_modules/lodash-es/toFinite.js +14 -0
  251. package/dist/node_modules/lodash-es/toNumber.js +22 -0
  252. package/dist/node_modules/lodash-es/toString.js +7 -0
  253. package/dist/node_modules/valibot/dist/index.js +126 -122
  254. package/dist/package.json.js +1 -1
  255. package/dist/services/recommendationApi.js +17 -14
  256. package/dist/services/templateLibraryApi.js +40 -38
  257. package/dist/src/@types/config/schemas.d.ts +4 -0
  258. package/dist/src/components/Guido.vue.d.ts +1 -1
  259. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +2 -0
  260. package/dist/src/components/organisms/header/AutoSaveToggle.vue.d.ts +2 -0
  261. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
  262. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
  263. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  264. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  265. package/dist/src/composables/useAutoSave.d.ts +3 -0
  266. package/dist/src/composables/useConfig.d.ts +2 -0
  267. package/dist/src/composables/useHtmlCompiler.d.ts +2 -1
  268. package/dist/src/composables/useRibbonOffset.d.ts +4 -0
  269. package/dist/src/composables/useSave.d.ts +1 -1
  270. package/dist/src/composables/useTranslations.d.ts +1 -1
  271. package/dist/src/enums/onboarding.d.ts +6 -0
  272. package/dist/src/enums/unsubscribe.d.ts +5 -0
  273. package/dist/src/stores/autosave.d.ts +12 -0
  274. package/dist/src/stores/config.d.ts +18 -0
  275. package/dist/src/stores/dynamic-content.d.ts +3 -3
  276. package/dist/src/stores/editor.d.ts +23 -0
  277. package/dist/src/stores/onboarding.d.ts +4 -0
  278. package/dist/src/utils/timeUtil.d.ts +8 -0
  279. package/dist/stores/autosave.js +17 -0
  280. package/dist/stores/config.js +81 -25
  281. package/dist/stores/dynamic-content.js +11 -6
  282. package/dist/stores/editor.js +3 -1
  283. package/dist/stores/onboarding.js +9 -5
  284. package/dist/stores/preview.js +9 -6
  285. package/dist/stores/unsubscribe.js +4 -1
  286. package/dist/utils/dateUtil.js +10 -7
  287. package/dist/utils/genericUtil.js +13 -10
  288. package/dist/utils/pairProductVariables.js +89 -87
  289. package/dist/utils/timeUtil.js +19 -0
  290. package/package.json +5 -8
@@ -1,6 +1,6 @@
1
- import l from "../extensions/ModulesTabIcons/extension.js";
2
- import { useConfigStore as r } from "../stores/config.js";
3
- const s = {
1
+ import r from "../extensions/ModulesTabIcons/extension.js";
2
+ import { useConfigStore as l } from "../stores/config.js";
3
+ const a = {
4
4
  "amp-accordion": "ampAccordionEnabled",
5
5
  "amp-carousel": "ampCarouselEnabled",
6
6
  "amp-form-controls": "ampFormControlsEnabled",
@@ -14,7 +14,7 @@ const s = {
14
14
  "text-block": "textEnabled",
15
15
  "timer-block": "timerEnabled",
16
16
  "video-block": "videoEnabled"
17
- }, a = {
17
+ }, s = {
18
18
  "dynamic-content": () => import("../extensions/DynamicContent/extension.js"),
19
19
  "checkbox-block": () => import("../extensions/Blocks/Checkbox/extension.js"),
20
20
  "radio-button-block": () => import("../extensions/Blocks/RadioButton/extension.js"),
@@ -22,40 +22,40 @@ const s = {
22
22
  "unsubscribe-block": () => import("../extensions/Blocks/Unsubscribe/extension.js"),
23
23
  "coupon-block": () => import("../extensions/Blocks/CouponBlock/extension.js"),
24
24
  "items-block": () => import("../extensions/Blocks/Items/extension.js")
25
- }, i = (o) => {
26
- if (!o || !o.length)
25
+ }, i = (n) => {
26
+ if (!n || !n.length)
27
27
  return {};
28
- const n = {};
29
- return o.forEach((t) => {
30
- const e = s[t];
31
- e && (n[e] = !1);
32
- }), n;
33
- }, b = () => [l], m = async (o) => {
34
- const n = b();
35
- if (!o || !o.length)
36
- return n;
37
- const t = await Promise.all(
38
- o.map(async (e) => {
39
- const c = a[e];
28
+ const t = {};
29
+ return n.forEach((o) => {
30
+ const e = a[o];
31
+ e && (t[e] = !1);
32
+ }), t;
33
+ }, b = () => [r], m = async (n) => {
34
+ const t = b();
35
+ if (!n || !n.length)
36
+ return t;
37
+ const o = await Promise.all(
38
+ n.map(async (e) => {
39
+ const c = s[e];
40
40
  return c ? (await c()).default : null;
41
41
  })
42
42
  );
43
43
  return [
44
- ...n,
45
- ...t.filter((e) => e !== null)
44
+ ...t,
45
+ ...o.filter((e) => e !== null)
46
46
  ];
47
- }, p = () => {
48
- const o = r();
47
+ }, E = () => {
48
+ const n = l();
49
49
  return {
50
50
  getStripoBlocksConfig: async () => {
51
- const t = o.blocks;
51
+ const o = n.blocks;
52
52
  return {
53
- baseBlocks: i(t?.excludeDefaults),
54
- extensions: await m(t?.includeCustoms)
53
+ baseBlocks: i(o == null ? void 0 : o.excludeDefaults),
54
+ extensions: await m(o == null ? void 0 : o.includeCustoms)
55
55
  };
56
56
  }
57
57
  };
58
58
  };
59
59
  export {
60
- p as useBlocksConfig
60
+ E as useBlocksConfig
61
61
  };
@@ -1,13 +1,14 @@
1
- const o = "https://email-static.useinsider.com/guido/guido-fs.js", c = () => ({ injectFullStory: () => {
2
- const e = window;
3
- if (typeof e._fs_org != "string" || !e._fs_org)
1
+ const c = "https://email-static.useinsider.com/guido/guido-fs.js", u = () => ({ injectFullStory: () => {
2
+ var n;
3
+ const s = window;
4
+ if (typeof s._fs_org != "string" || !s._fs_org)
4
5
  return;
5
- const r = document.querySelector("ui-editor")?.shadowRoot?.querySelector("iframe")?.contentDocument;
6
- if (!r || r.querySelector('script[data-fullstory-bridge="true"]'))
6
+ const r = document.querySelector("ui-editor"), o = (n = r == null ? void 0 : r.shadowRoot) == null ? void 0 : n.querySelector("iframe"), e = o == null ? void 0 : o.contentDocument;
7
+ if (!e || e.querySelector('script[data-fullstory-bridge="true"]'))
7
8
  return;
8
- const t = r.createElement("script");
9
- t.src = o, t.async = !0, t.crossOrigin = "anonymous", t.dataset.fullstoryBridge = "true", r.head.appendChild(t);
9
+ const t = e.createElement("script");
10
+ t.src = c, t.async = !0, t.crossOrigin = "anonymous", t.dataset.fullstoryBridge = "true", e.head.appendChild(t);
10
11
  } });
11
12
  export {
12
- c as useFullStoryBridge
13
+ u as useFullStoryBridge
13
14
  };
@@ -1,38 +1,30 @@
1
- import { defaultHtmlCompilerRules as n } from "../config/compiler/htmlCompilerRules.js";
2
- import { itemsCompilerRules as c } from "../config/compiler/itemsCompilerRules.js";
3
- import { liquidCompilerRules as p } from "../config/compiler/liquidCompilerRules.js";
4
- import { outlookCompilerRules as f } from "../config/compiler/outlookCompilerRules.js";
1
+ import { defaultHtmlCompilerRules as c } from "../config/compiler/htmlCompilerRules.js";
2
+ import { itemsCompilerRules as f } from "../config/compiler/itemsCompilerRules.js";
3
+ import { liquidCompilerRules as R } from "../config/compiler/liquidCompilerRules.js";
4
+ import { outlookCompilerRules as C } from "../config/compiler/outlookCompilerRules.js";
5
5
  import { recommendationCompilerRules as d } from "../config/compiler/recommendationCompilerRules.js";
6
- import { socialCompilerRules as R } from "../config/compiler/socialCompilerRules.js";
7
- import { unsubscribeCompilerRules as b } from "../config/compiler/unsubscribeCompilerRules.js";
8
- import { createHtmlCompiler as C } from "../utils/htmlCompiler.js";
9
- import { useConfig as F } from "./useConfig.js";
10
- let i = null, u, o = null;
11
- const g = (l) => !i || !o ? !0 : o.ignoreDefaultRules !== l.ignoreDefaultRules || o.liquidEnabled !== l.liquidEnabled || o.customRules !== l.customRules || o.fallbackFont !== l.fallbackFont, B = () => {
12
- const { compiler: l, isFeatureEnabled: m, partner: a } = F(), e = {
13
- ignoreDefaultRules: !!l.value?.ignoreDefaultRules,
14
- liquidEnabled: m("liquidSyntax"),
15
- customRules: l.value?.customRules,
16
- fallbackFont: a.value?.fallbackFont
17
- };
18
- if (g(e)) {
19
- const t = [
20
- ...e.ignoreDefaultRules ? [] : n,
21
- ...d,
22
- ...b,
23
- ...c,
24
- ...f,
25
- ...R,
26
- ...e.liquidEnabled ? p : [],
27
- ...(e.customRules ?? []).map((r, s) => ({
28
- ...r,
29
- priority: r.priority + 1e3 + s
30
- }))
31
- ];
32
- i = C(t), u = e.fallbackFont, o = e;
33
- }
34
- return { compileHtml: (t) => i.compile(t, void 0, u) };
6
+ import { socialCompilerRules as b } from "../config/compiler/socialCompilerRules.js";
7
+ import { unsubscribeCompilerRules as g } from "../config/compiler/unsubscribeCompilerRules.js";
8
+ import { createHtmlCompiler as H } from "../utils/htmlCompiler.js";
9
+ import { useConfig as v } from "./useConfig.js";
10
+ const w = () => {
11
+ var l, m, r;
12
+ const { compiler: e, isFeatureEnabled: t, partner: i } = v(), s = ((l = e.value) == null ? void 0 : l.customRules) || [], u = [
13
+ ...!!((m = e.value) != null && m.ignoreDefaultRules) ? [] : c,
14
+ ...d,
15
+ ...g,
16
+ ...f,
17
+ ...C,
18
+ ...b,
19
+ ...t("liquidSyntax") ? R : [],
20
+ ...s.map((o, a) => ({
21
+ ...o,
22
+ priority: o.priority + 1e3 + a
23
+ // Ensure additional rules run after default rules
24
+ }))
25
+ ], p = H(u), n = (r = i.value) == null ? void 0 : r.fallbackFont;
26
+ return { compileHtml: (o) => p.compile(o, void 0, n) };
35
27
  };
36
28
  export {
37
- B as useHtmlCompiler
29
+ w as useHtmlCompiler
38
30
  };
@@ -1,153 +1,161 @@
1
- import { useConfig as R } from "./useConfig.js";
2
- import { TemplateTypes as D } from "../enums/defaults.js";
3
- import { DISPLAY_CONDITIONS_REGEX as L, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as V, CampaignCouldNotBeSavedKey as _, CanNotMakeAnyChangesForRunningKey as H } from "../enums/html-validator.js";
4
- import { ToasterTypeOptions as r } from "../enums/toaster.js";
5
- import { itemsBlockDynamicVariables as P } from "../extensions/Blocks/Items/enums/productEnums.js";
6
- import { useRecommendationStore as G } from "../stores/recommendation.js";
7
- import { base64EncodeWithSpecialChars as M } from "../utils/base64.js";
8
- import { useHttp as $ } from "./useHttp.js";
9
- import { useToaster as X } from "./useToaster.js";
10
- import { useTranslations as j } from "./useTranslations.js";
11
- const q = /recommendation-id="(\d+)"/g;
12
- function z(i) {
13
- return [...i.matchAll(q)].map((u) => u[1]);
1
+ import { useConfig as L } from "./useConfig.js";
2
+ import { TemplateTypes as V } from "../enums/defaults.js";
3
+ import { DISPLAY_CONDITIONS_REGEX as _, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as H, CampaignCouldNotBeSavedKey as P, CanNotMakeAnyChangesForRunningKey as G } from "../enums/html-validator.js";
4
+ import { ToasterTypeOptions as c } from "../enums/toaster.js";
5
+ import { itemsBlockDynamicVariables as M } from "../extensions/Blocks/Items/enums/productEnums.js";
6
+ import { useRecommendationStore as $ } from "../stores/recommendation.js";
7
+ import { base64EncodeWithSpecialChars as X } from "../utils/base64.js";
8
+ import { useHttp as j } from "./useHttp.js";
9
+ import { useToaster as q } from "./useToaster.js";
10
+ import { useTranslations as z } from "./useTranslations.js";
11
+ const K = /recommendation-id="(\d+)"/g;
12
+ function U(a) {
13
+ return [...a.matchAll(K)].map((u) => u[1]);
14
14
  }
15
- function K(i, u) {
16
- return u.some((d) => i.startsWith(`${d}_`));
15
+ function Y(a, u) {
16
+ return u.some((d) => a.startsWith(`${d}_`));
17
17
  }
18
- const ae = () => {
19
- const { showToaster: i } = X(), { post: u } = $(), { config: d } = R(), a = j(), g = G(), p = d.value?.partner?.messageType === D.transactional, v = async (e) => {
18
+ const ce = () => {
19
+ var y, h;
20
+ const { showToaster: a } = q(), { post: u } = j(), { config: d } = L(), r = z(), g = $(), p = ((h = (y = d.value) == null ? void 0 : y.partner) == null ? void 0 : h.messageType) === V.transactional, b = async (e) => {
20
21
  const t = await u(
21
22
  "/newsletter/template-library/check-template-html-body",
22
- { html: M(e) }
23
- ), { status: n, message: c } = t.data;
24
- return n || i({
25
- type: r.Alert,
26
- message: n === void 0 ? c : a("newsletter.invalid-url-link-for-toaster")
27
- }), a(_), c === a(H) && i({
28
- type: r.Alert,
29
- message: a("newsletter.already-in-progress")
23
+ { html: X(e) }
24
+ ), { status: n, message: l } = t.data;
25
+ return n || a({
26
+ type: c.Alert,
27
+ message: n === void 0 ? l : r("newsletter.invalid-url-link-for-toaster")
28
+ }), r(P), l === r(G) && a({
29
+ type: c.Alert,
30
+ message: r("newsletter.already-in-progress")
30
31
  }), n;
31
- }, C = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), b = (e) => ["if", "endif"].includes(e.toLowerCase()), w = (e, s) => {
32
+ }, w = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), S = (e) => ["if", "endif"].includes(e.toLowerCase()), E = (e, s) => {
32
33
  const t = e.match(/({%(.*?)%})/g);
33
34
  let n = !0;
34
- return t !== null && !p && t.forEach((c) => {
35
- const o = c.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
35
+ return t !== null && !p && t.forEach((l) => {
36
+ const o = l.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
36
37
  if (o && o.length > 0) {
37
- const [l] = o;
38
- C(l) && !s.includes(l) && (i({
39
- type: r.Warning,
40
- message: a("custom-fields.invalid-custom-fields")
38
+ const [i] = o;
39
+ w(i) && !s.includes(i) && (a({
40
+ type: c.Warning,
41
+ message: r("custom-fields.invalid-custom-fields")
41
42
  }), n = !1);
42
43
  }
43
44
  }), n;
44
- }, S = async (e, s, t) => {
45
- const n = t ? await v(e) : !0;
46
- return w(e, s) && n;
47
- }, E = (e) => e.length > 0 ? !0 : (i({
48
- type: r.Warning,
49
- message: a("newsletter.html-content-is-empty")
50
- }), !1), A = (e) => {
45
+ }, A = async (e, s, t) => {
46
+ const n = t ? await b(e) : !0;
47
+ return E(e, s) && n;
48
+ }, I = (e) => e.length > 0 ? !0 : (a({
49
+ type: c.Warning,
50
+ message: r("newsletter.html-content-is-empty")
51
+ }), !1), k = (e) => {
51
52
  const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
52
- return s > t && i({
53
- type: r.Warning,
54
- message: a("custom-fields.missing-closing-braces")
55
- }), s < t && i({
56
- type: r.Warning,
57
- message: a("custom-fields.missing-opening-braces")
53
+ return s > t && a({
54
+ type: c.Warning,
55
+ message: r("custom-fields.missing-closing-braces")
56
+ }), s < t && a({
57
+ type: c.Warning,
58
+ message: r("custom-fields.missing-opening-braces")
58
59
  }), s === t;
59
- }, I = (e) => {
60
+ }, x = (e) => {
60
61
  const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
61
- return s || i({
62
- type: r.Warning,
63
- message: a("custom-fields.invalid-custom-fields")
62
+ return s || a({
63
+ type: c.Warning,
64
+ message: r("custom-fields.invalid-custom-fields")
64
65
  }), s;
65
- }, k = (e, s) => {
66
+ }, T = (e, s) => {
66
67
  const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
67
68
  if (t && !p) {
68
- const n = new Set(s.map((l) => l.toLowerCase())), c = z(e), o = [];
69
- if (t.forEach((l) => {
70
- const m = l.slice(2, -2).trim().toLowerCase();
71
- (!n.has(m) || m === "") && !K(m, c) && o.push(m);
69
+ const n = new Set(s.map((i) => i.toLowerCase())), l = U(e), o = [];
70
+ if (t.forEach((i) => {
71
+ const m = i.slice(2, -2).trim().toLowerCase();
72
+ (!n.has(m) || m === "") && !Y(m, l) && o.push(m);
72
73
  }), o.length > 0) {
73
- const l = `
74
+ const i = `
74
75
  <ul>
75
76
  ${o.map((m) => `<li>${m}</li>`).join("")}
76
77
  </ul>
77
78
  `;
78
- return i({
79
- type: r.Alert,
80
- message: a("custom-fields.invalid-custom-fields") + l
79
+ return a({
80
+ type: c.Alert,
81
+ message: r("custom-fields.invalid-custom-fields") + i
81
82
  }), !1;
82
83
  }
83
84
  }
84
85
  return !0;
85
- }, x = (e) => {
86
+ }, F = (e) => {
86
87
  const s = e.match(/{%(.*?)%}/g), t = [];
87
88
  let n = !0;
88
- if (s && s.forEach((c) => {
89
- const o = c.match(L), l = c.match(V), m = o?.join("") || "";
90
- (!o || c !== m) && !l && (i({
91
- type: r.Alert,
92
- message: a("newsletter.display-conditions-invalid-syntax")
89
+ if (s && s.forEach((l) => {
90
+ const o = l.match(_), i = l.match(H), m = (o == null ? void 0 : o.join("")) || "";
91
+ (!o || l !== m) && !i && (a({
92
+ type: c.Alert,
93
+ message: r("newsletter.display-conditions-invalid-syntax")
93
94
  }), n = !1), o && o.forEach((f) => {
94
- f.trim() === "=" && (i({
95
- type: r.Alert,
96
- message: a("custom-conditions.wrong-equality-operators")
95
+ f.trim() === "=" && (a({
96
+ type: c.Alert,
97
+ message: r("custom-conditions.wrong-equality-operators")
97
98
  }), n = !1);
98
- const y = f.match(/^[a-zA-Z]*$/g);
99
- y && y.forEach((h) => {
100
- b(h) && t.push(h);
99
+ const v = f.match(/^[a-zA-Z]*$/g);
100
+ v && v.forEach((C) => {
101
+ S(C) && t.push(C);
101
102
  });
102
103
  });
103
104
  }), t.length) {
104
- const c = t.filter((l) => l === "if"), o = t.filter((l) => l === "endif");
105
- c.length !== o.length && (i({
106
- type: r.Alert,
107
- message: a("custom-conditions.missing-if-endif-tag")
105
+ const l = t.filter((i) => i === "if"), o = t.filter((i) => i === "endif");
106
+ l.length !== o.length && (a({
107
+ type: c.Alert,
108
+ message: r("custom-conditions.missing-if-endif-tag")
108
109
  }), n = !1);
109
110
  }
110
111
  return n;
111
- }, T = (e) => {
112
+ }, W = (e) => {
112
113
  const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
113
- return n || i({
114
- type: r.Warning,
115
- message: a("custom-conditions.no-space-after-braces")
114
+ return n || a({
115
+ type: c.Warning,
116
+ message: r("custom-conditions.no-space-after-braces")
116
117
  }), n;
117
- }, F = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (i({
118
- type: r.Warning,
119
- message: a("custom-conditions.no-braces-inside-if-tag")
120
- }), !1) : !0, W = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (i({
121
- type: r.Alert,
122
- message: a("newsletter.fill-all-necessary-fields")
123
- }), !1) : !0, N = (e) => {
118
+ }, N = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (a({
119
+ type: c.Warning,
120
+ message: r("custom-conditions.no-braces-inside-if-tag")
121
+ }), !1) : !0, O = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (a({
122
+ type: c.Alert,
123
+ message: r("newsletter.fill-all-necessary-fields")
124
+ }), !1) : !0, B = (e) => {
124
125
  const s = /src="[^"]*\.(svg|pst)"/gm;
125
- return e.match(s) === null ? !0 : (i({
126
- type: r.Alert,
127
- message: a("newsletter.invalid-image-type")
126
+ return e.match(s) === null ? !0 : (a({
127
+ type: c.Alert,
128
+ message: r("newsletter.invalid-image-type")
128
129
  }), !1);
129
- }, O = (e) => {
130
+ }, R = (e) => {
130
131
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
131
- return Array.from(n).find((o) => !o.id?.trim()) ? (i({
132
- type: r.Alert,
133
- message: a("unsubscribe-templates.select-checkbox-groups")
132
+ return Array.from(n).find((o) => {
133
+ var i;
134
+ return !((i = o.id) != null && i.trim());
135
+ }) ? (a({
136
+ type: c.Alert,
137
+ message: r("unsubscribe-templates.select-checkbox-groups")
134
138
  }), !1) : !0;
135
- }, B = (e) => {
139
+ }, D = (e) => {
136
140
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
137
- return Array.from(n).find((o) => !o.id?.trim()) ? (i({
138
- type: r.Alert,
139
- message: a("unsubscribe-templates.select-radio-button-groups")
141
+ return Array.from(n).find((o) => {
142
+ var i;
143
+ return !((i = o.id) != null && i.trim());
144
+ }) ? (a({
145
+ type: c.Alert,
146
+ message: r("unsubscribe-templates.select-radio-button-groups")
140
147
  }), !1) : !0;
141
148
  };
142
149
  return { validateHtml: async (e, s, t = !1) => {
150
+ var o, i;
143
151
  const n = [
144
- ...s.map((o) => o.value),
145
- ...P,
146
- ...d.value?.template?.customFieldAttributes ?? []
152
+ ...s.map((m) => m.value),
153
+ ...M,
154
+ ...((i = (o = d.value) == null ? void 0 : o.template) == null ? void 0 : i.customFieldAttributes) ?? []
147
155
  ];
148
- return await S(e, n, t) && E(e) && A(e) && I(e) && k(e, n) && x(e) && T(e) && F(e) && W() && N(e) && O(e) && B(e);
156
+ return await A(e, n, t) && I(e) && k(e) && x(e) && T(e, n) && F(e) && W(e) && N(e) && O() && B(e) && R(e) && D(e);
149
157
  } };
150
158
  };
151
159
  export {
152
- ae as useHtmlValidator
160
+ ce as useHtmlValidator
153
161
  };
@@ -1,7 +1,7 @@
1
1
  import { getCsrfToken as H } from "../utils/genericUtil.js";
2
- import { ref as T, computed as h } from "vue";
3
- const k = (E = {}) => {
4
- const d = T(!1), n = T(null), l = T(null), b = h(() => d.value), g = h(() => n.value !== null), m = {
2
+ import { ref as p, computed as T } from "vue";
3
+ const k = (b = {}) => {
4
+ const h = p(!1), a = p(null), u = p(null), g = T(() => h.value), y = T(() => a.value !== null), v = {
5
5
  baseURL: "",
6
6
  timeout: 1e4,
7
7
  retry: 0,
@@ -10,11 +10,11 @@ const k = (E = {}) => {
10
10
  "Content-Type": "application/json",
11
11
  "X-CSRF-TOKEN": H()
12
12
  },
13
- ...E
13
+ ...b
14
14
  }, w = (e, s) => {
15
15
  if (e.startsWith("http://") || e.startsWith("https://"))
16
16
  return e;
17
- const t = s || m.baseURL || "";
17
+ const t = s || v.baseURL || "";
18
18
  return t.endsWith("/") && e.startsWith("/") ? `${t}${e.slice(1)}` : t.endsWith("/") || e.startsWith("/") ? `${t}${e}` : `${t}/${e}`;
19
19
  }, P = (e) => new Promise((s, t) => {
20
20
  setTimeout(() => {
@@ -23,53 +23,53 @@ const k = (E = {}) => {
23
23
  }), x = (e) => new Promise((s) => {
24
24
  setTimeout(s, e);
25
25
  }), i = async (e, s, t, D = {}) => {
26
- n.value = null, d.value = !0, l.value = new AbortController();
27
- const a = { ...m, ...D }, L = w(s, a.baseURL), u = {
26
+ a.value = null, h.value = !0, u.value = new AbortController();
27
+ const n = { ...v, ...D }, L = w(s, n.baseURL), c = {
28
28
  method: e,
29
- headers: { ...a.headers },
30
- signal: l.value.signal,
31
- ...a
29
+ headers: { ...n.headers },
30
+ signal: u.value.signal,
31
+ ...n
32
32
  };
33
- t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete u.headers["Content-Type"], u.body = t) : u.body = JSON.stringify(t));
34
- const y = async (p = 0) => {
33
+ t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete c.headers["Content-Type"], c.body = t) : c.body = JSON.stringify(t));
34
+ const E = async (m = 0) => {
35
35
  try {
36
- const o = [fetch(L, u)];
37
- a.timeout && o.push(P(a.timeout));
36
+ const o = [fetch(L, c)];
37
+ n.timeout && o.push(P(n.timeout));
38
38
  const r = await Promise.race(o);
39
39
  if (!r.ok) {
40
- const O = `HTTP Error: ${r.status} ${r.statusText}`, f = new Error(O);
41
- throw f.status = r.status, f.statusText = r.statusText, f.response = r, f;
40
+ const O = `HTTP Error: ${r.status} ${r.statusText}`, d = new Error(O);
41
+ throw d.status = r.status, d.statusText = r.statusText, d.response = r, d;
42
42
  }
43
- let c;
44
- const v = r.headers.get("content-type");
45
- return v?.includes("application/json") ? c = await r.json() : v?.includes("text/") ? c = await r.text() : c = await r.blob(), {
46
- data: c,
43
+ let f;
44
+ const l = r.headers.get("content-type");
45
+ return l != null && l.includes("application/json") ? f = await r.json() : l != null && l.includes("text/") ? f = await r.text() : f = await r.blob(), {
46
+ data: f,
47
47
  status: r.status,
48
48
  statusText: r.statusText,
49
49
  headers: r.headers
50
50
  };
51
51
  } catch (o) {
52
52
  const r = o instanceof Error && o.name === "AbortError";
53
- if (p < (a.retry || 0) && !r)
54
- return await x(a.retryDelay || 1e3), y(p + 1);
55
- throw o instanceof Error ? o.name === "AbortError" ? n.value = { message: "Request was cancelled" } : n.value = { message: o.message } : n.value = o, o;
53
+ if (m < (n.retry || 0) && !r)
54
+ return await x(n.retryDelay || 1e3), E(m + 1);
55
+ throw o instanceof Error ? o.name === "AbortError" ? a.value = { message: "Request was cancelled" } : a.value = { message: o.message } : a.value = o, o;
56
56
  }
57
57
  };
58
58
  try {
59
- return await y();
59
+ return await E();
60
60
  } finally {
61
- d.value = !1, l.value = null;
61
+ h.value = !1, u.value = null;
62
62
  }
63
63
  }, C = (e, s) => i("GET", e, void 0, s), $ = (e, s, t) => i("POST", e, s, t), R = (e, s, t) => i("PUT", e, s, t), U = (e, s, t) => i("PATCH", e, s, t), A = (e, s) => i("DELETE", e, void 0, s), W = (e) => {
64
- l.value && l.value.abort(e);
64
+ u.value && u.value.abort(e);
65
65
  }, q = () => {
66
- n.value = null;
66
+ a.value = null;
67
67
  };
68
68
  return {
69
69
  // State
70
- loading: b,
71
- error: h(() => n.value),
72
- hasError: g,
70
+ loading: g,
71
+ error: T(() => a.value),
72
+ hasError: y,
73
73
  // Methods
74
74
  request: i,
75
75
  get: C,
@@ -1,6 +1,6 @@
1
1
  import { useConfigStore as i } from "../stores/config.js";
2
- import { isTestPartner as o } from "../@types/config/defaults.js";
3
2
  import { ProductType as t } from "../@types/config/schemas.js";
3
+ import { isTestPartner as o } from "../@types/config/defaults.js";
4
4
  const T = () => {
5
5
  const e = i(), n = () => e.initialized && e.partnerName ? e.partnerName : window.location.hostname.split(".")[0] || "";
6
6
  return {
@@ -1,20 +1,20 @@
1
- import { RecommendationFeedSourceMaps as f, URLS as g } from "../enums/extensions/recommendationBlock.js";
2
- import { MinDeviceViewport as p, DefaultPadding as R } from "../enums/recommendation.js";
3
- import { useRecommendationExtensionStore as m } from "../extensions/Blocks/Recommendation/store/recommendation.js";
4
- import { generateCompleteFilterQuery as b } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
5
- import { useConfigStore as x } from "../stores/config.js";
6
- const P = () => ({
1
+ import { RecommendationFeedSourceMaps as g, URLS as p } from "../enums/extensions/recommendationBlock.js";
2
+ import { MinDeviceViewport as R, DefaultPadding as b } from "../enums/recommendation.js";
3
+ import { useRecommendationExtensionStore as u } from "../extensions/Blocks/Recommendation/store/recommendation.js";
4
+ import { generateCompleteFilterQuery as x } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
5
+ import { useConfigStore as I } from "../stores/config.js";
6
+ const N = () => ({
7
7
  calculateCardWidth: ({
8
8
  mobileLeftPadding: i,
9
9
  mobileRightPadding: n,
10
10
  cardsInRow: o,
11
11
  unresponsive: a
12
12
  }) => {
13
- const r = a ? o : 1, e = i + n + (r - 1) * R;
14
- return (p - e) / r;
13
+ const r = a ? o : 1, e = i + n + (r - 1) * b;
14
+ return (R - e) / r;
15
15
  },
16
16
  getRecommendationCampaignData: (i) => {
17
- const n = m(), o = Number(i), a = n.blockStates[o];
17
+ const n = u(), o = Number(i), a = n.blockStates[o];
18
18
  if (!a)
19
19
  return {
20
20
  textTrimming: !1,
@@ -43,17 +43,18 @@ const P = () => ({
43
43
  };
44
44
  },
45
45
  buildCampaignUrl: (i) => {
46
- const n = m(), o = x(), a = Number(i), r = n.blockStates[a];
46
+ var m;
47
+ const n = u(), o = I(), a = Number(i), r = n.blockStates[a];
47
48
  if (!r)
48
49
  return "";
49
- const { recommendationConfigs: e } = r, u = f.find((s) => s.key === e.strategy)?.path || "", t = new URLSearchParams();
50
+ const { recommendationConfigs: e } = r, l = ((m = g.find((s) => s.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
50
51
  t.set("locale", e.language), t.set("currency", e.currencySettings.value), t.set("partnerName", o.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", o.variationId), e.strategy === "manualMerchandising" ? t.set("productId", e.productIds.join(",")) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
51
- const l = e.filters.filter((s) => s.isValid), c = b(l);
52
+ const f = e.filters.filter((s) => s.isValid), c = x(f);
52
53
  c && t.set("filter", c), e.shuffleProducts && t.set("shuffle", "true");
53
- const d = `${g.RECOMMENDATION_API_URL}/v2/${u}?${t.toString()}`;
54
+ const d = `${p.RECOMMENDATION_API_URL}/v2/${l}?${t.toString()}`;
54
55
  return n.recommendationCampaignUrls[i] = d, d;
55
56
  }
56
57
  });
57
58
  export {
58
- P as useRecommendation
59
+ N as useRecommendation
59
60
  };
@@ -0,0 +1,21 @@
1
+ import { RIBBON_SELECTOR as r } from "../enums/onboarding.js";
2
+ import { ref as f, onMounted as c, onBeforeUnmount as i } from "vue";
3
+ const m = () => {
4
+ const o = f(0);
5
+ let e = null;
6
+ const n = () => {
7
+ const t = document.querySelector(r), s = (t == null ? void 0 : t.offsetHeight) ?? 0;
8
+ o.value !== s && (o.value = s);
9
+ }, u = (t) => `${t + o.value}px`;
10
+ return c(() => {
11
+ n(), e = new MutationObserver(n), e.observe(document.body, {
12
+ childList: !0,
13
+ subtree: !0
14
+ });
15
+ }), i(() => {
16
+ e == null || e.disconnect();
17
+ }), { ribbonOffset: o, getTopPosition: u };
18
+ };
19
+ export {
20
+ m as useRibbonOffset
21
+ };