@feedmepos/mf-connect 0.1.98-beta.79 → 0.1.98-beta.80

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 (128) hide show
  1. package/dist/{App-BffPZGzn.js → App-DievprEi.js} +49 -49
  2. package/dist/{AuditLogs-D3MEmFSx.js → AuditLogs-DrdqOhZL.js} +13 -13
  3. package/dist/{Bin-Jw_wcgsC.js → Bin-Ci2k3z77.js} +8 -8
  4. package/dist/{Broadcast-DOw7z6bn.js → Broadcast-CpDMAG1o.js} +12 -12
  5. package/dist/{CampaignAnalytic-XXjhRtfl.js → CampaignAnalytic-uRyGaLaN.js} +7 -7
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DkWeDf14.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DtGe2Og1.js} +8 -8
  7. package/dist/{Card-D_rB1X9o.js → Card-tb98Kyr-.js} +23 -23
  8. package/dist/{Collections-Da1I5--J.js → Collections-P1S5WjnJ.js} +8 -8
  9. package/dist/{Credit-DJuBjxVe.js → Credit-DwK7JYf-.js} +12 -12
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-CowFIZ3q.js → DateRangeChip.vue_vue_type_script_setup_true_lang-Cyk0iIsd.js} +1 -1
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-pI1jnJn4.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-8r29jKh9.js} +35 -35
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BrBy93g0.js → EffectSheet.vue_vue_type_style_index_0_lang-BML_-v8I.js} +8 -8
  13. package/dist/{Experience-F4_hPy4x.js → Experience-BejtRlOj.js} +13 -13
  14. package/dist/{FileSaver.min-C-nhkwVc.js → FileSaver.min-C-hmBaHm.js} +1 -1
  15. package/dist/{Game-Cfe5gux2.js → Game-n8qL896g.js} +13 -13
  16. package/dist/{GiftCardSetup-CGJCg8-o.js → GiftCardSetup-Bgsfcu7N.js} +57 -57
  17. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-DTHFJbl8.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-CzL68PPP.js} +7 -7
  18. package/dist/{Goals-WWe3kZ3W.js → Goals-BB8LJlq3.js} +4 -4
  19. package/dist/{Grab-Dr49Cz71.js → Grab-COq3Ujst.js} +9 -9
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CPB7kKVu.js → ImageInput.vue_vue_type_script_setup_true_lang-BmLclEyi.js} +1 -1
  21. package/dist/{Index-TsViXhvK.js → Index-BdkIinaE.js} +10 -10
  22. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-DmXKvvvk.js → LocationPicker.vue_vue_type_script_setup_true_lang-DsWv3DVb.js} +1 -1
  23. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BgRr2Bu5.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DvOzGF8c.js} +1 -1
  24. package/dist/{LoyaltyDashboard-D-sVA0uB.js → LoyaltyDashboard-D4Jtpw0n.js} +15 -15
  25. package/dist/{MainLayout-gSvcU53G.js → MainLayout-Ca-Xm3eZ.js} +3 -3
  26. package/dist/{Marketing-BUsNL2jQ.js → Marketing-Cpe4s7NZ.js} +4 -4
  27. package/dist/{MarketingMaterialEdit-DtubIpnt.js → MarketingMaterialEdit-nTeS9VVx.js} +6 -6
  28. package/dist/{Member-9ng7QgMa.js → Member-DgGZ4Cdg.js} +7 -7
  29. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-qOMNiTrI.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-_O3B-FIA.js} +24 -24
  30. package/dist/{MemberImportHistory-BsW3XNAv.js → MemberImportHistory-rdlbDVWU.js} +7 -7
  31. package/dist/{MemberList-DUky4ceB.js → MemberList-BC4aRJTt.js} +14 -14
  32. package/dist/{MemberTransactions-Bu-la_J4.js → MemberTransactions-BFfdTttp.js} +1 -1
  33. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BfLVofJG.js → MessageInput.vue_vue_type_script_setup_true_lang-DXajAQy9.js} +12 -12
  34. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CYqH-qT-.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-8xVDzdO3.js} +1 -1
  35. package/dist/{Mission-47XKDAIr.js → Mission-BWCNKTjU.js} +14 -14
  36. package/dist/{Overview-fPy87ZWK.js → Overview--Q7vzhNK.js} +4 -4
  37. package/dist/{Overview-SDSNOe1_.js → Overview-i02Wnyjn.js} +21 -21
  38. package/dist/{Point-Biql3Qi5.js → Point-CiWxqny5.js} +14 -14
  39. package/dist/{Promotion-CBbBWtke.js → Promotion-B0G9qfBm.js} +14 -14
  40. package/dist/{Queue-DJgqg-cC.js → Queue-YfwgYmzH.js} +13 -13
  41. package/dist/{Record-C6Uzc6pD.js → Record-CCuwrPKW.js} +9 -9
  42. package/dist/{Review-C2pjn38Z.js → Review-ymsfdh7Q.js} +2 -2
  43. package/dist/{ReviewFacebookCallback-USPINa9z.js → ReviewFacebookCallback-DyDExWvP.js} +5 -5
  44. package/dist/{ReviewGoogleCallback-Br_CV3Pq.js → ReviewGoogleCallback-DNyg3n2S.js} +5 -5
  45. package/dist/{Reward-Bl6TyJoX.js → Reward-BKIb0ezH.js} +29 -29
  46. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DVu2-HRI.js → RewardGroup.vue_vue_type_script_setup_true_lang-DPaaNgpr.js} +14 -14
  47. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DqnvglII.js → RuleGroup.vue_vue_type_script_setup_true_lang-BLFLybFn.js} +15 -15
  48. package/dist/{Segment-BKBNrfz8.js → Segment-D5_pp7fh.js} +26 -26
  49. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DLskCbGj.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BLLjIA-D.js} +15 -15
  50. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BT3-tDl-.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BRIcZwnU.js} +4 -4
  51. package/dist/{Setting-BqbtEU61.js → Setting-CD78gIMU.js} +14 -14
  52. package/dist/{SettingAdvertisements-DoHnZG47.js → SettingAdvertisements-C2AIT4s4.js} +12 -12
  53. package/dist/{Settings-HlQyk7g8.js → Settings-DI_tryQV.js} +5 -5
  54. package/dist/{Store-uexWJZhp.js → Store-BV2JTRNZ.js} +27 -27
  55. package/dist/{StoreRewards-BbkTRt3c.js → StoreRewards-Bk55YXyO.js} +15 -15
  56. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-K6q2obBY.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BZZ1fqwg.js} +40 -40
  57. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CRfwFvlQ.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BrEzWVrH.js} +2 -2
  58. package/dist/{Tier-DN6l1PvI.js → Tier-CO2K30Ew.js} +27 -27
  59. package/dist/{Title-4w7I9PNy.js → Title-qProQh3T.js} +23 -23
  60. package/dist/{Transaction-BypZ5Cbs.js → Transaction-qL5L-fE_.js} +2 -2
  61. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CVaOiG6q.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Co1BPScS.js} +6 -6
  62. package/dist/{Voucher-_kyZ6H17.js → Voucher-VFD1LY9Y.js} +19 -19
  63. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DbrNDu2d.js → VoucherEditor.vue_vue_type_script_setup_true_lang-9QyTl7iq.js} +16 -16
  64. package/dist/WhatsappAccount-CxSGqm7H.js +325 -0
  65. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-D8L6izf0.js +96 -0
  66. package/dist/WhatsappBot-C4Oz7Xwv.js +441 -0
  67. package/dist/WhatsappBotSettings-CKqaWzwE.js +136 -0
  68. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B3BOd7wE.js → ZodTextField.vue_vue_type_script_setup_true_lang-Bcsi94dw.js} +2 -2
  69. package/dist/{app-BUdfgxte.js → app-BEYzXWZO.js} +3906 -3703
  70. package/dist/app.js +1 -1
  71. package/dist/{base.export-gSYuTgGq.js → base.export-S_82Elmg.js} +2 -2
  72. package/dist/{business-CjYxENvr.js → business-DH7djUl8.js} +1 -1
  73. package/dist/{campaign-CNYzUQiR.js → campaign-DlHDgoFX.js} +2 -2
  74. package/dist/{campaign-yvttY7Iz.js → campaign-k_WHxsOR.js} +8 -8
  75. package/dist/{campaign.fn-Bsb9ItkF.js → campaign.fn-B-4JRzft.js} +36 -36
  76. package/dist/{collection.fn-0klvp7AD.js → collection.fn-zQwWDzZT.js} +2 -2
  77. package/dist/{currency-UZt1QX64.js → currency-CQVHXBFe.js} +1 -1
  78. package/dist/{duplicateCampaign-CCr4vLrU.js → duplicateCampaign-YTXMbJTj.js} +2 -2
  79. package/dist/{effect-Dx3ZJxHs.js → effect-CQkVLHWi.js} +1 -1
  80. package/dist/{email-addresses-C0cqEsI0.js → email-addresses-BIoVbPGC.js} +2 -2
  81. package/dist/{helper-C_jOIHaL.js → helper-BCkTvF4m.js} +1 -1
  82. package/dist/{index-D3wRc-GN.js → index-B-bQnb0_.js} +467 -446
  83. package/dist/{index--qbL3r5K.js → index-BAJOC43K.js} +3 -3
  84. package/dist/{index-BWnVV310.js → index-BFIHEBnX.js} +3 -3
  85. package/dist/{index-tS9a8fVh.js → index-BJIQe3QJ.js} +1 -1
  86. package/dist/{index-Cb9hrU0J.js → index-BJkRTH5T.js} +1 -1
  87. package/dist/{index-BLn35ij4.js → index-BOJogkKQ.js} +1 -1
  88. package/dist/{index-9LJ75jOS.js → index-BRPajAkE.js} +7 -7
  89. package/dist/{index-kwMMiU8Z.js → index-BTkxgos0.js} +2 -2
  90. package/dist/{index-U9Y--r1N.js → index-BUP4aHq8.js} +2 -2
  91. package/dist/{index-DWdVixHn.js → index-BYvnqARr.js} +4 -4
  92. package/dist/{index-Bru3cF21.js → index-Bonq819P.js} +1 -1
  93. package/dist/{index-DyaRNZLw.js → index-C6mOI2Pp.js} +1 -1
  94. package/dist/{index-uNe9XFEK.js → index-CDIe15AY.js} +2 -2
  95. package/dist/{index-ChgrDBj1.js → index-CTrcdIkt.js} +2 -2
  96. package/dist/{index-BhP7DpQu.js → index-CpnchVe1.js} +9 -9
  97. package/dist/{index-Dwrv-CFH.js → index-D5AR7A5e.js} +2 -2
  98. package/dist/index-D7-Q86HI.js +54 -0
  99. package/dist/{index-D8i3eZnu.js → index-DdOj8Hew.js} +1 -1
  100. package/dist/{index-Dr0sT8uH.js → index-Dvqguh2B.js} +2 -2
  101. package/dist/{index-C4cDk-o7.js → index-hAKRfE-4.js} +1 -1
  102. package/dist/{index-BgECjFM0.js → index-o2Ga_qaX.js} +18 -7
  103. package/dist/{index.esm2017-DqDs52qt.js → index.esm2017-D0fhMMPG.js} +37 -37
  104. package/dist/{loading-DbSZrkUs.js → loading-C686AMVG.js} +1 -1
  105. package/dist/{lodash-DqWWo2-K.js → lodash-CANlWUWW.js} +1 -1
  106. package/dist/{member-import-CoVI5_0P.js → member-import-UzJ6ByIS.js} +1 -1
  107. package/dist/{membership-SQa4SZUq.js → membership-DCVzFaFy.js} +2 -2
  108. package/dist/{money-Cl_T-LaY.js → money-DuazwoX7.js} +1 -1
  109. package/dist/{number-BOrgnhwZ.js → number-B2HFiV0g.js} +1 -1
  110. package/dist/{objectid-CsDYQ9eX.js → objectid-Bq-oVMdP.js} +6 -6
  111. package/dist/{onboarding-BLU2SSrI.js → onboarding-BxvNxz-9.js} +3 -3
  112. package/dist/{onboardingSetup-jyeouaTv.js → onboardingSetup-CcvKmyx8.js} +2 -2
  113. package/dist/{plugins-t_9JTEIa.js → plugins-C39O5j42.js} +3 -3
  114. package/dist/{reward-BWunDF4U.js → reward-HYt-2nxt.js} +1 -1
  115. package/dist/{rule-DyUt0gcn.js → rule-3xNIYM7z.js} +10 -10
  116. package/dist/style.css +1 -1
  117. package/dist/{template-DNh14IvS.js → template-D37Z_b0m.js} +6 -6
  118. package/dist/{timezone-DpCfnolZ.js → timezone-JwnQgpaU.js} +1 -1
  119. package/dist/{transaction.fn-D8JhcKmt.js → transaction.fn-C5vswLI_.js} +2 -2
  120. package/dist/{trigger-DYyQ4d7Z.js → trigger-Bc6s2cvq.js} +5 -5
  121. package/dist/{useMarketingMaterialActions-BVzjD61l.js → useMarketingMaterialActions-DMGyAXcy.js} +3 -3
  122. package/dist/{usePagination-jqXEShKi.js → usePagination-DLOOwiiY.js} +1 -1
  123. package/dist/{user-Bb-YcUvV.js → user-CTIGugVF.js} +1 -1
  124. package/dist/{vue-i18n-Bud-ZmQ_.js → vue-i18n-Dpic36zz.js} +195 -195
  125. package/dist/{xlsx-NzYW6kUX.js → xlsx-CT9_1SFr.js} +379 -379
  126. package/dist/{zod-DK9AcJ_Q.js → zod-CGVrMcDl.js} +1 -1
  127. package/package.json +1 -1
  128. package/dist/WhatsappBot-CgLUjd8a.js +0 -604
