@feedmepos/mf-connect 0.1.98-beta.15 → 0.1.98-beta.16

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 (138) hide show
  1. package/dist/App-DNXDhULP.js +4782 -0
  2. package/dist/AuditLogs-BNS27IJT.js +2013 -0
  3. package/dist/Bin-Dkjyrbz-.js +166 -0
  4. package/dist/Broadcast-B-fpjVzY.js +266 -0
  5. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-qBcG-vPM.js +120 -0
  6. package/dist/Card-BvVHO8kN.js +910 -0
  7. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  8. package/dist/Collections-BLxPSOJl.js +540 -0
  9. package/dist/Credit-DU-stilH.js +260 -0
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  11. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bqnb00zk.js +3377 -0
  13. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CTSfEq5N.js +351 -0
  14. package/dist/Experience-C3tB8hTp.js +259 -0
  15. package/dist/FileSaver.min-EIworvUf.js +74 -0
  16. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  17. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
  18. package/dist/Game-Dq1ms2fA.js +330 -0
  19. package/dist/Grab-DnSO2oLx.js +300 -0
  20. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-n1r2bgOE.js +145 -0
  21. package/dist/Index-BFIHgW9W.js +259 -0
  22. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  23. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-Do7CJZuh.js +48 -0
  24. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-vpJmHgKM.js +18737 -0
  25. package/dist/LoyaltyDashboard-CcBogXzl.js +1082 -0
  26. package/dist/MainLayout-CPNiL_et.js +41 -0
  27. package/dist/Marketing-Bzb1VaVA.js +235 -0
  28. package/dist/MarketingMaterialEdit-8UQNx3mV.js +1035 -0
  29. package/dist/Member-Drb_NVrb.js +280 -0
  30. package/dist/MemberList-wa3JxCVr.js +1601 -0
  31. package/dist/MemberOverview-wL_ailso.js +58 -0
  32. package/dist/MemberTransactions-8qlm-T67.js +45 -0
  33. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BHicaUXs.js +60802 -0
  34. package/dist/Mission-DmWbQmOv.js +334 -0
  35. package/dist/Overview-COEFtf12.js +1079 -0
  36. package/dist/Overview-D7ki-aBA.js +969 -0
  37. package/dist/Point-B0W-BcPA.js +262 -0
  38. package/dist/Promotion-CY16SjmK.js +397 -0
  39. package/dist/Queue-hMur40Xc.js +260 -0
  40. package/dist/Record-Bj7GQP1r.js +342 -0
  41. package/dist/Review-Z1XD6bJK.js +45 -0
  42. package/dist/ReviewFacebookCallback-DirGtKLX.js +248 -0
  43. package/dist/ReviewGoogleCallback-CVC6741e.js +213 -0
  44. package/dist/Reward-DDB5Usau.js +442 -0
  45. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-B-OnKAbx.js +149 -0
  46. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DDHM8NLi.js +1911 -0
  47. package/dist/Segment-Bl0k9fvJ.js +1014 -0
  48. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-C33DPiN6.js +181 -0
  49. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-YMpQ-IiW.js +188 -0
  50. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang--Rtf3gRa.js +226 -0
  51. package/dist/Setting-CpD98E2N.js +2047 -0
  52. package/dist/SettingAdvertisements-BZFQu_HI.js +264 -0
  53. package/dist/Settings-CRqlKNsc.js +228 -0
  54. package/dist/Store-CDG2_iqc.js +1996 -0
  55. package/dist/StoreRewards-DIU5hPXv.js +540 -0
  56. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B82RH_ZC.js +1133 -0
  57. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DKGCmk5y.js +7007 -0
  58. package/dist/Tier-BXgIdYDa.js +969 -0
  59. package/dist/Title-DgHxyV8p.js +566 -0
  60. package/dist/Transaction-iDacnm6Y.js +39 -0
  61. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-RUbR6pdK.js +130 -0
  62. package/dist/Voucher-C-I8JK4F.js +421 -0
  63. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BUpYZxij.js +421 -0
  64. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-LhG5jJq3.js +56 -0
  65. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  66. package/dist/app-CyNzTZOx.js +59950 -0
  67. package/dist/app-wDQR6dpb.js +39 -0
  68. package/dist/app.js +7 -0
  69. package/dist/business-o_sAO_33.js +82 -0
  70. package/dist/campaign--IUcyI8h.js +219 -0
  71. package/dist/campaign-CpzFl8Vr.js +4 -0
  72. package/dist/campaign-zLKyql03.js +277 -0
  73. package/dist/campaign.enum-CEbNgaGZ.js +26 -0
  74. package/dist/campaign.fn-BVT0m6Uy.js +776 -0
  75. package/dist/collectible.enum-2y8KIQLL.js +19 -0
  76. package/dist/duplicateCampaign-DIzdQf0e.js +51 -0
  77. package/dist/effect-B6gKaH4T.js +89 -0
  78. package/dist/email-addresses-CO9GNnUN.js +705 -0
  79. package/dist/export-DdDpRFVg.js +97 -0
  80. package/dist/feedme.ico +0 -0
  81. package/dist/google-BQK68wbe.js +5 -0
  82. package/dist/helper-DqypCsTm.js +86 -0
  83. package/dist/index-BK0OmX3R.js +85 -0
  84. package/dist/index-Bc7JXl59.js +54 -0
  85. package/dist/index-BgiIGrLb.js +32 -0
  86. package/dist/index-C-TiT9bf.js +1157 -0
  87. package/dist/index-COXmoOd1.js +3678 -0
  88. package/dist/index-CT6uJJ9y.js +151 -0
  89. package/dist/index-Ci2gFCfD.js +61 -0
  90. package/dist/index-CtJ0MQQ1.js +3 -0
  91. package/dist/index-CuvNtC_M.js +61 -0
  92. package/dist/index-D41Xq5qY.js +8910 -0
  93. package/dist/index-DBD_e_yR.js +31 -0
  94. package/dist/index-DDpz9LmI.js +67 -0
  95. package/dist/index-Dh2apeby.js +2819 -0
  96. package/dist/index-DiDmMG_M.js +28900 -0
  97. package/dist/index-pjXQwa0j.js +30289 -0
  98. package/dist/index-vh86FiIQ.js +10 -0
  99. package/dist/index.esm2017-Cd4FhecE.js +3069 -0
  100. package/dist/loading-D-RglDMV.js +72 -0
  101. package/dist/lodash-cggYhL9V.js +3678 -0
  102. package/dist/membership-DTfMyKwP.js +255 -0
  103. package/dist/moment-D7p2TMB-.js +2583 -0
  104. package/dist/money-fGZfbdgV.js +15 -0
  105. package/dist/number-BOalh3ZH.js +12 -0
  106. package/dist/object-BYyQ0PZp.js +18 -0
  107. package/dist/objectId-dwaoBfJX.js +7 -0
  108. package/dist/objectid-zPJFVngY.js +145 -0
  109. package/dist/plugins-CbpvMMOJ.js +1788 -0
  110. package/dist/reward-DkVAHEq2.js +36 -0
  111. package/dist/rule-EzWg2u8d.js +1969 -0
  112. package/dist/string-Gcy5IM_H.js +32 -0
  113. package/dist/style.css +4 -0
  114. package/dist/template-BfVFq4on.js +188 -0
  115. package/dist/tier-BJDhpH6X.js +4 -0
  116. package/dist/tiers/tier=1.png +0 -0
  117. package/dist/tiers/tier=2.png +0 -0
  118. package/dist/tiers/tier=3.png +0 -0
  119. package/dist/tiers/tier=4.png +0 -0
  120. package/dist/titles/type=diamond.png +0 -0
  121. package/dist/titles/type=drinks.png +0 -0
  122. package/dist/titles/type=food.png +0 -0
  123. package/dist/titles/type=heart.png +0 -0
  124. package/dist/titles/type=medal.png +0 -0
  125. package/dist/titles/type=spend.png +0 -0
  126. package/dist/titles/type=thank-you.png +0 -0
  127. package/dist/titles/type=thumbs-up.png +0 -0
  128. package/dist/titles/type=years.png +0 -0
  129. package/dist/trigger-es-_uiSg.js +213 -0
  130. package/dist/tslib.es6-BCqqvLQ_.js +44 -0
  131. package/dist/type_drinks-D6jnpvwV.js +4 -0
  132. package/dist/useMarketingMaterialActions-CpiIKMmG.js +107 -0
  133. package/dist/usePagination-SYsXgU6x.js +220 -0
  134. package/dist/user-DUe40u3g.js +55 -0
  135. package/dist/vue-i18n-Dn9zxRuv.js +2365 -0
  136. package/dist/xlsx-DugGi7dB.js +15491 -0
  137. package/dist/zod-Dw8_B6RC.js +91 -0
  138. package/package.json +1 -1
