@feedmepos/mf-connect 0.1.126-prod → 0.1.127-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-DRHHPaMz.js → App-CLrxVFgX.js} +224 -216
- package/dist/AuditLogs-DYlfToAk.js +2016 -0
- package/dist/{Bin-FkcYLSTm.js → Bin-C0CugBW4.js} +8 -8
- package/dist/{Broadcast-Cgqp_BMa.js → Broadcast-DhVQa_WW.js} +22 -21
- package/dist/{CampaignAnalytic-kKZ_BwW0.js → CampaignAnalytic-6jeG5U90.js} +97 -97
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CX0mWLjO.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cxydrkof.js} +9 -10
- package/dist/{Card-Bu1y37hV.js → Card-cpLj34Oy.js} +23 -23
- package/dist/{Collections-B3mJkBCT.js → Collections-CdRpJuHO.js} +197 -185
- package/dist/{Credit-Bn-2EcVy.js → Credit-E_N_yfnJ.js} +21 -20
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-Cz7pZ7LD.js → DateRangeChip.vue_vue_type_script_setup_true_lang-Dq-2vUqT.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSXO2bYC.js +4584 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-B7XBiv4l.js → EffectSheet.vue_vue_type_style_index_0_lang-BeQZjLIw.js} +33 -33
- package/dist/{Experience-CunbmoAu.js → Experience-D9i0ax4C.js} +32 -31
- package/dist/{FileSaver.min-ChFSxYyS.js → FileSaver.min-BOE2RBne.js} +1 -1
- package/dist/{Game-dFDwx_UJ.js → Game-CirwX_l1.js} +19 -18
- package/dist/{GiftCardSetup-DYpEqqX0.js → GiftCardSetup-DpJb_azW.js} +31 -31
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-DxJdI6gc.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-ff6Nfvxe.js} +140 -128
- package/dist/{Goals-DuZzgM_K.js → Goals-TejbPs-I.js} +4 -4
- package/dist/Grab-CeUX-LlF.js +301 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-lDulspkF.js → ImageInput.vue_vue_type_script_setup_true_lang-CnZzRDGS.js} +1 -1
- package/dist/{Index-BxB2ohT0.js → Index-gqWBDZBN.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-9sKJE1A5.js → LocationPicker.vue_vue_type_script_setup_true_lang-CzobgD7L.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CxBNYzcz.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DgeD1RQq.js} +1 -1
- package/dist/{LoyaltyDashboard-DQzGvQ7j.js → LoyaltyDashboard-R22oQHTd.js} +82 -82
- package/dist/{MainLayout-MAZ1S06H.js → MainLayout-pJBEBaM-.js} +1 -1
- package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-CeF3LU-N.js → MainLayout.vue_vue_type_script_setup_true_lang-IX_utv2Z.js} +3 -3
- package/dist/{Marketing-ACF6F7be.js → Marketing-5gMwO1jV.js} +4 -4
- package/dist/{MarketingMaterialEdit-B8NfkoHg.js → MarketingMaterialEdit-BaHNX_qE.js} +214 -211
- package/dist/{Member-rLxDUOr8.js → Member-Cd0oraEq.js} +7 -7
- package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-DzyM1fW_.js +1322 -0
- package/dist/{MemberImportHistory-BuG6DmdV.js → MemberImportHistory-C_RkY3fg.js} +7 -7
- package/dist/{MemberList-CC6zm_I6.js → MemberList-CJK1akUC.js} +103 -105
- package/dist/{MemberTransactions-Bw2xu6jZ.js → MemberTransactions-DP6schuy.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Cav8gQUK.js → MessageInput.vue_vue_type_script_setup_true_lang-BaivunRx.js} +12 -12
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-8wdY4FnI.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DOdYyPp2.js} +1 -1
- package/dist/{Mission-DnEcbALs.js → Mission-DJ40IcG9.js} +22 -21
- package/dist/{Overview-DShFohlk.js → Overview-CaQlLSBg.js} +145 -144
- package/dist/{Overview-COytI5xN.js → Overview-DXHjNmIO.js} +21 -21
- package/dist/{Point-CWYwlx0i.js → Point-D0Qqmgai.js} +22 -21
- package/dist/{Promotion-LBrQYtad.js → Promotion-CQU2-tpG.js} +137 -131
- package/dist/{Queue-DKg5EvDM.js → Queue-B-Uki3qh.js} +46 -46
- package/dist/{Record--lYpawLN.js → Record-BvQ0nVja.js} +9 -9
- package/dist/{Review-C4pNmJ7n.js → Review-DMfBPU_D.js} +2 -2
- package/dist/ReviewFacebookCallback-Bq6JQ7LR.js +225 -0
- package/dist/{ReviewGoogleCallback-ge8fL_A-.js → ReviewGoogleCallback-Bg9PFxog.js} +5 -5
- package/dist/{Reward-B67r1Bpz.js → Reward-CNC0z98e.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Bt0Kx2--.js → RewardGroup.vue_vue_type_script_setup_true_lang-DXr-5wJE.js} +14 -14
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-OznhirAU.js +1923 -0
- package/dist/{Segment-DeSC3z5G.js → Segment-V0ZQJkN-.js} +304 -307
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DdjC7X1V.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BmFp2pst.js} +15 -15
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Crys59UO.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-C0IbEZMG.js} +4 -4
- package/dist/{Setting-DiDcMU5E.js → Setting-DCb6IIrk.js} +17 -17
- package/dist/{SettingAdvertisements-3wMI9egH.js → SettingAdvertisements-Dc9XfzVl.js} +12 -12
- package/dist/Settings-BIjIfmFI.js +286 -0
- package/dist/{Store-DgefqByH.js → Store-DkoB_5IF.js} +29 -29
- package/dist/{StoreRewards-CS2h5RVB.js → StoreRewards-a4ujLMfY.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-gPR8sn4k.js → StoreTransactions.vue_vue_type_script_setup_true_lang-UbMY0RzG.js} +25 -25
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BWjb1wHV.js +7007 -0
- package/dist/{Tier-Cye6888q.js → Tier-1WKuUirS.js} +2583 -688
- package/dist/{Title-B1eJh5oy.js → Title-CznZg4jL.js} +96 -95
- package/dist/{Transaction-ouzdsBUx.js → Transaction-DBRQDmA3.js} +2 -2
- package/dist/{Upselling-CdQd2Fuk.js → Upselling-CjZvUUqn.js} +3 -3
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BSlxe1Hf.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DS4hdSE9.js} +26 -26
- package/dist/{Voucher-CJJt8VlJ.js → Voucher-Di6VhoSM.js} +19 -19
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BzbNaK6H.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BjSzCnBw.js} +12 -12
- package/dist/{WhatsappAccount-DIxSP6Tp.js → WhatsappAccount-DdXadlHI.js} +6 -6
- package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-L9Y5lAft.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-Cnlvi-GG.js} +1 -1
- package/dist/WhatsappBot-DwhQmZLJ.js +882 -0
- package/dist/{WhatsappBotLogs-D8IfLHk3.js → WhatsappBotLogs-BAglKUAZ.js} +66 -66
- package/dist/WhatsappBotSettings-DslJTj2X.js +945 -0
- package/dist/{WhatsappLayout-3rWwmGRd.js → WhatsappLayout-14847AOz.js} +3 -3
- package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-C3N-loYJ.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-otzgv6Jh.js} +3 -3
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-D1dORvMi.js → ZodTextField.vue_vue_type_script_setup_true_lang-BEY-LOVu.js} +2 -2
- package/dist/{app-BXqas0p1.js → app-KbxCI4gY.js} +4204 -3400
- package/dist/app.js +4 -3
- package/dist/{base.export-DQCZiS2E.js → base.export-DH8OxNrx.js} +2 -2
- package/dist/business-DuKNr9P7.js +83 -0
- package/dist/{campaign-C2X6aa7B.js → campaign-DR5xHhgA.js} +31 -25
- package/dist/{campaign-DASPASQ0.js → campaign-Ddv-RZgo.js} +121 -94
- package/dist/{campaign.enum-BqekIiiN.js → campaign.enum-DsaSpHDQ.js} +3 -2
- package/dist/campaign.fn-CJlEovlZ.js +776 -0
- package/dist/{collectible.enum-Liy2wH3s.js → collectible.enum-CDHT9uk3.js} +1 -1
- package/dist/{collection.fn-C7jNdh0A.js → collection.fn-DTZs-hUX.js} +2 -2
- package/dist/{currency-BvBM_Io9.js → currency-1-Yhpyv5.js} +1 -1
- package/dist/duplicateCampaign-BncSxYSg.js +51 -0
- package/dist/{effect-BA1yh6Mj.js → effect-TTD5--LN.js} +1 -1
- package/dist/{email-addresses-haS5P7hq.js → email-addresses-pxXp67Al.js} +2 -2
- package/dist/{feature-flag-B4bJnuei.js → feature-flag-CFVZl4ed.js} +84 -84
- package/dist/google-BQK68wbe.js +5 -0
- package/dist/{helper-BtTBvFuA.js → helper-BC_Cl5VR.js} +1 -1
- package/dist/{index-ChGZ_S3V.js → index-42Wl_5UE.js} +1 -1
- package/dist/{index-Dm2Dvxph.js → index-BRl7Besd.js} +23 -23
- package/dist/{index-DAtVp1NI.js → index-BxUMqeaY.js} +2700 -2614
- package/dist/{index-Dg972Dfv.js → index-ByFFDLTo.js} +1 -1
- package/dist/{index-DtbR7I4C.js → index-CBKbnJRo.js} +9 -9
- package/dist/index-CGtlXLTG.js +10767 -0
- package/dist/{index-CH-uRaZH.js → index-CRKdLbXL.js} +71 -52
- package/dist/{index-B1dAoOWi.js → index-CaHkqz0W.js} +19 -6
- package/dist/{index-DeomfIu9.js → index-CcXMYJxc.js} +609 -252
- package/dist/{index-B6A6sHpy.js → index-CkiP4iG6.js} +1 -1
- package/dist/{index-g_SHjVWE.js → index-D1iOPNg3.js} +1 -1
- package/dist/{index-D-D0s8PB.js → index-D2Nq0UoL.js} +381 -235
- package/dist/index-D4nA0Z7e.js +19528 -0
- package/dist/{index-BV-YiCDM.js → index-DHw8wo7T.js} +2 -2
- package/dist/{index-C2rjmdar.js → index-DKOoRHPf.js} +4 -4
- package/dist/{index-Q-iHraJ3.js → index-DcbPYZkw.js} +26 -19
- package/dist/{index-C7UBk5gq.js → index-DjwrfZk3.js} +35 -17
- package/dist/{index-BvFq5REc.js → index-EuZfRdBT.js} +10 -10
- package/dist/{index-CJ-BZCvB.js → index-H4XJDOoT.js} +1315 -1243
- package/dist/{index-CXznvd79.js → index-ImU7YXN7.js} +4 -4
- package/dist/{index-BRTy6G9c.js → index-N4EzkcEu.js} +2 -2
- package/dist/{index-CBfVFFME.js → index-j7eLKJK3.js} +198 -198
- package/dist/{index.esm2017-B7iE1Ggr.js → index.esm2017-CBo4j3U1.js} +93 -93
- package/dist/{loading-BvlSfSVK.js → loading-COAu2l7W.js} +1 -1
- package/dist/{lodash-Daey2k0N.js → lodash-Bu1ipIkR.js} +1 -1
- package/dist/{member-import-CF9aym_y.js → member-import-CkiTJIqy.js} +2 -2
- package/dist/{membership-DfG-fl80.js → membership-BSEeYyiz.js} +3 -3
- package/dist/{money-SBIQhxqf.js → money-BOaGQSGa.js} +1 -1
- package/dist/{number-Cp1bFK9U.js → number-B2AC2EMT.js} +1 -1
- package/dist/objectid-BKw48v5L.js +145 -0
- package/dist/{onboarding-bjc7C8O-.js → onboarding-ClA8xAnH.js} +25 -25
- package/dist/{onboardingSetup-BAu9TDI6.js → onboardingSetup-DHjnq0H1.js} +2 -2
- package/dist/{plugins-Def73Eyk.js → plugins-DewN43sP.js} +3 -3
- package/dist/{reward-KecVeztH.js → reward-deDdPQiR.js} +1 -1
- package/dist/{rule-kMIC0vOi.js → rule-B8ifutnO.js} +572 -492
- package/dist/style.css +1 -1
- package/dist/template-z3VMmWei.js +227 -0
- package/dist/timezone-BxJDy-bY.js +19 -0
- package/dist/{transaction.fn-Bjy5utxD.js → transaction.fn-CBBhq01K.js} +2 -2
- package/dist/{trigger-DnnOJVUi.js → trigger-B_quLwWr.js} +9 -9
- package/dist/{useMarketingMaterialActions-DMrNOpok.js → useMarketingMaterialActions-DqoRLx1M.js} +4 -4
- package/dist/{usePagination-BCY4a-dh.js → usePagination-Q1fPttcp.js} +1 -1
- package/dist/{user-BTc0S1Vx.js → user-Bw6h9xn-.js} +1 -1
- package/dist/vue-i18n-DpCS1FnK.js +2365 -0
- package/dist/{xlsx-DR5oLrEs.js → xlsx--toeD6hC.js} +1 -1
- package/dist/{zod-CMq39HWn.js → zod-BkNAcpay.js} +1 -1
- package/package.json +6 -2
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DIUEjCFW.js +0 -3638
- package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-Bq3UKX7v.js +0 -1308
- package/dist/ReviewFacebookCallback-BYXwKQNG.js +0 -238
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-fLtn32Rw.js +0 -1884
- package/dist/Settings-BR6Y1DBZ.js +0 -179
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-Cjnkpd1j.js +0 -142
- package/dist/WhatsappBot-BXxoaz7-.js +0 -878
- package/dist/WhatsappBotSettings-Bq9C7pNZ.js +0 -704
- package/dist/business-RsRhXSh8.js +0 -82
- package/dist/campaign.fn-BEX99lsa.js +0 -776
- package/dist/google-C3S8u0mT.js +0 -4
- package/dist/index-C_H8jFYf.js +0 -2743
- package/dist/index-D9zjHXFU.js +0 -27551
- package/dist/objectid-BMRA1fIL.js +0 -145
- package/dist/rule-builder-DgU6P24U.js +0 -102
- package/dist/template-BH9vS8A9.js +0 -275
- package/dist/timezone-CMX1sJ0a.js +0 -20
- package/dist/vue-i18n-7BKLPLxj.js +0 -2365
|
@@ -1,704 +0,0 @@
|
|
|
1
|
-
import { defineComponent as L, mergeModels as Z, useModel as H, openBlock as a, createElementBlock as i, createElementVNode as e, toDisplayString as l, unref as t, withDirectives as q, vModelText as re, resolveComponent as $, Fragment as O, renderList as ee, createBlock as P, ref as y, computed as E, watch as ce, onBeforeUnmount as ie, createCommentVNode as _, createVNode as S, createTextVNode as N, withCtx as ae, normalizeClass as X, vModelRadio as fe } from "vue";
|
|
2
|
-
import { u as U } from "./vue-i18n-7BKLPLxj.js";
|
|
3
|
-
import { useSnackbar as de } from "@feedmepos/ui-library";
|
|
4
|
-
import { F as J, a as W, b as ve, c as se, d as be, e as z, f as ge } from "./index-CH-uRaZH.js";
|
|
5
|
-
import { S as Q } from "./index-BvFq5REc.js";
|
|
6
|
-
import { w as Y } from "./index-C7UBk5gq.js";
|
|
7
|
-
import { p as he } from "./plugins-Def73Eyk.js";
|
|
8
|
-
const ye = { class: "flex flex-col gap-[10px]" }, _e = { class: "flex flex-col gap-[2px]" }, we = {
|
|
9
|
-
id: "whatsapp-bot-instructions-title",
|
|
10
|
-
class: "text-[16px] leading-[24px] font-semibold"
|
|
11
|
-
}, Be = {
|
|
12
|
-
id: "whatsapp-bot-instructions-description",
|
|
13
|
-
class: "text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]"
|
|
14
|
-
}, ke = { class: "flex flex-col gap-[6px]" }, Se = ["placeholder", "maxlength", "disabled"], $e = {
|
|
15
|
-
id: "whatsapp-bot-instructions-count",
|
|
16
|
-
class: "text-right text-[12px] leading-[16px] text-fm-color-typo-tertiary tabular-nums"
|
|
17
|
-
}, Ae = /* @__PURE__ */ L({
|
|
18
|
-
__name: "BotInstructions",
|
|
19
|
-
props: /* @__PURE__ */ Z({
|
|
20
|
-
disabled: { type: Boolean }
|
|
21
|
-
}, {
|
|
22
|
-
modelValue: { required: !0 },
|
|
23
|
-
modelModifiers: {}
|
|
24
|
-
}),
|
|
25
|
-
emits: ["update:modelValue"],
|
|
26
|
-
setup(p) {
|
|
27
|
-
const n = H(p, "modelValue"), { t: m } = U();
|
|
28
|
-
return (s, o) => (a(), i("div", ye, [
|
|
29
|
-
e("div", _e, [
|
|
30
|
-
e("h2", we, l(t(m)("connect.whatsappBot.botSettings.instructions")), 1),
|
|
31
|
-
e("p", Be, l(t(m)("connect.whatsappBot.botSettings.description")), 1)
|
|
32
|
-
]),
|
|
33
|
-
e("div", ke, [
|
|
34
|
-
q(e("textarea", {
|
|
35
|
-
"onUpdate:modelValue": o[0] || (o[0] = (v) => n.value = v),
|
|
36
|
-
"aria-labelledby": "whatsapp-bot-instructions-title",
|
|
37
|
-
"aria-describedby": "whatsapp-bot-instructions-description whatsapp-bot-instructions-count",
|
|
38
|
-
placeholder: t(m)("connect.whatsappBot.botSettings.placeholder"),
|
|
39
|
-
maxlength: t(J),
|
|
40
|
-
disabled: p.disabled,
|
|
41
|
-
rows: "6",
|
|
42
|
-
class: "block w-full min-h-[136px] resize-y rounded-[8px] border border-fm-color-neutral-gray-200 bg-fm-color-neutral-white p-[12px] text-[14px] leading-[20px] text-fm-color-typo-primary placeholder:text-fm-color-typo-tertiary transition-[border-color,box-shadow] focus:border-fm-color-primary focus:outline-none focus:ring-[4px] focus:ring-fm-color-primary/30 disabled:cursor-not-allowed disabled:bg-fm-color-neutral-gray-100 disabled:text-fm-color-typo-disabled"
|
|
43
|
-
}, null, 8, Se), [
|
|
44
|
-
[re, n.value]
|
|
45
|
-
]),
|
|
46
|
-
e("p", $e, l(n.value.length) + " / " + l(t(J)), 1)
|
|
47
|
-
])
|
|
48
|
-
]));
|
|
49
|
-
}
|
|
50
|
-
}), Te = { class: "overflow-x-auto" }, Ie = ["aria-label"], Fe = { class: "border-b border-fm-color-neutral-gray-100 bg-fm-color-neutral-gray-100/30 text-[12px] leading-[16px] text-fm-color-typo-tertiary" }, Ce = {
|
|
51
|
-
scope: "col",
|
|
52
|
-
class: "py-[10px] pl-[16px] pr-[8px] font-semibold"
|
|
53
|
-
}, Ee = {
|
|
54
|
-
scope: "col",
|
|
55
|
-
class: "px-[8px] py-[10px] font-semibold"
|
|
56
|
-
}, Ve = {
|
|
57
|
-
scope: "col",
|
|
58
|
-
class: "px-[8px] py-[10px] font-semibold"
|
|
59
|
-
}, Pe = {
|
|
60
|
-
scope: "col",
|
|
61
|
-
class: "py-[10px] pl-[8px] pr-[16px]"
|
|
62
|
-
}, Ne = { class: "sr-only" }, De = { class: "text-[14px] leading-[20px]" }, Oe = { class: "py-[8px] pl-[16px] pr-[8px] font-medium" }, Le = ["title"], Ue = { class: "px-[8px] py-[8px] text-fm-color-typo-secondary tabular-nums" }, Me = ["title"], Re = { class: "px-[8px] py-[8px] text-fm-color-typo-tertiary tabular-nums" }, We = ["datetime", "title"], ze = { class: "py-[8px] pl-[8px] pr-[16px]" }, He = ["aria-label", "disabled", "aria-busy", "onClick"], Ge = { key: 1 }, ne = /* @__PURE__ */ L({
|
|
63
|
-
__name: "ExcludedAccountsTable",
|
|
64
|
-
props: {
|
|
65
|
-
accounts: {},
|
|
66
|
-
removingId: {}
|
|
67
|
-
},
|
|
68
|
-
emits: ["remove"],
|
|
69
|
-
setup(p, { emit: n }) {
|
|
70
|
-
const m = n, { t: s, locale: o } = U();
|
|
71
|
-
function v(f) {
|
|
72
|
-
return f.customerName || f.phoneNumber || f.conversationId;
|
|
73
|
-
}
|
|
74
|
-
function u(f) {
|
|
75
|
-
return new Intl.DateTimeFormat(o.value, {
|
|
76
|
-
dateStyle: "medium",
|
|
77
|
-
timeStyle: "short"
|
|
78
|
-
}).format(new Date(f));
|
|
79
|
-
}
|
|
80
|
-
return (f, h) => {
|
|
81
|
-
const w = $("FmCircularProgress");
|
|
82
|
-
return a(), i("div", Te, [
|
|
83
|
-
e("table", {
|
|
84
|
-
"aria-label": t(s)("connect.whatsappBot.excludedAccounts.title"),
|
|
85
|
-
class: "w-full min-w-[600px] table-fixed border-collapse text-left"
|
|
86
|
-
}, [
|
|
87
|
-
h[0] || (h[0] = e("colgroup", null, [
|
|
88
|
-
e("col", { class: "w-[30%]" }),
|
|
89
|
-
e("col", { class: "w-[25%]" }),
|
|
90
|
-
e("col"),
|
|
91
|
-
e("col", { class: "w-[116px]" })
|
|
92
|
-
], -1)),
|
|
93
|
-
e("thead", Fe, [
|
|
94
|
-
e("tr", null, [
|
|
95
|
-
e("th", Ce, l(t(s)("connect.whatsappBot.excludedAccounts.name")), 1),
|
|
96
|
-
e("th", Ee, l(t(s)("connect.whatsappBot.excludedAccounts.phoneNumber")), 1),
|
|
97
|
-
e("th", Ve, l(t(s)("connect.whatsappBot.excludedAccounts.excludedOn")), 1),
|
|
98
|
-
e("th", Pe, [
|
|
99
|
-
e("span", Ne, l(t(s)("connect.whatsappBot.excludedAccounts.actions")), 1)
|
|
100
|
-
])
|
|
101
|
-
])
|
|
102
|
-
]),
|
|
103
|
-
e("tbody", De, [
|
|
104
|
-
(a(!0), i(O, null, ee(p.accounts, (r) => (a(), i("tr", {
|
|
105
|
-
key: r.id,
|
|
106
|
-
class: "border-b border-fm-color-neutral-gray-100 last:border-b-0"
|
|
107
|
-
}, [
|
|
108
|
-
e("td", Oe, [
|
|
109
|
-
e("span", {
|
|
110
|
-
class: "block truncate",
|
|
111
|
-
title: v(r)
|
|
112
|
-
}, l(v(r)), 9, Le)
|
|
113
|
-
]),
|
|
114
|
-
e("td", Ue, [
|
|
115
|
-
e("span", {
|
|
116
|
-
class: "block truncate",
|
|
117
|
-
title: r.phoneNumber || t(s)("connect.whatsappBot.phoneUnavailable")
|
|
118
|
-
}, l(r.phoneNumber || t(s)("connect.whatsappBot.phoneUnavailable")), 9, Me)
|
|
119
|
-
]),
|
|
120
|
-
e("td", Re, [
|
|
121
|
-
e("time", {
|
|
122
|
-
datetime: r.updatedAt,
|
|
123
|
-
title: u(r.updatedAt),
|
|
124
|
-
class: "block truncate"
|
|
125
|
-
}, l(u(r.updatedAt)), 9, We)
|
|
126
|
-
]),
|
|
127
|
-
e("td", ze, [
|
|
128
|
-
e("button", {
|
|
129
|
-
type: "button",
|
|
130
|
-
"aria-label": t(s)("connect.whatsappBot.excludedAccounts.removeAccount", {
|
|
131
|
-
name: v(r)
|
|
132
|
-
}),
|
|
133
|
-
disabled: !!p.removingId,
|
|
134
|
-
"aria-busy": p.removingId === r.id,
|
|
135
|
-
class: "flex h-[32px] w-[84px] items-center justify-center rounded-[8px] text-[14px] font-semibold text-fm-color-typo-secondary transition-colors hover:bg-fm-color-system-error-100 hover:text-fm-color-typo-error focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-fm-color-primary disabled:cursor-wait disabled:opacity-50",
|
|
136
|
-
onClick: (T) => m("remove", r)
|
|
137
|
-
}, [
|
|
138
|
-
p.removingId === r.id ? (a(), P(w, {
|
|
139
|
-
key: 0,
|
|
140
|
-
size: "md",
|
|
141
|
-
"aria-hidden": "true"
|
|
142
|
-
})) : (a(), i("span", Ge, l(t(s)("connect.common.remove")), 1))
|
|
143
|
-
], 8, He)
|
|
144
|
-
])
|
|
145
|
-
]))), 128))
|
|
146
|
-
])
|
|
147
|
-
], 8, Ie)
|
|
148
|
-
]);
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
}), Ke = {
|
|
152
|
-
id: "whatsapp-excluded-accounts",
|
|
153
|
-
"aria-labelledby": "whatsapp-excluded-accounts-title",
|
|
154
|
-
class: "flex min-w-0 flex-col gap-[12px]"
|
|
155
|
-
}, je = { class: "flex flex-col gap-[2px]" }, Xe = {
|
|
156
|
-
id: "whatsapp-excluded-accounts-title",
|
|
157
|
-
class: "text-[16px] leading-[24px] font-semibold"
|
|
158
|
-
}, Je = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]" }, Qe = {
|
|
159
|
-
key: 0,
|
|
160
|
-
role: "alert",
|
|
161
|
-
class: "text-[14px] text-fm-color-typo-error"
|
|
162
|
-
}, Ye = {
|
|
163
|
-
key: 1,
|
|
164
|
-
class: "flex flex-col items-center gap-[12px] py-[32px] text-[14px] text-fm-color-typo-secondary"
|
|
165
|
-
}, Ze = {
|
|
166
|
-
key: 0,
|
|
167
|
-
class: "flex flex-wrap items-center gap-[12px]"
|
|
168
|
-
}, qe = {
|
|
169
|
-
role: "alert",
|
|
170
|
-
class: "text-[14px] text-fm-color-typo-error"
|
|
171
|
-
}, et = {
|
|
172
|
-
key: 1,
|
|
173
|
-
class: "flex flex-col items-center gap-[6px] rounded-[16px] border border-fm-color-neutral-gray-200 px-[24px] py-[32px] text-center"
|
|
174
|
-
}, tt = { class: "text-[16px] leading-[24px] font-semibold" }, ot = { class: "max-w-[420px] text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]" }, lt = {
|
|
175
|
-
key: 2,
|
|
176
|
-
class: "overflow-hidden rounded-[16px] border border-fm-color-neutral-gray-100 bg-fm-color-neutral-white"
|
|
177
|
-
}, at = { class: "flex min-w-0 flex-col" }, st = { class: "text-[18px] leading-[24px] font-semibold" }, nt = { class: "text-[14px] leading-[20px] text-fm-color-typo-tertiary" }, rt = {
|
|
178
|
-
key: 0,
|
|
179
|
-
role: "alert",
|
|
180
|
-
class: "mb-[12px] text-[14px] text-fm-color-typo-error"
|
|
181
|
-
}, ct = {
|
|
182
|
-
key: 1,
|
|
183
|
-
class: "px-[24px] py-[40px] text-center text-[14px] text-fm-color-typo-secondary"
|
|
184
|
-
}, it = /* @__PURE__ */ L({
|
|
185
|
-
__name: "ExcludedAccounts",
|
|
186
|
-
props: {
|
|
187
|
-
accounts: {},
|
|
188
|
-
loading: { type: Boolean },
|
|
189
|
-
error: {}
|
|
190
|
-
},
|
|
191
|
-
emits: ["retry", "removed"],
|
|
192
|
-
setup(p, { emit: n }) {
|
|
193
|
-
const m = p, s = n, { t: o } = U(), v = de(), u = y(""), f = y(""), h = y(!1);
|
|
194
|
-
let w;
|
|
195
|
-
const r = E(
|
|
196
|
-
() => [...m.accounts].sort((x, b) => b.updatedAt.localeCompare(x.updatedAt))
|
|
197
|
-
), T = E(() => r.value.slice(0, 3));
|
|
198
|
-
async function C(x) {
|
|
199
|
-
if (u.value) return;
|
|
200
|
-
const b = Q.getBusinessId();
|
|
201
|
-
if (!b || x.businessId !== b) return;
|
|
202
|
-
const B = new AbortController();
|
|
203
|
-
w = B, u.value = x.id, f.value = "";
|
|
204
|
-
try {
|
|
205
|
-
if (await Y.removeExcludedAccount(
|
|
206
|
-
b,
|
|
207
|
-
x.id,
|
|
208
|
-
B.signal
|
|
209
|
-
), B.signal.aborted) return;
|
|
210
|
-
s("removed", x.id), v.open({
|
|
211
|
-
type: "success",
|
|
212
|
-
message: o("connect.whatsappBot.excludedAccounts.removed", {
|
|
213
|
-
name: x.customerName || x.phoneNumber || x.conversationId
|
|
214
|
-
})
|
|
215
|
-
});
|
|
216
|
-
} catch (I) {
|
|
217
|
-
B.signal.aborted || (f.value = I instanceof Error ? I.message : o("connect.whatsappBot.excludedAccounts.removeError"), v.open({ type: "error", message: f.value }));
|
|
218
|
-
} finally {
|
|
219
|
-
B.signal.aborted || (u.value = "");
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
function g() {
|
|
223
|
-
w == null || w.abort(), u.value = "", f.value = "", h.value = !1;
|
|
224
|
-
}
|
|
225
|
-
return ce(() => Q.getBusinessId(), g), ie(g), (x, b) => {
|
|
226
|
-
const B = $("FmCircularProgress"), I = $("FmButton"), G = $("FmIcon"), K = $("FmDialog");
|
|
227
|
-
return a(), i(O, null, [
|
|
228
|
-
e("section", Ke, [
|
|
229
|
-
e("div", je, [
|
|
230
|
-
e("h2", Xe, l(t(o)("connect.whatsappBot.excludedAccounts.title")), 1),
|
|
231
|
-
e("p", Je, l(t(o)("connect.whatsappBot.excludedAccounts.description")), 1)
|
|
232
|
-
]),
|
|
233
|
-
f.value ? (a(), i("p", Qe, l(f.value), 1)) : _("", !0),
|
|
234
|
-
p.loading ? (a(), i("output", Ye, [
|
|
235
|
-
S(B),
|
|
236
|
-
N(" " + l(t(o)("connect.whatsappBot.excludedAccounts.loading")), 1)
|
|
237
|
-
])) : (a(), i(O, { key: 2 }, [
|
|
238
|
-
p.error ? (a(), i("div", Ze, [
|
|
239
|
-
e("p", qe, l(p.error), 1),
|
|
240
|
-
S(I, {
|
|
241
|
-
variant: "secondary",
|
|
242
|
-
"border-color": "neutral-gray-200",
|
|
243
|
-
label: t(o)("connect.whatsappBot.tryAgain"),
|
|
244
|
-
"prepend-icon": "refresh",
|
|
245
|
-
class: "!rounded-full [&_.label]:text-[14px]",
|
|
246
|
-
onClick: b[0] || (b[0] = (V) => s("retry"))
|
|
247
|
-
}, null, 8, ["label"])
|
|
248
|
-
])) : _("", !0),
|
|
249
|
-
!r.value.length && !p.error ? (a(), i("div", et, [
|
|
250
|
-
e("h3", tt, l(t(o)("connect.whatsappBot.excludedAccounts.emptyTitle")), 1),
|
|
251
|
-
e("p", ot, l(t(o)("connect.whatsappBot.excludedAccounts.emptyDescription")), 1)
|
|
252
|
-
])) : r.value.length ? (a(), i("div", lt, [
|
|
253
|
-
S(ne, {
|
|
254
|
-
accounts: T.value,
|
|
255
|
-
"removing-id": u.value,
|
|
256
|
-
onRemove: C
|
|
257
|
-
}, null, 8, ["accounts", "removing-id"]),
|
|
258
|
-
r.value.length > T.value.length ? (a(), i("button", {
|
|
259
|
-
key: 0,
|
|
260
|
-
type: "button",
|
|
261
|
-
class: "flex min-h-[44px] w-full items-center justify-center gap-[6px] border-t border-fm-color-neutral-gray-100 px-[16px] py-[8px] text-[14px] font-semibold text-fm-color-primary transition-colors hover:bg-fm-color-primary-oats focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-inset focus-visible:ring-fm-color-primary",
|
|
262
|
-
onClick: b[1] || (b[1] = (V) => h.value = !0)
|
|
263
|
-
}, [
|
|
264
|
-
N(l(t(o)("connect.whatsappBot.excludedAccounts.showAll", {
|
|
265
|
-
count: r.value.length
|
|
266
|
-
})) + " ", 1),
|
|
267
|
-
S(G, {
|
|
268
|
-
name: "chevron_right",
|
|
269
|
-
size: "sm",
|
|
270
|
-
"aria-hidden": "true"
|
|
271
|
-
})
|
|
272
|
-
])) : _("", !0)
|
|
273
|
-
])) : _("", !0)
|
|
274
|
-
], 64))
|
|
275
|
-
]),
|
|
276
|
-
S(K, {
|
|
277
|
-
modelValue: h.value,
|
|
278
|
-
"onUpdate:modelValue": b[2] || (b[2] = (V) => h.value = V),
|
|
279
|
-
"min-width": "min(720px, calc(100% - 32px))",
|
|
280
|
-
"max-width": "720px",
|
|
281
|
-
"max-height": "90vh",
|
|
282
|
-
"dismiss-away": ""
|
|
283
|
-
}, {
|
|
284
|
-
"dialog-header": ae(() => [
|
|
285
|
-
e("div", at, [
|
|
286
|
-
e("h2", st, l(t(o)("connect.whatsappBot.excludedAccounts.title")), 1),
|
|
287
|
-
e("p", nt, l(t(o)("connect.whatsappBot.accountCount", r.value.length)), 1)
|
|
288
|
-
])
|
|
289
|
-
]),
|
|
290
|
-
default: ae(() => [
|
|
291
|
-
f.value ? (a(), i("p", rt, l(f.value), 1)) : _("", !0),
|
|
292
|
-
r.value.length ? (a(), P(ne, {
|
|
293
|
-
key: 2,
|
|
294
|
-
accounts: r.value,
|
|
295
|
-
"removing-id": u.value,
|
|
296
|
-
onRemove: C
|
|
297
|
-
}, null, 8, ["accounts", "removing-id"])) : (a(), i("p", ct, l(t(o)("connect.whatsappBot.excludedAccounts.emptyTitle")), 1))
|
|
298
|
-
]),
|
|
299
|
-
_: 1
|
|
300
|
-
}, 8, ["modelValue"])
|
|
301
|
-
], 64);
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
}), dt = {
|
|
305
|
-
"aria-labelledby": "knowledge-base-title",
|
|
306
|
-
class: "flex flex-col gap-[10px]"
|
|
307
|
-
}, pt = { class: "flex flex-col gap-[2px]" }, ut = {
|
|
308
|
-
id: "knowledge-base-title",
|
|
309
|
-
class: "text-[16px] leading-[24px] font-semibold"
|
|
310
|
-
}, mt = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]" }, xt = { class: "flex flex-wrap gap-[8px]" }, ft = ["title", "aria-expanded", "disabled", "onClick"], vt = ["disabled"], bt = {
|
|
311
|
-
key: 0,
|
|
312
|
-
class: "text-[14px] text-fm-color-typo-tertiary"
|
|
313
|
-
}, gt = {
|
|
314
|
-
key: 1,
|
|
315
|
-
class: "text-[14px] text-fm-color-typo-secondary"
|
|
316
|
-
}, ht = { class: "flex flex-col gap-[6px]" }, yt = {
|
|
317
|
-
for: "whatsapp-knowledge-topic-description",
|
|
318
|
-
class: "text-[14px] leading-[20px] font-medium text-fm-color-typo-secondary"
|
|
319
|
-
}, _t = ["placeholder", "maxlength", "disabled"], wt = {
|
|
320
|
-
id: "whatsapp-knowledge-topic-description-count",
|
|
321
|
-
class: "text-right text-[12px] leading-[16px] text-fm-color-typo-tertiary tabular-nums"
|
|
322
|
-
}, Bt = /* @__PURE__ */ L({
|
|
323
|
-
__name: "KnowledgeBase",
|
|
324
|
-
props: /* @__PURE__ */ Z({
|
|
325
|
-
disabled: { type: Boolean }
|
|
326
|
-
}, {
|
|
327
|
-
modelValue: {
|
|
328
|
-
required: !0
|
|
329
|
-
},
|
|
330
|
-
modelModifiers: {},
|
|
331
|
-
activeTopicIndex: {
|
|
332
|
-
required: !0
|
|
333
|
-
},
|
|
334
|
-
activeTopicIndexModifiers: {}
|
|
335
|
-
}),
|
|
336
|
-
emits: ["update:modelValue", "update:activeTopicIndex"],
|
|
337
|
-
setup(p) {
|
|
338
|
-
const n = p, m = H(p, "modelValue"), s = H(p, "activeTopicIndex"), { t: o } = U(), v = E(
|
|
339
|
-
() => s.value === null ? null : m.value[s.value]
|
|
340
|
-
);
|
|
341
|
-
function u() {
|
|
342
|
-
n.disabled || m.value.length >= W || (m.value.push({ title: "", description: "" }), s.value = m.value.length - 1);
|
|
343
|
-
}
|
|
344
|
-
function f() {
|
|
345
|
-
n.disabled || s.value === null || (m.value.splice(s.value, 1), s.value = null);
|
|
346
|
-
}
|
|
347
|
-
return (h, w) => {
|
|
348
|
-
const r = $("FmIcon"), T = $("FmTextField"), C = $("FmButton");
|
|
349
|
-
return a(), i("section", dt, [
|
|
350
|
-
e("div", pt, [
|
|
351
|
-
e("h2", ut, l(t(o)("connect.whatsappBot.botSettings.knowledgeBase.title")), 1),
|
|
352
|
-
e("p", mt, l(t(o)("connect.whatsappBot.botSettings.knowledgeBase.description")), 1)
|
|
353
|
-
]),
|
|
354
|
-
e("div", xt, [
|
|
355
|
-
(a(!0), i(O, null, ee(m.value, (g, x) => (a(), i("button", {
|
|
356
|
-
key: x,
|
|
357
|
-
type: "button",
|
|
358
|
-
title: g.title.trim() || t(o)("connect.whatsappBot.botSettings.knowledgeBase.untitled"),
|
|
359
|
-
"aria-expanded": s.value === x,
|
|
360
|
-
"aria-controls": "knowledge-topic-editor",
|
|
361
|
-
disabled: p.disabled,
|
|
362
|
-
class: X(["h-[32px] max-w-[240px] rounded-[8px] border-[1px] px-[12px] truncate text-[14px] font-medium transition-colors focus-visible:ring-2 focus-visible:ring-fm-color-primary disabled:opacity-60", [
|
|
363
|
-
s.value === x ? "border-fm-color-primary bg-fm-color-primary-oats text-fm-color-primary" : "border-fm-color-neutral-gray-200 bg-fm-color-neutral-white",
|
|
364
|
-
p.disabled ? "cursor-default" : "cursor-pointer hover:border-fm-color-primary"
|
|
365
|
-
]]),
|
|
366
|
-
onClick: (b) => s.value = s.value === x ? null : x
|
|
367
|
-
}, l(g.title.trim() || t(o)("connect.whatsappBot.botSettings.knowledgeBase.untitled")), 11, ft))), 128)),
|
|
368
|
-
e("button", {
|
|
369
|
-
type: "button",
|
|
370
|
-
disabled: p.disabled || m.value.length >= t(W),
|
|
371
|
-
class: "h-[32px] rounded-[8px] border-[1px] border-dashed border-fm-color-neutral-gray-200 bg-fm-color-neutral-white px-[12px] flex items-center gap-[6px] text-[14px] font-semibold text-fm-color-primary hover:border-fm-color-primary focus-visible:ring-2 focus-visible:ring-fm-color-primary disabled:opacity-60 disabled:cursor-default",
|
|
372
|
-
onClick: u
|
|
373
|
-
}, [
|
|
374
|
-
S(r, {
|
|
375
|
-
name: "add",
|
|
376
|
-
size: "sm"
|
|
377
|
-
}),
|
|
378
|
-
N(" " + l(t(o)("connect.whatsappBot.botSettings.knowledgeBase.addTopic")), 1)
|
|
379
|
-
], 8, vt)
|
|
380
|
-
]),
|
|
381
|
-
m.value.length === 0 ? (a(), i("p", bt, l(t(o)("connect.whatsappBot.botSettings.knowledgeBase.empty")), 1)) : _("", !0),
|
|
382
|
-
m.value.length >= t(W) ? (a(), i("p", gt, l(t(o)("connect.whatsappBot.botSettings.knowledgeBase.topicLimit", {
|
|
383
|
-
count: t(W)
|
|
384
|
-
})), 1)) : _("", !0),
|
|
385
|
-
v.value ? (a(), i("div", {
|
|
386
|
-
id: "knowledge-topic-editor",
|
|
387
|
-
key: s.value ?? void 0,
|
|
388
|
-
class: "rounded-[8px] border-[1px] border-fm-color-neutral-gray-100 p-[16px] flex flex-col gap-[10px]"
|
|
389
|
-
}, [
|
|
390
|
-
S(T, {
|
|
391
|
-
modelValue: v.value.title,
|
|
392
|
-
"onUpdate:modelValue": w[0] || (w[0] = (g) => v.value.title = g),
|
|
393
|
-
label: t(o)("connect.whatsappBot.botSettings.knowledgeBase.titleLabel"),
|
|
394
|
-
placeholder: t(o)("connect.whatsappBot.botSettings.knowledgeBase.titlePlaceholder"),
|
|
395
|
-
"max-length": t(ve),
|
|
396
|
-
disabled: p.disabled
|
|
397
|
-
}, null, 8, ["modelValue", "label", "placeholder", "max-length", "disabled"]),
|
|
398
|
-
e("div", ht, [
|
|
399
|
-
e("label", yt, l(t(o)("connect.whatsappBot.botSettings.knowledgeBase.descriptionLabel")), 1),
|
|
400
|
-
q(e("textarea", {
|
|
401
|
-
id: "whatsapp-knowledge-topic-description",
|
|
402
|
-
"onUpdate:modelValue": w[1] || (w[1] = (g) => v.value.description = g),
|
|
403
|
-
"aria-describedby": "whatsapp-knowledge-topic-description-count",
|
|
404
|
-
placeholder: t(o)(
|
|
405
|
-
"connect.whatsappBot.botSettings.knowledgeBase.descriptionPlaceholder"
|
|
406
|
-
),
|
|
407
|
-
maxlength: t(se),
|
|
408
|
-
disabled: p.disabled,
|
|
409
|
-
rows: "5",
|
|
410
|
-
class: "block w-full min-h-[116px] resize-y rounded-[8px] border border-fm-color-neutral-gray-200 bg-fm-color-neutral-white px-[12px] py-[8px] text-[14px] leading-[20px] text-fm-color-typo-primary placeholder:text-fm-color-typo-tertiary transition-[border-color,box-shadow] focus:border-fm-color-primary focus:outline-none focus:ring-[4px] focus:ring-fm-color-primary/30 disabled:cursor-not-allowed disabled:bg-fm-color-neutral-gray-100 disabled:text-fm-color-typo-disabled"
|
|
411
|
-
}, null, 8, _t), [
|
|
412
|
-
[re, v.value.description]
|
|
413
|
-
]),
|
|
414
|
-
e("p", wt, l(v.value.description.length) + " / " + l(t(se)), 1)
|
|
415
|
-
]),
|
|
416
|
-
S(C, {
|
|
417
|
-
variant: "plain",
|
|
418
|
-
size: "sm",
|
|
419
|
-
"prepend-icon": "delete",
|
|
420
|
-
"text-color": "typo-error",
|
|
421
|
-
label: t(o)("connect.whatsappBot.botSettings.knowledgeBase.removeTopic"),
|
|
422
|
-
disabled: p.disabled,
|
|
423
|
-
class: "self-start",
|
|
424
|
-
onClick: f
|
|
425
|
-
}, null, 8, ["label", "disabled"])
|
|
426
|
-
])) : _("", !0)
|
|
427
|
-
]);
|
|
428
|
-
};
|
|
429
|
-
}
|
|
430
|
-
}), kt = {
|
|
431
|
-
"aria-labelledby": "response-speed-title",
|
|
432
|
-
class: "flex flex-col gap-[12px]"
|
|
433
|
-
}, St = { class: "flex flex-col gap-[2px]" }, $t = {
|
|
434
|
-
id: "response-speed-title",
|
|
435
|
-
class: "text-[16px] leading-[24px] font-semibold"
|
|
436
|
-
}, At = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]" }, Tt = {
|
|
437
|
-
role: "radiogroup",
|
|
438
|
-
"aria-labelledby": "response-speed-title",
|
|
439
|
-
"aria-describedby": "response-speed-detail",
|
|
440
|
-
class: "grid grid-cols-[repeat(auto-fit,minmax(150px,1fr))] gap-[8px]"
|
|
441
|
-
}, It = ["value", "disabled"], Ft = { class: "flex items-center gap-[8px] text-[14px] leading-[20px] font-semibold" }, Ct = {
|
|
442
|
-
key: 0,
|
|
443
|
-
class: "w-[8px] h-[8px] rounded-full bg-fm-color-primary"
|
|
444
|
-
}, Et = { class: "text-[12px] leading-[16px] text-fm-color-typo-secondary" }, Vt = {
|
|
445
|
-
id: "response-speed-detail",
|
|
446
|
-
"aria-live": "polite",
|
|
447
|
-
class: "text-[14px] leading-[20px] text-fm-color-typo-secondary"
|
|
448
|
-
}, Pt = {
|
|
449
|
-
key: 0,
|
|
450
|
-
class: "rounded-[8px] bg-fm-color-system-warning-100 px-[12px] py-[10px] flex items-start gap-[10px] text-[14px] leading-[20px]"
|
|
451
|
-
}, Nt = /* @__PURE__ */ L({
|
|
452
|
-
__name: "ResponseSpeed",
|
|
453
|
-
props: /* @__PURE__ */ Z({
|
|
454
|
-
disabled: { type: Boolean }
|
|
455
|
-
}, {
|
|
456
|
-
modelValue: {
|
|
457
|
-
required: !0
|
|
458
|
-
},
|
|
459
|
-
modelModifiers: {}
|
|
460
|
-
}),
|
|
461
|
-
emits: ["update:modelValue"],
|
|
462
|
-
setup(p) {
|
|
463
|
-
const n = H(p, "modelValue"), { t: m } = U();
|
|
464
|
-
return (s, o) => {
|
|
465
|
-
const v = $("FmIcon");
|
|
466
|
-
return a(), i("section", kt, [
|
|
467
|
-
e("div", St, [
|
|
468
|
-
e("h2", $t, l(t(m)("connect.whatsappBot.botSettings.responseSpeed.title")), 1),
|
|
469
|
-
e("p", At, l(t(m)("connect.whatsappBot.botSettings.responseSpeed.description")), 1)
|
|
470
|
-
]),
|
|
471
|
-
e("div", Tt, [
|
|
472
|
-
(a(!0), i(O, null, ee(t(be), (u) => (a(), i("label", { key: u }, [
|
|
473
|
-
q(e("input", {
|
|
474
|
-
"onUpdate:modelValue": o[0] || (o[0] = (f) => n.value = f),
|
|
475
|
-
type: "radio",
|
|
476
|
-
name: "response-speed",
|
|
477
|
-
value: u,
|
|
478
|
-
disabled: p.disabled,
|
|
479
|
-
class: "sr-only peer"
|
|
480
|
-
}, null, 8, It), [
|
|
481
|
-
[fe, n.value]
|
|
482
|
-
]),
|
|
483
|
-
e("span", {
|
|
484
|
-
class: X(["h-full border-[1px] rounded-[8px] p-[12px] flex flex-col gap-[4px] transition-colors peer-focus-visible:ring-2 peer-focus-visible:ring-fm-color-primary", [
|
|
485
|
-
n.value === u ? "border-fm-color-primary bg-fm-color-primary-oats" : "border-fm-color-neutral-gray-200 bg-fm-color-neutral-white",
|
|
486
|
-
p.disabled ? "cursor-default opacity-60" : "cursor-pointer hover:border-fm-color-primary"
|
|
487
|
-
]])
|
|
488
|
-
}, [
|
|
489
|
-
e("span", Ft, [
|
|
490
|
-
e("span", {
|
|
491
|
-
"aria-hidden": "true",
|
|
492
|
-
class: X([
|
|
493
|
-
"w-[16px] h-[16px] shrink-0 rounded-full border-[1.5px] bg-fm-color-neutral-white flex items-center justify-center",
|
|
494
|
-
n.value === u ? "border-fm-color-primary" : "border-fm-color-neutral-gray-300"
|
|
495
|
-
])
|
|
496
|
-
}, [
|
|
497
|
-
n.value === u ? (a(), i("span", Ct)) : _("", !0)
|
|
498
|
-
], 2),
|
|
499
|
-
N(" " + l(t(m)(`connect.whatsappBot.botSettings.responseSpeed.${u}.label`)), 1)
|
|
500
|
-
]),
|
|
501
|
-
e("span", Et, l(t(m)(`connect.whatsappBot.botSettings.responseSpeed.${u}.hint`)), 1)
|
|
502
|
-
], 2)
|
|
503
|
-
]))), 128))
|
|
504
|
-
]),
|
|
505
|
-
e("p", Vt, l(t(m)(
|
|
506
|
-
`connect.whatsappBot.botSettings.responseSpeed.${n.value}.detail`
|
|
507
|
-
)), 1),
|
|
508
|
-
n.value === "immediate" ? (a(), i("div", Pt, [
|
|
509
|
-
S(v, {
|
|
510
|
-
name: "warning",
|
|
511
|
-
size: "sm",
|
|
512
|
-
class: "mt-[2px] shrink-0 text-fm-color-typo-warning"
|
|
513
|
-
}),
|
|
514
|
-
N(" " + l(t(m)("connect.whatsappBot.botSettings.responseSpeed.immediateWarning")), 1)
|
|
515
|
-
])) : _("", !0)
|
|
516
|
-
]);
|
|
517
|
-
};
|
|
518
|
-
}
|
|
519
|
-
}), Dt = { class: "mt-[20px] mx-auto w-full min-w-0 flex flex-col gap-[20px]" }, Ot = {
|
|
520
|
-
key: 0,
|
|
521
|
-
class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
|
|
522
|
-
}, Lt = { class: "border-t border-fm-color-neutral-gray-100 pt-[20px]" }, Ut = { class: "group border-t border-fm-color-neutral-gray-100 pt-[12px]" }, Mt = { class: "flex h-[36px] w-fit cursor-pointer list-none items-center gap-[8px] rounded-[8px] px-[8px] -ml-[8px] text-[16px] font-semibold transition-colors hover:bg-fm-color-neutral-gray-100 focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-fm-color-primary [&::-webkit-details-marker]:hidden" }, Rt = { class: "mt-[20px] flex flex-col gap-[20px]" }, Wt = {
|
|
523
|
-
key: 1,
|
|
524
|
-
role: "alert",
|
|
525
|
-
class: "text-[14px] text-fm-color-typo-error"
|
|
526
|
-
}, zt = { class: "flex items-center justify-end gap-[12px] flex-wrap" }, Yt = /* @__PURE__ */ L({
|
|
527
|
-
__name: "WhatsappBotSettings",
|
|
528
|
-
setup(p) {
|
|
529
|
-
const { t: n } = U(), m = de(), s = E(() => Q.getBusinessId() ?? ""), o = y(""), v = y(""), u = y([]), f = y([]), h = y(null), w = E(
|
|
530
|
-
() => u.value.filter(
|
|
531
|
-
(d) => d.title.trim() || d.description.trim()
|
|
532
|
-
)
|
|
533
|
-
), r = y(
|
|
534
|
-
z
|
|
535
|
-
), T = y(
|
|
536
|
-
z
|
|
537
|
-
), C = y(!0), g = y(!1), x = y(!1), b = y(""), B = y([]), I = y(""), G = J, K = E(
|
|
538
|
-
() => o.value !== v.value || r.value !== T.value || JSON.stringify(u.value) !== JSON.stringify(f.value)
|
|
539
|
-
), V = E(
|
|
540
|
-
() => !g.value || x.value || !K.value
|
|
541
|
-
), te = E(
|
|
542
|
-
() => !g.value || x.value || o.value.length > G || !ge.safeParse(w.value).success
|
|
543
|
-
);
|
|
544
|
-
let A, M;
|
|
545
|
-
function oe(d) {
|
|
546
|
-
B.value = d.excludedAccounts, o.value = d.botInstructions, v.value = d.botInstructions, r.value = d.responseSpeed, T.value = d.responseSpeed, u.value = d.knowledgeBase.map((c) => ({ ...c })), f.value = d.knowledgeBase.map((c) => ({
|
|
547
|
-
...c
|
|
548
|
-
}));
|
|
549
|
-
}
|
|
550
|
-
function pe(d, c) {
|
|
551
|
-
const k = d instanceof Error ? d.message : n("connect.whatsappBot.errors.loadSettings");
|
|
552
|
-
c ? I.value = k : b.value = k;
|
|
553
|
-
}
|
|
554
|
-
async function R(d = !1) {
|
|
555
|
-
if (d && x.value) return;
|
|
556
|
-
clearTimeout(M), A == null || A.abort();
|
|
557
|
-
const c = new AbortController();
|
|
558
|
-
A = c, d || (C.value = !0, g.value = !1, x.value = !1, b.value = "", o.value = "", v.value = "", r.value = z, T.value = z, u.value = [], f.value = [], h.value = null, B.value = [], I.value = "");
|
|
559
|
-
try {
|
|
560
|
-
if (!s.value)
|
|
561
|
-
throw new Error(n("connect.whatsappBot.errors.selectBusiness"));
|
|
562
|
-
const k = await Y.getSettings(
|
|
563
|
-
s.value,
|
|
564
|
-
c.signal
|
|
565
|
-
);
|
|
566
|
-
if (c.signal.aborted) return;
|
|
567
|
-
B.value = k.excludedAccounts, I.value = "", d || (oe(k), g.value = !0);
|
|
568
|
-
} catch (k) {
|
|
569
|
-
c.signal.aborted || pe(k, d);
|
|
570
|
-
} finally {
|
|
571
|
-
c.signal.aborted || (C.value = !1, g.value && le());
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
function le() {
|
|
575
|
-
clearTimeout(M), M = setTimeout(() => void R(!0), 1e4);
|
|
576
|
-
}
|
|
577
|
-
function ue(d) {
|
|
578
|
-
B.value = B.value.filter(
|
|
579
|
-
(c) => c.id !== d
|
|
580
|
-
), R(!0);
|
|
581
|
-
}
|
|
582
|
-
async function me() {
|
|
583
|
-
if (te.value) return;
|
|
584
|
-
clearTimeout(M), A == null || A.abort();
|
|
585
|
-
const d = new AbortController();
|
|
586
|
-
A = d, x.value = !0, b.value = "";
|
|
587
|
-
const c = h.value === null ? void 0 : u.value[h.value], k = c ? w.value.indexOf(c) : -1;
|
|
588
|
-
try {
|
|
589
|
-
const D = await Y.saveSettings(
|
|
590
|
-
s.value,
|
|
591
|
-
{
|
|
592
|
-
botInstructions: o.value,
|
|
593
|
-
responseSpeed: r.value,
|
|
594
|
-
knowledgeBase: w.value
|
|
595
|
-
},
|
|
596
|
-
d.signal
|
|
597
|
-
);
|
|
598
|
-
if (d.signal.aborted) return;
|
|
599
|
-
oe(D), h.value = k < 0 ? null : k, m.open({
|
|
600
|
-
type: "success",
|
|
601
|
-
message: n("connect.whatsappBot.botSettings.saved")
|
|
602
|
-
});
|
|
603
|
-
} catch (D) {
|
|
604
|
-
d.signal.aborted || (b.value = D instanceof Error ? D.message : n("connect.whatsappBot.errors.saveSettings"), m.open({ type: "error", message: b.value }));
|
|
605
|
-
} finally {
|
|
606
|
-
d.signal.aborted || (x.value = !1, le());
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
async function xe() {
|
|
610
|
-
if (V.value) return;
|
|
611
|
-
const d = s.value;
|
|
612
|
-
!await he.confirm(
|
|
613
|
-
n("connect.whatsappBot.botSettings.discardChangesMessage"),
|
|
614
|
-
n("connect.whatsappBot.botSettings.discardChangesTitle"),
|
|
615
|
-
n("connect.common.confirm"),
|
|
616
|
-
n("connect.common.cancel")
|
|
617
|
-
) || V.value || s.value !== d || (o.value = v.value, r.value = T.value, u.value = f.value.map((k) => ({ ...k })), h.value = null);
|
|
618
|
-
}
|
|
619
|
-
return ce(s, () => void R(), { immediate: !0 }), ie(() => {
|
|
620
|
-
A == null || A.abort(), clearTimeout(M);
|
|
621
|
-
}), (d, c) => {
|
|
622
|
-
const k = $("FmCircularProgress"), D = $("FmIcon"), j = $("FmButton");
|
|
623
|
-
return a(), i("div", Dt, [
|
|
624
|
-
C.value ? (a(), i("output", Ot, [
|
|
625
|
-
S(k),
|
|
626
|
-
N(" " + l(t(n)("connect.whatsappBot.botSettings.loading")), 1)
|
|
627
|
-
])) : (a(), i(O, { key: 1 }, [
|
|
628
|
-
g.value ? (a(), P(Ae, {
|
|
629
|
-
key: 0,
|
|
630
|
-
modelValue: o.value,
|
|
631
|
-
"onUpdate:modelValue": c[0] || (c[0] = (F) => o.value = F),
|
|
632
|
-
disabled: x.value
|
|
633
|
-
}, null, 8, ["modelValue", "disabled"])) : _("", !0),
|
|
634
|
-
e("div", Lt, [
|
|
635
|
-
g.value ? (a(), P(it, {
|
|
636
|
-
key: 0,
|
|
637
|
-
accounts: B.value,
|
|
638
|
-
loading: !1,
|
|
639
|
-
error: I.value,
|
|
640
|
-
onRetry: c[1] || (c[1] = (F) => R(!0)),
|
|
641
|
-
onRemoved: ue
|
|
642
|
-
}, null, 8, ["accounts", "error"])) : _("", !0)
|
|
643
|
-
]),
|
|
644
|
-
e("details", Ut, [
|
|
645
|
-
e("summary", Mt, [
|
|
646
|
-
N(l(t(n)("connect.whatsappBot.botSettings.advancedSettings")) + " ", 1),
|
|
647
|
-
S(D, {
|
|
648
|
-
name: "keyboard_arrow_down",
|
|
649
|
-
size: "sm",
|
|
650
|
-
class: "transition-transform group-open:rotate-180 motion-reduce:transition-none",
|
|
651
|
-
"aria-hidden": "true"
|
|
652
|
-
})
|
|
653
|
-
]),
|
|
654
|
-
e("div", Rt, [
|
|
655
|
-
g.value ? (a(), P(Bt, {
|
|
656
|
-
key: 0,
|
|
657
|
-
modelValue: u.value,
|
|
658
|
-
"onUpdate:modelValue": c[2] || (c[2] = (F) => u.value = F),
|
|
659
|
-
"active-topic-index": h.value,
|
|
660
|
-
"onUpdate:activeTopicIndex": c[3] || (c[3] = (F) => h.value = F),
|
|
661
|
-
disabled: x.value
|
|
662
|
-
}, null, 8, ["modelValue", "active-topic-index", "disabled"])) : _("", !0),
|
|
663
|
-
g.value ? (a(), P(Nt, {
|
|
664
|
-
key: 1,
|
|
665
|
-
modelValue: r.value,
|
|
666
|
-
"onUpdate:modelValue": c[4] || (c[4] = (F) => r.value = F),
|
|
667
|
-
disabled: x.value,
|
|
668
|
-
class: "border-t border-fm-color-neutral-gray-100 pt-[20px]"
|
|
669
|
-
}, null, 8, ["modelValue", "disabled"])) : _("", !0)
|
|
670
|
-
])
|
|
671
|
-
]),
|
|
672
|
-
b.value ? (a(), i("p", Wt, l(b.value), 1)) : _("", !0),
|
|
673
|
-
g.value ? _("", !0) : (a(), P(j, {
|
|
674
|
-
key: 2,
|
|
675
|
-
class: "self-start !rounded-full [&_.label]:text-[14px]",
|
|
676
|
-
label: t(n)("connect.whatsappBot.tryAgain"),
|
|
677
|
-
"prepend-icon": "refresh",
|
|
678
|
-
onClick: c[5] || (c[5] = (F) => R())
|
|
679
|
-
}, null, 8, ["label"])),
|
|
680
|
-
e("div", zt, [
|
|
681
|
-
S(j, {
|
|
682
|
-
variant: "secondary",
|
|
683
|
-
"border-color": "neutral-gray-200",
|
|
684
|
-
label: t(n)("connect.common.cancel"),
|
|
685
|
-
disabled: V.value,
|
|
686
|
-
class: "!rounded-full !px-[20px] [&_.label]:text-[14px]",
|
|
687
|
-
onClick: xe
|
|
688
|
-
}, null, 8, ["label", "disabled"]),
|
|
689
|
-
S(j, {
|
|
690
|
-
label: t(n)("connect.common.save"),
|
|
691
|
-
disabled: te.value,
|
|
692
|
-
loading: x.value,
|
|
693
|
-
class: "!rounded-full !px-[20px] [&_.label]:text-[14px]",
|
|
694
|
-
onClick: me
|
|
695
|
-
}, null, 8, ["label", "disabled", "loading"])
|
|
696
|
-
])
|
|
697
|
-
], 64))
|
|
698
|
-
]);
|
|
699
|
-
};
|
|
700
|
-
}
|
|
701
|
-
});
|
|
702
|
-
export {
|
|
703
|
-
Yt as default
|
|
704
|
-
};
|