@feedmepos/mf-connect 0.1.122-dev → 0.1.122-prod

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 (148) hide show
  1. package/dist/{App-Otfhp3H1.js → App-BKnL7b6M.js} +493 -502
  2. package/dist/{Bin-B5aee7-4.js → Bin-BqqQF1h_.js} +8 -8
  3. package/dist/{Broadcast-BAQl4nEs.js → Broadcast-U5rJmhdd.js} +21 -22
  4. package/dist/{CampaignAnalytic-mc0rWnt4.js → CampaignAnalytic-ClwXxxzE.js} +7 -7
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C06IzthB.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DyeoWFcd.js} +9 -8
  6. package/dist/{Card-CoeclAye.js → Card-DKikDYES.js} +22 -22
  7. package/dist/{Collections-DIamDQDK.js → Collections-CD0xjFqI.js} +185 -197
  8. package/dist/{Credit-CoIPdhRy.js → Credit-BWcvFlb2.js} +20 -21
  9. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-nI2oXZiR.js → DateRangeChip.vue_vue_type_script_setup_true_lang-B2RizWP8.js} +1 -1
  10. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-D38JB0FV.js +3493 -0
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BZ42IxXy.js → EffectSheet.vue_vue_type_style_index_0_lang-Hr10pgqD.js} +16 -16
  12. package/dist/{Experience-bJSkl9Xm.js → Experience-dqXYj1Fv.js} +31 -32
  13. package/dist/{FileSaver.min-CFKCOdNt.js → FileSaver.min-DdJMn696.js} +1 -1
  14. package/dist/{Game-DMoyicRl.js → Game-BGQXqzck.js} +18 -19
  15. package/dist/{GiftCardSetup-B28jebxX.js → GiftCardSetup-C3MR25fp.js} +31 -31
  16. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-il1_TmfZ.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-9dL1kVPG.js} +7 -7
  17. package/dist/{Goals-B9XRX-to.js → Goals-DA2jHEZa.js} +4 -4
  18. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BZH5In2V.js → ImageInput.vue_vue_type_script_setup_true_lang-_rlsNocb.js} +1 -1
  19. package/dist/{Index-BgGZBhf8.js → Index-WOvryalE.js} +10 -10
  20. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-M6eRk_nC.js → LocationPicker.vue_vue_type_script_setup_true_lang-Bu1DjV9M.js} +1 -1
  21. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DQCpH8dV.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DiLtSIXt.js} +1 -1
  22. package/dist/{LoyaltyDashboard-B-vMpAdx.js → LoyaltyDashboard-BKN2vBqc.js} +15 -15
  23. package/dist/{MainLayout-rv2xd7Yc.js → MainLayout-DizL-dxl.js} +1 -1
  24. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-BMwNt98l.js → MainLayout.vue_vue_type_script_setup_true_lang-El0YeLnE.js} +3 -3
  25. package/dist/{Marketing-Wu2M2xPV.js → Marketing-B77EoiCf.js} +4 -4
  26. package/dist/{MarketingMaterialEdit-C5s0grZF.js → MarketingMaterialEdit-C_qFEur7.js} +211 -214
  27. package/dist/{Member-D02_98Yo.js → Member-TYDrU3Tk.js} +7 -7
  28. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-DGVDww0P.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-BuzMeXR9.js} +47 -39
  29. package/dist/{MemberImportHistory-ZqjppSHQ.js → MemberImportHistory-l7dVJdEH.js} +7 -7
  30. package/dist/{MemberList-DpWX6mT9.js → MemberList-DiuyeJx_.js} +105 -103
  31. package/dist/{MemberTransactions-BiE7FtKT.js → MemberTransactions-BJ27Gd5P.js} +1 -1
  32. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DUtNRTNB.js → MessageInput.vue_vue_type_script_setup_true_lang-so7LWtlv.js} +12 -12
  33. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DD5GkLoA.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DgE7HPsT.js} +1 -1
  34. package/dist/{Mission-D3uyaxrt.js → Mission-C63hh8Ra.js} +21 -22
  35. package/dist/{Overview-C80up9Cz.js → Overview-CVdvQK6q.js} +20 -20
  36. package/dist/{Overview-Dzs2l9dt.js → Overview-DP-4Kpuj.js} +144 -145
  37. package/dist/{Point-CtyqLefg.js → Point-DXH4kJNQ.js} +21 -22
  38. package/dist/{Promotion-C1pB_Mup.js → Promotion-Cn-wAx6m.js} +131 -137
  39. package/dist/{Queue-DkmBLRMM.js → Queue-CEEUE-UT.js} +45 -45
  40. package/dist/{Record-B5onEmZr.js → Record-BFIjLKJD.js} +9 -9
  41. package/dist/{Review-fkpAgnWl.js → Review-BMRfKri0.js} +2 -2
  42. package/dist/ReviewFacebookCallback-CPYIC3RS.js +238 -0
  43. package/dist/{ReviewGoogleCallback-Cj9zmCme.js → ReviewGoogleCallback-Cflqv5Z5.js} +5 -5
  44. package/dist/{Reward-BNt4rJXG.js → Reward-C-qGtzpu.js} +16 -16
  45. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CJbD7izQ.js → RewardGroup.vue_vue_type_script_setup_true_lang-kxJ5i8xe.js} +13 -13
  46. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BlRmshrE.js +1884 -0
  47. package/dist/{Segment-9weq5m6d.js → Segment-Bx1pfw4Q.js} +306 -303
  48. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-j_DlD4Uz.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-vuH9xdOi.js} +14 -14
  49. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Bq1XKmWl.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CZHpyimI.js} +4 -4
  50. package/dist/Setting-CEcpuE_O.js +578 -0
  51. package/dist/{SettingAdvertisements-BdXfSnNM.js → SettingAdvertisements-CZlIQ5m_.js} +12 -12
  52. package/dist/Settings-CPLibjQy.js +179 -0
  53. package/dist/{Store-D3cAsGJ6.js → Store-BhZulzuc.js} +28 -28
  54. package/dist/{StoreRewards-C2y1M4Ps.js → StoreRewards-CvYgJVFU.js} +15 -15
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Dqj5zIgi.js +1297 -0
  56. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang--Ii9ejFG.js +142 -0
  57. package/dist/{Tier-Dci8VbpH.js → Tier-BPPSaEe0.js} +687 -2575
  58. package/dist/{Title-D4BpqJPQ.js → Title-CccRUVZV.js} +94 -95
  59. package/dist/{Transaction-1biUZvIt.js → Transaction-ULzAt-u7.js} +2 -2
  60. package/dist/Upselling-D2tSUTkE.js +200 -0
  61. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-D7W1cxlp.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CoqrSuWu.js} +26 -26
  62. package/dist/{Voucher-DSygKr_u.js → Voucher-Cz7IMRNl.js} +19 -19
  63. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-JL1V_LbU.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BaxHZN76.js} +12 -12
  64. package/dist/{WhatsappAccount-CZ-js350.js → WhatsappAccount-BsxVHiZZ.js} +6 -6
  65. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DBiqtHgs.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DJnkGMF1.js} +1 -1
  66. package/dist/{WhatsappBot-Bygdlech.js → WhatsappBot-sd6erVZk.js} +6 -6
  67. package/dist/{WhatsappBotLogs-BFLRYeQf.js → WhatsappBotLogs-DNbGWyOY.js} +6 -6
  68. package/dist/{WhatsappBotSettings-COZEGQxT.js → WhatsappBotSettings-DXa_e7-a.js} +4 -4
  69. package/dist/{WhatsappLayout-DEzbS1SP.js → WhatsappLayout-DvBPIB5f.js} +3 -3
  70. package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DUX8zJnw.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-CRDouGvj.js} +3 -3
  71. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BJFYIRZl.js → ZodTextField.vue_vue_type_script_setup_true_lang-B6BvSACt.js} +2 -2
  72. package/dist/{app-gGao9t7Z.js → app-4x06ItoL.js} +15017 -14861
  73. package/dist/app.js +3 -4
  74. package/dist/{base.export-cVWgL6vy.js → base.export-DS0xThWi.js} +2 -2
  75. package/dist/{business-DbDh-BxN.js → business-D0I7G-5H.js} +1 -1
  76. package/dist/{campaign-B9tq1vZv.js → campaign-BuJCjEH-.js} +94 -121
  77. package/dist/{campaign-D8jV7hA8.js → campaign-CC9U7rkr.js} +28 -34
  78. package/dist/{campaign.enum-Dx-Zo68Q.js → campaign.enum-BqekIiiN.js} +1 -2
  79. package/dist/campaign.fn-CLUOgMgc.js +776 -0
  80. package/dist/{collection.fn-DBfMa_P2.js → collection.fn-CUifllLR.js} +2 -2
  81. package/dist/{currency-SZSbDgAr.js → currency-BPhBDOpt.js} +1 -1
  82. package/dist/{effect-CVTuOMbk.js → effect-DKHOR-B3.js} +1 -1
  83. package/dist/{email-addresses-DpVS_e0D.js → email-addresses-B-VEReRV.js} +25 -25
  84. package/dist/{feature-flag-orm4I4-0.js → feature-flag-Cjl6gaO5.js} +185 -171
  85. package/dist/google-C3S8u0mT.js +4 -0
  86. package/dist/{helper-Ct1_-IEp.js → helper-CBLh1PWR.js} +1 -1
  87. package/dist/{index-Clg5CVmr.js → index-BBsqcXfJ.js} +1 -1
  88. package/dist/{index-NN_GXe7Q.js → index-B_iKSOXp.js} +1 -1
  89. package/dist/{index-BeGbQvrb.js → index-BwgjSrwa.js} +2 -2
  90. package/dist/{index-DW5cDL7l.js → index-BzKKNuLc.js} +2 -2
  91. package/dist/{index-Bz2GhZNd.js → index-C1QA2M4I.js} +10 -10
  92. package/dist/{index-uIOAK7Yt.js → index-CGcWs8B5.js} +462 -533
  93. package/dist/{index-CrluLS6Q.js → index-CWJi_hw-.js} +2 -2
  94. package/dist/{index-BUDFQtMG.js → index-D3B392A3.js} +3 -3
  95. package/dist/{index-CONIxgEK.js → index-DL_UYO4J.js} +234 -380
  96. package/dist/{index-B6hbCvzb.js → index-DenQ8DV4.js} +1 -1
  97. package/dist/{index-BOoNJIJh.js → index-Djf4TpYV.js} +23 -23
  98. package/dist/{index-DBpHsVZR.js → index-EpqQFMu2.js} +2614 -2699
  99. package/dist/{index-MlhU8ucu.js → index-Ob5I-Sex.js} +1 -1
  100. package/dist/{index-BXXLVdgj.js → index-RMsQnHez.js} +1 -1
  101. package/dist/{index-COAgKj0v.js → index-ZTC5k9Jb.js} +6 -19
  102. package/dist/{index-B2GJ653R.js → index-bc7bIIVP.js} +197 -197
  103. package/dist/{index-DFePTLAw.js → index-kClA31M9.js} +10 -10
  104. package/dist/{index-vfdh50L9.js → index-nnmfOPuw.js} +4 -4
  105. package/dist/{index-DCuUA8EI.js → index-umYXnOWc.js} +251 -608
  106. package/dist/{index-DwofBI5n.js → index-vqUiCeKb.js} +1 -1
  107. package/dist/{index.esm2017-ZSQn8C-d.js → index.esm2017-DMKkHR06.js} +111 -111
  108. package/dist/{loading-B-xDCOdo.js → loading-Cb4RgEo7.js} +1 -1
  109. package/dist/{lodash-DFW9UbwC.js → lodash-CMazTe9d.js} +1 -1
  110. package/dist/{member-import-J0fm9uzH.js → member-import-Df1y7FvX.js} +1 -1
  111. package/dist/{membership-B8KWhxBD.js → membership-yvDb2HS8.js} +2 -2
  112. package/dist/{money-CSIA5h2F.js → money-rs9shyUy.js} +1 -1
  113. package/dist/{number-mHKvdu_x.js → number-Ecq6MjRx.js} +1 -1
  114. package/dist/objectid-BVri-Vim.js +145 -0
  115. package/dist/{onboarding-CbvpduVK.js → onboarding-DugmLfNG.js} +36 -36
  116. package/dist/{onboardingSetup-pQHr4ATi.js → onboardingSetup-DMzNxJC4.js} +2 -2
  117. package/dist/{plugins-D_LhWxFb.js → plugins-CvhBJQEK.js} +3 -3
  118. package/dist/{reward-CFEIG_Fc.js → reward-BGUOUKZn.js} +1 -1
  119. package/dist/{rule-Dqxm0TiU.js → rule-C87YbT3F.js} +492 -572
  120. package/dist/rule-builder-lzMi7irV.js +102 -0
  121. package/dist/style.css +1 -1
  122. package/dist/template-BfFSbH04.js +275 -0
  123. package/dist/{timezone-CijbubTV.js → timezone-uP_heouv.js} +1 -1
  124. package/dist/{transaction.fn-Bg5w0js6.js → transaction.fn-CiGhIgzP.js} +2 -2
  125. package/dist/{trigger-Z2ynsa7k.js → trigger-dOOSh-Yp.js} +9 -9
  126. package/dist/{useMarketingMaterialActions-Dgm-u9Nu.js → useMarketingMaterialActions-BRenBblP.js} +4 -4
  127. package/dist/{usePagination-Dlw4BUF1.js → usePagination-DNOc8GFS.js} +1 -1
  128. package/dist/{user-BRNDlg4h.js → user-DTAGYy-F.js} +1 -1
  129. package/dist/vue-i18n-D8wuxuA4.js +2365 -0
  130. package/dist/{xlsx-CnlrcvXS.js → xlsx-BU0bDwTF.js} +1 -1
  131. package/dist/{zod-DPWT8J03.js → zod-mPFqdty8.js} +1 -1
  132. package/package.json +3 -7
  133. package/dist/AuditLogs-C4DQ624f.js +0 -2016
  134. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CXNf6M-7.js +0 -4439
  135. package/dist/Grab-CNXLDEKx.js +0 -301
  136. package/dist/ReviewFacebookCallback-CLeQP52t.js +0 -225
  137. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-ie0okvmi.js +0 -1923
  138. package/dist/Setting-DadiBCUq.js +0 -574
  139. package/dist/Settings-SF-Ai88W.js +0 -286
  140. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DX8nrBZd.js +0 -1319
  141. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CjBucvpJ.js +0 -7007
  142. package/dist/Upselling-BTqqiZlc.js +0 -1032
  143. package/dist/campaign.fn-DiQIanat.js +0 -776
  144. package/dist/duplicateCampaign-3K1VYqMD.js +0 -51
  145. package/dist/google-BQK68wbe.js +0 -5
  146. package/dist/objectid-BVNgDFLu.js +0 -145
  147. package/dist/template-BKPcMDwU.js +0 -227
  148. package/dist/vue-i18n-h2H0nxj-.js +0 -2365
