vendor: 5,289 bytes, line 1
1import{S as gt}from"./SchedulerModal.984dd570.js";import{f as yt,h as ct,bg as vt,v as _t,U as tt,b4 as lt,t as F,r as it,o as L,x as z,C as o,c as dt,B as J,E as Z,b as P,I as rt,z as xt,s as $t,w as wt,J as j,bR as bt,bS as St}from"./vendor.58ef7e65.js";import{aZ as q,O as Mt,K as Dt,a_ as K,a$ as kt,b0 as At,_ as Tt,b1 as Ot,b2 as Ct,b3 as Lt,b4 as jt,b5 as It,s as Ht,b6 as Vt}from"./index.a84e78ad.js";import{f as Rt,e as Yt,b as Nt}from"./DateTimeModule.33c7c242.js";import{r as mt}from"./MarkdownModule.d5be117d.js";import"./Loading.d05ace09.js";import"./v4.90f1a8cc.js";import"./index.415c5bd8.js";var pt={exports:{}};(function(d,C){(function(p,$){d.exports=$()})(yt,function(){var p=1e3,$=6e4,l=36e5,I="millisecond",D="second",S="minute",k="hour",M="day",H="week",v="month",U="quarter",g="year",O="date",E="Invalid Date",R=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(r){var n=["th","st","nd","rd"],t=r%100;return"["+r+(n[(t-20)%10]||n[t]||n[0])+"]"}},w=function(r,n,t){var s=String(r);return!s||s.length>=n?r:""+Array(n+1-s.length).join(t)+r},Y={s:w,z:function(r){var n=-r.utcOffset(),t=Math.abs(n),s=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+w(s,2,"0")+":"+w(e,2,"0")},m:function r(n,t){if(n.date()<t.date())return-r(t,n);var s=12*(t.year()-n.year())+(t.month()-n.month()),e=n.clone().add(s,v),a=t-e<0,i=n.clone().add(s+(a?-1:1),v);return+(-(s+(t-e)/(a?e-i:i-e))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M:v,y:g,w:H,d:M,D:O,h:k,m:S,s:D,ms:I,Q:U}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},A="en",N={};N[A]=x;var ot="$isDayjsObject",at=function(r){return r instanceof nt||!(!r||!r[ot])},et=function r(n,t,s){var e;if(!n)return A;if(typeof n=="string"){var a=n.toLowerCase();N[a]&&(e=a),t&&(N[a]=t,e=a);var i=n.split("-");if(!e&&i.length>1)return r(i[0])}else{var c=n.name;N[c]=n,e=c}return!s&&e&&(A=e),e||!s&&A},f=function(r,n){if(at(r))return r.clone();var t=typeof n=="object"?n:{};return t.date=r,t.args=arguments,new nt(t)},u=Y;u.l=et,u.i=at,u.w=function(r,n){return f(r,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var nt=function(){function r(t){this.$L=et(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[ot]=!0}var n=r.prototype;return n.parse=function(t){this.$d=function(s){var e=s.date,a=s.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var i=e.match(R);if(i){var c=i[2]-1||0,m=(i[7]||"0").substring(0,3);return a?new Date(Date.UTC(i[1],c,i[3]||1,i[4]||0,i[5]||0,i[6]||0,m)):new Date(i[1],c,i[3]||1,i[4]||0,i[5]||0,i[6]||0,m)}}return new Date(e)}(t),this.init()},n.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},n.$utils=function(){return u},n.isValid=function(){return this.$d.toString()!==E},n.isSame=function(t,s){var e=f(t);return this.startOf(s)<=e&&e<=this.endOf(s)},n.isAfter=function(t,s){return f(t)<this.startOf(s)},n.isBefore=function(t,s){return this.endOf(s)<f(t)},n.$g=function(t,s,e){return u.u(t)?this[s]:this.set(e,t)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(t,s){var e=this,a=!!u.u(s)||s,i=u.p(t),c=function(B,b){var V=u.w(e.$u?Date.UTC(e.$y,b,B):new Date(e.$y,b,B),e);return a?V:V.endOf(M)},m=function(B,b){return u.w(e.toDate()[B].apply(e.toDate("s"),(a?[0,0,0,0]:[23,59,59,999]).slice(b)),e)},h=this.$W,_=this.$M,T=this.$D,G="set"+(this.$u?"UTC":"");switch(i){case g:return a?c(1,0):c(31,11);case v:return a?c(1,_):c(0,_+1);case H:var W=this.$locale().weekStart||0,Q=(h<W?h+7:h)-W;return c(a?T-Q:T+(6-Q),_);case M:case O:return m(G+"Hours",0);case k:return m(G+"Minutes",1);case S:return m(G+"Seconds",2);case D:return m(G+"Milliseconds",3);default:return this.clone()}},n.endOf=function(t){return this.startOf(t,!1)},n.$set=function(t,s){var e,a=u.p(t),i="set"+(this.$u?"UTC":""),c=(e={},e[M]=i+"Date",e[O]=i+"Date",e[v]=i+"Month",e[g]=i+"FullYear",e[k]=i+"Hours",e[S]=i+"Minutes",e[D]=i+"Seconds",e[I]=i+"Milliseconds",e)[a],m=a===M?this.$D+(s-this.$W):s;if(a===v||a===g){var h=this.clone().set(O,1);h.$d[c](m),h.init(),this.$d=h.set(O,Math.min(this.$D,h.daysInMonth())).$d}else c&&this.$d[c](m);return this.init(),this},n.set=function(t,s){return this.clone().$set(t,s)},n.get=function(t){return this[u.p(t)]()},n.add=function(t,s){var e,a=this;t=Number(t);var i=u.p(s),c=function(_){var T=f(a);return u.w(T.date(T.date()+Math.round(_*t)),a)};if(i===v)return this.set(v,this.$M+t);if(i===g)return this.set(g,this.$y+t);if(i===M)return c(1);if(i===H)return c(7);var m=(e={},e[S]=$,e[k]=l,e[D]=p,e)[i]||1,h=this.$d.getTime()+t*m;return u.w(h,this)},n.subtract=function(t,s){return this.add(-1*t,s)},n.format=function(t){var s=this,e=this.$locale();
1if(!this.isValid())return e.invalidDate||E;var a=t||"YYYY-MM-DDTHH:mm:ssZ",i=u.z(this),c=this.$H,m=this.$m,h=this.$M,_=e.weekdays,T=e.months,G=e.meridiem,W=function(b,V,X,st){return b&&(b[V]||b(s,a))||X[V].slice(0,st)},Q=function(b){return u.s(c%12||12,b,"0")},B=G||function(b,V,X){var st=b<12?"AM":"PM";return X?st.toLowerCase():st};return a.replace(y,function(b,V){return V||function(X){switch(X){case"YY":return String(s.$y).slice(-2);case"YYYY":return u.s(s.$y,4,"0");case"M":return h+1;case"MM":return u.s(h+1,2,"0");case"MMM":return W(e.monthsShort,h,T,3);case"MMMM":return W(T,h);case"D":return s.$D;case"DD":return u.s(s.$D,2,"0");case"d":return String(s.$W);case"dd":return W(e.weekdaysMin,s.$W,_,2);case"ddd":return W(e.weekdaysShort,s.$W,_,3);case"dddd":return _[s.$W];case"H":return String(c);case"HH":return u.s(c,2,"0");case"h":return Q(1);case"hh":return Q(2);case"a":return B(c,m,!0);case"A":return B(c,m,!1);case"m":return String(m);case"mm":return u.s(m,2,"0");case"s":return String(s.$s);case"ss":return u.s(s.$s,2,"0");case"SSS":return u.s(s.$ms,3,"0");case"Z":return i}return null}(b)||i.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(t,s,e){var a,i=this,c=u.p(s),m=f(t),h=(m.utcOffset()-this.utcOffset())*$,_=this-m,T=function(){return u.m(i,m)};switch(c){case g:a=T()/12;break;case v:a=T();break;case U:a=T()/3;break;case H:a=(_-h)/6048e5;break;case M:a=(_-h)/864e5;break;case k:a=_/l;break;case S:a=_/$;break;case D:a=_/p;break;default:a=_}return e?a:u.a(a)},n.daysInMonth=function(){return this.endOf(v).$D},n.$locale=function(){return N[this.$L]},n.locale=function(t,s){if(!t)return this.$L;var e=this.clone(),a=et(t,s,!0);return a&&(e.$L=a),e},n.clone=function(){return u.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},r}(),ut=nt.prototype;return f.prototype=ut,[["$ms",I],["$s",D],["$m",S],["$H",k],["$W",M],["$M",v],["$y",g],["$D",O]].forEach(function(r){ut[r[1]]=function(n){return this.$g(n,r[0],r[1])}}),f.extend=function(r,n){return r.$i||(r(n,nt,f),r.$i=!0),f},f.locale=et,f.isDayjs=at,f.unix=function(r){return f(1e3*r)},f.en=N[A],f.Ls=N,f.p={},f})})(pt);var ft=pt.exports;const Wt=ct({props:{appointment:{type:Object,required:!0},reportType:{type:String,default:q}},components:{DownloadIcon:vt,Spinner:Mt},setup(d){var R;const C=_t(Dt),p=tt(),$=tt(),l=tt(!1),I=(R=d.appointment.id)!=null?R:"";lt(async()=>{M.value&&($.value=setInterval(v,15e3),await v(),l.value=!0)});const D=F(()=>{switch(d.reportType){case q:return"Download Receipt";case K:return"Download After Visit Summary"}return p.value?"Download Statement":"Generating Statement..."}),S=F(()=>{switch(d.reportType){case q:return"Generating Receipt...";case K:return"Generating After Visit Summary..."}return p.value?"Download Statement":"Generating Statement..."}),k=F(()=>!p.value),M=F(()=>{var y,x,w,Y;switch(d.reportType){case q:return((x=(y=d.appointment)==null?void 0:y.metadata)==null?void 0:x.receiptData)!=null;case K:{const A=(Y=(w=d.appointment)==null?void 0:w.metadata)==null?void 0:Y.afterVisitSummary;return A!=null&&H(A)}default:return!1}}),H=y=>{var x;try{const w=JSON.parse(y),Y=w.Type,A=(x=w.Plan)==null?void 0:x.value;switch(Y){case"Followup":return(A==null?void 0:A.trim().length)>0;default:return!0}}catch(w){console.error("Error parsing JSON:",w)}return!1},v=async()=>{try{const x=(await U(I)).data.url;p.value=x,$.value&&clearInterval($.value)}catch(y){const x=y==null?void 0:y.response;if(x)switch(x.status){case 404:return}}};async function U(y){switch(d.reportType){case q:return await At(y);case K:return await kt(y);default:throw new Error("Invalid report type")}}async function g(){switch(d.reportType){case q:await O();break;case K:await E();break}}async function O(){p.value!=null?(window.open(p.value,"_blank"),await Ot()):C&&(C.value={open:!0,type:"error",message:"Your receipt is being generated, please try again in a few minutes."})}async function E(){p.value!=null?(window.open(p.value,"_blank"),await Ct()):C&&(C.value={open:!0,type:"error",message:"Your after visit summary is being generated, please try again in a few minutes."})}return{openLink:g,report:p,generating:k,loaded:l,shouldShowButton:M,buttonText:D,generatingText:S}}}),Bt={key:0},Ft=["disabled"],zt={key:1},Jt={key:2,class:"inline-flex items-center"};function Ut(d,C,p,$,l,I){const D=it("Spinner"),S=it("DownloadIcon");return d.shouldShowButton&&d.loaded?(L(),z("span",Bt,[o("a",{type:"button",onClick:C[0]||(C[0]=(...k)=>d.openLink&&d.openLink(...k)),target:"_blank",class:xt(["inline-flex items-center px-2.5 py-1.5 border mentavi-purple shadow-sm text-xs font-medium rounded text-secondary-button-text bg-secondary-button hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-mentavi-purple",{"cursor-not-allowed bg-secondary-button-disabled text-mentavi-text-disabled":d.generating,"hover:bg-gray-50":d.generating}]),disabled:d.generating},[d.generating?(L(),dt(D,{key:0,classOverride:"w-5 h-5 mr-2 text-purple-500"})):J("",!0),d.generating?(L(),z("div",zt,Z(d.generatingText),1)):(L(),z("div",Jt,[P(S,{class:"-ml-1 mr-2 h-5 w-5 text-mentavi-gray","aria-hidden":"true"}),rt(" "+Z(d.buttonText),1)]))],10,Ft)])):J("",!0)}var ht=Tt(Wt,[["render",Ut]]);const Et={key:0,class:"xl:max-w-7xl xl:mx-auto"},Gt={class:"px-4 sm:px-0 lg:flex lg:items-center lg:justify-between"},Zt={class:"flex-1 min-w-0"},Pt={class:"flex items-center space-x-3"},qt=o("h2",{class:"text-2xl font-bold leading-7 text-gray-900 sm:truncate"},"Appointment details",-1),Kt=rt("(back to appointments)"),Qt={key:0,class:"mt-4 flex lg:mt-0 lg:ml-4"},Xt=rt(" Reschedule "),te={type:"button",class:"hidden ml-3 inline-flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-mentavi-purple"},ee=rt(" Cancel "),ne={class:"mt-4 sm:mt-6 bg-white shadow overflow-hidden sm:rou
1nded-lg"},se={class:"px-4 py-5 sm:px-6"},re={class:"flex items-center justify-between"},ae=o("h3",{class:"text-lg leading-6 font-medium text-gray-900"},"Information",-1),ie={key:0,class:"inline-flex items-center px-2.5 py-0.5 rounded-md text-sm font-medium bg-red-100 text-red-800"},oe={class:"border-t border-gray-200"},ue={class:"bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6"},ce=o("dt",{class:"text-sm font-medium text-mentavi-gray"},"Meeting with",-1),le=["textContent"],de={class:"bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6"},me=o("dt",{class:"text-sm font-medium text-menensureAppointmentReceipttavi-gray"},"Duration",-1),pe={class:"mt-1 text-sm text-gray-700 sm:mt-0 sm:col-span-2"},fe={class:"bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6"},he=o("dt",{class:"text-sm font-medium text-mentavi-gray"},"When",-1),ge=["textContent"],ye={class:"bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6"},ve=o("dt",{class:"text-sm font-medium text-mentavi-gray"},"Timezone",-1),_e=["textContent"],xe={class:"bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6"},$e=o("dt",{class:"text-sm font-medium text-mentavi-gray"},"Location",-1),we=["innerHTML"],be={class:"bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6"},Se=o("dt",{class:"text-sm font-medium text-mentavi-gray"},"Details",-1),Me=["innerHTML"],Ie=ct({setup(d){const p=$t().params.id,$=tt(!1),l=tt(),I=F(()=>Ht.getters["client/isDischarged"]),D=F(()=>{var g;return((g=l.value)==null?void 0:g.status)===Vt.Scheduled});lt(async()=>{await Promise.all([S(),Lt(p),jt(p)])});async function S(){l.value=(await It(p)).data}function k(g){return`<a target="_blank" href="${g}">`+g+"</a>"}function M(){S()}function H(){$.value=!0}function v(){return!I.value&&D.value&&l.value&&ft(l.value.start).isAfter(ft().add(24,"h"))}const U=F(()=>!0);return(g,O)=>{var R,y,x,w;const E=it("router-link");return l.value?(L(),z("div",Et,[o("div",Gt,[o("div",Zt,[o("div",Pt,[qt,P(E,{to:{name:"dashboard.appointments.index"},class:"hidden sm:flex text-xs text-mentavi-blue hover:text-mentavi-blue"},{default:wt(()=>[Kt]),_:1},8,["to"])])]),l.value.status!=="canceled"?(L(),z("div",Qt,[v()?(L(),z("button",{key:0,type:"button",class:"inline-flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-mentavi-purple",onClick:H},[P(j(bt),{class:"-ml-1 mr-2 h-5 w-5 text-mentavi-gray","aria-hidden":"true"}),Xt])):J("",!0),o("button",te,[P(j(St),{class:"-ml-1 mr-2 h-5 w-5 text-mentavi-gray","aria-hidden":"true"}),ee]),P(ht,{appointment:l.value,class:"ml-3"},null,8,["appointment"]),j(U)?J("",!0):(L(),dt(ht,{key:1,appointment:l.value,reportType:j(K),class:"ml-3"},null,8,["appointment","reportType"]))])):J("",!0)]),o("div",ne,[o("div",se,[o("div",re,[ae,l.value.status==="canceled"?(L(),z("span",ie," Canceled ")):J("",!0)])]),o("div",oe,[o("dl",null,[o("div",ue,[ce,o("dd",{class:"mt-1 text-sm text-gray-700 sm:mt-0 sm:col-span-2",textContent:Z((y=(R=l.value)==null?void 0:R.provider)==null?void 0:y.name)},null,8,le)]),o("div",de,[me,o("dd",pe,Z(j(Rt)(l.value.start,l.value.end))+" minutes",1)]),o("div",fe,[he,o("dd",{class:"mt-1 text-sm text-gray-700 sm:mt-0 sm:col-span-2",textContent:Z(j(Yt)(l.value.start,l.value.end,{longDateFormat:!0}))},null,8,ge)]),o("div",ye,[ve,o("dd",{class:"mt-1 text-sm text-gray-700 sm:mt-0 sm:col-span-2",textContent:Z(j(Nt)(l.value.start))},null,8,_e)]),o("div",xe,[$e,o("dd",{class:"mt-1 text-sm sm:mt-0 sm:col-span-2 prose prose-sm prose-sky max-w-none",innerHTML:j(mt)(k((x=l.value.location)!=null?x:""))},null,8,we)]),o("div",be,[Se,o("dd",{class:"mt-1 text-sm sm:mt-0 sm:col-span-2 prose prose-sm prose-sky max-w-none",innerHTML:j(mt)((w=l.value.details)!=null?w:"")},null,8,Me)])])])]),P(gt,{open:$.value,loadAppointment:l.value,onClose:O[0]||(O[0]=Y=>$.value=!1),onAppointmentConfirmed:M},null,8,["open","loadAppointment"])])):J("",!0)}}});export{Ie as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.