@feedmepos/mf-connect 0.1.98-beta.73 → 0.1.98-beta.75

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-C4XD_vWL.js → App-BU-KKX-n.js} +550 -526
  2. package/dist/{AuditLogs-DpevHGsA.js → AuditLogs-CmLqBgj6.js} +15 -13
  3. package/dist/{Bin-FRrYZ8pV.js → Bin-Zbera_MK.js} +8 -8
  4. package/dist/{Broadcast-CoefxWt-.js → Broadcast-CYgMTWI5.js} +89 -86
  5. package/dist/{CampaignAnalytic-CdZjzsLr.js → CampaignAnalytic-UNTkez3N.js} +7 -7
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DQOLEDzY.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CfaXdAeW.js} +8 -6
  7. package/dist/{Card-BABL96V6.js → Card-CdoDOGUZ.js} +25 -23
  8. package/dist/{Collections-D6XuhBO1.js → Collections-CdeMQQCd.js} +8 -8
  9. package/dist/{Credit-D2WTeN8Z.js → Credit-BAP0k14-.js} +12 -12
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-B0KkvFWi.js → DateRangeChip.vue_vue_type_script_setup_true_lang-CBn5qXw2.js} +1 -1
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-G2oU70Ef.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bk9ZmCSP.js} +38 -35
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-C4RByg0k.js → EffectSheet.vue_vue_type_style_index_0_lang-OUHg9s8b.js} +6 -6
  13. package/dist/{Experience-CUqmspwT.js → Experience-Dq4FXfGp.js} +87 -84
  14. package/dist/{FileSaver.min-DX17A8Gj.js → FileSaver.min-CCrEHqr_.js} +1 -1
  15. package/dist/{Game-D8IvyDdA.js → Game-BjgPoHzZ.js} +13 -13
  16. package/dist/{GiftCardSetup-BOSKBH8c.js → GiftCardSetup-CLKjBRXP.js} +10 -10
  17. package/dist/GoalPickerPanel.vue_vue_type_script_setup_true_lang-zCMcelvk.js +417 -0
  18. package/dist/Goals-B_DvaaRc.js +244 -0
  19. package/dist/{Grab-CnBGt_H2.js → Grab-C9QKHF9-.js} +9 -9
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BI00YCKv.js → ImageInput.vue_vue_type_script_setup_true_lang-CYoMZ7Rd.js} +1 -1
  21. package/dist/{Index-BovDOTbf.js → Index-DjyD4Ukt.js} +10 -10
  22. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-D8auavm7.js → LocationPicker.vue_vue_type_script_setup_true_lang-D32lT_JS.js} +1 -1
  23. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BM99IoIG.js → LottieAnimation.vue_vue_type_script_setup_true_lang-C8pCFjzw.js} +1 -1
  24. package/dist/{LoyaltyDashboard-DiCQnQ76.js → LoyaltyDashboard-gEfgYtBH.js} +1213 -1170
  25. package/dist/{MainLayout-Cg37dK-P.js → MainLayout-BZd3nvw4.js} +3 -3
  26. package/dist/{Marketing-DRCT9dBo.js → Marketing-vXzXx-ht.js} +4 -4
  27. package/dist/{MarketingMaterialEdit-DcE0A8_A.js → MarketingMaterialEdit-CodE48Pa.js} +6 -6
  28. package/dist/{Member-C8T1-ywK.js → Member-DmjIle-d.js} +7 -7
  29. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-CTl8LtJ9.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-BkOC-rzc.js} +27 -25
  30. package/dist/{MemberImportHistory-CYCxxxN7.js → MemberImportHistory-Ds92Kmv3.js} +7 -7
  31. package/dist/{MemberList-Ddlnm4JX.js → MemberList-DRAygZjh.js} +14 -14
  32. package/dist/{MemberTransactions-DwyZTeZb.js → MemberTransactions-COQKjSaO.js} +1 -1
  33. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BWCxGlQO.js → MessageInput.vue_vue_type_script_setup_true_lang-C1N1Q9KC.js} +10 -10
  34. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-LdVeH7gh.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-hUZ6DRV3.js} +1 -1
  35. package/dist/{Mission-CW0y8Bzw.js → Mission-DVEvVeg9.js} +84 -81
  36. package/dist/{Overview-i2XPL7Pu.js → Overview-Lb2EDuKr.js} +4 -4
  37. package/dist/{Overview-CO4T3l6l.js → Overview-dKPDCTby.js} +23 -21
  38. package/dist/{Point-CNWdfqQZ.js → Point-HERJxwkG.js} +108 -99
  39. package/dist/{Promotion-DAemCP79.js → Promotion-C1O48NJ4.js} +96 -93
  40. package/dist/{Queue-DI50gMny.js → Queue-CIlcqlHV.js} +15 -13
  41. package/dist/{Record-DX3WHXku.js → Record-CbAQRpe2.js} +9 -9
  42. package/dist/{Review-DzSNG4Le.js → Review-C_aPrryB.js} +2 -2
  43. package/dist/{ReviewFacebookCallback-CrdRUN3t.js → ReviewFacebookCallback-zLjyKeV8.js} +5 -5
  44. package/dist/{ReviewGoogleCallback-Da28WNzU.js → ReviewGoogleCallback-DzJFf6UO.js} +5 -5
  45. package/dist/{Reward-DUQAE99I.js → Reward-kLTp1_Ph.js} +16 -16
  46. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BGAOPkwD.js → RewardGroup.vue_vue_type_script_setup_true_lang-dzsAihqZ.js} +26 -24
  47. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-B9Dbe9no.js → RuleGroup.vue_vue_type_script_setup_true_lang-BQDwwF1P.js} +17 -15
  48. package/dist/{Segment-BgVf2-G2.js → Segment-Blo6pvlP.js} +35 -32
  49. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DDLXF5HM.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DI2f-icN.js} +31 -29
  50. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-9UiH43em.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BRYqib7b.js} +4 -4
  51. package/dist/Setting-BqfHAaJ4.js +573 -0
  52. package/dist/{SettingAdvertisements-C40QcuSn.js → SettingAdvertisements-BBWGPfr6.js} +12 -12
  53. package/dist/{Settings-DT9bypKs.js → Settings-xIvDU54B.js} +5 -5
  54. package/dist/{Store-DQyOUfEJ.js → Store-B4LKdCMI.js} +30 -27
  55. package/dist/{StoreRewards-Dr_c0PbO.js → StoreRewards-DioYcpoB.js} +15 -15
  56. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-Bh5h8Lc_.js → StoreTransactions.vue_vue_type_script_setup_true_lang-D8Aomf51.js} +45 -43
  57. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-LquvtnTy.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-zau-k4F2.js} +2 -2
  58. package/dist/{Tier-DmqfEWcB.js → Tier-Byj8iaqs.js} +915 -922
  59. package/dist/{Title-Dx6pcJfP.js → Title-B47H9-3j.js} +25 -23
  60. package/dist/{Transaction-CD6agt6m.js → Transaction-Dv5d9njL.js} +2 -2
  61. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CNjBtitb.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BuitfoqE.js} +6 -6
  62. package/dist/Voucher-Cxz8pkd-.js +837 -0
  63. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Bv--fzY0.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CyF6pfdh.js} +12 -12
  64. package/dist/WhatsappBot-DEt2cwdQ.js +577 -0
  65. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Bq_7U0NO.js → ZodTextField.vue_vue_type_script_setup_true_lang-CoxyeE0y.js} +2 -2
  66. package/dist/{app-CmqX1V1B.js → app-Cy05FPyq.js} +1471 -918
  67. package/dist/app.js +1 -1
  68. package/dist/{base.export-guVE-B2c.js → base.export-CtX7g_L1.js} +2 -2
  69. package/dist/browser-BSAOEeIM.js +1478 -0
  70. package/dist/{business-DXmGtwPm.js → business-DwhrC6ZF.js} +1 -1
  71. package/dist/{campaign-CVXbgs-y.js → campaign-BPm7kwff.js} +2 -2
  72. package/dist/{campaign-D9Jufumh.js → campaign-RHNw7ITA.js} +9 -9
  73. package/dist/{campaign.enum-CXhYMbkx.js → campaign.enum-Dx-Zo68Q.js} +1 -1
  74. package/dist/{campaign.fn-DoJPn6yl.js → campaign.fn-Bg4cy9as.js} +77 -77
  75. package/dist/{collectible.enum-Tk6LIMMm.js → collectible.enum-Liy2wH3s.js} +1 -1
  76. package/dist/{collection.fn-DCVNYQau.js → collection.fn-TRu13bwb.js} +2 -2
  77. package/dist/{currency-BYhkCI6F.js → currency-B8eK9hdV.js} +1 -1
  78. package/dist/{duplicateCampaign-BOVBZHFs.js → duplicateCampaign-CGXCaVuj.js} +2 -2
  79. package/dist/{effect-e6wYWgc8.js → effect-OZ5p9rDk.js} +1 -1
  80. package/dist/{email-addresses-Dcd_vAeM.js → email-addresses-BZjfvPMn.js} +2 -2
  81. package/dist/{helper-DluoQ6zi.js → helper-WVL8SABi.js} +1 -1
  82. package/dist/{index-DB51l5yi.js → index-BGpXgY7W.js} +1 -1
  83. package/dist/{index-ChYMoLaB.js → index-BY_JWg4s.js} +1 -1
  84. package/dist/{index-qkkPuNFM.js → index-BrnzIo_o.js} +168 -155
  85. package/dist/{index-C9JY8Ru6.js → index-BzKV72Cd.js} +2 -2
  86. package/dist/index-C7RUAv0i.js +167 -0
  87. package/dist/index-C_H8jFYf.js +2743 -0
  88. package/dist/{index-BFzBAm6P.js → index-CcYZyfxy.js} +1 -1
  89. package/dist/{index-DIP_uzZm.js → index-CdUgMl41.js} +18 -17
  90. package/dist/{index-DoiGG41P.js → index-CicyjdaK.js} +8 -7
  91. package/dist/index-Cp2qabkb.js +28 -0
  92. package/dist/{index-DKrJlWH3.js → index-D5hnwmRx.js} +4 -4
  93. package/dist/{index-CiJQlOu7.js → index-D755ywwR.js} +11 -9
  94. package/dist/{index-CDdNExzM.js → index-DQO1iioy.js} +1 -1
  95. package/dist/{index-C-oypk0K.js → index-DcO-Tg44.js} +8027 -10766
  96. package/dist/{index-SQItAw7w.js → index-Df6TpLRF.js} +3 -3
  97. package/dist/{index-CBRWvjup.js → index-DzNxG_QU.js} +1202 -79
  98. package/dist/{index-2QCDTrA9.js → index-J5zd25r3.js} +2 -2
  99. package/dist/{index-BpAhyOgv.js → index-KakYLwk1.js} +1 -1
  100. package/dist/{index-BAs9N7bi.js → index-MRXHlUhf.js} +20 -19
  101. package/dist/{index-SS72WJs_.js → index-U0xt4ckb.js} +1 -1
  102. package/dist/{index-kPcRcSFx.js → index-co2uO7IC.js} +2 -2
  103. package/dist/{index.esm2017-BLVWhb4f.js → index.esm2017-xVDCuu7s.js} +37 -37
  104. package/dist/{loading-ClX4Z1ZH.js → loading-BiPCW0qK.js} +1 -1
  105. package/dist/{lodash-Cxh2BWuW.js → lodash-P_PMkPFg.js} +1 -1
  106. package/dist/{member-import-DKfSDn0D.js → member-import-Dc0ZuxZn.js} +6 -5
  107. package/dist/{membership-BBAosVNQ.js → membership-GQhLFMct.js} +3 -3
  108. package/dist/{money-CWzvdiFT.js → money-kIVXcKX4.js} +1 -1
  109. package/dist/{number-Cp7TGBzd.js → number-D15D84XS.js} +1 -1
  110. package/dist/{objectid-CXWfUmP_.js → objectid-DbtWoaPC.js} +12 -12
  111. package/dist/onboarding-B9rm_U_k.js +129 -0
  112. package/dist/onboardingSetup-DFET-PDE.js +17 -0
  113. package/dist/{plugins-BKD6oEHa.js → plugins-DrEJvnRW.js} +3 -3
  114. package/dist/{reward-CrjStT4w.js → reward-C8T99546.js} +1 -1
  115. package/dist/{rule-CBZRptRM.js → rule-BB_Uo0iG.js} +20 -18
  116. package/dist/{template-D4qWK9tk.js → template-B7oaySuH.js} +6 -6
  117. package/dist/{timezone-t0WxSk3e.js → timezone-DN2mMeK6.js} +1 -1
  118. package/dist/{transaction.fn-DZp6Drqf.js → transaction.fn-BHBTwOI9.js} +2 -2
  119. package/dist/{trigger-DN5yeimJ.js → trigger-D5xsNhoR.js} +5 -5
  120. package/dist/{useMarketingMaterialActions-ChkZyyRO.js → useMarketingMaterialActions-CKtANGYF.js} +3 -3
  121. package/dist/{usePagination-Vda9U5Dh.js → usePagination-Cxv7buJt.js} +1 -1
  122. package/dist/{user-jEjTV3E6.js → user-CXp-0Sc-.js} +1 -1
  123. package/dist/{vue-i18n-Bg_RJ_GV.js → vue-i18n-DU1J-6Fe.js} +455 -455
  124. package/dist/{xlsx-unW4U5Tx.js → xlsx-CaGnvtHp.js} +224 -224
  125. package/dist/{zod-DIsCEUuE.js → zod-DPK1tAj-.js} +1 -1
  126. package/package.json +1 -1
  127. package/dist/Setting-3jW6EbKA.js +0 -2047
  128. package/dist/Voucher-P4dyOeUd.js +0 -444