@@ -0,0 +1,441 @@
1
+ import { defineComponent as F, computed as W, resolveComponent as _, openBlock as a, createElementBlock as d, createVNode as h, unref as t, withCtx as k, createElementVNode as e, normalizeClass as G, toDisplayString as s, createCommentVNode as D, Fragment as U, renderList as Q, createBlock as $, useModel as J, ref as A, watch as O, onBeforeUnmount as q, createTextVNode as H, mergeProps as K, createSlots as X } from "vue";
2
+ import { u as I } from "./vue-i18n-Dpic36zz.js";
3
+ import { useRouter as Y } from "vue-router";
4
+ import { S as M } from "./index-BUP4aHq8.js";
5
+ import { w as L } from "./index-D7-Q86HI.js";
6
+ import { u as ee, _ as te, w as oe } from "./WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-D8L6izf0.js";
7
+ import { R as T } from "./app-BEYzXWZO.js";
8
+ import { b as ne } from "./browser-BSAOEeIM.js";
9
+ const se = { class: "flex items-center gap-[12px]" }, ae = { class: "min-w-0 flex-1" }, ce = ["title"], le = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary break-all" }, re = { class: "flex items-center justify-between flex-wrap gap-[8px] border-t border-fm-color-neutral-gray-100 pt-[12px]" }, ie = {
10
+ key: 0,
11
+ class: "text-[12px] text-fm-color-typo-secondary"
12
+ }, pe = /* @__PURE__ */ F({
13
+ __name: "WhatsappAccountCard",
14
+ props: {
15
+ account: {}
16
+ },
17
+ setup(b) {
18
+ const l = b, { t: n, locale: i } = I(), { name: g, phoneNumber: p, initials: u, state: x, avatarColor: y } = ee(
19
+ () => l.account
20
+ ), C = W(
21
+ () => x.value === "connected" || x.value === "connecting"
22
+ );
23
+ function w(f) {
24
+ return new Intl.DateTimeFormat(i.value, {
25
+ year: "numeric",
26
+ month: "short",
27
+ day: "numeric"
28
+ }).format(new Date(f));
29
+ }
30
+ return (f, B) => {
31
+ const S = _("RouterLink");
32
+ return a(), d("li", null, [
33
+ h(S, {
34
+ to: {
35
+ name: t(T)["$connect-WHATSAPP_ACCOUNT"],
36
+ params: { clientId: b.account.clientId }
37
+ },
38
+ class: "h-full border border-fm-color-neutral-gray-100 rounded-[16px] p-[20px] flex flex-col gap-[16px] bg-fm-color-neutral-white text-fm-color-typo-primary no-underline cursor-pointer transition-shadow hover:border-fm-color-neutral-gray-200 hover:fm-shadow-light-100 focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-fm-color-primary focus-visible:ring-offset-[2px]"
39
+ }, {
40
+ default: k(() => [
41
+ e("div", se, [
42
+ e("div", {
43
+ "aria-hidden": "true",
44
+ class: G(["w-[48px] h-[48px] rounded-full shrink-0 flex items-center justify-center text-[16px] font-semibold text-fm-color-typo-white", t(y)])
45
+ }, s(t(u)), 3),
46
+ e("div", ae, [
47
+ e("h2", {
48
+ class: "text-[16px] leading-[24px] font-semibold truncate",
49
+ title: t(g)
50
+ }, s(t(g)), 9, ce),
51
+ e("p", le, s(t(p)), 1)
52
+ ])
53
+ ]),
54
+ e("div", re, [
55
+ h(te, { state: t(x) }, null, 8, ["state"]),
56
+ C.value && b.account.connectedAt ? (a(), d("span", ie, s(t(n)("connect.whatsappBot.connectedSince", {
57
+ date: w(b.account.connectedAt)
58
+ })), 1)) : D("", !0)
59
+ ])
60
+ ]),
61
+ _: 1
62
+ }, 8, ["to"])
63
+ ]);
64
+ };
65
+ }
66
+ }), ue = { class: "mt-[24px] grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] xs:grid-cols-1 gap-[16px]" }, de = /* @__PURE__ */ F({
67
+ __name: "WhatsappAccountList",
68
+ props: {
69
+ accounts: {}
70
+ },
71
+ setup(b) {
72
+ return (l, n) => (a(), d("ul", ue, [
73
+ (a(!0), d(U, null, Q(b.accounts, (i) => (a(), $(pe, {
74
+ key: i.clientId,
75
+ account: i
76
+ }, null, 8, ["account"]))), 128))
77
+ ]));
78
+ }
79
+ }), me = { class: "text-[18px] font-semibold" }, xe = {
80
+ key: 0,
81
+ role: "status",
82
+ class: "flex flex-col items-center text-center gap-[8px] px-[8px] py-[40px]"
83
+ }, fe = { class: "text-[18px] font-semibold" }, _e = { class: "text-[14px] text-fm-color-typo-secondary break-all" }, he = {
84
+ key: 1,
85
+ class: "grid grid-cols-[minmax(0,1fr)_232px] xs:grid-cols-1 gap-[32px] p-[8px] xs:p-[0px]"
86
+ }, ve = { class: "flex flex-col gap-[20px] text-[14px] leading-[20px]" }, ge = { class: "text-fm-color-typo-secondary" }, ye = { class: "flex flex-col gap-[14px]" }, be = { class: "w-[22px] h-[22px] shrink-0 rounded-full bg-fm-color-neutral-gray-100 flex items-center justify-center text-[12px] font-semibold" }, we = { key: 0 }, Be = { class: "font-semibold" }, Te = { class: "font-semibold" }, ke = { class: "font-semibold" }, Ae = { class: "font-semibold" }, $e = { key: 3 }, Ce = { class: "text-[12px] leading-[16px] text-fm-color-typo-secondary" }, Se = { class: "relative w-[232px] h-[232px] xs:justify-self-center border border-fm-color-neutral-gray-100 rounded-xl flex items-center justify-center overflow-hidden" }, Pe = {
87
+ key: 0,
88
+ role: "status",
89
+ class: "flex flex-col items-center gap-[12px] text-[13px]"
90
+ }, Fe = {
91
+ key: 1,
92
+ class: "flex flex-col items-center text-center gap-[12px] p-[12px]"
93
+ }, Ee = {
94
+ role: "alert",
95
+ class: "text-[14px] text-fm-color-typo-error"
96
+ }, Ve = ["src", "alt"], We = {
97
+ key: 3,
98
+ role: "status",
99
+ "aria-live": "polite",
100
+ class: "absolute inset-0 bg-fm-color-neutral-white/90 flex flex-col items-center justify-center gap-[10px] text-[13px] font-medium"
101
+ }, De = /* @__PURE__ */ F({
102
+ __name: "WhatsappConnectDialog",
103
+ props: {
104
+ modelValue: { type: Boolean, required: !0 },
105
+ modelModifiers: {}
106
+ },
107
+ emits: ["update:modelValue"],
108
+ setup(b) {
109
+ const l = J(b, "modelValue"), { t: n } = I(), i = A(""), g = A(!1), p = A(""), u = A(!1), x = A();
110
+ let y, C, w;
111
+ function f() {
112
+ y == null || y.abort(), clearTimeout(C), C = void 0, clearTimeout(w), w = void 0;
113
+ }
114
+ async function B(c, o, r) {
115
+ if (!r.aborted) {
116
+ try {
117
+ const m = await L.getClient(c, o, r);
118
+ if (r.aborted) return;
119
+ if ((m.status === "connecting" || m.status === "connected") && (u.value = !0), m.status === "connected" && m.profileStatus === "ready") {
120
+ f(), u.value = !1, x.value = m, w = setTimeout(() => {
121
+ l.value = !1;
122
+ }, 1800);
123
+ return;
124
+ }
125
+ if (m.status === "not_found") {
126
+ f(), u.value = !1, i.value = "", p.value = n("connect.whatsappBot.errors.qrExpired");
127
+ return;
128
+ }
129
+ } catch {
130
+ }
131
+ r.aborted || (C = setTimeout(() => {
132
+ B(c, o, r);
133
+ }, 2e3));
134
+ }
135
+ }
136
+ async function S() {
137
+ f();
138
+ const c = new AbortController();
139
+ y = c, i.value = "", p.value = "", u.value = !1, x.value = void 0, g.value = !0;
140
+ try {
141
+ const o = M.getBusinessId();
142
+ if (!o)
143
+ throw new Error(n("connect.whatsappBot.errors.selectBusiness"));
144
+ const r = await L.createClient(
145
+ o,
146
+ c.signal
147
+ ), m = await ne.toDataURL(r.qr, {
148
+ width: 224,
149
+ margin: 2,
150
+ errorCorrectionLevel: "M"
151
+ });
152
+ c.signal.aborted || (i.value = m, B(o, r.clientId, c.signal));
153
+ } catch (o) {
154
+ c.signal.aborted || (p.value = o instanceof Error ? o.message : n("connect.whatsappBot.errors.loadQr"));
155
+ } finally {
156
+ c.signal.aborted || (g.value = !1);
157
+ }
158
+ }
159
+ return O(
160
+ l,
161
+ (c) => {
162
+ c ? S() : f();
163
+ },
164
+ { immediate: !0 }
165
+ ), q(f), (c, o) => {
166
+ const r = _("i18n-t"), m = _("FmCircularProgress"), N = _("FmButton"), j = _("FmDialog");
167
+ return a(), $(j, {
168
+ modelValue: l.value,
169
+ "onUpdate:modelValue": o[0] || (o[0] = (P) => l.value = P),
170
+ "min-width": "min(720px, calc(100% - 32px))",
171
+ "max-width": "720px",
172
+ "max-height": "90vh",
173
+ "dismiss-away": ""
174
+ }, {
175
+ "dialog-header": k(() => [
176
+ e("h2", me, s(t(n)("connect.whatsappBot.connectAccount")), 1)
177
+ ]),
178
+ default: k(() => {
179
+ var P, E, V;
180
+ return [
181
+ x.value ? (a(), d("div", xe, [
182
+ o[1] || (o[1] = e("div", {
183
+ "aria-hidden": "true",
184
+ class: "w-[64px] h-[64px] rounded-full bg-fm-color-system-success-100 text-fm-color-typo-success flex items-center justify-center mb-[8px]"
185
+ }, [
186
+ e("svg", {
187
+ width: "32",
188
+ height: "32",
189
+ viewBox: "0 0 24 24",
190
+ fill: "none",
191
+ stroke: "currentColor",
192
+ "stroke-width": "2.2",
193
+ "stroke-linecap": "round",
194
+ "stroke-linejoin": "round"
195
+ }, [
196
+ e("path", { d: "M20 6 9 17l-5-5" })
197
+ ])
198
+ ], -1)),
199
+ e("h3", fe, s(t(n)("connect.whatsappBot.accountConnected")), 1),
200
+ e("p", _e, s(((P = x.value.account) == null ? void 0 : P.businessName) || ((E = x.value.account) == null ? void 0 : E.name) || t(n)("connect.whatsappBot.unnamedAccount")) + " · " + s(((V = x.value.account) == null ? void 0 : V.phoneNumber) || t(n)("connect.whatsappBot.phoneUnavailable")), 1)
201
+ ])) : (a(), d("div", he, [
202
+ e("div", ve, [
203
+ e("p", ge, s(t(n)("connect.whatsappBot.scanDescription")), 1),
204
+ e("ol", ye, [
205
+ (a(), d(U, null, Q(4, (v) => e("li", {
206
+ key: v,
207
+ class: "flex gap-[12px]"
208
+ }, [
209
+ e("span", be, s(v), 1),
210
+ v === 1 ? (a(), d("span", we, s(t(n)("connect.whatsappBot.steps.openApp")), 1)) : v === 2 ? (a(), $(r, {
211
+ key: 1,
212
+ keypath: "connect.whatsappBot.steps.openSettings",
213
+ tag: "span",
214
+ scope: "global"
215
+ }, {
216
+ menu: k(() => [
217
+ e("b", Be, s(t(n)("connect.whatsappBot.menu")), 1)
218
+ ]),
219
+ settings: k(() => [
220
+ e("b", Te, s(t(n)("connect.whatsappBot.settings")), 1)
221
+ ]),
222
+ _: 1
223
+ })) : v === 3 ? (a(), $(r, {
224
+ key: 2,
225
+ keypath: "connect.whatsappBot.steps.linkDevice",
226
+ tag: "span",
227
+ scope: "global"
228
+ }, {
229
+ linkedDevices: k(() => [
230
+ e("b", ke, s(t(n)("connect.whatsappBot.linkedDevices")), 1)
231
+ ]),
232
+ linkDevice: k(() => [
233
+ e("b", Ae, s(t(n)("connect.whatsappBot.linkDevice")), 1)
234
+ ]),
235
+ _: 1
236
+ })) : (a(), d("span", $e, s(t(n)("connect.whatsappBot.steps.scanQr")), 1))
237
+ ])), 64))
238
+ ]),
239
+ e("p", Ce, s(t(n)("connect.whatsappBot.connectionNote")), 1)
240
+ ]),
241
+ e("div", Se, [
242
+ g.value ? (a(), d("div", Pe, [
243
+ h(m),
244
+ H(s(t(n)("connect.whatsappBot.generatingQr")), 1)
245
+ ])) : p.value ? (a(), d("div", Fe, [
246
+ e("p", Ee, s(p.value), 1),
247
+ h(N, {
248
+ label: t(n)("connect.whatsappBot.tryAgain"),
249
+ "prepend-icon": "refresh",
250
+ onClick: S
251
+ }, null, 8, ["label"])
252
+ ])) : i.value ? (a(), d("img", {
253
+ key: 2,
254
+ src: i.value,
255
+ alt: t(n)("connect.whatsappBot.qrAlt"),
256
+ width: "224",
257
+ height: "224",
258
+ class: G({ "opacity-20": u.value })
259
+ }, null, 10, Ve)) : D("", !0),
260
+ u.value ? (a(), d("div", We, [
261
+ h(m),
262
+ H(" " + s(t(n)("connect.whatsappBot.connecting")), 1)
263
+ ])) : D("", !0)
264
+ ])
265
+ ]))
266
+ ];
267
+ }),
268
+ _: 1
269
+ }, 8, ["modelValue"]);
270
+ };
271
+ }
272
+ }), Ie = { class: "mt-[24px] border border-fm-color-neutral-gray-200 rounded-[16px] px-[24px] py-[56px] flex flex-col items-center text-center gap-[8px]" }, Ne = { class: "text-[20px] leading-[28px] font-bold" }, je = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary max-w-[420px]" }, Oe = /* @__PURE__ */ F({
273
+ __name: "WhatsappEmptyState",
274
+ emits: ["connect"],
275
+ setup(b, { emit: l }) {
276
+ const n = l, { t: i } = I();
277
+ return (g, p) => {
278
+ const u = _("FmButton");
279
+ return a(), d("div", Ie, [
280
+ p[1] || (p[1] = e("div", { class: "w-[72px] h-[72px] rounded-full bg-fm-color-primary-oats text-fm-color-primary flex items-center justify-center mb-[12px]" }, [
281
+ e("svg", {
282
+ width: "34",
283
+ height: "34",
284
+ viewBox: "0 0 24 24",
285
+ fill: "none",
286
+ stroke: "currentColor",
287
+ "stroke-width": "1.6",
288
+ "stroke-linecap": "round",
289
+ "stroke-linejoin": "round",
290
+ "aria-hidden": "true"
291
+ }, [
292
+ e("path", { d: "M7.9 20A9 9 0 1 0 4 16.1L2 22Z" }),
293
+ e("path", { d: "M9 10h.01M12 10h.01M15 10h.01" })
294
+ ])
295
+ ], -1)),
296
+ e("h2", Ne, s(t(i)("connect.whatsappBot.emptyTitle")), 1),
297
+ e("p", je, s(t(i)("connect.whatsappBot.emptyDescription")), 1),
298
+ h(u, {
299
+ class: "mt-[16px]",
300
+ label: t(i)("connect.whatsappBot.connectAccountCta"),
301
+ "prepend-icon": "add",
302
+ onClick: p[0] || (p[0] = (x) => n("connect"))
303
+ }, null, 8, ["label"])
304
+ ]);
305
+ };
306
+ }
307
+ }), He = { class: "px-[24px] xs:px-[12px] pt-[20px] pb-[40px] text-fm-color-typo-primary" }, Me = { class: "flex items-center justify-between gap-[16px] flex-wrap min-h-[40px]" }, Le = { class: "flex items-center gap-8" }, Ue = { class: "text-[24px] leading-[32px] font-semibold tracking-[-0.01em]" }, Re = {
308
+ key: 1,
309
+ role: "status",
310
+ class: "mt-[24px] py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
311
+ }, Ge = {
312
+ key: 2,
313
+ class: "mt-[24px] border border-fm-color-neutral-gray-200 rounded-[16px] px-[24px] py-[56px] flex flex-col items-center text-center gap-[16px]"
314
+ }, Qe = {
315
+ role: "alert",
316
+ class: "text-[14px] text-fm-color-typo-error"
317
+ }, tt = /* @__PURE__ */ F({
318
+ __name: "WhatsappBot",
319
+ setup(b) {
320
+ const { t: l } = I(), n = Y(), i = A([]), g = A(!0), p = A("");
321
+ let u, x;
322
+ const y = W(
323
+ () => i.value.filter((c) => oe(c) !== void 0)
324
+ ), C = W(() => [
325
+ {
326
+ label: l("connect.whatsappBot.accounts"),
327
+ value: T["$connect-WHATSAPP_BOT"],
328
+ badge: y.value.length
329
+ },
330
+ {
331
+ label: l("connect.whatsappBot.settings"),
332
+ value: T["$connect-WHATSAPP_BOT_SETTINGS"]
333
+ }
334
+ ]), w = W(
335
+ () => n.currentRoute.value.name === T["$connect-WHATSAPP_BOT_SETTINGS"] ? T["$connect-WHATSAPP_BOT_SETTINGS"] : T["$connect-WHATSAPP_BOT"]
336
+ );
337
+ async function f(c = !1) {
338
+ clearTimeout(x), u == null || u.abort();
339
+ const o = new AbortController();
340
+ u = o, c || (g.value = !0, p.value = "");
341
+ try {
342
+ const r = M.getBusinessId();
343
+ if (!r)
344
+ throw new Error(l("connect.whatsappBot.errors.selectBusiness"));
345
+ const m = await L.listClients(r, o.signal);
346
+ o.signal.aborted || (i.value = m, p.value = "");
347
+ } catch (r) {
348
+ !o.signal.aborted && !c && (p.value = r instanceof Error ? r.message : l("connect.whatsappBot.errors.loadSessions"));
349
+ } finally {
350
+ o.signal.aborted || (g.value = !1, x = setTimeout(() => void f(!0), 1e4));
351
+ }
352
+ }
353
+ const B = A(!1);
354
+ function S(c) {
355
+ (c === T["$connect-WHATSAPP_BOT"] || c === T["$connect-WHATSAPP_BOT_SETTINGS"]) && n.push({ name: c });
356
+ }
357
+ return O(B, (c) => {
358
+ c || f();
359
+ }), O(
360
+ () => M.getBusinessId(),
361
+ () => {
362
+ B.value = !1, i.value = [], f();
363
+ },
364
+ { immediate: !0 }
365
+ ), q(() => {
366
+ u == null || u.abort(), clearTimeout(x);
367
+ }), (c, o) => {
368
+ const r = _("FmPill"), m = _("FmButton"), N = _("FmBadge"), j = _("FmTab"), P = _("FmTabs"), E = _("RouterView"), V = _("FmCircularProgress");
369
+ return a(), d(U, null, [
370
+ e("div", He, [
371
+ e("div", Me, [
372
+ e("div", Le, [
373
+ e("h1", Ue, s(t(l)("connect.navigation.whatsappBot")), 1),
374
+ h(r, { variant: "beta" })
375
+ ]),
376
+ w.value === t(T)["$connect-WHATSAPP_BOT"] && y.value.length ? (a(), $(m, {
377
+ key: 0,
378
+ label: t(l)("connect.whatsappBot.connectAccountCta"),
379
+ "prepend-icon": "add",
380
+ onClick: o[0] || (o[0] = (v) => B.value = !0)
381
+ }, null, 8, ["label"])) : D("", !0)
382
+ ]),
383
+ h(P, {
384
+ "model-value": w.value,
385
+ items: C.value,
386
+ role: "tablist",
387
+ "aria-label": t(l)("connect.navigation.whatsappBot"),
388
+ class: "mt-[16px] border-b border-fm-color-neutral-gray-100"
389
+ }, {
390
+ default: k(({ label: v, value: z, badge: R, tabsProps: Z }) => [
391
+ h(j, K(Z, {
392
+ "model-value": w.value,
393
+ label: v,
394
+ value: z,
395
+ "onUpdate:modelValue": S
396
+ }), X({ _: 2 }, [
397
+ R ? {
398
+ name: "append",
399
+ fn: k(() => [
400
+ h(N, {
401
+ value: R,
402
+ variant: "neutral",
403
+ inline: "",
404
+ class: "bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary"
405
+ }, null, 8, ["value"])
406
+ ]),
407
+ key: "0"
408
+ } : void 0
409
+ ]), 1040, ["model-value", "label", "value"])
410
+ ]),
411
+ _: 1
412
+ }, 8, ["model-value", "items", "aria-label"]),
413
+ w.value === t(T)["$connect-WHATSAPP_BOT_SETTINGS"] ? (a(), $(E, { key: 0 })) : g.value ? (a(), d("div", Re, [
414
+ h(V),
415
+ H(" " + s(t(l)("connect.whatsappBot.loadingSessions")), 1)
416
+ ])) : p.value ? (a(), d("div", Ge, [
417
+ e("p", Qe, s(p.value), 1),
418
+ h(m, {
419
+ label: t(l)("connect.whatsappBot.tryAgain"),
420
+ "prepend-icon": "refresh",
421
+ onClick: o[1] || (o[1] = (v) => f())
422
+ }, null, 8, ["label"])
423
+ ])) : y.value.length ? (a(), $(de, {
424
+ key: 3,
425
+ accounts: y.value
426
+ }, null, 8, ["accounts"])) : (a(), $(Oe, {
427
+ key: 4,
428
+ onConnect: o[2] || (o[2] = (v) => B.value = !0)
429
+ }))
430
+ ]),
431
+ h(De, {
432
+ modelValue: B.value,
433
+ "onUpdate:modelValue": o[3] || (o[3] = (v) => B.value = v)
434
+ }, null, 8, ["modelValue"])
435
+ ], 64);
436
+ };
437
+ }
438
+ });
439
+ export {
440
+ tt as default
441
+ };
@@ -0,0 +1,136 @@
1
+ import { defineComponent as j, computed as C, ref as l, watch as F, onBeforeUnmount as D, resolveComponent as b, openBlock as c, createElementBlock as u, createVNode as v, createTextVNode as T, toDisplayString as f, unref as n, Fragment as H, createElementVNode as _, createCommentVNode as h, createBlock as L } from "vue";
2
+ import { u as O } from "./vue-i18n-Dpic36zz.js";
3
+ import { F as z } from "./index-o2Ga_qaX.js";
4
+ import { S as G } from "./index-BUP4aHq8.js";
5
+ import { w as A } from "./index-D7-Q86HI.js";
6
+ import { _ as M } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
+ const R = { class: "mt-[24px] max-w-[720px] flex flex-col gap-[20px]" }, X = {
8
+ key: 0,
9
+ role: "status",
10
+ class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
11
+ }, J = {
12
+ key: 0,
13
+ class: "border-[1px] border-fm-color-neutral-gray-100 rounded-[16px] p-[24px] flex flex-col gap-[16px]"
14
+ }, K = { class: "flex flex-col gap-[4px]" }, Q = { class: "text-[16px] leading-[24px] font-semibold" }, Y = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary" }, Z = {
15
+ key: 1,
16
+ role: "alert",
17
+ class: "text-[14px] text-fm-color-typo-error"
18
+ }, $ = { class: "flex items-center justify-end gap-[12px] flex-wrap" }, q = {
19
+ key: 0,
20
+ role: "status",
21
+ class: "mr-auto flex items-center gap-[6px] text-[14px] text-fm-color-typo-success"
22
+ }, ee = /* @__PURE__ */ j({
23
+ __name: "WhatsappBotSettings",
24
+ setup(te) {
25
+ const { t } = O(), g = C(() => G.getBusinessId() ?? ""), s = l(""), p = l(""), y = l(!0), d = l(!1), r = l(!1), i = l(""), x = l(!1), B = z, w = C(
26
+ () => !d.value || r.value || s.value === p.value || s.value.length > B
27
+ );
28
+ let o, I;
29
+ function m() {
30
+ clearTimeout(I), x.value = !1;
31
+ }
32
+ async function k() {
33
+ o == null || o.abort(), m();
34
+ const a = new AbortController();
35
+ o = a, y.value = !0, d.value = !1, r.value = !1, i.value = "", s.value = "", p.value = "";
36
+ try {
37
+ if (!g.value)
38
+ throw new Error(t("connect.whatsappBot.errors.selectBusiness"));
39
+ const e = await A.getSettings(
40
+ g.value,
41
+ a.signal
42
+ );
43
+ if (a.signal.aborted) return;
44
+ s.value = e.botInstructions, p.value = e.botInstructions, d.value = !0;
45
+ } catch (e) {
46
+ a.signal.aborted || (i.value = e instanceof Error ? e.message : t("connect.whatsappBot.errors.loadSettings"));
47
+ } finally {
48
+ a.signal.aborted || (y.value = !1);
49
+ }
50
+ }
51
+ async function N() {
52
+ if (w.value) return;
53
+ o == null || o.abort();
54
+ const a = new AbortController();
55
+ o = a, r.value = !0, i.value = "", m();
56
+ try {
57
+ const e = await A.saveSettings(
58
+ g.value,
59
+ { botInstructions: s.value },
60
+ a.signal
61
+ );
62
+ if (a.signal.aborted) return;
63
+ p.value = e.botInstructions, s.value = e.botInstructions, x.value = !0, I = setTimeout(() => {
64
+ x.value = !1;
65
+ }, 2500);
66
+ } catch (e) {
67
+ a.signal.aborted || (i.value = e instanceof Error ? e.message : t("connect.whatsappBot.errors.saveSettings"));
68
+ } finally {
69
+ a.signal.aborted || (r.value = !1);
70
+ }
71
+ }
72
+ function V() {
73
+ s.value = p.value, m();
74
+ }
75
+ return F(s, m, { flush: "sync" }), F(g, k, { immediate: !0 }), D(() => {
76
+ o == null || o.abort(), m();
77
+ }), (a, e) => {
78
+ const E = b("FmCircularProgress"), P = b("FmTextarea"), S = b("FmButton"), U = b("FmIcon");
79
+ return c(), u("div", R, [
80
+ y.value ? (c(), u("div", X, [
81
+ v(E),
82
+ T(" " + f(n(t)("connect.whatsappBot.botSettings.loading")), 1)
83
+ ])) : (c(), u(H, { key: 1 }, [
84
+ d.value ? (c(), u("div", J, [
85
+ _("div", K, [
86
+ _("h2", Q, f(n(t)("connect.whatsappBot.botSettings.instructions")), 1),
87
+ _("p", Y, f(n(t)("connect.whatsappBot.botSettings.description")), 1)
88
+ ]),
89
+ v(P, {
90
+ modelValue: s.value,
91
+ "onUpdate:modelValue": e[0] || (e[0] = (W) => s.value = W),
92
+ "aria-label": n(t)("connect.whatsappBot.botSettings.instructions"),
93
+ placeholder: n(t)("connect.whatsappBot.botSettings.placeholder"),
94
+ "max-length": n(B),
95
+ disabled: r.value,
96
+ "show-word-count": "",
97
+ class: "bot-instructions-textarea"
98
+ }, null, 8, ["modelValue", "aria-label", "placeholder", "max-length", "disabled"])
99
+ ])) : h("", !0),
100
+ i.value ? (c(), u("p", Z, f(i.value), 1)) : h("", !0),
101
+ d.value ? h("", !0) : (c(), L(S, {
102
+ key: 2,
103
+ class: "self-start",
104
+ label: n(t)("connect.whatsappBot.tryAgain"),
105
+ "prepend-icon": "refresh",
106
+ onClick: k
107
+ }, null, 8, ["label"])),
108
+ _("div", $, [
109
+ x.value ? (c(), u("span", q, [
110
+ v(U, {
111
+ name: "check",
112
+ size: "sm"
113
+ }),
114
+ T(" " + f(n(t)("connect.whatsappBot.botSettings.saved")), 1)
115
+ ])) : h("", !0),
116
+ v(S, {
117
+ variant: "secondary",
118
+ label: n(t)("connect.common.cancel"),
119
+ disabled: w.value,
120
+ onClick: V
121
+ }, null, 8, ["label", "disabled"]),
122
+ v(S, {
123
+ label: n(t)("connect.common.save"),
124
+ disabled: w.value,
125
+ loading: r.value,
126
+ onClick: N
127
+ }, null, 8, ["label", "disabled", "loading"])
128
+ ])
129
+ ], 64))
130
+ ]);
131
+ };
132
+ }
133
+ }), re = /* @__PURE__ */ M(ee, [["__scopeId", "data-v-b989ed03"]]);
134
+ export {
135
+ re as default
136
+ };
@@ -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-DK9AcJ_Q.js";
3
- import { u as V } from "./vue-i18n-Bud-ZmQ_.js";
2
+ import { Z as d } from "./zod-CGVrMcDl.js";
3
+ import { u as V } from "./vue-i18n-Dpic36zz.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"