@feedmepos/mf-connect 0.1.0-beta.8 → 0.1.0-beta.81

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 (127) hide show
  1. package/dist/Analytic-C9JWdPcg.js +761 -0
  2. package/dist/{App-SRz4257n.js → App-BVEfQEjU.js} +441 -420
  3. package/dist/AuditLogs-qbqxB_Oz.js +1887 -0
  4. package/dist/Bin-DPfStHeL.js +166 -0
  5. package/dist/{Broadcast-DmkrJGp2.js → Broadcast-CrQZDeiZ.js} +56 -54
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CZXSxA9u.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Fpcw9NWs.js} +14 -10
  7. package/dist/Card-d7rnO53X.js +905 -0
  8. package/dist/Collections-5rEy2lvX.js +464 -0
  9. package/dist/{Credit-CcNrq9qk.js → Credit-CHyEsV7R.js} +36 -34
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
  11. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CLqubY_R.js +2182 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BIZDiLns.js → EffectSheet.vue_vue_type_style_index_0_lang-DEmIYpS6.js} +49 -49
  14. package/dist/{Experience-DNsQLzDH.js → Experience-DhDLyUFN.js} +32 -30
  15. package/dist/FileSaver.min-NlMItPOc.js +74 -0
  16. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
  17. package/dist/Game-CoOZBnN-.js +278 -0
  18. package/dist/Index-BxzvptzX.js +259 -0
  19. package/dist/Marketing-CwxJ5Upf.js +20071 -0
  20. package/dist/Member-D1SRjLZd.js +287 -0
  21. package/dist/MemberList-C-8mcfuk.js +1606 -0
  22. package/dist/MemberTransactions-C7uwJdn8.js +45 -0
  23. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-GCEQCVOt.js → MessageInput.vue_vue_type_script_setup_true_lang-ChQ3zuj7.js} +152 -137
  24. package/dist/Mission-CtF_zohU.js +296 -0
  25. package/dist/Overview-g9HqRUmv.js +1079 -0
  26. package/dist/{Point-Ck8EG_3k.js → Point-BrifiJTO.js} +55 -53
  27. package/dist/Promotion-D-VpO9Y1.js +289 -0
  28. package/dist/Queue-V6tLLO52.js +260 -0
  29. package/dist/Record-C_eSy9Pl.js +341 -0
  30. package/dist/Reward-BcS5W2o6.js +442 -0
  31. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-B_g46hrr.js +150 -0
  32. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CFvxrx8L.js +1728 -0
  33. package/dist/Segment-B7JtvneQ.js +880 -0
  34. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BX-E0sDn.js +181 -0
  35. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-DPByAnL2.js +188 -0
  36. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DE7ROhd5.js +147 -0
  37. package/dist/Setting-1KOQwRHn.js +1932 -0
  38. package/dist/Store-Dj84K8ZK.js +1842 -0
  39. package/dist/StoreRewards-7rXn3J0B.js +423 -0
  40. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-D7zdyg9d.js +1029 -0
  41. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DrzmjYmU.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-D6T7vFXj.js} +1 -1
  42. package/dist/{Tier-CJ9-d8Zg.js → Tier-CwS_A8F5.js} +350 -334
  43. package/dist/{Title-DZCpvg4q.js → Title-YAj_vykl.js} +245 -222
  44. package/dist/{Transaction-DpnTxlbf.js → Transaction-CvbHHpIT.js} +2 -2
  45. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-CYXM679D.js +130 -0
  46. package/dist/Voucher-C0V9koK8.js +354 -0
  47. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DwfF_8uQ.js +419 -0
  48. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-SukfoJpU.js → ZodTextField.vue_vue_type_script_setup_true_lang-D3mmtmvI.js} +1 -1
  49. package/dist/{app-DzAexOqx.js → app-D5BiHqr1.js} +2712 -1266
  50. package/dist/app-TANcLG-R.js +33357 -0
  51. package/dist/app.js +1 -1
  52. package/dist/business-DxNWLRXa.js +79 -0
  53. package/dist/{campaign-winsqufa.js → campaign-DhEbMRyc.js} +2 -2
  54. package/dist/campaign-DqFW5qoE.js +1810 -0
  55. package/dist/campaign.enum-DGpeHkL2.js +20 -0
  56. package/dist/campaign.fn-BqP9eKCL.js +758 -0
  57. package/dist/collectible.enum-CSFqER3H.js +19 -0
  58. package/dist/{collection.fn-CI5Llblg.js → collection.fn-CA112Q3U.js} +2 -2
  59. package/dist/dto-UeacqOxr.js +214 -0
  60. package/dist/{effect-CdkrIYgX.js → effect-CEB8v8KY.js} +33 -16
  61. package/dist/email-addresses-DLDeL77c.js +705 -0
  62. package/dist/{export-DGxfief1.js → export-B_8_zEGl.js} +5 -5
  63. package/dist/{helper-B8RqcTNu.js → helper-BN4JZQLv.js} +1 -1
  64. package/dist/index-B-O8sm9u.js +54 -0
  65. package/dist/index-B-WW-LtM.js +56 -0
  66. package/dist/index-BOQonmqm.js +32 -0
  67. package/dist/{index-9w43_U1v.js → index-CboHpXNN.js} +1506 -1480
  68. package/dist/{index-A34xEz20.js → index-CjJOf_Ko.js} +2246 -871
  69. package/dist/index-CsU66Lo8.js +115 -0
  70. package/dist/index-CsaQJMAR.js +66 -0
  71. package/dist/index-Csb4GQq-.js +29556 -0
  72. package/dist/{index-wzdbEEcZ.js → index-Cv54KpqR.js} +1 -1
  73. package/dist/{index-Cw_aXFH6.js → index-D-9zLobO.js} +269 -173
  74. package/dist/{index-HZC9LLAX.js → index-DLEuoM6n.js} +48 -4
  75. package/dist/{index-CZgQVRsm.js → index-DX1pCi2M.js} +1 -1
  76. package/dist/{index-OzicErwL.js → index-Dtvx0B0f.js} +24 -21
  77. package/dist/index-vh86FiIQ.js +10 -0
  78. package/dist/{loading-DuEFUCwF.js → index-wwxalEHE.js} +4609 -4886
  79. package/dist/{index.esm2017-CppSMh_U.js → index.esm2017-B8lg2TL9.js} +206 -206
  80. package/dist/loading-C7yV_Gjh.js +71 -0
  81. package/dist/{membership-nsMtWeTC.js → membership-DVqBNqdx.js} +80 -66
  82. package/dist/money-DlG5z_tl.js +15 -0
  83. package/dist/number-CEbwCzov.js +12 -0
  84. package/dist/objectid-Du3yg6Vv.js +145 -0
  85. package/dist/plugins-D_RKZlC6.js +208 -0
  86. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  87. package/dist/reward-Bv14VitO.js +36 -0
  88. package/dist/{rule-CPIMqt1h.js → rule-BR5ZUIKH.js} +185 -178
  89. package/dist/{rule-builder-CSs5XRKP.js → rule-builder-CITle0qo.js} +1 -1
  90. package/dist/style.css +1 -1
  91. package/dist/{template-CJZoYavu.js → template-ybPO7TWN.js} +5 -5
  92. package/dist/trigger-5C6n0ORq.js +144 -0
  93. package/dist/user-CP3tloTS.js +54 -0
  94. package/dist/vue-i18n-DGew8_SZ.js +2365 -0
  95. package/dist/{xlsx-BZlnYinX.js → xlsx-CsBnmxHp.js} +1 -1
  96. package/package.json +11 -7
  97. package/dist/Analytic-5QztrYSp.js +0 -622
  98. package/dist/Card-BsjFTVsH.js +0 -825
  99. package/dist/Collections-7wqZHOax.js +0 -453
  100. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Cuklmxur.js +0 -2813
  101. package/dist/Game-DlzDerT7.js +0 -255
  102. package/dist/Marketing-BqhpaG4o.js +0 -316
  103. package/dist/Member-AFgZcdtz.js +0 -69
  104. package/dist/MemberList-BKgrLz2C.js +0 -1733
  105. package/dist/MemberTransactions-BwT3zE2a.js +0 -38
  106. package/dist/Mission-BTAia7AS.js +0 -261
  107. package/dist/Promotion-0v3kvsK3.js +0 -247
  108. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BkFm7tXq.js +0 -1753
  109. package/dist/Segment-BenLupqV.js +0 -437
  110. package/dist/Setting-0fpREqpJ.js +0 -1901
  111. package/dist/Store-BDGwe4ar.js +0 -1511
  112. package/dist/StoreRewards-TDZt9H1V.js +0 -401
  113. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BqpsMcl1.js +0 -890
  114. package/dist/Voucher-DsP_rh8I.js +0 -490
  115. package/dist/app-Cg2pTZJK.js +0 -53428
  116. package/dist/business-Cw_qGw8y.js +0 -78
  117. package/dist/dto-ozu1smC3.js +0 -2770
  118. package/dist/index-BLACZ3-L.js +0 -206
  119. package/dist/index-BaozRfWB.js +0 -762
  120. package/dist/index-CjVmULNd.js +0 -99
  121. package/dist/index-CuvNtC_M.js +0 -61
  122. package/dist/index-DAEmawcj.js +0 -298
  123. package/dist/index-Oxr-mU6h.js +0 -29193
  124. package/dist/money-BGZPFtUc.js +0 -15
  125. package/dist/number-4J0xvXP9.js +0 -12
  126. package/dist/user-Bm4KttFq.js +0 -37
  127. package/dist/vue-i18n-CCyiVzOE.js +0 -2365
