@feedmepos/mf-connect 0.1.38-beta.7 → 0.1.38-beta.71

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 (153) hide show
  1. package/dist/{Analytic-NNi-22sK.js → Analytic-BY0xqCru.js} +16 -16
  2. package/dist/{App-Bu14Mro_.js → App-n6-XqhU7.js} +625 -619
  3. package/dist/AuditLogs-Dml3WjdH.js +1991 -0
  4. package/dist/{Bin-CnAQA85j.js → Bin-DaPZyWm-.js} +10 -10
  5. package/dist/Broadcast-hLmkBNne.js +267 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DC_fReu7.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BahnNhzD.js} +6 -6
  7. package/dist/{Card-DqAGiETA.js → Card-C_Fm3E0s.js} +144 -140
  8. package/dist/Collections-DAUsUa0c.js +540 -0
  9. package/dist/Credit-DklbckuQ.js +261 -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-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-vpnaCdLI.js +3167 -0
  13. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-e1ZWGrXS.js +351 -0
  14. package/dist/Experience-D3Ve8dCI.js +260 -0
  15. package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-Bg15HHd0.js} +1 -1
  16. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  17. package/dist/Game-BJzRdZNg.js +331 -0
  18. package/dist/GenerateMaterial-pDWgptXt.js +589 -0
  19. package/dist/Grab-B0D8SpcD.js +301 -0
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js → ImageInput.vue_vue_type_script_setup_true_lang-DkI3qMHv.js} +49 -48
  21. package/dist/{Index-loHkiwyo.js → Index-ysSM8-pd.js} +54 -54
  22. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-C7bEzQ4b.js} +1 -1
  23. package/dist/{MainLayout-B1aJoR95.js → MainLayout-Kt1Wiz87.js} +1 -1
  24. package/dist/Marketing-CFS6ff03.js +145 -0
  25. package/dist/MarketingMaterialEdit-BDYr5Rlw.js +746 -0
  26. package/dist/{Member-BQjQQdoA.js → Member-Dgb3QBKF.js} +38 -37
  27. package/dist/{MemberList-WPsEUKf_.js → MemberList-CfcQUvN8.js} +158 -159
  28. package/dist/{MemberTransactions-BtM7dugy.js → MemberTransactions-BVwGdpXo.js} +1 -1
  29. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Bl9sFIwG.js → MessageInput.vue_vue_type_script_setup_true_lang-Dj3h51yH.js} +13463 -10597
  30. package/dist/Mission-B9K8-Wrt.js +335 -0
  31. package/dist/{Overview-Bsf5IPOg.js → Overview-DJgKxAvU.js} +24 -25
  32. package/dist/Point-lev1_Nit.js +263 -0
  33. package/dist/Promotion-De9e8yPj.js +397 -0
  34. package/dist/{Queue-XFVbSuDw.js → Queue-DH_F0Ekd.js} +14 -15
  35. package/dist/{Record-CQzujESE.js → Record-CH2AZqzF.js} +10 -10
  36. package/dist/{Reward-Dj_h_May.js → Reward-BUgOAjd4.js} +16 -16
  37. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Clxk-oYM.js → RewardGroup.vue_vue_type_script_setup_true_lang-KTaTLjjw.js} +13 -14
  38. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-rs5kKp_v.js +1912 -0
  39. package/dist/{Segment-D_DUu_Sp.js → Segment-DL6O--Aw.js} +273 -274
  40. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-D3C2mVlv.js → SelectItems.vue_vue_type_script_setup_true_lang-ZUGDMD5J.js} +23 -23
  41. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-C0vsl8oV.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CIeyrheH.js} +12 -12
  42. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-5HkJROSb.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BAtXxIjO.js} +4 -4
  43. package/dist/Setting-DOA80XlJ.js +1999 -0
  44. package/dist/SettingAdvertisements-Dl0eisXq.js +263 -0
  45. package/dist/Store-fni1Xblz.js +1995 -0
  46. package/dist/StoreRewards-CLMO-kNi.js +534 -0
  47. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BlBovyiT.js +1034 -0
  48. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D-jYcuAa.js +7005 -0
  49. package/dist/{Tier-YQsLRt06.js → Tier-B0_DiVNv.js} +561 -480
  50. package/dist/{Title-C5gxYNvh.js → Title-twptCzpk.js} +149 -147
  51. package/dist/{Transaction-CZ_QdIii.js → Transaction-CTX5I6gO.js} +2 -2
  52. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DqUu7wSt.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Bp-rIgz4.js} +7 -7
  53. package/dist/Voucher-C7Kxmzjr.js +422 -0
  54. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-lZQTZUUU.js +421 -0
  55. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DCtdp-LK.js → ZodTextField.vue_vue_type_script_setup_true_lang-BlBEFfgu.js} +2 -2
  56. package/dist/app-D5GVWKxc.js +59071 -0
  57. package/dist/app.js +1 -1
  58. package/dist/{business-DZYFoAKz.js → business-BvNsRlY4.js} +11 -8
  59. package/dist/{campaign-Ca4l6UUg.js → campaign-DRErhSfb.js} +29 -25
  60. package/dist/campaign-MN_o01w6.js +253 -0
  61. package/dist/campaign.enum-BtfwwLCf.js +26 -0
  62. package/dist/campaign.fn-BgSGxLPo.js +776 -0
  63. package/dist/{collectible.enum-DnIeDAB-.js → collectible.enum-CV2tpD2C.js} +1 -1
  64. package/dist/{collection.fn-mQfXEwJv.js → collection.fn-BYjqObg7.js} +2 -2
  65. package/dist/dto-CyhnIGn-.js +222 -0
  66. package/dist/duplicateCampaign-jOZ1UznM.js +51 -0
  67. package/dist/effect-NKfquhhR.js +89 -0
  68. package/dist/{email-addresses-CQYqi2rN.js → email-addresses-EmFJeFmB.js} +2 -2
  69. package/dist/{export-BsikVZw2.js → export-B70Bp6s8.js} +9 -10
  70. package/dist/{helper-n74IteBU.js → helper-DiSstsUa.js} +22 -7
  71. package/dist/index-5FmmWAib.js +30289 -0
  72. package/dist/index-B09KKPb4.js +3419 -0
  73. package/dist/{index-CrHCbDIs.js → index-BgP5ZHK6.js} +3 -3
  74. package/dist/{index-DRrSsoqp.js → index-C46EHygk.js} +1 -1
  75. package/dist/{index-Bg3fAg5z.js → index-CD7Ji4Nw.js} +1 -1
  76. package/dist/{index-BJ-IAF-1.js → index-CHXlBh7-.js} +1 -1
  77. package/dist/{index-BpjT8Rx0.js → index-Cr2243n7.js} +455 -245
  78. package/dist/index-CrDg9PFk.js +8912 -0
  79. package/dist/index-CuvNtC_M.js +61 -0
  80. package/dist/{index-Dt6wui_L.js → index-DK45XoFG.js} +3 -3
  81. package/dist/{index-DTErPYrT.js → index-Qg_bzaF2.js} +1 -1
  82. package/dist/{index-Do7TcKmg.js → index-bAmlAkpk.js} +4 -1
  83. package/dist/index-nTpkh7pU.js +28897 -0
  84. package/dist/index-tvZKdKVU.js +36 -0
  85. package/dist/{index.esm2017-T7F54Aqa.js → index.esm2017-B8fYlj6l.js} +185 -185
  86. package/dist/loading-DVr3dbZ1.js +215 -0
  87. package/dist/{lodash-B5I3zXaY.js → lodash-BNr1VEn2.js} +1 -1
  88. package/dist/{membership-BRy4jMt2.js → membership-LEuPDIbe.js} +3 -3
  89. package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
  90. package/dist/{money-B9Auav5u.js → money-CogUwiv6.js} +1 -1
  91. package/dist/{number-BdhIBsUp.js → number-C5wGUTN5.js} +1 -1
  92. package/dist/objectid-DbUENFHd.js +145 -0
  93. package/dist/{campaign-162kZMje.js → plugins-BxKrsjEx.js} +784 -777
  94. package/dist/remy-D_Deb3ue.js +13 -0
  95. package/dist/{reward-UuqZUHsq.js → reward-CM4Wx2zA.js} +1 -1
  96. package/dist/{rule-D158NIpm.js → rule-CMMr2GMg.js} +505 -487
  97. package/dist/rule-builder-D5QsmOxi.js +102 -0
  98. package/dist/style.css +11 -2
  99. package/dist/template-BDKqBasy.js +188 -0
  100. package/dist/timezone-DuaWQsQ2.js +1154 -0
  101. package/dist/trigger-IcyZcRow.js +213 -0
  102. package/dist/usePagination-D8OEDsCt.js +223 -0
  103. package/dist/user-u3blYzG2.js +55 -0
  104. package/dist/vue-i18n-DfD8ZY6j.js +2365 -0
  105. package/dist/{xlsx-Ddqi5i8p.js → xlsx-Bgf4_JHr.js} +1 -1
  106. package/dist/{zod-Bg2FbC-D.js → zod-9J33xiFS.js} +32 -31
  107. package/package.json +14 -6
  108. package/dist/AuditLogs-Cai9CVBl.js +0 -1887
  109. package/dist/Broadcast-DskXjXn4.js +0 -227
  110. package/dist/Collections-DuaIQAk7.js +0 -465
  111. package/dist/Credit-D40Vzu2g.js +0 -222
  112. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +0 -108
  113. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BsQ4iAsV.js +0 -2185
  114. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CDCX5B5k.js +0 -347
  115. package/dist/Experience-B9yHQPuj.js +0 -223
  116. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  117. package/dist/Game-e9-Q3qmO.js +0 -278
  118. package/dist/Marketing-CipbukIV.js +0 -20073
  119. package/dist/Mission-B_DJ3Yu_.js +0 -296
  120. package/dist/Point-DMphcWjy.js +0 -226
  121. package/dist/Promotion-B33A-Jwe.js +0 -289
  122. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CGAXTOLN.js +0 -1751
  123. package/dist/Setting-CtdC4G3W.js +0 -1936
  124. package/dist/Store-DCksWACh.js +0 -1842
  125. package/dist/StoreRewards-CHWKYKet.js +0 -423
  126. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-D1TDyD6N.js +0 -1029
  127. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D59sGO3F.js +0 -139
  128. package/dist/Voucher-BzV8yZ3o.js +0 -384
  129. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DjBj_3EF.js +0 -419
  130. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  131. package/dist/app-FFOpPHwj.js +0 -33357
  132. package/dist/app-az9e8Yfl.js +0 -7086
  133. package/dist/campaign.enum-DWjyDV2D.js +0 -20
  134. package/dist/campaign.fn-DWWJ74z-.js +0 -758
  135. package/dist/dto-mKZIPV4o.js +0 -214
  136. package/dist/effect-B8UexeyG.js +0 -78
  137. package/dist/index-5ShiAY8U.js +0 -8861
  138. package/dist/index-Bf6AmJwX.js +0 -32260
  139. package/dist/index-C5gjIb5d.js +0 -146
  140. package/dist/index-C9YrDtDN.js +0 -38
  141. package/dist/index-CK-MAqWE.js +0 -3120
  142. package/dist/index-CsaQJMAR.js +0 -66
  143. package/dist/index-f4MzX8IY.js +0 -30038
  144. package/dist/loading-BEAayQS-.js +0 -71
  145. package/dist/objectid-K-JVTsfA.js +0 -145
  146. package/dist/plugins-CWlRYif_.js +0 -208
  147. package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
  148. package/dist/rule-builder-DNeViq0I.js +0 -89
  149. package/dist/template-B02wYF7G.js +0 -190
  150. package/dist/trigger-BDjnKHLI.js +0 -144
  151. package/dist/usePagination-BeF5K3M7.js +0 -223
  152. package/dist/user-DbP37Ohh.js +0 -54
  153. package/dist/vue-i18n-BbhkYWlk.js +0 -2365
