@feedmepos/mf-connect 0.1.98-beta.81 → 0.1.98-beta.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/{App-CKdnfhUE.js → App-DoYDNru4.js} +9 -9
  2. package/dist/{AuditLogs-vN-szmrB.js → AuditLogs-qHYp6lM4.js} +13 -13
  3. package/dist/{Bin-FIyWozvZ.js → Bin-CJvPHkvE.js} +8 -8
  4. package/dist/{Broadcast-CV_euppF.js → Broadcast-D6ECVLby.js} +12 -12
  5. package/dist/{CampaignAnalytic-Dlovlsh3.js → CampaignAnalytic-DbAO0BOB.js} +7 -7
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Fd_0aPzZ.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-UnagFqxE.js} +8 -8
  7. package/dist/{Card-ZgfOZ7sV.js → Card-DbQcw0mC.js} +23 -23
  8. package/dist/{Collections-DZmHKbZn.js → Collections-BFStwoAg.js} +8 -8
  9. package/dist/{Credit-DGsbEvMw.js → Credit-BVFgG__U.js} +12 -12
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-Cj89MnB0.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DXrDsiLw.js} +1 -1
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C77dXZo-.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BBTJuWd_.js} +35 -35
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CcIiEV2Z.js → EffectSheet.vue_vue_type_style_index_0_lang-BCWbz73-.js} +6 -6
  13. package/dist/{Experience-DlJycdKe.js → Experience-CK_YnT2w.js} +13 -13
  14. package/dist/{FileSaver.min-DVGF0TBc.js → FileSaver.min-CawPE0hc.js} +1 -1
  15. package/dist/{Game-q2X_SSup.js → Game-DrYm5UCq.js} +13 -13
  16. package/dist/{GiftCardSetup-BLDm3RfC.js → GiftCardSetup-CeB4uHzh.js} +10 -10
  17. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-CBC5AGR-.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-DRyzcwuk.js} +7 -7
  18. package/dist/{Goals-CD8vdUPQ.js → Goals-DDssCeP8.js} +4 -4
  19. package/dist/{Grab-KDYktOCn.js → Grab-BruNklz5.js} +9 -9
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DUi1YY1x.js → ImageInput.vue_vue_type_script_setup_true_lang-JIeTaPKV.js} +1 -1
  21. package/dist/{Index-BT4esMkG.js → Index-Qk1esxkY.js} +10 -10
  22. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BRCrx3DA.js → LocationPicker.vue_vue_type_script_setup_true_lang-Dblb8rtE.js} +1 -1
  23. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-D3G4alTX.js → LottieAnimation.vue_vue_type_script_setup_true_lang-XepGx2h_.js} +1 -1
  24. package/dist/{LoyaltyDashboard-CzmwuzTw.js → LoyaltyDashboard-VxKYWHoz.js} +15 -15
  25. package/dist/{MainLayout-CVYfxfuS.js → MainLayout-P6XTHUGB.js} +3 -3
  26. package/dist/{Marketing-sDWWcaL5.js → Marketing-CTYdcJfZ.js} +4 -4
  27. package/dist/{MarketingMaterialEdit-DHmI38Lo.js → MarketingMaterialEdit-D-1tqOR_.js} +6 -6
  28. package/dist/{Member-sdcMiTmr.js → Member-Dxuq4ZCO.js} +7 -7
  29. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-DqchRq6h.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-vIdcxago.js} +24 -24
  30. package/dist/{MemberImportHistory-Df_5SiGn.js → MemberImportHistory-DcofsjnB.js} +7 -7
  31. package/dist/{MemberList-BGoClGZE.js → MemberList-DQ7MGqA_.js} +14 -14
  32. package/dist/{MemberTransactions-qR38yGk5.js → MemberTransactions--5lBgWBw.js} +1 -1
  33. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-D4yY57Vo.js → MessageInput.vue_vue_type_script_setup_true_lang-DHst8mwG.js} +10 -10
  34. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Co9oeOFx.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Bb-tOtHg.js} +1 -1
  35. package/dist/{Mission-DSyqYeI6.js → Mission-C77jQ0ak.js} +14 -14
  36. package/dist/{Overview-BDM8Lxfv.js → Overview-B4G2MVEP.js} +21 -21
  37. package/dist/{Overview-sLhLv5Oa.js → Overview-BTDsp_z4.js} +4 -4
  38. package/dist/{Point-DO5Z5sOL.js → Point-CcU9cSwd.js} +14 -14
  39. package/dist/{Promotion-BXm1Dxlv.js → Promotion-BWUpBOOf.js} +14 -14
  40. package/dist/{Queue-C4kEj_Bp.js → Queue-BrMy2YTd.js} +13 -13
  41. package/dist/{Record-iKUy-nn3.js → Record-CeK0K1Yl.js} +9 -9
  42. package/dist/{Review-D-3-BRON.js → Review-C3rRbudC.js} +2 -2
  43. package/dist/{ReviewFacebookCallback-SLzE3D7c.js → ReviewFacebookCallback-DrDIi4eL.js} +5 -5
  44. package/dist/{ReviewGoogleCallback-DntrtfGB.js → ReviewGoogleCallback-BXQeRqiH.js} +5 -5
  45. package/dist/{Reward-CNQS6F2m.js → Reward-nBH1xNNR.js} +16 -16
  46. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-D0ZNJilO.js → RewardGroup.vue_vue_type_script_setup_true_lang-uBaqphhg.js} +14 -14
  47. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BgvaMOAJ.js → RuleGroup.vue_vue_type_script_setup_true_lang-DmPpapkp.js} +15 -15
  48. package/dist/{Segment-Bi58A7cw.js → Segment-B3pAFkuH.js} +26 -26
  49. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CxC6ZLZT.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Bz13JYlQ.js} +15 -15
  50. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CToVAWKO.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-Ct8y-moB.js} +4 -4
  51. package/dist/{Setting-CixcOp_l.js → Setting-NGYZe9J1.js} +14 -14
  52. package/dist/{SettingAdvertisements-DkPNDfxz.js → SettingAdvertisements-9N8x4lIo.js} +12 -12
  53. package/dist/{Settings-bD_DkKI0.js → Settings-BKJBdYbG.js} +5 -5
  54. package/dist/{Store-BvnsumDX.js → Store-CnMsvn0G.js} +27 -27
  55. package/dist/{StoreRewards-CKPnV_j3.js → StoreRewards-B0DPGAEq.js} +15 -15
  56. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-k46T2rql.js → StoreTransactions.vue_vue_type_script_setup_true_lang-D__oi--Z.js} +25 -25
  57. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-IknvTIMG.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BRJIcmLs.js} +2 -2
  58. package/dist/{Tier-CiKGy-Do.js → Tier-DFn6wpLy.js} +27 -27
  59. package/dist/{Title-CNFamvkQ.js → Title-BeM9d4fj.js} +23 -23
  60. package/dist/{Transaction-C8SnyFML.js → Transaction-DXIDbCJV.js} +2 -2
  61. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DQrTH7cz.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CcoMCIWr.js} +6 -6
  62. package/dist/{Voucher-9Q-GHuvD.js → Voucher-D18h9vy8.js} +18 -18
  63. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-B-6mF0RH.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Dyzo3qNu.js} +12 -12
  64. package/dist/{WhatsappAccount-DRKJVs0I.js → WhatsappAccount-Be38M23T.js} +5 -5
  65. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DBS9_rbY.js +80 -0
  66. package/dist/WhatsappBot-lyaORqV6.js +561 -0
  67. package/dist/WhatsappBotSettings-DPBqHZXW.js +394 -0
  68. package/dist/WhatsappBotTickets-D_3v1pKU.js +153 -0
  69. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-7tSuZ_C3.js → ZodTextField.vue_vue_type_script_setup_true_lang-DL7rIl_N.js} +2 -2
  70. package/dist/{app-CQnX8TXq.js → app-DqMmw6WJ.js} +3914 -3559
  71. package/dist/app.js +1 -1
  72. package/dist/{base.export-CwCY41wr.js → base.export-BoqiarPy.js} +2 -2
  73. package/dist/{business-DGYo03yh.js → business-CcxL-gF3.js} +1 -1
  74. package/dist/{campaign-BFhMhQWk.js → campaign-BE2lgjRF.js} +8 -8
  75. package/dist/{campaign-BmVMseCM.js → campaign-MBz26iMH.js} +2 -2
  76. package/dist/{campaign.fn-DHdhR9C8.js → campaign.fn-D5LT2U39.js} +130 -130
  77. package/dist/{collection.fn-CYrQd8Th.js → collection.fn-CpJyr6Y_.js} +2 -2
  78. package/dist/{currency-B7wFZjCM.js → currency-kViea7ZW.js} +1 -1
  79. package/dist/{duplicateCampaign-C62eVSKZ.js → duplicateCampaign-DwFhnGNW.js} +2 -2
  80. package/dist/{effect-XVC0SyM1.js → effect-OEQJ_NOd.js} +1 -1
  81. package/dist/{email-addresses-DUWzbknH.js → email-addresses-BiqNmeSY.js} +2 -2
  82. package/dist/{helper-Bw_KFook.js → helper-qe6OtfMQ.js} +1 -1
  83. package/dist/{index-CmJ4UtbH.js → index-B2JXMepI.js} +7 -7
  84. package/dist/{index-D5D85re4.js → index-B5-ebn1k.js} +9 -9
  85. package/dist/{index-CoaZuwwm.js → index-B6mE0q8e.js} +1 -1
  86. package/dist/{index-C5a9ZaAM.js → index-BCVOoMJ1.js} +2 -2
  87. package/dist/index-BCXUZHQr.js +74 -0
  88. package/dist/{index-Bu0rl1Jm.js → index-BivO-FMW.js} +1 -1
  89. package/dist/{index-DlFjUct2.js → index-BjJnzBgb.js} +18 -18
  90. package/dist/{index-B88wz0DA.js → index-C01w59Sf.js} +1 -1
  91. package/dist/{index-CRX2b_-n.js → index-C4tRz5aW.js} +2 -2
  92. package/dist/{index-CX2tKi6X.js → index-CDL5im4n.js} +1 -1
  93. package/dist/{index-BHPcqvxB.js → index-CM0g-9-V.js} +2 -2
  94. package/dist/{index-BpcakDLo.js → index-CXafRDRN.js} +2 -2
  95. package/dist/{index-DKabvlsg.js → index-CnHeoO9f.js} +23 -23
  96. package/dist/{index-D89ye2yV.js → index-DCO-4L0t.js} +9 -9
  97. package/dist/{index-CSaO5mCs.js → index-DNLDqugg.js} +1 -1
  98. package/dist/{index-BL01AAGF.js → index-DSkhLfAT.js} +3 -3
  99. package/dist/{index-C0WVYJgp.js → index-DWW4rV5u.js} +1 -1
  100. package/dist/{index-CsZ7_Qzf.js → index-DZIBSUS_.js} +2 -2
  101. package/dist/index-DopAV1p0.js +68 -0
  102. package/dist/{index-XCHxkJPE.js → index-IdvPib7v.js} +2 -2
  103. package/dist/{index-DHRVhERM.js → index-uxpFoeBR.js} +3 -3
  104. package/dist/{index.esm2017-cOXL--fX.js → index.esm2017-JBUZVF0b.js} +37 -37
  105. package/dist/{loading-BlfJuA-h.js → loading-BWIBiviO.js} +1 -1
  106. package/dist/{lodash-CFkpI5Sp.js → lodash-BzPqU7SK.js} +1 -1
  107. package/dist/{member-import-B4ihDPgR.js → member-import-Bf5_v2rw.js} +1 -1
  108. package/dist/{membership-CyNEU3ld.js → membership-D_wss7NM.js} +2 -2
  109. package/dist/{money-B0QV3AtE.js → money-Bh3-N1sf.js} +1 -1
  110. package/dist/{number-DJ7EhoTu.js → number-BbQ0fzK1.js} +1 -1
  111. package/dist/{objectid-DZ8o9_J4.js → objectid-DXuwIDWq.js} +9 -9
  112. package/dist/{onboarding-BhMbuIRK.js → onboarding-DspO-Me0.js} +3 -3
  113. package/dist/{onboardingSetup-BZMYTun6.js → onboardingSetup-MufLiFPA.js} +2 -2
  114. package/dist/{plugins-C7hEP98r.js → plugins-JFwonds1.js} +3 -3
  115. package/dist/{reward-D4975Y4s.js → reward-DgsTibBz.js} +1 -1
  116. package/dist/{rule-BfSrqM9Z.js → rule-C9wt-ChP.js} +10 -10
  117. package/dist/style.css +1 -1
  118. package/dist/{template-CTCYJKDu.js → template-DelWr_nw.js} +6 -6
  119. package/dist/{timezone-hBjTK85u.js → timezone-tn-KM65h.js} +1 -1
  120. package/dist/{transaction.fn-1iGyAGZA.js → transaction.fn-n9smufaW.js} +2 -2
  121. package/dist/{trigger-CdJikvw9.js → trigger-C26nxLCh.js} +5 -5
  122. package/dist/{useMarketingMaterialActions-R1rDbIr8.js → useMarketingMaterialActions-IM2MsMTk.js} +3 -3
  123. package/dist/{usePagination-CqSRHo9z.js → usePagination-Dtz2hc5n.js} +1 -1
  124. package/dist/{user-C8i4TfQt.js → user-BkwDIIp3.js} +1 -1
  125. package/dist/{vue-i18n-CiJ_kNkt.js → vue-i18n-Dnb3kew0.js} +313 -313
  126. package/dist/{xlsx-DGiPalb9.js → xlsx-be-7IH2e.js} +224 -224
  127. package/dist/{zod-CKl6yP5K.js → zod-CAhiOJ1R.js} +1 -1
  128. package/package.json +1 -1
  129. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DGOPGiGH.js +0 -96
  130. package/dist/WhatsappBot-muUmTIyY.js +0 -441
  131. package/dist/WhatsappBotSettings-DUjKwiv6.js +0 -136
  132. package/dist/index-o2Ga_qaX.js +0 -39
  133. package/dist/index-z0K48rtR.js +0 -54