@@ -1,17 +1,17 @@
1
1
  import { defineComponent as B, ref as L, resolveComponent as g, openBlock as p, createBlock as O, withCtx as y, renderSlot as J, createVNode as m, createTextVNode as U, toDisplayString as f, createElementVNode as s, unref as e, computed as N, createElementBlock as S, Fragment as w, renderList as K, normalizeClass as Q, createCommentVNode as T, resolveDynamicComponent as H } from "vue";
2
- import { u as G } from "./vue-i18n-Bg_RJ_GV.js";
3
- import { c as j } from "./index-C9JY8Ru6.js";
4
- import { g as W, F as Y } from "./index-BAs9N7bi.js";
5
- import { C as ee } from "./membership-BBAosVNQ.js";
6
- import { Z as x } from "./zod-DIsCEUuE.js";
7
- import { S as te } from "./app-CmqX1V1B.js";
8
- import { u as le } from "./business-DXmGtwPm.js";
2
+ import { u as G } from "./vue-i18n-DU1J-6Fe.js";
3
+ import { c as j } from "./index-BzKV72Cd.js";
4
+ import { g as W, F as Y } from "./index-MRXHlUhf.js";
5
+ import { C as ee } from "./membership-GQhLFMct.js";
6
+ import { Z as x } from "./zod-DPK1tAj-.js";
7
+ import { S as te } from "./app-Cy05FPyq.js";
8
+ import { u as le } from "./business-DwhrC6ZF.js";
9
9
  import { useCoreStore as oe } from "@feedmepos/mf-common";
