@feedmepos/mf-connect 0.1.0-beta.7 → 0.1.0-beta.70

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 (123) hide show
  1. package/dist/Analytic-DEQUEGlq.js +427 -0
  2. package/dist/{App-DalxIjTu.js → App-CcoU2SAx.js} +445 -420
  3. package/dist/AuditLogs-CiB6u06w.js +1886 -0
  4. package/dist/Bin-C2_1m5RT.js +166 -0
  5. package/dist/{Broadcast-uMAvsC--.js → Broadcast-TotIXDuJ.js} +56 -54
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-JxbENan8.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CixQu3Pr.js} +6 -8
  7. package/dist/Card-Ce-_xMgS.js +896 -0
  8. package/dist/Collections-DKva6Doi.js +459 -0
  9. package/dist/{Credit-QlnatflM.js → Credit-BVUxIJ6C.js} +36 -34
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
  11. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BKEumoan.js +2181 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BE07lc4M.js → EffectSheet.vue_vue_type_style_index_0_lang-ah4bz-qR.js} +49 -49
  14. package/dist/{Experience-Czy41ifp.js → Experience-DV3384o0.js} +32 -30
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
  16. package/dist/Game-DY83ti52.js +278 -0
  17. package/dist/Index-DEIaZ-2H.js +259 -0
  18. package/dist/Marketing-C2RwIlrg.js +20071 -0
  19. package/dist/Member-D4fc-wzd.js +333 -0
  20. package/dist/MemberList-DSMI6t_D.js +1598 -0
  21. package/dist/MemberTransactions-wXUlbbRq.js +45 -0
  22. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CtM73bcN.js → MessageInput.vue_vue_type_script_setup_true_lang-DYS0klKm.js} +135 -120
  23. package/dist/Mission-P_KLDEpg.js +296 -0
  24. package/dist/Overview-8vc0f1D7.js +1078 -0
  25. package/dist/{Point-By6ogYy_.js → Point-B4Y0Pq60.js} +55 -53
  26. package/dist/{Promotion-DKcBr-RI.js → Promotion-C1CbesgZ.js} +65 -57
  27. package/dist/Queue-BlPA7PNH.js +244 -0
  28. package/dist/Record-Cl1qXSSk.js +340 -0
  29. package/dist/Reward-jy6-W1Eh.js +442 -0
  30. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-d5JNNNHf.js +150 -0
  31. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DYul_Nu8.js +1640 -0
  32. package/dist/Segment-B36Nrvxs.js +568 -0
  33. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-jN0xUFNR.js +181 -0
  34. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-BLFTNooB.js +186 -0
  35. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-H_Sehhgf.js +147 -0
  36. package/dist/Setting-AgQf2X4W.js +1931 -0
  37. package/dist/Store-D3Mm0pan.js +1841 -0
  38. package/dist/StoreRewards-L0VLWz8l.js +423 -0
  39. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Zl_cXXSD.js +1028 -0
  40. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-nEdCD6la.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-b4mfueTj.js} +1 -1
  41. package/dist/{Tier-DvAs0-yx.js → Tier-DQq-375x.js} +327 -318
  42. package/dist/{Title-B_Trr39o.js → Title-OJxuBvaa.js} +224 -209
  43. package/dist/{Transaction-DCJw-b3H.js → Transaction-vgsYRfD7.js} +2 -2
  44. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-Cwi0mvC3.js +130 -0
  45. package/dist/Voucher-BFwLaoxe.js +354 -0
  46. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DNUBaNtJ.js +419 -0
  47. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DXkhu8e9.js → ZodTextField.vue_vue_type_script_setup_true_lang-ms40eptZ.js} +1 -1
  48. package/dist/app-BQFTJ_hE.js +33357 -0
  49. package/dist/app-D7C3Fxfi.js +7077 -0
  50. package/dist/app.js +1 -1
  51. package/dist/{business-BC4-i1cU.js → business-vzpvmTdG.js} +1 -1
  52. package/dist/{campaign--0_yMbMV.js → campaign-BkxTDfsK.js} +2 -2
  53. package/dist/campaign-UQ8kMVeC.js +1810 -0
  54. package/dist/campaign.enum-BdT-e9h9.js +20 -0
  55. package/dist/campaign.fn-lc4ZhFCU.js +758 -0
  56. package/dist/collectible.enum-C8kd17Tz.js +19 -0
  57. package/dist/{collection.fn-3TwPe7aF.js → collection.fn-BIw1Y_tv.js} +2 -2
  58. package/dist/dto-CwzAhB8x.js +214 -0
  59. package/dist/{effect-BeR0LK61.js → effect-CJcvLlKG.js} +33 -16
  60. package/dist/email-addresses-BCJTQPT0.js +705 -0
  61. package/dist/{export-xeLLhqvh.js → export-URRwle1z.js} +5 -5
  62. package/dist/{helper-B5iqfKh8.js → helper-DccnE6zn.js} +1 -1
  63. package/dist/index-BiIZ7X6d.js +29556 -0
  64. package/dist/{index-CyKZ-SsN.js → index-BsRJ4kVb.js} +1 -1
  65. package/dist/{index-CU_d8jjU.js → index-C3lpXz_P.js} +1 -1
  66. package/dist/{index-Ct_wR519.js → index-CFA3EqId.js} +24 -21
  67. package/dist/{index-DP-dGMJC.js → index-CPRN3irj.js} +2230 -871
  68. package/dist/index-CaxFS90M.js +56 -0
  69. package/dist/index-CsaQJMAR.js +66 -0
  70. package/dist/index-D4MX9e5q.js +115 -0
  71. package/dist/index-DrE9VkxR.js +32 -0
  72. package/dist/index-EOPRlB9V.js +54 -0
  73. package/dist/{index-CAn5heDe.js → index-FcxOGFKj.js} +48 -4
  74. package/dist/{index-Bh-uaaBG.js → index-OScGm4mF.js} +1506 -1480
  75. package/dist/{index-BOdtpNkP.js → index-ghSGvG-m.js} +266 -173
  76. package/dist/index-vh86FiIQ.js +10 -0
  77. package/dist/{index.esm2017-5jeDA5Zo.js → index.esm2017-CE1CQHrP.js} +121 -121
  78. package/dist/loading-B8zghYbj.js +71 -0
  79. package/dist/{membership-D0nqqWNZ.js → membership-DoJMF2T6.js} +54 -46
  80. package/dist/money-CTR0rXZw.js +15 -0
  81. package/dist/number-Bhgz9eFP.js +12 -0
  82. package/dist/objectid-DdVJrRBw.js +145 -0
  83. package/dist/{loading-C-JDVajU.js → plugins-B5mQ7CHT.js} +3871 -3943
  84. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  85. package/dist/reward-DicsEEHe.js +36 -0
  86. package/dist/{rule-builder-BXt29Es4.js → rule-builder-BWb4JTrd.js} +1 -1
  87. package/dist/{rule-Dn_GgBCe.js → rule-s8siRar1.js} +185 -178
  88. package/dist/style.css +1 -1
  89. package/dist/{template-D2Oi3dxP.js → template-Qb5ozfLa.js} +5 -5
  90. package/dist/trigger-Bsb3Kj35.js +144 -0
  91. package/dist/user-DJ8aHRaM.js +54 -0
  92. package/dist/{vue-i18n-Dud8fvmw.js → vue-i18n-BG2U7GtN.js} +282 -282
  93. package/dist/{xlsx-CCRCidY2.js → xlsx-2QxyDFwt.js} +1 -1
  94. package/package.json +11 -7
  95. package/dist/Analytic-BMpS6jWb.js +0 -622
  96. package/dist/Card-DV8-g69L.js +0 -825
  97. package/dist/Collections-DRafEHT1.js +0 -453
  98. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-TDoMehSB.js +0 -2813
  99. package/dist/Game-CD3zSitz.js +0 -255
  100. package/dist/Marketing-NNes8z6Q.js +0 -316
  101. package/dist/Member-CTqBgYuV.js +0 -69
  102. package/dist/MemberList-B99tS5ce.js +0 -1733
  103. package/dist/MemberTransactions-D1YCXPOg.js +0 -38
  104. package/dist/Mission-XbBVKBiE.js +0 -261
  105. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D1ESqEFO.js +0 -1753
  106. package/dist/Segment-B8cszL-F.js +0 -437
  107. package/dist/Setting-aZYABlMW.js +0 -1901
  108. package/dist/Store-Bx2tyJwe.js +0 -1511
  109. package/dist/StoreRewards-DTp9G6gw.js +0 -401
  110. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B2W7ly5Z.js +0 -890
  111. package/dist/Voucher-jqv3ji90.js +0 -490
  112. package/dist/app-WlcUVbFb.js +0 -5764
  113. package/dist/app-_w0hjM7u.js +0 -53428
  114. package/dist/dto-Ns2dLn1B.js +0 -2770
  115. package/dist/index-BWb9vRCi.js +0 -29193
  116. package/dist/index-CpU9aqyW.js +0 -206
  117. package/dist/index-CqO_ZvtD.js +0 -99
  118. package/dist/index-CuvNtC_M.js +0 -61
  119. package/dist/index-DsNsA2uX.js +0 -298
  120. package/dist/index-WAMr3npT.js +0 -762
  121. package/dist/money-hdbrblud.js +0 -15
  122. package/dist/number-CRWGOZaW.js +0 -12
  123. 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-B2W7ly5Z.js";
