@feedmepos/mf-connect 0.1.0-beta.5 → 0.1.0-beta.50

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 (112) hide show
  1. package/dist/Analytic-D-yp03jJ.js +427 -0
  2. package/dist/{App-C8Qfnkhz.js → App-CeQWTGNK.js} +441 -420
  3. package/dist/AuditLogs-2qzwcMXR.js +1885 -0
  4. package/dist/Bin-D1b2NbbA.js +191 -0
  5. package/dist/{Broadcast-BK-1MQkL.js → Broadcast-bKF9mIns.js} +13 -12
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BLzpFQoc.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B_q5K-cx.js} +6 -8
  7. package/dist/Card-BCAyfBLi.js +896 -0
  8. package/dist/{Collections-TA4iW1r0.js → Collections-Yz3F55bv.js} +27 -31
  9. package/dist/{Credit-Df9iFQjZ.js → Credit-Ceptt_g_.js} +17 -16
  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-CLFeMi0j.js +169 -0
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-TjNinQ8e.js +2181 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BCRVyPwl.js → EffectSheet.vue_vue_type_style_index_0_lang-D3Bt-Vuu.js} +6 -6
  14. package/dist/{Experience-ByLFXKn6.js → Experience-DskHKzfo.js} +26 -25
  15. package/dist/{Game-B6Ez0pfW.js → Game-IJ6X0AXM.js} +21 -20
  16. package/dist/Index-CEl2y9X6.js +259 -0
  17. package/dist/Marketing-CWekLb4c.js +20071 -0
  18. package/dist/{Member-TobP1ISp.js → Member-BUZPQ5Lb.js} +4 -4
  19. package/dist/MemberList-BmVNqvbm.js +1598 -0
  20. package/dist/MemberTransactions-B3XhEOK_.js +45 -0
  21. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CZ-w6iZi.js → MessageInput.vue_vue_type_script_setup_true_lang-C6YIbQtM.js} +6 -6
  22. package/dist/{Mission-D9uTVo0G.js → Mission-Ci9ed_ph.js} +97 -84
  23. package/dist/Overview-CU9uhC-k.js +1078 -0
  24. package/dist/{Point-4rDr-53e.js → Point-wuuR7AEb.js} +26 -25
  25. package/dist/{Promotion-BKO_dtQk.js → Promotion-BMi3kyE8.js} +55 -48
  26. package/dist/Record-Wmh-g8WY.js +340 -0
  27. package/dist/Reward-BL4lxhIB.js +442 -0
  28. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CqXuTxun.js +150 -0
  29. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Dbik0PEw.js +1637 -0
  30. package/dist/Segment-DObdjyYi.js +568 -0
  31. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BAuM6qP5.js +181 -0
  32. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-BfyRVxWM.js +147 -0
  33. package/dist/{Setting-B7oISD0D.js → Setting-Dqgnd7TR.js} +610 -586
  34. package/dist/Store--Z4So__g.js +1744 -0
  35. package/dist/{StoreRewards-AMxIYhjZ.js → StoreRewards-DPFVXWwm.js} +33 -32
  36. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CNsdA106.js +939 -0
  37. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-B2szciPk.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CGOmGozY.js} +1 -1
  38. package/dist/{Tier-DkxdNj-K.js → Tier-36IfhsnP.js} +327 -318
  39. package/dist/{Title-VFpCOsMO.js → Title-XH56OOug.js} +199 -184
  40. package/dist/{Transaction-BgKD8n2L.js → Transaction-BUQcSmBs.js} +2 -2
  41. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-BVCfeG5T.js +130 -0
  42. package/dist/Voucher-CvmH0kcF.js +353 -0
  43. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BQOD6uEf.js +419 -0
  44. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B2FGvyza.js → ZodTextField.vue_vue_type_script_setup_true_lang-CcIcCt4N.js} +1 -1
  45. package/dist/{app-DUl5dav5.js → app-DeW5_DB0.js} +1754 -1496
  46. package/dist/{app-DA-t-2Zt.js → app-TN8KEPMu.js} +1 -1
  47. package/dist/app.js +1 -1
  48. package/dist/{business-CeCitOY4.js → business-D1mLhSME.js} +1 -1
  49. package/dist/campaign-0tnkhu78.js +1810 -0
  50. package/dist/{campaign-CcLM6e4s.js → campaign-B-12Im0w.js} +2 -2
  51. package/dist/campaign.enum-C8m-HHZE.js +20 -0
  52. package/dist/campaign.fn-CxkhbK9i.js +758 -0
  53. package/dist/collectible.enum-6Syq-vQ6.js +19 -0
  54. package/dist/{collection.fn-CAEP7YxB.js → collection.fn-BUj75Jp2.js} +2 -2
  55. package/dist/dto-8wODhIIC.js +214 -0
  56. package/dist/{effect-Dt7rXOBy.js → effect-BEZEjcJu.js} +9 -9
  57. package/dist/email-addresses-PwjkdYYD.js +705 -0
  58. package/dist/{export-CyioiboQ.js → export-BB-0vgwy.js} +5 -5
  59. package/dist/{helper-FA_9AhGV.js → helper-DOt8-wns.js} +1 -1
  60. package/dist/{index-DLN4Kzz_.js → index-B1qUjniH.js} +1 -1
  61. package/dist/index-BTMIZz4v.js +44 -0
  62. package/dist/{index-igxrd5jC.js → index-By-GlmG7.js} +1500 -1479
  63. package/dist/index-C7zBkoZ4.js +115 -0
  64. package/dist/{index-CyNdsVrw.js → index-CNlHabtk.js} +1 -1
  65. package/dist/{index-DbbO3wip.js → index-CXGiIgdK.js} +48 -4
  66. package/dist/{index-C20XBD7G.js → index-Cjn1LVjC.js} +2192 -931
  67. package/dist/index-CpfUrdgw.js +29000 -0
  68. package/dist/index-CsaQJMAR.js +66 -0
  69. package/dist/index-DZuEmMyY.js +54 -0
  70. package/dist/{index-CCdXvb92.js → index-D_zwqIhq.js} +1 -1
  71. package/dist/index-DabUEw_c.js +32 -0
  72. package/dist/{index-BiFueJiF.js → index-X-FfC49l.js} +258 -192
  73. package/dist/index-vh86FiIQ.js +10 -0
  74. package/dist/{index.esm2017-Dl_CdTcK.js → index.esm2017-DJOUiVjR.js} +33 -33
  75. package/dist/loading-aCWVsOPY.js +71 -0
  76. package/dist/{membership-DFiY8aVd.js → membership-1etsHC5G.js} +54 -46
  77. package/dist/money-DzWRURZ5.js +15 -0
  78. package/dist/number-BxIQO1i3.js +12 -0
  79. package/dist/objectid-DjhmYkn-.js +145 -0
  80. package/dist/{loading-CZ0fiViM.js → plugins-CSPFAU50.js} +2990 -3062
  81. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  82. package/dist/reward-Bh4Li9f0.js +36 -0
  83. package/dist/{rule-C3e1xTqN.js → rule-CHTTTUFB.js} +180 -177
  84. package/dist/{rule-builder-MEVb_AiZ.js → rule-builder-OHfUJTIA.js} +1 -1
  85. package/dist/style.css +1 -1
  86. package/dist/{template-C2OKWd_e.js → template-ZGxXqkaC.js} +5 -5
  87. package/dist/trigger-Ogu5FDs0.js +144 -0
  88. package/dist/user-DBuU81tO.js +54 -0
  89. package/dist/{vue-i18n-CjxDUnX6.js → vue-i18n-CKpKQ6iE.js} +216 -216
  90. package/dist/{xlsx-CtXdl3ls.js → xlsx-DJDZBIeg.js} +1 -1
  91. package/package.json +9 -7
  92. package/dist/Analytic-C_ZFR5jh.js +0 -622
  93. package/dist/Card-C7dUFJKe.js +0 -825
  94. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bgl90veU.js +0 -2813
  95. package/dist/Marketing-BaqZUeVI.js +0 -316
  96. package/dist/MemberList-B9cutmEh.js +0 -1733
  97. package/dist/MemberTransactions-DRHA7AOF.js +0 -38
  98. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BHCoDSTg.js +0 -1753
  99. package/dist/Segment-Dj8nc3AE.js +0 -437
  100. package/dist/Store-CJ3wcohQ.js +0 -1511
  101. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-wXUTfQQF.js +0 -890
  102. package/dist/Voucher-BbTLt8Pt.js +0 -490
  103. package/dist/dto-CRJma6eX.js +0 -2770
  104. package/dist/index-B1e0LtDe.js +0 -99
  105. package/dist/index-Be2ZYDy_.js +0 -298
  106. package/dist/index-CDkITvze.js +0 -762
  107. package/dist/index-CuvNtC_M.js +0 -61
  108. package/dist/index-DPP5F3bT.js +0 -206
  109. package/dist/index-Dbo3DDwp.js +0 -29193
  110. package/dist/money-D8hUEfP4.js +0 -15
  111. package/dist/number-DL3GAeVt.js +0 -12
  112. package/dist/user-Bm4KttFq.js +0 -37