@@ -0,0 +1,394 @@
1
+ import { defineComponent as W, mergeModels as U, useModel as O, resolveComponent as w, openBlock as d, createElementBlock as c, createElementVNode as i, toDisplayString as u, unref as e, createVNode as b, computed as F, Fragment as L, renderList as Q, normalizeClass as M, createTextVNode as P, createCommentVNode as S, withDirectives as oe, vModelRadio as le, ref as g, watch as j, onBeforeUnmount as ae, createBlock as se } from "vue";
2
+ import { u as D } from "./vue-i18n-Dnb3kew0.js";
3
+ import { F as Y, a as C, b as ne, c as re, d as ie, e as N, f as de } from "./index-DopAV1p0.js";
4
+ import { S as ce } from "./index-CXafRDRN.js";
5
+ import { w as J } from "./index-BCXUZHQr.js";
6
+ const pe = { class: "flex flex-col gap-[16px]" }, ue = { class: "flex flex-col gap-[4px]" }, me = { class: "text-[16px] leading-[24px] font-semibold" }, ve = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary" }, xe = /* @__PURE__ */ W({
7
+ __name: "BotInstructions",
8
+ props: /* @__PURE__ */ U({
9
+ disabled: { type: Boolean }
10
+ }, {
11
+ modelValue: { required: !0 },
12
+ modelModifiers: {}
13
+ }),
14
+ emits: ["update:modelValue"],
15
+ setup(p) {
16
+ const s = O(p, "modelValue"), { t } = D();
17
+ return (l, a) => {
18
+ const r = w("FmTextarea");
19
+ return d(), c("div", pe, [
20
+ i("div", ue, [
21
+ i("h2", me, u(e(t)("connect.whatsappBot.botSettings.instructions")), 1),
22
+ i("p", ve, u(e(t)("connect.whatsappBot.botSettings.description")), 1)
23
+ ]),
24
+ b(r, {
25
+ modelValue: s.value,
26
+ "onUpdate:modelValue": a[0] || (a[0] = (m) => s.value = m),
27
+ "aria-label": e(t)("connect.whatsappBot.botSettings.instructions"),
28
+ placeholder: e(t)("connect.whatsappBot.botSettings.placeholder"),
29
+ "max-length": e(Y),
30
+ disabled: p.disabled,
31
+ "show-word-count": "",
32
+ class: "bot-instructions-textarea"
33
+ }, null, 8, ["modelValue", "aria-label", "placeholder", "max-length", "disabled"])
34
+ ]);
35
+ };
36
+ }
37
+ }), be = {
38
+ "aria-labelledby": "knowledge-base-title",
39
+ class: "border-t-[1px] border-fm-color-neutral-gray-100 pt-[20px] flex flex-col gap-[12px]"
40
+ }, ge = { class: "flex flex-col gap-[4px]" }, fe = {
41
+ id: "knowledge-base-title",
42
+ class: "text-[16px] leading-[24px] font-semibold"
43
+ }, he = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary" }, _e = { class: "flex flex-wrap gap-[8px]" }, ye = ["title", "aria-expanded", "disabled", "onClick"], we = ["disabled"], Se = {
44
+ key: 0,
45
+ class: "text-[14px] text-fm-color-typo-tertiary"
46
+ }, Be = {
47
+ key: 1,
48
+ class: "text-[14px] text-fm-color-typo-secondary"
49
+ }, ke = /* @__PURE__ */ W({
50
+ __name: "KnowledgeBase",
51
+ props: /* @__PURE__ */ U({
52
+ disabled: { type: Boolean }
53
+ }, {
54
+ modelValue: {
55
+ required: !0
56
+ },
57
+ modelModifiers: {},
58
+ activeTopicIndex: {
59
+ required: !0
60
+ },
61
+ activeTopicIndexModifiers: {}
62
+ }),
63
+ emits: ["update:modelValue", "update:activeTopicIndex"],
64
+ setup(p) {
65
+ const s = p, t = O(p, "modelValue"), l = O(p, "activeTopicIndex"), { t: a } = D(), r = F(
66
+ () => l.value === null ? null : t.value[l.value]
67
+ );
68
+ function m() {
69
+ s.disabled || t.value.length >= C || (t.value.push({ title: "", description: "" }), l.value = t.value.length - 1);
70
+ }
71
+ function f() {
72
+ s.disabled || l.value === null || (t.value.splice(l.value, 1), l.value = null);
73
+ }
74
+ return ($, v) => {
75
+ const V = w("FmIcon"), I = w("FmTextField"), k = w("FmTextarea"), _ = w("FmButton");
76
+ return d(), c("section", be, [
77
+ i("div", ge, [
78
+ i("h2", fe, u(e(a)("connect.whatsappBot.botSettings.knowledgeBase.title")), 1),
79
+ i("p", he, u(e(a)("connect.whatsappBot.botSettings.knowledgeBase.description")), 1)
80
+ ]),
81
+ i("div", _e, [
82
+ (d(!0), c(L, null, Q(t.value, (x, y) => (d(), c("button", {
83
+ key: y,
84
+ type: "button",
85
+ title: x.title.trim() || e(a)("connect.whatsappBot.botSettings.knowledgeBase.untitled"),
86
+ "aria-expanded": l.value === y,
87
+ "aria-controls": "knowledge-topic-editor",
88
+ disabled: p.disabled,
89
+ class: M(["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", [
90
+ l.value === y ? "border-fm-color-primary bg-fm-color-primary-oats text-fm-color-primary" : "border-fm-color-neutral-gray-200 bg-fm-color-neutral-white",
91
+ p.disabled ? "cursor-default" : "cursor-pointer hover:border-fm-color-primary"
92
+ ]]),
93
+ onClick: (H) => l.value = l.value === y ? null : y
94
+ }, u(x.title.trim() || e(a)("connect.whatsappBot.botSettings.knowledgeBase.untitled")), 11, ye))), 128)),
95
+ i("button", {
96
+ type: "button",
97
+ disabled: p.disabled || t.value.length >= e(C),
98
+ 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",
99
+ onClick: m
100
+ }, [
101
+ b(V, {
102
+ name: "add",
103
+ size: "sm"
104
+ }),
105
+ P(" " + u(e(a)("connect.whatsappBot.botSettings.knowledgeBase.addTopic")), 1)
106
+ ], 8, we)
107
+ ]),
108
+ t.value.length === 0 ? (d(), c("p", Se, u(e(a)("connect.whatsappBot.botSettings.knowledgeBase.empty")), 1)) : S("", !0),
109
+ t.value.length >= e(C) ? (d(), c("p", Be, u(e(a)("connect.whatsappBot.botSettings.knowledgeBase.topicLimit", {
110
+ count: e(C)
111
+ })), 1)) : S("", !0),
112
+ r.value ? (d(), c("div", {
113
+ id: "knowledge-topic-editor",
114
+ key: l.value ?? void 0,
115
+ class: "rounded-[8px] border-[1px] border-fm-color-neutral-gray-100 p-[16px] flex flex-col gap-[12px]"
116
+ }, [
117
+ b(I, {
118
+ modelValue: r.value.title,
119
+ "onUpdate:modelValue": v[0] || (v[0] = (x) => r.value.title = x),
120
+ label: e(a)("connect.whatsappBot.botSettings.knowledgeBase.titleLabel"),
121
+ placeholder: e(a)("connect.whatsappBot.botSettings.knowledgeBase.titlePlaceholder"),
122
+ "max-length": e(ne),
123
+ disabled: p.disabled
124
+ }, null, 8, ["modelValue", "label", "placeholder", "max-length", "disabled"]),
125
+ b(k, {
126
+ modelValue: r.value.description,
127
+ "onUpdate:modelValue": v[1] || (v[1] = (x) => r.value.description = x),
128
+ label: e(a)("connect.whatsappBot.botSettings.knowledgeBase.descriptionLabel"),
129
+ placeholder: e(a)(
130
+ "connect.whatsappBot.botSettings.knowledgeBase.descriptionPlaceholder"
131
+ ),
132
+ "max-length": e(re),
133
+ disabled: p.disabled,
134
+ "show-word-count": "",
135
+ class: "bot-instructions-textarea"
136
+ }, null, 8, ["modelValue", "label", "placeholder", "max-length", "disabled"]),
137
+ b(_, {
138
+ variant: "plain",
139
+ size: "sm",
140
+ "prepend-icon": "delete",
141
+ "text-color": "typo-error",
142
+ label: e(a)("connect.whatsappBot.botSettings.knowledgeBase.removeTopic"),
143
+ disabled: p.disabled,
144
+ class: "self-start",
145
+ onClick: f
146
+ }, null, 8, ["label", "disabled"])
147
+ ])) : S("", !0)
148
+ ]);
149
+ };
150
+ }
151
+ }), Te = {
152
+ "aria-labelledby": "response-speed-title",
153
+ class: "border-t-[1px] border-fm-color-neutral-gray-100 pt-[20px] flex flex-col gap-[12px]"
154
+ }, Ve = { class: "flex flex-col gap-[4px]" }, Fe = {
155
+ id: "response-speed-title",
156
+ class: "text-[16px] leading-[24px] font-semibold"
157
+ }, Ie = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary" }, Ee = {
158
+ role: "radiogroup",
159
+ "aria-labelledby": "response-speed-title",
160
+ "aria-describedby": "response-speed-detail",
161
+ class: "grid grid-cols-[repeat(auto-fit,minmax(150px,1fr))] gap-[8px]"
162
+ }, Pe = ["value", "disabled"], $e = { class: "flex items-center gap-[8px] text-[14px] leading-[20px] font-semibold" }, Ae = {
163
+ key: 0,
164
+ class: "w-[8px] h-[8px] rounded-full bg-fm-color-primary"
165
+ }, Ce = { class: "text-[12px] leading-[16px] text-fm-color-typo-secondary" }, Ne = {
166
+ id: "response-speed-detail",
167
+ "aria-live": "polite",
168
+ class: "text-[14px] leading-[20px] text-fm-color-typo-secondary"
169
+ }, Oe = {
170
+ key: 0,
171
+ class: "rounded-[8px] bg-fm-color-system-warning-100 px-[12px] py-[10px] flex items-start gap-[10px] text-[14px] leading-[20px]"
172
+ }, Le = /* @__PURE__ */ W({
173
+ __name: "ResponseSpeed",
174
+ props: /* @__PURE__ */ U({
175
+ disabled: { type: Boolean }
176
+ }, {
177
+ modelValue: {
178
+ required: !0
179
+ },
180
+ modelModifiers: {}
181
+ }),
182
+ emits: ["update:modelValue"],
183
+ setup(p) {
184
+ const s = O(p, "modelValue"), { t } = D();
185
+ return (l, a) => {
186
+ const r = w("FmIcon");
187
+ return d(), c("section", Te, [
188
+ i("div", Ve, [
189
+ i("h2", Fe, u(e(t)("connect.whatsappBot.botSettings.responseSpeed.title")), 1),
190
+ i("p", Ie, u(e(t)("connect.whatsappBot.botSettings.responseSpeed.description")), 1)
191
+ ]),
192
+ i("div", Ee, [
193
+ (d(!0), c(L, null, Q(e(ie), (m) => (d(), c("label", { key: m }, [
194
+ oe(i("input", {
195
+ "onUpdate:modelValue": a[0] || (a[0] = (f) => s.value = f),
196
+ type: "radio",
197
+ name: "response-speed",
198
+ value: m,
199
+ disabled: p.disabled,
200
+ class: "sr-only peer"
201
+ }, null, 8, Pe), [
202
+ [le, s.value]
203
+ ]),
204
+ i("span", {
205
+ class: M(["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", [
206
+ s.value === m ? "border-fm-color-primary bg-fm-color-primary-oats" : "border-fm-color-neutral-gray-200 bg-fm-color-neutral-white",
207
+ p.disabled ? "cursor-default opacity-60" : "cursor-pointer hover:border-fm-color-primary"
208
+ ]])
209
+ }, [
210
+ i("span", $e, [
211
+ i("span", {
212
+ "aria-hidden": "true",
213
+ class: M([
214
+ "w-[16px] h-[16px] shrink-0 rounded-full border-[1.5px] bg-fm-color-neutral-white flex items-center justify-center",
215
+ s.value === m ? "border-fm-color-primary" : "border-fm-color-neutral-gray-300"
216
+ ])
217
+ }, [
218
+ s.value === m ? (d(), c("span", Ae)) : S("", !0)
219
+ ], 2),
220
+ P(" " + u(e(t)(`connect.whatsappBot.botSettings.responseSpeed.${m}.label`)), 1)
221
+ ]),
222
+ i("span", Ce, u(e(t)(`connect.whatsappBot.botSettings.responseSpeed.${m}.hint`)), 1)
223
+ ], 2)
224
+ ]))), 128))
225
+ ]),
226
+ i("p", Ne, u(e(t)(
227
+ `connect.whatsappBot.botSettings.responseSpeed.${s.value}.detail`
228
+ )), 1),
229
+ s.value === "immediate" ? (d(), c("div", Oe, [
230
+ b(r, {
231
+ name: "warning",
232
+ size: "sm",
233
+ class: "mt-[2px] shrink-0 text-fm-color-typo-warning"
234
+ }),
235
+ P(" " + u(e(t)("connect.whatsappBot.botSettings.responseSpeed.immediateWarning")), 1)
236
+ ])) : S("", !0)
237
+ ]);
238
+ };
239
+ }
240
+ }), We = { class: "mt-[24px] w-full flex flex-col gap-[20px]" }, De = {
241
+ key: 0,
242
+ role: "status",
243
+ class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
244
+ }, Me = {
245
+ key: 1,
246
+ role: "alert",
247
+ class: "text-[14px] text-fm-color-typo-error"
248
+ }, Ue = { class: "flex items-center justify-end gap-[12px] flex-wrap" }, He = {
249
+ key: 0,
250
+ role: "status",
251
+ class: "mr-auto flex items-center gap-[6px] text-[14px] text-fm-color-typo-success"
252
+ }, je = /* @__PURE__ */ W({
253
+ __name: "WhatsappBotSettings",
254
+ setup(p) {
255
+ const { t: s } = D(), t = F(() => ce.getBusinessId() ?? ""), l = g(""), a = g(""), r = g([]), m = g([]), f = g(null), $ = F(
256
+ () => r.value.filter(
257
+ (o) => o.title.trim() || o.description.trim()
258
+ )
259
+ ), v = g(
260
+ N
261
+ ), V = g(
262
+ N
263
+ ), I = g(!0), k = g(!1), _ = g(!1), x = g(""), y = g(!1), H = Y, Z = F(
264
+ () => l.value !== a.value || v.value !== V.value || JSON.stringify(r.value) !== JSON.stringify(m.value)
265
+ ), R = F(
266
+ () => !k.value || _.value || !Z.value
267
+ ), G = F(
268
+ () => R.value || l.value.length > H || !de.safeParse($.value).success
269
+ );
270
+ let h, K;
271
+ function E() {
272
+ clearTimeout(K), y.value = !1;
273
+ }
274
+ function z(o) {
275
+ l.value = o.botInstructions, a.value = o.botInstructions, v.value = o.responseSpeed, V.value = o.responseSpeed, r.value = o.knowledgeBase.map((n) => ({ ...n })), m.value = o.knowledgeBase.map((n) => ({
276
+ ...n
277
+ }));
278
+ }
279
+ async function X() {
280
+ h == null || h.abort(), E();
281
+ const o = new AbortController();
282
+ h = o, I.value = !0, k.value = !1, _.value = !1, x.value = "", l.value = "", a.value = "", v.value = N, V.value = N, r.value = [], m.value = [], f.value = null;
283
+ try {
284
+ if (!t.value)
285
+ throw new Error(s("connect.whatsappBot.errors.selectBusiness"));
286
+ const n = await J.getSettings(
287
+ t.value,
288
+ o.signal
289
+ );
290
+ if (o.signal.aborted) return;
291
+ z(n), k.value = !0;
292
+ } catch (n) {
293
+ o.signal.aborted || (x.value = n instanceof Error ? n.message : s("connect.whatsappBot.errors.loadSettings"));
294
+ } finally {
295
+ o.signal.aborted || (I.value = !1);
296
+ }
297
+ }
298
+ async function q() {
299
+ if (G.value) return;
300
+ h == null || h.abort();
301
+ const o = new AbortController();
302
+ h = o, _.value = !0, x.value = "", E();
303
+ const n = f.value === null ? void 0 : r.value[f.value], A = n ? $.value.indexOf(n) : -1;
304
+ try {
305
+ const B = await J.saveSettings(
306
+ t.value,
307
+ {
308
+ botInstructions: l.value,
309
+ responseSpeed: v.value,
310
+ knowledgeBase: $.value
311
+ },
312
+ o.signal
313
+ );
314
+ if (o.signal.aborted) return;
315
+ z(B), f.value = A < 0 ? null : A, y.value = !0, K = setTimeout(() => {
316
+ y.value = !1;
317
+ }, 2500);
318
+ } catch (B) {
319
+ o.signal.aborted || (x.value = B instanceof Error ? B.message : s("connect.whatsappBot.errors.saveSettings"));
320
+ } finally {
321
+ o.signal.aborted || (_.value = !1);
322
+ }
323
+ }
324
+ function ee() {
325
+ l.value = a.value, v.value = V.value, r.value = m.value.map((o) => ({ ...o })), f.value = null, E();
326
+ }
327
+ return j([l, v, r], E, {
328
+ flush: "sync",
329
+ deep: !0
330
+ }), j(t, X, { immediate: !0 }), ae(() => {
331
+ h == null || h.abort(), E();
332
+ }), (o, n) => {
333
+ const A = w("FmCircularProgress"), B = w("FmButton"), te = w("FmIcon");
334
+ return d(), c("div", We, [
335
+ I.value ? (d(), c("div", De, [
336
+ b(A),
337
+ P(" " + u(e(s)("connect.whatsappBot.botSettings.loading")), 1)
338
+ ])) : (d(), c(L, { key: 1 }, [
339
+ k.value ? (d(), c(L, { key: 0 }, [
340
+ b(xe, {
341
+ modelValue: l.value,
342
+ "onUpdate:modelValue": n[0] || (n[0] = (T) => l.value = T),
343
+ disabled: _.value
344
+ }, null, 8, ["modelValue", "disabled"]),
345
+ b(ke, {
346
+ modelValue: r.value,
347
+ "onUpdate:modelValue": n[1] || (n[1] = (T) => r.value = T),
348
+ "active-topic-index": f.value,
349
+ "onUpdate:activeTopicIndex": n[2] || (n[2] = (T) => f.value = T),
350
+ disabled: _.value
351
+ }, null, 8, ["modelValue", "active-topic-index", "disabled"]),
352
+ b(Le, {
353
+ modelValue: v.value,
354
+ "onUpdate:modelValue": n[3] || (n[3] = (T) => v.value = T),
355
+ disabled: _.value
356
+ }, null, 8, ["modelValue", "disabled"])
357
+ ], 64)) : S("", !0),
358
+ x.value ? (d(), c("p", Me, u(x.value), 1)) : S("", !0),
359
+ k.value ? S("", !0) : (d(), se(B, {
360
+ key: 2,
361
+ class: "self-start",
362
+ label: e(s)("connect.whatsappBot.tryAgain"),
363
+ "prepend-icon": "refresh",
364
+ onClick: X
365
+ }, null, 8, ["label"])),
366
+ i("div", Ue, [
367
+ y.value ? (d(), c("span", He, [
368
+ b(te, {
369
+ name: "check",
370
+ size: "sm"
371
+ }),
372
+ P(" " + u(e(s)("connect.whatsappBot.botSettings.saved")), 1)
373
+ ])) : S("", !0),
374
+ b(B, {
375
+ variant: "secondary",
376
+ label: e(s)("connect.common.cancel"),
377
+ disabled: R.value,
378
+ onClick: ee
379
+ }, null, 8, ["label", "disabled"]),
380
+ b(B, {
381
+ label: e(s)("connect.common.save"),
382
+ disabled: G.value,
383
+ loading: _.value,
384
+ onClick: q
385
+ }, null, 8, ["label", "disabled", "loading"])
386
+ ])
387
+ ], 64))
388
+ ]);
389
+ };
390
+ }
391
+ });
392
+ export {
393
+ je as default
394
+ };
@@ -0,0 +1,153 @@
1
+ import { defineComponent as U, ref as v, computed as j, watch as L, onBeforeUnmount as P, resolveComponent as _, openBlock as l, createElementBlock as c, createElementVNode as o, toDisplayString as s, unref as n, createVNode as h, createTextVNode as w, createCommentVNode as b, Fragment as T, renderList as R } from "vue";
2
+ import { u as $ } from "./vue-i18n-Dnb3kew0.js";
3
+ import { S as I } from "./index-CXafRDRN.js";
4
+ import { w as z } from "./index-BCXUZHQr.js";
5
+ const M = { class: "mt-[20px] w-full flex flex-col gap-[16px]" }, W = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary" }, G = {
6
+ key: 0,
7
+ role: "status",
8
+ class: "flex items-center gap-[6px] text-[14px] text-fm-color-typo-success"
9
+ }, H = {
10
+ key: 1,
11
+ role: "status",
12
+ class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
13
+ }, J = {
14
+ key: 0,
15
+ class: "flex items-center gap-[12px] flex-wrap"
16
+ }, K = {
17
+ role: "alert",
18
+ class: "text-[14px] text-fm-color-typo-error"
19
+ }, O = {
20
+ key: 1,
21
+ role: "alert",
22
+ class: "text-[14px] text-fm-color-typo-error"
23
+ }, Q = {
24
+ key: 2,
25
+ class: "border border-fm-color-neutral-gray-200 rounded-[16px] px-[24px] py-[56px] flex flex-col items-center text-center gap-[8px]"
26
+ }, X = { class: "text-[20px] font-semibold" }, Y = { class: "max-w-[420px] text-[14px] leading-[20px] text-fm-color-typo-secondary" }, Z = {
27
+ key: 3,
28
+ class: "flex flex-col gap-[12px]"
29
+ }, q = {
30
+ "aria-hidden": "true",
31
+ class: "w-[40px] h-[40px] rounded-full bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary text-[14px] font-semibold flex items-center justify-center flex-shrink-0 self-start"
32
+ }, ee = { class: "flex-1 min-w-[200px] flex flex-col gap-[2px]" }, te = { class: "flex items-center gap-[8px] flex-wrap" }, oe = { class: "text-[14px] leading-[20px] font-semibold break-words" }, se = { class: "flex items-center gap-[6px] rounded-[6px] px-[8px] py-[2px] text-[12px] font-semibold bg-fm-color-system-warning-100 text-fm-color-typo-warning" }, ae = { class: "text-[12px] leading-[16px] text-fm-color-typo-tertiary break-words" }, re = { class: "mt-[6px] text-[14px] leading-[20px] text-fm-color-typo-secondary whitespace-pre-wrap break-words" }, ne = { class: "flex items-center gap-[16px] ml-auto flex-wrap" }, le = ["datetime"], ue = /* @__PURE__ */ U({
33
+ __name: "WhatsappBotTickets",
34
+ props: {
35
+ tickets: {},
36
+ loading: { type: Boolean },
37
+ error: {}
38
+ },
39
+ emits: ["retry", "resolved"],
40
+ setup(m, { emit: A }) {
41
+ const F = m, B = A, { t, locale: S } = $(), i = v(""), u = v(""), d = v("");
42
+ let x, y;
43
+ const k = j(
44
+ () => [...F.tickets].sort((e, a) => a.updatedAt.localeCompare(e.updatedAt))
45
+ );
46
+ function g(e) {
47
+ return e.customerName || e.phoneNumber || e.customerLid;
48
+ }
49
+ function E(e) {
50
+ return e.customerName ? e.customerName.trim().split(/\s+/).slice(0, 2).map((a) => Array.from(a)[0]).join("").toUpperCase() : "?";
51
+ }
52
+ function D(e) {
53
+ return new Intl.DateTimeFormat(S.value, {
54
+ dateStyle: "medium",
55
+ timeStyle: "short"
56
+ }).format(new Date(e));
57
+ }
58
+ async function V(e) {
59
+ if (i.value) return;
60
+ const a = I.getBusinessId();
61
+ if (!a || e.businessId !== a) return;
62
+ const p = new AbortController();
63
+ x = p, i.value = e.id, u.value = "", d.value = "", clearTimeout(y);
64
+ try {
65
+ if (await z.resolveTicket(a, e.id, p.signal), p.signal.aborted) return;
66
+ B("resolved", e.id), d.value = t("connect.whatsappBot.tickets.resolvedMessage", {
67
+ name: g(e)
68
+ }), y = setTimeout(() => d.value = "", 3e3);
69
+ } catch (f) {
70
+ p.signal.aborted || (u.value = f instanceof Error ? f.message : t("connect.whatsappBot.tickets.resolveError"));
71
+ } finally {
72
+ p.signal.aborted || (i.value = "");
73
+ }
74
+ }
75
+ function C() {
76
+ x == null || x.abort(), clearTimeout(y), i.value = "", u.value = "", d.value = "";
77
+ }
78
+ return L(() => I.getBusinessId(), C), P(C), (e, a) => {
79
+ const p = _("FmIcon"), f = _("FmCircularProgress"), N = _("FmButton");
80
+ return l(), c("section", M, [
81
+ o("p", W, s(n(t)("connect.whatsappBot.tickets.description")), 1),
82
+ d.value ? (l(), c("p", G, [
83
+ h(p, {
84
+ name: "check",
85
+ size: "sm"
86
+ }),
87
+ w(" " + s(d.value), 1)
88
+ ])) : b("", !0),
89
+ m.loading ? (l(), c("div", H, [
90
+ h(f),
91
+ w(" " + s(n(t)("connect.whatsappBot.tickets.loading")), 1)
92
+ ])) : (l(), c(T, { key: 2 }, [
93
+ m.error ? (l(), c("div", J, [
94
+ o("p", K, s(m.error), 1),
95
+ h(N, {
96
+ variant: "secondary",
97
+ label: n(t)("connect.whatsappBot.tryAgain"),
98
+ "prepend-icon": "refresh",
99
+ onClick: a[0] || (a[0] = (r) => B("retry"))
100
+ }, null, 8, ["label"])
101
+ ])) : b("", !0),
102
+ u.value ? (l(), c("p", O, s(u.value), 1)) : b("", !0),
103
+ !k.value.length && !m.error ? (l(), c("div", Q, [
104
+ o("h2", X, s(n(t)("connect.whatsappBot.tickets.empty.open.title")), 1),
105
+ o("p", Y, s(n(t)("connect.whatsappBot.tickets.empty.open.description")), 1)
106
+ ])) : (l(), c("ul", Z, [
107
+ (l(!0), c(T, null, R(k.value, (r) => (l(), c("li", {
108
+ key: r.id,
109
+ class: "border border-fm-color-neutral-gray-100 rounded-[16px] bg-fm-color-neutral-white p-[16px] flex items-center gap-[12px] flex-wrap"
110
+ }, [
111
+ o("div", q, s(E(r)), 1),
112
+ o("div", ee, [
113
+ o("div", te, [
114
+ o("span", oe, s(g(r)), 1),
115
+ o("span", se, [
116
+ a[1] || (a[1] = o("span", { class: "w-[6px] h-[6px] rounded-full bg-current" }, null, -1)),
117
+ w(" " + s(n(t)("connect.whatsappBot.tickets.paused")), 1)
118
+ ])
119
+ ]),
120
+ o("p", ae, s(r.phoneNumber || n(t)("connect.whatsappBot.phoneUnavailable")), 1),
121
+ o("p", re, s(r.source === "staff" ? n(t)("connect.whatsappBot.tickets.staffReason") : n(t)("connect.whatsappBot.tickets.botReason", {
122
+ reason: r.reason
123
+ })), 1)
124
+ ]),
125
+ o("div", ne, [
126
+ o("time", {
127
+ datetime: r.updatedAt,
128
+ class: "text-[12px] text-fm-color-typo-tertiary tabular-nums"
129
+ }, s(n(t)("connect.whatsappBot.tickets.pausedSince", {
130
+ date: D(r.updatedAt)
131
+ })), 9, le),
132
+ h(N, {
133
+ variant: "secondary",
134
+ "prepend-icon": "check",
135
+ label: n(t)("connect.whatsappBot.tickets.resolve"),
136
+ "aria-label": n(t)("connect.whatsappBot.tickets.resolveCustomer", {
137
+ name: g(r)
138
+ }),
139
+ loading: i.value === r.id,
140
+ disabled: !!i.value,
141
+ onClick: (ce) => V(r)
142
+ }, null, 8, ["label", "aria-label", "loading", "disabled", "onClick"])
143
+ ])
144
+ ]))), 128))
145
+ ]))
146
+ ], 64))
147
+ ]);
148
+ };
149
+ }
150
+ });
151
+ export {
152
+ ue as default
153
+ };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as f, useAttrs as y, resolveComponent as b, openBlock as l, createBlock as v, mergeProps as x, unref as t, createSlots as g, withCtx as h, createElementVNode as a, toDisplayString as n, renderSlot as k, createElementBlock as F, createCommentVNode as S } from "vue";
2
- import { Z as d } from "./zod-CKl6yP5K.js";
3
- import { u as V } from "./vue-i18n-CiJ_kNkt.js";
2
+ import { Z as d } from "./zod-CAhiOJ1R.js";
3
+ import { u as V } from "./vue-i18n-Dnb3kew0.js";
4
4
  const B = { class: "fm-typo-en-body-lg-400 flex gap-4 text-fm-color-typo-primary items-center" }, C = {
5
5
  key: 0,
6
6
  class: "text-fm-color-typo-tertiary"