PageSourceSearch

https://app2.sked.life/assets/calendar.component-CjH0ZPg2.js

js sked.life collected 2026-10-02 12:13:33 UTC 51,961 bytes, 1 lines download raw bytes

1import{az as wt,j as t,J as et,jd as Ct,f2 as _t,B as Ze,je as Ot,ae as At,V as Yt,jf as Gt,jg as Ut,jh as Xt,ji as Vt,N as Kt,be as Zt,bE as qt,ak as Jt,n as f,M as Qt,H as G,dz as Se,cW as je,cY as Le,eC as Ne,R as a,L as Y,bj as Tt,fe as kt,ay as ve,p as de,dg as en,r as Fe,cA as tn,ag as it,a3 as he,a4 as ot,a6 as k,a9 as rt,A as nn,a5 as Me,G as H,a$ as tt,cF as Ie,aA as qe,bl as lt,b0 as at,$ as Ee,u as sn,e as on,a as ct,b as Ye,i as Ge,c as rn,d as ln,f0 as an,i8 as cn,m as dn,f as pn,C as mn,jj as un,jk as dt,jl as pt,jm as hn,jn as Ue,jo as fn,c7 as gn}from"./index-2k2e1F8S.js";import{P as xn}from"./intake-list.page-Cu2FOuGL.js";import{A as yn}from"./Add-BvHB-VPL.js";import{A as vn,T as bn,t as Sn,e as jn,C as wn}from"./Appointments.component-xcykr4Sn.js";import{f as Cn,b as An,c as We,d as Tn,e as Dt,g as kn,h as Dn}from"./getCalendarApi-D3kj9EUM.js";import{g as In,a as Ln}from"./appointments.service-J_UpJqSF.js";import{a as mt,B as $e,T as Nn}from"./TableContainer.component-DbVZvbOn.js";import{T as Hn}from"./TableRow-B_Xdv0vT.js";import{L as zn}from"./ListItem-Bbo2Atif.js";import{p as Pn}from"./pick-Eb_0nsQq.js";import{D as En}from"./DialogTitle-C4ffLzD_.js";import{D as Wn}from"./DialogContent-BjQuEoSh.js";import{F as $n}from"./FormControlLabel-DTmxyUmR.js";import{C as Rn}from"./Checkbox-CyLj9Qpv.js";import{D as Fn}from"./DialogActions-Bn9BjVxc.js";import{E as Mn}from"./Visibility-CPZPh7-k.js";import{F as nt}from"./FilterHeader.component-9vKVsrMw.js";import{S as Bn}from"./Switch-9VfNviW1.js";import{I as ut}from"./InputAdornment-D_vrziC0.js";import{u as _n}from"./useTitle-CTZNLmI5.js";import{P as On}from"./PageHeader.component-3dQc61hD.js";import{S as Yn}from"./SelectProfessional.component-Dxhisuvv.js";import{F as Gn}from"./FilterLocations.component-Cot1zzdl.js";import{C as Un}from"./FilterStartEndDate.component-CuwFXPlQ.js";import{C as Xn,D as Vn}from"./DateInput.component-BQxPXKGY.js";import{F as ht}from"./FilterSelect.component-Bq_PmD3e.js";import{A as Kn}from"./AppointmentTypeLabel.component-DQp-xMkV.js";import"./Delete-TmGf8XG4.js";import"./promise.hook-BeqSMSpU.js";import"./HeaderTabs.component-CEAaAfJ_.js";import"./KeyboardArrowDown-BHrHG3Mm.js";import"./Settings.icon-DbzBDNHV.js";import"./Copy.icon-BUZYPIzG.js";import"./TableHead-BF_d99Ij.js";import"./CheckBox-BfB6V0Cq.js";import"./Convert.component-BsMcnHdk.js";import"./Clock.icon-Bvr6hVKa.js";import"./range-DHSINqi3.js";import"./chain-r-wqyjzJ.js";import"./CheckCircle-C_HUDRG5.js";import"./Professional.icon-DnIWutr2.js";import"./ApptTypeSelector.component-EWG4Y7VK.js";import"./ExpandLess-Chga_r89.js";import"./Search-CkpQcndd.js";import"./KeyboardArrowUp-BPKn8ZPp.js";import"./Input.component-x3IBogpr.js";import"./inputAdornmentClasses-DAPYZ7aH.js";import"./Radio-C6B0eTuQ.js";import"./Checkbox.component-drCMVWvX.js";import"./PartialChecked.icon-Cg4BldBY.js";import"./Button.component-BxpK7Xc6.js";import"./useDrop-C-hUx1J0.js";import"./difference-BfmijKj_.js";import"./Box-J9ns1Mf-.js";import"./Collapse-CyyoCvKq.js";import"./intersection-CvKlKIce.js";import"./LockModal.component-ygEBKEFh.js";import"./RoundExclamation.icon-Cw5idCuV.js";import"./emoji-B3ceABCI.js";import"./index-BcA84JJb.js";import"./Check-CeNJHpI6.js";import"./Error-1FM79VlE.js";import"./ChevronLeft-B5IBp7lf.js";import"./KeyboardArrowRight-Bch2APbE.js";import"./Editor.component-9RjPO1Vb.js";import"./Info-v2HnUEsb.js";import"./TipTap.component-DAdOJtRB.js";import"./Link-CBIsPU2V.js";import"./Undo-DxLXRrh8.js";import"./Google-CLQvVlx_.js";import"./ImageUpload.component-ZwBTJrEM.js";import"./Lock-xVLNkkZ9.js";import"./components.component-Cu0TTQ7g.js";import"./Tabs-Bx01J7i8.js";import"./htmlTemplates-Do-QgPes.js";import"./fromPairs-eFGrIL2n.js";import"./forEach-DO2W1516.js";import"./gt-C04ZannU.js";import"./OpenInNew-CQNJnWC3.js";import"./dripCampaigns.types-BIQG0yzx.js";import"./phone-B39Y4O8P.js";import"./Container.component-CmG6p6ds.js";import"./PhoneInput.component-OLhflosC.js";import"./Delete.icon-B2ZEksMb.js";import"./placeholders-BGlTkxmw.js";import"./quick-replies.page-BJwNeT0r.js";import"./FilterText.component-DX2RZ1LH.js";import"./Link-J-dERu0A.js";import"./SwapVert-pZQINl7e.js";import"./useEppPlaceholders-4s2MCAmW.js";import"./NewPatientPortal.actions-C3PsWlK1.js";import"./Trash.icon-D3NE4Rsn.js";import"./automation-message.actions-DMBERNQA.js";import"./automations.actions-CtP7CGGz.js";import"./intersperse-DJV4HeB6.js";import"./Edit-CnMlClWI.js";import"./OpenInNewTab.icon-C9YptI6T.js";import"./Reports.icon-CtyS6F4m.js";import"./Avatar-C0xwm1EY.js";import"./CalloutCard.component-C782SQjO.js";import"./getValidReactChildren-DpiZ8iPW.js";import"./AccordionSummary-w03QlhNd.js";import"./automations.page-ITbPuAEc.js";import"./ChevronRight-D7JFQKUD.js";import"./feature-disabled.component-BcL7Qi9I.js";import"./typeahead.hook-C1tlD2BH.js";
1import"./MessageComposer.component-9X6tJC8T.js";import"./TagsSelector.component--6R4WKqj.js";import"./Autocomplete.component-DM0hn9df.js";import"./DrawerList.component-UrF4xbDr.js";import"./Tag.component-BVO2lwdQ.js";import"./Loading.component-Dq4YBBIA.js";import"./SidebarFolders.component-Ckn5UdIy.js";import"./join-l_emI_xZ.js";import"./sortWith-CMxVsVLW.js";import"./Stack-C6x6Zxxx.js";import"./PencilFilled.icon-Cr4tKqJm.js";import"./Block-FjzC7Uxq.js";import"./DiscardDialog.component-BfyxxIyC.js";import"./ConfirmationDialog.component-BfuxQCeq.js";import"./app.actions-DaoresS8.js";import"./stop-managers.page-C60F_hEB.js";import"./Save-D9vymLfu.js";import"./Switch.component-CuD4u6RX.js";import"./HeaderCheckbox.component-TOhPuIv5.js";import"./SearchClients.component--9oxubWC.js";import"./RadioButtonUnchecked-ksLr7bc4.js";import"./RadioGroup-Cu6AG27I.js";import"./FormGroup-DlXI3Nad.js";import"./Card-sWLQbFU6.js";import"./Help-C015KE1B.js";import"./form-validation-3A4u7sau.js";import"./AddClients.component-UUplwF0-.js";import"./FilterApptTypes.component-BiaTFW3H.js";import"./ThreePeople.icon-DARHPGRn.js";import"./Select.component-Dq4QdXhZ.js";import"./dripCampaigns.actions-w6hDcGa4.js";import"./subtract--TvxTltL.js";import"./InnerHeader.component-CIjmR-l0.js";const Zn=wt(t.jsx("path",{d:"M17.77 3.77 16 2 6 12l10 10 1.77-1.77L9.54 12z"}),"ArrowBackIosNew"),qn=({date:e,view:i,timezone:s,officeId:l,admin:d})=>m=>{const x=d?`calendarSettings-${l}`:"calendarSettings",u=JSON.parse(localStorage[x]||"{}");return console.log("load settings from "+x,u),m(Je({settings:u,officeId:l,admin:d})),et({type:Xt,action:()=>An({date:e,view:i,timezone:s})})(m)},Jn=()=>({type:Ct,state:"REQUEST"}),Je=({settings:e,officeId:i,admin:s})=>{const l=s?`calendarSettings-${i}`:"calendarSettings";console.log("save settings to "+l,e);try{const d=JSON.parse(localStorage[l]);localStorage[l]=JSON.stringify(Ze(d,e))}catch(d){console.log("Don't cry, it wasn't an object",d),localStorage[l]=JSON.stringify(e)}return{type:Ot,payload:e}},ft=({date:e,view:i,timezone:s})=>(l,d)=>{const m=d().calendarv2.sequence+1;return et({type:Ct,action:()=>Cn({date:e,view:i,timezone:s}).then(x=>({appointments:x,sequence:m}))})(l)},gt=e=>et({type:Vt,action:()=>Kt.put(`appointment/${e.id}`,{time:e.time,source:"Admin"}).then(()=>e).catch(i=>{Zt("Error!","Failed to reschedule appointment"),console.error(i)})}),xt=e=>({type:Ut,data:e}),Qn=e=>({type:Gt,data:e}),es=e=>(i,s)=>{const d=s().calendarv2.appointments.find(At("id",e.id));if(d){if(Yt("Canceled",e.status))return i(Qn(e));{const m=Ze(e,{client:d.client,appointmentType:d.appointmentType});return i(xt(m))}}return Promise.all([In(e.clientId),Ln(e.appointmentTypeId)]).then(([m,x])=>{const u=Ze(e,{client:m,appointmentType:x});return i(xt(u))}).catch(()=>{console.log("error getting client and appointment type for appointment update")})},ts=e=>(i,s)=>{if(!e)return()=>null;const l=d=>{const m=_t(d.data);(m==null?void 0:m.tag)==="Appointment"&&es(m.contents)(i,s)};return e.addEventListener("message",l),()=>{e.removeEventListener("message",l)}},ns=f(bn)({color:"green"}),ss=f("div")({position:"absolute",backgroundColor:"red",top:0,left:0,display:"flex",flexDirection:"column",borderRadius:"2px",overflow:"hidden"}),is=f("div")({fontSize:"13px",lineHeight:"13px",marginLeft:"2px"}),os=f("div")({fontSize:"11px",marginLeft:"2px"}),rs=f("div")({position:"absolute",backgroundColor:"red",bottom:2,right:2,height:5,width:5,borderRadius:2.5}),ke=(e="")=>e&&e.length>0?e.toUpperCase()[0]:"",ls=({client:e,nameDisplay:i})=>{switch(i){case"abbr_f":return ke(e.firstName)+" "+(e.lastName||"");case"abbr_l":return(e.firstName||"")+" "+ke(e.lastName);case"abbr_fl":return ke(e.firstName)+" "+ke(e.lastName);case"abbr_none":return(e.firstName||"")+" "+(e.lastName||"");default:return ke(e.firstName)+" "+(e.lastName||"")}},Qe=({a:e,startSlot:i=0,handleDragStart:s,cellWidth:l,currentTimestamp:d,nameDisplay:m="abbr_f",timezone:x,hasConfirmationFeature:u=!1})=>{var U,h,C;const p=((U=e.confirmedStatus)==null?void 0:U.Confirmed)&&"Confirmed: "+qt((h=e.confirmedStatus)==null?void 0:h.Confirmed,x,"yyyy-MM-dd h:mm a"),A=e.clientId===-1;return t.jsxs(ss,{onMouseDown:s,id:`apt-${e.id}`,title:`(${e.appointmentType.name||"unspecified"}) ${e.client.firstName} ${e.client.lastName} ${e.appointmentType.duration}
1m`,style:{top:e.draw.y,left:e.draw.x+l*i,height:e.draw.h,width:l-3+"px",backgroundColor:A?"#DFDFE0":e.draw.color,color:e.appointmentType.color&&e.appointmentType.color.lightness<45?"#EEE":"#111"},children:[t.jsx("div",{style:{position:"absolute",top:2,right:2},children:t.jsx(vn,{confirmation:e.confirmedStatus,hasConfirmationFeature:u,noBackground:!0,showBorder:!0})}),t.jsx(is,{children:ls({client:e.client,nameDisplay:m})}),!A&&t.jsx(os,{children:e.appointmentType.name||"unspecified"}),t.jsx(rs,{style:{display:e.status.Scheduled&&e.timestamp>d?"none":"block",backgroundColor:e.draw.statusColor,boxShadow:e.appointmentType.color&&e.appointmentType.color.lightness<45&&"rgba(255, 255, 255, 0.5) 0px 0px 1px 1px"||"rgba(0,0,0, 0.5) 0px 0px 1px 1px"}}),!u&&t.jsx(Jt,{arrow:!0,placement:"top",title:p,children:t.jsx(ns,{style:{position:"absolute",bottom:1,display:(C=e.confirmedStatus)!=null&&C.Confirmed?"block":"none",fontSize:"10px",color:e.appointmentType.color&&e.appointmentType.color.lightness<45?"white":"black",right:e.status.Scheduled&&e.timestamp>d?2:12}})})]})},as=f("div")({position:"absolute",top:0,left:0,display:"flex",flexDirection:"column",borderRadius:"2px",overflow:"hidden",backgroundColor:"rgba(50, 50, 50, 0.5)",color:"#EEE"}),cs=f("div")({fontSize:"12px",marginLeft:"2px"}),Re=({id:e,title:i,y:s,x:l,height:d,width:m,name:x})=>t.jsx(as,{id:String(e),title:i,style:{pointerEvents:"none",top:s,left:l,height:d,width:m},children:t.jsx(cs,{children:x})}),ds=Le.ofPattern("eee, MMM d, yyyy").withLocale(Ne.US),ps=Le.ofPattern("hh:mm a").withLocale(Ne.US),yt=(e="",i="")=>{try{return Se.parse(e).withZoneSameInstant(je.of(i)).format(ds)}catch{return"invalid date"}},vt=(e="",i="")=>{try{return Se.parse(e).withZoneSameInstant(je.of(i)).format(ps)}catch{return"invalid date"}},ms=f(Nn)({marginBottom:"10px","& tbody tr td":{borderBottom:"none"}}),bt=f($e)({width:170}),St=f($e)({width:60}),It=({openReskedPopup:e,closeReskedPopup:i,confirmResked:s,dragApt:l,dragData:d,timezone:m})=>{const x=l&&yt(l.time,m),u=d&&yt(d.time,m),p=l&&vt(l.time,m),A=d&&vt(d.time,m);return t.jsx(Qt,{open:e,onClose:i,size:"xs",maxWidth:700,title:l?`Reschedule ${l.client.firstName} ${l.client.lastName}'s appointment?`:"",className:"sked-test-calendar-reschedule-drag-modal",buttons:[t.jsx(G,{title:"Save",onClick:s,color:"primary",className:"sked-test-calendar-reschedule-drag-modal-button-save"},"save")],children:l&&d.time&&t.jsx("div",{children:t.jsx(ms,{noHover:!0,children:t.jsxs(Hn,{children:[x!==u&&t.jsxs(mt,{children:[t.jsx(bt,{children:x}),t.jsx(St,{children:"→"}),t.jsx($e,{children:u})]}),p!==A&&t.jsxs(mt,{children:[t.jsx(bt,{children:p}),t.jsx(St,{children:"→"}),t.jsx($e,{children:A})]})]})})})})},be=f(zn)({cursor:"pointer"}),us=f("div")({height:"calc(100% - 15px)",position:"relative"}),hs=f("div")({position:"relative",display:"flex",flexDirection:"row",boxSizing:"border-box",overflow:"hidden",height:"max-content",marginLeft:"51px"}),fs=f("div")({paddingLeft:"2px",boxSizing:"border-box",borderLeft:"2px solid #AAA","& > div":{position:"sticky",left:"1px",boxSizing:"border-box",fontSize:14},fontWeight:"bold"}),Lt=f("div")({display:"flex",flexDirection:"row",alignItems:"flex-start",justifyContent:"flex-start",boxSizing:"border-box"}),gs=f(Lt)({height:"100%"}),Nt=f("div")({position:"relative",display:"flex",flexDirection:"row",overflowX:"scroll",overflowY:"scroll",height:"calc(100% - 60px)",userSelect:"none","@media print":{height:"auto !important"}}),xs=f(Nt)({height:"100%"}),Ht=f("div")({display:"flex",flexDirection:"column",borderRight:"1px solid #AAA",boxSizing:"border-box",position:"relative"}),zt=f("div")({display:"flex",flexDirection:"column",boxSizing:"border-box","&>div:nth-of-type(odd)":{backgroundColor:"rgba(0,123,207, 0.2)"}}),ys={"60min":{borderTop:"3px solid #AAA",fontWeight:"bold"},"30min":{borderTop:"2px solid #AAA",fontWeight:"bold"},"15min":{borderTop:"1px solid #AAA"},"5min":{borderTop:"0.5px solid #AAA"}},Pt=f("div",{shouldForwardProp:e=>e!=="interval"})(({interval:e})=>({display:"flex",flexDirection:"column",width:"100px",minHeight:"25px",height:"25px",justifyContent:"flex-start",boxSizing:"border-box",overflow:"hidden",...ys[e]})),Et=f("div")({display:"flex",flexDirection:"column",boxSizing:"border-box",overflow:"hidden",alignItems:"center",transform:"translateY(8px)"}),Wt=f("div")({flexGrow:1,display:"flex",flexDirection:"column",justifyContent:"center",fontSize:13,textAlign:"center",width:"28px",color:"#5d5252",lineHeight:1.1}
1),$t=f("span")({display:"block",margin:0,width:"20px",maxWidth:"20px",height:"20px",maxHeight:"20px",borderRadius:"10px",backgroundColor:"#FFA000"}),Rt=f("div")({position:"absolute",borderTop:"2px solid #FFA000"}),vs=f("div")({overflow:"hidden"}),bs=f("div")({display:"flex",flexDirection:"row",boxSizing:"border-box",overflow:"hidden"}),Ss=f(bs)({paddingRight:10}),js=f("div")({paddingLeft:"2px",boxSizing:"border-box",borderLeft:"2px solid #AAA","& > div":{position:"sticky",left:"1px",boxSizing:"border-box",fontSize:14}}),ws=f("div")({paddingLeft:"2px",boxSizing:"border-box",borderLeft:"2px solid #AAA",fontWeight:"bold",fontSize:14}),Cs=Le.ofPattern("eee d").withLocale(Ne.US),As=e=>{try{return Y.parse(e).format(Cs)}catch{return"invalid date"}},Ts=(e,i)=>Se.parse(e).withZoneSameInstant(je.of(i)),Xe=({id:e,width:i,cellWidth:s,name:l})=>t.jsx(fs,{style:{minWidth:i+"px"},id:e,children:t.jsx("div",{style:{width:s-4},children:l})}),Pe=(e,i,s)=>s?e.maxGroupedSlots*i:e.slots.length*i,ks=({state:e,store:i,selectedProfessional:s,selectedLocation:l,possibleAppointments:d,selectedDate:m,viewAppointment:x,skedAppointment:u,reskedAppointment:p,markAppointment:A,hasConfirmationFeature:U=!1})=>{const h=a.useRef(null),C=a.useRef(null),M=a.useRef(null),[j,D]=a.useState(null),[b,T]=a.useState({selectedSchedule:{id:-1,name:"All"},groupedAppointments:[],sortedAppointments:[],times:[],specialHours:[],scheduleHours:[],slots:Array.from(Array(10).keys()),dayStart:new Date().toISOString(),dayEnd:new Date().toISOString(),maxGroupedSlots:0}),y=a.useRef(null),[E,ee]=a.useState(!1),[te,X]=a.useState(null),[B,ne]=a.useState({time:"",topStart:0,leftStart:0}),se=(n,r=0)=>S=>{X(n);const o=S.clientX,c=S.clientY;y.current=document.querySelector(`#apt-${n.id}`),y.current.style.zIndex=1;const g=h.current.scrollTop,v=y.current.style.top,I=y.current.style.left,W=N=>{const _=N.clientX,le=N.clientY,ae=_-o,ce=le-c,z=h.current.scrollTop-g,P=n.draw.x+ae+r*e.cellWidth,Q=n.draw.y+ce+z;return{x:P,y:Q}},$=N=>{if(y.current){const _=W(N);y.current.style.top=_.y+"px",y.current.style.left=_.x+"px"}},L=N=>{var z,P;const _=W(N),le=Math.abs(N.clientX-o),ae=Math.abs(N.clientY-c),ce=le>5||ae>5,O=Dt({startOfDay:new Date(b.dayStart).getTime(),interval:i.timeIntervals,cellHeight:e.cellHeight,y:_.y});if(!ce||new Date(n.time).getTime()===new Date(O).getTime())y.current.style.top=v,D(n),K(y.current),X(null),y.current.style.zIndex=0;else if(n.status.Preview){const Q=Ts(O,i.tz);u({time:Q})}else y.current.style.top=We({startOfDay:new Date(b.dayStart).getTime(),interval:i.timeIntervals,cellHeight:e.cellHeight,time:new Date(O).getTime()})+"px",ee(!0),ne({...B,time:O,topStart:v,leftStart:I});y.current.style.left=I,(z=h.current)==null||z.removeEventListener("mouseup",L),(P=h.current)==null||P.removeEventListener("mousemove",$)};n&&(h.current.addEventListener("mousemove",$),h.current.addEventListener("mouseup",L))},fe=()=>{y.current.style.zIndex=0,y.current.style.top=B.topStart,y.current.style.left=B.leftStart,ee(!1),X(null),ne({time:"",topStart:0,leftStart:0})},ie=()=>{y.current.style.zIndex=0,p({...te,time:B.time}),X(null),ee(!1)},pe=a.useRef(!1),[R,oe]=a.useState({date:new Date().getTime(),y:0,show:!1});a.useEffect(()=>{const n=new Date().getTime(),r=We({startOfDay:new Date(b.dayStart).getTime(),time:n,interval:i.timeIntervals,cellHeight:e.cellHeight});!pe.current&&r>1&&(h.current.scrollTop=r,pe.current=!0);const S=Y.now().toString()===m,o=setTimeout(()=>{oe(c=>({...c,date:new Date().getTime()}))},6e4);return oe(c=>({...c,y:r,show:S})),()=>{clearTimeout(o)}},[R.date,m,b.dayStart,e.cellHeight]);const[V,we]=a.useState(500),Ce=a.useMemo(()=>{var r;let n=15;return M.current&&!e.loading&&(n=((r=M.current)==null?void 0:r.clientHeight)||15),`calc(100% - ${n}px)`},[M,e]),ge=()=>{const n=h.current.getBoundingClientRect(),r=window.innerHeight;we(r-n.y)},xe=()=>{const n=new Date().getTime(),r=m,{cellHeight:S,cellWidth:o,groupByProfessional:c,scheduleId:g,appointments:v,officeHours:I,specialOfficeHours:W,schedules:$}=e,L=i.tz,N=i.timeIntervals,_=i.colors,le=v.concat(d),ae=Tn({date:r,timezone:L,interval:N,scheduleId:g,specialOfficeHours:W,officeHours:I,schedules:$,cellHeight:S,cellWidth:o,colors:_,groupByProfessional:c,appointments:le,professionals:i.professionals.filter(({id:Q})=>Q!==0),selectedProfessional:s,appointmentTypes:i.proTypes,selectedLocation:l}),ce=new Date().getTime(),O=e.appointments.length,z=ce-n,P=(O/z).toFixed(4);console.log(`time to calc new positions: ${z}ms for ${O} apts. Rate: ${P} apts/ms`),T(ae)};a.useEffect(()=>{xe()},[e.appointments,e.timezone,e.officeHours,e.schedules,e.interval,e.scheduleId,d,e.cellWidth,e.cellHeight,e.groupByProfessional,s,l,e.localInterval]),a.useEffect(()=>{ge()},[]);const re=a.useCallback(()=>
1{if(!h.current)return;const n=h.current.scrollTop,r=h.current.scrollLeft;C.current.style.marginTop=String((n+e.cellHeight/2)*-1)+"px",M.current.scrollLeft=r},[h.current]);a.useEffect(()=>{function n(){ge()}return window.addEventListener("resize",n),h.current.addEventListener("scroll",re),()=>{var r;window.removeEventListener("resize",n),(r=h.current)==null||r.removeEventListener("scroll",re)}},[re,h.current]);const[me,K]=a.useState(null),w=()=>{K(null)},Z=()=>{w(),x(j)},q=()=>(w(),j.status.Arrived?A(j,"Scheduled"):A(j,"Arrived")),J=()=>(w(),j.status.Missed?A(j,"Scheduled"):A(j,"Missed")),F=a.useMemo(()=>s?i.professionals.find(n=>n.id===s):{},[s,i.professionals]),ue=!!me,ye=ue?"simple-popover":void 0;return t.jsxs(us,{children:[t.jsx("div",{children:t.jsxs(hs,{ref:M,children:[e.groupByProfessional&&b.groupedAppointments.map(n=>t.jsx(Xe,{id:"provider-slot-"+n.professional.id,width:e.cellWidth*n.slotLength,cellWidth:e.cellWidth,name:`${n.professional.displayFirstName} ${n.professional.displayLastName}`},n.professional.id)),!e.groupByProfessional&&!!s&&t.jsx(Xe,{id:"date-label-slot",width:e.cellWidth+"px",cellWidth:e.cellWidth,name:`${F==null?void 0:F.displayFirstName} ${F==null?void 0:F.displayLastName}`}),!e.groupByProfessional&&!s&&t.jsx(Xe,{id:"date-label-slot",width:e.cellWidth+"px",cellWidth:e.cellWidth,name:As(m)}),t.jsx("div",{style:{minWidth:"15px"}})]})}),t.jsxs(gs,{style:{height:Ce},children:[t.jsx("div",{style:{maxWidth:"52px",minWidth:"52px",overflow:"hidden",height:"100%"},id:"slot-labels",children:t.jsxs(Ht,{id:"slot-labels",ref:C,children:[b.times.map((n,r)=>t.jsx(Et,{onClick:()=>u(n),style:{height:`${e.cellHeight}px`,minHeight:`${e.cellHeight}px`},children:t.jsx(Wt,{children:r!==0&&(n.interval==="60min"||n.interval==="30min")?n.display:t.jsx("span",{children:" "})})},`slot-time-labels-${n.time}`)),R.show&&t.jsx("p",{style:{position:"absolute",margin:0,marginTop:R.y-10+e.cellHeight/2,left:80},children:t.jsx($t,{})})]})}),t.jsxs(xs,{ref:h,children:[t.jsx(zt,{style:{minHeight:V,minWidth:Pe(b,e.cellWidth,e.groupByProfessional)},children:b.times.map(n=>t.jsx(Pt,{interval:n.interval,onClick:()=>u(n),style:{width:"100%",minHeight:`${e.cellHeight}px`}},`slot-time-labels-${n.time}`))}),e.groupByProfessional&&b.groupedAppointments.map((n,r)=>n.slots.map((S,o)=>t.jsx("div",{className:"vertical-line",style:{position:"absolute",left:e.cellWidth*(o+n.startSlot),marginLeft:S===0?"-2px":"-1px",minWidth:S===0?"2px":"1px",minHeight:b.times.length*e.cellHeight+"px",backgroundColor:S===0?"#777":"#AAA"}},`slot-bar-${r}-${o}`))),!e.groupByProfessional&&b.slots.map((n,r)=>t.jsx("div",{className:"vertical-line",style:{position:"absolute",left:e.cellWidth*r,marginLeft:n===0?"-2px":"-1px",minWidth:n===0?"2px":"1px",minHeight:b.times.length*e.cellHeight+"px",backgroundColor:n===0?"#777":"#AAA"}},`slot-bar-${r}`)),b.specialHours.map((n,r)=>t.jsx(Re,{id:`sh-${r}${n.display}`,title:"",x:0,y:n.y,width:Pe(b,e.cellWidth,e.groupByProfessional)+"px",height:n.h,name:`Special Hours: ${n.display}`},`${r}${n.display}`)),b.scheduleHours.map((n,r)=>t.jsx(Re,{id:`sch-${r}${n.display}`,title:"",x:0,y:n.y,width:Pe(b,e.cellWidth,e.groupByProfessional)+"px",height:n.h,name:n.display},`${r}${n.display}`)),e.groupByProfessional&&b.groupedAppointments.map(n=>n.appointments.map(r=>t.jsx(Qe,{a:r,startSlot:n.startSlot,handleDragStart:se(r,n.startSlot),cellWidth:e.cellWidth,currentTimestamp:R.date,nameDisplay:e.nameDisplay,timezone:i.tz,hasConfirmationFeature:U},r.id))),!e.groupByProfessional&&b.sortedAppointments.map(n=>t.jsx(Qe,{a:n,handleDragStart:se(n,0),cellWidth:e.cellWidth,currentTimestamp:R.date,nameDisplay:e.nameDisplay,timezone:i.tz,hasConfirmationFeature:U},n.id)),R.show&&t.jsx(Rt,{style:{top:R.y-1,width:Pe(b,e.cellWidth,e.groupByProfessional)}})]})]}),t.jsx(Tt,{id:ye,open:ue,anchorEl:me,onClose:w,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:t.jsxs(kt,{component:"nav","aria-label":"primary appointment actions",children:[t.jsx(be,{onClick:Z,children:t.jsx(ve,{primary:"View Appointment"})}),t.jsx(be,{onClick:q,children:t.jsx(ve,{primary:j&&j.status.Arrived?"Mark as Not Arrived":"Mark as Arrived"})}),de("",["office","ehrSystem"],i)==="None"&&t.jsx(be,{onClick:J,children:t.jsx(ve,{primary:j&&j.status.Missed?"Mark as Scheduled":"Mark as Missed"})})]})}),t.jsx(It,{openReskedPopup:E,closeReskedPopup:fe,confirmResked:ie,dragApt:te,dragData:B,timezone:i.tz})]})},Ds=(e,i)=>Se.parse(e).withZoneSameInstant(je.of(i)),Is=({state:e,store:i,possibleAppointments:s,selectedDate:l,viewAppointment:d,skedAppointment:m,reskedAppointment:x,selectedProfessional:u,selectedLocation:p,markAppointment:A,hasConfirmationFeature:U=!1})=>{var S;const h=a.useRef(null),C=a.useRef(null),M=a.useRef(null),j=a.useRef(null),[D,b]=a.useState(null),[T,y]=a.useState({days:[{selectedSchedule:{id:-1,name:"All"},sortedAppointments:[],startSlot:0,date:"",dateString:"Thurs, Jan 9",specialHours:[],scheduleHours:[],times:[],slots:Array.from(Array(10).keys()),dayStart:new Date().toISOString(),dayEnd:new Date().toISOString(),groupedAppointments:[]}],timeLabels:[],width:1,height:1,maxSlots:1}),[E,ee]=a.useState({date:new Date().getTime(),y:0,width:0,x:0,show:!1}),te=o=>{let c=0,g=0;for(;o>g;){const v=T.days[c];g=(v.startSlot+v.slots.length)*e.cellWidth,c=c+1}return c<=0?0:c-1},X=o=>c=>{c.preventDefault();const g=h.current.scrollLeft,v=h.current.getBoundingClientRect(),I=c.clientX-v.x+g,W=te(I),$=T.days[W],L=$.date,N=Se.of(en.parse(`${L}T${o.time.toString()}`),je.of("Europe/Paris"));m({time:N}),setTimeout(()=>{h.current.scrollLeft=$.startSlot*e.cellWidth},100)},B=a.useRef(!1);a.useEffect(()=>{const o=new Date().getTime(),c=Y.now().toString(),g=T.days.find(L=>L.date===c);let v=0,I=0,W=0;g&&(v=We({startOfDay:new Date(g.dayStart).getTime(),time:o,interval:i.timeIntervals,cellHeight:e.cellHeight}),I=e.cellWidth*g.startSlot,W=g.slots.length*e.cellWidth,!B.current&&v>1&&!e.loading&&(h.current.scrollLeft=I,h.current.scrollTop=v,B.current=!0)),ee(L=>({...L,y:v,x:I,width:W,show:!!g}));const $=setTimeout(()=>{ee(L=>({...L,date:new Date().getTime()}))},6e4);return()=>{clearTimeout($)}},[E.date,l,T.days]);const[ne,se]=a.useState(500),fe=a.useMemo(()=>{var c;let o=15;return j.current&&!e.loading&&(o=((c=j.current)==null?void 0:c.clientHeight)||15),`calc(100vh - ${o+(i.headerHeight||54)}px)`},[(S=j==null?void 0:j.current)==null?void 0:S.clientHeight,e,i.headerHeight]),ie=()=>{if(h.current){const o=h.current.getBoundingClientRect(),c=window.innerHeight;se(c-o.y)}},pe=()=>{const o=l,{cellHeight:c,cellWidth:g,scheduleId:v,appointments:I,officeHours:W,schedules:$,specialOfficeHours:L}=e;y(kn({professionalId:u,professionals:i.professionals.filter(({id:N})=>N!==0),appointmentTypes:i.proTypes,allAppointments:I.concat(s),timezone:i.tz,interval:i.timeIntervals,colors:i.colors,locationId:p,cellWidth:g,cellHeight:c,scheduleId:v,officeHours:W,schedules:$,specialOfficeHours:L,date:o})),setTimeout(()=>{ie()},10)};a.useEffect(()=>{pe()},[e.appointments,e.timezone,e.officeHours,e.schedules,e.interval,e.scheduleId,s,e.cellWidth,e.cellHeight,u,p]),a.useEffect(()=>{ie()},[]),a.useEffect(()=>{var g;function o(){ie()}window.addEventListener("resize",o);
1function c(){if(!h.current)return;const v=h.current.scrollLeft,I=h.current.scrollTop;C.current.style.marginTop=String((I+e.cellHeight/2)*-1)+"px",M.current.scrollLeft=v}return(g=h.current)==null||g.addEventListener("scroll",c),()=>{var v;window.removeEventListener("resize",o),(v=h.current)==null||v.removeEventListener("scroll",c)}});const[R,oe]=a.useState(null),V=()=>{oe(null)},we=()=>{V(),d(D)},Ce=()=>(V(),D.status.Arrived?A(D,"Scheduled"):A(D,"Arrived")),ge=()=>(V(),D.status.Missed?A(D,"Scheduled"):A(D,"Missed")),xe=!!R,re=xe?"simple-popover":void 0,[me,K]=a.useState(!1),w=a.useRef(null),[Z,q]=a.useState(null),[J,F]=a.useState({time:"",topStart:0,leftStart:0}),ue=(o,c)=>g=>{var ce,O;q(o);const v=g.clientX,I=g.clientY;w.current=document.querySelector(`#apt-${o.id}`),w.current.style.zIndex=10;const W=h.current.scrollTop,$=h.current.scrollLeft,L=w.current.style.top,N=w.current.style.left,_=z=>{const P=z.clientX,Q=z.clientY,Be=P-v,_e=Q-I,Ae=h.current.scrollTop-W,He=h.current.scrollLeft-$,ze=o.draw.x+e.cellWidth*c.startSlot+Be+He,Oe=o.draw.y+_e+Ae;return{x:ze,y:Oe}},le=z=>{if(w.current){const P=_(z);w.current.style.top=P.y+"px",w.current.style.left=P.x+"px"}},ae=z=>{var He,ze;const P=_(z),Q=Math.abs(z.clientX-v),Be=Math.abs(z.clientY-I),_e=Q>5||Be>5,st=te(P.x),Ae=T.days[st],Te=Dt({startOfDay:new Date(Ae.dayStart).getTime(),interval:i.timeIntervals,cellHeight:e.cellHeight,y:P.y});if(!_e||new Date(o.time).getTime()===new Date(Te).getTime())w.current.style.zIndex=0,w.current.style.left=N,w.current.style.top=L,b(o),oe(w.current),q(null);else if(o.status.Preview){const Oe=Ds(Te,i.tz);m({time:Oe})}else K(!0),F({...J,time:Te,topStart:L,leftStart:N}),w.current.style.left=e.cellWidth*Ae.startSlot+"px",w.current.style.top=We({startOfDay:new Date(Ae.dayStart).getTime(),interval:i.timeIntervals,cellHeight:e.cellHeight,time:new Date(Te).getTime()})+"px";(He=h.current)==null||He.removeEventListener("mouseup",ae),(ze=h.current)==null||ze.removeEventListener("mousemove",le)};o&&((ce=h.current)==null||ce.addEventListener("mousemove",le),(O=h.current)==null||O.addEventListener("mouseup",ae))},ye=()=>{w.current.style.zIndex=0,w.current.style.top=J.topStart,w.current.style.left=J.leftStart,K(!1),q(null),F({time:"",topStart:0,leftStart:0})},n=()=>{w.current.style.zIndex=0,x({...Z,time:J.time}),q(null),K(!1)},r=a.useMemo(()=>u?i.professionals.find(o=>o.id===u):null,[u,i.professionals]);return t.jsxs("div",{children:[t.jsxs(vs,{ref:j,style:{marginLeft:"51px"},children:[!!r&&t.jsx(ws,{id:"provider-slot-"+r.id,children:`${r.displayFirstName} ${r.displayLastName}`}),t.jsx(Ss,{ref:M,children:T.days.map((o,c)=>t.jsx(js,{style:{minWidth:e.cellWidth*o.slots.length+"px"},id:"date-slot-"+c,children:t.jsx("div",{style:{width:e.cellWidth-4},children:o.dateString})},o.date))}),t.jsx("div",{style:{minWidth:"15px"}})]}),t.jsxs(Lt,{style:{height:fe},children:[t.jsx("div",{style:{maxWidth:"52px",minWidth:"52px",overflowY:"hidden",height:ne},id:"slot-labels",children:t.jsx(Ht,{ref:C,children:T.timeLabels.map((o,c)=>t.jsx(Et,{style:{width:"52px",minHeight:`${e.cellHeight}px`,height:`${e.cellHeight}px`},children:t.jsx(Wt,{children:c!==0&&(o.interval==="60min"||o.interval==="30min")?o.display:t.jsx("span",{children:" "})})},`slot-time-labels-${o.time}`))})}),t.jsxs(Nt,{ref:h,children:[t.jsx(zt,{style:{minHeight:T.height,minWidth:T.width},children:T.timeLabels.map(o=>t.jsx(Pt,{onClick:X(o),interval:o.interval,style:{width:"100%",minHeight:`${e.cellHeight}px`}},`slot-time-labels-${o.time}`))}),T.days.map(o=>o.slots.map((c,g)=>t.jsx("div",{className:"vertical-line",style:{position:"absolute",left:e.cellWidth*(o.startSlot+c),marginLeft:c===0?"-2px":"-1px",minWidth:c===0?"2px":"1px",minHeight:T.height+"px",backgroundColor:c===0?"#777":"#AAA"}},`${o.date}-${g}`))),T.days.map((o,c)=>o.specialHours.map((g,v)=>t.jsx(Re,{title:"Special hours",id:`sh-${c}-${v}${o.date}-${g.display}`,x:e.cellWidth*o.startSlot,y:g.y,width:e.cellWidth*o.slots.length-3+"px",height:g.h,name:`Special Hours: ${g.display}`},`${c}-${v}-${o.date}${g.display}`))),T.days.map((o,c)=>o.scheduleHours.map((g,v)=>t.jsx(Re,{id:`sch-${c}-${v}${o.date}
1-${g.display}`,title:"Schedule Hours",x:e.cellWidth*o.startSlot,y:g.y,width:e.cellWidth*o.slots.length-3+"px",height:g.h,name:g.display},`${c}-${v}${o.date}${g.display}`))),T.days.map(o=>o.sortedAppointments.map(c=>t.jsx(Qe,{a:c,startSlot:o.startSlot,currentTimestamp:E.date,cellWidth:e.cellWidth,handleDragStart:ue(c,o),nameDisplay:e.nameDisplay,timezone:i.tz,hasConfirmationFeature:U},c.id))),E.show&&t.jsx(Rt,{style:{top:E.y-1,left:E.x,width:E.width}}),E.show&&t.jsx("p",{style:{position:"absolute",margin:0,top:E.y-10,left:E.x-20},children:t.jsx($t,{})})]})]}),t.jsx(Tt,{id:re,open:xe,anchorEl:R,onClose:V,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:t.jsxs(kt,{component:"nav","aria-label":"primary appointment actions",children:[t.jsx(be,{onClick:we,children:t.jsx(ve,{primary:"View Appointment"})}),t.jsx(be,{onClick:Ce,children:t.jsx(ve,{primary:D&&D.status.Arrived?"Mark as Not Arrived":"Mark as Arrived"})}),de("",["office","ehrSystem"],i)==="None"&&t.jsx(be,{onClick:ge,children:t.jsx(ve,{primary:D&&D.status.Missed?"Mark as Scheduled":"Mark as Missed"})})]})}),t.jsx(It,{openReskedPopup:me,closeReskedPopup:ye,confirmResked:n,dragApt:Z,dragData:J,timezone:i.tz})]})},Ls=a.memo(Is),jt=f(Me)({width:"200px"}),De=f("div")({display:"block",marginTop:"20px",marginBottom:"20px",width:"100%"}),Ns=({openSettings:e,handleCloseSettings:i,handleSaveSettings:s,defaultForm:l})=>{const[d,m]=Fe.useState(Pn(["cellHeight","cellWidth","nameDisplay","groupByProfessional","localInterval"],l)),x=(u="",p)=>{m(nn(u,p))};return t.jsxs(tn,{open:e,onClose:i,"aria-labelledby":"form-dialog-title",children:[t.jsx(En,{id:"form-dialog-title",children:"Calendar Settings"}),t.jsxs(Wn,{children:[t.jsx(De,{style:{marginTop:"-5px"},children:t.jsx(it,{autoFocus:!0,margin:"dense",id:"width",label:"Cell Width",type:"number",variant:"standard",onChange:u=>x("cellWidth",Math.abs(Number(u.target.value))),value:d.cellWidth,fullWidth:!0})}),t.jsx(De,{children:t.jsx(it,{autoFocus:!0,margin:"dense",id:"height",label:"Cell Height",variant:"standard",value:d.cellHeight,onChange:u=>x("cellHeight",Math.abs(Number(u.target.value))),type:"number",fullWidth:!0})}),t.jsx(De,{children:t.jsxs(he,{variant:"standard",children:[t.jsx(ot,{id:"demo-simple-select-label",children:"Name Display"}),t.jsxs(jt,{labelId:"demo-simple-select-label",id:"demo-simple-select",value:d.nameDisplay,onChange:u=>x("nameDisplay",u.target.value),children:[t.jsx(k,{value:"abbr_f",children:"Abbreviate First Name"}),t.jsx(k,{value:"abbr_l",children:"Abbreviate Last Name"}),t.jsx(k,{value:"abbr_fl",children:"Abbreviate First and Last Name"}),t.jsx(k,{value:"abbr_none",children:"Show First and Last Name"})]})]})}),t.jsx(De,{children:t.jsx($n,{control:t.jsx(Rn,{checked:d.groupByProfessional,onChange:u=>x("groupByProfessional",u.target.checked),name:"groupByProfessional"}),label:"Group By Professional in Day View"})}),t.jsx(De,{children:t.jsxs(he,{variant:"standard",children:[t.jsx(ot,{id:"local-interval-label",children:"Interval"}),t.jsxs(jt,{labelId:"local-interval-label",id:"local-interval",value:d.localInterval,onChange:u=>x("localInterval",u.target.value),children:[t.jsx(k,{value:"5",children:"5 minutes"}),t.jsx(k,{value:"10",children:"10 minutes"}),t.jsx(k,{value:"15",children:"15 minutes"}),t.jsx(k,{value:"20",children:"20 minutes"})]})]})})]}),t.jsxs(Fn,{children:[t.jsx(rt,{onClick:()=>s(d),color:"primary",variant:"contained",disableElevation:!0,children:"Save"}),t.jsx(rt,{onClick:i,color:"primary",children:"Close"})]})]})},Ft=({nameDisplay:e,setNameDisplay:i,onlyIcon:s})=>{const[l,d]=Fe.useState(null),m=()=>{d(null)},x=p=>{i(p),m()},u=()=>{i("abbr_l"),m()};return t.jsxs(H,{children:[t.jsx(H,{marginRight:.5,children:t.jsx(G,{title:"Field",Icon:Mn,onClick:p=>d(p.currentTarget),active:e!=="abbr_l",type:"filter",onlyIcon:s,className:"sked-test-calendar-display-fields"})}),t.jsx(tt,{open:!!l,anchorEl:l,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:t.jsxs(H,{minWidth:300,children:[t.jsx(nt,{title:"Display Fields",reset:u,resetDisabled:e==="abbr_l",saveClassName:"sked-test-calendar-display-fields-save-button",resetClassName:"sked-test-calendar-display-fields-reset-button"}),t.jsx(H,{padding:2,children:t.jsxs(he,{variant:"outlined",fullWidth:!0,children:[t.jsx(Ie,{children:"Name Display"}),t.jsxs(Me,{size:"small",value:e,style:{borderRadius:10},onChange:p=>x(p.target.value),inputProps:{className:"sked-test-calendar-display-fields-selection"},children:[t.jsx(k,{className:"sked-test-calendar-display-fields-abbreviate-first-name",value:"abbr_f",children:"Abbreviate First Name"}),t.jsx(k,{className:"sked-test-calendar-display-fields-abbreviate-last-name",value:"abbr_l",children:"Abbreviate Last Name"}),t.jsx(k,{className:"sked-test-calendar-display-fields-abbreviate-first-last-name",value:"abbr_fl",children:"Abbreviate First and Last Name"}),t.jsx(k,{className:"sked-test-calendar-display-fields-show-first-last-name",value:"abbr_none",children:"Show First and Last Name"})]})]})})]})})]})};Ft.prototype="header-component";const Hs=({color:e,className:i})=>t.jsx("svg",{className:i,id:"uuid-ddb1255a-58cd-49c6-ada2-f55d3f2d18a4","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50",children:t.jsxs("g",{fill:e||"rgba(0, 0, 0, 0.6)",id:"uuid-bc87ae7c-c2f6-4a9e-bb8c-6eb5da58e717","data-name":"Group 8843",children:[t.jsx("path",{id:"uuid-0ed49748-5315-44e6-9545-a49038f4a22e","data-name":"Path 4743",d:"m47.0662,12.5296c.0256.4703-.2324.9103-.6554,1.1174-6.9906,3.6875-13.9812,7.3849-20.9717,11.0921-.243.1725-.5641.1878-.8225.0393-6.9622-3.7072-13.9309-7.4046-20.9062-11.0921-.6749-.3336-.9516-1.1512-.618-1.8261.
11051-.2127.2639-.3942.4607-.5267.1391-.1009.2859-.1908.4391-.2687C10.6682,7.4712,17.3388,3.8766,24.0038.2808c.6231-.3744,1.402-.3744,2.0251,0,6.6651,3.6023,13.3367,7.1959,20.0149,10.7808.5884.2563.9834.8209,1.0224,1.4615"}),t.jsx("path",{id:"uuid-1d20551d-f5b3-4bc5-94c3-744ab0dc3a93","data-name":"Path 4745",d:"m47.0596,25.4239c-.0147.4253-.2684.8059-.6554.983-7.0212,3.7006-14.0347,7.4144-21.0406,11.1412-.2271.1439-.5168.1439-.7438,0-6.9469-3.7006-13.9025-7.3936-20.8669-11.079-.6735-.2655-1.0042-1.0266-.7387-1.7001.1011-.2565.2805-.4745.5126-.6232,1.0601-.6594,2.1539-1.2632,3.2768-1.8088.1081-.0557.3277.036.4686.1114,3.2047,1.6908,6.4073,3.3861,9.6077,5.0856,2.379,1.2616,4.7645,2.5101,7.1369,3.7847.6134.3671,1.3789.3671,1.9923,0,5.5641-2.9601,11.1347-5.9092,16.7119-8.8475.238-.159.5484-.159.7864,0,.8847.5014,1.7892.9667,2.6805,1.4549.5662.2795.9144.8666.888,1.4975"}),t.jsx("path",{id:"uuid-c347a533-9c14-4f40-9a1e-3ef449dc1b3e","data-name":"Path 4829",d:"m47.0596,37.7678c-.0147.4253-.2684.8059-.6554.983-7.0212,3.7006-14.0347,7.4144-21.0406,11.1412-.2271.1439-.5168.1439-.7438,0-6.9469-3.7006-13.9025-7.3936-20.8669-11.079-.6735-.2655-1.0042-1.0266-.7387-1.7001.1011-.2565.2805-.4745.5126-.6232,1.0601-.6594,2.1539-1.2632,3.2768-1.8088.1081-.0557.3277.036.4686.1114,3.2047,1.6908,6.4073,3.3861,9.6077,5.0856,2.379,1.2616,4.7645,2.5101,7.1369,3.7847.6134.3671,1.3789.3671,1.9923,0,5.5641-2.9601,11.1347-5.9092,16.7119-8.8475.238-.159.5484-.159.7864,0,.8847.5014,1.7892.9667,2.6805,1.4549.5662.2795.9144.8666.888,1.4975"})]})}),Mt=({isGroupBy:e,setIsGroupBy:i,onlyIcon:s})=>{const[l,d]=Fe.useState(null),m=()=>{d(null)},x=()=>{i(!1),m()},u=p=>{i(p),m()};return t.jsxs(H,{children:[t.jsx(H,{marginRight:.5,children:t.jsx(G,{title:"Group",onClick:p=>d(p.currentTarget),Icon:Hs,active:e,type:"group",onlyIcon:s,className:"sked-test-calendar-group-by"})}),t.jsx(tt,{open:!!l,anchorEl:l,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:t.jsxs(H,{minWidth:300,children:[t.jsx(nt,{title:"Group By",reset:x,resetDisabled:!e,resetClassName:"sked-test-calendar-group-reset-button",saveClassName:"sked-test-calendar-group-save-button"}),t.jsx(H,{padding:2,children:t.jsxs(he,{variant:"outlined",fullWidth:!0,children:[t.jsx(Ie,{children:"Group By Professional in Day View"}),t.jsxs(H,{display:"flex",alignItems:"center",children:[t.jsx(qe,{children:"Off"}),t.jsx(Bn,{checked:e,onChange:p=>u(p.target.checked),inputProps:{"aria-label":"controlled",className:"sked-test-calendar-group-on-off-toggle"}}),t.jsx(qe,{children:"On"})]})]})})]})})]})};Mt.prototype="header-component";const zs=wt(t.jsx("path",{d:"M6 7h2.5L5 3.5 1.5 7H4v10H1.5L5 20.5 8.5 17H6zm4-2v2h12V5zm0 14h12v-2H10zm0-6h12v-2H10z"}),"FormatLineSpacing"),Ve={cellHeight:35,cellWidth:100,localInterval:15},Bt=({value:e,save:i,onlyIcon:s})=>{const[l,d]=Fe.useState(null),m=()=>{d(null)},x=()=>{i(Ve),m()},u=(p,A)=>{i({...e,[p]:Number(A)})};return t.jsxs(H,{children:[t.jsx(H,{marginRight:.5,children:t.jsx(G,{title:"Spacing",Icon:zs,onClick:p=>d(p.currentTarget),onlyIcon:s,type:"hide",className:"sked-test-calendar-spacing",active:!lt(e,Ve)})}),t.jsx(tt,{open:!!l,anchorEl:l,onClose:m,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:t.jsxs(H,{minWidth:200,children:[t.jsx(nt,{title:"Calendar Spacing",reset:x,resetDisabled:lt(e,Ve),resetClassName:"sked-test-calendar-spacing-reset-button",saveClassName:"sked-test-calendar-spacing-save-button"}),t.jsx(H,{padding:2,children:t.jsxs(he,{variant:"outlined",fullWidth:!0,children:[t.jsxs(H,{display:"flex",alignItems:"center",marginBottom:1,children:[t.jsxs(H,{display:"flex",flexDirection:"column",marginRight:1.5,children:[t.jsx(Ie,{children:"Cell Width"}),t.jsx(at,{value:e.cellWidth,style:{width:180},size:"small",variant:"outlined",type:"number",inputProps:{className:"sked-test-calendar-spacing-cell-width"},InputProps:{endAdornment:t.jsx(ut,{position:"end",children:"px"}),inputProps:{min:0}},onChange:p=>u("cellWidth",p.target.value)})]}),t.jsxs(H,{display:"flex",flexDirection:"column",children:[t.jsx(Ie,{children:"Cell Height"}),t.jsx(at,{value:e.cellHeight,style:{width:180},size:"small",variant:"outlined",type:"number",inputProps:{className:"sked-test-calendar-spacing-cell-height"},InputProps:{endAdornment:t.jsx(ut,{position:"end",children:"px"}),inputProps:{min:0}},onChange:p=>u("cellHeight",p.target.value)})]})]}),t.jsx(H,{children:t.jsxs(he,{variant:"outlined",fullWidth:!0,children:[t.jsx(Ie,{children:"Interval"}),t.jsxs(Me,{size:"small",variant:"outlined",value:e.localInterval||"",style:{width:180,borderRadius:10},onChange:p=>u("localInterval",p.target.value),inputProps:{className:"sked-test-calendar-spacing-interval"},children:[t.jsx(k,{className:"sked-test-calendar-spacing-interval-5-minutes",value:5,children:"5 minutes"}),t.jsx(k,{className:"sked-test-calendar-spacing-interval-10-minutes",value:10,children:"10 minutes"}),t.jsx(k,{className:"sked-test-calendar-spacing-interval-15-minutes",value:15,children:"15 minutes"}),t.jsx(k,{className:"sked-test-calendar-spacing-interval-20-minutes",value:20,children:"20 minutes"})]})]})})]})})]})})]})};Bt.prototype="header-component";const Ps=({color:e,className:i,...s})=>t.jsxs("svg",{className:i,xmlns:"http://www.w3.org/2000/svg",...s,width:"14.989",height:"13.561",viewBox:"0 0 14.989 13.561",children:[t.jsx("defs",{children:t.jsx("clipPath",{id:"clip-path",children:t.jsx("rect",{id:"Rectangle_11876","data-name":"Rectangle 11876",width:"14.989",height:"13.561",transform:"translate(0 0)",fill:e||"#4d4d4d"})})}),t.jsx("g",{id:"list-view-icon",transform:"translate(0 0)",children:t.jsxs("g",{id:"Group_15468","data-name":"Group 15468",clipPath:"url(#clip-path)",children:[t.jsx("path",{id:"Path_8820","data-name":"Path 8820",d:"M13.195,0H1.794a1.794,1.794,0,0,0,0,3.588h11.4a1.794,1.794,0,1,0,0-3.588",fill:e||"#4d4d4d"}),t.jsx("path",{id:"Path_8821","data-name":"Path 8821",d:"M13.195,9.973H1.794a1.794,1.794,0,0,0,0,3.588h11.4a1.794,1.794,0,1,0,0-3.588",fill:e||"#4d4d4d"}),t.jsx("path",{id:"Path_8822","data-name":"Path 8822",d:"M13.195,4.987H1.794a1.794,1.794,0,1,0,0,3.588h11.4a1.794,1.794,0,1,0,0-3.588",fill:e||"#4d4d4d"})]})})]}),Es=f("div")({flexGrow:1,height:"calc(100vh - 55px - 46px)",overflow:"hidden",position:"relative"}),Ws=f("div")({display:"flex",flexDirection:"row",height:"100%"}),$s=f("div")({display:"flex",flexDirection:"row",alignItems:"center",marginBottom:"10px",alignSelf:"center",fontWeight:"bold",fontSize:"18px",marginLeft:"15px",justifyContent:"center"}),Rs=f(Ee)({"& > div":{width:132,"& input":{padding:"4px 8px",width:114,fontSize:14}}}),Fs=f("div",{shouldForwardProp:e=>e!=="hasScroll"})(({hasScroll:e})=>e?{overflowY:"auto","@media print":{overflowY:"visible"}}:{}),Ke=Le.ofPattern("eeee, MMMM d, yyyy").withLocale(Ne.US),Ms=Le.ofPattern("eee, MMM d yyyy h:mm a").withLocale(Ne.US),Bs=({time:e,timezone:i})=>{try{return Se.parse(e).withZoneSameInstant(je.of(i)).format(Ms)}catch{return"Error parsing date"}},_s=f(Me)({"& .MuiSelect-select":{padding:"4px 8px",minWidth:42,paddingLeft:10}}),Os=(e=0,i=[])=>i.find(At("id",e)),jr=()=>{var F,ue,ye;const e=sn(),i=on(),s=ct(n=>{const r=de([],["business","locations"],n),S=Ye(de([],["login","features"]),Ge("Locations"))(n),o=Ye(de([],["login","features"]),Ge("Leads"))(n),c=Ye(de([],["login","features"]),Ge("AppointmentConfirmationPending"))(n);
1return{...n.calendar,tz:n.login.office.timezone||"America/New_York",ehrSystem:n.login.office.ehrSystem,timeIntervals:n.calendarv2.localInterval||de(15,["login","ehrSettings","blockLength"])(n),office:n.login.office,admin:de(!1,["login","admin"])(n),locations:S&&!rn(r)?ln({id:0,name:"All Locations"},r):[],hasLocations:S,headerHeight:n.login.headerHeight,hasLeads:o,hasConfirmationFeature:c,features:n.login.features,officeId:n.login.office.id}}),l=ct(({calendarv2:n})=>n),[d,m]=a.useState([]),[x,u]=a.useState(!1),[p,A]=a.useState(Y.now().toString()),[U,h]=a.useState(null),[C,M]=a.useState("day"),[j,D]=a.useState(0),[b,T]=a.useState(0),[y,E]=a.useState("calendar"),[ee,te]=a.useState(!1),[X,B]=a.useState(0),[ne,se]=a.useState({scheduleId:-1}),fe=n=>{u(!0),h(n)};_n("Calendar");const ie=an();a.useEffect(()=>{const n=localStorage[`sked-calendar-view-${s.office.id}`];n&&M(n);const r=Number(localStorage[`sked-calendar-professional-${s.office.id}`]);r&&D(r||0)},[s.office.id]),a.useEffect(()=>{const n=Number(localStorage[`sked-calendar-scheduleId-${s.office.id}`]),r=l.schedules.find(S=>S.id===n);n&&r&&se(S=>({...S,scheduleId:n}))},[s.office.id,l.schedules]),a.useEffect(()=>{const n=e(ts(ie));return()=>{n()}},[e,ie]),a.useEffect(()=>{const n=localStorage[`sked-calendar-view-${s.office.id}`];if(s.tz&&(e(cn(!0,i)),e(qn({date:p,view:n||C,timezone:s.tz,officeId:s.office.id,admin:s.admin}))),s.hasLocations){e(dn());try{const r=localStorage[`sked-calendar-location-${s.office.id}`];pn(r)||isNaN(Number(r))?T(0):T(Number(r))}catch{console.log("error gettings calendar location")}}},[e,s.tz,s.office.id,s.admin]);const pe=a.useRef(null);a.useEffect(()=>{if(l.init)return;const n=pe.current;e(Jn());const r=()=>{se(o=>({...o,timeout:null})),e(ft({date:p,view:C,timezone:s.tz}))};clearTimeout(n);const S=setTimeout(r,300);return pe.current=S,()=>{clearTimeout(n)}},[p,C,s.tz]),a.useEffect(()=>{localStorage[`sked-calendar-location-${s.office.id}`]=b},[b]),a.useEffect(()=>{localStorage[`sked-calendar-professional-${s.office.id}`]=j},[j]),a.useEffect(()=>{localStorage[`sked-calendar-view-${s.office.id}`]=C},[C]);const R=()=>{e(ft({date:p,view:C,timezone:s.tz}))},oe=n=>{if(!n)return;const r=gn(String,n)?n:n.toString();A(r)},V=()=>{const n=Y.now().toString();A(n)},we=()=>{const n=C==="day"?1:7,r=Y.parse(p).plusDays(n).toString();A(r)},Ce=()=>{const n=C==="day"?1:7,r=Y.parse(p).minusDays(n).toString();A(r)},ge=()=>{h(null),u(!0)},xe=()=>{if(C==="day")return Y.parse(p).format(Ke);const n=Dn(p),r=Y.parse(p).minusDays(n).format(Ke),S=Y.parse(p).minusDays(n).plusDays(6).format(Ke);return`${r} - ${S}`},re=n=>{se(r=>({...r,scheduleId:n})),localStorage[`sked-calendar-scheduleId-${s.office.id}`]=n},[me,K]=a.useState(!1),w=()=>{K(!1)},Z=n=>{K(!1),e(Je({settings:n,officeId:s.office.id,admin:s.admin}))},q=n=>{e(Je({settings:{nameDisplay:n},officeId:s.office.id,admin:s.admin}))},J=()=>{V(),q("abbr_l"),re(-1),D(0),Z({groupByProfessional:!1,cellHeight:35,cellWidth:100,localInterval:15});const n=document.getElementById("more-header-button");n==null||n.click()};return a.useEffect(()=>{C==="day"?setTimeout(()=>{te(!0)},200):te(!1)},[C]),t.jsxs(t.Fragment,{children:[t.jsx(On,{title:"Calendar",pageId:"calendar-v2",leftIcons:[t.jsx(ht,{items:["Calendar","List"],title:y==="calendar"?"Calendar":"List",setSelected:n=>E(n==="Calendar"?"calendar":"print"),selected:y==="calendar"?"Calendar":"List",Icon:y==="calendar"?Xn:Ps,horizontalMenu:"left",simpleList:!0,neverOnlyIcon:!0,minWidth:200,noneText:y==="calendar"?"Calendar":"List",className:"sked-test-calendar-view",nameForTest:"calendar-view"},"calendar-view"),t.jsx(G,{title:"Today",onClick:V,borderSolid:!0,className:"sked-test-calendar-today-button"},"today"),t.jsx(G,{Icon:Zn,onClick:Ce,onlyIcon:!0,className:"sked-test-calendar-day-previous-arrow"},"day-previos"),t.jsx(Rs,{children:t.jsx(Vn,{value:p,onChange:n=>oe(n),inputClassName:"sked-test-calendar-date-picker",required:!0})},"date"),t.jsx(G,{Icon:un,onClick:we,onlyIcon:!0,className:"sked-test-calendar-day-next-arrow"},"day-next"),t.jsx(he,{variant:"outlined",size:"small",style:{marginRight:8},children:t.jsxs(_s,{labelId:"view-select-label",id:"view-select",variant:"outlined",size:"small",value:C,inputProps:{className:"sked-test-calendar-select-view"},onChange:n=>M(n.target.value),children:[t.jsx(k,{className:"sked-test-calendar-select-view-day",value:"day",children:"Day"}),t.jsx(k,{className:"sked-test-calendar-select-view-week",value:"week",children:"Week"})]})},"select"),t.jsx(Ft,{nameDisplay:l.nameDisplay,setNameDisplay:q},"display-name"),t.jsx(ht,{title:"Provider Schedule",Icon:Un,noneText:"All Schedules",horizontalMenu:"left",type:"filter",items:(F=l.schedules)==null?void 0:F.map(n=>n.name),selected:(ye=(ue=l.schedules)==null?void 0:ue.find(n=>n.id===ne.scheduleId))==null?void 0:ye.name,setSelected:n=>{var S,o;const r=(o=(S=l.schedules)==null?void 0:S.find(c=>c.name===n))==null?void 0:o.id;re(r)},className:"sked-test-calendar-provider-schedule",saveClassName:"sked-test-calendar-provider-schedule-save-button",resetClassName:"sked-test-calendar-provider-schedule-reset-button",nameForTest:"calendar-provider-schedule"},"provider"),t.jsx(Yn,{allProfessionals:s.professionals,selectedProId:j,setPropId:D,className:"sked-test-calendar-professional",saveClassName:"sked-test-calendar-professional-save-button",resetClassName:"sked-test-calendar-professional-reset-button"},"professional"),t.jsx(Gn,{hasLocations:s.hasLocations,selectedLocationId:b,allLocations:s.locations,setSelectedLocationId:T,className:"sked-test-calendar-location",saveClassName:"sked-test-calendar-location-save-button",resetClassName:"sked-test-calendar-location-reset-button"},"location"),t.jsx(Mt,{isGroupBy:!!l.groupByProfessional,setIsGroupBy:n=>Z({groupByProfessional:n})},"group"),t.jsx(Bt,{value:{cellWidth:l.cellWidth,cellHeight:l.cellHeight,localInterval:l.localInterval||15},save:Z},"spacing")],rightIcons:[t.jsx(Ee,{children:l.loading&&t.jsx(mn,{size:18})},"loading"),t.jsx(Ee,{children:y==="calendar"?t.jsx("div",{}):t.jsx(G,{Icon:xn,onClick:()=>window.print(),onlyIcon:!0})},"print"),t.jsx(G,{title:"Add Appt",onClick:ge,Icon:yn,className:"sked-test-calendar-scheduler"},"add-appt"),t.jsx(G,{onClick:J,title:"Reset Filters",borderSolid:!0,marginLeft:5},"reset")],onlyIconsWidth:1570,breakPoints:[{width:1030,mobileItems:[15]},{width:956,mobileItems:[8,9,10,11,15]},{width:855,mobileItems:[6,7,8,9,10,11,15]},{width:770,mobileItems:[1,2,3,4,6,7,8,9,10,11,15]},{width:542,mobileItems:[1,2,3,4,5,6,7,8,9,10,11,15]}]}),t.jsxs(Es,{children:[t.jsxs(Ws,{children:[t.jsxs(Fs,{hasScroll:y==="print",style:{width:x?"50%":"100%",maxHeight:y==="print"?`calc(100vh - ${s.headerHeight+45}px)`:"100%"},children:[t.jsx("div",{style:{width:"100%",height:10}}),y==="print"&&t.jsxs($s,{children:["Appointments from ",xe()]}),ee&&C==="day"&&y==="calendar"&&t.jsx(ks,{viewAppointment:n=>e(pt(n)),reskedAppointment:n=>e(gt(n)),markAppointment:(n,r)=>e(dt(n,r)),skedAppointment:fe,possibleAppointments:x&&d.length>0?d:[],state:{...ne,...l},selectedProfessional:j,selectedLocation:b,selectedDate:p,store:s,hasConfirmationFeature:s.hasConfirmationFeature}),C==="week"&&y==="calendar"&&t.jsx(Ls,{viewAppointment:n=>e(pt(n)),reskedAppointment:n=>e(gt(n)),markAppointment:(n,r)=>e(dt(n,r)),skedAppointment:fe,selectedProfessional:j,selectedLocation:b,possibleAppointments:x&&d.length>0?d:[],state:{...ne,...l},selectedDate:p,store:s,hasConfirmationFeature:s.hasConfirmationFeature}),y==="print"&&t.jsx("div",{style:{marginLeft:"20px",paddingBottom:"20px"},children:l.appointments.map(n=>{var r;return t.jsxs("div",{style:{marginBottom:"20px",breakInside:"avoid"},children:[t.jsx("div",{children:Bs({time:n.time,timezone:s.tz})}),t.jsxs("div",{children:[n.client.firstName," ",n.client.lastName]}),t.jsxs(Ee,{display:"flex",children:[t.jsx(Kn,{appointmentType:n.appointmentType,provider:Os((r=n.appointmentType)==null?void 0:r.professionalId,s.professionals),fontSize:16}),t.jsxs(qe,{marginLeft:.5,fontSize:16,children:[n.appointmentType.duration,"m"]})]}),t.jsxs("div",{children:[n.status.Scheduled&&"Scheduled",n.status.Arrived&&"Arrived",n.status.Missed&&"Missed",n.status.Preview&&"Preview"]})]},n.id)})})]}),x&&t.jsx(Sn,{isOpen:x,refreshToday:R,setPossibleAppointments:m,timezone:s.tz,interval:s.timeIntervals,selectDate:oe,types:s.types,professionals:s.professionals,selectedTime:U,close:()=>u(!1),ehrSystem:s.ehrSystem,hasLeads:s.hasLeads,features:s.features,officeId:s.officeId})]}),t.jsx(jn,{open:s.state==="SKED_APT",appointment:s.selectedAppointment,tz:s.tz,from:"SKED",busy:s.aptBusy,onClose:()=>e(Ue()),gotoClient:n=>{B(n.id),e(Ue())},cancel:()=>e(fn(s.selectedAppointment)),back:()=>e(Ue()),pros:s.professionals,types:s.types,resked:n=>e(hn(n))}),t.jsx(wn,{clientId:X,open:!!X,onClose:()=>B(0)}),me&&t.jsx(Ns,{openSettings:me,handleCloseSettings:w,handleSaveSettings:Z,defaultForm:l})]})]})};export{jr 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.