1import{g as q,u as I,w as M,a0 as B,y as O,r as y,_ as v,an as A,T as N,z as j,aq as p,j as e,ed as C,C as H,Z as U,t as G,p as $,k as Q,am as D,N as W,ar as K,L as Y,fw as Z,I as J,Q as L,V as X,ad as ee,ae as te,bF as ae,eS as se}from"./index-Ba5x2QVK.js";import{b as oe,C as ne,D as ie,S as re}from"./StateDescriptionScreen-DOoiqNSU.js";import{M as le}from"./MobileStickyFooter-B4125FCe.js";import{s as ce,n as me}from"./appointmentSelector-C8fwNuKK.js";import{g as pe}from"./form-BwVQ8j7O.js";import{f as de}from"./request-form-DAj-Bp2F.js";import{e as ue,f as Se}from"./index-CjX5232D.js";import"./index-CRm-aGqA.js";import{u as fe}from"./useNavigateInternalRequestForm-B0WkD3aW.js";import"./formatErrorMessage-BebLn3kD.js";import"./index-CIgKKhPx.js";import"./index-CoBGeWf3.js";import"./index-Dcr8iWjF.js";const{Text:x}=G,xe=()=>{const{isMobileView:d,isSharedServiceView:o}=q(),{t}=I(),c=M(),u=B(),{memberIdentifier:n}=O(),[g,P]=y.useState(),S=v(ce),f=(S?.slots?.length??0)>0?A(S?.slots[0].startDateTime):N,{isAcuteVideoConsult:w,isSingleOrganizationVcService:k,selectedLocation:i,selectedServiceType:h}=v(me),m=y.useMemo(()=>h?.ServicesByOrganization.find(l=>l?.Organization===i?.OrganizationCode),[i?.OrganizationCode,h?.ServicesByOrganization]),b=m?.ServiceId,T=m?.ServiceType,{handleClickRequestForm:E}=fe({formType:Y.Make}),{data:s,error:a,isFetching:r}=ue({End:"",IsFilterStart:!1,IsUrtiConsult:!1,MemberPrn:n,NextPageRequestData:"",Organization:i?.OrganizationCode,ServiceId:b,ServiceType:T,SlotIdList:[],Start:j(g??f,p)}),[z]=Se(),R=async()=>{await z({End:"",IsFilterStart:!1,IsLoadMore:!0,IsUrtiConsult:!1,MemberPrn:n,NextPageRequestData:s?.Link?D(s?.Link):"",Organization:i?.OrganizationCode,ServiceId:b,ServiceType:T,SlotIdList:[],Start:j(g??f,p)}).unwrap()},_=()=>{c({pathname:Z,search:n?`?mid=${n}`:""})},F=()=>{c(J(L,{mid:n??""}),{replace:!0})};return e.jsx("div",{className:"mt-[0.15rem] flex h-full flex-col justify-between",children:e.jsxs("div",{className:K("flex flex-col gap-4",(d||o)&&!a&&"mb-44",a&&"mb-9"),children:[e.jsxs("div",{className:"space-y-4 bg-white p-4",children:[e.jsx(C,{label:`${t("appointment.serviceType")}:`,value:m?.DisplayName||m?.Name||""}),!k&&e.jsx(C,{label:`${t("appointment.location")}:`,value:i?.Name||""}),!w&&e.jsx(H,{className:"w-full lg:w-1/2",defaultValue:f,disabled:r,minDate:N.format(p),onChange:l=>{const V=A(l?.toDate()).format(p);P(V)},title:t("appointment.appointmentDate")})]}),e.jsxs("div",{className:"flex flex-col gap-2.5",children:[!!r&&e.jsx(U.Button,{active:!0,className:"mt-4 h-44 w-full rounded-lg"}),!r&&!!a&&e.jsx(oe,{description:e.jsxs(ie,{classNames:"space-y-6",children:[e.jsx(x,{className:"text-base font-semibold",children:t("appointment.sourceSystemOffline")}),e.jsx(x,{className:"text-sm",children:e.jsx("button",{className:"text-base",onClick:E,onContextMenu:l=>l.preventDefault(),type:"button",children:$(Q.sanitize(de({formType:pe({canCancel:!1,canReschedule:!1,path:u.pathname}),responseString:t("appointment.sourceSystemOfflineHelper")}),{ALLOWED_ATTR:["href","target","rel","style"]}))})}),!!a?.code&&e.jsx("div",{children:`(Code: ${a?.code})`})]}),image:ne}),!r&&!a&&e.jsx("div",{className:"mx-4",children:e.jsx(re,{appointmentSlots:{message:s?.Message??"",nexPageLink:s?.Link??"",slots:s?.Slots??[]},descriptionElement:e.jsx(x,{children:t("appointment.slotContainer.generalSlotDescription")}),isLoadMore:!!D(s?.Link??""),onLoadMoreSlot:R,title:"appointment.slotContainer.chooseATimeSlot"})})]}),!r&&!a&&e.jsx(le,{children:e.jsx(W,{cancelText:t("button.cancel"),handleCancel:F,handleSubmit:_,okDisabled:!S,okText:t("button.next")})})]})})},Oe=()=>{const d=M(),{t:o}=I(),{memberIdentifier:t}=O(),c=[{title:"Appointments"},{title:o("appointment.breadcrumbs.newAppointment")}],u=()=>{d({pathname:ae,search:t?`?mid=${t}`:""},{state:{step:se.SUMMARY}})};return e.jsx(X,{backButton:{name:o("button.back"),onBack:u},breadcrumbs:{portal:{breadcrumbsDetails:c}},title:o("appointment.breadcrumbs.newAppointment"),children:e.jsxs("div",{className:"flex-1 space-y-[1.5px]",children:[e.jsx(ee,{customSwitchUserNavigatePath:L,hideRelationship:!0,isShowSwitchUser:!0,switchProfileType:te.ALL}),e.jsx(xe,{})]})})};export{Oe 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.