@feedmepos/mf-connect 0.1.38-beta.73 → 0.1.38-beta.74

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 (133) hide show
  1. package/package.json +1 -1
  2. package/dist/Analytic-gGjm5ome.js +0 -761
  3. package/dist/App-BDz9mw-6.js +0 -4638
  4. package/dist/AuditLogs-4x90ZjjY.js +0 -1991
  5. package/dist/Bin-Bby2f42O.js +0 -166
  6. package/dist/Broadcast-eYN2AqFC.js +0 -267
  7. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B-fO9-Hb.js +0 -121
  8. package/dist/Card-Cz-pLt7X.js +0 -909
  9. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  10. package/dist/Collections-CgfXuVA1.js +0 -540
  11. package/dist/Credit-Lc6B2oQ9.js +0 -261
  12. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  13. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  14. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bm7XTR7o.js +0 -3167
  15. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Cp5nSLEX.js +0 -351
  16. package/dist/Experience-Ca94IJBt.js +0 -260
  17. package/dist/FileSaver.min-BThLVsSf.js +0 -74
  18. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  19. package/dist/Game-BYLYDTU9.js +0 -331
  20. package/dist/GenerateMaterial-CUoG6uyI.js +0 -589
  21. package/dist/Grab-DZ_LkTly.js +0 -301
  22. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-CI4kP9ul.js +0 -145
  23. package/dist/Index-BZ2r8x0t.js +0 -259
  24. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  25. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-BLKlXW1b.js +0 -18737
  26. package/dist/MainLayout-BfGSSVMW.js +0 -41
  27. package/dist/Marketing-DYg0J1xG.js +0 -145
  28. package/dist/MarketingMaterialEdit-B--Kck7j.js +0 -746
  29. package/dist/Member-By5QEJxn.js +0 -280
  30. package/dist/MemberList-D49bMmGJ.js +0 -1600
  31. package/dist/MemberOverview-wL_ailso.js +0 -58
  32. package/dist/MemberTransactions-Cz9XENK1.js +0 -45
  33. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-IlFjM-Y5.js +0 -60798
  34. package/dist/Mission-Cvl-V7c8.js +0 -335
  35. package/dist/Overview-lu82lUJp.js +0 -1078
  36. package/dist/Point-C65YFhOB.js +0 -263
  37. package/dist/Promotion-DQCrKO6a.js +0 -397
  38. package/dist/Queue-DR5lfSMi.js +0 -259
  39. package/dist/Record-BCt42_VZ.js +0 -341
  40. package/dist/Reward-7aOnjmMm.js +0 -442
  41. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-BPgjr91S.js +0 -149
  42. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Bp5jnlFr.js +0 -1912
  43. package/dist/Segment-DiYwfb8M.js +0 -881
  44. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-ydM5ypC0.js +0 -181
  45. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-BRs7pw0l.js +0 -188
  46. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DU8AAPFD.js +0 -147
  47. package/dist/Setting-k6xShcs8.js +0 -1999
  48. package/dist/SettingAdvertisements-DQa_jXYM.js +0 -263
  49. package/dist/Store-B6lYBpsm.js +0 -1995
  50. package/dist/StoreRewards-Cqd399q8.js +0 -534
  51. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Wv_SHwmo.js +0 -1128
  52. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-Bi1o4YAz.js +0 -7005
  53. package/dist/Tier-CXXImaDx.js +0 -969
  54. package/dist/Title-CTxNCmBW.js +0 -567
  55. package/dist/Transaction-DonaHVzF.js +0 -39
  56. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DbRVYccO.js +0 -130
  57. package/dist/Voucher-Bso_Mjlg.js +0 -422
  58. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DNvmaJk9.js +0 -421
  59. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-KHZ3-THo.js +0 -56
  60. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  61. package/dist/app-DKrmktFJ.js +0 -59071
  62. package/dist/app-wDQR6dpb.js +0 -39
  63. package/dist/app.js +0 -7
  64. package/dist/business-Dd73TVX5.js +0 -82
  65. package/dist/campaign-BUQHH4KL.js +0 -100
  66. package/dist/campaign-CpzFl8Vr.js +0 -4
  67. package/dist/campaign-DkJOyF24.js +0 -253
  68. package/dist/campaign.enum-C8vJuDAq.js +0 -26
  69. package/dist/campaign.fn-DJSpfhZH.js +0 -776
  70. package/dist/collectible.enum-D3W0TwoJ.js +0 -19
  71. package/dist/collection.fn-YzgpOmG0.js +0 -26
  72. package/dist/dto-sceHHLGr.js +0 -222
  73. package/dist/duplicateCampaign-CDulKxgJ.js +0 -51
  74. package/dist/effect-BSgfR9iB.js +0 -89
  75. package/dist/email-addresses-D_fyxOof.js +0 -705
  76. package/dist/export-OxiqL1B7.js +0 -96
  77. package/dist/feedme.ico +0 -0
  78. package/dist/helper-CzurWUe4.js +0 -86
  79. package/dist/index-BF0hGAkO.js +0 -32
  80. package/dist/index-BGMhsZnB.js +0 -124
  81. package/dist/index-B_QGGlMD.js +0 -54
  82. package/dist/index-BbTHqh58.js +0 -31
  83. package/dist/index-BqQas5Sx.js +0 -2428
  84. package/dist/index-BtMmY44D.js +0 -36
  85. package/dist/index-CAUVTn1I.js +0 -67
  86. package/dist/index-Cg-sBBf_.js +0 -3419
  87. package/dist/index-CuvNtC_M.js +0 -61
  88. package/dist/index-Cyt6eKEF.js +0 -8912
  89. package/dist/index-Dw3ew6qN.js +0 -85
  90. package/dist/index-IBvUTxqC.js +0 -30289
  91. package/dist/index-pkwrUX33.js +0 -28897
  92. package/dist/index-tYmg4eyJ.js +0 -3
  93. package/dist/index-vh86FiIQ.js +0 -10
  94. package/dist/index.esm2017-5xGykkgL.js +0 -3069
  95. package/dist/loading-CvHPT80F.js +0 -215
  96. package/dist/lodash-Q-_FPkpI.js +0 -3678
  97. package/dist/membership-CU-wFWan.js +0 -235
  98. package/dist/moment-D7p2TMB-.js +0 -2583
  99. package/dist/money-CzlfhEoe.js +0 -15
  100. package/dist/number-Bee2M41N.js +0 -12
  101. package/dist/object-qECH92oz.js +0 -26
  102. package/dist/objectId-dwaoBfJX.js +0 -7
  103. package/dist/objectid-DRJQv7AY.js +0 -145
  104. package/dist/plugins-CAdlnev8.js +0 -1817
  105. package/dist/remy-D_Deb3ue.js +0 -13
  106. package/dist/reward-BhlYd0FB.js +0 -36
  107. package/dist/rule-Ccvu41A_.js +0 -1969
  108. package/dist/rule-builder-B968rIyS.js +0 -102
  109. package/dist/style.css +0 -13
  110. package/dist/template-OZfyPJVE.js +0 -188
  111. package/dist/tier-BJDhpH6X.js +0 -4
  112. package/dist/tiers/tier=1.png +0 -0
  113. package/dist/tiers/tier=2.png +0 -0
  114. package/dist/tiers/tier=3.png +0 -0
  115. package/dist/tiers/tier=4.png +0 -0
  116. package/dist/timezone-CopuRbDK.js +0 -1154
  117. package/dist/titles/type=diamond.png +0 -0
  118. package/dist/titles/type=drinks.png +0 -0
  119. package/dist/titles/type=food.png +0 -0
  120. package/dist/titles/type=heart.png +0 -0
  121. package/dist/titles/type=medal.png +0 -0
  122. package/dist/titles/type=spend.png +0 -0
  123. package/dist/titles/type=thank-you.png +0 -0
  124. package/dist/titles/type=thumbs-up.png +0 -0
  125. package/dist/titles/type=years.png +0 -0
  126. package/dist/trigger-BtQI81FL.js +0 -213
  127. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  128. package/dist/type_drinks-D6jnpvwV.js +0 -4
  129. package/dist/usePagination-Ciom38dd.js +0 -266
  130. package/dist/user-BOW0ixDK.js +0 -55
  131. package/dist/vue-i18n-jTYKTJq1.js +0 -2365
  132. package/dist/xlsx-YD3LYwip.js +0 -15491
  133. package/dist/zod-B_G9o5PC.js +0 -91
