@feedmepos/mf-connect 0.1.37-prod → 0.1.38-beta.2

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 (116) hide show
  1. package/dist/Analytic-BjSfI2Ff.js +761 -0
  2. package/dist/{App-Bpo0XZSs.js → App-D11A2JY1.js} +364 -352
  3. package/dist/AuditLogs-DWCFYoRg.js +1887 -0
  4. package/dist/{Bin-ohZ2CZZR.js → Bin-9wV4Ah3M.js} +8 -8
  5. package/dist/{Broadcast-D5x0_-zC.js → Broadcast-I3BtSk8V.js} +40 -40
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CYb38NXA.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-XJqTXbKr.js} +18 -18
  7. package/dist/{Card-BM-Lrm5y.js → Card-CqALG5RM.js} +159 -159
  8. package/dist/{Collections-Cr4aoJer.js → Collections-rg3SzoUb.js} +103 -91
  9. package/dist/{Credit-DzDVFv4H.js → Credit-BNn1sYZv.js} +74 -74
  10. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bs8o9n1V.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-PJ8q72XH.js} +491 -488
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-koqrPPqM.js → EffectSheet.vue_vue_type_style_index_0_lang-Sww7KNle.js} +91 -89
  13. package/dist/{Experience-CjaDdbvZ.js → Experience-D_Qm8SUj.js} +41 -41
  14. package/dist/{FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js → FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js} +2 -6
  15. package/dist/{Game-BuiTygow.js → Game-CKXgXm6Q.js} +31 -31
  16. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  17. package/dist/{Index-CQGzUU-w.js → Index-D4DGfUHd.js} +10 -10
  18. package/dist/Marketing-Dn9A1vgH.js +20073 -0
  19. package/dist/Member-B55vWHDd.js +279 -0
  20. package/dist/MemberList-BWTG9Ohy.js +1606 -0
  21. package/dist/MemberOverview-wL_ailso.js +58 -0
  22. package/dist/{MemberTransactions-DzG1fY0c.js → MemberTransactions-CP5EI-W0.js} +1 -1
  23. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-D--_An-f.js +60279 -0
  24. package/dist/{Mission-BtypT2uF.js → Mission-CFvhROuB.js} +21 -21
  25. package/dist/{Overview-Be7bUtRO.js → Overview-4273yNwL.js} +335 -335
  26. package/dist/{Point-Bw4lnLqp.js → Point-B_-_C919.js} +41 -41
  27. package/dist/Promotion-D2S3COxk.js +289 -0
  28. package/dist/{Queue-CpPEVgn8.js → Queue-BmS1Oi-C.js} +52 -52
  29. package/dist/{Record-DQq4P69i.js → Record-DRBl0M8g.js} +9 -9
  30. package/dist/{Reward-DJH0eM8u.js → Reward-8056NmfK.js} +173 -173
  31. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-_kw_PR0h.js → RewardGroup.vue_vue_type_script_setup_true_lang-CJ_WC2gV.js} +11 -11
  32. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CRGep1RK.js → RuleGroup.vue_vue_type_script_setup_true_lang-DqNQl_nz.js} +635 -548
  33. package/dist/Segment-Bzq-pyhc.js +882 -0
  34. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Dx6Ew9Z_.js → SelectItems.vue_vue_type_script_setup_true_lang-4nNkkklE.js} +2 -2
  35. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-B60_8Toi.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Dnf2oxOG.js} +11 -11
  36. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BCaJ3xKT.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BLYP-5U9.js} +3 -3
  37. package/dist/{Setting-GRIUo7vg.js → Setting-BrJfYoru.js} +432 -432
  38. package/dist/{Store-H0UDQpln.js → Store-Bpl_4yZW.js} +211 -211
  39. package/dist/StoreRewards-Cu7n7Pjz.js +423 -0
  40. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-T3Wo2maC.js +1029 -0
  41. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D-jL1oGS.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-QucRaI08.js} +1 -1
  42. package/dist/{Tier-CJufQcIz.js → Tier-_LnXg3n6.js} +106 -106
  43. package/dist/{Title-BBMgGUld.js → Title-B7AGStvx.js} +133 -131
  44. package/dist/{Transaction-DsucPnfp.js → Transaction-Chxv6V7u.js} +2 -2
  45. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CwOcZEQX.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CzXNmobp.js} +6 -6
  46. package/dist/{Voucher-BPvxKO_w.js → Voucher-C5z2kOq9.js} +153 -123
  47. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DdGMrk2C.js +419 -0
  48. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DMs4XKXM.js → ZodTextField.vue_vue_type_script_setup_true_lang-BlXzEWA6.js} +1 -1
  49. package/dist/{app-D3MT1deX.js → app-7cvPyHJ7.js} +164 -125
  50. package/dist/{app-Bo0JpadQ.js → app-BVojNX0w.js} +1 -1
  51. package/dist/app.js +4 -3
  52. package/dist/business-CmxV69wT.js +79 -0
  53. package/dist/{campaign-Z3l7BoMg.js → campaign-CT_cNJEL.js} +9 -9
  54. package/dist/{campaign-j1c3ou7l.js → campaign-Dq5C_no-.js} +5 -3
  55. package/dist/{campaign.enum-CVXPc5Pd.js → campaign.enum-dp7yHKzF.js} +1 -1
  56. package/dist/campaign.fn-BYZgKDN7.js +758 -0
  57. package/dist/{collectible.enum-CDSikBAy.js → collectible.enum-DxbB4DxT.js} +1 -1
  58. package/dist/{collection.fn-Bz38mGMa.js → collection.fn-CNZRdUgy.js} +2 -2
  59. package/dist/{dto-D648NN4s.js → dto-CT9zZbv9.js} +4 -4
  60. package/dist/{effect-DbMAmVSR.js → effect-FIlOEC4H.js} +1 -1
  61. package/dist/{email-addresses-KOVDrRiK.js → email-addresses-Ba7xImfX.js} +1 -1
  62. package/dist/{export-cTZf8Avd.js → export-uzjZFNF9.js} +3 -3
  63. package/dist/{helper-BYyfcLqw.js → helper-D4sAZde0.js} +1 -1
  64. package/dist/{index-BIaCtk8e.js → index-B9pl4zRZ.js} +192 -79
  65. package/dist/{index-B4MqsaBz.js → index-BI3m1Ehv.js} +3 -3
  66. package/dist/{index-E-0tTd0_.js → index-BXz54M1s.js} +1 -1
  67. package/dist/{index-BMl2KZts.js → index-BjU8LVUC.js} +11447 -10969
  68. package/dist/index-CH3z92VV.js +31 -0
  69. package/dist/{index-BTb8I_eB.js → index-CNJLP3D5.js} +1 -1
  70. package/dist/{index-BrKXRxe_.js → index-CONvJfKv.js} +1 -1
  71. package/dist/index-CS3Jmojj.js +32260 -0
  72. package/dist/{index-CTPMbFf5.js → index-CUfS9Kp1.js} +10 -9
  73. package/dist/index-CsaQJMAR.js +66 -0
  74. package/dist/{index-nF9iYTlh.js → index-CvBcve-r.js} +1 -1
  75. package/dist/index-CwsMG2cV.js +56 -0
  76. package/dist/{index-B3p0hmIV.js → index-D5rvMvzx.js} +1 -1
  77. package/dist/{index-CvoShC5J.js → index-DNxa8Rqx.js} +536 -461
  78. package/dist/{index-DPBHiqsJ.js → index-l2F5MnLF.js} +1 -1
  79. package/dist/{index.esm2017-DFYwde30.js → index.esm2017-ATcsD5N4.js} +127 -127
  80. package/dist/{loading-vUArhX_O.js → loading-BWGQSrCB.js} +1 -1
  81. package/dist/{membership-BHKv29yt.js → membership-Cc4OZ8-U.js} +3 -3
  82. package/dist/{money-Bl3_QRkE.js → money-D7p8nfun.js} +1 -1
  83. package/dist/{number-hh_S9w7k.js → number-CMJjC4qz.js} +1 -1
  84. package/dist/objectid-D5T27iny.js +145 -0
  85. package/dist/{plugins-CVes2wzE.js → plugins-eQis66QR.js} +2 -2
  86. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  87. package/dist/{reward-ANZOdWzf.js → reward-DrnzbG20.js} +1 -1
  88. package/dist/{rule-BvFk5bQg.js → rule-CtRxkYXB.js} +3 -3
  89. package/dist/{rule-builder-BSN777PN.js → rule-builder-Di9RIYHF.js} +17 -17
  90. package/dist/style.css +1 -1
  91. package/dist/{template-Dh9lDLs_.js → template-C3UfY0v5.js} +64 -64
  92. package/dist/{trigger-C7THbt7R.js → trigger-C9U7Zgad.js} +7 -7
  93. package/dist/{usePagination-JoYaROkV.js → usePagination-BeF5K3M7.js} +85 -85
  94. package/dist/{user-DtNR9JY2.js → user-D7n9yYmO.js} +1 -1
  95. package/dist/{vue-i18n-BWyHnm4m.js → vue-i18n-Bz45zC04.js} +387 -387
  96. package/dist/{xlsx-7u9SB0oa.js → xlsx-D4S4qbcZ.js} +226 -226
  97. package/package.json +9 -3
  98. package/dist/Analytic-CavR2bzs.js +0 -427
  99. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +0 -144
  100. package/dist/Marketing-BSspYuhg.js +0 -319
  101. package/dist/Member-B4S0UNGq.js +0 -287
  102. package/dist/MemberList-CfnUJ3mh.js +0 -1606
  103. package/dist/MemberOverview-C2n9oJZh.js +0 -58
  104. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-hZUWLTWj.js +0 -455
  105. package/dist/Promotion-Bg6x0rAh.js +0 -255
  106. package/dist/Segment-BLB4VWNJ.js +0 -882
  107. package/dist/StoreRewards--TNIFaCo.js +0 -423
  108. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CfB8tA5l.js +0 -995
  109. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Bg-9YqLP.js +0 -419
  110. package/dist/business-DMALI7ZO.js +0 -78
  111. package/dist/campaign.fn-rsRhHYZP.js +0 -758
  112. package/dist/index-BsCGyJMY.js +0 -29566
  113. package/dist/index-CuvNtC_M.js +0 -61
  114. package/dist/index-DFKmjCG1.js +0 -44
  115. package/dist/index-Dbd4WA4r.js +0 -61
  116. package/dist/objectid-CEyMlMge.js +0 -145
