@feedmepos/mf-connect 0.1.114-prod → 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/README.md +66 -1
- package/dist/{App-DMYXrCc7.js → App-43mZfFAr.js} +700 -654
- package/dist/AuditLogs-BPpdm96t.js +2016 -0
- package/dist/{Bin-CHZolo56.js → Bin-CA7v180Y.js} +8 -8
- package/dist/Broadcast-qmdifF2Y.js +306 -0
- package/dist/{CampaignAnalytic-DgZvsUoF.js → CampaignAnalytic-xnrDxqaH.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C42uL_JO.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-zjk-QdtX.js} +9 -9
- package/dist/{Card-wRFTJwJ9.js → Card-D8icsk7L.js} +25 -24
- package/dist/{Collections-9G-_9Etz.js → Collections--THcD-E_.js} +197 -185
- package/dist/{Credit-Bl7IDMCU.js → Credit-JrbtVMBp.js} +21 -20
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BVLJeofG.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DrwKtnE5.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DgdAlHU7.js +4442 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Q1f6EQW3.js → EffectSheet.vue_vue_type_style_index_0_lang-hVgqWdD0.js} +32 -32
- package/dist/{Experience-Cs2iViLv.js → Experience-CFeRqBoj.js} +32 -31
- package/dist/{FileSaver.min-B3Levdbu.js → FileSaver.min-CCXIBm58.js} +1 -1
- package/dist/{Game-oXURgzan.js → Game-CPxq6Ex3.js} +19 -18
- package/dist/{GiftCardSetup-C2Wu-dRl.js → GiftCardSetup-D0esVZDp.js} +75 -75
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Da2e89Um.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-CJ1-vL-K.js} +7 -7
- package/dist/{Goals-B_xEM7gf.js → Goals-DaKI6uXt.js} +4 -4
- package/dist/Grab-BWzdN_cd.js +301 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BRJR1heE.js → ImageInput.vue_vue_type_script_setup_true_lang-BOnL0GxM.js} +1 -1
- package/dist/{Index-kuT6W6R_.js → Index-2kENoaZm.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-7JqHfSk-.js → LocationPicker.vue_vue_type_script_setup_true_lang-BtWnJKU_.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CI_4S7tW.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CX_Sspu5.js} +1 -1
- package/dist/{LoyaltyDashboard-CqxHdZcm.js → LoyaltyDashboard-CB93Fz8u.js} +15 -15
- package/dist/MainLayout-DwnjGXh6.js +4 -0
- package/dist/{MainLayout-CAERFIms.js → MainLayout.vue_vue_type_script_setup_true_lang-Du8fw5v_.js} +5 -4
- package/dist/Marketing-DCco__2F.js +273 -0
- package/dist/MarketingMaterialEdit-BbgFtrYP.js +1037 -0
- package/dist/{Member-B8VZEn9t.js → Member-B--nYyr0.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-B31lVLKh.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-BBlzO7Db.js} +43 -50
- package/dist/{MemberImportHistory-D9tgHnTS.js → MemberImportHistory-D52Y4RTC.js} +7 -7
- package/dist/{MemberList-Hw_xQY1i.js → MemberList-13Owa1fj.js} +103 -105
- package/dist/{MemberTransactions-DiBO4plw.js → MemberTransactions-CpXEWNbq.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CbFt5X89.js → MessageInput.vue_vue_type_script_setup_true_lang-DlELjFM0.js} +4228 -4176
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BE_-Ed4z.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-C_y0rM8c.js} +1 -1
- package/dist/{Mission-DpYei3aF.js → Mission-Ci-UzXSu.js} +22 -21
- package/dist/{Overview-CARquJCS.js → Overview-CKxSfAGF.js} +145 -144
- package/dist/{Overview-BFQMmyT6.js → Overview-CXen9Ram.js} +23 -22
- package/dist/{Point-Dd2ykwNv.js → Point-CR3YOaag.js} +22 -21
- package/dist/{Promotion-DXl-W7np.js → Promotion-tw3J4ul-.js} +137 -131
- package/dist/{Queue-Cd3N-4iB.js → Queue-BZGA5ZXt.js} +47 -46
- package/dist/{Record-C3HdDsh5.js → Record-BTevVXnT.js} +9 -9
- package/dist/{Review-Bif3Ub9Z.js → Review-BU7c8ZF0.js} +2 -2
- package/dist/ReviewFacebookCallback-BnMF6Arh.js +225 -0
- package/dist/{ReviewGoogleCallback-i-RNLlLm.js → ReviewGoogleCallback-xpdPHSdg.js} +5 -5
- package/dist/{Reward-DHxzrR_7.js → Reward-jlA_7cxz.js} +29 -29
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DcrFlcSo.js → RewardGroup.vue_vue_type_script_setup_true_lang-D3z_n42G.js} +16 -15
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CsHxqH9h.js +1923 -0
- package/dist/{Segment-Cjpxordk.js → Segment-C1Bwm--Q.js} +290 -291
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-6u21xBu6.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-B6apgWTM.js} +31 -30
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BOXVzfer.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-B7m2F9UV.js} +4 -4
- package/dist/Setting-CDM4RhLW.js +574 -0
- package/dist/{SettingAdvertisements-aog5fz32.js → SettingAdvertisements-4XEAJzlL.js} +12 -12
- package/dist/Settings-D-0tvZRr.js +286 -0
- package/dist/{Store-Bq3kw1l2.js → Store-C56dXtc4.js} +31 -30
- package/dist/{StoreRewards-ZGXKEM09.js → StoreRewards-DQ1Q6WS6.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-LLD91Rz6.js +1319 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-Bvy4NJMd.js +7007 -0
- package/dist/{Tier-CfgpEHY7.js → Tier-D4CPZqw7.js} +2576 -687
- package/dist/{Title-B2itYWeD.js → Title-DCbwhUic.js} +94 -92
- package/dist/{Transaction-hJ5ygIcf.js → Transaction-C5LrasXr.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-8BgGlpTh.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Cl9b4mrK.js} +26 -26
- package/dist/{Voucher-TG47pGR3.js → Voucher-rrVbNZKR.js} +19 -19
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CjuXCTxg.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BIq227nz.js} +16 -16
- package/dist/WhatsappAccount-oJDo5zTr.js +159 -0
- package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-aCQCYFYq.js +39 -0
- package/dist/WhatsappBot-Cl64wG_F.js +876 -0
- package/dist/WhatsappBotLogs-D3uT4EiB.js +372 -0
- package/dist/WhatsappBotSettings-Cs1lLxh-.js +705 -0
- package/dist/WhatsappLayout-C639d2HP.js +21 -0
- package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DpPxWp2x.js +253 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BRs-gbP0.js → ZodTextField.vue_vue_type_script_setup_true_lang-C39_95SZ.js} +2 -2
- package/dist/{app-tPHYkJcQ.js → app-CgimGODl.js} +10610 -8223
- package/dist/app.js +4 -3
- package/dist/{base.export-BHDVnGj2.js → base.export-D2P6HFvo.js} +2 -2
- package/dist/browser-BSAOEeIM.js +1478 -0
- package/dist/{business-HLyWfrXY.js → business-Bu5TqSA0.js} +1 -1
- package/dist/campaign-BFIXSgdJ.js +400 -0
- package/dist/{campaign-5zFgUNLw.js → campaign-zJxttSIk.js} +31 -25
- package/dist/{campaign.enum-BOkDnP2g.js → campaign.enum-Dx-Zo68Q.js} +3 -2
- package/dist/{campaign.fn-BIAoVtJj.js → campaign.fn-gvjlcEfe.js} +78 -78
- package/dist/{collectible.enum-BbZSAfys.js → collectible.enum-Liy2wH3s.js} +1 -1
- package/dist/{collection.fn-DPSgBHnz.js → collection.fn-DOm0HsSh.js} +2 -2
- package/dist/{currency-BVrMqU6-.js → currency-BpbQvbm8.js} +1 -1
- package/dist/duplicateCampaign-CvsvjRE9.js +51 -0
- package/dist/{effect-BBifVx76.js → effect-D-GtNB3n.js} +1 -1
- package/dist/{email-addresses-9C7xHTNv.js → email-addresses-BKMoAtMi.js} +2 -2
- package/dist/feature-flag-BJ_eyKsq.js +868 -0
- package/dist/feature-flag-Bo-k5sIG.js +50 -0
- package/dist/google-BQK68wbe.js +5 -0
- package/dist/{helper-C08jyQNK.js → helper-CkfjBgMM.js} +1 -1
- package/dist/{index-Dhyqf1s8.js → index-B6kU3PkV.js} +2700 -2613
- package/dist/{index-BgwZGunW.js → index-BAtUrtqM.js} +19 -6
- package/dist/index-BKsxIwbi.js +14571 -0
- package/dist/{index-DZ-q5O-V.js → index-BdEXUNoG.js} +4 -4
- package/dist/{index-hIUtD2eY.js → index-Bhl5IRXy.js} +11 -10
- package/dist/{index-kCbkOivd.js → index-BpTIulTX.js} +1 -1
- package/dist/index-C-iwb2Ln.js +109 -0
- package/dist/{index-Ciw2TZxV.js → index-CCEXSPxk.js} +8 -7
- package/dist/{index-CUle4c2B.js → index-CIej31pF.js} +4 -3
- package/dist/{index-ihw-WFCa.js → index-CQ8XFbBk.js} +2 -2
- package/dist/index-C_H8jFYf.js +2743 -0
- package/dist/{index-CEe1kJ0T.js → index-CfQuYqXn.js} +1 -1
- package/dist/{index-C_WoO58V.js → index-CuREApMc.js} +8 -7
- package/dist/{index-NJSI4wX4.js → index-D0JK99Ko.js} +693 -231
- package/dist/{index-DnRMNmUA.js → index-DKxN1mMS.js} +396 -232
- package/dist/index-DQ8JJhxs.js +74 -0
- package/dist/{index-D24Q28cH.js → index-DUAZOMVJ.js} +1 -1
- package/dist/{index-Yo0tP8KJ.js → index-DqGs6RJG.js} +683 -581
- package/dist/{index-B_334Y_i.js → index-DwU3fsLW.js} +29 -15
- package/dist/{index-hSRM1smQ.js → index-LygS9WsG.js} +8028 -10767
- package/dist/{index-96ZiAKj_.js → index-feCrYhi6.js} +1 -1
- package/dist/{index-Dk-jg0wN.js → index-zTvr2GR4.js} +2 -2
- package/dist/{index.esm2017-hN99SQTb.js → index.esm2017-DZi9IQPS.js} +209 -209
- package/dist/{loading-CVuY4vQ4.js → loading-Brid2wnu.js} +1 -1
- package/dist/{lodash-GFl9_FMH.js → lodash-C1epw3Kv.js} +1 -1
- package/dist/{member-import-CshTzabx.js → member-import-DAIxTIiu.js} +6 -5
- package/dist/{membership-S0KES3Ex.js → membership-BZmljFhF.js} +3 -3
- package/dist/{money-JxdX8ru4.js → money-cLcyGcSZ.js} +1 -1
- package/dist/{number-BRLwa-mB.js → number-C2jPLJr2.js} +1 -1
- package/dist/objectid-C-wocWKI.js +145 -0
- package/dist/{onboarding-BSKYeyP7.js → onboarding-oRfy_g05.js} +25 -25
- package/dist/{onboardingSetup-BqT52VRm.js → onboardingSetup-BLD6m8HY.js} +2 -2
- package/dist/{plugins-BR_wmMFJ.js → plugins-CUsr9vB0.js} +3 -3
- package/dist/{MarketingMaterialEdit-BvIthCHG.js → remy-icon-BhUGu2NI.js} +2 -1031
- package/dist/{reward-CpCGg_W2.js → reward-UOT03odb.js} +1 -1
- package/dist/{rule-Dbg9e8MO.js → rule-BgJnPjkI.js} +572 -492
- package/dist/style.css +1 -1
- package/dist/template-BZyFhr73.js +188 -0
- package/dist/{timezone-CDVa-xPr.js → timezone-BXA4wq7Y.js} +1 -1
- package/dist/{transaction.fn-DrTBoF9T.js → transaction.fn-CQ4fpRt3.js} +2 -2
- package/dist/{trigger-wqGwQfB2.js → trigger-DXJCGT0q.js} +8 -8
- package/dist/useMarketingMaterialActions-B-Wib5ga.js +125 -0
- package/dist/{usePagination-fODgpZZ8.js → usePagination-Pp4okWr8.js} +1 -1
- package/dist/{user-DaLUK1dk.js → user-B3gXcAIy.js} +1 -1
- package/dist/vue-i18n-DWGiC_vs.js +2365 -0
- package/dist/{xlsx-Bl4_Dtrq.js → xlsx-CCaDUTgW.js} +651 -651
- package/dist/{zod-CAzWyVqj.js → zod-CPwjOxvW.js} +1 -1
- package/package.json +12 -3
- package/dist/Broadcast-ByWvxVhW.js +0 -271
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DGpQfV5T.js +0 -2431
- package/dist/Marketing-KgcwGErU.js +0 -236
- package/dist/ReviewFacebookCallback-mJF54-9l.js +0 -238
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-39f3I4BB.js +0 -1883
- package/dist/Setting-Dl9MelHz.js +0 -2036
- package/dist/Settings-DvCCClIP.js +0 -179
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DscLAF0p.js +0 -1264
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-l_v4FHO0.js +0 -142
- package/dist/campaign-awCRccgX.js +0 -228
- package/dist/google-C3S8u0mT.js +0 -4
- package/dist/index-CoNJdOx7.js +0 -51
- package/dist/objectid-CEHN25HN.js +0 -145
- package/dist/rule-builder-BEIjxsE0.js +0 -102
- package/dist/template-CS-lExgI.js +0 -236
- package/dist/useMarketingMaterialActions-DC0gIyIZ.js +0 -96
- package/dist/vue-i18n-Dx-KXojZ.js +0 -2365
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import { defineComponent as T, resolveComponent as k, openBlock as l, createElementBlock as d, createElementVNode as s, toDisplayString as i, unref as u, createVNode as _, computed as w, Fragment as M, renderList as V, createCommentVNode as $, normalizeClass as ee, createTextVNode as P, createBlock as I, ref as b, watch as G, onBeforeUnmount as te, withCtx as O } from "vue";
|
|
2
|
+
import { u as E } from "./vue-i18n-DWGiC_vs.js";
|
|
3
|
+
import { useCoreStore as oe } from "@feedmepos/mf-common";
|
|
4
|
+
import { S as ne } from "./index-CCEXSPxk.js";
|
|
5
|
+
import { w as ae } from "./index-DQ8JJhxs.js";
|
|
6
|
+
import { _ as se } from "./remy-icon-BhUGu2NI.js";
|
|
7
|
+
import { _ as le } from "./WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DpPxWp2x.js";
|
|
8
|
+
import { C as U } from "./timezone-BXA4wq7Y.js";
|
|
9
|
+
import { m as re } from "./index-DUAZOMVJ.js";
|
|
10
|
+
const ce = { class: "group self-end min-w-[min(280px,100%)] max-w-[80%] rounded-[12px] rounded-br-[4px] bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary" }, ie = { class: "flex items-center gap-[4px] min-h-[28px] px-[10px] py-[4px] text-[11px] font-medium cursor-pointer list-none rounded-[12px] focus-visible:outline-fm-color-primary" }, pe = { class: "flex-1 group-open:hidden" }, ue = { class: "flex-1 hidden group-open:inline" }, me = { class: "px-[10px] pt-[2px] pb-[8px] text-[13px] leading-[18px] whitespace-pre-wrap break-words" }, de = /* @__PURE__ */ T({
|
|
11
|
+
__name: "ThoughtBubble",
|
|
12
|
+
props: {
|
|
13
|
+
text: {}
|
|
14
|
+
},
|
|
15
|
+
setup(m) {
|
|
16
|
+
const { t: v } = E();
|
|
17
|
+
return (n, g) => {
|
|
18
|
+
const c = k("FmIcon");
|
|
19
|
+
return l(), d("details", ce, [
|
|
20
|
+
s("summary", ie, [
|
|
21
|
+
g[0] || (g[0] = s("img", {
|
|
22
|
+
src: se,
|
|
23
|
+
alt: "",
|
|
24
|
+
"aria-hidden": "true",
|
|
25
|
+
class: "w-[16px] h-[16px] shrink-0"
|
|
26
|
+
}, null, -1)),
|
|
27
|
+
s("span", pe, i(u(v)("connect.whatsappBot.logs.thought")), 1),
|
|
28
|
+
s("span", ue, i(u(v)("connect.whatsappBot.logs.hideThought")), 1),
|
|
29
|
+
_(c, {
|
|
30
|
+
name: "keyboard_arrow_down",
|
|
31
|
+
size: "sm",
|
|
32
|
+
class: "transition-transform group-open:rotate-180"
|
|
33
|
+
})
|
|
34
|
+
]),
|
|
35
|
+
s("p", me, i(m.text), 1)
|
|
36
|
+
]);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}), xe = { class: "border border-fm-color-neutral-gray-100 rounded-[16px] bg-fm-color-neutral-white overflow-hidden" }, fe = { class: "flex items-center gap-[10px] px-[16px] py-[10px] border-b border-fm-color-neutral-gray-100 flex-wrap" }, he = {
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
class: "w-[28px] h-[28px] rounded-full bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary text-[12px] font-semibold flex items-center justify-center shrink-0"
|
|
42
|
+
}, ve = { class: "min-w-0 flex-1" }, ge = { class: "text-[14px] font-semibold leading-[20px] break-words" }, ye = { class: "text-[12px] leading-[16px] text-fm-color-typo-tertiary break-words" }, _e = ["datetime"], we = { class: "flex flex-col gap-[10px] px-[16px] py-[12px]" }, be = {
|
|
43
|
+
key: 0,
|
|
44
|
+
class: "self-end text-[12px] leading-[16px] text-fm-color-typo-tertiary"
|
|
45
|
+
}, ke = {
|
|
46
|
+
key: 0,
|
|
47
|
+
class: "text-[11px] text-fm-color-typo-tertiary"
|
|
48
|
+
}, Be = ["datetime"], Ce = ["title", "onClick"], Fe = { class: "w-[24px] h-[24px] rounded-full bg-fm-color-secondary-plum/10 text-fm-color-secondary-plum flex items-center justify-center shrink-0" }, Ae = { class: "flex flex-col min-w-0" }, Ne = { class: "text-[13px] leading-[18px] font-semibold" }, $e = { class: "text-[12px] leading-[16px] text-fm-color-typo-tertiary whitespace-pre-wrap break-words" }, Ie = /* @__PURE__ */ T({
|
|
49
|
+
__name: "WhatsappLogConversation",
|
|
50
|
+
props: {
|
|
51
|
+
conversation: {},
|
|
52
|
+
accountName: {},
|
|
53
|
+
timezone: {}
|
|
54
|
+
},
|
|
55
|
+
emits: ["notificationGroup"],
|
|
56
|
+
setup(m, { emit: v }) {
|
|
57
|
+
const n = m, g = v, { t: c, locale: t } = E(), o = w(
|
|
58
|
+
() => n.conversation.customerName || n.conversation.phoneNumber || c("connect.whatsappBot.logs.unknownCustomer")
|
|
59
|
+
), p = w(
|
|
60
|
+
() => n.conversation.customerName ? n.conversation.customerName.trim().split(/\s+/).slice(0, 2).map((f) => Array.from(f)[0]).join("").toLocaleUpperCase(t.value) : "?"
|
|
61
|
+
), A = w(
|
|
62
|
+
() => new Intl.DateTimeFormat(t.value, {
|
|
63
|
+
dateStyle: "medium",
|
|
64
|
+
timeStyle: "short",
|
|
65
|
+
timeZone: n.timezone
|
|
66
|
+
})
|
|
67
|
+
), y = w(
|
|
68
|
+
() => new Intl.DateTimeFormat(t.value, {
|
|
69
|
+
hour: "2-digit",
|
|
70
|
+
minute: "2-digit",
|
|
71
|
+
hour12: !1,
|
|
72
|
+
timeZone: n.timezone
|
|
73
|
+
})
|
|
74
|
+
);
|
|
75
|
+
function h(f) {
|
|
76
|
+
var B;
|
|
77
|
+
return (B = f.reaction) != null && B.removed ? c("connect.whatsappBot.logs.reactionRemoved") : f.text ? f.text : c("connect.whatsappBot.logs.mediaMessage", { type: f.messageType });
|
|
78
|
+
}
|
|
79
|
+
return (f, B) => {
|
|
80
|
+
const N = k("FmIcon");
|
|
81
|
+
return l(), d("article", xe, [
|
|
82
|
+
s("header", fe, [
|
|
83
|
+
s("div", he, i(p.value), 1),
|
|
84
|
+
s("div", ve, [
|
|
85
|
+
s("h2", ge, i(o.value), 1),
|
|
86
|
+
s("p", ye, i(m.conversation.phoneNumber || u(c)("connect.whatsappBot.phoneUnavailable")) + " · " + i(u(c)("connect.whatsappBot.logs.via", { name: m.accountName })), 1)
|
|
87
|
+
]),
|
|
88
|
+
s("time", {
|
|
89
|
+
datetime: m.conversation.lastCreatedAt,
|
|
90
|
+
class: "text-[12px] text-fm-color-typo-tertiary tabular-nums"
|
|
91
|
+
}, i(A.value.format(new Date(m.conversation.lastCreatedAt))), 9, _e)
|
|
92
|
+
]),
|
|
93
|
+
s("ol", we, [
|
|
94
|
+
(l(!0), d(M, null, V(m.conversation.logs, (r) => (l(), d("li", {
|
|
95
|
+
key: r.id,
|
|
96
|
+
class: "flex flex-col gap-[4px] min-w-0"
|
|
97
|
+
}, [
|
|
98
|
+
r.type === "message" ? (l(), d(M, { key: 0 }, [
|
|
99
|
+
r.isFromMe && !r.isFromBot ? (l(), d("span", be, i(u(c)("connect.whatsappBot.logs.sentByStaff")), 1)) : $("", !0),
|
|
100
|
+
s("div", {
|
|
101
|
+
class: ee([
|
|
102
|
+
"px-[10px] py-[6px] text-[14px] leading-[20px] whitespace-pre-wrap break-words min-w-0",
|
|
103
|
+
r.isFromMe ? "self-end max-w-[80%] bg-fm-color-primary-oats rounded-[12px] rounded-br-[4px]" : "self-start max-w-[75%] bg-[#F7F7F7] rounded-[12px] rounded-bl-[4px]"
|
|
104
|
+
])
|
|
105
|
+
}, [
|
|
106
|
+
P(i(h(r)) + " ", 1),
|
|
107
|
+
r.isEdit ? (l(), d("span", ke, " (" + i(u(c)("connect.whatsappBot.logs.edited")) + ") ", 1)) : $("", !0),
|
|
108
|
+
s("time", {
|
|
109
|
+
datetime: r.timestamp,
|
|
110
|
+
class: "float-right mt-[6px] ml-[10px] text-[11px] leading-[14px] text-fm-color-typo-tertiary tabular-nums"
|
|
111
|
+
}, i(y.value.format(new Date(r.timestamp))), 9, Be)
|
|
112
|
+
], 2)
|
|
113
|
+
], 64)) : r.type === "thought" ? (l(), I(de, {
|
|
114
|
+
key: 1,
|
|
115
|
+
text: r.text
|
|
116
|
+
}, null, 8, ["text"])) : r.type === "escalate" ? (l(), d("button", {
|
|
117
|
+
key: 2,
|
|
118
|
+
type: "button",
|
|
119
|
+
title: u(c)("connect.whatsappBot.logs.openNotificationGroup"),
|
|
120
|
+
class: "self-end flex items-start gap-[8px] max-w-[80%] py-[8px] pr-[12px] pl-[8px] border border-fm-color-neutral-gray-200 rounded-[8px] text-left hover:bg-fm-color-neutral-gray-100/50 focus-visible:outline-fm-color-primary",
|
|
121
|
+
onClick: (C) => g("notificationGroup", r.clientId)
|
|
122
|
+
}, [
|
|
123
|
+
s("span", Fe, [
|
|
124
|
+
_(N, {
|
|
125
|
+
name: "group",
|
|
126
|
+
size: "sm"
|
|
127
|
+
})
|
|
128
|
+
]),
|
|
129
|
+
s("span", Ae, [
|
|
130
|
+
s("span", Ne, i(u(c)("connect.whatsappBot.logs.escalated")), 1),
|
|
131
|
+
s("span", $e, i(u(c)("connect.whatsappBot.logs.reason", {
|
|
132
|
+
reason: r.reason
|
|
133
|
+
})), 1)
|
|
134
|
+
])
|
|
135
|
+
], 8, Ce)) : $("", !0)
|
|
136
|
+
]))), 128))
|
|
137
|
+
])
|
|
138
|
+
]);
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
function Me(m, v) {
|
|
143
|
+
const n = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), c = [...m].sort(
|
|
144
|
+
(t, o) => Date.parse(t.createdAt) - Date.parse(o.createdAt) || W(t) - W(o) || t.id.localeCompare(o.id)
|
|
145
|
+
);
|
|
146
|
+
for (const t of c) {
|
|
147
|
+
const o = JSON.stringify([
|
|
148
|
+
t.accountLid || t.clientId,
|
|
149
|
+
t.chatJid
|
|
150
|
+
]), p = g.get(o) ?? { name: "", phone: "" };
|
|
151
|
+
t.customerName && (p.name = t.customerName), t.phoneNumber && (p.phone = t.phoneNumber), g.set(o, p);
|
|
152
|
+
const A = re.tz(t.createdAt, v).format("YYYY-MM-DD"), y = `${o}:${A}`, h = n.get(y);
|
|
153
|
+
h ? (h.logs.push(t), h.lastCreatedAt = t.createdAt, h.clientId = t.clientId) : n.set(y, {
|
|
154
|
+
id: y,
|
|
155
|
+
clientId: t.clientId,
|
|
156
|
+
chatJid: t.chatJid,
|
|
157
|
+
customerName: "",
|
|
158
|
+
phoneNumber: "",
|
|
159
|
+
createdAt: t.createdAt,
|
|
160
|
+
lastCreatedAt: t.createdAt,
|
|
161
|
+
logs: [t]
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
for (const t of n.values()) {
|
|
165
|
+
const o = t.logs[0], p = g.get(
|
|
166
|
+
JSON.stringify([o.accountLid || o.clientId, o.chatJid])
|
|
167
|
+
);
|
|
168
|
+
t.customerName = (p == null ? void 0 : p.name) ?? "", t.phoneNumber = (p == null ? void 0 : p.phone) ?? "";
|
|
169
|
+
}
|
|
170
|
+
return [...n.values()].sort(
|
|
171
|
+
(t, o) => Date.parse(o.lastCreatedAt) - Date.parse(t.lastCreatedAt)
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
function W(m) {
|
|
175
|
+
return m.type === "thought" ? 1 : m.type === "escalate" ? 2 : m.isFromMe ? 3 : 0;
|
|
176
|
+
}
|
|
177
|
+
const Se = { class: "mt-[20px] flex flex-col gap-[16px]" }, De = { class: "flex items-center gap-[8px] flex-wrap" }, Le = { class: "max-h-[240px] overflow-y-auto" }, ze = {
|
|
178
|
+
key: 0,
|
|
179
|
+
role: "alert",
|
|
180
|
+
class: "text-[14px] text-fm-color-typo-error"
|
|
181
|
+
}, Ve = {
|
|
182
|
+
key: 1,
|
|
183
|
+
role: "status",
|
|
184
|
+
class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
|
|
185
|
+
}, Te = {
|
|
186
|
+
key: 2,
|
|
187
|
+
class: "flex items-center gap-[12px] flex-wrap"
|
|
188
|
+
}, Ee = {
|
|
189
|
+
role: "alert",
|
|
190
|
+
class: "text-[14px] text-fm-color-typo-error"
|
|
191
|
+
}, Je = {
|
|
192
|
+
key: 3,
|
|
193
|
+
class: "border border-fm-color-neutral-gray-200 rounded-[16px] px-[24px] py-[56px] flex flex-col items-center text-center gap-[8px]"
|
|
194
|
+
}, Ye = { class: "text-[20px] font-semibold" }, je = { class: "max-w-[420px] text-[14px] leading-[20px] text-fm-color-typo-secondary" }, Ge = {
|
|
195
|
+
key: 4,
|
|
196
|
+
class: "mx-auto w-full min-w-0 flex flex-col gap-[12px]"
|
|
197
|
+
}, qe = /* @__PURE__ */ T({
|
|
198
|
+
__name: "WhatsappBotLogs",
|
|
199
|
+
props: {
|
|
200
|
+
accounts: {}
|
|
201
|
+
},
|
|
202
|
+
setup(m) {
|
|
203
|
+
const v = m, { t: n } = E(), g = oe(), c = w(() => ne.getBusinessId() ?? ""), t = w(
|
|
204
|
+
() => U[g.currentCountry.value || "MY"] ?? U.MY
|
|
205
|
+
), o = b([]), p = b(""), A = b([]), y = b([]), h = b(!0), f = b(""), B = b(), N = b(!1), r = b("");
|
|
206
|
+
let C;
|
|
207
|
+
function S(a) {
|
|
208
|
+
var F;
|
|
209
|
+
const e = (F = v.accounts.find(
|
|
210
|
+
(L) => L.clientId === a
|
|
211
|
+
)) == null ? void 0 : F.account;
|
|
212
|
+
return (e == null ? void 0 : e.businessName) || (e == null ? void 0 : e.name) || (e == null ? void 0 : e.phoneNumber) || n("connect.whatsappBot.logs.unknownAccount", { id: a.slice(-6) });
|
|
213
|
+
}
|
|
214
|
+
const Z = w(
|
|
215
|
+
() => [
|
|
216
|
+
.../* @__PURE__ */ new Set([
|
|
217
|
+
...v.accounts.map((a) => a.clientId),
|
|
218
|
+
...y.value,
|
|
219
|
+
...o.value
|
|
220
|
+
])
|
|
221
|
+
].map((a) => ({ clientId: a, label: S(a) }))
|
|
222
|
+
), J = w(() => {
|
|
223
|
+
const a = p.value.trim().toLocaleLowerCase();
|
|
224
|
+
return Z.value.filter(
|
|
225
|
+
(e) => e.label.toLocaleLowerCase().includes(a)
|
|
226
|
+
);
|
|
227
|
+
}), R = w(() => {
|
|
228
|
+
const a = o.value, e = a.length ? a.length === 1 ? S(a[0]) : n("connect.whatsappBot.logs.selectedAccounts", {
|
|
229
|
+
count: a.length
|
|
230
|
+
}) : n("connect.whatsappBot.logs.allAccounts");
|
|
231
|
+
return n("connect.whatsappBot.logs.accountFilter", { name: e });
|
|
232
|
+
}), Y = w(
|
|
233
|
+
() => Me(A.value, t.value)
|
|
234
|
+
);
|
|
235
|
+
function H(a) {
|
|
236
|
+
o.value = o.value.includes(a) ? o.value.filter((e) => e !== a) : [...o.value, a];
|
|
237
|
+
}
|
|
238
|
+
function K(a) {
|
|
239
|
+
r.value = "";
|
|
240
|
+
const e = v.accounts.find(
|
|
241
|
+
(F) => F.clientId === a
|
|
242
|
+
);
|
|
243
|
+
if (!e) {
|
|
244
|
+
r.value = n("connect.whatsappBot.errors.accountNotFound");
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
B.value = e, N.value = !0;
|
|
248
|
+
}
|
|
249
|
+
async function D() {
|
|
250
|
+
C == null || C.abort();
|
|
251
|
+
const a = new AbortController();
|
|
252
|
+
C = a, h.value = !0, f.value = "", A.value = [];
|
|
253
|
+
try {
|
|
254
|
+
if (!c.value)
|
|
255
|
+
throw new Error(n("connect.whatsappBot.errors.selectBusiness"));
|
|
256
|
+
const e = await ae.listLogs(
|
|
257
|
+
c.value,
|
|
258
|
+
o.value.length ? { clientIds: o.value.join(",") } : {},
|
|
259
|
+
a.signal
|
|
260
|
+
);
|
|
261
|
+
if (a.signal.aborted) return;
|
|
262
|
+
A.value = e.logs, y.value = [
|
|
263
|
+
.../* @__PURE__ */ new Set([
|
|
264
|
+
...y.value,
|
|
265
|
+
...e.logs.map((F) => F.clientId)
|
|
266
|
+
])
|
|
267
|
+
];
|
|
268
|
+
} catch (e) {
|
|
269
|
+
a.signal.aborted || (f.value = e instanceof Error ? e.message : n("connect.whatsappBot.logs.loadError"));
|
|
270
|
+
} finally {
|
|
271
|
+
a.signal.aborted || (h.value = !1);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return G(c, () => {
|
|
275
|
+
o.value = [], p.value = "", y.value = [], N.value = !1, B.value = void 0, r.value = "";
|
|
276
|
+
}), G(
|
|
277
|
+
[c, () => o.value.join(",")],
|
|
278
|
+
() => void D(),
|
|
279
|
+
{ immediate: !0 }
|
|
280
|
+
), te(() => C == null ? void 0 : C.abort()), (a, e) => {
|
|
281
|
+
const F = k("FmChip"), L = k("FmSearch"), Q = k("FmMenuDivider"), z = k("FmMenuItem"), X = k("FmMenu"), j = k("FmButton"), q = k("FmCircularProgress");
|
|
282
|
+
return l(), d(M, null, [
|
|
283
|
+
s("section", Se, [
|
|
284
|
+
s("div", De, [
|
|
285
|
+
_(X, {
|
|
286
|
+
"close-on-click": !1,
|
|
287
|
+
width: 280
|
|
288
|
+
}, {
|
|
289
|
+
"menu-button": O(() => [
|
|
290
|
+
_(F, {
|
|
291
|
+
label: R.value,
|
|
292
|
+
"right-icon": "keyboard_arrow_down",
|
|
293
|
+
class: "text-fm-color-typo-secondary cursor-pointer"
|
|
294
|
+
}, null, 8, ["label"])
|
|
295
|
+
]),
|
|
296
|
+
default: O(() => [
|
|
297
|
+
_(L, {
|
|
298
|
+
modelValue: p.value,
|
|
299
|
+
"onUpdate:modelValue": e[0] || (e[0] = (x) => p.value = x),
|
|
300
|
+
placeholder: u(n)("connect.whatsappBot.logs.searchAccounts")
|
|
301
|
+
}, null, 8, ["modelValue", "placeholder"]),
|
|
302
|
+
_(Q),
|
|
303
|
+
_(z, {
|
|
304
|
+
label: u(n)("connect.whatsappBot.logs.allAccounts"),
|
|
305
|
+
"model-value": !o.value.length,
|
|
306
|
+
"has-checkbox": "",
|
|
307
|
+
onClick: e[1] || (e[1] = (x) => o.value = [])
|
|
308
|
+
}, null, 8, ["label", "model-value"]),
|
|
309
|
+
s("div", Le, [
|
|
310
|
+
(l(!0), d(M, null, V(J.value, (x) => (l(), I(z, {
|
|
311
|
+
key: x.clientId,
|
|
312
|
+
label: x.label,
|
|
313
|
+
"model-value": o.value.includes(x.clientId),
|
|
314
|
+
"has-checkbox": "",
|
|
315
|
+
onClick: (Oe) => H(x.clientId)
|
|
316
|
+
}, null, 8, ["label", "model-value", "onClick"]))), 128)),
|
|
317
|
+
J.value.length ? $("", !0) : (l(), I(z, {
|
|
318
|
+
key: 0,
|
|
319
|
+
label: u(n)("connect.whatsappBot.logs.noMatchingAccounts"),
|
|
320
|
+
disabled: ""
|
|
321
|
+
}, null, 8, ["label"]))
|
|
322
|
+
])
|
|
323
|
+
]),
|
|
324
|
+
_: 1
|
|
325
|
+
}),
|
|
326
|
+
_(j, {
|
|
327
|
+
variant: "plain",
|
|
328
|
+
"prepend-icon": "refresh",
|
|
329
|
+
label: u(n)("connect.whatsappBot.logs.refresh"),
|
|
330
|
+
disabled: h.value,
|
|
331
|
+
class: "ml-auto",
|
|
332
|
+
onClick: e[2] || (e[2] = (x) => D())
|
|
333
|
+
}, null, 8, ["label", "disabled"])
|
|
334
|
+
]),
|
|
335
|
+
r.value ? (l(), d("p", ze, i(r.value), 1)) : $("", !0),
|
|
336
|
+
h.value ? (l(), d("div", Ve, [
|
|
337
|
+
_(q),
|
|
338
|
+
P(" " + i(u(n)("connect.whatsappBot.logs.loading")), 1)
|
|
339
|
+
])) : f.value ? (l(), d("div", Te, [
|
|
340
|
+
s("p", Ee, i(f.value), 1),
|
|
341
|
+
_(j, {
|
|
342
|
+
variant: "secondary",
|
|
343
|
+
"prepend-icon": "refresh",
|
|
344
|
+
label: u(n)("connect.whatsappBot.tryAgain"),
|
|
345
|
+
onClick: e[3] || (e[3] = (x) => D())
|
|
346
|
+
}, null, 8, ["label"])
|
|
347
|
+
])) : Y.value.length ? (l(), d("div", Ge, [
|
|
348
|
+
(l(!0), d(M, null, V(Y.value, (x) => (l(), I(Ie, {
|
|
349
|
+
key: x.id,
|
|
350
|
+
conversation: x,
|
|
351
|
+
"account-name": S(x.clientId),
|
|
352
|
+
timezone: t.value,
|
|
353
|
+
onNotificationGroup: K
|
|
354
|
+
}, null, 8, ["conversation", "account-name", "timezone"]))), 128))
|
|
355
|
+
])) : (l(), d("div", Je, [
|
|
356
|
+
s("h2", Ye, i(u(n)("connect.whatsappBot.logs.emptyTitle")), 1),
|
|
357
|
+
s("p", je, i(u(n)("connect.whatsappBot.logs.emptyDescription")), 1)
|
|
358
|
+
]))
|
|
359
|
+
]),
|
|
360
|
+
B.value ? (l(), I(le, {
|
|
361
|
+
key: 0,
|
|
362
|
+
modelValue: N.value,
|
|
363
|
+
"onUpdate:modelValue": e[4] || (e[4] = (x) => N.value = x),
|
|
364
|
+
account: B.value
|
|
365
|
+
}, null, 8, ["modelValue", "account"])) : $("", !0)
|
|
366
|
+
], 64);
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
export {
|
|
371
|
+
qe as default
|
|
372
|
+
};
|