@feedmepos/mf-connect 0.1.112-prod → 0.1.113-beta.3

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 (158) hide show
  1. package/README.md +66 -1
  2. package/dist/{App-CFJcQZEE.js → App-YfpYV7C0.js} +700 -654
  3. package/dist/AuditLogs-kD0_HO_p.js +2016 -0
  4. package/dist/{Bin-DaqUNsSV.js → Bin-Dr-Xp3pn.js} +8 -8
  5. package/dist/Broadcast-CEbHu2xA.js +306 -0
  6. package/dist/{CampaignAnalytic-CpP7lgTX.js → CampaignAnalytic-DDiGxPwp.js} +7 -7
  7. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BQiQVQBN.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cc_Yho9-.js} +9 -9
  8. package/dist/{Card-Bmz5p5Pq.js → Card-BUnwg0eM.js} +25 -24
  9. package/dist/{Collections-BKND60cK.js → Collections-CKyBkKq2.js} +197 -185
  10. package/dist/{Credit-DQ_tDm8l.js → Credit-CJOXWLV1.js} +21 -20
  11. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-CCwpsEWf.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DmEBLeNI.js} +1 -1
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Ce5R4Un6.js +4442 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-wUV_beN0.js → EffectSheet.vue_vue_type_style_index_0_lang-CMFmlqfF.js} +32 -32
  14. package/dist/{Experience-BOE6jLIS.js → Experience-C_Am5CTY.js} +32 -31
  15. package/dist/{FileSaver.min-D0CP0E3N.js → FileSaver.min-CueAGbjq.js} +1 -1
  16. package/dist/{Game-B-8by2dp.js → Game-B6GO_LVU.js} +19 -18
  17. package/dist/{GiftCardSetup-CdqZd1ee.js → GiftCardSetup-CVLDDpI2.js} +75 -75
  18. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-BVTu4uTR.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-isfGhKO1.js} +7 -7
  19. package/dist/{Goals-xFHNbwt7.js → Goals-BX-sMV2V.js} +4 -4
  20. package/dist/Grab-Bh335Srh.js +301 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-B5Z1AZRV.js → ImageInput.vue_vue_type_script_setup_true_lang-srSgUY3e.js} +1 -1
  22. package/dist/{Index-t6veJ0lU.js → Index-CyXRbwcm.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Deeanc8z.js → LocationPicker.vue_vue_type_script_setup_true_lang-S3GB2Ems.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-B8qOJYoS.js → LottieAnimation.vue_vue_type_script_setup_true_lang-ZlWHXwXZ.js} +1 -1
  25. package/dist/{LoyaltyDashboard-DXNBsnM5.js → LoyaltyDashboard-DrTq8oiu.js} +15 -15
  26. package/dist/MainLayout-KbKkpX5n.js +4 -0
  27. package/dist/{MainLayout-CmCboaEn.js → MainLayout.vue_vue_type_script_setup_true_lang-2D5ate_s.js} +5 -4
  28. package/dist/{Marketing-DCq9O5eb.js → Marketing-DQT1MWQg.js} +4 -4
  29. package/dist/MarketingMaterialEdit-fSqr53-M.js +1037 -0
  30. package/dist/{Member-BCYmEmhD.js → Member-DwDUCzlv.js} +7 -7
  31. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-Djrfmj9g.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-DaQ4Lw8f.js} +43 -50
  32. package/dist/{MemberImportHistory-D-5NAOfo.js → MemberImportHistory-D4ezvJGZ.js} +7 -7
  33. package/dist/{MemberList-IySTKOT_.js → MemberList-DFieV7Qk.js} +103 -105
  34. package/dist/{MemberTransactions-BgQZvc5O.js → MemberTransactions-BPOXyAuC.js} +1 -1
  35. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-N8PCSKBx.js → MessageInput.vue_vue_type_script_setup_true_lang-DhfsgDd4.js} +4228 -4176
  36. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-_JNdYsBu.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CX8bk_IQ.js} +1 -1
  37. package/dist/{Mission-DtaTKWE2.js → Mission-nErb05Es.js} +22 -21
  38. package/dist/{Overview-DVMdPa97.js → Overview-7G31a7B-.js} +23 -22
  39. package/dist/{Overview-D-uC2-Pi.js → Overview-DuJr_hAg.js} +145 -144
  40. package/dist/{Point-jnPIgHMZ.js → Point-PWDLemD4.js} +22 -21
  41. package/dist/{Promotion-mdQg-RSh.js → Promotion-N80Tj8M6.js} +137 -131
  42. package/dist/{Queue-D8YY1lbn.js → Queue-M7ZpgiMT.js} +47 -46
  43. package/dist/{Record-Dh-rN7a0.js → Record-NhxrdvWv.js} +9 -9
  44. package/dist/{Review-C8B-SIR8.js → Review-DiAaAzIG.js} +2 -2
  45. package/dist/ReviewFacebookCallback-JdyxFbNl.js +225 -0
  46. package/dist/{ReviewGoogleCallback-pNF2ICvQ.js → ReviewGoogleCallback-BXbI3Bsh.js} +5 -5
  47. package/dist/{Reward-D7KPnzXt.js → Reward-yTaOqOT8.js} +29 -29
  48. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-C87CDjxP.js → RewardGroup.vue_vue_type_script_setup_true_lang-BWPfjZ9K.js} +16 -15
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cz2H9MKe.js +1923 -0
  50. package/dist/{Segment-Ct8JRTjV.js → Segment-DE9Bcd6R.js} +290 -291
  51. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-w-UpWetC.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-pmv0cb4J.js} +31 -30
  52. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BbEX2h2u.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BeWwkTix.js} +4 -4
  53. package/dist/Setting-C0JAxIRT.js +574 -0
  54. package/dist/{SettingAdvertisements-BrB-dGPs.js → SettingAdvertisements-DxueyKU8.js} +12 -12
  55. package/dist/Settings-Cs46AcxZ.js +286 -0
  56. package/dist/{Store-EKPfHEmY.js → Store-DqQae9nE.js} +661 -654
  57. package/dist/{StoreRewards-B208ENOi.js → StoreRewards-JxSUsOzJ.js} +15 -15
  58. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-qgrBtUNX.js +1319 -0
  59. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D7ifzgsI.js +7007 -0
  60. package/dist/{Tier-CjYiCZy_.js → Tier-DWhgWush.js} +2576 -687
  61. package/dist/{Title-BXkVolaL.js → Title-DUNeMdz8.js} +94 -92
  62. package/dist/{Transaction-D1T3aIC3.js → Transaction-DAv-LVhC.js} +2 -2
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-flUDCSA5.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Cih-9IoW.js} +26 -26
  64. package/dist/{Voucher-DnQ8jNjI.js → Voucher-uLTq9RSK.js} +19 -19
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Z9GDpO4z.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BevVL_Kx.js} +16 -16
  66. package/dist/WhatsappAccount-BpXQ4q0P.js +158 -0
  67. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-EssnbsgT.js +39 -0
  68. package/dist/WhatsappBot-DB4NRZMd.js +589 -0
  69. package/dist/WhatsappBotLogs-DDN4H_bv.js +372 -0
  70. package/dist/WhatsappBotSettings-Bkv1VNwF.js +387 -0
  71. package/dist/WhatsappBotTickets-DAKgnE6T.js +162 -0
  72. package/dist/WhatsappLayout-DSnq84Uo.js +21 -0
  73. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-1BvxPD-k.js +195 -0
  74. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Dcw8Oi-t.js → ZodTextField.vue_vue_type_script_setup_true_lang-CR-F0x1r.js} +2 -2
  75. package/dist/{app-BtGohMqA.js → app-Devzv4gO.js} +10468 -8156
  76. package/dist/app.js +4 -3
  77. package/dist/{base.export-DulNMo7e.js → base.export-CCSMkvAm.js} +2 -2
  78. package/dist/browser-BSAOEeIM.js +1478 -0
  79. package/dist/{business-Bla8vvZH.js → business-BjAmUqNA.js} +1 -1
  80. package/dist/campaign-C5c47GqT.js +400 -0
  81. package/dist/{campaign-BIPNFBY5.js → campaign-CTe-T5Gd.js} +31 -25
  82. package/dist/{campaign.enum-liUaxkcy.js → campaign.enum-Dx-Zo68Q.js} +3 -2
  83. package/dist/campaign.fn-DxAO8A5b.js +776 -0
  84. package/dist/{collectible.enum-C0FfRMrW.js → collectible.enum-Liy2wH3s.js} +1 -1
  85. package/dist/{collection.fn-DdDMfaFO.js → collection.fn-C9l-OtNt.js} +2 -2
  86. package/dist/{currency-BrVnqxQ1.js → currency-mwm4AWXK.js} +1 -1
  87. package/dist/duplicateCampaign-BbC4AwQ1.js +51 -0
  88. package/dist/{effect-gfVmfrm9.js → effect-D8ba9z0K.js} +1 -1
  89. package/dist/{email-addresses-Dy8NFNBw.js → email-addresses-BR5J6_Jz.js} +2 -2
  90. package/dist/feature-flag-C-5NdFW8.js +868 -0
  91. package/dist/feature-flag-CNcU4_3r.js +50 -0
  92. package/dist/google-BQK68wbe.js +5 -0
  93. package/dist/{helper-CMhQctQK.js → helper-D9cEaMIv.js} +1 -1
  94. package/dist/index-0H82-X0n.js +80 -0
  95. package/dist/{index-D6RDVy95.js → index-B1jP-_Z_.js} +691 -230
  96. package/dist/{index-Dalmv1m4.js → index-B7HH6vKF.js} +8 -7
  97. package/dist/{index-v1exQSyU.js → index-BFaZp6Et.js} +29 -15
  98. package/dist/{index-DKmtDBKS.js → index-B_gzo75q.js} +1 -1
  99. package/dist/{index-qJOEwQ_z.js → index-BfoDdVQS.js} +19 -6
  100. package/dist/{index-C5rRuwhC.js → index-BvY2hQac.js} +1 -1
  101. package/dist/{index-CZqwIQXi.js → index-Byg4ztr-.js} +396 -232
  102. package/dist/{index-otcusTFM.js → index-CZfqqrVu.js} +4 -3
  103. package/dist/index-C_H8jFYf.js +2743 -0
  104. package/dist/{index-CUFuU2eJ.js → index-CmzjBrHR.js} +11 -10
  105. package/dist/{index-CLiJUFmJ.js → index-Ct6YjTIW.js} +2 -2
  106. package/dist/{index-B6x6s8mu.js → index-D34iYRdc.js} +683 -581
  107. package/dist/{index-dyMdi0Rt.js → index-D4k1G2oE.js} +4 -4
  108. package/dist/{index-DvW-3flw.js → index-DnepoNWn.js} +8028 -10767
  109. package/dist/index-Drmh0FT-.js +14571 -0
  110. package/dist/{index-BqKrePY8.js → index-DtcUCknS.js} +2700 -2613
  111. package/dist/{index-D1T4Yf4t.js → index-DwTBiVts.js} +1 -1
  112. package/dist/{index-BOZ3oVHd.js → index-OvnHt5x5.js} +800 -793
  113. package/dist/index-RwNlbTO8.js +115 -0
  114. package/dist/{index-C67-z1uf.js → index-VqAbYyHH.js} +2 -2
  115. package/dist/{index-CghtzuVO.js → index-yGSko6Eq.js} +1 -1
  116. package/dist/{index.esm2017-BLKRIlb9.js → index.esm2017-DLb2VyCT.js} +156 -156
  117. package/dist/{loading-BkJ3h_4U.js → loading-CUNk5u1d.js} +1 -1
  118. package/dist/{lodash-C0Kbs8lQ.js → lodash-BJXravls.js} +1 -1
  119. package/dist/{member-import-trpK8l8R.js → member-import-DjYoddBi.js} +6 -5
  120. package/dist/{membership-TV1CoyKQ.js → membership-ByJUFP8f.js} +3 -3
  121. package/dist/{money-BM-DK9iD.js → money-Bf2IEMJJ.js} +1 -1
  122. package/dist/{number-BclgE86R.js → number-CRBHrRUL.js} +1 -1
  123. package/dist/objectid-58gyOvdR.js +145 -0
  124. package/dist/{onboarding-BLuoXyCY.js → onboarding-CQ3lw7eY.js} +25 -25
  125. package/dist/{onboardingSetup-BLmLAgIV.js → onboardingSetup-CsdZKGFk.js} +2 -2
  126. package/dist/{plugins-3_mD58dh.js → plugins-iTZLbJGy.js} +3 -3
  127. package/dist/{MarketingMaterialEdit-CGLxanxm.js → remy-icon-BhUGu2NI.js} +2 -1031
  128. package/dist/{reward-Bo4szVCU.js → reward-DTN6JpEd.js} +1 -1
  129. package/dist/{rule-Bwy5-zD7.js → rule-BYACNQOL.js} +572 -492
  130. package/dist/style.css +1 -1
  131. package/dist/template--Vr0PCjB.js +188 -0
  132. package/dist/{timezone-DQ7TNXmV.js → timezone-DwzjOED-.js} +1 -1
  133. package/dist/{transaction.fn-OT7ucfCB.js → transaction.fn-DapYe3n7.js} +2 -2
  134. package/dist/{trigger-BJKHGcNG.js → trigger-D8r76yb0.js} +9 -9
  135. package/dist/{useMarketingMaterialActions-BX3C1Gga.js → useMarketingMaterialActions-CdMmibPE.js} +3 -3
  136. package/dist/{usePagination-Qp0qoWBj.js → usePagination-BRcQJkO1.js} +1 -1
  137. package/dist/useWhatsappAccount-BOJ8fz84.js +62 -0
  138. package/dist/{user-BcE3fiEa.js → user-vBZFKqXQ.js} +1 -1
  139. package/dist/vue-i18n-Cw6fF11e.js +2365 -0
  140. package/dist/{xlsx-DYZ421PG.js → xlsx-Muy_Rjhk.js} +1 -1
  141. package/dist/{zod-DestzeIp.js → zod-CCPTOeUz.js} +1 -1
  142. package/package.json +12 -3
  143. package/dist/Broadcast-CdAN6JCa.js +0 -271
  144. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bn-lauCv.js +0 -2431
  145. package/dist/ReviewFacebookCallback-C3eyH0pS.js +0 -238
  146. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D1S2sLOK.js +0 -1883
  147. package/dist/Setting-C3Binnn_.js +0 -2036
  148. package/dist/Settings-D6h2QM6X.js +0 -179
  149. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Dy7_GFoi.js +0 -1264
  150. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-B2KJeL5Y.js +0 -142
  151. package/dist/campaign-DYqAyRCY.js +0 -228
  152. package/dist/campaign.fn-J7hYcX_7.js +0 -776
  153. package/dist/google-C3S8u0mT.js +0 -4
  154. package/dist/index-Culx-Z9v.js +0 -51
  155. package/dist/objectid-C2XvpEgx.js +0 -145
  156. package/dist/rule-builder-Co_1uuj4.js +0 -102
  157. package/dist/template-fImyGLa7.js +0 -236
  158. package/dist/vue-i18n-BQmB8Ex1.js +0 -2365
