@feedmepos/mf-connect 0.1.98-beta.40 → 0.1.98-beta.41

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 (151) hide show
  1. package/dist/App-C6JJ9uQ8.js +4785 -0
  2. package/dist/AuditLogs-CAlgtDgx.js +2014 -0
  3. package/dist/Bin-D8jwhwER.js +166 -0
  4. package/dist/Broadcast-CP8DRfkT.js +269 -0
  5. package/dist/CampaignAnalytic-MVjYBFvu.js +1826 -0
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DeLURz87.js +122 -0
  7. package/dist/Card-QribXJwZ.js +911 -0
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  9. package/dist/Collections-X9xbt43V.js +541 -0
  10. package/dist/Credit-QmbsW1eb.js +286 -0
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  12. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-ClNieHSo.js +3382 -0
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CrGHTNhg.js +351 -0
  15. package/dist/Experience-CPGMg847.js +285 -0
  16. package/dist/FileSaver.min-CK67LsPG.js +74 -0
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
  19. package/dist/Game-BrkiEFCS.js +356 -0
  20. package/dist/GiftCardSetup-DXNBHF1A.js +542 -0
  21. package/dist/Grab-BgtDzK1B.js +301 -0
  22. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-Dzv2AkKN.js +145 -0
  23. package/dist/Index-KJgzalOd.js +259 -0
  24. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  25. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-C6SBLJGQ.js +48 -0
  26. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-Dj74lJ7b.js +18737 -0
  27. package/dist/LoyaltyDashboard-B2JpbC01.js +1345 -0
  28. package/dist/MainLayout-DlfTKHQ-.js +143 -0
  29. package/dist/Marketing-Crx_JQpi.js +236 -0
  30. package/dist/MarketingMaterialEdit-BfsdcMXJ.js +1036 -0
  31. package/dist/Member-C50Nrsko.js +281 -0
  32. package/dist/MemberList-C9uUKw1o.js +1603 -0
  33. package/dist/MemberOverview-wL_ailso.js +58 -0
  34. package/dist/MemberTransactions-DZ7zPOHX.js +45 -0
  35. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Du_ZGsbX.js +60957 -0
  36. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bg_0YlwG.js +38 -0
  37. package/dist/Mission-D_km8zi6.js +360 -0
  38. package/dist/Overview-BBieK6qQ.js +1080 -0
  39. package/dist/Overview-B_kmLOcc.js +1316 -0
  40. package/dist/Point-D0q9N7f9.js +288 -0
  41. package/dist/Promotion-DoFTy-NK.js +423 -0
  42. package/dist/Queue-Dh5sDRHW.js +261 -0
  43. package/dist/Record-0owEBKqN.js +342 -0
  44. package/dist/Review-DV2fnpOH.js +45 -0
  45. package/dist/ReviewFacebookCallback-D8mnAPzR.js +238 -0
  46. package/dist/ReviewGoogleCallback-CLzt_ox2.js +213 -0
  47. package/dist/Reward-Co20Xrss.js +442 -0
  48. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-0qU49c47.js +150 -0
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-qdvaXPhJ.js +1913 -0
  50. package/dist/Segment-7dQKeHWK.js +1017 -0
  51. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BUVrUifO.js +181 -0
  52. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-DDsV9TD9.js +189 -0
  53. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DqPZpddc.js +226 -0
  54. package/dist/Setting-Bvahxs-y.js +2047 -0
  55. package/dist/SettingAdvertisements-fbXLRwfb.js +264 -0
  56. package/dist/Settings-C_HWDFN8.js +179 -0
  57. package/dist/Store-8yBKDR1b.js +2413 -0
  58. package/dist/StoreRewards-DKaJvoJs.js +540 -0
  59. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-D23XzJD7.js +1075 -0
  60. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-JaFhCK_L.js +7007 -0
  61. package/dist/Tier-CD-CjXC3.js +972 -0
  62. package/dist/Title-C_lcgye8.js +569 -0
  63. package/dist/Transaction-BvUYm-rT.js +39 -0
  64. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-C3Yacz7K.js +130 -0
  65. package/dist/Voucher-CYaG0GLU.js +444 -0
  66. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DF2JqzRe.js +421 -0
  67. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-B4UPqSNc.js +56 -0
  68. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  69. package/dist/app-CE5hQ4Uq.js +60740 -0
  70. package/dist/app-wDQR6dpb.js +39 -0
  71. package/dist/app.js +7 -0
  72. package/dist/business-CE_4siXc.js +82 -0
  73. package/dist/campaign-BP6rvSpg.js +255 -0
  74. package/dist/campaign-CXQtKpeb.js +100 -0
  75. package/dist/campaign-CpzFl8Vr.js +4 -0
  76. package/dist/campaign.enum-Dx-Zo68Q.js +26 -0
  77. package/dist/campaign.fn-DKnBpE1N.js +776 -0
  78. package/dist/collectible.enum-Liy2wH3s.js +19 -0
  79. package/dist/collection.fn-Cg16QZSp.js +26 -0
  80. package/dist/duplicateCampaign-DbtVAGsT.js +51 -0
  81. package/dist/effect-CLI8NI4O.js +89 -0
  82. package/dist/email-addresses-DlLiZ1io.js +705 -0
  83. package/dist/export-6Hr34dBU.js +97 -0
  84. package/dist/feedme.ico +0 -0
  85. package/dist/google-C3S8u0mT.js +4 -0
  86. package/dist/helper-vkjFqj70.js +86 -0
  87. package/dist/index-BIyKgw4m.js +72 -0
  88. package/dist/index-BLQJ-rv3.js +31 -0
  89. package/dist/index-BbTIqReL.js +67 -0
  90. package/dist/index-BuMfQxMf.js +897 -0
  91. package/dist/index-C8cXXcLk.js +45 -0
  92. package/dist/index-CSVhIZSY.js +8919 -0
  93. package/dist/index-CVHacTbc.js +151 -0
  94. package/dist/index-C_H8jFYf.js +2743 -0
  95. package/dist/index-CmNsGhDf.js +2706 -0
  96. package/dist/index-CnTeeRyJ.js +53 -0
  97. package/dist/index-CuvNtC_M.js +61 -0
  98. package/dist/index-CzbNobLv.js +1139 -0
  99. package/dist/index-D06n1h1b.js +146 -0
  100. package/dist/index-D4SDAfbP.js +27550 -0
  101. package/dist/index-DVnYQ3Hs.js +85 -0
  102. package/dist/index-DcjnS5Sv.js +28900 -0
  103. package/dist/index-Dx9h0FNH.js +3 -0
  104. package/dist/index-YgP4ihQL.js +32 -0
  105. package/dist/index-kedErkLZ.js +2963 -0
  106. package/dist/index-lnQT4P3d.js +55 -0
  107. package/dist/index-vh86FiIQ.js +10 -0
  108. package/dist/index.esm2017-Jhv2lkrq.js +3069 -0
  109. package/dist/loading-NY-FPxVY.js +72 -0
  110. package/dist/lodash-BC_P6kLg.js +3678 -0
  111. package/dist/membership-BWaK-9FY.js +255 -0
  112. package/dist/moment-D7p2TMB-.js +2583 -0
  113. package/dist/money-COoh4GXK.js +15 -0
  114. package/dist/number-BX5OEXgq.js +12 -0
  115. package/dist/object-BYyQ0PZp.js +18 -0
  116. package/dist/objectId-dwaoBfJX.js +7 -0
  117. package/dist/objectid-1SUSRtmY.js +145 -0
  118. package/dist/plugins-ur-FAoye.js +1788 -0
  119. package/dist/remy-Qz_pNsUS.js +13 -0
  120. package/dist/reward-DSsylZ22.js +36 -0
  121. package/dist/rule-BM9GUd1C.js +1969 -0
  122. package/dist/rule-builder-gC9LH2AC.js +126 -0
  123. package/dist/string-Gcy5IM_H.js +32 -0
  124. package/dist/style.css +4 -0
  125. package/dist/template-CUV3AMFI.js +188 -0
  126. package/dist/tier-BJDhpH6X.js +4 -0
  127. package/dist/tiers/tier=1.png +0 -0
  128. package/dist/tiers/tier=2.png +0 -0
  129. package/dist/tiers/tier=3.png +0 -0
  130. package/dist/tiers/tier=4.png +0 -0
  131. package/dist/timezone-BFZhekOU.js +20 -0
  132. package/dist/titles/type=diamond.png +0 -0
  133. package/dist/titles/type=drinks.png +0 -0
  134. package/dist/titles/type=food.png +0 -0
  135. package/dist/titles/type=heart.png +0 -0
  136. package/dist/titles/type=medal.png +0 -0
  137. package/dist/titles/type=spend.png +0 -0
  138. package/dist/titles/type=thank-you.png +0 -0
  139. package/dist/titles/type=thumbs-up.png +0 -0
  140. package/dist/titles/type=years.png +0 -0
  141. package/dist/transaction.fn-C5MlkEIC.js +64 -0
  142. package/dist/trigger-CbjiuoSo.js +213 -0
  143. package/dist/tslib.es6-BCqqvLQ_.js +44 -0
  144. package/dist/type_drinks-D6jnpvwV.js +4 -0
  145. package/dist/useMarketingMaterialActions-BLisTieA.js +96 -0
  146. package/dist/usePagination-Caah4sJr.js +220 -0
  147. package/dist/user-BZC4P_jL.js +55 -0
  148. package/dist/vue-i18n-BYz7XAr_.js +2365 -0
  149. package/dist/xlsx-Bn7BqUFA.js +15491 -0
  150. package/dist/zod-DHH42rXG.js +91 -0
  151. package/package.json +1 -1
