"use strict";(self.webpackChunkhhgHealthCareV1=self.webpackChunkhhgHealthCareV1||[]).push([[9028],{86711:function(n,e,t){var i,o,r,a,l,c,d,s,u=t(73884);function p(){return p=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=(0,o.A)(n),v=g.getDay(),b=6+(v=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=(0,i.A)(n),v=g.getDay(),b=(v svg {\n overflow: visible;\n cursor: pointer;\n &:first-of-type {\n margin-right: 8px;\n transform: rotate(180deg);\n }\n &[data-is-first-week='true'],\n &[data-is-last-week='true'] {\n opacity: 0.3;\n pointer-events: none;\n }\n }\n }\n & {\n .week_display {\n min-width: 200px;\n margin-right: 6px;\n font-size: 14px;\n }\n }\n\n .edit-btn {\n color: ",";\n margin-right: 10px;\n }\n"]);return rn=function(){return n},n}function an(){var n=(0,h.A)(["\n position: relative;\n display: table;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n .timeline {\n display: table-cell;\n width: 60px;\n vertical-align: top;\n\n "," {\n width: 45px;\n }\n\n .day-column {\n width: 60px;\n min-width: 0;\n\n "," {\n width: 45px;\n }\n }\n .empty-title {\n height: 60px;\n border-width: 1px 0px 1px 1px;\n "," {\n height: 56px;\n }\n }\n }\n .day-column {\n min-width: 150px;\n flex: 1 1 auto;\n border-collapse: collapse;\n border: 0.1px solid ",";\n\n min-width: 14.28%;\n width: 14.28%;\n &:last-child {\n border-right: 1px solid #f1f2f4;\n }\n .date {\n font-size: 14px;\n line-height: 22px;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n }\n\n .day-hours {\n position: relative;\n display: flex;\n flex-direction: column;\n }\n\n .cell {\n display: flex;\n flex: 1 1 60px;\n align-items: flex-start;\n justify-content: flex-start;\n &:last-child {\n border-bottom: 1px solid #f1f2f4;\n }\n }\n .calendar {\n display: flex;\n /* border: 0.1px solid ","; */\n border-collapse: collapse;\n text-align: center;\n "," {\n &.sticky {\n z-index: 1;\n top: 64px;\n position: sticky;\n background-color: ",";\n }\n }\n }\n .heading {\n min-height: 60px;\n border: 1px solid #f1f2f4;\n border-width: 1px 0px 1px 1px;\n "," {\n min-height: 56px;\n &:last-child {\n border-right-width: 1px;\n }\n }\n .heading-wrap {\n height: 100%;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n padding: 4px 0;\n }\n }\n .calendar_overlay {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n width: 100%;\n height: 100%;\n border-collapse: collapse;\n text-align: center;\n }\n\n "," {\n .sticky {\n position: sticky;\n z-index: 8;\n top: 312px;\n background-color: white;\n }\n\n &[data-is-in-schedule='true'] {\n .sticky {\n top: 136px;\n }\n }\n }\n\n #currentTime {\n z-index: 7;\n display: flex;\n }\n #currentTime::before {\n position: absolute;\n top: -5px;\n left: -5px;\n display: inline-block;\n width: 12px;\n height: 12px;\n background-color: #2d87f3;\n border-radius: 50%;\n content: '';\n }\n #currentTime::after {\n position: absolute;\n top: -5px;\n right: -5px;\n display: inline-block;\n width: 12px;\n height: 12px;\n background-color: #2d87f3;\n border-radius: 50%;\n content: '';\n }\n"]);return an=function(){return n},n}function ln(){var n=(0,h.A)(["\n z-index: 10;\n min-width: 186px;\n margin-right: 16px;\n\n "," {\n flex: 1;\n }\n\n .time {\n input {\n height: 40px;\n }\n }\n"]);return ln=function(){return n},n}function cn(){var n=(0,h.A)(["\n position: relative;\n display: flex;\n justify-content: flex-end;\n & > img {\n position: absolute;\n top: -32px;\n right: 12px;\n cursor: pointer;\n }\n"]);return cn=function(){return n},n}function dn(){var n=(0,h.A)(["\n margin-top: -16px;\n padding-top: 16px;\n background-color: ",";\n padding-bottom: 16px;\n\n "," {\n position: sticky;\n z-index: 10;\n top: 238px;\n &[data-is-in-schedule='true'] {\n top: 64px;\n }\n }\n\n "," {\n padding-left: 16px;\n padding-right: 16px;\n }\n"]);return dn=function(){return n},n}function sn(){var n=(0,h.A)(["\n /* z-index: 1; */\n\n top: ","px;\n height: ","px;\n position: absolute;\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background-color: ",";\n\n &[data-appointment-type] {\n &::before {\n content: '';\n position: absolute;\n left: 2px;\n width: 3px;\n height: ","px;\n }\n\n &[data-is-first='true'] {\n &::before {\n margin-top: 4px;\n height: ","px;\n border-top-right-radius: 2px;\n border-top-left-radius: 2px;\n }\n }\n &[data-is-last='true'] {\n &::before {\n height: ","px;\n border-bottom-right-radius: 2px;\n border-bottom-left-radius: 2px;\n }\n }\n }\n\n &[data-appointment-type='","'] {\n &::before {\n background-color: ",";\n }\n }\n &[data-appointment-type='","'] {\n &::before {\n background-color: ",";\n }\n }\n &[data-appointment-type='","'] {\n &::before {\n background-color: ",";\n }\n }\n\n &:not([data-appointment-type='","']) {\n &:hover {\n cursor: pointer;\n outline: 1px solid ",";\n background-color: white;\n }\n\n &.hide-action-schedule {\n &:hover {\n outline: none;\n background-color: ",";\n pointer-events: none;\n }\n }\n }\n\n &[data-type='schedules'] {\n &:hover {\n cursor: pointer;\n outline: 1px solid ",";\n background-color: white;\n }\n\n &.hide-action-schedule {\n &:hover {\n outline: none;\n background-color: ",";\n pointer-events: none;\n }\n }\n }\n\n .add-new {\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 4px;\n svg {\n width: 16px;\n }\n }\n\n .schedule {\n height: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 6px;\n }\n"]);return sn=function(){return n},n}function un(){var n=(0,h.A)(["\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n\n .remove-unavailable {\n background-color: white;\n }\n\n svg > path {\n stroke: ",";\n width: 16px;\n height: 16px;\n }\n div {\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n flex-direction: row;\n align-items: center;\n gap: 4px;\n }\n ul {\n margin: 1px 0;\n min-width: 100px;\n width: 100%;\n }\n"]);return un=function(){return n},n}function pn(){var n=(0,h.A)(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding: 9px 12px 9px 16px;\n gap: 8px;\n width: max-content;\n height: 42px;\n\n color: ",";\n background-color: ",";\n border-radius: 4px;\n\n font-weight: 700;\n font-size: 14px;\n line-height: 22px;\n svg > path {\n stroke: ",";\n width: 18px;\n height: 18px;\n }\n"]);return pn=function(){return n},n}function hn(){var n=(0,h.A)(["\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n padding: 2px 6px 0 6px;\n\n .dayoff {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n border-radius: 4px;\n background-color: ",";\n width: fit-content;\n padding: 0 2px;\n margin-bottom: 4px;\n }\n svg {\n width: 16px;\n "," {\n display: none;\n }\n }\n .remove {\n path {\n stroke: ",";\n }\n }\n .bin {\n path {\n stroke: ",";\n }\n }\n .off {\n margin-top: 4px;\n }\n"]);return hn=function(){return n},n}function fn(){var n=(0,h.A)(["\n position: absolute;\n opacity: ",";\n top: ","px;\n height: ","px;\n max-height: ","px;\n font-size: ",";\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n overflow: hidden;\n background: repeating-linear-gradient(\n -45deg,\n ",",\n "," 1px,\n white 0,\n white 3px\n );\n\n &:hover {\n cursor: pointer;\n background: ",";\n }\n .off {\n /* height: 100%; */\n margin-top: 4px;\n }\n"]);return fn=function(){return n},n}var mn=f.Ay.div.withConfig({componentId:"sc-2069c75a-0"})(on()),gn=f.Ay.div.withConfig({componentId:"sc-2069c75a-1"})(rn(),K.M.mbDown,(function(n){return n.theme.colors.primaryBase})),vn=f.Ay.div.withConfig({componentId:"sc-2069c75a-2"})(an(),K.M.tdDown,K.M.tdDown,K.M.mbDown,(function(n){return n.theme.colors.neutral100}),(function(n){return n.theme.colors.neutral100}),K.M.mbDown,(function(n){return n.theme.colors.white}),K.M.mbDown,K.M.tdUp),bn=f.Ay.div.withConfig({componentId:"sc-2069c75a-3"})(ln(),K.M.mbDown),yn=f.Ay.div.withConfig({componentId:"sc-2069c75a-4"})(cn()),xn=f.Ay.header.withConfig({componentId:"sc-2069c75a-5"})(dn(),(function(n){return n.theme.colors.white}),K.M.tdUp,K.M.mbDown),wn=f.Ay.div.withConfig({componentId:"sc-2069c75a-6"})(sn(),(function(n){return n.top}),(function(n){return n.height}),(function(n){return n.theme.colors.green50}),(function(n){return n.height}),(function(n){return n.height-4}),(function(n){return n.height-4}),H.foO.BOTH,(function(n){return n.theme.colors.green700}),H.foO.OUTPATIENT,(function(n){return n.theme.colors.primaryBase}),H.foO.TELEMEDICINE,(function(n){return n.theme.colors.yellow900}),H.foO.TELEMEDICINE,(function(n){return n.theme.colors.neutral100}),(function(n){return n.theme.colors.green50}),(function(n){return n.theme.colors.neutral100}),(function(n){return n.theme.colors.green50})),An=f.Ay.div.withConfig({componentId:"sc-2069c75a-7"})(un(),(function(n){return n.theme.colors.primaryBase})),kn=f.Ay.div.withConfig({componentId:"sc-2069c75a-8"})(pn(),(function(n){return n.theme.colors.white}),(function(n){return n.theme.colors.primaryBase}),(function(n){return n.theme.colors.white})),Mn=f.Ay.div.withConfig({componentId:"sc-2069c75a-9"})(hn(),(function(n){return n.theme.colors.violet50}),K.M.mbDown,(function(n){return n.theme.colors.violet600}),(function(n){return n.theme.colors.gray600})),Dn=f.Ay.div.attrs((function(n){return{difference:n.difference||1,height:n.height||15,visible:n.visible||1}})).withConfig({componentId:"sc-2069c75a-10"})(fn(),(function(n){return n.visible}),(function(n){return 2*n.difference}),(function(n){return 2*n.height}),(function(n){return 2*n.height}),(function(n){return n.height<=20?"12px":"inherit"}),(function(n){return n.theme.colors.violet50}),(function(n){return n.theme.colors.violet50}),(function(n){return n.theme.colors.violet50})),Yn=t(8859),Cn=t(90206),En=function(n){return+n.split(":")[0]},Fn=function(n){return+n.split(":")[1]},Nn=function(n){var e=n.schedule,t=n.currentDate,i=n.onClickAdd,o=n.isFirst,r=n.isLast,c=n.isEdit,d=n.onEdit,s=n.type,h=n.disableActionSchedule,f=void 0!==h&&h,m=n.onSetUnavailable,g=(0,V.A)().formatMessage,v=Number(e.appointment_type),b=(0,l.useState)(),y=b[0],x=b[1],w=new Date,A=w.getFullYear(),k=w.getMonth(),M=w.getDate(),D=(0,j.A)(new Date(A,k,M,En(e.started),Fn(e.started),0),new Date(A,k,M,0,0,0)),Y=(0,j.A)(new Date(A,k,M,En(e.ended),Fn(e.ended),0),new Date(A,k,M,En(e.started),Fn(e.started),0)),C=(0,l.useMemo)((function(){return[{value:"appointment",name:g({id:"admin.schedule.create.appointment",defaultMessage:"Appointment"}),action:function(){return i(e,t)}},{value:"unavailable",name:g({id:"admin.schedule.create.setUnavailable",defaultMessage:"Set unavailable"}),action:function(){return null===m||void 0===m?void 0:m(e,t)}}]}),[g]);return(0,l.useEffect)((function(){"schedules"!==s||c||x(void 0)}),[c]),(0,a.FD)(wn,{top:2*D,height:2*Y,className:"cell schedule ".concat(f?"hide-action-schedule":""),onMouseEnter:function(){"schedules"===s?v===H.foO.TELEMEDICINE?x("set-unavailable"):x("full"):v!==H.foO.TELEMEDICINE&&x("appointment")},onMouseLeave:function(){x(void 0)},onClick:function(){f||("schedules"===s?v===H.foO.TELEMEDICINE?null===m||void 0===m||m(e,t):null===d||void 0===d||d(e.schedule_id):v!==H.foO.TELEMEDICINE&&i(e,t))},"data-appointment-type":v,"data-is-first":o,"data-is-last":r,"data-type":s,children:[!f&&"full"===y&&(0,a.Y)(An,{children:(0,a.Y)(q.r,{data:C,button:(0,a.FD)("div",{children:[(0,a.Y)(u.T,{size:"n1",type:"semiBold",color:p.w.colors.primaryBase,children:g({id:"admin.booking.addNew",defaultMessage:"Add new"})}),(0,a.Y)(Yn.A,{})]})})}),!f&&"set-unavailable"===y&&(0,a.Y)(An,{children:(0,a.Y)(u.T,{size:"n1",type:"semiBold",color:p.w.colors.gray600,children:g({id:"admin.schedule.create.setUnavailable",defaultMessage:"Set unavailable"})})}),!f&&"appointment"===y&&(0,a.FD)("div",{className:"add-new",children:[(0,a.Y)(Cn.A,{width:"16px",height:"16px"}),(0,a.Y)(u.T,{size:"n1",type:"semiBold",color:p.w.colors.primaryBase,children:g({id:"admin.booking.addNew",defaultMessage:"Add new"})})]})]})},On=t(66e3),Sn=t(1032),In=function(n){var e=n.unavailable,t=n.onRemoveUnavailable,i=n.visible,o=void 0===i||i,r=(0,V.A)().formatMessage,c="00:00"===e.started&&"24:00"===e.ended,d=(0,X.A)("".concat(e.date," ").concat(e.started)||"","yyyy-MM-dd HH:mm",new Date),s=(0,X.A)("".concat(e.date," ").concat("24:00"===e.ended?"23:59":e.ended)||"","yyyy-MM-dd HH:mm",new Date),h=d.getFullYear(),f=d.getMonth(),m=d.getDate(),g=(0,j.A)(d,new Date(h,f,m,0,0,0)),v=(0,j.A)(s,d),b=(0,l.useState)(!1),y=b[0],x=b[1];return(0,a.Y)(Dn,{visible:o?1:0,difference:g,height:v,id:"js-booking-".concat(e.id),"data-is-day-off":c,onMouseEnter:function(){x(!0)},onMouseLeave:function(){x(!1)},onClick:function(){return null===t||void 0===t?void 0:t(e)},children:y&&(0,a.FD)(Mn,{style:{alignItems:"flex-start",padding:"14px 6px 0 6px"},children:[(0,a.FD)("div",{className:"dayoff",children:[(0,a.Y)(On.A,{className:"remove"}),(0,a.Y)(u.T,{size:"n1",type:"semiBold",color:p.w.colors.violet600,children:r({id:"admin.schedule.create.remove",defaultMessage:"Unavailable"})})]}),(0,a.Y)(Sn.A,{className:"bin off"})]})})},zn=t(64889),Tn={Mon:"day.Mon",Tue:"day.Tue",Wed:"day.Wed",Thu:"day.Thu",Fri:"day.Fri",Sat:"day.Sat",Sun:"day.Sun"};function jn(n){return n.getBoundingClientRect().top+(window.scrollY||document.documentElement.scrollTop)}function Bn(n,e){var t=document.querySelector(n),i=window.outerHeight||document.documentElement.clientHeight||document.body.clientHeight;t&&(e?window.scrollTo({top:jn(t)-i/2,left:0,behavior:"smooth"}):t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"}))}var Ln=function(n,e){for(var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30,i=[],o=n;o<=e;o++)for(var a=0;a<60;a+=t){var l=o<10?"0"+o:o,c=0===a?a+"0":a,d=l+":"+c;i=(0,r.A)(i).concat([d])}return i},Hn=function(n){return(0,L.B)(_n,n)},_n=function(n){var e=n.eventObject,t=n.scheduleObject,h=n.onClickDetailBooking,f=n.onAddAppointment,m=n.addNewAppointment,g=n.scrollCalendarId,v=n.initDisplayDate,b=void 0===v?new Date:v,y=n.isInSchedule,x=void 0!==y&&y,w=n.type,A=n.isChoosingAction,k=n.setIsChoosingAction,M=n.addUnavailable,D=n.addUnavailableOnSchedule,L=n.onRemoveUnavailable,P=n.fetchEventObject,J=n.unavailableSchedules,K=n.disableActionSchedule,G=void 0!==K&&K,Q=(0,l.useContext)(W.B).state.userInfo,X=(0,V.A)().formatMessage,Z=(0,_.useRouter)().locale,$=(0,B.d)().isMobileOrTablet,nn=new Date,en=(0,l.useState)(!1),on=en[0],rn=en[1],an=(0,l.useState)(b),ln=an[0],cn=an[1],dn=(0,l.useState)({availability:!0,past:!0,upcoming:!0,telemed:!0}),sn=dn[0],un=dn[1],pn=(0,C.A)(ln,{weekStartsOn:1});(0,l.useEffect)((function(){return rn(!0)}),[]);var hn=function(n){var e,t=(0,S.A)(n);return!!(J&&(null===(e=J[t])||void 0===e?void 0:e.every((function(n){return"00:00"===n.started&&"24:00"===n.ended}))))},fn=function(){setTimeout((function(){Bn('[id*="js-booking-"]',$)}),100)},wn=(0,l.useMemo)((function(){return[{value:"appointment",name:X({id:"admin.schedule.create.appointment",defaultMessage:"Appointment"}),action:m},{value:"unavailable",name:X({id:"admin.schedule.create.setUnavailable",defaultMessage:"Set unavailable"}),action:M}]}),[X]),An=function(n){var e=(0,S.A)(n);if(void 0!==J&&J.hasOwnProperty(e))return(0,a.Y)("div",{children:J[e].map((function(n){return(0,a.Y)(In,{unavailable:n,onRemoveUnavailable:L},n.id)}))})},Dn=function(n,e){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(!t){var r=(0,z.A)(n);if(r)return null}var l=(0,S.A)(n);if(void 0!==e&&e.hasOwnProperty(l))return(0,a.Y)("div",{children:e[l].map((function(n){var e=!0;return(i||n.appointmentType!==H.YYr.INPATIENT_HOSPITAL)&&(o||n.appointmentType!==H.YYr.VIDEO_CALL)||(e=!1),(0,a.Y)(tn,{booking:n,onClickDetailBooking:h,visible:e},n.id)}))})},Cn=function(n,e){var t=(0,S.A)(n);if(void 0!==e&&e.hasOwnProperty(t))return(0,a.Y)("div",{children:e[t].map((function(i,o){var r,l=Boolean((null===(r=e[t][o-1])||void 0===r?void 0:r.appointment_type)&&e[t][o-1].appointment_type!==i.appointment_type),c=Boolean(!e[t][o+1]||e[t][o+1].appointment_type!==i.appointment_type);return(0,a.Y)(Nn,{isFirst:l,isLast:c,schedule:i,onClickAdd:f,onSetUnavailable:D,currentDate:n,isEdit:A===i.schedule_id,onEdit:k,type:w,disableActionSchedule:G},i.schedule_id)}))})},En=function(n){var e=(0,T.A)(n);if(on&&e){var t=new Date,i=t.getDate(),o=t.getMonth(),r=t.getFullYear(),l=(0,j.A)(t,new Date(r,o,i,0,0,0));return(0,a.Y)("div",{style:{position:"absolute",top:2*l,height:"2px",backgroundColor:"#2D87F3",width:"100%"},id:"currentTime"})}return null},Fn=function(n){var e=X({id:Tn[(0,N.A)((0,O.A)(pn,n),"ccc")],defaultMessage:"Day"});return"vi-VN"===Z?$?e.split(" ").map((function(n){return n[0].toUpperCase()})).join(""):e:$?e[0]:e};return(0,l.useEffect)((function(){var n=setTimeout((function(){Bn("#"+(g?"js-booking-".concat(g):"currentTime"),$)}),100);return function(){return clearTimeout(n)}}),[g,$]),(0,a.FD)(mn,{children:[(0,a.Y)(xn,{"data-is-in-schedule":x,children:(0,a.FD)(gn,{children:[(0,a.FD)("div",{className:"d-flex",children:[(0,a.FD)(bn,{children:[(0,a.Y)(c.I,{autoComplete:"off",name:"date",placeholder:"",type:"text",size:"sm",value:function(n){if((0,E.A)(n,(0,C.A)(new Date,{weekStartsOn:1})))return X({id:"admin.schedule.thisWeek",defaultMessage:"This week"});var e=(0,F.A)(n,{weekStartsOn:1});return"".concat((0,N.A)(n,"MMM dd")," - ").concat((0,N.A)(e,"MMM dd yyyy"))}(pn),className:"time"}),(0,a.Y)(d.D,{pickedDate:function(n){for(var e=(0,F.A)(pn,{weekStartsOn:1}),t=[],i=n;i<=e;)t.push(new Date(i)),i=(0,O.A)(i,1);return t}(pn),customInput:function(n){return(0,a.Y)(yn,{onClick:n.onClick,children:(0,a.Y)("img",{src:"".concat(H.JpE,"/images/chevron-down.svg")})})},className:"Selectable",onChange:function(n){cn(n),fn(),P&&P(n)},locale:Z})]}),(0,a.FD)("div",{className:"skip-buttons",children:[(0,a.Y)(R,{onClick:function(){cn((0,I.A)(ln,7)),fn(),P&&P((0,I.A)(ln,7))},role:"button"}),(0,a.Y)(R,{onClick:function(){cn((0,O.A)(ln,7)),fn(),P&&P((0,O.A)(ln,7))},role:"button"})]})]}),(0,a.FD)("div",{className:"d-flex sp-mt-10",children:[(0,a.FD)("div",{className:"d-flex-center",children:[(0,a.Y)(Y,{label:"Telemedicine",name:"telemed",id:"telemed",color:"orange",checked:sn.telemed,onChange:function(){return un((0,o.A)((0,i.A)({},sn),{telemed:!sn.telemed}))}}),(0,a.Y)(Y,{label:"Outpatient",name:"upcoming",id:"upcoming",color:"blue",checked:sn.upcoming,onChange:function(){return un((0,o.A)((0,i.A)({},sn),{upcoming:!sn.upcoming}))}}),(0,a.Y)(Y,{label:X({id:"admin.booking.availability",defaultMessage:"Availability"}),name:"checkbox",id:"availability",color:"green",checked:sn.availability,onChange:function(){return un((0,o.A)((0,i.A)({},sn),{availability:!sn.availability}))}}),(0,a.Y)(Y,{label:X({id:"admin.booking.past",defaultMessage:"Past"}),name:"checkbox",id:"past",color:"grey",checked:sn.past,onChange:function(){return un((0,o.A)((0,i.A)({},sn),{past:!sn.past}))}})]}),"doctor"===(null===Q||void 0===Q?void 0:Q.role)&&(0,a.Y)(s.B,{onClick:function(){return U().push("/admin/schedule/edit")},color:"transparent",size:"md",icon:(0,a.Y)(zn.A,{}),className:"edit-btn",children:X({id:"admin.doctors.editSchedule",defaultMessage:"Edit Schedule"})}),!G&&!$&&(0,a.Y)(a.FK,{children:"schedules"===w?(0,a.Y)(q.r,{data:wn,button:(0,a.FD)(kn,{children:[X({id:"admin.schedule.create.title",defaultMessage:"Create"})," ",(0,a.Y)(Yn.A,{})]})}):(0,a.FD)(s.B,{color:"primary",size:"md",onClick:m,children:["+"," ",X({id:"admin.booking.addAnAppointment",defaultMessage:"Add an appointment"})]})})]})]})}),(0,a.FD)(vn,{"data-is-in-schedule":x,children:[(0,a.Y)("div",{className:"timeline",children:(0,a.FD)("div",{className:"day-column",children:[(0,a.Y)("div",{className:"empty-title",children:(0,a.FD)("div",{style:{visibility:"hidden"},className:"date",children:[" ","Empty Cell"]})}),(0,a.Y)("div",{className:"day-hours",children:Ln(0,23).map((function(n,e){return(0,a.Y)("div",{className:"cell",style:{position:"relative",borderLeft:"1px solid #F1F2F4"},children:(0,a.Y)("span",{style:{fontSize:"13px",paddingLeft:5},children:e%2!==0?"":n})},"header-".concat(e))}))})]})}),(0,a.Y)("div",{className:"calendar sticky",children:(0,r.A)(Array(7)).map((function(n,e){return(0,a.Y)("div",{className:"day-column heading",style:{backgroundColor:(0,S.A)(nn)===(0,S.A)((0,O.A)(pn,e))?"#E3F2FF":""},children:(0,a.FD)("div",{className:"heading-wrap",children:[(0,a.Y)("div",{className:"w-full font-bold date",children:Fn(e)}),hn((0,O.A)(pn,e))?(0,a.Y)(Mn,{onClick:function(){var n=(0,S.A)((0,O.A)(pn,e)),t=J&&J[n];t&&(null===L||void 0===L||L(t[0]))},style:{justifyContent:"center",alignItems:"flex-start"},children:(0,a.FD)("div",{className:"dayoff",children:[(0,a.Y)(On.A,{className:"remove"}),(0,a.Y)(u.T,{size:"n1",color:p.w.colors.violet600,children:(0,N.A)((0,O.A)(pn,e),$?"dd/MM":"dd/MM/yyyy")}),(0,a.Y)(Sn.A,{className:"bin"})]})}):(0,a.Y)("div",{style:{color:"#737373"},className:"w-full date",children:(0,N.A)((0,O.A)(pn,e),$?"dd/MM":"dd/MM/yyyy")})]})},"day-title-".concat(e+1))}))}),(0,a.FD)("div",{style:{position:"relative"},children:[(0,a.Y)("div",{className:"calendar",children:(0,r.A)(Array(7)).map((function(n,e){return(0,a.Y)("div",{className:"day-column",style:{borderLeft:"1px solid #F1F2F4"},children:(0,a.Y)("div",{className:"day-hours",children:Ln(0,23,30).map((function(n,e){return(0,a.Y)("div",{id:"empty-cell-".concat(e),className:"cell",style:{borderBottom:e%2===0?"1px dashed #E6E7EC":"1px solid #E6E7EC"}},"empty-cell-".concat(e))}))})},"day-".concat(e+1))}))}),(0,a.Y)("div",{className:"calendar_overlay",children:(0,r.A)(Array(7)).map((function(n,i){return(0,a.Y)("div",{className:"day-column",children:(0,a.FD)("div",{className:"day-hours",children:[sn.availability&&Cn((0,O.A)(pn,i),t),Dn((0,O.A)(pn,i),e,sn.past,sn.upcoming,sn.telemed),An((0,O.A)(pn,i)),En((0,O.A)(pn,i))]})},"day-event-".concat(i+1))}))})]})]})]})}},83545:function(n,e,t){t.d(e,{B:function(){return a}});var i=t(53513),o=t(2445),r=t(73884);function a(n,e){var t=(0,r.useState)(!1),a=t[0],l=t[1];return(0,r.useEffect)((function(){return l(!0)}),[]),a?(0,o.Y)(n,(0,i.A)({},e)):null}}}]);