@feedmepos/mf-connect 0.1.97-prod → 0.1.98-beta.2

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 (116) hide show
  1. package/dist/{App-DHAyGCKP.js → App-BWBeJksP.js} +118 -106
  2. package/dist/AuditLogs-CWVUX5o0.js +2013 -0
  3. package/dist/{Bin-BxyU2xtK.js → Bin-jXmZpGfg.js} +8 -8
  4. package/dist/{Broadcast-BJjehb02.js → Broadcast-C76pTADb.js} +18 -17
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BCxP8rEW.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-9kfq8OXE.js} +5 -6
  6. package/dist/{Card-BYDuADCn.js → Card-qXn83BYu.js} +19 -19
  7. package/dist/{Collections-BlPEkNm8.js → Collections-DGXUQSbz.js} +197 -185
  8. package/dist/{Credit-D9Eqxv2E.js → Credit-CpmrPZx9.js} +18 -17
  9. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
  10. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DAnw5TFZ.js +3377 -0
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-hpNgkLOt.js → EffectSheet.vue_vue_type_style_index_0_lang-BCAotF0P.js} +6 -6
  12. package/dist/{Experience-DGumSpYK.js → Experience-CuOq7hd3.js} +35 -34
  13. package/dist/{FileSaver.min-D_TpPHp3.js → FileSaver.min-Cjv6SzrG.js} +1 -1
  14. package/dist/{Game-DDsYLdKu.js → Game-D0KfLD-b.js} +16 -15
  15. package/dist/Grab-L1h7bHD7.js +300 -0
  16. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-R00i7YNe.js → ImageInput.vue_vue_type_script_setup_true_lang-DMAaHxzm.js} +1 -1
  17. package/dist/{Index-DwRbFOsj.js → Index-DxwMHEV3.js} +10 -10
  18. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-i9-B25xO.js +48 -0
  19. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-D_HOJBzW.js → LottieAnimation.vue_vue_type_script_setup_true_lang-D84v7zC_.js} +1 -1
  20. package/dist/LoyaltyDashboard-B5wg1EUC.js +1082 -0
  21. package/dist/{MainLayout-BEUAguIP.js → MainLayout-Cgi3Z3EM.js} +1 -1
  22. package/dist/{Marketing-WdhEZvmz.js → Marketing-Cl5OSBI1.js} +4 -4
  23. package/dist/{MarketingMaterialEdit-DUIkUA79.js → MarketingMaterialEdit-CzYTbdJd.js} +214 -211
  24. package/dist/{Member-jL3RMGsZ.js → Member-D29x5Cic.js} +20 -20
  25. package/dist/{MemberList-B1bdPK63.js → MemberList-DDPe6Ymr.js} +50 -51
  26. package/dist/{MemberTransactions-BNKJ0wtr.js → MemberTransactions-3mboVWAx.js} +1 -1
  27. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Cvsz00_4.js → MessageInput.vue_vue_type_script_setup_true_lang-C2HlA9O8.js} +11 -11
  28. package/dist/{Mission-CoXzS7U6.js → Mission-CMPc4NLe.js} +35 -34
  29. package/dist/{Overview-B16wZUSV.js → Overview-sJ2kuP4U.js} +19 -19
  30. package/dist/{Point-CORBv0y2.js → Point-BBP4UEhf.js} +30 -29
  31. package/dist/{Promotion-DQ4WnFkH.js → Promotion-Bt0RLGsd.js} +111 -105
  32. package/dist/{Queue-BW97QEY2.js → Queue-CzVsoIDM.js} +43 -43
  33. package/dist/{Record-DZOhwf13.js → Record-CAoGgaxo.js} +10 -10
  34. package/dist/Review-CVBJlwGK.js +959 -0
  35. package/dist/ReviewFacebookCallback-RGWdxXYf.js +243 -0
  36. package/dist/ReviewGoogleCallback-L7_Jjbkx.js +208 -0
  37. package/dist/{Reward-Bi9mpuyH.js → Reward-CrpFlr0a.js} +17 -17
  38. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Dtosx1wE.js → RewardGroup.vue_vue_type_script_setup_true_lang-DW-WFNI6.js} +12 -12
  39. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DlcsO8fk.js +1911 -0
  40. package/dist/{Segment-COhS8SPv.js → Segment-Cy-QwYQQ.js} +77 -78
  41. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-By_BQodK.js → SelectItems.vue_vue_type_script_setup_true_lang-ovvxxcrQ.js} +3 -3
  42. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BoEnwoYd.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-D69bJtyd.js} +12 -12
  43. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DonadRJT.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DQyoPZ_6.js} +4 -4
  44. package/dist/{Setting-BNtYrzdN.js → Setting-DEQIJ4fY.js} +259 -248
  45. package/dist/{SettingAdvertisements-Cne8GikV.js → SettingAdvertisements-NuwjCPLN.js} +13 -13
  46. package/dist/{Store-iTgtmUVL.js → Store-Cw2J_ecA.js} +24 -24
  47. package/dist/{StoreRewards-DLawXBsl.js → StoreRewards-BK5rDAaK.js} +16 -16
  48. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B3jwaYHX.js +1130 -0
  49. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D_OdWctk.js +7007 -0
  50. package/dist/{Tier-BbZMbFSd.js → Tier-CwZ40RYc.js} +544 -469
  51. package/dist/{Title-Co5XWIJm.js → Title-DU7KmsK2.js} +93 -92
  52. package/dist/{Transaction-CoUbt5rr.js → Transaction-Uh5Ozt93.js} +2 -2
  53. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CzJpNT94.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BtnUNkcS.js} +6 -6
  54. package/dist/{Voucher-CXojttH0.js → Voucher-BF6ARaRe.js} +28 -27
  55. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Bxkds9_4.js → VoucherEditor.vue_vue_type_script_setup_true_lang-C7msPJdi.js} +12 -12
  56. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CHVqFzLm.js → ZodTextField.vue_vue_type_script_setup_true_lang-BrR2WA1K.js} +2 -2
  57. package/dist/{app-_LtKE4PZ.js → app-DlECkPwT.js} +3408 -2913
  58. package/dist/app.js +4 -3
  59. package/dist/{business-CchrWCX9.js → business-BSe9C-xG.js} +1 -1
  60. package/dist/{campaign-N2x2N6OP.js → campaign-BNS2RxKc.js} +114 -64
  61. package/dist/{campaign-D2RzC0L1.js → campaign-CXw3jpdr.js} +13 -7
  62. package/dist/{campaign.enum-DqJsu1At.js → campaign.enum-CnMa2Tia.js} +3 -2
  63. package/dist/{campaign.fn-Da4r_dvc.js → campaign.fn-CNOinW8t.js} +131 -131
  64. package/dist/{collectible.enum-CHheiKkA.js → collectible.enum-BIvEz79q.js} +1 -1
  65. package/dist/duplicateCampaign-Co2TdbrL.js +51 -0
  66. package/dist/{effect-DADvE7lZ.js → effect-Bt8PE3-M.js} +1 -1
  67. package/dist/{email-addresses-DzUHQuVs.js → email-addresses-Dh95ALqP.js} +2 -2
  68. package/dist/{export-uzECYleM.js → export-DIIgAwP7.js} +3 -3
  69. package/dist/{helper-DMsYRFIM.js → helper-8zEdQ9jm.js} +1 -1
  70. package/dist/{index-CEVpWmjC.js → index-0BNEvaYc.js} +7 -7
  71. package/dist/{index-r8TuEpzi.js → index-BAlFstx4.js} +1 -1
  72. package/dist/{index-C2h4SP0A.js → index-BP5qSDQw.js} +806 -205
  73. package/dist/{index-KYtKBtvK.js → index-Bqxe3Gbq.js} +3 -3
  74. package/dist/{index-CrPHsZg1.js → index-CWypTyOP.js} +1554 -1270
  75. package/dist/{index-DXl_Qtu-.js → index-CfxDirFl.js} +1 -1
  76. package/dist/{index-Bc-pgOn6.js → index-DDp0nMys.js} +1 -1
  77. package/dist/index-DW4-mTTG.js +52 -0
  78. package/dist/{timezone-B_KZGqyd.js → index-DdCPfF8x.js} +21 -20
  79. package/dist/index-IPOrNVQw.js +67 -0
  80. package/dist/{index-XJX8_Wlh.js → index-SsUBL4IR.js} +1 -1
  81. package/dist/{index-Ct1Qf7kH.js → index-VS1hWlhk.js} +1 -1
  82. package/dist/{index-B9RmImNP.js → index-ZKJoXi1-.js} +3 -3
  83. package/dist/{index-DQ6H1MEw.js → index-rwlkBKrS.js} +1996 -1968
  84. package/dist/{index.esm2017-D9jjiQqn.js → index.esm2017-CgR02aQB.js} +209 -209
  85. package/dist/{loading-DK8UdxtS.js → loading-CxY9qhzD.js} +1 -1
  86. package/dist/{lodash-CgcQgDO8.js → lodash-CELsN1M_.js} +1 -1
  87. package/dist/{membership-Cs4GzRnn.js → membership-BoQMuerb.js} +3 -3
  88. package/dist/{money-TgbWserQ.js → money-CH913hGN.js} +1 -1
  89. package/dist/{number-fLCh4B45.js → number-CO-WbLdr.js} +1 -1
  90. package/dist/object-BYyQ0PZp.js +18 -0
  91. package/dist/objectid-BM2Ygj-U.js +145 -0
  92. package/dist/{plugins-DYcrIMpx.js → plugins-YK45gSb1.js} +94 -95
  93. package/dist/{reward-uQ8Oz8Fd.js → reward-3aFPahH6.js} +1 -1
  94. package/dist/{rule-BcbgF0xS.js → rule-DC9my0Vg.js} +505 -487
  95. package/dist/style.css +1 -1
  96. package/dist/template-tDq12e1p.js +188 -0
  97. package/dist/{trigger-c-_77EFL.js → trigger-DoPHRgKt.js} +5 -5
  98. package/dist/{useMarketingMaterialActions-BCqwGe4e.js → useMarketingMaterialActions-CEd6ODsz.js} +3 -3
  99. package/dist/{usePagination-C3cT5BmC.js → usePagination-C8FUj5q_.js} +1 -1
  100. package/dist/{user-CRIo5MyA.js → user-Dhlhrnf8.js} +1 -1
  101. package/dist/{vue-i18n-BU_SuDqj.js → vue-i18n-B-92uhPn.js} +175 -175
  102. package/dist/{xlsx-Bw1AshOG.js → xlsx-Dmxne1eM.js} +166 -166
  103. package/dist/{zod-CzlTW8Al.js → zod-Dcdy9Dm3.js} +1 -1
  104. package/package.json +8 -4
  105. package/dist/Analytic-Ccb5IKBy.js +0 -426
  106. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bf8Rc-Eh.js +0 -2223
  107. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CrvTdEPu.js +0 -1888
  108. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cl8JEYjx.js +0 -1118
  109. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DEEz7iEu.js +0 -142
  110. package/dist/collection.fn-BqDPyvUe.js +0 -26
  111. package/dist/dto-CstKk_3g.js +0 -216
  112. package/dist/index-_KlH62Ed.js +0 -55
  113. package/dist/object-qECH92oz.js +0 -26
  114. package/dist/objectid-CVxLIQ5K.js +0 -145
  115. package/dist/rule-builder-CIkRKgap.js +0 -102
  116. package/dist/template-wZEVj8lZ.js +0 -236
