@useinsider/guido 3.26.0 → 3.27.0-beta.3e42e7a

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 (66) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +91 -89
  3. package/dist/@types/display-condition.js +25 -0
  4. package/dist/components/Guido.vue.js +5 -5
  5. package/dist/components/Guido.vue2.js +95 -90
  6. package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +17 -0
  7. package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +41 -0
  8. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +30 -0
  9. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +81 -0
  10. package/dist/components/organisms/display-conditions/DisplayConditionListState.vue.js +17 -0
  11. package/dist/components/organisms/display-conditions/DisplayConditionListState.vue2.js +45 -0
  12. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +36 -0
  13. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +63 -0
  14. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +17 -0
  15. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +22 -0
  16. package/dist/composables/useBlocksConfig.js +29 -20
  17. package/dist/composables/useDisplayConditions.js +116 -0
  18. package/dist/composables/useTranslations.js +2 -1
  19. package/dist/config/compiler/utils/itemsCompilerUtils.js +43 -42
  20. package/dist/config/compiler/utils/recommendationCompilerUtils.js +67 -64
  21. package/dist/enums/academy.js +1 -0
  22. package/dist/enums/display-condition.js +12 -0
  23. package/dist/extensions/DisplayConditions/bridge.js +25 -0
  24. package/dist/extensions/DisplayConditions/constants.js +26 -0
  25. package/dist/extensions/DisplayConditions/control.js +215 -0
  26. package/dist/extensions/DisplayConditions/display-conditions.css.js +226 -0
  27. package/dist/extensions/DisplayConditions/extension.js +28 -0
  28. package/dist/extensions/DisplayConditions/iconsRegistry.js +20 -0
  29. package/dist/extensions/DisplayConditions/library.js +30 -0
  30. package/dist/extensions/DisplayConditions/settingsPanel.js +17 -0
  31. package/dist/guido.css +1 -1
  32. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +93 -92
  33. package/dist/node_modules/valibot/dist/index.js +297 -261
  34. package/dist/package.json.js +4 -4
  35. package/dist/services/displayConditionApi.js +39 -0
  36. package/dist/src/@types/config/schemas.d.ts +4 -0
  37. package/dist/src/@types/display-condition.d.ts +61 -0
  38. package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +43 -0
  39. package/dist/src/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.d.ts +2 -0
  40. package/dist/src/components/organisms/display-conditions/DisplayConditionListState.vue.d.ts +18 -0
  41. package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts +2 -0
  42. package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +2 -0
  43. package/dist/src/composables/useConfig.d.ts +2 -0
  44. package/dist/src/composables/useDisplayConditions.d.ts +18 -0
  45. package/dist/src/enums/academy.d.ts +1 -0
  46. package/dist/src/enums/display-condition.d.ts +15 -0
  47. package/dist/src/extensions/DisplayConditions/bridge.d.ts +7 -0
  48. package/dist/src/extensions/DisplayConditions/constants.d.ts +23 -0
  49. package/dist/src/extensions/DisplayConditions/control.d.ts +25 -0
  50. package/dist/src/extensions/DisplayConditions/extension.d.ts +2 -0
  51. package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +4 -0
  52. package/dist/src/extensions/DisplayConditions/library.d.ts +8 -0
  53. package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +5 -0
  54. package/dist/src/mock/api/display-conditions.d.ts +2 -0
  55. package/dist/src/services/displayConditionApi.d.ts +8 -0
  56. package/dist/src/stores/config.d.ts +170 -0
  57. package/dist/src/stores/display-condition.d.ts +86 -0
  58. package/dist/src/utils/displayCondition.d.ts +11 -0
  59. package/dist/src/utils/protectTableText.d.ts +2 -0
  60. package/dist/static/styles/variables.css.js +1 -0
  61. package/dist/stores/config.js +13 -6
  62. package/dist/stores/display-condition.js +29 -0
  63. package/dist/utils/displayCondition.js +29 -0
  64. package/dist/utils/pairProductVariables.js +29 -28
  65. package/dist/utils/protectTableText.js +22 -0
  66. package/package.json +1 -1
@@ -1,40 +1,41 @@
1
- import { defineComponent as fe, defineAsyncComponent as m, ref as W, computed as u, watch as G, onMounted as ge, onUnmounted as ye } from "vue";
2
- import { useCortexBlueprintBridge as be } from "../composables/useCortexBlueprintBridge.js";
3
- import { useEditorLock as ve } from "../composables/useEditorLock.js";
4
- import { startEditorOpenMetrics as Se } from "../composables/useEditorOpenMetrics.js";
5
- import { provideGuidoActions as he } from "../composables/useGuidoActions.js";
6
- import { useGuidoStateBridge as Ee } from "../composables/useGuidoStateBridge.js";
7
- import { usePartner as Ce } from "../composables/usePartner.js";
8
- import { useSaveValidationRollout as we } from "../composables/useSaveValidationRollout.js";
9
- import { useStripo as Te } from "../composables/useStripo.js";
10
- import { useTimerClone as ke } from "../composables/useTimerClone.js";
11
- import { useToaster as Fe } from "../composables/useToaster.js";
12
- import { useTranslations as De } from "../composables/useTranslations.js";
13
- import { migrate as Ie } from "../config/migrator/index.js";
1
+ import { defineComponent as ge, defineAsyncComponent as a, ref as W, computed as l, watch as G, onMounted as be, onUnmounted as ve } from "vue";
2
+ import { useCortexBlueprintBridge as Se } from "../composables/useCortexBlueprintBridge.js";
3
+ import { useEditorLock as he } from "../composables/useEditorLock.js";
4
+ import { startEditorOpenMetrics as Ee } from "../composables/useEditorOpenMetrics.js";
5
+ import { provideGuidoActions as Ce } from "../composables/useGuidoActions.js";
6
+ import { useGuidoStateBridge as De } from "../composables/useGuidoStateBridge.js";
7
+ import { usePartner as we } from "../composables/usePartner.js";
8
+ import { useSaveValidationRollout as Te } from "../composables/useSaveValidationRollout.js";
9
+ import { useStripo as ke } from "../composables/useStripo.js";
10
+ import { useTimerClone as Fe } from "../composables/useTimerClone.js";
11
+ import { useToaster as Ie } from "../composables/useToaster.js";
12
+ import { useTranslations as Me } from "../composables/useTranslations.js";
13
+ import { migrate as Re } from "../config/migrator/index.js";
14
14
  import { ModuleFolderDefaults as $ } from "../enums/defaults.js";