@@ -1,6 +1,6 @@
1
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-wXUTfQQF.js";
3
- import { u as C } from "./vue-i18n-CjxDUnX6.js";
2
+ import { _ as g, a as y } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-CNsdA106.js";
3
+ import { u as C } from "./vue-i18n-CKpKQ6iE.js";
4
4
  const T = { class: "px-24 flex flex-col gap-y-32 pb-24" }, P = /* @__PURE__ */ d({
5
5
  __name: "Transaction",
6
6
  setup(V) {
@@ -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-By-GlmG7.js";
3
+ import { i as C, R as e } from "./rule-builder-OHfUJTIA.js";
4
+ import { _ as I } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Dbik0PEw.js";
5
+ import { p as N } from "./plugins-CSPFAU50.js";
6
+ import { u as S } from "./membership-1etsHC5G.js";
7
+ import { _ as j } from "./CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js";
8
+ import { u as x } from "./vue-i18n-CKpKQ6iE.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,353 @@
1
+ import { defineComponent as z, ref as k, computed as Q, h as m, onMounted as Z, resolveComponent as d, openBlock as u, createElementBlock as S, Fragment as V, createVNode as s, unref as t, createElementVNode as r, withCtx as F, renderList as J, createBlock as y, resolveDynamicComponent as Y, toDisplayString as g, createCommentVNode as E } from "vue";
2
+ import { _ as ee } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as oe, components as f } from "@feedmepos/ui-library";
4
+ import { p as A, a as te } from "./plugins-CSPFAU50.js";
5
+ import { useCoreStore as ae } from "@feedmepos/mf-common";
6
+ import { u as ne } from "./loading-aCWVsOPY.js";
7
+ import { u as ce } from "./business-D1mLhSME.js";
8
+ import { u as re } from "./campaign-B-12Im0w.js";
9
+ import { g as B, a as O } from "./campaign-0tnkhu78.js";
10
+ import "./index-CNlHabtk.js";
11
+ import { u as ie } from "./template-ZGxXqkaC.js";
12
+ import { _ as se } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-TjNinQ8e.js";
13
+ import { _ as le } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
14
+ import { _ as me } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang-BfyRVxWM.js";
15
+ import { u as ue } from "./vue-i18n-CKpKQ6iE.js";
16
+ import { useRouter as de } from "vue-router";
17
+ import { c as w } from "./index-C7zBkoZ4.js";
18
+ import { R as H } from "./app-DeW5_DB0.js";
19
+ var pe = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedmedev.cc", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc" };
20
+ const fe = { class: "px-24 flex flex-col gap-y-16" }, he = { class: "flex items-center justify-between w-full" }, ye = { class: "flex gap-8 overflow-x-auto" }, ge = { class: "space-y-8" }, _e = { class: "flex w-full gap-4 items-center" }, ve = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ce = { class: "space-y-4" }, we = { class: "fm-typo-en-body-lg-600" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xe = { class: "flex gap-8 items-center" }, ke = { class: "flex flex-col gap-16 text-center" }, Se = { class: "fm-typo-en-title-sm-800" }, Ve = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ge = /* @__PURE__ */ z({
21
+ __name: "Voucher",
22
+ setup(Fe) {
23
+ const { t: a } = ue(), T = {
24
+ label: a("connect.voucher.createCampaign"),
25
+ value: "create",
26
+ isPrimary: !0,
27
+ prependIcon: "add"
28
+ }, I = oe(), $ = ie("VOUCHER", I), K = ce(), p = re(), { global: N, minor: L } = ne, P = de(), i = k({
29
+ searchKey: "",
30
+ location: null
31
+ }), _ = Q(
32
+ () => p.campaigns.voucher.filter(
33
+ (e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
34
+ )
35
+ ), D = [
36
+ {
37
+ header: a("connect.voucher.voucherTitle"),
38
+ accessorFn: (e) => e.name
39
+ },
40
+ {
41
+ header: a("connect.voucher.status"),
42
+ cell(e) {
43
+ return B(e.row.original);
44
+ }
45
+ },
46
+ {
47
+ header: a("connect.voucher.summary"),
48
+ accessorFn: (e) => O(e)
49
+ },
50
+ {
51
+ header: a("connect.voucher.quota"),
52
+ accessorFn: (e) => {
53
+ var o;
54
+ return ((o = e.pf_collectible) == null ? void 0 : o.options.maxReceive) ?? "Unlimited";
55
+ }
56
+ },
57
+ {
58
+ header: a("connect.voucher.claimed"),
59
+ accessorFn: (e) => {
60
+ var o;
61
+ return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
62
+ }
63
+ },
64
+ {
65
+ header: a("connect.voucher.actions"),
66
+ cell(e) {
67
+ return m("div", { class: "flex items-center justify-end" }, [
68
+ m(f.FmButton, {
69
+ icon: "visibility",
70
+ variant: "tertiary",
71
+ iconColor: "neutral-gray-400",
72
+ onClick: async (o) => {
73
+ o.stopPropagation(), await P.push({
74
+ name: H["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
75
+ params: { id: e.row.original._id }
76
+ });
77
+ }
78
+ }),
79
+ m(
80
+ f.FmMenu,
81
+ {
82
+ placement: "bottom-end",
83
+ onClick: (o) => {
84
+ o.stopPropagation();
85
+ }
86
+ },
87
+ {
88
+ "menu-button": () => m(f.FmButton, {
89
+ icon: "more_vert",
90
+ iconColor: "neutral-gray-400",
91
+ variant: "tertiary"
92
+ }),
93
+ default: () => {
94
+ const o = [
95
+ m(
96
+ f.FmMenuItem,
97
+ {
98
+ onClick: async (c) => {
99
+ c.stopPropagation(), M(e.row.original);
100
+ }
101
+ },
102
+ {
103
+ label: m(
104
+ "div",
105
+ {
106
+ class: "text-fm-color-typo-error fm-typo-en-body-md-400"
107
+ },
108
+ a("connect.voucher.remove")
109
+ )
110
+ }
111
+ )
112
+ ];
113
+ return e.row.original.event.type === "SIMPLE_CLAIM" && (o.unshift(
114
+ m(f.FmMenuItem, {
115
+ label: a("connect.voucher.send"),
116
+ onClick: async (c) => {
117
+ var l;
118
+ c.stopPropagation(), (l = b.value) == null || l.showSheet({
119
+ campaignId: e.row.original._id
120
+ });
121
+ }
122
+ })
123
+ ), o.unshift(
124
+ m(f.FmMenuItem, {
125
+ label: a("connect.voucher.share"),
126
+ onClick: async (c) => {
127
+ if (c.stopPropagation(), e.row.original.event.type !== "SIMPLE_CLAIM")
128
+ return await A.confirm(
129
+ "Cannot share a voucher that is not a simple claim.",
130
+ "Share Voucher",
131
+ "OK"
132
+ );
133
+ await te(
134
+ `https://${ae().currentBusiness.value._id}.${pe.appUrl}/vouchers/${e.row.original._id}`,
135
+ {
136
+ successMessage: "Voucher link copied to clipboard"
137
+ }
138
+ );
139
+ }
140
+ })
141
+ )), o;
142
+ }
143
+ }
144
+ )
145
+ ]);
146
+ }
147
+ }
148
+ ], U = k(), b = k();
149
+ async function M(e) {
150
+ await A.remove(a("connect.voucher.confirmRemove", { name: e.name })) && await L(
151
+ async () => {
152
+ await w.delete(e._id), await p.read("VOUCHER");
153
+ },
154
+ {
155
+ message: a("connect.voucher.removing", { name: e.name }),
156
+ successMessage: a("connect.voucher.removedSuccessfully", {
157
+ name: e.name
158
+ })
159
+ }
160
+ );
161
+ }
162
+ async function v(e) {
163
+ e ? await o() : $.open(async (c) => {
164
+ await o(c);
165
+ });
166
+ async function o(c) {
167
+ var l;
168
+ (l = U.value) == null || l.showSheet(
169
+ !0,
170
+ "VOUCHER",
171
+ e ? await w.readById(e._id) : void 0,
172
+ c
173
+ );
174
+ }
175
+ }
176
+ async function j(e) {
177
+ e.campaign._id && await new Promise((o) => {
178
+ I.open({
179
+ title: "Confirmation",
180
+ message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
181
+ primaryActions: { text: "Update all", close: !0 },
182
+ secondaryActions: { text: "Update future only", close: !0 }
183
+ }).onPrimary(async () => {
184
+ var c;
185
+ e.updateCollections = !0, (c = window.top) == null || c.postMessage("updateAllVoucher", "*"), o();
186
+ }).onSecondary(async () => {
187
+ o();
188
+ });
189
+ }), await L(
190
+ async () => {
191
+ e.campaign._id ? await w.update(e.campaign._id, e) : await w.create(e), await p.read("VOUCHER");
192
+ },
193
+ {
194
+ message: a(
195
+ e.campaign._id ? "connect.voucher.updating" : "connect.voucher.creating"
196
+ ),
197
+ successMessage: a(
198
+ e.campaign._id ? "connect.voucher.updatedSuccessfully" : "connect.voucher.createdSuccessfully"
199
+ )
200
+ }
201
+ );
202
+ }
203
+ return Z(async () => {
204
+ await N(async () => {
205
+ await p.read("VOUCHER");
206
+ });
207
+ }), (e, o) => {
208
+ const c = d("FmPageHead"), l = d("FmSearch"), q = d("FmTable"), C = d("FmButton"), G = d("FmListItem"), X = d("FmList"), W = d("FmCard");
209
+ return u(), S(V, null, [
210
+ s(c, {
211
+ title: t(a)("connect.voucher.title"),
212
+ actions: t(_).length > 0 ? [T] : [],
213
+ "onClick:action": o[0] || (o[0] = () => v())
214
+ }, null, 8, ["title", "actions"]),
215
+ r("div", fe, [
216
+ s(l, {
217
+ modelValue: t(i).searchKey,
218
+ "onUpdate:modelValue": o[1] || (o[1] = (n) => t(i).searchKey = n),
219
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
220
+ placeholder: t(a)("connect.voucher.search"),
221
+ collapsible: ""
222
+ }, null, 8, ["modelValue", "placeholder"]),
223
+ t(p).campaigns.voucher && t(p).campaigns.voucher.length > 0 ? (u(), S(V, { key: 0 }, [
224
+ r("div", he, [
225
+ r("div", ye, [
226
+ s(le, {
227
+ modelValue: t(i).location,
228
+ "onUpdate:modelValue": o[2] || (o[2] = (n) => t(i).location = n),
229
+ label: t(a)("connect.voucher.location"),
230
+ "show-item-label": !0,
231
+ icon: "storefront",
232
+ placement: "bottom-start",
233
+ items: t(K).locationItems
234
+ }, null, 8, ["modelValue", "label", "items"])
235
+ ]),
236
+ s(l, {
237
+ modelValue: t(i).searchKey,
238
+ "onUpdate:modelValue": o[3] || (o[3] = (n) => t(i).searchKey = n),
239
+ class: "xs:hidden",
240
+ placeholder: t(a)("connect.voucher.search"),
241
+ collapsible: ""
242
+ }, null, 8, ["modelValue", "placeholder"])
243
+ ]),
244
+ s(q, {
245
+ class: "xs:hidden",
246
+ "row-data": t(_),
247
+ "column-defs": D,
248
+ "search-value": t(i).searchKey,
249
+ "column-filter": [],
250
+ onRowClick: o[4] || (o[4] = (n) => v(n.original)),
251
+ "hide-footer": t(_).length < 10
252
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
253
+ s(X, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
254
+ default: F(() => [
255
+ (u(!0), S(V, null, J(t(_).filter(
256
+ (n) => n.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
257
+ ), (n) => (u(), y(G, {
258
+ key: n._id.toString(),
259
+ onClick: (x) => v(n),
260
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
261
+ }, {
262
+ default: F(() => {
263
+ var x;
264
+ return [
265
+ r("div", ge, [
266
+ r("div", _e, [
267
+ (u(), y(Y(t(B)(n)))),
268
+ r("div", ve, g(((x = n.pf_collectible) == null ? void 0 : x.currentReceive) ?? 0) + " claimed ", 1)
269
+ ]),
270
+ r("div", Ce, [
271
+ r("div", we, g(n.name), 1),
272
+ r("div", be, g(t(O)(n)), 1)
273
+ ])
274
+ ]),
275
+ r("div", xe, [
276
+ n.event.type === "SIMPLE_CLAIM" ? (u(), y(C, {
277
+ key: 0,
278
+ icon: "visibility",
279
+ "icon-color": "neutral-gray-400",
280
+ variant: "tertiary",
281
+ onClick: async (h) => {
282
+ h.stopPropagation(), await t(P).push({
283
+ name: t(H)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
284
+ params: { id: n._id }
285
+ });
286
+ }
287
+ }, null, 8, ["onClick"])) : E("", !0),
288
+ n.event.type === "SIMPLE_CLAIM" ? (u(), y(C, {
289
+ key: 1,
290
+ icon: "send",
291
+ "icon-color": "neutral-gray-400",
292
+ variant: "tertiary",
293
+ onClick: (h) => {
294
+ var R;
295
+ h.stopPropagation(), (R = t(b)) == null || R.showSheet({
296
+ campaignId: n._id
297
+ });
298
+ }
299
+ }, null, 8, ["onClick"])) : E("", !0),
300
+ s(C, {
301
+ icon: "delete",
302
+ "icon-color": "neutral-gray-400",
303
+ variant: "tertiary",
304
+ onClick: (h) => (h.stopPropagation(), M(n))
305
+ }, null, 8, ["onClick"])
306
+ ])
307
+ ];
308
+ }),
309
+ _: 2
310
+ }, 1032, ["onClick"]))), 128))
311
+ ]),
312
+ _: 1
313
+ })
314
+ ], 64)) : (u(), y(W, {
315
+ key: 1,
316
+ variant: "outlined",
317
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
318
+ }, {
319
+ default: F(() => [
320
+ o[6] || (o[6] = r("img", {
321
+ src: ee,
322
+ class: "aspect-square w-[150px]"
323
+ }, null, -1)),
324
+ r("div", ke, [
325
+ r("div", Se, g(t(a)("connect.voucher.createVoucherCampaign")), 1),
326
+ r("div", Ve, g(t(a)("connect.voucher.description")), 1)
327
+ ]),
328
+ s(C, {
329
+ variant: "primary",
330
+ label: t(a)("connect.voucher.createVoucherCampaign"),
331
+ icon: "add",
332
+ onClick: o[5] || (o[5] = (n) => v())
333
+ }, null, 8, ["label"])
334
+ ]),
335
+ _: 1
336
+ })),
337
+ s(se, {
338
+ ref_key: "sheetRef",
339
+ ref: U,
340
+ "onSubmit:modelValue": j
341
+ }, null, 512),
342
+ s(me, {
343
+ ref_key: "sendVoucherSheetRef",
344
+ ref: b
345
+ }, null, 512)
346
+ ])
347
+ ], 64);
348
+ };
349
+ }
350
+ });
351
+ export {
352
+ Ge as default
353
+ };