1import{r as u,j as e}from"./query-vendor-CqOtiPNe.js";import{$ as re,D as ie}from"./DashboardLayout-bhpyg6kK.js";import{P as le}from"./PageHeader-CZkE0AwI.js";import{T as ee,a as se,b as y,c as D}from"./tabs-DhAXdYsK.js";import{h as j,i as b,k as w,B as o,m as g,c as I,D as ce,p as oe,q as me,r as de,t as pe,L as N,v as he,a as x,f as xe,y as O,R as ue,o as je}from"./index-CgiuONvO.js";import{I as B}from"./input-oPoHA7Fw.js";import{B as S}from"./badge-CSzvBtO5.js";import{A as W,a as U,b as V}from"./avatar-B9y0eyOh.js";import{M as L}from"./mail-dnbKMUvE.js";import{F as ge}from"./filter-DOTkE5Cb.js";import{S as fe}from"./search-CT8fLn3_.js";import{S as K}from"./star-DgTF5ai2.js";import{f as $}from"./formatDistanceToNow-DExfhm_y.js";import{T as ae}from"./trash-2-XdlKjO4t.js";import{M as E}from"./message-square-BqIfb2eA.js";import{P as ve}from"./phone-CCpZm87m.js";import{T as te}from"./textarea-CxLaKExY.js";import{S as M,a as R,b as A,c as P,d as l}from"./select-DLa9MRfA.js";import{F as ne}from"./file-text-BqBFGr3S.js";import{P as ye}from"./plus-DhJDBkeB.js";import{S as Ne}from"./square-pen-Cd8FE6iD.js";import{C as be}from"./copy-B3hQhSgM.js";import{C as q}from"./checkbox-DKjJLhPq.js";import{U as we}from"./users-BKG6ZMTq.js";import{S as H}from"./send-Dev9pED3.js";import{P as Se}from"./progress-CGtqSgOL.js";import{T as Ce}from"./trending-up-BVHf_RoK.js";import{R as G,B as Te,C as J,X as Q,Y as X,T as Y,b as Z,g as F,L as ke,d as z}from"./chart-vendor-De-uRwFm.js";import{C as De}from"./circle-x-BuyswQ-Z.js";import{C as Me}from"./circle-check-DJQ0aRpE.js";import{S as Re}from"./SEOHead-Dme3WS_r.js";import"./ui-vendor-C92kXd7i.js";import"./react-vendor-Oyj1q24G.js";import"./use-mobile-Bs-uMLmp.js";import"./separator-BBHmpRWz.js";import"./sheet-Dt5T48FQ.js";import"./skeleton-B97PTBMn.js";import"./tooltip-DukMi9Yb.js";import"./Logo-BMQirxBI.js";import"./calendar-njTWr43i.js";import"./house-C9sHcoTX.js";import"./calendar-days-BvC5INej.js";import"./building-2-Dhg-JMoH.js";import"./map-pin-C3B4zHzE.js";import"./wrench-BveqLzJ6.js";import"./wifi-off--tLv87Xm.js";import"./credit-card-B4XMcBmh.js";import"./panel-top-C_rCNK16.js";import"./log-out-BzS-CLno.js";import"./scroll-area-Cf6pvS46.js";import"./index-BdQq_4o_.js";import"./bell-CJIBHycy.js";import"./check-check-XSobeTl0.js";import"./en-US-5rFTtd83.js";import"./LanguageSwitcher-k7A6VFzv.js";import"./dropdown-menu-D-1fS2hr.js";import"./chevron-right-Cl4Mx2Wq.js";import"./check-EsNBkSFR.js";import"./circle-QNrbGPhh.js";import"./languages-1QBd6nWm.js";import"./message-circle-C3Kdh8KU.js";import"./activity-DmUxG0fV.js";import"./arrow-down-C4HxAdL9.js";import"./arrow-left-Cg5pwYzI.js";import"./arrow-right-left-tf9Dbt9n.js";import"./arrow-right-CcjvJnjH.js";import"./banknote-wg82AAG7.js";import"./bed--FRu_ZOR.js";import"./list-ordered-CD-hc5AR.js";import"./book-open-check-DeGSCDpn.js";import"./book-open-CkJItcBu.js";import"./brain-QP504LxU.js";import"./building-B1y8ifkf.js";import"./calculator-BuA7e-mZ.js";import"./car-BBeSSily.js";import"./landmark-DVOwzqRj.js";import"./chart-no-axes-column-increasing-DINm0A4J.js";import"./chart-pie-BH1JXQN4.js";import"./chevron-down-C04YKbFY.js";import"./chevron-left-ChhJq7GD.js";import"./chevron-up-YEko4sQ9.js";import"./circle-check-big-B-nqExcc.js";import"./message-square-text-CGi8Ghec.js";import"./circle-help-C7Zpw0pA.js";import"./clipboard-check-BqHgjlQp.js";import"./clipboard-list-Csw_7fPS.js";import"./clipboard-BrLc9XKt.js";import"./clock-DZbyb8Zh.js";import"./database-BFqeg3FR.js";import"./dollar-sign-BoJmMuTa.js";import"./download-CVkjVrJo.js";import"./zoom-out-CZzr-t9-.js";import"./external-link-DLbL3mEn.js";import"./twitter-DZP3beY2.js";import"./file-chart-column-increasing-B5g6evDe.js";import"./file-check-2P_f7S4-.js";import"./file-spreadsheet-BbKDqPhp.js";import"./folder-open-CQAcdSBr.js";import"./tree-pine-BPQJJftn.js";import"./globe-CnUNDEKq.js";import"./video-CEw6mOAP.js";import"./hammer-wk7AQWqX.js";import"./heart-BnQgcucT.js";import"./hotel-GOTEiWOT.js";import"./image-plus-DfX-_AyQ.js";import"./image-DrO_YHf9.js";import"./infinity-BeOXN0LM.js";import"./key-round-Cl3pyXjD.js";import"./pen-tool-ErvG_pvg.js";import"./keyboard-CzV9enBr.js";import"./layers-BFQ0OLI3.js";import"./lightbulb-IBP3Qpkq.js";import"./list-checks-CsRR_GQp.js";import"./list-Cj3mFARp.js";import"./lock-rMWs3zu_.js";import"./map-pinned-DBhEITMu.js";import"./map-Dml-fuwB.js";import"./maximize-2-BAo6X0VP.js";import"./maximize-DllRQL4I.js";import"./menu-B6QavzjZ.js";import"./minus-BWhsihkF.js";import"./mouse-pointer-click-BX0OFv2U.js";import"./mouse-z7gxK0yj.js";import"./navigation-CE5W2bfp.js";import"./pause-DMf9J0er.js";import"./pencil-s0UamddO.js";import"./ruler-PMZpHEX4.js";import"./play-jGttOVZX.js";import"./printer-DPItEGKX.js";import"./refresh-ccw-D8-NZbc0.js";import"./rocket-o5dk1x7z.js";import"./rotate-ccw-D5LvpNON.js";import"./rotate-cw-qBQXdDzU.js";import"./route-BHkgA-GC.js";import"./save-CD5NOpBU.js";import"./scale-ChbaOrX5.js";import"./share-2-CZ8fruyy.js";import"./square-plus-BYoTN96c.js";import"./skip-forward-B2g28Adz.js";import"./smartphone-BVaS8Ogf.js";import"./square-check-big-S7f3xHqK.js";import"./square-DpPlSXOl.js";import"./trending-down-BOTbmgUi.js";import"./upload-B2TjyuSq.js";import"./user-check-DLa2T6BS.js";import"./user-C4n8hF8r.js";import"./volume-2-CyzFl9Wm.js";import"./volume-x-DwUdAb_B.js";import"./wallet-DFZjOwp1.js";import"./workflow-eRF_Iozj.js";import"./zap-CZwSyBya.js";import"./useIsRTL-CvXztNyx.js";import"./useOrganization-BfvJJCCq.js";import"./index-DBVc4pCm.js";function Ae(){const[i,c]=u.useState("all"),[m,d]=u.useState(""),[t,p]=u.useState(null),a=[{id:"1",channel:"email",from:"John Tenant",fromAvatar:"",subject:"Maintenance Request - Leaking Faucet",preview:"Hi, the kitchen faucet has been leaking for the past two days...",timestamp:new Date(Date.now()-36e5).toISOString(),read:!1,starred:!0,propertyName:"Sunset Apartments #101",tags:["urgent","maintenance"]},{id:"2",channel:"whatsapp",from:"Sarah Johnson",fromAvatar:"",preview:"When is the rent due this month?",timestamp:new Date(Date.now()-72e5).toISOString(),read:!0,starred:!1,propertyName:"Downtown Plaza #205"}
1,{id:"3",channel:"sms",from:"+1 555-0123",preview:"Thank you for fixing the AC so quickly!",timestamp:new Date(Date.now()-864e5).toISOString(),read:!0,starred:!1,propertyName:"Green Valley #302"},{id:"4",channel:"in-app",from:"Mike Davis",fromAvatar:"",subject:"Lease Renewal Question",preview:"I'd like to discuss renewing my lease for another year...",timestamp:new Date(Date.now()-1728e5).toISOString(),read:!1,starred:!1,propertyName:"Riverside Complex #108"}],h=n=>{const r={email:L,sms:E,whatsapp:ve,"in-app":E}[n];return r?e.jsx(r,{className:"h-4 w-4"}):null},_=n=>({email:"bg-muted text-foreground",sms:"bg-accent text-foreground",whatsapp:"bg-emerald-500/10 text-emerald-500","in-app":"bg-purple-500/10 text-purple-500"})[n]||"bg-gray-500/10 text-gray-500",C=a.filter(n=>{var f;if(i!=="all"&&n.channel!==i)return!1;if(m){const r=m.toLowerCase();return n.from.toLowerCase().includes(r)||((f=n.subject)==null?void 0:f.toLowerCase().includes(r))||n.preview.toLowerCase().includes(r)}return!0}),T=a.filter(n=>!n.read).length;return e.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[e.jsxs(j,{className:"lg:col-span-1",children:[e.jsxs(b,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(w,{className:"flex items-center gap-2",children:[e.jsx(L,{className:"h-5 w-5"}),"Inbox",T>0&&e.jsx(S,{variant:"destructive",children:T})]}),e.jsx("div",{className:"flex gap-2",children:e.jsx(o,{variant:"ghost",size:"icon",children:e.jsx(ge,{className:"h-4 w-4"})})})]}),e.jsxs("div",{className:"relative mt-2",children:[e.jsx(fe,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(B,{placeholder:"Search messages...",value:m,onChange:n=>d(n.target.value),className:"pl-9"})]})]}),e.jsxs(g,{className:"p-0",children:[e.jsx(ee,{value:i,onValueChange:c,children:e.jsxs(se,{className:"w-full justify-start rounded-none border-b",children:[e.jsx(y,{value:"all",children:"All"}),e.jsx(y,{value:"email",children:"Email"}),e.jsx(y,{value:"whatsapp",children:"WhatsApp"}),e.jsx(y,{value:"sms",children:"SMS"}),e.jsx(y,{value:"in-app",children:"In-App"})]})}),e.jsx("div",{className:"divide-y max-h-[600px] overflow-y-auto",children:C.map(n=>e.jsx("div",{onClick:()=>p(n),className:I("p-4 cursor-pointer hover:bg-accent transition-colors",!n.read&&"bg-accent/50",(t==null?void 0:t.id)===n.id&&"bg-accent"),children:e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(W,{className:"h-10 w-10",children:[e.jsx(U,{src:n.fromAvatar}),e.jsx(V,{children:n.from.split(" ").map(f=>f[0]).join("")})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:I("font-medium truncate",!n.read&&"font-bold"),children:n.from}),n.starred&&e.jsx(K,{className:"h-3 w-3 fill-yellow-500 text-yellow-500"})]}),n.subject&&e.jsx("p",{className:I("text-sm truncate",!n.read&&"font-semibold"),children:n.subject})]}),e.jsx(S,{className:_(n.channel),children:h(n.channel)})]}),e.jsx("p",{className:"text-sm text-muted-foreground truncate mt-1",children:n.preview}),e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:$(new Date(n.timestamp),{addSuffix:!0})}),n.propertyName&&e.jsx(S,{variant:"outline",className:"text-xs",children:n.propertyName})]})]})]})},n.id))})]})]}),e.jsxs(j,{className:"lg:col-span-2",children:[e.jsx(b,{children:t?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(W,{className:"h-12 w-12",children:[e.jsx(U,{src:t.fromAvatar}),e.jsx(V,{children:t.from.split(" ").map(n=>n[0]).join("")})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold",children:t.from}),e.jsx("p",{className:"text-sm text-muted-foreground",children:$(new Date(t.timestamp),{addSuffix:!0})})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{variant:"ghost",size:"icon",children:e.jsx(K,{className:I("h-4 w-4",t.starred&&"fill-yellow-500 text-yellow-500")})}),e.jsx(o,{variant:"ghost",size:"icon",children:e.jsx(re,{className:"h-4 w-4"})}),e.jsx(o,{variant:"ghost",size:"icon",children:e.jsx(ae,{className:"h-4 w-4"})})]})]}),t.subject&&e.jsx("h2",{className:"text-xl font-semibold",children:t.subject})]}):e.jsx(w,{children:"Select a message to view"})}),e.jsx(g,{children:t?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"prose prose-sm max-w-none",children:[e.jsx("p",{children:t.preview}),e.jsx("p",{className:"mt-4",children:"This is the full message content. In a real implementation, this would contain the complete message body with proper formatting, attachments, and threading capabilities."})]}),e.jsx("div",{className:"border-t pt-4",children:e.jsx(o,{className:"w-full",children:"Reply"})})]}):e.jsx("div",{className:"flex items-center justify-center h-[400px] text-muted-foreground",children:e.jsxs("div",{className:"text-center",children:[e.jsx(L,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),e.jsx("p",{children:"Select a message to read"})]})})})]})]})}function Pe(){const[i,c]=u.useState([{id:"1",name:"Rent Reminder",category:"payment",channel:"email",subject:"Rent Payment Reminder - {{property_name}}",body:`Dear {{tenant_name}}, 2 3This is a friendly reminder that your rent payment of {{amount}} is due on {{due_date}}. 4 5Please ensure timely payment to avoid any late fees. 6 7Best regards, 8{{landlord_name}}`,variables:["tenant_name","property_name","amount","due_date","landlord_name"],usageCount:45},{id:"2",name:"Maintenance Confirmation",category:"maintenance",channel:"sms",body:"Hi {{tenant_name}}, your maintenance request for {{issue}} has been received. Our team will visit on {{scheduled_date}}. -{{property_manager}}
8",variables:["tenant_name","issue","scheduled_date","property_manager"],usageCount:32},{id:"3",name:"Lease Renewal Notice",category:"lease",channel:"email",subject:"Lease Renewal - {{property_name}}",body:`Dear {{tenant_name}}, 9 10Your lease for {{property_name}} is set to expire on {{expiry_date}}. 11 12We would like to discuss renewal options with you. Please contact us at your earliest convenience. 13 14Thank you, 15{{landlord_name}}`,variables:["tenant_name","property_name","expiry_date","landlord_name"],usageCount:18}]),[m,d]=u.useState(!1),[t,p]=u.useState(null),[a,h]=u.useState({name:"",category:"general",channel:"email",subject:"",body:""}),_=s=>{p(s),h({name:s.name,category:s.category,channel:s.channel,subject:s.subject||"",body:s.body}),d(!0)},C=()=>{if(!a.name||!a.body){x.error("Name and body are required");return}const s=/\{\{([^}]+)\}\}/g,v=[...a.body.matchAll(s)].map(k=>k[1]);t?(c(i.map(k=>k.id===t.id?{...k,...a,variables:[...new Set(v)]}:k)),x.success("Template updated")):(c([...i,{id:Date.now().toString(),...a,variables:[...new Set(v)],usageCount:0}]),x.success("Template created")),d(!1),p(null),h({name:"",category:"general",channel:"email",subject:"",body:""})},T=s=>{c(i.filter(v=>v.id!==s)),x.success("Template deleted")},n=s=>{c([...i,{...s,id:Date.now().toString(),name:`${s.name} (Copy)`,usageCount:0}]),x.success("Template duplicated")},f=s=>{const v={payment:"bg-muted text-foreground",maintenance:"bg-accent/50 text-accent-foreground",lease:"bg-muted/50 text-foreground",general:"bg-muted/70 text-muted-foreground"};return v[s]||v.general},r=s=>({email:"Email",sms:"SMS",whatsapp:"WhatsApp",all:"All Channels"})[s]||s;return e.jsxs(e.Fragment,{children:[e.jsxs(j,{children:[e.jsx(b,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(w,{className:"flex items-center gap-2",children:[e.jsx(ne,{className:"h-5 w-5"}),"Message Templates"]}),e.jsxs(o,{onClick:()=>d(!0),children:[e.jsx(ye,{className:"h-4 w-4 mr-2"}),"Create Template"]})]})}),e.jsx(g,{children:e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:i.map(s=>e.jsx(j,{className:"hover:shadow-md transition-shadow",children:e.jsxs(g,{className:"p-4 space-y-3",children:[e.jsx("div",{className:"flex items-start justify-between",children:e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-semibold",children:s.name}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1 line-clamp-2",children:s.body})]})}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(S,{className:f(s.category),children:s.category}),e.jsx(S,{variant:"outline",children:r(s.channel)})]}),s.variables.length>0&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Variables: ",s.variables.join(", ")]}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:["Used ",s.usageCount," times"]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(o,{variant:"ghost",size:"sm",onClick:()=>_(s),children:e.jsx(Ne,{className:"h-4 w-4"})}),e.jsx(o,{variant:"ghost",size:"sm",onClick:()=>n(s),children:e.jsx(be,{className:"h-4 w-4"})}),e.jsx(o,{variant:"ghost",size:"sm",onClick:()=>T(s.id),children:e.jsx(ae,{className:"h-4 w-4 text-destructive"})})]})]})]})},s.id))})})]}),e.jsx(ce,{open:m,onOpenChange:d,children:e.jsxs(oe,{className:"max-w-2xl",children:[e.jsxs(me,{children:[e.jsx(de,{children:t?"Edit Template":"Create Template"}),e.jsxs(pe,{children:["Use variables like ","{{tenant_name}}"," or ","{{property_name}}"," for personalization"]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(N,{htmlFor:"template-name",children:"Template Name"}),e.jsx(B,{id:"template-name",value:a.name,onChange:s=>h({...a,name:s.target.value}),placeholder:"e.g., Rent Reminder"})]}),e.jsxs("div",{children:[e.jsx(N,{htmlFor:"template-category",children:"Category"}),e.jsxs(M,{value:a.category,onValueChange:s=>h({...a,category:s}),children:[e.jsx(R,{id:"template-category",children:e.jsx(A,{})}),e.jsxs(P,{children:[e.jsx(l,{value:"general",children:"General"}),e.jsx(l,{value:"payment",children:"Payment"}),e.jsx(l,{value:"maintenance",children:"Maintenance"}),e.jsx(l,{value:"lease",children:"Lease"})]})]})]})]}),e.jsxs("div",{children:[e.jsx(N,{htmlFor:"template-channel",children:"Channel"}),e.jsxs(M,{value:a.channel,onValueChange:s=>h({...a,channel:s}),children:[e.jsx(R,{id:"template-channel",children:e.jsx(A,{})}),e.jsxs(P,{children:[e.jsx(l,{value:"email",children:"Email"}),e.jsx(l,{value:"sms",children:"SMS"}),e.jsx(l,{value:"whatsapp",children:"WhatsApp"}),e.jsx(l,{value:"all",children:"All Channels"})]})]})]}),a.channel==="email"&&e.jsxs("div",{children:[e.jsx(N,{htmlFor:"template-subject",children:"Email Subject"}),e.jsx(B,{id:"template-subject",value:a.subject,onChange:s=>h({...a,subject:s.target.value}),placeholder:"e.g., Rent Payment Reminder"})]}),e.jsxs("div",{children:[e.jsx(N,{htmlFor:"template-body",children:"Message Body"}),e.jsx(te,{id:"template-body",value:a.body,onChange:s=>h({...a,body:s.target.value}),placeholder:"Type your message here...",rows:8}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Tip: Use ","{{variable_name}}"," syntax for dynamic content"]})]})]}),e.jsxs(he,{children:[e.jsx(o,{variant:"outline",onClick:()=>d(!1),children:"Cancel"}),e.jsx(o,{onClick:C,children:t?"Save Changes":"Create Template"})]})]})})]})}function _e(){const[i,c]=u.useState([]),[m,d]=u.useState("email"),[t,p]=u.useState(""),[a,h]=u.useState("all"),C=[{id:"1",name:"John Tenant",email:"[email protected]",phone:"+1 555-0101",property:"Sunset Apartments #101",tags:["active","on-time-payer"]},{id:"2",name:"Sarah Johnson",email:"[email protected]",phone:"+1 555-0102",property:"Downtown Plaza #205",tags:["active","renewal-due"]},{id:"3",name:"Mike Davis",email:"[email protected]",phone:"+1 555-0103",property:"Green Valley #302",tags:["active","on-time-payer"]},{id:"4",name:"Lisa Anderson",email:"[email protected]",phone:"+1 555-0104",property:"Riverside Complex #108",tags:["active","late-payment"]}].filter(r=>a==="all"?!0:r.tags.includes(a)),T=()=>{i.length===C.length?c([]):c(C.map(r=>r.id))},n=r=>{c(s=>s.includes(r)?s.filter(v=>v!==r):[...s,r])},f=()=>{if(i.length===0){x.error("Please select at least one recipient");return}if(!t.trim()){x.error("Please enter a message");return}x.success(`Sending ${m} to ${i.length} recipients`),p(""),c([])};return e.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[e.jsxs(j,{className:"lg:col-span-1",children:[e.jsxs(b,{children:[e.jsxs(w,{className:"flex items-center gap-2",children:[e.jsx(we,{className:"h-5 w-5"}),"Recipients (",i.length,")"]}),e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsx(N,{htmlFor:"filter",children:"Filter by:"}),e.jsxs(M,{value:a,onValueChange:h,children:[e.jsx(R,{id:"filter",className:"flex-1",children:e.jsx(A,{})}),e.jsxs(P,{children:[e.jsx(l,{value:"all",children:"All Tenants"}),e.jsx(l,{value:"on-time-payer",children:"On-Time Payers"}),e.jsx(l,{value:"late-payment",children:"Late Payments"}),e.jsx(l,{value:"renewal-due",children:"Renewal Due"})]})]})]})]}),e.jsxs(g,{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 pb-2 border-b",children:[e.jsx(q,{checked:i.length===C.length,onCheckedChange:T}),e.jsx("span",{className:"text-sm font-medium",children:"Select All"})]}),e.jsx("div",{className:"space-y-2 max-h-[500px] overflow-y-auto",children:C.map(r=>e.jsxs("div",{className:"flex items-start gap-2 p-3 border rounded-lg hover:bg-accent transition-colors",children:[e.jsx(q,{checked:i.includes(r.id),onCheckedChange:()=>n(r.id)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium",children:r.name}),e.jsx("p",{className:"text-sm text-muted-foreground truncate",children:r.property}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:r.tags.map(s=>e.jsx(S,{variant:"secondary",className:"text-xs",children:s},s))})]})]},r.id))})]})]}),e.jsxs(j,{className:"lg:col-span-2",children:[e.jsx(b,{children:e.jsxs(w,{className:"flex items-center gap-2",children:[e.jsx(H,{className:"h-5 w-5"}),"Compose Bulk Message"]})}),e.jsxs(g,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(N,{htmlFor:"channel",children:"Channel"}),e.jsxs(M,{value:m,onValueChange:d,children:[e.jsx(R,{id:"channel",children:e.jsx(A,{})}),e.jsxs(P,{children:[e.jsx(l,{value:"email",children:"Email"}),e.jsx(l,{value:"sms",children:"SMS"}),e.jsx(l,{value:"whatsapp",children:"WhatsApp"})]})]})]}),e.jsxs("div",{children:[e.jsx(N,{htmlFor:"template",children:"Use Template (Optional)"}),e.jsxs(M,{children:[e.jsx(R,{id:"template",children:e.jsx(A,{placeholder:"Select template..."})}),e.jsxs(P,{children:[e.jsx(l,{value:"rent-reminder",children:"Rent Reminder"}),e.jsx(l,{value:"maintenance",children:"Maintenance Update"}),e.jsx(l,{value:"renewal",children:"Lease Renewal"})]})]})]})]}),m==="email"&&e.jsxs("div",{children:[e.jsx(N,{htmlFor:"subject",children:"Subject"}),e.jsx("input",{id:"subject",type:"text",className:"w-full border rounded-md p-2",placeholder:"Email subject..."})]}),e.jsxs("div",{children:[e.jsx(N,{htmlFor:"message",children:"Message"}),e.jsx(te,{id:"message",value:t,onChange:r=>p(r.target.value),placeholder:"Type your message here...",rows:10}),e.jsxs("div",{className:"flex items-center justify-between mt-2",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.length," characters"]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Personalize with ","{{tenant_name}}",", ","{{property_name}}"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-accent rounded-lg",children:[e.jsx(ne,{className:"h-5 w-5 text-muted-foreground"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium",children:"Preview Personalization"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Messages will be personalized for each recipient"})]})]}),e.jsxs("div",{className:"flex justify-between items-center pt-4 border-t",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-medium",children:["Sending to ",i.length," recipients"]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Estimated cost: $",(i.length*.05).toFixed(2)]})]}),e.jsxs(o,{onClick:f,disabled:i.length===0,children:[e.jsx(H,{className:"h-4 w-4 mr-2"}),"Send Messages"]})]})]})]})]})}function Ie(){const i=[{title:"Total Messages Sent",value:"1,247",change:"+12%",icon:L,color:"text-foreground"},{title:"Delivery Rate",value:"98.5%",change:"+2.1%",icon:Ce,color:"text-green-500"},{title:"Open Rate",value:"67.3%",change:"+5.2%",icon:xe,color:"text-purple-500"},{title:"Response Rate",value:"34.8%",change:"+3.8%",icon:E,color:"text-orange-500"}],c=[{channel:"Email",sent:645,delivered:638,opened:430,clicked:145},{channel:"SMS",sent:384,delivered:380,opened:310,clicked:89},{channel:"WhatsApp",sent:218,delivered:216,opened:198,clicked:67}],m=[{date:"Mon",email:45,sms:32,whatsapp:18},{date:"Tue",email:52,sms:38,whatsapp:22},{date:"Wed",email:48,sms:35,whatsapp:20},{date:"Thu",email:61,sms:42,whatsapp:28},{date:"Fri",email:55,sms:40,whatsapp:25},{date:"Sat",email:38,sms:28,whatsapp:15},{date:"Sun",email:35,sms:25,whatsapp:12}],d=[{name:"Rent Reminders",sent:245,opened:198,rate:81},{name:"Maintenance Updates",sent:186,opened:165,rate:89},{name:"Lease Renewals",sent:92,opened:71,rate:77},{name:"General Notices",sent:134,opened:89,rate:66}];return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:i.map(t=>{const p=t.icon;return e.jsx(j,{children:e.jsx(g,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:t.title}),e.jsx("p",{className:"text-2xl font-bold mt-2",children:t.value}),e.jsxs("p",{className:"text-sm text-green-500 mt-1",children:[t.change," from last month"]})]}),e.jsx(p,{className:`h-8 w-8 ${t.color}`})]})})},t.title)})}),e.jsxs(j,{children:[e.jsx(b,{children:e.jsx(w,{children:"Channel Performance"})}),e.jsx(g,{children:e.jsx(G,{width:"100%",height:300,children:e.jsxs(Te,{data:c,children:[e.jsx(J,{strokeDasharray:"3 3"}),e.jsx(Q,{dataKey:"channel"}),e.jsx(X,{}),e.jsx(Y,{}),e.jsx(Z,{}),e.jsx(F,{dataKey:"sent",fill:"#3b82f6",name:"Sent"}),e.jsx(F,{dataKey:"delivered",fill:"#10b981",name:"Delivered"}),e.jsx(F,{dataKey:"opened",fill:"#8b5cf6",name:"Opened"}),e.jsx(F,{dataKey:"clicked",fill:"#f59e0b",name:"Clicked"})]})})})]}),e.jsxs(j,{children:[e.jsx(b,{children:e.jsx(w,{children:"Message Volume Trends (Last 7 Days)"})}),e.jsx(g,{children:e.jsx(G,{width:"100%",height:300,children:e.jsxs(ke,{data:m,children:[e.jsx(J,{strokeDasharray:"3 3"}),e.jsx(Q,{dataKey:"date"}),e.jsx(X,{}),e.jsx(Y,{}),e.jsx(Z,{}),e.jsx(z,{type:"monotone",dataKey:"email",stroke:"#3b82f6",name:"Email",strokeWidth:2}),e.jsx(z,{type:"monotone",dataKey:"sms",stroke:"#10b981",name:"SMS",strokeWidth:2}),e.jsx(z,{type:"monotone",dataKey:"whatsapp",stroke:"#8b5cf6",name:"WhatsApp",strokeWidth:2})]})})})]}),e.jsxs(j,{children:[e.jsx(b,{children:e.jsx(w,{children:"Campaign Performance"})}),e.jsx(g,{children:e.jsx("div",{className:"space-y-4",children:d.map(t=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium",children:t.name}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.opened,"/",t.sent," opened (",t.rate,"%)"]})]}),e.jsx(Se,{value:t.rate})]},t.name))})})]})]})}function Fe(){const i=[{id:"1",name:"Gmail SMTP",type:"email",status:"connected",lastSync:"2 minutes ago",messagesSent:645,description:"Sending emails via Gmail"},{id:"2",name:"Twilio SMS",type:"sms",status:"connected",lastSync:"5 minutes ago",messagesSent:384,description:"SMS messaging service"},{id:"3",name:"WhatsApp Business",type:"whatsapp",status:"warning",lastSync:"1 hour ago",messagesSent:218,description:"Message template approval pending"},{id:"4",name:"Resend API",type:"email",status:"error",lastSync:"3 hours ago",messagesSent:0,description:"API key invalid or expired"}],c=a=>{switch(a){case"connected":return e.jsx(Me,{className:"h-5 w-5 text-green-500"});case"warning":return e.jsx(je,{className:"h-5 w-5 text-yellow-500"});case"error":return e.jsx(De,{className:"h-5 w-5 text-destructive"});default:return null}},m=a=>{switch(a){case"connected":return e.jsx(S,{className:"bg-green-500/10 text-green-500",children:"Connected"});case"warning":return e.jsx(S,{className:"bg-yellow-500/10 text-yellow-500",children:"Warning"});case"error":return e.jsx(S,{className:"bg-destructive/10 text-destructive",children:"Error"});default:return null}},d=a=>{x.success(`Testing ${a.name}...`)},t=a=>{x.success(`Syncing ${a.name}...`)},p=a=>{x.info(`Opening settings for ${a.name}`)};return e.jsxs(j,{children:[e.jsx(b,{children:e.jsxs(w,{className:"flex items-center gap-2",children:[e.jsx(O,{className:"h-5 w-5"}),"Integration Status"]})}),e.jsx(g,{children:e.jsx("div",{className:"space-y-4",children:i.map(a=>e.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg hover:bg-accent/50 transition-colors",children:[e.jsx("div",{className:"mt-1",children:c(a.status)}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx("div",{className:"flex items-start justify-between",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-semibold",children:a.name}),m(a.status)]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:a.description})]})}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("span",{children:["Last sync: ",a.lastSync]}),e.jsx("span",{children:"â¢"}),e.jsxs("span",{children:[a.messagesSent," messages sent"]})]}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsx(o,{variant:"outline",size:"sm",onClick:()=>d(a),children:"Test Connection"}),e.jsxs(o,{variant:"outline",size:"sm",onClick:()=>t(a),children:[e.jsx(ue,{className:"h-4 w-4 mr-1"}),"Sync"]}),e.jsxs(o,{var
15iant:"outline",size:"sm",onClick:()=>p(a),children:[e.jsx(O,{className:"h-4 w-4 mr-1"}),"Configure"]})]})]})]},a.id))})})]})}function Dt(){return e.jsxs(ie,{children:[e.jsx(Re,{title:"Communications Hub",description:"Unified inbox, message templates, bulk messaging, and analytics"}),e.jsx(le,{title:"Communications Hub",subtitle:"Manage all your communications in one place",icon:e.jsx(E,{className:"h-5 w-5"})}),e.jsxs(ee,{defaultValue:"inbox",className:"space-y-6",children:[e.jsxs(se,{className:"flex w-full md:grid md:grid-cols-5",children:[e.jsx(y,{value:"inbox",children:"Unified Inbox"}),e.jsx(y,{value:"bulk",children:"Bulk Messaging"}),e.jsx(y,{value:"templates",children:"Templates"}),e.jsx(y,{value:"analytics",children:"Analytics"}),e.jsx(y,{value:"integrations",children:"Integrations"})]}),e.jsx(D,{value:"inbox",className:"space-y-6",children:e.jsx(Ae,{})}),e.jsx(D,{value:"bulk",className:"space-y-6",children:e.jsx(_e,{})}),e.jsx(D,{value:"templates",className:"space-y-6",children:e.jsx(Pe,{})}),e.jsx(D,{value:"analytics",className:"space-y-6",children:e.jsx(Ie,{})}),e.jsx(D,{value:"integrations",className:"space-y-6",children:e.jsx(Fe,{})})]})]})}export{Dt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.