@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,8 @@
1
- import { defineStore as n } from "pinia";
2
- import { parseConfig as t } from "../@types/config/validator.js";
3
- const a = n("guido-config", {
1
+ import "../@types/config/schemas.js";
2
+ import "../@types/config/defaults.js";
3
+ import { parseConfig as n } from "../@types/config/validator.js";
4
+ import { defineStore as o } from "pinia";
5
+ const s = o("guido-config", {
4
6
  state: () => ({
5
7
  initialized: !1,
6
8
  config: null
@@ -9,83 +11,137 @@ const a = n("guido-config", {
9
11
  /**
10
12
  * Get the identity configuration
11
13
  */
12
- identity: (e) => e.config?.identity ?? null,
14
+ identity: (i) => {
15
+ var e;
16
+ return ((e = i.config) == null ? void 0 : e.identity) ?? null;
17
+ },
13
18
  /**
14
19
  * Get the partner configuration
15
20
  */
16
- partner: (e) => e.config?.partner ?? null,
21
+ partner: (i) => {
22
+ var e;
23
+ return ((e = i.config) == null ? void 0 : e.partner) ?? null;
24
+ },
17
25
  /**
18
26
  * Get the template configuration
19
27
  */
20
- template: (e) => e.config?.template ?? null,
28
+ template: (i) => {
29
+ var e;
30
+ return ((e = i.config) == null ? void 0 : e.template) ?? null;
31
+ },
21
32
  /**
22
33
  * Get the editor configuration
23
34
  */
24
- editor: (e) => e.config?.editor ?? null,
35
+ editor: (i) => {
36
+ var e;
37
+ return ((e = i.config) == null ? void 0 : e.editor) ?? null;
38
+ },
25
39
  /**
26
40
  * Get the UI configuration
27
41
  */
28
- ui: (e) => e.config?.ui ?? null,
42
+ ui: (i) => {
43
+ var e;
44
+ return ((e = i.config) == null ? void 0 : e.ui) ?? null;
45
+ },
29
46
  /**
30
47
  * Get the features configuration
31
48
  */
32
- features: (e) => e.config?.features ?? null,
49
+ features: (i) => {
50
+ var e;
51
+ return ((e = i.config) == null ? void 0 : e.features) ?? null;
52
+ },
33
53
  /**
34
54
  * Get the blocks configuration
35
55
  */
36
- blocks: (e) => e.config?.blocks ?? null,
56
+ blocks: (i) => {
57
+ var e;
58
+ return ((e = i.config) == null ? void 0 : e.blocks) ?? null;
59
+ },
37
60
  /**
38
61
  * Get the compiler configuration
39
62
  */
40
- compiler: (e) => e.config?.compiler ?? null,
63
+ compiler: (i) => {
64
+ var e;
65
+ return ((e = i.config) == null ? void 0 : e.compiler) ?? null;
66
+ },
41
67
  /**
42
68
  * Get the callbacks configuration
43
69
  */
44
- callbacks: (e) => e.config?.callbacks ?? null,
70
+ callbacks: (i) => {
71
+ var e;
72
+ return ((e = i.config) == null ? void 0 : e.callbacks) ?? null;
73
+ },
45
74
  /**
46
75
  * Get the template ID
47
76
  */
48
- templateId: (e) => e.config?.identity.templateId ?? "",
77
+ templateId: (i) => {
78
+ var e;
79
+ return ((e = i.config) == null ? void 0 : e.identity.templateId) ?? "";
80
+ },
49
81
  /**
50
82
  * Get the user ID
51
83
  */
52
- userId: (e) => e.config?.identity.userId ?? "",
84
+ userId: (i) => {
85
+ var e;
86
+ return ((e = i.config) == null ? void 0 : e.identity.userId) ?? "";
87
+ },
53
88
  /**
54
89
  * Get the variation ID
55
90
  */
56
- variationId: (e) => e.config?.identity.variationId ?? "",
91
+ variationId: (i) => {
92
+ var e;
93
+ return ((e = i.config) == null ? void 0 : e.identity.variationId) ?? "";
94
+ },
57
95
  /**
58
96
  * Get the partner name
59
97
  */
60
- partnerName: (e) => e.config?.partner.name ?? "",
98
+ partnerName: (i) => {
99
+ var e;
100
+ return ((e = i.config) == null ? void 0 : e.partner.name) ?? "";
101
+ },
61
102
  /**
62
103
  * Get the product type
63
104
  */
64
- productType: (e) => e.config?.partner.productType ?? 60,
105
+ productType: (i) => {
106
+ var e;
107
+ return ((e = i.config) == null ? void 0 : e.partner.productType) ?? 60;
108
+ },
65
109
  /**
66
110
  * Get the message type
67
111
  */
68
- messageType: (e) => e.config?.partner.messageType ?? 1,
112
+ messageType: (i) => {
113
+ var e;
114
+ return ((e = i.config) == null ? void 0 : e.partner.messageType) ?? 1;
115
+ },
69
116
  /**
70
117
  * Get the username
71
118
  */
72
- username: (e) => e.config?.partner.username ?? "Guido User",
119
+ username: (i) => {
120
+ var e;
121
+ return ((e = i.config) == null ? void 0 : e.partner.username) ?? "Guido User";
122
+ },
73
123
  /**
74
124
  * Check if header should be shown
75
125
  */
76
- showHeader: (e) => e.config?.ui.showHeader ?? !0,
126
+ showHeader: (i) => {
127
+ var e;
128
+ return ((e = i.config) == null ? void 0 : e.ui.showHeader) ?? !0;
129
+ },
77
130
  /**
78
131
  * Check if a specific feature is enabled
79
132
  */
80
- isFeatureEnabled: (e) => (i) => e.config?.features[i] ?? !0
133
+ isFeatureEnabled: (i) => (e) => {
134
+ var t;
135
+ return ((t = i.config) == null ? void 0 : t.features[e]) ?? !0;
136
+ }
81
137
  },
82
138
  actions: {
83
139
  /**
84
140
  * Initialize the config store with validated configuration
85
141
  */
86
- init(e) {
87
- const i = t(e);
88
- this.config = i, this.initialized = !0;
142
+ init(i) {
143
+ const e = n(i);
144
+ this.config = e, this.initialized = !0;
89
145
  },
90
146
  /**
91
147
  * Reset the config store
@@ -96,5 +152,5 @@ const a = n("guido-config", {
96
152
  }
97
153
  });
98
154
  export {
99
- a as useConfigStore
155
+ s as useConfigStore
100
156
  };
@@ -1,17 +1,22 @@
1
- import { removeDuplicatesFromArray as t } from "../utils/arrayUtil.js";
2
- import { defineStore as n } from "pinia";
3
- const s = n("guidoDynamicContent", {
1
+ import { removeDuplicatesFromArray as n } from "../utils/arrayUtil.js";
2
+ import { defineStore as a } from "pinia";
3
+ const s = a("guidoDynamicContent", {
4
4
  state: () => ({
5
5
  selectedDynamicContent: { text: "", value: "" },
6
6
  selectedDynamicContentList: []
7
7
  }),
8
8
  actions: {
9
- setSelectedDynamicContent(e) {
10
- this.selectedDynamicContent = e, this.selectedDynamicContentList.push(e);
9
+ setSelectedDynamicContent(t) {
10
+ this.selectedDynamicContent = t, this.selectedDynamicContentList.push(t);
11
11
  }
12
12
  },
13
13
  getters: {
14
- getSelectedDynamicContentList: (e) => t(e.selectedDynamicContentList)
14
+ getSelectedDynamicContentList: (t) => n(t.selectedDynamicContentList).map((e) => ({
15
+ text: e.text,
16
+ value: e.value,
17
+ fallback: e.fallback,
18
+ format: e.format
19
+ })) || []
15
20
  }
16
21
  });
17
22
  export {
@@ -25,7 +25,9 @@ const o = e("guidoEditor", {
25
25
  isExportButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
26
26
  isSaveAsButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
27
27
  isTestButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
28
- isSaveButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen || i.isPreviewModeOpen
28
+ isSaveButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen || i.isPreviewModeOpen,
29
+ // Autosave
30
+ isInSaveableState: (i) => !i.loadingStatus && !i.isVersionHistoryOpen && !i.isPreviewModeOpen && !i.isCodeEditorOpen
29
31
  }
30
32
  });
31
33
  export {
@@ -1,5 +1,5 @@
1
1
  import { useOnboardingApi as r } from "../services/onboardingApi.js";
2
- import { defineStore as s } from "pinia";
2
+ import { defineStore as e } from "pinia";
3
3
  const t = () => ({
4
4
  cardIndex: 0,
5
5
  isActive: !1,
@@ -15,7 +15,7 @@ const t = () => ({
15
15
  },
16
16
  userModalState: {},
17
17
  isFetched: !1
18
- }), c = s("guidoOnboarding", {
18
+ }), c = e("guidoOnboarding", {
19
19
  state: () => a(),
20
20
  getters: {
21
21
  getOnboarding: (n) => (i) => n.onboardings[i],
@@ -46,7 +46,7 @@ const t = () => ({
46
46
  },
47
47
  shouldShowOnboarding: (n) => (i) => {
48
48
  const o = n.userModalState.Guido;
49
- return i === "newVersionPopup" && o?.genericOnboarding ? !1 : o ? !o[i] : !0;
49
+ return i === "newVersionPopup" && (o != null && o.genericOnboarding) ? !1 : o ? !o[i] : !0;
50
50
  }
51
51
  },
52
52
  actions: {
@@ -71,6 +71,10 @@ const t = () => ({
71
71
  previous(n) {
72
72
  this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
73
73
  },
74
+ updateCardPosition(n, i, o) {
75
+ const s = this.onboardings[n].config[i];
76
+ s && (s.top = o.top, s.position = o.position);
77
+ },
74
78
  setConfig(n, i) {
75
79
  this.onboardings[n].config = i ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
76
80
  },
@@ -93,8 +97,8 @@ const t = () => ({
93
97
  this.userModalState = i, this.isFetched = !0;
94
98
  },
95
99
  async setUserModalState(n, i, o) {
96
- const { setUserModalState: e } = r();
97
- await e(n, i, o), this.isFetched = !1, await this.fetchUserModalState();
100
+ const { setUserModalState: s } = r();
101
+ await s(n, i, o), this.isFetched = !1, await this.fetchUserModalState();
98
102
  }
99
103
  }
100
104
  });
@@ -1,5 +1,5 @@
1
- import { defineStore as r } from "pinia";
2
- const e = () => ({
1
+ import { defineStore as e } from "pinia";
2
+ const i = () => ({
3
3
  emailFormat: "html",
4
4
  ampHtml: "",
5
5
  ampErrors: [],
@@ -7,14 +7,17 @@ const e = () => ({
7
7
  isLoaded: !1,
8
8
  isAMPErrorModalVisible: !1,
9
9
  emailSizeKB: 0
10
- }), s = r("guidoPreview", {
11
- state: () => e(),
10
+ }), a = e("guidoPreview", {
11
+ state: () => i(),
12
12
  getters: {
13
13
  isAMPModeEnabled: (t) => t.emailFormat === "AMP",
14
14
  previewHtml() {
15
15
  return this.isAMPModeEnabled ? this.ampHtml : this.templateHtml;
16
16
  },
17
- hasAMP: (t) => !!t.ampHtml?.trim(),
17
+ hasAMP: (t) => {
18
+ var r;
19
+ return !!((r = t.ampHtml) != null && r.trim());
20
+ },
18
21
  hasAMPErrors: (t) => t.ampErrors.length > 0,
19
22
  showAMPErrorButton() {
20
23
  return this.isAMPModeEnabled && this.hasAMPErrors;
@@ -39,5 +42,5 @@ const e = () => ({
39
42
  }
40
43
  });
41
44
  export {
42
- s as usePreviewStore
45
+ a as usePreviewStore
43
46
  };
@@ -19,7 +19,10 @@ const r = () => ({
19
19
  getSelectedCollection: (e) => i[e.selectedCollectionType],
20
20
  getSelectedTemplateByActiveType: (e) => e.selectedTemplates[e.activeType],
21
21
  getTemplatesByActiveType: (e) => e.templates.filter((t) => t.type === e.activeType),
22
- getThumbnailByTemplateId: (e) => (t) => e.templates.find((l) => l.id === t)?.thumbnail ?? "",
22
+ getThumbnailByTemplateId: (e) => (t) => {
23
+ var l;
24
+ return ((l = e.templates.find((s) => s.id === t)) == null ? void 0 : l.thumbnail) ?? "";
25
+ },
23
26
  getSelectedUnsubscribePagesByCollection: (e) => (t) => {
24
27
  const l = i[t];
25
28
  if (!l)
@@ -1,8 +1,11 @@
1
1
  import { DEFAULT_LOCALE as r, DEFAULT as a, DEFAULT_TZ as c } from "../enums/date.js";
2
2
  const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length === 10 ? new Date(Number(t) * 1e3) : new Date(t) : typeof t == "number" ? t.toString().length === 10 ? new Date(t * 1e3) : new Date(t) : /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(), s = () => {
3
3
  const t = window.l10n;
4
- return t?.locale === a ? r : t?.locale || r;
5
- }, u = new Intl.DateTimeFormat().resolvedOptions().timeZone, f = () => window.l10n?.timezone || u || c, l = (t, e = s(), n = f()) => {
4
+ return (t == null ? void 0 : t.locale) === a ? r : (t == null ? void 0 : t.locale) || r;
5
+ }, u = new Intl.DateTimeFormat().resolvedOptions().timeZone, f = () => {
6
+ const t = window.l10n;
7
+ return (t == null ? void 0 : t.timezone) || u || c;
8
+ }, D = (t, e = s(), n = f()) => {
6
9
  const o = {
7
10
  year: "numeric",
8
11
  month: "2-digit",
@@ -10,7 +13,7 @@ const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length ===
10
13
  timeZone: n
11
14
  }, i = m(t);
12
15
  return new Intl.DateTimeFormat(e, o).format(i);
13
- }, D = (t) => {
16
+ }, T = (t) => {
14
17
  if (!t)
15
18
  return "";
16
19
  const e = new Date(t);
@@ -22,12 +25,12 @@ const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length ===
22
25
  second: "2-digit",
23
26
  hour12: !1
24
27
  }).format(e);
25
- }, T = (t) => t ? Math.floor(Date.now() / 1e3) >= t : !1;
28
+ }, h = (t) => t ? Math.floor(Date.now() / 1e3) >= t : !1;
26
29
  export {
27
30
  m as convertToDateObject,
28
- D as formatPatchDate,
29
- l as formatShortDate,
30
- T as isAfterDate,
31
+ T as formatPatchDate,
32
+ D as formatShortDate,
33
+ h as isAfterDate,
31
34
  u as localTz,
32
35
  s as locale,
33
36
  f as timezone
@@ -1,20 +1,20 @@
1
- const s = (c) => {
2
- const a = c.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((l) => l.trim()), [n] = a, e = {
3
- text: c.label,
1
+ const s = (e) => {
2
+ const a = e.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((l) => l.trim()), [n] = a, c = {
3
+ text: e.label,
4
4
  value: n || ""
5
5
  };
6
6
  if (a.length >= 2) {
7
7
  const [, l, r] = a;
8
8
  if (l.startsWith("default:")) {
9
9
  let t = l.slice(8).trim();
10
- t.startsWith('"') && t.endsWith('"') && (t = t.slice(1, -1)), e.fallback = t;
10
+ t.startsWith('"') && t.endsWith('"') && (t = t.slice(1, -1)), c.fallback = t;
11
11
  } else {
12
12
  const t = l.includes("=") ? { key: l.split("=")[0].trim(), value: l.split("=")[1].trim() } : null;
13
- t ? e.format = t : r || (e.fallback = l), r && (e.fallback = r);
13
+ t ? c.format = t : r || (c.fallback = l), r && (c.fallback = r);
14
14
  }
15
15
  }
16
- return e;
17
- }, u = (c, f = !1) => c.map((a) => {
16
+ return c;
17
+ }, u = (e, f = !1) => e.map((a) => {
18
18
  if (a.format)
19
19
  return {
20
20
  label: `${a.text} | ${a.format.key}=${a.format.value}`,
@@ -26,17 +26,20 @@ const s = (c) => {
26
26
  label: a.text,
27
27
  value: `{{ ${a.value} }}`
28
28
  };
29
- const e = !Number.isNaN(Number(a.fallback)) && a.fallback.trim() !== "" ? a.fallback : `"${a.fallback}"`;
29
+ const c = !Number.isNaN(Number(a.fallback)) && a.fallback.trim() !== "" ? a.fallback : `"${a.fallback}"`;
30
30
  return {
31
31
  label: `${a.text} | ${a.fallback}`,
32
- value: `{{ ${a.value} | default: ${e} }}`
32
+ value: `{{ ${a.value} | default: ${c} }}`
33
33
  };
34
34
  }
35
35
  return {
36
36
  label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
37
37
  value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
38
38
  };
39
- }), o = () => document.head.querySelector('meta[name="csrf-token"]')?.getAttribute("content") ?? "";
39
+ }), o = () => {
40
+ var e;
41
+ return ((e = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : e.getAttribute("content")) ?? "";
42
+ };
40
43
  export {
41
44
  u as dynamicContentToMergeTags,
42
45
  o as getCsrfToken,
@@ -1,83 +1,85 @@
1
- import { productPairs as M } from "../extensions/Blocks/Items/enums/productEnums.js";
2
- function D(k) {
3
- const R = k.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), $ = new DOMParser().parseFromString(R, "text/html"), y = M.PAIRS_FOR_EXTENSION;
4
- Object.entries(y).forEach(([n, l]) => {
5
- $.querySelectorAll(".ins-product-td").forEach((c) => {
6
- const E = c.getAttribute("data-number") || "1", T = c.getAttribute("data-type") || "CART_ITEMS";
7
- c.querySelectorAll(`[product-attr="${n}"]`).forEach((e) => {
8
- const b = e.getAttribute("data-type") || T, u = e.getAttribute("data-number") || E, p = l[b];
9
- if (p)
10
- switch (n) {
1
+ import { productPairs as L } from "../extensions/Blocks/Items/enums/productEnums.js";
2
+ function q(w) {
3
+ const y = w.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), T = new DOMParser().parseFromString(y, "text/html"), C = L.PAIRS_FOR_EXTENSION;
4
+ Object.entries(C).forEach(([r, f]) => {
5
+ T.querySelectorAll(".ins-product-td").forEach((o) => {
6
+ const A = o.getAttribute("data-number") || "1", b = o.getAttribute("data-type") || "CART_ITEMS";
7
+ o.querySelectorAll(`[product-attr="${r}"]`).forEach((e) => {
8
+ var k, F, I;
9
+ const $ = e.getAttribute("data-type") || b, d = e.getAttribute("data-number") || A, u = f[$];
10
+ if (u)
11
+ switch (r) {
11
12
  case "imageSrc": {
12
- let t = null, o = null;
13
- if (e.tagName === "IMG" ? (t = e, o = t.closest("a")) : (t = e.querySelector("img"), o = e.querySelector("a") || e.closest("a")), !t)
13
+ let t = null, i = null;
14
+ if (e.tagName === "IMG" ? (t = e, i = t.closest("a")) : (t = e.querySelector("img"), i = e.querySelector("a") || e.closest("a")), !t)
14
15
  break;
15
- const i = p.DEFAULT, a = p.ATTR;
16
- if (i && t.src) {
17
- const r = t.src;
18
- i.some((f) => {
19
- const s = f.split("/").pop() || "", _ = r.split("/").pop() || "";
20
- return r.includes(f) || r.includes(s) || _ === s;
21
- }) && (t.src = `{{${a}_${u}}}`);
16
+ const a = u.DEFAULT, s = u.ATTR;
17
+ if (a && t.src) {
18
+ const c = t.src;
19
+ a.some((h) => {
20
+ const l = h.split("/").pop() || "", g = c.split("/").pop() || "";
21
+ return c.includes(h) || c.includes(l) || g === l;
22
+ }) && (t.src = `{{${s}_${d}}}`);
22
23
  }
23
- if (o) {
24
- const r = y.itemLink?.[b];
25
- if (r) {
26
- const d = r.HREF, f = r.DEFAULT_HREF || "#!", s = o.href;
27
- (s === "#" || s === "" || s.endsWith("#!") || s.endsWith(f) || s === `${window.location.href}${f}` || !s || s === window.location.href) && (o.href = `{{${d}_${u}}}`);
24
+ const n = (F = (k = C.name) == null ? void 0 : k[$]) == null ? void 0 : F.ATTR;
25
+ if (n && t.setAttribute("alt", `{{${n}_${d}}}`), i) {
26
+ const c = (I = C.itemLink) == null ? void 0 : I[$];
27
+ if (c) {
28
+ const E = c.HREF, h = c.DEFAULT_HREF || "#!", l = i.href;
29
+ (l === "#" || l === "" || l.endsWith("#!") || l.endsWith(h) || l === `${window.location.href}${h}` || !l || l === window.location.href) && (i.href = `{{${E}_${d}}}`);
28
30
  }
29
31
  }
30
32
  break;
31
33
  }
32
34
  case "name": {
33
- const t = p, o = t.ATTR, i = t.DEFAULT_HREF || "#!", a = t.HREF;
34
- e.textContent && (e.textContent = `{{${o}_${u}}}`);
35
- const r = e.closest("a") || (e.tagName === "A" ? e : null);
36
- if (r && a) {
37
- const d = r.href, f = `${window.location.href}${i}`;
38
- (d === f || d.endsWith(i)) && (r.href = `{{${a}_${u}}}`);
35
+ const t = u, i = t.ATTR, a = t.DEFAULT_HREF || "#!", s = t.HREF;
36
+ e.textContent && (e.textContent = `{{${i}_${d}}}`);
37
+ const n = e.closest("a") || (e.tagName === "A" ? e : null);
38
+ if (n && s) {
39
+ const c = n.href, E = `${window.location.href}${a}`;
40
+ (c === E || c.endsWith(a)) && (n.href = `{{${s}_${d}}}`);
39
41
  }
40
42
  break;
41
43
  }
42
44
  case "price":
43
45
  case "originalPrice": {
44
- const t = p, o = e.getAttribute("data-formated"), i = e.getAttribute("data-single_price"), a = o === "true", r = i === "true", d = e.getAttribute("data-curency") || "before";
45
- let f;
46
- r ? f = a ? t.SINGLE_PRICE_FORMATTED : t.SINGLE_PRICE : f = a ? t.PRICE_FORMATTED : t.PRICE;
47
- const s = t.CURRENCY;
48
- let _ = `{{${f}_${u}}}`;
49
- if (s) {
50
- const H = `{{${s}_${u}}}`;
51
- _ = d === "after" ? `${_} ${H}` : `${H} ${_}`;
46
+ const t = u, i = e.getAttribute("data-formated"), a = e.getAttribute("data-single_price"), s = i === "true", n = a === "true", c = e.getAttribute("data-curency") || "before";
47
+ let E;
48
+ n ? E = s ? t.SINGLE_PRICE_FORMATTED : t.SINGLE_PRICE : E = s ? t.PRICE_FORMATTED : t.PRICE;
49
+ const h = t.CURRENCY;
50
+ let l = `{{${E}_${d}}}`;
51
+ if (h) {
52
+ const g = `{{${h}_${d}}}`;
53
+ l = c === "after" ? `${l} ${g}` : `${g} ${l}`;
52
54
  }
53
- e.textContent = _;
55
+ e.textContent = l;
54
56
  break;
55
57
  }
56
58
  case "quantity": {
57
- const t = p, o = t.ATTR, i = t.DEFAULT;
58
- e.textContent && e.textContent.trim() === i && (e.textContent = `{{${o}_${u}}}`);
59
+ const t = u, i = t.ATTR, a = t.DEFAULT;
60
+ e.textContent && e.textContent.trim() === a && (e.textContent = `{{${i}_${d}}}`);
59
61
  break;
60
62
  }
61
63
  case "button": {
62
- const t = p, o = t.HREF, i = t.DEFAULT_HREF || "#!", a = e.tagName === "A" ? e : e.querySelector("a");
63
- if (a) {
64
- const r = a.href || "", d = `${window.location.href}${i}`;
65
- (r === "" || r === "#" || r === d || r.endsWith(i) || r.endsWith("#!") || r === window.location.href) && (a.href = `{{${o}_${u}}}`);
64
+ const t = u, i = t.HREF, a = t.DEFAULT_HREF || "#!", s = e.tagName === "A" ? e : e.querySelector("a");
65
+ if (s) {
66
+ const n = s.href || "", c = `${window.location.href}${a}`;
67
+ (n === "" || n === "#" || n === c || n.endsWith(a) || n.endsWith("#!") || n === window.location.href) && (s.href = `{{${i}_${d}}}`);
66
68
  }
67
69
  break;
68
70
  }
69
71
  case "itemLink": {
70
- const t = p, o = t.HREF, i = t.DEFAULT_HREF || "#!", a = e;
71
- if (a.href) {
72
- const r = a.href, d = `${window.location.href}${i}`;
73
- (r === d || r.endsWith(i)) && (a.href = `{{${o}_${u}}}`);
72
+ const t = u, i = t.HREF, a = t.DEFAULT_HREF || "#!", s = e;
73
+ if (s.href) {
74
+ const n = s.href, c = `${window.location.href}${a}`;
75
+ (n === c || n.endsWith(a)) && (s.href = `{{${i}_${d}}}`);
74
76
  }
75
77
  break;
76
78
  }
77
79
  default: {
78
- if ("ATTR" in p) {
79
- const t = p.ATTR;
80
- e.textContent && (e.textContent = `{{${t}_${u}}}`);
80
+ if ("ATTR" in u) {
81
+ const t = u.ATTR;
82
+ e.textContent && (e.textContent = `{{${t}_${d}}}`);
81
83
  }
82
84
  break;
83
85
  }
@@ -85,55 +87,55 @@ function D(k) {
85
87
  });
86
88
  });
87
89
  });
88
- const S = R.match(/<!DOCTYPE[^>]*>/i), F = S ? `${S[0]}
89
- ` : "", I = $.querySelectorAll(".ins-product-td"), m = [];
90
- I.forEach((n) => {
91
- const l = n.getAttribute("data-type") || "CART_ITEMS", A = n.getAttribute("data-number") || "1", c = n.getAttribute("data-nodup"), E = n.outerHTML;
92
- m.push({
93
- element: n,
94
- outerHtml: E,
95
- type: l,
96
- number: A,
97
- nodup: c || void 0
90
+ const S = y.match(/<!DOCTYPE[^>]*>/i), M = S ? `${S[0]}
91
+ ` : "", P = T.querySelectorAll(".ins-product-td"), H = [];
92
+ P.forEach((r) => {
93
+ const f = r.getAttribute("data-type") || "CART_ITEMS", p = r.getAttribute("data-number") || "1", o = r.getAttribute("data-nodup"), A = r.outerHTML;
94
+ H.push({
95
+ element: r,
96
+ outerHtml: A,
97
+ type: f,
98
+ number: p,
99
+ nodup: o || void 0
98
100
  });
99
101
  });
100
- let h = F + $.documentElement.outerHTML;
101
- m.reverse().forEach(({ outerHtml: n, type: l, number: A }) => {
102
- let c = "";
103
- switch (l) {
102
+ let _ = M + T.documentElement.outerHTML;
103
+ H.reverse().forEach(({ outerHtml: r, type: f, number: p }) => {
104
+ let o = "";
105
+ switch (f) {
104
106
  case "CART_ITEMS":
105
- c = "ins_apr_total_product_kind";
107
+ o = "ins_apr_total_product_kind";
106
108
  break;
107
109
  case "BROWSED_ITEMS":
108
- c = "browsed_item_total_product_kind";
110
+ o = "browsed_item_total_product_kind";
109
111
  break;
110
112
  case "PURCHASED_ITEMS":
111
- c = "purchased_item_total_product_kind";
113
+ o = "purchased_item_total_product_kind";
112
114
  break;
113
115
  }
114
- if (c) {
115
- const T = parseInt(A) - 1, b = `${`{% if ${c} > ${T} %}`}${n}{% endif %}`;
116
- h = h.replace(n, b);
116
+ if (o) {
117
+ const b = parseInt(p) - 1, $ = `${`{% if ${o} > ${b} %}`}${r}{% endif %}`;
118
+ _ = _.replace(r, $);
117
119
  }
118
120
  });
119
- const w = $.querySelectorAll('[product-attr="originalPrice"][data-type="CART_ITEMS"]'), g = [];
120
- return w.forEach((n) => {
121
- const l = n.getAttribute("data-number"), A = n.getAttribute("data-type");
122
- if (!l || A !== "CART_ITEMS")
121
+ const D = T.querySelectorAll('[product-attr="originalPrice"][data-type="CART_ITEMS"]'), R = [];
122
+ return D.forEach((r) => {
123
+ const f = r.getAttribute("data-number"), p = r.getAttribute("data-type");
124
+ if (!f || p !== "CART_ITEMS")
123
125
  return;
124
- const c = n.closest(".product-original-price-class");
125
- if (c) {
126
- const E = c.outerHTML;
127
- g.some((C) => C.tdOuterHtml === E) || g.push({ tdOuterHtml: E, number: l });
126
+ const o = r.closest(".product-original-price-class");
127
+ if (o) {
128
+ const A = o.outerHTML;
129
+ R.some((m) => m.tdOuterHtml === A) || R.push({ tdOuterHtml: A, number: f });
128
130
  }
129
- }), g.reverse().forEach(({ tdOuterHtml: n, number: l }) => {
130
- const A = `{% if ins_apr_price_${l} != ins_apr_originalprice_${l} %}`;
131
- if (!h.includes(A) && !n.includes("{% if")) {
132
- const E = `${A}${n}{% endif %}`;
133
- h = h.replace(n, E);
131
+ }), R.reverse().forEach(({ tdOuterHtml: r, number: f }) => {
132
+ const p = `{% if ins_apr_price_${f} != ins_apr_originalprice_${f} %}`;
133
+ if (!_.includes(p) && !r.includes("{% if")) {
134
+ const A = `${p}${r}{% endif %}`;
135
+ _ = _.replace(r, A);
134
136
  }
135
- }), h.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
137
+ }), _.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
136
138
  }
137
139
  export {
138
- D as pairProductVariables
140
+ q as pairProductVariables
139
141
  };