3
- import { u as C } from "./vue-i18n-Dud8fvmw.js";
2
+ import { _ as g, a as y } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-Zl_cXXSD.js";
3
+ import { u as C } from "./vue-i18n-BG2U7GtN.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-OScGm4mF.js";
3
+ import { i as C, R as e } from "./rule-builder-BWb4JTrd.js";
4
+ import { _ as I } from "./RuleGroup.vue_vue_type_script_setup_true_lang-DYul_Nu8.js";
5
+ import { p as N } from "./plugins-B5mQ7CHT.js";
6
+ import { u as S } from "./membership-DoJMF2T6.js";
7
+ import { _ as j } from "./CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js";
8
+ import { u as x } from "./vue-i18n-BG2U7GtN.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,354 @@
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 F, createVNode as s, unref as t, createElementVNode as r, withCtx as V, 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-B5mQ7CHT.js";
5
+ import { useCoreStore as ae } from "@feedmepos/mf-common";
6
+ import { u as ne } from "./loading-B8zghYbj.js";
7
+ import { u as ce } from "./business-vzpvmTdG.js";
8
+ import { u as re } from "./campaign-BkxTDfsK.js";
9
+ import { g as ie, a as B, b as O } from "./campaign-UQ8kMVeC.js";
10
+ import "./index-BsRJ4kVb.js";
11
+ import { u as se } from "./template-Qb5ozfLa.js";
12
+ import { _ as le } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-BKEumoan.js";
13
+ import { _ as me } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
14
+ import { _ as ue } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang-H_Sehhgf.js";
15
+ import { u as de } from "./vue-i18n-BG2U7GtN.js";
16
+ import { useRouter as pe } from "vue-router";
17
+ import { c as w } from "./index-D4MX9e5q.js";
18
+ import { R as H } from "./app-D7C3Fxfi.js";
19
+ var fe = { 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 he = { class: "px-24 flex flex-col gap-y-16" }, ye = { class: "flex items-center justify-between w-full" }, ge = { class: "flex gap-8 overflow-x-auto" }, _e = { class: "space-y-8" }, ve = { class: "flex w-full gap-4 items-center" }, Ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, we = { class: "space-y-4" }, be = { class: "fm-typo-en-body-lg-600" }, xe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ke = { class: "flex gap-8 items-center" }, Se = { class: "flex flex-col gap-16 text-center" }, Fe = { class: "fm-typo-en-title-sm-800" }, Ve = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xe = /* @__PURE__ */ z({
21
+ __name: "Voucher",
22
+ setup(Ie) {
23
+ const { t: a } = de(), T = {
24
+ label: a("connect.voucher.createCampaign"),
25
+ value: "create",
26
+ isPrimary: !0,
27
+ prependIcon: "add"
28
+ }, I = oe(), $ = se("VOUCHER", I), K = ce(), p = re(), { global: N, minor: L } = ne, P = pe(), 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
+ accessorFn: (e) => ie(e),
43
+ cell(e) {
44
+ return B(e.row.original);
45
+ }
46
+ },
47
+ {
48
+ header: a("connect.voucher.summary"),
49
+ accessorFn: (e) => O(e)
50
+ },
51
+ {
52
+ header: a("connect.voucher.quota"),
53
+ accessorFn: (e) => {
54
+ var o;
55
+ return ((o = e.pf_collectible) == null ? void 0 : o.options.maxReceive) ?? "Unlimited";
56
+ }
57
+ },
58
+ {
59
+ header: a("connect.voucher.claimed"),
60
+ accessorFn: (e) => {
61
+ var o;
62
+ return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
63
+ }
64
+ },
65
+ {
66
+ header: a("connect.voucher.actions"),
67
+ cell(e) {
68
+ return m("div", { class: "flex items-center justify-end" }, [
69
+ m(f.FmButton, {
70
+ icon: "visibility",
71
+ variant: "tertiary",
72
+ iconColor: "neutral-gray-400",
73
+ onClick: async (o) => {
74
+ o.stopPropagation(), await P.push({
75
+ name: H["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
76
+ params: { id: e.row.original._id }
77
+ });
78
+ }
79
+ }),
80
+ m(
81
+ f.FmMenu,
82
+ {
83
+ placement: "bottom-end",
84
+ onClick: (o) => {
85
+ o.stopPropagation();
86
+ }
87
+ },
88
+ {
89
+ "menu-button": () => m(f.FmButton, {
90
+ icon: "more_vert",
91
+ iconColor: "neutral-gray-400",
92
+ variant: "tertiary"
93
+ }),
94
+ default: () => {
95
+ const o = [
96
+ m(
97
+ f.FmMenuItem,
98
+ {
99
+ onClick: async (c) => {
100
+ c.stopPropagation(), M(e.row.original);
101
+ }
102
+ },
103
+ {
104
+ label: m(
105
+ "div",
106
+ {
107
+ class: "text-fm-color-typo-error fm-typo-en-body-md-400"
108
+ },
109
+ a("connect.voucher.remove")
110
+ )
111
+ }
112
+ )
113
+ ];
114
+ return e.row.original.event.type === "SIMPLE_CLAIM" && (o.unshift(
115
+ m(f.FmMenuItem, {
116
+ label: a("connect.voucher.send"),
117
+ onClick: async (c) => {
118
+ var l;
119
+ c.stopPropagation(), (l = b.value) == null || l.showSheet({
120
+ campaignId: e.row.original._id
121
+ });
122
+ }
123
+ })
124
+ ), o.unshift(
125
+ m(f.FmMenuItem, {
126
+ label: a("connect.voucher.share"),
127
+ onClick: async (c) => {
128
+ if (c.stopPropagation(), e.row.original.event.type !== "SIMPLE_CLAIM")
129
+ return await A.confirm(
130
+ "Cannot share a voucher that is not a simple claim.",
131
+ "Share Voucher",
132
+ "OK"
133
+ );
134
+ await te(
135
+ `https://${ae().currentBusiness.value._id}.${fe.appUrl}/vouchers/${e.row.original._id}`,
136
+ {
137
+ successMessage: "Voucher link copied to clipboard"
138
+ }
139
+ );
140
+ }
141
+ })
142
+ )), o;
143
+ }
144
+ }
145
+ )
146
+ ]);
147
+ }
148
+ }
149
+ ], U = k(), b = k();
150
+ async function M(e) {
151
+ await A.remove(a("connect.voucher.confirmRemove", { name: e.name })) && await L(
152
+ async () => {
153
+ await w.delete(e._id), await p.read("VOUCHER");
154
+ },
155
+ {
156
+ message: a("connect.voucher.removing", { name: e.name }),
157
+ successMessage: a("connect.voucher.removedSuccessfully", {
158
+ name: e.name
159
+ })
160
+ }
161
+ );
162
+ }
163
+ async function v(e) {
164
+ e ? await o() : $.open(async (c) => {
165
+ await o(c);
166
+ });
167
+ async function o(c) {
168
+ var l;
169
+ (l = U.value) == null || l.showSheet(
170
+ !0,
171
+ "VOUCHER",
172
+ e ? await w.readById(e._id) : void 0,
173
+ c
174
+ );
175
+ }
176
+ }
177
+ async function j(e) {
178
+ e.campaign._id && await new Promise((o) => {
179
+ I.open({
180
+ title: "Confirmation",
181
+ message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
182
+ primaryActions: { text: "Update all", close: !0 },
183
+ secondaryActions: { text: "Update future only", close: !0 }
184
+ }).onPrimary(async () => {
185
+ var c;
186
+ e.updateCollections = !0, (c = window.top) == null || c.postMessage("updateAllVoucher", "*"), o();
187
+ }).onSecondary(async () => {
188
+ o();
189
+ });
190
+ }), await L(
191
+ async () => {
192
+ e.campaign._id ? await w.update(e.campaign._id, e) : await w.create(e), await p.read("VOUCHER");
193
+ },
194
+ {
195
+ message: a(
196
+ e.campaign._id ? "connect.voucher.updating" : "connect.voucher.creating"
197
+ ),
198
+ successMessage: a(
199
+ e.campaign._id ? "connect.voucher.updatedSuccessfully" : "connect.voucher.createdSuccessfully"
200
+ )
201
+ }
202
+ );
203
+ }
204
+ return Z(async () => {
205
+ await N(async () => {
206
+ await p.read("VOUCHER");
207
+ });
208
+ }), (e, o) => {
209
+ const c = d("FmPageHead"), l = d("FmSearch"), q = d("FmTable"), C = d("FmButton"), G = d("FmListItem"), X = d("FmList"), W = d("FmCard");
210
+ return u(), S(F, null, [
211
+ s(c, {
212
+ title: t(a)("connect.voucher.title"),
213
+ actions: t(_).length > 0 ? [T] : [],
214
+ "onClick:action": o[0] || (o[0] = () => v())
215
+ }, null, 8, ["title", "actions"]),
216
+ r("div", he, [
217
+ s(l, {
218
+ modelValue: t(i).searchKey,
219
+ "onUpdate:modelValue": o[1] || (o[1] = (n) => t(i).searchKey = n),
220
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
221
+ placeholder: t(a)("connect.voucher.search"),
222
+ collapsible: ""
223
+ }, null, 8, ["modelValue", "placeholder"]),
224
+ t(p).campaigns.voucher && t(p).campaigns.voucher.length > 0 ? (u(), S(F, { key: 0 }, [
225
+ r("div", ye, [
226
+ r("div", ge, [
227
+ s(me, {
228
+ modelValue: t(i).location,
229
+ "onUpdate:modelValue": o[2] || (o[2] = (n) => t(i).location = n),
230
+ label: t(a)("connect.voucher.location"),
231
+ "show-item-label": !0,
232
+ icon: "storefront",
233
+ placement: "bottom-start",
234
+ items: t(K).locationItems
235
+ }, null, 8, ["modelValue", "label", "items"])
236
+ ]),
237
+ s(l, {
238
+ modelValue: t(i).searchKey,
239
+ "onUpdate:modelValue": o[3] || (o[3] = (n) => t(i).searchKey = n),
240
+ class: "xs:hidden",
241
+ placeholder: t(a)("connect.voucher.search"),
242
+ collapsible: ""
243
+ }, null, 8, ["modelValue", "placeholder"])
244
+ ]),
245
+ s(q, {
246
+ class: "xs:hidden",
247
+ "row-data": t(_),
248
+ "column-defs": D,
249
+ "search-value": t(i).searchKey,
250
+ "column-filter": [],
251
+ onRowClick: o[4] || (o[4] = (n) => v(n.original)),
252
+ "hide-footer": t(_).length < 10
253
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
254
+ s(X, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
255
+ default: V(() => [
256
+ (u(!0), S(F, null, J(t(_).filter(
257
+ (n) => n.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
258
+ ), (n) => (u(), y(G, {
259
+ key: n._id.toString(),
260
+ onClick: (x) => v(n),
261
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
262
+ }, {
263
+ default: V(() => {
264
+ var x;
265
+ return [
266
+ r("div", _e, [
267
+ r("div", ve, [
268
+ (u(), y(Y(t(B)(n)))),
269
+ r("div", Ce, g(((x = n.pf_collectible) == null ? void 0 : x.currentReceive) ?? 0) + " claimed ", 1)
270
+ ]),
271
+ r("div", we, [
272
+ r("div", be, g(n.name), 1),
273
+ r("div", xe, g(t(O)(n)), 1)
274
+ ])
275
+ ]),
276
+ r("div", ke, [
277
+ n.event.type === "SIMPLE_CLAIM" ? (u(), y(C, {
278
+ key: 0,
279
+ icon: "visibility",
280
+ "icon-color": "neutral-gray-400",
281
+ variant: "tertiary",
282
+ onClick: async (h) => {
283
+ h.stopPropagation(), await t(P).push({
284
+ name: t(H)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
285
+ params: { id: n._id }
286
+ });
287
+ }
288
+ }, null, 8, ["onClick"])) : E("", !0),
289
+ n.event.type === "SIMPLE_CLAIM" ? (u(), y(C, {
290
+ key: 1,
291
+ icon: "send",
292
+ "icon-color": "neutral-gray-400",
293
+ variant: "tertiary",
294
+ onClick: (h) => {
295
+ var R;
296
+ h.stopPropagation(), (R = t(b)) == null || R.showSheet({
297
+ campaignId: n._id
298
+ });
299
+ }
300
+ }, null, 8, ["onClick"])) : E("", !0),
301
+ s(C, {
302
+ icon: "delete",
303
+ "icon-color": "neutral-gray-400",
304
+ variant: "tertiary",
305
+ onClick: (h) => (h.stopPropagation(), M(n))
306
+ }, null, 8, ["onClick"])
307
+ ])
308
+ ];
309
+ }),
310
+ _: 2
311
+ }, 1032, ["onClick"]))), 128))
312
+ ]),
313
+ _: 1
314
+ })
315
+ ], 64)) : (u(), y(W, {
316
+ key: 1,
317
+ variant: "outlined",
318
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
319
+ }, {
320
+ default: V(() => [
321
+ o[6] || (o[6] = r("img", {
322
+ src: ee,
323
+ class: "aspect-square w-[150px]"
324
+ }, null, -1)),
325
+ r("div", Se, [
326
+ r("div", Fe, g(t(a)("connect.voucher.createVoucherCampaign")), 1),
327
+ r("div", Ve, g(t(a)("connect.voucher.description")), 1)
328
+ ]),
329
+ s(C, {
330
+ variant: "primary",
331
+ label: t(a)("connect.voucher.createVoucherCampaign"),
332
+ icon: "add",
333
+ onClick: o[5] || (o[5] = (n) => v())
334
+ }, null, 8, ["label"])
335
+ ]),
336
+ _: 1
337
+ })),
338
+ s(le, {
339
+ ref_key: "sheetRef",
340
+ ref: U,
341
+ "onSubmit:modelValue": j
342
+ }, null, 512),
343
+ s(ue, {
344
+ ref_key: "sendVoucherSheetRef",
345
+ ref: b
346
+ }, null, 512)
347
+ ])
348
+ ], 64);
349
+ };
350
+ }
351
+ });
352
+ export {
353
+ Xe as default
354
+ };