@@ -0,0 +1,243 @@
1
+ import { defineComponent as S, computed as T, openBlock as d, createElementBlock as g, normalizeClass as z, createElementVNode as m, createBlock as C, unref as e, toDisplayString as k, createCommentVNode as $, createVNode as v, onMounted as B, ref as P, Fragment as E, renderList as N, resolveComponent as R, isRef as U } from "vue";
2
+ import { u as M } from "./vue-i18n-B-92uhPn.js";
3
+ import { components as x } from "@feedmepos/ui-library";
4
+ import { r as L } from "./index-DW4-mTTG.js";
5
+ import { u as V } from "./business-BSe9C-xG.js";
6
+ import { _ as A } from "./LocationPicker.vue_vue_type_script_setup_true_lang-i9-B25xO.js";
7
+ import { useRouter as H } from "vue-router";
8
+ const D = ["src"], q = { class: "fm-typo-en-body-md-600 flex-1 truncate" }, G = {
9
+ key: 2,
10
+ class: "fm-typo-en-body-sm-400 text-fm-color-primary-500 shrink-0"
11
+ }, J = /* @__PURE__ */ S({
12
+ __name: "FacebookPageConfig",
13
+ props: {
14
+ page: {},
15
+ expanded: { type: Boolean },
16
+ availableLocations: {}
17
+ },
18
+ emits: ["toggleExpand", "toggleLocation"],
19
+ setup(c, { emit: n }) {
20
+ const b = c, i = n, { t: h } = M(), f = T(
21
+ () => b.page.locations.map((_) => _._id)
22
+ );
23
+ return (_, l) => (d(), g("div", {
24
+ class: z([
25
+ "rounded-lg border overflow-hidden transition-colors",
26
+ c.expanded ? "border-fm-color-primary-500" : "border-fm-color-neutral-gray-200"
27
+ ])
28
+ }, [
29
+ m("button", {
30
+ class: "w-full flex items-center gap-12 p-16 bg-white text-left hover:bg-fm-color-neutral-gray-50 transition-colors",
31
+ onClick: l[0] || (l[0] = (w) => i("toggleExpand"))
32
+ }, [
33
+ c.page.pageProfileImageUrl ? (d(), g("img", {
34
+ key: 0,
35
+ src: c.page.pageProfileImageUrl,
36
+ class: "w-32 h-32 rounded-full shrink-0 object-cover"
37
+ }, null, 8, D)) : (d(), C(e(x).FmIcon, {
38
+ key: 1,
39
+ name: "thumb_up",
40
+ class: "text-fm-color-neutral-gray-400 shrink-0"
41
+ })),
42
+ m("span", q, k(c.page.pageName), 1),
43
+ c.page.locations.length > 0 ? (d(), g("span", G, k(e(h)("connect.review.locationsSelected", c.page.locations.length)), 1)) : $("", !0),
44
+ v(e(x).FmIcon, {
45
+ name: c.expanded ? "expand_less" : "expand_more",
46
+ class: "text-fm-color-neutral-gray-400 shrink-0"
47
+ }, null, 8, ["name"])
48
+ ]),
49
+ c.expanded ? (d(), C(A, {
50
+ key: 0,
51
+ locations: c.availableLocations,
52
+ "selected-ids": e(f),
53
+ onToggle: l[1] || (l[1] = (w) => i("toggleLocation", w))
54
+ }, null, 8, ["locations", "selected-ids"])) : $("", !0)
55
+ ], 2));
56
+ }
57
+ }), K = { class: "flex flex-col gap-8" }, O = /* @__PURE__ */ S({
58
+ __name: "FacebookPageLocationMapping",
59
+ props: {
60
+ pages: {}
61
+ },
62
+ emits: ["update:pages"],
63
+ setup(c, { emit: n }) {
64
+ const b = c, i = V();
65
+ B(() => i.readLocations());
66
+ const h = n, f = P(null), _ = T(() => {
67
+ const r = /* @__PURE__ */ new Set();
68
+ for (const p of b.pages)
69
+ p.locations.forEach((a) => r.add(a._id));
70
+ return r;
71
+ });
72
+ function l(r) {
73
+ const p = new Set(r.locations.map((a) => a._id));
74
+ return i.locations.filter((a) => {
75
+ const t = a._id.toString();
76
+ return !_.value.has(t) || p.has(t);
77
+ });
78
+ }
79
+ function w(r, p) {
80
+ const a = p._id.toString(), t = b.pages.map((o) => {
81
+ if (o.facebookPageId !== r) return o;
82
+ const u = o.locations.some(
83
+ (s) => s._id === a
84
+ );
85
+ return {
86
+ ...o,
87
+ locations: u ? o.locations.filter((s) => s._id !== a) : [
88
+ ...o.locations,
89
+ {
90
+ _id: a,
91
+ name: p.name
92
+ }
93
+ ]
94
+ };
95
+ });
96
+ h("update:pages", t);
97
+ }
98
+ function I(r) {
99
+ f.value = f.value === r ? null : r;
100
+ }
101
+ return (r, p) => (d(), g("div", K, [
102
+ (d(!0), g(E, null, N(c.pages, (a) => (d(), C(J, {
103
+ key: a.facebookPageId,
104
+ page: a,
105
+ expanded: e(f) === a.facebookPageId,
106
+ "available-locations": l(a),
107
+ onToggleExpand: (t) => I(a.facebookPageId),
108
+ onToggleLocation: (t) => w(a.facebookPageId, t)
109
+ }, null, 8, ["page", "expanded", "available-locations", "onToggleExpand", "onToggleLocation"]))), 128))
110
+ ]));
111
+ }
112
+ }), Q = { class: "flex flex-col min-h-full gap-16 p-24" }, W = {
113
+ key: 0,
114
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
115
+ }, X = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, Y = {
116
+ key: 1,
117
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
118
+ }, Z = { class: "fm-typo-en-body-lg-600" }, ee = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, oe = {
119
+ key: 2,
120
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
121
+ }, te = { class: "fm-typo-en-body-lg-600" }, ne = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, ae = { class: "fm-typo-en-body-lg-600" }, se = { class: "flex gap-8 justify-end mt-auto pt-8" }, ge = /* @__PURE__ */ S({
122
+ __name: "ReviewFacebookCallback",
123
+ setup(c) {
124
+ const { t: n } = M(), b = H(), i = P([]), h = P(!1), f = P(!1), _ = P(!1), l = P(null), w = T(
125
+ () => i.value.some((t) => t.locations.length > 0)
126
+ );
127
+ function I(t, o) {
128
+ const u = new Map(
129
+ o.map((s) => [s.facebookPageId, s])
130
+ );
131
+ return t.map((s) => {
132
+ var y;
133
+ return {
134
+ ...s,
135
+ locations: ((y = u.get(s.facebookPageId)) == null ? void 0 : y.locations) ?? []
136
+ };
137
+ });
138
+ }
139
+ function r(t, o) {
140
+ return t instanceof Error ? t.message : o;
141
+ }
142
+ async function p() {
143
+ var s;
144
+ const t = window.location.hash;
145
+ if (!t) {
146
+ l.value = n("connect.review.noToken");
147
+ return;
148
+ }
149
+ const u = new URLSearchParams(t.slice(1)).get("access_token");
150
+ if (!u) {
151
+ l.value = n("connect.review.noToken");
152
+ return;
153
+ }
154
+ h.value = !0;
155
+ try {
156
+ const y = await L.getSource(), j = ((s = y == null ? void 0 : y.facebook) == null ? void 0 : s.pages) ?? [], F = await L.connectFacebook(u);
157
+ i.value = I((F == null ? void 0 : F.pages) ?? [], j), i.value.length === 0 && (l.value = n("connect.review.facebook.noPages"));
158
+ } catch (y) {
159
+ l.value = r(y, n("connect.review.facebook.failed"));
160
+ } finally {
161
+ h.value = !1;
162
+ }
163
+ }
164
+ async function a() {
165
+ const t = i.value.filter((o) => o.locations.length > 0).map((o) => ({
166
+ facebookPageId: o.facebookPageId,
167
+ locationIds: o.locations.map((u) => u._id)
168
+ }));
169
+ if (t.length === 0) {
170
+ l.value = n("connect.review.noMappings");
171
+ return;
172
+ }
173
+ f.value = !0;
174
+ try {
175
+ await L.updateFacebookPages(t), _.value = !0, setTimeout(() => b.replace("/review"), 2e3);
176
+ } catch (o) {
177
+ l.value = r(o, n("connect.review.facebook.failed"));
178
+ } finally {
179
+ f.value = !1;
180
+ }
181
+ }
182
+ return B(p), (t, o) => {
183
+ const u = R("FmPageHead");
184
+ return d(), g(E, null, [
185
+ v(u, {
186
+ title: e(n)("connect.navigation.review")
187
+ }, null, 8, ["title"]),
188
+ m("div", Q, [
189
+ e(h) ? (d(), g("div", W, [
190
+ v(e(x).FmIcon, {
191
+ name: "sync",
192
+ size: "xl",
193
+ class: "animate-spin text-fm-color-neutral-gray-400"
194
+ }),
195
+ m("p", X, k(e(n)("connect.review.facebook.fetching")), 1)
196
+ ])) : e(_) ? (d(), g("div", Y, [
197
+ v(e(x).FmIcon, {
198
+ name: "check_circle",
199
+ size: "xl",
200
+ class: "text-fm-color-typo-success"
201
+ }),
202
+ m("p", Z, k(e(n)("connect.review.facebook.success")), 1),
203
+ m("p", ee, k(e(n)("connect.review.redirecting")), 1)
204
+ ])) : e(l) ? (d(), g("div", oe, [
205
+ v(e(x).FmIcon, {
206
+ name: "error",
207
+ size: "xl",
208
+ class: "text-fm-color-system-error-500"
209
+ }),
210
+ m("p", te, k(e(n)("connect.review.errorTitle")), 1),
211
+ m("p", ne, k(e(l)), 1),
212
+ v(e(x).FmButton, {
213
+ label: e(n)("connect.review.goBack"),
214
+ onClick: o[0] || (o[0] = (s) => e(b).replace("/review"))
215
+ }, null, 8, ["label"])
216
+ ])) : e(i).length > 0 ? (d(), g(E, { key: 3 }, [
217
+ m("p", ae, k(e(n)("connect.review.facebook.selectPage")), 1),
218
+ v(O, {
219
+ pages: e(i),
220
+ "onUpdate:pages": o[1] || (o[1] = (s) => U(i) ? i.value = s : null)
221
+ }, null, 8, ["pages"]),
222
+ m("div", se, [
223
+ v(e(x).FmButton, {
224
+ variant: "outlined",
225
+ label: e(n)("connect.review.cancel"),
226
+ onClick: o[2] || (o[2] = (s) => e(b).replace("/review"))
227
+ }, null, 8, ["label"]),
228
+ v(e(x).FmButton, {
229
+ label: e(n)("connect.review.connect"),
230
+ disabled: !e(w),
231
+ loading: e(f),
232
+ onClick: a
233
+ }, null, 8, ["label", "disabled", "loading"])
234
+ ])
235
+ ], 64)) : $("", !0)
236
+ ])
237
+ ], 64);
238
+ };
239
+ }
240
+ });
241
+ export {
242
+ ge as default
243
+ };
@@ -0,0 +1,208 @@
1
+ import { defineComponent as S, onMounted as B, ref as h, computed as T, openBlock as d, createElementBlock as v, Fragment as F, renderList as z, normalizeClass as G, unref as e, createElementVNode as m, createVNode as u, toDisplayString as y, createCommentVNode as $, createBlock as P, resolveComponent as R, isRef as U } from "vue";
2
+ import { u as V } from "./vue-i18n-B-92uhPn.js";
3
+ import { components as _ } from "@feedmepos/ui-library";
4
+ import { r as C } from "./index-DW4-mTTG.js";
5
+ import { u as A } from "./business-BSe9C-xG.js";
6
+ import { _ as H } from "./LocationPicker.vue_vue_type_script_setup_true_lang-i9-B25xO.js";
7
+ import { useRouter as D } from "vue-router";
8
+ const q = { class: "flex flex-col gap-8" }, J = ["onClick"], K = { class: "fm-typo-en-body-md-600 flex-1 truncate" }, O = {
9
+ key: 0,
10
+ class: "fm-typo-en-body-sm-400 text-fm-color-primary-500 shrink-0"
11
+ }, Q = /* @__PURE__ */ S({
12
+ __name: "GoogleLocationMapping",
13
+ props: {
14
+ locations: {}
15
+ },
16
+ emits: ["update:locations"],
17
+ setup(N, { emit: a }) {
18
+ const x = N, i = a, w = A();
19
+ B(() => w.readLocations());
20
+ const g = h(null), b = T(() => {
21
+ const s = /* @__PURE__ */ new Set();
22
+ for (const r of x.locations)
23
+ r.locationId && s.add(r.locationId);
24
+ return s;
25
+ });
26
+ function f(s) {
27
+ return w.locations.filter((r) => {
28
+ const t = r._id.toString();
29
+ return !b.value.has(t) || s.locationId === t;
30
+ });
31
+ }
32
+ function k(s, r) {
33
+ const t = r._id.toString(), n = x.locations.map((o) => {
34
+ if (o.googleLocationName !== s) return o;
35
+ const p = o.locationId === t;
36
+ return {
37
+ ...o,
38
+ locationId: p ? null : t,
39
+ locationName: p ? null : r.name
40
+ };
41
+ });
42
+ i("update:locations", n);
43
+ }
44
+ function L(s) {
45
+ g.value = g.value === s ? null : s;
46
+ }
47
+ return (s, r) => (d(), v("div", q, [
48
+ (d(!0), v(F, null, z(N.locations, (t) => (d(), v("div", {
49
+ key: t.googleLocationName,
50
+ class: G([
51
+ "rounded-lg border overflow-hidden transition-colors",
52
+ e(g) === t.googleLocationName ? "border-fm-color-primary-500" : "border-fm-color-neutral-gray-200"
53
+ ])
54
+ }, [
55
+ m("button", {
56
+ class: "w-full flex items-center gap-12 p-16 bg-white text-left hover:bg-fm-color-neutral-gray-50 transition-colors",
57
+ onClick: (n) => L(t.googleLocationName)
58
+ }, [
59
+ u(e(_).FmIcon, {
60
+ name: "storefront",
61
+ class: "text-fm-color-neutral-gray-400 shrink-0"
62
+ }),
63
+ m("span", K, y(t.displayName || t.googleLocationName), 1),
64
+ t.locationName ? (d(), v("span", O, y(t.locationName), 1)) : $("", !0),
65
+ u(e(_).FmIcon, {
66
+ name: e(g) === t.googleLocationName ? "expand_less" : "expand_more",
67
+ class: "text-fm-color-neutral-gray-400 shrink-0"
68
+ }, null, 8, ["name"])
69
+ ], 8, J),
70
+ e(g) === t.googleLocationName ? (d(), P(H, {
71
+ key: 0,
72
+ locations: f(t),
73
+ "selected-ids": t.locationId ? [t.locationId] : [],
74
+ onToggle: (n) => k(t.googleLocationName, n)
75
+ }, null, 8, ["locations", "selected-ids", "onToggle"])) : $("", !0)
76
+ ], 2))), 128))
77
+ ]));
78
+ }
79
+ }), W = { class: "flex flex-col min-h-full gap-16 p-24" }, X = {
80
+ key: 0,
81
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
82
+ }, Y = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, Z = {
83
+ key: 1,
84
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
85
+ }, ee = { class: "fm-typo-en-body-lg-600" }, oe = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, te = {
86
+ key: 2,
87
+ class: "flex flex-col items-center justify-center flex-1 gap-16"
88
+ }, ne = { class: "fm-typo-en-body-lg-600" }, ae = { class: "fm-typo-en-body-md-400 text-fm-color-neutral-gray-400" }, le = { class: "fm-typo-en-body-lg-600" }, se = { class: "flex gap-8 justify-end mt-auto pt-8" }, fe = /* @__PURE__ */ S({
89
+ __name: "ReviewGoogleCallback",
90
+ setup(N) {
91
+ const { t: a } = V(), x = D(), i = h([]), w = h(!1), g = h(!1), b = h(!1), f = h(null), k = T(
92
+ () => i.value.some((n) => n.locationId !== null)
93
+ );
94
+ function L(n, o) {
95
+ return n instanceof Error ? n.message : o;
96
+ }
97
+ function s(n, o) {
98
+ const p = new Map(
99
+ o.map((l) => [l.googleLocationName, l.location])
100
+ );
101
+ return n.map((l) => {
102
+ const c = p.get(l.googleLocationName) ?? null;
103
+ return {
104
+ googleLocationName: l.googleLocationName,
105
+ displayName: l.displayName,
106
+ locationId: (c == null ? void 0 : c._id) ?? null,
107
+ locationName: (c == null ? void 0 : c.name) ?? null
108
+ };
109
+ });
110
+ }
111
+ async function r() {
112
+ var l;
113
+ const n = new URLSearchParams(window.location.search), o = n.get("code"), p = n.get("state");
114
+ if (!o || !p) {
115
+ f.value = a("connect.review.noToken");
116
+ return;
117
+ }
118
+ w.value = !0;
119
+ try {
120
+ const c = await C.getSource(), E = ((l = c == null ? void 0 : c.google) == null ? void 0 : l.locations) ?? [], M = window.location.pathname.replace(/\/review(?:\/.*)?$/, ""), j = `${window.location.origin}${M}/review/google/callback`, I = await C.connectGoogle(o, j, p);
121
+ i.value = s((I == null ? void 0 : I.locations) ?? [], E), i.value.length === 0 && (f.value = a("connect.review.google.noLocations"));
122
+ } catch (c) {
123
+ f.value = L(c, a("connect.review.google.failed"));
124
+ } finally {
125
+ w.value = !1;
126
+ }
127
+ }
128
+ async function t() {
129
+ const n = i.value.map((o) => ({
130
+ googleLocationName: o.googleLocationName,
131
+ displayName: o.displayName,
132
+ locationId: o.locationId
133
+ }));
134
+ if (n.length === 0) {
135
+ f.value = a("connect.review.noMappings");
136
+ return;
137
+ }
138
+ g.value = !0;
139
+ try {
140
+ await C.updateGoogleLocations(n), b.value = !0, setTimeout(() => x.replace("/review"), 2e3);
141
+ } catch (o) {
142
+ f.value = L(o, a("connect.review.google.failed"));
143
+ } finally {
144
+ g.value = !1;
145
+ }
146
+ }
147
+ return B(r), (n, o) => {
148
+ const p = R("FmPageHead");
149
+ return d(), v(F, null, [
150
+ u(p, {
151
+ title: e(a)("connect.navigation.review")
152
+ }, null, 8, ["title"]),
153
+ m("div", W, [
154
+ e(w) ? (d(), v("div", X, [
155
+ u(e(_).FmIcon, {
156
+ name: "sync",
157
+ size: "xl",
158
+ class: "animate-spin text-fm-color-neutral-gray-400"
159
+ }),
160
+ m("p", Y, y(e(a)("connect.review.google.fetching")), 1)
161
+ ])) : e(b) ? (d(), v("div", Z, [
162
+ u(e(_).FmIcon, {
163
+ name: "check_circle",
164
+ size: "xl",
165
+ class: "text-fm-color-typo-success"
166
+ }),
167
+ m("p", ee, y(e(a)("connect.review.google.success")), 1),
168
+ m("p", oe, y(e(a)("connect.review.redirecting")), 1)
169
+ ])) : e(f) ? (d(), v("div", te, [
170
+ u(e(_).FmIcon, {
171
+ name: "error",
172
+ size: "xl",
173
+ class: "text-fm-color-system-error-500"
174
+ }),
175
+ m("p", ne, y(e(a)("connect.review.errorTitle")), 1),
176
+ m("p", ae, y(e(f)), 1),
177
+ u(e(_).FmButton, {
178
+ label: e(a)("connect.review.goBack"),
179
+ onClick: o[0] || (o[0] = (l) => e(x).replace("/review"))
180
+ }, null, 8, ["label"])
181
+ ])) : e(i).length > 0 ? (d(), v(F, { key: 3 }, [
182
+ m("p", le, y(e(a)("connect.review.google.selectLocation")), 1),
183
+ u(Q, {
184
+ locations: e(i),
185
+ "onUpdate:locations": o[1] || (o[1] = (l) => U(i) ? i.value = l : null)
186
+ }, null, 8, ["locations"]),
187
+ m("div", se, [
188
+ u(e(_).FmButton, {
189
+ variant: "outlined",
190
+ label: e(a)("connect.review.cancel"),
191
+ onClick: o[2] || (o[2] = (l) => e(x).replace("/review"))
192
+ }, null, 8, ["label"]),
193
+ u(e(_).FmButton, {
194
+ label: e(a)("connect.review.connect"),
195
+ disabled: !e(k),
196
+ loading: e(g),
197
+ onClick: t
198
+ }, null, 8, ["label", "disabled", "loading"])
199
+ ])
200
+ ], 64)) : $("", !0)
201
+ ])
202
+ ], 64);
203
+ };
204
+ }
205
+ });
206
+ export {
207
+ fe as default
208
+ };
@@ -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-DK8UdxtS.js";
5
- import { u as J, C as ee } from "./membership-Cs4GzRnn.js";
6
- import { f as j, p as te } from "./plugins-DYcrIMpx.js";
7
- import { u as oe } from "./vue-i18n-BU_SuDqj.js";
8
- import { c as ae } from "./object-qECH92oz.js";
9
- import { Z as _ } from "./zod-CzlTW8Al.js";
10
- import "./index-DQ6H1MEw.js";
11
- import { F as N } from "./index-B9RmImNP.js";
4
+ import { u as G } from "./loading-CxY9qhzD.js";
5
+ import { u as J, C as ee } from "./membership-BoQMuerb.js";
6
+ import { f as j, p as te } from "./plugins-YK45gSb1.js";
7
+ import { u as oe } from "./vue-i18n-B-92uhPn.js";
8
+ import { c as ae } from "./object-BYyQ0PZp.js";
9
+ import { Z as _ } from "./zod-Dcdy9Dm3.js";
10
+ import "./index-rwlkBKrS.js";
11
+ import { F as N } from "./index-ZKJoXi1-.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-Bxkds9_4.js";
14
- import { b as re } from "./EffectSheet.vue_vue_type_style_index_0_lang-hpNgkLOt.js";
13
+ import { _ as ne, a as ie } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-C7msPJdi.js";
14
+ import { b as re } from "./EffectSheet.vue_vue_type_style_index_0_lang-BCAotF0P.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-CHVqFzLm.js";
17
- import { i as de } from "./helper-DMsYRFIM.js";
18
- import { u as pe, r as P } from "./reward-uQ8Oz8Fd.js";
19
- import "./index-Bc-pgOn6.js";
20
- import { C as ce } from "./campaign.fn-Da4r_dvc.js";
21
- import { e as me } from "./effect-DADvE7lZ.js";
16
+ import { _ as se } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BrR2WA1K.js";
17
+ import { i as de } from "./helper-8zEdQ9jm.js";
18
+ import { u as pe, r as P } from "./reward-3aFPahH6.js";
19
+ import "./index-DDp0nMys.js";
20
+ import { C as ce } from "./campaign.fn-CNOinW8t.js";
21
+ import { e as me } from "./effect-Bt8PE3-M.js";
22
22
  import { useRouter as ue } from "vue-router";