@@ -1,58 +0,0 @@
1
- import { defineComponent as d, resolveComponent as o, openBlock as r, createElementBlock as s, Fragment as a, createElementVNode as e, createVNode as c, withCtx as v, renderList as p, normalizeClass as _, toDisplayString as n, createCommentVNode as u } from "vue";
2
- const y = { class: "bg-gradient-to-r from-orange-200 p-24 to-blue-200 via-pink-100 mx-[-24px]" }, b = /* @__PURE__ */ e("div", { class: "fm-typo-en-body-lg-600" }, "Member overview", -1), g = { class: "grid grid-cols-6 xs:grid-cols-2 gap-4 divide-x xs:divide-x-0" }, x = { class: "fm-typo-body-md-400 fm-typo-en-body-md-400 mb-2 text-fm-color-typo-secondary" }, f = { class: "fm-typo-en-title-sm-800" }, F = /* @__PURE__ */ d({
3
- __name: "MemberOverview",
4
- setup(k) {
5
- const l = [
6
- {
7
- key: "Total member",
8
- value: 4
9
- },
10
- {
11
- key: "New member",
12
- value: 2
13
- },
14
- {
15
- key: "Member average spend",
16
- value: 100
17
- },
18
- {
19
- key: "Average visit time",
20
- value: 567
21
- },
22
- {
23
- key: "Member growth",
24
- value: "100%"
25
- },
26
- { key: "Inactive member", value: 0 }
27
- ];
28
- return (h, C) => {
29
- const i = o("FmCard");
30
- return o("FmButton"), r(), s(a, null, [
31
- e("div", y, [
32
- c(i, {
33
- variant: "outlined",
34
- class: "flex flex-col gap-16 p-16"
35
- }, {
36
- default: v(() => [
37
- b,
38
- e("div", g, [
39
- (r(), s(a, null, p(l, (t, m) => e("div", {
40
- key: t.key,
41
- class: _(["px-8", { "xs:!border-r": m % 2 == 0 }])
42
- }, [
43
- e("div", x, n(t.key), 1),
44
- e("div", f, n(t.value), 1)
45
- ], 2)), 64))
46
- ])
47
- ]),
48
- _: 1
49
- })
50
- ]),
51
- u("", !0)
52
- ], 64);
53
- };
54
- }
55
- });
56
- export {
57
- F as default
58
- };
@@ -1,455 +0,0 @@
1
- import { defineComponent as I, shallowRef as G, openBlock as h, createElementBlock as F, normalizeStyle as z, ref as w, resolveComponent as b, createBlock as C, unref as i, isRef as P, withCtx as $, createVNode as g, createElementVNode as S, createCommentVNode as H, withDirectives as A, vShow as B, computed as q, onMounted as J, Fragment as T, renderList as Z, normalizeClass as K, toDisplayString as W } from "vue";
2
- import { p as X } from "./plugins-CVes2wzE.js";
3
- import { B as Y } from "./index-CvoShC5J.js";
4
- import "./index-BsCGyJMY.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 se } from "./membership-BHKv29yt.js";
10
- const ae = {
11
- "user.name": {
12
- name: "User name"
13
- },
14
- "user.birthday": {
15
- name: "Birthday"
16
- },
17
- "user.joinAt": {
18
- name: "Join at"
19
- },
20
- "user.expiringVouchers.days7": {
21
- name: "Expiring vouchers in 7 days"
22
- },
23
- "user.expiringVouchers.days30": {
24
- name: "Expiring vouchers in 30 days"
25
- },
26
- "user.expiringVouchers.days90": {
27
- name: "Expiring vouchers in 90 days"
28
- },
29
- "user.tier": {
30
- name: "User tier"
31
- },
32
- "user.point": {
33
- name: "User experience"
34
- },
35
- "user.gender": {
36
- name: "Gender"
37
- },
38
- "user.phoneNumber": {
39
- name: "Phone Number"
40
- },
41
- "transaction.amount": {
42
- name: "Reward amount"
43
- },
44
- "collectible.name": {
45
- name: "Reward name"
46
- },
47
- "membership.url": {
48
- name: "Membership URL"
49
- }
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) => {
55
- const n = document.querySelectorAll("script");
56
- let d = !1;
57
- return n.forEach((u) => {
58
- u.src.includes(e) && (d = !0);
59
- }), d;
60
- }, le = (e) => {
61
- N.push(e);
62
- }, R = () => {
63
- if (O) {
64
- let e;
65
- for (; e = N.shift(); )
66
- e();
67
- }
68
- }, de = (e, n = ie) => {
69
- if (le(e), re(n))
70
- R();
71
- else {
72
- const d = document.createElement("script");
73
- d.setAttribute("src", n), d.onload = () => {
74
- O = !0, R();
75
- }, document.head.appendChild(d);
76
- }
77
- };
78
- let ce = 0;
79
- const ue = I({
80
- name: "EmailEditor",
81
- props: {
82
- editorId: String,
83
- minHeight: {
84
- type: String,
85
- default: "500px"
86
- },
87
- options: Object,
88
- scriptUrl: String,
89
- /**
90
- * @Deprecated Props: Use `options.appearance` instead
91
- */
92
- appearance: Object,
93
- /**
94
- * @Deprecated Props: Use `options.locale` instead
95
- */
96
- locale: String,
97
- /**
98
- * @Deprecated Props: Use `options.projectId` instead
99
- */
100
- projectId: Number,
101
- /**
102
- * @Deprecated Props: Use `options.tools` instead
103
- */
104
- tools: Object
105
- },
106
- computed: {
107
- id() {
108
- return this.editorId || `editor-${++ce}`;
109
- }
110
- },
111
- setup() {
112
- return {
113
- editor: G(null)
114
- // Makes editor available to the template
115
- };
116
- },
117
- mounted() {
118
- this.$emit("load"), de(this.loadEditor.bind(this), this.scriptUrl);
119
- },
120
- methods: {
121
- loadEditor() {
122
- const e = this.options || {};
123
- this.appearance && (e.appearance = this.appearance), this.locale && (e.locale = this.locale), this.projectId && (e.projectId = this.projectId), this.tools && (e.tools = this.tools), this.editor = unlayer.createEditor({
124
- ...e,
125
- id: this.id
126
- }), this.editor.addEventListener("editor:ready", () => {
127
- this.$emit("ready");
128
- });
129
- },
130
- /**
131
- * @deprecated This method will be removed in the next major release. Use `editor.exportHtml` instead.
132
- */
133
- exportHtml(e) {
134
- var n;
135
- (n = this.editor) == null || n.exportHtml(e);
136
- },
137
- /**
138
- * @deprecated This method will be removed in the next major release. Use `editor.loadDesign` instead.
139
- */
140
- loadDesign(e) {
141
- var n;
142
- (n = this.editor) == null || n.loadDesign(e);
143
- },
144
- /**
145
- * @deprecated This method will be removed in the next major release. Use `editor.saveDesign` instead.
146
- */
147
- saveDesign(e) {
148
- var n;
149
- (n = this.editor) == null || n.saveDesign(e);
150
- }
151
- }
152
- }), me = ["id"];
153
- function pe(e, n, d, u, a, m) {
154
- return h(), F("div", {
155
- id: e.id,
156
- class: "unlayer-editor",
157
- style: z({ minHeight: e.minHeight })
158
- }, null, 12, me);
159
- }
160
- const he = /* @__PURE__ */ Q(ue, [["render", pe], ["__scopeId", "data-v-a9a2bb94"]]), ge = { class: "h-full flex flex-col" }, fe = { class: "flex items-center gap-8" }, be = /* @__PURE__ */ I({
161
- __name: "EmailEditorSheet",
162
- props: {
163
- design: {
164
- type: Object,
165
- required: !1
166
- },
167
- title: {
168
- type: String,
169
- required: !1
170
- }
171
- },
172
- emits: ["update:design"],
173
- setup(e, { expose: n, emit: d }) {
174
- const u = w(!1), a = w(null), m = w(!1), x = e, c = w({
175
- html: "",
176
- design: x.design,
177
- title: x.title || ""
178
- });
179
- function E(o) {
180
- u.value = o;
181
- }
182
- const L = d;
183
- function k() {
184
- a.value && (a.value.exportHtml((o) => {
185
- c.value = {
186
- html: o.html,
187
- design: o.design,
188
- title: c.value.title
189
- }, L("update:design", c.value);
190
- }), E(!1));
191
- }
192
- return n({
193
- showSheet: E
194
- }), (o, t) => {
195
- const r = b("FmButton"), f = b("FmTextField"), y = b("FmSideSheet");
196
- return h(), C(y, {
197
- modelValue: i(u),
198
- "onUpdate:modelValue": t[4] || (t[4] = (l) => P(u) ? u.value = l : null),
199
- header: "Email editor",
200
- "max-width": 1280
201
- }, {
202
- "side-sheet-button": $(() => [
203
- g(r, {
204
- label: "Edit email",
205
- variant: "tertiary",
206
- icon: "edit"
207
- })
208
- ]),
209
- default: $(() => [
210
- S("div", ge, [
211
- i(m) ? H("", !0) : (h(), C(ee, {
212
- key: 0,
213
- class: "flex-1",
214
- json: i(te),
215
- width: 100,
216
- height: 100
217
- }, null, 8, ["json"])),
218
- A(g(f, {
219
- label: "Email title",
220
- modelValue: i(c).title,
221
- "onUpdate:modelValue": t[0] || (t[0] = (l) => i(c).title = l)
222
- }, null, 8, ["modelValue"]), [
223
- [B, i(m)]
224
- ]),
225
- A(g(he, {
226
- class: "flex-1",
227
- ref_key: "editorRef",
228
- ref: a,
229
- onLoad: t[1] || (t[1] = (l) => m.value = !1),
230
- onReady: t[2] || (t[2] = () => {
231
- var l;
232
- m.value = !0, x.design && ((l = i(a)) == null || l.loadDesign(i(ne)(x.design)));
233
- })
234
- }, null, 512), [
235
- [B, i(m)]
236
- ])
237
- ])
238
- ]),
239
- "side-sheet-footer": $(() => [
240
- S("div", fe, [
241
- g(r, {
242
- variant: "primary",
243
- label: "Confirm",
244
- onClick: k
245
- }),
246
- g(r, {
247
- variant: "tertiary",
248
- label: "Cancel",
249
- onClick: t[3] || (t[3] = (l) => E(!1))
250
- })
251
- ])
252
- ]),
253
- _: 1
254
- }, 8, ["modelValue"]);
255
- };
256
- }
257
- }), ye = { class: "space-y-4" }, ve = { class: "flex items-center gap-8 justify-between" }, Se = /* @__PURE__ */ S("div", { class: "fm-typo-en-body-lg-400" }, "Add message", -1), xe = { class: "relative" }, Ee = { class: "absolute bottom-[24px] right-[4px]" }, Ue = /* @__PURE__ */ I({
258
- __name: "MessageInput",
259
- props: {
260
- allowEmail: {
261
- type: Boolean,
262
- default: !1
263
- },
264
- modelValue: {
265
- type: Object
266
- },
267
- triggerType: {
268
- type: String,
269
- default: () => "SCHEDULE"
270
- },
271
- helperText: {
272
- type: String
273
- },
274
- helperState: {
275
- type: String
276
- },
277
- variables: {
278
- type: Object,
279
- default: () => [
280
- "user.name",
281
- "user.birthday",
282
- "user.joinAt",
283
- "user.expiringVouchers.days7",
284
- "user.expiringVouchers.days30",
285
- "user.expiringVouchers.days90",
286
- "user.tier",
287
- "user.point",
288
- "transaction.amount",
289
- "collectible.name"
290
- ]
291
- },
292
- placeholder: {
293
- type: String
294
- }
295
- },
296
- emits: ["update:model-value"],
297
- setup(e, { emit: n }) {
298
- const d = oe(), u = se(), a = e, m = n;
299
- function x() {
300
- var r;
301
- const o = {
302
- user: {
303
- name: "John Doe",
304
- tier: 1,
305
- point: 1283,
306
- birthday: (/* @__PURE__ */ new Date("2000-10-02T16:00:00.000Z")).toLocaleDateString(),
307
- joinAt: (/* @__PURE__ */ new Date("2024-06-14")).toLocaleDateString(),
308
- expiringVouchers: { days7: 3, days30: 5, days90: 5 }
309
- },
310
- transaction: {
311
- amount: 3
312
- },
313
- collectible: {
314
- name: "RM10 Voucher"
315
- }
316
- }, t = Y(
317
- ((r = a.modelValue) == null ? void 0 : r.content) ?? "",
318
- o
319
- );
320
- X.confirm(t, "Preview message", "OK");
321
- }
322
- function c(o, t = "SMS") {
323
- m("update:model-value", {
324
- channel: t,
325
- content: t == "SMS" ? o : o.html,
326
- design: t == "EMAIL" ? o.design : void 0,
327
- language: "en",
328
- title: t == "EMAIL" ? o.title : void 0,
329
- variables: a.variables
330
- });
331
- }
332
- const E = w(a.helperState || "none"), L = q(() => {
333
- var M, _;
334
- const o = ((M = u.membership) == null ? void 0 : M.brand) || d.currentBusiness.value.name || "", t = 160;
335
- let r = t;
336
- const f = ((_ = a.modelValue) == null ? void 0 : _.content.replace(/{{([^}]+)}}/g, (v, s) => {
337
- switch (s) {
338
- case "user.name":
339
- return "1234567890";
340
- case "user.tier":
341
- return "1";
342
- case "user.point":
343
- return "1000";
344
- case "user.birthday":
345
- return "01/01/2024";
346
- case "user.joinAt":
347
- return "01/01/2024";
348
- case "user.expiringVouchers.days7":
349
- case "user.expiringVouchers.days30":
350
- case "user.expiringVouchers.days90":
351
- return "5";
352
- case "transaction.amount":
353
- return "100";
354
- case "collectible.name":
355
- return "Voucher";
356
- default:
357
- return "...";
358
- }
359
- })) || "";
360
- let y = o.length + 5;
361
- const l = "^{}\\[~]|€", j = /[^@£$¥èéùìòÇ\nØø\rÅåΔ_ΦΓΛΩΠΨΣΘΞ !"#%&'()*+,\-./0123456789:;<=>?A-ZÄÖÑܧ¿a-zäöñüà^{}\\[~\]|€]/.test(
362
- f
363
- );
364
- let p = 0;
365
- if (j)
366
- p = f.length + y, r = p > 70 ? 67 : 70;
367
- else {
368
- let v = 0;
369
- for (const s of f)
370
- l.includes(s) ? v += 2 : v += 1;
371
- p = v + y, r = p > 160 ? 153 : 160;
372
- }
373
- const V = Math.min(r, t);
374
- return `Reserved: ${y} | Character used: ${p} | Encoding: ${j ? "UCS2" : "GSM 7-bit"}. Estimated ${Math.ceil(p / V)} SMS (Every ${V} characters will be sent as 1 SMS)`;
375
- }), k = [{ label: "SMS" }, { label: "EMAIL" }];
376
- return J(() => {
377
- m("update:model-value", {
378
- ...a.modelValue,
379
- variables: a.variables
380
- }), a.modelValue || c("");
381
- }), (o, t) => {
382
- var p, V, M, _, v;
383
- const r = b("FmButtonGroup"), f = b("FmButton"), y = b("FmTextarea"), l = b("FmMenuItem"), j = b("FmMenu");
384
- return h(), F("div", ye, [
385
- e.allowEmail ? (h(), C(r, {
386
- key: 0,
387
- items: k,
388
- "model-value": { label: (p = e.modelValue) == null ? void 0 : p.channel },
389
- "onUpdate:modelValue": t[0] || (t[0] = (s) => c("", s.label))
390
- }, null, 8, ["model-value"])) : H("", !0),
391
- ((V = e.modelValue) == null ? void 0 : V.channel) == "EMAIL" ? (h(), C(be, {
392
- key: 1,
393
- design: (M = e.modelValue) == null ? void 0 : M.design,
394
- title: ((_ = e.modelValue) == null ? void 0 : _.title) || void 0,
395
- "onUpdate:design": t[1] || (t[1] = (s) => {
396
- c(s, "EMAIL");
397
- })
398
- }, null, 8, ["design", "title"])) : (h(), F(T, { key: 2 }, [
399
- S("div", ve, [
400
- Se,
401
- g(f, {
402
- icon: "visibility",
403
- label: "Preview message",
404
- variant: "plain",
405
- onClick: x
406
- })
407
- ]),
408
- S("div", xe, [
409
- g(y, {
410
- "model-value": (v = e.modelValue) == null ? void 0 : v.content,
411
- "onUpdate:modelValue": c,
412
- "show-word-count": !0,
413
- placeholder: e.placeholder,
414
- "helper-state": i(E) || "none"
415
- }, null, 8, ["model-value", "placeholder", "helper-state"]),
416
- S("div", Ee, [
417
- g(j, { placement: "left-end" }, {
418
- "menu-button": $(() => [
419
- g(f, {
420
- icon: "add",
421
- variant: "tertiary",
422
- size: "md"
423
- })
424
- ]),
425
- default: $(() => [
426
- (h(!0), F(T, null, Z(e.variables.filter(
427
- (s) => e.triggerType == "SCHEDULE" ? !s.startsWith("transaction.") : !0
428
- ), (s) => {
429
- var U;
430
- return h(), C(l, {
431
- key: s,
432
- label: ((U = i(ae)[s]) == null ? void 0 : U.name) || s,
433
- onClick: (Ve) => {
434
- var D;
435
- return c(((D = e.modelValue) == null ? void 0 : D.content) + `{{${s}}}`);
436
- }
437
- }, null, 8, ["label", "onClick"]);
438
- }), 128))
439
- ]),
440
- _: 1
441
- })
442
- ])
443
- ]),
444
- S("span", {
445
- class: K(["fm-typo-en-body-md-400 text-fm-color-neutral-gray-400", i(E)])
446
- }, W(i(L)), 3)
447
- ], 64))
448
- ]);
449
- };
450
- }
451
- });
452
- export {
453
- Ie as M,
454
- Ue as _
455
- };