@@ -0,0 +1,45 @@
1
+ import { defineComponent as d, ref as p, resolveComponent as _, openBlock as a, createElementBlock as f, createVNode as v, unref as o, createBlock as u, createCommentVNode as b } from "vue";
2
+ import { _ as k, a as x } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-D7zdyg9d.js";
3
+ import { useRouter as y } from "vue-router";
4
+ const C = { class: "flex flex-col gap-y-32 pb-24" }, F = /* @__PURE__ */ d({
5
+ __name: "MemberTransactions",
6
+ setup(T) {
7
+ const r = y(), t = [
8
+ {
9
+ label: "Collection",
10
+ value: "collection"
11
+ },
12
+ {
13
+ label: "Store",
14
+ value: "store"
15
+ }
16
+ ], l = p(
17
+ t.find(
18
+ (s) => {
19
+ var e;
20
+ return s.value == ((e = r.currentRoute.value.query) == null ? void 0 : e.tab);
21
+ }
22
+ ) || t[0]
23
+ ), n = r.currentRoute.value.params.id;
24
+ return (s, e) => {
25
+ const c = _("FmTabs");
26
+ return a(), f("div", C, [
27
+ v(c, {
28
+ "model-value": o(l).value,
29
+ items: t,
30
+ "onUpdate:modelValue": e[0] || (e[0] = (m) => l.value = t.find((i) => i.value === m))
31
+ }, null, 8, ["model-value"]),
32
+ o(l).value == "collection" ? (a(), u(k, {
33
+ key: 0,
34
+ user: o(n)
35
+ }, null, 8, ["user"])) : o(l).value == "store" ? (a(), u(x, {
36
+ key: 1,
37
+ user: o(n)
38
+ }, null, 8, ["user"])) : b("", !0)
39
+ ]);
40
+ };
41
+ }
42
+ });
43
+ export {
44
+ F as default
45
+ };
@@ -1,10 +1,13 @@
1
- import { defineComponent as M, shallowRef as R, openBlock as p, createElementBlock as _, normalizeStyle as O, ref as V, resolveComponent as g, createBlock as E, unref as s, isRef as N, withCtx as x, createVNode as h, createElementVNode as v, createCommentVNode as B, withDirectives as D, vShow as A, computed as q, onMounted as J, Fragment as U, createTextVNode as P, toDisplayString as z, renderList as G } from "vue";
2
- import { p as K } from "./loading-DuEFUCwF.js";
3
- import { r as W } from "./index-BaozRfWB.js";
4
- import { _ as Z } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
- import { _ as Q, S as X } from "./LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js";
6
- import { c as Y } from "./object-qECH92oz.js";
7
- const ee = {
1
+ import { defineComponent as I, shallowRef as G, openBlock as p, createElementBlock as C, normalizeStyle as P, ref as M, resolveComponent as g, createBlock as _, unref as i, isRef as q, withCtx as x, createVNode as h, createElementVNode as v, createCommentVNode as H, withDirectives as A, vShow as B, computed as J, onMounted as z, Fragment as T, createTextVNode as K, toDisplayString as W, renderList as X } from "vue";
2
+ import { p as Y } from "./plugins-D_RKZlC6.js";
3
+ import { B as Z } from "./index-CjJOf_Ko.js";
4
+ import "./index-wwxalEHE.js";
5
+ import { _ as Q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
+ import { _ as ee, S as te } from "./LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js";
7
+ import { c as ne } from "./object-qECH92oz.js";
8
+ import { useCoreStore as oe } from "@feedmepos/mf-common";
9
+ import { u as ae } from "./membership-DVqBNqdx.js";
10
+ const se = {
8
11
  "user.name": {
9
12
  name: "User name"
10
13
  },
@@ -29,40 +32,51 @@ const ee = {
29
32
  "user.point": {
30
33
  name: "User experience"
31
34
  },
35
+ "user.gender": {
36
+ name: "Gender"
37
+ },
38
+ "user.phoneNumber": {
39
+ name: "Phone Number"
40
+ },
32
41
  "transaction.amount": {
33
42
  name: "Reward amount"
34
43
  },
35
44
  "collectible.name": {
36
45
  name: "Reward name"
46
+ },
47
+ "membership.url": {
48
+ name: "Membership URL"
37
49
  }
38
- }, te = "https://editor.unlayer.com/embed.js?2", T = [];
39
- let H = !1;
40
- const ne = (e) => {
50
+ }, Ie = {
51
+ MY: ["user.phoneNumber", "membership.url"]
52
+ }, ie = "https://editor.unlayer.com/embed.js?2", N = [];
53
+ let O = !1;
54
+ const re = (e) => {
41
55
  const n = document.querySelectorAll("script");
42
- let a = !1;
43
- return n.forEach((u) => {
44
- u.src.includes(e) && (a = !0);
45
- }), a;
46
- }, ae = (e) => {
47
- T.push(e);
48
- }, L = () => {
49
- if (H) {
56
+ let r = !1;
57
+ return n.forEach((m) => {
58
+ m.src.includes(e) && (r = !0);
59
+ }), r;
60
+ }, le = (e) => {
61
+ N.push(e);
62
+ }, R = () => {
63
+ if (O) {
50
64
  let e;
51
- for (; e = T.shift(); )
65
+ for (; e = N.shift(); )
52
66
  e();
53
67
  }
54
- }, ie = (e, n = te) => {
55
- if (ae(e), ne(n))
56
- L();
68
+ }, de = (e, n = ie) => {
69
+ if (le(e), re(n))
70
+ R();
57
71
  else {
58
- const a = document.createElement("script");
59
- a.setAttribute("src", n), a.onload = () => {
60
- H = !0, L();
61
- }, document.head.appendChild(a);
72
+ const r = document.createElement("script");
73
+ r.setAttribute("src", n), r.onload = () => {
74
+ O = !0, R();
75
+ }, document.head.appendChild(r);
62
76
  }
63
77
  };
64
- let oe = 0;
65
- const le = M({
78
+ let ue = 0;
79
+ const me = I({
66
80
  name: "EmailEditor",
67
81
  props: {
68
82
  editorId: String,
@@ -91,17 +105,17 @@ const le = M({
91
105
  },
92
106
  computed: {
93
107
  id() {
94
- return this.editorId || `editor-${++oe}`;
108
+ return this.editorId || `editor-${++ue}`;
95
109
  }
96
110
  },
97
111
  setup() {
98
112
  return {
99
- editor: R(null)
113
+ editor: G(null)
100
114
  // Makes editor available to the template
101
115
  };
102
116
  },
103
117
  mounted() {
104
- this.$emit("load"), ie(this.loadEditor.bind(this), this.scriptUrl);
118
+ this.$emit("load"), de(this.loadEditor.bind(this), this.scriptUrl);
105
119
  },
106
120
  methods: {
107
121
  loadEditor() {
@@ -135,15 +149,15 @@ const le = M({
135
149
  (n = this.editor) == null || n.saveDesign(e);
136
150
  }
137
151
  }
138
- }), se = ["id"];
139
- function re(e, n, a, u, y, r) {
140
- return p(), _("div", {
152
+ }), ce = ["id"];
153
+ function pe(e, n, r, m, a, c) {
154
+ return p(), C("div", {
141
155
  id: e.id,
142
156
  class: "unlayer-editor",
143
- style: O({ minHeight: e.minHeight })
144
- }, null, 12, se);
157
+ style: P({ minHeight: e.minHeight })
158
+ }, null, 12, ce);
145
159
  }
146
- const de = /* @__PURE__ */ Z(le, [["render", re], ["__scopeId", "data-v-a9a2bb94"]]), ue = { class: "h-full flex flex-col" }, ce = { class: "flex items-center gap-8" }, me = /* @__PURE__ */ M({
160
+ const he = /* @__PURE__ */ Q(me, [["render", pe], ["__scopeId", "data-v-a9a2bb94"]]), fe = { class: "h-full flex flex-col" }, ge = { class: "flex items-center gap-8" }, be = /* @__PURE__ */ I({
147
161
  __name: "EmailEditorSheet",
148
162
  props: {
149
163
  design: {
@@ -156,83 +170,83 @@ const de = /* @__PURE__ */ Z(le, [["render", re], ["__scopeId", "data-v-a9a2bb94
156
170
  }
157
171
  },
158
172
  emits: ["update:design"],
159
- setup(e, { expose: n, emit: a }) {
160
- const u = V(!1), y = V(null), r = V(!1), b = e, f = V({
173
+ setup(e, { expose: n, emit: r }) {
174
+ const m = M(!1), a = M(null), c = M(!1), b = e, l = M({
161
175
  html: "",
162
176
  design: b.design,
163
177
  title: b.title || ""
164
178
  });
165
- function o(l) {
166
- u.value = l;
179
+ function S(o) {
180
+ m.value = o;
167
181
  }
168
- const t = a;
169
- function m() {
170
- y.value && (y.value.exportHtml((l) => {
171
- f.value = {
172
- html: l.html,
173
- design: l.design,
174
- title: f.value.title
175
- }, t("update:design", f.value);
176
- }), o(!1));
182
+ const w = r;
183
+ function F() {
184
+ a.value && (a.value.exportHtml((o) => {
185
+ l.value = {
186
+ html: o.html,
187
+ design: o.design,
188
+ title: l.value.title
189
+ }, w("update:design", l.value);
190
+ }), S(!1));
177
191
  }
178
192
  return n({
179
- showSheet: o
180
- }), (l, i) => {
181
- const S = g("FmButton"), j = g("FmTextField"), w = g("FmSideSheet");
182
- return p(), E(w, {
183
- modelValue: s(u),
184
- "onUpdate:modelValue": i[4] || (i[4] = (d) => N(u) ? u.value = d : null),
193
+ showSheet: S
194
+ }), (o, t) => {
195
+ const d = g("FmButton"), f = g("FmTextField"), y = g("FmSideSheet");
196
+ return p(), _(y, {
197
+ modelValue: i(m),
198
+ "onUpdate:modelValue": t[4] || (t[4] = (s) => q(m) ? m.value = s : null),
185
199
  header: "Email editor",
186
200
  "max-width": 1280
187
201
  }, {
188
202
  "side-sheet-button": x(() => [
189
- h(S, {
203
+ h(d, {
190
204
  label: "Edit email",
191
205
  variant: "tertiary",
192
206
  icon: "edit"
193
207
  })
194
208
  ]),
195
209
  default: x(() => [
196
- v("div", ue, [
197
- s(r) ? B("", !0) : (p(), E(Q, {
210
+ v("div", fe, [
211
+ i(c) ? H("", !0) : (p(), _(ee, {
198
212
  key: 0,
199
213
  class: "flex-1",
200
- json: s(X),
214
+ json: i(te),
201
215
  width: 100,
202
216
  height: 100
203
217
  }, null, 8, ["json"])),
204
- D(h(j, {
218
+ A(h(f, {
205
219
  label: "Email title",
206
- modelValue: s(f).title,
207
- "onUpdate:modelValue": i[0] || (i[0] = (d) => s(f).title = d)
220
+ modelValue: i(l).title,
221
+ "onUpdate:modelValue": t[0] || (t[0] = (s) => i(l).title = s)
208
222
  }, null, 8, ["modelValue"]), [
209
- [A, s(r)]
223
+ [B, i(c)]
210
224
  ]),
211
- D(h(de, {
225
+ A(h(he, {
212
226
  class: "flex-1",
213
227
  ref_key: "editorRef",
214
- ref: y,
215
- onLoad: i[1] || (i[1] = (d) => r.value = !1),
216
- onReady: i[2] || (i[2] = () => {
217
- var d;
218
- r.value = !0, b.design && ((d = s(y)) == null || d.loadDesign(s(Y)(b.design)));
228
+ ref: a,
229
+ onLoad: t[1] || (t[1] = (s) => c.value = !1),
230
+ onReady: t[2] || (t[2] = () => {
231
+ var s;
232
+ c.value = !0, b.design && ((s = i(a)) == null || s.loadDesign(i(ne)(b.design)));
219
233
  })
220
234
  }, null, 512), [
221
- [A, s(r)]
235
+ [B, i(c)]
222
236
  ])
223
237
  ])
224
238
  ]),
225
239
  "side-sheet-footer": x(() => [
226
- v("div", ce, [
227
- h(S, {
240
+ v("div", ge, [
241
+ h(d, {
228
242
  variant: "primary",
229
243
  label: "Confirm",
230
- onClick: m
244
+ onClick: F
231
245
  }),
232
- h(S, {
246
+ h(d, {
233
247
  variant: "tertiary",
234
248
  label: "Cancel",
235
- onClick: i[3] || (i[3] = (d) => o(!1))
249
+ onClick: t[3] || (t[3] = (s) => S(!1))
236
250
  })
237
251
  ])
238
252
  ]),
@@ -240,7 +254,7 @@ const de = /* @__PURE__ */ Z(le, [["render", re], ["__scopeId", "data-v-a9a2bb94
240
254
  }, 8, ["modelValue"]);
241
255
  };
242
256
  }
243
- }), pe = { class: "space-y-4" }, he = { class: "flex items-center gap-8 justify-between" }, fe = { class: "relative" }, ge = { class: "absolute bottom-[24px] right-[4px]" }, we = /* @__PURE__ */ M({
257
+ }), ye = { class: "space-y-4" }, ve = { class: "flex items-center gap-8 justify-between" }, xe = { class: "relative" }, Se = { class: "absolute bottom-[24px] right-[4px]" }, Le = /* @__PURE__ */ I({
244
258
  __name: "MessageInput",
245
259
  props: {
246
260
  allowEmail: {
@@ -281,9 +295,9 @@ const de = /* @__PURE__ */ Z(le, [["render", re], ["__scopeId", "data-v-a9a2bb94
281
295
  },
282
296
  emits: ["update:model-value"],
283
297
  setup(e, { emit: n }) {
284
- const a = e, u = n;
285
- function y() {
286
- var m;
298
+ const r = oe(), m = ae(), a = e, c = n;
299
+ function b() {
300
+ var d;
287
301
  const o = {
288
302
  user: {
289
303
  name: "John Doe",
@@ -299,14 +313,14 @@ const de = /* @__PURE__ */ Z(le, [["render", re], ["__scopeId", "data-v-a9a2bb94
299
313
  collectible: {
300
314
  name: "RM10 Voucher"
301
315
  }
302
- }, t = W(
303
- ((m = a.modelValue) == null ? void 0 : m.content) ?? "",
316
+ }, t = Z(
317
+ ((d = a.modelValue) == null ? void 0 : d.content) ?? "",
304
318
  o
305
319
  );
306
- K.confirm(t, "Preview message", "OK");
320
+ Y.confirm(t, "Preview message", "OK");
307
321
  }
308
- function r(o, t = "SMS") {
309
- u("update:model-value", {
322
+ function l(o, t = "SMS") {
323
+ c("update:model-value", {
310
324
  channel: t,
311
325
  content: t == "SMS" ? o : o.html,
312
326
  design: t == "EMAIL" ? o.design : void 0,
@@ -315,10 +329,12 @@ const de = /* @__PURE__ */ Z(le, [["render", re], ["__scopeId", "data-v-a9a2bb94
315
329
  variables: a.variables
316
330
  });
317
331
  }
318
- const b = V(a.helperState || "none"), f = q(() => {
319
- var m;
320
- const o = ((m = a.modelValue) == null ? void 0 : m.content.replace(/{{([^}]+)}}/g, (l, i) => {
321
- switch (i) {
332
+ const S = M(a.helperState || "none"), w = J(() => {
333
+ var V, E;
334
+ const o = ((V = m.membership) == null ? void 0 : V.brand) || r.currentBusiness.value.name || "", t = 160;
335
+ let d = t;
336
+ const f = ((E = a.modelValue) == null ? void 0 : E.content.replace(/{{([^}]+)}}/g, (k, j) => {
337
+ switch (j) {
322
338
  case "user.name":
323
339
  return "1234567890";
324
340
  case "user.tier":
@@ -341,79 +357,77 @@ const de = /* @__PURE__ */ Z(le, [["render", re], ["__scopeId", "data-v-a9a2bb94
341
357
  return "...";
342
358
  }
343
359
  })) || "";
344
- let t = 0;
345
- for (let l = 0; l < o.length; l++) {
346
- const i = o.charAt(l);
347
- /[\u4e00-\u9fff\u3040-\u30ff\u3400-\u4dbf]/.test(i) || /[{}\\~\[\]|\^€]/.test(i) ? t += 2 : t += 1;
348
- }
349
- return `Character used: ${t} ≈ ${Math.ceil(t / 160)} SMS (Every 160 characters will be sent as 1 SMS)`;
350
- });
351
- return J(() => {
352
- u("update:model-value", {
360
+ let y = o.length + 4, s = f.length + y;
361
+ (/[\u4e00-\u9fff\u3040-\u30ff\u3400-\u4dbf]/.test(f) || /[\u4e00-\u9fff\u3040-\u30ff\u3400-\u4dbf]/.test(f)) && (d = 70);
362
+ const $ = Math.min(d, t);
363
+ return `Reserverd: ${y} | Character used: ${s} ≈ ${Math.ceil(s / $)} SMS (Every ${$} characters will be sent as 1 SMS)`;
364
+ }), F = [{ label: "SMS" }, { label: "EMAIL" }];
365
+ return z(() => {
366
+ c("update:model-value", {
353
367
  ...a.modelValue,
354
368
  variables: a.variables
355
- }), a.modelValue || r("");
369
+ }), a.modelValue || l("");
356
370
  }), (o, t) => {
357
- var w, d, F, $, k;
358
- const m = g("FmButtonGroup"), l = g("FmButton"), i = g("FmTextarea"), S = g("FmMenuItem"), j = g("FmMenu");
359
- return p(), _("div", pe, [
360
- e.allowEmail ? (p(), E(m, {
371
+ var V, E, k, j, L;
372
+ const d = g("FmButtonGroup"), f = g("FmButton"), y = g("FmTextarea"), s = g("FmMenuItem"), $ = g("FmMenu");
373
+ return p(), C("div", ye, [
374
+ e.allowEmail ? (p(), _(d, {
361
375
  key: 0,
362
- items: [{ label: "SMS" }, { label: "EMAIL" }],
363
- "model-value": { label: (w = e.modelValue) == null ? void 0 : w.channel },
364
- "onUpdate:modelValue": t[0] || (t[0] = (c) => r("", c.label))
365
- }, null, 8, ["model-value"])) : B("", !0),
366
- ((d = e.modelValue) == null ? void 0 : d.channel) == "EMAIL" ? (p(), E(me, {
376
+ items: F,
377
+ "model-value": { label: (V = e.modelValue) == null ? void 0 : V.channel },
378
+ "onUpdate:modelValue": t[0] || (t[0] = (u) => l("", u.label))
379
+ }, null, 8, ["model-value"])) : H("", !0),
380
+ ((E = e.modelValue) == null ? void 0 : E.channel) == "EMAIL" ? (p(), _(be, {
367
381
  key: 1,
368
- design: (F = e.modelValue) == null ? void 0 : F.design,
369
- title: (($ = e.modelValue) == null ? void 0 : $.title) || void 0,
370
- "onUpdate:design": t[1] || (t[1] = (c) => {
371
- r(c, "EMAIL");
382
+ design: (k = e.modelValue) == null ? void 0 : k.design,
383
+ title: ((j = e.modelValue) == null ? void 0 : j.title) || void 0,
384
+ "onUpdate:design": t[1] || (t[1] = (u) => {
385
+ l(u, "EMAIL");
372
386
  })
373
- }, null, 8, ["design", "title"])) : (p(), _(U, { key: 2 }, [
374
- v("div", he, [
387
+ }, null, 8, ["design", "title"])) : (p(), C(T, { key: 2 }, [
388
+ v("div", ve, [
375
389
  t[2] || (t[2] = v("div", { class: "fm-typo-en-body-lg-400" }, "Add message", -1)),
376
- h(l, {
390
+ h(f, {
377
391
  icon: "visibility",
378
392
  label: "Preview message",
379
393
  variant: "plain",
380
- onClick: y
394
+ onClick: b
381
395
  })
382
396
  ]),
383
- v("div", fe, [
384
- h(i, {
385
- "model-value": (k = e.modelValue) == null ? void 0 : k.content,
386
- "onUpdate:modelValue": r,
397
+ v("div", xe, [
398
+ h(y, {
399
+ "model-value": (L = e.modelValue) == null ? void 0 : L.content,
400
+ "onUpdate:modelValue": l,
387
401
  "show-word-count": !0,
388
402
  placeholder: e.placeholder,
389
- "helper-state": s(b) || "none",
390
- "helper-text": s(f)
403
+ "helper-state": i(S) || "none",
404
+ "helper-text": i(w)
391
405
  }, {
392
406
  "helper-text": x(() => [
393
- P(z(s(f)), 1)
407
+ K(W(i(w)), 1)
394
408
  ]),
395
409
  _: 1
396
410
  }, 8, ["model-value", "placeholder", "helper-state", "helper-text"]),
397
- v("div", ge, [
398
- h(j, { placement: "left-end" }, {
411
+ v("div", Se, [
412
+ h($, { placement: "left-end" }, {
399
413
  "menu-button": x(() => [
400
- h(l, {
414
+ h(f, {
401
415
  icon: "add",
402
416
  variant: "tertiary",
403
417
  size: "md"
404
418
  })
405
419
  ]),
406
420
  default: x(() => [
407
- (p(!0), _(U, null, G(e.variables.filter(
408
- (c) => e.triggerType == "SCHEDULE" ? !c.startsWith("transaction.") : !0
409
- ), (c) => {
410
- var C;
411
- return p(), E(S, {
412
- key: c,
413
- label: ((C = s(ee)[c]) == null ? void 0 : C.name) || c,
414
- onClick: (ye) => {
415
- var I;
416
- return r(((I = e.modelValue) == null ? void 0 : I.content) + `{{${c}}}`);
421
+ (p(!0), C(T, null, X(e.variables.filter(
422
+ (u) => e.triggerType == "SCHEDULE" ? !u.startsWith("transaction.") : !0
423
+ ), (u) => {
424
+ var D;
425
+ return p(), _(s, {
426
+ key: u,
427
+ label: ((D = i(se)[u]) == null ? void 0 : D.name) || u,
428
+ onClick: (Ve) => {
429
+ var U;
430
+ return l(((U = e.modelValue) == null ? void 0 : U.content) + `{{${u}}}`);
417
431
  }
418
432
  }, null, 8, ["label", "onClick"]);
419
433
  }), 128))
@@ -428,5 +442,6 @@ const de = /* @__PURE__ */ Z(le, [["render", re], ["__scopeId", "data-v-a9a2bb94
428
442
  }
429
443
  });
430
444
  export {
431
- we as _
445
+ Ie as M,
446
+ Le as _
432
447
  };