10
- import { _ as ne } from "./ZodTextField.vue_vue_type_script_setup_true_lang-Bq_7U0NO.js";
11
- import { _ as ae } from "./ImageInput.vue_vue_type_script_setup_true_lang-BI00YCKv.js";
12
- import { _ as ie, a as se } from "./EffectSheet.vue_vue_type_style_index_0_lang-C4RByg0k.js";
13
- import { _ as me } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-LquvtnTy.js";
14
- import { i as re } from "./helper-DluoQ6zi.js";
10
+ import { _ as ne } from "./ZodTextField.vue_vue_type_script_setup_true_lang-CoxyeE0y.js";
11
+ import { _ as ae } from "./ImageInput.vue_vue_type_script_setup_true_lang-CYoMZ7Rd.js";
12
+ import { _ as ie, a as se } from "./EffectSheet.vue_vue_type_style_index_0_lang-OUHg9s8b.js";
13
+ import { _ as me } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-zau-k4F2.js";
14
+ import { i as re } from "./helper-WVL8SABi.js";
15
15
  const ue = { class: "flex justify-end gap-8 w-full" }, ce = /* @__PURE__ */ B({
16
16
  __name: "MenuSheet",
17
17
  props: {
@@ -0,0 +1,577 @@
1
+ import { defineComponent as E, computed as U, openBlock as s, createElementBlock as i, createElementVNode as e, normalizeClass as Z, toDisplayString as n, unref as t, createTextVNode as j, createCommentVNode as I, Fragment as N, renderList as J, createBlock as A, useModel as R, ref as w, watch as W, onBeforeUnmount as G, resolveComponent as $, withCtx as V, createVNode as k } from "vue";
2
+ import { u as P } from "./vue-i18n-DU1J-6Fe.js";
3
+ import { g as Q, b as Y, S as H } from "./index-BzKV72Cd.js";
4
+ import { F as X, a as q, b as ee, c as te, d as oe } from "./index-Cp2qabkb.js";
5
+ import { b as se } from "./browser-BSAOEeIM.js";
6
+ const z = (p) => Y(`businesses/${encodeURIComponent(p)}/whatsapp`), L = {
7
+ async getSettings(p, a) {
8
+ return X.parse(
9
+ Q(await z(p).get("/settings", { signal: a }))
10
+ );
11
+ },
12
+ async saveSettings(p, a, o) {
13
+ const b = q.parse(a);
14
+ return X.parse(
15
+ Q(await z(p).put("/settings", b, { signal: o }))
16
+ );
17
+ },
18
+ async listClients(p, a) {
19
+ return ee.array().parse(
20
+ Q(await z(p).get("/clients", { signal: a }))
21
+ );
22
+ },
23
+ async createClient(p, a) {
24
+ return te.parse(
25
+ Q(
26
+ await z(p).post(
27
+ "/clients",
28
+ {},
29
+ { signal: a, timeout: 5e4 }
30
+ )
31
+ )
32
+ );
33
+ }
34
+ }, ne = { class: "border border-fm-color-neutral-gray-100 rounded-[16px] p-[20px] flex flex-col gap-[16px] bg-fm-color-neutral-white" }, ae = { class: "flex items-center gap-[12px]" }, le = { class: "min-w-0 flex-1" }, ce = ["title"], re = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary break-all" }, ie = { class: "flex items-center justify-between flex-wrap gap-[8px] border-t border-fm-color-neutral-gray-100 pt-[12px]" }, pe = { class: "flex items-center gap-[6px] text-[12px] font-semibold text-fm-color-typo-success bg-fm-color-system-success-100 px-[8px] py-[3px] rounded-[6px]" }, ue = {
35
+ key: 0,
36
+ class: "text-[12px] text-fm-color-typo-secondary"
37
+ }, de = /* @__PURE__ */ E({
38
+ __name: "WhatsappAccountCard",
39
+ props: {
40
+ account: {},
41
+ index: {}
42
+ },
43
+ setup(p) {
44
+ const a = p, { t: o, locale: b } = P(), l = U(
45
+ () => {
46
+ var x, m, u;
47
+ return ((x = a.account.account) == null ? void 0 : x.businessName) || ((m = a.account.account) == null ? void 0 : m.name) || ((u = a.account.account) == null ? void 0 : u.phoneNumber) || o("connect.whatsappBot.unnamedAccount");
48
+ }
49
+ ), r = U(
50
+ () => l.value.trim().split(/\s+/).slice(0, 2).map((x) => Array.from(x)[0]).join("").toLocaleUpperCase(b.value)
51
+ ), g = [
52
+ "bg-fm-color-primary",
53
+ "bg-fm-color-secondary-plum",
54
+ "bg-fm-color-system-success-400"
55
+ ];
56
+ function v(x) {
57
+ return new Intl.DateTimeFormat(b.value, {
58
+ year: "numeric",
59
+ month: "short",
60
+ day: "numeric"
61
+ }).format(new Date(x));
62
+ }
63
+ return (x, m) => {
64
+ var u;
65
+ return s(), i("li", ne, [
66
+ e("div", ae, [
67
+ e("div", {
68
+ "aria-hidden": "true",
69
+ class: Z(["w-[48px] h-[48px] rounded-full shrink-0 flex items-center justify-center text-[16px] font-semibold text-fm-color-typo-white", g[p.index % g.length]])
70
+ }, n(r.value), 3),
71
+ e("div", le, [
72
+ e("h2", {
73
+ class: "text-[16px] leading-[24px] font-semibold truncate",
74
+ title: l.value
75
+ }, n(l.value), 9, ce),
76
+ e("p", re, n(((u = p.account.account) == null ? void 0 : u.phoneNumber) || t(o)("connect.whatsappBot.phoneUnavailable")), 1)
77
+ ])
78
+ ]),
79
+ e("div", ie, [
80
+ e("span", pe, [
81
+ m[0] || (m[0] = e("span", { class: "w-[6px] h-[6px] rounded-full bg-fm-color-system-success-400" }, null, -1)),
82
+ j(" " + n(t(o)("connect.whatsappBot.connected")), 1)
83
+ ]),
84
+ p.account.connectedAt ? (s(), i("span", ue, n(t(o)("connect.whatsappBot.connectedSince", {
85
+ date: v(p.account.connectedAt)
86
+ })), 1)) : I("", !0)
87
+ ])
88
+ ]);
89
+ };
90
+ }
91
+ }), xe = { class: "mt-[4px] text-[14px] text-fm-color-typo-secondary" }, me = { class: "mt-[20px] grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] xs:grid-cols-1 gap-[16px]" }, fe = /* @__PURE__ */ E({
92
+ __name: "WhatsappAccountList",
93
+ props: {
94
+ accounts: {}
95
+ },
96
+ setup(p) {
97
+ const { t: a } = P();
98
+ return (o, b) => (s(), i(N, null, [
99
+ e("p", xe, n(t(a)("connect.whatsappBot.accountCount", p.accounts.length)), 1),
100
+ e("ul", me, [
101
+ (s(!0), i(N, null, J(p.accounts, (l, r) => (s(), A(de, {
102
+ key: l.clientId,
103
+ account: l,
104
+ index: r
105
+ }, null, 8, ["account", "index"]))), 128))
106
+ ])
107
+ ], 64));
108
+ }
109
+ }), he = { class: "text-[18px] font-semibold" }, ve = {
110
+ key: 0,
111
+ role: "status",
112
+ class: "flex flex-col items-center text-center gap-[8px] px-[8px] py-[40px]"
113
+ }, ge = { class: "text-[18px] font-semibold" }, _e = { class: "text-[14px] text-fm-color-typo-secondary break-all" }, be = {
114
+ key: 1,
115
+ class: "grid grid-cols-[minmax(0,1fr)_232px] xs:grid-cols-1 gap-[32px] p-[8px] xs:p-[0px]"
116
+ }, ye = { class: "flex flex-col gap-[20px] text-[14px] leading-[20px]" }, we = { class: "text-fm-color-typo-secondary" }, Be = { class: "flex flex-col gap-[14px]" }, ke = { class: "w-[22px] h-[22px] shrink-0 rounded-full bg-fm-color-neutral-gray-100 flex items-center justify-center text-[12px] font-semibold" }, Ce = { key: 0 }, $e = { class: "font-semibold" }, Se = { class: "font-semibold" }, Fe = { class: "font-semibold" }, Ie = { class: "font-semibold" }, Ae = { key: 3 }, Te = { class: "text-[12px] leading-[16px] text-fm-color-typo-secondary" }, De = { 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" }, Ve = {
117
+ key: 0,
118
+ role: "status",
119
+ class: "flex flex-col items-center gap-[12px] text-[13px]"
120
+ }, je = {
121
+ key: 1,
122
+ class: "flex flex-col items-center text-center gap-[12px] p-[12px]"
123
+ }, Ne = {
124
+ role: "alert",
125
+ class: "text-[14px] text-fm-color-typo-error"
126
+ }, Ee = ["src", "alt"], Pe = {
127
+ key: 3,
128
+ role: "status",
129
+ "aria-live": "polite",
130
+ class: "absolute inset-0 bg-fm-color-neutral-white/90 flex flex-col items-center justify-center gap-[10px] text-[13px] font-medium"
131
+ }, Ue = /* @__PURE__ */ E({
132
+ __name: "WhatsappConnectDialog",
133
+ props: {
134
+ modelValue: { type: Boolean, required: !0 },
135
+ modelModifiers: {}
136
+ },
137
+ emits: ["update:modelValue"],
138
+ setup(p) {
139
+ const a = R(p, "modelValue"), { t: o } = P(), b = w(""), l = w(!1), r = w(""), g = w(!1), v = w();
140
+ let x, m, u;
141
+ function _() {
142
+ x == null || x.abort(), clearTimeout(m), m = void 0, clearTimeout(u), u = void 0;
143
+ }
144
+ async function f(c, y, h) {
145
+ if (!h.aborted) {
146
+ try {
147
+ const F = await L.listClients(c, h);
148
+ if (h.aborted) return;
149
+ const C = F.find((B) => B.clientId === y);
150
+ if ((C == null ? void 0 : C.status) === "connected" && (g.value = !0), (C == null ? void 0 : C.status) === "connected" && C.profileStatus === "ready") {
151
+ _(), g.value = !1, v.value = C, u = setTimeout(() => {
152
+ a.value = !1;
153
+ }, 1800);
154
+ return;
155
+ }
156
+ } catch {
157
+ }
158
+ h.aborted || (m = setTimeout(() => {
159
+ f(c, y, h);
160
+ }, 3e3));
161
+ }
162
+ }
163
+ async function S() {
164
+ _();
165
+ const c = new AbortController();
166
+ x = c, b.value = "", r.value = "", g.value = !1, v.value = void 0, l.value = !0;
167
+ try {
168
+ const y = H.getBusinessId();
169
+ if (!y)
170
+ throw new Error(o("connect.whatsappBot.errors.selectBusiness"));
171
+ const h = await L.createClient(
172
+ y,
173
+ c.signal
174
+ ), F = await se.toDataURL(h.qr, {
175
+ width: 224,
176
+ margin: 2,
177
+ errorCorrectionLevel: "M"
178
+ });
179
+ c.signal.aborted || (b.value = F, f(y, h.clientId, c.signal));
180
+ } catch (y) {
181
+ c.signal.aborted || (r.value = y instanceof Error ? y.message : o("connect.whatsappBot.errors.loadQr"));
182
+ } finally {
183
+ c.signal.aborted || (l.value = !1);
184
+ }
185
+ }
186
+ return W(
187
+ a,
188
+ (c) => {
189
+ c ? S() : _();
190
+ },
191
+ { immediate: !0 }
192
+ ), G(_), (c, y) => {
193
+ const h = $("i18n-t"), F = $("FmCircularProgress"), C = $("FmButton"), B = $("FmDialog");
194
+ return s(), A(B, {
195
+ modelValue: a.value,
196
+ "onUpdate:modelValue": y[0] || (y[0] = (d) => a.value = d),
197
+ "min-width": "min(720px, calc(100% - 32px))",
198
+ "max-width": "720px",
199
+ "max-height": "90vh",
200
+ "dismiss-away": ""
201
+ }, {
202
+ "dialog-header": V(() => [
203
+ e("h2", he, n(t(o)("connect.whatsappBot.connectAccount")), 1)
204
+ ]),
205
+ default: V(() => {
206
+ var d, T, M;
207
+ return [
208
+ v.value ? (s(), i("div", ve, [
209
+ y[1] || (y[1] = e("div", {
210
+ "aria-hidden": "true",
211
+ 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]"
212
+ }, [
213
+ e("svg", {
214
+ width: "32",
215
+ height: "32",
216
+ viewBox: "0 0 24 24",
217
+ fill: "none",
218
+ stroke: "currentColor",
219
+ "stroke-width": "2.2",
220
+ "stroke-linecap": "round",
221
+ "stroke-linejoin": "round"
222
+ }, [
223
+ e("path", { d: "M20 6 9 17l-5-5" })
224
+ ])
225
+ ], -1)),
226
+ e("h3", ge, n(t(o)("connect.whatsappBot.accountConnected")), 1),
227
+ e("p", _e, n(((d = v.value.account) == null ? void 0 : d.businessName) || ((T = v.value.account) == null ? void 0 : T.name) || t(o)("connect.whatsappBot.unnamedAccount")) + " · " + n(((M = v.value.account) == null ? void 0 : M.phoneNumber) || t(o)("connect.whatsappBot.phoneUnavailable")), 1)
228
+ ])) : (s(), i("div", be, [
229
+ e("div", ye, [
230
+ e("p", we, n(t(o)("connect.whatsappBot.scanDescription")), 1),
231
+ e("ol", Be, [
232
+ (s(), i(N, null, J(4, (D) => e("li", {
233
+ key: D,
234
+ class: "flex gap-[12px]"
235
+ }, [
236
+ e("span", ke, n(D), 1),
237
+ D === 1 ? (s(), i("span", Ce, n(t(o)("connect.whatsappBot.steps.openApp")), 1)) : D === 2 ? (s(), A(h, {
238
+ key: 1,
239
+ keypath: "connect.whatsappBot.steps.openSettings",
240
+ tag: "span",
241
+ scope: "global"
242
+ }, {
243
+ menu: V(() => [
244
+ e("b", $e, n(t(o)("connect.whatsappBot.menu")), 1)
245
+ ]),
246
+ settings: V(() => [
247
+ e("b", Se, n(t(o)("connect.whatsappBot.settings")), 1)
248
+ ]),
249
+ _: 1
250
+ })) : D === 3 ? (s(), A(h, {
251
+ key: 2,
252
+ keypath: "connect.whatsappBot.steps.linkDevice",
253
+ tag: "span",
254
+ scope: "global"
255
+ }, {
256
+ linkedDevices: V(() => [
257
+ e("b", Fe, n(t(o)("connect.whatsappBot.linkedDevices")), 1)
258
+ ]),
259
+ linkDevice: V(() => [
260
+ e("b", Ie, n(t(o)("connect.whatsappBot.linkDevice")), 1)
261
+ ]),
262
+ _: 1
263
+ })) : (s(), i("span", Ae, n(t(o)("connect.whatsappBot.steps.scanQr")), 1))
264
+ ])), 64))
265
+ ]),
266
+ e("p", Te, n(t(o)("connect.whatsappBot.connectionNote")), 1)
267
+ ]),
268
+ e("div", De, [
269
+ l.value ? (s(), i("div", Ve, [
270
+ k(F),
271
+ j(n(t(o)("connect.whatsappBot.generatingQr")), 1)
272
+ ])) : r.value ? (s(), i("div", je, [
273
+ e("p", Ne, n(r.value), 1),
274
+ k(C, {
275
+ label: t(o)("connect.whatsappBot.tryAgain"),
276
+ "prepend-icon": "refresh",
277
+ onClick: S
278
+ }, null, 8, ["label"])
279
+ ])) : b.value ? (s(), i("img", {
280
+ key: 2,
281
+ src: b.value,
282
+ alt: t(o)("connect.whatsappBot.qrAlt"),
283
+ width: "224",
284
+ height: "224",
285
+ class: Z({ "opacity-20": g.value })
286
+ }, null, 10, Ee)) : I("", !0),
287
+ g.value ? (s(), i("div", Pe, [
288
+ k(F),
289
+ j(" " + n(t(o)("connect.whatsappBot.connecting")), 1)
290
+ ])) : I("", !0)
291
+ ])
292
+ ]))
293
+ ];
294
+ }),
295
+ _: 1
296
+ }, 8, ["modelValue"]);
297
+ };
298
+ }
299
+ }), We = { 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]" }, Le = { class: "text-[20px] leading-[28px] font-bold" }, Me = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary max-w-[420px]" }, Qe = /* @__PURE__ */ E({
300
+ __name: "WhatsappEmptyState",
301
+ emits: ["connect"],
302
+ setup(p, { emit: a }) {
303
+ const o = a, { t: b } = P();
304
+ return (l, r) => {
305
+ const g = $("FmButton");
306
+ return s(), i("div", We, [
307
+ r[1] || (r[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]" }, [
308
+ e("svg", {
309
+ width: "34",
310
+ height: "34",
311
+ viewBox: "0 0 24 24",
312
+ fill: "none",
313
+ stroke: "currentColor",
314
+ "stroke-width": "1.6",
315
+ "stroke-linecap": "round",
316
+ "stroke-linejoin": "round",
317
+ "aria-hidden": "true"
318
+ }, [
319
+ e("path", { d: "M7.9 20A9 9 0 1 0 4 16.1L2 22Z" }),
320
+ e("path", { d: "M9 10h.01M12 10h.01M15 10h.01" })
321
+ ])
322
+ ], -1)),
323
+ e("h2", Le, n(t(b)("connect.whatsappBot.emptyTitle")), 1),
324
+ e("p", Me, n(t(b)("connect.whatsappBot.emptyDescription")), 1),
325
+ k(g, {
326
+ class: "mt-[16px]",
327
+ label: t(b)("connect.whatsappBot.connectAccount"),
328
+ "prepend-icon": "add",
329
+ onClick: r[0] || (r[0] = (v) => o("connect"))
330
+ }, null, 8, ["label"])
331
+ ]);
332
+ };
333
+ }
334
+ }), ze = { class: "max-w-[720px] flex flex-col gap-[20px]" }, He = { class: "flex flex-col items-start gap-[8px]" }, Oe = { class: "text-[24px] leading-[32px] font-semibold tracking-[-0.24px]" }, Ge = {
335
+ key: 0,
336
+ role: "status",
337
+ class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
338
+ }, Xe = {
339
+ key: 0,
340
+ class: "border-[1px] border-fm-color-neutral-gray-100 rounded-[16px] p-[24px] flex flex-col gap-[16px]"
341
+ }, Ze = { class: "flex flex-col gap-[4px]" }, Je = { class: "text-[16px] leading-[24px] font-semibold" }, Ke = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary" }, Re = {
342
+ key: 1,
343
+ role: "alert",
344
+ class: "text-[14px] text-fm-color-typo-error"
345
+ }, Ye = { class: "flex items-center justify-end gap-[12px] flex-wrap" }, qe = {
346
+ key: 0,
347
+ role: "status",
348
+ class: "mr-auto flex items-center gap-[6px] text-[14px] text-fm-color-typo-success"
349
+ }, et = /* @__PURE__ */ E({
350
+ __name: "WhatsappBotSettings",
351
+ props: {
352
+ businessId: {}
353
+ },
354
+ emits: ["close"],
355
+ setup(p, { emit: a }) {
356
+ const o = p, b = a, { t: l } = P(), r = w(""), g = w(""), v = w(!0), x = w(!1), m = w(!1), u = w(""), _ = w(!1), f = oe, S = U(
357
+ () => !x.value || m.value || r.value === g.value || r.value.length > f
358
+ );
359
+ let c, y;
360
+ function h() {
361
+ clearTimeout(y), _.value = !1;
362
+ }
363
+ async function F() {
364
+ c == null || c.abort(), h();
365
+ const B = new AbortController();
366
+ c = B, v.value = !0, x.value = !1, m.value = !1, u.value = "", r.value = "", g.value = "";
367
+ try {
368
+ if (!o.businessId)
369
+ throw new Error(l("connect.whatsappBot.errors.selectBusiness"));
370
+ const d = await L.getSettings(
371
+ o.businessId,
372
+ B.signal
373
+ );
374
+ if (B.signal.aborted) return;
375
+ r.value = d.botInstructions, g.value = d.botInstructions, x.value = !0;
376
+ } catch (d) {
377
+ B.signal.aborted || (u.value = d instanceof Error ? d.message : l("connect.whatsappBot.errors.loadSettings"));
378
+ } finally {
379
+ B.signal.aborted || (v.value = !1);
380
+ }
381
+ }
382
+ async function C() {
383
+ if (S.value) return;
384
+ c == null || c.abort();
385
+ const B = new AbortController();
386
+ c = B, m.value = !0, u.value = "", h();
387
+ try {
388
+ const d = await L.saveSettings(
389
+ o.businessId,
390
+ { botInstructions: r.value },
391
+ B.signal
392
+ );
393
+ if (B.signal.aborted) return;
394
+ g.value = d.botInstructions, r.value = d.botInstructions, _.value = !0, y = setTimeout(() => {
395
+ _.value = !1;
396
+ }, 2500);
397
+ } catch (d) {
398
+ B.signal.aborted || (u.value = d instanceof Error ? d.message : l("connect.whatsappBot.errors.saveSettings"));
399
+ } finally {
400
+ B.signal.aborted || (m.value = !1);
401
+ }
402
+ }
403
+ return W(r, h, { flush: "sync" }), W(() => o.businessId, F, { immediate: !0 }), G(() => {
404
+ c == null || c.abort(), h();
405
+ }), (B, d) => {
406
+ const T = $("FmButton"), M = $("FmCircularProgress"), D = $("FmTextarea"), K = $("FmIcon");
407
+ return s(), i("div", ze, [
408
+ e("div", He, [
409
+ k(T, {
410
+ variant: "plain",
411
+ "prepend-icon": "chevron_left",
412
+ label: t(l)("connect.navigation.whatsappBot"),
413
+ disabled: m.value,
414
+ onClick: d[0] || (d[0] = (O) => b("close"))
415
+ }, null, 8, ["label", "disabled"]),
416
+ e("h1", Oe, n(t(l)("connect.whatsappBot.botSettings.title")), 1)
417
+ ]),
418
+ v.value ? (s(), i("div", Ge, [
419
+ k(M),
420
+ j(" " + n(t(l)("connect.whatsappBot.botSettings.loading")), 1)
421
+ ])) : (s(), i(N, { key: 1 }, [
422
+ x.value ? (s(), i("div", Xe, [
423
+ e("div", Ze, [
424
+ e("h2", Je, n(t(l)("connect.whatsappBot.botSettings.instructions")), 1),
425
+ e("p", Ke, n(t(l)("connect.whatsappBot.botSettings.description")), 1)
426
+ ]),
427
+ k(D, {
428
+ modelValue: r.value,
429
+ "onUpdate:modelValue": d[1] || (d[1] = (O) => r.value = O),
430
+ "aria-label": t(l)("connect.whatsappBot.botSettings.instructions"),
431
+ placeholder: t(l)("connect.whatsappBot.botSettings.placeholder"),
432
+ "max-length": t(f),
433
+ disabled: m.value,
434
+ "show-word-count": "",
435
+ class: "[&_.fm-textarea\\_\\_container]:!h-auto [&_textarea]:min-h-[200px] [&_textarea]:!resize-y"
436
+ }, null, 8, ["modelValue", "aria-label", "placeholder", "max-length", "disabled"])
437
+ ])) : I("", !0),
438
+ u.value ? (s(), i("p", Re, n(u.value), 1)) : I("", !0),
439
+ x.value ? I("", !0) : (s(), A(T, {
440
+ key: 2,
441
+ class: "self-start",
442
+ label: t(l)("connect.whatsappBot.tryAgain"),
443
+ "prepend-icon": "refresh",
444
+ onClick: F
445
+ }, null, 8, ["label"])),
446
+ e("div", Ye, [
447
+ _.value ? (s(), i("span", qe, [
448
+ k(K, {
449
+ name: "check",
450
+ size: "sm"
451
+ }),
452
+ j(" " + n(t(l)("connect.whatsappBot.botSettings.saved")), 1)
453
+ ])) : I("", !0),
454
+ k(T, {
455
+ variant: "secondary",
456
+ label: t(l)("connect.common.cancel"),
457
+ disabled: m.value,
458
+ onClick: d[2] || (d[2] = (O) => b("close"))
459
+ }, null, 8, ["label", "disabled"]),
460
+ k(T, {
461
+ label: t(l)("connect.common.save"),
462
+ disabled: S.value,
463
+ loading: m.value,
464
+ onClick: C
465
+ }, null, 8, ["label", "disabled", "loading"])
466
+ ])
467
+ ], 64))
468
+ ]);
469
+ };
470
+ }
471
+ }), tt = { class: "px-[24px] xs:px-[12px] pt-[20px] pb-[40px] text-fm-color-typo-primary" }, ot = {
472
+ key: 0,
473
+ class: "flex items-center justify-between gap-[16px] flex-wrap min-h-[40px]"
474
+ }, st = { class: "flex items-center gap-8" }, nt = { class: "text-[24px] leading-[32px] font-semibold tracking-[-0.01em]" }, at = { class: "flex items-center gap-[8px]" }, lt = {
475
+ key: 0,
476
+ role: "status",
477
+ class: "mt-[24px] py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
478
+ }, ct = {
479
+ key: 1,
480
+ 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]"
481
+ }, rt = {
482
+ role: "alert",
483
+ class: "text-[14px] text-fm-color-typo-error"
484
+ }, mt = /* @__PURE__ */ E({
485
+ __name: "WhatsappBot",
486
+ setup(p) {
487
+ const { t: a } = P(), o = w(!1), b = U(() => H.getBusinessId() ?? ""), l = w([]), r = w(!0), g = w("");
488
+ let v;
489
+ const x = U(
490
+ () => l.value.filter((_) => _.status === "connected")
491
+ );
492
+ async function m() {
493
+ v == null || v.abort();
494
+ const _ = new AbortController();
495
+ v = _, r.value = !0, g.value = "";
496
+ try {
497
+ const f = H.getBusinessId();
498
+ if (!f)
499
+ throw new Error(a("connect.whatsappBot.errors.selectBusiness"));
500
+ const S = await L.listClients(f, _.signal);
501
+ _.signal.aborted || (l.value = S);
502
+ } catch (f) {
503
+ _.signal.aborted || (g.value = f instanceof Error ? f.message : a("connect.whatsappBot.errors.loadSessions"));
504
+ } finally {
505
+ _.signal.aborted || (r.value = !1);
506
+ }
507
+ }
508
+ const u = w(!1);
509
+ return W(u, (_) => {
510
+ _ || m();
511
+ }), W(
512
+ () => H.getBusinessId(),
513
+ () => {
514
+ u.value = !1, o.value = !1, l.value = [], m();
515
+ },
516
+ { immediate: !0 }
517
+ ), G(() => {
518
+ v == null || v.abort();
519
+ }), (_, f) => {
520
+ const S = $("FmPill"), c = $("FmButton"), y = $("FmCircularProgress");
521
+ return s(), i(N, null, [
522
+ e("div", tt, [
523
+ o.value ? I("", !0) : (s(), i("div", ot, [
524
+ e("div", st, [
525
+ e("h1", nt, n(t(a)("connect.navigation.whatsappBot")), 1),
526
+ k(S, { variant: "beta" })
527
+ ]),
528
+ e("div", at, [
529
+ k(c, {
530
+ variant: "secondary",
531
+ label: t(a)("connect.whatsappBot.settings"),
532
+ "prepend-icon": "settings",
533
+ onClick: f[0] || (f[0] = (h) => o.value = !0)
534
+ }, null, 8, ["label"]),
535
+ x.value.length ? (s(), A(c, {
536
+ key: 0,
537
+ label: t(a)("connect.whatsappBot.connectAccount"),
538
+ "prepend-icon": "add",
539
+ onClick: f[1] || (f[1] = (h) => u.value = !0)
540
+ }, null, 8, ["label"])) : I("", !0)
541
+ ])
542
+ ])),
543
+ o.value ? (s(), A(et, {
544
+ key: 1,
545
+ "business-id": b.value,
546
+ onClose: f[2] || (f[2] = (h) => o.value = !1)
547
+ }, null, 8, ["business-id"])) : (s(), i(N, { key: 2 }, [
548
+ r.value ? (s(), i("div", lt, [
549
+ k(y),
550
+ j(" " + n(t(a)("connect.whatsappBot.loadingSessions")), 1)
551
+ ])) : g.value ? (s(), i("div", ct, [
552
+ e("p", rt, n(g.value), 1),
553
+ k(c, {
554
+ label: t(a)("connect.whatsappBot.tryAgain"),
555
+ "prepend-icon": "refresh",
556
+ onClick: m
557
+ }, null, 8, ["label"])
558
+ ])) : x.value.length ? (s(), A(fe, {
559
+ key: 2,
560
+ accounts: x.value
561
+ }, null, 8, ["accounts"])) : (s(), A(Qe, {
562
+ key: 3,
563
+ onConnect: f[3] || (f[3] = (h) => u.value = !0)
564
+ }))
565
+ ], 64))
566
+ ]),
567
+ k(Ue, {
568
+ modelValue: u.value,
569
+ "onUpdate:modelValue": f[4] || (f[4] = (h) => u.value = h)
570
+ }, null, 8, ["modelValue"])
571
+ ], 64);
572
+ };
573
+ }
574
+ });
575
+ export {
576
+ mt as default
577
+ };
@@ -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-DIsCEUuE.js";
3
- import { u as V } from "./vue-i18n-Bg_RJ_GV.js";
2
+ import { Z as d } from "./zod-DPK1tAj-.js";
3
+ import { u as V } from "./vue-i18n-DU1J-6Fe.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"