@useinsider/guido 3.2.0-beta.e69fb3b → 3.2.0-beta.ecc7c6c

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 (231) hide show
  1. package/dist/@types/config/schemas.js +1 -1
  2. package/dist/@types/config/validator.js +34 -27
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +81 -76
  5. package/dist/components/organisms/base/Toaster.vue2.js +11 -10
  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 +15 -9
  9. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +40 -31
  10. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +20 -19
  11. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +14 -11
  12. package/dist/components/organisms/header/EditorActions.vue.js +12 -11
  13. package/dist/components/organisms/header/EditorActions.vue2.js +22 -18
  14. package/dist/components/organisms/header/HeaderWrapper.vue2.js +15 -12
  15. package/dist/components/organisms/header/LeftSlot.vue2.js +19 -16
  16. package/dist/components/organisms/header/MiddleSlot.vue2.js +11 -14
  17. package/dist/components/organisms/header/RightSlot.vue2.js +17 -14
  18. package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +12 -11
  19. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +26 -24
  20. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +12 -11
  21. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +44 -41
  22. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +12 -11
  23. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +38 -36
  24. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +21 -18
  25. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +31 -27
  26. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +12 -11
  27. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +32 -30
  28. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +12 -11
  29. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +23 -21
  30. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +9 -8
  31. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +10 -9
  32. package/dist/composables/useActionsApi.js +38 -37
  33. package/dist/composables/useBlocksConfig.js +26 -26
  34. package/dist/composables/useFullStoryBridge.js +9 -8
  35. package/dist/composables/useHtmlCompiler.js +26 -34
  36. package/dist/composables/useHtmlValidator.js +114 -101
  37. package/dist/composables/useHttp.js +30 -30
  38. package/dist/composables/usePartner.js +1 -1
  39. package/dist/composables/useRecommendation.js +15 -14
  40. package/dist/composables/useRibbonOffset.js +15 -15
  41. package/dist/composables/useSave.js +23 -19
  42. package/dist/composables/useStripo.js +48 -53
  43. package/dist/composables/useSyncModuleExtractor.js +29 -31
  44. package/dist/composables/useTimerClone.js +25 -24
  45. package/dist/composables/useTranslations.js +3 -2
  46. package/dist/composables/useValidation.js +8 -7
  47. package/dist/composables/validators/useCouponBlockValidator.js +24 -0
  48. package/dist/composables/validators/useLiquidValidator.js +13 -13
  49. package/dist/config/compiler/recommendationCompilerRules.js +27 -27
  50. package/dist/config/compiler/unsubscribeCompilerRules.js +19 -17
  51. package/dist/config/compiler/utils/recommendationCompilerUtils.js +11 -10
  52. package/dist/config/migrator/checkboxMigrator.js +21 -20
  53. package/dist/config/migrator/couponBlockMigrator.js +19 -18
  54. package/dist/config/migrator/itemsBlockMigrator.js +89 -87
  55. package/dist/config/migrator/radioButtonMigrator.js +63 -42
  56. package/dist/config/migrator/recommendationMigrator.js +109 -106
  57. package/dist/config/migrator/unsubscribeMigrator.js +11 -10
  58. package/dist/enums/unsubscribe.js +19 -18
  59. package/dist/extensions/Blocks/Items/block.js +9 -9
  60. package/dist/extensions/Blocks/Items/controls/button/link.js +14 -14
  61. package/dist/extensions/Blocks/Items/controls/cardComposition.js +97 -89
  62. package/dist/extensions/Blocks/Items/controls/image/link.js +14 -14
  63. package/dist/extensions/Blocks/Items/controls/name/trimming.js +24 -23
  64. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +14 -13
  65. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +47 -44
  66. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +38 -38
  67. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +11 -11
  68. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +40 -38
  69. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +35 -35
  70. package/dist/extensions/Blocks/Items/controls/settingsControl.js +162 -155
  71. package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
  72. package/dist/extensions/Blocks/Items/template.js +210 -210
  73. package/dist/extensions/Blocks/RadioButton/template.js +1 -1
  74. package/dist/extensions/Blocks/Recommendation/controls/button/index.js +36 -36
  75. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +133 -128
  76. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +9 -9
  77. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +10 -10
  78. package/dist/extensions/Blocks/Recommendation/controls/image/index.js +9 -9
  79. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +18 -17
  80. package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +6 -4
  81. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +90 -82
  82. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +18 -18
  83. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +4 -4
  84. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +36 -35
  85. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +135 -134
  86. package/dist/extensions/Blocks/Recommendation/controls/name/index.js +24 -24
  87. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +10 -10
  88. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +24 -24
  89. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +24 -24
  90. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +4 -4
  91. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +4 -4
  92. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +24 -24
  93. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +4 -4
  94. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +4 -4
  95. package/dist/extensions/Blocks/Recommendation/controls/price/index.js +24 -24
  96. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +32 -32
  97. package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +20 -18
  98. package/dist/extensions/Blocks/Recommendation/extension.js +32 -31
  99. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +16 -8
  100. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +64 -54
  101. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +23 -22
  102. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +10 -10
  103. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +10 -10
  104. package/dist/extensions/Blocks/Recommendation/templates/index.js +6 -6
  105. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +25 -24
  106. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +1 -1
  107. package/dist/extensions/Blocks/Recommendation/templates/utils.js +47 -45
  108. package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +16 -13
  109. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +33 -0
  110. package/dist/extensions/Blocks/Unsubscribe/control.js +13 -11
  111. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +18 -16
  112. package/dist/extensions/Blocks/common-control.js +26 -25
  113. package/dist/extensions/DynamicContent/dynamic-content.js +58 -53
  114. package/dist/guido.css +1 -1
  115. package/dist/library.js +12 -11
  116. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +234 -233
  117. package/dist/node_modules/lodash-es/_DataView.js +6 -0
  118. package/dist/node_modules/lodash-es/_Promise.js +6 -0
  119. package/dist/node_modules/lodash-es/_Set.js +6 -0
  120. package/dist/node_modules/lodash-es/_SetCache.js +13 -0
  121. package/dist/node_modules/lodash-es/_Stack.js +18 -0
  122. package/dist/node_modules/lodash-es/_Uint8Array.js +5 -0
  123. package/dist/node_modules/lodash-es/_WeakMap.js +6 -0
  124. package/dist/node_modules/lodash-es/_arrayFilter.js +10 -0
  125. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +20 -0
  126. package/dist/node_modules/lodash-es/_arrayMap.js +8 -0
  127. package/dist/node_modules/lodash-es/_arrayPush.js +8 -0
  128. package/dist/node_modules/lodash-es/_arraySome.js +9 -0
  129. package/dist/node_modules/lodash-es/_baseEach.js +6 -0
  130. package/dist/node_modules/lodash-es/_baseFlatten.js +13 -0
  131. package/dist/node_modules/lodash-es/_baseFor.js +5 -0
  132. package/dist/node_modules/lodash-es/_baseForOwn.js +8 -0
  133. package/dist/node_modules/lodash-es/_baseGet.js +11 -0
  134. package/dist/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  135. package/dist/node_modules/lodash-es/_baseHasIn.js +6 -0
  136. package/dist/node_modules/lodash-es/_baseIsArguments.js +9 -0
  137. package/dist/node_modules/lodash-es/_baseIsEqual.js +8 -0
  138. package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +32 -0
  139. package/dist/node_modules/lodash-es/_baseIsMatch.js +29 -0
  140. package/dist/node_modules/lodash-es/_baseIsTypedArray.js +12 -0
  141. package/dist/node_modules/lodash-es/_baseIteratee.js +11 -0
  142. package/dist/node_modules/lodash-es/_baseKeys.js +14 -0
  143. package/dist/node_modules/lodash-es/_baseMap.js +11 -0
  144. package/dist/node_modules/lodash-es/_baseMatches.js +12 -0
  145. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
  146. package/dist/node_modules/lodash-es/_baseProperty.js +8 -0
  147. package/dist/node_modules/lodash-es/_basePropertyDeep.js +9 -0
  148. package/dist/node_modules/lodash-es/_baseRange.js +9 -0
  149. package/dist/node_modules/lodash-es/_baseTimes.js +8 -0
  150. package/dist/node_modules/lodash-es/_baseToString.js +18 -0
  151. package/dist/node_modules/lodash-es/_baseTrim.js +8 -0
  152. package/dist/node_modules/lodash-es/_baseUnary.js +8 -0
  153. package/dist/node_modules/lodash-es/_cacheHas.js +6 -0
  154. package/dist/node_modules/lodash-es/_castPath.js +10 -0
  155. package/dist/node_modules/lodash-es/_createBaseEach.js +15 -0
  156. package/dist/node_modules/lodash-es/_createBaseFor.js +13 -0
  157. package/dist/node_modules/lodash-es/_createRange.js +11 -0
  158. package/dist/node_modules/lodash-es/_equalArrays.js +40 -0
  159. package/dist/node_modules/lodash-es/_equalByTag.js +45 -0
  160. package/dist/node_modules/lodash-es/_equalObjects.js +36 -0
  161. package/dist/node_modules/lodash-es/_getAllKeys.js +9 -0
  162. package/dist/node_modules/lodash-es/_getMatchData.js +12 -0
  163. package/dist/node_modules/lodash-es/_getSymbols.js +10 -0
  164. package/dist/node_modules/lodash-es/_getTag.js +28 -0
  165. package/dist/node_modules/lodash-es/_getValue.js +1 -1
  166. package/dist/node_modules/lodash-es/_hasPath.js +19 -0
  167. package/dist/node_modules/lodash-es/_isFlattenable.js +10 -0
  168. package/dist/node_modules/lodash-es/_isIndex.js +8 -0
  169. package/dist/node_modules/lodash-es/_isIterateeCall.js +13 -0
  170. package/dist/node_modules/lodash-es/_isKey.js +12 -0
  171. package/dist/node_modules/lodash-es/_isPrototype.js +8 -0
  172. package/dist/node_modules/lodash-es/_isStrictComparable.js +7 -0
  173. package/dist/node_modules/lodash-es/_mapToArray.js +9 -0
  174. package/dist/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
  175. package/dist/node_modules/lodash-es/_memoizeCapped.js +11 -0
  176. package/dist/node_modules/lodash-es/_nativeKeys.js +5 -0
  177. package/dist/node_modules/lodash-es/_nodeUtil.js +11 -0
  178. package/dist/node_modules/lodash-es/_overArg.js +8 -0
  179. package/dist/node_modules/lodash-es/_setCacheAdd.js +7 -0
  180. package/dist/node_modules/lodash-es/_setCacheHas.js +6 -0
  181. package/dist/node_modules/lodash-es/_setToArray.js +9 -0
  182. package/dist/node_modules/lodash-es/_stackClear.js +7 -0
  183. package/dist/node_modules/lodash-es/_stackDelete.js +7 -0
  184. package/dist/node_modules/lodash-es/_stackGet.js +6 -0
  185. package/dist/node_modules/lodash-es/_stackHas.js +6 -0
  186. package/dist/node_modules/lodash-es/_stackSet.js +17 -0
  187. package/dist/node_modules/lodash-es/_stringToPath.js +10 -0
  188. package/dist/node_modules/lodash-es/_toKey.js +10 -0
  189. package/dist/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
  190. package/dist/node_modules/lodash-es/flatMap.js +8 -0
  191. package/dist/node_modules/lodash-es/get.js +8 -0
  192. package/dist/node_modules/lodash-es/hasIn.js +8 -0
  193. package/dist/node_modules/lodash-es/identity.js +6 -0
  194. package/dist/node_modules/lodash-es/isArguments.js +10 -0
  195. package/dist/node_modules/lodash-es/isArray.js +4 -0
  196. package/dist/node_modules/lodash-es/isArrayLike.js +8 -0
  197. package/dist/node_modules/lodash-es/isBuffer.js +6 -0
  198. package/dist/node_modules/lodash-es/isLength.js +7 -0
  199. package/dist/node_modules/lodash-es/isObjectLike.js +6 -0
  200. package/dist/node_modules/lodash-es/isSymbol.js +9 -0
  201. package/dist/node_modules/lodash-es/isTypedArray.js +7 -0
  202. package/dist/node_modules/lodash-es/keys.js +9 -0
  203. package/dist/node_modules/lodash-es/map.js +11 -0
  204. package/dist/node_modules/lodash-es/property.js +10 -0
  205. package/dist/node_modules/lodash-es/range.js +5 -0
  206. package/dist/node_modules/lodash-es/stubArray.js +6 -0
  207. package/dist/node_modules/lodash-es/stubFalse.js +6 -0
  208. package/dist/node_modules/lodash-es/toFinite.js +14 -0
  209. package/dist/node_modules/lodash-es/toNumber.js +22 -0
  210. package/dist/node_modules/lodash-es/toString.js +7 -0
  211. package/dist/node_modules/valibot/dist/index.js +126 -122
  212. package/dist/services/recommendationApi.js +17 -14
  213. package/dist/services/templateLibraryApi.js +40 -38
  214. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  215. package/dist/src/composables/useHtmlCompiler.d.ts +2 -1
  216. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  217. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  218. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -1
  219. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +21 -0
  220. package/dist/src/stores/dynamic-content.d.ts +3 -3
  221. package/dist/stores/config.js +81 -25
  222. package/dist/stores/dynamic-content.js +11 -6
  223. package/dist/stores/onboarding.js +1 -1
  224. package/dist/stores/preview.js +9 -6
  225. package/dist/stores/unsubscribe.js +4 -1
  226. package/dist/utils/dateUtil.js +10 -7
  227. package/dist/utils/genericUtil.js +13 -10
  228. package/dist/utils/pairProductVariables.js +89 -87
  229. package/package.json +1 -6
  230. package/dist/enums/displayConditions.js +0 -80
  231. package/dist/src/enums/displayConditions.d.ts +0 -2
