@feedmepos/mf-connect 0.1.38-beta.8 → 0.1.38-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 (159) hide show
  1. package/dist/{Analytic-CJap-Cat.js → Analytic-FMehGs58.js} +31 -32
  2. package/dist/{App-CLTtX1QT.js → App-7cwNu3e0.js} +617 -607
  3. package/dist/AuditLogs-CpmLBHAR.js +1991 -0
  4. package/dist/{Bin-C2xMLxoE.js → Bin-D21tScmC.js} +10 -10
  5. package/dist/Broadcast-DrX9zS2Z.js +266 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BCkD7Xfn.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BvN7Q36X.js} +6 -6
  7. package/dist/{Card-BPrCNLQy.js → Card-Nk0KHSjb.js} +145 -140
  8. package/dist/Collections-BAnIaZRj.js +540 -0
  9. package/dist/Credit-BhU_Vd3l.js +260 -0
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  11. package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
  12. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DUrvbUE4.js +3120 -0
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CqBGsZmi.js +351 -0
  15. package/dist/Experience-B7Fl1uzk.js +259 -0
  16. package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-DaCnYliS.js} +1 -1
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
  19. package/dist/Game-BdkSBpyV.js +330 -0
  20. package/dist/Grab-y_ISAZvb.js +300 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js → ImageInput.vue_vue_type_script_setup_true_lang-WEsv0wME.js} +49 -48
  22. package/dist/{Index-DMdNgISh.js → Index-DZp0xkxW.js} +54 -54
  23. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-DXMshwQu.js +48 -0
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-24MFkuKg.js} +1 -1
  25. package/dist/{MainLayout-B1aJoR95.js → MainLayout-B8VvzvAT.js} +1 -1
  26. package/dist/Marketing-BXfk7ZLc.js +166 -0
  27. package/dist/MarketingMaterialEdit-CoDx_QvV.js +1065 -0
  28. package/dist/{Member-CnSXGQi_.js → Member-DOP3Z4-m.js} +38 -37
  29. package/dist/{MemberList-DcpEKV1D.js → MemberList-BcMezuLM.js} +486 -491
  30. package/dist/{MemberTransactions-DeuuEcO5.js → MemberTransactions-BEG9Cfgw.js} +1 -1
  31. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DLAEPNsq.js → MessageInput.vue_vue_type_script_setup_true_lang-R6ImfcMO.js} +13443 -10607
  32. package/dist/Mission-C4eWldYu.js +334 -0
  33. package/dist/{Overview-elpi-jpI.js → Overview-0V1dmEPw.js} +24 -25
  34. package/dist/Point-s9t7_Iee.js +262 -0
  35. package/dist/Promotion-VZCoFHHx.js +396 -0
  36. package/dist/{Queue-GvBhNEFe.js → Queue-DdoHcsXv.js} +23 -24
  37. package/dist/{Record-CbSxgo8i.js → Record-B73AsvsB.js} +10 -10
  38. package/dist/Review-eEJG7-gc.js +621 -0
  39. package/dist/ReviewFacebookCallback-Cq1fGEP3.js +243 -0
  40. package/dist/ReviewGoogleCallback-C7BBKqnK.js +213 -0
  41. package/dist/{Reward-QCGlrq89.js → Reward-DKFT9MmI.js} +16 -16
  42. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DSRvoo9z.js → RewardGroup.vue_vue_type_script_setup_true_lang-vbTI-3-L.js} +13 -14
  43. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Dc4daP4P.js +1912 -0
  44. package/dist/{Segment-5PndnEUa.js → Segment-RAMBNzZd.js} +273 -274
  45. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DXR7bpzY.js → SelectItems.vue_vue_type_script_setup_true_lang-pQmd43cO.js} +23 -23
  46. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DmITlNtt.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-PwedwyBw.js} +12 -12
  47. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-rN37l0uX.js +226 -0
  48. package/dist/Setting--t7CPcWL.js +2039 -0
  49. package/dist/SettingAdvertisements-BzhckLOK.js +264 -0
  50. package/dist/Store-Dnax6l9z.js +1996 -0
  51. package/dist/StoreRewards-BIdtA-W4.js +535 -0
  52. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B__Nqwzg.js +1129 -0
  53. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-on00idd9.js +7007 -0
  54. package/dist/{Tier-BKKxG29r.js → Tier-Ch63LeNc.js} +561 -480
  55. package/dist/{Title-CReZgw8V.js → Title-wOMe2o3w.js} +151 -149
  56. package/dist/{Transaction-HWCmSVaJ.js → Transaction-CpkfV_sQ.js} +2 -2
  57. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-D00AchXo.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-MPlAwheJ.js} +7 -7
  58. package/dist/Voucher-DlOZmlyt.js +421 -0
  59. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DBAk4tDY.js +421 -0
  60. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DXF39yC1.js → ZodTextField.vue_vue_type_script_setup_true_lang-BhCfP2wn.js} +2 -2
  61. package/dist/app-nACimuOe.js +59309 -0
  62. package/dist/app.js +1 -1
  63. package/dist/{business-Bc-EMd2p.js → business-BpM7Eni_.js} +11 -8
  64. package/dist/campaign-BaSTB-19.js +219 -0
  65. package/dist/campaign-CN7MibEN.js +253 -0
  66. package/dist/campaign.enum-CW4ESvMk.js +26 -0
  67. package/dist/campaign.fn-DPMaaXjP.js +776 -0
  68. package/dist/{collectible.enum-C4dM8khp.js → collectible.enum-_Bg6BIol.js} +1 -1
  69. package/dist/{collection.fn-AjDNdFe1.js → collection.fn-D86VQVrc.js} +2 -2
  70. package/dist/dto-By8psmkB.js +222 -0
  71. package/dist/duplicateCampaign-AVfDsabR.js +51 -0
  72. package/dist/effect-CCB9eCEr.js +89 -0
  73. package/dist/{email-addresses-B0SzUCQM.js → email-addresses-CyMOiGPR.js} +2 -2
  74. package/dist/{export-Bgz6WcNZ.js → export-DPUTGKPb.js} +4 -4
  75. package/dist/{helper-B1vFwohM.js → helper-CYKFnu8y.js} +22 -7
  76. package/dist/index-43V5T9JA.js +28899 -0
  77. package/dist/{index-DVQnrex_.js → index-9FXa-6Mk.js} +3 -3
  78. package/dist/{index-26SopNpv.js → index-B9vArh0F.js} +1 -1
  79. package/dist/index-BF2vcn02.js +3431 -0
  80. package/dist/{index-BIRmS75g.js → index-BPBdEGEz.js} +1 -1
  81. package/dist/index-BTaTuuEo.js +48 -0
  82. package/dist/{index-Cm2sBagk.js → index-Beq-ShJI.js} +1 -1
  83. package/dist/{index-CSQY21Zb.js → index-BxGFddJP.js} +3 -3
  84. package/dist/index-C0veCCui.js +85 -0
  85. package/dist/index-C0yZzlB3.js +8912 -0
  86. package/dist/index-CJy_KEtq.js +30289 -0
  87. package/dist/{index-DwT9RLst.js → index-CZRA2IY5.js} +23 -12
  88. package/dist/{index-DT2viYsL.js → index-Cpff1wjo.js} +617 -191
  89. package/dist/index-CuvNtC_M.js +61 -0
  90. package/dist/{index.esm2017-BAIN70_n.js → index.esm2017-DHrbC5Ry.js} +185 -185
  91. package/dist/{loading-C6Ouh0mG.js → loading-BSMi2eIc.js} +1 -1
  92. package/dist/{lodash-B5I3zXaY.js → lodash-DZxxJH2N.js} +1 -1
  93. package/dist/{membership-DU0BwIj8.js → membership-CWkspNDR.js} +3 -3
  94. package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
  95. package/dist/{money-Bg7GuE5s.js → money-CSBC-3Ol.js} +1 -1
  96. package/dist/{number-Ddmqo5D_.js → number-CeqAGZy9.js} +1 -1
  97. package/dist/objectid-C_sYOjBD.js +145 -0
  98. package/dist/{campaign-BeF8kTyg.js → plugins-B37e5K6S.js} +784 -777
  99. package/dist/remy-DM_pSPd3.js +46 -0
  100. package/dist/{reward-CN4gvn4c.js → reward-BHf9o7F7.js} +1 -1
  101. package/dist/{rule-CpiqqR0c.js → rule-CAOC63go.js} +505 -487
  102. package/dist/rule-builder-BTxbYw5Z.js +102 -0
  103. package/dist/style.css +11 -2
  104. package/dist/template-DHmXFTjv.js +188 -0
  105. package/dist/timezone-C9EUfUmm.js +1156 -0
  106. package/dist/trigger--TbXeeFT.js +213 -0
  107. package/dist/usePagination-Lr6F7nYH.js +220 -0
  108. package/dist/user-DOc3B6F_.js +55 -0
  109. package/dist/{vue-i18n-DVmD9I_o.js → vue-i18n-DQbt3scE.js} +409 -409
  110. package/dist/{xlsx-qJHsnW7k.js → xlsx-QxmpwFgC.js} +1 -1
  111. package/dist/{zod-Bg2FbC-D.js → zod-OfQMlh-A.js} +32 -31
  112. package/package.json +14 -6
  113. package/dist/AuditLogs-DW4rwNOn.js +0 -1887
  114. package/dist/Broadcast-Dhc0j16O.js +0 -227
  115. package/dist/Collections-CsUJEmqz.js +0 -465
  116. package/dist/Credit-Mqa-0XJd.js +0 -222
  117. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +0 -108
  118. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DWWLxIq-.js +0 -2185
  119. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BiQGZeDc.js +0 -347
  120. package/dist/Experience-BD5C3old.js +0 -223
  121. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  122. package/dist/Game-D4xsi8Ym.js +0 -278
  123. package/dist/Marketing-axcQYl8k.js +0 -20073
  124. package/dist/Mission-BHZiL-GH.js +0 -296
  125. package/dist/Point-gKvdggAl.js +0 -226
  126. package/dist/Promotion-7x2F_sFX.js +0 -289
  127. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-AuN9NgcG.js +0 -1751
  128. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DTlv8ZAn.js +0 -147
  129. package/dist/Setting-Cab47wfH.js +0 -1936
  130. package/dist/Store-BFL3T9B5.js +0 -1842
  131. package/dist/StoreRewards-C43dCJtM.js +0 -423
  132. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-aAj5-nzZ.js +0 -1029
  133. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-K3OPSYrF.js +0 -139
  134. package/dist/Voucher-BhUAcPZg.js +0 -384
  135. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-C0YNez2L.js +0 -419
  136. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  137. package/dist/app-BGaUIdCr.js +0 -7086
  138. package/dist/app-DccKBdW_.js +0 -33357
  139. package/dist/campaign-DbJZEU7P.js +0 -96
  140. package/dist/campaign.enum-PBKYGUQY.js +0 -20
  141. package/dist/campaign.fn-Cq-4LfQj.js +0 -758
  142. package/dist/dto-8NvMMYAb.js +0 -214
  143. package/dist/effect-DZhcEQ5g.js +0 -78
  144. package/dist/index-CQQedv0M.js +0 -32260
  145. package/dist/index-CTgQRqQR.js +0 -30038
  146. package/dist/index-CsaQJMAR.js +0 -66
  147. package/dist/index-DGaywhpY.js +0 -76
  148. package/dist/index-DOfLDlI8.js +0 -8861
  149. package/dist/index-DVpAocyR.js +0 -3120
  150. package/dist/index-DlJGd8RC.js +0 -121
  151. package/dist/index-Dm65CTdy.js +0 -38
  152. package/dist/objectid-MCaJXAgq.js +0 -145
  153. package/dist/plugins-C-CRzeyC.js +0 -208
  154. package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
  155. package/dist/rule-builder-DmkJng-x.js +0 -89
  156. package/dist/template-DTZgnkl5.js +0 -190
  157. package/dist/trigger-CPjJ73Rc.js +0 -144
  158. package/dist/usePagination-BeF5K3M7.js +0 -223
  159. package/dist/user-8VIt8A1x.js +0 -54