15
- import { RIBBON_SELECTOR as Me } from "../enums/onboarding.js";
16
- import { ToasterTypeOptions as Le } from "../enums/toaster.js";
17
- import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as Re } from "../extensions/Blocks/Recommendation/store/recommendation.js";
18
- import { disposeUnsubscribeListeners as Ue } from "../extensions/Blocks/Unsubscribe/block.js";
19
- import Oe from "./organisms/AutoSaveController.vue.js";
20
- import Ne from "./organisms/base/AuthErrorModal.vue.js";
21
- import _e from "./organisms/base/Toaster.vue.js";
22
- import Ae from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
23
- import Pe from "./organisms/header/HeaderWrapper.vue.js";
24
- import Be from "./organisms/LoadingWrapper.vue.js";
25
- import xe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
26
- import He from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
27
- import Ve from "./organisms/validation/ValidationErrorDrawer.vue.js";
28
- import { useStripoApi as We } from "../services/stripoApi.js";
29
- import { useConfigStore as Ge } from "../stores/config.js";
30
- import { useDynamicContentStore as $e } from "../stores/dynamic-content.js";
15
+ import { RIBBON_SELECTOR as Le } from "../enums/onboarding.js";
16
+ import { ToasterTypeOptions as Ue } from "../enums/toaster.js";
17
+ import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as Oe } from "../extensions/Blocks/Recommendation/store/recommendation.js";
18
+ import { disposeUnsubscribeListeners as Ne } from "../extensions/Blocks/Unsubscribe/block.js";
19
+ import { disposeDisplayConditionRequest as _e } from "../extensions/DisplayConditions/bridge.js";
20
+ import Ae from "./organisms/AutoSaveController.vue.js";
21
+ import Pe from "./organisms/base/AuthErrorModal.vue.js";
22
+ import xe from "./organisms/base/Toaster.vue.js";
23
+ import Be from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
24
+ import He from "./organisms/header/HeaderWrapper.vue.js";
25
+ import Ve from "./organisms/LoadingWrapper.vue.js";
26
+ import We from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
27
+ import Ge from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
28
+ import $e from "./organisms/validation/ValidationErrorDrawer.vue.js";
29
+ import { useStripoApi as ze } from "../services/stripoApi.js";
30
+ import { useConfigStore as qe } from "../stores/config.js";
31
+ import { useDynamicContentStore as Ke } from "../stores/dynamic-content.js";
31
32
  import { useEditorStore as C } from "../stores/editor.js";
32
- import { usePreviewStore as ze } from "../stores/preview.js";
33
- import { useSaveValidationStore as qe } from "../stores/save-validation.js";
34
- import { useTemplateStore as Ke } from "../stores/template.js";
35
- import { useUnsubscribeStore as je } from "../stores/unsubscribe.js";
33
+ import { usePreviewStore as je } from "../stores/preview.js";
34
+ import { useSaveValidationStore as Je } from "../stores/save-validation.js";
35
+ import { useTemplateStore as Qe } from "../stores/template.js";
36
+ import { useUnsubscribeStore as Xe } from "../stores/unsubscribe.js";
36
37
  import { readTrackFloor as q } from "../utils/linkTrackingIds.js";