@@ -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-D1TDyD6N.js";
3
- import { u as C } from "./vue-i18n-BbhkYWlk.js";
2
+ import { _ as g, a as y } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-BlBovyiT.js";
3
+ import { u as C } from "./vue-i18n-DfD8ZY6j.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) {
@@ -1,11 +1,11 @@
1
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-5ShiAY8U.js";
3
- import { i as C, R as e } from "./rule-builder-DNeViq0I.js";
4
- import { _ as I } from "./RuleGroup.vue_vue_type_script_setup_true_lang-CGAXTOLN.js";
5
- import { p as N } from "./plugins-CWlRYif_.js";
6
- import { u as S } from "./membership-BRy4jMt2.js";
7
- import { _ as j } from "./CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js";
8
- import { u as x } from "./vue-i18n-BbhkYWlk.js";
2
+ import "./index-CrDg9PFk.js";
3
+ import { i as C, R as e } from "./rule-builder-D5QsmOxi.js";
4
+ import { _ as I } from "./RuleGroup.vue_vue_type_script_setup_true_lang-rs5kKp_v.js";
5
+ import { p as N } from "./plugins-BxKrsjEx.js";
6
+ import { u as S } from "./membership-LEuPDIbe.js";
7
+ import { _ as j } from "./CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js";
8
+ import { u as x } from "./vue-i18n-DfD8ZY6j.js";
9
9
  const A = /* @__PURE__ */ y({
10
10
  __name: "SegmentConfigurator",
11
11
  props: {
@@ -0,0 +1,422 @@
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-BxKrsjEx.js";
6
+ import { useCoreStore as ue } from "@feedmepos/mf-common";
7
+ import { u as de } from "./loading-DVr3dbZ1.js";
8
+ import { u as pe } from "./business-BvNsRlY4.js";
9
+ import { u as fe } from "./campaign-DRErhSfb.js";
10
+ import { a as ye, b as $, c as D } from "./campaign-MN_o01w6.js";
11
+ import { c as he, p as ge } from "./duplicateCampaign-jOZ1UznM.js";
12
+ import "./index-C46EHygk.js";
13
+ import { u as ve } from "./template-BDKqBasy.js";
14
+ import { _ as _e } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-vpnaCdLI.js";
15
+ import { _ as Ce } from "./SendVoucherSheet.vue_vue_type_script_setup_true_lang-BAtXxIjO.js";
16
+ import { u as we } from "./vue-i18n-DfD8ZY6j.js";
17
+ import { T as be } from "./trigger-IcyZcRow.js";
18
+ import { useRouter as ke } from "vue-router";
19
+ import { c as _ } from "./index-bAmlAkpk.js";
20
+ import { R as K } from "./app-D5GVWKxc.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
+ };