@feedmepos/mf-connect 0.1.124-prod → 0.1.125-prod

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/{App-DMh2xABv.js → App-VvS6HIoz.js} +10 -10
  2. package/dist/{Bin-C_pkPgIo.js → Bin-dVF9Q1iu.js} +8 -8
  3. package/dist/{Broadcast-6ZJzdY0b.js → Broadcast-BIZbCshz.js} +11 -11
  4. package/dist/{CampaignAnalytic-CLd5ecQe.js → CampaignAnalytic-Ci8Ryoig.js} +7 -7
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C4OWhhAx.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CMgvX7Qs.js} +10 -10
  6. package/dist/{Card-CkS8F43U.js → Card-CZkmyXaw.js} +23 -23
  7. package/dist/{Collections-BA9I-dDz.js → Collections-Inv8osLz.js} +9 -9
  8. package/dist/{Credit-CXm0A-qe.js → Credit-C0sAkt2c.js} +11 -11
  9. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-DzsHTlrN.js → DateRangeChip.vue_vue_type_script_setup_true_lang-BiJ_wHig.js} +1 -1
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C5INV6R7.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-B28ds81U.js} +37 -37
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-zSPUBUSz.js → EffectSheet.vue_vue_type_style_index_0_lang-BU1c2K1g.js} +6 -6
  12. package/dist/{Experience-Bq4ykqTJ.js → Experience-BNEfKjkq.js} +12 -12
  13. package/dist/{FileSaver.min-BtBxrIBi.js → FileSaver.min-C5THVA6m.js} +1 -1
  14. package/dist/{Game-DpLFmP-G.js → Game-S9z8ZBF3.js} +12 -12
  15. package/dist/{GiftCardSetup-BqOqEUim.js → GiftCardSetup-nVMJLp50.js} +10 -10
  16. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-B06xj5q7.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-DC2QB9kR.js} +7 -7
  17. package/dist/{Goals-DMlNeiUc.js → Goals-Do6Z0FfW.js} +4 -4
  18. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DPWRgxG_.js → ImageInput.vue_vue_type_script_setup_true_lang-CFb4EUQ5.js} +1 -1
  19. package/dist/{Index-Cw07jj0k.js → Index-CLVDmWRo.js} +10 -10
  20. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-CLjjquVP.js → LocationPicker.vue_vue_type_script_setup_true_lang-CZwKWjn6.js} +1 -1
  21. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DHOShJQp.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CGPZUYnY.js} +1 -1
  22. package/dist/{LoyaltyDashboard-DzSiK6M7.js → LoyaltyDashboard-B_HpEQdz.js} +15 -15
  23. package/dist/{MainLayout-1EF680_j.js → MainLayout-uQfsgnnu.js} +1 -1
  24. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-Df9pBgH9.js → MainLayout.vue_vue_type_script_setup_true_lang-DNPmnCA8.js} +3 -3
  25. package/dist/{Marketing-T-epFsvG.js → Marketing-DPWybdMq.js} +4 -4
  26. package/dist/{MarketingMaterialEdit-CVhPfyEp.js → MarketingMaterialEdit-BfBgdPyz.js} +6 -6
  27. package/dist/{Member-BUZOPyQR.js → Member-Bkt3UPXA.js} +7 -7
  28. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-zURjtl1z.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-EIc8nFZ0.js} +24 -24
  29. package/dist/{MemberImportHistory-DGz9i6L7.js → MemberImportHistory-DbzrfaI6.js} +7 -7
  30. package/dist/{MemberList-CNdSrzBa.js → MemberList-CAxUgRRp.js} +14 -14
  31. package/dist/{MemberTransactions-CdQMuQsd.js → MemberTransactions-DDGkVcHw.js} +1 -1
  32. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CWKVXeCa.js → MessageInput.vue_vue_type_script_setup_true_lang-C2D5J4Ja.js} +10 -10
  33. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-xZitIoXE.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-2f1SFptj.js} +1 -1
  34. package/dist/{Mission-CYxgMBPt.js → Mission-CTa5syv8.js} +13 -13
  35. package/dist/{Overview-DSm8AfDB.js → Overview-CD6Q9DJm.js} +21 -21
  36. package/dist/{Overview-qZ1KKw9D.js → Overview-DLXj9lo5.js} +4 -4
  37. package/dist/{Point-BGlbT9OK.js → Point-ktWnL8q5.js} +13 -13
  38. package/dist/{Promotion-CtlrUFa8.js → Promotion-hqaOxx8q.js} +13 -13
  39. package/dist/{Queue-Dc_z9MKc.js → Queue-BE-fU8IM.js} +13 -13
  40. package/dist/{Record-DVKrhFwJ.js → Record-BEFt0lae.js} +9 -9
  41. package/dist/{Review-Bh8Tw_QU.js → Review-DcLFxegb.js} +2 -2
  42. package/dist/{ReviewFacebookCallback-ZZ0pxplM.js → ReviewFacebookCallback-6BapqO6b.js} +5 -5
  43. package/dist/{ReviewGoogleCallback-CsSCz_C5.js → ReviewGoogleCallback-CQ1awmJH.js} +5 -5
  44. package/dist/{Reward-DY1Q3m1w.js → Reward-eZLQ_qzv.js} +16 -16
  45. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-4A91EkSW.js → RewardGroup.vue_vue_type_script_setup_true_lang-DT4cU2lr.js} +14 -14
  46. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-JA0XIgqb.js → RuleGroup.vue_vue_type_script_setup_true_lang-CdWm80id.js} +16 -16
  47. package/dist/{Segment-D6LchJFl.js → Segment-C1Xbqlcv.js} +27 -27
  48. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CSAtkMnJ.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-C_1xj3Cl.js} +15 -15
  49. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Co1MQoVq.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DwejRzlR.js} +4 -4
  50. package/dist/{Setting-UkdSKiUb.js → Setting-Cg21mqEc.js} +15 -15
  51. package/dist/{SettingAdvertisements-DK97gcus.js → SettingAdvertisements-CA6x_w-6.js} +12 -12
  52. package/dist/{Settings-BFcVswDS.js → Settings-CbrC5bN2.js} +5 -5
  53. package/dist/{Store-2VVStL5_.js → Store-CFDsun8N.js} +27 -27
  54. package/dist/{StoreRewards-f3Pyb9hu.js → StoreRewards-BhURDAsS.js} +15 -15
  55. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BmnyPSVT.js → StoreTransactions.vue_vue_type_script_setup_true_lang-JkpE5XsA.js} +25 -25
  56. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CCWNzg4p.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DzMfetDA.js} +2 -2
  57. package/dist/{Tier-D4Of9P17.js → Tier-B4iofOYH.js} +26 -26
  58. package/dist/{Title-Cg6X9UkB.js → Title-3YNx77l4.js} +24 -24
  59. package/dist/{Transaction-LJbjQnj_.js → Transaction-CX9SxMEG.js} +2 -2
  60. package/dist/{Upselling-B-VwbtjT.js → Upselling-CznVPMJC.js} +3 -3
  61. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DqH6Upx-.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BZVdb3An.js} +6 -6
  62. package/dist/{Voucher-BJG6VKXt.js → Voucher-7Hl1LPrh.js} +18 -18
  63. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-7kYeJthi.js → VoucherEditor.vue_vue_type_script_setup_true_lang-dFJXQsFv.js} +12 -12
  64. package/dist/{WhatsappAccount-Dc1fJWWj.js → WhatsappAccount-DQbkWBel.js} +6 -6
  65. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BV0Bsl7a.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-CvqJzTXs.js} +1 -1
  66. package/dist/{WhatsappBot-Coq1WP96.js → WhatsappBot-B0nZTeT7.js} +6 -6
  67. package/dist/WhatsappBotLogs-DujpGQWa.js +509 -0
  68. package/dist/{WhatsappBotSettings-fNRFecJX.js → WhatsappBotSettings-CfhMycMW.js} +65 -65
  69. package/dist/{WhatsappLayout-x9Ovpu6e.js → WhatsappLayout-b1gwbBm0.js} +3 -3
  70. package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DZlT0uLW.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DiQnP4cp.js} +3 -3
  71. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DSJncfI_.js → ZodTextField.vue_vue_type_script_setup_true_lang-Cidk_OlM.js} +2 -2
  72. package/dist/{app-BMFxxLUm.js → app-C5LDuXmt.js} +452 -416
  73. package/dist/app.js +1 -1
  74. package/dist/{base.export-LmQ51u5f.js → base.export-BBrPA7Jg.js} +2 -2
  75. package/dist/{business-DZWViiMC.js → business-ClZ-GkSj.js} +1 -1
  76. package/dist/{campaign-DZDGbR4W.js → campaign-B-h5N3HR.js} +8 -8
  77. package/dist/{campaign-C9xvGyrL.js → campaign-DefEj7jV.js} +2 -2
  78. package/dist/{campaign.fn-OVkj0QLu.js → campaign.fn-C5ZXEU8C.js} +205 -205
  79. package/dist/{collection.fn-DrNrla0B.js → collection.fn-DZ0ViZdo.js} +2 -2
  80. package/dist/{currency-BZv2gSlF.js → currency-C0Qn4nj3.js} +1 -1
  81. package/dist/{effect-CvumfBMY.js → effect-CJHdpc35.js} +1 -1
  82. package/dist/{email-addresses-79tPeI4j.js → email-addresses-CipYiyL4.js} +2 -2
  83. package/dist/{feature-flag-CYXnrECh.js → feature-flag-BBsHJnnj.js} +1 -1
  84. package/dist/{helper-DFjsyjri.js → helper-Cn8vgyK3.js} +1 -1
  85. package/dist/{index-Bnane9cm.js → index-0Ub4nEKy.js} +1 -1
  86. package/dist/{index-CAWnce4u.js → index-B2r_X6DR.js} +1 -1
  87. package/dist/{index-MhAbTpBy.js → index-BAvmo8cc.js} +2 -2
  88. package/dist/{index-DZrX13oF.js → index-BREObqqd.js} +4 -4
  89. package/dist/{index-Ba1t5vQv.js → index-BcjArc8W.js} +4 -4
  90. package/dist/{index-C6Rx7pjc.js → index-BcwGxZje.js} +8 -8
  91. package/dist/{index-B_8PAyia.js → index-BkXjF7ZI.js} +2 -2
  92. package/dist/{index-C43KoLej.js → index-BzLz01zb.js} +1 -1
  93. package/dist/{index-BiPRZRyE.js → index-C5o2Pc_f.js} +2 -2
  94. package/dist/{index-I9lmcd2w.js → index-CH-uRaZH.js} +56 -53
  95. package/dist/{index-C5bC2n8X.js → index-CWs0a5Bx.js} +3 -3
  96. package/dist/{index-C6ZTa-eq.js → index-CZ3CQEXM.js} +1 -1
  97. package/dist/{index-CW4rNV1_.js → index-CazcZ2A4.js} +2 -2
  98. package/dist/{index-_-nCOZ1D.js → index-DBqf8mMi.js} +1 -1
  99. package/dist/{index-DWZzsJHU.js → index-DKg5PbUy.js} +2 -2
  100. package/dist/{index-Bt-n8QuD.js → index-DLKFoHdk.js} +9 -9
  101. package/dist/{index-CA7oIW_T.js → index-DYMRcL11.js} +3 -3
  102. package/dist/{index-CNzQ3FLi.js → index-Wm89O5a0.js} +1 -1
  103. package/dist/{index-CcCiEG6N.js → index-auS6xhgf.js} +1 -1
  104. package/dist/{index-CBd91xYU.js → index-sntP2S4R.js} +2 -2
  105. package/dist/index-xn_PXhGL.js +86 -0
  106. package/dist/{index.esm2017-DtTjnHHc.js → index.esm2017-ePnKsRWd.js} +1 -1
  107. package/dist/{loading-DkqEFbrR.js → loading-DyfvdnK3.js} +1 -1
  108. package/dist/{lodash-BxU_5gPB.js → lodash-OSOEHuHV.js} +1 -1
  109. package/dist/{member-import-B3NBqSF6.js → member-import-DyKhgdl1.js} +22 -13
  110. package/dist/{membership-Dr5BxoL-.js → membership-E97L9c1m.js} +2 -2
  111. package/dist/{money-D58xuACG.js → money-BizInVDg.js} +1 -1
  112. package/dist/{number-C9CiD5ci.js → number-BLjNuAXB.js} +1 -1
  113. package/dist/objectid-CfbfYlrU.js +145 -0
  114. package/dist/{onboarding-BssUSfGQ.js → onboarding-BVOkoMd2.js} +3 -3
  115. package/dist/{onboardingSetup-Dc_lD-K8.js → onboardingSetup-WWZ5x3uC.js} +2 -2
  116. package/dist/{plugins-D7Xjefvk.js → plugins-BFwgESNo.js} +3 -3
  117. package/dist/{reward-CACqYkQp.js → reward-BOldgYfT.js} +1 -1
  118. package/dist/{rule-BRaTrwKz.js → rule-CffnxtCw.js} +3 -3
  119. package/dist/{rule-builder-DZOASGFD.js → rule-builder-dOQCz1XZ.js} +1 -1
  120. package/dist/{template-DdeVPIBt.js → template-CbHOOFuo.js} +7 -7
  121. package/dist/{timezone-CgVEOC5i.js → timezone-CDbzzKWe.js} +1 -1
  122. package/dist/{transaction.fn-C64l_ja_.js → transaction.fn-CM89jnhJ.js} +2 -2
  123. package/dist/{trigger-d2RIqXLt.js → trigger-BUKAiVxy.js} +5 -5
  124. package/dist/{useMarketingMaterialActions-Drf2MY9h.js → useMarketingMaterialActions-D-AWVN4e.js} +4 -4
  125. package/dist/{usePagination-IUw34YLE.js → usePagination-3kKtIKVu.js} +1 -1
  126. package/dist/{user-ClGyYHyS.js → user-CHb8XZ5i.js} +1 -1
  127. package/dist/{vue-i18n-Cby9s0nj.js → vue-i18n-CqhxVhhE.js} +345 -345
  128. package/dist/{xlsx-HvtVSofi.js → xlsx-BR-cAoRJ.js} +1 -1
  129. package/dist/{zod-IPdjFU_b.js → zod-dX5GDNHW.js} +1 -1
  130. package/package.json +1 -1
  131. package/dist/WhatsappBotLogs-EH9PQVn9.js +0 -372
  132. package/dist/index-C-pVo6PI.js +0 -74
  133. package/dist/objectid-CgTtbB6Q.js +0 -145