@@ -0,0 +1,387 @@
1
+ import { defineComponent as L, mergeModels as U, useModel as A, resolveComponent as k, openBlock as c, createElementBlock as p, createElementVNode as r, toDisplayString as m, unref as e, createVNode as g, computed as E, Fragment as N, renderList as X, normalizeClass as D, createTextVNode as O, createCommentVNode as T, withDirectives as Y, vModelRadio as Z, ref as f, watch as ee, onBeforeUnmount as te, createBlock as oe } from "vue";
2
+ import { u as M } from "./vue-i18n-Cw6fF11e.js";
3
+ import { useSnackbar as ae } from "@feedmepos/ui-library";
4
+ import { F as j, a as C, b as le, c as se, d as ne, e as $, f as re } from "./index-RwNlbTO8.js";
5
+ import { S as ie } from "./index-OvnHt5x5.js";
6
+ import { w as z } from "./index-0H82-X0n.js";
7
+ import { p as ce } from "./plugins-iTZLbJGy.js";
8
+ const de = { class: "flex flex-col gap-[16px]" }, pe = { class: "flex flex-col gap-[4px]" }, ue = { class: "text-[16px] leading-[24px] font-semibold" }, me = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary" }, ve = /* @__PURE__ */ L({
9
+ __name: "BotInstructions",
10
+ props: /* @__PURE__ */ U({
11
+ disabled: { type: Boolean }
12
+ }, {
13
+ modelValue: { required: !0 },
14
+ modelModifiers: {}
15
+ }),
16
+ emits: ["update:modelValue"],
17
+ setup(d) {
18
+ const o = A(d, "modelValue"), { t: a } = M();
19
+ return (i, t) => {
20
+ const v = k("FmTextarea");
21
+ return c(), p("div", de, [
22
+ r("div", pe, [
23
+ r("h2", ue, m(e(a)("connect.whatsappBot.botSettings.instructions")), 1),
24
+ r("p", me, m(e(a)("connect.whatsappBot.botSettings.description")), 1)
25
+ ]),
26
+ g(v, {
27
+ modelValue: o.value,
28
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => o.value = n),
29
+ "aria-label": e(a)("connect.whatsappBot.botSettings.instructions"),
30
+ placeholder: e(a)("connect.whatsappBot.botSettings.placeholder"),
31
+ "max-length": e(j),
32
+ disabled: d.disabled,
33
+ "show-word-count": "",
34
+ class: "bot-instructions-textarea"
35
+ }, null, 8, ["modelValue", "aria-label", "placeholder", "max-length", "disabled"])
36
+ ]);
37
+ };
38
+ }
39
+ }), xe = {
40
+ "aria-labelledby": "knowledge-base-title",
41
+ class: "border-t-[1px] border-fm-color-neutral-gray-100 pt-[20px] flex flex-col gap-[12px]"
42
+ }, be = { class: "flex flex-col gap-[4px]" }, ge = {
43
+ id: "knowledge-base-title",
44
+ class: "text-[16px] leading-[24px] font-semibold"
45
+ }, fe = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary" }, he = { class: "flex flex-wrap gap-[8px]" }, _e = ["title", "aria-expanded", "disabled", "onClick"], ye = ["disabled"], we = {
46
+ key: 0,
47
+ class: "text-[14px] text-fm-color-typo-tertiary"
48
+ }, Se = {
49
+ key: 1,
50
+ class: "text-[14px] text-fm-color-typo-secondary"
51
+ }, Be = /* @__PURE__ */ L({
52
+ __name: "KnowledgeBase",
53
+ props: /* @__PURE__ */ U({
54
+ disabled: { type: Boolean }
55
+ }, {
56
+ modelValue: {
57
+ required: !0
58
+ },
59
+ modelModifiers: {},
60
+ activeTopicIndex: {
61
+ required: !0
62
+ },
63
+ activeTopicIndexModifiers: {}
64
+ }),
65
+ emits: ["update:modelValue", "update:activeTopicIndex"],
66
+ setup(d) {
67
+ const o = d, a = A(d, "modelValue"), i = A(d, "activeTopicIndex"), { t } = M(), v = E(
68
+ () => i.value === null ? null : a.value[i.value]
69
+ );
70
+ function n() {
71
+ o.disabled || a.value.length >= C || (a.value.push({ title: "", description: "" }), i.value = a.value.length - 1);
72
+ }
73
+ function _() {
74
+ o.disabled || i.value === null || (a.value.splice(i.value, 1), i.value = null);
75
+ }
76
+ return (y, w) => {
77
+ const h = k("FmIcon"), F = k("FmTextField"), P = k("FmTextarea"), S = k("FmButton");
78
+ return c(), p("section", xe, [
79
+ r("div", be, [
80
+ r("h2", ge, m(e(t)("connect.whatsappBot.botSettings.knowledgeBase.title")), 1),
81
+ r("p", fe, m(e(t)("connect.whatsappBot.botSettings.knowledgeBase.description")), 1)
82
+ ]),
83
+ r("div", he, [
84
+ (c(!0), p(N, null, X(a.value, (u, x) => (c(), p("button", {
85
+ key: x,
86
+ type: "button",
87
+ title: u.title.trim() || e(t)("connect.whatsappBot.botSettings.knowledgeBase.untitled"),
88
+ "aria-expanded": i.value === x,
89
+ "aria-controls": "knowledge-topic-editor",
90
+ disabled: d.disabled,
91
+ class: D(["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", [
92
+ i.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",
93
+ d.disabled ? "cursor-default" : "cursor-pointer hover:border-fm-color-primary"
94
+ ]]),
95
+ onClick: (H) => i.value = i.value === x ? null : x
96
+ }, m(u.title.trim() || e(t)("connect.whatsappBot.botSettings.knowledgeBase.untitled")), 11, _e))), 128)),
97
+ r("button", {
98
+ type: "button",
99
+ disabled: d.disabled || a.value.length >= e(C),
100
+ 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",
101
+ onClick: n
102
+ }, [
103
+ g(h, {
104
+ name: "add",
105
+ size: "sm"
106
+ }),
107
+ O(" " + m(e(t)("connect.whatsappBot.botSettings.knowledgeBase.addTopic")), 1)
108
+ ], 8, ye)
109
+ ]),
110
+ a.value.length === 0 ? (c(), p("p", we, m(e(t)("connect.whatsappBot.botSettings.knowledgeBase.empty")), 1)) : T("", !0),
111
+ a.value.length >= e(C) ? (c(), p("p", Se, m(e(t)("connect.whatsappBot.botSettings.knowledgeBase.topicLimit", {
112
+ count: e(C)
113
+ })), 1)) : T("", !0),
114
+ v.value ? (c(), p("div", {
115
+ id: "knowledge-topic-editor",
116
+ key: i.value ?? void 0,
117
+ class: "rounded-[8px] border-[1px] border-fm-color-neutral-gray-100 p-[16px] flex flex-col gap-[12px]"
118
+ }, [
119
+ g(F, {
120
+ modelValue: v.value.title,
121
+ "onUpdate:modelValue": w[0] || (w[0] = (u) => v.value.title = u),
122
+ label: e(t)("connect.whatsappBot.botSettings.knowledgeBase.titleLabel"),
123
+ placeholder: e(t)("connect.whatsappBot.botSettings.knowledgeBase.titlePlaceholder"),
124
+ "max-length": e(le),
125
+ disabled: d.disabled
126
+ }, null, 8, ["modelValue", "label", "placeholder", "max-length", "disabled"]),
127
+ g(P, {
128
+ modelValue: v.value.description,
129
+ "onUpdate:modelValue": w[1] || (w[1] = (u) => v.value.description = u),
130
+ label: e(t)("connect.whatsappBot.botSettings.knowledgeBase.descriptionLabel"),
131
+ placeholder: e(t)(
132
+ "connect.whatsappBot.botSettings.knowledgeBase.descriptionPlaceholder"
133
+ ),
134
+ "max-length": e(se),
135
+ disabled: d.disabled,
136
+ "show-word-count": "",
137
+ class: "bot-instructions-textarea"
138
+ }, null, 8, ["modelValue", "label", "placeholder", "max-length", "disabled"]),
139
+ g(S, {
140
+ variant: "plain",
141
+ size: "sm",
142
+ "prepend-icon": "delete",
143
+ "text-color": "typo-error",
144
+ label: e(t)("connect.whatsappBot.botSettings.knowledgeBase.removeTopic"),
145
+ disabled: d.disabled,
146
+ class: "self-start",
147
+ onClick: _
148
+ }, null, 8, ["label", "disabled"])
149
+ ])) : T("", !0)
150
+ ]);
151
+ };
152
+ }
153
+ }), ke = {
154
+ "aria-labelledby": "response-speed-title",
155
+ class: "border-t-[1px] border-fm-color-neutral-gray-100 pt-[20px] flex flex-col gap-[12px]"
156
+ }, Te = { class: "flex flex-col gap-[4px]" }, Ve = {
157
+ id: "response-speed-title",
158
+ class: "text-[16px] leading-[24px] font-semibold"
159
+ }, Fe = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary" }, Ie = {
160
+ role: "radiogroup",
161
+ "aria-labelledby": "response-speed-title",
162
+ "aria-describedby": "response-speed-detail",
163
+ class: "grid grid-cols-[repeat(auto-fit,minmax(150px,1fr))] gap-[8px]"
164
+ }, Ee = ["value", "disabled"], Pe = { class: "flex items-center gap-[8px] text-[14px] leading-[20px] font-semibold" }, Ce = {
165
+ key: 0,
166
+ class: "w-[8px] h-[8px] rounded-full bg-fm-color-primary"
167
+ }, $e = { class: "text-[12px] leading-[16px] text-fm-color-typo-secondary" }, Ae = {
168
+ id: "response-speed-detail",
169
+ "aria-live": "polite",
170
+ class: "text-[14px] leading-[20px] text-fm-color-typo-secondary"
171
+ }, Ne = {
172
+ key: 0,
173
+ class: "rounded-[8px] bg-fm-color-system-warning-100 px-[12px] py-[10px] flex items-start gap-[10px] text-[14px] leading-[20px]"
174
+ }, Oe = /* @__PURE__ */ L({
175
+ __name: "ResponseSpeed",
176
+ props: /* @__PURE__ */ U({
177
+ disabled: { type: Boolean }
178
+ }, {
179
+ modelValue: {
180
+ required: !0
181
+ },
182
+ modelModifiers: {}
183
+ }),
184
+ emits: ["update:modelValue"],
185
+ setup(d) {
186
+ const o = A(d, "modelValue"), { t: a } = M();
187
+ return (i, t) => {
188
+ const v = k("FmIcon");
189
+ return c(), p("section", ke, [
190
+ r("div", Te, [
191
+ r("h2", Ve, m(e(a)("connect.whatsappBot.botSettings.responseSpeed.title")), 1),
192
+ r("p", Fe, m(e(a)("connect.whatsappBot.botSettings.responseSpeed.description")), 1)
193
+ ]),
194
+ r("div", Ie, [
195
+ (c(!0), p(N, null, X(e(ne), (n) => (c(), p("label", { key: n }, [
196
+ Y(r("input", {
197
+ "onUpdate:modelValue": t[0] || (t[0] = (_) => o.value = _),
198
+ type: "radio",
199
+ name: "response-speed",
200
+ value: n,
201
+ disabled: d.disabled,
202
+ class: "sr-only peer"
203
+ }, null, 8, Ee), [
204
+ [Z, o.value]
205
+ ]),
206
+ r("span", {
207
+ class: D(["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", [
208
+ o.value === n ? "border-fm-color-primary bg-fm-color-primary-oats" : "border-fm-color-neutral-gray-200 bg-fm-color-neutral-white",
209
+ d.disabled ? "cursor-default opacity-60" : "cursor-pointer hover:border-fm-color-primary"
210
+ ]])
211
+ }, [
212
+ r("span", Pe, [
213
+ r("span", {
214
+ "aria-hidden": "true",
215
+ class: D([
216
+ "w-[16px] h-[16px] shrink-0 rounded-full border-[1.5px] bg-fm-color-neutral-white flex items-center justify-center",
217
+ o.value === n ? "border-fm-color-primary" : "border-fm-color-neutral-gray-300"
218
+ ])
219
+ }, [
220
+ o.value === n ? (c(), p("span", Ce)) : T("", !0)
221
+ ], 2),
222
+ O(" " + m(e(a)(`connect.whatsappBot.botSettings.responseSpeed.${n}.label`)), 1)
223
+ ]),
224
+ r("span", $e, m(e(a)(`connect.whatsappBot.botSettings.responseSpeed.${n}.hint`)), 1)
225
+ ], 2)
226
+ ]))), 128))
227
+ ]),
228
+ r("p", Ae, m(e(a)(
229
+ `connect.whatsappBot.botSettings.responseSpeed.${o.value}.detail`
230
+ )), 1),
231
+ o.value === "immediate" ? (c(), p("div", Ne, [
232
+ g(v, {
233
+ name: "warning",
234
+ size: "sm",
235
+ class: "mt-[2px] shrink-0 text-fm-color-typo-warning"
236
+ }),
237
+ O(" " + m(e(a)("connect.whatsappBot.botSettings.responseSpeed.immediateWarning")), 1)
238
+ ])) : T("", !0)
239
+ ]);
240
+ };
241
+ }
242
+ }), Le = { class: "mt-[24px] w-full flex flex-col gap-[20px]" }, Me = {
243
+ key: 0,
244
+ role: "status",
245
+ class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
246
+ }, We = {
247
+ key: 1,
248
+ role: "alert",
249
+ class: "text-[14px] text-fm-color-typo-error"
250
+ }, De = { class: "flex items-center justify-end gap-[12px] flex-wrap" }, je = /* @__PURE__ */ L({
251
+ __name: "WhatsappBotSettings",
252
+ setup(d) {
253
+ const { t: o } = M(), a = ae(), i = E(() => ie.getBusinessId() ?? ""), t = f(""), v = f(""), n = f([]), _ = f([]), y = f(null), w = E(
254
+ () => n.value.filter(
255
+ (l) => l.title.trim() || l.description.trim()
256
+ )
257
+ ), h = f(
258
+ $
259
+ ), F = f(
260
+ $
261
+ ), P = f(!0), S = f(!1), u = f(!1), x = f(""), H = j, J = E(
262
+ () => t.value !== v.value || h.value !== F.value || JSON.stringify(n.value) !== JSON.stringify(_.value)
263
+ ), W = E(
264
+ () => !S.value || u.value || !J.value
265
+ ), R = E(
266
+ () => !S.value || u.value || t.value.length > H || !re.safeParse(w.value).success
267
+ );
268
+ let b;
269
+ function G(l) {
270
+ t.value = l.botInstructions, v.value = l.botInstructions, h.value = l.responseSpeed, F.value = l.responseSpeed, n.value = l.knowledgeBase.map((s) => ({ ...s })), _.value = l.knowledgeBase.map((s) => ({
271
+ ...s
272
+ }));
273
+ }
274
+ async function K() {
275
+ b == null || b.abort();
276
+ const l = new AbortController();
277
+ b = l, P.value = !0, S.value = !1, u.value = !1, x.value = "", t.value = "", v.value = "", h.value = $, F.value = $, n.value = [], _.value = [], y.value = null;
278
+ try {
279
+ if (!i.value)
280
+ throw new Error(o("connect.whatsappBot.errors.selectBusiness"));
281
+ const s = await z.getSettings(
282
+ i.value,
283
+ l.signal
284
+ );
285
+ if (l.signal.aborted) return;
286
+ G(s), S.value = !0;
287
+ } catch (s) {
288
+ l.signal.aborted || (x.value = s instanceof Error ? s.message : o("connect.whatsappBot.errors.loadSettings"));
289
+ } finally {
290
+ l.signal.aborted || (P.value = !1);
291
+ }
292
+ }
293
+ async function q() {
294
+ if (R.value) return;
295
+ b == null || b.abort();
296
+ const l = new AbortController();
297
+ b = l, u.value = !0, x.value = "";
298
+ const s = y.value === null ? void 0 : n.value[y.value], I = s ? w.value.indexOf(s) : -1;
299
+ try {
300
+ const B = await z.saveSettings(
301
+ i.value,
302
+ {
303
+ botInstructions: t.value,
304
+ responseSpeed: h.value,
305
+ knowledgeBase: w.value
306
+ },
307
+ l.signal
308
+ );
309
+ if (l.signal.aborted) return;
310
+ G(B), y.value = I < 0 ? null : I, a.open({
311
+ type: "success",
312
+ message: o("connect.whatsappBot.botSettings.saved")
313
+ });
314
+ } catch (B) {
315
+ l.signal.aborted || (x.value = B instanceof Error ? B.message : o("connect.whatsappBot.errors.saveSettings"), a.open({ type: "error", message: x.value }));
316
+ } finally {
317
+ l.signal.aborted || (u.value = !1);
318
+ }
319
+ }
320
+ async function Q() {
321
+ if (W.value) return;
322
+ const l = b;
323
+ !await ce.confirm(
324
+ o("connect.whatsappBot.botSettings.discardChangesMessage"),
325
+ o("connect.whatsappBot.botSettings.discardChangesTitle"),
326
+ o("connect.common.confirm"),
327
+ o("connect.common.cancel")
328
+ ) || W.value || b !== l || (t.value = v.value, h.value = F.value, n.value = _.value.map((I) => ({ ...I })), y.value = null);
329
+ }
330
+ return ee(i, K, { immediate: !0 }), te(() => {
331
+ b == null || b.abort();
332
+ }), (l, s) => {
333
+ const I = k("FmCircularProgress"), B = k("FmButton");
334
+ return c(), p("div", Le, [
335
+ P.value ? (c(), p("div", Me, [
336
+ g(I),
337
+ O(" " + m(e(o)("connect.whatsappBot.botSettings.loading")), 1)
338
+ ])) : (c(), p(N, { key: 1 }, [
339
+ S.value ? (c(), p(N, { key: 0 }, [
340
+ g(ve, {
341
+ modelValue: t.value,
342
+ "onUpdate:modelValue": s[0] || (s[0] = (V) => t.value = V),
343
+ disabled: u.value
344
+ }, null, 8, ["modelValue", "disabled"]),
345
+ g(Be, {
346
+ modelValue: n.value,
347
+ "onUpdate:modelValue": s[1] || (s[1] = (V) => n.value = V),
348
+ "active-topic-index": y.value,
349
+ "onUpdate:activeTopicIndex": s[2] || (s[2] = (V) => y.value = V),
350
+ disabled: u.value
351
+ }, null, 8, ["modelValue", "active-topic-index", "disabled"]),
352
+ g(Oe, {
353
+ modelValue: h.value,
354
+ "onUpdate:modelValue": s[3] || (s[3] = (V) => h.value = V),
355
+ disabled: u.value
356
+ }, null, 8, ["modelValue", "disabled"])
357
+ ], 64)) : T("", !0),
358
+ x.value ? (c(), p("p", We, m(x.value), 1)) : T("", !0),
359
+ S.value ? T("", !0) : (c(), oe(B, {
360
+ key: 2,
361
+ class: "self-start",
362
+ label: e(o)("connect.whatsappBot.tryAgain"),
363
+ "prepend-icon": "refresh",
364
+ onClick: K
365
+ }, null, 8, ["label"])),
366
+ r("div", De, [
367
+ g(B, {
368
+ variant: "secondary",
369
+ label: e(o)("connect.common.cancel"),
370
+ disabled: W.value,
371
+ onClick: Q
372
+ }, null, 8, ["label", "disabled"]),
373
+ g(B, {
374
+ label: e(o)("connect.common.save"),
375
+ disabled: R.value,
376
+ loading: u.value,
377
+ onClick: q
378
+ }, null, 8, ["label", "disabled", "loading"])
379
+ ])
380
+ ], 64))
381
+ ]);
382
+ };
383
+ }
384
+ });
385
+ export {
386
+ je as default
387
+ };
@@ -0,0 +1,162 @@
1
+ import { defineComponent as U, ref as h, computed as $, watch as L, onBeforeUnmount as R, resolveComponent as w, openBlock as n, createElementBlock as l, createElementVNode as s, toDisplayString as r, unref as c, createVNode as g, createTextVNode as b, createCommentVNode as B, Fragment as T, renderList as z } from "vue";
2
+ import { u as M } from "./vue-i18n-Cw6fF11e.js";
3
+ import { S as A } from "./index-OvnHt5x5.js";
4
+ import { w as W } from "./index-0H82-X0n.js";
5
+ const G = { class: "mt-[20px] w-full flex flex-col gap-[16px]" }, H = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary" }, J = {
6
+ key: 0,
7
+ role: "status",
8
+ class: "flex items-center gap-[6px] text-[14px] text-fm-color-typo-success"
9
+ }, K = {
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
+ }, O = {
14
+ key: 0,
15
+ class: "flex items-center gap-[12px] flex-wrap"
16
+ }, Q = {
17
+ role: "alert",
18
+ class: "text-[14px] text-fm-color-typo-error"
19
+ }, X = {
20
+ key: 1,
21
+ role: "alert",
22
+ class: "text-[14px] text-fm-color-typo-error"
23
+ }, Y = {
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
+ }, Z = { class: "text-[20px] font-semibold" }, q = { class: "max-w-[420px] text-[14px] leading-[20px] text-fm-color-typo-secondary" }, ee = {
27
+ key: 3,
28
+ class: "flex flex-col gap-[12px]"
29
+ }, te = {
30
+ "aria-hidden": "true",
31
+ class: "w-[40px] h-[40px] rounded-full overflow-hidden 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
+ }, oe = ["src", "onError"], se = { key: 1 }, re = { class: "flex-1 min-w-[200px] flex flex-col gap-[2px]" }, ae = { class: "flex items-center gap-[8px] flex-wrap" }, ne = { class: "text-[14px] leading-[20px] font-semibold break-words" }, le = { 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" }, ce = { class: "text-[12px] leading-[16px] text-fm-color-typo-tertiary break-words" }, pe = { class: "mt-[6px] text-[14px] leading-[20px] text-fm-color-typo-secondary whitespace-pre-wrap break-words" }, ie = { class: "flex items-center gap-[16px] ml-auto flex-wrap" }, de = ["datetime"], he = /* @__PURE__ */ U({
33
+ __name: "WhatsappBotTickets",
34
+ props: {
35
+ tickets: {},
36
+ loading: { type: Boolean },
37
+ error: {}
38
+ },
39
+ emits: ["retry", "resolved"],
40
+ setup(m, { emit: F }) {
41
+ const E = m, k = F, { t: o, locale: S } = M(), i = h(""), u = h(""), d = h(""), y = h({});
42
+ let x, v;
43
+ const I = $(
44
+ () => [...E.tickets].sort((t, a) => a.updatedAt.localeCompare(t.updatedAt))
45
+ );
46
+ function _(t) {
47
+ return t.customerName || t.phoneNumber || t.customerLid;
48
+ }
49
+ function D(t) {
50
+ return t.customerName ? t.customerName.trim().split(/\s+/).slice(0, 2).map((a) => Array.from(a)[0]).join("").toUpperCase() : "?";
51
+ }
52
+ function V(t) {
53
+ return new Intl.DateTimeFormat(S.value, {
54
+ dateStyle: "medium",
55
+ timeStyle: "short"
56
+ }).format(new Date(t));
57
+ }
58
+ async function j(t) {
59
+ if (i.value) return;
60
+ const a = A.getBusinessId();
61
+ if (!a || t.businessId !== a) return;
62
+ const p = new AbortController();
63
+ x = p, i.value = t.id, u.value = "", d.value = "", clearTimeout(v);
64
+ try {
65
+ if (await W.resolveTicket(a, t.id, p.signal), p.signal.aborted) return;
66
+ k("resolved", t.id), d.value = o("connect.whatsappBot.tickets.resolvedMessage", {
67
+ name: _(t)
68
+ }), v = setTimeout(() => d.value = "", 3e3);
69
+ } catch (f) {
70
+ p.signal.aborted || (u.value = f instanceof Error ? f.message : o("connect.whatsappBot.tickets.resolveError"));
71
+ } finally {
72
+ p.signal.aborted || (i.value = "");
73
+ }
74
+ }
75
+ function C() {
76
+ x == null || x.abort(), clearTimeout(v), i.value = "", u.value = "", d.value = "", y.value = {};
77
+ }
78
+ return L(() => A.getBusinessId(), C), R(C), (t, a) => {
79
+ const p = w("FmIcon"), f = w("FmCircularProgress"), N = w("FmButton");
80
+ return n(), l("section", G, [
81
+ s("p", H, r(c(o)("connect.whatsappBot.tickets.description")), 1),
82
+ d.value ? (n(), l("p", J, [
83
+ g(p, {
84
+ name: "check",
85
+ size: "sm"
86
+ }),
87
+ b(" " + r(d.value), 1)
88
+ ])) : B("", !0),
89
+ m.loading ? (n(), l("div", K, [
90
+ g(f),
91
+ b(" " + r(c(o)("connect.whatsappBot.tickets.loading")), 1)
92
+ ])) : (n(), l(T, { key: 2 }, [
93
+ m.error ? (n(), l("div", O, [
94
+ s("p", Q, r(m.error), 1),
95
+ g(N, {
96
+ variant: "secondary",
97
+ label: c(o)("connect.whatsappBot.tryAgain"),
98
+ "prepend-icon": "refresh",
99
+ onClick: a[0] || (a[0] = (e) => k("retry"))
100
+ }, null, 8, ["label"])
101
+ ])) : B("", !0),
102
+ u.value ? (n(), l("p", X, r(u.value), 1)) : B("", !0),
103
+ !I.value.length && !m.error ? (n(), l("div", Y, [
104
+ s("h2", Z, r(c(o)("connect.whatsappBot.tickets.empty.open.title")), 1),
105
+ s("p", q, r(c(o)("connect.whatsappBot.tickets.empty.open.description")), 1)
106
+ ])) : (n(), l("ul", ee, [
107
+ (n(!0), l(T, null, z(I.value, (e) => (n(), l("li", {
108
+ key: e.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
+ s("div", te, [
112
+ e.profileImage && y.value[e.id] !== e.profileImage ? (n(), l("img", {
113
+ key: 0,
114
+ src: e.profileImage,
115
+ alt: "",
116
+ class: "w-full h-full object-cover",
117
+ referrerpolicy: "no-referrer",
118
+ onError: (P) => y.value[e.id] = e.profileImage ?? ""
119
+ }, null, 40, oe)) : (n(), l("span", se, r(D(e)), 1))
120
+ ]),
121
+ s("div", re, [
122
+ s("div", ae, [
123
+ s("span", ne, r(_(e)), 1),
124
+ s("span", le, [
125
+ a[1] || (a[1] = s("span", { class: "w-[6px] h-[6px] rounded-full bg-current" }, null, -1)),
126
+ b(" " + r(c(o)("connect.whatsappBot.tickets.paused")), 1)
127
+ ])
128
+ ]),
129
+ s("p", ce, r(e.phoneNumber || c(o)("connect.whatsappBot.phoneUnavailable")), 1),
130
+ s("p", pe, r(e.source === "staff" ? c(o)("connect.whatsappBot.tickets.staffReason") : c(o)("connect.whatsappBot.tickets.botReason", {
131
+ reason: e.reason
132
+ })), 1)
133
+ ]),
134
+ s("div", ie, [
135
+ s("time", {
136
+ datetime: e.updatedAt,
137
+ class: "text-[12px] text-fm-color-typo-tertiary tabular-nums"
138
+ }, r(c(o)("connect.whatsappBot.tickets.pausedSince", {
139
+ date: V(e.updatedAt)
140
+ })), 9, de),
141
+ g(N, {
142
+ variant: "secondary",
143
+ "prepend-icon": "check",
144
+ label: c(o)("connect.whatsappBot.tickets.resolve"),
145
+ "aria-label": c(o)("connect.whatsappBot.tickets.resolveCustomer", {
146
+ name: _(e)
147
+ }),
148
+ loading: i.value === e.id,
149
+ disabled: !!i.value,
150
+ onClick: (P) => j(e)
151
+ }, null, 8, ["label", "aria-label", "loading", "disabled", "onClick"])
152
+ ])
153
+ ]))), 128))
154
+ ]))
155
+ ], 64))
156
+ ]);
157
+ };
158
+ }
159
+ });
160
+ export {
161
+ he as default
162
+ };
@@ -0,0 +1,21 @@
1
+ import { defineComponent as n, watch as s, unref as a, openBlock as o, createBlock as r, createCommentVNode as p } from "vue";
2
+ import { useRouter as c } from "vue-router";
3
+ import { _ as u, a as _ } from "./MainLayout.vue_vue_type_script_setup_true_lang-2D5ate_s.js";
4
+ import { u as f } from "./feature-flag-CNcU4_3r.js";
5
+ import { R as i } from "./app-Devzv4gO.js";
6
+ const y = /* @__PURE__ */ n({
7
+ __name: "WhatsappLayout",
8
+ setup(d) {
9
+ const m = c(), e = f();
10
+ return s(
11
+ () => e.loaded && !e.whatsappBotEnabled,
12
+ (t) => {
13
+ t && m.replace({ name: i["$connect-ANALYTIC"] });
14
+ },
15
+ { immediate: !0 }
16
+ ), (t, l) => a(e).loaded ? a(e).whatsappBotEnabled ? (o(), r(_, { key: 1 })) : p("", !0) : (o(), r(u, { key: 0 }));
17
+ }
18
+ });
19
+ export {
20
+ y as default
21
+ };