@feedmepos/mf-connect 0.1.98-beta.8 → 0.1.98-beta.80

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 (167) hide show
  1. package/dist/{App-DsB2o1oB.js → App-DievprEi.js} +853 -683
  2. package/dist/{AuditLogs-BcfgiYnJ.js → AuditLogs-DrdqOhZL.js} +16 -13
  3. package/dist/{Bin-DMr7K8Kj.js → Bin-Ci2k3z77.js} +8 -8
  4. package/dist/Broadcast-CpDMAG1o.js +306 -0
  5. package/dist/CampaignAnalytic-uRyGaLaN.js +1830 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CwGoEBsW.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DtGe2Og1.js} +8 -5
  7. package/dist/Card-tb98Kyr-.js +1086 -0
  8. package/dist/{Collections-B0uGC2FE.js → Collections-P1S5WjnJ.js} +14 -13
  9. package/dist/Credit-DwK7JYf-.js +286 -0
  10. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-Cyk0iIsd.js +53 -0
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-8r29jKh9.js +4432 -0
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DJLxGk7W.js → EffectSheet.vue_vue_type_style_index_0_lang-BML_-v8I.js} +36 -36
  13. package/dist/Experience-BejtRlOj.js +288 -0
  14. package/dist/{FileSaver.min-BlA0oZEC.js → FileSaver.min-C-hmBaHm.js} +1 -1
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
  16. package/dist/Game-n8qL896g.js +356 -0
  17. package/dist/GiftCardSetup-Bgsfcu7N.js +736 -0
  18. package/dist/GoalPickerPanel.vue_vue_type_script_setup_true_lang-CzL68PPP.js +424 -0
  19. package/dist/Goals-BB8LJlq3.js +247 -0
  20. package/dist/{Grab-DmmwrGzk.js → Grab-COq3Ujst.js} +33 -32
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DNtLW0yQ.js → ImageInput.vue_vue_type_script_setup_true_lang-BmLclEyi.js} +1 -1
  22. package/dist/{Index-m7l4insz.js → Index-BdkIinaE.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-B9sJ-M20.js → LocationPicker.vue_vue_type_script_setup_true_lang-DsWv3DVb.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-Dsg2sWjF.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DvOzGF8c.js} +1 -1
  25. package/dist/LoyaltyDashboard-D4Jtpw0n.js +2911 -0
  26. package/dist/MainLayout-Ca-Xm3eZ.js +143 -0
  27. package/dist/{Marketing-C9pSIdBU.js → Marketing-Cpe4s7NZ.js} +7 -6
  28. package/dist/{MarketingMaterialEdit-BEF2T9LR.js → MarketingMaterialEdit-nTeS9VVx.js} +15 -14
  29. package/dist/Member-DgGZ4Cdg.js +654 -0
  30. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-_O3B-FIA.js +1281 -0
  31. package/dist/MemberImportHistory-rdlbDVWU.js +187 -0
  32. package/dist/MemberList-BC4aRJTt.js +334 -0
  33. package/dist/{MemberTransactions-CAut1TQb.js → MemberTransactions-BFfdTttp.js} +1 -1
  34. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-1AuHixPC.js → MessageInput.vue_vue_type_script_setup_true_lang-DXajAQy9.js} +5928 -5644
  35. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-8xVDzdO3.js +40 -0
  36. package/dist/Mission-BWCNKTjU.js +363 -0
  37. package/dist/Overview--Q7vzhNK.js +1316 -0
  38. package/dist/{Overview-DOJj4XvO.js → Overview-i02Wnyjn.js} +23 -20
  39. package/dist/Point-CiWxqny5.js +297 -0
  40. package/dist/Promotion-B0G9qfBm.js +426 -0
  41. package/dist/{Queue-55G2gtP5.js → Queue-YfwgYmzH.js} +16 -13
  42. package/dist/{Record-DNPI02c6.js → Record-CCuwrPKW.js} +9 -9
  43. package/dist/Review-ymsfdh7Q.js +45 -0
  44. package/dist/ReviewFacebookCallback-DyDExWvP.js +238 -0
  45. package/dist/ReviewGoogleCallback-DNyg3n2S.js +213 -0
  46. package/dist/{Reward-CnP8R2pS.js → Reward-BKIb0ezH.js} +28 -28
  47. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BN71h9IK.js → RewardGroup.vue_vue_type_script_setup_true_lang-DPaaNgpr.js} +26 -23
  48. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CtB9Ls5-.js → RuleGroup.vue_vue_type_script_setup_true_lang-BLFLybFn.js} +198 -186
  49. package/dist/{Segment-CxiQnnyj.js → Segment-D5_pp7fh.js} +278 -276
  50. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-B1vj5f7T.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BLLjIA-D.js} +45 -42
  51. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-cWx0G3nM.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BRIcZwnU.js} +4 -4
  52. package/dist/Setting-CD78gIMU.js +574 -0
  53. package/dist/{SettingAdvertisements-Vt7w1WN3.js → SettingAdvertisements-C2AIT4s4.js} +12 -12
  54. package/dist/Settings-DI_tryQV.js +230 -0
  55. package/dist/Store-BV2JTRNZ.js +2615 -0
  56. package/dist/{StoreRewards-DILeipMG.js → StoreRewards-Bk55YXyO.js} +15 -15
  57. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BZZ1fqwg.js +1331 -0
  58. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-C7lVeybl.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BrEzWVrH.js} +2 -2
  59. package/dist/{Tier-BAZ1xuKL.js → Tier-CO2K30Ew.js} +2576 -757
  60. package/dist/{Title-CcNAt47f.js → Title-qProQh3T.js} +41 -37
  61. package/dist/Transaction-qL5L-fE_.js +45 -0
  62. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-hUjQVZ_U.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Co1BPScS.js} +26 -26
  63. package/dist/Voucher-VFD1LY9Y.js +837 -0
  64. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CTQDxc5l.js → VoucherEditor.vue_vue_type_script_setup_true_lang-9QyTl7iq.js} +118 -124
  65. package/dist/WhatsappAccount-CxSGqm7H.js +325 -0
  66. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-D8L6izf0.js +96 -0
  67. package/dist/WhatsappBot-C4Oz7Xwv.js +441 -0
  68. package/dist/WhatsappBotSettings-CKqaWzwE.js +136 -0
  69. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DuRKA4cj.js → ZodTextField.vue_vue_type_script_setup_true_lang-Bcsi94dw.js} +2 -2
  70. package/dist/{app-Z-UKRG5V.js → app-BEYzXWZO.js} +50954 -42517
  71. package/dist/app.js +1 -1
  72. package/dist/base.export-S_82Elmg.js +75 -0
  73. package/dist/browser-BSAOEeIM.js +1478 -0
  74. package/dist/{business-C7EF6cKC.js → business-DH7djUl8.js} +5 -5
  75. package/dist/campaign-DlHDgoFX.js +100 -0
  76. package/dist/campaign-k_WHxsOR.js +400 -0
  77. package/dist/{campaign.enum-BNN2gLFY.js → campaign.enum-Dx-Zo68Q.js} +1 -1
  78. package/dist/{campaign.fn-Bd34dVnx.js → campaign.fn-B-4JRzft.js} +67 -67
  79. package/dist/{collectible.enum-DO9HdJGH.js → collectible.enum-Liy2wH3s.js} +1 -1
  80. package/dist/collection.fn-zQwWDzZT.js +26 -0
  81. package/dist/currency-CQVHXBFe.js +7 -0
  82. package/dist/{duplicateCampaign-2ODeDw3a.js → duplicateCampaign-YTXMbJTj.js} +11 -11
  83. package/dist/{effect-BcB8IlTI.js → effect-CQkVLHWi.js} +1 -1
  84. package/dist/{email-addresses-BcTeU4Sh.js → email-addresses-BIoVbPGC.js} +209 -201
  85. package/dist/google-C3S8u0mT.js +4 -0
  86. package/dist/{helper-BSgrCJRv.js → helper-BCkTvF4m.js} +1 -1
  87. package/dist/{index-CoHWpylO.js → index-B-bQnb0_.js} +2115 -2557
  88. package/dist/index-BAJOC43K.js +14550 -0
  89. package/dist/{index-HXiYGO4_.js → index-BFIHEBnX.js} +6343 -7693
  90. package/dist/{index-VlFWaBrg.js → index-BJIQe3QJ.js} +1 -1
  91. package/dist/{index-BpI-BI4H.js → index-BJkRTH5T.js} +4 -4
  92. package/dist/index-BOJogkKQ.js +172 -0
  93. package/dist/{index-BoYEqLif.js → index-BRPajAkE.js} +1517 -263
  94. package/dist/{index-CsoBDon4.js → index-BTkxgos0.js} +1590 -1523
  95. package/dist/index-BUP4aHq8.js +32438 -0
  96. package/dist/index-BYvnqARr.js +902 -0
  97. package/dist/{index-hlyg-wxV.js → index-Bonq819P.js} +1 -1
  98. package/dist/{index-CIBPhxlC.js → index-C6mOI2Pp.js} +105 -123
  99. package/dist/{index-Bf6jNZit.js → index-CDIe15AY.js} +24 -9
  100. package/dist/index-CTrcdIkt.js +137 -0
  101. package/dist/index-C_H8jFYf.js +2743 -0
  102. package/dist/index-CpnchVe1.js +74 -0
  103. package/dist/index-D5AR7A5e.js +151 -0
  104. package/dist/index-D7-Q86HI.js +54 -0
  105. package/dist/index-DdOj8Hew.js +53 -0
  106. package/dist/{index-iMPtFp54.js → index-Dvqguh2B.js} +10 -9
  107. package/dist/{index-Bm0QPucw.js → index-hAKRfE-4.js} +14 -14
  108. package/dist/index-o2Ga_qaX.js +39 -0
  109. package/dist/{index.esm2017-CM7OnEyP.js → index.esm2017-D0fhMMPG.js} +128 -128
  110. package/dist/{loading-CSXr0Yqz.js → loading-C686AMVG.js} +1 -1
  111. package/dist/{lodash-Bh7XKI-R.js → lodash-CANlWUWW.js} +1 -1
  112. package/dist/member-import-UzJ6ByIS.js +188 -0
  113. package/dist/membership-DCVzFaFy.js +274 -0
  114. package/dist/{money-BZIST_m9.js → money-DuazwoX7.js} +1 -1
  115. package/dist/{number-DXLR2w95.js → number-B2HFiV0g.js} +1 -1
  116. package/dist/objectid-Bq-oVMdP.js +145 -0
  117. package/dist/onboarding-BxvNxz-9.js +131 -0
  118. package/dist/onboardingSetup-CcvKmyx8.js +17 -0
  119. package/dist/{plugins-4FlbwoES.js → plugins-C39O5j42.js} +13 -12
  120. package/dist/remy-Qz_pNsUS.js +13 -0
  121. package/dist/{reward-DUbl79bZ.js → reward-HYt-2nxt.js} +1 -1
  122. package/dist/{rule-BQUoZ4l_.js → rule-3xNIYM7z.js} +337 -275
  123. package/dist/style.css +1 -1
  124. package/dist/{template-BoiSG7G7.js → template-D37Z_b0m.js} +6 -6
  125. package/dist/timezone-JwnQgpaU.js +20 -0
  126. package/dist/transaction.fn-C5vswLI_.js +71 -0
  127. package/dist/{trigger-D5g5m6tT.js → trigger-Bc6s2cvq.js} +17 -17
  128. package/dist/useMarketingMaterialActions-DMGyAXcy.js +96 -0
  129. package/dist/{usePagination-DHePBBoR.js → usePagination-DLOOwiiY.js} +1 -1
  130. package/dist/{user-C_ToSo-g.js → user-CTIGugVF.js} +1 -1
  131. package/dist/{vue-i18n-BcYh6_51.js → vue-i18n-Dpic36zz.js} +287 -287
  132. package/dist/{xlsx-h4G1C-xj.js → xlsx-CT9_1SFr.js} +786 -786
  133. package/dist/{zod-CgigfJar.js → zod-CGVrMcDl.js} +1 -1
  134. package/package.json +10 -6
  135. package/dist/Broadcast-C9akM-TB.js +0 -266
  136. package/dist/Card-DRkIYs0M.js +0 -910
  137. package/dist/Credit-V5YA_hGx.js +0 -260
  138. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  139. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CYQMXARx.js +0 -3377
  140. package/dist/Experience-WTWy5yY6.js +0 -259
  141. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  142. package/dist/Game-BwOfTCW5.js +0 -330
  143. package/dist/LoyaltyDashboard-CJdhYiea.js +0 -1082
  144. package/dist/MainLayout-Du5kZOtA.js +0 -41
  145. package/dist/Member-DUV_vbPI.js +0 -280
  146. package/dist/MemberList-Ye4nOk-i.js +0 -1601
  147. package/dist/Mission-BBmCGpt8.js +0 -334
  148. package/dist/Point-Bzg6hi6o.js +0 -262
  149. package/dist/Promotion-BMXIp_ef.js +0 -397
  150. package/dist/Review-CYNPPxYU.js +0 -1141
  151. package/dist/ReviewFacebookCallback-0SUkKAaC.js +0 -243
  152. package/dist/ReviewGoogleCallback-BZEzx68n.js +0 -208
  153. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-C4vohf6c.js +0 -181
  154. package/dist/Setting-jHAjccod.js +0 -2047
  155. package/dist/Store-Cu-hKmVa.js +0 -1996
  156. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CGz6CTWA.js +0 -1130
  157. package/dist/Transaction-D7DO3dKQ.js +0 -39
  158. package/dist/Voucher-Cq-n1CaC.js +0 -421
  159. package/dist/campaign--MjoY1Mn.js +0 -219
  160. package/dist/campaign-DHBuP4UA.js +0 -277
  161. package/dist/export-CjB7qxZ9.js +0 -97
  162. package/dist/index-BIAjmMga.js +0 -85
  163. package/dist/index-Bv4MBLQ5.js +0 -52
  164. package/dist/index-hbyCVNa7.js +0 -30289
  165. package/dist/membership-CfredTm3.js +0 -255
  166. package/dist/objectid-Dg4ZodlT.js +0 -145
  167. package/dist/useMarketingMaterialActions-B-Jlw2Z9.js +0 -107