@@ -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
  };
@@ -1,21 +1,21 @@
1
- import { RIBBON_SELECTOR as u } from "../enums/onboarding.js";
2
- import { ref as i, onMounted as b, onBeforeUnmount as f } from "vue";
3
- const d = () => {
4
- const e = i(0);
5
- let o = null;
6
- const t = () => {
7
- const r = document.querySelector(u)?.offsetHeight ?? 0;
8
- e.value !== r && (e.value = r);
9
- }, s = (n) => `${n + e.value}px`;
10
- return b(() => {
11
- t(), o = new MutationObserver(t), o.observe(document.body, {
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
12
  childList: !0,
13
13
  subtree: !0
14
14
  });
15
- }), f(() => {
16
- o?.disconnect();
17
- }), { ribbonOffset: e, getTopPosition: s };
15
+ }), i(() => {
16
+ e == null || e.disconnect();
17
+ }), { ribbonOffset: o, getTopPosition: u };
18
18
  };
19
19
  export {
20
- d as useRibbonOffset
20
+ m as useRibbonOffset
21
21
  };
@@ -1,28 +1,32 @@
1
- import { useActionsApi as v } from "./useActionsApi.js";
2
- import { useConfig as S } from "./useConfig.js";
3
- import { useSaveStart as V, useSaveComplete as x } from "./useGuidoActions.js";
4
- import { useSyncModuleExtractor as y } from "./useSyncModuleExtractor.js";
5
- import { useStripoApi as w } from "../services/stripoApi.js";
1
+ import { useActionsApi as V } from "./useActionsApi.js";
2
+ import { useConfig as x } from "./useConfig.js";
3
+ import { useSaveStart as y, useSaveComplete as w } from "./useGuidoActions.js";
4
+ import { useSyncModuleExtractor as C } from "./useSyncModuleExtractor.js";
5
+ import { useStripoApi as H } from "../services/stripoApi.js";
6
6
  import { useTemplatePreparation as b } from "../utils/templatePreparation.js";