23
- import { R as ye } from "./app-_LtKE4PZ.js";
23
+ import { R as ye } from "./app-DlECkPwT.js";
24
24
  const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__ */ X({
25
25
  __name: "EditRewardSheet",
26
26
  emits: ["update"],
@@ -1,19 +1,19 @@
1
1
  import { ref as p, defineComponent as T, computed as x, resolveComponent as y, openBlock as U, createBlock as G, unref as e, isRef as $, withCtx as b, createElementVNode as v, createVNode as u, toDisplayString as j } from "vue";
2
- import { u as B } from "./loading-DK8UdxtS.js";
2
+ import { u as B } from "./loading-CxY9qhzD.js";
3
3
  import { J as P } from "./JsonViewer-v8_C7l5N.js";
4
- import { _ as D } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CHVqFzLm.js";
5
- import { _ as I } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-CzJpNT94.js";
6
- import { Z as L } from "./zod-CzlTW8Al.js";
4
+ import { _ as D } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BrR2WA1K.js";
5
+ import { _ as I } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-BtnUNkcS.js";
6
+ import { Z as L } from "./zod-Dcdy9Dm3.js";
7
7
  import { u as V } from "./app-wDQR6dpb.js";
8
8
  import { defineStore as N } from "pinia";
9
- import { r as k } from "./index-XJX8_Wlh.js";
10
- import "./index-CrPHsZg1.js";
11
- import "./index-DQ6H1MEw.js";
12
- import "./index-KYtKBtvK.js";
13
- import { c as E } from "./index-C2h4SP0A.js";
14
- import "./index-B9RmImNP.js";
15
- import { u as J } from "./vue-i18n-BU_SuDqj.js";
16
- import { c as C } from "./object-qECH92oz.js";
9
+ import { r as k } from "./index-SsUBL4IR.js";
10
+ import { d as E } from "./index-BP5qSDQw.js";
11
+ import "./index-CWypTyOP.js";
12
+ import "./index-rwlkBKrS.js";
13
+ import "./index-Bqxe3Gbq.js";
14
+ import "./index-ZKJoXi1-.js";
15
+ import { u as J } from "./vue-i18n-B-92uhPn.js";
16
+ import { c as C } from "./object-BYyQ0PZp.js";
17
17
  import { useDialog as Z } from "@feedmepos/ui-library";
18
18
  const A = N("mf-connect-referral", () => {
19
19
  const h = p();