@@ -0,0 +1,238 @@
1
+ import { defineComponent as C, computed as M, openBlock as l, createElementBlock as g, normalizeClass as j, createElementVNode as u, createBlock as T, unref as e, toDisplayString as h, createCommentVNode as S, createVNode as y, onMounted as B, ref as P, Fragment as $, renderList as U, resolveComponent as z, isRef as V } from "vue";
2
+ import { u as R } from "./vue-i18n-Dpic36zz.js";
3
+ import { components as I } from "@feedmepos/ui-library";
4
+ import { r as L } from "./index-CpnchVe1.js";
5
+ import { u as A } from "./business-DH7djUl8.js";
6
+ import { _ as H } from "./LocationPicker.vue_vue_type_script_setup_true_lang-DsWv3DVb.js";
7
+ import { R as D } from "./app-BEYzXWZO.js";
8
+ import { useRouter as G } from "vue-router";
9
+ const O = ["src"], W = { class: "fm-typo-en-body-md-600 flex-1 truncate" }, q = {
10
+ key: 2,
11
+ class: "fm-typo-en-body-sm-400 text-fm-color-primary-500 shrink-0"
12
+ }, J = /* @__PURE__ */ C({
13
+ __name: "FacebookPageConfig",
14
+ props: {
15
+ page: {},
16
+ expanded: { type: Boolean },
17
+ availableLocations: {}
18
+ },
19
+ emits: ["toggleExpand", "toggleLocation"],
20
+ setup(s, { emit: n }) {
21
+ const _ = s, f = n, { t: i } = R(), m = M(() => _.page.locationIds);
22
+ return (w, p) => (l(), g("div", {
23
+ class: j([
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 ? (l(), g("img", {
33
+ key: 0,
34
+ src: s.page.pageProfileImageUrl,
35
+ class: "w-32 h-32 rounded-full shrink-0 object-cover"
36
+ }, null, 8, O)) : (l(), T(e(I).FmIcon, {
37
+ key: 1,
38
+ name: "thumb_up",
39
+ class: "text-fm-color-neutral-gray-400 shrink-0"
40
+ })),
41
+ u("span", W, h(s.page.pageName), 1),
42
+ s.page.locationIds.length > 0 ? (l(), g("span", q, h(e(i)("connect.review.locationsSelected", s.page.locationIds.length)), 1)) : S("", !0),
43
+ y(e(I).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 ? (l(), T(H, {
49
+ key: 0,
50
+ locations: s.availableLocations,
51
+ "selected-ids": e(m),
52
+ onToggle: p[1] || (p[1] = (c) => f("toggleLocation", c))
53
+ }, null, 8, ["locations", "selected-ids"])) : S("", !0)
54
+ ], 2));
55
+ }
56
+ }), K = { class: "flex flex-col gap-8" }, Q = /* @__PURE__ */ C({
57
+ __name: "FacebookPageLocationMapping",
58
+ props: {
59
+ pages: {}
60
+ },
61
+ emits: ["update:pages"],
62
+ setup(s, { emit: n }) {
63
+ const _ = s, f = A();
64
+ B(() => f.readLocations());
65
+ const i = n, m = P(null), w = M(() => {
66
+ const r = /* @__PURE__ */ new Set();
67
+ for (const v of _.pages)
68
+ v.locationIds.forEach((a) => r.add(a));
69
+ return r;
70
+ });
71
+ function p(r) {
72
+ const v = new Set(r.locationIds);
73
+ return f.locations.filter((a) => {
74
+ const b = a._id.toString();
75
+ return !w.value.has(b) || v.has(b);
76
+ });
77
+ }
78
+ function c(r, v) {
79
+ const a = v._id.toString(), b = _.pages.map((o) => {
80
+ if (o.facebookPageId !== r) return o;
81
+ const t = o.locationIds.includes(a);
82
+ return {
83
+ ...o,
84
+ locationIds: t ? o.locationIds.filter((k) => k !== a) : [...o.locationIds, a]
85
+ };
86
+ });
87
+ i("update:pages", b);
88
+ }
89
+ function F(r) {
90
+ m.value = m.value === r ? null : r;
91
+ }
92
+ return (r, v) => (l(), g("div", K, [
93
+ (l(!0), g($, null, U(s.pages, (a) => (l(), T(J, {
94
+ key: a.facebookPageId,
95
+ page: a,
96
+ expanded: e(m) === a.facebookPageId,
97
+ "available-locations": p(a),
98
+ onToggleExpand: (b) => F(a.facebookPageId),
99
+ onToggleLocation: (b) => c(a.facebookPageId, b)
100
+ }, null, 8, ["page", "expanded", "available-locations", "onToggleExpand", "onToggleLocation"]))), 128))
101
+ ]));
102
+ }
103
+ }), X = { class: "flex flex-col min-h-full gap-16 p-24" }, Y = {
104
+ key: 0,
105
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
106
+ }, Z = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, ee = {
107
+ key: 1,
108
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
109
+ }, oe = { class: "fm-typo-en-body-lg-600" }, te = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, ne = {
110
+ key: 2,
111
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
112
+ }, ae = { class: "fm-typo-en-body-lg-600" }, se = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, ce = { class: "fm-typo-en-body-lg-600" }, le = { class: "flex gap-8 justify-end mt-auto pt-8" }, ve = /* @__PURE__ */ C({
113
+ __name: "ReviewFacebookCallback",
114
+ setup(s) {
115
+ const { t: n } = R(), _ = G();
116
+ function f() {
117
+ return _.replace({ name: D["$connect-REVIEW_SETTINGS"] });
118
+ }
119
+ const i = P([]), m = P(!1), w = P(!1), p = P(!1), c = P(null), F = M(
120
+ () => i.value.some((o) => o.locationIds.length > 0)
121
+ );
122
+ function r(o, t) {
123
+ const k = new Map(
124
+ t.map((d) => [d.facebookPageId, d])
125
+ );
126
+ return o.map((d) => {
127
+ var x;
128
+ return {
129
+ ...d,
130
+ locationIds: ((x = k.get(d.facebookPageId)) == null ? void 0 : x.locationIds) ?? []
131
+ };
132
+ });
133
+ }
134
+ function v(o, t) {
135
+ return o instanceof Error ? o.message : t;
136
+ }
137
+ async function a() {
138
+ var d;
139
+ const o = window.location.hash;
140
+ if (!o) {
141
+ c.value = n("connect.review.noToken");
142
+ return;
143
+ }
144
+ const k = new URLSearchParams(o.slice(1)).get("access_token");
145
+ if (!k) {
146
+ c.value = n("connect.review.noToken");
147
+ return;
148
+ }
149
+ m.value = !0;
150
+ try {
151
+ const x = await L.getSource(), N = ((d = x == null ? void 0 : x.facebook) == null ? void 0 : d.pages) ?? [], E = await L.connectFacebook(k);
152
+ i.value = r((E == null ? void 0 : E.pages) ?? [], N), i.value.length === 0 && (c.value = n("connect.review.facebook.noPages"));
153
+ } catch (x) {
154
+ c.value = v(x, n("connect.review.facebook.failed"));
155
+ } finally {
156
+ m.value = !1;
157
+ }
158
+ }
159
+ async function b() {
160
+ const o = i.value.filter((t) => t.locationIds.length > 0).map((t) => ({
161
+ facebookPageId: t.facebookPageId,
162
+ locationIds: t.locationIds
163
+ }));
164
+ if (o.length === 0) {
165
+ c.value = n("connect.review.noMappings");
166
+ return;
167
+ }
168
+ w.value = !0;
169
+ try {
170
+ await L.updateFacebookPages(o), p.value = !0, setTimeout(f, 2e3);
171
+ } catch (t) {
172
+ c.value = v(t, n("connect.review.facebook.failed"));
173
+ } finally {
174
+ w.value = !1;
175
+ }
176
+ }
177
+ return B(a), (o, t) => {
178
+ const k = z("FmPageHead");
179
+ return l(), g($, null, [
180
+ y(k, {
181
+ title: e(n)("connect.navigation.review")
182
+ }, null, 8, ["title"]),
183
+ u("div", X, [
184
+ e(m) ? (l(), g("div", Y, [
185
+ y(e(I).FmIcon, {
186
+ name: "sync",
187
+ size: "xl",
188
+ class: "animate-spin text-fm-color-neutral-gray-400"
189
+ }),
190
+ u("p", Z, h(e(n)("connect.review.facebook.fetching")), 1)
191
+ ])) : e(p) ? (l(), g("div", ee, [
192
+ y(e(I).FmIcon, {
193
+ name: "check_circle",
194
+ size: "xl",
195
+ class: "text-fm-color-typo-success"
196
+ }),
197
+ u("p", oe, h(e(n)("connect.review.facebook.success")), 1),
198
+ u("p", te, h(e(n)("connect.review.redirecting")), 1)
199
+ ])) : e(c) ? (l(), g("div", ne, [
200
+ y(e(I).FmIcon, {
201
+ name: "error",
202
+ size: "xl",
203
+ class: "text-fm-color-system-error-500"
204
+ }),
205
+ u("p", ae, h(e(n)("connect.review.errorTitle")), 1),
206
+ u("p", se, h(e(c)), 1),
207
+ y(e(I).FmButton, {
208
+ label: e(n)("connect.review.goBack"),
209
+ onClick: t[0] || (t[0] = (d) => f())
210
+ }, null, 8, ["label"])
211
+ ])) : e(i).length > 0 ? (l(), g($, { key: 3 }, [
212
+ u("p", ce, h(e(n)("connect.review.facebook.selectPage")), 1),
213
+ y(Q, {
214
+ pages: e(i),
215
+ "onUpdate:pages": t[1] || (t[1] = (d) => V(i) ? i.value = d : null)
216
+ }, null, 8, ["pages"]),
217
+ u("div", le, [
218
+ y(e(I).FmButton, {
219
+ variant: "outlined",
220
+ label: e(n)("connect.review.cancel"),
221
+ onClick: t[2] || (t[2] = (d) => f())
222
+ }, null, 8, ["label"]),
223
+ y(e(I).FmButton, {
224
+ label: e(n)("connect.review.connect"),
225
+ disabled: !e(F),
226
+ loading: e(w),
227
+ onClick: b
228
+ }, null, 8, ["label", "disabled", "loading"])
229
+ ])
230
+ ], 64)) : S("", !0)
231
+ ])
232
+ ], 64);
233
+ };
234
+ }
235
+ });
236
+ export {
237
+ ve as default
238
+ };
@@ -0,0 +1,213 @@
1
+ import { defineComponent as E, onMounted as T, ref as w, computed as B, openBlock as d, createElementBlock as p, Fragment as F, renderList as j, normalizeClass as z, unref as e, createElementVNode as m, createVNode as u, toDisplayString as y, createCommentVNode as S, createBlock as P, resolveComponent as U, isRef as V } from "vue";
2
+ import { u as A } from "./vue-i18n-Dpic36zz.js";
3
+ import { components as v } from "@feedmepos/ui-library";
4
+ import { r as C } from "./index-CpnchVe1.js";
5
+ import { u as H } from "./business-DH7djUl8.js";
6
+ import { _ as D } from "./LocationPicker.vue_vue_type_script_setup_true_lang-DsWv3DVb.js";
7
+ import { R as O } from "./app-BEYzXWZO.js";
8
+ import { useRouter as W } from "vue-router";
9
+ const q = { class: "flex flex-col gap-8" }, J = ["onClick"], K = { class: "fm-typo-en-body-md-600 flex-1 truncate" }, Q = {
10
+ key: 0,
11
+ class: "fm-typo-en-body-sm-400 text-fm-color-primary-500 shrink-0"
12
+ }, X = /* @__PURE__ */ E({
13
+ __name: "GoogleLocationMapping",
14
+ props: {
15
+ locations: {}
16
+ },
17
+ emits: ["update:locations"],
18
+ setup(k, { emit: a }) {
19
+ const N = k, b = a, i = H();
20
+ T(() => i.readLocations());
21
+ const g = w(null), h = B(() => {
22
+ const l = /* @__PURE__ */ new Set();
23
+ for (const r of N.locations)
24
+ r.locationId && l.add(r.locationId);
25
+ return l;
26
+ });
27
+ function L(l) {
28
+ return i.locations.filter((r) => {
29
+ const t = r._id.toString();
30
+ return !h.value.has(t) || l.locationId === t;
31
+ });
32
+ }
33
+ function f(l, r) {
34
+ const t = r._id.toString(), _ = N.locations.map((n) => {
35
+ if (n.googleLocationName !== l) return n;
36
+ const o = n.locationId === t;
37
+ return {
38
+ ...n,
39
+ locationId: o ? null : t,
40
+ locationName: o ? null : r.name
41
+ };
42
+ });
43
+ b("update:locations", _);
44
+ }
45
+ function I(l) {
46
+ g.value = g.value === l ? null : l;
47
+ }
48
+ return (l, r) => (d(), p("div", q, [
49
+ (d(!0), p(F, null, j(k.locations, (t) => (d(), p("div", {
50
+ key: t.googleLocationName,
51
+ class: z([
52
+ "rounded-lg border overflow-hidden transition-colors",
53
+ e(g) === t.googleLocationName ? "border-fm-color-primary-500" : "border-fm-color-neutral-gray-200"
54
+ ])
55
+ }, [
56
+ m("button", {
57
+ class: "w-full flex items-center gap-12 p-16 bg-white text-left hover:bg-fm-color-neutral-gray-50 transition-colors",
58
+ onClick: (_) => I(t.googleLocationName)
59
+ }, [
60
+ u(e(v).FmIcon, {
61
+ name: "storefront",
62
+ class: "text-fm-color-neutral-gray-400 shrink-0"
63
+ }),
64
+ m("span", K, y(t.displayName || t.googleLocationName), 1),
65
+ t.locationName ? (d(), p("span", Q, y(t.locationName), 1)) : S("", !0),
66
+ u(e(v).FmIcon, {
67
+ name: e(g) === t.googleLocationName ? "expand_less" : "expand_more",
68
+ class: "text-fm-color-neutral-gray-400 shrink-0"
69
+ }, null, 8, ["name"])
70
+ ], 8, J),
71
+ e(g) === t.googleLocationName ? (d(), P(D, {
72
+ key: 0,
73
+ locations: L(t),
74
+ "selected-ids": t.locationId ? [t.locationId] : [],
75
+ onToggle: (_) => f(t.googleLocationName, _)
76
+ }, null, 8, ["locations", "selected-ids", "onToggle"])) : S("", !0)
77
+ ], 2))), 128))
78
+ ]));
79
+ }
80
+ }), Y = { class: "flex flex-col min-h-full gap-16 p-24" }, Z = {
81
+ key: 0,
82
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
83
+ }, ee = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, oe = {
84
+ key: 1,
85
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
86
+ }, te = { class: "fm-typo-en-body-lg-600" }, ne = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, ae = {
87
+ key: 2,
88
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
89
+ }, le = { class: "fm-typo-en-body-lg-600" }, se = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, ce = { class: "fm-typo-en-body-lg-600" }, ie = { class: "flex gap-8 justify-end mt-auto pt-8" }, ve = /* @__PURE__ */ E({
90
+ __name: "ReviewGoogleCallback",
91
+ setup(k) {
92
+ const { t: a } = A(), N = W();
93
+ function b() {
94
+ return N.replace({ name: O["$connect-REVIEW_SETTINGS"] });
95
+ }
96
+ const i = w([]), g = w(!1), h = w(!1), L = w(!1), f = w(null), I = B(
97
+ () => i.value.some((n) => n.locationId !== null)
98
+ );
99
+ function l(n, o) {
100
+ return n instanceof Error ? n.message : o;
101
+ }
102
+ function r(n, o) {
103
+ const x = new Map(
104
+ o.map((s) => [s.googleLocationName, s.location])
105
+ );
106
+ return n.map((s) => {
107
+ const c = x.get(s.googleLocationName) ?? null;
108
+ return {
109
+ googleLocationName: s.googleLocationName,
110
+ displayName: s.displayName,
111
+ locationId: (c == null ? void 0 : c._id) ?? null,
112
+ locationName: (c == null ? void 0 : c.name) ?? null
113
+ };
114
+ });
115
+ }
116
+ async function t() {
117
+ var s;
118
+ const n = new URLSearchParams(window.location.search), o = n.get("code"), x = n.get("state");
119
+ if (!o || !x) {
120
+ f.value = a("connect.review.noToken");
121
+ return;
122
+ }
123
+ g.value = !0;
124
+ try {
125
+ const c = await C.getSource(), R = ((s = c == null ? void 0 : c.google) == null ? void 0 : s.locations) ?? [], M = window.location.pathname.replace(/\/review(?:\/.*)?$/, ""), G = `${window.location.origin}${M}/review/google/callback`, $ = await C.connectGoogle(o, G, x);
126
+ i.value = r(($ == null ? void 0 : $.locations) ?? [], R), i.value.length === 0 && (f.value = a("connect.review.google.noLocations"));
127
+ } catch (c) {
128
+ f.value = l(c, a("connect.review.google.failed"));
129
+ } finally {
130
+ g.value = !1;
131
+ }
132
+ }
133
+ async function _() {
134
+ const n = i.value.map((o) => ({
135
+ googleLocationName: o.googleLocationName,
136
+ displayName: o.displayName,
137
+ locationId: o.locationId
138
+ }));
139
+ if (n.length === 0) {
140
+ f.value = a("connect.review.noMappings");
141
+ return;
142
+ }
143
+ h.value = !0;
144
+ try {
145
+ await C.updateGoogleLocations(n), L.value = !0, setTimeout(b, 2e3);
146
+ } catch (o) {
147
+ f.value = l(o, a("connect.review.google.failed"));
148
+ } finally {
149
+ h.value = !1;
150
+ }
151
+ }
152
+ return T(t), (n, o) => {
153
+ const x = U("FmPageHead");
154
+ return d(), p(F, null, [
155
+ u(x, {
156
+ title: e(a)("connect.navigation.review")
157
+ }, null, 8, ["title"]),
158
+ m("div", Y, [
159
+ e(g) ? (d(), p("div", Z, [
160
+ u(e(v).FmIcon, {
161
+ name: "sync",
162
+ size: "xl",
163
+ class: "animate-spin text-fm-color-neutral-gray-400"
164
+ }),
165
+ m("p", ee, y(e(a)("connect.review.google.fetching")), 1)
166
+ ])) : e(L) ? (d(), p("div", oe, [
167
+ u(e(v).FmIcon, {
168
+ name: "check_circle",
169
+ size: "xl",
170
+ class: "text-fm-color-typo-success"
171
+ }),
172
+ m("p", te, y(e(a)("connect.review.google.success")), 1),
173
+ m("p", ne, y(e(a)("connect.review.redirecting")), 1)
174
+ ])) : e(f) ? (d(), p("div", ae, [
175
+ u(e(v).FmIcon, {
176
+ name: "error",
177
+ size: "xl",
178
+ class: "text-fm-color-system-error-500"
179
+ }),
180
+ m("p", le, y(e(a)("connect.review.errorTitle")), 1),
181
+ m("p", se, y(e(f)), 1),
182
+ u(e(v).FmButton, {
183
+ label: e(a)("connect.review.goBack"),
184
+ onClick: o[0] || (o[0] = (s) => b())
185
+ }, null, 8, ["label"])
186
+ ])) : e(i).length > 0 ? (d(), p(F, { key: 3 }, [
187
+ m("p", ce, y(e(a)("connect.review.google.selectLocation")), 1),
188
+ u(X, {
189
+ locations: e(i),
190
+ "onUpdate:locations": o[1] || (o[1] = (s) => V(i) ? i.value = s : null)
191
+ }, null, 8, ["locations"]),
192
+ m("div", ie, [
193
+ u(e(v).FmButton, {
194
+ variant: "outlined",
195
+ label: e(a)("connect.review.cancel"),
196
+ onClick: o[2] || (o[2] = (s) => b())
197
+ }, null, 8, ["label"]),
198
+ u(e(v).FmButton, {
199
+ label: e(a)("connect.review.connect"),
200
+ disabled: !e(I),
201
+ loading: e(h),
202
+ onClick: _
203
+ }, null, 8, ["label", "disabled", "loading"])
204
+ ])
205
+ ], 64)) : S("", !0)
206
+ ])
207
+ ], 64);
208
+ };
209
+ }
210
+ });
211
+ export {
212
+ ve as default
213
+ };
@@ -1,26 +1,26 @@
1
1
  import { defineComponent as X, ref as x, computed as H, resolveComponent as w, openBlock as b, createBlock as h, unref as t, isRef as Z, withCtx as A, createElementVNode as f, createVNode as d, createCommentVNode as k, createElementBlock as M, Fragment as Y, h as O, onMounted as q, toDisplayString as B } from "vue";
2
2
  import { _ as z } from "./campaign-CpzFl8Vr.js";
3
3
  import { useDialog as Q, components as L } from "@feedmepos/ui-library";
4
- import { u as G } from "./loading-CSXr0Yqz.js";
5
- import { u as J, C as ee } from "./membership-CfredTm3.js";
6
- import { f as j, p as te } from "./plugins-4FlbwoES.js";
7
- import { u as oe } from "./vue-i18n-BcYh6_51.js";
4
+ import { u as G } from "./loading-C686AMVG.js";
5
+ import { u as J, C as ee } from "./membership-DCVzFaFy.js";
6
+ import { f as j, p as te } from "./plugins-C39O5j42.js";
7
+ import { u as oe } from "./vue-i18n-Dpic36zz.js";
8
8
  import { c as ae } from "./object-BYyQ0PZp.js";
9
- import { Z as _ } from "./zod-CgigfJar.js";
10
- import "./index-CsoBDon4.js";
11
- import { F as N } from "./index-iMPtFp54.js";
9
+ import { Z as F } from "./zod-CGVrMcDl.js";
10
+ import "./index-BTkxgos0.js";
11
+ import { a as N } from "./index-Dvqguh2B.js";
12
12
  import { useCoreStore as le } from "@feedmepos/mf-common";
13
- import { _ as ne, a as ie } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-CTQDxc5l.js";
14
- import { b as re } from "./EffectSheet.vue_vue_type_style_index_0_lang-DJLxGk7W.js";
13
+ import { _ as ne, a as ie } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-9QyTl7iq.js";
14
+ import { _ as re } from "./EffectSheet.vue_vue_type_style_index_0_lang-BML_-v8I.js";
15
15
  import { J as K } from "./JsonViewer-v8_C7l5N.js";
16
- import { _ as se } from "./ZodTextField.vue_vue_type_script_setup_true_lang-DuRKA4cj.js";
17
- import { i as de } from "./helper-BSgrCJRv.js";
18
- import { u as pe, r as P } from "./reward-DUbl79bZ.js";
19
- import "./index-hlyg-wxV.js";
20
- import { C as ce } from "./campaign.fn-Bd34dVnx.js";
21
- import { e as me } from "./effect-BcB8IlTI.js";
16
+ import { _ as se } from "./ZodTextField.vue_vue_type_script_setup_true_lang-Bcsi94dw.js";
17
+ import { i as de } from "./helper-BCkTvF4m.js";
18
+ import { u as pe, r as P } from "./reward-HYt-2nxt.js";
19
+ import "./index-Bonq819P.js";
20
+ import { C as ce } from "./campaign.fn-B-4JRzft.js";
21
+ import { e as me } from "./effect-CQkVLHWi.js";
22
22
  import { useRouter as ue } from "vue-router";
23
- import { R as ye } from "./app-Z-UKRG5V.js";
23
+ import { R as ye } from "./app-BEYzXWZO.js";
24
24
  const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__ */ X({
25
25
  __name: "EditRewardSheet",
26
26
  emits: ["update"],
@@ -39,7 +39,7 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
39
39
  const l = R.value.safeParse(a.value);
40
40
  return l.success ? [] : l.error.errors;
41
41
  });
42
- function F(l, e) {
42
+ function _(l, e) {
43
43
  l && (y.value = void 0, a.value = e), v.value = l;
44
44
  }
45
45
  const D = I;
@@ -93,7 +93,7 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
93
93
  }
94
94
  const V = x();
95
95
  return n({
96
- showSheet: F
96
+ showSheet: _
97
97
  }), (l, e) => {
98
98
  const o = w("FmSelect"), i = w("FmForm"), m = w("FmButton"), g = w("FmSideSheet");
99
99
  return b(), h(g, {
@@ -137,8 +137,8 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
137
137
  modelValue: t(a).name,
138
138
  "onUpdate:modelValue": e[0] || (e[0] = (s) => t(a).name = s),
139
139
  label: "Reward Name",
140
- schema: t(_).typeAtPath(t(R), "name", []),
141
- "error-text": t(_).helperText(t(u), "name")
140
+ schema: t(F).typeAtPath(t(R), "name", []),
141
+ "error-text": t(F).helperText(t(u), "name")
142
142
  }, null, 8, ["modelValue", "schema", "error-text"]),
143
143
  d(o, {
144
144
  label: "Reward Type",
@@ -168,12 +168,12 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
168
168
  key: 0,
169
169
  class: "mt-[-8px]",
170
170
  rules: [
171
- t(_).ruleAtPath(t(R), "option.earningOption", [
171
+ t(F).ruleAtPath(t(R), "option.earningOption", [
172
172
  t(a).option.type
173
173
  ])
174
174
  ],
175
- "helper-state": t(_).helperState(t(u), "option.earningOption"),
176
- "error-text": t(_).helperText(t(u), "option.earningOption"),
175
+ "helper-state": t(F).helperState(t(u), "option.earningOption"),
176
+ "error-text": t(F).helperText(t(u), "option.earningOption"),
177
177
  "fixed-type": !0,
178
178
  "model-value": t(a).option.earningOption,
179
179
  "onUpdate:modelValue": e[1] || (e[1] = (s) => t(a).option.earningOption = s)
@@ -188,7 +188,7 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
188
188
  )) == null ? void 0 : E.raw.type) === "CREDIT",
189
189
  type: t(a).option.type === "VOUCHER" ? "range" : "custom",
190
190
  rules: [
191
- t(_).ruleAtPath(t(R), "option.validityOption", [
191
+ t(F).ruleAtPath(t(R), "option.validityOption", [
192
192
  t(a).option.type
193
193
  ])
194
194
  ],
@@ -224,7 +224,7 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
224
224
  }, p = J(), C = pe(), { global: v, minor: a } = G, y = ue(), R = Q(), u = x({
225
225
  searchKey: "",
226
226
  columnFilters: []
227
- }), F = H(() => C.rewards);
227
+ }), _ = H(() => C.rewards);
228
228
  function D(e) {
229
229
  y.push({
230
230
  name: ye["$connect-STORE_REWARD_COLLECTIONS"],
@@ -385,7 +385,7 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
385
385
  })
386
386
  }, null, 8, ["title", "actions"]),
387
387
  f("div", ve, [
388
- t(F) && t(F).length > 0 ? (b(), M(Y, { key: 0 }, [
388
+ t(_) && t(_).length > 0 ? (b(), M(Y, { key: 0 }, [
389
389
  f("div", ge, [
390
390
  o[6] || (o[6] = f("div", { class: "flex gap-8" }, null, -1)),
391
391
  d(m, {
@@ -397,12 +397,12 @@ const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__
397
397
  }, null, 8, ["modelValue"])
398
398
  ]),
399
399
  d(g, {
400
- "row-data": t(F),
400
+ "row-data": t(_),
401
401
  "column-defs": S,
402
402
  "search-value": t(u).searchKey,
403
403
  "column-filter": t(u).columnFilters,
404
404
  onRowClick: o[3] || (o[3] = (c) => V(c.original)),
405
- "hide-footer": t(F).length < 10
405
+ "hide-footer": t(_).length < 10
406
406
  }, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
407
407
  ], 64)) : (b(), h(E, {
408
408
  key: 1,