@@ -1,39 +0,0 @@
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-Wv_SHwmo.js";
3
- import { u as C } from "./vue-i18n-jTYKTJq1.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
- };
@@ -1,130 +0,0 @@
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-Cyt6eKEF.js";
3
- import { i as C, R as e } from "./rule-builder-B968rIyS.js";
4
- import { _ as I } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Bp5jnlFr.js";
5
- import { p as N } from "./plugins-CAdlnev8.js";
6
- import { u as S } from "./membership-CU-wFWan.js";
7
- import { _ as j } from "./CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js";
8
- import { u as x } from "./vue-i18n-jTYKTJq1.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
- };
@@ -1,422 +0,0 @@
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 { a as le, p as me } from "./plugins-CAdlnev8.js";
6
- import { useCoreStore as ue } from "@feedmepos/mf-common";
7
- import { u as de } from "./loading-CvHPT80F.js";
8
- import { u as pe } from "./business-Dd73TVX5.js";
9
- import { u as fe } from "./campaign-BUQHH4KL.js";
10
- import { a as ye, b as $, c as D } from "./campaign-DkJOyF24.js";
11
- import { c as he, p as ge } from "./duplicateCampaign-CDulKxgJ.js";
12
- import "./index-tYmg4eyJ.js";
13
- import { u as ve } from "./template-OZfyPJVE.js";
14
- import { _ as _e } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bm7XTR7o.js";
15
- import { _ as Ce } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang-DU8AAPFD.js";
16
- import { u as we } from "./vue-i18n-jTYKTJq1.js";
17
- import { T as be } from "./trigger-BtQI81FL.js";
18
- import { useRouter as ke } from "vue-router";
19
- import { c as _ } from "./index-BGMhsZnB.js";
20
- import { R as K } from "./app-DKrmktFJ.js";
21
- 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/" };
22
- 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" }, ro = /* @__PURE__ */ te({
23
- __name: "Voucher",
24
- setup(Me) {
25
- const { t: a } = we(), N = {
26
- label: a("connect.voucher.createCampaign"),
27
- value: "create",
28
- isPrimary: !0,
29
- prependIcon: "add"
30
- }, I = se(), j = ve("VOUCHER", I), q = pe(), y = fe(), { global: G, minor: E } = de, B = ke(), s = U({
31
- searchKey: "",
32
- location: [],
33
- triggerType: []
34
- }), C = ne(
35
- () => y.campaigns.voucher.filter(
36
- (e) => W(e) && z(e)
37
- )
38
- ), X = be.VOUCHER.map((e) => ({
39
- label: e.name,
40
- value: e.value
41
- }));
42
- function W(e) {
43
- const o = s.value.location;
44
- return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some(
45
- (r) => {
46
- var i;
47
- return (i = e == null ? void 0 : e.targetLocation) == null ? void 0 : i.includes(r);
48
- }
49
- ) : e.targetLocation.includes(o);
50
- }
51
- function k(e) {
52
- return e.hideInApp === !1;
53
- }
54
- function x(e) {
55
- return e.event.type === "SIMPLE_CLAIM" && !k(e);
56
- }
57
- function z(e) {
58
- const o = s.value.triggerType;
59
- if (!o || o.length === 0) return !0;
60
- const r = e.event.type;
61
- return o.includes(r);
62
- }
63
- const Q = [
64
- {
65
- header: a("connect.voucher.voucherTitle"),
66
- accessorFn: (e) => e.name,
67
- cell(e) {
68
- const o = [e.row.original.name];
69
- return k(e.row.original) && o.push(
70
- m(p.FmChip, {
71
- label: "Feedvibe",
72
- class: "text-fm-color-primary bg-fm-color-system-warning-100",
73
- compact: !0
74
- })
75
- ), m("div", { class: "flex items-center gap-4" }, o);
76
- }
77
- },
78
- {
79
- header: a("connect.voucher.status"),
80
- accessorFn: (e) => ye(e),
81
- cell(e) {
82
- return $(e.row.original);
83
- }
84
- },
85
- {
86
- header: a("connect.voucher.summary"),
87
- accessorFn: (e) => D(e)
88
- },
89
- {
90
- header: a("connect.voucher.quota"),
91
- accessorFn: (e) => {
92
- var o;
93
- return ((o = e.pf_collectible) == null ? void 0 : o.options.maxReceive) ?? "Unlimited";
94
- }
95
- },
96
- {
97
- header: a("connect.voucher.claimed"),
98
- accessorFn: (e) => {
99
- var o;
100
- return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
101
- }
102
- },
103
- {
104
- header: a("connect.voucher.actions"),
105
- cell(e) {
106
- return m("div", { class: "flex items-center justify-end" }, [
107
- m(p.FmButton, {
108
- icon: "visibility",
109
- variant: "tertiary",
110
- iconColor: "neutral-gray-400",
111
- onClick: async (o) => {
112
- o.stopPropagation(), await B.push({
113
- name: K["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
114
- params: { id: e.row.original._id }
115
- });
116
- }
117
- }),
118
- m(
119
- p.FmMenu,
120
- {
121
- placement: "bottom-end",
122
- onClick: (o) => {
123
- o.stopPropagation();
124
- }
125
- },
126
- {
127
- "menu-button": () => m(p.FmButton, {
128
- icon: "more_vert",
129
- iconColor: "neutral-gray-400",
130
- variant: "tertiary"
131
- }),
132
- default: () => {
133
- const o = [
134
- m(p.FmMenuItem, {
135
- label: a("connect.voucher.duplicate"),
136
- onClick: async (r) => {
137
- r.stopPropagation(), await A(e.row.original);
138
- }
139
- }),
140
- m(
141
- p.FmMenuItem,
142
- {
143
- onClick: async (r) => {
144
- r.stopPropagation(), O(e.row.original);
145
- }
146
- },
147
- {
148
- label: m(
149
- "div",
150
- {
151
- class: "text-fm-color-typo-error fm-typo-en-body-md-400"
152
- },
153
- a("connect.voucher.remove")
154
- )
155
- }
156
- )
157
- ];
158
- return x(e.row.original) && (o.unshift(
159
- m(p.FmMenuItem, {
160
- label: a("connect.voucher.send"),
161
- onClick: async (r) => {
162
- var i;
163
- r.stopPropagation(), (i = V.value) == null || i.showSheet({
164
- campaignId: e.row.original._id
165
- });
166
- }
167
- })
168
- ), o.unshift(
169
- m(p.FmMenuItem, {
170
- label: a("connect.voucher.share"),
171
- onClick: async (r) => {
172
- r.stopPropagation(), await le(
173
- `https://${ue().currentBusiness.value._id}.${xe.appUrl}/vouchers/${e.row.original._id}`,
174
- {
175
- successMessage: "Voucher link copied to clipboard"
176
- }
177
- );
178
- }
179
- })
180
- )), o;
181
- }
182
- }
183
- )
184
- ]);
185
- }
186
- }
187
- ], F = U(), V = U();
188
- async function O(e) {
189
- await me.remove(a("connect.voucher.confirmRemove", { name: e.name })) && await E(
190
- async () => {
191
- await _.delete(e._id), await y.read("VOUCHER");
192
- },
193
- {
194
- message: a("connect.voucher.removing", { name: e.name }),
195
- successMessage: a("connect.voucher.removedSuccessfully", {
196
- name: e.name
197
- })
198
- }
199
- );
200
- }
201
- async function w(e) {
202
- e ? await o(await _.readById(e._id)) : j.open(async (r) => {
203
- await o(void 0, r);
204
- });
205
- async function o(r, i) {
206
- var b;
207
- (b = F.value) == null || b.showSheet(!0, "VOUCHER", r, i);
208
- }
209
- }
210
- async function A(e) {
211
- var i;
212
- if (!await he(e.name))
213
- return;
214
- const o = await _.readById(e._id), r = ge(o);
215
- (i = F.value) == null || i.showSheet(
216
- !0,
217
- "VOUCHER",
218
- r,
219
- o.template
220
- );
221
- }
222
- async function Z(e) {
223
- e.campaign._id && await new Promise((o) => {
224
- I.open({
225
- title: "Confirmation",
226
- message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
227
- primaryActions: { text: "Update all", close: !0 },
228
- secondaryActions: { text: "Update future only", close: !0 }
229
- }).onPrimary(async () => {
230
- var r;
231
- e.updateCollections = !0, (r = window.top) == null || r.postMessage("updateAllVoucher", "*"), o();
232
- }).onSecondary(async () => {
233
- o();
234
- });
235
- }), await E(
236
- async () => {
237
- e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await y.read("VOUCHER");
238
- },
239
- {
240
- message: a(
241
- e.campaign._id ? "connect.voucher.updating" : "connect.voucher.creating"
242
- ),
243
- successMessage: a(
244
- e.campaign._id ? "connect.voucher.updatedSuccessfully" : "connect.voucher.createdSuccessfully"
245
- )
246
- }
247
- );
248
- }
249
- return ae(async () => {
250
- await G(async () => {
251
- await y.read("VOUCHER");
252
- });
253
- }), (e, o) => {
254
- 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");
255
- return u(), T(P, null, [
256
- l(r, {
257
- title: t(a)("connect.voucher.title"),
258
- actions: t(C).length > 0 ? [N] : [],
259
- "onClick:action": o[0] || (o[0] = () => w())
260
- }, null, 8, ["title", "actions"]),
261
- c("div", Fe, [
262
- l(i, {
263
- modelValue: t(s).searchKey,
264
- "onUpdate:modelValue": o[1] || (o[1] = (n) => t(s).searchKey = n),
265
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
266
- placeholder: t(a)("connect.voucher.search"),
267
- collapsible: ""
268
- }, null, 8, ["modelValue", "placeholder"]),
269
- t(y).campaigns.voucher && t(y).campaigns.voucher.length > 0 ? (u(), T(P, { key: 0 }, [
270
- c("div", Ve, [
271
- c("div", Se, [
272
- l(H, {
273
- label: `${t(a)("connect.common.location")}: `,
274
- "right-icon": "keyboard_arrow_down",
275
- modelValue: t(s).location,
276
- "onUpdate:modelValue": o[2] || (o[2] = (n) => t(s).location = n),
277
- icon: "storefront",
278
- "show-item-label": !0,
279
- items: t(q).locationOptions
280
- }, null, 8, ["label", "modelValue", "items"]),
281
- l(H, {
282
- label: "Type:",
283
- "right-icon": "keyboard_arrow_down",
284
- modelValue: t(s).triggerType,
285
- "onUpdate:modelValue": o[3] || (o[3] = (n) => t(s).triggerType = n),
286
- icon: "filter_list",
287
- "show-item-label": !0,
288
- items: t(X)
289
- }, null, 8, ["modelValue", "items"])
290
- ]),
291
- l(i, {
292
- modelValue: t(s).searchKey,
293
- "onUpdate:modelValue": o[4] || (o[4] = (n) => t(s).searchKey = n),
294
- class: "xs:hidden sm:hidden",
295
- placeholder: t(a)("connect.voucher.search"),
296
- collapsible: ""
297
- }, null, 8, ["modelValue", "placeholder"])
298
- ]),
299
- l(b, {
300
- class: "xs:hidden sm:hidden",
301
- "row-data": t(C),
302
- "column-defs": Q,
303
- "search-value": t(s).searchKey,
304
- "column-filter": [],
305
- onRowClick: o[5] || (o[5] = (n) => w(n.original)),
306
- "hide-footer": t(C).length < 10
307
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
308
- l(ee, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
309
- default: R(() => [
310
- (u(!0), T(P, null, re(t(C).filter(
311
- (n) => n.name.toLowerCase().includes(t(s).searchKey.toLowerCase())
312
- ), (n) => (u(), h(Y, {
313
- key: n._id.toString(),
314
- onClick: (S) => w(n),
315
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
316
- }, {
317
- default: R(() => {
318
- var S;
319
- return [
320
- c("div", Ue, [
321
- c("div", Te, [
322
- (u(), h(ce(t($)(n)))),
323
- k(n) ? (u(), h(J, {
324
- key: 0,
325
- label: "Feedvibe",
326
- class: "text-fm-color-primary bg-fm-color-system-warning-100",
327
- compact: ""
328
- })) : L("", !0),
329
- c("div", Pe, v(((S = n.pf_collectible) == null ? void 0 : S.currentReceive) ?? 0) + " claimed ", 1)
330
- ]),
331
- c("div", Re, [
332
- c("div", Le, v(n.name), 1),
333
- c("div", Ie, v(t(D)(n)), 1)
334
- ])
335
- ]),
336
- c("div", Ee, [
337
- l(g, {
338
- icon: "content_copy",
339
- "icon-color": "neutral-gray-400",
340
- variant: "tertiary",
341
- onClick: async (f) => {
342
- f.stopPropagation(), await A(n);
343
- }
344
- }, null, 8, ["onClick"]),
345
- x(n) ? (u(), h(g, {
346
- key: 0,
347
- icon: "visibility",
348
- "icon-color": "neutral-gray-400",
349
- variant: "tertiary",
350
- onClick: async (f) => {
351
- f.stopPropagation(), await t(B).push({
352
- name: t(K)["$connect-CAMPAIGN_VOUCHER_COLLECTIONS"],
353
- params: { id: n._id }
354
- });
355
- }
356
- }, null, 8, ["onClick"])) : L("", !0),
357
- x(n) ? (u(), h(g, {
358
- key: 1,
359
- icon: "send",
360
- "icon-color": "neutral-gray-400",
361
- variant: "tertiary",
362
- onClick: (f) => {
363
- var M;
364
- f.stopPropagation(), (M = t(V)) == null || M.showSheet({
365
- campaignId: n._id
366
- });
367
- }
368
- }, null, 8, ["onClick"])) : L("", !0),
369
- l(g, {
370
- icon: "delete",
371
- "icon-color": "neutral-gray-400",
372
- variant: "tertiary",
373
- onClick: (f) => (f.stopPropagation(), O(n))
374
- }, null, 8, ["onClick"])
375
- ])
376
- ];
377
- }),
378
- _: 2
379
- }, 1032, ["onClick"]))), 128))
380
- ]),
381
- _: 1
382
- })
383
- ], 64)) : (u(), h(oe, {
384
- key: 1,
385
- variant: "outlined",
386
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
387
- }, {
388
- default: R(() => [
389
- o[7] || (o[7] = c("img", {
390
- src: ie,
391
- class: "aspect-square w-[150px]"
392
- }, null, -1)),
393
- c("div", Be, [
394
- c("div", Oe, v(t(a)("connect.voucher.createVoucherCampaign")), 1),
395
- c("div", Ae, v(t(a)("connect.voucher.description")), 1)
396
- ]),
397
- l(g, {
398
- variant: "primary",
399
- label: t(a)("connect.voucher.createVoucherCampaign"),
400
- icon: "add",
401
- onClick: o[6] || (o[6] = (n) => w())
402
- }, null, 8, ["label"])
403
- ]),
404
- _: 1
405
- })),
406
- l(_e, {
407
- ref_key: "sheetRef",
408
- ref: F,
409
- "onSubmit:modelValue": Z
410
- }, null, 512),
411
- l(Ce, {
412
- ref_key: "sendVoucherSheetRef",
413
- ref: V
414
- }, null, 512)
415
- ])
416
- ], 64);
417
- };
418
- }
419
- });
420
- export {
421
- ro as default
422
- };