@@ -1,301 +0,0 @@
1
- import { defineComponent as q, ref as L, computed as z, h as J, onMounted as Q, resolveComponent as u, openBlock as f, createElementBlock as k, Fragment as F, createVNode as l, unref as i, withCtx as x, createElementVNode as m, renderList as W, createBlock as O, resolveDynamicComponent as X, toDisplayString as Y } from "vue";
2
- import { _ as Z } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as ee, components as te } from "@feedmepos/ui-library";
4
- import { p as P } from "./plugins-D_LhWxFb.js";
5
- import { u as oe } from "./loading-B-xDCOdo.js";
6
- import { u as ne } from "./business-DbDh-BxN.js";
7
- import { u as ae } from "./campaign-D8jV7hA8.js";
8
- import { u as re } from "./vue-i18n-h2H0nxj-.js";
9
- import { h as d } from "./moment-D7p2TMB-.js";
10
- import { a as se, b as V } from "./campaign-B9tq1vZv.js";
11
- import { s as ie, _ as ce } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CXNf6M-7.js";
12
- import { u as le } from "./template-BKPcMDwU.js";
13
- import { _ as $ } from "./FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js";
14
- import { c as C } from "./index-DW5cDL7l.js";
15
- const me = { class: "px-24 flex flex-col gap-y-16" }, ue = { class: "flex items-center justify-between w-full" }, de = { class: "flex gap-8 overflow-x-auto" }, pe = { class: "space-y-8" }, fe = { class: "flex w-full gap-4 items-center" }, ge = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pe = /* @__PURE__ */ q({
16
- __name: "Grab",
17
- setup(_e) {
18
- const { t: o } = re(), I = {
19
- label: o("connect.grab.createCampaign"),
20
- value: "create",
21
- isPrimary: !0,
22
- prependIcon: "add"
23
- }, A = le("GRAB", ee()), S = ne(), g = ae(), { global: R, minor: T } = oe, K = [
24
- {
25
- label: "Bill promotion",
26
- value: "BILL"
27
- },
28
- {
29
- label: "Item promotion",
30
- value: "ITEM"
31
- }
32
- ], c = L({
33
- searchKey: "",
34
- location: [],
35
- effectType: []
36
- });
37
- function E(e) {
38
- const t = c.value.location;
39
- return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((a) => {
40
- var s;
41
- return (s = e == null ? void 0 : e.targetLocation) == null ? void 0 : s.includes(a);
42
- }) : e.targetLocation.includes(t);
43
- }
44
- function j(e) {
45
- var s, r;
46
- const t = c.value.effectType;
47
- if (!t || t.length === 0) return !0;
48
- const a = (r = (s = e.effect) == null ? void 0 : s.options) == null ? void 0 : r.target;
49
- return t.includes(a);
50
- }
51
- const p = z(
52
- () => g.campaigns.grab.filter(
53
- (e) => E(e) && j(e)
54
- )
55
- ), G = [
56
- {
57
- header: o("connect.grab.promotionTitle"),
58
- accessorFn: (e) => e.name
59
- },
60
- {
61
- header: o("connect.grab.period"),
62
- accessorFn: (e) => {
63
- const t = d(e.timeframeOptions.start).format("DD/MM/YYYY"), a = d(e.timeframeOptions.end).format("DD/MM/YYYY");
64
- return `${t} - ${a}`;
65
- }
66
- },
67
- {
68
- header: o("connect.grab.status"),
69
- accessorFn: (e) => se(e),
70
- cell(e) {
71
- return V(e.row.original);
72
- }
73
- },
74
- {
75
- header: o("connect.grab.summary"),
76
- cell(e) {
77
- const t = ie(e.row.original.discount);
78
- return t ? `${t.type} - ${t.adjustment}` : "-";
79
- }
80
- },
81
- {
82
- header: o("connect.grab.actions"),
83
- cell(e) {
84
- return J(te.FmButton, {
85
- variant: "tertiary",
86
- icon: "delete",
87
- iconColor: "neutral-gray-400",
88
- onClick: (t) => {
89
- t.stopPropagation(), D(e.row.original);
90
- }
91
- });
92
- }
93
- }
94
- ], B = L();
95
- async function D(e) {
96
- await P.remove(o("connect.grab.confirmRemove", { name: e.name })) && await T(
97
- async () => {
98
- await C.delete(e._id), await g.read("PROMOTION");
99
- },
100
- {
101
- message: o("connect.grab.removing", { name: e.name }),
102
- successMessage: o("connect.grab.removedSuccessfully", {
103
- name: e.name
104
- })
105
- }
106
- );
107
- }
108
- async function b(e) {
109
- e ? await t() : A.open(async (a) => {
110
- await t(a);
111
- });
112
- async function t(a) {
113
- var s;
114
- (s = B.value) == null || s.showSheet(
115
- !0,
116
- "GRAB",
117
- e ? await C.readById(e._id) : void 0,
118
- a
119
- );
120
- }
121
- }
122
- async function N(e) {
123
- var a;
124
- const t = await U(e.campaign);
125
- if (t.length > 0) {
126
- const s = t.map(
127
- (r) => `"${r.name}" (${d(r.timeframeOptions.start).format("DD/MM/YYYY")} - ${d(r.timeframeOptions.end).format("DD/MM/YYYY")})`
128
- ).join(`
129
- `);
130
- return await ((a = P.dialog) == null ? void 0 : a.open({
131
- title: o("connect.grab.conflictDetected"),
132
- message: o("connect.grab.conflictMessage", {
133
- conflicts: s
134
- }),
135
- closeButton: !0,
136
- overlay: !0,
137
- primaryActions: {
138
- close: !0,
139
- text: "OK"
140
- }
141
- })), !1;
142
- }
143
- await T(
144
- async () => (e.campaign._id ? await C.update(e.campaign._id, e) : await C.create(e), await g.read("PROMOTION"), !0),
145
- {
146
- message: o(
147
- e.campaign._id ? "connect.grab.updating" : "connect.grab.creating"
148
- ),
149
- successMessage: o(
150
- e.campaign._id ? "connect.grab.updatedSuccessfully" : "connect.grab.createdSuccessfully"
151
- )
152
- }
153
- );
154
- }
155
- async function U(e) {
156
- const t = g.campaigns.grab, a = [], s = !!e._id;
157
- for (const r of t) {
158
- if (s && r._id === e._id) continue;
159
- const _ = d(e.timeframeOptions.start), y = d(e.timeframeOptions.end), h = d(r.timeframeOptions.start), v = d(r.timeframeOptions.end);
160
- if (_.isBefore(v) && y.isAfter(h) || h.isBefore(y) && v.isAfter(_)) {
161
- const n = e.discount, w = r.discount;
162
- n.scope.type === w.scope.type && a.push(r);
163
- }
164
- }
165
- return a;
166
- }
167
- async function H(e) {
168
- switch (e) {
169
- case "create":
170
- b();
171
- break;
172
- }
173
- }
174
- return Q(async () => {
175
- await R(async () => {
176
- await S.readLocations(), await g.read("PROMOTION");
177
- });
178
- }), (e, t) => {
179
- const a = u("FmPill"), s = u("FmPageHead"), r = u("FmSearch"), _ = u("FmTable"), y = u("FmButton"), h = u("FmListItem"), v = u("FmList"), M = u("FmCard");
180
- return f(), k(F, null, [
181
- l(s, {
182
- title: i(o)("connect.grab.title"),
183
- actions: i(p).length > 0 ? [I] : [],
184
- "onClick:action": H
185
- }, {
186
- prepend: x(() => [
187
- l(a, { variant: "beta" }),
188
- l(a, { variant: "premium" })
189
- ]),
190
- _: 1
191
- }, 8, ["title", "actions"]),
192
- m("div", me, [
193
- l(r, {
194
- modelValue: c.value.searchKey,
195
- "onUpdate:modelValue": t[0] || (t[0] = (n) => c.value.searchKey = n),
196
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
197
- placeholder: i(o)("connect.grab.search"),
198
- collapsible: ""
199
- }, null, 8, ["modelValue", "placeholder"]),
200
- i(p) && i(p).length > 0 ? (f(), k(F, { key: 0 }, [
201
- m("div", ue, [
202
- m("div", de, [
203
- l($, {
204
- label: `${i(o)("connect.common.location")}: `,
205
- "right-icon": "keyboard_arrow_down",
206
- modelValue: c.value.location,
207
- "onUpdate:modelValue": t[1] || (t[1] = (n) => c.value.location = n),
208
- icon: "storefront",
209
- "show-item-label": !0,
210
- items: i(S).locationOptions
211
- }, null, 8, ["label", "modelValue", "items"]),
212
- l($, {
213
- label: "Type:",
214
- "right-icon": "keyboard_arrow_down",
215
- modelValue: c.value.effectType,
216
- "onUpdate:modelValue": t[2] || (t[2] = (n) => c.value.effectType = n),
217
- icon: "filter_list",
218
- "show-item-label": !0,
219
- items: K
220
- }, null, 8, ["modelValue"])
221
- ]),
222
- l(r, {
223
- modelValue: c.value.searchKey,
224
- "onUpdate:modelValue": t[3] || (t[3] = (n) => c.value.searchKey = n),
225
- class: "xs:hidden",
226
- placeholder: "search",
227
- collapsible: ""
228
- }, null, 8, ["modelValue"])
229
- ]),
230
- l(_, {
231
- class: "xs:hidden",
232
- "row-data": i(p),
233
- "column-defs": G,
234
- "search-value": c.value.searchKey,
235
- "column-filter": [],
236
- onRowClick: t[4] || (t[4] = (n) => b(n.original)),
237
- "hide-footer": i(p).length < 10
238
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
239
- l(v, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
240
- default: x(() => [
241
- (f(!0), k(F, null, W(i(p).filter(
242
- (n) => n.name.toLowerCase().includes(c.value.searchKey.toLowerCase())
243
- ), (n) => (f(), O(h, {
244
- key: n._id.toString(),
245
- onClick: (w) => b(n),
246
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
247
- }, {
248
- default: x(() => [
249
- m("div", pe, [
250
- m("div", fe, [
251
- (f(), O(X(i(V)(n))))
252
- ])
253
- ]),
254
- l(y, {
255
- icon: "delete",
256
- "icon-color": "neutral-gray-400",
257
- variant: "tertiary",
258
- onClick: (w) => (w.stopPropagation(), D(n))
259
- }, null, 8, ["onClick"])
260
- ]),
261
- _: 2
262
- }, 1032, ["onClick"]))), 128))
263
- ]),
264
- _: 1
265
- })
266
- ], 64)) : (f(), O(M, {
267
- key: 1,
268
- variant: "outlined",
269
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
270
- }, {
271
- default: x(() => [
272
- t[6] || (t[6] = m("img", {
273
- src: Z,
274
- class: "aspect-square w-[150px]"
275
- }, null, -1)),
276
- m("div", ge, [
277
- m("div", ye, Y(i(o)("connect.grab.createPromotionCampaign")), 1),
278
- m("div", be, Y(i(o)("connect.grab.description")), 1)
279
- ]),
280
- l(y, {
281
- variant: "primary",
282
- label: i(o)("connect.grab.createPromotionCampaign"),
283
- icon: "add",
284
- onClick: t[5] || (t[5] = (n) => b())
285
- }, null, 8, ["label"])
286
- ]),
287
- _: 1
288
- }))
289
- ]),
290
- l(ce, {
291
- ref_key: "sheetRef",
292
- ref: B,
293
- "onSubmit:modelValue": N
294
- }, null, 512)
295
- ], 64);
296
- };
297
- }
298
- });
299
- export {
300
- Pe as default
301
- };
@@ -1,225 +0,0 @@
1
- import { defineComponent as L, computed as T, openBlock as i, createElementBlock as m, normalizeClass as B, createElementVNode as u, createBlock as P, unref as e, toDisplayString as y, createCommentVNode as F, createVNode as v, onMounted as $, ref as I, Fragment as E, renderList as R, resolveComponent as M, isRef as N } from "vue";
2
- import { u as C } from "./vue-i18n-h2H0nxj-.js";
3
- import { components as x } from "@feedmepos/ui-library";
4
- import { r as S } from "./index-DFePTLAw.js";
5
- import { u as j } from "./business-DbDh-BxN.js";
6
- import { _ as U } from "./LocationPicker.vue_vue_type_script_setup_true_lang-M6eRk_nC.js";
7
- import { R as z } from "./app-gGao9t7Z.js";
8
- import { useRouter as V } from "vue-router";
9
- const A = ["src"], H = { class: "fm-typo-en-body-md-600 flex-1 truncate" }, D = {
10
- key: 2,
11
- class: "fm-typo-en-body-sm-400 text-fm-color-primary-500 shrink-0"
12
- }, G = /* @__PURE__ */ L({
13
- __name: "FacebookPageConfig",
14
- props: {
15
- page: {},
16
- expanded: { type: Boolean },
17
- availableLocations: {}
18
- },
19
- emits: ["toggleExpand", "toggleLocation"],
20
- setup(s, { emit: t }) {
21
- const k = s, f = t, { t: r } = C(), g = T(() => k.page.locationIds);
22
- return (h, p) => (i(), m("div", {
23
- class: B([
24
- "rounded-lg border overflow-hidden transition-colors",
25
- s.expanded ? "border-fm-color-primary-500" : "border-fm-color-neutral-gray-200"
26
- ])
27
- }, [
28
- u("button", {
29
- class: "w-full flex items-center gap-12 p-16 bg-white text-left hover:bg-fm-color-neutral-gray-50 transition-colors",
30
- onClick: p[0] || (p[0] = (c) => f("toggleExpand"))
31
- }, [
32
- s.page.pageProfileImageUrl ? (i(), m("img", {
33
- key: 0,
34
- src: s.page.pageProfileImageUrl,
35
- class: "w-32 h-32 rounded-full shrink-0 object-cover"
36
- }, null, 8, A)) : (i(), P(e(x).FmIcon, {
37
- key: 1,
38
- name: "thumb_up",
39
- class: "text-fm-color-neutral-gray-400 shrink-0"
40
- })),
41
- u("span", H, y(s.page.pageName), 1),
42
- s.page.locationIds.length > 0 ? (i(), m("span", D, y(e(r)("connect.review.locationsSelected", s.page.locationIds.length)), 1)) : F("", !0),
43
- v(e(x).FmIcon, {
44
- name: s.expanded ? "expand_less" : "expand_more",
45
- class: "text-fm-color-neutral-gray-400 shrink-0"
46
- }, null, 8, ["name"])
47
- ]),
48
- s.expanded ? (i(), P(U, {
49
- key: 0,
50
- locations: s.availableLocations,
51
- "selected-ids": e(g),
52
- onToggle: p[1] || (p[1] = (c) => f("toggleLocation", c))
53
- }, null, 8, ["locations", "selected-ids"])) : F("", !0)
54
- ], 2));
55
- }
56
- }), O = { class: "flex flex-col gap-8" }, W = /* @__PURE__ */ L({
57
- __name: "FacebookPageLocationMapping",
58
- props: {
59
- pages: {}
60
- },
61
- emits: ["update:pages"],
62
- setup(s, { emit: t }) {
63
- const k = s, f = j();
64
- $(() => f.readLocations());
65
- const r = t, g = I(null), h = T(() => {
66
- const l = /* @__PURE__ */ new Set();
67
- for (const b of k.pages)
68
- b.locationIds.forEach((a) => l.add(a));
69
- return l;
70
- });
71
- function p(l) {
72
- const b = new Set(l.locationIds);
73
- return f.locations.filter((a) => {
74
- const n = a._id.toString();
75
- return !h.value.has(n) || b.has(n);
76
- });
77
- }
78
- function c(l, b) {
79
- const a = b._id.toString(), n = k.pages.map((o) => {
80
- if (o.facebookPageId !== l) return o;
81
- const _ = o.locationIds.includes(a);
82
- return {
83
- ...o,
84
- locationIds: _ ? o.locationIds.filter((d) => d !== a) : [...o.locationIds, a]
85
- };
86
- });
87
- r("update:pages", n);
88
- }
89
- function w(l) {
90
- g.value = g.value === l ? null : l;
91
- }
92
- return (l, b) => (i(), m("div", O, [
93
- (i(!0), m(E, null, R(s.pages, (a) => (i(), P(G, {
94
- key: a.facebookPageId,
95
- page: a,
96
- expanded: e(g) === a.facebookPageId,
97
- "available-locations": p(a),
98
- onToggleExpand: (n) => w(a.facebookPageId),
99
- onToggleLocation: (n) => c(a.facebookPageId, n)
100
- }, null, 8, ["page", "expanded", "available-locations", "onToggleExpand", "onToggleLocation"]))), 128))
101
- ]));
102
- }
103
- }), q = { class: "flex flex-col min-h-full gap-16 p-24" }, J = {
104
- key: 0,
105
- class: "flex flex-col items-center justify-center flex-1 gap-16"
106
- }, K = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, Q = {
107
- key: 1,
108
- class: "flex flex-col items-center justify-center flex-1 gap-16"
109
- }, X = { class: "fm-typo-en-body-lg-600" }, Y = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, Z = {
110
- key: 2,
111
- class: "flex flex-col items-center justify-center flex-1 gap-16"
112
- }, ee = { class: "fm-typo-en-body-lg-600" }, oe = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, te = { class: "fm-typo-en-body-lg-600" }, ne = { class: "flex gap-8 justify-end mt-auto pt-8" }, me = /* @__PURE__ */ L({
113
- __name: "ReviewFacebookCallback",
114
- setup(s) {
115
- const { t } = C(), k = V();
116
- function f() {
117
- return k.replace({ name: z["$connect-REVIEW_SETTINGS"] });
118
- }
119
- const r = I([]), g = I(!1), h = I(!1), p = I(!1), c = I(null), w = T(
120
- () => r.value.some((n) => n.locationIds.length > 0)
121
- );
122
- function l(n, o) {
123
- return n instanceof Error ? n.message : o;
124
- }
125
- async function b() {
126
- const n = window.location.hash;
127
- if (!n) {
128
- c.value = t("connect.review.noToken");
129
- return;
130
- }
131
- const _ = new URLSearchParams(n.slice(1)).get("access_token");
132
- if (!_) {
133
- c.value = t("connect.review.noToken");
134
- return;
135
- }
136
- g.value = !0;
137
- try {
138
- const d = await S.connectFacebook(_);
139
- r.value = (d == null ? void 0 : d.pages) ?? [], r.value.length === 0 && (c.value = t("connect.review.facebook.noPages"));
140
- } catch (d) {
141
- c.value = l(d, t("connect.review.facebook.failed"));
142
- } finally {
143
- g.value = !1;
144
- }
145
- }
146
- async function a() {
147
- if (!w.value) {
148
- c.value = t("connect.review.noMappings");
149
- return;
150
- }
151
- const n = r.value.map((o) => ({
152
- facebookPageId: o.facebookPageId,
153
- locationIds: o.locationIds
154
- }));
155
- h.value = !0;
156
- try {
157
- await S.updateFacebookPages(n), p.value = !0, setTimeout(f, 2e3);
158
- } catch (o) {
159
- c.value = l(o, t("connect.review.facebook.failed"));
160
- } finally {
161
- h.value = !1;
162
- }
163
- }
164
- return $(b), (n, o) => {
165
- const _ = M("FmPageHead");
166
- return i(), m(E, null, [
167
- v(_, {
168
- title: e(t)("connect.navigation.review")
169
- }, null, 8, ["title"]),
170
- u("div", q, [
171
- e(g) ? (i(), m("div", J, [
172
- v(e(x).FmIcon, {
173
- name: "sync",
174
- size: "xl",
175
- class: "animate-spin text-fm-color-neutral-gray-400"
176
- }),
177
- u("p", K, y(e(t)("connect.review.facebook.fetching")), 1)
178
- ])) : e(p) ? (i(), m("div", Q, [
179
- v(e(x).FmIcon, {
180
- name: "check_circle",
181
- size: "xl",
182
- class: "text-fm-color-typo-success"
183
- }),
184
- u("p", X, y(e(t)("connect.review.facebook.success")), 1),
185
- u("p", Y, y(e(t)("connect.review.redirecting")), 1)
186
- ])) : e(c) ? (i(), m("div", Z, [
187
- v(e(x).FmIcon, {
188
- name: "error",
189
- size: "xl",
190
- class: "text-fm-color-system-error-500"
191
- }),
192
- u("p", ee, y(e(t)("connect.review.errorTitle")), 1),
193
- u("p", oe, y(e(c)), 1),
194
- v(e(x).FmButton, {
195
- label: e(t)("connect.review.goBack"),
196
- onClick: o[0] || (o[0] = (d) => f())
197
- }, null, 8, ["label"])
198
- ])) : e(r).length > 0 ? (i(), m(E, { key: 3 }, [
199
- u("p", te, y(e(t)("connect.review.facebook.selectPage")), 1),
200
- v(W, {
201
- pages: e(r),
202
- "onUpdate:pages": o[1] || (o[1] = (d) => N(r) ? r.value = d : null)
203
- }, null, 8, ["pages"]),
204
- u("div", ne, [
205
- v(e(x).FmButton, {
206
- variant: "secondary",
207
- label: e(t)("connect.review.cancel"),
208
- onClick: o[2] || (o[2] = (d) => f())
209
- }, null, 8, ["label"]),
210
- v(e(x).FmButton, {
211
- label: e(t)("connect.review.connect"),
212
- disabled: !e(w),
213
- loading: e(h),
214
- onClick: a
215
- }, null, 8, ["label", "disabled", "loading"])
216
- ])
217
- ], 64)) : F("", !0)
218
- ])
219
- ], 64);
220
- };
221
- }
222
- });
223
- export {
224
- me as default
225
- };