PageSourceSearch

https://www.smallbizagent.ai/assets/dashboard-Dx30xjkl.js

js smallbizagent.ai collected 2026-10-05 15:06:11 UTC 22,996 bytes, 1 lines download raw bytes

1import{e as ze,r as m,u as M,d as ge,j as e}from"./vendor-query-CnAhr2B8.js";import{g as He,a as Ie,u as Fe,H as w,ak as _,B as i,au as je,e as Ne,C as G,d as b,bu as Ae,p as x,s as h,q as L,r as z,aT as K,ab as ve,a9 as Re,P as pe,J as ye,aC as H,I as B,O as qe,Q as Pe,R as Ue,T as Ve,V as _e,Y as Ge,a8 as Ke}from"./index-CLUtDhnY.js";import{u as Be,f as we,a as Q,S as be}from"./use-business-hours-BVDO-KPC.js";import{M as Qe}from"./minimize-2-CEejOsk8.js";import{E as Y}from"./eye-Dal3N8ej.js";import{M as Ye}from"./maximize-2-BKCNVxrM.js";import{U as De}from"./user-D7D5Y3_w.js";import{C as We}from"./calendar-off-BwXTqyob.js";import"./vendor-ui-CYA7SV0W.js";import"./vendor-charts-CPMWc2oJ.js";import"./vendor-forms-UY-il7MQ.js";const Je=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],f=70,Xe=["Vacation","Sick","Personal","Training","Holiday","Other"];function ms(){var oe,me,xe;const{user:Ze,logoutMutation:Se}=He(),{toast:k}=Ie(),W=ze();Fe();const{hourStart:J,hours:g}=Be(),[o,C]=m.useState(new Date),[I,F]=m.useState(!1),[D,Te]=m.useState(new Date),[A,X]=m.useState("grid"),[Z,R]=m.useState(!1),[c,S]=m.useState({startDate:"",endDate:"",reason:"Vacation",note:""});m.useEffect(()=>{const s=setInterval(()=>Te(new Date),3e4);return()=>clearInterval(s)},[]),m.useEffect(()=>{function s(a){I&&(a.key==="Escape"?F(!1):a.key==="ArrowLeft"?N(-1):a.key==="ArrowRight"?N(1):(a.key==="t"||a.key==="T")&&C(new Date))}return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[I]);const{data:t,isLoading:Oe}=M({queryKey:["/api/staff/me"],queryFn:async()=>(await w("GET","/api/staff/me")).json()}),ee=new Date(o);ee.setHours(0,0,0,0);const se=new Date(o);se.setHours(23,59,59,999);const{data:d=[],isLoading:ke}=M({queryKey:["/api/staff/me/appointments",o.toISOString().split("T")[0]],queryFn:async()=>(await w("GET",`/api/staff/me/appointments?startDate=${ee.toISOString()}&endDate=${se.toISOString()}`)).json(),refetchInterval:1e4,staleTime:5e3}),{data:te=[]}=M({queryKey:["/api/staff/me/appointments","upcoming"],queryFn:async()=>{const s=new Date,a=new Date(s.getTime()+30*24*60*60*1e3);return(await w("GET",`/api/staff/me/appointments?startDate=${s.toISOString()}&endDate=${a.toISOString()}`)).json()},refetchInterval:3e4}),{data:ae=[]}=M({queryKey:["/api/staff/me/time-off"],queryFn:async()=>(await w("GET","/api/staff/me/time-off")).json()}),q=ge({mutationFn:async s=>(await w("POST","/api/staff/me/time-off",{startDate:new Date(s.startDate+"T00:00:00").toISOString(),endDate:new Date(s.endDate+"T23:59:59").toISOString(),reason:s.reason,note:s.note||null,allDay:!0})).json(),onSuccess:()=>{W.invalidateQueries({queryKey:["/api/staff/me/time-off"]}),S({startDate:"",endDate:"",reason:"Vacation",note:""}),R(!1),k({title:"Time off added",description:"Your schedule has been updated."})},onError:()=>{k({title:"Error",description:"Failed to add time off",variant:"destructive"})}}),ne=ge({mutationFn:async s=>{await w("DELETE",`/api/staff/me/time-off/${s}`)},onSuccess:()=>{W.invalidateQueries({queryKey:["/api/staff/me/time-off"]}),k({title:"Removed",description:"Time off entry removed."})},onError:()=>{k({title:"Error",description:"Failed to remove time off",variant:"destructive"})}}),re=ae.filter(s=>new Date(s.endDate)>=new Date).sort((s,a)=>new Date(s.startDate).getTime()-new Date(a.startDate).getTime()),ie=ae.filter(s=>new Date(s.endDate)<new Date).sort((s,a)=>new Date(a.startDate).getTime()-new Date(s.startDate).getTime()),j=s=>new Date(s).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),N=s=>{const a=new Date(o);a.setDate(a.getDate()+s),C(a)},$=o.toDateString()===new Date().toDateString(),v=s=>new Date(s).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),le=s=>s.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"}),Ce=s=>{const a=Q(s);return`${a.bg} ${a.text}`},ce=()=>o.toLocaleDateString("en-US",{weekday:"long"}).toLowerCase(),p=(oe=t==null?void 0:t.hours)==null?void 0:oe.find(s=>s.day===ce()),de=$,P=(D.getHours()*60+D.getMinutes()-J*60)/60*f,$e=d.length,Ee=d.filter(s=>s.status==="confirmed").length,Me=d.filter(s=>s.status==="scheduled").length;if(d.filter(s=>s.status==="completed").length,Oe)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsx(_,{className:"h-8 w-8 animate-spin"})});if(I){const s=D.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}),a=90,n=(D.getHours()*60+D.getMinutes()-J*60)/60*a;return e.jsxs("div",{className:"fixed inset-0 z-50 bg-white flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-3 bg-black text-white border-b border-neutral-800 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(i,{variant:"ghost",size:"icon",className:"text-neutral-400 hover:text-white hover:bg-neutral-800",onClick:()=>N(-1),children:e.jsx(je,{className:"h-5 w-5"})}),e.jsx(i,{variant:"ghost",size:"sm",className:`text-sm font-medium ${$?"bg-white text-black hover:bg-neutral-200":"text-neutral-300 hover:text-white hover:bg-neutral-800"}`,onClick:()=>C(new Date),children:"Today"}),e.jsx(i,{variant:"ghost",size:"icon",className:"text-neutral-400 hover:text-white hover:bg-neutral-800",onClick:()=>N(1),children:e.jsx(Ne,{className:"h-5 w-5"})}),e.jsxs("div",{className:"ml-2",children:[e.jsx("h1",{className:"text-lg font-bold",children:le(o)}),e.jsxs("p",{className:"text-xs text-neutral-400",children:[t==null?void 0:t.firstName," ",t
1==null?void 0:t.lastName," — ",t==null?void 0:t.businessName]})]})]}),e.jsxs("div",{className:"hidden md:flex items-center gap-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(G,{className:"h-4 w-4 text-neutral-400"}),e.jsxs("span",{className:"text-sm",children:[e.jsx("span",{className:"font-bold",children:$e}),e.jsx("span",{className:"text-neutral-400 ml-1",children:"total"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500"}),e.jsxs("span",{className:"text-sm",children:[e.jsx("span",{className:"font-bold",children:Ee}),e.jsx("span",{className:"text-neutral-400 ml-1",children:"confirmed"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500"}),e.jsxs("span",{className:"text-sm",children:[e.jsx("span",{className:"font-bold",children:Me}),e.jsx("span",{className:"text-neutral-400 ml-1",children:"scheduled"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"text-lg font-mono font-bold tabular-nums hidden sm:block",children:s}),e.jsxs(i,{variant:"ghost",size:"sm",className:"text-neutral-400 hover:text-white hover:bg-neutral-800",onClick:()=>F(!1),children:[e.jsx(Qe,{className:"h-4 w-4 mr-2"}),"Exit"]})]})]}),e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs("div",{className:"grid grid-cols-[72px_1fr] relative",style:{minHeight:g.length*a},children:[de&&n>=0&&n<=g.length*a&&e.jsxs("div",{className:"absolute left-0 right-0 z-20 pointer-events-none flex items-center",style:{top:n},children:[e.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500 -ml-1 shadow-lg"}),e.jsx("div",{className:"flex-1 h-0.5 bg-red-500"})]}),g.map(l=>{const y=d.filter(r=>new Date(r.startDate).getHours()===l);return e.jsxs("div",{className:"contents",children:[e.jsx("div",{className:"text-sm text-gray-400 text-right pr-3 pt-2 border-b border-r bg-gray-50/50 font-medium",style:{height:a},children:we(l)}),e.jsx("div",{className:"relative border-b",style:{height:a},children:y.map(r=>{var ue,fe;const U=new Date(r.startDate),E=U.getMinutes()/60*a,V=(new Date(r.endDate).getTime()-U.getTime())/6e4,O=Math.max(V/60*a-2,40),u=Q(r.status),Le=r.customer?`${r.customer.firstName} ${r.customer.lastName}`.trim():"Walk-in";return e.jsxs("div",{className:`absolute left-2 right-2 rounded-lg px-4 py-2 border-l-4 overflow-hidden transition-all hover:shadow-lg z-10 ${u.bg} ${u.border}`,style:{top:E,height:O},children:[e.jsx("div",{className:`text-base font-bold truncate ${u.text}`,children:Le}),e.jsxs("div",{className:"text-sm text-gray-500 truncate",children:[((ue=r.service)==null?void 0:ue.name)||"Appointment"," · ",v(r.startDate)," - ",v(r.endDate)]}),O>60&&((fe=r.customer)==null?void 0:fe.phone)&&e.jsx("div",{className:"text-sm text-gray-400 truncate mt-0.5",children:r.customer.phone}),e.jsx("div",{className:"absolute top-2 right-2",children:e.jsx("div",{className:`w-2.5 h-2.5 rounded-full ${u.dot}`})})]},r.id)})})]},`fs-${l}`)})]})}),e.jsxs("div",{className:"flex items-center justify-between px-6 py-2 bg-gray-50 border-t text-xs text-gray-500 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{children:["Press ",e.jsx("kbd",{className:"px-1.5 py-0.5 bg-white border rounded text-gray-700 font-mono",children:"Esc"})," to exit"]}),e.jsxs("span",{children:[e.jsx("kbd",{className:"px-1.5 py-0.5 bg-white border rounded text-gray-700 font-mono",children:"←"})," ",e.jsx("kbd",{className:"px-1.5 py-0.5 bg-white border rounded text-gray-700 font-mono",children:"→"})," navigate"]}),e.jsxs("span",{children:[e.jsx("kbd",{className:"px-1.5 py-0.5 bg-white border rounded text-gray-700 font-mono",children:"T"})," today"]})]}),e.jsx("div",{className:"flex items-center gap-3",children:Object.entries(be).map(([l,y])=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:`w-2 h-2 rounded-full ${y.dot}`}),e.jsx("span",{className:"capitalize",children:l})]},l))}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Y,{className:"h-3 w-3"})," View only · Auto-refreshes"]})]})]})}return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("header",{className:"sticky top-0 z-10 bg-black text-white border-b border-neutral-800",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-lg font-bold",children:[t==null?void 0:t.firstName," ",t
1==null?void 0:t.lastName]}),e.jsxs("p",{className:"text-xs text-neutral-400",children:[(t==null?void 0:t.specialty)||"Team Member"," — ",t==null?void 0:t.businessName]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(b,{variant:"secondary",className:"bg-neutral-800 text-neutral-300 border-neutral-700",children:[e.jsx(Y,{className:"h-3 w-3 mr-1"}),"View Only"]}),e.jsxs(i,{variant:"ghost",size:"sm",className:"text-neutral-400 hover:text-white",onClick:()=>Se.mutate(),children:[e.jsx(Ae,{className:"h-4 w-4 mr-1"}),"Logout"]})]})]})}),e.jsxs("div",{className:"max-w-5xl mx-auto px-4 py-6 space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[e.jsx(x,{children:e.jsxs(h,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold",children:d.length}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Today"})]})}),e.jsx(x,{children:e.jsxs(h,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold",children:te.filter(s=>s.status==="confirmed").length}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Confirmed"})]})}),e.jsx(x,{children:e.jsxs(h,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold",children:te.length}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"This Month"})]})}),e.jsx(x,{children:e.jsxs(h,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-sm font-medium",children:p!=null&&p.isOff?"Day Off":p?`${p.startTime} - ${p.endTime}`:"No schedule"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Today's Hours"})]})})]}),e.jsxs(x,{children:[e.jsxs(L,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[e.jsxs(z,{className:"flex items-center gap-2",children:[e.jsx(G,{className:"h-5 w-5"}),"My Appointments"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(i,{variant:"outline",size:"sm",onClick:()=>N(-1),children:e.jsx(je,{className:"h-4 w-4"})}),e.jsx(i,{variant:$?"default":"outline",size:"sm",onClick:()=>C(new Date),children:"Today"}),e.jsx(i,{variant:"outline",size:"sm",onClick:()=>N(1),children:e.jsx(Ne,{className:"h-4 w-4"})}),e.jsxs("div",{className:"border-l pl-2 ml-1 flex items-center gap-1",children:[e.jsxs("div",{className:"flex rounded-lg border overflow-hidden",children:[e.jsx("button",{onClick:()=>X("grid"),className:`px-3 py-1 text-xs font-medium transition-colors ${A==="grid"?"bg-primary text-primary-foreground":"bg-white text-gray-600 hover:bg-gray-50"}`,children:"Grid"}),e.jsx("button",{onClick:()=>X("list"),className:`px-3 py-1 text-xs font-medium transition-colors border-l ${A==="list"?"bg-primary text-primary-foreground":"bg-white text-gray-600 hover:bg-gray-50"}`,children:"List"})]}),e.jsx(i,{variant:"outline",size:"sm",onClick:()=>F(!0),title:"Open fullscreen schedule",children:e.jsx(Ye,{className:"h-4 w-4"})})]})]})]}),e.jsx(K,{children:le(o)})]}),e.jsx(h,{children:ke?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(_,{className:"h-6 w-6 animate-spin"})}):d.length===0?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[e.jsx(G,{className:"h-12 w-12 mx-auto mb-3 opacity-50"}),e.jsx("p",{className:"font-medium",children:"No appointments"}),e.jsx("p",{className:"text-sm",children:$?"You're free today!":"Nothing scheduled for this day."})]}):A==="grid"?e.jsxs("div",{className:"border rounded-lg overflow-hidden bg-white",children:[e.jsx("div",{className:"overflow-y-auto",style:{maxHeight:"65vh"},children:e.jsxs("div",{className:"grid grid-cols-[60px_1fr] relative",style:{minHeight:g.length*f},children:[de&&P>=0&&P<=g.length*f&&e.jsxs("div",{className:"absolute left-0 right-0 z-20 pointer-events-none flex items-center",style:{top:P},children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500 -ml-0.5 shadow-lg"}),e.jsx("div",{className:"flex-1 h-0.5 bg-red-500"})]}),g.map(s=>{const a=d.filter(n=>new Date(n.startDate).getHours()===s);return e.jsxs("div",{className:"contents",children:[e.jsx("div",{className:"text-xs text-gray-400 text-right pr-2 pt-1 border-b border-r bg-gray-50/50",style:{height:f},children:we(s)}),e.jsx("div",{className:"relative border-b",style:{height:f},children:a.map(n=>{var O,u;const l=new Date(n.startDate),r=l.getMinutes()/60*f,he=(new Date(n.endDate).getTime()-l.getTime())/6e4,E=Math.max(he/60*f-2,32),T=Q(n.status),V=n.customer?`${n.customer.firstName} ${n.customer.lastName}`.trim():"Walk-in";return e.jsxs("div",{className:`absolute left-1 right-1 rounded-md px-3 py-1.5 border-l-4 overflow-hidden transition-all hover:shadow-md z-10 ${T.bg} ${T.border}
1`,style:{top:r,height:E},children:[e.jsx("div",{className:`text-xs font-bold truncate ${T.text}`,children:V}),e.jsxs("div",{className:"text-[11px] text-gray-500 truncate",children:[((O=n.service)==null?void 0:O.name)||"Appointment"," · ",v(n.startDate)," - ",v(n.endDate)]}),E>50&&((u=n.customer)==null?void 0:u.phone)&&e.jsx("div",{className:"text-[10px] text-gray-400 truncate",children:n.customer.phone}),e.jsx("div",{className:"absolute top-1.5 right-1.5",children:e.jsx("div",{className:`w-2 h-2 rounded-full ${T.dot}`})})]},n.id)})})]},`grid-${s}`)})]})}),e.jsxs("div",{className:"flex items-center gap-4 px-4 py-2 bg-gray-50 border-t text-xs text-gray-500",children:[Object.entries(be).map(([s,a])=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:`w-2 h-2 rounded-full ${a.dot}`}),e.jsx("span",{className:"capitalize",children:s})]},s)),e.jsxs("span",{className:"ml-auto flex items-center gap-1",children:[e.jsx(Y,{className:"h-3 w-3"})," View only"]})]})]}):e.jsx("div",{className:"space-y-3",children:d.sort((s,a)=>new Date(s.startDate).getTime()-new Date(a.startDate).getTime()).map(s=>e.jsx("div",{className:"border rounded-lg p-4 hover:bg-muted/50 transition-colors",children:e.jsx("div",{className:"flex items-start justify-between",children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ve,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs("span",{className:"font-medium",children:[v(s.startDate)," — ",v(s.endDate)]}),e.jsx(b,{className:Ce(s.status),children:s.status})]}),s.service&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Re,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsxs("span",{children:[s.service.name," (",s.service.duration," min)"]})]}),s.customer&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(De,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsxs("span",{children:[s.customer.firstName," ",s.customer.lastName]}),s.customer.phone&&e.jsxs(e.Fragment,{children:[e.jsx(pe,{className:"h-3.5 w-3.5 text-muted-foreground ml-2"}),e.jsx("a",{href:`tel:${s.customer.phone}`,className:"text-primary underline",children:s.customer.phone})]})]}),s.notes&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Notes: ",s.notes]})]})})},s.id))})})]}),e.jsxs(x,{children:[e.jsxs(L,{children:[e.jsxs(z,{className:"flex items-center gap-2",children:[e.jsx(ve,{className:"h-5 w-5"}),"My Schedule"]}),e.jsx(K,{children:"Your regular working hours"})]}),e.jsx(h,{children:e.jsx("div",{className:"space-y-2",children:Je.map(s=>{var l;const a=(l=t==null?void 0:t.hours)==null?void 0:l.find(y=>y.day===s),n=ce()===s;return e.jsxs("div",{className:`flex items-center justify-between p-3 rounded-lg ${n?"bg-primary/10 border border-primary/20":"hover:bg-muted/50"}`,children:[e.jsx("span",{className:"font-medium capitalize w-28",children:s}),a!=null&&a.isOff?e.jsx(b,{variant:"secondary",children:"Day Off"}):a?e.jsxs("span",{className:"text-sm",children:[a.startTime," — ",a.endTime]}):e.jsx("span",{className:"text-sm text-muted-foreground",children:"Not set"})]},s)})})})]}),e.jsxs(x,{children:[e.jsx(L,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(z,{className:"flex items-center gap-2",children:[e.jsx(We,{className:"h-5 w-5"}),"Time Off"]}),e.jsx(K,{children:"Request days off — the AI won't book you during these times"})]}),e.jsxs(i,{size:"sm",variant:"outline",onClick:()=>R(!Z),children:[e.jsx(ye,{className:"h-4 w-4 mr-1"}),"Add"]})]})}),e.jsxs(h,{children:[Z&&e.jsxs("div",{className:"space-y-3 mb-4 p-3 border rounded-lg bg-muted/30",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(H,{className:"text-xs",children:"Start Date"}),e.jsx(B,{type:"date",value:c.startDate,onChange:s=>{const a=s.target.value;S(n=>({...n,startDate:a,endDate:!n.endDate||a>n.endDate?a:n.endDate}))},min:new Date().toISOString().split("T")[0]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(H,{className:"text-xs",children:"End Date"}
1),e.jsx(B,{type:"date",value:c.endDate,onChange:s=>S({...c,endDate:s.target.value}),min:c.startDate||new Date().toISOString().split("T")[0]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(H,{className:"text-xs",children:"Reason"}),e.jsxs(qe,{value:c.reason,onValueChange:s=>S({...c,reason:s}),children:[e.jsx(Pe,{className:"h-9",children:e.jsx(Ue,{})}),e.jsx(Ve,{children:Xe.map(s=>e.jsx(_e,{value:s,children:s},s))})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(H,{className:"text-xs",children:"Note"}),e.jsx(B,{value:c.note,onChange:s=>S({...c,note:s.target.value}),placeholder:"Optional",className:"h-9"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(i,{size:"sm",onClick:()=>q.mutate(c),disabled:!c.startDate||!c.endDate||q.isPending,children:[q.isPending?e.jsx(_,{className:"h-4 w-4 mr-1 animate-spin"}):e.jsx(ye,{className:"h-4 w-4 mr-1"}),"Save"]}),e.jsx(i,{size:"sm",variant:"ghost",onClick:()=>R(!1),children:"Cancel"})]})]}),re.length===0&&ie.length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-3",children:'No time off scheduled. Tap "Add" to request days off.'}):e.jsxs("div",{className:"space-y-2",children:[re.map(s=>{const a=new Date(s.startDate).toDateString()===new Date(s.endDate).toDateString();return e.jsxs("div",{className:"flex items-center justify-between p-2 rounded-lg border bg-muted/50",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium",children:a?j(s.startDate):`${j(s.startDate)} - ${j(s.endDate)}`}),e.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s.reason&&e.jsx(b,{variant:"outline",className:"text-xs py-0 h-5",children:s.reason}),s.note&&e.jsx("span",{className:"truncate",children:s.note})]})]}),e.jsx(i,{variant:"ghost",size:"sm",onClick:()=>{confirm("Remove this time off?")&&ne.mutate(s.id)},disabled:ne.isPending,children:e.jsx(Ge,{className:"h-4 w-4 text-destructive"})})]},s.id)}),ie.slice(0,3).map(s=>{const a=new Date(s.startDate).toDateString()===new Date(s.endDate).toDateString();return e.jsx("div",{className:"flex items-center justify-between p-2 rounded-lg border opacity-50 bg-muted/20",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm",children:a?j(s.startDate):`${j(s.startDate)} - ${j(s.endDate)}`}),e.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s.reason&&e.jsx(b,{variant:"secondary",className:"text-xs py-0 h-5",children:s.reason}),e.jsx(b,{variant:"secondary",className:"text-xs py-0 h-5",children:"Past"})]})]})},s.id)})]})]})]}),e.jsxs(x,{children:[e.jsx(L,{children:e.jsxs(z,{className:"flex items-center gap-2",children:[e.jsx(De,{className:"h-5 w-5"}),"My Profile"]})}),e.jsx(h,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"h-16 w-16 rounded-full bg-primary/10 flex items-center justify-center text-primary text-xl font-bold",children:[(me=t==null?void 0:t.firstName)==null?void 0:me[0],(xe=t==null?void 0:t.lastName)==null?void 0:xe[0]]}),e.jsxs("div",{children:[e.jsxs("h3",{className:"font-semibold text-lg",children:[t==null?void 0:t.firstName," ",t==null?void 0:t.lastName]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:(t==null?void 0:t.specialty)||"Team Member"})]})]}),(t==null?void 0:t.email)&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Ke,{className:"h-4 w-4 text-muted-foreground"}),t.email]}),(t==null?void 0:t.phone)&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(pe,{className:"h-4 w-4 text-muted-foreground"}),t.phone]}),(t==null?void 0:t.bio)&&e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:t.bio})]})})]})]})]})}export{ms 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.