@@ -0,0 +1,39 @@
1
+ import { defineComponent as d, ref as f, resolveComponent as s, openBlock as t, createElementBlock as v, Fragment as b, createVNode as r, unref as o, createElementVNode as k, createBlock as l, KeepAlive as x, resolveDynamicComponent as m, createCommentVNode as F } from "vue";
2
+ import { _ as g, a as y } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-B82RH_ZC.js";
3
+ import { u as C } from "./vue-i18n-Dn9zxRuv.js";
4
+ const T = { class: "px-24 flex flex-col gap-y-32 pb-24" }, P = /* @__PURE__ */ d({
5
+ __name: "Transaction",
6
+ setup(V) {
7
+ const { t: n } = C(), a = [
8
+ {
9
+ label: n("connect.transaction.tabs.collection"),
10
+ value: "collection"
11
+ },
12
+ {
13
+ label: n("connect.transaction.tabs.store"),
14
+ value: "store"
15
+ }
16
+ ], e = f(a[0]);
17
+ return (B, c) => {
18
+ const i = s("FmPageHead"), u = s("FmTabs");
19
+ return t(), v(b, null, [
20
+ r(i, {
21
+ title: o(n)("connect.transaction.title")
22
+ }, null, 8, ["title"]),
23
+ k("div", T, [
24
+ r(u, {
25
+ "model-value": o(e).value,
26
+ items: a,
27
+ "onUpdate:modelValue": c[0] || (c[0] = (p) => e.value = a.find((_) => _.value === p))
28
+ }, null, 8, ["model-value"]),
29
+ (t(), l(x, null, [
30
+ o(e).value == "collection" ? (t(), l(m(g), { key: 0 })) : o(e).value == "store" ? (t(), l(m(y), { key: 1 })) : F("", !0)
31
+ ], 1024))
32
+ ])
33
+ ], 64);
34
+ };
35
+ }
36
+ });
37
+ export {
38
+ P as default
39
+ };
@@ -0,0 +1,130 @@
1
+ import { defineComponent as y, computed as b, openBlock as i, createBlock as R, unref as l, ref as E, watch as k, resolveComponent as h, createElementBlock as g, createElementVNode as B, Fragment as O, renderList as T, createVNode as V, isRef as U, createCommentVNode as v } from "vue";
2
+ import "./index-D41Xq5qY.js";
3
+ import { i as C, R as e } from "./index-Dh2apeby.js";
4
+ import { _ as I } from "./RuleGroup.vue_vue_type_script_setup_true_lang-DDHM8NLi.js";
5
+ import { p as N } from "./plugins-CbpvMMOJ.js";
6
+ import { u as S } from "./membership-DTfMyKwP.js";
7
+ import { _ as j } from "./CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js";
8
+ import { u as x } from "./vue-i18n-Dn9zxRuv.js";
9
+ const A = /* @__PURE__ */ y({
10
+ __name: "SegmentConfigurator",
11
+ props: {
12
+ modelValue: {
13
+ type: Object,
14
+ required: !0
15
+ }
16
+ },
17
+ emits: ["update:model-value"],
18
+ setup(n, { emit: f }) {
19
+ const o = n, m = b(() => {
20
+ var s;
21
+ const [u] = C(o.modelValue) ? Object.values(((s = o.modelValue) == null ? void 0 : s.rules) ?? {}) : [null];
22
+ return (u ?? e.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
23
+ }), r = f;
24
+ return (u, c) => (i(), R(j, {
25
+ multiselect: !0,
26
+ items: l(S)().segmentOptions,
27
+ "model-value": l(m),
28
+ "onUpdate:modelValue": c[0] || (c[0] = (s) => r(
29
+ "update:model-value",
30
+ l(e).setRuleToGroup(
31
+ l(e).scaffoldGroup("g_segment"),
32
+ l(e).constructEntry("user.segment", "_hasAny", s)
33
+ )
34
+ )),
35
+ label: "Select segment(s) to match"
36
+ }, null, 8, ["items", "model-value"]));
37
+ }
38
+ }), F = { class: "space-y-16" }, M = { key: 0 }, z = /* @__PURE__ */ y({
39
+ __name: "UserRuleGroup",
40
+ props: {
41
+ modelValue: {
42
+ type: Object,
43
+ default: () => {
44
+ }
45
+ }
46
+ },
47
+ emits: ["update:model-value"],
48
+ setup(n, { emit: f }) {
49
+ const { t: o } = x(), m = n, r = f, u = E(
50
+ m.modelValue ? e.getRules(m.modelValue.rules.g_user).length > 0 ? "custom" : e.getRules(m.modelValue.rules.g_segment).length > 0 ? "segment" : "all_users" : "all_users"
51
+ ), c = [
52
+ {
53
+ value: "all_users",
54
+ label: o("connect.template.rule.audience.all")
55
+ },
56
+ {
57
+ value: "segment",
58
+ label: o("connect.template.rule.audience.member_segment")
59
+ },
60
+ {
61
+ value: "custom",
62
+ label: o("connect.template.rule.audience.custom_audience")
63
+ }
64
+ ];
65
+ return k(u, async (s, t) => {
66
+ var p;
67
+ if (t != "all_users" && t != s && e.getRules(
68
+ (p = m.modelValue) == null ? void 0 : p.rules[t == "custom" ? "g_user" : "g_segment"]
69
+ ).length > 0) {
70
+ const d = await N.confirm(
71
+ o("connect.template.rule.audience.confirm_remove"),
72
+ o("connect.common.confirm"),
73
+ o("connect.common.confirm"),
74
+ o("connect.common.cancel")
75
+ );
76
+ d && r(
77
+ "update:model-value",
78
+ e.setRuleToGroup(
79
+ m.modelValue ?? e.scaffoldGroup(),
80
+ e.scaffoldGroup(t == "custom" ? "g_user" : "g_segment")
81
+ )
82
+ ), u.value = d ? s : t;
83
+ }
84
+ }), (s, t) => {
85
+ var d, _;
86
+ const p = h("FmRadio");
87
+ return i(), g("div", F, [
88
+ B("div", null, [
89
+ (i(), g(O, null, T(c, (a) => V(p, {
90
+ key: a.value,
91
+ value: a.value,
92
+ label: a.label,
93
+ modelValue: l(u),
94
+ "onUpdate:modelValue": t[0] || (t[0] = (G) => U(u) ? u.value = G : null)
95
+ }, null, 8, ["value", "label", "modelValue"])), 64))
96
+ ]),
97
+ l(u) == "segment" ? (i(), g("div", M, [
98
+ V(A, {
99
+ modelValue: ((d = n.modelValue) == null ? void 0 : d.rules.g_segment) ?? l(e).scaffoldGroup("g_segment"),
100
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => r(
101
+ "update:model-value",
102
+ l(e).setRuleToGroup(
103
+ n.modelValue ?? l(e).scaffoldGroup(),
104
+ a,
105
+ "&&"
106
+ )
107
+ ))
108
+ }, null, 8, ["modelValue"])
109
+ ])) : v("", !0),
110
+ l(u) == "custom" ? (i(), R(I, {
111
+ key: 1,
112
+ "include-only": "user",
113
+ "trigger-type": "MEMBERSHIP_JOINED",
114
+ "model-value": ((_ = n.modelValue) == null ? void 0 : _.rules.g_user) ?? l(e).scaffoldGroup("g_user"),
115
+ "onUpdate:modelValue": t[2] || (t[2] = (a) => r(
116
+ "update:model-value",
117
+ l(e).setRuleToGroup(
118
+ n.modelValue ?? l(e).scaffoldGroup(),
119
+ a,
120
+ "&&"
121
+ )
122
+ ))
123
+ }, null, 8, ["model-value"])) : v("", !0)
124
+ ]);
125
+ };
126
+ }
127
+ });
128
+ export {
129
+ z as _
130
+ };
@@ -0,0 +1,421 @@
1
+ import { defineComponent as te, ref as U, computed as ne, h as m, onMounted as ae, resolveComponent as d, openBlock as u, createElementBlock as T, Fragment as P, createVNode as l, unref as t, createElementVNode as c, withCtx as R, renderList as re, createBlock as h, resolveDynamicComponent as ce, createCommentVNode as L, toDisplayString as v } from "vue";
2
+ import { _ as ie } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as se, components as p } from "@feedmepos/ui-library";
4
+ import { _ as H } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
5
+ import { c as le, p as me } from "./plugins-CbpvMMOJ.js";
6
+ import { useCoreStore as ue } from "@feedmepos/mf-common";
7
+ import { u as de } from "./loading-D-RglDMV.js";
8
+ import { u as pe } from "./business-o_sAO_33.js";
9
+ import { u as fe, c as _ } from "./campaign--IUcyI8h.js";
10
+ import { a as ye, b as $, c as D } from "./campaign-zLKyql03.js";
11
+ import { c as he, p as ge } from "./duplicateCampaign-DIzdQf0e.js";
12
+ import "./index-CtJ0MQQ1.js";
13
+ import { u as ve } from "./template-BfVFq4on.js";
14
+ import { _ as _e } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bqnb00zk.js";
15
+ import { _ as Ce } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang--Rtf3gRa.js";
16
+ import { u as we } from "./vue-i18n-Dn9zxRuv.js";
17
+ import { T as be } from "./trigger-es-_uiSg.js";
18
+ import { useRouter as ke } from "vue-router";
19
+ import { R as K } from "./app-CyNzTZOx.js";
20
+ var xe = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "feedmedev.vip", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc", voucherAppUrl: "https://voucher.feedmedev.cc/" };
21
+ const Fe = { class: "px-24 flex flex-col gap-y-16" }, Ve = { class: "flex items-center justify-between w-full" }, Se = { class: "flex gap-8 overflow-x-auto" }, Ue = { class: "space-y-8" }, Te = { class: "flex w-full gap-4 items-center" }, Pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Re = { class: "space-y-4" }, Le = { class: "fm-typo-en-body-lg-600" }, Ie = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ee = { class: "flex gap-8 items-center" }, Be = { class: "flex flex-col gap-16 text-center" }, Oe = { class: "fm-typo-en-title-sm-800" }, Ae = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ao = /* @__PURE__ */ te({
22
+ __name: "Voucher",
23
+ setup(Me) {
24
+ const { t: a } = we(), N = {
25
+ label: a("connect.voucher.createCampaign"),
26
+ value: "create",
27
+ isPrimary: !0,
28
+ prependIcon: "add"
29
+ }, I = se(), j = ve("VOUCHER", I), q = pe(), y = fe(), { global: G, minor: E } = de, B = ke(), s = U({
30
+ searchKey: "",
31
+ location: [],
32
+ triggerType: []
33
+ }), C = ne(
34
+ () => y.campaigns.voucher.filter(
35
+ (e) => W(e) && z(e)
36
+ )
37
+ ), X = be.VOUCHER.map((e) => ({
38
+ label: e.name,
39
+ value: e.value
40
+ }));
41
+ function W(e) {
42
+ const o = s.value.location;
43
+ return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some(
44
+ (r) => {
45
+ var i;
46
+ return (i = e == null ? void 0 : e.targetLocation) == null ? void 0 : i.includes(r);
47
+ }
48
+ ) : e.targetLocation.includes(o);
49
+ }
50
+ function k(e) {
51
+ return e.hideInApp === !1;
52
+ }
53
+ function x(e) {
54
+ return e.event.type === "SIMPLE_CLAIM" && !k(e);
55
+ }
56
+ function z(e) {
57
+ const o = s.value.triggerType;
58
+ if (!o || o.length === 0) return !0;
59
+ const r = e.event.type;
60
+ return o.includes(r);
61
+ }
62
+ const Q = [
63
+ {
64
+ header: a("connect.voucher.voucherTitle"),
65
+ accessorFn: (e) => e.name,
66
+ cell(e) {
67
+ const o = [e.row.original.name];
68
+ return k(e.row.original) && o.push(
69
+ m(p.FmChip, {
70
+ label: "Feedvibe",
71
+ class: "text-fm-color-primary bg-fm-color-system-warning-100",
72
+ compact: !0
73
+ })
74
+ ), m("div", { class: "flex items-center gap-4" }, o);
75
+ }
76
+ },
77
+ {
78
+ header: a("connect.voucher.status"),
79
+ accessorFn: (e) => ye(e),
80
+ cell(e) {
81
+ return $(e.row.original);
82
+ }
83
+ },
84
+ {
85
+ header: a("connect.voucher.summary"),
86
+ accessorFn: (e) => D(e)
87
+ },
88
+ {
89
+ header: a("connect.voucher.quota"),
90
+ accessorFn: (e) => {
91
+ var o;
92
+ return ((o = e.pf_collectible) == null ? void 0 : o.options.maxReceive) ?? "Unlimited";
93
+ }
94
+ },
95
+ {
96
+ header: a("connect.voucher.claimed"),
97
+ accessorFn: (e) => {
98
+ var o;
99
+ return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
100
+ }
101
+ },
102
+ {
103
+ header: a("connect.voucher.actions"),
104
+ cell(e) {
105
+ return m("div", { class: "flex items-center justify-end" }, [
106
+ m(p.FmButton, {
107
+ icon: "visibility",
108
+ variant: "tertiary",
109
+ iconColor: "neutral-gray-400",
110
+ onClick: async (o) => {
111
+ o.stopPropagation(), await B.push({
112
+ name: K["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
113
+ params: { id: e.row.original._id }
114
+ });
115
+ }
116
+ }),
117
+ m(
118
+ p.FmMenu,
119
+ {
120
+ placement: "bottom-end",
121
+ onClick: (o) => {
122
+ o.stopPropagation();
123
+ }
124
+ },
125
+ {
126
+ "menu-button": () => m(p.FmButton, {
127
+ icon: "more_vert",
128
+ iconColor: "neutral-gray-400",
129
+ variant: "tertiary"
130
+ }),
131
+ default: () => {
132
+ const o = [
133
+ m(p.FmMenuItem, {
134
+ label: a("connect.voucher.duplicate"),
135
+ onClick: async (r) => {
136
+ r.stopPropagation(), await A(e.row.original);
137
+ }
138
+ }),
139
+ m(
140
+ p.FmMenuItem,
141
+ {
142
+ onClick: async (r) => {
143
+ r.stopPropagation(), O(e.row.original);
144
+ }
145
+ },
146
+ {
147
+ label: m(
148
+ "div",
149
+ {
150
+ class: "text-fm-color-typo-error fm-typo-en-body-md-400"
151
+ },
152
+ a("connect.voucher.remove")
153
+ )
154
+ }
155
+ )
156
+ ];
157
+ return x(e.row.original) && (o.unshift(
158
+ m(p.FmMenuItem, {
159
+ label: a("connect.voucher.send"),
160
+ onClick: async (r) => {
161
+ var i;
162
+ r.stopPropagation(), (i = V.value) == null || i.showSheet({
163
+ campaignId: e.row.original._id
164
+ });
165
+ }
166
+ })
167
+ ), o.unshift(
168
+ m(p.FmMenuItem, {
169
+ label: a("connect.voucher.share"),
170
+ onClick: async (r) => {
171
+ r.stopPropagation(), await le(
172
+ `https://${ue().currentBusiness.value._id}.${xe.appUrl}/vouchers/${e.row.original._id}`,
173
+ {
174
+ successMessage: "Voucher link copied to clipboard"
175
+ }
176
+ );
177
+ }
178
+ })
179
+ )), o;
180
+ }
181
+ }
182
+ )
183
+ ]);
184
+ }
185
+ }
186
+ ], F = U(), V = U();
187
+ async function O(e) {
188
+ await me.remove(a("connect.voucher.confirmRemove", { name: e.name })) && await E(
189
+ async () => {
190
+ await _.delete(e._id), await y.read("VOUCHER");
191
+ },
192
+ {
193
+ message: a("connect.voucher.removing", { name: e.name }),
194
+ successMessage: a("connect.voucher.removedSuccessfully", {
195
+ name: e.name
196
+ })
197
+ }
198
+ );
199
+ }
200
+ async function w(e) {
201
+ e ? await o(await _.readById(e._id)) : j.open(async (r) => {
202
+ await o(void 0, r);
203
+ });
204
+ async function o(r, i) {
205
+ var b;
206
+ (b = F.value) == null || b.showSheet(!0, "VOUCHER", r, i);
207
+ }
208
+ }
209
+ async function A(e) {
210
+ var i;
211
+ if (!await he(e.name))
212
+ return;
213
+ const o = await _.readById(e._id), r = ge(o);
214
+ (i = F.value) == null || i.showSheet(
215
+ !0,
216
+ "VOUCHER",
217
+ r,
218
+ o.template
219
+ );
220
+ }
221
+ async function Z(e) {
222
+ e.campaign._id && await new Promise((o) => {
223
+ I.open({
224
+ title: "Confirmation",
225
+ message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
226
+ primaryActions: { text: "Update all", close: !0 },
227
+ secondaryActions: { text: "Update future only", close: !0 }
228
+ }).onPrimary(async () => {
229
+ var r;
230
+ e.updateCollections = !0, (r = window.top) == null || r.postMessage("updateAllVoucher", "*"), o();
231
+ }).onSecondary(async () => {
232
+ o();
233
+ });
234
+ }), await E(
235
+ async () => {
236
+ e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await y.read("VOUCHER");
237
+ },
238
+ {
239
+ message: a(
240
+ e.campaign._id ? "connect.voucher.updating" : "connect.voucher.creating"
241
+ ),
242
+ successMessage: a(
243
+ e.campaign._id ? "connect.voucher.updatedSuccessfully" : "connect.voucher.createdSuccessfully"
244
+ )
245
+ }
246
+ );
247
+ }
248
+ return ae(async () => {
249
+ await G(async () => {
250
+ await y.read("VOUCHER");
251
+ });
252
+ }), (e, o) => {
253
+ const r = d("FmPageHead"), i = d("FmSearch"), b = d("FmTable"), J = d("FmChip"), g = d("FmButton"), Y = d("FmListItem"), ee = d("FmList"), oe = d("FmCard");
254
+ return u(), T(P, null, [
255
+ l(r, {
256
+ title: t(a)("connect.voucher.title"),
257
+ actions: t(C).length > 0 ? [N] : [],
258
+ "onClick:action": o[0] || (o[0] = () => w())
259
+ }, null, 8, ["title", "actions"]),
260
+ c("div", Fe, [
261
+ l(i, {
262
+ modelValue: t(s).searchKey,
263
+ "onUpdate:modelValue": o[1] || (o[1] = (n) => t(s).searchKey = n),
264
+ class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
265
+ placeholder: t(a)("connect.voucher.search"),
266
+ collapsible: ""
267
+ }, null, 8, ["modelValue", "placeholder"]),
268
+ t(y).campaigns.voucher && t(y).campaigns.voucher.length > 0 ? (u(), T(P, { key: 0 }, [
269
+ c("div", Ve, [
270
+ c("div", Se, [
271
+ l(H, {
272
+ label: `${t(a)("connect.common.location")}: `,
273
+ "right-icon": "keyboard_arrow_down",
274
+ modelValue: t(s).location,
275
+ "onUpdate:modelValue": o[2] || (o[2] = (n) => t(s).location = n),
276
+ icon: "storefront",
277
+ "show-item-label": !0,
278
+ items: t(q).locationOptions
279
+ }, null, 8, ["label", "modelValue", "items"]),
280
+ l(H, {
281
+ label: "Type:",
282
+ "right-icon": "keyboard_arrow_down",
283
+ modelValue: t(s).triggerType,
284
+ "onUpdate:modelValue": o[3] || (o[3] = (n) => t(s).triggerType = n),
285
+ icon: "filter_list",
286
+ "show-item-label": !0,
287
+ items: t(X)
288
+ }, null, 8, ["modelValue", "items"])
289
+ ]),
290
+ l(i, {
291
+ modelValue: t(s).searchKey,
292
+ "onUpdate:modelValue": o[4] || (o[4] = (n) => t(s).searchKey = n),
293
+ class: "xs:hidden sm:hidden",
294
+ placeholder: t(a)("connect.voucher.search"),
295
+ collapsible: ""
296
+ }, null, 8, ["modelValue", "placeholder"])
297
+ ]),
298
+ l(b, {
299
+ class: "xs:hidden sm:hidden",
300
+ "row-data": t(C),
301
+ "column-defs": Q,
302
+ "search-value": t(s).searchKey,
303
+ "column-filter": [],
304
+ onRowClick: o[5] || (o[5] = (n) => w(n.original)),
305
+ "hide-footer": t(C).length < 10
306
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
307
+ l(ee, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
308
+ default: R(() => [
309
+ (u(!0), T(P, null, re(t(C).filter(
310
+ (n) => n.name.toLowerCase().includes(t(s).searchKey.toLowerCase())
311
+ ), (n) => (u(), h(Y, {
312
+ key: n._id.toString(),
313
+ onClick: (S) => w(n),
314
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
315
+ }, {
316
+ default: R(() => {
317
+ var S;
318
+ return [
319
+ c("div", Ue, [
320
+ c("div", Te, [
321
+ (u(), h(ce(t($)(n)))),
322
+ k(n) ? (u(), h(J, {
323
+ key: 0,
324
+ label: "Feedvibe",
325
+ class: "text-fm-color-primary bg-fm-color-system-warning-100",
326
+ compact: ""
327
+ })) : L("", !0),
328
+ c("div", Pe, v(((S = n.pf_collectible) == null ? void 0 : S.currentReceive) ?? 0) + " claimed ", 1)
329
+ ]),
330
+ c("div", Re, [
331
+ c("div", Le, v(n.name), 1),
332
+ c("div", Ie, v(t(D)(n)), 1)
333
+ ])
334
+ ]),
335
+ c("div", Ee, [
336
+ l(g, {
337
+ icon: "content_copy",
338
+ "icon-color": "neutral-gray-400",
339
+ variant: "tertiary",
340
+ onClick: async (f) => {
341
+ f.stopPropagation(), await A(n);
342
+ }
343
+ }, null, 8, ["onClick"]),
344
+ x(n) ? (u(), h(g, {
345
+ key: 0,
346
+ icon: "visibility",
347
+ "icon-color": "neutral-gray-400",
348
+ variant: "tertiary",
349
+ onClick: async (f) => {
350
+ f.stopPropagation(), await t(B).push({
351
+ name: t(K)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
352
+ params: { id: n._id }
353
+ });
354
+ }
355
+ }, null, 8, ["onClick"])) : L("", !0),
356
+ x(n) ? (u(), h(g, {
357
+ key: 1,
358
+ icon: "send",
359
+ "icon-color": "neutral-gray-400",
360
+ variant: "tertiary",
361
+ onClick: (f) => {
362
+ var M;
363
+ f.stopPropagation(), (M = t(V)) == null || M.showSheet({
364
+ campaignId: n._id
365
+ });
366
+ }
367
+ }, null, 8, ["onClick"])) : L("", !0),
368
+ l(g, {
369
+ icon: "delete",
370
+ "icon-color": "neutral-gray-400",
371
+ variant: "tertiary",
372
+ onClick: (f) => (f.stopPropagation(), O(n))
373
+ }, null, 8, ["onClick"])
374
+ ])
375
+ ];
376
+ }),
377
+ _: 2
378
+ }, 1032, ["onClick"]))), 128))
379
+ ]),
380
+ _: 1
381
+ })
382
+ ], 64)) : (u(), h(oe, {
383
+ key: 1,
384
+ variant: "outlined",
385
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
386
+ }, {
387
+ default: R(() => [
388
+ o[7] || (o[7] = c("img", {
389
+ src: ie,
390
+ class: "aspect-square w-[150px]"
391
+ }, null, -1)),
392
+ c("div", Be, [
393
+ c("div", Oe, v(t(a)("connect.voucher.createVoucherCampaign")), 1),
394
+ c("div", Ae, v(t(a)("connect.voucher.description")), 1)
395
+ ]),
396
+ l(g, {
397
+ variant: "primary",
398
+ label: t(a)("connect.voucher.createVoucherCampaign"),
399
+ icon: "add",
400
+ onClick: o[6] || (o[6] = (n) => w())
401
+ }, null, 8, ["label"])
402
+ ]),
403
+ _: 1
404
+ })),
405
+ l(_e, {
406
+ ref_key: "sheetRef",
407
+ ref: F,
408
+ "onSubmit:modelValue": Z
409
+ }, null, 512),
410
+ l(Ce, {
411
+ ref_key: "sendVoucherSheetRef",
412
+ ref: V
413
+ }, null, 512)
414
+ ])
415
+ ], 64);
416
+ };
417
+ }
418
+ });
419
+ export {
420
+ ao as default
421
+ };