1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0f882-7b32-70f0-9238-5b33a324e152")}catch(e){}}();import{_ as js}from"./bXCbavT4.js";import{_ as Bs,n as $a,a as H,p as Je,d as Rs,o as Fs,c as Us,J as Ls}from"./B9L9bz2X.js";import{w as lt,o,A as ee,B as ye,C as f,u as e,a as t,x as oe,ai as zs,aa as i,c as d,I as p,ad as R,F as z,ab as q,d as v,r as m,al as mr,k as pr,ac as qs,g as Hs,G as se,S as Er,am as B,an as F,aq as ar,T as Gs,j as Ca,q as Ks}from"./BccGmGEE.js";import{Y as Ur,h as Na,G as Lr,S as zr,V as Ws}from"./BziuwqZg.js";import{a as Zs,c as qr,r as fr,G as rr,F as Ys,b3 as Qs,o as Xs,i as Xt,u as jr,A as Qe,aj as Jt,b4 as Js,a8 as ea,b5 as nr,q as Br,x as ei,s as ta,t as wt,ab as aa,a4 as Rr,$ as sr,aI as ir,m as ti}from"./BYZkvKjW.js";import{B as Fr}from"./D7ABbS-D.js";import{_ as xt}from"./DrdqExHg.js";import{usePrint as ai}from"./t8g2iBkJ.js";import{r as ri}from"./C1md7WsV.js";import{s as ni}from"./Ck5TixCY.js";import"./gCrg-oG1.js";import"./oL1aYJWA.js";import"./C_aVfSp4.js";import"./z0-iSErK.js";import"./Dk0_6L3c.js";import"./BIaf0pSb.js";const si={class:"fixed inset-0 overflow-y-auto"},ii={class:"flex min-h-full items-center justify-center p-4 sm:p-6"},oi={class:"border-b border-neutral-200 bg-white/95 px-6 py-5 backdrop-blur-sm"},li={class:"flex items-start justify-between gap-4"},di={class:"flex flex-1 items-start gap-4"},ui={class:"min-w-0"},ci={class:"mt-0 text-lg font-semibold leading-tight text-neutral-900"},mi={key:0,class:"mt-1 text-sm text-neutral-500"},pi={class:"flex items-center gap-2"},fi=["disabled"],yi={key:0,class:"h-4 w-4 animate-spin",fill:"none",viewBox:"0 0 24 24"},vi={key:1,class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},hi={key:0,class:"border-b border-neutral-100 bg-neutral-50/80 px-6 py-3"},gi={class:"flex flex-wrap items-center justify-between gap-3"},bi={class:"flex flex-wrap items-center gap-2 text-xs text-neutral-600"},wi={key:0,class:"inline-flex items-center gap-2 rounded-full border border-neutral-200 bg-white px-2.5 py-1 font-medium text-neutral-700"},xi={key:1,class:"inline-flex items-center gap-2 rounded-full border border-primary-200 bg-primary-50 px-2.5 py-1 font-medium text-primary-600"},_i={class:"max-w-[160px] truncate sm:max-w-none"},Si={key:0,class:"text-primary-500"},ki={key:0},Di={key:0},Ti={key:1},Ii={key:0,class:"flex items-center gap-1.5 overflow-x-auto","aria-label":"Note tabs"},Pi=["onClick","title"],Ci={class:"flex-1 overflow-hidden bg-neutral-50/60"},$i={key:0,class:"flex h-full flex-col items-center justify-center gap-4"},Ni={key:1,class:"h-full overflow-y-auto px-6 py-6"},Mi={class:"mx-auto w-full max-w-2xl rounded-2xl border border-error-200 bg-error-50/70 px-5 py-6 text-center shadow-sm"},Vi={class:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-error-100 text-error-600"},Oi={class:"mt-2 text-sm text-error-600"},Ai={key:2,class:"h-full overflow-y-auto px-6 py-6"},Ei={class:"mx-auto w-full max-w-3xl"},ji={class:"rounded-2xl border border-neutral-200 bg-white/95 px-5 py-6 shadow-sm"},Bi=["innerHTML"],Ri={key:3,class:"flex h-full items-center justify-center px-6 py-6"},Fi={class:"mx-auto w-full max-w-md text-center"},Ui={class:"mx-auto flex h-12 w-12 items-center justify-center rounded-full border border-neutral-200 bg-white text-neutral-400"},Li={class:"mt-2 text-sm text-neutral-500"},Xe=3,zi={__name:"TranscriptionNoteModal",props:{isVisible:{type:Boolean,required:!0},visitId:{type:[String,Number],default:null},highlightTerm:{type:String,default:null}},emits:["close"],setup(G,{emit:K}){const a=G,U=K,le=m(!1),A=m(null),k=m(""),Z=m(""),Y=m("template"),N=m(!1),b=m(!1),V=m(0),et=m(!1),ve=m([]),dt=m(0),ra=g=>g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Ue=v(()=>{const g=a.highlightTerm?.trim();return g?g.split(/\s+/).map(h=>h.trim()).filter(h=>h.length>2):[]}),$t=v(()=>Ue.value.length>0),Nt=v(()=>{const g=a.highlightTerm?.trim();return g?g.length>40?`${g.slice(0,37)}â¦`:g:""}),Mt=v(()=>{if(!k.value||!Ue.value.length)return 0;let g=0;for(const h of Ue.value){const T=new RegExp(`\\b${ra(h)}\\b`,"gi"),I=k.value.match(T);I&&(g+=I.length)}return g}),na=v(()=>{const g=k.value?.trim();
1return g?{wordCount:g.split(/\s+/).filter(Boolean).length}:{wordCount:0}}),te=v(()=>{const g=String(Y.value||"").toLowerCase(),h={label:"Transcription note",description:"Preview from this visit",indicator:"border-neutral-200 bg-neutral-50 text-neutral-600",icon:rr};return g==="template"||g==="note_template"?{label:"Template note",description:"Generated Note",indicator:"border-info-200 bg-info-50 text-info-600",icon:rr}:g==="audio"||g==="transcription"||g==="audio_transcription"?{label:"Audio transcription",description:"Transcribed from a recorded visit",indicator:"border-primary-200 bg-primary-50 text-primary-600",icon:Ys}:h}),sa=v(()=>Z.value?Z.value:a.visitId?`Visit #${a.visitId}`:"Transcription note"),Le=v(()=>{const g=[];return Z.value&&a.visitId&&g.push(`Visit #${a.visitId}`),te.value.description&&g.push(te.value.description),g.length?g.join(" ⢠"):null}),ia=v(()=>{if(!k.value)return"";let h=(S=>S.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"))(k.value);if(Ue.value.length)for(const S of Ue.value){const he=new RegExp(`(\\b${ra(S)}\\b)`,"gi");h=h.replace(he,'<mark data-highlight="true">$1</mark>')}const T=h.split(/\n{2,}/).map(S=>S.trim()).filter(Boolean);if(!T.length)return"";const I=S=>{if(!S)return"";if(/^([A-Z][A-Z\s]+:)/.test(S)){const[O,..._e]=S.split(/:\s*/),ze=`${O}:`,mt=_e.join(": ").trim(),St=`<h4 class="note-heading">${ze}</h4>`;if(!mt)return St;const la=mt.replace(/\n/g,"<br />");return`${St}<p>${la}</p>`}if(/^(?:-|\u2022)\s/.test(S)){const O=S.split(/\n/).map(_e=>_e.replace(/^(?:-|\u2022)\s*/,"").trim()).filter(Boolean);return O.length?`<ul class="note-list">${O.map(_e=>`<li>${_e}</li>`).join("")}</ul>`:""}return`<p>${S.replace(/\n/g,"<br />")}</p>`};return T.map(I).join("")}),oa=async()=>{if(!(!a.visitId||a.visitId==="undefined"||a.visitId==="null")){le.value=!0,A.value=null,k.value="",Z.value="",ve.value=[],dt.value=0;try{const g=H().currentOrgId||null,h=await Je("/api/transcriptions/get-note",{method:"POST",headers:g?{"x-claio-preferred-org":String(g)}:void 0,body:{visitId:a.visitId,highlightTerm:a.highlightTerm||null}});h?.success?(Z.value=h.visitName||"",Y.value=h.contentSource||"template",h.notes&&Array.isArray(h.notes)&&h.notes.length>0?(ve.value=h.notes,k.value=h.notes[0].content||""):(k.value=h.noteContent||"",ve.value=[]),k.value||(A.value=`No ${Y.value} content found for visit ID ${a.visitId}`)):A.value="Failed to load transcription note"}catch(g){console.error("Error fetching note content:",g?.message||"Unknown error"),g.statusCode===404?A.value=`Transcription not found for visit ID ${a.visitId}`:A.value=g.message||"Failed to load transcription note"}finally{le.value=!1}}},ut=()=>{U("close")},Q=v(()=>ve.value.length>1),L=g=>{g>=0&&g<ve.value.length&&(dt.value=g,k.value=ve.value[g].content||"")},ct=g=>g?g.replace(/_/g," ").replace(/([A-Z])/g," $1").trim().split(" ").map(h=>h.charAt(0).toUpperCase()+h.slice(1).toLowerCase()).join(" "):"Note",_t=async()=>{if(!et.value){if(!a.visitId){console.warn("[TranscriptionNoteModal] No visitId provided for navigation");return}et.value=!0,N.value=!0;try{const g={visit_id:a.visitId,...a.highlightTerm&&{highlight:a.highlightTerm},r:`${Date.now()}-${Math.random().toString(36).substring(2,11)}`};ut(),await new Promise(I=>setTimeout(I,100));const h={path:"/transcribing",query:g},T={replace:!0};try{const I=$a(h,T),S=new Promise((he,O)=>setTimeout(()=>O(new Error("Navigation timeout after 5 seconds")),5e3));await Promise.race([I,S])}catch(I){console.warn("[TranscriptionNoteModal] Primary navigation failed, trying fallback:",I);try{await mr().replace(h)}catch(S){console.warn("[TranscriptionNoteModal] Router.replace failed, trying router.push:",S);try{await mr().push(h)}catch(he){if(console.error("[TranscriptionNoteModal] All navigation methods failed:",he),b.value=!0,V.value++,V.value>=Xe){const O=new URL(window.location.href);O.pathname="/transcribing",O.search=new URLSearchParams(g).toString(),window.location.replace(O.toString())}else throw he}}}}catch(g){if(console.error("[TranscriptionNoteModal] Critical error in navigation process:",g?.message||"Unknown error"),b.value=!0,V.value++,V.value<Xe){const h=`Navigation failed (attempt ${V.value}/${Xe}). The "Go to Note" button will show a retry option.`;console.warn(h)}else V.value>=Xe&&alert("Unable to navigate to the note after multiple attempts. Please refresh the page and try again.")}finally{N.value=!1,setTimeout(()=>{et.value=!1},b.value?3e3:1e3)}}},xe=()=>{b.value=!1,V.value=0,N.value=!1};return lt(()=>[a.isVisible,a.visitId],([g,h])=>{g&&h&&h!=="undefined"&&h!=="null"&&(oa(),xe())},{immediate:!0}),(g,h)=>(o(),ee(e(zr),{appear:"",show:G.isVisible,as:"template"},{default:ye(()=>[f(e(Ur),{as:"div",onClose:ut,class:"relative z-[60]"},{default:ye(()=>[f(e(Na),{as:"template",enter:"duration-300 ease-out","enter-from":"opacity-0","enter-to":"opacity-100",leave:"duration-200 ease-in","leave-from":"opacity-100","leave-to":"opacity-0"},{default:ye(()=>[...h[0]||(h[0]=[t("div",{class:"fixed inset-0 bg-neutral-900/50 backdrop-blur-sm"},null,-1)])]),_:1}),t("div",si,[t("div",ii,[f(e(Na),{as:"template",enter:"duration-300 ease-out","enter-from":"opacity-0 scale-95","enter-to":"opacity-100 scale-100",leave:"duration-200 ease-in","leave-from":"opacity-100 scale-100","leave-to":"opacity-0 scale-95"},{default:ye(()=>[f(e(Lr),{class:"relative flex h-[85vh] max-h-[900px] w-full max-w-5xl flex-col overflow-hidden rounded-2xl border border-neutral-200 bg-white shadow-2xl shadow-neutral-900/10"},{default:ye(()=>[t("header",oi,[t("div",li,[t("div",di,[t("div",{class:oe(["flex h-12 w-12 shrink-0 items-center justify-center rounded-xl border text-neutral-600",te.value.indicator])},[(o(),ee(zs(te.value.icon),{class:"h-5 w-5"}))],2),t("div",ui,[t("h3",ci,i(sa.value),1),Le.value?(o(),d("p",mi,i(Le.value),1)):p("",!0)])]),t("div",pi,[a.visitId?(o(),d("button",{key:0,t
1ype:"button",onClick:_t,disabled:N.value,class:oe(["inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium transition",N.value?"border-neutral-400 bg-neutral-400 text-white cursor-not-allowed":b.value&&V.value<Xe?"border-warning-600 bg-warning-600 text-white hover:bg-warning-700 hover:border-warning-700":b.value&&V.value>=Xe?"border-error-600 bg-error-600 text-white hover:bg-error-700 hover:border-error-700":"border-neutral-700 bg-neutral-700 text-white hover:bg-neutral-800 hover:border-neutral-800"])},[N.value?(o(),d("svg",yi,[...h[1]||(h[1]=[t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),t("path",{class:"opacity-75",fill:"currentColor",d:"m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):(o(),d("svg",vi,[...h[2]||(h[2]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},null,-1)])])),R(" "+i(N.value?"Opening Note...":b.value&&V.value<Xe?`Retry Go to Note (${V.value}/${Xe})`:b.value&&V.value>=Xe?"Navigation Failed":"Go to Note"),1)],10,fi)):p("",!0),t("button",{type:"button",class:"rounded-full p-2 text-neutral-400 transition hover:bg-neutral-100 hover:text-neutral-600",onClick:ut,"aria-label":"Close transcription modal"},[f(e(Zs),{class:"h-5 w-5"})])])])]),k.value||Nt.value?(o(),d("div",hi,[t("div",gi,[t("div",bi,[k.value?(o(),d("span",wi,i(na.value.wordCount)+" words ",1)):p("",!0),Nt.value?(o(),d("span",xi,[f(e(qr),{class:"h-3.5 w-3.5"}),t("span",_i,'"'+i(Nt.value)+'"',1),k.value&&$t.value?(o(),d("span",Si,[h[3]||(h[3]=R(" · ",-1)),Mt.value?(o(),d("span",ki,[R(i(Mt.value)+" match",1),Mt.value!==1?(o(),d("span",Di,"es")):p("",!0)])):(o(),d("span",Ti,"No matches"))])):p("",!0)])):p("",!0)]),Q.value&&!le.value&&!A.value?(o(),d("nav",Ii,[(o(!0),d(z,null,q(ve.value,(T,I)=>(o(),d("button",{key:T.id,onClick:S=>L(I),class:oe(["whitespace-nowrap rounded-full px-3 py-1 text-xs font-medium transition-all",dt.value===I?"bg-primary-600 text-white shadow-sm":"bg-white text-neutral-600 border border-neutral-200 hover:bg-neutral-50 hover:border-neutral-300"]),title:ct(T.section_type)},i(ct(T.section_type)),11,Pi))),128))])):p("",!0)])])):p("",!0),t("div",Ci,[le.value?(o(),d("div",$i,[...h[4]||(h[4]=[t("span",{class:"h-10 w-10 animate-spin rounded-full border-2 border-primary-200 border-t-primary-600"},null,-1),t("p",{class:"text-sm text-neutral-500"},"Loading transcriptionâ¦",-1)])])):A.value?(o(),d("div",Ni,[t("div",Mi,[t("div",Vi,[f(e(fr),{class:"h-6 w-6"})]),h[5]||(h[5]=t("h3",{class:"mt-4 text-sm font-semibold text-error-800"},"Unable to load note",-1)),t("p",Oi,i(A.value),1)])])):k.value?(o(),d("div",Ai,[t("div",Ei,[t("div",ji,[t("article",{class:"ph-no-capture medical-note-content prose prose-sm max-w-none text-neutral-700",innerHTML:ia.value},null,8,Bi)])])])):(o(),d("div",Ri,[t("div",Fi,[t("div",Ui,[f(e(rr),{class:"h-6 w-6"})]),h[6]||(h[6]=t("h3",{class:"mt-4 text-sm font-semibold text-neutral-900"},"No content available",-1)),t("p",Li,i(a.visitId?"This visit doesn't have transcription content yet.":"No visit ID was provided to fetch transcription content."),1)])]))])]),_:1})]),_:1})])])]),_:1})]),_:1},8,["show"]))}},qi=Bs(zi,[["__scopeId","data-v-1776ce08"]]),Hi={class:"fixed inset-0 overflow-y-auto"},Gi={class:"flex min-h-full items-center justify-center p-4 text-center"},Ki={class:"flex items-start space-x-3 mb-4"},Wi={class:"mt-2"},Zi={class:"text-body-sm text-neutral-600"},Yi={key:0,class:"mb-6 p-4 bg-neutral-50 rounded-lg"},Qi={class:"text-body-sm text-neutral-700"},Xi={class:"mt-6 flex justify-end space-x-3"},Ji=pr({__name:"PatientSummaryErrorModal",props:{isOpen:{type:Boolean},modalType:{},title:{},message:{},secondaryMessage:{},primaryButtonText:{}},emits:["close","confirm","cancel"],setup(G,{emit:K}){const a=G,U=K,le=v(()=>a.title),A=v(()=>a.message),k=v(()=>{if(a.primaryButtonText)return a.primaryButtonText;switch(a.modalType){case"confirm":return"Continue";case"error":return"OK";case"info":return"Got it";default:return"OK"}}),Z=()=>{U("close")},Y=()=>{U("cancel"),U("close")},N=()=>{a.modalType==="confirm"&&U("confirm"),U("close")};return(b,V)=>(o(),ee(e(zr),{appear:"",show:G.isOpen,as:"template"},{default:ye(()=>[f(e(Ur),{as:"div",onClose:Z,class:"relative z-[60]"},{default:ye(()=>[f(e(Na),{as:"template",enter:"duration-300 ease-out","enter-from":"opacity-0","enter-to":"opacity-100",leave:"duration-200 ease-in","leave-from":"opacity-100","leave-to":"opacity-0"},{default:ye(()=>[...V[0]||(V[0]=[t("div",{class:"fixed inset-0 bg-black bg-opacity-25"},null,-1)])]),_:1}),t("div",Hi,[t("div",Gi,[f(e(Na),{as:"template",enter:"duration-300 ease-out","enter-from":"opacity-0 scale-95","enter-to":"opacity-100 scale-100",leave:"duration-200 ease-in","leave-from":"opacity-100 scale-100","leave-to":"opacity-0 scale-95"},{default:ye(()=>[f(e(Lr),{class:"w-full max-w-md transform overflow-hidden rounded-2xl bg-white p-6 text-left align-middle shadow-xl transition-all"},{default:ye(()=>[t("div",Ki,[V[1]||(V[1]=t("div",{class:"flex-shrink-0"},[t("svg",{class:"h-6 w-6 text-warning-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})])],-1)),t("div",null,[f(e(Ws),{as:"h3",class:"text-h4 font-medium leading-6 text-neutral-900"},{default:ye(()=>[R(i(le.value),1)]),_:1}),t("div",Wi,[t("p",Zi,i(A.value),1)])])]),G.secondaryMessage?(o(),d("div",Yi,[t("p",Qi,i(G.secondaryMessage),1)])):p("",!0),t("div",Xi,[G.modalType==="confirm"?(o(),ee(e(Fr),{key:0,variant:"outline",size:"md",onClick:Y},{default:ye(()=>[...V[2]||(V[2]=[R(" Cancel ",-1)])]),_:1})):p("",!0),f(e(Fr),{variant:G.modalType==="confirm"?"warning":"primary",size:"md",onClick:N},{default:ye(()=>[R(i(k.value),1)]),_:1},8,["variant"])])]),_:1})]),_:1})])])]),_:1})]),_:1},8,["show"]))}}),eo={CLEARDENT:"cleardent",MACPRACTICE:"macpractice",DENTITEK:"dentitek",XLDENT:"xldent",FASTMEDIC:"fastmedic",SIKKA:"sikka",NEXHEALTH:"nexhealth",OPENDENTAL:"opendental",OD:"opendental",ASCEND:"dentrix_ascend",CLOUDPMS:"cloud_pms"};function Hr(G){if(!G||typeof G!="string")return null;const K=G.trim();if(!K)return null;const a=K.indexOf("-");if(a<=0)return null;const U=K.indexOf("-",a+1),le=K.slice(0,a).toUpperCase(),A=eo[le];if(!A)return null;if(A==="cloud_pms"){const Y=K.slice(a+1),N="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
1",b=Y.match(new RegExp(`^(${N})-(${N})(?:-(${N}))?$`,"i"));return b?{source:A,sourceId:b[1],appointmentId:b[2],hasPatient:!0}:null}if(A==="xldent"){const Y=K.slice(a+1);if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(Y))return{source:A,sourceId:Y,appointmentId:Y,hasPatient:!0}}if(U<=a+1)return null;const k=K.slice(a+1,U),Z=K.slice(U+1);return!k||!Z?null:{source:A,sourceId:k,appointmentId:Z,hasPatient:k!=="block"}}function to(G,K){const a=m(null),U=m(null),le=m(!1);let A=0;const k=async()=>{const Z=++A,Y=G.value,N=Hr(Y);if(U.value=N?.source??null,!N||!N.hasPatient){a.value=null;return}le.value=!0;try{const b={};K.value&&(b["x-claio-preferred-org"]=String(K.value));const V=await Je("/api/integrations/ehr/user/patient-by-reference",{method:"GET",query:{reference:Y},headers:b});if(Z!==A)return;V?.success&&V.patient?a.value=V.patient:a.value=null}catch{if(Z!==A)return;a.value=null}finally{Z===A&&(le.value=!1)}};return lt([G,K],()=>{k()},{immediate:!0}),{patient:a,source:U,isLoading:le,reload:k}}const ao={class:"min-h-full bg-neutral-50 text-neutral-900 [overflow-wrap:anywhere]"},ro={class:"mx-auto w-full max-w-[1400px] space-y-4 px-3 py-3 sm:px-4 sm:py-4"},no=["aria-label"],so={class:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between"},io={class:"flex min-w-0 items-start gap-3"},oo={class:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary-600 text-sm font-semibold text-white shadow-sm sm:h-11 sm:w-11 sm:text-base md:h-12 md:w-12"},lo={class:"min-w-0 flex-1"},uo={class:"flex flex-wrap items-center gap-2"},co={class:"min-w-0 max-w-full break-words text-base font-semibold leading-tight text-neutral-900 [overflow-wrap:anywhere] sm:text-lg md:text-xl"},mo={key:0,class:"inline-flex max-w-full items-center gap-1 rounded-full border border-info-200 bg-info-50 px-2 py-0.5 text-xs font-medium text-info-700"},po={class:"min-w-0 break-words [overflow-wrap:anywhere]"},fo={key:0,class:"mt-2 flex flex-wrap gap-x-3 gap-y-1 text-xs sm:text-sm"},yo={key:0,class:"min-w-0"},vo={class:"inline text-xs font-medium text-neutral-500"},ho={class:"ml-1 inline break-words font-semibold text-neutral-900 [overflow-wrap:anywhere]"},go={key:1,class:"min-w-0"},bo={class:"inline text-xs font-medium text-neutral-500"},wo={class:"ml-1 inline break-words font-semibold text-neutral-900 [overflow-wrap:anywhere]"},xo={key:2,class:"min-w-0"},_o={class:"inline text-xs font-medium text-neutral-500"},So={class:"ml-1 inline break-words font-semibold text-neutral-900 [overflow-wrap:anywhere]"},ko={key:3,class:"min-w-0"},Do={class:"inline text-xs font-medium text-neutral-500"},To={class:"ml-1 inline break-words font-semibold text-neutral-900 [overflow-wrap:anywhere]"},Io={key:1,class:"mt-2 inline-flex max-w-full items-start gap-2 rounded-lg border border-info-100 bg-info-50 px-2.5 py-1.5 text-xs font-medium leading-5 text-info-700"},Po={class:"min-w-0 break-words [overflow-wrap:anywhere]"},Co={class:"flex w-full flex-col gap-2 sm:flex-row lg:w-auto lg:shrink-0 lg:justify-end"},$o={class:"min-w-0 break-words [overflow-wrap:anywhere]"},No={class:"relative min-w-0 flex-1 lg:flex-none"},Mo=["aria-expanded","aria-label"],Vo={class:"min-w-0 break-words [overflow-wrap:anywhere]"},Oo={key:1,class:"absolute left-0 right-0 z-50 mt-2 overflow-hidden rounded-lg border border-neutral-200 bg-white py-1 shadow-lg sm:left-auto sm:w-64"},Ao=["disabled"],Eo={class:"min-w-0 break-words [overflow-wrap:anywhere]"},jo={class:"min-w-0 break-words [overflow-wrap:anywhere]"},Bo={class:"min-w-0 break-words [overflow-wrap:anywhere]"},Ro={class:"min-w-0 break-words [overflow-wrap:anywhere]"},Fo={key:0,id:"intake",class:"rounded-xl border border-neutral-100 bg-white p-4 scroll-mt-24"},Uo={class:"text-xs font-semibold uppercase tracking-wide text-neutral-500 mb-3"},Lo={class:"space-y-2"},zo=["aria-expanded","onClick"],qo={class:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5 min-w-0"},Ho={class:"font-medium text-neutral-900 break-words [overflow-wrap:anywhere]"},Go={key:0,class:"inline-flex items-center rounded-full bg-warning-50 px-2 py-0.5 text-[10px] font-medium text-warning-700"},Ko={key:1,class:"text-xs text-neutral-500"},Wo={key:2,class:"text-xs text-neutral-500"},Zo={key:0,class:"px-3 pb-3"},Yo={key:0,class:"text-sm text-neutral-500"},Qo={key:1,class:"divide-y divide-dashed divide-neutral-200"},Xo={class:"text-xs font-medium text-neutral-600 mb-0.5 break-words [overflow-wrap:anywhere]"},Jo={class:"text-[13px] text-neutral-900 break-words [overflow-wrap:anywhere]"},el={class:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4"},tl={class:"min-w-0 rounded-xl border border-neutral-100 bg-white p-4"},al={class:"flex items-center justify-between gap-3"},rl={class:"text-xs font-medium text-neutral-500"},nl={key:0,class:"mt-2 h-5 w-24 animate-pulse rounded bg-neutral-100"},sl={key:1,class:"mt-2 min-w-0 break-words text-sm font-semibold leading-5 text-neutral-900 [overflow-wrap:anywhere] sm:text-base sm:leading-6"},il={class:"mt-1 text-xs text-neutral-500"},ol={class:"min-w-0 rounded-xl border border-neutral-100 bg-white p-4"},ll={class:"flex items-center justify-between gap-3"},dl={class:"text-xs font-medium text-neutral-500"},ul={key:0,class:"mt-2 h-5 w-28 animate-pulse rounded bg-neutral-100"},cl={key:1,class:"mt-2 min-w-0 break-words text-sm font-semibold leading-5 text-neutral-900 [overflow-wrap:anywhere] sm:text-base sm:leading-6"},ml={class:"mt-1 text-xs text-neutral-500"},pl={class:"min-w-0 rounded-xl border border-neutral-100 bg-white p-4"},fl={class:"flex items-center justify-between gap-3"},yl={class:"text-xs font-medium text-neutral-500"},vl={key:0,class:"mt-2 h-5 w-24 animate-pulse rounded bg-neutral-100"},hl={key:1,class:"mt-2 min-w-0 break-words text-sm font-semibold leading-5 text-neutral-900 [overflow-wrap:anywhere] sm:text-base sm:leading-6"},gl={class:"mt-1 min-w-0 break-words text-xs text-neutral-500 [overflow-wrap:anywhere]"},bl={class:"min-w-0 rounded-xl border border-neutral-100 bg-white p-4"},wl={class:"flex items-center justify-between gap-3"},xl={class:"text-xs font-medium text-neutral-500"},_l={class:"mt-2 min-w-0 break-words text-sm font-semibold leading-5 text-neutral-900 [overflow-wrap:anywhere] sm:text-base sm:leading-6"},Sl={class:"mt-1 min-w-0 break-words text-xs text-neutral-500 [overflow-wrap:anywhere]"},kl={key:1,class:"rounded-lg border border-error-200 bg-error-50 px-3 py-2.5 text-xs text-error-700",role:"alert"},Dl={key:2,class:"rounded-lg border border-info-200 bg-info-50 px-3 py-2.5 text-xs text-info-700",role:"status"},Tl={class:"flex items-start gap-2.5"},Il={class:"min-w-0 flex-1"},Pl={class:"break-words font-semibold [overflow-wrap:anywhere]"},Cl={class:"mt-1 break-words text-xs text-info-700 [overflow-wrap:anywhere]"},$l={class:"mt-1 break-words text-xs font-medium text-info-600 [overflow-wrap:anywhere]"},Nl={class:"grid grid-cols-1 gap-4 xl:grid-cols-[minmax(0,1fr)_minmax(18rem,22rem)] 2xl:gr
1id-cols-[minmax(0,1fr)_24rem]"},Ml={class:"min-w-0 space-y-4"},Vl=["aria-label"],Ol={class:"flex flex-col gap-2.5 sm:flex-row sm:items-center sm:justify-between"},Al={class:"min-w-0"},El={class:"text-xs font-semibold uppercase tracking-wide text-neutral-500"},jl={class:"mt-1 min-w-0 break-words text-xs text-neutral-500 [overflow-wrap:anywhere]"},Bl={class:"flex min-w-0 flex-col gap-2 sm:flex-row sm:items-center"},Rl={class:"inline-flex max-w-full overflow-x-auto rounded-lg border border-neutral-200 bg-white p-1"},Fl=["onClick"],Ul=["disabled","title"],Ll={class:"min-w-0 break-words [overflow-wrap:anywhere]"},zl={class:"grid gap-4 [grid-template-columns:repeat(auto-fit,minmax(min(100%,26rem),1fr))]"},ql=["aria-label"],Hl={class:"mb-3 flex flex-col gap-2.5 sm:flex-row sm:items-start sm:justify-between"},Gl={class:"min-w-0"},Kl={class:"break-words text-xs font-semibold uppercase tracking-wide text-neutral-500 [overflow-wrap:anywhere]"},Wl={class:"mt-1 break-words text-xs text-neutral-500 [overflow-wrap:anywhere]"},Zl={class:"flex w-full flex-wrap items-center justify-between gap-1.5 sm:w-auto sm:shrink-0 sm:justify-end"},Yl={class:"min-w-0 break-words [overflow-wrap:anywhere]"},Ql={key:0,class:"flex items-center gap-1"},Xl=["disabled","aria-label"],Jl={class:"text-xs font-medium text-warning-700"},ed=["disabled","aria-label"],td={key:0,class:"space-y-2.5"},ad={key:3,class:"grid gap-2.5"},rd={class:"grid min-w-0 grid-cols-[2rem_minmax(0,1fr)_2rem] gap-x-2.5 gap-y-1.5"},nd={class:"min-w-0 flex-1"},sd={class:"flex min-w-0 flex-wrap items-start gap-x-2 gap-y-1"},id={class:"min-w-0 break-words text-sm font-semibold leading-5 text-neutral-900 [overflow-wrap:anywhere]"},od={key:0,class:"mt-1.5 break-words text-sm leading-5 text-neutral-600 [overflow-wrap:anywhere]"},ld={class:"mt-2 flex flex-wrap items-center gap-1.5 text-xs text-neutral-500"},dd={key:0,class:"break-words font-medium text-neutral-600 [overflow-wrap:anywhere]"},ud={key:1,class:"break-words font-medium text-neutral-600 [overflow-wrap:anywhere]"},cd={class:"col-start-3 row-start-1 flex shrink-0 flex-col items-center gap-1"},md=["title","aria-label","onClick"],pd=["title","aria-label","onClick"],fd=["aria-label"],yd={class:"mb-3 flex flex-col gap-2.5 sm:flex-row sm:items-start sm:justify-between"},vd={class:"min-w-0"},hd={class:"break-words text-xs font-semibold uppercase tracking-wide text-neutral-500 [overflow-wrap:anywhere]"},gd={class:"mt-1 break-words text-xs text-neutral-500 [overflow-wrap:anywhere]"},bd={class:"flex w-full flex-wrap items-center justify-between gap-1.5 sm:w-auto sm:shrink-0 sm:justify-end"},wd={class:"min-w-0 break-words [overflow-wrap:anywhere]"},xd={key:0,class:"flex items-center gap-1"},_d=["disabled","aria-label"],Sd={class:"text-xs font-medium text-neutral-500"},kd=["disabled","aria-label"],Dd={key:0,class:"space-y-2.5"},Td={key:3,class:"grid gap-2.5"},Id={class:"grid min-w-0 grid-cols-[2rem_minmax(0,1fr)_2rem] gap-x-2.5 gap-y-1.5"},Pd={class:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary-50 text-xs font-bold text-primary-700 shadow-sm shadow-primary-900/5"},Cd=["onClick"],$d={class:"flex min-w-0 flex-wrap items-start gap-x-2 gap-y-1"},Nd={class:"min-w-0 break-words text-sm font-semibold leading-5 text-neutral-900 [overflow-wrap:anywhere]"},Md={key:0,class:"inline-flex max-w-full items-center break-words rounded-full bg-white px-2 py-0.5 text-xs font-medium text-neutral-600 ring-1 ring-inset ring-neutral-200 [overflow-wrap:anywhere]"},Vd={class:"mt-2 flex flex-wrap items-center gap-1.5 text-xs text-neutral-500"},Od={key:0,class:"break-words font-medium text-neutral-600 [overflow-wrap:anywhere]"},Ad={key:1,class:"break-words font-medium text-neutral-600 [overflow-wrap:anywhere]"},Ed={key:2,class:"break-words font-medium text-neutral-600 [overflow-wrap:anywhere]"},jd={key:3,class:"break-words font-medium text-neutral-600 [overflow-wrap:anywhere]"},Bd={class:"col-start-3 row-start-1 flex shrink-0 flex-col items-center gap-1"},Rd=["title","aria-label","onClick"],Fd=["title","aria-label","onClick"],Ud=["aria-label"],Ld={class:"mb-3 flex flex-col gap-2.5 sm:flex-row sm:items-start sm:justify-between"},zd={class:"min-w-0"},qd={class:"break-words text-xs font-semibold uppercase tracking-wide text-neutral-500 [overflow-wrap:anywhere]"},Hd={class:"mt-1 break-words text-xs text-neutral-500 [overflow-wrap:anywhere]"},Gd={class:"flex w-full flex-wrap items-center justify-between gap-1.5 sm:w-auto
1sm:shrink-0 sm:justify-end"},Kd={class:"min-w-0 break-words [overflow-wrap:anywhere]"},Wd={key:0,class:"flex items-center gap-1"},Zd=["disabled","aria-label"],Yd={class:"text-xs font-medium text-neutral-500"},Qd=["disabled","aria-label"],Xd={key:0,class:"grid gap-2.5 sm:grid-cols-2"},Jd={key:3,class:"grid gap-2.5 [grid-template-columns:repeat(auto-fit,minmax(min(100%,24rem),1fr))]"},eu={class:"grid min-w-0 grid-cols-[2rem_minmax(0,1fr)_2rem] gap-x-2.5 gap-y-1.5"},tu={class:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-success-50 text-success-700 shadow-sm shadow-success-900/5"},au=["onClick"],ru={class:"block min-w-0 break-words text-sm font-semibold leading-5 text-neutral-900 [overflow-wrap:anywhere]"},nu={class:"mt-2 flex flex-wrap items-center gap-1.5 text-xs text-neutral-500"},su={key:0,class:"break-words font-medium text-neutral-600 [overflow-wrap:anywhere]"},iu={key:1,class:"break-words font-medium text-neutral-600 [overflow-wrap:anywhere]"},ou={class:"col-start-3 row-start-1 flex shrink-0 flex-col items-center gap-1"},lu=["title","aria-label","onClick"],du=["title","aria-label","onClick"],uu=["aria-label"],cu={class:"mb-3 flex flex-col gap-2.5 sm:flex-row sm:items-start sm:justify-between"},mu={class:"min-w-0"},pu={class:"break-words text-xs font-semibold uppercase tracking-wide text-neutral-500 [overflow-wrap:anywhere]"},fu={class:"mt-1 break-words text-xs text-neutral-500 [overflow-wrap:anywhere]"},yu={key:0,class:"flex w-full shrink-0 items-center justify-end gap-1 sm:w-auto"},vu=["disabled","aria-label"],hu={class:"text-xs font-medium text-neutral-500"},gu=["disabled","aria-label"],bu={key:0,class:"space-y-2.5"},wu={key:3,class:"divide-y divide-neutral-100"},xu=["onClick"],_u={class:"min-w-0 flex-1"},Su={class:"grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-start gap-2"},ku={class:"min-w-0 break-words text-sm font-semibold leading-5 text-neutral-900 [overflow-wrap:anywhere]"},Du={key:0,class:"mt-0.5 max-w-[8rem] truncate rounded-full border border-neutral-200 bg-neutral-50 px-2 py-0.5 text-xs font-medium text-neutral-600"},Tu={key:0,class:"mt-2 flex flex-wrap gap-1.5"},Iu={key:0,class:"break-words rounded-full bg-neutral-100 px-2 py-0.5 text-xs font-medium text-neutral-700 [overflow-wrap:anywhere]"},Pu={key:1,class:"break-words rounded-full bg-neutral-100 px-2 py-0.5 text-xs font-medium text-neutral-700 [overflow-wrap:anywhere]"},Cu={key:2,class:"break-words rounded-full bg-error-50 px-2 py-0.5 text-xs font-medium text-error-700 [overflow-wrap:anywhere]"},$u={key:3,class:"break-words rounded-full bg-warning-50 px-2 py-0.5 text-xs font-medium text-warning-700 [overflow-wrap:anywhere]"},Nu={key:4,class:"break-words rounded-full bg-warning-50 px-2 py-0.5 text-xs font-medium text-warning-700 [overflow-wrap:anywhere]"},Mu={key:5,class:"break-words rounded-full bg-warning-50 px-2 py-0.5 text-xs font-medium text-warning-700 [overflow-wrap:anywhere]"},Vu={class:"min-w-0 space-y-4"},Ou=["aria-label"],Au={class:"mb-3 flex items-start justify-between gap-2.5"},Eu={class:"min-w-0"},ju={class:"break-words text-xs font-semibold uppercase tracking-wide text-neutral-500 [overflow-wrap:anywhere]"},Bu={class:"mt-1 break-words text-xs text-neutral-500 [overflow-wrap:anywhere]"},Ru={class:"w-fit rounded-full bg-neutral-100 px-2 py-0.5 text-xs font-medium text-neutral-600"},Fu={class:"divide-y divide-neutral-100"},Uu={class:"break-words text-xs font-medium text-neutral-500 [overflow-wrap:anywhere]"},Lu={class:"mt-1 min-w-0 break-words text-sm font-semibold text-neutral-900 [overflow-wrap:anywhere]"},zu=["href"],qu={key:1,class:"break-words [overflow-wrap:anywhere]"},Hu=["aria-label"],Gu={class:"mb-3 flex items-start justify-between gap-2.5"},Ku={class:"min-w-0"},Wu={class:"break-words text-xs font-semibold uppercase tracking-wide text-neutral-500 [overflow-wrap:anywhere]"},Zu={class:"mt-1 break-words text-xs text-neutral-500 [overflow-wrap:anywhere]"},Yu={class:"w-fit rounded-full bg-neutral-100 px-2 py-0.5 text-xs font-medium text-neutral-600"},Qu={class:"divide-y divide-neutral-100"},Xu={class:"break-words text-xs font-medium text-neutral-500 [overflow-wrap:anywhere]"},Ju={class:"mt-1 break-words text-sm font-semibold text-neutral-900 [overflow-wrap:anywhere]"},ec=["aria-label"],tc={class:"mb-3"},ac={class:"flex min-w-0 items-start justify-between gap-2.5"},rc={class:"min-w-0"},nc={class:"break-words text-xs font-semibold uppercase tracking-wide text-neutral-500 [overflow-wrap:anywhere]"},sc={class:"mt-0.5 break-words text-xs text-neutral-500 [overflow-wrap:anywhere]"},ic={class:"flex shrink-0 items-center gap-1"},oc={class:"min-w-0 break-words [overflow-wrap:anywhere]"},lc={key:0,class:"flex items-center gap-1"},dc=["disabled","aria-label"],uc=["disabled","aria-label"],cc={ke
vendor: 4,838 bytes, line 1
1y:0,class:"space-y-2.5"},mc={key:3,class:"grid gap-2.5"},pc={class:"grid min-w-0 grid-cols-[minmax(0,1fr)_2rem] gap-2.5"},fc={class:"min-w-0 flex-1"},yc={class:"flex min-w-0 flex-wrap items-center gap-1.5"},vc={key:0,class:"inline-flex max-w-full items-center break-words rounded-full bg-white px-2 py-0.5 text-xs font-medium text-neutral-600 ring-1 ring-inset ring-neutral-200 [overflow-wrap:anywhere]"},hc={class:"mt-2 break-words text-sm font-semibold leading-5 text-neutral-900 [overflow-wrap:anywhere]"},gc={key:0,class:"mt-1.5 break-words text-sm leading-5 text-neutral-600 [overflow-wrap:anywhere]"},bc={class:"mt-2 flex flex-wrap items-center gap-1.5"},wc={key:0,class:"inline-flex max-w-full items-center break-words rounded-full bg-white px-2 py-0.5 text-xs font-medium text-neutral-600 ring-1 ring-inset ring-neutral-200 [overflow-wrap:anywhere]"},xc={key:1,class:"inline-flex max-w-full items-center break-words rounded-full bg-white px-2 py-0.5 text-xs font-medium text-neutral-600 ring-1 ring-inset ring-neutral-200 [overflow-wrap:anywhere]"},_c={class:"flex shrink-0 flex-col items-center gap-1"},Sc=["title","aria-label","onClick"],kc=["title","aria-label","onClick"],Dc=["aria-label"],Tc={key:0,role:"alert",class:"mb-3 flex items-start gap-2 rounded-lg border border-warning-300 bg-warning-50 px-3 py-2"},Ic={class:"min-w-0"},Pc={class:"break-words text-xs font-semibold text-warning-800 [overflow-wrap:anywhere]"},Cc={class:"mt-0.5 break-words text-xs text-warning-700 [overflow-wrap:anywhere]"},$c={class:"mb-3 flex flex-col gap-2.5 sm:flex-row sm:items-start sm:justify-between"},Nc={class:"min-w-0"},Mc={class:"break-words text-xs font-semibold uppercase tracking-wide text-neutral-500 [overflow-wrap:anywhere]"},Vc={class:"mt-1 break-words text-xs text-neutral-500 [overflow-wrap:anywhere]"},Oc={class:"mt-1 break-words text-xs text-neutral-400 [overflow-wrap:anywhere]"},Ac={class:"flex w-full flex-wrap items-center gap-2 sm:w-auto sm:justify-end"},Ec={key:0},jc={key:1},Bc={class:"min-w-0 break-words [overflow-wrap:anywhere]"},Rc={key:1,class:"space-y-4"},Fc={key:0,class:"break-words rounded-lg border border-error-200 bg-error-50 px-3 py-2 text-sm text-error-700 [overflow-wrap:anywhere]",role:"alert"},Uc={class:"grid grid-cols-1 gap-4 lg:grid-cols-2"},Lc={key:0,class:"relative min-w-0"},zc={class:"mb-1 block break-words text-sm font-medium text-neutral-700 [overflow-wrap:anywhere]"},qc={class:"relative"},Hc=["placeholder","aria-expanded","aria-activedescendant"],Gc={key:0,role:"listbox",class:"absolute z-20 mt-1 max-h-56 w-full overflow-auto rounded-lg border border-neutral-200 bg-white py-1 shadow-lg"},Kc=["id","aria-selected","onMousedown"],Wc={class:"break-words font-medium [overflow-wrap:anywhere]"},Zc={key:0,class:"ml-2 break-words text-xs text-neutral-400 [overflow-wrap:anywhere]"},Yc={key:1,class:"ml-1 break-words text-xs text-neutral-400 [overflow-wrap:anywhere]"},Qc={key:1,class:"mt-1 flex min-w-0 items-center gap-1 text-xs font-medium text-success-700"},Xc={class:"min-w-0 break-words [overflow-wrap:anywhere]"},Jc={key:1,class:"min-w-0"},em={class:"mb-1 block break-words text-sm font-medium text-neutral-700 [overflow-wrap:anywhere]"},tm=["placeholder"],am={class:"min-w-0"},rm={class:"mb-1 block break-words text-sm font-medium text-neutral-700 [overflow-wrap:anywhere]"},nm=["placeholder"],sm={class:"min-w-0"},im={class:"mb-2 break-words text-sm font-semibold text-neutral-700 [overflow-wrap:anywhere]"},om={class:"grid grid-cols-1 gap-4 md:grid-cols-3"},lm={class:"min-w-0"},dm={class:"mb-1 block break-words text-sm font-medium text-neutral-700 [overflow-wrap:anywhere]"},um=["placeholder"],cm={class:"min-w-0"},mm={class:"mb-1 block break-words text-sm font-medium text-neutral-700 [overflow-wrap:anywhere]"},pm=["placeholder"],fm={class:"min-w-0"},ym={class:"mb-1 block break-words text-sm font-medium text-neutral-700 [overflow-wrap:anywhere]"},vm={class:"min-w-0 break-words [overflow-wrap:anywhere]"},hm={key:0,class:"mt-3 grid grid-cols-1 gap-4 md:grid-cols-3"},gm={key:1,class:"min-w-0"},bm={class:"mb-1 block break-words text-sm font-medium text-neutral-700 [overflow-wrap:anywhere]"},wm=["value"],xm={key:2,class:"min-w-0"},_m={class:"mb-1 block break-words text-sm font-medium text-neutral-700 [overflow-wrap:anywhere]"},Sm=["placeholder"],km={class:"min-w-0"},Dm={class:"mb-1 block break-words text-sm font-medium text-neutral-700 [overflow-wrap:anywhere]"},Tm=["placeholder"],Im={class:"min-w-0"},Pm={class:"mb-1 block break-words text-sm font-medium text-neutral-700 [overflow-wrap:anywhere]"},Cm={class:"flex flex-col gap-3 border-t border-neutral-100 pt-4 sm:flex-row sm:items-end"},$m={class:"min-w-0 flex-1"},Nm={class:"mb-1 block break-words text-sm font-medium text-neutral-700 [overflow-wrap:anywhere]"},Mm={class:"flex min-w-0 flex-col gap-2 sm:flex-row"}
1,Vm=["disabled"],Om={class:"min-w-0 break-words [overflow-wrap:anywhere]"},Am=["disabled"],Em={class:"min-w-0 break-words [overflow-wrap:anywhere]"},jm={key:1,class:"min-w-0 rounded-lg border border-neutral-200 bg-neutral-50 px-3 py-3"},Bm={key:0,role:"alert",class:"mb-3 flex items-start gap-2 rounded-lg border border-warning-300 bg-warning-100 px-3 py-2"},Rm={class:"min-w-0 break-words text-xs font-semibold text-warning-800 [overflow-wrap:anywhere]"},Fm={class:"mb-3 flex flex-wrap items-center gap-3 text-sm text-neutral-600"},Um={class:"break-words [overflow-wrap:anywhere]"},Lm={class:"text-neutral-900"},zm={key:0,class:"break-words [overflow-wrap:anywhere]"},qm={class:"text-neutral-900"},Hm={key:1,class:"break-words [overflow-wrap:anywhere]"},Gm={class:"text-neutral-900"},Km={key:1,class:"mb-3 rounded-lg border border-warning-200 bg-warning-50 px-3 py-2 text-sm text-warning-700"},Wm={class:"break-words font-semibold [overflow-wrap:anywhere]"},Zm={class:"mb-2 break-words text-sm font-semibold text-neutral-700 [overflow-wrap:anywhere]"},Ym={key:0,class:"grid grid-cols-1 gap-2 md:grid-cols-2"},Qm={class:"break-words [overflow-wrap:anywhere]"},Xm={key:0,class:"break-words [overflow-wrap:anywhere]"},Jm={key:1,class:"break-words [overflow-wrap:anywhere]"},ep={key:2,class:"break-words [overflow-wrap:anywhere]"},tp={key:3,class:"break-words [overflow-wrap:anywhere]"},ap={key:1,class:"break-words text-sm text-neutral-500 [overflow-wrap:anywhere]"},rp={key:0,class:"fixed inset-0 z-[60] overflow-y-auto"},np={class:"flex min-h-screen items-center justify-center px-4 pt-4 pb-20 text-center sm:block sm:p-0"},sp={class:"inline-block transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left align-bottom shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg sm:p-6 sm:align-middle"},ip={class:"mt-3 text-center sm:mt-5"},op={class:"text-lg font-medium leading-6 text-gray-900"},lp={class:"mt-2 text-sm text-gray-500"},dp={for:"patientName",class:"block text-sm font-medium text-gray-700"},up=["placeholder"],cp={class:"mt-1 text-xs text-gray-500"},mp={for:"dob",class:"block text-sm font-medium text-gray-700"},pp={for:"insurance",class:"block text-sm font-medium text-gray-700"},fp=["placeholder"],yp={class:"mt-5 sm:mt-6 sm:grid sm:grid-flow-row-dense sm:grid-cols-2 sm:gap-3"},vp=["disabled"],hp={key:0,class:"flex items-center"},gp={key:1},bp={key:1,class:"fixed inset-0 z-[60] overflow-y-auto"},wp={class:"flex min-h-screen items-center justify-center px-4 pt-4 pb-20 text-center sm:block sm:p-0"},xp={class:"inline-block transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left align-bottom shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg sm:p-6 sm:align-middle"},_p={class:"mt-3 text-center sm:mt-5"},Sp={class:"text-lg font-medium leading-6 text-gray-900"},kp={class:"mt-2"},Dp={class:"text-sm text-gray-500"},Tp={key:0,class:"mt-3 rounded-md border border-warning-200 bg-warning-50 px-3 py-2 text-sm text-warning-700"},Ip={class:"font-medium"},Pp={key:1,class:"mt-3 rounded-md border border-error-200 bg-error-50 px-3 py-2 text-sm text-error-700"},Cp={class:"mt-5 sm:mt-6 sm:grid sm:grid-flow-row-dense sm:grid-cols-2 sm:gap-3"},$p=["disabled"],Np={key:0,class:"flex items-center"},Mp={key:1},Vp=["disabled"],Op={key:0,class:"fixed inset-0 z-[60] overflow-y-auto [overflow-wrap:anywhere]"},Ap={class:"flex min-h-screen items-center justify-center px-4 pt-4 pb-20 text-center sm:block sm:p-0"},Ep={class:"inline-block w-full max-w-[calc(100vw-2rem)] transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left align-bottom shadow-xl transition-all sm:my-8 sm:max-w-lg sm:p-6 sm:align-middle"},jp={class:"mt-3 text-center sm:mt-5"},Bp={class:"break-words text-lg font-medium leading-6 text-gray-900 [overflow-wrap:anywhere]"},Rp={class:"mt-2 break-words text-sm text-gray-500 [overflow-wrap:anywhere]"},Fp={key:0,class:"mt-4 rounded-md border border-info-200 bg-info-50 px-4 py-3"},Up={class:"flex min-w-0 items-center gap-3"},Lp={class:"min-w-0 flex-1"},zp={class:"break-words text-sm font-medium text-info-700 [overflow-wrap:anywhere]"},qp={key:0,class:"mt-1 break-words text-xs text-info-600 [overflow-wrap:anywhere]"},Hp={key:1,class:"mt-4 break-words rounded-md border border-error-200 bg-error-50 px-3 py-2 text-sm text-error-700 [overflow-wrap:anywhere]"},Gp={key:2,class:"mt-6 space-y-4"},Kp={class:"mb-2 block break-words text-sm font-medium text-gray-700 [overflow-wrap:anywhere]"},Wp={class:"space-y-2"},Zp={class:"flex items-center gap-2 cursor-pointer"},Yp={class:"min-w-0 break-words text-sm text-gray-700 [overflow-wrap:anywhere]"},Qp={class:"flex items-center gap-2 cursor-pointer"},Xp={class:"min-w-0 break-words text-sm text-gray-700 [overflow-wrap:anywhere]"},Jp={class:"flex items-center gap-2 cursor-pointer"},e0={class:"min-w-0 break-words text-sm text-gray-700 [overflow-wrap:anywhere]"},t0={key:0,class:"grid grid-cols-1 gap-3 sm:grid-cols-2"},a0={class:"mb-1 block break-words text-xs font-medium text-gray-700 [overflow-wrap:anywhere]"},r0={class:"mb-1 block break-words text-xs font-medium text-gray-700 [overflow-wrap:anywhere]"},n0={key:1,class:"space-y-2"},s0={class:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between"},i0={class:"break-words text-sm font-medium text-gray-700 [overflow-wrap:anywhere]"},o0={class:"flex gap-2"},l0={class:"max-h-40 overflow-y-auto border border-neutral-200 rounded-md divide-y divide-neutral-100"},d0=["checked","onChange"],u0={class:"flex-1 min-w-0"},c0={class:"break-words text-sm font-medium text-gray-900 [overflow-wrap:anywhere]"},m0={class:"break-words text-xs text-gray-500 [overflow-wrap:anywhere]"},p0={class:"rounded-md border border-neutral-200 bg-neutral-50 px-3 py-2"},f0={class:"break-words text-sm text-neutral-600 [overflow-wrap:anywhere]"},y0={class:"mt-5 sm:mt-6 space-y-3"},v0={class:"grid grid-cols-1 gap-3 sm:grid-cols-2"},h0=["disabled"],g0={class:"min-w-0 break-words [overflow-wrap:anywhere]"},b0=["disabled"],w0={class:"min-w-0 break-words [overflow-wrap:anywhere]"},x0=["disabled"],_0={class:"min-w-0 break-words [overflow-wrap:anywhere]"},S0={key:2,class:"fixed inset-0 z-[60] overflow-y-auto"},k0={class:"flex min-h-full items-center justify-center p-3 sm:p-4"},D0={class:"relative w-full max-w-lg overflow-hidden rounded-xl border border-neutral-100 bg-white text-left shadow-2xl shadow-neutral-900/10"},T0={class:"border-b border-neutral-100 px-4 py-3 sm:px-5"},I0={class:"flex items-start gap-3"},P0={class:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary-50 text-primary-700"},C0={class:"min-w-0"},$0={class:"text-sm font-semibold leading-6 text-neutral-900"},N0={class:"mt-0.5 text-xs leading-5 text-neutral-500"},M0={for:"condition",class:"block text-sm font-medium text-neutral-700"},V0=["placeholder"],O0={for:"recordedDate",class:"block text-sm font-medium text-neutral-700"},A0={class:"-mx-4 -mb-4 mt-5 flex flex-col-reverse gap-2 border-t border-neutral-100 px-4 py-3 sm:-mx-5 sm:-mb-4 sm:flex-row sm:justify-end sm:px-5"},E0=["disabled"],j0={key:0,class:"flex items-center"},B0={key:1},R0={key:3,class:"fixed inset-0 z-[60] overflow-y-auto"},F0={class:"flex min-h-full items-center justify-center p-3 sm:p-4"},U0={class:"relative w-full max-w-lg overflow-hidden rounded-xl border border-neutral-100 bg-white text-left shadow-2xl shadow-neutral-900/10"},L0={class:"border-b border-neutral-100 px-4 py-3 sm:px-5"},z0={class:"flex items-start gap-3"},q0={class:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-warning-50 text-warning-700"},H0={class:"min-w-0"},G0={class:"text-sm font-semibold leading-6 text-neutral-900"},K0={class:"mt-0.5 text-xs leading-5 text-neutral-500"},W0={for:"allergen",class:"block text-sm font-medium text-neutral-700"},Z0=["placeholder"],Y0={for:"reaction",class:"block text-sm font-medium text-neutral-700"},Q0=["placeholder"],X0={for:"allergyDate",class:"block text-sm font-medium text-neutral-700"},J0={class:"-mx-4 -mb-4 mt-5 flex flex-col-reverse gap-2 border-t border-neutral-100 px-4 py-3 sm:-mx-5 sm:-mb-4 sm:flex-row sm:justify-end sm:px-5"},ef=["disabled"],tf={key:0,class:"flex items-center"},af={key:1},rf={key:4,class:"fixed inset-0 z-[60] overflow-y-auto"},nf={class:"flex min-h-full items-center justify-center p-3 sm:p-4"},sf={class:"relative w-full max-w-lg overflow-hidden rounded-xl border border-neutral-100 bg-white text-left shadow-2xl shadow-neutral-900/10"},of={class:"border-b border-neutral-100 px-4 py-3 sm:px-5"},lf={class:"flex items-start gap-3"},df={class:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary-50 text-primary-700"},uf={class:"min-w-0"},cf={class:"text-sm font-semibold leading-6 text-neutral-900"},mf={class:"mt-0.5 text-xs leading-5 text-neutral-500"},pf={for:"medicationName",class:"block text-sm font-medium text-neutral-700"},ff=["placeholder"],yf={for:"dosage",class:"block text-sm font-medium text-neutral-700"},vf=["placeholder"],hf={for:"medicationDate",class:"block text-sm font-medium text-neutral-700"},gf={for:"medicationEndDate",class:"block text-sm font-medium text-neutral-700"},bf={class:"text-xs font-normal text-neutral-500"},wf={class:"-mx-4 -mb-4 mt-5 flex flex-col-reverse gap-2 border-t border-neutral-100 px-4 py-3 sm:-mx-5 sm:-mb-4 sm:flex-row sm:justify-end sm:px-5"},xf=["disabled"],_f={key:0,class:"flex items-center"},Sf={key:1},kf={key:5,class:"fixed inset-0 z-[60] overflow-y-auto"},Df={class:"flex min-h-full items-center justify-center p-3 sm:p-4"},Tf={class:"relative w-full max-w-lg overflow-hidden rounded-xl border border-neutral-100 bg-white text-left shadow-2xl shadow-neutral-900/10"},If={class:"border-b border-neutral-100 px-4 py-3 sm:px-5"},Pf={class:"flex items-start gap-3"},Cf={class:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary-50 text-primary-700"},$f={class:"min-w-0"},Nf={class:"text-sm font-semibold leading-6 text-neutral-900"},Mf={class:"mt-0.5 text-xs leading-5 text-neutral-500"},Vf={for:"details",class:"block text-sm font-medium text-neutral-700"},Of=["placeholder"],Af={for:"context",class:"block text-sm font-medium text-neutral-700"},Ef=["placeholder"],jf={for:"type",class:"block text-sm font-medium text-neutral-700"},Bf=["placeholder"],Rf={for:"personalInfoDate",class:"block text-sm font-medium text-neutral-700"},Ff={class:"-mx-4 -mb-4 mt-5 flex flex-col-reverse gap-2 border-t border-neutral-100 px-4 py-3 sm:-mx-5 sm:-mb-4 sm:flex-row sm:justify-end sm:px-5"},Uf=["disabled"],Lf={key:0,class:"flex items-center"},zf={key:1},qf={key:6,class:"fixed inset-0 z-[60] overflow-y-auto"},Hf={class:"flex min-h-full items-center justify-center p-3 sm:p-4"},Gf={class:"relative w-full max-w-lg overflow-hidden rounded-xl border border-neutral-100 bg-white text-left shadow-2xl shadow-neutral-900/10"},Kf={class:"border-b border-neutral-100 px-4 py-3 sm:px-5"},Wf={class:"flex items-start gap-3"},Zf={class:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary-50 text-primary-700"},Yf={class:"min-w-0"},Qf={class:"text-sm font-semibold leading-6 text-neutral-900"},Xf={class:"mt-0.5 text-xs leading-5 text-neutral-500"},Jf={for:"editDetails",class:"block text-sm font-medium text-neutral-700"},ey=["placeholder"],ty={for:"editContext",class:"block text-sm font-medium text-neutral-700"},ay=["placeholder"],ry={for:"editType",class:"block text-sm font-medium text-neutral-700"},ny=["placeholder"],sy={for:"editPersonalInfoDate",class:"block text-sm font-medium text-neutral-700"},iy={class:"-mx-4 -mb-4 mt-5 flex flex-col-reverse gap-2 border-t border-neutral-100 px-4 py-3 sm:-mx-5 sm:-mb-4 sm:flex-row sm:justify-end sm:px-5"},oy=["disabled"],ly={key:0,class:"flex items-center"}
1,dy={key:1},or=2,lr=2,dr=3,ur=3,cr=6,Ty=pr({__name:"PatientSummary",props:{patient:{},ehrReference:{}},emits:["patient-updated","visit-selected"],setup(G,{emit:K}){const{t:a}=Rs(),{brandName:U}=Fs(),le=Us();mr();const A=qs(),k=H(),{scribeEnabled:Z}=Ls();function Y(){if(mt.value||typeof window>"u"||A.hash!=="#intake")return;mt.value=!0;const r=performance.now();function n(){const l=document.getElementById("intake");if(l){l.scrollIntoView({behavior:"smooth",block:"start"});return}performance.now()-r<2e3&&requestAnimationFrame(n)}requestAnimationFrame(n)}const N=pr({name:"PatientSummaryEmptyState",props:{icon:{type:[Object,Function],required:!0},title:{type:String,required:!0},description:{type:String,default:""}},setup(r){return()=>Ca("div",{class:"rounded-lg border border-dashed border-neutral-200 bg-neutral-50 px-3 py-4 text-center"},[Ca(r.icon,{class:"mx-auto h-6 w-6 text-neutral-300","aria-hidden":"true"}),Ca("p",{class:"mt-2 text-sm font-semibold text-neutral-800"},r.title),r.description?Ca("p",{class:"mx-auto mt-1 max-w-sm text-xs leading-5 text-neutral-500"},r.description):null])}}),b=G,V=m(null),et=v(()=>{const r=b.patient?.patient_reference||b.patient?.reference||b.patient?.ehr_reference||b.patient?.latestEhrReference||V.value||b.ehrReference||null;return typeof r!="string"?null:r.trim()||null}),ve=v(()=>Hr(et.value)),dt=v(()=>!!(ve.value?.source&&ve.value?.hasPatient)),ra=v(()=>{switch(ve.value?.source){case"cleardent":return"patientSummary.clearDentSource";case"dentrix_ascend":return"patientSummary.dentrixAscendSource";case"opendental":return"patientSummary.openDentalSource";case"dentitek":return"patientSummary.dentitekSource";case"xldent":return"patientSummary.xldentSource";case"sikka":return"patientSummary.sikkaSource";case"nexhealth":return"patientSummary.nexHealthSource";case"cloud_pms":return"patientSummary.cloudPmsSource";case"fastmedic":return"patientSummary.fastMedicSource";case"macpractice":return"patientSummary.macPracticeSource";default:return"patientSummary.ehrSource"}}),Ue=v(()=>a(ra.value)),$t=v(()=>a("patientSummary.ehrReadOnly",{source:Ue.value})),Nt=v(()=>a("patientSummary.localClaioProfileNoticeWithSource",{source:Ue.value,brand:U.value})),Mt=v(()=>et.value),na=v(()=>k.currentOrgId||null),{patient:te,isLoading:sa}=to(Mt,na),Le=r=>{if(!r)return null;const n=new Date(r);return Number.isNaN(n.getTime())?r:n.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},ia=v(()=>{const r=te.value;if(!r)return[];const n=[];return r.mobilePhone&&n.push({label:a("patientSummary.mobilePhone"),value:r.mobilePhone,href:`tel:${r.mobilePhone}`}),r.homePhone&&n.push({label:a("patientSummary.homePhone"),value:r.homePhone,href:`tel:${r.homePhone}`}),r.businessPhone&&n.push({label:a("patientSummary.workPhone"),value:r.businessPhone,href:`tel:${r.businessPhone}`}),r.email&&n.push({label:a("patientSummary.email"),value:r.email,href:`mailto:${r.email}`}),n}),oa=v(()=>{const r=te.value;if(!r)return[];const n=[];r.providerName&&n.push({label:a("patientSummary.usualProvider"),value:r.providerName}),r.hygienistName&&n.push({label:a("patientSummary.hygienist"),value:r.hygienistName});const l=Le(r.firstVisit);l&&n.push({label:a("patientSummary.firstVisit"),value:l});const u=Le(r.lastVisit);u&&n.push({label:a("patientSummary.lastVisit"),value:u});const s=Le(r.nextAppointment);return s&&n.push({label:a("patientSummary.nextAppointment"),value:s}),n}),ut=K,Q=m({totalVisits:0,activeConditions:0,medications:0,allergies:0}),L=m([]),ct=m([]),_t=m(!1),xe=m(!1),g=m(0),h=m(0),T=m([]),I=m([]),S=m([]),he=m([]),O=m([]),_e=m([]),ze=m(new Set),mt=m(!1),St=m(null);function la(r){return ri({form_submission:{status:r.status,responses:r.responses,questions:r.questions}})}function Gr(r){const n=new Set(ze.value);n.has(r)?n.delete(r):n.add(r),ze.value=n}function Kr(r){return r?new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(r)):""}const Me=m(0),Ve=m(0),Oe=m(0),qe=m(0),Se=m(0),Wr=m(!1),ke=m(!1),Zr=m(null),Ae=m(0),He=m(!1),De=m(null),Te=m(!1),Ge=m(""),Vt=m(!1),yr=m({}),da=m(!1),Ot=m(!1),X=m({patientName:"",dateOfBirth:"",gender:"",insuranceProvider:""}),pt=m([]),de=m([]),ae=m(""),ua=m(!1),At=m(!1),Et=m(!1),Ie=m(null),re=m(null),x=m({policyName:"",payerName:"",payerStediId:"",memberId:"",groupNumber:"",subscriberFirstName:"",subscriberLastName:"",subscriberDateOfBirth:"",providerNpi:"",providerOrganizationName:""}),Ke=m({serviceTypeCode:"30",dateOfService:new Date().toISOString().slice(0,10)}),Ee=m(""),je=m([]),ca=m(!1),ue=m(!1),ce=m(-1),tt=m(!1);let Ma=null;const jt=m(!1),Bt=m(!1),Va=m(!1),Rt=m(!1),kt=m(null),Dt=m(!1),ma=m(null),pa=m(null),Ft=m(!1),at=m(!1),We=m(null),pe=m({condition:"",recordedDate:new Date().toISOString().split("T")[0]}),Ut=m(!1),Lt=m(!1),rt=m(!1),nt=m(null),J=m({allergen:"",reaction:"",severity:"low",recordedDate:new Date().toISOString().split("T")[0]}),zt=m(!1),qt=m(!1),st=m(!1),it=m(null),W=m({name:"",dosage:"",recordedDate:new Date().toISOString().split("T")[0],endDate:""}),Ht=m(!1),Gt=m(!1),Kt=m(!1),ft=m(null),P=m({details:"",context:"",category:"general",type:"",recordedDate:new Date().toISOString().split("T")[0]}),yt=m(!1),Tt=m(!1),ge=m(!1),E=m({contentType:"both",timeRange:0,customStartDate:"",customEndDate:""}),Ze=m(null),Pe=m({current:0,total:0,status:""}),Be=m(new Set),{printContent:Yr,downloadPdf:Qr}=ai(),D=v(()=>b.patient?.patient_id||b.patient?.id||null),Oa=v(()=>Ms(b.patient?.date_of_birth,te.value?.birthDate)),Ce=v(()=>b.patient?.patient_name||b.patient?.name||te.value?.displayName||a("patientSummary.unnamedPatient")),Aa=v(()=>Ns(Oa.value)),It=v(()=>Oa.value?ne(Oa.value):null),fa=v(()=>{const r=b.patient?.gender||te.value?.gender;if(!r)return null;switch(r.toLowerCase()){case"male":return a("patientSummary.genderMale");case"female":return a("patientSummary.genderFemale");case"other":return a("patientSummary.genderOther");case"prefer-not-to-say":return a("patientSummary.genderPreferNot");default:return r.charAt(0).toUpperCase()+r.slice(1).toLowerCase()}}),Pt=v(()=>b.patient?.insurance_provider||null),vt=v(()=>k.hasInsuranceVerification),Xr=v(()=>k.insuranceTestMode),vr=new Set,Ea=r=>typeof r=="string"?r.trim().length>0:r!=null,Jr=async()=>
1{if(sa.value)return;const r=D.value,n=et.value,l=k.currentOrgId,u=ve.value,s=te.value;if(!r||!n||!l||!u||!u.hasPatient||!s)return;const c=!Ea(b.patient?.date_of_birth),y=!Ea(b.patient?.gender),C=!!Ia(s.birthDate),fe=Ea(s.gender);if(!(c&&C)&&!(y&&fe))return;const we=`${l}:${r}:${n}`;if(!vr.has(we)){vr.add(we);try{const Ne=await Je("/api/patients/backfill-from-ehr",{method:"POST",headers:{"x-claio-preferred-org":String(l)},body:{patientId:r,reference:n}});Ne?.success&&Ne.updated&&Ne.patient&&(window.dispatchEvent(new CustomEvent("patient:updated",{detail:{patient:Ne.patient}})),ut("patient-updated",Ne.patient))}catch{}}};lt([D,et,na,()=>b.patient?.date_of_birth,()=>b.patient?.gender,()=>te.value?.patientId,()=>te.value?.birthDate,()=>te.value?.gender,sa],()=>{Jr()},{immediate:!0});const en=v(()=>de.value.length>1),ja=v(()=>de.value.length===1?de.value[0]:null),tn=v(()=>ja.value?xr(ja.value):""),ya=v(()=>!!(D.value&&x.value.payerStediId.trim()&&x.value.memberId.trim()&&x.value.subscriberFirstName.trim()&&x.value.subscriberLastName.trim()&&x.value.subscriberDateOfBirth)),hr=v(()=>!!(D.value&&(ae.value||ya.value)&&Ke.value.serviceTypeCode.trim()&&Ke.value.dateOfService)),an=v(()=>[{id:0,label:a("patientSummary.allTime")},{id:.02,label:a("patientSummary.lastWeek")},{id:.08,label:a("patientSummary.lastMonth")},{id:1,label:a("patientSummary.lastYear")}]),rn=r=>{Se.value=r},nn=v(()=>[{id:"",label:a("patientSummary.newPolicy")},...pt.value.map(r=>({id:r.id,label:Sn(r)}))]),sn=v(()=>de.value.map(r=>({id:r.npi,label:xr(r)}))),on=v(()=>[{id:"",label:a("patientSummary.selectGender")},{id:"male",label:a("patientSummary.genderMale")},{id:"female",label:a("patientSummary.genderFemale")},{id:"other",label:a("patientSummary.genderOther")},{id:"prefer-not-to-say",label:a("patientSummary.genderPreferNot")}]),ln=v(()=>[{id:"low",label:a("patientSummary.severityLow")},{id:"moderate",label:a("patientSummary.severityModerate")},{id:"high",label:a("patientSummary.severityHigh")}]),gr=v(()=>[{id:"general",label:a("patientSummary.categoryGeneral")},{id:"medical",label:a("patientSummary.categoryMedical")},{id:"social",label:a("patientSummary.categorySocial")},{id:"family",label:a("patientSummary.categoryFamily")},{id:"work",label:a("patientSummary.categoryWork")},{id:"hobbies",label:a("patientSummary.categoryHobbies")},{id:"life_events",label:a("patientSummary.categoryLifeEvents")},{id:"travel",label:a("patientSummary.categoryTravel")},{id:"lifestyle",label:a("patientSummary.categoryLifestyle")},{id:"contact",label:a("patientSummary.categoryContact")},{id:"insurance",label:a("patientSummary.categoryInsurance")},{id:"emergency",label:a("patientSummary.categoryEmergency")},{id:"other",label:a("patientSummary.categoryOther")}]),dn=v(()=>[{id:0,label:a("patientSummary.allTime")},{id:.02,label:a("patientSummary.lastWeek")},{id:.08,label:a("patientSummary.lastMonth")},{id:1,label:a("patientSummary.lastYear")},{id:"custom",label:a("patientSummary.customRange")}]),br=v(()=>re.value?.summary?.status==="eligible"?a("patientSummary.eligible"):re.value?.summary?.status==="ineligible"?a("patientSummary.ineligible"):a("patientSummary.notChecked")),un=v(()=>re.value?.summary?.status==="eligible"?"bg-success-50 text-success-700 border border-success-200":re.value?.summary?.status==="ineligible"?"bg-error-50 text-error-700 border border-error-200":"bg-neutral-100 text-neutral-600 border border-neutral-200"),cn=v(()=>va.value?.visit_date?ne(va.value.visit_date):null),mn=v(()=>Le(te.value?.lastVisit)),pn=v(()=>Le(te.value?.nextAppointment)),fn=v(()=>Le(St.value?.start_time)),va=v(()=>(Z.value?L.value[0]:null)||null),yn=v(()=>I.value[0]?.name||null),vn=v(()=>S.value.length?(S.value.find(n=>n.type==="danger")||S.value[0]).title:null),hn=v(()=>{const r=Me.value*or,n=r+or;return xa.value.slice(r,n)}),ha=v(()=>Math.ceil(xa.value.length/or)),gn=v(()=>{const r=Ve.value*lr,n=r+lr;return _a.value.slice(r,n)}),ga=v(()=>Math.ceil(_a.value.length/lr)),Ba=v(()=>wr.value),ba=v(()=>Math.ceil(g.value/dr)),bn=v(()=>{const r=qe.value*ur,n=r+ur;return Sa.value.slice(r,n)}),Ra=v(()=>
1Math.ceil(Sa.value.length/ur)),Wt=(r,n="displayDate")=>{if(Se.value<=0)return r;const l=new Date;return Se.value===.02?l.setDate(l.getDate()-7):Se.value===.08?l.setMonth(l.getMonth()-1):l.setFullYear(l.getFullYear()-Se.value),r.filter(u=>{const s=u[n]||u.recordedDate||u.onsetDateTime||u.effectiveDateTime;return s?new Date(s)>=l:!0})},wa=v(()=>{let r=T.value;return r=Wt(r,"displayDate"),r}),xa=v(()=>{let r=I.value;return r=Wt(r,"effectiveDateTime"),r}),_a=v(()=>{let r=S.value;return r=Wt(r,"displayDate"),r}),Sa=v(()=>{let r=O.value;return r=Wt(r,"displayDate"),r}),wr=v(()=>{let r=[...Z.value?L.value:[],...ct.value];return r.sort((n,l)=>{const u=new Date(n.visit_date||0).getTime();return new Date(l.visit_date||0).getTime()-u}),r=Wt(r,"visit_date"),r}),wn=v(()=>{const r=Ae.value*cr,n=r+cr;return wa.value.slice(r,n)}),ka=v(()=>Math.ceil(wa.value.length/cr)),Re=v(()=>({diagnoses:{total:T.value.length,filtered:wa.value.length},medications:{total:I.value.length,filtered:xa.value.length},allergies:{total:S.value.length,filtered:_a.value.length},personalInfo:{total:O.value.length,filtered:Sa.value.length},visits:{total:L.value.length,filtered:wr.value.length}})),xn=v(()=>{const r=Re.value.diagnoses.total+Re.value.medications.total+Re.value.allergies.total+Re.value.personalInfo.total+Re.value.visits.total,n=Re.value.diagnoses.filtered+Re.value.medications.filtered+Re.value.allergies.filtered+Re.value.personalInfo.filtered+Re.value.visits.filtered;return Se.value<=0?a("patientSummary.allRecordsVisible",{count:r}):a("patientSummary.filteredRecordsVisible",{filtered:n,total:r})}),xr=r=>`${r.name} (${r.npi})`,Fa=()=>{if(de.value.length===0)return;if(de.value.length===1){x.value.providerNpi=de.value[0].npi;return}const r=x.value.providerNpi.trim();de.value.some(l=>l.npi===r)||(x.value.providerNpi=de.value[0].npi)},_n=async()=>{const r=k.currentOrgId;if(!vt.value||!r){de.value=[];return}try{const n=await Je("/api/providers",{query:{org_id:r,active:"true"}}),l=Array.isArray(n?.providers)?n.providers:[];de.value=l.map(u=>{const s=String(u?.npi||"").replace(/\D/g,"");if(s.length!==10)return null;const c=String(u?.name||"").trim();return c?{id:String(u?.id||`${c}-${s}`),name:c,npi:s}:null}).filter(u=>u!==null),Fa()}catch{de.value=[]}},Ua=()=>{const n=(b.patient?.patient_name||"").trim().split(/\s+/),l=n[0]||"",u=n.slice(1).join(" ")||"";x.value={policyName:"",payerName:"",payerStediId:"",memberId:"",groupNumber:"",subscriberFirstName:l,subscriberLastName:u,subscriberDateOfBirth:b.patient?.date_of_birth||"",providerNpi:de.value[0]?.npi||"",providerOrganizationName:""},Fa(),Ee.value="",je.value=[],ue.value=!1,ce.value=-1,tt.value=!1},La=()=>{pt.value=[],de.value=[],ae.value="",re.value=null,Ie.value=null,ua.value=!1,At.value=!1,Et.value=!1,Ua()},Sn=r=>{const n=r.payer_name||r.payer_stedi_id,l=r.member_id;return`${n} ⢠${l}`},_r=()=>{if(Ie.value=null,!ae.value){Ua();return}const r=pt.value.find(n=>n.id===ae.value);r&&(x.value={policyName:r.policy_name||"",payerName:r.payer_name||"",payerStediId:r.payer_stedi_id||"",memberId:r.member_id||"",groupNumber:r.group_number||"",subscriberFirstName:r.subscriber_first_name||"",subscriberLastName:r.subscriber_last_name||"",subscriberDateOfBirth:r.subscriber_date_of_birth||"",providerNpi:r.provider_npi||"",providerOrganizationName:r.provider_organization_name||""},Ee.value=r.payer_name||r.payer_stedi_id||"",tt.value=!1,ue.value=!1,Fa())},kn=r=>{ae.value=r==null?"":String(r),_r()},Sr=m(!0),Dn=async r=>{if(!r||r.trim().length<2){je.value=[],ue.value=!1;return}if(!Sr.value)return;const n=k.currentOrgId||null;ca.value=!0;try{const l=await Je("/api/integrations/stedi/user/payers",{headers:n?{"x-claio-preferred-org":String(n)}:void 0,query:{q:r.trim(),limit:10}}),u=Array.isArray(l?.data)?l.data:[];je.value=u.map(s=>({stediId:s.stediId||"",displayName:s.displayName||"",primaryPayerId:s.primaryPayerId||null,coverageTypes:Array.isArray(s.coverageTypes)?s.coverageTypes:[]})),ue.value=je.value.length>0,ce.value=-1}catch{je.value=[],ue.value=!1,Sr.value=!1,tt.value=!0}finally{ca.value=!1}},Tn=()=>
1{Ma&&clearTimeout(Ma),x.value.payerStediId="",x.value.payerName="",Ma=setTimeout(()=>{Dn(Ee.value)},300)},kr=r=>{x.value.payerName=r.displayName,x.value.payerStediId=r.stediId,Ee.value=r.displayName,ue.value=!1,ce.value=-1,tt.value=!1},In=r=>{!ue.value&&r.key!=="Escape"||(r.key==="ArrowDown"?(r.preventDefault(),ce.value=Math.min(ce.value+1,je.value.length-1)):r.key==="ArrowUp"?(r.preventDefault(),ce.value=Math.max(ce.value-1,0)):r.key==="Enter"&&ce.value>=0?(r.preventDefault(),kr(je.value[ce.value])):r.key==="Escape"&&(ue.value=!1,ce.value=-1))},Pn=()=>{setTimeout(()=>{ue.value=!1},200)},Dr=()=>{tt.value=!tt.value,tt.value?(ue.value=!1,Ee.value="",je.value=[]):(x.value.payerStediId="",x.value.payerName="")},za=async()=>{if(!vt.value){La();return}if(D.value){ua.value=!0,Ie.value=null,await _n();try{const r=k.currentOrgId||null,n=await Je("/api/integrations/stedi/user/policies",{headers:r?{"x-claio-preferred-org":String(r)}:void 0,query:{patientId:D.value}});if(pt.value=n?.policies||[],pt.value.length>0){const l=pt.value.find(u=>u.is_primary)||pt.value[0];ae.value=l.id,_r()}else ae.value="",Ua()}catch(r){Ie.value=r?.data?.statusMessage||r?.message||a("patientSummary.failedToLoadPolicies")}finally{ua.value=!1}}},Tr=async()=>{if(!(!vt.value||!D.value||!ya.value)){At.value=!0,Ie.value=null;try{const r=k.currentOrgId||null,n={patientId:D.value,policyName:x.value.policyName,payerName:x.value.payerName,payerStediId:x.value.payerStediId,memberId:x.value.memberId,groupNumber:x.value.groupNumber,subscriberFirstName:x.value.subscriberFirstName,subscriberLastName:x.value.subscriberLastName,subscriberDateOfBirth:x.value.subscriberDateOfBirth,providerNpi:x.value.providerNpi,providerOrganizationName:x.value.providerOrganizationName,isPrimary:!0,active:!0};if(ae.value)await Je(`/api/integrations/stedi/user/policies/${ae.value}`,{method:"PUT",headers:r?{"x-claio-preferred-org":String(r)}:void 0,body:n});else{const l=await Je("/api/integrations/stedi/user/policies",{method:"POST",headers:r?{"x-claio-preferred-org":String(r)}:void 0,body:n});l?.policy?.id&&(ae.value=l.policy.id)}await za()}catch(r){Ie.value=r?.data?.statusMessage||r?.message||a("patientSummary.failedToSavePolicy")}finally{At.value=!1}}},Cn=async()=>{if(!(!vt.value||!D.value||!hr.value)){Et.value=!0,Ie.value=null;try{if(!ae.value&&ya.value&&(await Tr(),!ae.value)){Ie.value=a("patientSummary.failedToSavePolicy");return}const r=k.currentOrgId||null,n=await Je("/api/integrations/stedi/user/eligibility-check",{method:"POST",headers:r?{"x-claio-preferred-org":String(r)}:void 0,body:{patientId:D.value,policyId:ae.value,serviceTypeCode:Ke.value.serviceTypeCode.trim(),dateOfService:Ke.value.dateOfService||new Date().toISOString().slice(0,10),providerNpi:x.value.providerNpi?.trim()||void 0,providerOrganizationName:x.value.providerOrganizationName?.trim()||void 0}});re.value={summary:n.summary,checkedAt:new Date().toISOString(),environment:n.environment??null}}catch(r){Ie.value=r?.data?.statusMessage||r?.message||a("patientSummary.failedToCheckEligibility")}finally{Et.value=!1}}};let Ir=0;const ht=()=>String(b.patient?.patient_id||b.patient?.id||""),Zt=async()=>{if(ht(),!(!b.patient?.patient_id&&!b.patient?.id)){He.value=!0,De.value=null,V.value=null;try{const r=++Ir,n=ht(),l=H().currentOrgId||null,u=b.patient.patient_id||b.patient.id,s=await $fetch("/api/patients/summary",{headers:l?{"x-claio-preferred-org":String(l)}:void 0,query:{patientId:u}});if(r!==Ir||ht()!==n)return;if(s?.success){if(V.value=typeof s.latestEhrReference=="string"&&s.latestEhrReference.trim()||null,s.patient){const{id:w,patient_id:M,...$}=s.patient;Object.assign(b.patient,$)}Q.value={totalVisits:s.stats.totalVisits||0,activeConditions:s.stats.activeConditions||0,medications:s.stats.medications||0,allergies:s.stats.allergies||0},_e.value=Array.isArray(s.formSubmissions)?s.formSubmissions:[],St.value=s.nextCalendarEvent&&typeof s.nextCalendarEvent=="object"?s.nextCalendarEvent:null;const c=new Set,y=new Set;for(const w of _e.value){const M=String(w.template_name||w.id);c.has(M)||(c.add(M),y.add(w.id))}ze.value=y,Y(),g.value=s.stats.totalVisits||0,L.value=(s.recentVisits||[]).map(w=>
1({id:w.id,visit_type:w.visit_name,visit_date:w.created_at,status:w.status==="completed"?a("patientSummary.completed"):w.status,reference:w.reference||null})),_t.value=s.hasMoreVisits||!1;const C=b.patient?.id||b.patient?.patient_id;if(!C)ct.value=[];else try{const w=H().currentOrgId||null,M=await $fetch("/api/perio-charts/list",{query:{patient_id:C},headers:w?{"x-claio-preferred-org":String(w)}:void 0});M?.success&&(ct.value=(M.charts||[]).filter($=>$.status==="completed").map($=>({id:`perio-${$.id}`,perioChartId:$.id,visit_type:a("patientSummary.perioExam"),visit_date:$.completed_at||$.created_at,status:a("patientSummary.completed"),isPerioChart:!0,averagePocketDepth:$.average_pocket_depth,maxPocketDepth:$.max_pocket_depth,totalTeethCharted:$.total_teeth_charted,hasBleeding:$.has_bleeding,hasSuppuration:$.has_suppuration,hasMobility:$.has_mobility,hasFurcation:$.has_furcation})))}catch(w){console.error("Error fetching perio charts for patient:",w?.message||"Unknown error")}T.value=(s.activeDiagnoses||[]).sort((w,M)=>{const $=new Date(w.modifiedDate||w.displayDate||w.recordedDate||w.onsetDateTime||"1900-01-01").getTime();return new Date(M.modifiedDate||M.displayDate||M.recordedDate||M.onsetDateTime||"1900-01-01").getTime()-$}),I.value=(s.currentMedications||[]).sort((w,M)=>{const $=new Date(w.modifiedDate||w.effectiveDateTime||w.recordedDate||"1900-01-01").getTime();return new Date(M.modifiedDate||M.effectiveDateTime||M.recordedDate||"1900-01-01").getTime()-$}),O.value=(s.personalInformation||[]).sort((w,M)=>{const $=new Date(w.modifiedDate||w.displayDate||w.recordedDate||"1900-01-01").getTime();return new Date(M.modifiedDate||M.displayDate||M.recordedDate||"1900-01-01").getTime()-$}),S.value=(s.allergies||[]).map((w,M)=>{const $=w.criticality||"high",Fe=w.name||w.title||w.code?.text||"Allergy";return{id:w.id||M+1,type:$==="high"?"danger":$==="low"?"info":"warning",title:Fe.includes("Allergy")?Fe:`${Fe} Allergy`,description:w.reaction||w.description||"",recordedDate:w.recordedDate||null,onsetDateTime:w.onsetDateTime||null,displayDate:w.onsetDateTime||w.recordedDate||null,notes:w.notes||w.note?.[0]?.text||null,criticality:$,allergen:Fe.replace(/ Allergy$/i,""),severity:$,modifiedDate:w.modifiedDate||w.updated_at||null}}).sort((w,M)=>{const $=new Date(w.modifiedDate||w.displayDate||w.recordedDate||w.onsetDateTime||"1900-01-01").getTime();return new Date(M.modifiedDate||M.displayDate||M.recordedDate||M.onsetDateTime||"1900-01-01").getTime()-$}),he.value=s.labResults||[];const fe=s.stats.totalVisits>=30&&s.stats.activeConditions===0&&s.stats.medications===0&&s.stats.allergies===0&&!s.latestCaseSummary,we=ht(),Ne=sessionStorage.getItem(`lastForceRefresh_${we}`),Xa=Ne?Date.now()-parseInt(Ne):1/0,Ja=300*1e3,Ct=fe&&Xa>Ja;Ct&&sessionStorage.setItem(`lastForceRefresh_${we}`,String(Date.now()));const er=s.currentMedications&&s.currentMedications.length>0,tr=s.allergies&&s.allergies.length>0,bt=!(s.activeDiagnoses&&s.activeDiagnoses.length>0&&s.activeDiagnoses[0]?.condition&&typeof s.activeDiagnoses[0].condition=="string")||!er&&!tr,ot=s.hasUnprocessedTranscriptions||!1,Qt=s.unprocessedCount||0;ot&&!Te.value?(Ge.value=a("patientSummary.processingNewVisits",{unprocessedCount:Qt}),setTimeout(()=>{qa(!1)},100)):(Ct||bt)&&qa(Ct)}}catch(r){De.value=r?.message||a("patientSummary.failedToLoad")}finally{He.value=!1}}};let Pr=0;const qa=async(r=!1)=>{ht();let n=null;if(!(!b.patient?.patient_id&&!b.patient?.id)){Te.value=!0,Vt.value=!0,Ge.value=a("patientSummary.preparingToProcess"),De.value=null;try{const l=++Pr,u=ht(),s=H().currentOrgId||null,c=b.patient.patient_id||b.patient.id;let y=0,C=Q.value.totalVisits||0;const fe=120*1e3,we=30*1e3,Ne=Math.ceil(C/10),Xa=fe+Ne*we,Ja=900*1e3,Ct=Math.min(Xa,Ja);n=ni(()=>
1{if(C>0)y=Math.min(y+1,C-1),Ge.value=a("patientSummary.processingProgress",{current:y,total:C});else{const bt=[a("patientSummary.processingTranscriptions"),a("patientSummary.extractingData"),a("patientSummary.analyzingPatterns")],ot=bt[Math.floor(Math.random()*bt.length)];Ge.value=ot}},2e3);const er=new Promise((bt,ot)=>{setTimeout(()=>{const Qt=Math.ceil(Ct/6e4);ot(new Error(a("patientSummary.processingTimeout",{timeoutMinutes:Qt,totalTranscriptions:C})))},Ct)}),tr=$fetch("/api/patients/fhir-summary",{method:"POST",headers:s?{"x-claio-preferred-org":String(s)}:void 0,body:{patientId:c,forceRefresh:r,processingMode:r?"full_refresh":"incremental"}}),ie=await Promise.race([tr,er]);if(l!==Pr||ht()!==u)return;if(ie?.success){const bt=ie.transcriptionsProcessed||0,ot=ie.totalTranscriptionsCount||ie.totalTranscriptionsToProcess||0;if(ot>0?Ge.value=a("patientSummary.processingComplete",{processed:bt,total:ot}):Ge.value=a("patientSummary.processingSuccess"),ie.conditions||ie.medications||ie.allergies){const Qt=Ts(ie.conditions||[]),w=Is(ie.medications||[]),M=(ie.personalInformation||[]).map(_=>({..._,displayDate:As(_)}));T.value=Qt.sort((_,j)=>{const Ye=new Date(_.modifiedDate||_.displayDate||_.recordedDate||_.onsetDateTime||"1900-01-01").getTime();return new Date(j.modifiedDate||j.displayDate||j.recordedDate||j.onsetDateTime||"1900-01-01").getTime()-Ye}),I.value=w.sort((_,j)=>{const Ye=new Date(_.modifiedDate||_.effectiveDateTime||_.recordedDate||"1900-01-01").getTime();return new Date(j.modifiedDate||j.effectiveDateTime||j.recordedDate||"1900-01-01").getTime()-Ye}),O.value=M.sort((_,j)=>{const Ye=new Date(_.modifiedDate||_.displayDate||_.recordedDate||"1900-01-01").getTime();return new Date(j.modifiedDate||j.displayDate||j.recordedDate||"1900-01-01").getTime()-Ye}),he.value=Cs(ie.observations||[]),yr.value={};const $=(ie.allergies||[]).filter(_=>_.code?.text&&_.code.text.trim()!==""&&_.code.text!=="null").sort((_,j)=>{const Ye=new Date(_.recordedDate||_.onsetDateTime||"1900-01-01").getTime();return new Date(j.recordedDate||j.onsetDateTime||"1900-01-01").getTime()-Ye}).map((_,j)=>({id:`ai-allergy-${j+1}`,type:_.criticality==="high"?"danger":_.criticality==="low"?"info":"warning",title:`${_.code.text} Allergy`,description:_.reaction?.[0]?.manifestation?.[0]?.text||a("patientSummary.noReactionDetails"),recordedDate:_.recordedDate||null,onsetDateTime:_.onsetDateTime||null,displayDate:_.onsetDateTime||_.recordedDate||null,notes:_.evidence?.[0]?.detail?.[0]?.reference||"",modifiedDate:_.modifiedDate||null})),Fe=(ie.emergencyContacts||[]).filter(_=>_.name?.[0]?.text).map((_,j)=>({id:`emergency-${j+1}`,type:"info",title:a("patientSummary.emergencyContact"),description:`${_.name[0].text}${_.relationship?.[0]?.text?` (${_.relationship[0].text})`:""}${_.telecom?.[0]?.value?` - ${_.telecom[0].value}`:""}`}));S.value=[...$,...Fe].sort((_,j)=>{const Ye=new Date(_.modifiedDate||_.displayDate||_.recordedDate||_.onsetDateTime||"1900-01-01").getTime();return new Date(j.modifiedDate||j.displayDate||j.recordedDate||j.onsetDateTime||"1900-01-01").getTime()-Ye}),Ps(),Q.value={...Q.value,activeConditions:T.value.length,medications:I.value.length,allergies:(ie.allergies||[]).length}}setTimeout(()=>{Vt.value=!1},1500)}}catch(l){if(l?.message?.includes("longer than expected")||l?.message?.includes("timeout")){const u=Q.value.totalVisits||0;u>50?De.value=a("patientSummary.processingLargeVolume",{visitCount:u}):De.value=a("patientSummary.processingTakingLong")}else De.value=a("patientSummary.failedToProcess"),T.value.length===0&&I.value.length===0&&(T.value=[],I.value=[],he.value=[],O.value=[],S.value=[])}finally{n&&clearInterval(n),Te.value=!1,Vt.value=!1}}},be=m(!1),me=m({type:"error",title:"",message:"",secondaryMessage:"",primaryButtonText:"",onConfirm:null});lt(()=>b.patient?.patient_id||b.patient?.id,(r,n)=>{r!==n&&(_t.value=!1,xe.value=!1,Q.value={totalVisits:0,activeConditions:0,medications:0,allergies:0},L.value=[],ct.value=[],T.value=[],I.value=[],S.value=[],he.value=[],O.value=[],yr.value={},_e.value=[],ze.value=new Set,St.value=null,mt.value=!1,Se.value=0,Ae.value=0,Me.value=0,Ve.value=0,Oe.value=0,qe.value=0,h.value=0,g.value=0,_t.value=!1,Wr.value=!1,da.value=!1,Dt.value=!1,be.value=!1,Ft.value=!1,at.value=!1,Lt.value=!1,rt.value=!1,qt.value=!1,st.value=!1,Gt.value=!1,Kt.value=!1,ma.value=null,pa.value=null,We.value=null,nt.value=null,it.value=null,ft.value=null,X.value={patientName:"",dateOfBirth:"",gender:"",insuranceProvider:""},pe.value={condition:"",recordedDate:new Date().toISOString().split("T")[0]},J.value={allergen:"",reaction:"",severity:"low",recordedDate:new Date().toISOString().split("T")[0]},W.value={name:"",dosage:"",recordedDate:new Date().toISOString().split("T")[0],endDate:""},P.value={details:"",context:"",category:"general",type:"",recordedDate:new Date().toISOString().split("T")[0]},Ot.value=!1,Ut.value=!1,zt.value=!1,Ht.value=!1,yt.value=!1,De.value=null,Te.value=!1,Vt.value=!1,Ge.value="",La(),Ke.value.dateOfService=new Date().toISOString().slice(0,10),Zt(),vt.value&&za())},{immediate:!0}),lt(vt,(r,n)=>{if(!r){La();return}!n&&D.value&&za()}),lt(()=>
1A.hash,r=>{r==="#intake"&&(mt.value=!1,Y())});const $n=async()=>{me.value={type:"confirm",title:a("patientSummary.regenerateTitle"),message:a("patientSummary.regenerateConfirm"),secondaryMessage:"",primaryButtonText:a("patientSummary.continue"),onConfirm:async()=>{try{De.value=null,Ge.value=a("patientSummary.startingRegeneration"),await qa(!0)}catch{De.value=a("patientSummary.regenerateFailed")}}},be.value=!0},Nn=()=>{Se.value=0},Ha=async r=>{if(!(!D.value||xe.value)){xe.value=!0;try{const n=H().currentOrgId||null,l=r*dr,u=await $fetch("/api/patients/visits",{headers:n?{"x-claio-preferred-org":String(n)}:void 0,query:{patientId:D.value,offset:l,limit:dr}});if(u?.success&&u.visits){const s=u.visits.map(c=>({id:c.id,visit_type:c.visit_name,visit_date:c.created_at,status:c.status==="completed"?a("patientSummary.completed"):c.status}));L.value=s,_t.value=u.pagination.hasMore,g.value=u.pagination.total||0,u.pagination.total&&(Q.value.totalVisits=u.pagination.total)}}catch{}finally{xe.value=!1}}},Mn=()=>{Me.value+1<ha.value&&Me.value++},Vn=()=>{Me.value>0&&Me.value--},On=()=>{Ve.value+1<ga.value&&Ve.value++},An=()=>{Ve.value>0&&Ve.value--},En=async()=>{Oe.value+1<ba.value&&!xe.value&&(Oe.value++,h.value++,await Ha(h.value))},jn=async()=>{Oe.value>0&&!xe.value&&(Oe.value--,h.value--,await Ha(h.value))},Bn=()=>{qe.value+1<Ra.value&&qe.value++},Rn=()=>{qe.value>0&&qe.value--},Fn=()=>{Ae.value+1<ka.value&&Ae.value++},Un=()=>{Ae.value>0&&Ae.value--};lt([Se],(r,n)=>{Ae.value=0,Me.value=0,Ve.value=0,Oe.value=0,qe.value=0,r[0]===0&&n&&n[0]!==0&&h.value>0&&(h.value=0,Oe.value=0,Ha(0).catch(()=>{}))});const Ln=()=>{We.value=null,at.value=!1,pe.value={condition:"",recordedDate:new Date().toISOString().split("T")[0]},Ft.value=!0},zn=r=>{We.value=r,Ft.value=!1;const n=r.displayDate||r.recordedDate||r.onsetDateTime||new Date().toISOString();pe.value={condition:r.condition||"",recordedDate:new Date(n).toISOString().split("T")[0]},at.value=!0},Ga=()=>{Ft.value=!1,at.value=!1,We.value=null,pe.value={condition:"",recordedDate:new Date().toISOString().split("T")[0]}},qn=async()=>{if(!(!D.value||!pe.value.condition.trim())){Ut.value=!0;try{const r=H().currentOrgId||null,n=!!We.value,l=await $fetch("/api/patients/manage-panel",{method:"POST",headers:r?{"x-claio-preferred-org":String(r)}:void 0,body:{patientId:D.value,panelType:"conditions",item:{condition:pe.value.condition.trim(),recordedDate:pe.value.recordedDate},...n?{itemId:We.value.id}:{}}});if(l?.success){if(l.item){const u=l.item.recordedDate||pe.value.recordedDate,s={id:l.item.id,condition:l.item.code?.text||pe.value.condition.trim(),icd_code:l.item.code?.coding?.find(c=>c.system?.includes("icd"))?.code||null,type:l.item.category?.[0]?.coding?.[0]?.code==="encounter-diagnosis"?"acute":"chronic",notes:l.item.evidence?.[0]?.detail?.[0]?.reference||"Manual/user-entry",status:l.item.clinicalStatus?.coding?.[0]?.code||"active",recordedDate:u,onsetDateTime:l.item.onsetDateTime||null,displayDate:l.item.onsetDateTime||u,modifiedDate:l.item.modifiedDate||new Date().toISOString()};if(n){const c=T.value.findIndex(y=>y.id===We.value?.id);c!==-1&&T.value.splice(c,1,{...T.value[c],...s})}else T.value.unshift(s);T.value.sort((c,y)=>{const C=new Date(c.modifiedDate||c.displayDate||c.recordedDate||c.onsetDateTime||"1900-01-01").getTime();return new Date(y.modifiedDate||y.displayDate||y.recordedDate||y.onsetDateTime||"1900-01-01").getTime()-C}),Q.value={...Q.value,activeConditions:T.value.length}}Ga()}}catch{$e(a("patientSummary.saveFailed"),a("patientSummary.saveDiagnosisFailed"))}finally{Ut.value=!1}}},Hn=async r=>{Ta(a("patientSummary.deleteDiagnosisTitle"),a("patientSummary.deleteDiagnosisConfirm",{condition:r.condition}),()=>Gn(r),a("patientSummary.delete"))},Gn=async r=>{try{const n=H().currentOrgId||null;if((await $fetch("/api/patients/manage-panel",{method:"DELETE",headers:n?{"x-claio-preferred-org":String(n)}:void 0,query:{patientId:D.value,panelType:"conditions",itemId:r.id}}))?.success){const u=T.value.findIndex(s=>s.id===r.id);u!==-1&&(T.value.splice(u,1),We.value?.id===r.id&&(We.value=null),Q.value={...Q.value,activeConditions:T.value.length})}}catch{$e(a("patientSummary.deleteFailed"),a("patientSummary.deleteDiagnosisFailed"))}},Kn=()=>{nt.value=null,rt.value=!1,J.value={allergen:"",reaction:"",severity:"low",recordedDate:new Date().toISOString().split("T")[0]},Lt.value=!0},Wn=r=>{nt.value=r,Lt.value=!1;const n=r.allergen||(typeof r.title=="string"?r.title.replace(/ Allergy$/i,""):""),l=r.displayDate||r.recordedDate||r.onsetDateTime||new Date().toISOString();J.value={allergen:n,reaction:r.description||"",severity:r.severity||r.criticality||"low",re
1cordedDate:new Date(l).toISOString().split("T")[0]},rt.value=!0},Ka=()=>{Lt.value=!1,rt.value=!1,nt.value=null,J.value={allergen:"",reaction:"",severity:"low",recordedDate:new Date().toISOString().split("T")[0]}},Zn=async()=>{if(!(!D.value||!J.value.allergen.trim())){zt.value=!0;try{const r=H().currentOrgId||null,n=!!nt.value,l={patientId:D.value,panelType:"allergies",item:{allergen:J.value.allergen.trim(),reaction:J.value.reaction||a("patientSummary.noReactionDetails"),severity:J.value.severity,recordedDate:J.value.recordedDate}};n&&(l.itemId=nt.value.id),(await $fetch("/api/patients/manage-panel",{method:"POST",headers:r?{"x-claio-preferred-org":String(r)}:void 0,body:l}))?.success&&(await Zt(),Ka())}catch{$e(a("patientSummary.saveFailed"),a("patientSummary.saveAllergyFailed"))}finally{zt.value=!1}}},Yn=async r=>{Ta(a("patientSummary.deleteAllergyTitle"),a("patientSummary.deleteAllergyConfirm",{title:r.title}),()=>Qn(r),a("patientSummary.delete"))},Qn=async r=>{try{const n=H().currentOrgId||null;if((await $fetch("/api/patients/manage-panel",{method:"DELETE",headers:n?{"x-claio-preferred-org":String(n)}:void 0,query:{patientId:D.value,panelType:"allergies",itemId:r.id}}))?.success){const u=S.value.findIndex(s=>s.id===r.id);u!==-1&&(S.value.splice(u,1),nt.value?.id===r.id&&(nt.value=null),Q.value={...Q.value,allergies:S.value.length})}}catch{$e(a("patientSummary.deleteFailed"),a("patientSummary.deleteAllergyFailed"))}},Xn=()=>{it.value=null,st.value=!1,W.value={name:"",dosage:"",recordedDate:new Date().toISOString().split("T")[0],endDate:""},qt.value=!0},Jn=r=>{it.value=r,qt.value=!1;const n=r.displayDate||r.effectiveDateTime||r.recordedDate||new Date().toISOString(),l=r.effectivePeriod?.end||"";W.value={name:r.name||"",dosage:r.dosage||"",recordedDate:new Date(n).toISOString().split("T")[0],endDate:l?new Date(l).toISOString().split("T")[0]:""},st.value=!0},Wa=()=>{qt.value=!1,st.value=!1,it.value=null,W.value={name:"",dosage:"",recordedDate:new Date().toISOString().split("T")[0],endDate:""}},es=async()=>{if(!(!D.value||!W.value.name.trim())){Ht.value=!0;try{const r=H().currentOrgId||null,n=!!it.value,l={patientId:D.value,panelType:"medications",item:{name:W.value.name.trim(),dosage:W.value.dosage||"As prescribed",recordedDate:W.value.recordedDate,endDate:W.value.endDate||null}};n&&(l.itemId=it.value.id),(await $fetch("/api/patients/manage-panel",{method:"POST",headers:r?{"x-claio-preferred-org":String(r)}:void 0,body:l}))?.success&&(await Zt(),Wa())}catch{$e(a("patientSummary.saveFailed"),a("patientSummary.saveMedicationFailed"))}finally{Ht.value=!1}}},ts=async r=>{Ta(a("patientSummary.deleteMedicationTitle"),a("patientSummary.deleteMedicationConfirm",{name:r.name}),()=>as(r),a("patientSummary.delete"))},as=async r=>{try{const n=H().currentOrgId||null;if((await $fetch("/api/patients/manage-panel",{method:"DELETE",headers:n?{"x-claio-preferred-org":String(n)}:void 0,query:{patientId:D.value,panelType:"medications",itemId:r.id}}))?.success){const u=I.value.findIndex(s=>s.id===r.id);u!==-1&&(I.value.splice(u,1),it.value?.id===r.id&&(it.value=null),Q.value={...Q.value,medications:I.value.length})}}catch{$e(a("patientSummary.deleteFailed"),a("patientSummary.deleteMedicationFailed"))}},rs=()=>{ft.value=null,Kt.value=!1,P.value={details:"",context:"",category:"general",type:"",recordedDate:new Date().toISOString().split("T")[0]},Gt.value=!0},ns=r=>{ft.value=r,Gt.value=!1;const n=r.displayDate||r.recordedDate||new Date().toISOString();P.value={details:r.details||"",context:r.context||"",category:r.category||"general",type:r.type||"",recordedDate:new Date(n).toISOString().split("T")[0]},Kt.value=!0},Yt=()=>{Gt.value=!1,Kt.value=!1,ft.value=null,P.value={details:"",context:"",category:"general",type:"",recordedDate:new Date().toISOString().split("T")[0]}},Cr=async()=>{if(!(!D.value||!P.value.details.trim())){yt.value=!0;try{const r=H().currentOrgId||null,n=!!ft.value,l={patientId:D.value,panelType:"personal_information",item:{details:P.value.details.trim(),context:P.value.context||null,category:P.value.category,type:P.value.type||null,recordedDate:P.value.recordedDate}};n&&(l.itemId=ft.value.id);const u=await $fetch("/api/patients/manage-panel",{method:"POST",headers:r?{"x-claio-preferred-org":String(r)}:void 0,body:l});if(u?.success){if(n){const s=O.value.findIndex(c=>c.id===ft.value.id);s!==-1&&u.item&&(O.value[s]={id:u.item.id,details:u.item.details,context:u.item.context,category:u.item.category,type:u.item.type,source_reference:u.item.source_reference,recordedDate:u.item.recordedDate,displayDate:u.item.displayDate,modifiedDate:u.item.modifiedDate},O.value.sort((c,y)=>{const C=new Date(c.modifiedDate||c.displayDate||c.recordedDate||"1900-01-01").getTime();return new Date(y.modifiedDate||y.displayDate||y.recordedDate||"1900-01-01").getTime()-C}))}else if(u.item){const s={id:u.item.id,details:u.item.details,context:u.item.context,category:u.item.category,type:u.item.type,source_reference:u.item.source_reference,recordedDate:u.item.recordedDate,displayDate:u.item.displayDate,modifiedDate:u.item.modifiedDate};O.value.unshift(s),O.value.sort((c,y)=>{const C=new Date(c.modifiedDate||c.displayDate||c.recordedDate||"1900-01-01").getTime();return new Date(y.modifiedDate||y.displayDate||y.recordedDate||"1900-01-01").getTime()-C})}Yt()}}catch{$e(a("patientSummary.saveFailed"),a("patientSummary.savePersonalInfoFailed"))}finally{yt.value=!1}}},ss=async r=>{Ta(a("patientSummary.deletePersonalInfoTitle"),a("patientSummary.deletePersonalInfoConfirm",{details:r.details}),()=>is(r),a("patientSummary.delete"))},is=async r=>{try{const n=H().currentOrgId||null;if((await $fetch("/api/patients/manage-panel",{method:"DELETE",headers:n?{"x-claio-preferred-org":String(n)}:void 0,query:{patientId:D.value,panelType:"personal_information",itemId:r.id}}))?.success){const u=O.value.findIndex(s=>s.id===r.id);u!==-1&&O.value.splice(u,1)}}catch{$e(a("patientSummary.deleteFailed"),a("patientSummary.deletePersonalInfoFailed"))}},os=()=>{X.value={patientName:b.patient?.patient_name||Ce.value||"",dateOfBirth:b.patient?.date_of_birth||"",gender:b.patient?.gender||"",insuranceProvider:b.patient?.insurance_provider||""},da.value=!0},Za=()=>{da.value=!1,X.value={patientName:"",dateOfBirth:"",gender:"",insuranceProvider:""}},gt=v(()=>{if(E.value.timeRange===0)return L.value;if(E.value.timeRange==="custom"){const n=E.value.customStartDate?new Date(E.value.customStartDate):null,l=E.value.customEndDate?new Date(E.value.customEndDate+"T23:59:59"):null;return L.value.filter(u=>{if(!u.visit_date)return!1;const s=new Date(u.visit_date);return!(n&&s<n||l&&s>l)})}const r=new Date;return r.setFullYear(r.getFullYear()-E.value.timeRange),L.value.filter(n=>n.visit_date?new Date(n.visit_date)>=r:!1)}),Da=v(()=>gt.value.filter(r=>Be.value.has(r.id))),ls=()=>{gt.value.forEach(r=>{Be.value.add(r.id)})},ds=()=>{gt.value.forEach(r=>{Be.value.delete(r.id)})},us=r=>{Be.value.has(r)?Be.value.delete(r):Be.value.add(r)};lt(()=>[E.value.timeRange,E.value.customStartDate,E.value.customEndDate],()=>{Tt.value&&(Be.value.clear(),gt.value.forEach(r=>Be.value.add(r.id)))});const cs=()=>{E.value={contentType:"both",timeRange:0,customStartDate:"",customEndDate:""},Ze.value=null,Pe.value={current:0,total:0,status:""},Be.value=new Set(L.value.map(r=>r.id)),Tt.value=!0},$r=()=>{ge.value||(Tt.value=!1)},ms=async r=>{const n=H().currentOrgId||null;try{const l=await $fetch("/api/transcriptions/get-note",{method:"POST",headers:n?{"x-claio-preferred-org":String(n)}:void 0,body:{visitId:r}}),u=L.value.find(y=>y.id===r),s=u?.visit_date?ne(u.visit_date):"",c=l.contentSource==="generated_note";return{transcription:l.rawTranscription||"",notes:c&&l.noteContent||"",visitName:l.visitName||"Untitled Visit",visitDate:s}}catch(l){return console.error(`Error fetching content for visit ${r}:`,l?.message||"Unknown error"),{transcription:"",notes:"",visitName:"Untitled Visit",visitDate:""}}},Nr=async()=>{const r=Da.value,n=E.value.contentType;Pe.value.total=r.length,Pe.value.status=a("patientSummary.fetchingVisitData");const l=await Promise.allSettled(r.map(y=>ms(y.id))),u=l.map((y,C)=>y.status==="fulfilled"?y.value:(console.warn(`Failed to fetch visit ${r[C].id}:`,y.reason),null)).filter(y=>y!==null),s=l.length-u.length;s>0&&console.warn(`${s} visit(s) failed to load and will be excluded from export`),Pe.value.current=r.length,Pe.value.status=a("patientSummary.preparingDocument");const c=[];c.push(`Patient: ${Ce.value}`),It.value&&c.push(`Date of Birth: ${It.value}`),Pt.value&&c.push(`Insurance: ${Pt.value}`),c.push(""),c.push("=".repeat(50)),c.push("");for(const y of u)c.push(`Visit: ${y.visitName}`),c.push(`Date: ${y.visitDate}`),c.push("-".repeat(40)),(n==="transcription"||n==="both")&&y.transcription&&(c.push(""),c.push("TRANSCRIPTION:"),
1c.push(y.transcription)),(n==="notes"||n==="both")&&y.notes&&(c.push(""),c.push("CLINICAL NOTES:"),c.push(y.notes)),c.push(""),c.push("=".repeat(50)),c.push("");return c.join(` 2`)},Mr=async()=>{const n=H().currentOrgId;let l="",u=null,s={patientName:Ce.value||"",patientDOB:It.value||"",patientGender:fa.value||"",patientInsurance:Pt.value||""};if(n)try{const c=await $fetch("/api/org/letterhead",{method:"GET",headers:{"x-claio-preferred-org":String(n)}});if(c?.letterhead){const y=c.letterhead,C=y.layout_json||{};s={...s,providerName:y.letterhead_provider_name||void 0,credentials:y.letterhead_credentials||void 0,faxNumber:y.fax_number||void 0,letterheadEmail:y.letterhead_email||void 0,licenseNumber:y.license_number||void 0,signatureText:y.signature_text||void 0,signatureLine1:y.signature_line_1||void 0,signatureLine2:y.signature_line_2||void 0,phoneNumber:y.letterhead_phone_number||void 0,showPhone:y.letterhead_show_phone!==!1,showFax:y.letterhead_show_fax!==!1,showEmail:y.letterhead_show_email!==!1,showLicense:y.letterhead_show_license!==!1,showCredentials:y.letterhead_show_credentials!==!1,showAddress:y.letterhead_show_address!==!1,signatureImageUrl:C.signatureImageUrl||void 0,signatureImageSize:C.signatureImageSize||void 0,logoSize:C.logoSize||void 0}}if(c?.organization){l=c.organization.name||"";const y=c.organization.clinic_address||{};u={line1:y.line1||"",line2:y.line2||"",city:y.city||"",state:y.state||"",postal:y.postal||"",country:y.country||""}}}catch(c){console.error("Error fetching letterhead:",c?.message||"Unknown error")}return{orgName:l,clinicAddress:u,letterheadOptions:s}},ps=async()=>{try{ge.value=!0,Ze.value=null;const r=await Nr();if(!r.trim()){Ze.value=a("patientSummary.noContentToExport"),ge.value=!1;return}Pe.value.status=a("patientSummary.preparingPrint");const{orgName:n,clinicAddress:l,letterheadOptions:u}=await Mr();await Yr(r,n,l,u),Tt.value=!1}catch(r){console.error("Error printing all visits:",r?.message||"Unknown error"),Ze.value=a("patientSummary.printFailed")}finally{ge.value=!1}},fs=async()=>{try{ge.value=!0,Ze.value=null;const r=await Nr();if(!r.trim()){Ze.value=a("patientSummary.noContentToExport"),ge.value=!1;return}Pe.value.status=a("patientSummary.preparingDownload");const{orgName:n,clinicAddress:l,letterheadOptions:u}=await Mr(),s=Ce.value.replace(/[^a-z0-9]/gi,"_"),c=new Date().toISOString().split("T")[0],y=`${s}_medical_records_${c}`;await Qr(r,y,n,l,u),Tt.value=!1}catch(r){console.error("Error downloading PDF:",r?.message||"Unknown error"),Ze.value=a("patientSummary.downloadFailed")}finally{ge.value=!1}},ys=r=>{const n=r.target,l=n.value,u=vs(l);if(l!==u){const s=n.selectionStart;X.value.patientName=u,Ks(()=>{s!==null&&n.setSelectionRange(s,s)})}else X.value.patientName=u},vs=r=>r.split(" ").map(n=>n.length===0?n:n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()).join(" "),hs=async()=>{if(D.value){Ot.value=!0;try{const r=H().currentOrgId||null,n=await $fetch("/api/patients/update-profile",{method:"POST",headers:r?{"x-claio-preferred-org":String(r)}:void 0,body:{patientId:D.value,patientName:X.value.patientName,dateOfBirth:X.value.dateOfBirth,gender:X.value.gender,insuranceProvider:X.value.insuranceProvider}});n?.success&&(window.dispatchEvent(new CustomEvent("patient:updated",{detail:{patient:n.patient}})),n.visitsSynced>0&&Or(a("patientSummary.profileUpdated"),a("patientSummary.profileUpdatedMessage",{visitsSynced:n.visitsSynced})),ut("patient-updated",n.patient),Za(),await Zt())}catch{$e(a("patientSummary.updateFailed"),a("patientSummary.updateProfileFailed"))}finally{Ot.value=!1}}},gs=async()=>{try{await $a({path:"/transcribing",query:{action:"new_visit",name:Ce.value,patientId:D.value,reference:`Patient ID: ${D.value}`,status:"scheduled"}})}catch{$e(a("patientSummary.failedToGoToVisit"),a("patientSummary.failedToGoToVisitMessage"))}};let Ya=!1;const bs=async(r,n)=>{if(n&&(n.preventDefault(),n.stopPropagation()),r.isPerioChart){$a(`/periodontal-chart?chart_id=${r.perioChartId}`);return}if(!Ya){Ya=!0;try{ut("visit-selected",r.id)}catch(l){console.error("[PatientSummary] Error in navigateToVisit:",l?.message||"Unknown error"),$e(a("patientSummary.failedToOpenVisit"),a("patientSummary.failedToOpenVisitMessage"))}finally{setTimeout(()=>{Ya=!1},1e3)}}},Vr=async(r,n="diagnosis")=>{let l=null,u=null;if(n==="diagnosis"){if(u=r.condition,r.notes){const s=r.notes.match(/Transcription\/([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})/i);if(s)l=s[1];else{const c=r.notes.match(/Transcription\/(\d+)/)||r.notes.match(/transcription\/(\d+)/)||r.notes.match(/visit\/(\d+)/)||r.notes.match(/(\d+)/);c&&(l=c[1])}}}else if(n==="medication"&&(u=r.name,r.notes)){const s=r.notes.match(/Transcription\/([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})/i);if(s)l=s[1];else{const c=r.notes.match(/Transcription\/(\d+)/)||r.notes.match(/transcription\/(\d+)/)||r.notes.match(/visit\/(\d+)/)||r.notes.match(/(\d+)/);c&&(l=c[1])}}if(!l&&r.notes&&!r.notes.includes("Manual/"))try{const s=H().currentOrgId||null,c=await $fetch("/api/transcriptions/find-term",{method:"POST",headers:s?{"x-claio-preferred-org":String(s)}:void 0,body:{patientId:D.value,searchTerm:u,termType:n}});if(c?.success&&c.results.length>0){const y=c.results[0].transcriptionId;y&&y!=="undefined"&&y!=="null"&&(l=y)}}catch{}if(!l&&r.notes&&!r.notes.includes("Manual/")&&L.value.length>0){const s=L.value[0].id;s&&s!=="undefined"&&s!=="null"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(String(s))&&(l=s)}if(!l&&r.notes&&r.notes.includes("Manual/")){me.value={type:"info",title:a("patientSummary.manualEntry"),message:a("patientSummary.manualEntryMessage",{type:n}),secondaryMessage:a("patientSummary.manualEntrySecondary"),primaryButtonText:a("patientSummary.gotIt"),onConfirm:null},be.value=!0;return}if(l&&!/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(String(l))){me.value={type:"info",title:a("patientSummary.legacyDataReference"),message:a("patientSummary.legacyDataMessage",{type:n}),secondaryMessage:a("patientSummary.legacyDataSecondary"),primaryButtonText:a("patientSummary.gotIt"),onConfirm:null},be.value=!0;return}if(!l){me.value={type:"error",title:a("patientSummary.linkToMacPractice"),message:a("patientSummary.linkToMacPracticeMessage"),secondaryMessage:a("patientSummary.noAppointmentsFound"),primaryButtonText:a("patientSummary.ok"),onConfirm:null},be.value=!0;return}if(!l||l==="undefined"||l==="null"){console.warn("Cannot open transcription modal: no valid visitId found",{visitId:l,itemNotes:r.notes});return}Dt.value&&(Dt.value=!1,await new Promise(s=>setTimeout(s,100))),ma.value=l,pa.value=u,Dt.value=!0},ws=()=>{Dt.value=!1,ma.value=null,pa.value=null},xs=()=>{kt.value=null,Va.value=!0},Qa=()=>{Va.value=!1,kt.value=null},_s=()=>{ke.value=!ke.value},Ss=()=>{ke.value=!1},ks=async()=>
2{if(D.value){Rt.value=!0,kt.value=null;try{const r=H().currentOrgId||null,n=await $fetch("/api/patients/delete",{method:"POST",headers:r?{"x-claio-preferred-org":String(r)}:void 0,body:{patientId:D.value}});n?.success&&(window.dispatchEvent(new CustomEvent("patient:deleted",{detail:{patientId:D.value,patientName:Ce.value,deletedVisitsCount:n.deletedVisitsCount}})),Or("Patient Deleted",n.message),Qa(),await $a(le("/transcribing")))}catch(r){kt.value=r.data?.message||r.message||a("patientSummary.patientDeleteFailed")}finally{Rt.value=!1}}},Ds=()=>{me.value.onConfirm&&me.value.onConfirm(),be.value=!1},$e=(r,n,l="")=>{me.value={type:"error",title:r,message:n,secondaryMessage:l,primaryButtonText:a("patientSummary.ok"),onConfirm:null},be.value=!0},Ta=(r,n,l,u=null)=>{me.value={type:"confirm",title:r,message:n,secondaryMessage:"",primaryButtonText:u||a("patientSummary.confirm"),onConfirm:l},be.value=!0},Or=(r,n,l="")=>{me.value={type:"info",title:r,message:n,secondaryMessage:l,primaryButtonText:a("patientSummary.gotIt"),onConfirm:null},be.value=!0};Hs(()=>{Zt()});function Ts(r){return r.map(n=>{const l=n.recordedDate||null,u=n.onsetDateTime||null,s=n.evidence?.[0]?.detail?.[0]?.reference||"";return{id:n.id,condition:n.code?.text||n.code?.coding?.[0]?.display||a("patientSummary.unknownCondition"),icd_code:n.code?.coding?.find(c=>c.system?.includes("icd"))?.code||null,type:n.category?.[0]?.coding?.[0]?.code==="encounter-diagnosis"?"acute":"chronic",notes:s,status:n.clinicalStatus?.coding?.[0]?.code||"active",recordedDate:l,onsetDateTime:u,displayDate:u||l||null,modifiedDate:n.modifiedDate||null}}).sort((n,l)=>{const u=new Date(n.modifiedDate||n.displayDate||n.recordedDate||n.onsetDateTime||"1900-01-01").getTime();return new Date(l.modifiedDate||l.displayDate||l.recordedDate||l.onsetDateTime||"1900-01-01").getTime()-u})}function Is(r){return r.map(l=>({id:l.id,name:l.medicationCodeableConcept?.text||l.medicationCodeableConcept?.coding?.[0]?.display||a("patientSummary.unknownMedication"),dosage:l.dosage?.[0]?.text||a("patientSummary.dosageNotSpecified"),frequency:l.dosage?.[0]?.timing?.repeat?`${l.dosage[0].timing.repeat.frequency||1} times per ${l.dosage[0].timing.repeat.periodUnit||"day"}`:a("patientSummary.asNeeded"),notes:l.reasonReference?.[0]?.reference||"",indication:l.reasonReference?.[0]?.reference?.includes("Transcription/")?null:l.reasonReference?.[0]?.reference||null,status:l.status||"active",next_refill:null,effectiveDateTime:l.effectiveDateTime||null,recordedDate:l.recordedDate||null,displayDate:l.effectiveDateTime||l.recordedDate||null,modifiedDate:l.modifiedDate||null,effectivePeriod:l.effectivePeriod||null})).sort((l,u)=>{const s=new Date(l.modifiedDate||l.effectiveDateTime||l.recordedDate||"1900-01-01").getTime();return new Date(u.modifiedDate||u.effectiveDateTime||u.recordedDate||"1900-01-01").getTime()-s})}function Ar(r){if(!r||!r.includes("Transcription/"))return null;let n=r.match(/Transcription\/([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})/i);if(n||(n=r.match(/Transcription\/(\d+)/)),!n)return null;const l=n[1],u=L.value.find(c=>String(c.id)===l);if(u)return u.visit_date;const s=T.value.find(c=>c.notes?.includes(`Transcription/${l}`));return s&&s.displayDate?s.displayDate:null}function Ps(){try{for(const r of I.value)if(!r.effectiveDateTime&&!r.recordedDate&&r.notes&&r.notes.includes("Transcription/")){const n=Ar(r.notes);n&&(r.effectiveDateTime=n,r.recordedDate=n,r.displayDate=n)}for(const r of S.value)if(!r.displayDate&&!r.recordedDate&&!r.onsetDateTime&&r.notes){const n=Ar(r.notes);n&&(r.displayDate=n,r.recordedDate=n)}I.value.sort((r,n)=>{const l=new Date(r.modifiedDate||r.effectiveDateTime||r.recordedDate||"1900-01-01").getTime();return new Date(n.modifiedDate||n.effectiveDateTime||n.recordedDate||"1900-01-01").getTime()-l}),S.value.sort((r,n)=>{const l=new Date(r.modifiedDate||r.displayDate||r.recordedDate||r.onsetDateTime||"1900-01-01").getTime();return new Date(n.modifiedDate||n.displayDate||n.recordedDate||n.onsetDateTime||"1900-01-01").getTime()-l})}catch{}}function Cs(r){return r.map(n=>({id:n.id,test_name:n.code?.text||n.code?.coding?.[0]?.display||"Unknown test",value:n.valueQuantity?.value?`${n.valueQuantity.value} ${n.valueQuantity.unit||""}`:n.valueString||"No value",unit:n.valueQuantity?.unit||"",test_date:n.effectiveDateTime||n.issued||new Date().toISOString(),status:n.status==="final"?"normal":n.status}))}function $s(r){if(!r)return"?";const n=r.split(" ");return n.length===1?n[0].charAt(0).toUpperCase():(n[0].charAt(0)+n[n.length-1].charAt(0)).toUpperCase()}function Ns(r){const n=Ia(r);if(!n)return null;const[l,u,s]=n.split("-").map(Number),c=new Date,y=c.getFullYear(),C=c.getMonth()+1,fe=c.getDate();let we=y-l;return C>u||C===u&&fe>=s||we--,we>=0&&we<=130?we:null}function ne(r){const n=Ia(r);return n?new Date(`${n}T00:00:00Z`).toLocaleDateString("en-US",{timeZone:"UTC",year:"numeric",month:"short",day:"numeric"}):""}function Ms(...r){for(const n of r){const l=Ia(n);if(l)return l}return null}function Ia(r){if(r==null)return null;const n=String(r).trim();if(!n)return null;const l=c=>{const y=new Date(`${c}T00:00:00Z`),C=new Date().toISOString().slice(0,10);return!Number.isNaN(y.getTime())&&y.toISOString().slice(0,10)===c&&
2c<=C},u=n.match(/^(\d{4})-(\d{2})-(\d{2})/);if(u){const c=u[0];return l(c)?c:null}const s=n.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(s){const[,c,y,C]=s,fe=`${C}-${c.padStart(2,"0")}-${y.padStart(2,"0")}`;return l(fe)?fe:null}return null}function Vs(r){switch(r){case"danger":return"border-neutral-100 bg-neutral-50/70 hover:border-error-200 hover:bg-white";case"warning":return"border-neutral-100 bg-neutral-50/70 hover:border-warning-200 hover:bg-white";case"info":return"border-neutral-100 bg-neutral-50/70 hover:border-info-200 hover:bg-white";default:return"border-neutral-100 bg-neutral-50/70 hover:border-neutral-200 hover:bg-white"}}function Os(r){switch(r){case"danger":return"text-error-500";case"warning":return"text-yellow-500";case"info":return"text-info-500";default:return"text-neutral-500"}}function As(r){if(r.source_reference){let n=r.source_reference.match(/Transcription\/([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})/i);if(n||(n=r.source_reference.match(/Transcription\/(\d+)/)),n){const l=n[1],u=L.value.find(s=>s.id===l);if(u?.visit_date)return u.visit_date}}return new Date().toISOString()}function Es(r){switch(r){case"family":return"bg-info-100 text-info-700";case"work":return"bg-purple-100 text-purple-700";case"hobbies":return"bg-purple-100 text-purple-700";case"life_events":return"bg-primary-100 text-primary-700";case"pets":return"bg-orange-100 text-orange-700";case"travel":return"bg-indigo-100 text-indigo-700";case"social":return"bg-teal-100 text-teal-700";default:return"bg-neutral-100 text-neutral-700"}}return(r,n)=>{const l=js,u=qi;return o(),d("div",ao,[t("main",ro,[t("section",{"aria-label":e(a)("patientSummary.summaryAriaLabel"),class:"rounded-xl border border-neutral-100 bg-white p-4"},[t("div",null,[t("div",so,[t("div",io,[t("div",oo,i($s(e(Ce))),1),t("div",lo,[t("div",uo,[t("h1",co,i(e(Ce)),1),e(dt)?(o(),d("span",mo,[f(e(Qs),{class:"h-3.5 w-3.5","aria-hidden":"true"}),t("span",po,i(e(Ue)),1)])):p("",!0)]),e(Aa)!==null||e(It)||e(fa)||e(Pt)?(o(),d("dl",fo,[e(Aa)!==null?(o(),d("div",yo,[t("dt",vo,i(e(a)("patientSummary.age")),1),t("dd",ho,i(e(Aa)),1)])):p("",!0),e(It)?(o(),d("div",go,[t("dt",bo,i(e(a)("patientSummary.dob")),1),t("dd",wo,i(e(It)),1)])):p("",!0),e(fa)?(o(),d("div",xo,[t("dt",_o,i(e(a)("patientSummary.gender")),1),t("dd",So,i(e(fa)),1)])):p("",!0),e(Pt)?(o(),d("div",ko,[t("dt",Do,i(e(a)("patientSummary.insurance")),1),t("dd",To,i(e(Pt)),1)])):p("",!0)])):p("",!0),e(dt)?(o(),d("p",Io,[f(e(Xs),{class:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),t("span",Po,i(e(Nt)),1)])):p("",!0)])]),t("div",Co,[t("button",{type:"button",onClick:gs,class:"inline-flex min-h-10 min-w-0 flex-1 items-center justify-center gap-2 rounded-lg bg-primary-600 px-3 py-2 text-sm font-semibold text-white shadow-sm transition-colors hover:bg-primary-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 lg:flex-none"},[f(e(Xt),{class:"h-4 w-4","aria-hidden":"true"}),t("span",$o,i(e(a)("patientSummary.newVisit")),1)]),t("div",No,[e(ke)?(o(),d("div",{key:0,class:"fixed inset-0 z-40",onClick:Ss})):p("",!0),t("button",{ref_key:"actionsButton",ref:Zr,type:"button",class:"inline-flex min-h-10 w-full min-w-0 items-center justify-center gap-2 rounded-lg border border-neutral-200 bg-white px-3 py-2 text-sm font-semibold text-neutral-700 shadow-sm transition-colors hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 lg:w-auto","aria-expanded":e(ke),"aria-label":e(a)("patientSummary.patientActions"),onClick:_s},[t("span",Vo,i(e(a)("patientSummary.patientActions")),1),f(e(jr),{class:oe(["h-4 w-4 transition-transform",e(ke)?"rotate-180":""]),"aria-hidden":"true"},null,8,["class"])],8,Mo),e(ke)?(o(),d("div",Oo,[t("button",{type:"button",disabled:e(Te),class:"flex w-full min-w-0 items-center gap-2.5 px-3 py-2.5 text-left text-sm font-medium text-info-700 transition-colors hover:bg-info-50 disabled:cursor-not-allowed disabled:opacity-50",onClick:n[0]||(n[0]=s=>{$n(),ke.value=!1})},[f(e(Qe),{class:oe(["h-4 w-4",e(Te)?"animate-spin":""]),"aria-hidden":"true"},null,8,["class"]),t("span",Eo,i(e(Te)?e(a)("patientSummary.regenerating"):e(a)("patientSummary.regenerateSummary")),1)],8,Ao),t("button",{type:"button",class:"flex w-full min-w-0 items-center gap-2.5 px-3 py-2.5 text-left text-sm font-medium text-neutral-700 transition-colors hover:bg-neutral-50",onClick:n[1]||(n[1]=s=>{os(),ke.value=!1})},[f(e(Jt),{class:"h-4 w-4","aria-hidden":"true"}),t("span",jo,i(e(a)("patientSummary.editProfile")),1)]),t("button",{type:"button",class:"flex w-full min-w-0 items-center gap-2.5 px-3 py-2.5 text-left text-sm font-medium text-neutral-700 transition-colors hover:bg-neutral-50",onClick:n[2]||(n[2]=s=>{cs(),ke.value=!1})},[f(e(Js),{class:"h-4 w-4","aria-hidden":"true"}),t("span",Bo,i(e(a)("patientSummary.printExport")),1)]),t("button",{type:"button",class:"flex w-full min-w-0 items-center gap-2.5 border-t border-neutral-100 px-3 py-2.5 text-left text-sm font-medium text-error-700 transition-colors hover:bg-error-50",onClick:n[3]||(n[3]=s=>{xs(),ke.value=!1})},[f(e(ea),{class:"h-4 w-4","aria-hidden":"true"}),t("span",Ro,i(e(a)("patientSummary.deletePatient")),1)])])):p("",!0)])])])])],8,no),e(_e).length?(o(),d("section",Fo,[t("h2",Uo,i(e(a)("patientSummary.intakeResponses")),1),t("div",Lo,[(o(!0),d(z,null,q(e(_e),s=>(o(),d("div",{key:s.id,class:"rounded-lg border border-neutral-100"},[t("button",{type:"button",class:"w-full flex items-center justify-between gap-3 px-3 py-2 text-left text-sm hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500","aria-expanded":e(ze).has(s.id),onClick:c=>Gr(s.id)},[t("span",qo,[t("span",Ho,i(s.template_name||e(a)("patientSummary.intakeResponses")),1),s.status==="in_progress"?(o(),d("span",Go,i(e(a
2)("patientSummary.intakeInProgressBadge")),1)):p("",!0),s.version_number!=null?(o(),d("span",Ko," v"+i(s.version_number),1)):p("",!0),s.submitted_at?(o(),d("span",Wo," · "+i(e(a)("patientSummary.intakeSubmittedOn",{date:Kr(s.submitted_at)})),1)):p("",!0)]),t("span",{class:oe(["shrink-0 text-neutral-400 transition-transform",e(ze).has(s.id)?"rotate-90":""]),"aria-hidden":"true"},"â¶",2)],8,zo),e(ze).has(s.id)?(o(),d("div",Zo,[la(s).length===0?(o(),d("p",Yo,i(e(a)("patientSummary.intakeNoAnswers")),1)):(o(),d("div",Qo,[(o(!0),d(z,null,q(la(s),(c,y)=>(o(),d("div",{key:y,class:"py-2 first:pt-0"},[t("div",Xo,i(c.question),1),t("div",Jo,i(c.answer),1)]))),128))]))])):p("",!0)]))),128))])])):p("",!0),t("div",el,[t("div",tl,[t("div",al,[t("p",rl,i(e(a)("patientSummary.allergies")),1),f(e(fr),{class:"h-4 w-4 text-warning-500","aria-hidden":"true"})]),e(He)&&!e(S).length?(o(),d("div",nl)):(o(),d("p",sl,i(e(vn)||e(a)("patientSummary.noKnownAllergies")),1)),t("p",il,i(e(a)("patientSummary.clinicalSignal")),1)]),t("div",ol,[t("div",ll,[t("p",dl,i(e(a)("patientSummary.medications")),1),f(e(nr),{class:"h-4 w-4 text-neutral-400","aria-hidden":"true"})]),e(He)&&!e(I).length?(o(),d("div",ul)):(o(),d("p",cl,i(e(yn)||e(a)("patientSummary.noCurrentMedicationsShort")),1)),t("p",ml,i(e(a)("patientSummary.clinicalSignal")),1)]),t("div",pl,[t("div",fl,[t("p",yl,i(e(a)("patientSummary.lastVisit")),1),f(e(Br),{class:"h-4 w-4 text-neutral-400","aria-hidden":"true"})]),e(He)&&!e(va)?(o(),d("div",vl)):(o(),d("p",hl,i(e(cn)||e(mn)||e(a)("patientSummary.noVisitHistoryShort")),1)),t("p",gl,i(e(va)?.visit_type||e(a)("patientSummary.localVisitHistory",{brand:e(U)})),1)]),t("div",bl,[t("div",wl,[t("p",xl,i(e(a)("patientSummary.nextVisit")),1),f(e(ei),{class:"h-4 w-4 text-neutral-400","aria-hidden":"true"})]),t("p",_l,i(e(fn)||e(pn)||e(a)("patientSummary.noUpcomingVisitShort")),1),t("p",Sl,i(e(dt)?e($t):e(a)("patientSummary.localVisitHistory",{brand:e(U)})),1)])]),e(De)?(o(),d("div",kl,i(e(De)),1)):p("",!0),e(Vt)?(o(),d("div",Dl,[t("div",Tl,[f(e(Qe),{class:"mt-0.5 h-4 w-4 shrink-0 animate-spin","aria-hidden":"true"}),t("div",Il,[t("div",Pl,i(e(a)("patientSummary.processingMedicalRecords")),1),t("div",Cl,i(e(Ge)),1),t("div",$l,i(e(a)("patientSummary.progressMayBeLost")),1)])])])):p("",!0),t("div",Nl,[t("div",Ml,[t("section",{"aria-label":e(a)("patientSummary.filterAllPanels"),class:"rounded-xl border border-neutral-100 bg-white p-4"},[t("div",Ol,[t("div",Al,[t("h2",El,i(e(a)("patientSummary.filterAllPanels")),1),t("p",jl,i(e(xn)),1)]),t("div",Bl,[t("div",Rl,[(o(!0),d(z,null,q(e(an),s=>(o(),d("button",{key:s.id,type:"button",class:oe(["shrink-0 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",e(Se)===s.id?"bg-primary-600 text-white":"text-neutral-600 hover:bg-neutral-100"]),onClick:c=>rn(s.id)},i(s.label),11,Fl))),128))]),t("button",{type:"button",class:"inline-flex min-h-9 min-w-0 items-center justify-center gap-1.5 rounded-lg border border-neutral-200 bg-white px-2.5 py-1.5 text-xs font-medium text-neutral-700 transition-colors hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",disabled:e(Se)===0,title:e(a)("patientSummary.resetFiltersTitle"),onClick:Nn},[f(e(Qe),{class:"h-4 w-4","aria-hidden":"true"}),t("span",Ll,i(e(a)("patientSummary.resetAllFilters")),1)],8,Ul)])])],8,Vl),t("div",zl,[t("section",{"aria-label":e(a)("patientSummary.allergies"),class:"min-w-0 rounded-xl border border-neutral-100 bg-white p-4"},[t("header",Hl,[t("div",Gl,[t("h2",Kl,i(e(a)("patientSummary.allergies")),1),t("p",Wl,i(e(a)("patientSummary.mostImportantFirst")),1)]),t("div",Zl,[t("button",{type:"button",class:"inline-flex min-h-9 min-w-0 items-center justify-center gap-1.5 rounded-lg border border-neutral-200 px-2.5 py-1.5 text-xs font-medium text-neutral-700 transition-colors hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",onClick:Kn},[f(e(Xt),{class:"h-4 w-4","aria-hidden":"true"}),t("span",Yl,i(e(a)("patientSummary.add")),1)]),e(ga)>1?(o(),d("div",Ql,[t("button",{type:"button",disabled:e(Ve)===0,"aria-label":e(a)("patientSummary.previousPage"),class:"inline-flex h-9 w-9 items-center justify-center rounded-lg text-warning-700 transition-colors hover:bg-warning-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-warning-500 disabled:cursor-not-allowed disabled:opacity-40",onClick:An},[f(e(ta),{class:"h-4 w-4","aria-hidden":"true"})],8,Xl),t("span",Jl,i(e(Ve)+1)+"/"+i(e(ga)),1),t("button",{type:"button",disabled:e(Ve)+1>=e(ga),"aria-label":e(a)("patientSummary.nextPage"),class:"inline-flex h-9 w-9 items-center justify-center rounded-lg text-warning-700 transition-colors hover:bg-warning-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-warning-500 disabled:cursor-not-allowed disabled:opacity-40",onClick:On},[f(e(wt),{class:"h-4 w-4","aria-hidden":"true"})],8,ed)])):p("",!0)])]),t("div",null,[(e(Te)||e(He))&&e(S).length===0?(o(),d("div",td,[(o(),d(z,null,q(2,s=>t("div",{key:`allergy-skeleton-${s}`,class:"animate-pulse rounded-lg border border-neutral-100 bg-neutral-50 p-2.5"},[...n[51]||(n[51]=[t("div",{class:"h-4 w-2/3 rounded bg-neutral-200"},null,-1),t("div",{class:"mt-3 h-3 w-full rounded bg-neutral-100"}
2,null,-1),t("div",{class:"mt-2 h-3 w-1/2 rounded bg-neutral-100"},null,-1)])])),64))])):e(S).length===0?(o(),ee(e(N),{key:1,icon:e(fr),title:e(a)("patientSummary.noKnownAllergies"),description:e(a)("patientSummary.noKnownAllergiesDescription",{brand:e(U)})},null,8,["icon","title","description"])):e(_a).length===0?(o(),ee(e(N),{key:2,icon:e(aa),title:e(a)("patientSummary.noAllergiesMatch"),description:e(a)("patientSummary.adjustTimeRange")},null,8,["icon","title","description"])):(o(),d("div",ad,[(o(!0),d(z,null,q(e(gn),s=>(o(),d("article",{key:s.id,class:oe(["group min-w-0 rounded-lg border p-2.5 shadow-sm shadow-neutral-900/[0.02] transition-colors",Vs(s.type)])},[t("div",rd,[t("span",{class:oe(["flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-white shadow-sm shadow-neutral-900/5",Os(s.type)])},[f(e(Rr),{class:"h-4 w-4","aria-hidden":"true"})],2),t("div",nd,[t("div",sd,[t("h3",id,i(s.title),1)]),s.description?(o(),d("p",od,i(s.description),1)):p("",!0),t("div",ld,[s.displayDate||s.recordedDate||s.onsetDateTime?(o(),d("span",dd,i(ne(s.displayDate||s.recordedDate||s.onsetDateTime)),1)):p("",!0),s.modifiedDate?(o(),d("span",ud,i(e(a)("patientSummary.modified"))+" "+i(ne(s.modifiedDate)),1)):p("",!0)])]),t("div",cd,[t("button",{type:"button",class:"inline-flex h-8 w-8 items-center justify-center rounded-lg text-neutral-500 transition-colors hover:bg-primary-50 hover:text-primary-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",title:e(a)("patientSummary.editAllergyTitle"),"aria-label":e(a)("patientSummary.editAllergyTitle"),onClick:se(c=>Wn(s),["stop"])},[f(e(Jt),{class:"h-4 w-4","aria-hidden":"true"})],8,md),t("button",{type:"button",class:"inline-flex h-8 w-8 items-center justify-center rounded-lg text-neutral-500 transition-colors hover:bg-error-50 hover:text-error-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-error-500",title:e(a)("patientSummary.deleteAllergyTitle"),"aria-label":e(a)("patientSummary.deleteAllergyTitle"),onClick:se(c=>Yn(s),["stop"])},[f(e(ea),{class:"h-4 w-4","aria-hidden":"true"})],8,pd)])])],2))),128))]))])],8,ql),t("section",{"aria-label":e(a)("patientSummary.medications"),class:"min-w-0 rounded-xl border border-neutral-100 bg-white p-4"},[t("header",yd,[t("div",vd,[t("h2",hd,i(e(a)("patientSummary.medications")),1),t("p",gd,i(e(a)("patientSummary.currentMedicationList")),1)]),t("div",bd,[t("button",{type:"button",class:"inline-flex min-h-9 min-w-0 items-center justify-center gap-1.5 rounded-lg border border-neutral-200 px-2.5 py-1.5 text-xs font-medium text-neutral-700 transition-colors hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",onClick:Xn},[f(e(Xt),{class:"h-4 w-4","aria-hidden":"true"}),t("span",wd,i(e(a)("patientSummary.add")),1)]),e(ha)>1?(o(),d("div",xd,[t("button",{type:"button",disabled:e(Me)===0,"aria-label":e(a)("patientSummary.previousPage"),class:"inline-flex h-9 w-9 items-center justify-center rounded-lg text-neutral-600 transition-colors hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 disabled:cursor-not-allowed disabled:opacity-40",onClick:Vn},[f(e(ta),{class:"h-4 w-4","aria-hidden":"true"})],8,_d),t("span",Sd,i(e(Me)+1)+"/"+i(e(ha)),1),t("button",{type:"button",disabled:e(Me)+1>=e(ha),"aria-label":e(a)("patientSummary.nextPage"),class:"inline-flex h-9 w-9 items-center justify-center rounded-lg text-neutral-600 transition-colors hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 disabled:cursor-not-allowed disabled:opacity-40",onClick:Mn},[f(e(wt),{class:"h-4 w-4","aria-hidden":"true"})],8,kd)])):p("",!0)])]),t("div",null,[(e(Te)||e(He))&&e(I).length===0?(o(),d("div",Dd,[(o(),d(z,null,q(2,s=>t("div",{key:`medication-skeleton-${s}`,class:"animate-pulse rounded-lg border border-neutral-100 bg-neutral-50 p-2.5"}
2,[...n[52]||(n[52]=[t("div",{class:"h-4 w-1/2 rounded bg-neutral-200"},null,-1),t("div",{class:"mt-3 h-3 w-2/3 rounded bg-neutral-100"},null,-1)])])),64))])):e(I).length===0?(o(),ee(e(N),{key:1,icon:e(nr),title:e(a)("patientSummary.noCurrentMedicationsShort"),description:e(a)("patientSummary.noCurrentMedicationsDescription")},null,8,["icon","title","description"])):e(xa).length===0?(o(),ee(e(N),{key:2,icon:e(aa),title:e(a)("patientSummary.noMedicationsMatch"),description:e(a)("patientSummary.adjustTimeRange")},null,8,["icon","title","description"])):(o(),d("div",Td,[(o(!0),d(z,null,q(e(hn),s=>(o(),d("article",{key:s.id,class:"group min-w-0 rounded-lg border border-neutral-100 bg-neutral-50/70 p-2.5 shadow-sm shadow-neutral-900/[0.02] transition-colors hover:border-neutral-200 hover:bg-white"},[t("div",Id,[t("span",Pd,i(e(a)("patientSummary.rx")),1),t("button",{type:"button",class:"min-w-0 rounded-lg text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2",onClick:c=>Vr(s,"medication")},[t("span",$d,[t("span",Nd,i(s.name),1),s.dosage?(o(),d("span",Md,i(s.dosage),1)):p("",!0)]),t("span",Vd,[s.displayDate?(o(),d("span",Od,i(e(a)("patientSummary.started"))+": "+i(ne(s.displayDate)),1)):p("",!0),s.effectivePeriod?.end?(o(),d("span",Ad,i(e(a)("patientSummary.ended"))+": "+i(ne(s.effectivePeriod.end)),1)):p("",!0),s.modifiedDate?(o(),d("span",Ed,i(e(a)("patientSummary.modified"))+" "+i(ne(s.modifiedDate)),1)):p("",!0),s.next_refill?(o(),d("span",jd,i(e(a)("patientSummary.nextRefill"))+": "+i(ne(s.next_refill)),1)):p("",!0)])],8,Cd),t("div",Bd,[t("button",{type:"button",class:"inline-flex h-8 w-8 items-center justify-center rounded-lg text-neutral-500 transition-colors hover:bg-primary-50 hover:text-primary-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",title:e(a)("patientSummary.editMedicationTitle"),"aria-label":e(a)("patientSummary.editMedicationTitle"),onClick:se(c=>Jn(s),["stop"])},[f(e(Jt),{class:"h-4 w-4","aria-hidden":"true"})],8,Rd),t("button",{type:"button",class:"inline-flex h-8 w-8 items-center justify-center rounded-lg text-neutral-500 transition-colors hover:bg-error-50 hover:text-error-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-error-500",title:e(a)("patientSummary.deleteMedicationTitle"),"aria-label":e(a)("patientSummary.deleteMedicationTitle"),onClick:se(c=>ts(s),["stop"])},[f(e(ea),{class:"h-4 w-4","aria-hidden":"true"})],8,Fd)])])]))),128))]))])],8,fd)]),t("section",{"aria-label":e(a)("patientSummary.diagnoses"),class:"min-w-0 rounded-xl border border-neutral-100 bg-white p-4"},[t("header",Ld,[t("div",zd,[t("h2",qd,i(e(a)("patientSummary.diagnoses")),1),t("p",Hd,i(e(a)("patientSummary.activeDiagnoses")),1)]),t("div",Gd,[t("button",{type:"button",class:"inline-flex min-h-9 min-w-0 items-center justify-center gap-1.5 rounded-lg border border-neutral-200 px-2.5 py-1.5 text-xs font-medium text-neutral-700 transition-colors hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",onClick:Ln},[f(e(Xt),{class:"h-4 w-4","aria-hidden":"true"}),t("span",Kd,i(e(a)("patientSummary.add")),1)]),e(ka)>1?(o(),d("div",Wd,[t("button",{type:"button",disabled:e(Ae)===0,"aria-label":e(a)("patientSummary.previousPage"),class:"inline-flex h-9 w-9 items-center justify-center rounded-lg text-neutral-600 transition-colors hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 disabled:cursor-not-allowed disabled:opacity-40",onClick:Un},[f(e(ta),{class:"h-4 w-4","aria-hidden":"true"})],8,Zd),t("span",Yd,i(e(Ae)+1)+"/"+i(e(ka)),1),t("button",{type:"button",disabled:e(Ae)+1>=e(ka),"aria-label":e(a)("patientSummary.nextPage"),class:"inline-flex h-9 w-9 items-center justify-center rounded-lg text-neutral-600 transition-colors hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 disabled:cursor-not-allowed disabled:opacity-40",onClick:Fn},[f(e(wt),{class:"h-4 w-4","aria-hidden":"true"})],8,Qd)])):p("",!0)])]),t("div",null,[(e(Te)||e(He))&&e(T).length===0?(o(),d("div",Xd,[(o(),d(z,null,q(4,s=>t("div",{key:`diagnosis-skeleton-${s}`,class:"animate-pulse rounded-lg border border-neutral-100 bg-neutral-50 p-2.5"},[...n[53]||(n[53]=[t("div",{class:"h-4 w-2/3 rounded bg-neutral-200"}
2,null,-1),t("div",{class:"mt-3 h-3 w-1/2 rounded bg-neutral-100"},null,-1)])])),64))])):e(T).length===0?(o(),ee(e(N),{key:1,icon:e(sr),title:e(a)("patientSummary.noDiagnoses"),description:e(a)("patientSummary.noDiagnosesDescription")},null,8,["icon","title","description"])):e(wa).length===0?(o(),ee(e(N),{key:2,icon:e(aa),title:e(a)("patientSummary.noDiagnosesMatch"),description:e(a)("patientSummary.adjustTimeRange")},null,8,["icon","title","description"])):(o(),d("div",Jd,[(o(!0),d(z,null,q(e(wn),s=>(o(),d("article",{key:s.id,class:"group min-w-0 rounded-lg border border-neutral-100 bg-neutral-50/70 p-2.5 shadow-sm shadow-neutral-900/[0.02] transition-colors hover:border-neutral-200 hover:bg-white"},[t("div",eu,[t("span",tu,[f(e(sr),{class:"h-4 w-4","aria-hidden":"true"})]),t("button",{type:"button",class:"min-w-0 rounded-lg text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2",onClick:c=>Vr(s)},[t("span",ru,i(s.condition),1),t("span",nu,[s.displayDate?(o(),d("span",su,i(ne(s.displayDate)),1)):p("",!0),s.modifiedDate?(o(),d("span",iu,i(e(a)("patientSummary.modified"))+" "+i(ne(s.modifiedDate)),1)):p("",!0)])],8,au),t("div",ou,[t("button",{type:"button",class:"inline-flex h-8 w-8 items-center justify-center rounded-lg text-neutral-500 transition-colors hover:bg-primary-50 hover:text-primary-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",title:e(a)("patientSummary.editDiagnosisTitle"),"aria-label":e(a)("patientSummary.editDiagnosisTitle"),onClick:se(c=>zn(s),["stop"])},[f(e(Jt),{class:"h-4 w-4","aria-hidden":"true"})],8,lu),t("button",{type:"button",class:"inline-flex h-8 w-8 items-center justify-center rounded-lg text-neutral-500 transition-colors hover:bg-error-50 hover:text-error-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-error-500",title:e(a)("patientSummary.deleteDiagnosisTitle"),"aria-label":e(a)("patientSummary.deleteDiagnosisTitle"),onClick:se(c=>Hn(s),["stop"])},[f(e(ea),{class:"h-4 w-4","aria-hidden":"true"})],8,du)])])]))),128))]))])],8,Ud),t("section",{"aria-label":e(a)("patientSummary.visits"),class:"min-w-0 rounded-xl border border-neutral-100 bg-white p-4"},[t("header",cu,[t("div",mu,[t("h2",pu,i(e(a)("patientSummary.visits")),1),t("p",fu,i(e(a)("patientSummary.recentVisits")),1)]),e(ba)>1?(o(),d("div",yu,[t("button",{type:"button",disabled:e(Oe)===0||e(xe),"aria-label":e(a)("patientSummary.previousPage"),class:"inline-flex h-9 w-9 items-center justify-center rounded-lg text-neutral-600 transition-colors hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 disabled:cursor-not-allowed disabled:opacity-40",onClick:jn},[f(e(ta),{class:"h-4 w-4","aria-hidden":"true"})],8,vu),t("span",hu,i(e(Oe)+1)+"/"+i(e(ba)),1),t("button",{type:"button",disabled:e(Oe)+1>=e(ba)||e(xe),"aria-label":e(a)("patientSummary.nextPage"),class:"inline-flex h-9 w-9 items-center justify-center rounded-lg text-neutral-600 transition-colors hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 disabled:cursor-not-allowed disabled:opacity-40",onClick:En},[f(e(wt),{class:"h-4 w-4","aria-hidden":"true"})],8,gu)])):p("",!0)]),t("div",null,[e(xe)?(o(),d("div",bu,[(o(),d(z,null,q(3,s=>t("div",{key:`visit-skeleton-${s}`,class:"animate-pulse rounded-lg border border-neutral-100 bg-neutral-50 p-2.5"},[...n[54]||(n[54]=[t("div",{class:"h-4 w-1/3 rounded bg-neutral-200"},null,-1),t("div",{class:"mt-3 h-3 w-1/2 rounded bg-neutral-100"},null,-1)])])),64))])):e(Ba).length===0&&e(L).length===0?(o(),ee(e(N),{key:1,icon:e(Br),title:e(a)("patientSummary.noRecentVisits"),description:e(a
2)("patientSummary.noRecentVisitsDescription")},null,8,["icon","title","description"])):e(Ba).length===0?(o(),ee(e(N),{key:2,icon:e(aa),title:e(a)("patientSummary.noVisitsMatch"),description:e(a)("patientSummary.adjustTimeRange")},null,8,["icon","title","description"])):(o(),d("div",wu,[(o(!0),d(z,null,q(e(Ba),s=>(o(),d("button",{key:s.id||s.visit_date,type:"button",class:"-mx-2 flex w-full flex-col gap-2 rounded-lg px-2 py-2.5 text-left transition-colors hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 sm:flex-row sm:items-start sm:gap-2.5",onClick:se(c=>bs(s,c),["stop"])},[t("span",{class:oe(["w-fit shrink-0 rounded-lg px-2.5 py-1 text-xs font-semibold",s.isPerioChart?"bg-success-50 text-success-700":"bg-primary-50 text-primary-700"])},i(ne(s.visit_date)),3),t("span",_u,[t("span",Su,[t("span",ku,i(s.visit_type||e(a)("patientSummary.generalVisit")),1),s.status?(o(),d("span",Du,i(s.status),1)):p("",!0)]),s.isPerioChart?(o(),d("span",Tu,[s.averagePocketDepth?(o(),d("span",Iu,i(e(a)("patientSummary.averagePocketDepthShort"))+": "+i(Number(s.averagePocketDepth).toFixed(1))+"mm",1)):p("",!0),s.maxPocketDepth?(o(),d("span",Pu,i(e(a)("patientSummary.maxPocketDepthShort"))+": "+i(s.maxPocketDepth)+"mm",1)):p("",!0),s.hasBleeding?(o(),d("span",Cu,i(e(a)("patientSummary.bleeding")),1)):p("",!0),s.hasSuppuration?(o(),d("span",$u,i(e(a)("patientSummary.suppuration")),1)):p("",!0),s.hasMobility?(o(),d("span",Nu,i(e(a)("patientSummary.mobility")),1)):p("",!0),s.hasFurcation?(o(),d("span",Mu,i(e(a)("patientSummary.furcation")),1)):p("",!0)])):p("",!0)]),f(e(wt),{class:"mt-1 hidden h-4 w-4 shrink-0 text-neutral-400 sm:block","aria-hidden":"true"})],8,xu))),128))]))])],8,uu)]),t("aside",Vu,[e(ia).length?(o(),d("section",{key:0,"aria-label":e(a)("patientSummary.contact"),class:"min-w-0 rounded-xl border border-neutral-100 bg-white p-4"},[t("header",Au,[t("div",Eu,[t("h2",ju,i(e(a)("patientSummary.contact")),1),t("p",Bu,i(e($t)),1)]),t("span",Ru,i(e(a)("patientSummary.readOnly")),1)]),t("dl",Fu,[(o(!0),d(z,null,q(e(ia),s=>(o(),d("div",{key:s.label,class:"min-w-0 py-2.5"},[t("dt",Uu,i(s.label),1),t("dd",Lu,[s.href?(o(),d("a",{key:0,href:s.href,class:"rounded-sm break-words hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 [overflow-wrap:anywhere]"},i(s.value),9,zu)):(o(),d("span",qu,i(s.value),1))])]))),128))])],8,Ou)):p("",!0),e(oa).length?(o(),d("section",{key:1,"aria-label":e(a)("patientSummary.careTeamAndVisits"),class:"min-w-0 rounded-xl border border-neutral-100 bg-white p-4"},[t("header",Gu,[t("div",Ku,[t("h2",Wu,i(e(a)("patientSummary.careTeamAndVisits")),1),t("p",Zu,i(e($t)),1)]),t("span",Yu,i(e(a)("patientSummary.readOnly")),1)]),t("dl",Qu,[(o(!0),d(z,null,q(e(oa),s=>(o(),d("div",{key:s.label,class:"min-w-0 py-2.5"},[t("dt",Xu,i(s.label),1),t("dd",Ju,i(s.value),1)]))),128))])],8,Hu)):p("",!0),t("section",{"aria-label":e(a)("patientSummary.patientInformation"),class:"min-w-0 rounded-xl border border-neutral-100 bg-white p-4"},[t("header",tc,[t("div",ac,[t("div",rc,[t("h2",nc,i(e(a)("patientSummary.patientInformation")),1),t("p",sc,i(e(a)("patientSummary.localClaioFields",{brand:e(U)})),1)]),t("div",ic,[t("button",{type:"button",class:"inline-flex min-h-9 min-w-0 items-center justify-center gap-1.5 rounded-lg border border-neutral-200 px-2.5 py-1.5 text-xs font-medium text-neutral-700 transition-colors hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",onClick:rs},[f(e(Xt),{class:"h-4 w-4","aria-hidden":"true"}),t("span",oc,i(e(a)("patientSummary.add")),1)]),e(Ra)>1?(o(),d("div",lc,[t("button",{type:"button",disabled:e(qe)===0,"aria-label":e(a)("patientSummary.previousPage"),class:"inline-flex h-9 w-9 items-center justify-center rounded-lg text-neutral-600 transition-colors hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 disabled:cursor-not-allowed disabled:opacity-40",onClick:Rn},[f(e(ta),{class:"h-4 w-4","aria-hidden":"true"})],8,dc),t("button",{type:"button",disabled:e(qe)+1>=e(Ra),"aria-label":e(a)("patientSummary.nextPage"),class:"inline-flex h-9 w-9 items-center justify-center rounded-lg text-neutral-600 transition-colors hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 disabled:cursor-not-allowed disabled:opacity-40",onClick:Bn},[f(e(wt),{class:"h-4 w-4","aria-hidden":"true"})],8,uc)])):p("",!0)])])]),t("div",null,[(e(Te)||e(He))&&e(O).length===0?(o(),d("div",cc,[(o(),d(z,null,q(3,s=>t("div",{key:`personal-skeleton-${s}`,class:"animate-pulse rounded-lg border border-neutral-100 bg-neutral-50 p-2.5"},[...n[55]||(n[55]=[t("div",{class:"h-4 w-3/4 rounded bg-neutral-200"}
2,null,-1),t("div",{class:"mt-3 h-3 w-1/2 rounded bg-neutral-100"},null,-1)])])),64))])):e(O).length===0?(o(),ee(e(N),{key:1,icon:e(ir),title:e(a)("patientSummary.noPersonalInfo"),description:e(a)("patientSummary.noPersonalInfoDescription")},null,8,["icon","title","description"])):e(Sa).length===0?(o(),ee(e(N),{key:2,icon:e(aa),title:e(a)("patientSummary.noPersonalInfoMatch"),description:e(a)("patientSummary.adjustTimeRange")},null,8,["icon","title","description"])):(o(),d("div",mc,[(o(!0),d(z,null,q(e(bn),s=>(o(),d("article",{key:s.id||`${s.details}-${s.recordedDate}`,class:"group min-w-0 rounded-lg border border-neutral-100 bg-neutral-50/70 p-2.5 shadow-sm shadow-neutral-900/[0.02] transition-colors hover:border-neutral-200 hover:bg-white"},[t("div",pc,[t("div",fc,[t("div",yc,[t("span",{class:oe(["inline-flex max-w-full items-center break-words rounded-full px-2 py-0.5 text-xs font-medium capitalize [overflow-wrap:anywhere]",Es(s.category)])},i(s.category),3),s.type?(o(),d("span",vc,i(s.type),1)):p("",!0)]),t("p",hc,i(s.details),1),s.context?(o(),d("p",gc,i(s.context),1)):p("",!0),t("div",bc,[s.modifiedDate?(o(),d("span",wc,i(e(a)("patientSummary.modified"))+" "+i(ne(s.modifiedDate)),1)):s.displayDate?(o(),d("span",xc,i(ne(s.displayDate)),1)):p("",!0)])]),t("div",_c,[t("button",{type:"button",class:"inline-flex h-8 w-8 items-center justify-center rounded-lg text-neutral-500 transition-colors hover:bg-primary-50 hover:text-primary-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",title:e(a)("patientSummary.editPersonalInfoTitle"),"aria-label":e(a)("patientSummary.editPersonalInfoTitle"),onClick:se(c=>ns(s),["stop"])},[f(e(Jt),{class:"h-4 w-4","aria-hidden":"true"})],8,Sc),t("button",{type:"button",class:"inline-flex h-8 w-8 items-center justify-center rounded-lg text-neutral-500 transition-colors hover:bg-error-50 hover:text-error-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-error-500",title:e(a)("patientSummary.deletePersonalInfoTitle"),"aria-label":e(a)("patientSummary.deletePersonalInfoTitle"),onClick:se(c=>ss(s),["stop"])},[f(e(ea),{class:"h-4 w-4","aria-hidden":"true"})],8,kc)])])]))),128))]))])],8,ec)])]),e(vt)?(o(),d("section",{key:3,"aria-label":e(a)("patientSummary.eligibilityTitle"),class:"min-w-0 rounded-xl border border-neutral-100 bg-white p-4"},[e(Xr)?(o(),d("div",Tc,[n[56]||(n[56]=t("svg",{class:"mt-0.5 h-4 w-4 shrink-0 text-warning-600",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[t("path",{"fill-rule":"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z","clip-rule":"evenodd"})],-1)),t("div",Ic,[t("p",Pc,i(e(a)("patientSummary.eligibilityTestModeTitle")),1),t("p",Cc,i(e(a)("patientSummary.eligibilityTestModeBody")),1)])])):p("",!0),t("header",$c,[t("div",Nc,[t("h2",Mc,i(e(a)("patientSummary.eligibilityTitle")),1),t("p",Vc,i(e(a)("patientSummary.eligibilitySubtitle")),1),t("p",Oc,i(e(a)("patientSummary.eligibilityUsOnly")),1)]),t("div",Ac,[t("span",{class:oe(["inline-flex min-w-0 items-center break-words rounded-full px-2.5 py-1 text-xs font-semibold [overflow-wrap:anywhere]",e(un)])}
2,[e(ua)?(o(),d("span",Ec,i(e(a)("patientSummary.loadingPolicies")),1)):(o(),d("span",jc,i(e(br)),1))],2),t("button",{type:"button",class:"inline-flex min-h-9 min-w-0 flex-1 items-center justify-center gap-1.5 rounded-lg border border-neutral-200 bg-white px-2.5 py-1.5 text-xs font-medium text-neutral-700 transition-colors hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 sm:flex-none",onClick:n[4]||(n[4]=s=>Bt.value=!e(Bt))},[t("span",Bc,i(e(Bt)?e(a)("patientSummary.hideEligibilityForm"):e(a)("patientSummary.showEligibilityForm")),1),f(e(jr),{class:oe(["h-4 w-4 transition-transform",e(Bt)?"rotate-180":""]),"aria-hidden":"true"},null,8,["class"])])])]),e(Bt)?(o(),d("div",Rc,[e(Ie)?(o(),d("div",Fc,i(e(Ie)),1)):p("",!0),t("div",Uc,[f(xt,{modelValue:e(ae),"onUpdate:modelValue":[n[5]||(n[5]=s=>Er(ae)?ae.value=s:null),kn],label:e(a)("patientSummary.savedPolicy"),options:e(nn),placeholder:e(a)("patientSummary.newPolicy")},null,8,["modelValue","label","options","placeholder"]),e(tt)?(o(),d("div",Jc,[t("label",em,i(e(a)("patientSummary.payerStediId")),1),B(t("input",{"onUpdate:modelValue":n[8]||(n[8]=s=>e(x).payerStediId=s),type:"text",placeholder:e(a)("patientSummary.payerStediIdPlaceholder"),class:"w-full rounded-lg border border-neutral-200 px-3 py-2.5 text-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500"},null,8,tm),[[F,e(x).payerStediId]]),t("button",{type:"button",class:"mt-2 break-words text-left text-sm font-medium text-primary-700 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 [overflow-wrap:anywhere]",onClick:Dr},i(e(a)("patientSummary.usePayerSearch")),1)])):(o(),d("div",Lc,[t("label",zc,i(e(a)("patientSummary.payerName")),1),t("div",qc,[f(e(qr),{class:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-400","aria-hidden":"true"}),B(t("input",{"onUpdate:modelValue":n[6]||(n[6]=s=>Er(Ee)?Ee.value=s:null),type:"text",placeholder:e(a)("patientSummary.searchInsurance"),class:"w-full rounded-lg border border-neutral-200 py-2.5 pl-9 pr-9 text-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500",autocomplete:"off",role:"combobox","aria-expanded":e(ue),"aria-autocomplete":"list","aria-activedescendant":e(ce)>=0?`payer-option-${e(ce)}`:"",onInput:Tn,onKeydown:In,onBlur:Pn,onFocus:n[7]||(n[7]=s=>e(Ee).length>=2&&e(je).length>0&&(ue.value=!0))},null,40,Hc),[[F,e(Ee)]]),e(ca)?(o(),ee(e(Qe),{key:0,class:"absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 animate-spin text-neutral-400","aria-hidden":"true"})):p("",!0)]),e(ue)?(o(),d("ul",Gc,[(o(!0),d(z,null,q(e(je),(s,c)=>(o(),d("li",{id:`payer-option-${c}`,key:s.stediId,role:"option","aria-selected":c===e(ce),class:oe(["min-w-0 cursor-pointer px-3 py-2.5 text-sm transition-colors",c===e(ce)?"bg-primary-50 text-primary-900":"text-neutral-700 hover:bg-neutral-50"]),onMousedown:se(y=>kr(s),["prevent"])},[t("span",Wc,i(s.displayName),1),s.stediId?(o(),d("span",Zc,i(s.stediId),1)):p("",!0),s.coverageTypes?.length?(o(),d("span",Yc,i(s.coverageTypes.join(", ")),1)):p("",!0)],42,Kc))),128))])):p("",!0),e(x).payerStediId&&!e(ue)&&!e(ca)&&e(Ee)===e(x).payerName?(o(),d("div",Qc,[f(e(ti),{class:"h-3.5 w-3.5","aria-hidden":"true"}),t("span",Xc,i(e(x).payerName)+" ("+i(e(x).payerStediId)+")",1)])):p("",!0),t("button",{type:"button",class:"mt-2 break-words text-left text-sm font-medium text-primary-700 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 [overflow-wrap:anywhere]",onClick:Dr},i(e(a)("patientSummary.enterPayerManually")),1)])),t("div",am,[t("label",rm,i(e(a)("patientSummary.memberId")),1),B(t("input",{"onUpdate:modelValue":n[9]||(n[9]=s=>e(x).memberId=s),type:"text",placeholder:e(a)("patientSummary.memberIdPlaceholder"),class:"w-full rounded-lg border border-neutral-200 px-3 py-2.5 text-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500"},null,8,nm),[[F,e(x).memberId]])])]),t("div",sm,[t("p",im,i(e(a)("patientSummary.subscriberLabel")),1),t("div",om,[t("div",lm,[t("label",dm,i(e(a)("patientSummary.subscriberFirstName")),1),B(t("input",{"onUpdate:modelValue":n[10]||(n[10]=s=>e(x).subscriberFirstName=s),type:"text",placeholder:e(a)("patientSummary.subscriberFirstNamePlaceholder"),class:"w-full rounded-lg border border-neutral-200 px-3 py-2.5 text-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500"},null,8,um),[[F,e(x).subscriberFirstName]])]),t("div",cm,[t("label",mm,i(e(a)("patientSummary.subscriberLastName")),1),B(t("input",{"onUpdate:modelValue":n[11]||(n[11]=s=>e(x).subscriberLastName=s),type:"text",placeholder:e(a)("patientSummary.subscriberLastNamePlaceholder"),class:"w-full rounded-lg border border-neutral-200 px-3 py-2.5 text-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500"},null,8,pm),[[F,e(x).subscriberLastName]])]),t("div",fm,[t("label",ym,i(e(a)("patientSummary.subscriberDob")),1),f(l,{modelValue:e(x).subscriberDateOfBirth,"onUpdate:modelValue":n[12]||(n[12]=s=>e(x).subscriberDateOfBirth=s)},null,8,["modelValue"])])])]),t("div",null,[t("button",{type:"button",class:"inline-flex min-h-9 min-w-0 items-center gap-1.5 rounded-lg px-2 py-1.5 text-left text-sm font-medium text-neutral-600 transition-colors hover:bg-neutral-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",onClick:n[13]||(n[13]=s=>jt.value=!e(jt))},[f(e(wt),{class:oe(["h-4 w-4 transition-transform",e(jt)?"rotate-90":""]),"aria-hidden":"true"},null,8,["class"]),t("span",vm,i(e(jt)?e(a)("patientSummary.hideAdvancedOptions"):e(a)("patientSummary.advancedOptions")),1)]),e(jt)?(o(),d("div",hm,[e(en)?(o(),ee(xt,{key:0,modelValue:e(x).providerNpi,"onUpdate:modelValue":n[14]||(n[14]=s=>e(x).providerNpi=s),label:e(a)("patientSummary.providerNpi"),options:e(sn)},null,8,["modelValue","label","options"])):e(ja)?(o(),d("div",gm,[t("label",bm,i(e(a)("patientSummary.providerNpi")),1),t("input",{value:e(tn),type:"text",disabled:"",class:"w-full rounded-lg border border-neutral-200 bg-neutral-50 px-3 py-2.5 text-sm text-neutral-600"},null,8,wm)])):(o(),d("div",xm,[t("label",_m,i(e(a)("patientSummary.providerNpi")),1),B(t("input",{"onUpdate:modelValue":n[15]||(n[15]=s=>e(x).providerNpi=s),type:"text",maxlength:"10",inputmode:"numeric",pattern:"[0-9]*",placeholder:e(a)("patientSummary.providerNpiPlaceholder"),class:"w-full rounded-lg border border-neutral-200 px-3 py-2.5 text-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500"},null,8,Sm),[[F,e(x).providerNpi]])])),t("div",km,[t("label",Dm,i(e(a)("patientSummary.groupNumber")),1),B(t("input",{"onUpdate:modelValue":n[16]||(n[16]=s=>e(x).groupNumber=s),type:"text",placeholder:e(a)("patientSummary.groupNumberPlaceholder"),class:"w-full rounded-lg border border-neutral-200 px-3 py-2.5 text-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500"},null,8,Tm),[[F,e(x).groupNumber]])]),t("div",Im,[t("label",Pm,i(e(a)("patientSummary.serviceTypeCode")),1),B(t("input",{"onUpdate:modelValue":n[17]||(n[17]=s=>e(Ke).serviceTypeCode=s),type:"text",class:"w-full rounded-lg border border-neutral-200 px-3 py-2.5 text-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500"},null,512),[[F,e(Ke).serviceTypeCode]])])])):p("",!0)]),t("div",Cm,[t("div",$m,[t("label",Nm,i(e(a)("patientSummary.dateOfService")),1),f(l,{modelValue:e(Ke).dateOfService,"onUpdate:modelValue":n[18]||(n[18]=s=>e(Ke).dateOfService=s)},null,8,["modelValue"])]),t("div",Mm,[t("button",{type:"button",disabled:e(At)||!e(ya),class:"inline-flex min-h-10 min-w-0 items-center justify-center rounded-lg border border-neutral-200 bg-white px-4 py-2 text-sm font-medium text-neutral-700 transition-colors hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",onClick:Tr}
2,[t("span",Om,i(e(At)?e(a)("patientSummary.saving"):e(a)("patientSummary.savePolicy")),1)],8,Vm),t("button",{type:"button",disabled:e(Et)||!e(hr),class:"inline-flex min-h-10 min-w-0 items-center justify-center rounded-lg bg-primary-600 px-4 py-2 text-sm font-semibold text-white transition-colors hover:bg-primary-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",onClick:Cn},[t("span",Em,i(e(Et)?e(a)("patientSummary.checkingEligibility"):e(a)("patientSummary.verifyEligibility")),1)],8,Am)])]),e(re)?(o(),d("div",jm,[e(re).environment==="test"?(o(),d("div",Bm,[n[57]||(n[57]=t("svg",{class:"mt-0.5 h-4 w-4 shrink-0 text-warning-700",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[t("path",{"fill-rule":"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z","clip-rule":"evenodd"})],-1)),t("p",Rm,i(e(a)("patientSummary.eligibilityTestModeResult")),1)])):p("",!0),t("div",Fm,[t("span",Um,[R(i(e(a)("patientSummary.eligibilityStatus"))+": ",1),t("strong",Lm,i(e(br)),1)]),e(re).summary.payer?.name?(o(),d("span",zm,[R(i(e(a)("patientSummary.payer"))+": ",1),t("strong",qm,i(e(re).summary.payer.name),1)])):p("",!0),e(re).checkedAt?(o(),d("span",Hm,[R(i(e(a)("patientSummary.checkedAt"))+": ",1),t("strong",Gm,i(ne(e(re).checkedAt)),1)])):p("",!0)]),e(re).summary.errors?.length?(o(),d("div",Km,[t("p",Wm,i(e(a)("patientSummary.eligibilityErrors")),1),(o(!0),d(z,null,q(e(re).summary.errors,(s,c)=>(o(),d("p",{key:`eligibility-error-${c}`,class:"mt-1 break-words [overflow-wrap:anywhere]"},i(s.code||"ERR")+": "+i(s.description||e(a)("patientSummary.unknownError")),1))),128))])):p("",!0),t("div",null,[t("p",Zm,i(e(a)("patientSummary.coverageDetails")),1),e(re).summary.benefits?.length?(o(),d("div",Ym,[(o(!0),d(z,null,q(e(re).summary.benefits.slice(0,8),(s,c)=>(o(),d("div",{key:`benefit-${c}`,class:"min-w-0 rounded-lg border border-neutral-200 bg-white px-3 py-2 text-sm text-neutral-700"},[t("p",Qm,[t("strong",null,i(e(a)("patientSummary.benefitCode"))+":",1),R(" "+i(s.code||e(a)("patientSummary.notAvailable")),1)]),s.serviceTypeCodes?.length?(o(),d("p",Xm,[t("strong",null,i(e(a)("patientSummary.serviceTypeCodesLabel"))+":",1),R(" "+i(s.serviceTypeCodes.join(", ")),1)])):p("",!0),s.amount!==null?(o(),d("p",Jm,[t("strong",null,i(e(a)("patientSummary.amount"))+":",1),R(" "+i(s.amount),1)])):p("",!0),s.percentage!==null?(o(),d("p",ep,[t("strong",null,i(e(a)("patientSummary.percentage"))+":",1),R(" "+i(s.percentage)+"%",1)])):p("",!0),s.description?(o(),d("p",tp,[t("strong",null,i(e(a)("patientSummary.notes"))+":",1),R(" "+i(s.description),1)])):p("",!0)]))),128))])):(o(),d("p",ap,i(e(a)("patientSummary.noCoverageDetails")),1))])])):p("",!0)])):p("",!0)],8,Dc)):p("",!0)]),e(da)?(o(),d("div",rp,[t("div",np,[t("div",{class:"fixed inset-0",onClick:Za}),n[60]||(n[60]=t("span",{class:"hidden sm:inline-block sm:h-screen sm:align-middle"},"â",-1)),t("div",sp,[t("div",null,[n[58]||(n[58]=t("div",{class:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-primary-100"},[t("svg",{class:"h-6 w-6 text-primary-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})])],-1)),t("div",ip,[t("h3",op,i(e(a)("patientSummary.editPatientProfile")),1),t("p",lp,i(e(a)("patientSummary.updateBasicInfo",{name:e(Ce)})),1)])]),t("form",{onSubmit:se(hs,["prevent"]),class:"mt-6 space-y-4"},[t("div",null,[t("label",dp,i(e(a)("patientSummary.patientName")),1),B(t("input",{id:"patientName","onUpdate:modelValue":n[19]||(n[19]=s=>e(X).patientName=s),type:"text",required:"",placeholder:e(a)("patientSummary.enterPatientName"),class:"mt-1 block w-full rounded-md border-gray-300 text-sm shadow-sm focus:border-primary-500 focus:ring-primary-500",onInput:ys},null,40,up),[[F,e(X).patientName]]),t("p",cp,i(e(a)("patientSummary.changingNameWarning")),1)]),t("div",null,[t("label",mp,i(e(a
2)("patientSummary.dateOfBirth")),1),f(l,{modelValue:e(X).dateOfBirth,"onUpdate:modelValue":n[20]||(n[20]=s=>e(X).dateOfBirth=s)},null,8,["modelValue"])]),f(xt,{modelValue:e(X).gender,"onUpdate:modelValue":n[21]||(n[21]=s=>e(X).gender=s),label:e(a)("patientSummary.gender"),options:e(on),placeholder:e(a)("patientSummary.selectGender")},null,8,["modelValue","label","options","placeholder"]),t("div",null,[t("label",pp,i(e(a)("patientSummary.insuranceProvider")),1),B(t("input",{id:"insurance","onUpdate:modelValue":n[22]||(n[22]=s=>e(X).insuranceProvider=s),type:"text",placeholder:e(a)("patientSummary.enterInsurance"),class:"mt-1 block w-full rounded-md border-gray-300 text-sm shadow-sm focus:border-primary-500 focus:ring-primary-500"},null,8,fp),[[F,e(X).insuranceProvider]])]),t("div",yp,[t("button",{type:"submit",disabled:e(Ot),class:"inline-flex w-full justify-center rounded-md border border-transparent bg-primary-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 disabled:opacity-50 sm:col-start-2"},[e(Ot)?(o(),d("span",hp,[n[59]||(n[59]=t("svg",{class:"mr-2 h-4 w-4 animate-spin",viewBox:"0 0 24 24"},[t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4",fill:"none"}),t("path",{class:"opacity-75",fill:"currentColor",d:"m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),R(" "+i(e(a)("patientSummary.saving")),1)])):(o(),d("span",gp,i(e(a)("patientSummary.saveChanges")),1))],8,vp),t("button",{type:"button",onClick:Za,class:"mt-3 inline-flex w-full justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 sm:col-start-1 sm:mt-0"},i(e(a)("patientSummary.cancel")),1)])],32)])])])):p("",!0),e(Va)?(o(),d("div",bp,[t("div",wp,[t("div",{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",onClick:Qa}),n[63]||(n[63]=t("span",{class:"hidden sm:inline-block sm:h-screen sm:align-middle"},"â",-1)),t("div",xp,[t("div",null,[n[61]||(n[61]=t("div",{class:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-error-100"},[t("svg",{class:"h-6 w-6 text-error-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})])],-1)),t("div",_p,[t("h3",Sp,i(e(a)("patientSummary.deletePatientTitle")),1),t("div",kp,[t("p",Dp,i(e(a)("patientSummary.deletePatientConfirm",{name:e(Ce)})),1),e(L).length>0?(o(),d("div",Tp,[t("p",Ip,i(e(a)("patientSummary.thisWillAlsoDelete")),1),t("p",null,i(e(L).length)+" "+i(e(a)("patientSummary.visits")),1)])):p("",!0),e(kt)?(o(),d("div",Pp,i(e(kt)),1)):p("",!0)])])]),t("div",Cp,[t("button",{type:"button",onClick:ks,disabled:e(Rt),class:"inline-flex w-full justify-center rounded-md border border-transparent bg-error-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-error-700 focus:outline-none focus:ring-2 focus:ring-error-500 focus:ring-offset-2 disabled:opacity-50 sm:col-start-2"},[e(Rt)?(o(),d("span",Np,[n[62]||(n[62]=t("svg",{class:"mr-2 h-4 w-4 animate-spin",viewBox:"0 0 24 24"},[t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4",fill:"none"}),t("path",{class:"opacity-75",fill:"currentColor",d:"m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),R(" "+i(e(a)("patientSummary.deleting")),1)])):(o(),d("span",Mp,i(e(a)("patientSummary.deletePatient")),1))],8,$p),t("button",{type:"button",onClick:Qa,disabled:e(Rt),class:"mt-3 inline-flex w-full justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 sm:col-start-1 sm:mt-0"}
2,i(e(a)("patientSummary.cancel")),9,Vp)])])])])):p("",!0),(o(),ee(Gs,{to:"body"},[e(Tt)?(o(),d("div",Op,[t("div",Ap,[t("div",{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",onClick:$r}),n[69]||(n[69]=t("span",{class:"hidden sm:inline-block sm:h-screen sm:align-middle"},"â",-1)),t("div",Ep,[t("div",null,[n[64]||(n[64]=t("div",{class:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-primary-100"},[t("svg",{class:"h-6 w-6 text-primary-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})])],-1)),t("div",jp,[t("h3",Bp,i(e(a)("patientSummary.printExportTitle")),1),t("p",Rp,i(e(a)("patientSummary.printExportDescription",{name:e(Ce)})),1)])]),e(ge)?(o(),d("div",Fp,[t("div",Up,[n[65]||(n[65]=t("svg",{class:"h-4 w-4 animate-spin text-info-600",viewBox:"0 0 24 24"},[t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4",fill:"none"}),t("path",{class:"opacity-75",fill:"currentColor",d:"m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),t("div",Lp,[t("div",zp,i(e(Pe).status),1),e(Pe).total>0?(o(),d("div",qp,i(e(a)("patientSummary.processingVisit",{current:e(Pe).current,total:e(Pe).total})),1)):p("",!0)])])])):p("",!0),e(Ze)?(o(),d("div",Hp,i(e(Ze)),1)):p("",!0),e(ge)?p("",!0):(o(),d("div",Gp,[t("div",null,[t("label",Kp,i(e(a)("patientSummary.contentType")),1),t("div",Wp,[t("label",Zp,[B(t("input",{type:"radio","onUpdate:modelValue":n[23]||(n[23]=s=>e(E).contentType=s),value:"both",class:"h-4 w-4 text-primary-600 border-gray-300 focus:ring-primary-500"},null,512),[[ar,e(E).contentType]]),t("span",Yp,i(e(a)("patientSummary.contentBoth")),1)]),t("label",Qp,[B(t("input",{type:"radio","onUpdate:modelValue":n[24]||(n[24]=s=>e(E).contentType=s),value:"transcription",class:"h-4 w-4 text-primary-600 border-gray-300 focus:ring-primary-500"},null,512),[[ar,e(E).contentType]]),t("span",Xp,i(e(a)("patientSummary.contentTranscription")),1)]),t("label",Jp,[B(t("input",{type:"radio","onUpdate:modelValue":n[25]||(n[25]=s=>e(E).contentType=s),value:"notes",class:"h-4 w-4 text-primary-600 border-gray-300 focus:ring-primary-500"},null,512),[[ar,e(E).contentType]]),t("span",e0,i(e(a)("patientSummary.contentNotes")),1)])])]),f(xt,{modelValue:e(E).timeRange,"onUpdate:modelValue":n[26]||(n[26]=s=>e(E).timeRange=s),label:e(a)("patientSummary.timeRange"),options:e(dn)},null,8,["modelValue","label","options"]),e(E).timeRange==="custom"?(o(),d("div",t0,[t("div",null,[t("label",a0,i(e(a)("patientSummary.fromDate")),1),f(l,{modelValue:e(E).customStartDate,"onUpdate:modelValue":n[27]||(n[27]=s=>e(E).customStartDate=s)},null,8,["modelValue"])]),t("div",null,[t("label",r0,i(e(a)("patientSummary.toDate")),1),f(l,{modelValue:e(E).customEndDate,"onUpdate:modelValue":n[28]||(n[28]=s=>e(E).customEndDate=s)},null,8,["modelValue"])])])):p("",!0),e(gt).length>0?(o(),d("div",n0,[t("div",s0,[t("span",i0,i(e(a)("patientSummary.selectVisits")),1),t("div",o0,[t("button",{type:"button",onClick:ls,class:"break-words text-left text-xs font-medium text-primary-600 hover:text-primary-700 [overflow-wrap:anywhere]"},i(e(a)("patientSummary.selectAll")),1),n[66]||(n[66]=t("span",{class:"text-gray-300"},"|",-1)),t("button",{type:"button",onClick:ds,class:"break-words text-left text-xs font-medium text-primary-600 hover:text-primary-700 [overflow-wrap:anywhere]"},i(e(a)("patientSummary.deselectAll")),1)])]),t("div",l0,[(o(!0),d(z,null,q(e(gt),s=>(o(),d("label",{key:s.id,class:"flex min-w-0 cursor-pointer items-center gap-3 px-3 py-2 hover:bg-neutral-50"},[t("input",{type:"checkbox",checked:e(Be).has(s.id),onChange:c=>us(s.id),class:"h-4 w-4 shrink-0 rounded border-gray-300 text-primary-600 focus:ring-primary-500"},null,40,d0),t("div",u0,[t("p",c0,i(s.visit_type||e(a)("patientSummary.untitledVisit")),1),t("p",m0,i(s.visit_date?ne(s.visit_date):""),1)])]))),128))])])):p("",!0),t("div",p0,[t("p",f0,i(e(a)("patientSummary.visitsSelected",{selected:e(Da).length,total:e(gt).length})),1)])])),t("div",y0,[t("div",v0,[t("button",{type:"button",onClick:ps,disabled:e(ge)||e(Da).length===0,class:"inline-flex min-w-0 items-center justify-center rounded-md border border-transparent bg-primary-600 px-4 py-2.5 text-sm font-medium text-white shadow-sm hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"},[n[67]||(n[67]=t("svg",{class:"h-4 w-4 mr-2 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})],-1)),t("span",g0,i(e(a)("patientSummary.print")),1)],8,h0),t("button",{type:"button",onClick:fs,disabled:e(ge)||e(Da).length===0,class:"inline-flex min-w-0 items-center justify-center rounded-md border border-primary-300 bg-white px-4 py-2.5 text-sm font-medium text-primary-700 shadow-sm hover:bg-primary-50 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"},[n[68]||(n[68]=t("svg",{class:"h-4 w-4 mr-2 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"}
2)],-1)),t("span",w0,i(e(a)("patientSummary.downloadPdf")),1)],8,b0)]),t("button",{type:"button",onClick:$r,disabled:e(ge),class:"inline-flex w-full min-w-0 justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2"},[t("span",_0,i(e(a)("patientSummary.cancel")),1)],8,x0)])])])])):p("",!0)])),f(u,{"is-visible":e(Dt),"visit-id":e(ma),"highlight-term":e(pa),onClose:ws},null,8,["is-visible","visit-id","highlight-term"]),f(Ji,{"is-open":e(be),"modal-type":e(me).type,title:e(me).title,message:e(me).message,"secondary-message":e(me).secondaryMessage,"primary-button-text":e(me).primaryButtonText,onClose:n[29]||(n[29]=s=>be.value=!1),onConfirm:Ds,onCancel:n[30]||(n[30]=s=>be.value=!1)},null,8,["is-open","modal-type","title","message","secondary-message","primary-button-text"]),e(Ft)||e(at)?(o(),d("div",S0,[t("div",k0,[t("div",{class:"fixed inset-0 bg-neutral-900/20 backdrop-blur-[1px] transition-opacity",onClick:Ga}),t("div",D0,[t("header",T0,[t("div",I0,[t("div",P0,[f(e(sr),{class:"h-5 w-5","aria-hidden":"true"})]),t("div",C0,[t("h3",$0,i(e(at)?e(a)("patientSummary.editDiagnosis"):e(a)("patientSummary.addNewDiagnosis")),1),t("p",N0,i(e(at)?e(a)("patientSummary.updateDiagnosisInfo"):e(a)("patientSummary.addDiagnosisInfo")),1)])])]),t("form",{onSubmit:se(qn,["prevent"]),class:"space-y-4 px-4 py-4 sm:px-5"},[t("div",null,[t("label",M0,i(e(a)("patientSummary.conditionName")),1),B(t("input",{id:"condition","onUpdate:modelValue":n[31]||(n[31]=s=>e(pe).condition=s),type:"text",required:"",placeholder:e(a)("patientSummary.enterCondition"),class:"mt-1 block w-full rounded-lg border-neutral-200 text-sm shadow-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500"},null,8,V0),[[F,e(pe).condition]])]),t("div",null,[t("label",O0,i(e(a)("patientSummary.dateRecorded")),1),f(l,{modelValue:e(pe).recordedDate,"onUpdate:modelValue":n[32]||(n[32]=s=>e(pe).recordedDate=s)},null,8,["modelValue"])]),t("div",A0,[t("button",{type:"button",onClick:Ga,class:"inline-flex min-h-9 w-full items-center justify-center rounded-lg border border-neutral-200 bg-white px-3 py-1.5 text-sm font-medium text-neutral-700 shadow-sm shadow-neutral-900/5 hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 sm:w-auto"},i(e(a)("patientSummary.cancel")),1),t("button",{type:"submit",disabled:e(Ut),class:"inline-flex min-h-9 w-full items-center justify-center rounded-lg border border-transparent bg-primary-600 px-3 py-1.5 text-sm font-semibold text-white shadow-sm shadow-primary-900/10 hover:bg-primary-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto"},[e(Ut)?(o(),d("span",j0,[f(e(Qe),{class:"mr-2 h-4 w-4 animate-spin","aria-hidden":"true"}),R(" "+i(e(a)("patientSummary.saving")),1)])):(o(),d("span",B0,i(e(at)?e(a)("patientSummary.update"):e(a)("patientSummary.add"))+" "+i(e(a)("patientSummary.diagnosis")),1))],8,E0)])],32)])])])):p("",!0),e(Lt)||e(rt)?(o(),d("div",R0,[t("div",F0,[t("div",{class:"fixed inset-0 bg-neutral-900/20 backdrop-blur-[1px] transition-opacity",onClick:Ka}),t("div",U0,[t("header",L0,[t("div",z0,[t("div",q0,[f(e(Rr),{class:"h-5 w-5","aria-hidden":"true"})]),t("div",H0,[t("h3",G0,i(e(rt)?e(a)("patientSummary.editAllergy"):e(a)("patientSummary.addNewAllergy")),1),t("p",K0,i(e(rt)?e(a)("patientSummary.updateAllergyInfo"):e(a)("patientSummary.addAllergyInfo")),1)])])]),t("form",{onSubmit:se(Zn,["prevent"]),class:"space-y-4 px-4 py-4 sm:px-5"},[t("div",null,[t("label",W0,i(e(a)("patientSummary.allergen")),1),B(t("input",{id:"allergen","onUpdate:modelValue":n[33]||(n[33]=s=>e(J).allergen=s),type:"text",required:"",placeholder:e(a)("patientSummary.enterAllergen"),class:"mt-1 block w-full rounded-lg border-neutral-200 text-sm shadow-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500"},null,8,Z0),[[F,e(J).allergen]])]),t("div",null,[t("label",Y0,i(e(a)("patientSummary.reaction")),1),B(t("input",{id:"reaction","onUpdate:modelValue":n[34]||(n[34]=s=>
2e(J).reaction=s),type:"text",placeholder:e(a)("patientSummary.describeReaction"),class:"mt-1 block w-full rounded-lg border-neutral-200 text-sm shadow-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500"},null,8,Q0),[[F,e(J).reaction]])]),f(xt,{modelValue:e(J).severity,"onUpdate:modelValue":n[35]||(n[35]=s=>e(J).severity=s),label:e(a)("patientSummary.severity"),options:e(ln)},null,8,["modelValue","label","options"]),t("div",null,[t("label",X0,i(e(a)("patientSummary.dateRecorded")),1),f(l,{modelValue:e(J).recordedDate,"onUpdate:modelValue":n[36]||(n[36]=s=>e(J).recordedDate=s)},null,8,["modelValue"])]),t("div",J0,[t("button",{type:"button",onClick:Ka,class:"inline-flex min-h-9 w-full items-center justify-center rounded-lg border border-neutral-200 bg-white px-3 py-1.5 text-sm font-medium text-neutral-700 shadow-sm shadow-neutral-900/5 hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-warning-500 focus-visible:ring-offset-2 sm:w-auto"},i(e(a)("patientSummary.cancel")),1),t("button",{type:"submit",disabled:e(zt),class:"inline-flex min-h-9 w-full items-center justify-center rounded-lg border border-transparent bg-warning-600 px-3 py-1.5 text-sm font-semibold text-white shadow-sm shadow-warning-900/10 hover:bg-warning-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-warning-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto"},[e(zt)?(o(),d("span",tf,[f(e(Qe),{class:"mr-2 h-4 w-4 animate-spin","aria-hidden":"true"}),R(" "+i(e(a)("patientSummary.saving")),1)])):(o(),d("span",af,i(e(rt)?e(a)("patientSummary.saveChanges"):e(a)("patientSummary.addAllergy")),1))],8,ef)])],32)])])])):p("",!0),e(qt)||e(st)?(o(),d("div",rf,[t("div",nf,[t("div",{class:"fixed inset-0 bg-neutral-900/20 backdrop-blur-[1px] transition-opacity",onClick:Wa}),t("div",sf,[t("header",of,[t("div",lf,[t("div",df,[f(e(nr),{class:"h-5 w-5","aria-hidden":"true"})]),t("div",uf,[t("h3",cf,i(e(st)?e(a)("patientSummary.editMedication"):e(a)("patientSummary.addNewMedication")),1),t("p",mf,i(e(st)?e(a)("patientSummary.updateMedicationInfo"):e(a)("patientSummary.addMedicationInfo")),1)])])]),t("form",{onSubmit:se(es,["prevent"]),class:"space-y-4 px-4 py-4 sm:px-5"},[t("div",null,[t("label",pf,i(e(a)("patientSummary.medicationName")),1),B(t("input",{id:"medicationName","onUpdate:modelValue":n[37]||(n[37]=s=>e(W).name=s),type:"text",required:"",placeholder:e(a)("patientSummary.enterMedication"),class:"mt-1 block w-full rounded-lg border-neutral-200 text-sm shadow-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500"},null,8,ff),[[F,e(W).name]])]),t("div",null,[t("label",yf,i(e(a)("patientSummary.dosage")),1),B(t("input",{id:"dosage","onUpdate:modelValue":n[38]||(n[38]=s=>e(W).dosage=s),type:"text",placeholder:e(a)("patientSummary.dosagePlaceholder"),class:"mt-1 block w-full rounded-lg border-neutral-200 text-sm shadow-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500"},null,8,vf),[[F,e(W).dosage]])]),t("div",null,[t("label",hf,i(e(a)("patientSummary.dateStarted")),1),f(l,{modelValue:e(W).recordedDate,"onUpdate:modelValue":n[39]||(n[39]=s=>e(W).recordedDate=s)},null,8,["modelValue"])]),t("div",null,[t("label",gf,[R(i(e(a)("patientSummary.dateEnded","End Date"))+" ",1),t("span",bf,"("+i(e(a)("patientSummary.optional","Optional"))+")",1)]),f(l,{modelValue:e(W).endDate,"onUpdate:modelValue":n[40]||(n[40]=s=>e(W).endDate=s),min:e(W).recordedDate},null,8,["modelValue","min"])]),t("div",wf,[t("button",{type:"button",onClick:Wa,class:"inline-flex min-h-9 w-full items-center justify-center rounded-lg border border-neutral-200 bg-white px-3 py-1.5 text-sm font-medium text-neutral-700 shadow-sm shadow-neutral-900/5 hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 sm:w-auto"},i(e(a)("patientSummary.cancel")),1),t("button",{type:"submit",disabled:e(Ht),class:"inline-flex min-h-9 w-full items-center justify-center rounded-lg border border-transparent bg-primary-600 px-3 py-1.5 text-sm font-semibold text-white shadow-sm shadow-primary-900/10 hover:bg-primary-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto"},[e(Ht)?(o(),d("span",_f,[f(e(Qe),{class:"mr-2 h-4 w-4 animate-spin","aria-hidden":"true"}),R(" "+i(e(a)("patientSummary.saving")),1)])):(o(),d("span",Sf,i(e(st)?e(a)("patientSummary.saveChanges"):e(a)("patientSummary.addMedication")),1))],8,xf)])],32)])])])):p("",!0),e(Gt)?(o(),d("div",kf,[t("div",Df,[t("div",{class:"fixed inset-0 bg-neutral-900/20 backdrop-blur-[1px] transition-opacity",onClick:Yt}),t("div",Tf,[t("header",If,[t("div",Pf,[t("div",Cf,[f(e(ir),{class:"h-5 w-5","aria-hidden":"true"})]),t("div",$f,[t("h3",Nf,i(e(a)("patientSummary.addPersonalInformation")),1),t("p",Mf,i(e(a)("patientSummary.addPersonalInfoDescription")),1)])])]),t("form",{onSubmit:se(Cr,["prevent"]),class:"space-y-4 px-4 py-4 sm:px-5"},[t("div",null,[t("label",Vf,i(e(a)("patientSummary.details")),1),B(t("textarea",{id:"details","onUpdate:modelValue":n[41]||(n[41]=s=>e(P).details=s),rows:"3",required:"",placeholder:e(a)("patientSummary.enterDetails"),class:"mt-1 block w-full rounded-lg border-neutral-200 text-sm shadow-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500"},null,8,Of),[[F,e(P).details]])]),t("div",null,[t("label",Af,i(e(a)("patientSummary.context")),1),B(t("input",{id:"context","onUpdate:modelValue":n[42]||(n[42]=s=>
2e(P).context=s),type:"text",placeholder:e(a)("patientSummary.additionalContext"),class:"mt-1 block w-full rounded-lg border-neutral-200 text-sm shadow-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500"},null,8,Ef),[[F,e(P).context]])]),f(xt,{modelValue:e(P).category,"onUpdate:modelValue":n[43]||(n[43]=s=>e(P).category=s),label:e(a)("patientSummary.category"),options:e(gr)},null,8,["modelValue","label","options"]),t("div",null,[t("label",jf,i(e(a)("patientSummary.type")),1),B(t("input",{id:"type","onUpdate:modelValue":n[44]||(n[44]=s=>e(P).type=s),type:"text",placeholder:e(a)("patientSummary.informationType"),class:"mt-1 block w-full rounded-lg border-neutral-200 text-sm shadow-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500"},null,8,Bf),[[F,e(P).type]])]),t("div",null,[t("label",Rf,i(e(a)("patientSummary.dateRecorded")),1),f(l,{modelValue:e(P).recordedDate,"onUpdate:modelValue":n[45]||(n[45]=s=>e(P).recordedDate=s)},null,8,["modelValue"])]),t("div",Ff,[t("button",{type:"button",onClick:Yt,class:"inline-flex min-h-9 w-full items-center justify-center rounded-lg border border-neutral-200 bg-white px-3 py-1.5 text-sm font-medium text-neutral-700 shadow-sm shadow-neutral-900/5 hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 sm:w-auto"},i(e(a)("patientSummary.cancel")),1),t("button",{type:"submit",disabled:e(yt),class:"inline-flex min-h-9 w-full items-center justify-center rounded-lg border border-transparent bg-primary-600 px-3 py-1.5 text-sm font-semibold text-white shadow-sm shadow-primary-900/10 hover:bg-primary-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto"},[e(yt)?(o(),d("span",Lf,[f(e(Qe),{class:"mr-2 h-4 w-4 animate-spin","aria-hidden":"true"}),R(" "+i(e(a)("patientSummary.saving")),1)])):(o(),d("span",zf,i(e(a)("patientSummary.addInformation")),1))],8,Uf)])],32)])])])):p("",!0),e(Kt)?(o(),d("div",qf,[t("div",Hf,[t("div",{class:"fixed inset-0 bg-neutral-900/20 backdrop-blur-[1px] transition-opacity",onClick:Yt}),t("div",Gf,[t("header",Kf,[t("div",Wf,[t("div",Zf,[f(e(ir),{class:"h-5 w-5","aria-hidden":"true"})]),t("div",Yf,[t("h3",Qf,i(e(a)("patientSummary.editPersonalInformation")),1),t("p",Xf,i(e(a)("patientSummary.updatePersonalInfoDescription")),1)])])]),t("form",{onSubmit:se(Cr,["prevent"]),class:"space-y-4 px-4 py-4 sm:px-5"},[t("div",null,[t("label",Jf,i(e(a)("patientSummary.details")),1),B(t("textarea",{id:"editDetails","onUpdate:modelValue":n[46]||(n[46]=s=>e(P).details=s),rows:"3",required:"",placeholder:e(a)("patientSummary.enterDetails"),class:"mt-1 block w-full rounded-lg border-neutral-200 text-sm shadow-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500"},null,8,ey),[[F,e(P).details]])]),t("div",null,[t("label",ty,i(e(a)("patientSummary.context")),1),B(t("input",{id:"editContext","onUpdate:modelValue":n[47]||(n[47]=s=>e(P).context=s),type:"text",placeholder:e(a)("patientSummary.additionalContext"),class:"mt-1 block w-full rounded-lg border-neutral-200 text-sm shadow-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500"},null,8,ay),[[F,e(P).context]])]),f(xt,{modelValue:e(P).category,"onUpdate:modelValue":n[48]||(n[48]=s=>e(P).category=s),label:e(a)("patientSummary.category"),options:e(gr)},null,8,["modelValue","label","options"]),t("div",null,[t("label",ry,i(e(a)("patientSummary.type")),1),B(t("input",{id:"editType","onUpdate:modelValue":n[49]||(n[49]=s=>e(P).type=s),type:"text",placeholder:e(a)("patientSummary.informationType"),class:"mt-1 block w-full rounded-lg border-neutral-200 text-sm shadow-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500"},null,8,ny),[[F,e(P).type]])]),t("div",null,[t("label",sy,i(e(a)("patientSummary.dateRecorded")),1),f(l,{modelValue:e(P).recordedDate,"onUpdate:modelValue":n[50]||(n[50]=s=>e(P).recordedDate=s)},null,8,["modelValue"])]),t("div",iy,[t("button",{type:"button",onClick:Yt,class:"inline-flex min-h-9 w-full items-center justify-center rounded-lg border border-neutral-200 bg-white px-3 py-1.5 text-sm font-medium text-neutral-700 shadow-sm shadow-neutral-900/5 hover:bg-neutral-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 sm:w-auto"}
2,i(e(a)("patientSummary.cancel")),1),t("button",{type:"submit",disabled:e(yt),class:"inline-flex min-h-9 w-full items-center justify-center rounded-lg border border-transparent bg-primary-600 px-3 py-1.5 text-sm font-semibold text-white shadow-sm shadow-primary-900/10 hover:bg-primary-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto"},[e(yt)?(o(),d("span",ly,[f(e(Qe),{class:"mr-2 h-4 w-4 animate-spin","aria-hidden":"true"}),R(" "+i(e(a)("patientSummary.saving")),1)])):(o(),d("span",dy,i(e(a)("patientSummary.updateInformation")),1))],8,oy)])],32)])])])):p("",!0)])}}});export{Ty as default}; 3 4//# chunkId=01a0f882-7b32-70f0-9238-5b33a324e152
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.