7
7
  import { useHtmlValidator as q } from "./useHtmlValidator.js";
8
- import { useLiquidValidator as H } from "./validators/useLiquidValidator.js";
9
- const k = () => {
10
- const e = V(), o = x(), { validateHtml: s } = q(), { validateLiquidSyntax: r } = H(), { callbacks: a, isFeatureEnabled: n } = S(), { extractSyncModuleData: l } = y(), { setSyncModuleUnsubscriptionPages: d } = w(), { editorSave: u } = v();
11
- return { save: async (c = !1) => {
12
- e();
13
- const { prepareTemplateDetails: m } = b(), t = await m();
14
- if (n("liquidSyntax")) {
15
- if (!await r(t.compiledHtml))
8
+ import { useCouponBlockValidator as L } from "./validators/useCouponBlockValidator.js";
9
+ import { useLiquidValidator as P } from "./validators/useLiquidValidator.js";
10
+ const h = () => {
11
+ const o = y(), s = w(), { validateHtml: r } = q(), { validateLiquidSyntax: l } = P(), { validateCouponBlockTags: n } = L(), { callbacks: a, isFeatureEnabled: d } = x(), { extractSyncModuleData: u } = C(), { setSyncModuleUnsubscriptionPages: c } = H(), { editorSave: m } = V();
12
+ return { save: async (p = !1) => {
13
+ var i;
14
+ o();
15
+ const { prepareTemplateDetails: f } = b(), t = await f();
16
+ if (!n(t.compiledHtml))
17
+ return;
18
+ if (d("liquidSyntax")) {
19
+ if (!await l(t.compiledHtml))
16
20
  return;
17
- } else if (!await s(t.compiledHtml, t.dynamicContentList, !0))
21
+ } else if (!await r(t.compiledHtml, t.dynamicContentList, !0))
18
22
  return;
19
- if (a.value?.externalValidation && !await a.value.externalValidation(t))
23
+ if ((i = a.value) != null && i.externalValidation && !await a.value.externalValidation(t))
20
24
  return;
21
- await u();
22
- const { unsubscribePayload: p, stripoModules: f } = l(t.rawHtml);
23
- return await d(p), t.modules = f, c || o(t), t;
25
+ await m();
26
+ const { unsubscribePayload: v, stripoModules: S } = u(t.rawHtml);
27
+ return await c(v), t.modules = S, p || s(t), t;
24
28
  } };
25
29
  };
26
30
  export {
27
- k as useSave
31
+ h as useSave
28
32
  };
@@ -1,27 +1,27 @@
1
- import { useActionsApi as v } from "./useActionsApi.js";
2
- import { useBlocksConfig as M } from "./useBlocksConfig.js";
3
- import { useConfig as A } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as D } from "./useCustomInterfaceAppearance.js";
5
- import { useFullStoryBridge as I } from "./useFullStoryBridge.js";
6
- import { useStripoEventHandler as P } from "./useStripoEventHandler.js";
7
- import { useToaster as U } from "./useToaster.js";
8
- import { localePatch as q } from "../config/i18n/index.js";
9
- import { displayConditions as R } from "../enums/displayConditions.js";
10
- import { useStripoApi as x } from "../services/stripoApi.js";
11
- import H from "../static/styles/customEditorStyle.css.js";
12
- import { useEditorStore as g } from "../stores/editor.js";
13
- import { dynamicContentToMergeTags as O } from "../utils/genericUtil.js";
14
- import j from "../package.json.js";
15
- const ne = (S, c) => {
16
- const { features: l, template: y, isFeatureEnabled: u } = A(), { handleError: m } = U(), { getToken: C, getCustomFonts: h, getSyncModulesStatus: E } = x(), { handleEvent: w } = P(), { getStripoBlocksConfig: b } = M(), k = async (i, n = [], r = !1) => {
17
- const e = g(), { html: p, css: d } = i, { baseBlocks: o, extensions: s } = await b(), f = l.value?.displayConditions ?? !0, T = l.value?.modulesDisabled ?? !1, V = y.value?.forceRecreate ?? !1;
1
+ import { useActionsApi as D } from "./useActionsApi.js";
2
+ import { useBlocksConfig as I } from "./useBlocksConfig.js";
3
+ import { useConfig as P } from "./useConfig.js";
4
+ import { useCustomInterfaceAppearance as U } from "./useCustomInterfaceAppearance.js";
5
+ import { useFullStoryBridge as R } from "./useFullStoryBridge.js";
6
+ import { useStripoEventHandler as q } from "./useStripoEventHandler.js";
7
+ import { useToaster as x } from "./useToaster.js";
8
+ import { localePatch as H } from "../config/i18n/index.js";
9
+ import { useStripoApi as O } from "../services/stripoApi.js";
10
+ import j from "../static/styles/customEditorStyle.css.js";
11
+ import { useEditorStore as E } from "../stores/editor.js";
12
+ import { dynamicContentToMergeTags as L } from "../utils/genericUtil.js";
13
+ import $ from "../package.json.js";
14
+ const se = (C, l) => {
15
+ const { features: c, template: h, isFeatureEnabled: u } = P(), { handleError: m } = x(), { getToken: w, getCustomFonts: b, getSyncModulesStatus: k } = O(), { handleEvent: B } = q(), { getStripoBlocksConfig: T } = I(), V = async (i, r = [], s = !1) => {
16
+ var g, S, y;
17
+ const e = E(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await T(), f = ((g = c.value) == null ? void 0 : g.displayConditions) ?? !0, F = ((S = c.value) == null ? void 0 : S.modulesDisabled) ?? !1, v = ((y = h.value) == null ? void 0 : y.forceRecreate) ?? !1;
18
18
  window.UIEditor.initEditor(
19
19
  document.querySelector("#guido-editor"),
20
20
  {
21
- metadata: S,
21
+ metadata: C,
22
22
  html: p,
23
- css: d,
24
- forceRecreate: V,
23
+ css: a,
24
+ forceRecreate: v,
25
25
  locale: "en",
26
26
  undoButtonSelector: "#guido__undo-button",
27
27
  redoButtonSelector: "#guido__redo-button",
@@ -31,13 +31,12 @@ const ne = (S, c) => {
31
31
  customAppearanceMergetags: !u("liquidSyntax"),
32
32
  customAppearanceMergetagsBorderColor: "#f1f3fe",
33
33
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
34
- customViewStyles: H,
34
+ customViewStyles: j,
35
35
  conditionsEnabled: f,
36
36
  customConditionsEnabled: f,
37
- conditionCategories: R,
38
37
  enableXSSSecurity: !0,
39
- modulesDisabled: T,
40
- syncModulesEnabled: r,
38
+ modulesDisabled: F,
39
+ syncModulesEnabled: s,
41
40
  messageSettingsEnabled: !0,
42
41
  displayGmailAnnotations: !0,
43
42
  displayHiddenPreheader: !1,
@@ -49,28 +48,28 @@ const ne = (S, c) => {
49
48
  editorFonts: {
50
49
  showDefaultStandardFonts: !0,
51
50
  showDefaultNotStandardFonts: !0,
52
- customFonts: n
51
+ customFonts: r
53
52
  },
54
53
  mergeTags: [
55
54
  {
56
- entries: O(
57
- c.preselectedDynamicContentList,
55
+ entries: L(
56
+ l.preselectedDynamicContentList,
58
57
  u("liquidSyntax")
59
58
  )
60
59
  }
61
60
  ],
62
61
  async onTokenRefreshRequest(t) {
63
62
  try {
64
- const a = await C();
65
- t(a);
66
- } catch (a) {
67
- m(a, "Failed to refresh token");
63
+ const n = await w();
64
+ t(n);
65
+ } catch (n) {
66
+ m(n, "Failed to refresh token");
68
67
  }
69
68
  },
70
69
  onTemplateLoaded() {
71
70
  try {
72
- const { importCss: t } = D(), { activateCustomViewStyles: a, updateTimerInClonedTemplate: _ } = v(), { injectFullStory: F } = I();
73
- t(), a(), F(), _(), c.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
71
+ const { importCss: t } = U(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: M } = D(), { injectFullStory: A } = R();
72
+ t(), n(), A(), M(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
74
73
  e.hasChanges = !1;
75
74
  }, 1e3);
76
75
  } catch (t) {
@@ -89,43 +88,39 @@ const ne = (S, c) => {
89
88
  onDataChanged() {
90
89
  e.hasChanges = !0;
91
90
  },
92
- onEvent: w,
91
+ onEvent: B,
93
92
  ignoreClickOutsideSelectors: [
94
93
  "#guido-dynamic-content-modal",
95
94
  ".in-on-board-wrapper",
96
95
  ".in-drawer__container"
97
96
  ],
98
- extensions: s,
99
- localePatch: q
97
+ extensions: d,
98
+ localePatch: H
100
99
  }
101
100
  );
102
- }, B = (i) => new Promise((n, r) => {
101
+ }, _ = (i) => new Promise((r, s) => {
102
+ var d;
103
103
  if (document.getElementById("UiEditorScript")) {
104
- i(), n();
104
+ i(), r();
105
105
  return;
106
106
  }
107
- const d = `https://email-static.useinsider.com/guido/${j.guido?.stripo?.version}/UIEditor.js`;
108
- if (!document.querySelector('link[href="https://email-static.useinsider.com"]')) {
109
- const s = document.createElement("link");
110
- s.rel = "preconnect", s.href = "https://email-static.useinsider.com", document.head.appendChild(s);
111
- }
112
- const o = document.createElement("script");
113
- o.id = "UiEditorScript", o.type = "module", o.src = d, o.onload = () => {
114
- i(), n();
107
+ const e = $.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, o = document.createElement("script");
108
+ o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
109
+ i(), r();
115
110
  }, o.onerror = () => {
116
- r(new Error(`Failed to load Stripo UIEditor script from S3: ${d}`));
111
+ s(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
117
112
  }, document.body.appendChild(o);
118
113
  });
119
114
  return { initPlugin: async (i) => {
120
- await B(async () => {
121
- const n = g(), [r, e] = await Promise.all([
122
- h(),
123
- E()
115
+ await _(async () => {
116
+ const r = E(), [s, e] = await Promise.all([
117
+ b(),
118
+ k()
124
119
  ]);
125
- n.syncModulesEnabled = e, await k(i, r, e);
120
+ r.syncModulesEnabled = e, await V(i, s, e);
126
121
  });
127
122
  } };
128
123
  };
129
124
  export {
130
- ne as useStripo
125
+ se as useStripo
131
126
  };
@@ -1,47 +1,45 @@
1
- import { UNSUBSCRIBE_SYNC_MODULE_TYPES as A } from "../enums/unsubscribe.js";
2
- import { DATA_ATTRIBUTES as E } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
3
- import { useEditorStore as _ } from "../stores/editor.js";
4
- const M = ".esd-synchronizable-module", g = '[esd-extension-block-id="unsubscribe-block"]', D = "esd-custom-block-id";
5
- let S = "", e = null;
6
- const I = (t) => (t === S && e || (e = new DOMParser().parseFromString(t, "text/html"), S = t), e), L = () => {
7
- const t = _();
8
- return { extractSyncModuleData: (m) => {
9
- const f = {
1
+ import { UNSUBSCRIBE_SYNC_MODULE_TYPES as T } from "../enums/unsubscribe.js";
2
+ import { DATA_ATTRIBUTES as p } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
3
+ import { useEditorStore as f } from "../stores/editor.js";
4
+ const y = ".esd-synchronizable-module", A = '[esd-extension-block-id="unsubscribe-block"]', _ = "esd-custom-block-id", B = () => {
5
+ const d = f();
6
+ return { extractSyncModuleData: (E) => {
7
+ const S = {
10
8
  unsubscribePayload: [],
11
9
  stripoModules: []
12
10
  };
13
- if (!t.syncModulesEnabled)
14
- return f;
15
- const T = I(m).querySelectorAll(M), o = [], n = [];
16
- return T.forEach((c) => {
17
- const r = c.getAttribute(D);
18
- if (!r)
11
+ if (!d.syncModulesEnabled)
12
+ return S;
13
+ const b = new DOMParser().parseFromString(E, "text/html").querySelectorAll(y), r = [], s = [];
14
+ return b.forEach((o) => {
15
+ const t = o.getAttribute(_);
16
+ if (!t)
19
17
  return;
20
- const u = c.querySelectorAll(g);
21
- if (u.length === 0) {
22
- n.push(Number(r));
18
+ const n = o.querySelectorAll(A);
19
+ if (n.length === 0) {
20
+ s.push(Number(t));
23
21
  return;
24
22
  }
25
- u.forEach((i) => {
26
- const l = i.getAttribute(E.PAGE_LIST), a = i.getAttribute(E.PAGE_TYPE);
27
- if (!l || !a)
23
+ n.forEach((c) => {
24
+ const u = c.getAttribute(p.PAGE_LIST), i = c.getAttribute(p.PAGE_TYPE);
25
+ if (!u || !i)
28
26
  return;
29
- const y = parseInt(a), p = A[y];
30
- if (!p)
27
+ const m = parseInt(i), a = T[m];
28
+ if (!a)
31
29
  return;
32
- const d = l.split(",").map((s) => parseInt(s.trim())).filter((s) => !Number.isNaN(s));
33
- d.length !== 0 && o.push({
34
- stripoModuleId: r,
35
- unsubscriptionPreferencePages: d,
36
- type: p
30
+ const l = u.split(",").map((e) => parseInt(e.trim())).filter((e) => !Number.isNaN(e));
31
+ l.length !== 0 && r.push({
32
+ stripoModuleId: t,
33
+ unsubscriptionPreferencePages: l,
34
+ type: a
37
35
  });
38
36
  });
39
37
  }), {
40
- unsubscribePayload: o,
41
- stripoModules: n
38
+ unsubscribePayload: r,
39
+ stripoModules: s
42
40
  };
43
41
  } };
44
42
  };
45
43
  export {
46
- L as useSyncModuleExtractor
44
+ B as useSyncModuleExtractor
47
45
  };
@@ -1,11 +1,11 @@
1
- import { useActionsApi as d } from "./useActionsApi.js";
2
- import { useHttp as l } from "./useHttp.js";
3
- import { useToaster as T } from "./useToaster.js";
4
- import { useStripoApi as f } from "../services/stripoApi.js";
5
- const C = () => {
6
- const { handleError: i } = T(), { getToken: c } = f(), { post: m } = l(), { updateHtmlAndCss: p } = d(), n = (t) => /esd-timer-id="(\d+)"/.test(t), o = async (t, e) => {
1
+ import { useActionsApi as f } from "./useActionsApi.js";
2
+ import { useHttp as w } from "./useHttp.js";
3
+ import { useToaster as H } from "./useToaster.js";
4
+ import { useStripoApi as y } from "../services/stripoApi.js";
5
+ const O = () => {
6
+ const { handleError: c } = H(), { getToken: u } = y(), { post: d } = w(), { updateHtmlAndCss: l } = f(), s = (t) => /esd-timer-id="(\d+)"/.test(t), i = async (t, e) => {
7
7
  try {
8
- return (await m(
8
+ return (await d(
9
9
  "https://plugins.stripo.email/api/v1/timers/clone",
10
10
  { html: t },
11
11
  {
@@ -16,37 +16,38 @@ const C = () => {
16
16
  }
17
17
  )).data.html;
18
18
  } catch (r) {
19
- return i(r, "Failed to clone timer IDs"), null;
19
+ return c(r, "Failed to clone timer IDs"), null;
20
20
  }
21
21
  };
22
22
  return {
23
- hasTimerBlocks: n,
24
- cloneTimersInHtml: o,
23
+ hasTimerBlocks: s,
24
+ cloneTimersInHtml: i,
25
25
  cloneTimersOnSave: async (t) => {
26
- if (!n(t))
26
+ if (!s(t))
27
27
  return t;
28
- const e = await c();
29
- return e && await o(t, e) || t;
28
+ const e = await u();
29
+ return e && await i(t, e) || t;
30
30
  },
31
31
  updateTimersOnLoad: async (t) => {
32
+ var e, r, o, m;
32
33
  try {
33
- const e = window.UIEditor?.getHtml?.();
34
- if (!e || !n(e))
34
+ const n = (r = (e = window.UIEditor) == null ? void 0 : e.getHtml) == null ? void 0 : r.call(e);
35
+ if (!n || !s(n))
35
36
  return;
36
- const a = await t();
37
- if (!a)
37
+ const p = await t();
38
+ if (!p)
38
39
  return;
39
- const s = await o(e, a);
40
- if (!s || s === e)
40
+ const a = await i(n, p);
41
+ if (!a || a === n)
41
42
  return;
42
- const u = window.UIEditor?.getCss?.() || "";
43
- p(s, u);
44
- } catch (e) {
45
- i(e, "Failed to update timer blocks");
43
+ const T = ((m = (o = window.UIEditor) == null ? void 0 : o.getCss) == null ? void 0 : m.call(o)) || "";
44
+ l(a, T);
45
+ } catch (n) {
46
+ c(n, "Failed to update timer blocks");
46
47
  }
47
48
  }
48
49
  };
49
50
  };
50
51
  export {
51
- C as useTimerClone
52
+ O as useTimerClone
52
53
  };
@@ -2,10 +2,11 @@ import memoize from "../node_modules/lodash-es/memoize.js";
2
2
  import { ref } from "vue";
3
3
  import { useConfig } from "./useConfig.js";
4
4
  const useTranslations = () => {
5
- const { config } = useConfig(), translationsPath = config.value?.editor?.translationsPath || "window.trans.en", translations = ref(eval(translationsPath)), trans = (n, t) => {
5
+ var o, e;
6
+ const { config } = useConfig(), translationsPath = ((e = (o = config.value) == null ? void 0 : o.editor) == null ? void 0 : e.translationsPath) || "window.trans.en", translations = ref(eval(translationsPath)), trans = (n, t) => {
6
7
  const r = translations.value[n];
7
8
  return r ? t ? Object.entries(t).reduce(
8
- (o, [e, s]) => o.replace(new RegExp(`{${e}}`, "g"), String(s)),
9
+ (s, [i, a]) => s.replace(new RegExp(`{${i}}`, "g"), String(a)),
9
10
  r
10
11
  ) : r : (console.warn(`Translation key not found: ${n}`), n);
11
12
  };
@@ -1,18 +1,19 @@
1
- import { safeParseAsync as t } from "../node_modules/valibot/dist/index.js";
2
- import { unref as a } from "vue";
3
- function n(s, e) {
1
+ import { safeParseAsync as i } from "../node_modules/valibot/dist/index.js";
2
+ import { unref as n } from "vue";
3
+ function c(o, e) {
4
4
  return {
5
5
  schema: e,
6
6
  validate: async () => {
7
- const r = await t(e, a(s), { abortPipeEarly: !0 });
7
+ var s, t, a;
8
+ const r = await i(e, n(o), { abortPipeEarly: !0 });
8
9
  return {
9
10
  ...r,
10
- error: r.issues?.[0],
11
- errorMessage: r.issues?.[0]?.message || ""
11
+ error: (s = r.issues) == null ? void 0 : s[0],
12
+ errorMessage: ((a = (t = r.issues) == null ? void 0 : t[0]) == null ? void 0 : a.message) || ""
12
13
  };
13
14
  }
14
15
  };
15
16
  }
16
17
  export {
17
- n as useAsyncValidation
18
+ c as useAsyncValidation
18
19
  };