@wealthx/shadcn 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +262 -226
- package/CHANGELOG.md +6 -0
- package/dist/{chunk-2UM72RJ7.mjs → chunk-2D3HQPFN.mjs} +12 -10
- package/dist/chunk-2EM2FRU6.mjs +613 -0
- package/dist/{chunk-FH6QVUVZ.mjs → chunk-2GIYVERS.mjs} +2 -2
- package/dist/chunk-2P7HP7LR.mjs +68 -0
- package/dist/{chunk-HISNT2MG.mjs → chunk-37AE3OM5.mjs} +5 -5
- package/dist/{chunk-HBZLGDIN.mjs → chunk-3ERBUVHC.mjs} +169 -110
- package/dist/{chunk-C7CQJNMR.mjs → chunk-3VDET466.mjs} +2 -2
- package/dist/{chunk-462HMNO4.mjs → chunk-4MM7LHM5.mjs} +2 -2
- package/dist/{chunk-QMY3AZJH.mjs → chunk-4Z66LMIQ.mjs} +2 -2
- package/dist/{chunk-U5X52X37.mjs → chunk-57ZXILTS.mjs} +6 -6
- package/dist/{chunk-3OYFOX3X.mjs → chunk-5VOTTIXF.mjs} +2 -2
- package/dist/{chunk-LBMRIB3G.mjs → chunk-6AJUS7VX.mjs} +1 -1
- package/dist/{chunk-OODBHKG7.mjs → chunk-6HIOM2HL.mjs} +7 -4
- package/dist/{chunk-BDYZCBRT.mjs → chunk-6QAFGZC2.mjs} +2 -2
- package/dist/{chunk-U4NDAF2P.mjs → chunk-6TX73WG7.mjs} +1 -1
- package/dist/{chunk-GD4BJDJR.mjs → chunk-7BTFGCFC.mjs} +4 -4
- package/dist/{chunk-FAKPBKLT.mjs → chunk-7GWRPXHD.mjs} +4 -4
- package/dist/{chunk-NMOI6CQD.mjs → chunk-7YI3HEBH.mjs} +5 -5
- package/dist/{chunk-T4BJLT57.mjs → chunk-AE7MASLF.mjs} +5 -5
- package/dist/{chunk-VLQZANBF.mjs → chunk-AFML43VJ.mjs} +6 -1
- package/dist/chunk-BBXSNDS3.mjs +260 -0
- package/dist/chunk-BOW7U26Y.mjs +203 -0
- package/dist/{chunk-34NWQURD.mjs → chunk-BS75ICOO.mjs} +2 -2
- package/dist/chunk-D2NSIIXG.mjs +394 -0
- package/dist/{chunk-3GF7OVTP.mjs → chunk-DGNHGNYH.mjs} +2 -2
- package/dist/{chunk-VLARHE5V.mjs → chunk-DMXYRCHM.mjs} +6 -6
- package/dist/{chunk-OGOYQ7BG.mjs → chunk-DQB4EPIS.mjs} +1 -1
- package/dist/{chunk-MIZQHHUO.mjs → chunk-FL6DZFJK.mjs} +106 -38
- package/dist/{chunk-I3RZS7V2.mjs → chunk-FLL633WS.mjs} +19 -33
- package/dist/{chunk-PBL4OQV2.mjs → chunk-FTPBQVQ6.mjs} +4 -4
- package/dist/chunk-FYPSTTEJ.mjs +169 -0
- package/dist/{chunk-6O6KD7CE.mjs → chunk-G27TSQLQ.mjs} +6 -6
- package/dist/{chunk-66MI7Q4B.mjs → chunk-GT3RU6GA.mjs} +2 -2
- package/dist/{chunk-D6ID6M4V.mjs → chunk-GTAVSBDO.mjs} +2 -2
- package/dist/{chunk-24FUO7TD.mjs → chunk-H6NQTIF4.mjs} +2 -2
- package/dist/{chunk-7DHU4VGG.mjs → chunk-HK4HUQTV.mjs} +2 -2
- package/dist/chunk-I4KVSZCH.mjs +101 -0
- package/dist/{chunk-RGVKLTLH.mjs → chunk-IKXYTCSB.mjs} +2 -2
- package/dist/{chunk-Y6DWJSKZ.mjs → chunk-ISUA7DSB.mjs} +1 -1
- package/dist/{chunk-2A5RRQGG.mjs → chunk-JD3YWRNP.mjs} +10 -14
- package/dist/{chunk-J5UICVJS.mjs → chunk-JPGL36WQ.mjs} +2 -2
- package/dist/{chunk-7XJHLGUV.mjs → chunk-JTK6VJXY.mjs} +2 -2
- package/dist/{chunk-7YAU5CY6.mjs → chunk-JVMXMFBB.mjs} +2 -2
- package/dist/{chunk-IAE3F7DR.mjs → chunk-JZY6TNIS.mjs} +21 -21
- package/dist/{chunk-K5A5L6T2.mjs → chunk-K4KOD3KR.mjs} +12 -12
- package/dist/{chunk-MBON7YRJ.mjs → chunk-K5QV4TT6.mjs} +3 -3
- package/dist/{chunk-IHMFS7NZ.mjs → chunk-K5VHK7CM.mjs} +21 -21
- package/dist/{chunk-RJI6GKVF.mjs → chunk-KCWNDYPZ.mjs} +5 -5
- package/dist/{chunk-UFYSFDER.mjs → chunk-KFH36NKF.mjs} +1 -1
- package/dist/{chunk-EBXQWIYG.mjs → chunk-KLTACJ2G.mjs} +5 -5
- package/dist/{chunk-3TTACBDP.mjs → chunk-KWD6GANL.mjs} +4 -4
- package/dist/{chunk-IOJRDS6V.mjs → chunk-L4NSRQ3T.mjs} +218 -147
- package/dist/{chunk-GYMYRIZP.mjs → chunk-LBTHZSBT.mjs} +2 -2
- package/dist/{chunk-AMQZRHEZ.mjs → chunk-LQULK2E3.mjs} +5 -5
- package/dist/{chunk-YJG55G2H.mjs → chunk-LR6LHDP3.mjs} +5 -5
- package/dist/{chunk-7PV3IWCN.mjs → chunk-M4VYX2PV.mjs} +19 -1
- package/dist/{chunk-P76HMUI6.mjs → chunk-MDUKXXIL.mjs} +2 -2
- package/dist/{chunk-LV35NGVG.mjs → chunk-N6Q5IPKT.mjs} +9 -9
- package/dist/{chunk-DOEO3CDL.mjs → chunk-NB3ZL36B.mjs} +1 -1
- package/dist/{chunk-XREGSKX3.mjs → chunk-NOOEKOWY.mjs} +5 -5
- package/dist/{chunk-NL3ZO62D.mjs → chunk-NT4FX27K.mjs} +1 -1
- package/dist/{chunk-QZ4RE6NA.mjs → chunk-NTYQWVLI.mjs} +6 -6
- package/dist/{chunk-ERGGHC2V.mjs → chunk-OEOOYMC2.mjs} +2 -2
- package/dist/{chunk-4GAWMKMI.mjs → chunk-OIKBW2QD.mjs} +291 -54
- package/dist/{chunk-DUJTAXMH.mjs → chunk-OKTJFDPN.mjs} +6 -6
- package/dist/chunk-OLKMCXAR.mjs +1219 -0
- package/dist/{chunk-EI5F6FMT.mjs → chunk-OWFQSXVD.mjs} +3 -3
- package/dist/{chunk-6DZEXFNB.mjs → chunk-P2N2PEFY.mjs} +3 -3
- package/dist/{chunk-NSLMILBT.mjs → chunk-P7CEBZM6.mjs} +2 -2
- package/dist/{chunk-7S5AESZO.mjs → chunk-PNRUH7JY.mjs} +6 -6
- package/dist/{chunk-ZU4NV6RG.mjs → chunk-PNSYFE3K.mjs} +2 -2
- package/dist/{chunk-JKGDCQTZ.mjs → chunk-QTRSCVQ3.mjs} +5 -5
- package/dist/{chunk-ABFDMHOR.mjs → chunk-QX7IFQSF.mjs} +5 -5
- package/dist/{chunk-CFMQP5QS.mjs → chunk-QXKGOMUX.mjs} +6 -6
- package/dist/{chunk-NQPOYKAQ.mjs → chunk-R2ON6CAN.mjs} +2 -2
- package/dist/{chunk-DBHJ5KC3.mjs → chunk-R4HCRDU5.mjs} +1 -1
- package/dist/{chunk-EWRB4PAD.mjs → chunk-RCAOCHWA.mjs} +14 -14
- package/dist/{chunk-EFRENWEJ.mjs → chunk-RSUIPKGX.mjs} +2 -2
- package/dist/{chunk-DGHAXJBN.mjs → chunk-S2FKV4M5.mjs} +5 -5
- package/dist/{chunk-RGU7HOEC.mjs → chunk-SET2ANTY.mjs} +5 -7
- package/dist/chunk-SFH2NJEJ.mjs +47 -0
- package/dist/{chunk-6AW4KJHE.mjs → chunk-SIVYAI3M.mjs} +12 -12
- package/dist/{chunk-5FQIKDKP.mjs → chunk-THVO2N47.mjs} +8 -8
- package/dist/{chunk-JMHR3YGZ.mjs → chunk-TLAWKTSA.mjs} +3 -3
- package/dist/{chunk-HVY6KCCF.mjs → chunk-TOWTPLRC.mjs} +68 -72
- package/dist/{chunk-6JQFUE5I.mjs → chunk-UALR6JGV.mjs} +2 -2
- package/dist/{chunk-N6TNTQL6.mjs → chunk-UJZ4UHWI.mjs} +9 -11
- package/dist/{chunk-MARPPFOJ.mjs → chunk-UNACI2YK.mjs} +2 -2
- package/dist/{chunk-3NCUZIFP.mjs → chunk-V6XGXYCJ.mjs} +7 -7
- package/dist/chunk-VB5M6OZQ.mjs +57 -0
- package/dist/{chunk-5IS7G74I.mjs → chunk-VY5NEUP7.mjs} +6 -6
- package/dist/{chunk-JHJHG4GO.mjs → chunk-WE4YKBDE.mjs} +2 -2
- package/dist/{chunk-BKNFWEH2.mjs → chunk-WL6WVV47.mjs} +3 -3
- package/dist/{chunk-FWCSY2DS.mjs → chunk-WNQUEZJF.mjs} +22 -1
- package/dist/{chunk-2Y7YJKPE.mjs → chunk-WZ6UJCBL.mjs} +1 -1
- package/dist/{chunk-UMTOX62O.mjs → chunk-XYPW2XA5.mjs} +13 -10
- package/dist/chunk-Y2MTAVAK.mjs +34 -0
- package/dist/{chunk-6CR5N2JW.mjs → chunk-YCWLFG27.mjs} +6 -6
- package/dist/{chunk-PU4YZQXV.mjs → chunk-YE67AALL.mjs} +12 -12
- package/dist/{chunk-M3FV7LOK.mjs → chunk-YEWNFK5S.mjs} +6 -1
- package/dist/{chunk-R3VSPKNP.mjs → chunk-YIZHS72Z.mjs} +11 -12
- package/dist/{chunk-7PYJD5JI.mjs → chunk-ZEDMKQK2.mjs} +2 -2
- package/dist/{chunk-N2PT566P.mjs → chunk-ZFCDYW6N.mjs} +4 -4
- package/dist/chunk-ZGQIVGIN.mjs +57 -0
- package/dist/{chunk-Q2BGOAMG.mjs → chunk-ZKWXDQDG.mjs} +4 -4
- package/dist/{chunk-GHC7LLUX.mjs → chunk-ZOWL2L5J.mjs} +5 -5
- package/dist/components/ui/accordion.mjs +3 -3
- package/dist/components/ui/add-column-modal.js +2 -2
- package/dist/components/ui/add-column-modal.mjs +10 -10
- package/dist/components/ui/add-lead-modal.js +424 -82
- package/dist/components/ui/add-lead-modal.mjs +12 -9
- package/dist/components/ui/advisor-card.js +2 -2
- package/dist/components/ui/advisor-card.mjs +8 -8
- package/dist/components/ui/ai-assistant-drawer.js +2 -2
- package/dist/components/ui/ai-assistant-drawer.mjs +9 -9
- package/dist/components/ui/ai-builder.js +958 -0
- package/dist/components/ui/ai-builder.mjs +25 -0
- package/dist/components/ui/ai-conversations.js +2045 -0
- package/dist/components/ui/ai-conversations.mjs +41 -0
- package/dist/components/ui/alert-dialog.js +2 -2
- package/dist/components/ui/alert-dialog.mjs +5 -5
- package/dist/components/ui/alert.mjs +3 -3
- package/dist/components/ui/appointment-action-dialogs.js +19 -3
- package/dist/components/ui/appointment-action-dialogs.mjs +15 -14
- package/dist/components/ui/appointment-availability-settings.js +181 -111
- package/dist/components/ui/appointment-availability-settings.mjs +20 -18
- package/dist/components/ui/appointment-book-dialog.js +113 -24
- package/dist/components/ui/appointment-book-dialog.mjs +21 -20
- package/dist/components/ui/appointment-calendar-view.js +19 -3
- package/dist/components/ui/appointment-calendar-view.mjs +10 -9
- package/dist/components/ui/appointment-detail-sheet.js +19 -3
- package/dist/components/ui/appointment-detail-sheet.mjs +18 -17
- package/dist/components/ui/appointment-gmail-connect.js +49 -89
- package/dist/components/ui/appointment-gmail-connect.mjs +8 -9
- package/dist/components/ui/appointment-mini-card.js +2 -2
- package/dist/components/ui/appointment-mini-card.mjs +6 -6
- package/dist/components/ui/appointment-time-slot-picker.mjs +6 -6
- package/dist/components/ui/appointment-upcoming-card.js +19 -3
- package/dist/components/ui/appointment-upcoming-card.mjs +15 -14
- package/dist/components/ui/auth-logo.js +95 -0
- package/dist/components/ui/auth-logo.mjs +8 -0
- package/dist/components/ui/auth-page-layout.js +108 -0
- package/dist/components/ui/auth-page-layout.mjs +8 -0
- package/dist/components/ui/avatar.mjs +3 -3
- package/dist/components/ui/backoffice-alert-history-chart.js +2 -2
- package/dist/components/ui/backoffice-alert-history-chart.mjs +9 -9
- package/dist/components/ui/backoffice-alerts-chart.js +2 -2
- package/dist/components/ui/backoffice-alerts-chart.mjs +11 -11
- package/dist/components/ui/backoffice-connections-chart.js +2 -2
- package/dist/components/ui/backoffice-connections-chart.mjs +11 -11
- package/dist/components/ui/backoffice-contact-history-chart.js +2 -2
- package/dist/components/ui/backoffice-contact-history-chart.mjs +9 -9
- package/dist/components/ui/badge.mjs +4 -4
- package/dist/components/ui/borrowing-capacity-line-chart.js +145 -132
- package/dist/components/ui/borrowing-capacity-line-chart.mjs +9 -9
- package/dist/components/ui/button.js +2 -2
- package/dist/components/ui/button.mjs +4 -4
- package/dist/components/ui/calendar.js +17 -3
- package/dist/components/ui/calendar.mjs +6 -5
- package/dist/components/ui/card.mjs +3 -3
- package/dist/components/ui/cash-balance-line-chart.js +157 -152
- package/dist/components/ui/cash-balance-line-chart.mjs +9 -9
- package/dist/components/ui/cashflow-bar-chart.js +2 -2
- package/dist/components/ui/cashflow-bar-chart.mjs +9 -9
- package/dist/components/ui/chat-widget-primitives.js +573 -0
- package/dist/components/ui/chat-widget-primitives.mjs +21 -0
- package/dist/components/ui/chat-widget.js +1268 -0
- package/dist/components/ui/chat-widget.mjs +29 -0
- package/dist/components/ui/checkbox.mjs +3 -3
- package/dist/components/ui/chip.js +2 -2
- package/dist/components/ui/chip.mjs +6 -6
- package/dist/components/ui/color-picker.js +2 -2
- package/dist/components/ui/color-picker.mjs +7 -7
- package/dist/components/ui/combobox.mjs +3 -3
- package/dist/components/ui/data-table.js +2 -2
- package/dist/components/ui/data-table.mjs +12 -12
- package/dist/components/ui/date-picker.js +22 -6
- package/dist/components/ui/date-picker.mjs +9 -8
- package/dist/components/ui/dialog.js +2 -2
- package/dist/components/ui/dialog.mjs +5 -5
- package/dist/components/ui/document-checklist-template.js +630 -0
- package/dist/components/ui/document-checklist-template.mjs +15 -0
- package/dist/components/ui/drawer.js +2 -2
- package/dist/components/ui/drawer.mjs +3 -3
- package/dist/components/ui/dropdown-menu.mjs +3 -3
- package/dist/components/ui/empty.mjs +3 -3
- package/dist/components/ui/expense-bar-chart.js +2 -2
- package/dist/components/ui/expense-bar-chart.mjs +9 -9
- package/dist/components/ui/field.mjs +5 -5
- package/dist/components/ui/financial-cards.js +431 -291
- package/dist/components/ui/financial-cards.mjs +10 -9
- package/dist/components/ui/financial-drawers.js +4 -4
- package/dist/components/ui/financial-drawers.mjs +8 -8
- package/dist/components/ui/financial-primitives.mjs +3 -3
- package/dist/components/ui/financial-sections.js +8 -9
- package/dist/components/ui/financial-sections.mjs +12 -12
- package/dist/components/ui/form-primitives.mjs +8 -8
- package/dist/components/ui/income-bar-chart.js +2 -2
- package/dist/components/ui/income-bar-chart.mjs +9 -9
- package/dist/components/ui/input-group.js +2 -2
- package/dist/components/ui/input-group.mjs +7 -7
- package/dist/components/ui/input-otp.mjs +3 -3
- package/dist/components/ui/input.mjs +3 -3
- package/dist/components/ui/kanban-column.js +19 -23
- package/dist/components/ui/kanban-column.mjs +14 -14
- package/dist/components/ui/label.mjs +3 -3
- package/dist/components/ui/onboarding-layout.js +476 -0
- package/dist/components/ui/onboarding-layout.mjs +11 -0
- package/dist/components/ui/opportunity-card.js +2 -2
- package/dist/components/ui/opportunity-card.mjs +12 -12
- package/dist/components/ui/opportunity-edit-modals.js +22 -6
- package/dist/components/ui/opportunity-edit-modals.mjs +21 -20
- package/dist/components/ui/opportunity-summary-tab.js +991 -674
- package/dist/components/ui/opportunity-summary-tab.mjs +26 -26
- package/dist/components/ui/page-header.mjs +3 -3
- package/dist/components/ui/page-top-bar.mjs +3 -3
- package/dist/components/ui/pagination.js +2 -2
- package/dist/components/ui/pagination.mjs +6 -6
- package/dist/components/ui/password-strength-tooltip.js +197 -0
- package/dist/components/ui/password-strength-tooltip.mjs +11 -0
- package/dist/components/ui/pipeline-alerts.mjs +3 -3
- package/dist/components/ui/pipeline-board.js +19 -23
- package/dist/components/ui/pipeline-board.mjs +18 -18
- package/dist/components/ui/pipeline-chart.js +12 -6
- package/dist/components/ui/pipeline-chart.mjs +4 -3
- package/dist/components/ui/pipeline-dialogs.js +28 -12
- package/dist/components/ui/pipeline-dialogs.mjs +14 -13
- package/dist/components/ui/pipeline-primitives.mjs +6 -6
- package/dist/components/ui/popover.mjs +3 -3
- package/dist/components/ui/progress.mjs +3 -3
- package/dist/components/ui/property-cashflow-doughnut-chart.js +2 -2
- package/dist/components/ui/property-cashflow-doughnut-chart.mjs +9 -9
- package/dist/components/ui/property-debt-equity-doughnut-chart.js +2 -2
- package/dist/components/ui/property-debt-equity-doughnut-chart.mjs +9 -9
- package/dist/components/ui/property-mobile-estimate-line-chart.js +2 -2
- package/dist/components/ui/property-mobile-estimate-line-chart.mjs +9 -9
- package/dist/components/ui/radio-group.mjs +3 -3
- package/dist/components/ui/select.mjs +3 -3
- package/dist/components/ui/separator.mjs +3 -3
- package/dist/components/ui/sheet.mjs +3 -3
- package/dist/components/ui/sidebar-nav.js +6 -5
- package/dist/components/ui/sidebar-nav.mjs +7 -7
- package/dist/components/ui/skeleton.mjs +3 -3
- package/dist/components/ui/slider.mjs +3 -3
- package/dist/components/ui/sonner.mjs +2 -2
- package/dist/components/ui/spinner.mjs +3 -3
- package/dist/components/ui/stage-timeline.mjs +10 -10
- package/dist/components/ui/stepper.mjs +3 -3
- package/dist/components/ui/switch.mjs +3 -3
- package/dist/components/ui/table.mjs +3 -3
- package/dist/components/ui/tabs.mjs +3 -3
- package/dist/components/ui/textarea.mjs +3 -3
- package/dist/components/ui/toggle-group.mjs +4 -4
- package/dist/components/ui/toggle.mjs +3 -3
- package/dist/components/ui/tooltip.mjs +3 -3
- package/dist/components/ui/transactions-expense-categories-doughnut-chart.js +2 -2
- package/dist/components/ui/transactions-expense-categories-doughnut-chart.mjs +9 -9
- package/dist/components/ui/transactions-income-expense-bar-chart.js +2 -2
- package/dist/components/ui/transactions-income-expense-bar-chart.mjs +9 -9
- package/dist/components/ui/transactions-liabilities-breakdown-doughnut-chart.js +2 -2
- package/dist/components/ui/transactions-liabilities-breakdown-doughnut-chart.mjs +9 -9
- package/dist/components/ui/two-fa-setup-form.js +612 -0
- package/dist/components/ui/two-fa-setup-form.mjs +16 -0
- package/dist/components/ui/upload-card.js +187 -0
- package/dist/components/ui/upload-card.mjs +10 -0
- package/dist/components/ui/video-background.js +118 -0
- package/dist/components/ui/video-background.mjs +8 -0
- package/dist/index.js +12764 -9396
- package/dist/index.mjs +341 -245
- package/dist/lib/colors.mjs +1 -1
- package/dist/lib/theme-provider.mjs +1 -1
- package/dist/lib/typography.mjs +2 -2
- package/dist/lib/utils.js +8 -2
- package/dist/lib/utils.mjs +6 -4
- package/dist/styles.css +1 -1
- package/package.json +61 -1
- package/src/components/index.tsx +126 -1
- package/src/components/ui/add-lead-modal.tsx +101 -142
- package/src/components/ui/ai-builder.tsx +560 -0
- package/src/components/ui/ai-conversations.tsx +1690 -0
- package/src/components/ui/appointment-availability-settings.tsx +152 -101
- package/src/components/ui/appointment-book-dialog.tsx +138 -24
- package/src/components/ui/appointment-calendar-view.tsx +2 -3
- package/src/components/ui/appointment-gmail-connect.tsx +23 -42
- package/src/components/ui/auth-logo.tsx +50 -0
- package/src/components/ui/auth-page-layout.tsx +59 -0
- package/src/components/ui/borrowing-capacity-line-chart.tsx +10 -8
- package/src/components/ui/button.tsx +2 -2
- package/src/components/ui/calendar.tsx +2 -1
- package/src/components/ui/cash-balance-line-chart.tsx +10 -14
- package/src/components/ui/chart-shared.tsx +10 -0
- package/src/components/ui/chat-widget-primitives.tsx +336 -0
- package/src/components/ui/chat-widget.tsx +822 -0
- package/src/components/ui/document-checklist-template.tsx +264 -0
- package/src/components/ui/drawer.tsx +2 -2
- package/src/components/ui/financial-cards.tsx +176 -78
- package/src/components/ui/financial-drawers.tsx +2 -2
- package/src/components/ui/financial-sections.tsx +1 -1
- package/src/components/ui/kanban-column.tsx +2 -5
- package/src/components/ui/onboarding-layout.tsx +109 -0
- package/src/components/ui/opportunity-summary-tab.tsx +469 -142
- package/src/components/ui/password-strength-tooltip.tsx +70 -0
- package/src/components/ui/pipeline-chart.tsx +2 -6
- package/src/components/ui/sidebar-nav.tsx +1 -11
- package/src/components/ui/two-fa-setup-form.tsx +229 -0
- package/src/components/ui/upload-card.tsx +98 -0
- package/src/components/ui/video-background.tsx +55 -0
- package/src/lib/format-date.ts +26 -0
- package/src/lib/utils.ts +11 -0
- package/src/styles/styles-css.ts +1 -1
- package/tsup.config.ts +13 -0
|
@@ -0,0 +1,1219 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tooltip,
|
|
3
|
+
TooltipContent,
|
|
4
|
+
TooltipProvider,
|
|
5
|
+
TooltipTrigger
|
|
6
|
+
} from "./chunk-UALR6JGV.mjs";
|
|
7
|
+
import {
|
|
8
|
+
DropdownMenu,
|
|
9
|
+
DropdownMenuContent,
|
|
10
|
+
DropdownMenuItem,
|
|
11
|
+
DropdownMenuSeparator,
|
|
12
|
+
DropdownMenuTrigger
|
|
13
|
+
} from "./chunk-RSUIPKGX.mjs";
|
|
14
|
+
import {
|
|
15
|
+
ToggleGroup,
|
|
16
|
+
ToggleGroupItem
|
|
17
|
+
} from "./chunk-OWFQSXVD.mjs";
|
|
18
|
+
import {
|
|
19
|
+
Avatar,
|
|
20
|
+
AvatarFallback
|
|
21
|
+
} from "./chunk-H6NQTIF4.mjs";
|
|
22
|
+
import {
|
|
23
|
+
Textarea
|
|
24
|
+
} from "./chunk-BS75ICOO.mjs";
|
|
25
|
+
import {
|
|
26
|
+
Badge
|
|
27
|
+
} from "./chunk-WL6WVV47.mjs";
|
|
28
|
+
import {
|
|
29
|
+
Tabs,
|
|
30
|
+
TabsList,
|
|
31
|
+
TabsTrigger
|
|
32
|
+
} from "./chunk-WE4YKBDE.mjs";
|
|
33
|
+
import {
|
|
34
|
+
Separator
|
|
35
|
+
} from "./chunk-2GIYVERS.mjs";
|
|
36
|
+
import {
|
|
37
|
+
Input
|
|
38
|
+
} from "./chunk-LBTHZSBT.mjs";
|
|
39
|
+
import {
|
|
40
|
+
Dialog,
|
|
41
|
+
DialogContent,
|
|
42
|
+
DialogDescription,
|
|
43
|
+
DialogFooter,
|
|
44
|
+
DialogHeader,
|
|
45
|
+
DialogTitle
|
|
46
|
+
} from "./chunk-P2N2PEFY.mjs";
|
|
47
|
+
import {
|
|
48
|
+
Button,
|
|
49
|
+
buttonVariants
|
|
50
|
+
} from "./chunk-NOOEKOWY.mjs";
|
|
51
|
+
import {
|
|
52
|
+
cn,
|
|
53
|
+
getInitials
|
|
54
|
+
} from "./chunk-AFML43VJ.mjs";
|
|
55
|
+
|
|
56
|
+
// src/components/ui/ai-conversations.tsx
|
|
57
|
+
import { useState } from "react";
|
|
58
|
+
import {
|
|
59
|
+
Archive,
|
|
60
|
+
ArrowLeft,
|
|
61
|
+
Bot,
|
|
62
|
+
Briefcase,
|
|
63
|
+
Calendar,
|
|
64
|
+
CheckCircle2,
|
|
65
|
+
ChevronLeft,
|
|
66
|
+
ChevronRight,
|
|
67
|
+
Flag,
|
|
68
|
+
HelpCircle,
|
|
69
|
+
Lock,
|
|
70
|
+
Mail,
|
|
71
|
+
MapPin,
|
|
72
|
+
MessageSquare,
|
|
73
|
+
MoreHorizontal,
|
|
74
|
+
Phone,
|
|
75
|
+
PhoneCall,
|
|
76
|
+
Plus,
|
|
77
|
+
Search,
|
|
78
|
+
Send,
|
|
79
|
+
UserCheck,
|
|
80
|
+
UserPlus,
|
|
81
|
+
Video
|
|
82
|
+
} from "lucide-react";
|
|
83
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
84
|
+
function displayContactName(name) {
|
|
85
|
+
return name.trim() || "Website User";
|
|
86
|
+
}
|
|
87
|
+
var PANEL_HEADER_HEIGHT = "h-[94px]";
|
|
88
|
+
var APPOINTMENT_STATUS_LABEL = {
|
|
89
|
+
requested: "Lead requested",
|
|
90
|
+
confirmed: "Confirmed",
|
|
91
|
+
pending: "Pending confirmation",
|
|
92
|
+
cancelled: "Cancelled"
|
|
93
|
+
};
|
|
94
|
+
var STATUS_CONFIG = {
|
|
95
|
+
"ai-active": {
|
|
96
|
+
label: "AI Active",
|
|
97
|
+
variant: "success",
|
|
98
|
+
dotClass: "bg-success"
|
|
99
|
+
},
|
|
100
|
+
manual: {
|
|
101
|
+
label: "Manual",
|
|
102
|
+
variant: "default",
|
|
103
|
+
dotClass: "bg-primary"
|
|
104
|
+
},
|
|
105
|
+
"needs-attention": {
|
|
106
|
+
label: "Needs Attention",
|
|
107
|
+
variant: "warning",
|
|
108
|
+
dotClass: "bg-warning"
|
|
109
|
+
},
|
|
110
|
+
closed: {
|
|
111
|
+
label: "Closed",
|
|
112
|
+
variant: "secondary",
|
|
113
|
+
dotClass: "bg-muted-foreground/50"
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
function ConversationStatusChip({
|
|
117
|
+
status,
|
|
118
|
+
showDot = false,
|
|
119
|
+
className
|
|
120
|
+
}) {
|
|
121
|
+
const { label, variant, dotClass } = STATUS_CONFIG[status];
|
|
122
|
+
return /* @__PURE__ */ jsxs(Badge, { variant, className, children: [
|
|
123
|
+
showDot && /* @__PURE__ */ jsx("span", { className: cn("size-1.5 shrink-0 rounded-full", dotClass) }),
|
|
124
|
+
label
|
|
125
|
+
] });
|
|
126
|
+
}
|
|
127
|
+
function ContactAvatar({ name, size = "md", className }) {
|
|
128
|
+
const avatarSize = size === "sm" ? "sm" : size === "lg" ? "lg" : "default";
|
|
129
|
+
return /* @__PURE__ */ jsx(Avatar, { size: avatarSize, className, children: /* @__PURE__ */ jsx(AvatarFallback, { className: "font-semibold", children: getInitials(name) }) });
|
|
130
|
+
}
|
|
131
|
+
function ConversationListItem({
|
|
132
|
+
data,
|
|
133
|
+
isActive,
|
|
134
|
+
onClick,
|
|
135
|
+
onRead
|
|
136
|
+
}) {
|
|
137
|
+
return /* @__PURE__ */ jsxs(
|
|
138
|
+
"button",
|
|
139
|
+
{
|
|
140
|
+
type: "button",
|
|
141
|
+
onClick: () => {
|
|
142
|
+
onClick == null ? void 0 : onClick(data.id);
|
|
143
|
+
onRead == null ? void 0 : onRead(data.id);
|
|
144
|
+
},
|
|
145
|
+
className: cn(
|
|
146
|
+
"w-full flex items-start gap-3 px-3 py-3 text-left transition-colors",
|
|
147
|
+
"border-b border-border last:border-b-0",
|
|
148
|
+
isActive ? "bg-muted" : "hover:bg-muted/40"
|
|
149
|
+
),
|
|
150
|
+
children: [
|
|
151
|
+
/* @__PURE__ */ jsx(ContactAvatar, { name: data.contact.name }),
|
|
152
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
153
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-1 flex items-center justify-between gap-2", children: [
|
|
154
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-sm font-semibold text-foreground", children: displayContactName(data.contact.name) }),
|
|
155
|
+
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
156
|
+
data.status === "needs-attention" && /* @__PURE__ */ jsx(Flag, { className: "size-3 text-warning-text" }),
|
|
157
|
+
/* @__PURE__ */ jsx("span", { className: "whitespace-nowrap text-xs text-muted-foreground", children: data.timestamp })
|
|
158
|
+
] })
|
|
159
|
+
] }),
|
|
160
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-1.5 flex items-center justify-between gap-2", children: [
|
|
161
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
162
|
+
/* @__PURE__ */ jsx(ConversationStatusChip, { status: data.status, showDot: true }),
|
|
163
|
+
data.assignedTo && /* @__PURE__ */ jsxs("span", { className: "truncate text-xs text-muted-foreground", children: [
|
|
164
|
+
"\u2192 ",
|
|
165
|
+
data.assignedTo
|
|
166
|
+
] })
|
|
167
|
+
] }),
|
|
168
|
+
data.unreadCount ? /* @__PURE__ */ jsx(
|
|
169
|
+
Badge,
|
|
170
|
+
{
|
|
171
|
+
variant: "default",
|
|
172
|
+
className: "size-4 shrink-0 justify-center px-0 text-[10px]",
|
|
173
|
+
children: data.unreadCount
|
|
174
|
+
}
|
|
175
|
+
) : null
|
|
176
|
+
] }),
|
|
177
|
+
/* @__PURE__ */ jsxs("p", { className: "line-clamp-2 text-sm leading-relaxed text-muted-foreground", children: [
|
|
178
|
+
data.lastMessageRole === "bot" ? /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground/60", children: "AI: " }) : data.lastMessageRole === "advisor" ? /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground/60", children: "You: " }) : data.lastMessageRole === "visitor" ? /* @__PURE__ */ jsxs("span", { className: "font-medium text-foreground/60", children: [
|
|
179
|
+
displayContactName(data.contact.name).split(" ")[0],
|
|
180
|
+
":",
|
|
181
|
+
" "
|
|
182
|
+
] }) : null,
|
|
183
|
+
data.lastMessage
|
|
184
|
+
] })
|
|
185
|
+
] })
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
function filterConversations(conversations, query, filter) {
|
|
191
|
+
const q = query.toLowerCase();
|
|
192
|
+
return conversations.filter((c) => {
|
|
193
|
+
const matchesFilter = filter === "all" || (filter === "open" ? c.status !== "closed" : c.status === filter);
|
|
194
|
+
const matchesSearch = !q || c.contact.name.toLowerCase().includes(q) || c.lastMessage.toLowerCase().includes(q);
|
|
195
|
+
return matchesFilter && matchesSearch;
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
var FILTER_TABS = [
|
|
199
|
+
{ id: "all", label: "All" },
|
|
200
|
+
{ id: "open", label: "Open" },
|
|
201
|
+
{ id: "ai-active", label: "AI Active" },
|
|
202
|
+
{ id: "needs-attention", label: "Urgent" },
|
|
203
|
+
{ id: "closed", label: "Archived" }
|
|
204
|
+
];
|
|
205
|
+
function ConversationList({
|
|
206
|
+
conversations,
|
|
207
|
+
activeId,
|
|
208
|
+
searchQuery = "",
|
|
209
|
+
activeFilter = "all",
|
|
210
|
+
hasMore,
|
|
211
|
+
isLoadingMore,
|
|
212
|
+
onSearchChange,
|
|
213
|
+
onFilterChange,
|
|
214
|
+
onSelect,
|
|
215
|
+
onRead,
|
|
216
|
+
onLoadMore,
|
|
217
|
+
className
|
|
218
|
+
}) {
|
|
219
|
+
return /* @__PURE__ */ jsxs(
|
|
220
|
+
"div",
|
|
221
|
+
{
|
|
222
|
+
className: cn(
|
|
223
|
+
"flex flex-col border-r border-border bg-background",
|
|
224
|
+
className
|
|
225
|
+
),
|
|
226
|
+
children: [
|
|
227
|
+
/* @__PURE__ */ jsxs("div", { className: cn(PANEL_HEADER_HEIGHT, "flex shrink-0 flex-col"), children: [
|
|
228
|
+
/* @__PURE__ */ jsx("div", { className: "border-b border-border p-3 shrink-0", children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
229
|
+
/* @__PURE__ */ jsx(Search, { className: "absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
230
|
+
/* @__PURE__ */ jsx(
|
|
231
|
+
Input,
|
|
232
|
+
{
|
|
233
|
+
value: searchQuery,
|
|
234
|
+
onChange: (e) => onSearchChange == null ? void 0 : onSearchChange(e.target.value),
|
|
235
|
+
placeholder: "Search conversations...",
|
|
236
|
+
className: "h-8 pl-8 text-sm"
|
|
237
|
+
}
|
|
238
|
+
)
|
|
239
|
+
] }) }),
|
|
240
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center border-b border-border", children: /* @__PURE__ */ jsx(
|
|
241
|
+
Tabs,
|
|
242
|
+
{
|
|
243
|
+
value: activeFilter,
|
|
244
|
+
onValueChange: (v) => v && (onFilterChange == null ? void 0 : onFilterChange(v)),
|
|
245
|
+
className: "w-full",
|
|
246
|
+
children: /* @__PURE__ */ jsx(
|
|
247
|
+
TabsList,
|
|
248
|
+
{
|
|
249
|
+
variant: "line",
|
|
250
|
+
className: "w-full justify-start gap-0 h-auto",
|
|
251
|
+
children: FILTER_TABS.map((tab) => /* @__PURE__ */ jsx(
|
|
252
|
+
TabsTrigger,
|
|
253
|
+
{
|
|
254
|
+
value: tab.id,
|
|
255
|
+
className: "flex-none px-3 py-2 text-xs",
|
|
256
|
+
children: tab.label
|
|
257
|
+
},
|
|
258
|
+
tab.id
|
|
259
|
+
))
|
|
260
|
+
}
|
|
261
|
+
)
|
|
262
|
+
}
|
|
263
|
+
) })
|
|
264
|
+
] }),
|
|
265
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto", tabIndex: 0, children: (() => {
|
|
266
|
+
const filtered = filterConversations(
|
|
267
|
+
conversations,
|
|
268
|
+
searchQuery,
|
|
269
|
+
activeFilter
|
|
270
|
+
);
|
|
271
|
+
return filtered.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center gap-2 p-8 text-muted-foreground", children: [
|
|
272
|
+
/* @__PURE__ */ jsx(MessageSquare, { className: "size-8 opacity-30" }),
|
|
273
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm", children: "No conversations" }),
|
|
274
|
+
searchQuery && /* @__PURE__ */ jsx(
|
|
275
|
+
Button,
|
|
276
|
+
{
|
|
277
|
+
variant: "outline",
|
|
278
|
+
size: "sm",
|
|
279
|
+
onClick: () => onSearchChange == null ? void 0 : onSearchChange(""),
|
|
280
|
+
children: "Clear search"
|
|
281
|
+
}
|
|
282
|
+
),
|
|
283
|
+
!searchQuery && activeFilter !== "all" && /* @__PURE__ */ jsx(
|
|
284
|
+
Button,
|
|
285
|
+
{
|
|
286
|
+
variant: "outline",
|
|
287
|
+
size: "sm",
|
|
288
|
+
onClick: () => onFilterChange == null ? void 0 : onFilterChange("all"),
|
|
289
|
+
children: "Clear filter"
|
|
290
|
+
}
|
|
291
|
+
)
|
|
292
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
293
|
+
filtered.map((item) => /* @__PURE__ */ jsx(
|
|
294
|
+
ConversationListItem,
|
|
295
|
+
{
|
|
296
|
+
data: item,
|
|
297
|
+
isActive: activeId === item.id,
|
|
298
|
+
onClick: onSelect,
|
|
299
|
+
onRead
|
|
300
|
+
},
|
|
301
|
+
item.id
|
|
302
|
+
)),
|
|
303
|
+
hasMore && /* @__PURE__ */ jsx("div", { className: "border-t border-border p-3", children: /* @__PURE__ */ jsx(
|
|
304
|
+
Button,
|
|
305
|
+
{
|
|
306
|
+
variant: "outline",
|
|
307
|
+
size: "sm",
|
|
308
|
+
className: "w-full",
|
|
309
|
+
disabled: isLoadingMore,
|
|
310
|
+
onClick: onLoadMore,
|
|
311
|
+
children: isLoadingMore ? "Loading..." : "Load more"
|
|
312
|
+
}
|
|
313
|
+
) })
|
|
314
|
+
] });
|
|
315
|
+
})() })
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
function BubbleAvatar({
|
|
321
|
+
role,
|
|
322
|
+
senderName
|
|
323
|
+
}) {
|
|
324
|
+
if (role === "bot") {
|
|
325
|
+
return /* @__PURE__ */ jsx(Avatar, { size: "sm", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "border border-border bg-muted", children: /* @__PURE__ */ jsx(Bot, { className: "size-3.5 text-muted-foreground" }) }) });
|
|
326
|
+
}
|
|
327
|
+
if (role === "advisor") {
|
|
328
|
+
return /* @__PURE__ */ jsx(Avatar, { size: "sm", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "font-semibold", children: getInitials(senderName != null ? senderName : "Advisor") }) });
|
|
329
|
+
}
|
|
330
|
+
return /* @__PURE__ */ jsx(Avatar, { size: "sm", children: /* @__PURE__ */ jsx(AvatarFallback, { children: getInitials(senderName != null ? senderName : "?") }) });
|
|
331
|
+
}
|
|
332
|
+
function ChatBubble({ message, className }) {
|
|
333
|
+
const { role, content, timestamp, senderName } = message;
|
|
334
|
+
if (role === "system") {
|
|
335
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("my-2 flex items-center gap-3 px-2", className), children: [
|
|
336
|
+
/* @__PURE__ */ jsx(Separator, { className: "flex-1" }),
|
|
337
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 text-caption text-muted-foreground", children: content }),
|
|
338
|
+
/* @__PURE__ */ jsx(Separator, { className: "flex-1" })
|
|
339
|
+
] });
|
|
340
|
+
}
|
|
341
|
+
const isAdvisor = role === "advisor";
|
|
342
|
+
const isBot = role === "bot";
|
|
343
|
+
const isVisitor = role === "visitor";
|
|
344
|
+
const displayName = isBot ? "AI Assistant" : isAdvisor ? senderName != null ? senderName : "Advisor" : senderName != null ? senderName : "Lead";
|
|
345
|
+
return /* @__PURE__ */ jsxs(
|
|
346
|
+
"div",
|
|
347
|
+
{
|
|
348
|
+
className: cn(
|
|
349
|
+
"flex gap-2.5",
|
|
350
|
+
isAdvisor ? "flex-row-reverse" : "flex-row",
|
|
351
|
+
className
|
|
352
|
+
),
|
|
353
|
+
children: [
|
|
354
|
+
/* @__PURE__ */ jsx(BubbleAvatar, { role, senderName }),
|
|
355
|
+
/* @__PURE__ */ jsxs(
|
|
356
|
+
"div",
|
|
357
|
+
{
|
|
358
|
+
className: cn(
|
|
359
|
+
"flex max-w-[70%] flex-col gap-1",
|
|
360
|
+
isAdvisor && "items-end"
|
|
361
|
+
),
|
|
362
|
+
children: [
|
|
363
|
+
/* @__PURE__ */ jsx("span", { className: "text-caption text-muted-foreground", children: displayName }),
|
|
364
|
+
/* @__PURE__ */ jsx(
|
|
365
|
+
"div",
|
|
366
|
+
{
|
|
367
|
+
className: cn(
|
|
368
|
+
"px-3 py-2 text-sm leading-relaxed",
|
|
369
|
+
isBot && "border border-border bg-muted/60 text-foreground",
|
|
370
|
+
isVisitor && "border border-border bg-background text-foreground",
|
|
371
|
+
isAdvisor && "bg-primary text-primary-foreground"
|
|
372
|
+
),
|
|
373
|
+
children: content
|
|
374
|
+
}
|
|
375
|
+
),
|
|
376
|
+
timestamp && /* @__PURE__ */ jsx("span", { className: "text-caption text-muted-foreground", children: timestamp })
|
|
377
|
+
]
|
|
378
|
+
}
|
|
379
|
+
)
|
|
380
|
+
]
|
|
381
|
+
}
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
function ChatComposer({
|
|
385
|
+
mode,
|
|
386
|
+
inputValue = "",
|
|
387
|
+
onInputChange,
|
|
388
|
+
onSend,
|
|
389
|
+
onTakeOver,
|
|
390
|
+
onLetAiHandle,
|
|
391
|
+
className
|
|
392
|
+
}) {
|
|
393
|
+
if (mode === "ai") {
|
|
394
|
+
return /* @__PURE__ */ jsxs(
|
|
395
|
+
"div",
|
|
396
|
+
{
|
|
397
|
+
className: cn(
|
|
398
|
+
"flex items-center gap-2 border-t border-border bg-muted/30 px-4 py-2.5 text-[12px] text-muted-foreground",
|
|
399
|
+
className
|
|
400
|
+
),
|
|
401
|
+
children: [
|
|
402
|
+
/* @__PURE__ */ jsx(Bot, { className: "size-3.5 shrink-0 text-muted-foreground" }),
|
|
403
|
+
/* @__PURE__ */ jsx("span", { children: "AI is handling this conversation." }),
|
|
404
|
+
/* @__PURE__ */ jsx(
|
|
405
|
+
Button,
|
|
406
|
+
{
|
|
407
|
+
variant: "link",
|
|
408
|
+
size: "sm",
|
|
409
|
+
className: "h-auto p-0 text-[12px] font-medium text-foreground",
|
|
410
|
+
onClick: onTakeOver,
|
|
411
|
+
children: "Take Over"
|
|
412
|
+
}
|
|
413
|
+
),
|
|
414
|
+
/* @__PURE__ */ jsx("span", { children: "to reply directly." })
|
|
415
|
+
]
|
|
416
|
+
}
|
|
417
|
+
);
|
|
418
|
+
}
|
|
419
|
+
return /* @__PURE__ */ jsxs(
|
|
420
|
+
"div",
|
|
421
|
+
{
|
|
422
|
+
className: cn(
|
|
423
|
+
"flex flex-col gap-2 border-t border-border bg-background p-3",
|
|
424
|
+
className
|
|
425
|
+
),
|
|
426
|
+
children: [
|
|
427
|
+
/* @__PURE__ */ jsx(
|
|
428
|
+
Textarea,
|
|
429
|
+
{
|
|
430
|
+
value: inputValue,
|
|
431
|
+
onChange: (e) => onInputChange == null ? void 0 : onInputChange(e.target.value),
|
|
432
|
+
placeholder: "Reply to lead...",
|
|
433
|
+
rows: 3,
|
|
434
|
+
className: "resize-none text-sm"
|
|
435
|
+
}
|
|
436
|
+
),
|
|
437
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
438
|
+
/* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
|
|
439
|
+
/* @__PURE__ */ jsx(Bot, { className: "mr-1.5 size-3.5" }),
|
|
440
|
+
"Let AI Handle"
|
|
441
|
+
] }),
|
|
442
|
+
/* @__PURE__ */ jsxs(
|
|
443
|
+
Button,
|
|
444
|
+
{
|
|
445
|
+
size: "sm",
|
|
446
|
+
onClick: () => onSend == null ? void 0 : onSend(inputValue),
|
|
447
|
+
disabled: !inputValue.trim(),
|
|
448
|
+
children: [
|
|
449
|
+
/* @__PURE__ */ jsx(Send, { className: "mr-1.5 size-3.5" }),
|
|
450
|
+
"Send"
|
|
451
|
+
]
|
|
452
|
+
}
|
|
453
|
+
)
|
|
454
|
+
] })
|
|
455
|
+
]
|
|
456
|
+
}
|
|
457
|
+
);
|
|
458
|
+
}
|
|
459
|
+
function ChatThread({
|
|
460
|
+
contact,
|
|
461
|
+
status,
|
|
462
|
+
mode,
|
|
463
|
+
messages,
|
|
464
|
+
isAiTyping = false,
|
|
465
|
+
inputValue,
|
|
466
|
+
onInputChange,
|
|
467
|
+
onSend,
|
|
468
|
+
onTakeOver,
|
|
469
|
+
onLetAiHandle,
|
|
470
|
+
onReopen,
|
|
471
|
+
onMarkUrgent,
|
|
472
|
+
onUnmarkUrgent,
|
|
473
|
+
onArchive,
|
|
474
|
+
onAssignToAdvisor,
|
|
475
|
+
onBack,
|
|
476
|
+
onShowLeadInfo,
|
|
477
|
+
className
|
|
478
|
+
}) {
|
|
479
|
+
const aiIsHandling = mode === "ai";
|
|
480
|
+
const isClosed = status === "closed";
|
|
481
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col bg-background", className), children: [
|
|
482
|
+
/* @__PURE__ */ jsxs(
|
|
483
|
+
"div",
|
|
484
|
+
{
|
|
485
|
+
className: cn(
|
|
486
|
+
PANEL_HEADER_HEIGHT,
|
|
487
|
+
"flex items-center gap-3 border-b border-border px-4"
|
|
488
|
+
),
|
|
489
|
+
children: [
|
|
490
|
+
onBack && /* @__PURE__ */ jsx(
|
|
491
|
+
Button,
|
|
492
|
+
{
|
|
493
|
+
variant: "ghost",
|
|
494
|
+
size: "icon",
|
|
495
|
+
className: "size-8 shrink-0 md:hidden",
|
|
496
|
+
onClick: onBack,
|
|
497
|
+
"aria-label": "Back to conversations",
|
|
498
|
+
children: /* @__PURE__ */ jsx(ArrowLeft, { className: "size-4" })
|
|
499
|
+
}
|
|
500
|
+
),
|
|
501
|
+
/* @__PURE__ */ jsx(ContactAvatar, { name: contact.name, size: "md" }),
|
|
502
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
503
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
504
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
|
|
505
|
+
/* @__PURE__ */ jsx(ConversationStatusChip, { status, showDot: true })
|
|
506
|
+
] }),
|
|
507
|
+
contact.email && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: contact.email })
|
|
508
|
+
] }),
|
|
509
|
+
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
510
|
+
/* @__PURE__ */ jsxs("div", { className: "hidden items-center gap-2 md:flex", children: [
|
|
511
|
+
isClosed && /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: onReopen, children: "Reopen" }),
|
|
512
|
+
!isClosed && aiIsHandling && /* @__PURE__ */ jsx(Button, { size: "sm", onClick: onTakeOver, children: "Take Over" }),
|
|
513
|
+
!isClosed && !aiIsHandling && /* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
|
|
514
|
+
/* @__PURE__ */ jsx(Bot, { className: "mr-1.5 size-3.5" }),
|
|
515
|
+
"Let AI Handle"
|
|
516
|
+
] })
|
|
517
|
+
] }),
|
|
518
|
+
/* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
519
|
+
/* @__PURE__ */ jsx(
|
|
520
|
+
DropdownMenuTrigger,
|
|
521
|
+
{
|
|
522
|
+
className: cn(
|
|
523
|
+
buttonVariants({ variant: "ghost", size: "icon" }),
|
|
524
|
+
"size-8"
|
|
525
|
+
),
|
|
526
|
+
"aria-label": "More actions",
|
|
527
|
+
children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "size-4" })
|
|
528
|
+
}
|
|
529
|
+
),
|
|
530
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { children: [
|
|
531
|
+
onShowLeadInfo && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
532
|
+
/* @__PURE__ */ jsxs(
|
|
533
|
+
DropdownMenuItem,
|
|
534
|
+
{
|
|
535
|
+
className: "md:hidden",
|
|
536
|
+
onClick: onShowLeadInfo,
|
|
537
|
+
children: [
|
|
538
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "mr-2 size-4" }),
|
|
539
|
+
"Lead Info"
|
|
540
|
+
]
|
|
541
|
+
}
|
|
542
|
+
),
|
|
543
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, { className: "md:hidden" })
|
|
544
|
+
] }),
|
|
545
|
+
status === "needs-attention" ? /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: onUnmarkUrgent, children: [
|
|
546
|
+
/* @__PURE__ */ jsx(Flag, { className: "mr-2 size-4" }),
|
|
547
|
+
"Unmark Urgent"
|
|
548
|
+
] }) : /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: onMarkUrgent, children: [
|
|
549
|
+
/* @__PURE__ */ jsx(Flag, { className: "mr-2 size-4" }),
|
|
550
|
+
"Mark as Urgent"
|
|
551
|
+
] }),
|
|
552
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: onAssignToAdvisor, children: [
|
|
553
|
+
/* @__PURE__ */ jsx(UserCheck, { className: "mr-2 size-4" }),
|
|
554
|
+
"Assign to advisor"
|
|
555
|
+
] }),
|
|
556
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
557
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: onArchive, children: [
|
|
558
|
+
/* @__PURE__ */ jsx(Archive, { className: "mr-2 size-4" }),
|
|
559
|
+
"Archive"
|
|
560
|
+
] })
|
|
561
|
+
] })
|
|
562
|
+
] })
|
|
563
|
+
] })
|
|
564
|
+
]
|
|
565
|
+
}
|
|
566
|
+
),
|
|
567
|
+
/* @__PURE__ */ jsxs(
|
|
568
|
+
"div",
|
|
569
|
+
{
|
|
570
|
+
className: "flex flex-1 flex-col gap-4 overflow-y-auto p-4",
|
|
571
|
+
tabIndex: 0,
|
|
572
|
+
children: [
|
|
573
|
+
messages.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground", children: [
|
|
574
|
+
/* @__PURE__ */ jsx(MessageSquare, { className: "size-8 opacity-30" }),
|
|
575
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm", children: "No messages yet" })
|
|
576
|
+
] }) : messages.map((msg) => /* @__PURE__ */ jsx(ChatBubble, { message: msg }, msg.id)),
|
|
577
|
+
isAiTyping && !isClosed && /* @__PURE__ */ jsxs("div", { className: "flex gap-2.5", children: [
|
|
578
|
+
/* @__PURE__ */ jsx(BubbleAvatar, { role: "bot" }),
|
|
579
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
580
|
+
/* @__PURE__ */ jsx("span", { className: "text-caption text-muted-foreground", children: "AI Assistant" }),
|
|
581
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 border border-border bg-muted/60 px-3 py-2.5", children: [
|
|
582
|
+
/* @__PURE__ */ jsx("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:0ms]" }),
|
|
583
|
+
/* @__PURE__ */ jsx("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:150ms]" }),
|
|
584
|
+
/* @__PURE__ */ jsx("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:300ms]" })
|
|
585
|
+
] })
|
|
586
|
+
] })
|
|
587
|
+
] })
|
|
588
|
+
]
|
|
589
|
+
}
|
|
590
|
+
),
|
|
591
|
+
isClosed ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 border-t border-border bg-muted/30 px-4 py-3 text-sm text-muted-foreground", children: [
|
|
592
|
+
/* @__PURE__ */ jsx(Lock, { className: "size-3.5 shrink-0" }),
|
|
593
|
+
/* @__PURE__ */ jsx("span", { children: "This conversation is closed." }),
|
|
594
|
+
/* @__PURE__ */ jsx(
|
|
595
|
+
Button,
|
|
596
|
+
{
|
|
597
|
+
variant: "outline",
|
|
598
|
+
size: "sm",
|
|
599
|
+
className: "ml-auto",
|
|
600
|
+
onClick: onReopen,
|
|
601
|
+
children: "Reopen"
|
|
602
|
+
}
|
|
603
|
+
)
|
|
604
|
+
] }) : /* @__PURE__ */ jsx(
|
|
605
|
+
ChatComposer,
|
|
606
|
+
{
|
|
607
|
+
mode,
|
|
608
|
+
inputValue,
|
|
609
|
+
onInputChange,
|
|
610
|
+
onSend,
|
|
611
|
+
onTakeOver,
|
|
612
|
+
onLetAiHandle
|
|
613
|
+
}
|
|
614
|
+
)
|
|
615
|
+
] });
|
|
616
|
+
}
|
|
617
|
+
function AICollectedDataSection({
|
|
618
|
+
fields,
|
|
619
|
+
className
|
|
620
|
+
}) {
|
|
621
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col", className), children: fields.map((field, i) => /* @__PURE__ */ jsxs(
|
|
622
|
+
"div",
|
|
623
|
+
{
|
|
624
|
+
className: "flex items-center justify-between gap-2 border-b border-border/40 py-1.5 last:border-b-0",
|
|
625
|
+
children: [
|
|
626
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 text-sm text-muted-foreground", children: field.label }),
|
|
627
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
628
|
+
/* @__PURE__ */ jsx("span", { className: "text-right text-sm font-medium text-foreground", children: field.value }),
|
|
629
|
+
field.confidence === "confirmed" ? /* @__PURE__ */ jsx(CheckCircle2, { className: "size-3 shrink-0 text-success-text" }) : /* @__PURE__ */ jsx(HelpCircle, { className: "size-3 shrink-0 text-warning-text" })
|
|
630
|
+
] })
|
|
631
|
+
]
|
|
632
|
+
},
|
|
633
|
+
i
|
|
634
|
+
)) });
|
|
635
|
+
}
|
|
636
|
+
var MEETING_ICON = {
|
|
637
|
+
video: Video,
|
|
638
|
+
phone: Phone,
|
|
639
|
+
"in-person": MapPin
|
|
640
|
+
};
|
|
641
|
+
var MEETING_LABEL = {
|
|
642
|
+
video: "Video Call",
|
|
643
|
+
phone: "Phone Call",
|
|
644
|
+
"in-person": "In Person"
|
|
645
|
+
};
|
|
646
|
+
function AppointmentSection({
|
|
647
|
+
appointment,
|
|
648
|
+
contactId,
|
|
649
|
+
isAnonymous,
|
|
650
|
+
onApproveAppointment,
|
|
651
|
+
onDeclineAppointment,
|
|
652
|
+
onRescheduleAppointment
|
|
653
|
+
}) {
|
|
654
|
+
const AppointmentIcon = MEETING_ICON[appointment.meetingType];
|
|
655
|
+
const canReschedule = !isAnonymous && !!onRescheduleAppointment;
|
|
656
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
657
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
658
|
+
/* @__PURE__ */ jsx(Calendar, { className: "size-3.5 shrink-0 text-muted-foreground" }),
|
|
659
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: appointment.datetime })
|
|
660
|
+
] }),
|
|
661
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
662
|
+
/* @__PURE__ */ jsx(AppointmentIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
663
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: MEETING_LABEL[appointment.meetingType] })
|
|
664
|
+
] }),
|
|
665
|
+
/* @__PURE__ */ jsx(
|
|
666
|
+
"span",
|
|
667
|
+
{
|
|
668
|
+
className: cn("text-sm font-medium", {
|
|
669
|
+
"text-warning-text": appointment.status === "requested",
|
|
670
|
+
"text-success-text": appointment.status === "confirmed",
|
|
671
|
+
"text-muted-foreground": appointment.status === "pending",
|
|
672
|
+
"text-destructive line-through": appointment.status === "cancelled"
|
|
673
|
+
}),
|
|
674
|
+
children: APPOINTMENT_STATUS_LABEL[appointment.status]
|
|
675
|
+
}
|
|
676
|
+
),
|
|
677
|
+
appointment.status === "requested" && /* @__PURE__ */ jsxs("div", { className: "flex gap-2 pt-1", children: [
|
|
678
|
+
/* @__PURE__ */ jsx(Button, { size: "sm", className: "flex-1", onClick: onApproveAppointment, children: "Approve" }),
|
|
679
|
+
/* @__PURE__ */ jsx(
|
|
680
|
+
Button,
|
|
681
|
+
{
|
|
682
|
+
variant: "outline",
|
|
683
|
+
size: "sm",
|
|
684
|
+
className: "flex-1",
|
|
685
|
+
onClick: onDeclineAppointment,
|
|
686
|
+
children: "Decline"
|
|
687
|
+
}
|
|
688
|
+
),
|
|
689
|
+
canReschedule && /* @__PURE__ */ jsx(
|
|
690
|
+
Button,
|
|
691
|
+
{
|
|
692
|
+
variant: "ghost",
|
|
693
|
+
size: "sm",
|
|
694
|
+
className: "flex-1",
|
|
695
|
+
onClick: () => onRescheduleAppointment(contactId),
|
|
696
|
+
children: "Reschedule"
|
|
697
|
+
}
|
|
698
|
+
)
|
|
699
|
+
] }),
|
|
700
|
+
(appointment.status === "confirmed" || appointment.status === "cancelled") && canReschedule && /* @__PURE__ */ jsx(
|
|
701
|
+
Button,
|
|
702
|
+
{
|
|
703
|
+
variant: "outline",
|
|
704
|
+
size: "sm",
|
|
705
|
+
className: "mt-1 w-full justify-start",
|
|
706
|
+
onClick: () => onRescheduleAppointment(contactId),
|
|
707
|
+
children: "Reschedule"
|
|
708
|
+
}
|
|
709
|
+
)
|
|
710
|
+
] });
|
|
711
|
+
}
|
|
712
|
+
function PanelSectionHeader({ children }) {
|
|
713
|
+
return /* @__PURE__ */ jsx("p", { className: "mb-2.5 text-overline text-muted-foreground", children });
|
|
714
|
+
}
|
|
715
|
+
function PanelSection({
|
|
716
|
+
children,
|
|
717
|
+
last = false
|
|
718
|
+
}) {
|
|
719
|
+
return /* @__PURE__ */ jsx("div", { className: cn("px-4 py-4", !last && "border-b border-border"), children });
|
|
720
|
+
}
|
|
721
|
+
function LeadInfoPanel({
|
|
722
|
+
contact,
|
|
723
|
+
firstSeen,
|
|
724
|
+
source = "Website Chatbot",
|
|
725
|
+
aiFields = [],
|
|
726
|
+
appointment,
|
|
727
|
+
internalNotes = "",
|
|
728
|
+
notesSaveStatus = "idle",
|
|
729
|
+
isCollapsed = false,
|
|
730
|
+
isKnownContact = false,
|
|
731
|
+
onAddToContacts,
|
|
732
|
+
onCreateOpportunity,
|
|
733
|
+
onBookAppointment,
|
|
734
|
+
onApproveAppointment,
|
|
735
|
+
onDeclineAppointment,
|
|
736
|
+
onRescheduleAppointment,
|
|
737
|
+
onNotesChange,
|
|
738
|
+
onToggleCollapse,
|
|
739
|
+
onBack,
|
|
740
|
+
className
|
|
741
|
+
}) {
|
|
742
|
+
const isAnonymous = !contact.name.trim();
|
|
743
|
+
const addToContactsDisabled = isAnonymous || isKnownContact;
|
|
744
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col bg-background", className), children: [
|
|
745
|
+
/* @__PURE__ */ jsxs(
|
|
746
|
+
"div",
|
|
747
|
+
{
|
|
748
|
+
className: cn(
|
|
749
|
+
PANEL_HEADER_HEIGHT,
|
|
750
|
+
"flex items-center justify-between border-b border-border px-4"
|
|
751
|
+
),
|
|
752
|
+
children: [
|
|
753
|
+
onBack && /* @__PURE__ */ jsx(
|
|
754
|
+
Button,
|
|
755
|
+
{
|
|
756
|
+
variant: "ghost",
|
|
757
|
+
size: "icon",
|
|
758
|
+
className: "size-8 shrink-0 md:hidden",
|
|
759
|
+
onClick: onBack,
|
|
760
|
+
"aria-label": "Back to conversation",
|
|
761
|
+
children: /* @__PURE__ */ jsx(ArrowLeft, { className: "size-4" })
|
|
762
|
+
}
|
|
763
|
+
),
|
|
764
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground", children: "Lead Info" }),
|
|
765
|
+
onToggleCollapse && /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
766
|
+
/* @__PURE__ */ jsx(
|
|
767
|
+
TooltipTrigger,
|
|
768
|
+
{
|
|
769
|
+
render: /* @__PURE__ */ jsx(
|
|
770
|
+
Button,
|
|
771
|
+
{
|
|
772
|
+
variant: "ghost",
|
|
773
|
+
size: "icon",
|
|
774
|
+
className: "size-7",
|
|
775
|
+
onClick: onToggleCollapse,
|
|
776
|
+
"aria-label": isCollapsed ? "Expand panel" : "Collapse panel",
|
|
777
|
+
children: /* @__PURE__ */ jsx(
|
|
778
|
+
ChevronRight,
|
|
779
|
+
{
|
|
780
|
+
className: cn(
|
|
781
|
+
"size-4 transition-transform duration-150",
|
|
782
|
+
isCollapsed && "-rotate-180"
|
|
783
|
+
)
|
|
784
|
+
}
|
|
785
|
+
)
|
|
786
|
+
}
|
|
787
|
+
)
|
|
788
|
+
}
|
|
789
|
+
),
|
|
790
|
+
/* @__PURE__ */ jsx(TooltipContent, { children: isCollapsed ? "Expand panel" : "Collapse panel" })
|
|
791
|
+
] })
|
|
792
|
+
]
|
|
793
|
+
}
|
|
794
|
+
),
|
|
795
|
+
!isCollapsed && /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto", tabIndex: 0, children: [
|
|
796
|
+
/* @__PURE__ */ jsxs(PanelSection, { children: [
|
|
797
|
+
/* @__PURE__ */ jsx(PanelSectionHeader, { children: "Contact" }),
|
|
798
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
799
|
+
/* @__PURE__ */ jsx(ContactAvatar, { name: contact.name, size: "lg" }),
|
|
800
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
801
|
+
/* @__PURE__ */ jsx("p", { className: "truncate text-sm font-semibold text-foreground", children: displayContactName(contact.name) }),
|
|
802
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: source })
|
|
803
|
+
] })
|
|
804
|
+
] }),
|
|
805
|
+
(contact.email || contact.phone || firstSeen) && /* @__PURE__ */ jsxs("div", { className: "mt-3 flex flex-col gap-1.5", children: [
|
|
806
|
+
contact.email && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
807
|
+
/* @__PURE__ */ jsx(Mail, { className: "size-4 shrink-0" }),
|
|
808
|
+
/* @__PURE__ */ jsx(
|
|
809
|
+
"a",
|
|
810
|
+
{
|
|
811
|
+
href: `mailto:${contact.email}`,
|
|
812
|
+
className: "truncate hover:underline",
|
|
813
|
+
children: contact.email
|
|
814
|
+
}
|
|
815
|
+
)
|
|
816
|
+
] }),
|
|
817
|
+
contact.phone && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
818
|
+
/* @__PURE__ */ jsx(PhoneCall, { className: "size-4 shrink-0" }),
|
|
819
|
+
/* @__PURE__ */ jsx(
|
|
820
|
+
"a",
|
|
821
|
+
{
|
|
822
|
+
href: `tel:${contact.phone}`,
|
|
823
|
+
className: "hover:underline",
|
|
824
|
+
children: contact.phone
|
|
825
|
+
}
|
|
826
|
+
)
|
|
827
|
+
] }),
|
|
828
|
+
firstSeen && /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
|
|
829
|
+
"First seen: ",
|
|
830
|
+
firstSeen
|
|
831
|
+
] })
|
|
832
|
+
] })
|
|
833
|
+
] }),
|
|
834
|
+
/* @__PURE__ */ jsxs(PanelSection, { children: [
|
|
835
|
+
/* @__PURE__ */ jsx(PanelSectionHeader, { children: "AI-Collected Data" }),
|
|
836
|
+
aiFields.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
837
|
+
/* @__PURE__ */ jsx(AICollectedDataSection, { fields: aiFields }),
|
|
838
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-2.5 flex items-center gap-3 text-xs text-muted-foreground", children: [
|
|
839
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
|
|
840
|
+
/* @__PURE__ */ jsx(CheckCircle2, { className: "size-3 text-success-text" }),
|
|
841
|
+
"confirmed"
|
|
842
|
+
] }),
|
|
843
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
|
|
844
|
+
/* @__PURE__ */ jsx(HelpCircle, { className: "size-3 text-warning-text" }),
|
|
845
|
+
"estimated"
|
|
846
|
+
] })
|
|
847
|
+
] })
|
|
848
|
+
] }) : /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "AI is still gathering information..." })
|
|
849
|
+
] }),
|
|
850
|
+
/* @__PURE__ */ jsxs(PanelSection, { children: [
|
|
851
|
+
/* @__PURE__ */ jsx(PanelSectionHeader, { children: "Appointment" }),
|
|
852
|
+
appointment ? /* @__PURE__ */ jsx(
|
|
853
|
+
AppointmentSection,
|
|
854
|
+
{
|
|
855
|
+
appointment,
|
|
856
|
+
contactId: contact.id,
|
|
857
|
+
isAnonymous,
|
|
858
|
+
onApproveAppointment,
|
|
859
|
+
onDeclineAppointment,
|
|
860
|
+
onRescheduleAppointment
|
|
861
|
+
}
|
|
862
|
+
) : /* @__PURE__ */ jsxs(
|
|
863
|
+
Button,
|
|
864
|
+
{
|
|
865
|
+
variant: "outline",
|
|
866
|
+
size: "sm",
|
|
867
|
+
className: "w-full justify-start",
|
|
868
|
+
disabled: isAnonymous,
|
|
869
|
+
onClick: onBookAppointment,
|
|
870
|
+
children: [
|
|
871
|
+
/* @__PURE__ */ jsx(Plus, { className: "mr-1.5 size-3.5" }),
|
|
872
|
+
"Book Appointment"
|
|
873
|
+
]
|
|
874
|
+
}
|
|
875
|
+
)
|
|
876
|
+
] }),
|
|
877
|
+
/* @__PURE__ */ jsxs(PanelSection, { children: [
|
|
878
|
+
/* @__PURE__ */ jsx(PanelSectionHeader, { children: "CRM Actions" }),
|
|
879
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
880
|
+
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
881
|
+
/* @__PURE__ */ jsx(
|
|
882
|
+
TooltipTrigger,
|
|
883
|
+
{
|
|
884
|
+
render: /* @__PURE__ */ jsxs(
|
|
885
|
+
Button,
|
|
886
|
+
{
|
|
887
|
+
variant: "outline",
|
|
888
|
+
size: "sm",
|
|
889
|
+
className: "w-full justify-start",
|
|
890
|
+
disabled: addToContactsDisabled,
|
|
891
|
+
onClick: onAddToContacts,
|
|
892
|
+
children: [
|
|
893
|
+
/* @__PURE__ */ jsx(UserPlus, { className: "mr-1.5 size-3.5" }),
|
|
894
|
+
"Add to Contacts"
|
|
895
|
+
]
|
|
896
|
+
}
|
|
897
|
+
)
|
|
898
|
+
}
|
|
899
|
+
),
|
|
900
|
+
isKnownContact && /* @__PURE__ */ jsx(TooltipContent, { children: "Already in contacts" })
|
|
901
|
+
] }),
|
|
902
|
+
/* @__PURE__ */ jsxs(
|
|
903
|
+
Button,
|
|
904
|
+
{
|
|
905
|
+
variant: "outline",
|
|
906
|
+
size: "sm",
|
|
907
|
+
className: "w-full justify-start",
|
|
908
|
+
disabled: isAnonymous,
|
|
909
|
+
onClick: onCreateOpportunity,
|
|
910
|
+
children: [
|
|
911
|
+
/* @__PURE__ */ jsx(Briefcase, { className: "mr-1.5 size-3.5" }),
|
|
912
|
+
"Add to CRM"
|
|
913
|
+
]
|
|
914
|
+
}
|
|
915
|
+
)
|
|
916
|
+
] })
|
|
917
|
+
] }),
|
|
918
|
+
/* @__PURE__ */ jsxs(PanelSection, { last: true, children: [
|
|
919
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-2.5 flex items-center justify-between", children: [
|
|
920
|
+
/* @__PURE__ */ jsx("p", { className: "text-overline text-muted-foreground", children: "Internal Notes" }),
|
|
921
|
+
notesSaveStatus === "saving" && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "Saving..." }),
|
|
922
|
+
notesSaveStatus === "saved" && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 text-xs text-success-text", children: [
|
|
923
|
+
/* @__PURE__ */ jsx(CheckCircle2, { className: "size-3" }),
|
|
924
|
+
"Saved"
|
|
925
|
+
] })
|
|
926
|
+
] }),
|
|
927
|
+
/* @__PURE__ */ jsx(
|
|
928
|
+
Textarea,
|
|
929
|
+
{
|
|
930
|
+
value: internalNotes,
|
|
931
|
+
onChange: (e) => onNotesChange == null ? void 0 : onNotesChange(e.target.value),
|
|
932
|
+
placeholder: "Private notes \u2014 not visible to lead...",
|
|
933
|
+
rows: 4,
|
|
934
|
+
className: "resize-none text-sm"
|
|
935
|
+
}
|
|
936
|
+
)
|
|
937
|
+
] })
|
|
938
|
+
] })
|
|
939
|
+
] });
|
|
940
|
+
}
|
|
941
|
+
function ConversationsPage({
|
|
942
|
+
conversations,
|
|
943
|
+
activeConversationId,
|
|
944
|
+
contact,
|
|
945
|
+
status = "ai-active",
|
|
946
|
+
mode = "ai",
|
|
947
|
+
messages = [],
|
|
948
|
+
aiFields = [],
|
|
949
|
+
appointment,
|
|
950
|
+
leadFirstSeen,
|
|
951
|
+
leadSource,
|
|
952
|
+
searchQuery,
|
|
953
|
+
activeFilter,
|
|
954
|
+
inputValue,
|
|
955
|
+
internalNotes,
|
|
956
|
+
showLeadPanel = true,
|
|
957
|
+
hasMore,
|
|
958
|
+
isLoadingMore,
|
|
959
|
+
isAiTyping,
|
|
960
|
+
notesSaveStatus,
|
|
961
|
+
onSelectConversation,
|
|
962
|
+
onRead,
|
|
963
|
+
onSearchChange,
|
|
964
|
+
onFilterChange,
|
|
965
|
+
onInputChange,
|
|
966
|
+
onSend,
|
|
967
|
+
onTakeOver,
|
|
968
|
+
onLetAiHandle,
|
|
969
|
+
onReopen,
|
|
970
|
+
onMarkUrgent,
|
|
971
|
+
onUnmarkUrgent,
|
|
972
|
+
onArchive,
|
|
973
|
+
onAssignToAdvisor,
|
|
974
|
+
isKnownContact,
|
|
975
|
+
onAddToContacts,
|
|
976
|
+
onCreateOpportunity,
|
|
977
|
+
onBookAppointment,
|
|
978
|
+
onApproveAppointment,
|
|
979
|
+
onDeclineAppointment,
|
|
980
|
+
onRescheduleAppointment,
|
|
981
|
+
onNotesChange,
|
|
982
|
+
onToggleLeadPanel,
|
|
983
|
+
onLoadMore,
|
|
984
|
+
className
|
|
985
|
+
}) {
|
|
986
|
+
const [mobilePanel, setMobilePanel] = useState(
|
|
987
|
+
"list"
|
|
988
|
+
);
|
|
989
|
+
const handleSelectConversation = (id) => {
|
|
990
|
+
onSelectConversation == null ? void 0 : onSelectConversation(id);
|
|
991
|
+
setMobilePanel("chat");
|
|
992
|
+
};
|
|
993
|
+
const handleToggleLeadPanel = () => {
|
|
994
|
+
onToggleLeadPanel == null ? void 0 : onToggleLeadPanel();
|
|
995
|
+
setMobilePanel(showLeadPanel ? "chat" : "lead");
|
|
996
|
+
};
|
|
997
|
+
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(
|
|
998
|
+
"div",
|
|
999
|
+
{
|
|
1000
|
+
className: cn("flex h-full overflow-hidden bg-background", className),
|
|
1001
|
+
children: [
|
|
1002
|
+
/* @__PURE__ */ jsx(
|
|
1003
|
+
ConversationList,
|
|
1004
|
+
{
|
|
1005
|
+
conversations,
|
|
1006
|
+
activeId: activeConversationId,
|
|
1007
|
+
searchQuery,
|
|
1008
|
+
activeFilter,
|
|
1009
|
+
hasMore,
|
|
1010
|
+
isLoadingMore,
|
|
1011
|
+
onSearchChange,
|
|
1012
|
+
onFilterChange,
|
|
1013
|
+
onSelect: handleSelectConversation,
|
|
1014
|
+
onRead,
|
|
1015
|
+
onLoadMore,
|
|
1016
|
+
className: cn(
|
|
1017
|
+
"shrink-0 md:w-[320px]",
|
|
1018
|
+
// Mobile: full width, visible only on list panel
|
|
1019
|
+
mobilePanel === "list" ? "flex w-full md:flex" : "hidden md:flex"
|
|
1020
|
+
)
|
|
1021
|
+
}
|
|
1022
|
+
),
|
|
1023
|
+
contact ? /* @__PURE__ */ jsx(
|
|
1024
|
+
ChatThread,
|
|
1025
|
+
{
|
|
1026
|
+
contact,
|
|
1027
|
+
status,
|
|
1028
|
+
mode,
|
|
1029
|
+
messages,
|
|
1030
|
+
isAiTyping,
|
|
1031
|
+
inputValue,
|
|
1032
|
+
onInputChange,
|
|
1033
|
+
onSend,
|
|
1034
|
+
onTakeOver,
|
|
1035
|
+
onLetAiHandle,
|
|
1036
|
+
onReopen,
|
|
1037
|
+
onMarkUrgent,
|
|
1038
|
+
onUnmarkUrgent,
|
|
1039
|
+
onArchive,
|
|
1040
|
+
onAssignToAdvisor,
|
|
1041
|
+
onBack: () => setMobilePanel("list"),
|
|
1042
|
+
onShowLeadInfo: () => setMobilePanel("lead"),
|
|
1043
|
+
className: cn(
|
|
1044
|
+
"min-w-0 flex-1 border-r border-border",
|
|
1045
|
+
mobilePanel === "chat" ? "flex flex-col md:flex" : "hidden md:flex"
|
|
1046
|
+
)
|
|
1047
|
+
}
|
|
1048
|
+
) : /* @__PURE__ */ jsx(
|
|
1049
|
+
"div",
|
|
1050
|
+
{
|
|
1051
|
+
className: cn(
|
|
1052
|
+
"min-w-0 flex-1 items-center justify-center border-r border-border bg-muted/10",
|
|
1053
|
+
mobilePanel === "chat" ? "flex md:flex" : "hidden md:flex"
|
|
1054
|
+
),
|
|
1055
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
|
|
1056
|
+
/* @__PURE__ */ jsx(MessageSquare, { className: "size-10 opacity-30" }),
|
|
1057
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm", children: "Select a conversation" })
|
|
1058
|
+
] })
|
|
1059
|
+
}
|
|
1060
|
+
),
|
|
1061
|
+
contact && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1062
|
+
/* @__PURE__ */ jsx(
|
|
1063
|
+
"div",
|
|
1064
|
+
{
|
|
1065
|
+
className: cn(
|
|
1066
|
+
// Mobile: full-width, instant show/hide based on mobilePanel
|
|
1067
|
+
mobilePanel === "lead" ? "flex w-full shrink-0 flex-col" : "hidden",
|
|
1068
|
+
// Desktop: always rendered, animate width open/close
|
|
1069
|
+
"md:block md:shrink-0 md:overflow-hidden md:transition-[width] md:duration-200 md:ease-in-out",
|
|
1070
|
+
showLeadPanel ? "md:w-[320px]" : "md:w-0"
|
|
1071
|
+
),
|
|
1072
|
+
children: /* @__PURE__ */ jsx(
|
|
1073
|
+
LeadInfoPanel,
|
|
1074
|
+
{
|
|
1075
|
+
contact,
|
|
1076
|
+
firstSeen: leadFirstSeen,
|
|
1077
|
+
source: leadSource,
|
|
1078
|
+
aiFields,
|
|
1079
|
+
appointment,
|
|
1080
|
+
internalNotes,
|
|
1081
|
+
notesSaveStatus,
|
|
1082
|
+
isKnownContact,
|
|
1083
|
+
onAddToContacts,
|
|
1084
|
+
onCreateOpportunity,
|
|
1085
|
+
onBookAppointment,
|
|
1086
|
+
onApproveAppointment,
|
|
1087
|
+
onDeclineAppointment,
|
|
1088
|
+
onRescheduleAppointment,
|
|
1089
|
+
onNotesChange,
|
|
1090
|
+
onToggleCollapse: handleToggleLeadPanel,
|
|
1091
|
+
onBack: () => setMobilePanel("chat"),
|
|
1092
|
+
className: "flex h-full w-full flex-col border-l border-border md:w-[320px]"
|
|
1093
|
+
}
|
|
1094
|
+
)
|
|
1095
|
+
}
|
|
1096
|
+
),
|
|
1097
|
+
!showLeadPanel && onToggleLeadPanel && /* @__PURE__ */ jsx("div", { className: "hidden shrink-0 items-start border-l border-border pt-[29px] md:flex", children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
1098
|
+
/* @__PURE__ */ jsx(
|
|
1099
|
+
TooltipTrigger,
|
|
1100
|
+
{
|
|
1101
|
+
render: /* @__PURE__ */ jsx(
|
|
1102
|
+
Button,
|
|
1103
|
+
{
|
|
1104
|
+
variant: "ghost",
|
|
1105
|
+
size: "icon",
|
|
1106
|
+
className: "size-8",
|
|
1107
|
+
"aria-label": "Show lead info",
|
|
1108
|
+
onClick: handleToggleLeadPanel,
|
|
1109
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "size-4" })
|
|
1110
|
+
}
|
|
1111
|
+
)
|
|
1112
|
+
}
|
|
1113
|
+
),
|
|
1114
|
+
/* @__PURE__ */ jsx(TooltipContent, { children: "Show lead info" })
|
|
1115
|
+
] }) })
|
|
1116
|
+
] })
|
|
1117
|
+
]
|
|
1118
|
+
}
|
|
1119
|
+
) });
|
|
1120
|
+
}
|
|
1121
|
+
function AiConvAssignAdvisorDialog({
|
|
1122
|
+
open,
|
|
1123
|
+
onOpenChange,
|
|
1124
|
+
advisors,
|
|
1125
|
+
value,
|
|
1126
|
+
onValueChange,
|
|
1127
|
+
onConfirm
|
|
1128
|
+
}) {
|
|
1129
|
+
const [search, setSearch] = useState("");
|
|
1130
|
+
const [roleFilter, setRoleFilter] = useState("");
|
|
1131
|
+
const roles = Array.from(
|
|
1132
|
+
new Set(advisors.map((a) => a.role).filter(Boolean))
|
|
1133
|
+
);
|
|
1134
|
+
const filtered = advisors.filter(
|
|
1135
|
+
(a) => a.name.toLowerCase().includes(search.toLowerCase()) && (!roleFilter || a.role === roleFilter)
|
|
1136
|
+
);
|
|
1137
|
+
const handleOpenChange = (v) => {
|
|
1138
|
+
onOpenChange(v);
|
|
1139
|
+
if (!v) {
|
|
1140
|
+
setSearch("");
|
|
1141
|
+
setRoleFilter("");
|
|
1142
|
+
}
|
|
1143
|
+
};
|
|
1144
|
+
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { align: "top", children: [
|
|
1145
|
+
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
1146
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: "Assign to advisor" }),
|
|
1147
|
+
/* @__PURE__ */ jsx(DialogDescription, { children: "Choose an advisor to handle this conversation." })
|
|
1148
|
+
] }),
|
|
1149
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0", children: [
|
|
1150
|
+
roles.length > 0 && /* @__PURE__ */ jsx("div", { className: "pb-3", children: /* @__PURE__ */ jsxs(
|
|
1151
|
+
ToggleGroup,
|
|
1152
|
+
{
|
|
1153
|
+
type: "single",
|
|
1154
|
+
variant: "outline",
|
|
1155
|
+
spacing: 1.5,
|
|
1156
|
+
size: "sm",
|
|
1157
|
+
value: roleFilter ? [roleFilter] : ["__all__"],
|
|
1158
|
+
onValueChange: (values) => {
|
|
1159
|
+
const v = values[0];
|
|
1160
|
+
setRoleFilter(!v || v === "__all__" ? "" : v);
|
|
1161
|
+
},
|
|
1162
|
+
children: [
|
|
1163
|
+
/* @__PURE__ */ jsx(ToggleGroupItem, { value: "__all__", children: "All" }),
|
|
1164
|
+
roles.map((role) => /* @__PURE__ */ jsx(ToggleGroupItem, { value: role, children: role }, role))
|
|
1165
|
+
]
|
|
1166
|
+
}
|
|
1167
|
+
) }),
|
|
1168
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border border-input px-3", children: [
|
|
1169
|
+
/* @__PURE__ */ jsx(Search, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
1170
|
+
/* @__PURE__ */ jsx(
|
|
1171
|
+
"input",
|
|
1172
|
+
{
|
|
1173
|
+
type: "text",
|
|
1174
|
+
placeholder: "Search advisors...",
|
|
1175
|
+
value: search,
|
|
1176
|
+
onChange: (e) => setSearch(e.target.value),
|
|
1177
|
+
className: "h-9 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"
|
|
1178
|
+
}
|
|
1179
|
+
)
|
|
1180
|
+
] }),
|
|
1181
|
+
/* @__PURE__ */ jsx("div", { className: "max-h-52 overflow-y-auto border border-t-0 border-input", children: filtered.length === 0 ? /* @__PURE__ */ jsx("p", { className: "py-6 text-center text-sm text-muted-foreground", children: "No advisors found." }) : filtered.map((advisor) => /* @__PURE__ */ jsxs(
|
|
1182
|
+
"button",
|
|
1183
|
+
{
|
|
1184
|
+
type: "button",
|
|
1185
|
+
onClick: () => onValueChange(advisor.id),
|
|
1186
|
+
className: cn(
|
|
1187
|
+
"flex w-full items-center gap-3 px-3 py-2.5 text-left text-sm transition-colors hover:bg-muted",
|
|
1188
|
+
value === advisor.id && "bg-muted font-medium"
|
|
1189
|
+
),
|
|
1190
|
+
children: [
|
|
1191
|
+
/* @__PURE__ */ jsx(Avatar, { size: "sm", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "font-semibold", children: advisor.initials }) }),
|
|
1192
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1193
|
+
/* @__PURE__ */ jsx("p", { className: "truncate text-sm", children: advisor.name }),
|
|
1194
|
+
advisor.role && /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-muted-foreground", children: advisor.role })
|
|
1195
|
+
] })
|
|
1196
|
+
]
|
|
1197
|
+
},
|
|
1198
|
+
advisor.id
|
|
1199
|
+
)) })
|
|
1200
|
+
] }),
|
|
1201
|
+
/* @__PURE__ */ jsxs(DialogFooter, { children: [
|
|
1202
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
1203
|
+
/* @__PURE__ */ jsx(Button, { onClick: onConfirm, children: "Assign" })
|
|
1204
|
+
] })
|
|
1205
|
+
] }) });
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
export {
|
|
1209
|
+
ConversationStatusChip,
|
|
1210
|
+
ConversationListItem,
|
|
1211
|
+
ConversationList,
|
|
1212
|
+
ChatBubble,
|
|
1213
|
+
ChatComposer,
|
|
1214
|
+
ChatThread,
|
|
1215
|
+
AICollectedDataSection,
|
|
1216
|
+
LeadInfoPanel,
|
|
1217
|
+
ConversationsPage,
|
|
1218
|
+
AiConvAssignAdvisorDialog
|
|
1219
|
+
};
|