@@ -0,0 +1,509 @@
1
+ import { defineComponent as Y, resolveComponent as y, openBlock as n, createElementBlock as p, createElementVNode as s, toDisplayString as l, unref as c, createVNode as h, computed as g, createCommentVNode as k, Fragment as T, renderList as G, normalizeClass as ee, createTextVNode as te, createBlock as S, ref as w, h as F, watch as J, onBeforeUnmount as xe, withCtx as K, withDirectives as ve, vShow as fe } from "vue";
2
+ import { u as j } from "./vue-i18n-CqhxVhhE.js";
3
+ import { useCoreStore as he } from "@feedmepos/mf-common";
4
+ import { components as ge } from "@feedmepos/ui-library";
5
+ import { S as we } from "./index-sntP2S4R.js";
6
+ import { w as Q } from "./index-xn_PXhGL.js";
7
+ import { _ as ye } from "./remy-icon-BhUGu2NI.js";
8
+ import { _ as be } from "./WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DiQnP4cp.js";
9
+ import { C as X } from "./timezone-CDbzzKWe.js";
10
+ import { m as _e } from "./index-Wm89O5a0.js";
11
+ const Be = { class: "group self-end min-w-[min(280px,100%)] max-w-[80%] rounded-[12px] rounded-br-[4px] bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary" }, ke = { class: "flex items-center gap-[4px] min-h-[28px] px-[10px] py-[4px] text-[11px] font-medium cursor-pointer list-none rounded-[12px] focus-visible:outline-fm-color-primary" }, Ce = { class: "flex-1 group-open:hidden" }, Fe = { class: "flex-1 hidden group-open:inline" }, Ae = { class: "px-[10px] pt-[2px] pb-[8px] text-[13px] leading-[18px] whitespace-pre-wrap break-words" }, $e = /* @__PURE__ */ Y({
12
+ __name: "ThoughtBubble",
13
+ props: {
14
+ text: {}
15
+ },
16
+ setup(r) {
17
+ const { t: b } = j();
18
+ return (o, A) => {
19
+ const a = y("FmIcon");
20
+ return n(), p("details", Be, [
21
+ s("summary", ke, [
22
+ A[0] || (A[0] = s("img", {
23
+ src: ye,
24
+ alt: "",
25
+ "aria-hidden": "true",
26
+ class: "w-[16px] h-[16px] shrink-0"
27
+ }, null, -1)),
28
+ s("span", Ce, l(c(b)("connect.whatsappBot.logs.thought")), 1),
29
+ s("span", Fe, l(c(b)("connect.whatsappBot.logs.hideThought")), 1),
30
+ h(a, {
31
+ name: "keyboard_arrow_down",
32
+ size: "sm",
33
+ class: "transition-transform group-open:rotate-180"
34
+ })
35
+ ]),
36
+ s("p", Ae, l(r.text), 1)
37
+ ]);
38
+ };
39
+ }
40
+ }), Ne = { class: "border border-fm-color-neutral-gray-100 rounded-[16px] bg-fm-color-neutral-white overflow-hidden" }, Me = { class: "flex items-center gap-[10px] px-[16px] py-[10px] border-b border-fm-color-neutral-gray-100 flex-wrap" }, De = {
41
+ key: 0,
42
+ "aria-hidden": "true",
43
+ class: "w-[28px] h-[28px] rounded-full bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary text-[12px] font-semibold flex items-center justify-center shrink-0"
44
+ }, Ie = {
45
+ key: 1,
46
+ class: "min-w-0 flex-1"
47
+ }, Se = { class: "text-[14px] font-semibold leading-[20px] break-words" }, Te = { class: "text-[12px] leading-[16px] text-fm-color-typo-tertiary break-words" }, ze = ["datetime"], Le = { class: "flex flex-col gap-[10px] px-[16px] py-[12px]" }, Ee = {
48
+ key: 0,
49
+ class: "self-end text-[12px] leading-[16px] text-fm-color-typo-tertiary"
50
+ }, Ve = {
51
+ key: 0,
52
+ class: "text-[11px] text-fm-color-typo-tertiary"
53
+ }, Ue = ["datetime"], Ge = ["disabled", "title"], Ye = { class: "w-[24px] h-[24px] rounded-full bg-fm-color-secondary-plum/10 text-fm-color-secondary-plum flex items-center justify-center shrink-0" }, je = { class: "flex flex-col min-w-0" }, We = { class: "text-[13px] leading-[18px] font-semibold" }, Oe = { class: "text-[12px] leading-[16px] text-fm-color-typo-tertiary whitespace-pre-wrap break-words" }, Pe = /* @__PURE__ */ Y({
54
+ __name: "WhatsappLogConversation",
55
+ props: {
56
+ conversation: {},
57
+ group: {},
58
+ accountName: {},
59
+ timezone: {},
60
+ showCustomer: { type: Boolean, default: !0 }
61
+ },
62
+ emits: ["notificationGroup"],
63
+ setup(r, { emit: b }) {
64
+ const o = r, A = b, { t: a, locale: u } = j(), C = g(
65
+ () => o.conversation.customerName || o.conversation.phoneNumber || a("connect.whatsappBot.logs.unknownCustomer")
66
+ ), v = g(
67
+ () => o.conversation.customerName ? o.conversation.customerName.trim().split(/\s+/).slice(0, 2).map((f) => Array.from(f)[0]).join("").toLocaleUpperCase(u.value) : "?"
68
+ ), I = g(
69
+ () => new Intl.DateTimeFormat(u.value, {
70
+ dateStyle: "medium",
71
+ timeStyle: "short",
72
+ timeZone: o.timezone
73
+ })
74
+ ), $ = g(
75
+ () => new Intl.DateTimeFormat(u.value, {
76
+ hour: "2-digit",
77
+ minute: "2-digit",
78
+ hour12: !1,
79
+ timeZone: o.timezone
80
+ })
81
+ );
82
+ function m(f) {
83
+ var _;
84
+ return (_ = f.reaction) != null && _.removed ? a("connect.whatsappBot.logs.reactionRemoved") : f.text ? f.text : a("connect.whatsappBot.logs.mediaMessage", { type: f.messageType });
85
+ }
86
+ return (f, _) => {
87
+ const N = y("FmIcon");
88
+ return n(), p("article", Ne, [
89
+ s("header", Me, [
90
+ r.showCustomer ? (n(), p("div", De, l(v.value), 1)) : k("", !0),
91
+ r.showCustomer ? (n(), p("div", Ie, [
92
+ s("h2", Se, l(C.value), 1),
93
+ s("p", Te, l(r.conversation.phoneNumber || c(a)("connect.whatsappBot.phoneUnavailable")) + " · " + l(c(a)("connect.whatsappBot.logs.via", { name: r.accountName })), 1)
94
+ ])) : k("", !0),
95
+ s("time", {
96
+ datetime: r.group.lastCreatedAt,
97
+ class: "text-[12px] text-fm-color-typo-tertiary tabular-nums"
98
+ }, l(I.value.format(new Date(r.group.lastCreatedAt))), 9, ze)
99
+ ]),
100
+ s("ol", Le, [
101
+ (n(!0), p(T, null, G(r.group.logs, (i) => (n(), p("li", {
102
+ key: i.id,
103
+ class: "flex flex-col gap-[4px] min-w-0"
104
+ }, [
105
+ i.type === "message" ? (n(), p(T, { key: 0 }, [
106
+ i.isFromMe && !i.isFromBot ? (n(), p("span", Ee, l(c(a)("connect.whatsappBot.logs.sentByStaff")), 1)) : k("", !0),
107
+ s("div", {
108
+ class: ee([
109
+ "px-[10px] py-[6px] text-[14px] leading-[20px] whitespace-pre-wrap break-words min-w-0",
110
+ i.isFromMe ? "self-end max-w-[80%] bg-fm-color-primary-oats rounded-[12px] rounded-br-[4px]" : "self-start max-w-[75%] bg-[#F7F7F7] rounded-[12px] rounded-bl-[4px]"
111
+ ])
112
+ }, [
113
+ te(l(m(i)) + " ", 1),
114
+ i.isEdit ? (n(), p("span", Ve, " (" + l(c(a)("connect.whatsappBot.logs.edited")) + ") ", 1)) : k("", !0),
115
+ s("time", {
116
+ datetime: i.timestamp,
117
+ class: "float-right mt-[6px] ml-[10px] text-[11px] leading-[14px] text-fm-color-typo-tertiary tabular-nums"
118
+ }, l($.value.format(new Date(i.timestamp))), 9, Ue)
119
+ ], 2)
120
+ ], 64)) : i.type === "thought" ? (n(), S($e, {
121
+ key: 1,
122
+ text: i.text
123
+ }, null, 8, ["text"])) : i.type === "escalate" ? (n(), p("button", {
124
+ key: 2,
125
+ type: "button",
126
+ disabled: !r.conversation.clientId,
127
+ title: c(a)("connect.whatsappBot.logs.openNotificationGroup"),
128
+ class: "self-end flex items-start gap-[8px] max-w-[80%] py-[8px] pr-[12px] pl-[8px] border border-fm-color-neutral-gray-200 rounded-[8px] text-left hover:bg-fm-color-neutral-gray-100/50 focus-visible:outline-fm-color-primary",
129
+ onClick: _[0] || (_[0] = (z) => r.conversation.clientId && A("notificationGroup", r.conversation.clientId))
130
+ }, [
131
+ s("span", Ye, [
132
+ h(N, {
133
+ name: "group",
134
+ size: "sm"
135
+ })
136
+ ]),
137
+ s("span", je, [
138
+ s("span", We, l(c(a)("connect.whatsappBot.logs.escalated")), 1),
139
+ s("span", Oe, l(c(a)("connect.whatsappBot.logs.reason", {
140
+ reason: i.reason
141
+ })), 1)
142
+ ])
143
+ ], 8, Ge)) : k("", !0)
144
+ ]))), 128))
145
+ ])
146
+ ]);
147
+ };
148
+ }
149
+ });
150
+ function Re(r, b) {
151
+ const o = /* @__PURE__ */ new Map(), A = [...r].sort(
152
+ (a, u) => Date.parse(a.createdAt) - Date.parse(u.createdAt) || q(a) - q(u) || a.id.localeCompare(u.id)
153
+ );
154
+ for (const a of A) {
155
+ const u = _e.tz(a.createdAt, b).format("YYYY-MM-DD"), C = o.get(u);
156
+ C ? (C.logs.push(a), C.lastCreatedAt = a.createdAt) : o.set(u, {
157
+ date: u,
158
+ createdAt: a.createdAt,
159
+ lastCreatedAt: a.createdAt,
160
+ logs: [a]
161
+ });
162
+ }
163
+ return [...o.values()].sort(
164
+ (a, u) => Date.parse(u.lastCreatedAt) - Date.parse(a.lastCreatedAt)
165
+ );
166
+ }
167
+ function q(r) {
168
+ return r.type === "thought" ? 1 : r.type === "escalate" ? 2 : r.isFromMe ? 3 : 0;
169
+ }
170
+ const Ze = { class: "mt-[20px] flex flex-col gap-[16px]" }, He = { class: "min-w-0 flex-1" }, Je = { class: "text-[16px] font-semibold leading-[24px] break-words" }, Ke = { class: "text-[12px] leading-[16px] text-fm-color-typo-tertiary break-words" }, Qe = { class: "max-h-[240px] overflow-y-auto" }, Xe = {
171
+ key: 0,
172
+ role: "alert",
173
+ class: "text-[14px] text-fm-color-typo-error"
174
+ }, qe = {
175
+ key: 1,
176
+ class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
177
+ }, et = {
178
+ key: 2,
179
+ class: "flex items-center gap-[12px] flex-wrap"
180
+ }, tt = {
181
+ role: "alert",
182
+ class: "text-[14px] text-fm-color-typo-error"
183
+ }, ot = {
184
+ key: 3,
185
+ class: "border border-fm-color-neutral-gray-200 rounded-[16px] px-[24px] py-[56px] flex flex-col items-center text-center gap-[8px]"
186
+ }, at = { class: "text-[20px] font-semibold" }, nt = { class: "max-w-[420px] text-[14px] leading-[20px] text-fm-color-typo-secondary" }, st = {
187
+ key: 4,
188
+ class: "w-full max-w-[880px] min-w-0 flex flex-col gap-[12px]"
189
+ }, lt = { key: 5 }, gt = /* @__PURE__ */ Y({
190
+ __name: "WhatsappBotLogs",
191
+ props: {
192
+ accounts: {}
193
+ },
194
+ setup(r) {
195
+ const b = r, { t: o, locale: A } = j(), a = he(), u = g(() => we.getBusinessId() ?? ""), C = g(
196
+ () => X[a.currentCountry.value || "MY"] ?? X.MY
197
+ ), v = w([]), I = w(""), $ = w([]), m = w(), f = w([]), _ = w([]), N = w(!0), i = w(""), z = w(), E = w(!1), M = w("");
198
+ let B;
199
+ const oe = g(
200
+ () => new Intl.DateTimeFormat(A.value, {
201
+ dateStyle: "medium",
202
+ timeStyle: "short",
203
+ timeZone: C.value
204
+ })
205
+ );
206
+ function W(e) {
207
+ return e.customerName || e.phoneNumber || o("connect.whatsappBot.logs.unknownCustomer");
208
+ }
209
+ function O(e) {
210
+ var d;
211
+ const t = e.lastMessage;
212
+ return t ? (d = t.reaction) != null && d.removed ? o("connect.whatsappBot.logs.reactionRemoved") : t.text || o("connect.whatsappBot.logs.mediaMessage", { type: t.messageType }) : o("connect.whatsappBot.logs.noMessages");
213
+ }
214
+ function L(e) {
215
+ var d;
216
+ const t = (d = b.accounts.find(
217
+ (D) => D.clientId === e
218
+ )) == null ? void 0 : d.account;
219
+ return (t == null ? void 0 : t.businessName) || (t == null ? void 0 : t.name) || (t == null ? void 0 : t.phoneNumber) || o("connect.whatsappBot.logs.unknownAccount", { id: (e == null ? void 0 : e.slice(-6)) ?? "" });
220
+ }
221
+ const ae = g(
222
+ () => [
223
+ .../* @__PURE__ */ new Set([
224
+ ...b.accounts.map((e) => e.clientId),
225
+ ..._.value,
226
+ ...v.value
227
+ ])
228
+ ].map((e) => ({ clientId: e, label: L(e) }))
229
+ ), P = g(() => {
230
+ const e = I.value.trim().toLocaleLowerCase();
231
+ return ae.value.filter(
232
+ (t) => t.label.toLocaleLowerCase().includes(e)
233
+ );
234
+ }), ne = g(() => {
235
+ const e = v.value;
236
+ let t = o("connect.whatsappBot.logs.allAccounts");
237
+ return e.length === 1 ? t = L(e[0]) : e.length > 1 && (t = o("connect.whatsappBot.logs.selectedAccounts", {
238
+ count: e.length
239
+ })), o("connect.whatsappBot.logs.accountFilter", { name: t });
240
+ }), R = g(
241
+ () => Re(f.value, C.value)
242
+ ), se = g(() => [
243
+ {
244
+ id: "customer",
245
+ header: o("connect.whatsappBot.logs.customer"),
246
+ cell: ({ row: { original: e } }) => F("div", { class: "flex items-center gap-[10px] min-w-0" }, [
247
+ F(ge.FmAvatar, {
248
+ name: e.customerName || "?",
249
+ size: "sm"
250
+ }),
251
+ F("div", { class: "min-w-0" }, [
252
+ F(
253
+ "button",
254
+ {
255
+ type: "button",
256
+ class: "block max-w-full truncate text-left font-semibold focus-visible:outline-fm-color-primary",
257
+ onClick: (t) => {
258
+ t.stopPropagation(), H(e);
259
+ }
260
+ },
261
+ W(e)
262
+ ),
263
+ F(
264
+ "p",
265
+ { class: "text-[12px] text-fm-color-typo-tertiary truncate" },
266
+ e.phoneNumber || o("connect.whatsappBot.phoneUnavailable")
267
+ )
268
+ ])
269
+ ])
270
+ },
271
+ {
272
+ id: "account",
273
+ header: o("connect.whatsappBot.logs.account"),
274
+ accessorFn: (e) => L(e.clientId)
275
+ },
276
+ {
277
+ id: "lastMessage",
278
+ header: o("connect.whatsappBot.logs.lastMessage"),
279
+ cell: ({ row: e }) => F(
280
+ "p",
281
+ {
282
+ class: "truncate text-fm-color-typo-secondary",
283
+ title: O(e.original)
284
+ },
285
+ O(e.original)
286
+ ),
287
+ meta: { maxWidth: "400px" }
288
+ },
289
+ {
290
+ id: "lastActiveAt",
291
+ header: o("connect.whatsappBot.logs.lastActive"),
292
+ cell: ({ row: { original: e } }) => F("div", { class: "text-right tabular-nums" }, [
293
+ F(
294
+ "time",
295
+ { datetime: e.lastActiveAt },
296
+ oe.value.format(new Date(e.lastActiveAt))
297
+ ),
298
+ F(
299
+ "p",
300
+ { class: "text-[12px] text-fm-color-typo-tertiary" },
301
+ o("connect.whatsappBot.logs.messageCount", e.messageCount)
302
+ )
303
+ ]),
304
+ meta: { textAlign: "right" }
305
+ }
306
+ ]);
307
+ function le(e) {
308
+ v.value = v.value.includes(e) ? v.value.filter((t) => t !== e) : [...v.value, e];
309
+ }
310
+ function re(e) {
311
+ M.value = "";
312
+ const t = b.accounts.find(
313
+ (d) => d.clientId === e
314
+ );
315
+ if (!t) {
316
+ M.value = o("connect.whatsappBot.errors.accountNotFound");
317
+ return;
318
+ }
319
+ z.value = t, E.value = !0;
320
+ }
321
+ function Z() {
322
+ B == null || B.abort(), m.value = void 0, f.value = [], N.value = !1, i.value = "", M.value = "";
323
+ }
324
+ function H(e) {
325
+ m.value = e, M.value = "", V();
326
+ }
327
+ async function V() {
328
+ B == null || B.abort();
329
+ const e = new AbortController();
330
+ B = e, N.value = !0, i.value = "", f.value = [];
331
+ const t = m.value;
332
+ t || ($.value = []);
333
+ try {
334
+ if (!u.value)
335
+ throw new Error(o("connect.whatsappBot.errors.selectBusiness"));
336
+ if (t) {
337
+ const d = await Q.listConversationLogs(
338
+ u.value,
339
+ t.id,
340
+ e.signal
341
+ );
342
+ e.signal.aborted || (f.value = d);
343
+ } else {
344
+ const d = await Q.listConversations(
345
+ u.value,
346
+ v.value.length ? { clientIds: v.value.join(",") } : {},
347
+ e.signal
348
+ );
349
+ if (e.signal.aborted) return;
350
+ $.value = d, _.value = [
351
+ .../* @__PURE__ */ new Set([
352
+ ..._.value,
353
+ ...d.map((D) => D.clientId).filter((D) => D !== null)
354
+ ])
355
+ ];
356
+ }
357
+ } catch (d) {
358
+ e.signal.aborted || (i.value = d instanceof Error ? d.message : o(
359
+ t ? "connect.whatsappBot.logs.loadError" : "connect.whatsappBot.logs.conversationsLoadError"
360
+ ));
361
+ } finally {
362
+ e.signal.aborted || (N.value = !1);
363
+ }
364
+ }
365
+ return J(u, () => {
366
+ v.value = [], I.value = "", _.value = [], E.value = !1, z.value = void 0, M.value = "";
367
+ }), J(
368
+ [u, () => v.value.join(",")],
369
+ () => {
370
+ Z(), V();
371
+ },
372
+ { immediate: !0 }
373
+ ), xe(() => B == null ? void 0 : B.abort()), (e, t) => {
374
+ const d = y("FmButton"), D = y("FmAvatar"), ce = y("FmChip"), ie = y("FmSearch"), pe = y("FmMenuDivider"), U = y("FmMenuItem"), ue = y("FmMenu"), me = y("FmCircularProgress"), de = y("FmTable");
375
+ return n(), p(T, null, [
376
+ s("section", Ze, [
377
+ s("div", {
378
+ class: ee(["flex items-center gap-[12px] flex-wrap", m.value ? "max-w-[880px]" : ""])
379
+ }, [
380
+ m.value ? (n(), p(T, { key: 0 }, [
381
+ h(d, {
382
+ variant: "secondary",
383
+ icon: "chevron_left",
384
+ "aria-label": c(o)("connect.whatsappBot.logs.backToConversations"),
385
+ class: "!h-[36px] !w-[36px] !rounded-[8px] shrink-0",
386
+ onClick: Z
387
+ }, null, 8, ["aria-label"]),
388
+ h(D, {
389
+ name: m.value.customerName || "?",
390
+ size: "md"
391
+ }, null, 8, ["name"]),
392
+ s("div", He, [
393
+ s("h2", Je, l(W(m.value)), 1),
394
+ s("p", Ke, l(m.value.phoneNumber || c(o)("connect.whatsappBot.phoneUnavailable")) + " · " + l(c(o)("connect.whatsappBot.logs.via", {
395
+ name: L(m.value.clientId)
396
+ })), 1)
397
+ ])
398
+ ], 64)) : (n(), S(ue, {
399
+ key: 1,
400
+ "close-on-click": !1,
401
+ width: 280
402
+ }, {
403
+ "menu-button": K(() => [
404
+ h(ce, {
405
+ label: ne.value,
406
+ "right-icon": "keyboard_arrow_down",
407
+ class: "text-fm-color-typo-secondary cursor-pointer"
408
+ }, null, 8, ["label"])
409
+ ]),
410
+ default: K(() => [
411
+ h(ie, {
412
+ modelValue: I.value,
413
+ "onUpdate:modelValue": t[0] || (t[0] = (x) => I.value = x),
414
+ placeholder: c(o)("connect.whatsappBot.logs.searchAccounts")
415
+ }, null, 8, ["modelValue", "placeholder"]),
416
+ h(pe),
417
+ h(U, {
418
+ label: c(o)("connect.whatsappBot.logs.allAccounts"),
419
+ "model-value": !v.value.length,
420
+ "has-checkbox": "",
421
+ onClick: t[1] || (t[1] = (x) => v.value = [])
422
+ }, null, 8, ["label", "model-value"]),
423
+ s("div", Qe, [
424
+ (n(!0), p(T, null, G(P.value, (x) => (n(), S(U, {
425
+ key: x.clientId,
426
+ label: x.label,
427
+ "model-value": v.value.includes(x.clientId),
428
+ "has-checkbox": "",
429
+ onClick: (rt) => le(x.clientId)
430
+ }, null, 8, ["label", "model-value", "onClick"]))), 128)),
431
+ P.value.length ? k("", !0) : (n(), S(U, {
432
+ key: 0,
433
+ label: c(o)("connect.whatsappBot.logs.noMatchingAccounts"),
434
+ disabled: ""
435
+ }, null, 8, ["label"]))
436
+ ])
437
+ ]),
438
+ _: 1
439
+ })),
440
+ h(d, {
441
+ variant: "plain",
442
+ "prepend-icon": "refresh",
443
+ label: c(o)("connect.whatsappBot.logs.refresh"),
444
+ disabled: N.value,
445
+ class: "ml-auto",
446
+ onClick: t[2] || (t[2] = (x) => V())
447
+ }, null, 8, ["label", "disabled"])
448
+ ], 2),
449
+ M.value ? (n(), p("p", Xe, l(M.value), 1)) : k("", !0),
450
+ N.value ? (n(), p("output", qe, [
451
+ h(me),
452
+ te(" " + l(c(o)(
453
+ m.value ? "connect.whatsappBot.logs.loading" : "connect.whatsappBot.logs.conversationsLoading"
454
+ )), 1)
455
+ ])) : i.value ? (n(), p("div", et, [
456
+ s("p", tt, l(i.value), 1),
457
+ h(d, {
458
+ variant: "secondary",
459
+ "prepend-icon": "refresh",
460
+ label: c(o)("connect.whatsappBot.tryAgain"),
461
+ onClick: t[3] || (t[3] = (x) => V())
462
+ }, null, 8, ["label"])
463
+ ])) : (m.value ? !R.value.length : !$.value.length) ? (n(), p("div", ot, [
464
+ s("h2", at, l(c(o)(
465
+ m.value ? "connect.whatsappBot.logs.emptyTitle" : "connect.whatsappBot.logs.conversationsEmptyTitle"
466
+ )), 1),
467
+ s("p", nt, l(c(o)(
468
+ m.value ? "connect.whatsappBot.logs.emptyDescription" : "connect.whatsappBot.logs.conversationsEmptyDescription"
469
+ )), 1)
470
+ ])) : m.value ? (n(), p("div", st, [
471
+ (n(!0), p(T, null, G(R.value, (x) => (n(), S(Pe, {
472
+ key: x.date,
473
+ conversation: m.value,
474
+ group: x,
475
+ "account-name": L(m.value.clientId),
476
+ timezone: C.value,
477
+ "show-customer": !1,
478
+ onNotificationGroup: re
479
+ }, null, 8, ["conversation", "group", "account-name", "timezone"]))), 128))
480
+ ])) : k("", !0),
481
+ $.value.length ? ve((n(), p("div", lt, [
482
+ h(de, {
483
+ "aria-label": c(o)("connect.whatsappBot.logs.conversations"),
484
+ "row-data": $.value,
485
+ "column-defs": se.value,
486
+ "page-size": 10,
487
+ "hide-footer": $.value.length <= 10,
488
+ "shrink-at": !1,
489
+ "auto-reset-page-index": "",
490
+ "row-class-name": "cursor-pointer",
491
+ onRowClick: t[4] || (t[4] = (x) => H(x.original))
492
+ }, null, 8, ["aria-label", "row-data", "column-defs", "hide-footer"])
493
+ ], 512)), [
494
+ [fe, !m.value && !N.value && !i.value]
495
+ ]) : k("", !0)
496
+ ]),
497
+ z.value ? (n(), S(be, {
498
+ key: 0,
499
+ modelValue: E.value,
500
+ "onUpdate:modelValue": t[5] || (t[5] = (x) => E.value = x),
501
+ account: z.value
502
+ }, null, 8, ["modelValue", "account"])) : k("", !0)
503
+ ], 64);
504
+ };
505
+ }
506
+ });
507
+ export {
508
+ gt as default
509
+ };