@useinsider/guido 3.18.1-beta.5b53256 → 3.18.1-beta.5d9295b

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.
@@ -1,64 +1,64 @@
1
- import { defineComponent as _, ref as c, computed as h, watch as C, toRef as N, nextTick as O } from "vue";
2
- import b from "../../wrappers/WpDrawer.vue.js";
3
- import { useTranslations as D } from "../../../composables/useTranslations.js";
1
+ import { defineComponent as A, ref as c, computed as b, toRef as h, nextTick as C } from "vue";
2
+ import N from "../../wrappers/WpDrawer.vue.js";
3
+ import { useTranslations as O } from "../../../composables/useTranslations.js";
4
4
  import { useTemplateNameValidator as x } from "../../../composables/validators/saveAsTemplate.js";
5
5
  import { useTemplateLibraryApi as B } from "../../../services/templateLibraryApi.js";
6
- import { useEditorStore as k } from "../../../stores/editor.js";
7
- import { useSaveAsTemplateStore as I } from "../../../stores/save-as-template.js";
8
- import { InMultiSelect as M, InBasicTextInput as V } from "@useinsider/design-system-vue";
9
- import { useDebounceFn as E } from "../../../node_modules/@vueuse/shared/index.js";
10
- const J = /* @__PURE__ */ _({
6
+ import { useEditorStore as D } from "../../../stores/editor.js";
7
+ import { useSaveAsTemplateStore as k } from "../../../stores/save-as-template.js";
8
+ import { InMultiSelect as I, InBasicTextInput as M } from "@useinsider/design-system-vue";
9
+ import { useDebounceFn as V } from "../../../node_modules/@vueuse/shared/index.js";
10
+ const H = /* @__PURE__ */ A({
11
11
  __name: "SaveAsTemplateDrawer",
12
- setup(R) {
13
- const s = D(), o = k(), t = I(), { createTemplate: m } = B(), a = c(!1), n = c(!1), r = c(""), f = h(() => ({
12
+ setup(E) {
13
+ const o = O(), n = D(), t = k(), { createTemplate: m } = B(), a = c(!1), r = c(!1), l = c(""), f = b(() => ({
14
14
  primaryButton: {
15
15
  styling: "solid",
16
16
  type: "primary",
17
- labelText: s(a.value ? "newsletter.saving" : "products.save"),
17
+ labelText: o(a.value ? "newsletter.saving" : "products.save"),
18
18
  loadingStatus: a.value,
19
19
  disabledStatus: t.skeletonStatus
20
20
  },
21
21
  cancelOrBackButton: {
22
22
  styling: "ghost",
23
23
  type: "secondary",
24
- labelText: s("products.cancel"),
24
+ labelText: o("products.cancel"),
25
25
  disabledStatus: a.value
26
26
  }
27
- })), p = () => {
28
- r.value = "", o.isSaveAsTemplateDrawerOpen = !1;
29
- }, l = async () => {
30
- const e = N(t, "templateName"), { success: i, errorMessage: A } = await x(e).validate();
31
- return r.value = A, i;
32
- }, v = E(async (e) => {
33
- t.templateName = e, await l();
34
- }, 500), S = async (e) => {
35
- n.value = !0, await t.addCategory(e), n.value = !1;
36
- }, T = (e) => {
27
+ })), u = () => {
28
+ l.value = "", n.isSaveAsTemplateDrawerOpen = !1;
29
+ }, i = async () => {
30
+ const e = h(t, "templateName"), { success: s, errorMessage: _ } = await x(e).validate();
31
+ return l.value = _, s;
32
+ }, v = V(async (e) => {
33
+ t.templateName = e, await i();
34
+ }, 500), g = async (e) => {
35
+ r.value = !0, await t.addCategory(e), r.value = !1;
36
+ }, y = (e) => {
37
37
  t.selectedCategories = e;
38
- }, g = (e) => {
38
+ }, S = (e) => {
39
39
  e && (t.selectedCategories = e);
40
- }, y = () => {
40
+ }, T = () => {
41
41
  t.selectedCategories = [];
42
42
  }, w = async () => {
43
- if (a.value = !0, !await l()) {
43
+ if (a.value = !0, !await i()) {
44
44
  a.value = !1;
45
45
  return;
46
46
  }
47
- const i = await m();
48
- a.value = !1, i && p();
49
- }, u = () => {
50
- O(() => {
47
+ const s = await m();
48
+ a.value = !1, s && u();
49
+ }, p = () => {
50
+ C(() => {
51
51
  const e = document.querySelector("input#guido__template-name-input");
52
52
  e == null || e.focus();
53
53
  });
54
54
  }, d = async () => {
55
- t.$reset(), await t.fetchCategories(), t.skeletonStatus = !1, u();
55
+ t.$reset(), await t.fetchCategories(), t.skeletonStatus = !1, p();
56
56
  };
57
- return C(() => o.isSaveAsTemplateDrawerOpen, (e) => {
58
- e && d();
59
- }), { __sfc: !0, trans: s, editorStore: o, saveAsTemplateStore: t, createTemplate: m, isSaving: a, isAddingOption: n, templateNameError: r, footerButtonGroupOptions: f, closeModal: p, validateTemplateName: l, handleTemplateName: v, handleAddOption: S, handleCategoryChange: T, handleSelectAllOptions: g, handleResetAllOptions: y, saveTemplate: w, focusToInput: u, initializeDrawer: d, WpDrawer: b, InBasicTextInput: V, InMultiSelect: M };
57
+ return n.$subscribe((e, { isSaveAsTemplateDrawerOpen: s }) => {
58
+ s && d();
59
+ }), { __sfc: !0, trans: o, editorStore: n, saveAsTemplateStore: t, createTemplate: m, isSaving: a, isAddingOption: r, templateNameError: l, footerButtonGroupOptions: f, closeModal: u, validateTemplateName: i, handleTemplateName: v, handleAddOption: g, handleCategoryChange: y, handleSelectAllOptions: S, handleResetAllOptions: T, saveTemplate: w, focusToInput: p, initializeDrawer: d, WpDrawer: N, InBasicTextInput: M, InMultiSelect: I };
60
60
  }
61
61
  });
62
62
  export {
63
- J as default
63
+ H as default
64
64
  };
@@ -1,16 +1,14 @@
1
- import { getCsrfToken as O } from "../utils/genericUtil.js";
2
- import { ref as m, computed as T } from "vue";
3
- const X = (b = {}) => {
4
- const p = m(!1), a = m(null), u = m(null), g = T(() => p.value), y = T(() => a.value !== null), v = {
1
+ import { getCsrfToken as H } from "../utils/genericUtil.js";
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,
8
8
  retryDelay: 1e3,
9
9
  headers: {
10
10
  "Content-Type": "application/json",
11
- "X-CSRF-TOKEN": O(),
12
- Accept: "application/json",
13
- "X-Requested-With": "XMLHttpRequest"
11
+ "X-CSRF-TOKEN": H()
14
12
  },
15
13
  ...b
16
14
  }, w = (e, s) => {
@@ -24,22 +22,22 @@ const X = (b = {}) => {
24
22
  }, e);
25
23
  }), x = (e) => new Promise((s) => {
26
24
  setTimeout(s, e);
27
- }), i = async (e, s, t, L = {}) => {
28
- a.value = null, p.value = !0, u.value = new AbortController();
29
- const n = { ...v, ...L }, D = w(s, n.baseURL), c = {
25
+ }), i = async (e, s, t, D = {}) => {
26
+ a.value = null, h.value = !0, u.value = new AbortController();
27
+ const n = { ...v, ...D }, L = w(s, n.baseURL), c = {
30
28
  method: e,
31
29
  headers: { ...n.headers },
32
30
  signal: u.value.signal,
33
31
  ...n
34
32
  };
35
33
  t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete c.headers["Content-Type"], c.body = t) : c.body = JSON.stringify(t));
36
- const E = async (h = 0) => {
34
+ const E = async (m = 0) => {
37
35
  try {
38
- const o = [fetch(D, c)];
36
+ const o = [fetch(L, c)];
39
37
  n.timeout && o.push(P(n.timeout));
40
38
  const r = await Promise.race(o);
41
39
  if (!r.ok) {
42
- const H = `HTTP Error: ${r.status} ${r.statusText}`, d = new Error(H);
40
+ const O = `HTTP Error: ${r.status} ${r.statusText}`, d = new Error(O);
43
41
  throw d.status = r.status, d.statusText = r.statusText, d.response = r, d;
44
42
  }
45
43
  let f;
@@ -52,19 +50,19 @@ const X = (b = {}) => {
52
50
  };
53
51
  } catch (o) {
54
52
  const r = o instanceof Error && o.name === "AbortError";
55
- if (h < (n.retry || 0) && !r)
56
- return await x(n.retryDelay || 1e3), E(h + 1);
53
+ if (m < (n.retry || 0) && !r)
54
+ return await x(n.retryDelay || 1e3), E(m + 1);
57
55
  throw o instanceof Error ? o.name === "AbortError" ? a.value = { message: "Request was cancelled" } : a.value = { message: o.message } : a.value = o, o;
58
56
  }
59
57
  };
60
58
  try {
61
59
  return await E();
62
60
  } finally {
63
- p.value = !1, u.value = null;
61
+ h.value = !1, u.value = null;
64
62
  }
65
- }, C = (e, s) => i("GET", e, void 0, s), R = (e, s, t) => i("POST", e, s, t), $ = (e, s, t) => i("PUT", e, s, t), q = (e, s, t) => i("PATCH", e, s, t), A = (e, s) => i("DELETE", e, void 0, s), U = (e) => {
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) => {
66
64
  u.value && u.value.abort(e);
67
- }, W = () => {
65
+ }, q = () => {
68
66
  a.value = null;
69
67
  };
70
68
  return {
@@ -75,14 +73,14 @@ const X = (b = {}) => {
75
73
  // Methods
76
74
  request: i,
77
75
  get: C,
78
- post: R,
79
- put: $,
80
- patch: q,
76
+ post: $,
77
+ put: R,
78
+ patch: U,
81
79
  delete: A,
82
- cancel: U,
83
- clearError: W
80
+ cancel: W,
81
+ clearError: q
84
82
  };
85
83
  };
86
84
  export {
87
- X as useHttp
85
+ k as useHttp
88
86
  };
@@ -4,14 +4,13 @@ import { useToaster as C } from "../composables/useToaster.js";
4
4
  import { useTranslations as h } from "../composables/useTranslations.js";
5
5
  import { useLiquidValidator as S } from "../composables/validators/useLiquidValidator.js";
6
6
  import { EditorType as v } from "../enums/defaults.js";
7
- import { ToasterTypeOptions as x } from "../enums/toaster.js";
8
- import { useRecommendationExtensionStore as E } from "../extensions/Blocks/Recommendation/store/recommendation.js";
9
- import { useSaveAsTemplateStore as N } from "../stores/save-as-template.js";
7
+ import { ToasterTypeOptions as N } from "../enums/toaster.js";
8
+ import { useRecommendationExtensionStore as x } from "../extensions/Blocks/Recommendation/store/recommendation.js";
9
+ import { useSaveAsTemplateStore as E } from "../stores/save-as-template.js";
10
10
  import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
11
- import { isPlainObject as P } from "../utils/genericUtil.js";
12
11
  import { useTemplatePreparation as A } from "../utils/templatePreparation.js";
13
- const B = () => {
14
- const { get: n, post: m } = b(), { handleError: o, showToaster: l } = C(), { config: c, isFeatureEnabled: p } = w(), { validateLiquidSyntax: f } = S(), u = h();
12
+ const j = () => {
13
+ const { get: n, post: m } = b(), { handleError: o, showToaster: l } = C(), { config: c, isFeatureEnabled: p } = w(), { validateLiquidSyntax: g } = S(), u = h();
15
14
  return {
16
15
  getCategories: async () => {
17
16
  try {
@@ -41,10 +40,10 @@ const B = () => {
41
40
  createTemplate: async () => {
42
41
  var e, t, d, y;
43
42
  try {
44
- const { prepareTemplateDetails: i } = A(), s = N(), a = await i();
45
- if (p("liquidSyntax") && !await f(a.compiledHtml))
43
+ const { prepareTemplateDetails: i } = A(), s = E(), a = await i();
44
+ if (p("liquidSyntax") && !await g(a.compiledHtml))
46
45
  return !1;
47
- const T = {
46
+ const f = {
48
47
  name: s.getTemplateName,
49
48
  categories: s.getSelectedCategoryIds,
50
49
  productId: ((t = (e = c.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
@@ -55,7 +54,7 @@ const B = () => {
55
54
  unsubscriptionPreferencePageStatus: !1,
56
55
  unsubscriptionPreferencePages: [],
57
56
  recommendationCampaignUrls: r(
58
- E().recommendationCampaignUrls
57
+ x().recommendationCampaignUrls
59
58
  ),
60
59
  recommendationConfigs: r({}),
61
60
  isGuido: !0,
@@ -67,18 +66,16 @@ const B = () => {
67
66
  css: a.css,
68
67
  dynamicContentList: a.dynamicContentList
69
68
  })
70
- }, { data: g } = await m(
69
+ }, { data: { type: T } } = await m(
71
70
  "/newsletter/template-library/create-template",
72
- T
71
+ f
73
72
  );
74
- if (!P(g))
75
- throw new Error("Unexpected create-template response");
76
- return g.type === "alert" ? (l({
73
+ return T === "alert" ? (l({
77
74
  message: u(
78
75
  "newsletter.template-library-save-alert",
79
76
  { templateName: s.getTemplateName }
80
77
  ),
81
- type: x.Error
78
+ type: N.Error
82
79
  }), !1) : (l({
83
80
  message: u(
84
81
  "newsletter.template-library-save-success",
@@ -93,5 +90,5 @@ const B = () => {
93
90
  };
94
91
  };
95
92
  export {
96
- B as useTemplateLibraryApi
93
+ j as useTemplateLibraryApi
97
94
  };
@@ -30,9 +30,3 @@ export declare const replaceString: (string?: string, values?: Record<string, st
30
30
  * a string nor a number becomes ''.
31
31
  */
32
32
  export declare const asText: (value: unknown) => string;
33
- /**
34
- * Narrows an unknown API value to a plain JSON object. Arrays and exotic
35
- * objects (Blob, Date, FormData) are rejected, so a response body that useHttp
36
- * parsed as text or blob can never be read as a JSON payload.
37
- */
38
- export declare const isPlainObject: <T>(value: T) => value is T & Record<string, unknown>;
@@ -1,75 +1,69 @@
1
- const o = (a) => {
2
- const t = a.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((e) => e.trim()), [s] = t, r = {
3
- text: a.label,
1
+ const o = (t) => {
2
+ const a = t.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((l) => l.trim()), [s] = a, r = {
3
+ text: t.label,
4
4
  value: s || ""
5
5
  };
6
- if (t.length >= 2) {
7
- const [, e, l] = t;
8
- if (e.startsWith("default:")) {
9
- let n = e.slice(8).trim();
6
+ if (a.length >= 2) {
7
+ const [, l, e] = a;
8
+ if (l.startsWith("default:")) {
9
+ let n = l.slice(8).trim();
10
10
  n.startsWith('"') && n.endsWith('"') && (n = n.slice(1, -1)), r.fallback = n;
11
11
  } else {
12
- const n = e.includes("=") ? { key: e.split("=")[0].trim(), value: e.split("=")[1].trim() } : null;
13
- n ? r.format = n : l || (r.fallback = e), l && (r.fallback = l);
12
+ const n = l.includes("=") ? { key: l.split("=")[0].trim(), value: l.split("=")[1].trim() } : null;
13
+ n ? r.format = n : e || (r.fallback = l), e && (r.fallback = e);
14
14
  }
15
15
  }
16
16
  return r;
17
- }, u = (a, c = !1) => a.map((t) => {
18
- if (t.format)
17
+ }, f = (t, c = !1) => t.map((a) => {
18
+ if (a.format)
19
19
  return {
20
- label: `${t.text} | ${t.format.key}=${t.format.value}`,
21
- value: `{{${t.value}|${t.format.key}=${t.format.value}}}`
20
+ label: `${a.text} | ${a.format.key}=${a.format.value}`,
21
+ value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
22
22
  };
23
23
  if (c) {
24
- if (!t.fallback)
24
+ if (!a.fallback)
25
25
  return {
26
- label: t.text,
27
- value: `{{ ${t.value} }}`
26
+ label: a.text,
27
+ value: `{{ ${a.value} }}`
28
28
  };
29
- const r = !Number.isNaN(Number(t.fallback)) && t.fallback.trim() !== "" ? t.fallback : `"${t.fallback}"`;
29
+ const r = !Number.isNaN(Number(a.fallback)) && a.fallback.trim() !== "" ? a.fallback : `"${a.fallback}"`;
30
30
  return {
31
- label: `${t.text} | ${t.fallback}`,
32
- value: `{{ ${t.value} | default: ${r} }}`
31
+ label: `${a.text} | ${a.fallback}`,
32
+ value: `{{ ${a.value} | default: ${r} }}`
33
33
  };
34
34
  }
35
35
  return {
36
- label: t.fallback ? `${t.text} | ${t.fallback}` : t.text,
37
- value: t.fallback ? `{{${t.value}|${t.fallback}}}` : `{{${t.value}}}`
36
+ label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
37
+ value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
38
38
  };
39
- }), b = (a) => {
40
- const c = [], t = /* @__PURE__ */ new Set(), s = (e) => {
41
- Array.isArray(e) && e.forEach((l) => {
42
- const n = [...l.children ?? [], ...l.select_items ?? []];
39
+ }), b = (t) => {
40
+ const c = [], a = /* @__PURE__ */ new Set(), s = (l) => {
41
+ Array.isArray(l) && l.forEach((e) => {
42
+ const n = [...e.children ?? [], ...e.select_items ?? []];
43
43
  if (n.length > 0) {
44
44
  s(n);
45
45
  return;
46
46
  }
47
- const f = l.text || l.tag_text;
48
- f && l.value && !t.has(l.value) && (t.add(l.value), c.push({ text: f, value: l.value }));
47
+ const u = e.text || e.tag_text;
48
+ u && e.value && !a.has(e.value) && (a.add(e.value), c.push({ text: u, value: e.value }));
49
49
  });
50
- }, [r] = Object.values(a ?? {});
50
+ }, [r] = Object.values(t ?? {});
51
51
  return s(r), c;
52
- }, i = (a, c, t = !1) => {
53
- const s = new Set(a.map((e) => e.value)), r = c.filter((e) => s.has(e.value) ? !1 : (s.add(e.value), !0));
52
+ }, i = (t, c, a = !1) => {
53
+ const s = new Set(t.map((l) => l.value)), r = c.filter((l) => s.has(l.value) ? !1 : (s.add(l.value), !0));
54
54
  return [
55
- ...u(a, t),
56
- ...u(r, t)
55
+ ...f(t, a),
56
+ ...f(r, a)
57
57
  ];
58
- }, k = () => {
59
- var a;
60
- return ((a = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : a.getAttribute("content")) ?? "";
61
- }, v = (a) => typeof a == "string" ? a : typeof a == "number" ? String(a) : "", y = (a) => {
62
- if (a === null || typeof a != "object" || Array.isArray(a))
63
- return !1;
64
- const c = Object.getPrototypeOf(a);
65
- return c === Object.prototype || c === null;
66
- };
58
+ }, v = () => {
59
+ var t;
60
+ return ((t = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : t.getAttribute("content")) ?? "";
61
+ }, k = (t) => typeof t == "string" ? t : typeof t == "number" ? String(t) : "";
67
62
  export {
68
- v as asText,
63
+ k as asText,
69
64
  i as buildMergeTagEntries,
70
- u as dynamicContentToMergeTags,
65
+ f as dynamicContentToMergeTags,
71
66
  b as flattenDynamicContentList,
72
- k as getCsrfToken,
73
- y as isPlainObject,
67
+ v as getCsrfToken,
74
68
  o as mergeTagToDynamicContent
75
69
  };
@@ -2,27 +2,26 @@ import { useActionsApi as k } from "../composables/useActionsApi.js";
2
2
  import { useConfig as U } from "../composables/useConfig.js";
3
3
  import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
4
4
  import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
5
- import { useRecommendationExtensionStore as T } from "../extensions/Blocks/Recommendation/store/recommendation.js";
5
+ import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
6
6
  import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
7
- import { DATA_ATTRIBUTES as C } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
7
+ import { DATA_ATTRIBUTES as A } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
8
8
  import { parsePageList as R } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
9
9
  import { useDynamicContentStore as N } from "../stores/dynamic-content.js";
10
10
  import { useEditorStore as z } from "../stores/editor.js";
11
- import { useUnsubscribeStore as O } from "../stores/unsubscribe.js";
12
- import { isPlainObject as _ } from "./genericUtil.js";
11
+ import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
13
12
  import { assignTrackingIds as v } from "./linkTrackingIds.js";
14
- function M(m) {
15
- const i = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${C.PAGE_LIST}]`), t = [];
13
+ function O(m) {
14
+ const i = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
16
15
  return i.forEach((s) => {
17
- const o = s.getAttribute(C.PAGE_LIST);
16
+ const o = s.getAttribute(A.PAGE_LIST);
18
17
  o && t.push(...R(o));
19
18
  }), [...new Set(t)];
20
19
  }
21
- async function q(m) {
20
+ async function M(m) {
22
21
  const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
23
22
  if (n.length === 0)
24
23
  return;
25
- const i = T();
24
+ const i = C();
26
25
  n.forEach((t) => {
27
26
  var r, l, g, f, c;
28
27
  const s = t.getAttribute("recommendation-id"), o = s ? Number(s) : NaN;
@@ -37,7 +36,7 @@ async function q(m) {
37
36
  } catch {
38
37
  return;
39
38
  }
40
- if (!_(e))
39
+ if (!e || typeof e != "object" || Array.isArray(e))
41
40
  return;
42
41
  const h = {
43
42
  // Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
@@ -69,40 +68,40 @@ async function q(m) {
69
68
  );
70
69
  }
71
70
  }
72
- const te = () => {
73
- const m = N(), u = z(), n = O(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
71
+ const Z = () => {
72
+ const m = N(), u = z(), n = _(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
74
73
  return {
75
74
  prepareTemplateDetails: async () => {
76
75
  let { html: r, css: l, syncModulesIds: g = [] } = await t();
77
76
  if (e("linkTrackingIds"))
78
77
  try {
79
- const { html: y, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
80
- u.trackIdSessionFloor = H, F && (r = y, await s(y, l));
81
- } catch (y) {
82
- console.error("Tracking-id step failed, saving anyway:", y);
78
+ const { html: S, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
79
+ u.trackIdSessionFloor = H, F && (r = S, await s(S, l));
80
+ } catch (S) {
81
+ console.error("Tracking-id step failed, saving anyway:", S);
83
82
  }
84
- const { html: f, ampHtml: c = "", ampErrors: A = [] } = await i({
83
+ const { html: f, ampHtml: c = "", ampErrors: T = [] } = await i({
85
84
  minimize: !0,
86
85
  resetDataSavedFlag: !1
87
86
  });
88
- n.selectedUnsubscribePages.length && await n.fetchTemplates(), await q(r);
89
- const { compiledHtml: I, stats: S, appliedRules: w } = o(f), D = c && p(c).compiledHtml, P = m.getSelectedDynamicContentList, E = T(), b = M(r);
87
+ n.selectedUnsubscribePages.length && await n.fetchTemplates(), await M(r);
88
+ const { compiledHtml: I, stats: y, appliedRules: w } = o(f), D = c && p(c).compiledHtml, E = m.getSelectedDynamicContentList, P = C(), b = O(r);
90
89
  return console.debug("HTML Compilation Stats:", {
91
- originalSize: S.originalSize,
92
- compiledSize: S.compiledSize,
93
- reduction: `${S.reductionPercentage.toFixed(2)}%`,
90
+ originalSize: y.originalSize,
91
+ compiledSize: y.compiledSize,
92
+ reduction: `${y.reductionPercentage.toFixed(2)}%`,
94
93
  appliedRules: w,
95
- executionTime: `${S.executionTime.toFixed(2)}ms`
94
+ executionTime: `${y.executionTime.toFixed(2)}ms`
96
95
  }), {
97
- dynamicContentList: P,
96
+ dynamicContentList: E,
98
97
  compiledHtml: I,
99
98
  rawHtml: r,
100
99
  css: l,
101
100
  ampHtml: D,
102
- ampErrors: A,
101
+ ampErrors: T,
103
102
  modules: g.map(Number),
104
103
  recommendation: {
105
- campaignUrls: E.recommendationCampaignUrls,
104
+ campaignUrls: P.recommendationCampaignUrls,
106
105
  configs: {}
107
106
  },
108
107
  unsubscribe: {
@@ -114,6 +113,6 @@ const te = () => {
114
113
  };
115
114
  };
116
115
  export {
117
- M as getHtmlReferencedUnsubscribePages,
118
- te as useTemplatePreparation
116
+ O as getHtmlReferencedUnsubscribePages,
117
+ Z as useTemplatePreparation
119
118
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.18.1-beta.5b53256",
3
+ "version": "3.18.1-beta.5d9295b",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",