37
- const Rt = /* @__PURE__ */ fe({
38
+ const _t = /* @__PURE__ */ ge({
38
39
  __name: "Guido",
39
40
  props: {
40
41
  config: null,
@@ -42,34 +43,36 @@ const Rt = /* @__PURE__ */ fe({
42
43
  },
43
44
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
44
45
  setup(K, { expose: j, emit: s }) {
45
- const a = K, n = Se(), J = m(
46
+ const c = K, r = Ee(), J = a(
46
47
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
47
- ), Q = m(
48
+ ), Q = a(
48
49
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
49
- ), X = m(
50
+ ), X = a(
50
51
  () => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
51
- ), Y = m(
52
+ ), Y = a(
52
53
  () => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
53
- ), w = W(), Z = m(
54
+ ), Z = a(
55
+ () => import("./organisms/display-conditions/DisplayConditionsHost.vue.js")
56
+ ), D = W(), ee = a(
54
57
  () => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
55
- ), ee = m(
58
+ ), te = a(
56
59
  () => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
57
- ), g = W(), y = $e(), T = je(), o = Ge();
58
- a.ready && o.init(a.config);
59
- const c = C(), te = ze(), p = u(() => c.hasChanges), { isTestPartner: oe } = Ce(), { isEnabled: re, loadRollout: k } = we(), { showToaster: F } = Fe(), D = De(), I = () => {
60
+ ), y = W(), g = Ke(), w = Xe(), o = qe();
61
+ c.ready && o.init(c.config);
62
+ const d = C(), oe = je(), p = l(() => d.hasChanges), { isTestPartner: ne } = we(), { isEnabled: re, loadRollout: T } = Te(), { showToaster: k } = Ie(), F = Me(), I = () => {
60
63
  var t;
61
- if (c.isVersionHistoryOpen) {
62
- console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), F({
63
- type: Le.Warning,
64
- message: D("email-editor.save-blocked-outside-editor")
64
+ if (d.isVersionHistoryOpen) {
65
+ console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), k({
66
+ type: Ue.Warning,
67
+ message: F("email-editor.save-blocked-outside-editor")
65
68
  });
66
69
  return;
67
70
  }
68
- return (t = w.value) == null ? void 0 : t.saveSilent();
71
+ return (t = D.value) == null ? void 0 : t.saveSilent();
69
72
  }, M = (t) => {
70
- c.loadingStatus = t;
73
+ d.loadingStatus = t;
71
74
  };
72
- be(), Ee();
75
+ Se(), De();
73
76
  const b = () => {
74
77
  var t, e;
75
78
  return {
@@ -80,17 +83,17 @@ const Rt = /* @__PURE__ */ fe({
80
83
  savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || $.SAVED_MODULES,
81
84
  defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || $.DEFAULT_MODULES
82
85
  };
83
- }, { initPlugin: L, preloadRuntime: R } = Te(n), { runExclusive: U, beginMount: O, isCurrentMount: v } = ve();
86
+ }, { initPlugin: R, preloadRuntime: L } = ke(r), { runExclusive: U, beginMount: O, isCurrentMount: v } = he();
84
87
  let f = 0;
85
- const { getDefaultTemplate: N } = We(), { cloneTimersOnSave: _, hasTimerBlocks: A } = ke(), ne = u(() => {
88
+ const { getDefaultTemplate: N } = ze(), { cloneTimersOnSave: _, hasTimerBlocks: A } = Fe(), se = l(() => {
86
89
  var t;
87
90
  return !((t = o.ui) != null && t.showHeader);
88
- }), se = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ie = u(
91
+ }), ie = l(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ae = l(() => o.externalDisplayConditions), ce = l(
89
92
  () => o.isFeatureEnabled("legacyUnsubscribeConversion")
90
- ), ae = u(
93
+ ), de = l(
91
94
  () => !!z().recommendationConfigs.strategyId
92
95
  );
93
- he({
96
+ Ce({
94
97
  onBack: () => {
95
98
  console.debug("guido:back"), s("back");
96
99
  },
@@ -106,82 +109,84 @@ const Rt = /* @__PURE__ */ fe({
106
109
  }
107
110
  });
108
111
  const P = (t) => {
109
- console.debug("dynamic-content:close", t), y.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
110
- }, B = () => {
112
+ console.debug("dynamic-content:close", t), g.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
113
+ }, x = () => {
111
114
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
112
115
  };
113
116
  G(() => p.value, () => {
114
117
  s("on-change", p.value);
115
118
  });
116
119
  const S = (t) => {
117
- const e = t, { attribute: i, position: l } = e.detail;
118
- console.debug("dynamic-content:open", e.detail), s("dynamic-content:open", i, l);
120
+ const e = t, { attribute: i, position: u } = e.detail;
121
+ console.debug("dynamic-content:open", e.detail), s("dynamic-content:open", i, u);
119
122
  };
120
- let d = null;
123
+ let m = null;
121
124
  const h = () => {
122
125
  var e;
123
- const t = document.querySelector(Me);
124
- (e = g.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
126
+ const t = document.querySelector(Le);
127
+ (e = y.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
125
128
  }, E = async () => {
126
129
  var t;
127
- n.mark("host_ready");
130
+ r.mark("host_ready");
128
131
  try {
129
- o.initialized || o.init(a.config), c.templateId = o.templateId, n.setContext({
132
+ o.initialized || o.init(c.config), d.templateId = o.templateId, r.setContext({
130
133
  partnerName: o.partnerName,
131
134
  productType: o.productType,
132
135
  templateId: o.templateId,
133
136
  variationId: o.variationId
134
137
  });
135
- const e = o.template, i = (e == null ? void 0 : e.html) || "", l = (e == null ? void 0 : e.css) || "", x = (e == null ? void 0 : e.preselectedDynamicContent) || [];
136
- T.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
137
- const ce = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, H = o.isFeatureEnabled("linkTrackingIds"), de = {
138
+ const e = o.template, i = (e == null ? void 0 : e.html) || "", u = (e == null ? void 0 : e.css) || "", B = (e == null ? void 0 : e.preselectedDynamicContent) || [];
139
+ w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
140
+ const me = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, H = o.isFeatureEnabled("linkTrackingIds"), le = {
138
141
  partnerName: o.partnerName,
139
142
  campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
140
143
  rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
141
- }, me = {
144
+ }, ue = {
142
145
  itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
143
- }, V = (pe) => n.timed(
146
+ }, V = (ye) => r.timed(
144
147
  "migration",
145
- () => Ie(pe, ce, de, me)
148
+ () => Re(ye, me, le, ue)
146
149
  );
147
- let r = {
150
+ let n = {
148
151
  html: i && await V(i),
149
- css: l
152
+ css: u
150
153
  };
151
- r.html || (r = await n.timed("default_template", () => N()), r.html = await V(r.html));
152
- const le = H ? q(r.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
153
- A(r.html) && (r.html = await n.timed("timer_clone", () => _(r.html))), H && (c.trackIdSessionFloor = Math.max(le, q(r.html)));
154
- const ue = {
155
- preselectedDynamicContentList: x,
154
+ n.html || (n = await r.timed("default_template", () => N()), n.html = await V(n.html));
155
+ const pe = H ? q(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
156
+ A(n.html) && (n.html = await r.timed("timer_clone", () => _(n.html))), H && (d.trackIdSessionFloor = Math.max(pe, q(n.html)));
157
+ const fe = {
158
+ preselectedDynamicContentList: B,
156
159
  onReady: () => {
157
160
  console.debug("guido:ready"), s("ready");
158
161
  }
159
162
  };
160
- f = O(), await L(r, b(), ue, r.html !== i), y.selectedDynamicContentList = x;
163
+ f = O(), await R(n, b(), fe, n.html !== i), g.selectedDynamicContentList = B;
161
164
  } catch (e) {
162
- console.error("Failed to initialize Stripo editor:", e), n.markFailed();
165
+ console.error("Failed to initialize Stripo editor:", e), r.markFailed();
163
166
  }
164
167
  };
165
- return ge(async () => {
168
+ return be(async () => {
166
169
  var e;
167
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(), Ke().$reset(), qe().$reset(), k(), h();
168
- const t = (e = g.value) == null ? void 0 : e.parentElement;
169
- if (t && (d = new ResizeObserver(h), d.observe(t)), R(), a.ready)
170
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(), Qe().$reset(), Je().$reset(), T(), h();
171
+ const t = (e = y.value) == null ? void 0 : e.parentElement;
172
+ if (t && (m = new ResizeObserver(h), m.observe(t)), L(), c.ready)
170
173
  await E();
171
174
  else {
172
- const i = G(() => a.ready, (l) => {
173
- l && (i(), E());
175
+ const i = G(() => c.ready, (u) => {
176
+ u && (i(), E());
174
177
  });
175
178
  }
176
179
  document.addEventListener("dynamic-content:open", S);
177
- }), ye(() => {
178
- if (Ue(), Re(), n.dispose(), d == null || d.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f))
180
+ }), ve(() => {
181
+ if (Ne(), Oe(), r.dispose(), m == null || m.disconnect(), document.removeEventListener("dynamic-content:open", S), v(f)) {
182
+ _e();
179
183
  try {
180
184
  const t = C();
181
185
  t.isStripoInitialized = !1, t.isAccessibilityTestingOpen = !1, t.imagesHidden = !1, t.colorVisionDeficiency = "";
182
186
  } catch (t) {
183
187
  console.debug("Failed to close the editor readiness gate on unmount", t);
184
188
  }
189
+ }
185
190
  U(async () => {
186
191
  if (v(f))
187
192
  try {
@@ -193,14 +198,14 @@ const Rt = /* @__PURE__ */ fe({
193
198
  }), j({
194
199
  dynamicContent: {
195
200
  insert: P,
196
- close: B
201
+ close: x
197
202
  },
198
203
  hasChanges: p,
199
204
  saveSilent: I,
200
205
  setLoading: M
201
- }), { __sfc: !0, openMetrics: n, PreviewContainer: J, OnboardingWrapper: Q, AssignStrategyDrawer: X, RemoveStrategyModal: Y, autoSaveControllerRef: w, LegacyStrategyUpdatedModal: Z, LegacyUnsubscribeConvertedModal: ee, wrapperRef: g, dynamicContentStore: y, unsubscribeStore: T, props: a, configStore: o, editorStore: c, previewStore: te, hasChanges: p, isTestPartner: oe, isSaveValidationEnabled: re, loadRollout: k, showToaster: F, trans: D, saveSilent: I, setLoading: M, emit: s, buildMetadata: b, initPlugin: L, preloadRuntime: R, runExclusive: U, beginMount: O, isCurrentMount: v, mountGeneration: f, getDefaultTemplate: N, cloneTimersOnSave: _, hasTimerBlocks: A, noHeader: ne, isRrsEnabled: se, isLegacyUnsubscribeConversionEnabled: ie, hasAssignedStrategy: ae, insertDynamicContent: P, closeDynamicContent: B, handleDynamicContentOpen: S, ribbonObserver: d, updateRibbonOffset: h, startEditor: E, AutoSaveController: Oe, AuthErrorModal: Ne, Toaster: _e, FilterSelectionDrawer: Ae, HeaderWrapper: Pe, LoadingWrapper: Be, SaveAsTemplateDrawer: xe, UnsubscribeWrapper: He, ValidationErrorDrawer: Ve };
206
+ }), { __sfc: !0, openMetrics: r, PreviewContainer: J, OnboardingWrapper: Q, AssignStrategyDrawer: X, RemoveStrategyModal: Y, DisplayConditionsHost: Z, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: ee, LegacyUnsubscribeConvertedModal: te, wrapperRef: y, dynamicContentStore: g, unsubscribeStore: w, props: c, configStore: o, editorStore: d, previewStore: oe, hasChanges: p, isTestPartner: ne, isSaveValidationEnabled: re, loadRollout: T, showToaster: k, trans: F, saveSilent: I, setLoading: M, emit: s, buildMetadata: b, initPlugin: R, preloadRuntime: L, runExclusive: U, beginMount: O, isCurrentMount: v, mountGeneration: f, getDefaultTemplate: N, cloneTimersOnSave: _, hasTimerBlocks: A, noHeader: se, isRrsEnabled: ie, isExternalDisplayConditionsEnabled: ae, isLegacyUnsubscribeConversionEnabled: ce, hasAssignedStrategy: de, insertDynamicContent: P, closeDynamicContent: x, handleDynamicContentOpen: S, ribbonObserver: m, updateRibbonOffset: h, startEditor: E, AutoSaveController: Ae, AuthErrorModal: Pe, Toaster: xe, FilterSelectionDrawer: Be, HeaderWrapper: He, LoadingWrapper: Ve, SaveAsTemplateDrawer: We, UnsubscribeWrapper: Ge, ValidationErrorDrawer: $e };
202
207
  }
203
208
  });
204
209
  export {
205
- Rt as default
210
+ _t as default
206
211
  };
@@ -0,0 +1,17 @@
1
+ import r from "./CodeEditorField.vue2.js";
2
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var i = function() {
4
+ var e = this, t = e._self._c, o = e._self._setupProxy;
5
+ return t("div", { staticClass: "guido-code-editor-field", attrs: { id: e.id } }, [t("p", { staticClass: "guido-code-editor-field__label mt-0 mb-2 f-s-1 f-w-400 l-h-1 t-c-1" }, [e._v(" " + e._s(e.label) + " ")]), t(o.InCodeSnippet, { attrs: { code: e.value, disable: e.disabled, "focus-editor": !1, invalid: !!e.error, "invalid-message": e.error, options: o.options, size: { height: e.error ? 196 : 216 }, "syntax-check": !1 }, on: { input: o.onInput, ready: o.onReady } })], 1);
6
+ }, a = [], n = /* @__PURE__ */ s(
7
+ r,
8
+ i,
9
+ a,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const c = n.exports;
15
+ export {
16
+ c as default
17
+ };
@@ -0,0 +1,41 @@
1
+ import { defineComponent as f, computed as m, nextTick as _ } from "vue";
2
+ import { InCodeSnippet as I } from "@useinsider/design-system-vue";
3
+ const S = /* @__PURE__ */ f({
4
+ __name: "CodeEditorField",
5
+ props: {
6
+ id: null,
7
+ label: null,
8
+ value: null,
9
+ placeholder: { default: "" },
10
+ error: { default: "" },
11
+ disabled: { type: Boolean, default: !1 }
12
+ },
13
+ emits: ["input"],
14
+ setup(r, { expose: a, emit: n }) {
15
+ const l = r, u = 700;
16
+ let t = null, e = null;
17
+ const d = m(() => ({
18
+ mode: "liquid",
19
+ lint: !1,
20
+ foldGutter: !1,
21
+ placeholder: l.placeholder
22
+ })), p = (o) => {
23
+ t = o;
24
+ }, s = (o) => {
25
+ n("input", o), e == null || e();
26
+ }, i = () => new Promise((o) => {
27
+ if (!t || t.state.doc.toString() === l.value) {
28
+ o(l.value);
29
+ return;
30
+ }
31
+ const c = setTimeout(() => e == null ? void 0 : e(), u);
32
+ e = () => {
33
+ clearTimeout(c), e = null, _(() => o(l.value));
34
+ };
35
+ });
36
+ return a({ read: i }), { __sfc: !0, props: l, emit: n, SANITIZED_INPUT_WAIT_MS: u, view: t, settleRead: e, options: d, onReady: p, onInput: s, read: i, InCodeSnippet: I };
37
+ }
38
+ });
39
+ export {
40
+ S as default
41
+ };
@@ -0,0 +1,30 @@
1
+ import a from "./DisplayConditionCreateDrawer.vue2.js";
2
+ /* empty css */
3
+ import r from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var n = function() {
5
+ var i = this, t = i._self._c, e = i._self._setupProxy;
6
+ return t(e.WpDrawer, { attrs: { id: "guido__display-condition-create-drawer", "description-status": "", "class-name": "guido-display-condition-create-drawer", size: "large", "close-on-outside-click": !1, "description-text": e.descriptionText, "footer-button-group-options": e.footerButtonGroupOptions, status: e.store.isCreateOpen, "title-text": e.trans(`${e.KEY}.create-title`) }, on: { cancelOrBackButtonEvent: e.close, onCloseEvent: e.close, primaryButtonEvent: function(o) {
7
+ return e.submit("inline");
8
+ }, secondaryButtonEvent: function(o) {
9
+ return e.submit("save");
10
+ } } }, [t("div", { staticClass: "guido-display-condition-create" }, [t(e.InBasicTextInput, { staticClass: "mb-4 w-1", attrs: { id: "guido__display-condition-name-input", name: "displayConditionName", "character-counter-status": !1, "disabled-status": e.isSaving, "label-text": e.trans(`${e.KEY}.condition-name`), "max-character-length": e.DISPLAY_CONDITION_LIMITS.NAME_MAX, "placeholder-text": e.trans(`${e.KEY}.condition-name-placeholder`), "state-message": e.errors.name || "", states: e.errors.name ? "error" : "default", "tooltip-status": !1, value: e.draft.name }, on: { input: function(o) {
11
+ return e.updateField("name", o);
12
+ } } }), t(e.InBasicTextInput, { staticClass: "mb-4 w-1", attrs: { id: "guido__display-condition-description-input", name: "displayConditionDescription", "character-counter-status": !1, "disabled-status": e.isSaving, "label-text": e.descriptionLabel, "max-character-length": e.DISPLAY_CONDITION_LIMITS.DESCRIPTION_MAX, "placeholder-text": e.trans(`${e.KEY}.condition-description-placeholder`), "state-message": e.errors.description || "", states: e.errors.description ? "error" : "default", "tooltip-status": !1, value: e.draft.description }, on: { input: function(o) {
13
+ return e.updateField("description", o);
14
+ } } }), t("div", { staticClass: "guido-display-condition-create__separator t-c-3" }), t("p", { staticClass: "guido-display-condition-create__method-title mt-0 mb-4 f-s-1 f-w-600 l-h-6 l-s-5 t-t-u t-c-55" }, [i._v(" " + i._s(e.trans(`${e.KEY}.select-method`)) + " ")]), t("div", { staticClass: "guido-display-condition-create__methods d-f mb-4" }, [t(e.InRadioButton, { attrs: { id: "guido__display-condition-method-logic-builder", disable: "", disabled: "", name: "displayConditionMethod", selected: "codeOnly", value: "logicBuilder", label: e.trans(`${e.KEY}.logic-builder`) } }), t(e.InRadioButton, { attrs: { id: "guido__display-condition-method-code-only", name: "displayConditionMethod", selected: "codeOnly", value: "codeOnly", label: e.trans(`${e.KEY}.code-only`) } })], 1), t(e.CodeEditorField, { ref: "codeBeforeRef", staticClass: "mb-3", attrs: { id: "guido__display-condition-code-before", disabled: e.isSaving, error: e.errors.codeBefore, label: e.trans(`${e.KEY}.code-before`), placeholder: e.trans(`${e.KEY}.code-placeholder`), value: e.draft.codeBefore }, on: { input: function(o) {
15
+ return e.updateField("codeBefore", o);
16
+ } } }), t(e.CodeEditorField, { ref: "codeAfterRef", attrs: { id: "guido__display-condition-code-after", disabled: e.isSaving, error: e.errors.codeAfter, label: e.trans(`${e.KEY}.code-after`), placeholder: e.trans(`${e.KEY}.code-placeholder`), value: e.draft.codeAfter }, on: { input: function(o) {
17
+ return e.updateField("codeAfter", o);
18
+ } } })], 1)]);
19
+ }, s = [], d = /* @__PURE__ */ r(
20
+ a,
21
+ n,
22
+ s,
23
+ !1,
24
+ null,
25
+ "929822bc"
26
+ );
27
+ const f = d.exports;
28
+ export {
29
+ f as default
30
+ };
@@ -0,0 +1,81 @@
1
+ import { defineComponent as w, reactive as L, ref as c, computed as u, watch as N } from "vue";
2
+ import R from "../../wrappers/WpDrawer.vue.js";
3
+ import { useDisplayConditions as k, DISPLAY_CONDITIONS_TRANS_KEY as i } from "../../../composables/useDisplayConditions.js";
4
+ import { useTranslations as Y } from "../../../composables/useTranslations.js";
5
+ import { DISPLAY_CONDITION_LIMITS as j } from "../../../enums/display-condition.js";
6
+ import { useDisplayConditionStore as E } from "../../../stores/display-condition.js";
7
+ import { InRadioButton as P, InBasicTextInput as F } from "@useinsider/design-system-vue";
8
+ import G from "./CodeEditorField.vue.js";
9
+ const Z = /* @__PURE__ */ w({
10
+ __name: "DisplayConditionCreateDrawer",
11
+ setup(K) {
12
+ const n = Y(), p = E(), {
13
+ validate: v,
14
+ notifyInvalid: f,
15
+ createInline: y,
16
+ createAndSave: _,
17
+ cancel: b,
18
+ describeWithAcademyLink: B
19
+ } = k(), m = () => ({ name: "", description: "", codeBefore: "", codeAfter: "" }), e = L(m()), o = c({}), r = c(!1), l = c(!1), s = u(() => r.value || l.value), g = c(), I = c();
20
+ let d = 0;
21
+ N(() => p.isCreateOpen, (a) => {
22
+ if (d += 1, !a)
23
+ return;
24
+ const { editing: t } = p;
25
+ Object.assign(e, t ? {
26
+ name: t.name,
27
+ description: t.description,
28
+ codeBefore: t.beforeScript,
29
+ codeAfter: t.afterScript
30
+ } : m()), o.value = {}, r.value = !1;
31
+ }, { immediate: !0 });
32
+ const C = u(() => B("create-description")), D = u(() => ({
33
+ cancelOrBackButton: {
34
+ styling: "ghost",
35
+ type: "secondary",
36
+ labelText: n(`${i}.cancel`),
37
+ disabledStatus: s.value
38
+ },
39
+ secondaryButton: {
40
+ styling: "solid",
41
+ type: "subtle-primary",
42
+ labelText: n(`${i}.create-and-save`),
43
+ loadingStatus: r.value
44
+ },
45
+ primaryButton: {
46
+ styling: "solid",
47
+ type: "primary",
48
+ labelText: n(`${i}.create`),
49
+ disabledStatus: s.value
50
+ }
51
+ })), O = (a, t) => {
52
+ t !== e[a] && (e[a] = t, o.value[a] && (o.value = { ...o.value, [a]: void 0 }));
53
+ }, T = u(() => `${n(`${i}.condition-description`)} <span class="guido-display-condition-create__optional t-c-53">(${n(`${i}.optional`)})</span>`);
54
+ return { __sfc: !0, trans: n, store: p, validate: v, notifyInvalid: f, createInline: y, createAndSave: _, cancel: b, describeWithAcademyLink: B, emptyDraft: m, draft: e, errors: o, isSaving: r, isReadingCode: l, isBusy: s, codeBeforeRef: g, codeAfterRef: I, openGeneration: d, descriptionText: C, footerButtonGroupOptions: D, updateField: O, descriptionLabel: T, submit: async (a) => {
55
+ var S, A;
56
+ if (s.value)
57
+ return;
58
+ const t = d;
59
+ l.value = !0;
60
+ const [$, x] = await Promise.all([(S = g.value) == null ? void 0 : S.read(), (A = I.value) == null ? void 0 : A.read()]);
61
+ if (l.value = !1, t !== d)
62
+ return;
63
+ if (e.codeBefore = $ ?? e.codeBefore, e.codeAfter = x ?? e.codeAfter, o.value = v(e), Object.keys(o.value).length) {
64
+ f();
65
+ return;
66
+ }
67
+ if (a === "inline") {
68
+ y({ ...e });
69
+ return;
70
+ }
71
+ r.value = !0;
72
+ const h = await _({ ...e });
73
+ r.value = !1, o.value = h ?? {}, Object.keys(o.value).length && f();
74
+ }, close: () => {
75
+ s.value || b();
76
+ }, WpDrawer: R, KEY: i, DISPLAY_CONDITION_LIMITS: j, InBasicTextInput: F, InRadioButton: P, CodeEditorField: G };
77
+ }
78
+ });
79
+ export {
80
+ Z as default
81
+ };
@@ -0,0 +1,17 @@
1
+ import n from "./DisplayConditionListState.vue2.js";
2
+ import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var s = function() {
4
+ var e = this, i = e._self._c, t = e._self._setupProxy;
5
+ return i(t.InNoData, { staticClass: "d-f f-d-c j-c-c f-g-1", attrs: { id: t.view.id, "button-status": !!t.view.buttonText, "button-text": t.view.buttonText, description: t.view.description, icon: t.view.icon, title: t.view.title }, on: { click: t.onClick } });
6
+ }, r = [], c = /* @__PURE__ */ o(
7
+ n,
8
+ s,
9
+ r,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const f = c.exports;
15
+ export {
16
+ f as default
17
+ };
@@ -0,0 +1,45 @@
1
+ import { defineComponent as s, computed as a } from "vue";
2
+ import { DISPLAY_CONDITIONS_TRANS_KEY as e } from "../../../composables/useDisplayConditions.js";
3
+ import { useTranslations as c } from "../../../composables/useTranslations.js";
4
+ import { InNoData as p } from "@useinsider/design-system-vue";
5
+ const y = /* @__PURE__ */ s({
6
+ __name: "DisplayConditionListState",
7
+ props: {
8
+ state: null
9
+ },
10
+ emits: ["retry", "create"],
11
+ setup(i, { emit: r }) {
12
+ const o = i, t = c(), n = a(() => {
13
+ switch (o.state) {
14
+ case "error":
15
+ return {
16
+ id: "guido__display-condition-error",
17
+ icon: "no-data",
18
+ title: t(`${e}.error-load-title`),
19
+ description: t(`${e}.error-load`),
20
+ buttonText: t(`${e}.retry`)
21
+ };
22
+ case "empty":
23
+ return {
24
+ id: "guido__display-condition-empty",
25
+ icon: "no-personalization",
26
+ title: t(`${e}.empty-title`),
27
+ description: t(`${e}.empty-description`),
28
+ buttonText: t(`${e}.create-new`)
29
+ };
30
+ default:
31
+ return {
32
+ id: "guido__display-condition-no-result",
33
+ icon: "no-data",
34
+ title: t(`${e}.no-result`)
35
+ };
36
+ }
37
+ });
38
+ return { __sfc: !0, props: o, emit: r, trans: t, view: n, onClick: () => {
39
+ o.state === "error" ? r("retry") : o.state === "empty" && r("create");
40
+ }, InNoData: p };
41
+ }
42
+ });
43
+ export {
44
+ y as default
45
+ };
@@ -0,0 +1,36 @@
1
+ import o from "./DisplayConditionSelectDrawer.vue2.js";
2
+ /* empty css */
3
+ import d from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var a = function() {
5
+ var s = this, e = s._self._c, t = s._self._setupProxy;
6
+ return e("div", { staticClass: "guido-display-condition-select-root" }, [e(t.WpDrawer, { attrs: { id: "guido__display-condition-select-drawer", "description-status": "", "class-name": "guido-display-condition-select-drawer", size: "large", "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, status: t.store.isSelectOpen, "title-text": t.trans(`${t.KEY}.select-title`) }, on: { cancelOrBackButtonEvent: t.cancel, onCloseEvent: t.cancel } }, [e("div", { staticClass: "guido-display-condition-select d-f f-d-c f-g-1" }, [t.store.listStatus === "loaded" && t.store.list.length ? e(t.InBasicTextInput, { staticClass: "mb-4 w-1", attrs: { id: "guido__display-condition-search-input", name: "displayConditionSearch", "character-counter-status": !1, "label-status": !1, "placeholder-text": t.trans(`${t.KEY}.search`), "tooltip-status": !1, value: t.search }, on: { input: function(i) {
7
+ t.search = i;
8
+ } } }) : s._e(), t.store.listStatus === "loading" || t.store.listStatus === "idle" ? e("div", { staticClass: "guido-display-condition-select__list", attrs: { "data-testid": "display-condition-loading" } }, s._l(t.SKELETON_HEIGHTS, function(i, n) {
9
+ return e(t.InSkeleton, { key: n, attrs: { sizing: { width: 856, height: i } } });
10
+ }), 1) : t.listState ? e(t.DisplayConditionListState, { attrs: { state: t.listState }, on: { create: function(i) {
11
+ return t.store.openCreate();
12
+ }, retry: t.loadList } }) : e("ul", { staticClass: "guido-display-condition-select__list" }, s._l(t.filteredList, function(i) {
13
+ return e("li", { key: i.id, staticClass: "guido-display-condition-card bor-w-1 bor-s-s bor-c-50 bor-r-1 b-c-4", attrs: { "data-condition-id": i.id } }, [e("div", { staticClass: "guido-display-condition-card__header" }, [e("div", { staticClass: "guido-display-condition-card__text" }, [e("p", { staticClass: "guido-display-condition-card__name m-0 f-s-13 f-w-600 l-h-2 t-c-55" }, [s._v(" " + s._s(i.name) + " ")]), i.description ? e("p", { staticClass: "guido-display-condition-card__description mt-1 mb-0 f-s-1 l-h-1 t-c-53" }, [s._v(" " + s._s(i.description) + " ")]) : s._e()]), e("div", { staticClass: "guido-display-condition-card__actions" }, [e("div", { staticClass: "guido-display-condition-card__split" }, [e(t.InButtonV2, { attrs: { id: `guido__display-condition-select-${i.id}`, type: "subtle-primary", "label-text": t.trans(`${t.KEY}.select`) }, on: { click: function(n) {
14
+ return t.select(i);
15
+ } } }), e(t.InButtonV2, { attrs: { id: `guido__display-condition-menu-${i.id}`, "left-icon": "filled-dropdown-down", type: "subtle-primary", "label-text-status": !1 }, on: { click: function(n) {
16
+ return t.toggleMenu(i);
17
+ } } }), e(t.InDropdownMenu, { staticClass: "guido-display-condition-card__menu", attrs: { id: `guido__display-condition-menu-list-${i.id}`, "box-width": "basedOnLongestItem", "static-position": "bottom right", "dynamic-position": !1, options: t.menuOptions(i), "select-all-option-status": !1, status: t.menuId === i.id }, on: { clickOutside: function(n) {
18
+ return t.closeMenu(i);
19
+ }, optionClick: function(n) {
20
+ return t.requestDelete(i);
21
+ } } })], 1), e("span", { staticClass: "guido-display-condition-card__divider b-c-6" }), e(t.InButtonV2, { attrs: { id: `guido__display-condition-expand-${i.id}`, styling: "text", type: "secondary", "label-text-status": !1, "left-icon": t.expandedId === i.id ? "filled-dropdown-up" : "filled-dropdown-down", "selected-status": t.expandedId === i.id, "tooltip-options": t.expandTooltip(i), "tooltip-text": t.trans(`${t.KEY}.preview`) }, on: { click: function(n) {
22
+ return t.toggleExpanded(i);
23
+ } } })], 1)]), t.expandedId === i.id ? e("pre", { staticClass: "guido-display-condition-card__code bor-w-1 bor-s-s bor-c-50 bor-r-1 b-c-4 t-c-35 f-s-2 l-h-2" }, [s._v(s._s(t.codeOf(i)))]) : s._e()]);
24
+ }), 0)], 1)]), t.store.pendingDelete ? e("div", { staticClass: "guido-display-condition-select__delete-modal" }, [e(t.WpModal, { attrs: { id: "guido__display-condition-delete-modal", size: "X-small", state: "danger", "close-on-outside-click": !1, "footer-button-options": t.deleteModalButtons, title: t.trans(`${t.KEY}.delete-confirm-title`) }, on: { close: t.closeDeleteModal, "primary-action": t.confirmDelete } }, [e("p", { staticClass: "guido-display-condition-select__delete-text m-0 t-c-55" }, [s._v(" " + s._s(t.trans(`${t.KEY}.delete-confirm-description`, { name: t.store.pendingDelete.name })) + " ")])])], 1) : s._e()], 1);
25
+ }, l = [], c = /* @__PURE__ */ d(
26
+ o,
27
+ a,
28
+ l,
29
+ !1,
30
+ null,
31
+ "0d740001"
32
+ );
33
+ const f = c.exports;
34
+ export {
35
+ f as default
36
+ };