@@ -0,0 +1,264 @@
1
+ import { defineComponent as J, ref as y, computed as z, onMounted as K, resolveComponent as A, openBlock as u, createElementBlock as b, createElementVNode as s, createVNode as d, createTextVNode as W, toDisplayString as v, unref as e, withCtx as k, createBlock as B, Fragment as Y, renderList as Z, createCommentVNode as N, isRef as ee } from "vue";
2
+ import { u as te } from "./loading-NY-FPxVY.js";
3
+ import { u as ne } from "./app-wDQR6dpb.js";
4
+ import { u as se } from "./business-CE_4siXc.js";
5
+ import { u as oe } from "./membership-BWaK-9FY.js";
6
+ import "./index-D4SDAfbP.js";
7
+ import { b as ae } from "./index-BuMfQxMf.js";
8
+ import "./index-Dx9h0FNH.js";
9
+ import { _ as le } from "./ImageInput.vue_vue_type_script_setup_true_lang-Dzv2AkKN.js";
10
+ import { f as D, p as ie } from "./plugins-ur-FAoye.js";
11
+ import { _ as re } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-JaFhCK_L.js";
12
+ import { u as ce } from "./vue-i18n-BYz7XAr_.js";
13
+ import { useRouter as de } from "vue-router";
14
+ import { m as me } from "./index-CVHacTbc.js";
15
+ import { R as ue } from "./app-CE5hQ4Uq.js";
16
+ import { a as ve } from "./object-BYyQ0PZp.js";
17
+ const pe = { class: "min-h-screen bg-fm-color-neutral-gray-50" }, fe = { class: "bg-white border-b border-fm-color-neutral-gray-100 sticky top-0 z-10" }, ge = { class: "px-24 py-16 flex items-center justify-between" }, _e = { class: "flex items-center gap-16" }, he = { class: "fm-typo-en-title-md-800 flex items-center gap-8" }, ye = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, be = {
18
+ key: 0,
19
+ class: "px-24 py-24"
20
+ }, we = { class: "flex items-center gap-24 mb-24" }, xe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Se = { class: "fm-typo-en-body-lg-600" }, ke = { class: "fm-typo-en-title-sm-800 mb-8" }, Ae = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-16" }, Ce = {
21
+ key: 1,
22
+ class: "grid grid-cols-5 gap-16 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2"
23
+ }, Fe = { class: "absolute top-8 right-8 z-10" }, je = { class: "aspect-[3/4] bg-fm-color-neutral-gray-100" }, Le = ["src"], Me = ["src", "alt"], Ve = {
24
+ key: 2,
25
+ class: "w-full h-full flex items-center justify-center text-fm-color-typo-disabled"
26
+ }, $e = { class: "w-48 h-48 rounded-full bg-fm-color-neutral-gray-100 flex items-center justify-center mb-8" }, Be = { class: "fm-typo-en-body-md-600 mb-4" }, Ie = { class: "fm-typo-en-body-xs-400 text-fm-color-typo-secondary" }, Pe = { class: "space-y-[40px]" }, Ee = { class: "flex" }, Te = { class: "flex flex-wrap" }, ze = { class: "flex items-center gap-8" }, I = 20, nt = /* @__PURE__ */ J({
27
+ __name: "SettingAdvertisements",
28
+ setup(Ne) {
29
+ const U = de(), C = ne(), M = se(), F = oe(), { global: Q, minor: R } = te, { t: o } = ce(), c = y(), f = y([]), _ = y([]), w = y(!1), g = y(null), j = y(null), L = y(null), V = z(() => {
30
+ var n, t;
31
+ return ((t = (n = c.value) == null ? void 0 : n.advertisements) == null ? void 0 : t.length) ?? 0;
32
+ }), P = z(() => V.value < I);
33
+ function x(n) {
34
+ var a, p;
35
+ const t = (p = (a = c.value) == null ? void 0 : a.advertisements) == null ? void 0 : p[n];
36
+ if (t)
37
+ return typeof t == "string" ? t : t.url;
38
+ }
39
+ function O(n) {
40
+ return n ? [".mp4", ".webm", ".ogg", ".mov"].some((a) => n.toLowerCase().includes(a)) : !1;
41
+ }
42
+ async function $() {
43
+ await R(
44
+ async () => {
45
+ const n = ve(c.value), t = ae.parse(n), a = Date.now(), p = (m) => `${a}-${m}-${Math.random().toString(36).substring(2, 15)}`, S = await Promise.all(
46
+ f.value.map(async (m, h) => {
47
+ var r;
48
+ const i = (r = t.advertisements) == null ? void 0 : r[h];
49
+ let l;
50
+ return m ? l = await D.update(
51
+ D.advertisementPath(h, m),
52
+ m
53
+ ) : typeof i == "string" ? l = i : i && typeof i == "object" && (l = i.url), l ? {
54
+ _id: typeof i == "object" && (i == null ? void 0 : i._id) || p(h),
55
+ url: l,
56
+ targetLocation: _.value[h] || null,
57
+ order: h
58
+ } : null;
59
+ })
60
+ );
61
+ t.advertisements = S.filter((m) => m), await me.update(t), await F.readMembership(), c.value = F.membership;
62
+ },
63
+ {
64
+ message: o("connect.advertisements.saving"),
65
+ successMessage: o("connect.advertisements.savedSuccessfully")
66
+ }
67
+ );
68
+ }
69
+ function E(n) {
70
+ g.value = n, j.value = f.value[n], L.value = _.value[n], w.value = !0;
71
+ }
72
+ function q() {
73
+ if (!P.value) return;
74
+ const n = f.value.length;
75
+ f.value.push(null), _.value.push(null), E(n);
76
+ }
77
+ async function G() {
78
+ g.value !== null && (f.value[g.value] = j.value, _.value[g.value] = L.value, await $(), w.value = !1);
79
+ }
80
+ async function H(n, t) {
81
+ var a, p;
82
+ n.stopPropagation(), await ie.remove(
83
+ o("connect.setting.advertisement.deleteConfirm"),
84
+ o("connect.setting.advertisement.delete"),
85
+ o("connect.setting.advertisement.delete")
86
+ ) && ((p = (a = c.value) == null ? void 0 : a.advertisements) == null || p.splice(t, 1), f.value.splice(t, 1), _.value.splice(t, 1), await $());
87
+ }
88
+ function X() {
89
+ U.push({ name: ue["$connect-SETTING"] });
90
+ }
91
+ return K(async () => {
92
+ await Q(async () => {
93
+ var n, t;
94
+ await M.readPremium(), await M.readLocations(), await F.readMembership(), c.value = F.membership, (t = (n = c.value) == null ? void 0 : n.advertisements) != null && t.length ? (f.value = c.value.advertisements.map(() => null), _.value = c.value.advertisements.map(
95
+ (a) => typeof a == "string" ? null : a.targetLocation || null
96
+ )) : (f.value = [], _.value = []);
97
+ });
98
+ }), (n, t) => {
99
+ var i;
100
+ const a = A("FmButton"), p = A("FmPill"), S = A("FmCard"), m = A("FmIcon"), h = A("FmSideSheet");
101
+ return u(), b("div", pe, [
102
+ s("div", fe, [
103
+ s("div", ge, [
104
+ s("div", _e, [
105
+ d(a, {
106
+ icon: "arrow_back",
107
+ variant: "tertiary",
108
+ onClick: X
109
+ }),
110
+ s("div", null, [
111
+ s("div", he, [
112
+ W(v(e(o)("connect.setting.advertisement.title")) + " ", 1),
113
+ d(p, { variant: "premium" })
114
+ ]),
115
+ s("div", ye, v(e(o)("connect.setting.advertisement.subtitle")), 1)
116
+ ])
117
+ ]),
118
+ d(a, {
119
+ label: e(o)("connect.setting.advertisement.saveChanges"),
120
+ onClick: $,
121
+ disabled: !!e(C).loadingQueue.length,
122
+ loading: !!e(C).loadingQueue.length
123
+ }, null, 8, ["label", "disabled", "loading"])
124
+ ])
125
+ ]),
126
+ e(c) ? (u(), b("div", be, [
127
+ s("div", we, [
128
+ d(S, {
129
+ variant: "outlined",
130
+ class: "px-16 py-12 flex items-center gap-8"
131
+ }, {
132
+ default: k(() => [
133
+ s("span", xe, v(e(o)("connect.setting.advertisement.activeAds")), 1),
134
+ s("span", Se, v(e(V)) + " / " + v(I), 1)
135
+ ]),
136
+ _: 1
137
+ })
138
+ ]),
139
+ e(M).isPremium ? (u(), b("div", Ce, [
140
+ (u(!0), b(Y, null, Z(((i = e(c).advertisements) == null ? void 0 : i.length) || 0, (l, r) => (u(), B(S, {
141
+ key: r,
142
+ variant: "outlined",
143
+ class: "cursor-pointer hover:shadow-lg transition-shadow overflow-hidden relative",
144
+ onClick: (T) => E(r)
145
+ }, {
146
+ default: k(() => [
147
+ s("div", Fe, [
148
+ d(a, {
149
+ icon: "delete",
150
+ variant: "tertiary",
151
+ size: "sm",
152
+ class: "bg-white/90 hover:bg-white shadow-sm",
153
+ onClick: (T) => H(T, r)
154
+ }, null, 8, ["onClick"])
155
+ ]),
156
+ s("div", je, [
157
+ x(r) && O(x(r)) ? (u(), b("video", {
158
+ key: 0,
159
+ src: x(r),
160
+ class: "w-full h-full object-cover",
161
+ muted: "",
162
+ loop: "",
163
+ autoplay: "",
164
+ playsinline: ""
165
+ }, null, 8, Le)) : x(r) ? (u(), b("img", {
166
+ key: 1,
167
+ src: x(r),
168
+ class: "w-full h-full object-cover",
169
+ alt: `Ad ${r + 1}`
170
+ }, null, 8, Me)) : (u(), b("div", Ve, [
171
+ d(m, {
172
+ name: "image",
173
+ size: "48"
174
+ })
175
+ ]))
176
+ ])
177
+ ]),
178
+ _: 2
179
+ }, 1032, ["onClick"]))), 128)),
180
+ e(P) ? (u(), B(S, {
181
+ key: 0,
182
+ variant: "outlined",
183
+ class: "cursor-pointer hover:bg-fm-color-neutral-gray-50 transition-colors border-dashed aspect-[3/4] flex flex-col items-center justify-center",
184
+ onClick: q
185
+ }, {
186
+ default: k(() => [
187
+ s("div", $e, [
188
+ d(m, {
189
+ name: "add",
190
+ size: "24",
191
+ class: "text-fm-color-typo-secondary"
192
+ })
193
+ ]),
194
+ s("div", Be, v(e(o)("connect.setting.advertisement.addAd")), 1),
195
+ s("div", Ie, v(I - e(V)) + " " + v(e(o)("connect.setting.advertisement.left")), 1)
196
+ ]),
197
+ _: 1
198
+ })) : N("", !0)
199
+ ])) : (u(), B(S, {
200
+ key: 0,
201
+ variant: "outlined",
202
+ class: "p-24 text-center mb-24 bg-fm-color-warning-50"
203
+ }, {
204
+ default: k(() => [
205
+ s("div", ke, v(e(o)("connect.setting.advertisement.premiumFeatureTitle")), 1),
206
+ s("div", Ae, v(e(o)("connect.setting.advertisement.premiumFeatureDescription")), 1)
207
+ ]),
208
+ _: 1
209
+ }))
210
+ ])) : N("", !0),
211
+ d(h, {
212
+ modelValue: e(w),
213
+ "onUpdate:modelValue": [
214
+ t[2] || (t[2] = (l) => ee(w) ? w.value = l : null),
215
+ t[3] || (t[3] = (l) => w.value = l)
216
+ ],
217
+ "max-width": 560,
218
+ header: e(g) !== null ? `${e(o)("connect.setting.advertisement.manageAd")} #${e(g) + 1}` : e(o)("connect.setting.advertisement.addAdvertisement")
219
+ }, {
220
+ "side-sheet-footer": k(() => [
221
+ s("div", ze, [
222
+ d(a, {
223
+ label: e(o)("connect.setting.advertisement.save"),
224
+ onClick: G,
225
+ loading: !!e(C).loadingQueue.length,
226
+ disabled: !!e(C).loadingQueue.length
227
+ }, null, 8, ["label", "loading", "disabled"])
228
+ ])
229
+ ]),
230
+ default: k(() => [
231
+ s("div", Pe, [
232
+ s("div", Ee, [
233
+ s("div", Te, [
234
+ d(le, {
235
+ label: e(o)("connect.setting.advertisement.advertisementImage"),
236
+ "image-fit": "cover",
237
+ "aspect-ratio": "4/5",
238
+ thumbnail: e(g) !== null ? x(e(g)) : void 0,
239
+ accept: ".png, .jpg, .jpeg, .mp4, .gif",
240
+ "recommended-size": "1080px x 1350px (4:5)",
241
+ file: e(j) ?? void 0,
242
+ "onUpdate:file": t[0] || (t[0] = (l) => j.value = l)
243
+ }, null, 8, ["label", "thumbnail", "file"])
244
+ ])
245
+ ]),
246
+ s("div", null, [
247
+ d(re, {
248
+ label: e(o)("connect.setting.advertisement.targetLocations"),
249
+ "helper-text": e(o)("connect.setting.advertisement.targetLocationsHelper"),
250
+ "model-value": e(L) ?? null,
251
+ "onUpdate:modelValue": t[1] || (t[1] = (l) => L.value = l)
252
+ }, null, 8, ["label", "helper-text", "model-value"])
253
+ ])
254
+ ])
255
+ ]),
256
+ _: 1
257
+ }, 8, ["modelValue", "header"])
258
+ ]);
259
+ };
260
+ }
261
+ });
262
+ export {
263
+ nt as default
264
+ };
@@ -0,0 +1,179 @@
1
+ import { defineComponent as N, useSlots as U, openBlock as r, createElementBlock as l, createElementVNode as s, normalizeClass as $, unref as e, toDisplayString as y, createCommentVNode as m, Fragment as b, createBlock as E, createVNode as w, renderSlot as T, ref as x, computed as B, onMounted as G, withCtx as O, renderList as C, createStaticVNode as z } from "vue";
2
+ import { u as A } from "./loading-NY-FPxVY.js";
3
+ import { u as M } from "./business-CE_4siXc.js";
4
+ import { components as f, useSnackbar as W } from "@feedmepos/ui-library";
5
+ import { u as R } from "./vue-i18n-BYz7XAr_.js";
6
+ import { g as j } from "./google-C3S8u0mT.js";
7
+ import { R as D } from "./app-CE5hQ4Uq.js";
8
+ import { useRouter as H } from "vue-router";
9
+ import { r as h } from "./index-BIyKgw4m.js";
10
+ const P = { class: "rounded-lg border border-fm-color-neutral-gray-200 bg-white overflow-hidden" }, q = ["src"], J = { class: "flex flex-col flex-1 gap-1 min-w-0" }, K = { class: "fm-typo-en-body-md-600 capitalize" }, Q = {
11
+ key: 0,
12
+ class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400 truncate"
13
+ }, X = { class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400" }, Y = /* @__PURE__ */ N({
14
+ __name: "ReviewSource",
15
+ props: {
16
+ icon: {},
17
+ name: {},
18
+ connected: { type: Boolean },
19
+ subtitle: {},
20
+ syncing: { type: Boolean },
21
+ tokenExpired: { type: Boolean }
22
+ },
23
+ emits: ["connect", "sync"],
24
+ setup(o, { emit: p }) {
25
+ const u = p, { t: i } = R(), g = U();
26
+ return (c, a) => (r(), l("div", P, [
27
+ s("div", {
28
+ class: $(["flex items-center gap-12 p-16", e(g).default ? "border-b border-fm-color-neutral-gray-100" : ""])
29
+ }, [
30
+ s("img", {
31
+ src: o.icon,
32
+ class: "w-10 h-10 shrink-0"
33
+ }, null, 8, q),
34
+ s("div", J, [
35
+ s("span", K, y(o.name), 1),
36
+ o.subtitle || !o.connected ? (r(), l("span", Q, y(o.connected ? o.subtitle : e(i)("connect.review.notConnected")), 1)) : m("", !0)
37
+ ]),
38
+ o.connected ? (r(), l(b, { key: 0 }, [
39
+ o.tokenExpired ? (r(), E(e(f).FmChip, {
40
+ key: 0,
41
+ label: e(i)("connect.review.expired"),
42
+ variant: "critical"
43
+ }, null, 8, ["label"])) : m("", !0),
44
+ w(e(f).FmButton, {
45
+ variant: "secondary",
46
+ "prepend-icon": "refresh",
47
+ label: e(i)("connect.review.reconnect"),
48
+ onClick: a[0] || (a[0] = (v) => u("connect"))
49
+ }, null, 8, ["label"]),
50
+ o.tokenExpired ? m("", !0) : (r(), E(e(f).FmButton, {
51
+ key: 1,
52
+ variant: "primary",
53
+ "prepend-icon": "sync",
54
+ label: e(i)("connect.review.sync"),
55
+ loading: o.syncing,
56
+ onClick: a[1] || (a[1] = (v) => u("sync"))
57
+ }, null, 8, ["label", "loading"]))
58
+ ], 64)) : m("", !0)
59
+ ], 2),
60
+ o.connected ? m("", !0) : (r(), l("div", {
61
+ key: 0,
62
+ class: $(["flex items-center justify-between gap-12 p-16", e(g).default ? "border-b border-fm-color-neutral-gray-100" : ""])
63
+ }, [
64
+ s("span", X, y(e(i)("connect.review.connectHint", { name: o.name })), 1),
65
+ w(e(f).FmButton, {
66
+ "prepend-icon": "add",
67
+ label: e(i)("connect.review.connect"),
68
+ onClick: a[2] || (a[2] = (v) => u("connect"))
69
+ }, null, 8, ["label"])
70
+ ], 2)),
71
+ T(c.$slots, "default")
72
+ ]));
73
+ }
74
+ }), Z = { class: "p-24 flex flex-col gap-8" }, ee = { class: "flex flex-col flex-1 min-w-0" }, ne = { class: "fm-typo-en-body-lg-600 truncate" }, oe = { class: "fm-typo-en-body-sm-400 text-fm-color-neutral-gray-400 truncate" }, me = /* @__PURE__ */ N({
75
+ __name: "Settings",
76
+ setup(o) {
77
+ const { t: p } = R(), u = W(), i = H(), g = M(), c = x(null), a = x(!1);
78
+ x(!1);
79
+ const v = B(
80
+ () => {
81
+ var n;
82
+ return c.value ? ((n = c.value.google) == null ? void 0 : n.accessToken) === null : !1;
83
+ }
84
+ );
85
+ B(
86
+ () => {
87
+ var n;
88
+ return c.value ? ((n = c.value.facebook) == null ? void 0 : n.token) === null : !1;
89
+ }
90
+ );
91
+ function _(n) {
92
+ const t = window.location.pathname.replace(/\/review(?:\/.*)?$/, "");
93
+ return `${window.location.origin}${t}${n}`;
94
+ }
95
+ async function S() {
96
+ await A.minor(async () => {
97
+ c.value = await h.getSource();
98
+ });
99
+ }
100
+ function V(n) {
101
+ var t;
102
+ return (t = g.locations.find(
103
+ (d) => d._id.toString() === n
104
+ )) == null ? void 0 : t.name;
105
+ }
106
+ function F() {
107
+ u.open({
108
+ message: p("connect.review.syncSuccess"),
109
+ type: "success"
110
+ }), i.push({ name: D["$connect-REVIEW_OVERVIEW"] });
111
+ }
112
+ async function I() {
113
+ var n, t;
114
+ a.value = !0;
115
+ try {
116
+ await h.syncGoogleReviews(), F();
117
+ } catch (d) {
118
+ if (await S(), ((t = (n = c.value) == null ? void 0 : n.google) == null ? void 0 : t.accessToken) === null) {
119
+ u.open({
120
+ message: p("connect.review.tokenExpired"),
121
+ type: "error"
122
+ });
123
+ return;
124
+ }
125
+ throw d;
126
+ } finally {
127
+ a.value = !1;
128
+ }
129
+ }
130
+ async function L() {
131
+ const n = _("/review/google/callback"), { callbackUrl: t } = await h.getOauthUrl("google", n);
132
+ window.location.href = t;
133
+ }
134
+ return G(() => {
135
+ S(), g.readLocations();
136
+ }), (n, t) => (r(), l("div", Z, [
137
+ e(c) ? (r(), l(b, { key: 0 }, [
138
+ w(Y, {
139
+ icon: e(j),
140
+ name: "google",
141
+ connected: !!e(c).google,
142
+ syncing: e(a),
143
+ "token-expired": e(v),
144
+ onConnect: L,
145
+ onSync: I
146
+ }, {
147
+ default: O(() => {
148
+ var d;
149
+ return [
150
+ (r(!0), l(b, null, C((d = e(c).google) == null ? void 0 : d.locations, (k) => (r(), l("div", {
151
+ key: k.googleLocationName,
152
+ class: "flex items-center gap-12 px-16 py-12 border-b border-fm-color-neutral-gray-100 last:border-b-0"
153
+ }, [
154
+ w(e(f).FmIcon, {
155
+ name: "location_on",
156
+ class: "text-fm-color-neutral-gray-300 shrink-0"
157
+ }),
158
+ s("div", ee, [
159
+ s("span", ne, y(k.displayName), 1),
160
+ s("span", oe, y(V(k.locationId)), 1)
161
+ ])
162
+ ]))), 128))
163
+ ];
164
+ }),
165
+ _: 1
166
+ }, 8, ["icon", "connected", "syncing", "token-expired"]),
167
+ m("", !0)
168
+ ], 64)) : (r(), l(b, { key: 1 }, C(["google", "facebook"], (d) => s("div", {
169
+ key: d,
170
+ class: "rounded-lg border border-fm-color-neutral-gray-200 bg-white p-16"
171
+ }, [...t[0] || (t[0] = [
172
+ z('<div class="animate-pulse flex items-center gap-12"><div class="w-10 h-10 rounded-full bg-fm-color-neutral-gray-100 shrink-0"></div><div class="flex-1 min-w-0 space-y-8"><div class="h-16 w-20 rounded bg-fm-color-neutral-gray-100"></div><div class="h-12 w-full max-w-[160px] rounded bg-fm-color-neutral-gray-100"></div></div><div class="h-32 w-24 rounded bg-fm-color-neutral-gray-100 shrink-0"></div></div>', 1)
173
+ ])])), 64))
174
+ ]));
175
+ }
176
+ });
177
+ export {
178
+ me as default
179
+ };