@@ -1,227 +0,0 @@
1
- import { defineComponent as N, ref as h, computed as U, onMounted as j, resolveComponent as r, openBlock as l, createElementBlock as y, Fragment as b, createVNode as i, unref as t, createElementVNode as n, withCtx as v, renderList as E, createBlock as w, resolveDynamicComponent as H, toDisplayString as d, createCommentVNode as q, h as z } from "vue";
2
- import { _ as G } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as J, components as Q } from "@feedmepos/ui-library";
4
- import { p as W } from "./plugins-C-CRzeyC.js";
5
- import { u as X } from "./loading-C6Ouh0mG.js";
6
- import { u as Y } from "./business-Bc-EMd2p.js";
7
- import { u as Z } from "./campaign-DbJZEU7P.js";
8
- import { a as B, b as A, g as ee } from "./campaign-BeF8kTyg.js";
9
- import { u as te } from "./vue-i18n-DVmD9I_o.js";
10
- import { _ as oe } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
11
- import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DWWLxIq-.js";
12
- import { u as ne } from "./template-DTZgnkl5.js";
13
- import { c as _ } from "./index-DlJGd8RC.js";
14
- const se = { class: "px-24 flex flex-col gap-y-16" }, ce = { class: "flex items-center justify-between w-full" }, ie = { class: "flex gap-8 overflow-x-auto" }, re = { class: "space-y-8" }, le = { class: "flex w-full gap-4 items-center" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "space-y-4" }, pe = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { key: 0 }, ge = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, ye = { class: "flex flex-col gap-16 text-center" }, _e = { class: "fm-typo-en-title-sm-800" }, he = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Te = /* @__PURE__ */ N({
15
- __name: "Broadcast",
16
- setup(be) {
17
- const { t: s } = te(), V = {
18
- label: s("connect.campaign.common.createCampaign"),
19
- value: "create",
20
- isPrimary: !0,
21
- prependIcon: "add"
22
- }, D = ne("BROADCAST", J()), R = Y(), m = Z(), { global: L, minor: C } = X, T = h((/* @__PURE__ */ new Date()).toISOString()), c = h({
23
- searchKey: "",
24
- location: null
25
- }), f = U(
26
- () => m.campaigns.broadcast.filter(
27
- (e) => !c.value.location || !e.targetLocation || e.targetLocation.includes(c.value.location)
28
- )
29
- ), I = [
30
- {
31
- header: "Broadcast title",
32
- accessorFn: (e) => e.name
33
- },
34
- {
35
- header: "Status",
36
- accessorFn: (e) => ee(e),
37
- cell(e) {
38
- return B(e.row.original);
39
- }
40
- },
41
- {
42
- header: "Summary",
43
- accessorFn: (e) => A(e)
44
- },
45
- {
46
- header: "Message sent",
47
- accessorFn: (e) => e.currentReceive ?? "N/A"
48
- },
49
- {
50
- header: "Actions",
51
- cell(e) {
52
- return z(Q.FmButton, {
53
- variant: "tertiary",
54
- icon: "delete",
55
- iconColor: "neutral-gray-400",
56
- onClick: (o) => {
57
- o.stopPropagation(), S(e.row.original);
58
- }
59
- });
60
- }
61
- }
62
- ], x = h();
63
- async function S(e) {
64
- await W.remove(
65
- s("connect.campaign.common.remove.confirm", { name: e.name })
66
- ) && await C(
67
- async () => {
68
- await _.delete(e._id), await m.read("BROADCAST");
69
- },
70
- {
71
- message: s("connect.campaign.common.remove.removing", { name: e.name }),
72
- successMessage: s("connect.campaign.common.remove.removed", {
73
- name: e.name
74
- })
75
- }
76
- );
77
- }
78
- async function g(e) {
79
- T.value = (/* @__PURE__ */ new Date()).toISOString(), e ? await o() : D.open(async (p) => {
80
- await o(p);
81
- });
82
- async function o(p) {
83
- var u;
84
- (u = x.value) == null || u.showSheet(
85
- !0,
86
- "BROADCAST",
87
- e ? await _.readById(e._id) : void 0,
88
- p
89
- );
90
- }
91
- }
92
- async function K(e) {
93
- await C(
94
- async () => {
95
- e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await m.read("BROADCAST");
96
- },
97
- {
98
- message: s(
99
- `connect.campaign.broadcast.update.${e.campaign._id ? "updating" : "creating"}`
100
- ),
101
- successMessage: s("connect.campaign.broadcast.update.success", {
102
- action: e.campaign._id ? "updated" : "created"
103
- })
104
- }
105
- );
106
- }
107
- return j(async () => {
108
- await L(async () => {
109
- await m.read("BROADCAST");
110
- });
111
- }), (e, o) => {
112
- const p = r("FmPageHead"), u = r("FmSearch"), O = r("FmTable"), F = r("FmButton"), $ = r("FmListItem"), P = r("FmList"), M = r("FmCard");
113
- return l(), y(b, null, [
114
- i(p, {
115
- title: t(s)("connect.campaign.broadcast.title"),
116
- actions: t(f).length > 0 ? [V] : [],
117
- "onClick:action": o[0] || (o[0] = () => g())
118
- }, null, 8, ["title", "actions"]),
119
- n("div", se, [
120
- i(u, {
121
- modelValue: t(c).searchKey,
122
- "onUpdate:modelValue": o[1] || (o[1] = (a) => t(c).searchKey = a),
123
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
124
- placeholder: t(s)("connect.campaign.common.search"),
125
- collapsible: ""
126
- }, null, 8, ["modelValue", "placeholder"]),
127
- t(m).campaigns.broadcast && t(m).campaigns.broadcast.length > 0 ? (l(), y(b, { key: 0 }, [
128
- n("div", ce, [
129
- n("div", ie, [
130
- i(oe, {
131
- modelValue: t(c).location,
132
- "onUpdate:modelValue": o[2] || (o[2] = (a) => t(c).location = a),
133
- label: `${t(s)("connect.campaign.common.location")}: `,
134
- "show-item-label": !0,
135
- icon: "storefront",
136
- placement: "bottom-start",
137
- items: t(R).locationItems
138
- }, null, 8, ["modelValue", "label", "items"])
139
- ]),
140
- i(u, {
141
- modelValue: t(c).searchKey,
142
- "onUpdate:modelValue": o[3] || (o[3] = (a) => t(c).searchKey = a),
143
- class: "xs:hidden",
144
- placeholder: "search",
145
- collapsible: ""
146
- }, null, 8, ["modelValue"])
147
- ]),
148
- i(O, {
149
- class: "xs:hidden",
150
- "row-data": t(f),
151
- "column-defs": I,
152
- "search-value": t(c).searchKey,
153
- "column-filter": [],
154
- onRowClick: o[4] || (o[4] = (a) => g(a.original)),
155
- "hide-footer": !0
156
- }, null, 8, ["row-data", "search-value"]),
157
- i(P, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
158
- default: v(() => [
159
- (l(!0), y(b, null, E(t(f).filter(
160
- (a) => a.name.toLowerCase().includes(t(c).searchKey.toLowerCase())
161
- ), (a) => (l(), w($, {
162
- key: a._id.toString(),
163
- onClick: (k) => g(a),
164
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
165
- }, {
166
- default: v(() => [
167
- n("div", re, [
168
- n("div", le, [
169
- (l(), w(H(t(B)(a)))),
170
- n("div", me, d(a.currentReceive ?? 0) + " sent ", 1)
171
- ]),
172
- n("div", de, [
173
- n("div", pe, d(a.name), 1),
174
- n("div", ue, d(t(A)(a)), 1)
175
- ])
176
- ]),
177
- i(F, {
178
- icon: "delete",
179
- "icon-color": "neutral-gray-400",
180
- variant: "tertiary",
181
- onClick: (k) => (k.stopPropagation(), S(a))
182
- }, null, 8, ["onClick"])
183
- ]),
184
- _: 2
185
- }, 1032, ["onClick"]))), 128))
186
- ]),
187
- _: 1
188
- }),
189
- t(f).length == 0 ? (l(), y("div", fe, [
190
- n("div", ge, d(t(s)("connect.campaign.common.noResults")), 1)
191
- ])) : q("", !0)
192
- ], 64)) : (l(), w(M, {
193
- key: 1,
194
- variant: "outlined",
195
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
196
- }, {
197
- default: v(() => [
198
- o[6] || (o[6] = n("img", {
199
- src: G,
200
- class: "aspect-square w-[150px]"
201
- }, null, -1)),
202
- n("div", ye, [
203
- n("div", _e, d(t(s)("connect.campaign.broadcast.create.title")), 1),
204
- n("div", he, d(t(s)("connect.campaign.broadcast.create.description")), 1)
205
- ]),
206
- i(F, {
207
- variant: "primary",
208
- label: t(s)("connect.campaign.broadcast.create.button"),
209
- icon: "add",
210
- onClick: o[5] || (o[5] = (a) => g())
211
- }, null, 8, ["label"])
212
- ]),
213
- _: 1
214
- })),
215
- i(ae, {
216
- ref_key: "sheetRef",
217
- ref: x,
218
- "onSubmit:modelValue": K
219
- }, null, 512)
220
- ])
221
- ], 64);
222
- };
223
- }
224
- });
225
- export {
226
- Te as default
227
- };
@@ -1,465 +0,0 @@
1
- var ae = Object.defineProperty;
2
- var le = (g, i, d) => i in g ? ae(g, i, { enumerable: !0, configurable: !0, writable: !0, value: d }) : g[i] = d;
3
- var O = (g, i, d) => le(g, typeof i != "symbol" ? i + "" : i, d);
4
- import { defineComponent as J, ref as f, computed as Q, watch as K, resolveComponent as u, openBlock as y, createBlock as z, unref as o, isRef as j, withCtx as I, createElementVNode as h, createVNode as r, createElementBlock as N, Fragment as P, renderList as ne, createCommentVNode as R, onMounted as se, h as S } from "vue";
5
- import { h as G } from "./moment-BWErdI6_.js";
6
- import { components as H } from "@feedmepos/ui-library";
7
- import "./index-CQQedv0M.js";
8
- import { J as re } from "./JsonViewer-v8_C7l5N.js";
9
- import { u as W } from "./loading-C6Ouh0mG.js";
10
- import { u as ie } from "./app-wDQR6dpb.js";
11
- import { useRoute as X, useRouter as ue } from "vue-router";
12
- import { c as q } from "./index-DlJGd8RC.js";
13
- import { e as p } from "./index-vh86FiIQ.js";
14
- import { u as Y, w as de } from "./xlsx-qJHsnW7k.js";
15
- import { u as ce, _ as me } from "./usePagination-BeF5K3M7.js";
16
- import { a as pe } from "./plugins-C-CRzeyC.js";
17
- import { m as fe } from "./index-BIRmS75g.js";
18
- import { o as ge } from "./objectId-dwaoBfJX.js";
19
- const be = { class: "space-y-16" }, Ce = { class: "gap-16 grid grid-cols-2" }, ve = { class: "flex items-center gap-8" }, he = /* @__PURE__ */ J({
20
- __name: "CreateCollectionSheet",
21
- emits: ["success"],
22
- setup(g, { expose: i, emit: d }) {
23
- const { minor: w } = W, F = X(), k = f(), _ = f(!1), A = d, b = f(!1);
24
- function D(s) {
25
- b.value = s, s && (a.value = {
26
- quantity: 1,
27
- code: "",
28
- codeConfig: {
29
- length: 8,
30
- charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
31
- prefix: "",
32
- suffix: "",
33
- pattern: "########"
34
- }
35
- });
36
- }
37
- const a = f({
38
- quantity: 1,
39
- code: "",
40
- codeConfig: {
41
- length: 8,
42
- charset: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
43
- prefix: "",
44
- suffix: "",
45
- pattern: "########"
46
- }
47
- }), E = [
48
- {
49
- label: "Bulk codes",
50
- value: "bulk",
51
- sublabel: "Bulk generate unique codes"
52
- },
53
- {
54
- label: "Custom code",
55
- value: "single",
56
- sublabel: "Enter your own custom codes"
57
- }
58
- ], U = [
59
- {
60
- label: "Alphanumeric",
61
- value: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
62
- },
63
- {
64
- label: "Alphabetic",
65
- value: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
66
- },
67
- { label: "Alphabetic Lowercase", value: "abcdefghijklmnopqrstuvwxyz" },
68
- { label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
69
- { label: "Numbers", value: "0123456789" },
70
- { label: "Custom", value: "" }
71
- ], x = f(U[0].value), c = f("bulk"), V = f(!1), M = Q(() => F.params.id);
72
- async function n(s) {
73
- var e;
74
- await ((e = k.value) == null ? void 0 : e.validateInputs()), _.value && await w(
75
- async () => {
76
- await q.createCollectionByCampaignId(M.value, s), await A("success");
77
- },
78
- {
79
- message: "Creating claim(s)",
80
- successMessage: "Claim(s) created"
81
- }
82
- );
83
- }
84
- i({
85
- showSheet: D
86
- }), K(
87
- () => c.value,
88
- (s, e) => {
89
- e != s && (a.value.code = "", a.value.codeConfig.length = 8, a.value.codeConfig.charset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", a.value.codeConfig.prefix = "", a.value.codeConfig.suffix = "", a.value.codeConfig.pattern = "########");
90
- }
91
- );
92
- function l(s) {
93
- if (c.value !== "single") return !1;
94
- const e = s.split(`
95
- `).map((v) => v.trim()).filter(Boolean);
96
- return new Set(e).size !== e.length;
97
- }
98
- function C(s) {
99
- return /[ \t]/.test(s);
100
- }
101
- return K(
102
- () => a.value.codeConfig.length,
103
- (s, e) => {
104
- s != e && (a.value.codeConfig.pattern = "#".repeat(Math.min(16, Number(s))));
105
- }
106
- ), (s, e) => {
107
- const v = u("FmRadio"), L = u("FmRadioGroup"), m = u("FmSwitch"), T = u("FmStepperField"), Z = u("FmSelect"), B = u("FmTextField"), ee = u("FmTextarea"), oe = u("FmForm"), $ = u("FmButton"), te = u("FmSideSheet");
108
- return y(), z(te, {
109
- "max-width": 560,
110
- "dismiss-away": !0,
111
- header: "Create collection",
112
- modelValue: o(b),
113
- "onUpdate:modelValue": [
114
- e[14] || (e[14] = (t) => j(b) ? b.value = t : null),
115
- e[15] || (e[15] = (t) => b.value = t)
116
- ]
117
- }, {
118
- "side-sheet-footer": I(() => [
119
- h("div", ve, [
120
- r($, {
121
- label: "Save",
122
- onClick: e[12] || (e[12] = (t) => n(o(a))),
123
- loading: o(ie)().isLoading
124
- }, null, 8, ["loading"]),
125
- r($, {
126
- label: "Cancel",
127
- type: "button",
128
- variant: "tertiary",
129
- onClick: e[13] || (e[13] = (t) => b.value = !1)
130
- })
131
- ])
132
- ]),
133
- default: I(() => [
134
- r(re, { json: o(a) }, null, 8, ["json"]),
135
- r(oe, {
136
- ref_key: "form",
137
- ref: k,
138
- class: "space-y-40",
139
- onValidationSuccess: e[10] || (e[10] = (t) => _.value = !0),
140
- onValidationFailed: e[11] || (e[11] = (t) => _.value = !1)
141
- }, {
142
- default: I(() => [
143
- h("div", null, [
144
- e[16] || (e[16] = h("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1)),
145
- r(L, {
146
- modelValue: o(c),
147
- "onUpdate:modelValue": e[0] || (e[0] = (t) => j(c) ? c.value = t : null),
148
- inline: !1
149
- }, {
150
- default: I(() => [
151
- (y(), N(P, null, ne(E, (t) => r(v, {
152
- key: t.value,
153
- value: t.value,
154
- label: t.label,
155
- sublabel: t.sublabel
156
- }, null, 8, ["value", "label", "sublabel"])), 64))
157
- ]),
158
- _: 1
159
- }, 8, ["modelValue"])
160
- ]),
161
- h("div", be, [
162
- e[17] || (e[17] = h("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1)),
163
- o(c) === "bulk" ? (y(), N(P, { key: 0 }, [
164
- r(m, {
165
- "model-value": o(V),
166
- "label-placement": "right",
167
- value: "true",
168
- label: "Advance code setting",
169
- required: !0,
170
- "onUpdate:modelValue": e[1] || (e[1] = () => V.value = !o(V))
171
- }, null, 8, ["model-value"]),
172
- o(V) ? (y(), N(P, { key: 0 }, [
173
- r(T, {
174
- modelValue: o(a).codeConfig.length,
175
- "onUpdate:modelValue": e[2] || (e[2] = (t) => o(a).codeConfig.length = t),
176
- label: "Code length",
177
- max: 16,
178
- min: 1,
179
- rules: [
180
- (t) => Number(t) >= 1 || "Code length must at least 1",
181
- (t) => Number(t) <= 16 || "Code length must less than 16"
182
- ],
183
- required: !0
184
- }, null, 8, ["modelValue", "rules"]),
185
- r(Z, {
186
- label: "Charset",
187
- "model-value": o(x),
188
- items: U,
189
- "helper-text": o(a).codeConfig.charset.length > 62 ? `${o(a).codeConfig.charset.substring(0, 62)}...` : o(a).codeConfig.charset,
190
- "onUpdate:modelValue": e[3] || (e[3] = (t) => {
191
- x.value = t, o(a).codeConfig.charset = t;
192
- })
193
- }, null, 8, ["model-value", "helper-text"]),
194
- o(x) === "" ? (y(), z(B, {
195
- key: 0,
196
- modelValue: o(a).codeConfig.charset,
197
- "onUpdate:modelValue": e[4] || (e[4] = (t) => o(a).codeConfig.charset = t),
198
- label: "Custom Charset",
199
- required: ""
200
- }, null, 8, ["modelValue"])) : R("", !0),
201
- h("div", Ce, [
202
- r(B, {
203
- modelValue: o(a).codeConfig.prefix,
204
- "onUpdate:modelValue": e[5] || (e[5] = (t) => o(a).codeConfig.prefix = t),
205
- label: "Prefix (Optional)"
206
- }, null, 8, ["modelValue"]),
207
- r(B, {
208
- modelValue: o(a).codeConfig.suffix,
209
- "onUpdate:modelValue": e[6] || (e[6] = (t) => o(a).codeConfig.suffix = t),
210
- label: "Suffix (Optional)"
211
- }, null, 8, ["modelValue"])
212
- ]),
213
- r(B, {
214
- modelValue: o(a).codeConfig.pattern,
215
- "onUpdate:modelValue": e[7] || (e[7] = (t) => o(a).codeConfig.pattern = t),
216
- label: "Pattern",
217
- required: !0
218
- }, null, 8, ["modelValue"])
219
- ], 64)) : R("", !0),
220
- r(B, {
221
- modelValue: o(a).quantity,
222
- "onUpdate:modelValue": e[8] || (e[8] = (t) => o(a).quantity = t),
223
- label: "Number of code",
224
- rules: [
225
- (t) => t >= 1 || "Quantity cannot be less than 1",
226
- (t) => t <= 1e4 || "Quantity cannot more than 10,000"
227
- ],
228
- required: !0,
229
- "helper-text": `${o(a).quantity} claim will be created`
230
- }, null, 8, ["modelValue", "rules", "helper-text"])
231
- ], 64)) : R("", !0),
232
- o(c) !== "bulk" ? (y(), z(ee, {
233
- key: 1,
234
- modelValue: o(a).code,
235
- "onUpdate:modelValue": e[9] || (e[9] = (t) => o(a).code = t),
236
- label: "Custom Code",
237
- rules: [
238
- (t) => o(c) != "single" || !!t || "Custom code is required",
239
- (t) => !l(t) || "Custom code must be unique",
240
- (t) => !C(t) || "Custom code must not contain space"
241
- ],
242
- placeholder: "(For multiple codes, please enter in the new row.)"
243
- }, null, 8, ["modelValue", "rules"])) : R("", !0)
244
- ])
245
- ]),
246
- _: 1
247
- }, 512)
248
- ]),
249
- _: 1
250
- }, 8, ["modelValue"]);
251
- };
252
- }
253
- });
254
- class xe {
255
- constructor() {
256
- O(this, "data", []);
257
- }
258
- addRecord(i) {
259
- this.data.push(i);
260
- }
261
- buildExcel() {
262
- const i = Y.book_new(), d = Y.json_to_sheet(this.data);
263
- return Y.book_append_sheet(i, d, "Collection"), i;
264
- }
265
- }
266
- const ye = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Ve = { class: "flex items-center justify-end py-4 xs:hidden" }, Le = /* @__PURE__ */ J({
267
- __name: "Collections",
268
- setup(g) {
269
- const i = ue(), d = X(), w = f(), F = Q(() => d.params.id), k = f(!1), { custom: _ } = W, A = [
270
- {
271
- header: "ID/Code",
272
- accessorKey: "_id",
273
- cell(n) {
274
- return S("div", { class: "flex items-center" }, [
275
- S(H.FmIcon, {
276
- name: "content_copy",
277
- outline: !0,
278
- size: "sm",
279
- class: "cursor-pointer mr-4",
280
- onClick: (l) => {
281
- l.preventDefault(), l.stopPropagation(), pe(
282
- n.row.original.code || n.row.original._id.toString()
283
- );
284
- }
285
- }),
286
- S(
287
- "div",
288
- { class: "pr-2 text-ellipsis overflow-hidden" },
289
- n.row.original.code || n.row.original._id.toString()
290
- )
291
- ]);
292
- }
293
- },
294
- {
295
- header: "User",
296
- accessorKey: "user",
297
- enableSorting: !1,
298
- cell(n) {
299
- const l = n.row.original.pf_user;
300
- return S(
301
- "div",
302
- {
303
- class: "flex items-center gap-x-8"
304
- },
305
- [
306
- S(H.FmAvatar, {
307
- name: l != null && l.photoUrl || l == null ? void 0 : l.name,
308
- src: (l == null ? void 0 : l.photoUrl) ?? void 0,
309
- size: "sm"
310
- }),
311
- S("span", l == null ? void 0 : l.name)
312
- ]
313
- );
314
- }
315
- },
316
- {
317
- header: "Phone",
318
- accessorFn: (n) => {
319
- var l;
320
- return ((l = n.pf_user) == null ? void 0 : l.phoneNumber) || "-";
321
- },
322
- accessorKey: "pf_user.phoneNumber"
323
- },
324
- {
325
- header: "Balance",
326
- accessorKey: "balance"
327
- },
328
- {
329
- header: "Created at",
330
- accessorKey: "_id",
331
- accessorFn: (n) => G(ge(n._id.toString())).format("DD MMM YYYY")
332
- },
333
- {
334
- header: "Nearest expired at",
335
- accessorKey: "expiryBalance",
336
- accessorFn: (n) => {
337
- var l;
338
- return n.expiryBalance && n.expiryBalance.length ? G((l = n.expiryBalance) == null ? void 0 : l[0].expiredAt).format("DD MMM YYYY") : "Never expires";
339
- }
340
- }
341
- ], b = {
342
- "$connect-STORE_REWARD_COLLECTIONS": fe.readCollectionsByRewardId,
343
- "$connect-CAMPAIGN_VOUCHER_COLLECTIONS": q.readCollectionsByCampaignId
344
- }, D = (n) => {
345
- const l = b[d.name];
346
- return (C) => l(n, C);
347
- }, { tableMeta: a, rowData: E, onSort: U, debouncedFetchData: x, onSearch: c } = ce(D(F.value));
348
- async function V() {
349
- var n;
350
- await x(), (n = w.value) == null || n.showSheet(!1);
351
- }
352
- async function M() {
353
- k.value || _(
354
- async () => {
355
- var s;
356
- const n = new xe(), l = (await q.readCollectionsByCampaignId(F.value, {
357
- limit: 1,
358
- skip: 0,
359
- sortBy: p.sortBy,
360
- descending: p.descending
361
- })).meta.totalResources ?? 0, C = p.rowsPerPage;
362
- for (let e = 0; e < l; e += C) {
363
- const v = {
364
- ...p,
365
- limit: C,
366
- skip: p.page - 1,
367
- sortBy: p.sortBy,
368
- descending: p.descending
369
- }, L = await q.readCollectionsByCampaignId(
370
- F.value,
371
- v
372
- );
373
- for await (const m of L.resources) {
374
- const T = {
375
- Id: (m == null ? void 0 : m.code) || ((s = m._id) == null ? void 0 : s.toString()) || "",
376
- Balance: (m == null ? void 0 : m.balance) || 0
377
- };
378
- n.addRecord(T);
379
- }
380
- p.page++;
381
- }
382
- await de(
383
- n.buildExcel(),
384
- `members-${(/* @__PURE__ */ new Date()).toISOString()}.xlsx`,
385
- {
386
- bookType: "xlsx",
387
- bookSST: !1,
388
- type: "array"
389
- }
390
- ), p.page = 1;
391
- },
392
- {
393
- isLoading: k
394
- }
395
- );
396
- }
397
- return se(async () => {
398
- await x();
399
- }), (n, l) => {
400
- const C = u("FmPageHead"), s = u("FmSearch");
401
- return y(), N(P, null, [
402
- r(C, {
403
- title: "Collections",
404
- "back-button": !0,
405
- actions: [
406
- { label: "Export", value: "export", isPrimary: !1 },
407
- {
408
- label: "Create collection",
409
- value: "create",
410
- isPrimary: !0
411
- }
412
- ],
413
- "onClick:back": l[0] || (l[0] = (e) => o(i).back()),
414
- "onClick:action": l[1] || (l[1] = (e) => {
415
- var v;
416
- e === "create" && ((v = o(w)) == null || v.showSheet(!0)), e === "export" && M();
417
- })
418
- }),
419
- h("div", ye, [
420
- r(s, {
421
- class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
422
- modelValue: o(a).searchValue,
423
- "onUpdate:modelValue": [
424
- l[2] || (l[2] = (e) => o(a).searchValue = e),
425
- o(c)
426
- ],
427
- placeholder: "Search",
428
- collapsible: ""
429
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
430
- h("div", Ve, [
431
- r(s, {
432
- modelValue: o(a).searchValue,
433
- "onUpdate:modelValue": [
434
- l[3] || (l[3] = (e) => o(a).searchValue = e),
435
- o(c)
436
- ],
437
- placeholder: "Search",
438
- collapsible: ""
439
- }, null, 8, ["modelValue", "onUpdate:modelValue"])
440
- ]),
441
- r(me, {
442
- loading: o(a).isLoading,
443
- "row-data": o(E),
444
- "column-defs": A,
445
- "row-count": o(a).totalRows,
446
- "page-count": o(a).pageCount,
447
- "page-index": o(a).pageIndex,
448
- "page-size": o(a).pageSize,
449
- "shrink-at": !1,
450
- onSortChange: o(U),
451
- onPageChange: l[4] || (l[4] = (e) => o(x)({ pageSize: e.pageSize, pageIndex: e.pageIndex }))
452
- }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
453
- r(he, {
454
- ref_key: "sheetRef",
455
- ref: w,
456
- onSuccess: V
457
- }, null, 512)
458
- ])
459
- ], 64);
460
- };
461
- }
462
- });
463
- export {
464
- Le as default
465
- };