@feedmepos/mf-connect 0.1.114-dev → 0.1.115-dev
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.
- package/dist/{App-CIWTDYuZ.js → App-43mZfFAr.js} +11 -11
- package/dist/{AuditLogs-BluLDXu9.js → AuditLogs-BPpdm96t.js} +13 -13
- package/dist/{Bin-jS6pM4L3.js → Bin-CA7v180Y.js} +8 -8
- package/dist/{Broadcast-DBqsSZ0S.js → Broadcast-qmdifF2Y.js} +12 -12
- package/dist/{CampaignAnalytic-DJrjXD4H.js → CampaignAnalytic-xnrDxqaH.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CzwigRLi.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-zjk-QdtX.js} +9 -9
- package/dist/{Card-B10nLilL.js → Card-D8icsk7L.js} +23 -23
- package/dist/{Collections-BN42A73p.js → Collections--THcD-E_.js} +8 -8
- package/dist/{Credit-0SS26HGE.js → Credit-JrbtVMBp.js} +12 -12
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-B3wozBFs.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DrwKtnE5.js} +1 -1
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BRd5RVYe.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-DgdAlHU7.js} +36 -36
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-zV9dLCWp.js → EffectSheet.vue_vue_type_style_index_0_lang-hVgqWdD0.js} +6 -6
- package/dist/{Experience-D7qPzsrc.js → Experience-CFeRqBoj.js} +13 -13
- package/dist/{FileSaver.min-BKWoklMK.js → FileSaver.min-CCXIBm58.js} +1 -1
- package/dist/{Game-BoYMwfog.js → Game-CPxq6Ex3.js} +13 -13
- package/dist/{GiftCardSetup-B87O0xzo.js → GiftCardSetup-D0esVZDp.js} +10 -10
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-B3uGbEFY.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-CJ1-vL-K.js} +7 -7
- package/dist/{Goals-CVxf3xCA.js → Goals-DaKI6uXt.js} +4 -4
- package/dist/{Grab-mGL1Mue_.js → Grab-BWzdN_cd.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-HipBZ1_T.js → ImageInput.vue_vue_type_script_setup_true_lang-BOnL0GxM.js} +1 -1
- package/dist/{Index-Dptuy-6c.js → Index-2kENoaZm.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Cjc4UeKz.js → LocationPicker.vue_vue_type_script_setup_true_lang-BtWnJKU_.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-Bh0ari3f.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CX_Sspu5.js} +1 -1
- package/dist/{LoyaltyDashboard-BxhI6RAE.js → LoyaltyDashboard-CB93Fz8u.js} +15 -15
- package/dist/{MainLayout-YfDxvZXl.js → MainLayout-DwnjGXh6.js} +1 -1
- package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-BgXpznbi.js → MainLayout.vue_vue_type_script_setup_true_lang-Du8fw5v_.js} +3 -3
- package/dist/Marketing-DCco__2F.js +273 -0
- package/dist/{MarketingMaterialEdit-DkOEy_L-.js → MarketingMaterialEdit-BbgFtrYP.js} +6 -6
- package/dist/{Member-DufbKDOh.js → Member-B--nYyr0.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-CU8EmBxy.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-BBlzO7Db.js} +24 -24
- package/dist/{MemberImportHistory-DlFN-uQl.js → MemberImportHistory-D52Y4RTC.js} +7 -7
- package/dist/{MemberList-B344n8I4.js → MemberList-13Owa1fj.js} +14 -14
- package/dist/{MemberTransactions-BS7H640M.js → MemberTransactions-CpXEWNbq.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CxDtXvwd.js → MessageInput.vue_vue_type_script_setup_true_lang-DlELjFM0.js} +10 -10
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-lY0jlyOG.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-C_y0rM8c.js} +1 -1
- package/dist/{Mission-D2ed_oKn.js → Mission-Ci-UzXSu.js} +14 -14
- package/dist/{Overview-CLh_T6YY.js → Overview-CKxSfAGF.js} +4 -4
- package/dist/{Overview-DJa-hXDC.js → Overview-CXen9Ram.js} +21 -21
- package/dist/{Point-DAPeg1VD.js → Point-CR3YOaag.js} +14 -14
- package/dist/{Promotion-CPPCMMFl.js → Promotion-tw3J4ul-.js} +14 -14
- package/dist/{Queue-BcPwCRcM.js → Queue-BZGA5ZXt.js} +13 -13
- package/dist/{Record-C5XKn--g.js → Record-BTevVXnT.js} +9 -9
- package/dist/{Review-Cc51luIv.js → Review-BU7c8ZF0.js} +2 -2
- package/dist/{ReviewFacebookCallback-BSGInFB8.js → ReviewFacebookCallback-BnMF6Arh.js} +5 -5
- package/dist/{ReviewGoogleCallback-C1gY4vcP.js → ReviewGoogleCallback-xpdPHSdg.js} +5 -5
- package/dist/{Reward-k1R3hLiF.js → Reward-jlA_7cxz.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BGbbGVK4.js → RewardGroup.vue_vue_type_script_setup_true_lang-D3z_n42G.js} +14 -14
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Coh3L11L.js → RuleGroup.vue_vue_type_script_setup_true_lang-CsHxqH9h.js} +15 -15
- package/dist/{Segment-DsBnIvje.js → Segment-C1Bwm--Q.js} +26 -26
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CMKpvXN-.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-B6apgWTM.js} +15 -15
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-LyAtRMs8.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-B7m2F9UV.js} +4 -4
- package/dist/{Setting-BRueNgc4.js → Setting-CDM4RhLW.js} +14 -14
- package/dist/{SettingAdvertisements-BrVcQyhF.js → SettingAdvertisements-4XEAJzlL.js} +12 -12
- package/dist/{Settings-fOvXd29Z.js → Settings-D-0tvZRr.js} +5 -5
- package/dist/{Store-rrh2pIHH.js → Store-C56dXtc4.js} +27 -27
- package/dist/{StoreRewards-D-jivVKr.js → StoreRewards-DQ1Q6WS6.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CvQXsZbH.js → StoreTransactions.vue_vue_type_script_setup_true_lang-LLD91Rz6.js} +25 -25
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DbnY9VE9.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Bvy4NJMd.js} +2 -2
- package/dist/{Tier-DJiLtw3M.js → Tier-D4CPZqw7.js} +27 -27
- package/dist/{Title-s0bzA7yZ.js → Title-DCbwhUic.js} +23 -23
- package/dist/{Transaction-CQ-CJ_eh.js → Transaction-C5LrasXr.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Bfy8SZH1.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Cl9b4mrK.js} +6 -6
- package/dist/{Voucher-9vydRET7.js → Voucher-rrVbNZKR.js} +18 -18
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Dq7veRL5.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BIq227nz.js} +12 -12
- package/dist/{WhatsappAccount-D12Hvzfl.js → WhatsappAccount-oJDo5zTr.js} +6 -6
- package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BrZEDi6O.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-aCQCYFYq.js} +1 -1
- package/dist/WhatsappBot-Cl64wG_F.js +876 -0
- package/dist/{WhatsappBotLogs-CK_V_iT5.js → WhatsappBotLogs-D3uT4EiB.js} +64 -64
- package/dist/WhatsappBotSettings-Cs1lLxh-.js +705 -0
- package/dist/{WhatsappLayout-bOyNHGUI.js → WhatsappLayout-C639d2HP.js} +3 -3
- package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-Cytrffdh.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DpPxWp2x.js} +3 -3
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-96t_eUzk.js → ZodTextField.vue_vue_type_script_setup_true_lang-C39_95SZ.js} +2 -2
- package/dist/{app-DV3e2LkD.js → app-CgimGODl.js} +214 -214
- package/dist/app.js +1 -1
- package/dist/{base.export-DQUUtGmy.js → base.export-D2P6HFvo.js} +2 -2
- package/dist/{business-BZ0boE-5.js → business-Bu5TqSA0.js} +1 -1
- package/dist/{campaign-CsfFq2S-.js → campaign-BFIXSgdJ.js} +8 -8
- package/dist/{campaign-DMrtYWcs.js → campaign-zJxttSIk.js} +2 -2
- package/dist/{campaign.fn-C-CdNNdR.js → campaign.fn-gvjlcEfe.js} +20 -20
- package/dist/{collection.fn-C-rryKSc.js → collection.fn-DOm0HsSh.js} +2 -2
- package/dist/{currency-BOd9iVZV.js → currency-BpbQvbm8.js} +1 -1
- package/dist/{duplicateCampaign-ey_rW0Bz.js → duplicateCampaign-CvsvjRE9.js} +2 -2
- package/dist/{effect-BP6Hkxmj.js → effect-D-GtNB3n.js} +1 -1
- package/dist/{email-addresses-CO61QAq0.js → email-addresses-BKMoAtMi.js} +2 -2
- package/dist/{feature-flag-Bq1SgbYC.js → feature-flag-BJ_eyKsq.js} +1 -1
- package/dist/{feature-flag-lvPP0ED-.js → feature-flag-Bo-k5sIG.js} +1 -1
- package/dist/{helper-BRpts-M-.js → helper-CkfjBgMM.js} +1 -1
- package/dist/{index-CoROn5OA.js → index-B6kU3PkV.js} +2 -2
- package/dist/{index-B0RavybO.js → index-BAtUrtqM.js} +2 -2
- package/dist/{index-Bn19rfby.js → index-BKsxIwbi.js} +3 -3
- package/dist/{index-R5WS21OL.js → index-BdEXUNoG.js} +1 -1
- package/dist/{index-BV5aPSYo.js → index-Bhl5IRXy.js} +9 -9
- package/dist/{index-Cj-eugzc.js → index-BpTIulTX.js} +1 -1
- package/dist/{index-RwNlbTO8.js → index-C-iwb2Ln.js} +49 -55
- package/dist/{index-03WIXl-H.js → index-CCEXSPxk.js} +2 -2
- package/dist/{index-CsBjAM3E.js → index-CIej31pF.js} +1 -1
- package/dist/{index-DucKyzrD.js → index-CQ8XFbBk.js} +2 -2
- package/dist/{index-Bk20uvPY.js → index-CfQuYqXn.js} +1 -1
- package/dist/{index-D3wGTCWf.js → index-CuREApMc.js} +2 -2
- package/dist/{index-DIZLkVe0.js → index-D0JK99Ko.js} +9 -8
- package/dist/{index-_Cj-bsd_.js → index-DKxN1mMS.js} +4 -4
- package/dist/{index-ZRE89TKq.js → index-DQ8JJhxs.js} +15 -21
- package/dist/{index-D1t4_KaG.js → index-DUAZOMVJ.js} +1 -1
- package/dist/{index-D41kjcrZ.js → index-DqGs6RJG.js} +4 -4
- package/dist/{index-VYI0zWNC.js → index-DwU3fsLW.js} +2 -2
- package/dist/{index-CrBhcMaL.js → index-LygS9WsG.js} +3 -3
- package/dist/{index-BDNkoALK.js → index-feCrYhi6.js} +1 -1
- package/dist/{index-mToWKHVs.js → index-zTvr2GR4.js} +2 -2
- package/dist/{index.esm2017-B_Sag8Pg.js → index.esm2017-DZi9IQPS.js} +1 -1
- package/dist/{loading-C5fVI0ry.js → loading-Brid2wnu.js} +1 -1
- package/dist/{lodash-COo8_xCU.js → lodash-C1epw3Kv.js} +1 -1
- package/dist/{member-import-I_pKwUfF.js → member-import-DAIxTIiu.js} +1 -1
- package/dist/{membership-BgfH9Kva.js → membership-BZmljFhF.js} +2 -2
- package/dist/{money-Cr07YDlV.js → money-cLcyGcSZ.js} +1 -1
- package/dist/{number-DFsj0dkh.js → number-C2jPLJr2.js} +1 -1
- package/dist/{objectid-Cu89BzwI.js → objectid-C-wocWKI.js} +6 -6
- package/dist/{onboarding-DlkJCm-5.js → onboarding-oRfy_g05.js} +3 -3
- package/dist/{onboardingSetup-BEhVj613.js → onboardingSetup-BLD6m8HY.js} +2 -2
- package/dist/{plugins-CPTtiKqf.js → plugins-CUsr9vB0.js} +3 -3
- package/dist/{reward-DqY0mQ_5.js → reward-UOT03odb.js} +1 -1
- package/dist/{rule-mJJ48eKw.js → rule-BgJnPjkI.js} +10 -10
- package/dist/{template-C1QftpDG.js → template-BZyFhr73.js} +6 -6
- package/dist/{timezone-BBgBHels.js → timezone-BXA4wq7Y.js} +1 -1
- package/dist/{transaction.fn-Sr0hj3kY.js → transaction.fn-CQ4fpRt3.js} +2 -2
- package/dist/{trigger-PUP0mwKM.js → trigger-DXJCGT0q.js} +5 -5
- package/dist/useMarketingMaterialActions-B-Wib5ga.js +125 -0
- package/dist/{usePagination-Be6nIQ9y.js → usePagination-Pp4okWr8.js} +1 -1
- package/dist/{user-DBSYzG_9.js → user-B3gXcAIy.js} +1 -1
- package/dist/{vue-i18n-C6c2jsH3.js → vue-i18n-DWGiC_vs.js} +158 -158
- package/dist/{xlsx-Bfo19lFv.js → xlsx-CCaDUTgW.js} +1 -1
- package/dist/{zod-CihbDg3N.js → zod-CPwjOxvW.js} +1 -1
- package/package.json +1 -1
- package/dist/Marketing-C2cVJacf.js +0 -236
- package/dist/WhatsappBot-o5b_0CnB.js +0 -629
- package/dist/WhatsappBotSettings-BooibLUg.js +0 -694
- package/dist/useMarketingMaterialActions-faslwaHd.js +0 -96
|
@@ -1,629 +0,0 @@
|
|
|
1
|
-
import { defineComponent as Q, ref as b, computed as j, watch as Z, onBeforeUnmount as Y, resolveComponent as B, openBlock as n, createElementBlock as u, createElementVNode as o, normalizeClass as O, unref as t, toDisplayString as s, createBlock as k, withCtx as C, createTextVNode as z, createVNode as T, createCommentVNode as D, Fragment as J, renderList as q, useModel as ee } from "vue";
|
|
2
|
-
import { u as K } from "./vue-i18n-C6c2jsH3.js";
|
|
3
|
-
import { useRouter as te } from "vue-router";
|
|
4
|
-
import { useCoreStore as oe } from "@feedmepos/mf-common";
|
|
5
|
-
import { S as N, a as ne } from "./index-03WIXl-H.js";
|
|
6
|
-
import { w as G } from "./index-ZRE89TKq.js";
|
|
7
|
-
import { u as ae, _ as se, w as le } from "./WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-Cytrffdh.js";
|
|
8
|
-
import { R as M } from "./app-DV3e2LkD.js";
|
|
9
|
-
import { _ as re } from "./WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BrZEDi6O.js";
|
|
10
|
-
import { b as ce } from "./browser-BSAOEeIM.js";
|
|
11
|
-
const ie = { class: "min-w-0" }, ue = { class: "flex items-center gap-[12px]" }, pe = ["src"], de = { key: 1 }, me = { class: "min-w-0 flex-1" }, fe = ["title"], xe = { key: 1 }, ve = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary break-all" }, he = { class: "relative z-10 shrink-0" }, _e = ["aria-label", "title", "aria-expanded", "disabled", "aria-busy"], ge = { class: "text-[14px] text-fm-color-typo-error" }, ye = { class: "flex items-center justify-between flex-wrap gap-[8px] border-t border-fm-color-neutral-gray-100 pt-[12px]" }, be = {
|
|
12
|
-
key: 0,
|
|
13
|
-
class: "text-[12px] text-fm-color-typo-tertiary"
|
|
14
|
-
}, we = {
|
|
15
|
-
key: 0,
|
|
16
|
-
role: "alert",
|
|
17
|
-
class: "text-[14px] text-fm-color-typo-error"
|
|
18
|
-
}, ke = /* @__PURE__ */ Q({
|
|
19
|
-
__name: "WhatsappAccountCard",
|
|
20
|
-
props: {
|
|
21
|
-
account: {}
|
|
22
|
-
},
|
|
23
|
-
emits: ["removed"],
|
|
24
|
-
setup(E, { emit: i }) {
|
|
25
|
-
const l = E, w = i, { t: _, locale: d } = K(), r = b(!1), x = b(""), y = b(!1), A = b(!1);
|
|
26
|
-
let g;
|
|
27
|
-
const {
|
|
28
|
-
name: $,
|
|
29
|
-
phoneNumber: V,
|
|
30
|
-
initials: P,
|
|
31
|
-
state: v,
|
|
32
|
-
avatarColor: p,
|
|
33
|
-
profilePictureUrl: h,
|
|
34
|
-
profilePictureFailed: c
|
|
35
|
-
} = ae(() => l.account), I = j(() => v.value === "connected"), R = j(() => ({
|
|
36
|
-
name: M["$connect-WHATSAPP_ACCOUNT"],
|
|
37
|
-
params: { clientId: l.account.clientId }
|
|
38
|
-
}));
|
|
39
|
-
function S(a) {
|
|
40
|
-
return new Intl.DateTimeFormat(d.value, {
|
|
41
|
-
year: "numeric",
|
|
42
|
-
month: "short",
|
|
43
|
-
day: "numeric"
|
|
44
|
-
}).format(new Date(a));
|
|
45
|
-
}
|
|
46
|
-
async function W() {
|
|
47
|
-
if (r.value) return;
|
|
48
|
-
const a = N.getBusinessId();
|
|
49
|
-
if (!a) {
|
|
50
|
-
x.value = _("connect.whatsappBot.errors.selectBusiness");
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const e = l.account.clientId, m = new AbortController();
|
|
54
|
-
g = m, r.value = !0, x.value = "";
|
|
55
|
-
try {
|
|
56
|
-
await G.deleteClient(a, e, m.signal), m.signal.aborted || w("removed", e);
|
|
57
|
-
} catch {
|
|
58
|
-
m.signal.aborted || (x.value = _("connect.whatsappBot.errors.removeAccount"));
|
|
59
|
-
} finally {
|
|
60
|
-
g === m && (g = void 0, r.value = !1);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
function F() {
|
|
64
|
-
g == null || g.abort(), g = void 0, r.value = !1, x.value = "";
|
|
65
|
-
}
|
|
66
|
-
return Z(
|
|
67
|
-
() => N.getBusinessId(),
|
|
68
|
-
() => {
|
|
69
|
-
F(), A.value = !1;
|
|
70
|
-
}
|
|
71
|
-
), Y(F), (a, e) => {
|
|
72
|
-
const m = B("RouterLink"), L = B("FmCircularProgress"), U = B("FmIcon"), H = B("FmMenuItem"), X = B("FmMenu");
|
|
73
|
-
return n(), u("li", ie, [
|
|
74
|
-
o("div", {
|
|
75
|
-
class: O(["relative h-full border border-fm-color-neutral-gray-100 rounded-[16px] p-[20px] flex flex-col gap-[16px] bg-fm-color-neutral-white text-fm-color-typo-primary", {
|
|
76
|
-
"cursor-pointer transition-shadow hover:border-fm-color-neutral-gray-200 hover:fm-shadow-light-100": I.value
|
|
77
|
-
}])
|
|
78
|
-
}, [
|
|
79
|
-
o("div", ue, [
|
|
80
|
-
o("div", {
|
|
81
|
-
"aria-hidden": "true",
|
|
82
|
-
class: O(["w-[48px] h-[48px] rounded-full overflow-hidden shrink-0 flex items-center justify-center text-[16px] font-semibold text-fm-color-typo-white", t(p)])
|
|
83
|
-
}, [
|
|
84
|
-
t(h) && !t(c) ? (n(), u("img", {
|
|
85
|
-
key: 0,
|
|
86
|
-
src: t(h),
|
|
87
|
-
alt: "",
|
|
88
|
-
class: "w-full h-full object-cover",
|
|
89
|
-
referrerpolicy: "no-referrer",
|
|
90
|
-
onError: e[0] || (e[0] = (f) => c.value = !0)
|
|
91
|
-
}, null, 40, pe)) : (n(), u("span", de, s(t(P)), 1))
|
|
92
|
-
], 2),
|
|
93
|
-
o("div", me, [
|
|
94
|
-
o("h2", {
|
|
95
|
-
class: "text-[16px] leading-[24px] font-semibold truncate",
|
|
96
|
-
title: t($)
|
|
97
|
-
}, [
|
|
98
|
-
I.value ? (n(), k(m, {
|
|
99
|
-
key: 0,
|
|
100
|
-
to: R.value,
|
|
101
|
-
class: "text-inherit no-underline after:absolute after:inset-0 after:rounded-[16px] focus-visible:outline-none focus-visible:after:ring-[2px] focus-visible:after:ring-fm-color-primary focus-visible:after:ring-offset-[2px]"
|
|
102
|
-
}, {
|
|
103
|
-
default: C(() => [
|
|
104
|
-
z(s(t($)), 1)
|
|
105
|
-
]),
|
|
106
|
-
_: 1
|
|
107
|
-
}, 8, ["to"])) : (n(), u("span", xe, s(t($)), 1))
|
|
108
|
-
], 8, fe),
|
|
109
|
-
o("p", ve, s(t(V)), 1)
|
|
110
|
-
]),
|
|
111
|
-
o("div", he, [
|
|
112
|
-
T(X, {
|
|
113
|
-
placement: "bottom-end",
|
|
114
|
-
width: 220,
|
|
115
|
-
disabled: r.value,
|
|
116
|
-
"stop-click-propagation": "",
|
|
117
|
-
onMenuChanged: e[3] || (e[3] = (f) => y.value = f)
|
|
118
|
-
}, {
|
|
119
|
-
"menu-button": C(() => [
|
|
120
|
-
o("button", {
|
|
121
|
-
type: "button",
|
|
122
|
-
"aria-label": t(_)("connect.whatsappBot.moreActions"),
|
|
123
|
-
title: t(_)("connect.whatsappBot.moreActions"),
|
|
124
|
-
"aria-haspopup": "menu",
|
|
125
|
-
"aria-expanded": y.value,
|
|
126
|
-
disabled: r.value,
|
|
127
|
-
"aria-busy": r.value,
|
|
128
|
-
class: O(["w-[32px] h-[32px] flex items-center justify-center rounded-[8px] text-fm-color-typo-tertiary transition-colors hover:bg-fm-color-neutral-gray-100 hover:text-fm-color-typo-primary focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-fm-color-primary disabled:cursor-wait disabled:opacity-50", { "bg-fm-color-neutral-gray-100": y.value }])
|
|
129
|
-
}, [
|
|
130
|
-
r.value ? (n(), k(L, {
|
|
131
|
-
key: 0,
|
|
132
|
-
size: "md",
|
|
133
|
-
"aria-hidden": "true"
|
|
134
|
-
})) : (n(), k(U, {
|
|
135
|
-
key: 1,
|
|
136
|
-
name: "more_vert",
|
|
137
|
-
size: "sm",
|
|
138
|
-
"aria-hidden": "true"
|
|
139
|
-
}))
|
|
140
|
-
], 10, _e)
|
|
141
|
-
]),
|
|
142
|
-
default: C(() => [
|
|
143
|
-
I.value ? (n(), k(H, {
|
|
144
|
-
key: 0,
|
|
145
|
-
label: t(_)("connect.whatsappBot.notificationGroup.title"),
|
|
146
|
-
disabled: r.value,
|
|
147
|
-
"onUpdate:modelValue": e[1] || (e[1] = (f) => A.value = !0)
|
|
148
|
-
}, {
|
|
149
|
-
prepend: C(() => [
|
|
150
|
-
T(U, {
|
|
151
|
-
name: "notifications",
|
|
152
|
-
size: "sm",
|
|
153
|
-
outline: "",
|
|
154
|
-
"aria-hidden": "true"
|
|
155
|
-
})
|
|
156
|
-
]),
|
|
157
|
-
_: 1
|
|
158
|
-
}, 8, ["label", "disabled"])) : D("", !0),
|
|
159
|
-
T(H, {
|
|
160
|
-
disabled: r.value,
|
|
161
|
-
"onUpdate:modelValue": e[2] || (e[2] = (f) => W())
|
|
162
|
-
}, {
|
|
163
|
-
prepend: C(() => [
|
|
164
|
-
T(U, {
|
|
165
|
-
name: "delete",
|
|
166
|
-
size: "sm",
|
|
167
|
-
outline: "",
|
|
168
|
-
class: "text-fm-color-typo-error",
|
|
169
|
-
"aria-hidden": "true"
|
|
170
|
-
})
|
|
171
|
-
]),
|
|
172
|
-
label: C(() => [
|
|
173
|
-
o("span", ge, s(t(_)("connect.common.delete")), 1)
|
|
174
|
-
]),
|
|
175
|
-
_: 1
|
|
176
|
-
}, 8, ["disabled"])
|
|
177
|
-
]),
|
|
178
|
-
_: 1
|
|
179
|
-
}, 8, ["disabled"])
|
|
180
|
-
])
|
|
181
|
-
]),
|
|
182
|
-
o("div", ye, [
|
|
183
|
-
T(re, { state: t(v) }, null, 8, ["state"]),
|
|
184
|
-
I.value && E.account.connectedAt ? (n(), u("span", be, s(t(_)("connect.whatsappBot.connectedSince", {
|
|
185
|
-
date: S(E.account.connectedAt)
|
|
186
|
-
})), 1)) : D("", !0)
|
|
187
|
-
]),
|
|
188
|
-
x.value ? (n(), u("p", we, s(x.value), 1)) : D("", !0)
|
|
189
|
-
], 2),
|
|
190
|
-
A.value ? (n(), k(se, {
|
|
191
|
-
key: 0,
|
|
192
|
-
modelValue: A.value,
|
|
193
|
-
"onUpdate:modelValue": e[4] || (e[4] = (f) => A.value = f),
|
|
194
|
-
account: E.account
|
|
195
|
-
}, null, 8, ["modelValue", "account"])) : D("", !0)
|
|
196
|
-
]);
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
}), Be = { class: "mt-[24px] grid grid-cols-[repeat(auto-fill,minmax(min(300px,100%),1fr))] gap-[16px]" }, $e = /* @__PURE__ */ Q({
|
|
200
|
-
__name: "WhatsappAccountList",
|
|
201
|
-
props: {
|
|
202
|
-
accounts: {}
|
|
203
|
-
},
|
|
204
|
-
emits: ["removed"],
|
|
205
|
-
setup(E, { emit: i }) {
|
|
206
|
-
const l = i;
|
|
207
|
-
return (w, _) => (n(), u("ul", Be, [
|
|
208
|
-
(n(!0), u(J, null, q(E.accounts, (d) => (n(), k(ke, {
|
|
209
|
-
key: d.clientId,
|
|
210
|
-
account: d,
|
|
211
|
-
onRemoved: _[0] || (_[0] = (r) => l("removed", r))
|
|
212
|
-
}, null, 8, ["account"]))), 128))
|
|
213
|
-
]));
|
|
214
|
-
}
|
|
215
|
-
}), Ae = { class: "text-[18px] font-semibold" }, Ce = {
|
|
216
|
-
key: 0,
|
|
217
|
-
role: "status",
|
|
218
|
-
class: "flex flex-col items-center text-center gap-[8px] px-[8px] py-[40px]"
|
|
219
|
-
}, Te = { class: "text-[18px] font-semibold" }, Pe = { class: "text-[14px] text-fm-color-typo-secondary break-all" }, Se = {
|
|
220
|
-
key: 1,
|
|
221
|
-
class: "grid grid-cols-[minmax(0,1fr)_232px] xs:grid-cols-1 gap-[32px] p-[8px] xs:p-[0px]"
|
|
222
|
-
}, Fe = { class: "flex flex-col gap-[20px] text-[14px] leading-[20px]" }, Ie = { class: "text-fm-color-typo-secondary" }, Ee = { class: "flex flex-col gap-[14px]" }, Ve = { class: "w-[22px] h-[22px] shrink-0 rounded-full bg-fm-color-neutral-gray-100 flex items-center justify-center text-[12px] font-semibold" }, De = { key: 0 }, Le = { class: "font-semibold" }, Me = { class: "font-semibold" }, We = { class: "font-semibold" }, je = { class: "font-semibold" }, Oe = { key: 3 }, Ne = { class: "text-[12px] leading-[16px] text-fm-color-typo-tertiary" }, Re = { class: "relative w-[232px] h-[232px] xs:justify-self-center border border-fm-color-neutral-gray-100 rounded-[12px] flex items-center justify-center overflow-hidden" }, Ue = {
|
|
223
|
-
key: 0,
|
|
224
|
-
role: "status",
|
|
225
|
-
class: "flex flex-col items-center gap-[12px] text-[13px]"
|
|
226
|
-
}, He = {
|
|
227
|
-
key: 1,
|
|
228
|
-
class: "flex flex-col items-center text-center gap-[12px] p-[12px]"
|
|
229
|
-
}, ze = {
|
|
230
|
-
role: "alert",
|
|
231
|
-
class: "text-[14px] text-fm-color-typo-error"
|
|
232
|
-
}, Ge = ["src", "alt"], Qe = {
|
|
233
|
-
key: 3,
|
|
234
|
-
role: "status",
|
|
235
|
-
"aria-live": "polite",
|
|
236
|
-
class: "absolute inset-0 bg-fm-color-neutral-white/90 flex flex-col items-center justify-center gap-[10px] text-[13px] font-medium"
|
|
237
|
-
}, Ze = /* @__PURE__ */ Q({
|
|
238
|
-
__name: "WhatsappConnectDialog",
|
|
239
|
-
props: {
|
|
240
|
-
modelValue: { type: Boolean, required: !0 },
|
|
241
|
-
modelModifiers: {}
|
|
242
|
-
},
|
|
243
|
-
emits: ["update:modelValue"],
|
|
244
|
-
setup(E) {
|
|
245
|
-
const i = ee(E, "modelValue"), { t: l } = K(), w = b(""), _ = b(!1), d = b(""), r = b(!1), x = b();
|
|
246
|
-
let y, A, g;
|
|
247
|
-
function $() {
|
|
248
|
-
y == null || y.abort(), clearTimeout(A), A = void 0, clearTimeout(g), g = void 0;
|
|
249
|
-
}
|
|
250
|
-
async function V(v, p, h) {
|
|
251
|
-
if (!h.aborted) {
|
|
252
|
-
try {
|
|
253
|
-
const c = await G.getClient(v, p, h);
|
|
254
|
-
if (h.aborted) return;
|
|
255
|
-
if (r.value = c.status === "connected" || c.status === "connecting" && c.connectedAt !== null, c.status === "connected" && c.connectedAt !== null && c.profileStatus === "ready") {
|
|
256
|
-
$(), r.value = !1, x.value = c, g = setTimeout(() => {
|
|
257
|
-
i.value = !1;
|
|
258
|
-
}, 1800);
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
if (c.status === "disconnected") {
|
|
262
|
-
$(), r.value = !1, w.value = "", d.value = l("connect.whatsappBot.errors.qrExpired");
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
} catch (c) {
|
|
266
|
-
if (h.aborted) return;
|
|
267
|
-
if (c instanceof ne && c.status === 409) {
|
|
268
|
-
$(), r.value = !1, w.value = "", d.value = l("connect.whatsappBot.errors.accountAlreadyLinked");
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
h.aborted || (A = setTimeout(() => {
|
|
273
|
-
V(v, p, h);
|
|
274
|
-
}, 2e3));
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
async function P() {
|
|
278
|
-
$();
|
|
279
|
-
const v = new AbortController();
|
|
280
|
-
y = v, w.value = "", d.value = "", r.value = !1, x.value = void 0, _.value = !0;
|
|
281
|
-
try {
|
|
282
|
-
const p = N.getBusinessId();
|
|
283
|
-
if (!p)
|
|
284
|
-
throw new Error(l("connect.whatsappBot.errors.selectBusiness"));
|
|
285
|
-
const h = await G.createClient(
|
|
286
|
-
p,
|
|
287
|
-
v.signal
|
|
288
|
-
), c = await ce.toDataURL(h.qr, {
|
|
289
|
-
width: 224,
|
|
290
|
-
margin: 2,
|
|
291
|
-
errorCorrectionLevel: "M"
|
|
292
|
-
});
|
|
293
|
-
v.signal.aborted || (w.value = c, V(p, h.clientId, v.signal));
|
|
294
|
-
} catch (p) {
|
|
295
|
-
v.signal.aborted || (d.value = p instanceof Error ? p.message : l("connect.whatsappBot.errors.loadQr"));
|
|
296
|
-
} finally {
|
|
297
|
-
v.signal.aborted || (_.value = !1);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
return Z(
|
|
301
|
-
i,
|
|
302
|
-
(v) => {
|
|
303
|
-
v ? P() : $();
|
|
304
|
-
},
|
|
305
|
-
{ immediate: !0 }
|
|
306
|
-
), Y($), (v, p) => {
|
|
307
|
-
const h = B("i18n-t"), c = B("FmCircularProgress"), I = B("FmButton"), R = B("FmDialog");
|
|
308
|
-
return n(), k(R, {
|
|
309
|
-
modelValue: i.value,
|
|
310
|
-
"onUpdate:modelValue": p[0] || (p[0] = (S) => i.value = S),
|
|
311
|
-
"min-width": "min(720px, calc(100% - 32px))",
|
|
312
|
-
"max-width": "720px",
|
|
313
|
-
"max-height": "90vh",
|
|
314
|
-
"dismiss-away": ""
|
|
315
|
-
}, {
|
|
316
|
-
"dialog-header": C(() => [
|
|
317
|
-
o("h2", Ae, s(t(l)("connect.whatsappBot.connectAccount")), 1)
|
|
318
|
-
]),
|
|
319
|
-
default: C(() => {
|
|
320
|
-
var S, W, F;
|
|
321
|
-
return [
|
|
322
|
-
x.value ? (n(), u("div", Ce, [
|
|
323
|
-
p[1] || (p[1] = o("div", {
|
|
324
|
-
"aria-hidden": "true",
|
|
325
|
-
class: "w-[64px] h-[64px] rounded-full bg-fm-color-system-success-100 text-fm-color-typo-success flex items-center justify-center mb-[8px]"
|
|
326
|
-
}, [
|
|
327
|
-
o("svg", {
|
|
328
|
-
width: "32",
|
|
329
|
-
height: "32",
|
|
330
|
-
viewBox: "0 0 24 24",
|
|
331
|
-
fill: "none",
|
|
332
|
-
stroke: "currentColor",
|
|
333
|
-
"stroke-width": "2.2",
|
|
334
|
-
"stroke-linecap": "round",
|
|
335
|
-
"stroke-linejoin": "round"
|
|
336
|
-
}, [
|
|
337
|
-
o("path", { d: "M20 6 9 17l-5-5" })
|
|
338
|
-
])
|
|
339
|
-
], -1)),
|
|
340
|
-
o("h3", Te, s(t(l)("connect.whatsappBot.accountConnected")), 1),
|
|
341
|
-
o("p", Pe, s(((S = x.value.account) == null ? void 0 : S.businessName) || ((W = x.value.account) == null ? void 0 : W.name) || t(l)("connect.whatsappBot.unnamedAccount")) + " · " + s(((F = x.value.account) == null ? void 0 : F.phoneNumber) || t(l)("connect.whatsappBot.phoneUnavailable")), 1)
|
|
342
|
-
])) : (n(), u("div", Se, [
|
|
343
|
-
o("div", Fe, [
|
|
344
|
-
o("p", Ie, s(t(l)("connect.whatsappBot.scanDescription")), 1),
|
|
345
|
-
o("ol", Ee, [
|
|
346
|
-
(n(), u(J, null, q(4, (a) => o("li", {
|
|
347
|
-
key: a,
|
|
348
|
-
class: "flex gap-[12px]"
|
|
349
|
-
}, [
|
|
350
|
-
o("span", Ve, s(a), 1),
|
|
351
|
-
a === 1 ? (n(), u("span", De, s(t(l)("connect.whatsappBot.steps.openApp")), 1)) : a === 2 ? (n(), k(h, {
|
|
352
|
-
key: 1,
|
|
353
|
-
keypath: "connect.whatsappBot.steps.openSettings",
|
|
354
|
-
tag: "span",
|
|
355
|
-
scope: "global"
|
|
356
|
-
}, {
|
|
357
|
-
menu: C(() => [
|
|
358
|
-
o("b", Le, s(t(l)("connect.whatsappBot.menu")), 1)
|
|
359
|
-
]),
|
|
360
|
-
settings: C(() => [
|
|
361
|
-
o("b", Me, s(t(l)("connect.whatsappBot.settings")), 1)
|
|
362
|
-
]),
|
|
363
|
-
_: 1
|
|
364
|
-
})) : a === 3 ? (n(), k(h, {
|
|
365
|
-
key: 2,
|
|
366
|
-
keypath: "connect.whatsappBot.steps.linkDevice",
|
|
367
|
-
tag: "span",
|
|
368
|
-
scope: "global"
|
|
369
|
-
}, {
|
|
370
|
-
linkedDevices: C(() => [
|
|
371
|
-
o("b", We, s(t(l)("connect.whatsappBot.linkedDevices")), 1)
|
|
372
|
-
]),
|
|
373
|
-
linkDevice: C(() => [
|
|
374
|
-
o("b", je, s(t(l)("connect.whatsappBot.linkDevice")), 1)
|
|
375
|
-
]),
|
|
376
|
-
_: 1
|
|
377
|
-
})) : (n(), u("span", Oe, s(t(l)("connect.whatsappBot.steps.scanQr")), 1))
|
|
378
|
-
])), 64))
|
|
379
|
-
]),
|
|
380
|
-
o("p", Ne, s(t(l)("connect.whatsappBot.connectionNote")), 1)
|
|
381
|
-
]),
|
|
382
|
-
o("div", Re, [
|
|
383
|
-
_.value ? (n(), u("div", Ue, [
|
|
384
|
-
T(c),
|
|
385
|
-
z(s(t(l)("connect.whatsappBot.generatingQr")), 1)
|
|
386
|
-
])) : d.value ? (n(), u("div", He, [
|
|
387
|
-
o("p", ze, s(d.value), 1),
|
|
388
|
-
T(I, {
|
|
389
|
-
label: t(l)("connect.whatsappBot.tryAgain"),
|
|
390
|
-
"prepend-icon": "refresh",
|
|
391
|
-
class: "!rounded-full [&_.label]:text-[14px]",
|
|
392
|
-
onClick: P
|
|
393
|
-
}, null, 8, ["label"])
|
|
394
|
-
])) : w.value ? (n(), u("img", {
|
|
395
|
-
key: 2,
|
|
396
|
-
src: w.value,
|
|
397
|
-
alt: t(l)("connect.whatsappBot.qrAlt"),
|
|
398
|
-
width: "224",
|
|
399
|
-
height: "224",
|
|
400
|
-
class: O({ "opacity-20": r.value })
|
|
401
|
-
}, null, 10, Ge)) : D("", !0),
|
|
402
|
-
r.value ? (n(), u("div", Qe, [
|
|
403
|
-
T(c),
|
|
404
|
-
z(" " + s(t(l)("connect.whatsappBot.connecting")), 1)
|
|
405
|
-
])) : D("", !0)
|
|
406
|
-
])
|
|
407
|
-
]))
|
|
408
|
-
];
|
|
409
|
-
}),
|
|
410
|
-
_: 1
|
|
411
|
-
}, 8, ["modelValue"]);
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
}), Je = { class: "mt-[24px] border border-fm-color-neutral-gray-200 rounded-[16px] px-[24px] py-[56px] flex flex-col items-center text-center gap-[8px]" }, Ke = { class: "text-[20px] leading-[28px] font-bold" }, Xe = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary max-w-[420px] [text-wrap:pretty]" }, Ye = /* @__PURE__ */ Q({
|
|
415
|
-
__name: "WhatsappEmptyState",
|
|
416
|
-
emits: ["connect"],
|
|
417
|
-
setup(E, { emit: i }) {
|
|
418
|
-
const l = i, { t: w } = K();
|
|
419
|
-
return (_, d) => {
|
|
420
|
-
const r = B("FmButton");
|
|
421
|
-
return n(), u("div", Je, [
|
|
422
|
-
d[1] || (d[1] = o("div", { class: "w-[72px] h-[72px] rounded-full bg-fm-color-primary-oats text-fm-color-primary flex items-center justify-center mb-[12px]" }, [
|
|
423
|
-
o("svg", {
|
|
424
|
-
width: "34",
|
|
425
|
-
height: "34",
|
|
426
|
-
viewBox: "0 0 24 24",
|
|
427
|
-
fill: "none",
|
|
428
|
-
stroke: "currentColor",
|
|
429
|
-
"stroke-width": "1.6",
|
|
430
|
-
"stroke-linecap": "round",
|
|
431
|
-
"stroke-linejoin": "round",
|
|
432
|
-
"aria-hidden": "true"
|
|
433
|
-
}, [
|
|
434
|
-
o("path", { d: "M7.9 20A9 9 0 1 0 4 16.1L2 22Z" }),
|
|
435
|
-
o("path", { d: "M9 10h.01M12 10h.01M15 10h.01" })
|
|
436
|
-
])
|
|
437
|
-
], -1)),
|
|
438
|
-
o("h2", Ke, s(t(w)("connect.whatsappBot.emptyTitle")), 1),
|
|
439
|
-
o("p", Xe, s(t(w)("connect.whatsappBot.emptyDescription")), 1),
|
|
440
|
-
T(r, {
|
|
441
|
-
class: "mt-[16px] !rounded-full !px-[20px] [&_.label]:text-[14px]",
|
|
442
|
-
label: t(w)("connect.whatsappBot.connectAccount"),
|
|
443
|
-
"prepend-icon": "add",
|
|
444
|
-
onClick: d[0] || (d[0] = (x) => l("connect"))
|
|
445
|
-
}, null, 8, ["label"])
|
|
446
|
-
]);
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
}), qe = { class: "px-[24px] xs:px-[12px] pt-[20px] pb-[40px] text-fm-color-typo-primary" }, et = { class: "flex items-center justify-between gap-[16px] flex-wrap min-h-[40px]" }, tt = { class: "flex items-center gap-8" }, ot = { class: "text-[24px] leading-[32px] font-semibold tracking-[-0.01em]" }, nt = {
|
|
450
|
-
key: 0,
|
|
451
|
-
class: "mt-[8px] w-full text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]"
|
|
452
|
-
}, at = ["aria-label"], st = {
|
|
453
|
-
key: 3,
|
|
454
|
-
role: "status",
|
|
455
|
-
class: "mt-[24px] py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
|
|
456
|
-
}, lt = {
|
|
457
|
-
key: 4,
|
|
458
|
-
class: "mt-[24px] border border-fm-color-neutral-gray-200 rounded-[16px] px-[24px] py-[56px] flex flex-col items-center text-center gap-[16px]"
|
|
459
|
-
}, rt = {
|
|
460
|
-
role: "alert",
|
|
461
|
-
class: "text-[14px] text-fm-color-typo-error"
|
|
462
|
-
}, _t = /* @__PURE__ */ Q({
|
|
463
|
-
__name: "WhatsappBot",
|
|
464
|
-
setup(E) {
|
|
465
|
-
const { t: i } = K(), l = te(), w = oe(), _ = j(() => {
|
|
466
|
-
var a, e;
|
|
467
|
-
return !!((e = (a = w.sessionUser.value) == null ? void 0 : a.role) != null && e.isAdmin);
|
|
468
|
-
}), d = b([]), r = b(!0), x = b("");
|
|
469
|
-
let y, A;
|
|
470
|
-
const g = b([]), $ = b(!0), V = b("");
|
|
471
|
-
let P, v;
|
|
472
|
-
const p = j(
|
|
473
|
-
() => d.value.filter((a) => le(a) !== void 0)
|
|
474
|
-
), h = j(() => [
|
|
475
|
-
{
|
|
476
|
-
label: i("connect.whatsappBot.accounts"),
|
|
477
|
-
value: M["$connect-WHATSAPP_BOT"],
|
|
478
|
-
badge: p.value.length
|
|
479
|
-
},
|
|
480
|
-
{
|
|
481
|
-
label: i("connect.whatsappBot.settings"),
|
|
482
|
-
value: M["$connect-WHATSAPP_BOT_SETTINGS"]
|
|
483
|
-
},
|
|
484
|
-
..._.value ? [
|
|
485
|
-
{
|
|
486
|
-
label: i("connect.whatsappBot.logs.title"),
|
|
487
|
-
value: M["$connect-WHATSAPP_BOT_LOGS"]
|
|
488
|
-
}
|
|
489
|
-
] : []
|
|
490
|
-
]), c = j(() => {
|
|
491
|
-
const a = l.currentRoute.value.name;
|
|
492
|
-
return h.value.some((e) => e.value === a) ? a : M["$connect-WHATSAPP_BOT"];
|
|
493
|
-
});
|
|
494
|
-
async function I(a = !1) {
|
|
495
|
-
clearTimeout(v), P == null || P.abort();
|
|
496
|
-
const e = new AbortController();
|
|
497
|
-
P = e, a || ($.value = !0, V.value = "");
|
|
498
|
-
try {
|
|
499
|
-
const m = N.getBusinessId();
|
|
500
|
-
if (!m)
|
|
501
|
-
throw new Error(i("connect.whatsappBot.errors.selectBusiness"));
|
|
502
|
-
const L = await G.listTickets(m, e.signal);
|
|
503
|
-
e.signal.aborted || (g.value = L, V.value = "");
|
|
504
|
-
} catch (m) {
|
|
505
|
-
e.signal.aborted || (V.value = m instanceof Error ? m.message : i("connect.whatsappBot.excludedAccounts.loadError"));
|
|
506
|
-
} finally {
|
|
507
|
-
e.signal.aborted || ($.value = !1, v = setTimeout(() => void I(!0), 1e4));
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
function R(a) {
|
|
511
|
-
g.value = g.value.filter((e) => e.id !== a), I(!0);
|
|
512
|
-
}
|
|
513
|
-
async function S(a = !1) {
|
|
514
|
-
clearTimeout(A), y == null || y.abort();
|
|
515
|
-
const e = new AbortController();
|
|
516
|
-
y = e, a || (r.value = !0, x.value = "");
|
|
517
|
-
try {
|
|
518
|
-
const m = N.getBusinessId();
|
|
519
|
-
if (!m)
|
|
520
|
-
throw new Error(i("connect.whatsappBot.errors.selectBusiness"));
|
|
521
|
-
const L = await G.listClients(m, e.signal);
|
|
522
|
-
e.signal.aborted || (d.value = L, x.value = "");
|
|
523
|
-
} catch (m) {
|
|
524
|
-
!e.signal.aborted && !a && (x.value = m instanceof Error ? m.message : i("connect.whatsappBot.errors.loadSessions"));
|
|
525
|
-
} finally {
|
|
526
|
-
e.signal.aborted || (r.value = !1, A = setTimeout(() => void S(!0), 1e4));
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
function W(a) {
|
|
530
|
-
d.value = d.value.filter(
|
|
531
|
-
(e) => e.clientId !== a
|
|
532
|
-
), S(!0);
|
|
533
|
-
}
|
|
534
|
-
const F = b(!1);
|
|
535
|
-
return Z(F, (a) => {
|
|
536
|
-
a || S();
|
|
537
|
-
}), Z(
|
|
538
|
-
() => N.getBusinessId(),
|
|
539
|
-
() => {
|
|
540
|
-
F.value = !1, d.value = [], g.value = [], S(), I();
|
|
541
|
-
},
|
|
542
|
-
{ immediate: !0 }
|
|
543
|
-
), Y(() => {
|
|
544
|
-
y == null || y.abort(), clearTimeout(A), P == null || P.abort(), clearTimeout(v);
|
|
545
|
-
}), (a, e) => {
|
|
546
|
-
const m = B("FmPill"), L = B("FmButton"), U = B("RouterLink"), H = B("RouterView"), X = B("FmCircularProgress");
|
|
547
|
-
return n(), u(J, null, [
|
|
548
|
-
o("div", qe, [
|
|
549
|
-
o("div", et, [
|
|
550
|
-
o("div", tt, [
|
|
551
|
-
o("h1", ot, s(t(i)("connect.navigation.whatsappBot")), 1),
|
|
552
|
-
T(m, { variant: "beta" })
|
|
553
|
-
]),
|
|
554
|
-
c.value === t(M)["$connect-WHATSAPP_BOT"] && p.value.length ? (n(), k(L, {
|
|
555
|
-
key: 0,
|
|
556
|
-
label: t(i)("connect.whatsappBot.connectAccountCta"),
|
|
557
|
-
"prepend-icon": "add",
|
|
558
|
-
class: "!h-[36px] !rounded-full !px-[16px] [&_.label]:text-[14px]",
|
|
559
|
-
onClick: e[0] || (e[0] = (f) => F.value = !0)
|
|
560
|
-
}, null, 8, ["label"])) : D("", !0)
|
|
561
|
-
]),
|
|
562
|
-
p.value.length ? (n(), u("p", nt, s(t(i)("connect.whatsappBot.description")), 1)) : D("", !0),
|
|
563
|
-
o("nav", {
|
|
564
|
-
"aria-label": t(i)("connect.navigation.whatsappBot"),
|
|
565
|
-
class: "mt-[16px] flex gap-[24px] overflow-x-auto border-b border-fm-color-neutral-gray-100"
|
|
566
|
-
}, [
|
|
567
|
-
(n(!0), u(J, null, q(h.value, (f) => (n(), k(U, {
|
|
568
|
-
key: f.value,
|
|
569
|
-
to: { name: f.value },
|
|
570
|
-
"aria-current": c.value === f.value ? "page" : void 0,
|
|
571
|
-
class: O([
|
|
572
|
-
"flex h-[40px] shrink-0 items-center gap-[6px] whitespace-nowrap border-b-[2px] px-[2px] text-[14px] leading-[20px] font-medium no-underline transition-colors hover:text-fm-color-primary focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-inset focus-visible:ring-fm-color-primary",
|
|
573
|
-
c.value === f.value ? "border-fm-color-primary text-fm-color-primary" : "border-transparent text-fm-color-typo-secondary"
|
|
574
|
-
])
|
|
575
|
-
}, {
|
|
576
|
-
default: C(() => [
|
|
577
|
-
z(s(f.label) + " ", 1),
|
|
578
|
-
f.badge ? (n(), u("span", {
|
|
579
|
-
key: 0,
|
|
580
|
-
class: O([
|
|
581
|
-
"min-w-[20px] rounded-full px-[6px] text-center text-[12px] leading-[20px] font-semibold tabular-nums",
|
|
582
|
-
c.value === f.value ? "bg-fm-color-primary-oats text-fm-color-primary" : "bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary"
|
|
583
|
-
])
|
|
584
|
-
}, s(f.badge), 3)) : D("", !0)
|
|
585
|
-
]),
|
|
586
|
-
_: 2
|
|
587
|
-
}, 1032, ["to", "aria-current", "class"]))), 128))
|
|
588
|
-
], 8, at),
|
|
589
|
-
c.value === t(M)["$connect-WHATSAPP_BOT_SETTINGS"] ? (n(), k(H, {
|
|
590
|
-
key: 1,
|
|
591
|
-
tickets: g.value,
|
|
592
|
-
"tickets-loading": $.value,
|
|
593
|
-
"tickets-error": V.value,
|
|
594
|
-
onRetryExclusions: e[1] || (e[1] = (f) => I()),
|
|
595
|
-
onExcludedAccountRemoved: R
|
|
596
|
-
}, null, 8, ["tickets", "tickets-loading", "tickets-error"])) : c.value === t(M)["$connect-WHATSAPP_BOT_LOGS"] ? (n(), k(H, {
|
|
597
|
-
key: 2,
|
|
598
|
-
accounts: p.value
|
|
599
|
-
}, null, 8, ["accounts"])) : r.value ? (n(), u("div", st, [
|
|
600
|
-
T(X),
|
|
601
|
-
z(" " + s(t(i)("connect.whatsappBot.loadingSessions")), 1)
|
|
602
|
-
])) : x.value ? (n(), u("div", lt, [
|
|
603
|
-
o("p", rt, s(x.value), 1),
|
|
604
|
-
T(L, {
|
|
605
|
-
label: t(i)("connect.whatsappBot.tryAgain"),
|
|
606
|
-
"prepend-icon": "refresh",
|
|
607
|
-
class: "!rounded-full [&_.label]:text-[14px]",
|
|
608
|
-
onClick: e[2] || (e[2] = (f) => S())
|
|
609
|
-
}, null, 8, ["label"])
|
|
610
|
-
])) : p.value.length ? (n(), k($e, {
|
|
611
|
-
key: 5,
|
|
612
|
-
accounts: p.value,
|
|
613
|
-
onRemoved: W
|
|
614
|
-
}, null, 8, ["accounts"])) : (n(), k(Ye, {
|
|
615
|
-
key: 6,
|
|
616
|
-
onConnect: e[3] || (e[3] = (f) => F.value = !0)
|
|
617
|
-
}))
|
|
618
|
-
]),
|
|
619
|
-
T(Ze, {
|
|
620
|
-
modelValue: F.value,
|
|
621
|
-
"onUpdate:modelValue": e[4] || (e[4] = (f) => F.value = f)
|
|
622
|
-
}, null, 8, ["modelValue"])
|
|
623
|
-
], 64);
|
|
624
|
-
};
|
|
625
|
-
}
|
|
626
|
-
});
|
|
627
|
-
export {
|
|
628
|
-
_t as default
|
|
629
|
-
};
|