@mediquo/elements 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{action-unavailable-message-CzRDRmk9.js → action-unavailable-message-CRLimFj5.js} +1 -1
- package/dist/chunks/api-chat-client-BiiYnU-b.js +1 -0
- package/dist/chunks/{apple-pay-outcomes-B4dOTOhL.js → apple-pay-outcomes-BpcbdGfO.js} +1 -1
- package/dist/chunks/{appointment-action-unavailable-dialog-ByWsZP0d.d.ts → appointment-action-unavailable-dialog-Da2IATYj.d.ts} +7 -0
- package/dist/chunks/{appointment-card-skeleton-DRWT9q2U.d.ts → appointment-card-skeleton-B7dKtGv0.d.ts} +3 -3
- package/dist/chunks/{appointment-card-skeleton-CwIuoOXV.js → appointment-card-skeleton-ZfTAElLq.js} +1 -1
- package/dist/chunks/{appointment-details-D7Rw3Hyl.js → appointment-details-Bm3Uuw2g.js} +1 -1
- package/dist/chunks/{appointment-details-DpzdYLjq.d.ts → appointment-details-CVEDe_k0.d.ts} +1 -1
- package/dist/chunks/{appointment.model.d-Dy50gMPg.d.ts → appointment.model.d-BWwBLaEL.d.ts} +3 -0
- package/dist/chunks/documentation-view-CTnpWIxq.js +1 -0
- package/dist/chunks/{index-CatvNhwL.js → index-CZ9HtP96.js} +1 -1
- package/dist/chunks/{index-m_sTPA-8.js → index-DMiowcMQ.js} +1 -1
- package/dist/chunks/{mq-chat-room-DuG4RuIp.d.ts → mq-chat-room-CRPruRJD.d.ts} +1 -1
- package/dist/chunks/{refund-cancel-policy-qaBi5AHH.js → refund-cancel-policy-DV6bzqcu.js} +1 -1
- package/dist/env.js +1 -1
- package/dist/mq-apple-pay-checkout.js +1 -1
- package/dist/mq-appointment-checkout.js +1 -1
- package/dist/mq-appointment-documentation.d.ts +2 -2
- package/dist/mq-appointment-documentation.js +1 -1
- package/dist/mq-chat-room.d.ts +2 -2
- package/dist/mq-chat-room.js +1 -1
- package/dist/mq-checkout.js +1 -1
- package/dist/mq-dashboard.d.ts +9 -9
- package/dist/mq-dashboard.js +1 -1
- package/dist/mq-documents.js +1 -1
- package/dist/mq-google-pay-checkout.js +1 -1
- package/dist/mq-immediate-videocall-checkout.js +1 -1
- package/dist/mq-my-appointments.d.ts +5 -5
- package/dist/mq-my-appointments.js +1 -1
- package/dist/mq-next-appointments.d.ts +3 -3
- package/dist/mq-next-appointments.js +1 -1
- package/dist/mq-payment-poller.js +1 -1
- package/dist/mq-professional-presence-sync.js +1 -1
- package/dist/mq-recent-documents.js +1 -1
- package/dist/mq-schedule-success.d.ts +3 -4
- package/dist/mq-schedule-success.js +2 -2
- package/dist/mq-schedule.d.ts +2 -2
- package/dist/mq-schedule.js +1 -1
- package/dist/mq-support-chat.d.ts +2 -2
- package/dist/mq-support-chat.js +1 -1
- package/dist/mq-terms-and-conditions.js +1 -1
- package/dist/mq-unread-count-sync.js +1 -1
- package/dist/mq-videocall.d.ts +2 -2
- package/dist/mq-videocall.js +1 -1
- package/dist/react/mq-apple-pay-checkout.js +1 -1
- package/dist/react/mq-appointment-checkout.js +1 -1
- package/dist/react/mq-appointment-documentation.d.ts +2 -2
- package/dist/react/mq-appointment-documentation.js +1 -1
- package/dist/react/mq-chat-room.d.ts +2 -2
- package/dist/react/mq-chat-room.js +1 -1
- package/dist/react/mq-checkout.js +1 -1
- package/dist/react/mq-dashboard.d.ts +5 -5
- package/dist/react/mq-dashboard.js +1 -1
- package/dist/react/mq-documents-page.js +1 -1
- package/dist/react/mq-documents.js +1 -1
- package/dist/react/mq-google-pay-checkout.js +1 -1
- package/dist/react/mq-immediate-videocall-checkout.js +1 -1
- package/dist/react/mq-my-appointments.d.ts +5 -5
- package/dist/react/mq-my-appointments.js +1 -1
- package/dist/react/mq-next-appointments.d.ts +3 -3
- package/dist/react/mq-next-appointments.js +1 -1
- package/dist/react/mq-payment-poller.js +1 -1
- package/dist/react/mq-professional-presence-sync.js +1 -1
- package/dist/react/mq-recent-documents.js +1 -1
- package/dist/react/mq-schedule-success.d.ts +3 -3
- package/dist/react/mq-schedule-success.js +1 -1
- package/dist/react/mq-schedule.d.ts +2 -2
- package/dist/react/mq-schedule.js +1 -1
- package/dist/react/mq-support-chat.d.ts +2 -2
- package/dist/react/mq-support-chat.js +1 -1
- package/dist/react/mq-terms-and-conditions.js +1 -1
- package/dist/react/mq-unread-count-sync.js +1 -1
- package/dist/react/mq-videocall.d.ts +2 -2
- package/dist/react/mq-videocall.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/api-chat-client-BsiZ3A6g.js +0 -1
- package/dist/chunks/documentation-view-Mqdp7yKi.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as t}from"./chunk-6CCJWPGL-DlOpbEYH.js";import{_ as e,c as i}from"./custom-element-D2ziPxYE.js";import{Q as o}from"./chunk-RCFIJTXZ-C6Ir0-sM.js";import{M as n}from"./mutation-controller-CR2qcqhH.js";import{h as a,f as s}from"./price-DU3YLTpk.js";import{getLocale as r}from"../i18n.js";import"../ui/mq-button.js";import"../ui/mq-dialog.js";import{c as l}from"./consume-BhoQNO_8.js";import{m as p,s as m}from"./runtime-Bg1WXVCx.js";import{l as c}from"./localized-decorator-BlOuLhym.js";import{a as d,i as h,x as u}from"./lit-element-DiWJYFwC.js";import{n as f}from"./property-scuRaFcM.js";import{a as v}from"./api-chat-client-
|
|
1
|
+
import{s as t}from"./chunk-6CCJWPGL-DlOpbEYH.js";import{_ as e,c as i}from"./custom-element-D2ziPxYE.js";import{Q as o}from"./chunk-RCFIJTXZ-C6Ir0-sM.js";import{M as n}from"./mutation-controller-CR2qcqhH.js";import{h as a,f as s}from"./price-DU3YLTpk.js";import{getLocale as r}from"../i18n.js";import"../ui/mq-button.js";import"../ui/mq-dialog.js";import{c as l}from"./consume-BhoQNO_8.js";import{m as p,s as m}from"./runtime-Bg1WXVCx.js";import{l as c}from"./localized-decorator-BlOuLhym.js";import{a as d,i as h,x as u}from"./lit-element-DiWJYFwC.js";import{n as f}from"./property-scuRaFcM.js";import{a as v}from"./api-chat-client-BiiYnU-b.js";function g(e,i){return{queryKey:t(e,"appointments",i),queryFn:()=>e.appointments.getAppointments(i)}}let b=class CancelAppointmentConfirmationDialog extends d{constructor(){super(...arguments),this.open=!1,this.cancelAppointmentMutation=new n(this,{mutationFn:async t=>v.appointments.cancelAppointment(t),onSuccess:()=>{this.queryClientContext?.invalidateQueries(),this.dispatchEvent(new CustomEvent("success",{bubbles:!0,composed:!0}))}}),this.handleClose=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))},this.handleDismissClick=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))},this.handleConfirmClick=()=>{this.cancelAppointmentMutation.run({id:this.appointmentId})}}static{this.styles=h`:host{display:contents}h2{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0}p{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);margin:0}.subheading-payable{font-size:var(--text-base);line-height:22px}.price-rows{display:flex;flex-direction:column;font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-medium);line-height:var(--text-sm--line-height);color:var(--color-card-foreground);width:100%;margin-bottom:var(--sp-4)}.price-row{display:flex;align-items:center;justify-content:space-between;min-height:34px;gap:var(--sp-2)}.price-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-4);justify-content:flex-end;flex-wrap:wrap}`}render(){const t=r(),e=this.price,i=a(e),o=this.cancelAppointmentMutation.isPending;if(i){const i=s(e,t),n=`-${i}`;return u`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${p("Confirmar cancelación")}</h2><p slot="subheading" class="subheading-payable">${p("¿Seguro que quieres cancelar esta cita? Se te devolverá el importe pagado en un plazo de 5-10 días hábiles.")}</p><div><div class="price-rows"><div class="price-row"><span>${p("Importe pagado")}</span> <span>${i}</span></div><div class="price-row"><span>${p("Importe a devolver")}</span> <span>${n}</span></div></div><div class="actions"><mq-button variant="outline" ?disabled="${o}" @click="${this.handleDismissClick}">${p("Volver")}</mq-button><mq-button variant="primary" ?disabled="${o}" @click="${this.handleConfirmClick}">${p("Confirmar")}</mq-button></div></div></mq-dialog>`}return u`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${p("Confirmar cancelación")}</h2><p slot="subheading">${p("¿Seguro que quieres cancelar esta cita?")}</p><div><div class="actions"><mq-button variant="outline" ?disabled="${o}" @click="${this.handleDismissClick}">${p("Cancelar")}</mq-button><mq-button variant="primary" ?disabled="${o}" @click="${this.handleConfirmClick}">${p("Confirmar")}</mq-button></div></div></mq-dialog>`}};e([f({type:Boolean,reflect:!0})],b.prototype,"open",void 0),e([l({context:o,subscribe:!0})],b.prototype,"queryClientContext",void 0),e([f({type:String})],b.prototype,"appointmentId",void 0),e([f({type:Object})],b.prototype,"price",void 0),b=e([c(),i("cancel-appointment-confirmation-dialog")],b);let y=class AppointmentActionUnavailableDialog extends d{constructor(){super(...arguments),this.open=!1,this.heading="",this.message="",this.handleClose=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static{this.styles=h`:host{display:contents}mq-dialog::part(dialog){max-width:343px;min-width:0}h2{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0}p{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);margin:0}.actions{display:flex;margin-top:var(--sp-4)}`}render(){return u`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${this.heading}</h2><p slot="subheading">${this.message}</p><div class="actions"><mq-button variant="primary" fullwidth @click="${this.handleClose}">${p("Volver")}</mq-button></div></mq-dialog>`}};function $(t){const{action:e,refundPolicySeconds:i}=t,o=null!=i&&i<3600,n=Math.ceil((i??0)/60),a=Math.ceil((i??0)/3600);return p(0===(o?n:a)?"modify"===e?"Esta cita ya ha pasado, por lo que no se puede modificar.":"Esta cita ya ha pasado, por lo que no se puede anular.":"modify"===e?o?m`Lo sentimos, como faltan menos de ${n} minutos para tu cita no podemos modificarla.`:m`Lo sentimos, como faltan menos de ${a} horas para tu cita no podemos modificarla.`:o?m`Lo sentimos, como faltan menos de ${n} minutos para tu cita no podemos anularla.`:m`Lo sentimos, como faltan menos de ${a} horas para tu cita no podemos anularla.`)}e([f({type:Boolean,reflect:!0})],y.prototype,"open",void 0),e([f({type:String})],y.prototype,"heading",void 0),e([f({type:String})],y.prototype,"message",void 0),y=e([c(),i("appointment-action-unavailable-dialog")],y);export{g as a,$ as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as t,n as e,a as n,z as r,s as i,e as s,b as o,r as a,u as l,c,d as u,f as d,l as p,g as h,i as f}from"./external-CJj32K_p.js";import{p as m}from"./parseISO-Dj3qSTG8.js";import{f as g}from"./format-CRFiCNHw.js";import{i as b}from"./isBefore-CPpTogxo.js";import{env as y}from"../env.js";function _(r){return t({data:n(r),meta:t({current_page:e(),last_page:e(),per_page:e(),total:e()})})}function v(t){return m(`${t.replace(" ","T")}Z`)}function w(t){const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds()));return g(e,"yyyy-MM-dd HH:mm:ss")}function C(t,e){try{const n=new Intl.DateTimeFormat("en",{timeZone:t,timeZoneName:"shortOffset"}).formatToParts(e);return n.find(t=>"timeZoneName"===t.type)?.value??""}catch{return""}}var E=r.enum(["pending","expired","accepted","inCall","declined","cancelled","finished","free_of_charge","owed","unpaid","reporting"]),R=E.enum,O=r.enum(["videocall","chat","phonecall"]),S=O.enum,A=r.object({id:r.string().uuid(),room_id:r.string(),channel:O,consultation_short_url:r.string().url().nullable(),call_id:r.string().url(),duration:r.number(),from:r.object({hash:r.string(),name:r.string().nullable(),avatar:r.string().url().nullable(),speciality:r.string().nullable(),collegiate_number:r.string().nullable(),is_dismissed:r.boolean(),languages:r.array(r.string()),description:r.string().nullable()}),to:r.object({id:r.number(),hash:r.string(),name:r.string().nullable(),avatar:r.string().url().nullable(),is_dismissed:r.boolean()}),speciality_id:r.number().nullable(),has_chat_in_appointment:r.boolean().optional(),created_at:r.string(),status:E,seconds_to_open:r.number().nonnegative(),start_date:r.string(),started_at:r.string().nullable(),expires_at:r.string().nullable(),consultation_reason:r.string().nullable(),preconsultation_documents:r.array(r.object({file_path:r.string(),file_name:r.string(),id:r.string().uuid()})).nullable(),service_id:r.string().uuid().nullable(),price:r.number().nullable().optional(),currency:r.string().nullable().optional(),discount_amount:r.number().nullable().optional()}),T=r.enum(["appointment","chat","immediate"]),j=T.enum;function x(t){return 0===t.seconds_to_open}function P(t){if(!t)return!1;const e=new Date,n=v(t);return b(n,e)}var k=r.enum(["prescription","report","diagnosticTestPrescription"]),N=k.enum,U=r.enum(["published","draft"]);U.enum;var L=r.object({document_id:r.string().uuid(),document_type:k,name:r.string(),professional:r.object({speciality_id:r.number()}),status:U,url:r.string().url(),created_at:r.string()}),D=t({hash:i(),profile:t({first_name:i().nullable(),last_name:i().nullable(),birth_date:i().nullable(),gender:s(["male","female"]).nullable(),email:i().nullable(),phone_prefix:i().nullable(),phone:i().nullable(),billing:t({tax_id:i().nullable(),address:i().nullable(),country_code:i().nullable(),region:i().nullable(),postal_code:i().nullable()})})});function F(t){const e=t?.profile;return`${e?.first_name??""} ${e?.last_name??""}`.trim()}function B(t){return[t?.profile.first_name,t?.profile.last_name,t?.profile.email,t?.profile.phone,t?.profile.birth_date,t?.profile?.billing?.tax_id].every(t=>null!==t)}r.object({appointmentId:r.string()});var I=A;r.object({callId:r.string()});var $=r.object({session_id:r.string(),session_token:r.string()});r.object({professional_hash:r.string(),consultation_id:r.string(),consultation_type:r.enum(["appointment"])}),r.object({professional_hash:r.string(),consultation_id:r.string(),consultation_type:r.enum(["appointment"])}),r.object({appointment_id:r.string()});var M=r.array(L);r.object({url:r.string().url()}),r.object({first_name:D.shape.profile.shape.first_name,last_name:D.shape.profile.shape.last_name,tax_id:D.shape.profile.shape.billing.shape.tax_id,birth_date:D.shape.profile.shape.birth_date,gender:D.shape.profile.shape.gender.optional(),email:D.shape.profile.shape.email,phone_prefix:D.shape.profile.shape.phone_prefix,phone:D.shape.profile.shape.phone,terms_accepted:r.boolean(),privacy_accepted:r.boolean()}),r.object({patient_hash:r.string(),page:r.number().optional(),per_page:r.number().optional()});var q=_(L);t({consultation_id:i(),consultation_type:T,rating:e().int().min(1).max(5),comment:i().nullable().optional()});var z=t({rating:e().int().optional(),comment:i().nullable().optional()}).passthrough();t({slot_id:i().uuid(),service_id:i().uuid(),specialty_id:i(),consultation_reason:i().optional(),preconsultation_documents:n(t({file_path:i(),file_name:i()})).optional(),discount_code:i().optional(),return_url:i().url().optional()});var H=t({id:i(),percent_off:e(),code:i(),after_discount_amount:e().nullable()}),J=t({id:i(),percent_off:e(),code:i(),name:i().nullish()}),K={Addon:"addon",Stripe:"stripe"},W=t({session_id:i(),payment_link:i().url(),provider:o(K).optional()});t({video_call_schedule_id:i()});var V=W;t({professional_hash:i().uuid()});var X=W,G={Paid:"paid",Unpaid:"unpaid",Denied:"denied"},Z=t({status:o(G),consultation_id:i(),consultation_type:i()});t({order_id:i(),validation_url:i().url()});var Q=a(l());t({order_id:i(),token:i()});var Y=t({data:t({status:o(G),consultation_id:i(),consultation_type:i().optional()})});t({order_id:i(),token:i()});var tt=t({data:t({status:o(G),consultation_id:i(),consultation_type:i().optional()})}),et=r.array(r.object({id:r.number(),name:r.string(),code:r.string()})),nt=r.object({primary_color:r.string().nullable(),logo:r.string().nullable(),favicon:r.string().nullable(),support_professional:r.object({hash:r.string().nullable()}).optional(),home:r.object({title:r.string().nullable(),description:r.string().nullable(),image_url:r.string().nullable()}),appointments:r.object({reserve_conditions:r.string().nullable(),seconds_before_start_to_refund_on_cancel:r.number().nullable(),has_nps:r.boolean().optional(),has_chat_in_appointment:r.boolean().optional(),has_discount_coupons_show:r.boolean().optional(),payment_provider:r.nativeEnum(K).nullish()}),legal_consent:r.object({terms_url:r.string().nullable(),privacy_url:r.string().nullable()})}),rt=s(["monday","tuesday","wednesday","thursday","friday","saturday","sunday","working_week","weekend","all_week"]);rt.enum;var it=t({days_of_week:rt,from_time:i(),to_time:i()});t({hash:i().uuid()});var st=t({hash:i().uuid(),active_absence:t({id:i().uuid(),finishes_at:i()}).nullable(),avatar:i().url().nullable(),collegiate_number:i().nullable(),description:i().nullable(),is_available:c(),name:i(),overview:i().nullable(),schedule_description:i().nullable(),speciality_id:e().nullable(),status:s(["online","offline"]),title:i().nullable(),chat_schedule:t({channel:O,duration:e(),name:i(),timezone:i(),starts_at:i(),gaps:n(it)}).nullable()});function ot(t){return t.active_absence?"absent":"online"===t.status?"online":"offline"}s(["online","offline","absent"]),t({roomId:e()});var at=D;t({first_name:i(),last_name:i(),tax_id:i(),birth_date:i(),gender:s(["male","female"]),email:i(),phone_prefix:i(),phone:i(),terms_accepted:c(),privacy_accepted:c()}),t({terms_accepted:c(),privacy_accepted:c(),commercial_accepted:c()}),t({hash:i().uuid()});var lt=t({id:e(),hash:i().uuid(),speciality_alias:i(),name:i(),avatar:i().url(),description:i(),collegiate_number:i(),languages:n(i()),centers:n(t({id:i().uuid(),name:i()}))}),ct=s(["available","reserved"]),ut=ct.enum,dt=t({id:i().uuid(),channel:O,duration:e(),starts_at:i(),finishes_at:i(),professional:t({id:i().uuid(),name:i()}),services:n(t({id:i().uuid(),name:i()})),speciality:t({id:e(),price:t({amount:e(),currency:i()}).nullish()}),status:ct}),pt=r.array(r.object({id:r.string().uuid(),name:r.string(),code:r.string(),channel:O,price:r.object({amount:r.number(),currency:r.string()}).nullable()})),ht=r.array(r.object({id:r.string().uuid(),avatar:r.string().url().nullable(),description:r.string().nullable(),collegiate_number:r.string().nullable(),languages:r.array(r.string()),name:r.string(),slots:r.array(dt),speciality:r.object({id:r.number()}),tax_id:r.string().nullable()}));r.object({speciality_id:r.number(),organization_schedule_service_id:r.string().uuid(),closest_slots_days:r.number().optional(),slots_per_day:r.number().optional()}),r.object({service_id:r.string().uuid(),professional_hash:r.string().uuid(),starts_at:r.string(),finishes_at:r.string(),rescheduling_appointment_id:r.string().uuid().optional()});var ft=r.array(dt),mt=r.array(r.object({id:r.number(),name:r.string(),code:r.string().nullish(),price:r.object({amount:r.number(),currency:r.string()}).nullable()}));r.object({slot_id:r.string().uuid(),service_id:r.string().uuid().optional(),speciality_id:r.number().optional()});var gt=dt;u([p(1),p(2),p(3)]);var bt={Sent:1,Received:2,Read:3},yt=t({roomId:e(),messageId:i().uuid(),string:i(),status:e(),senderType:s(["ordinary","system"]),fromUserHash:i().uuid(),auto:u([p(0),p(1)]),createdAt:i().nullable(),deletedAt:i().nullable(),time:e().nullable()}),_t=t({file_name:i(),file_size:e(),url:i().url(),signed_url:i().url().nullable(),type:s(["uncategorized","voice_note"]),meta:t({duration:e()})}),vt=yt.extend({type:p("string"),attachment:d()}),wt=yt.extend({type:p("file"),attachment:_t}),Ct=yt.extend({type:p("image"),attachment:_t});t({roomId:e()});var Et=n(u([vt,wt,Ct]));t({roomId:e()});var Rt=t({unread_count:e()});t({professional_hash:i()});var Ot=t({room_id:e()});t({status:n(E).optional(),order:t({field:s(["starts_at"]).optional(),direction:s(["asc","desc"]).optional()}).optional(),page:e().optional(),per_page:e().optional()});var St=_(t({appointment:t({id:i().uuid(),url:i().url(),starts_at:i(),duration:e(),status:E,channel:O,expires_at:i().nullable(),service_id:i().uuid().nullable(),has_chat_in_appointment:c().optional()}),room:t({id:e()}),price:t({amount:e(),currency:i()}).nullable(),patient:t({hash:i().uuid()}),slots:n(h()),professional:t({hash:i().uuid(),name:i(),avatar:i().url().optional(),description:i().optional(),languages:n(i()),collegiate_number:i().optional()}),speciality:t({id:e(),name:i()})}));t({slot_id:i().uuid(),service_id:i().uuid(),consultation_reason:i().optional(),preconsultation_documents:n(t({file_path:i(),file_name:i()})).optional(),discount_code:i().optional()});var At=t({appointment:t({id:i().uuid()})});t({id:i().uuid()});var Tt=A,jt=t({file_path:i(),presigned_storage_url:i().url()});t({id:i().uuid(),slot_id:i().uuid(),consultation_reason:i().optional(),preconsultation_documents:n(t({file_path:i(),file_name:i()})).optional()}),t({id:i().uuid()}),t({appointment_id:i().uuid(),consultation_reason:i().optional()}),t({appointment_id:i().uuid(),file_path:i(),file_name:i()}),t({appointment_id:i().uuid(),document_id:i().uuid()}),t({appointmentId:i().uuid()}),r.object({api_key:r.string(),token:r.string()});var xt=r.object({access_token:r.string(),patient:r.object({hash:r.string(),country_code:r.string(),timezone:r.string(),first_name:r.string(),last_name:r.string().nullable(),name:r.string(),birth_date:r.string().nullable(),email:r.string().email().nullable(),language_code:r.string(),phone:r.string(),phone_prefix:r.string(),tax_id:r.string().nullable(),legal_consent:r.object({accepted_at:r.string().nullable(),last_version_at:r.string().nullable(),terms_url:r.string(),privacy_url:r.string(),has_commercial_communications:r.boolean(),organization_name:r.string()})})});t({file:f(File)});var Pt=t({url:i().url()});function kt(t,e){return function(){return t.apply(e,arguments)}}const{toString:Nt}=Object.prototype,{getPrototypeOf:Ut}=Object,{iterator:Lt,toStringTag:Dt}=Symbol,Ft=(Bt=Object.create(null),t=>{const e=Nt.call(t);return Bt[e]||(Bt[e]=e.slice(8,-1).toLowerCase())});var Bt;const It=t=>(t=t.toLowerCase(),e=>Ft(e)===t),$t=t=>e=>typeof e===t,{isArray:Mt}=Array,qt=$t("undefined");function zt(t){return null!==t&&!qt(t)&&null!==t.constructor&&!qt(t.constructor)&&Kt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Ht=It("ArrayBuffer");const Jt=$t("string"),Kt=$t("function"),Wt=$t("number"),Vt=t=>null!==t&&"object"==typeof t,Xt=t=>{if("object"!==Ft(t))return!1;const e=Ut(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Dt in t||Lt in t)},Gt=It("Date"),Zt=It("File"),Qt=It("Blob"),Yt=It("FileList"),te=It("URLSearchParams"),[ee,ne,re,ie]=["ReadableStream","Request","Response","Headers"].map(It);function se(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,i;if("object"!=typeof t&&(t=[t]),Mt(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{if(zt(t))return;const i=n?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length;let o;for(r=0;r<s;r++)o=i[r],e.call(null,t[o],o,t)}}function oe(t,e){if(zt(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r,i=n.length;for(;i-- >0;)if(r=n[i],e===r.toLowerCase())return r;return null}const ae="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,le=t=>!qt(t)&&t!==ae;const ce=(ue="undefined"!=typeof Uint8Array&&Ut(Uint8Array),t=>ue&&t instanceof ue);var ue;const de=It("HTMLFormElement"),pe=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),he=It("RegExp"),fe=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};se(n,(n,i)=>{let s;!1!==(s=e(n,i,t))&&(r[i]=s||n)}),Object.defineProperties(t,r)};const me=It("AsyncFunction"),ge=(be="function"==typeof setImmediate,ye=Kt(ae.postMessage),be?setImmediate:ye?(_e=`axios@${Math.random()}`,ve=[],ae.addEventListener("message",({source:t,data:e})=>{t===ae&&e===_e&&ve.length&&ve.shift()()},!1),t=>{ve.push(t),ae.postMessage(_e,"*")}):t=>setTimeout(t));var be,ye,_e,ve;const we="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ae):"undefined"!=typeof process&&process.nextTick||ge;var Ce={isArray:Mt,isArrayBuffer:Ht,isBuffer:zt,isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||Kt(t.append)&&("formdata"===(e=Ft(t))||"object"===e&&Kt(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&Ht(t.buffer),e},isString:Jt,isNumber:Wt,isBoolean:t=>!0===t||!1===t,isObject:Vt,isPlainObject:Xt,isEmptyObject:t=>{if(!Vt(t)||zt(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:ee,isRequest:ne,isResponse:re,isHeaders:ie,isUndefined:qt,isDate:Gt,isFile:Zt,isBlob:Qt,isRegExp:he,isFunction:Kt,isStream:t=>Vt(t)&&Kt(t.pipe),isURLSearchParams:te,isTypedArray:ce,isFileList:Yt,forEach:se,merge:function t(){const{caseless:e}=le(this)&&this||{},n={},r=(r,i)=>{const s=e&&oe(n,i)||i;Xt(n[s])&&Xt(r)?n[s]=t(n[s],r):Xt(r)?n[s]=t({},r):Mt(r)?n[s]=r.slice():n[s]=r};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&se(arguments[t],r);return n},extend:(t,e,n,{allOwnKeys:r}={})=>(se(e,(e,r)=>{n&&Kt(e)?t[r]=kt(e,n):t[r]=e},{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let i,s,o;const a={};if(e=e||{},null==t)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)o=i[s],r&&!r(o,t,e)||a[o]||(e[o]=t[o],a[o]=!0);t=!1!==n&&Ut(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:Ft,kindOfTest:It,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(Mt(t))return t;let e=t.length;if(!Wt(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[Lt]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:de,hasOwnProperty:pe,hasOwnProp:pe,reduceDescriptors:fe,freezeMethods:t=>{fe(t,(e,n)=>{if(Kt(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];Kt(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach(t=>{n[t]=!0})};return Mt(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,e,n){return e.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:oe,global:ae,isContextDefined:le,isSpecCompliantForm:function(t){return!!(t&&Kt(t.append)&&"FormData"===t[Dt]&&t[Lt])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(Vt(t)){if(e.indexOf(t)>=0)return;if(zt(t))return t;if(!("toJSON"in t)){e[r]=t;const i=Mt(t)?[]:{};return se(t,(t,e)=>{const s=n(t,r+1);!qt(s)&&(i[e]=s)}),e[r]=void 0,i}}return t};return n(t,0)},isAsyncFn:me,isThenable:t=>t&&(Vt(t)||Kt(t))&&Kt(t.then)&&Kt(t.catch),setImmediate:ge,asap:we,isIterable:t=>null!=t&&Kt(t[Lt])};function Ee(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}Ce.inherits(Ee,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ce.toJSONObject(this.config),code:this.code,status:this.status}}});const Re=Ee.prototype,Oe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Oe[t]={value:t}}),Object.defineProperties(Ee,Oe),Object.defineProperty(Re,"isAxiosError",{value:!0}),Ee.from=(t,e,n,r,i,s)=>{const o=Object.create(Re);return Ce.toFlatObject(t,o,function(t){return t!==Error.prototype},t=>"isAxiosError"!==t),Ee.call(o,t.message,e,n,r,i),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};function Se(t){return Ce.isPlainObject(t)||Ce.isArray(t)}function Ae(t){return Ce.endsWith(t,"[]")?t.slice(0,-2):t}function Te(t,e,n){return t?t.concat(e).map(function(t,e){return t=Ae(t),!n&&e?"["+t+"]":t}).join(n?".":""):e}const je=Ce.toFlatObject(Ce,{},null,function(t){return/^is[A-Z]/.test(t)});function xe(t,e,n){if(!Ce.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=Ce.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,e){return!Ce.isUndefined(e[t])})).metaTokens,i=n.visitor||c,s=n.dots,o=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Ce.isSpecCompliantForm(e);if(!Ce.isFunction(i))throw new TypeError("visitor must be a function");function l(t){if(null===t)return"";if(Ce.isDate(t))return t.toISOString();if(Ce.isBoolean(t))return t.toString();if(!a&&Ce.isBlob(t))throw new Ee("Blob is not supported. Use a Buffer instead.");return Ce.isArrayBuffer(t)||Ce.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function c(t,n,i){let a=t;if(t&&!i&&"object"==typeof t)if(Ce.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(Ce.isArray(t)&&function(t){return Ce.isArray(t)&&!t.some(Se)}(t)||(Ce.isFileList(t)||Ce.endsWith(n,"[]"))&&(a=Ce.toArray(t)))return n=Ae(n),a.forEach(function(t,r){!Ce.isUndefined(t)&&null!==t&&e.append(!0===o?Te([n],r,s):null===o?n:n+"[]",l(t))}),!1;return!!Se(t)||(e.append(Te(i,n,s),l(t)),!1)}const u=[],d=Object.assign(je,{defaultVisitor:c,convertValue:l,isVisitable:Se});if(!Ce.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!Ce.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),Ce.forEach(n,function(n,s){!0===(!(Ce.isUndefined(n)||null===n)&&i.call(e,n,Ce.isString(s)?s.trim():s,r,d))&&t(n,r?r.concat(s):[s])}),u.pop()}}(t),e}function Pe(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(t){return e[t]})}function ke(t,e){this._pairs=[],t&&xe(t,this,e)}const Ne=ke.prototype;function Ue(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Le(t,e,n){if(!e)return t;const r=n&&n.encode||Ue;Ce.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(s=i?i(e,n):Ce.isURLSearchParams(e)?e.toString():new ke(e,n).toString(r),s){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}Ne.append=function(t,e){this._pairs.push([t,e])},Ne.toString=function(t){const e=t?function(e){return t.call(this,e,Pe)}:Pe;return this._pairs.map(function(t){return e(t[0])+"="+e(t[1])},"").join("&")};class InterceptorManager{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Ce.forEach(this.handlers,function(e){null!==e&&t(e)})}}var De={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Fe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ke,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Be="undefined"!=typeof window&&"undefined"!=typeof document,Ie="object"==typeof navigator&&navigator||void 0,$e=Be&&(!Ie||["ReactNative","NativeScript","NS"].indexOf(Ie.product)<0),Me="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,qe=Be&&window.location.href||"http://localhost";var ze={...Object.freeze({__proto__:null,hasBrowserEnv:Be,hasStandardBrowserEnv:$e,hasStandardBrowserWebWorkerEnv:Me,navigator:Ie,origin:qe}),...Fe};function He(t){function e(t,n,r,i){let s=t[i++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),a=i>=t.length;if(s=!s&&Ce.isArray(r)?r.length:s,a)return Ce.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!o;r[s]&&Ce.isObject(r[s])||(r[s]=[]);return e(t,n,r[s],i)&&Ce.isArray(r[s])&&(r[s]=function(t){const e={},n=Object.keys(t);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],e[s]=t[s];return e}(r[s])),!o}if(Ce.isFormData(t)&&Ce.isFunction(t.entries)){const n={};return Ce.forEachEntry(t,(t,r)=>{e(function(t){return Ce.matchAll(/\w+|\[(\w*)]/g,t).map(t=>"[]"===t[0]?"":t[1]||t[0])}(t),r,n,0)}),n}return null}const Je={transitional:De,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,i=Ce.isObject(t);i&&Ce.isHTMLForm(t)&&(t=new FormData(t));if(Ce.isFormData(t))return r?JSON.stringify(He(t)):t;if(Ce.isArrayBuffer(t)||Ce.isBuffer(t)||Ce.isStream(t)||Ce.isFile(t)||Ce.isBlob(t)||Ce.isReadableStream(t))return t;if(Ce.isArrayBufferView(t))return t.buffer;if(Ce.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return xe(t,new ze.classes.URLSearchParams,{visitor:function(t,e,n,r){return ze.isNode&&Ce.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...e})}(t,this.formSerializer).toString();if((s=Ce.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return xe(s?{"files[]":t}:t,e&&new e,this.formSerializer)}}return i||r?(e.setContentType("application/json",!1),function(t,e,n){if(Ce.isString(t))try{return(e||JSON.parse)(t),Ce.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(n||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||Je.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(Ce.isResponse(t)||Ce.isReadableStream(t))return t;if(t&&Ce.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(n){if("SyntaxError"===t.name)throw Ee.from(t,Ee.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ze.classes.FormData,Blob:ze.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ce.forEach(["delete","get","head","post","put","patch"],t=>{Je.headers[t]={}});const Ke=Ce.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const We=Symbol("internals");function Ve(t){return t&&String(t).trim().toLowerCase()}function Xe(t){return!1===t||null==t?t:Ce.isArray(t)?t.map(Xe):String(t)}function Ge(t,e,n,r,i){return Ce.isFunction(r)?r.call(this,e,n):(i&&(e=n),Ce.isString(e)?Ce.isString(r)?-1!==e.indexOf(r):Ce.isRegExp(r)?r.test(e):void 0:void 0)}let Ze=class AxiosHeaders{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function i(t,e,n){const i=Ve(e);if(!i)throw new Error("header name must be a non-empty string");const s=Ce.findKey(r,i);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||e]=Xe(t))}const s=(t,e)=>Ce.forEach(t,(t,n)=>i(t,n,e));if(Ce.isPlainObject(t)||t instanceof this.constructor)s(t,e);else if(Ce.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))s((t=>{const e={};let n,r,i;return t&&t.split("\n").forEach(function(t){i=t.indexOf(":"),n=t.substring(0,i).trim().toLowerCase(),r=t.substring(i+1).trim(),!n||e[n]&&Ke[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e})(t),e);else if(Ce.isObject(t)&&Ce.isIterable(t)){let n,r,i={};for(const e of t){if(!Ce.isArray(e))throw TypeError("Object iterator must return a key-value pair");i[r=e[0]]=(n=i[r])?Ce.isArray(n)?[...n,e[1]]:[n,e[1]]:e[1]}s(i,e)}else null!=t&&i(e,t,n);return this}get(t,e){if(t=Ve(t)){const n=Ce.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(Ce.isFunction(e))return e.call(this,t,n);if(Ce.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Ve(t)){const n=Ce.findKey(this,t);return!(!n||void 0===this[n]||e&&!Ge(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function i(t){if(t=Ve(t)){const i=Ce.findKey(n,t);!i||e&&!Ge(0,n[i],i,e)||(delete n[i],r=!0)}}return Ce.isArray(t)?t.forEach(i):i(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const i=e[n];t&&!Ge(0,this[i],i,t,!0)||(delete this[i],r=!0)}return r}normalize(t){const e=this,n={};return Ce.forEach(this,(r,i)=>{const s=Ce.findKey(n,i);if(s)return e[s]=Xe(r),void delete e[i];const o=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,n)=>e.toUpperCase()+n)}(i):String(i).trim();o!==i&&delete e[i],e[o]=Xe(r),n[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return Ce.forEach(this,(n,r)=>{null!=n&&!1!==n&&(e[r]=t&&Ce.isArray(n)?n.join(", "):n)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach(t=>n.set(t)),n}static accessor(t){const e=(this[We]=this[We]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=Ve(t);e[r]||(!function(t,e){const n=Ce.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(t,n,i){return this[r].call(this,e,t,n,i)},configurable:!0})})}(n,t),e[r]=!0)}return Ce.isArray(t)?t.forEach(r):r(t),this}};function Qe(t,e){const n=this||Je,r=e||n,i=Ze.from(r.headers);let s=r.data;return Ce.forEach(t,function(t){s=t.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function Ye(t){return!(!t||!t.__CANCEL__)}function tn(t,e,n){Ee.call(this,t??"canceled",Ee.ERR_CANCELED,e,n),this.name="CanceledError"}function en(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new Ee("Request failed with status code "+n.status,[Ee.ERR_BAD_REQUEST,Ee.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}Ze.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ce.reduceDescriptors(Ze.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}}),Ce.freezeMethods(Ze),Ce.inherits(tn,Ee,{__CANCEL__:!0});const nn=(t,e,n=3)=>{let r=0;const i=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i,s=0,o=0;return e=void 0!==e?e:1e3,function(a){const l=Date.now(),c=r[o];i||(i=l),n[s]=a,r[s]=l;let u=o,d=0;for(;u!==s;)d+=n[u++],u%=t;if(s=(s+1)%t,s===o&&(o=(o+1)%t),l-i<e)return;const p=c&&l-c;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(t,e){let n,r,i=0,s=1e3/e;const o=(e,s=Date.now())=>{i=s,n=null,r&&(clearTimeout(r),r=null),t(...e)};return[(...t)=>{const e=Date.now(),a=e-i;a>=s?o(t,e):(n=t,r||(r=setTimeout(()=>{r=null,o(n)},s-a)))},()=>n&&o(n)]}(n=>{const s=n.loaded,o=n.lengthComputable?n.total:void 0,a=s-r,l=i(a);r=s;t({loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&s<=o?(o-s)/l:void 0,event:n,lengthComputable:null!=o,[e?"download":"upload"]:!0})},n)},rn=(t,e)=>{const n=null!=t;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},sn=t=>(...e)=>Ce.asap(()=>t(...e));var on=ze.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,ze.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(ze.origin),ze.navigator&&/(msie|trident)/i.test(ze.navigator.userAgent)):()=>!0,an=ze.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const o=[t+"="+encodeURIComponent(e)];Ce.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),Ce.isString(r)&&o.push("path="+r),Ce.isString(i)&&o.push("domain="+i),!0===s&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function ln(t,e,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);return t&&(r||0==n)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const cn=t=>t instanceof Ze?{...t}:t;function un(t,e){e=e||{};const n={};function r(t,e,n,r){return Ce.isPlainObject(t)&&Ce.isPlainObject(e)?Ce.merge.call({caseless:r},t,e):Ce.isPlainObject(e)?Ce.merge({},e):Ce.isArray(e)?e.slice():e}function i(t,e,n,i){return Ce.isUndefined(e)?Ce.isUndefined(t)?void 0:r(void 0,t,0,i):r(t,e,0,i)}function s(t,e){if(!Ce.isUndefined(e))return r(void 0,e)}function o(t,e){return Ce.isUndefined(e)?Ce.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function a(n,i,s){return s in e?r(n,i):s in t?r(void 0,n):void 0}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(t,e,n)=>i(cn(t),cn(e),0,!0)};return Ce.forEach(Object.keys({...t,...e}),function(r){const s=l[r]||i,o=s(t[r],e[r],r);Ce.isUndefined(o)&&s!==a||(n[r]=o)}),n}var dn=t=>{const e=un({},t);let n,{data:r,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:l}=e;if(e.headers=a=Ze.from(a),e.url=Le(ln(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),Ce.isFormData(r))if(ze.hasStandardBrowserEnv||ze.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[t,...e]=n?n.split(";").map(t=>t.trim()).filter(Boolean):[];a.setContentType([t||"multipart/form-data",...e].join("; "))}if(ze.hasStandardBrowserEnv&&(i&&Ce.isFunction(i)&&(i=i(e)),i||!1!==i&&on(e.url))){const t=s&&o&&an.read(o);t&&a.set(s,t)}return e};var pn="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise(function(e,n){const r=dn(t);let i=r.data;const s=Ze.from(r.headers).normalize();let o,a,l,c,u,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=r;function f(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(o),r.signal&&r.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=Ze.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());en(function(t){e(t),f()},function(t){n(t),f()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:t,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Ee("Request aborted",Ee.ECONNABORTED,t,m)),m=null)},m.onerror=function(){n(new Ee("Network Error",Ee.ERR_NETWORK,t,m)),m=null},m.ontimeout=function(){let e=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||De;r.timeoutErrorMessage&&(e=r.timeoutErrorMessage),n(new Ee(e,i.clarifyTimeoutError?Ee.ETIMEDOUT:Ee.ECONNABORTED,t,m)),m=null},void 0===i&&s.setContentType(null),"setRequestHeader"in m&&Ce.forEach(s.toJSON(),function(t,e){m.setRequestHeader(e,t)}),Ce.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),h&&([l,u]=nn(h,!0),m.addEventListener("progress",l)),p&&m.upload&&([a,c]=nn(p),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(o=e=>{m&&(n(!e||e.type?new tn(null,t,m):e),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(o),r.signal&&(r.signal.aborted?o():r.signal.addEventListener("abort",o)));const b=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(r.url);b&&-1===ze.protocols.indexOf(b)?n(new Ee("Unsupported protocol "+b+":",Ee.ERR_BAD_REQUEST,t)):m.send(i||null)})};const hn=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n,r=new AbortController;const i=function(t){if(!n){n=!0,o();const e=t instanceof Error?t:this.reason;r.abort(e instanceof Ee?e:new tn(e instanceof Error?e.message:e))}};let s=e&&setTimeout(()=>{s=null,i(new Ee(`timeout ${e} of ms exceeded`,Ee.ETIMEDOUT))},e);const o=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(i):t.removeEventListener("abort",i)}),t=null)};t.forEach(t=>t.addEventListener("abort",i));const{signal:a}=r;return a.unsubscribe=()=>Ce.asap(o),a}},fn=function*(t,e){let n=t.byteLength;if(n<e)return void(yield t);let r,i=0;for(;i<n;)r=i+e,yield t.slice(i,r),i=r},mn=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},gn=(t,e,n,r)=>{const i=async function*(t,e){for await(const n of mn(t))yield*fn(n,e)}(t,e);let s,o=0,a=t=>{s||(s=!0,r&&r(t))};return new ReadableStream({async pull(t){try{const{done:e,value:r}=await i.next();if(e)return a(),void t.close();let s=r.byteLength;if(n){let t=o+=s;n(t)}t.enqueue(new Uint8Array(r))}catch(t){throw a(t),t}},cancel:t=>(a(t),i.return())},{highWaterMark:2})},bn="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,yn=bn&&"function"==typeof ReadableStream,_n=bn&&("function"==typeof TextEncoder?(vn=new TextEncoder,t=>vn.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var vn;const wn=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},Cn=yn&&wn(()=>{let t=!1;const e=new Request(ze.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),En=yn&&wn(()=>Ce.isReadableStream(new Response("").body)),Rn={stream:En&&(t=>t.body)};var On;bn&&(On=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Rn[t]&&(Rn[t]=Ce.isFunction(On[t])?e=>e[t]():(e,n)=>{throw new Ee(`Response type '${t}' is not supported`,Ee.ERR_NOT_SUPPORT,n)})}));const Sn=async(t,e)=>{const n=Ce.toFiniteNumber(t.getContentLength());return n??(async t=>{if(null==t)return 0;if(Ce.isBlob(t))return t.size;if(Ce.isSpecCompliantForm(t)){const e=new Request(ze.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return Ce.isArrayBufferView(t)||Ce.isArrayBuffer(t)?t.byteLength:(Ce.isURLSearchParams(t)&&(t+=""),Ce.isString(t)?(await _n(t)).byteLength:void 0)})(e)};const An={http:null,xhr:pn,fetch:bn&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:p}=dn(t);c=c?(c+"").toLowerCase():"text";let h,f=hn([i,s&&s.toAbortSignal()],o);const m=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let g;try{if(l&&Cn&&"get"!==n&&"head"!==n&&0!==(g=await Sn(u,r))){let t,n=new Request(e,{method:"POST",body:r,duplex:"half"});if(Ce.isFormData(r)&&(t=n.headers.get("content-type"))&&u.setContentType(t),n.body){const[t,e]=rn(g,nn(sn(l)));r=gn(n.body,65536,t,e)}}Ce.isString(d)||(d=d?"include":"omit");const i="credentials"in Request.prototype;h=new Request(e,{...p,signal:f,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:i?d:void 0});let s=await fetch(h,p);const o=En&&("stream"===c||"response"===c);if(En&&(a||o&&m)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=s[e]});const e=Ce.toFiniteNumber(s.headers.get("content-length")),[n,r]=a&&rn(e,nn(sn(a),!0))||[];s=new Response(gn(s.body,65536,n,()=>{r&&r(),m&&m()}),t)}c=c||"text";let b=await Rn[Ce.findKey(Rn,c)||"text"](s,t);return!o&&m&&m(),await new Promise((e,n)=>{en(e,n,{data:b,headers:Ze.from(s.headers),status:s.status,statusText:s.statusText,config:t,request:h})})}catch(e){if(m&&m(),e&&"TypeError"===e.name&&/Load failed|fetch/i.test(e.message))throw Object.assign(new Ee("Network Error",Ee.ERR_NETWORK,t,h),{cause:e.cause||e});throw Ee.from(e,e&&e.code,t,h)}})};Ce.forEach(An,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}});const Tn=t=>`- ${t}`,jn=t=>Ce.isFunction(t)||null===t||!1===t;var xn=t=>{t=Ce.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let s=0;s<e;s++){let e;if(n=t[s],r=n,!jn(n)&&(r=An[(e=String(n)).toLowerCase()],void 0===r))throw new Ee(`Unknown adapter '${e}'`);if(r)break;i[e||"#"+s]=r}if(!r){const t=Object.entries(i).map(([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build"));throw new Ee("There is no suitable adapter to dispatch the request "+(e?t.length>1?"since :\n"+t.map(Tn).join("\n"):" "+Tn(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Pn(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new tn(null,t)}function kn(t){Pn(t),t.headers=Ze.from(t.headers),t.data=Qe.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return xn(t.adapter||Je.adapter)(t).then(function(e){return Pn(t),e.data=Qe.call(t,t.transformResponse,e),e.headers=Ze.from(e.headers),e},function(e){return Ye(e)||(Pn(t),e&&e.response&&(e.response.data=Qe.call(t,t.transformResponse,e.response),e.response.headers=Ze.from(e.response.headers))),Promise.reject(e)})}const Nn="1.11.0",Un={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Un[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Ln={};Un.transitional=function(t,e,n){function r(t,e){return"[Axios v"+Nn+"] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,i,s)=>{if(!1===t)throw new Ee(r(i," has been removed"+(e?" in "+e:"")),Ee.ERR_DEPRECATED);return e&&!Ln[i]&&(Ln[i]=!0,console.warn(r(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,i,s)}},Un.spelling=function(t){return(e,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};var Dn={assertOptions:function(t,e,n){if("object"!=typeof t)throw new Ee("options must be an object",Ee.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const s=r[i],o=e[s];if(o){const e=t[s],n=void 0===e||o(e,s,t);if(!0!==n)throw new Ee("option "+s+" must be "+n,Ee.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Ee("Unknown option "+s,Ee.ERR_BAD_OPTION)}},validators:Un};const Fn=Dn.validators;let Bn=class Axios{constructor(t){this.defaults=t||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const n=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?n&&!String(t.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+n):t.stack=n}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=un(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:i}=e;void 0!==n&&Dn.assertOptions(n,{silentJSONParsing:Fn.transitional(Fn.boolean),forcedJSONParsing:Fn.transitional(Fn.boolean),clarifyTimeoutError:Fn.transitional(Fn.boolean)},!1),null!=r&&(Ce.isFunction(r)?e.paramsSerializer={serialize:r}:Dn.assertOptions(r,{encode:Fn.function,serialize:Fn.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Dn.assertOptions(e,{baseUrl:Fn.spelling("baseURL"),withXsrfToken:Fn.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=i&&Ce.merge(i.common,i[e.method]);i&&Ce.forEach(["delete","get","head","post","put","patch","common"],t=>{delete i[t]}),e.headers=Ze.concat(s,i);const o=[];let a=!0;this.interceptors.request.forEach(function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,o.unshift(t.fulfilled,t.rejected))});const l=[];let c;this.interceptors.response.forEach(function(t){l.push(t.fulfilled,t.rejected)});let u,d=0;if(!a){const t=[kn.bind(this),void 0];for(t.unshift(...o),t.push(...l),u=t.length,c=Promise.resolve(e);d<u;)c=c.then(t[d++],t[d++]);return c}u=o.length;let p=e;for(d=0;d<u;){const t=o[d++],e=o[d++];try{p=t(p)}catch(t){e.call(this,t);break}}try{c=kn.call(this,p)}catch(t){return Promise.reject(t)}for(d=0,u=l.length;d<u;)c=c.then(l[d++],l[d++]);return c}getUri(t){return Le(ln((t=un(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}};Ce.forEach(["delete","get","head","options"],function(t){Bn.prototype[t]=function(e,n){return this.request(un(n||{},{method:t,url:e,data:(n||{}).data}))}}),Ce.forEach(["post","put","patch"],function(t){function e(e){return function(n,r,i){return this.request(un(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Bn.prototype[t]=e(),Bn.prototype[t+"Form"]=e(!0)});const In={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(In).forEach(([t,e])=>{In[e]=t});const $n=function t(e){const n=new Bn(e),r=kt(Bn.prototype.request,n);return Ce.extend(r,Bn.prototype,n,{allOwnKeys:!0}),Ce.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(un(e,n))},r}(Je);$n.Axios=Bn,$n.CanceledError=tn,$n.CancelToken=class CancelToken{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(t){e=t});const n=this;this.promise.then(t=>{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null}),this.promise.then=t=>{let e;const r=new Promise(t=>{n.subscribe(t),e=t}).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t(function(t,r,i){n.reason||(n.reason=new tn(t,r,i),e(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new CancelToken(function(e){t=e}),cancel:t}}},$n.isCancel=Ye,$n.VERSION=Nn,$n.toFormData=xe,$n.AxiosError=Ee,$n.Cancel=$n.CanceledError,$n.all=function(t){return Promise.all(t)},$n.spread=function(t){return function(e){return t.apply(null,e)}},$n.isAxiosError=function(t){return Ce.isObject(t)&&!0===t.isAxiosError},$n.mergeConfig=un,$n.AxiosHeaders=Ze,$n.formToJSON=t=>He(Ce.isHTMLForm(t)?new FormData(t):t),$n.getAdapter=xn,$n.HttpStatusCode=In,$n.default=$n;const{Axios:Mn,AxiosError:qn,CanceledError:zn,isCancel:Hn,CancelToken:Jn,VERSION:Kn,all:Wn,Cancel:Vn,isAxiosError:Xn,spread:Gn,toFormData:Zn,AxiosHeaders:Qn,HttpStatusCode:Yn,formToJSON:tr,getAdapter:er,mergeConfig:nr}=$n;var rr=class{constructor(t,e){this.httpClient=t,this.validate=e}async getAppointments(t){return this.httpClient.get("/appointments/v1",{params:t}).then(this.validate(St))}async createAppointment(t){return this.httpClient.post(`/appointments/v1/slots/${t.slot_id}`,t).then(t=>t.data).then(this.validate(At))}async getAppointment(t){return this.httpClient.get(`/api/v1/appointments/${t.id}`).then(t=>t.data).then(this.validate(Tt))}async getDocumentsStorage(){return this.httpClient.get("/appointments/v1/documents/storage").then(t=>t.data).then(this.validate(jt))}async rescheduleAppointment(t){const{id:e,...n}=t;return this.httpClient.put(`/appointments/v1/${e}/reschedule`,n)}async cancelAppointment(t){return this.httpClient.put(`/appointments/v1/${t.id}/cancel`)}async updateAppointment(t){const{appointment_id:e,...n}=t;return this.httpClient.put(`/appointments/v1/${e}/update`,n)}async addDocument(t){const{appointment_id:e,...n}=t;return this.httpClient.post(`/appointments/v1/${e}/consultation-document`,n)}async deleteDocument(t){return this.httpClient.delete(`/appointments/v1/${t.appointment_id}/consultation-document/${t.document_id}`)}async reconnectAppointment(t){return this.httpClient.put(`/appointments/v1/${t.appointmentId}/reconnect`)}},ir=class{constructor(t,e){this.httpClient=t,this.validate=e}async loginToken(t){return this.httpClient.post("/login/v1/token",{token:t.token},{headers:{"x-api-key":t.api_key}}).then(this.validate(xt))}};var sr=class{constructor(t,e){this.httpClient=t,this.validate=e}async postReview(t){return this.httpClient.post("/consultations/v1/review",t)}async startChatConsultation(t){return this.httpClient.put(`/consultations/v1/chat/professionals/${encodeURIComponent(t)}/consult`).then(()=>{})}async getReview(t){return this.httpClient.get(`/consultations/v1/review/${t}`).then(t=>t.data).then(this.validate(z))}},or=class{constructor(t,e){this.httpClient=t,this.validate=e}async uploadFile(t){const e=new FormData;return e.append("file",t.file,t.file.name),this.httpClient.post("/documents/v1/upload-file",e,{headers:{"Content-Type":"multipart/form-data"}}).then(this.validate(Pt))}},ar=class{constructor(t,e){this.httpClient=t,this.validate=e}async getAppointment(t){return this.httpClient.get(`/flash/v1/appointments/${t.appointmentId}`).then(t=>t.data).then(this.validate(I))}async joinCall(t){return this.httpClient.get(`/flash/v1/calls/${t.callId}/join`).then(t=>t.data).then(this.validate($))}async setReady(t){return this.httpClient.post(`/flash/v1/waiting/${t.professional_hash}/ready`,{consultation_id:t.consultation_id,consultation_type:t.consultation_type})}async leaveWaitingRoom(t){return this.httpClient.post(`/flash/v1/waiting/${t.professional_hash}/leave`,{consultation_id:t.consultation_id,consultation_type:t.consultation_type})}async getSharedDocuments(t){return this.httpClient.get(`/flash/v1/appointments/${t.appointment_id}/documents`).then(t=>t.data).then(this.validate(M))}async downloadDocument(t){return this.httpClient.get(t.url,{responseType:"blob"}).then(t=>t.data)}async updatePatientProfile(t){return this.httpClient.put("/flash/v1/profile",t)}async getPatientDocuments(t){return this.httpClient.get(`/flash/v1/patients/${t.patient_hash}/documents`,{params:{page:t.page,per_page:t.per_page}}).then(this.validate(q))}},lr=class{constructor(t,e){this.httpClient=t,this.validate=e}async getOrganizationSpecialties(){return this.httpClient.get("/organizations/v1/specialities").then(t=>t.data).then(this.validate(et))}async getOrganizationSetup(){return this.httpClient.get("/organizations/v1/setup").then(t=>t.data).then(this.validate(nt))}},cr=class{constructor(t,e){this.httpClient=t,this.validate=e}async createPaymentLink(t){const{specialty_id:e,...n}=t,r={...n,speciality_id:e};return this.httpClient.post("/payments/v1/schedule",r).then(t=>t.data).then(this.validate(W))}async createImmediateVideocallPaymentLink(t){return this.httpClient.post("/payments/v1/immediate-videocall",t).then(t=>t.data).then(this.validate(V))}async createChatConsultationPaymentLink(t){return this.httpClient.post("/payments/v1/schedule",t).then(t=>t.data).then(this.validate(X))}async getConsultationCoupon(t,e){return this.httpClient.get(`/payments/v1/consultation-coupon/${encodeURIComponent(t)}`,{params:{amount:e}}).then(t=>t.data).then(this.validate(H))}async getAppointmentConsultationCoupon(t){return this.httpClient.get(`/payments/v1/appointment/${encodeURIComponent(t)}/consultation-coupon`).then(t=>t.data).then(this.validate(J))}async getPaymentSession(t){return this.httpClient.get(`/payments/v1/session/${t}`).then(t=>t.data).then(this.validate(Z))}async validateApplePayMerchant(t){return this.httpClient.post("/payments/v1/apple-pay/validate-merchant",t).then(this.validate(Q))}async authorizeApplePay(t){return this.httpClient.post("/payments/v1/apple-pay/authorize",t).then(this.validate(Y))}async authorizeGooglePay(t){return this.httpClient.post("/payments/v1/google-pay/authorize",t).then(this.validate(tt))}},ur=class{constructor(t,e){this.httpClient=t,this.validate=e}async getProfessional(t){return this.httpClient.get(`sdk/v1/professionals/${t.hash}`).then(t=>t.data).then(this.validate(st))}async readAllMessages(t){return this.httpClient.put(`sdk/v1/rooms/${t.roomId}/messages/read`).then(t=>t.data)}},dr=class{constructor(t,e){this.httpClient=t,this.validate=e}async getPatientProfile(){return this.httpClient.get("/profile/v1/patients").then(t=>t.data).then(this.validate(at))}async getProfessionalPublicProfile(t){return this.httpClient.get(`/profile/v1/public/professionals/${t.hash}`).then(t=>t.data).then(this.validate(lt))}async acceptLegalConsent(t){return this.httpClient.post("/profile/v1/legal-consent",t)}},pr=class{constructor(t,e){this.httpClient=t,this.validate=e}async getRoomMessages(t){return this.httpClient.get(`api/v1/rooms/${t.roomId}/messages`).then(t=>t.data).then(this.validate(Et))}async getUnreadMessagesCount(t){return this.httpClient.get(`chat/v1/${t.roomId}/unread-count`).then(t=>t.data).then(this.validate(Rt))}async createSupportRoom(t){return this.httpClient.post("chat/v1/support-room",t).then(t=>t.data).then(this.validate(Ot))}},hr=class{constructor(t,e){this.httpClient=t,this.validate=e}async getScheduleServices(){return this.httpClient.get("/schedules/v1/services").then(t=>t.data).then(this.validate(pt))}async getProfessionalsBySpecialtyAndService(t){return this.httpClient.get("/schedules/v1/professionals",{params:t}).then(t=>t.data).then(this.validate(ht))}async getScheduleServiceProfessionalSlots(t){return this.httpClient.get(`/schedules/v1/services/${t.service_id}/professionals/${t.professional_hash}/slots`,{params:{starts_at:t.starts_at,finishes_at:t.finishes_at,rescheduling_appointment_id:t.rescheduling_appointment_id}}).then(t=>t.data).then(this.validate(ft))}async getScheduleServiceSpecialities(t){return this.httpClient.get(`/schedules/v1/services/${t}/specialities`).then(t=>t.data).then(this.validate(mt))}async getScheduleSlot(t){return this.httpClient.get(`schedules/v1/slot/${t.slot_id}`,{params:{service_id:t.service_id,speciality_id:t.speciality_id}}).then(t=>t.data).then(this.validate(gt))}};var fr={development:"https://chat-dev.mediquo.com",production:"https://chat.mediquo.com"},mr=class{constructor({env:t="production",baseURL:e,debug:n}={}){const r=e??fr[t];var i;this.httpClient=(i=r,$n.create({baseURL:i,headers:{"Content-Type":"application/json"}}));const s=(o={debug:n},t=>e=>{const n=t.safeParse(e.data);if(n.error&&o?.debug){const t=e.config?.url??"";console.warn(`[Validation Error]${t?` - URL: ${t}`:""}\n${r=n.error,r.issues.map(t=>`${t.path.join(".")}: ${t.message}`).join("\n")}`)}var r;return n.data??e.data});var o;this.flash=new ar(this.httpClient,s),this.auth=new ir(this.httpClient,s),this.appointments=new rr(this.httpClient,s),this.payments=new cr(this.httpClient,s),this.schedules=new hr(this.httpClient,s),this.organizations=new lr(this.httpClient,s),this.profile=new dr(this.httpClient,s),this.professionals=new ur(this.httpClient,s),this.rooms=new pr(this.httpClient,s),this.documents=new or(this.httpClient,s),this.consultations=new sr(this.httpClient,s)}setAuthToken(t){this.httpClient.defaults.headers.common.Authorization=`Bearer ${t}`}setApiKey(t){this._apiKey=t,this.httpClient.defaults.headers.common["x-api-key"]=t}getApiKey(){return this._apiKey}setLanguage(t){this.httpClient.defaults.headers.common["Accept-Language"]=t}};let gr=null,br=null;const yr=new Proxy({},{get:(t,e)=>(gr&&br===y.MODE||(gr=new mr({env:y.MODE,debug:"development"===y.MODE}),br=y.MODE),gr)[e]});export{S as A,j as C,N as D,bt as M,G as P,ut as S,yr as a,v as b,R as c,ot as d,Xn as e,K as f,C as g,w as h,P as i,F as j,B as k,x as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as n}from"./api-chat-client-
|
|
1
|
+
import{P as n}from"./api-chat-client-BiiYnU-b.js";function e(e,r,t){return e===n.Paid?{kind:"success",sessionId:t,reference:r}:e===n.Denied?{kind:"denied",sessionId:t}:{kind:"error",reason:"authorize"}}function r(n){const e=n.merchant_session;return null===e||"object"!=typeof e||Array.isArray(e)?n:e}function t(n){if("string"==typeof n)return n;if(null!==n&&"object"==typeof n&&"paymentData"in n){const e=n.paymentData;if("string"==typeof e)return e;if(null!=e)return JSON.stringify(e)}return JSON.stringify(n)}export{e as r,t as s,r as u};
|
|
@@ -18,6 +18,7 @@ declare const GetAppointmentsResponseSchema: z.ZodObject<{
|
|
|
18
18
|
channel: z.ZodEnum<["videocall", "chat", "phonecall"]>;
|
|
19
19
|
expires_at: z.ZodNullable<z.ZodString>;
|
|
20
20
|
service_id: z.ZodNullable<z.ZodString>;
|
|
21
|
+
has_chat_in_appointment: z.ZodOptional<z.ZodBoolean>;
|
|
21
22
|
}, "strip", z.ZodTypeAny, {
|
|
22
23
|
url: string;
|
|
23
24
|
status: "pending" | "expired" | "accepted" | "inCall" | "declined" | "cancelled" | "finished" | "free_of_charge" | "owed" | "unpaid" | "reporting";
|
|
@@ -27,6 +28,7 @@ declare const GetAppointmentsResponseSchema: z.ZodObject<{
|
|
|
27
28
|
expires_at: string | null;
|
|
28
29
|
service_id: string | null;
|
|
29
30
|
starts_at: string;
|
|
31
|
+
has_chat_in_appointment?: boolean | undefined;
|
|
30
32
|
}, {
|
|
31
33
|
url: string;
|
|
32
34
|
status: "pending" | "expired" | "accepted" | "inCall" | "declined" | "cancelled" | "finished" | "free_of_charge" | "owed" | "unpaid" | "reporting";
|
|
@@ -36,6 +38,7 @@ declare const GetAppointmentsResponseSchema: z.ZodObject<{
|
|
|
36
38
|
expires_at: string | null;
|
|
37
39
|
service_id: string | null;
|
|
38
40
|
starts_at: string;
|
|
41
|
+
has_chat_in_appointment?: boolean | undefined;
|
|
39
42
|
}>;
|
|
40
43
|
room: z.ZodObject<{
|
|
41
44
|
id: z.ZodNumber;
|
|
@@ -112,6 +115,7 @@ declare const GetAppointmentsResponseSchema: z.ZodObject<{
|
|
|
112
115
|
expires_at: string | null;
|
|
113
116
|
service_id: string | null;
|
|
114
117
|
starts_at: string;
|
|
118
|
+
has_chat_in_appointment?: boolean | undefined;
|
|
115
119
|
};
|
|
116
120
|
room: {
|
|
117
121
|
id: number;
|
|
@@ -146,6 +150,7 @@ declare const GetAppointmentsResponseSchema: z.ZodObject<{
|
|
|
146
150
|
expires_at: string | null;
|
|
147
151
|
service_id: string | null;
|
|
148
152
|
starts_at: string;
|
|
153
|
+
has_chat_in_appointment?: boolean | undefined;
|
|
149
154
|
};
|
|
150
155
|
room: {
|
|
151
156
|
id: number;
|
|
@@ -198,6 +203,7 @@ declare const GetAppointmentsResponseSchema: z.ZodObject<{
|
|
|
198
203
|
expires_at: string | null;
|
|
199
204
|
service_id: string | null;
|
|
200
205
|
starts_at: string;
|
|
206
|
+
has_chat_in_appointment?: boolean | undefined;
|
|
201
207
|
};
|
|
202
208
|
room: {
|
|
203
209
|
id: number;
|
|
@@ -240,6 +246,7 @@ declare const GetAppointmentsResponseSchema: z.ZodObject<{
|
|
|
240
246
|
expires_at: string | null;
|
|
241
247
|
service_id: string | null;
|
|
242
248
|
starts_at: string;
|
|
249
|
+
has_chat_in_appointment?: boolean | undefined;
|
|
243
250
|
};
|
|
244
251
|
room: {
|
|
245
252
|
id: number;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
2
|
import * as lit from 'lit';
|
|
3
3
|
import { LitElement } from 'lit';
|
|
4
|
-
import { G as GetAppointmentsResponse } from './appointment-action-unavailable-dialog-
|
|
5
|
-
import './appointment-details-
|
|
4
|
+
import { G as GetAppointmentsResponse } from './appointment-action-unavailable-dialog-Da2IATYj.js';
|
|
5
|
+
import './appointment-details-CVEDe_k0.js';
|
|
6
6
|
import '../ui/mq-card.js';
|
|
7
7
|
import './professional-overview-mO3tuMuH.js';
|
|
8
8
|
import { L as LoginTokenResponse } from './schemas.d-D7bCe24u.js';
|
|
9
|
-
import './mq-chat-room-
|
|
9
|
+
import './mq-chat-room-CRPruRJD.js';
|
|
10
10
|
import '../ui/mq-floating-bubble.js';
|
|
11
11
|
import '../ui/mq-button.js';
|
|
12
12
|
import '../ui/mq-unread-badge.js';
|
package/dist/chunks/{appointment-card-skeleton-CwIuoOXV.js → appointment-card-skeleton-ZfTAElLq.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{c as i}from"./consume-BhoQNO_8.js";import{m as a}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{Q as n}from"./query-controller-D7jBX4X7.js";import{g as s}from"./get-organization-setup-query-DxHNY0w8.js";import{g as p,a as r}from"./i18n-formats-EgnwLxKt.js";import{g as l}from"./get-schedule-services-query-Ckvz9Fqh.js";import{g as c}from"./chunk-Y4EKUX25-CqL3lLdx.js";import{a as d,i as h,E as m,x as u}from"./lit-element-DiWJYFwC.js";import{n as g}from"./property-scuRaFcM.js";import{r as v}from"./state-LQivXIgA.js";import{getLocale as f}from"../i18n.js";import{a as y,A as b,i as $}from"./api-chat-client-BsiZ3A6g.js";import"./appointment-details-D7Rw3Hyl.js";import"../ui/mq-card.js";import"./professional-overview-C4H_znIJ.js";import{l as C}from"./chunk-S5RWG6G2-DPesx3Od.js";import"../mq-chat-room.js";import"../ui/mq-floating-bubble.js";import{g as x}from"./action-unavailable-message-CzRDRmk9.js";import{t as k,c as q,e as R,f as j,g as w,h as S,i as D}from"./telemetry-client-Bkbn48Dd.js";import{e as O}from"./class-map-Co76I6aw.js";import{MqAppointmentRescheduleEvent as I,MqAppointmentBookEvent as M,MqAppointmentJoinVideocallEvent as U,MqAppointmentViewDocumentationEvent as _}from"../events.js";import{messageBubbleIcon as H}from"../ui/icons/message-bubble-icon.js";import{videoIcon as z}from"../ui/icons/video-icon.js";import"../ui/mq-button.js";import"../ui/mq-unread-badge.js";import{c as A}from"./refund-cancel-policy-qaBi5AHH.js";import{toast as E}from"../ui/mq-toast.js";let N=class AppointmentCardActions extends d{constructor(){super(...arguments),this.variant="next",this.isVideocall=!1,this.hasChatSupport=!1,this.unreadCount=0,this.isModifyUnavailable=!1,this.isCancelUnavailable=!1,this.hasNoSlots=!1,this.modifyUnavailableMessage="",this.cancelUnavailableMessage="",this.repeatTarget=null,this.professionalHash="",this.openDialog=null,this.handleModifyClick=()=>{this.isModifyUnavailable?this.openDialog="modify":(k.track(q(this.patientHash,this.appointmentId)),this.dispatchEvent(new I({appointmentId:this.appointmentId})))},this.handleCancelClick=()=>{this.isCancelUnavailable?this.openDialog="cancel":(k.track(R(this.patientHash,this.appointmentId)),this.dispatchEvent(new CustomEvent("request-cancel",{bubbles:!0,composed:!0})))},this.handleRepeatClick=()=>{this.hasNoSlots?this.openDialog="repeat-no-slots":this.repeatTarget?(k.track(j(this.patientHash,this.appointmentId)),this.dispatchEvent(new M({specialty:this.repeatTarget.specialty,service:this.repeatTarget.service,professional:this.professionalHash}))):this.openDialog="repeat-error"},this.handleDialogClose=()=>{this.openDialog=null}}static{this.styles=h`:host{display:contents}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-2)}.actions.next{flex-direction:column}.actions-secondary{display:flex;gap:var(--sp-3)}.actions mq-button{flex:1}`}get patientHash(){return this.loginToken.patient.hash}renderChatButton(){return u`<mq-button variant="primary" fullwidth noPadding @click="${()=>{this.dispatchEvent(new CustomEvent("toggle-chat",{bubbles:!0,composed:!0}))}}">${H({size:24})} ${a("Chat")} ${this.unreadCount>0?u`<mq-unread-badge></mq-unread-badge>`:m}</mq-button>`}renderNextActions(){return u`${this.isVideocall?u`<mq-button variant="outline" fullwidth noPadding @click="${()=>{k.track(w(this.patientHash,this.appointmentId)),this.dispatchEvent(new U({appointmentId:this.appointmentId}))}}">${z({size:24})} ${a("Ir a videollamada")}</mq-button>`:m}<div class="actions-secondary">${this.hasChatSupport?this.renderChatButton():m}<mq-button variant="outline" fullwidth noPadding @click="${this.handleModifyClick}">${a("Modificar")}</mq-button><mq-button variant="outline-negative" fullwidth noPadding @click="${this.handleCancelClick}">${a("Cancelar")}</mq-button></div>`}renderHistoryActions(){return u`${this.hasChatSupport?this.renderChatButton():m}<mq-button variant="outline" fullwidth noPadding @click="${()=>{k.track(S(this.patientHash,this.appointmentId)),this.dispatchEvent(new _({appointmentId:this.appointmentId}))}}">${a("Documentos")}</mq-button><mq-button variant="outline" fullwidth noPadding @click="${this.handleRepeatClick}">${a("Repetir")}</mq-button>`}render(){return u`<div class="${O({actions:!0,next:"next"===this.variant})}">${"next"===this.variant?this.renderNextActions():this.renderHistoryActions()}</div><appointment-action-unavailable-dialog .open="${"modify"===this.openDialog}" .heading="${a("Modificar cita")}" .message="${this.modifyUnavailableMessage}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"cancel"===this.openDialog}" .heading="${a("Anular cita")}" .message="${this.cancelUnavailableMessage}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"repeat-no-slots"===this.openDialog}" .heading="${a("Repetir cita")}" .message="${a("Este profesional no tiene horarios disponibles")}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"repeat-error"===this.openDialog}" .heading="${a("Repetir cita")}" .message="${a("Lo sentimos, no hemos podido repetir tu cita. Por favor, contacta con soporte.")}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog>`}};t([i({context:C})],N.prototype,"loginToken",void 0),t([g({type:String})],N.prototype,"variant",void 0),t([g({type:String})],N.prototype,"appointmentId",void 0),t([g({type:Boolean})],N.prototype,"isVideocall",void 0),t([g({type:Boolean})],N.prototype,"hasChatSupport",void 0),t([g({type:Number})],N.prototype,"unreadCount",void 0),t([g({type:Boolean})],N.prototype,"isModifyUnavailable",void 0),t([g({type:Boolean})],N.prototype,"isCancelUnavailable",void 0),t([g({type:Boolean})],N.prototype,"hasNoSlots",void 0),t([g({type:String})],N.prototype,"modifyUnavailableMessage",void 0),t([g({type:String})],N.prototype,"cancelUnavailableMessage",void 0),t([g({type:Object})],N.prototype,"repeatTarget",void 0),t([g({type:String})],N.prototype,"professionalHash",void 0),t([v()],N.prototype,"openDialog",void 0),N=t([o(),e("appointment-card-actions")],N);let T=class AppointmentCard extends d{constructor(){super(...arguments),this.variant="next",this.detailsVariant="wide",this.isChatOpen=!1,this.isCancelDialogOpen=!1,this.unreadQuery=new n(this,()=>c(y,{roomId:this.appointmentResource?.room?.id})),this.getOrganizationSpecialtiesQuery=new n(this,()=>p(y,{enabled:!!this.appointmentResource?.speciality?.id})),this.getOrganizationSetupQuery=new n(this,()=>s(y)),this.getScheduleServicesQuery=new n(this,()=>l(y))}static{this.styles=h`:host{display:flex}.card{width:100%;padding:var(--sp-6);display:flex;flex-direction:column;gap:var(--sp-4);justify-content:space-between}.card-top-content{display:flex;flex-direction:column;gap:var(--sp-6)}.see-details{color:var(--color-primary-link-default);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-bold)}.see-details:hover{text-decoration:underline}.chevron-down{width:16px;height:16px;transition:transform .2s ease}.appointment-details{display:flex;flex-direction:column;gap:12px}.clock-icon-wrapper{width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.clock-icon-wrapper svg{width:100%;height:100%}.appointment-type{display:flex;align-items:center;gap:12px;font-size:18px;color:#2c3e50}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-2)}.actions.next{flex-direction:column}.actions-secondary{display:flex;gap:var(--sp-3)}.actions mq-button{flex:1}`}render(){const t=this.appointmentResource.appointment.channel===b.videocall,e=this.appointmentResource.appointment.channel===b.phonecall,i=!0===this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment,o=(t||e)&&i,n=f(),s=$(this.appointmentResource.appointment.expires_at),p=0===this.appointmentResource.slots.length,l=this.getOrganizationSetupQuery.result?.data?.appointments?.seconds_before_start_to_refund_on_cancel,c=A({startsAtIso:this.appointmentResource.appointment.starts_at,refundPolicySeconds:l}),d=s||p||!c,h=s||!c,g=x({action:"modify",refundPolicySeconds:l}),v=x({action:"cancel",refundPolicySeconds:l}),y=this.getOrganizationSpecialtiesQuery.result?.data?.find(t=>Number(t.id)===Number(this.appointmentResource.speciality.id)),C=r(y?.code??"",n,y?.name??this.appointmentResource.speciality.name),q=this.getScheduleServicesQuery.result?.data?.find(t=>t.id===this.appointmentResource.appointment.service_id)?.code,R=y?.code&&q?{specialty:y.code,service:q}:null;return u`<mq-card class="card" roundness="md"><div class="card-top-content"><professional-overview .specialtyName="${C??""}" .collegiateNumber="${this.appointmentResource.professional.collegiate_number??void 0}" .description="${this.appointmentResource.professional.description??""}" .languages="${this.appointmentResource.professional.languages}" .avatar="${this.appointmentResource.professional.avatar??""}" .name="${this.appointmentResource.professional.name}"></professional-overview><appointment-details .startsAt="${this.appointmentResource.appointment.starts_at}" .duration="${this.appointmentResource.appointment.duration}" .channel="${this.appointmentResource.appointment.channel}" .timezone="${this.loginToken?.patient?.timezone}" variant="${this.detailsVariant}"></appointment-details></div><appointment-card-actions .variant="${this.variant}" .appointmentId="${this.appointmentResource.appointment.id??""}" .isVideocall="${t}" .hasChatSupport="${o}" .unreadCount="${this.unreadQuery.result?.data?.unread_count??0}" .isModifyUnavailable="${d}" .isCancelUnavailable="${h}" .hasNoSlots="${p}" .modifyUnavailableMessage="${g}" .cancelUnavailableMessage="${v}" .repeatTarget="${R}" .professionalHash="${this.appointmentResource.professional.hash}" @toggle-chat="${()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&k.track(D(this.loginToken.patient.hash,this.appointmentResource.appointment.id??""))}}" @request-cancel="${()=>{this.isCancelDialogOpen=!0}}"></appointment-card-actions><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?u`<mq-chat-room slot="content" .consultationId="${this.appointmentResource.appointment.id}" consultation-type="appointment" token="${this.loginToken.access_token}" .roomId="${this.appointmentResource.room.id}" .professionalHash="${this.appointmentResource.professional.hash}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}" ?readonly="${s}"></mq-chat-room>`:m}</mq-floating-bubble><cancel-appointment-confirmation-dialog .appointmentId="${this.appointmentResource.appointment.id}" .price="${this.appointmentResource.price??void 0}" .open="${this.isCancelDialogOpen}" @cancel="${()=>{this.isCancelDialogOpen=!1}}" @success="${()=>{this.isCancelDialogOpen=!1,E.success(a("Consulta anulada correctamente")),this.dispatchEvent(new CustomEvent("appointment-cancel-confirmed",{bubbles:!0,composed:!0,detail:{id:this.appointmentResource.appointment.id}}))}}"></cancel-appointment-confirmation-dialog></mq-card>`}};t([g({type:Object})],T.prototype,"appointmentResource",void 0),t([g({type:Number})],T.prototype,"specialtyId",void 0),t([g({type:String})],T.prototype,"variant",void 0),t([g({type:String})],T.prototype,"detailsVariant",void 0),t([i({context:C})],T.prototype,"loginToken",void 0),t([v()],T.prototype,"isChatOpen",void 0),t([v()],T.prototype,"isCancelDialogOpen",void 0),T=t([o(),e("appointment-card")],T);let P=class AppointmentCardSkeleton extends d{static{this.styles=h`div{border-radius:var(--border-radius-md);background:color-mix(in srgb,var(--color-neutrals-background-disabled) 50%,#fff 50%);height:337px;width:100%}`}render(){return u`<div></div>`}};P=t([e("appointment-card-skeleton")],P);
|
|
1
|
+
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{c as i}from"./consume-BhoQNO_8.js";import{m as a}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{Q as n}from"./query-controller-D7jBX4X7.js";import{g as s}from"./get-organization-setup-query-DxHNY0w8.js";import{g as p,a as r}from"./i18n-formats-EgnwLxKt.js";import{g as l}from"./get-schedule-services-query-Ckvz9Fqh.js";import{g as c}from"./chunk-Y4EKUX25-CqL3lLdx.js";import{a as d,i as h,E as m,x as u}from"./lit-element-DiWJYFwC.js";import{n as g}from"./property-scuRaFcM.js";import{r as v}from"./state-LQivXIgA.js";import{getLocale as f}from"../i18n.js";import{a as y,A as b,i as $}from"./api-chat-client-BiiYnU-b.js";import"./appointment-details-Bm3Uuw2g.js";import"../ui/mq-card.js";import"./professional-overview-C4H_znIJ.js";import{l as C}from"./chunk-S5RWG6G2-DPesx3Od.js";import"../mq-chat-room.js";import"../ui/mq-floating-bubble.js";import{g as x}from"./action-unavailable-message-CRLimFj5.js";import{t as k,c as R,e as q,f as j,g as w,h as S,i as D}from"./telemetry-client-Bkbn48Dd.js";import{e as O}from"./class-map-Co76I6aw.js";import{MqAppointmentRescheduleEvent as I,MqAppointmentBookEvent as M,MqAppointmentJoinVideocallEvent as U,MqAppointmentViewDocumentationEvent as _}from"../events.js";import{messageBubbleIcon as H}from"../ui/icons/message-bubble-icon.js";import{videoIcon as z}from"../ui/icons/video-icon.js";import"../ui/mq-button.js";import"../ui/mq-unread-badge.js";import{c as A}from"./refund-cancel-policy-DV6bzqcu.js";import{toast as E}from"../ui/mq-toast.js";let N=class AppointmentCardActions extends d{constructor(){super(...arguments),this.variant="next",this.isVideocall=!1,this.hasChatSupport=!1,this.unreadCount=0,this.isModifyUnavailable=!1,this.isCancelUnavailable=!1,this.hasNoSlots=!1,this.modifyUnavailableMessage="",this.cancelUnavailableMessage="",this.repeatTarget=null,this.professionalHash="",this.openDialog=null,this.handleModifyClick=()=>{this.isModifyUnavailable?this.openDialog="modify":(k.track(R(this.patientHash,this.appointmentId)),this.dispatchEvent(new I({appointmentId:this.appointmentId})))},this.handleCancelClick=()=>{this.isCancelUnavailable?this.openDialog="cancel":(k.track(q(this.patientHash,this.appointmentId)),this.dispatchEvent(new CustomEvent("request-cancel",{bubbles:!0,composed:!0})))},this.handleRepeatClick=()=>{this.hasNoSlots?this.openDialog="repeat-no-slots":this.repeatTarget?(k.track(j(this.patientHash,this.appointmentId)),this.dispatchEvent(new M({specialty:this.repeatTarget.specialty,service:this.repeatTarget.service,professional:this.professionalHash}))):this.openDialog="repeat-error"},this.handleDialogClose=()=>{this.openDialog=null}}static{this.styles=h`:host{display:contents}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-2)}.actions.next{flex-direction:column}.actions-secondary{display:flex;gap:var(--sp-3)}.actions mq-button{flex:1}`}get patientHash(){return this.loginToken.patient.hash}renderChatButton(){return u`<mq-button variant="primary" fullwidth noPadding @click="${()=>{this.dispatchEvent(new CustomEvent("toggle-chat",{bubbles:!0,composed:!0}))}}">${H({size:24})} ${a("Chat")} ${this.unreadCount>0?u`<mq-unread-badge></mq-unread-badge>`:m}</mq-button>`}renderNextActions(){return u`${this.isVideocall?u`<mq-button variant="outline" fullwidth noPadding @click="${()=>{k.track(w(this.patientHash,this.appointmentId)),this.dispatchEvent(new U({appointmentId:this.appointmentId}))}}">${z({size:24})} ${a("Ir a videollamada")}</mq-button>`:m}<div class="actions-secondary">${this.hasChatSupport?this.renderChatButton():m}<mq-button variant="outline" fullwidth noPadding @click="${this.handleModifyClick}">${a("Modificar")}</mq-button><mq-button variant="outline-negative" fullwidth noPadding @click="${this.handleCancelClick}">${a("Cancelar")}</mq-button></div>`}renderHistoryActions(){return u`${this.hasChatSupport?this.renderChatButton():m}<mq-button variant="outline" fullwidth noPadding @click="${()=>{k.track(S(this.patientHash,this.appointmentId)),this.dispatchEvent(new _({appointmentId:this.appointmentId}))}}">${a("Documentos")}</mq-button><mq-button variant="outline" fullwidth noPadding @click="${this.handleRepeatClick}">${a("Repetir")}</mq-button>`}render(){return u`<div class="${O({actions:!0,next:"next"===this.variant})}">${"next"===this.variant?this.renderNextActions():this.renderHistoryActions()}</div><appointment-action-unavailable-dialog .open="${"modify"===this.openDialog}" .heading="${a("Modificar cita")}" .message="${this.modifyUnavailableMessage}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"cancel"===this.openDialog}" .heading="${a("Anular cita")}" .message="${this.cancelUnavailableMessage}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"repeat-no-slots"===this.openDialog}" .heading="${a("Repetir cita")}" .message="${a("Este profesional no tiene horarios disponibles")}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"repeat-error"===this.openDialog}" .heading="${a("Repetir cita")}" .message="${a("Lo sentimos, no hemos podido repetir tu cita. Por favor, contacta con soporte.")}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog>`}};t([i({context:C})],N.prototype,"loginToken",void 0),t([g({type:String})],N.prototype,"variant",void 0),t([g({type:String})],N.prototype,"appointmentId",void 0),t([g({type:Boolean})],N.prototype,"isVideocall",void 0),t([g({type:Boolean})],N.prototype,"hasChatSupport",void 0),t([g({type:Number})],N.prototype,"unreadCount",void 0),t([g({type:Boolean})],N.prototype,"isModifyUnavailable",void 0),t([g({type:Boolean})],N.prototype,"isCancelUnavailable",void 0),t([g({type:Boolean})],N.prototype,"hasNoSlots",void 0),t([g({type:String})],N.prototype,"modifyUnavailableMessage",void 0),t([g({type:String})],N.prototype,"cancelUnavailableMessage",void 0),t([g({type:Object})],N.prototype,"repeatTarget",void 0),t([g({type:String})],N.prototype,"professionalHash",void 0),t([v()],N.prototype,"openDialog",void 0),N=t([o(),e("appointment-card-actions")],N);let T=class AppointmentCard extends d{constructor(){super(...arguments),this.variant="next",this.detailsVariant="wide",this.isChatOpen=!1,this.isCancelDialogOpen=!1,this.unreadQuery=new n(this,()=>c(y,{roomId:this.appointmentResource?.room?.id})),this.getOrganizationSpecialtiesQuery=new n(this,()=>p(y,{enabled:!!this.appointmentResource?.speciality?.id})),this.getOrganizationSetupQuery=new n(this,()=>s(y)),this.getScheduleServicesQuery=new n(this,()=>l(y))}static{this.styles=h`:host{display:flex}.card{width:100%;padding:var(--sp-6);display:flex;flex-direction:column;gap:var(--sp-4);justify-content:space-between}.card-top-content{display:flex;flex-direction:column;gap:var(--sp-6)}.see-details{color:var(--color-primary-link-default);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-bold)}.see-details:hover{text-decoration:underline}.chevron-down{width:16px;height:16px;transition:transform .2s ease}.appointment-details{display:flex;flex-direction:column;gap:12px}.clock-icon-wrapper{width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.clock-icon-wrapper svg{width:100%;height:100%}.appointment-type{display:flex;align-items:center;gap:12px;font-size:18px;color:#2c3e50}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-2)}.actions.next{flex-direction:column}.actions-secondary{display:flex;gap:var(--sp-3)}.actions mq-button{flex:1}`}render(){const t=this.appointmentResource.appointment.channel===b.videocall,e=this.appointmentResource.appointment.channel===b.phonecall,i=!0===this.appointmentResource.appointment.has_chat_in_appointment,o=(t||e)&&i,n=f(),s=$(this.appointmentResource.appointment.expires_at),p=0===this.appointmentResource.slots.length,l=this.getOrganizationSetupQuery.result?.data?.appointments?.seconds_before_start_to_refund_on_cancel,c=A({startsAtIso:this.appointmentResource.appointment.starts_at,refundPolicySeconds:l}),d=s||p||!c,h=s||!c,g=x({action:"modify",refundPolicySeconds:l}),v=x({action:"cancel",refundPolicySeconds:l}),y=this.getOrganizationSpecialtiesQuery.result?.data?.find(t=>Number(t.id)===Number(this.appointmentResource.speciality.id)),C=r(y?.code??"",n,y?.name??this.appointmentResource.speciality.name),R=this.getScheduleServicesQuery.result?.data?.find(t=>t.id===this.appointmentResource.appointment.service_id)?.code,q=y?.code&&R?{specialty:y.code,service:R}:null;return u`<mq-card class="card" roundness="md"><div class="card-top-content"><professional-overview .specialtyName="${C??""}" .collegiateNumber="${this.appointmentResource.professional.collegiate_number??void 0}" .description="${this.appointmentResource.professional.description??""}" .languages="${this.appointmentResource.professional.languages}" .avatar="${this.appointmentResource.professional.avatar??""}" .name="${this.appointmentResource.professional.name}"></professional-overview><appointment-details .startsAt="${this.appointmentResource.appointment.starts_at}" .duration="${this.appointmentResource.appointment.duration}" .channel="${this.appointmentResource.appointment.channel}" .timezone="${this.loginToken?.patient?.timezone}" variant="${this.detailsVariant}"></appointment-details></div><appointment-card-actions .variant="${this.variant}" .appointmentId="${this.appointmentResource.appointment.id??""}" .isVideocall="${t}" .hasChatSupport="${o}" .unreadCount="${this.unreadQuery.result?.data?.unread_count??0}" .isModifyUnavailable="${d}" .isCancelUnavailable="${h}" .hasNoSlots="${p}" .modifyUnavailableMessage="${g}" .cancelUnavailableMessage="${v}" .repeatTarget="${q}" .professionalHash="${this.appointmentResource.professional.hash}" @toggle-chat="${()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&k.track(D(this.loginToken.patient.hash,this.appointmentResource.appointment.id??""))}}" @request-cancel="${()=>{this.isCancelDialogOpen=!0}}"></appointment-card-actions><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?u`<mq-chat-room slot="content" .consultationId="${this.appointmentResource.appointment.id}" consultation-type="appointment" token="${this.loginToken.access_token}" .roomId="${this.appointmentResource.room.id}" .professionalHash="${this.appointmentResource.professional.hash}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}" ?readonly="${s}"></mq-chat-room>`:m}</mq-floating-bubble><cancel-appointment-confirmation-dialog .appointmentId="${this.appointmentResource.appointment.id}" .price="${this.appointmentResource.price??void 0}" .open="${this.isCancelDialogOpen}" @cancel="${()=>{this.isCancelDialogOpen=!1}}" @success="${()=>{this.isCancelDialogOpen=!1,E.success(a("Consulta anulada correctamente")),this.dispatchEvent(new CustomEvent("appointment-cancel-confirmed",{bubbles:!0,composed:!0,detail:{id:this.appointmentResource.appointment.id}}))}}"></cancel-appointment-confirmation-dialog></mq-card>`}};t([g({type:Object})],T.prototype,"appointmentResource",void 0),t([g({type:Number})],T.prototype,"specialtyId",void 0),t([g({type:String})],T.prototype,"variant",void 0),t([g({type:String})],T.prototype,"detailsVariant",void 0),t([i({context:C})],T.prototype,"loginToken",void 0),t([v()],T.prototype,"isChatOpen",void 0),t([v()],T.prototype,"isCancelDialogOpen",void 0),T=t([o(),e("appointment-card")],T);let P=class AppointmentCardSkeleton extends d{static{this.styles=h`div{border-radius:var(--border-radius-md);background:color-mix(in srgb,var(--color-neutrals-background-disabled) 50%,#fff 50%);height:337px;width:100%}`}render(){return u`<div></div>`}};P=t([e("appointment-card-skeleton")],P);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{g as n}from"./api-chat-client-
|
|
1
|
+
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{g as n}from"./api-chat-client-BiiYnU-b.js";import{a}from"./addSeconds-ofMnxlgT.js";import{i as r,a as s,E as l,x as p}from"./lit-element-DiWJYFwC.js";import{n as m}from"./property-scuRaFcM.js";import{e as c}from"./class-map-Co76I6aw.js";import{getLocale as h}from"../i18n.js";import{briefcaseIcon as d}from"../ui/icons/briefcase-icon.js";import{calendarIcon as f}from"../ui/icons/calendar-icon.js";import{clockIcon as u}from"../ui/icons/clock-icon.js";import{messageBubbleIcon as v}from"../ui/icons/message-bubble-icon.js";import{phoneIcon as w}from"../ui/icons/phone-icon.js";const g=r`.appointment-details{display:flex;flex-direction:column;gap:var(--sp-3)}.detail-row{display:inline-flex;width:fit-content;align-items:center;gap:var(--sp-2);color:var(--color-neutrals-text-default);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-bold)}.detail-row svg{flex-shrink:0}.detail-row span::first-letter{text-transform:uppercase}.detail-row.full-width{width:100%}:host([strike-through]) .detail-row span{text-decoration:line-through}@media (min-width:768px){.appointment-details.wide{flex-direction:row;flex-wrap:wrap}}`;let y=class AppointmentDetails extends s{constructor(){super(...arguments),this.channel=void 0,this.variant="default",this.strikeThrough=!1,this.timezone=void 0,this._appointmentChannelToLabel=t=>{switch(t){case"videocall":return i("Videoconsulta");case"chat":return i("Chat");case"phonecall":return i("Consulta telefónica");default:return""}},this._appointmentChannelToIcon=t=>{switch(t){case"videocall":return d({size:24});case"chat":return v({size:24});case"phonecall":return w({size:24});default:return l}}}static{this.styles=g}render(){const t=h().replace("_","-"),e=new Intl.DateTimeFormat(t,{weekday:"long",year:"numeric",month:"long",day:"numeric",...this.timezone?{timeZone:this.timezone}:{}}),i=new Intl.DateTimeFormat(t,{timeStyle:"short",...this.timezone?{timeZone:this.timezone}:{}}),o=new Date(this.startsAt),r=a(o,this.duration),s=e.format(o),m=i.format(o),d=i.format(r),v=this.timezone?n(this.timezone,o):"";return p`<div class="${c({"appointment-details":!0,wide:"wide"===this.variant})}"><div class="detail-row">${f({size:24})} <span>${s}</span></div><div class="detail-row">${u({size:24})} <span>${m} - ${d}${v?` (${v})`:""}</span></div>${this.channel?p`<div class="detail-row full-width">${this._appointmentChannelToIcon(this.channel)} <span>${this._appointmentChannelToLabel(this.channel)}</span></div>`:l}</div>`}};t([m({type:String})],y.prototype,"startsAt",void 0),t([m({type:Number})],y.prototype,"duration",void 0),t([m({type:String})],y.prototype,"channel",void 0),t([m({type:String})],y.prototype,"variant",void 0),t([m({type:Boolean,attribute:"strike-through"})],y.prototype,"strikeThrough",void 0),t([m({type:String})],y.prototype,"timezone",void 0),y=t([o(),e("appointment-details")],y);export{y as A};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
2
|
import * as lit from 'lit';
|
|
3
3
|
import { LitElement } from 'lit';
|
|
4
|
-
import { A as AppointmentChannel } from './appointment.model.d-
|
|
4
|
+
import { A as AppointmentChannel } from './appointment.model.d-BWwBLaEL.js';
|
|
5
5
|
|
|
6
6
|
declare class AppointmentDetails extends LitElement {
|
|
7
7
|
static styles: lit.CSSResult;
|
|
@@ -57,6 +57,7 @@ declare const AppointmentSchema: z.ZodObject<{
|
|
|
57
57
|
is_dismissed: boolean;
|
|
58
58
|
}>;
|
|
59
59
|
speciality_id: z.ZodNullable<z.ZodNumber>;
|
|
60
|
+
has_chat_in_appointment: z.ZodOptional<z.ZodBoolean>;
|
|
60
61
|
created_at: z.ZodString;
|
|
61
62
|
status: z.ZodEnum<["pending", "expired", "accepted", "inCall", "declined", "cancelled", "finished", "free_of_charge", "owed", "unpaid", "reporting"]>;
|
|
62
63
|
seconds_to_open: z.ZodNumber;
|
|
@@ -119,6 +120,7 @@ declare const AppointmentSchema: z.ZodObject<{
|
|
|
119
120
|
file_name: string;
|
|
120
121
|
}[] | null;
|
|
121
122
|
service_id: string | null;
|
|
123
|
+
has_chat_in_appointment?: boolean | undefined;
|
|
122
124
|
price?: number | null | undefined;
|
|
123
125
|
currency?: string | null | undefined;
|
|
124
126
|
discount_amount?: number | null | undefined;
|
|
@@ -160,6 +162,7 @@ declare const AppointmentSchema: z.ZodObject<{
|
|
|
160
162
|
file_name: string;
|
|
161
163
|
}[] | null;
|
|
162
164
|
service_id: string | null;
|
|
165
|
+
has_chat_in_appointment?: boolean | undefined;
|
|
163
166
|
price?: number | null | undefined;
|
|
164
167
|
currency?: string | null | undefined;
|
|
165
168
|
discount_amount?: number | null | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{h as a,s as n}from"./task-Bj8p7kJX.js";import{a as s,C as r,g as d,i as l}from"./api-chat-client-BiiYnU-b.js";import{a as c}from"./addSeconds-ofMnxlgT.js";import{a as m,i as p,E as h,x as u}from"./lit-element-DiWJYFwC.js";import{n as f}from"./property-scuRaFcM.js";import{getLocale as g}from"../i18n.js";import{calendarIcon as v}from"../ui/icons/calendar-icon.js";import{clockIcon as y}from"../ui/icons/clock-icon.js";import{r as b}from"./state-LQivXIgA.js";import{infoCircleOutineIcon as x}from"../ui/icons/info-circle-outine-icon.js";import"../ui/mq-button.js";import{l as $}from"./chunk-S5RWG6G2-DPesx3Od.js";import{messageBubbleIcon as k}from"../ui/icons/message-bubble-icon.js";import"../mq-chat-room.js";import"../ui/mq-floating-bubble.js";import"../ui/mq-card.js";import"../ui/mq-unread-badge.js";import{c as w}from"./consume-BhoQNO_8.js";import{Q as q}from"./query-controller-D7jBX4X7.js";import{g as z}from"./chunk-Y4EKUX25-CqL3lLdx.js";import"../ui/mq-page-title.js";import"./index-CZ9HtP96.js";import{M as j}from"./mutation-controller-CR2qcqhH.js";import{g as _,a as C}from"./i18n-formats-EgnwLxKt.js";import{t as T,d as O,a as I,b as S}from"./telemetry-client-Bkbn48Dd.js";import{MqViewAppointmentsEvent as D}from"../events.js";let E=class ChatCta extends m{constructor(){super(...arguments),this.text=i("Utiliza el chat para enviar el motivo de consulta, documentos o imágenes"),this.readonly=!1,this.isChatOpen=!1,this.unreadQuery=new q(this,()=>z(s,{roomId:this.roomId}))}static{this.styles=[p`.chat-cta{padding:var(--sp-6) var(--sp-4);display:flex;flex-direction:column;gap:var(--sp-4)}.cta-message{display:inline-flex;align-items:center;justify-content:center;gap:var(--sp-4);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default)}.cta-message svg{flex-shrink:0}mq-button svg{flex-shrink:0}mq-chat-room{height:100%}@media (min-width:768px){.chat-cta{padding:var(--sp-6)}mq-button{max-width:323px;margin:0 auto}}`]}render(){return u`<mq-card class="chat-cta" roundness="md"><div class="cta-message">${x({size:24})} <span>${this.text}</span></div><mq-button variant="primary" size="md" fullwidth @click="${()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&this.onOpenChat?.()}}">${k({size:24})} ${i("Chatea con el profesional")} ${(this.unreadQuery.result?.data?.unread_count??0)>0?u`<mq-unread-badge></mq-unread-badge>`:h}</mq-button></mq-card><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?u`<mq-chat-room slot="content" .consultationId="${this.consultationId}" .consultationType="${r.appointment}" token="${this.loginToken.access_token}" .roomId="${this.roomId}" .professionalHash="${this.professionalHash}" ?readonly="${this.readonly}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room>`:h}</mq-floating-bubble>`}};t([f({type:Number})],E.prototype,"roomId",void 0),t([f({type:String})],E.prototype,"professionalHash",void 0),t([f({type:String})],E.prototype,"text",void 0),t([f({type:String})],E.prototype,"consultationId",void 0),t([f({type:Boolean,reflect:!0})],E.prototype,"readonly",void 0),t([f({attribute:!1})],E.prototype,"onOpenChat",void 0),t([w({context:$})],E.prototype,"loginToken",void 0),t([b()],E.prototype,"isChatOpen",void 0),E=t([o(),e("chat-cta")],E);let B=class PageLayout extends m{constructor(){super(...arguments),this.yCentered=!1,this.background="solid"}static{this.styles=p`:host([background=transparent]){background-color:transparent}:host([background=solid]){background-color:var(--color-background)}:host([y-centered]) div{display:grid;place-items:center}div{width:100%;max-width:1000px;padding:var(--mq-layout-padding,0);margin:0 auto;box-sizing:border-box}:host([y-centered]) div{height:100%}main{width:100%}`}render(){return u`<div><main><slot></slot></main></div>`}};t([f({type:Boolean,attribute:"y-centered"})],B.prototype,"yCentered",void 0),t([f({type:String})],B.prototype,"background",void 0),B=t([e("page-layout")],B);const H=p`mq-page-title{margin:var(--size-3) 0}.description{font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0;margin-bottom:var(--size-5)}.professional-card{padding:var(--size-4);margin-bottom:var(--size-4)}.professional-card>:not(:first-child){margin-top:var(--size-4)}.professional-name{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-1)}.professional-speciality{font-size:var(--text-base);line-height:var(--text-base--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0}.description-list{display:flex;flex-direction:column;gap:var(--size-4)}.description-list-item{display:flex;flex-direction:row;align-items:center;gap:var(--size-2);color:var(--color-neutrals-text-default)}.description-list-item dt{display:inline-flex}.description-list-item dd{margin:0;font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-semibold)}.description-list-item dd::first-letter{text-transform:uppercase}.documents-card{padding:var(--size-4);margin-bottom:var(--size-6)}.documents-card-empty{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal)}.documents-card-title{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-4)}.documents-list{margin-bottom:var(--size-4)}.documents-list>:not(:first-child){margin-top:var(--size-2)}.finished-consultation-footer{display:flex;flex-direction:column;gap:var(--size-5)}.document-item-skeleton{height:57px;width:100%;background-color:var(--color-muted);animation:skeleton-pulse 1.5s infinite}@keyframes skeleton-pulse{0%{opacity:1}50%{opacity:.6}100%{opacity:1}}@media (min-width:768px){.description-list{flex-direction:row}mq-button{display:block;max-width:323px;margin:0 auto}}`;let P=class DocumentationView extends m{constructor(){super(...arguments),this.canReconnect=!1,this._sharedocumentsTask=new a(this,{task:async([t])=>await s.flash.getSharedDocuments({appointment_id:t}),args:()=>[this.appointment.id]}),this.getOrganizationSpecialtiesQuery=new q(this,()=>_(s)),this._reconnectMutation=new j(this,{mutationFn:t=>s.appointments.reconnectAppointment(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("reconnect",{bubbles:!0,composed:!0}))}})}static{this.styles=H}firstUpdated(){T.track(O(this.loginToken.patient.hash,this.appointment.id??""))}render(){const t=!0===this.appointment.has_chat_in_appointment,e=g(),o=e.replace("_","-"),a=this.loginToken.patient.timezone,s=a?{timeZone:a}:{},r=new Intl.DateTimeFormat(o,{dateStyle:"full",...s}),m=new Intl.DateTimeFormat(o,{hour:"2-digit",minute:"2-digit",...s}),p=new Date(this.appointment.start_date),f=c(p,this.appointment.duration),b=a?d(a,p):"";return u`<mq-page-title .title="${i("Consulta finalizada")}" back-label="${i("Salir")}" @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new D({tab:"history"}))}}"></mq-page-title><p class="description">${i("Si tu médico ha generado alguna documentación podrás verla y descargarla aquí, desde la sección de documentación, tu correo o el chat.")}</p><mq-card class="professional-card" roundness="md"><div><h2 class="professional-name">${this.appointment.from.name}</h2><p class="professional-speciality">${this.appointment.from.speciality}</p></div><dl class="description-list"><div class="description-list-item"><dt>${v()}</dt><dd>${r.format(p)}</dd></div><div class="description-list-item"><dt>${y()}</dt><dd>${m.format(p)} - ${m.format(f)}${b?` (${b})`:""}</dd></div></dl></mq-card><mq-card class="documents-card" roundness="md"><h2 class="documents-card-title">${i("Documentación")}</h2><div class="documents-list">${this._sharedocumentsTask?.render({pending:()=>u`<div class="document-item-skeleton"></div>`,complete:()=>0===this._sharedocumentsTask?.value?.length?u`<p class="documents-card-empty">${i("El médico está terminando de gestionar tu consulta. Actualiza en unos minutos para ver si tienes documentación.")}</p>`:this._sharedocumentsTask?.value?.map(t=>u`<patient-document .kind="${t.document_type}" .filename="${t.name}" .specialty="${(()=>{const i=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>e.id===t.professional.speciality_id);return C(i?.code??"",e,i?.name)})()}" .description="${t.name}" .date="${t.created_at}" .downloadUrl="${t.url}"></patient-document>`)})}</div><mq-button variant="outline" size="md" fullwidth @click="${()=>{T.track(I(this.loginToken.patient.hash,this.appointment.id??"")),this._sharedocumentsTask?.run()}}" .disabled="${this._sharedocumentsTask?.status===n.PENDING}">${i("Actualizar")}</mq-button></mq-card><div class="finished-consultation-footer">${this.canReconnect?u`<mq-button variant="primary" size="md" fullwidth ?disabled="${this._reconnectMutation.isPending}" @click="${()=>this._reconnectMutation.run({appointmentId:this.appointment.id})}">${i("Volver a la sala de espera")}</mq-button>`:h} ${t?u`<chat-cta .consultationId="${this.appointment.id}" .roomId="${Number(this.appointment.room_id)}" .professionalHash="${this.appointment.from.hash}" .text="${i("Puedes chatear con tu profesional hasta 48 horas finalizada tu cita")}" ?readonly="${l(this.appointment.expires_at)}" .onOpenChat="${()=>{T.track(S(this.loginToken.patient.hash,this.appointment.id??""))}}"></chat-cta>`:h}</div>`}};t([f({type:Object})],P.prototype,"appointment",void 0),t([f({type:String})],P.prototype,"token",void 0),t([f({type:Boolean,attribute:"can-reconnect"})],P.prototype,"canReconnect",void 0),t([w({context:$})],P.prototype,"loginToken",void 0),P=t([o(),e("documentation-view")],P);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{i as o,a as i,x as r}from"./lit-element-DiWJYFwC.js";import{n}from"./property-scuRaFcM.js";import{r as a}from"./state-LQivXIgA.js";import{downloadIcon as s}from"../ui/icons/download-icon.js";import"../ui/mq-button.js";import{m as l}from"./runtime-Bg1WXVCx.js";import{l as d}from"./localized-decorator-BlOuLhym.js";import{a as p,D as c}from"./api-chat-client-
|
|
1
|
+
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{i as o,a as i,x as r}from"./lit-element-DiWJYFwC.js";import{n}from"./property-scuRaFcM.js";import{r as a}from"./state-LQivXIgA.js";import{downloadIcon as s}from"../ui/icons/download-icon.js";import"../ui/mq-button.js";import{m as l}from"./runtime-Bg1WXVCx.js";import{l as d}from"./localized-decorator-BlOuLhym.js";import{a as p,D as c}from"./api-chat-client-BiiYnU-b.js";import{b as m}from"./blob-to-base64-CUL1trde.js";import{DownloadFileEvent as f}from"../events.js";import{getLocale as h}from"../i18n.js";const v=o`:host{display:flex;justify-content:space-between;align-items:center;gap:var(--sp-4);width:100%}.left{display:flex;flex-direction:column;gap:var(--sp-1);flex:1;min-width:0}.tag{border-radius:var(--border-radius-sm);display:inline-flex;align-items:center;justify-content:center;padding:var(--sp-0_5) var(--sp-2);background-color:#e5e5e5;width:fit-content}.tag-label{font-family:var(--font-body);font-size:11px;font-weight:var(--font-weight-medium);color:var(--color-neutrals-text-default);text-transform:uppercase;letter-spacing:3px;line-height:normal}.title{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.description{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`;let g=class PatientDocument extends i{constructor(){super(...arguments),this.isDownloading=!1}static{this.styles=v}getFormatter(){const t=h().replace("_","-");return new Intl.DateTimeFormat(t,{year:"numeric",month:"numeric",day:"numeric"})}async _handleDownload(){this.isDownloading=!0;const t=await p.flash.downloadDocument({url:this.downloadUrl}),e=await m(t);this.dispatchEvent(new f({url:e,filename:`${this.filename}.pdf`})),this.isDownloading=!1}formatKind(t){switch(t){case c.prescription:return l("Receta");case c.report:return l("Informe");case c.diagnosticTestPrescription:return l("Prescripción")}}render(){const t=this.getFormatter().format(new Date(this.date));return r`<div class="left"><div class="tag"><span class="tag-label">${this.formatKind(this.kind)}</span></div><div class="title">${t} - ${this.specialty}</div><div class="description">${this.description}</div></div><mq-button variant="ghost" size="icon-lg" @click="${this._handleDownload}" ?disabled="${this.isDownloading}">${s({size:24})}</mq-button>`}};t([n({type:String})],g.prototype,"kind",void 0),t([n({type:String})],g.prototype,"filename",void 0),t([n({type:String})],g.prototype,"specialty",void 0),t([n({type:String})],g.prototype,"description",void 0),t([n({type:String})],g.prototype,"date",void 0),t([n({type:String})],g.prototype,"downloadUrl",void 0),t([a()],g.prototype,"isDownloading",void 0),g=t([d(),e("patient-document")],g);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{i,a as o,x as n}from"./lit-element-DiWJYFwC.js";import{n as a}from"./property-scuRaFcM.js";import{r as s}from"./state-LQivXIgA.js";import"../ui/mq-checkbox.js";import"../ui/mq-button.js";import{M as r}from"./mutation-controller-CR2qcqhH.js";import{setEnv as l}from"../env.js";import{a as h}from"./api-chat-client-
|
|
1
|
+
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{i,a as o,x as n}from"./lit-element-DiWJYFwC.js";import{n as a}from"./property-scuRaFcM.js";import{r as s}from"./state-LQivXIgA.js";import"../ui/mq-checkbox.js";import"../ui/mq-button.js";import{M as r}from"./mutation-controller-CR2qcqhH.js";import{setEnv as l}from"../env.js";import{a as h}from"./api-chat-client-BiiYnU-b.js";const c=i`.page-header{box-sizing:border-box;width:100%;display:none}.page-title{font-family:var(--font-body);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default)}.page-title ::slotted(*){margin:0;margin-bottom:var(--sp-2);font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.page-subtitle{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-subtle)}.page-subtitle ::slotted(*){margin:0;font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.terms-section{box-sizing:border-box;width:100%;display:flex;flex-direction:column;gap:var(--sp-6);background-color:var(--color-neutrals-background-weak);padding:var(--sp-6);border-radius:var(--border-radius-md)}.terms-title{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default)}.terms-title ::slotted(*){margin:0;margin-bottom:var(--sp-2);font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.terms-description{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default)}.terms-description ::slotted(*){margin:0;font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.checkbox-container{display:flex;gap:var(--sp-3);align-items:flex-start;cursor:pointer}.checkbox-label{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);flex:1}@media (min-width:768px){.page-header{display:block;margin-bottom:var(--sp-10)}.page-title{font-size:var(--text-3xl);line-height:var(--text-3xl--line-height)}.page-title ::slotted(*){font-size:inherit;line-height:inherit}.page-subtitle{font-size:var(--text-base);line-height:var(--text-base--line-height)}.page-subtitle ::slotted(*){font-size:inherit;line-height:inherit}.terms-title{font-size:var(--text-2xl);line-height:var(--text-2xl--line-height)}.terms-title ::slotted(*){font-size:inherit;line-height:inherit}.terms-description{font-size:var(--text-base);line-height:var(--text-base--line-height)}.terms-description ::slotted(*){font-size:inherit;line-height:inherit}.checkbox-label{font-size:var(--text-base);line-height:var(--text-base--line-height)}}`;let d=class MqTermsAndConditions extends o{constructor(){super(...arguments),this.disabled=!1,this.hasCommercialCommunications=!1,this._accepted=!1,this.acceptLegalConsentMutation=new r(this,{mutationFn:async t=>h.profile.acceptLegalConsent(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("continue"))}})}static{this.styles=c}willUpdate(t){t.has("env")&&this.env&&l(this.env),t.has("apiKey")&&this.apiKey&&h.setApiKey(this.apiKey),t.has("token")&&this.token&&h.setAuthToken(this.token)}handleCheckboxChange(t){this._accepted=t.detail.checked}handleContinue(){this._accepted&&!this.disabled&&this.acceptLegalConsentMutation.run({terms_accepted:!0,privacy_accepted:!0,commercial_accepted:this.hasCommercialCommunications})}render(){const t=!this._accepted||this.disabled;return n`<div class="page-header"><div class="page-title"><slot name="page-title"></slot></div><div class="page-subtitle"><slot name="page-subtitle"></slot></div></div><div class="terms-section"><div><div class="terms-title"><slot name="terms-title"></slot></div><div class="terms-description"><slot name="terms-description"></slot></div></div><div class="checkbox-container"><mq-checkbox id="terms-checkbox" @change="${this.handleCheckboxChange}" ?disabled="${this.disabled}"></mq-checkbox><label class="checkbox-label" for="terms-checkbox"><slot name="checkbox-label"></slot></label></div><mq-button variant="primary" size="md" fullwidth ?disabled="${this.acceptLegalConsentMutation.isPending||t}" @click="${this.handleContinue}"><slot name="button-text"></slot></mq-button></div>`}};t([a({type:Boolean})],d.prototype,"disabled",void 0),t([a({type:Boolean})],d.prototype,"hasCommercialCommunications",void 0),t([a({type:String,attribute:"api-key"})],d.prototype,"apiKey",void 0),t([a({type:String,attribute:"token"})],d.prototype,"token",void 0),t([a({type:String,attribute:"env"})],d.prototype,"env",void 0),t([s()],d.prototype,"_accepted",void 0),d=t([e("mq-terms-and-conditions")],d);export{d as M};
|
|
@@ -5,7 +5,7 @@ import '../ui/mq-avatar.js';
|
|
|
5
5
|
import '../ui/mq-button.js';
|
|
6
6
|
import '../ui/mq-skeleton.js';
|
|
7
7
|
import { z } from 'zod';
|
|
8
|
-
import { C as ConsultationType } from './appointment.model.d-
|
|
8
|
+
import { C as ConsultationType } from './appointment.model.d-BWwBLaEL.js';
|
|
9
9
|
import { QueryClient } from '@tanstack/query-core';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t}from"./api-chat-client-
|
|
1
|
+
import{b as t}from"./api-chat-client-BiiYnU-b.js";import{t as n}from"./parseISO-Dj3qSTG8.js";function r(t,r,o){const e=function(t,r){return+n(t)-+n(r)}(t,r)/1e3;return(s=o?.roundingMethod,t=>{const n=(s?Math[s]:Math.trunc)(t);return 0===n?0:n})(e);var s}function o(n){const{startsAtIso:o,refundPolicySeconds:e,now:s=new Date}=n,c=r(t(o),s);return!(c<0)&&(null==e||c>=e)}export{o as c};
|
package/dist/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const E="https://mediquo-landing.s3.eu-central-1.amazonaws.com/sdk-web/elements",o="production",e="0.
|
|
1
|
+
const E="https://mediquo-landing.s3.eu-central-1.amazonaws.com/sdk-web/elements",o="production",e="0.8.0",n={development:{MODE:"development",MQ_DEFAULT_ENV:o,MQ_ELEMENTS_VERSION:e,OPENTOK_API_KEY:"47836441",ASSETS_BASE_URL:E},production:{MODE:"production",MQ_DEFAULT_ENV:o,MQ_ELEMENTS_VERSION:e,OPENTOK_API_KEY:"46655102",ASSETS_BASE_URL:E}};let t=o;const _=new Proxy({},{get:(E,o)=>n[t??"production"][o]});function S(E){t=E}export{E as ASSETS_BASE_URL,_ as env,S as setEnv};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,c as t}from"./chunks/custom-element-D2ziPxYE.js";import{m as a}from"./chunks/runtime-Bg1WXVCx.js";import{l as s}from"./chunks/localized-decorator-BlOuLhym.js";import{L as i}from"./chunks/login-token-task-BI-L2zSV.js";import{l as n}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{i as o,a as r,x as p}from"./chunks/lit-element-DiWJYFwC.js";import{n as l}from"./chunks/property-scuRaFcM.js";import{r as c}from"./chunks/state-LQivXIgA.js";import{setEnv as h}from"./env.js";import{initLocalization as u,isValidLocale as y,setLocale as d}from"./i18n.js";import{a as m}from"./chunks/api-chat-client-
|
|
1
|
+
import{_ as e,c as t}from"./chunks/custom-element-D2ziPxYE.js";import{m as a}from"./chunks/runtime-Bg1WXVCx.js";import{l as s}from"./chunks/localized-decorator-BlOuLhym.js";import{L as i}from"./chunks/login-token-task-BI-L2zSV.js";import{l as n}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{i as o,a as r,x as p}from"./chunks/lit-element-DiWJYFwC.js";import{n as l}from"./chunks/property-scuRaFcM.js";import{r as c}from"./chunks/state-LQivXIgA.js";import{setEnv as h}from"./env.js";import{initLocalization as u,isValidLocale as y,setLocale as d}from"./i18n.js";import{a as m}from"./chunks/api-chat-client-BiiYnU-b.js";import{u as v,s as b,r as k}from"./chunks/apple-pay-outcomes-BpcbdGfO.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/external-CJj32K_p.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";function f(){if("undefined"==typeof navigator)return!1;const e=navigator.userAgent;return/Safari/i.test(e)&&!/Chrome|Chromium|Edg|OPR|Firefox|FxiOS/i.test(e)}async function P(e){if("undefined"==typeof window||!window.isSecureContext)return{available:!1,reason:"unsupported"};if(!function(){if("undefined"==typeof window)return!1;const e="undefined"!=typeof ApplePaySession&&"function"==typeof ApplePaySession.canMakePayments,t="undefined"!=typeof customElements&&void 0!==customElements.get("apple-pay-button");return e&&t}())return{available:!1,reason:"sdk-missing"};if(!e.trim())return{available:!1,reason:"merchant-id-missing"};const t=ApplePaySession;if(function(e){return"function"==typeof e.applePayCapabilities}(t))try{return function(e){switch(e){case"applePayUnsupported":return{available:!1,reason:"unsupported"};case"paymentCredentialsUnavailable":case"paymentCredentialsAvailable":case"paymentCredentialStatusUnknown":return{available:!0,usesQrFlow:!f()}}}((await t.applePayCapabilities(e)).paymentCredentialStatus)}catch{return t.canMakePayments()?{available:!0,usesQrFlow:!f()}:{available:!1,reason:"unsupported"}}return t.canMakePayments()?{available:!0,usesQrFlow:!f()}:{available:!1,reason:"unsupported"}}const g={es_ES:"es-ES",en_US:"en-US",pt_PT:"pt-PT",de_DE:"de-DE",ca_ES:"ca-ES"};try{u()}catch{}const E=["visa","masterCard","amex"],_=["supports3DS"],S=o`:host{display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:12px;width:100%;min-height:48px}.helper{margin:0;text-align:center;font-family:system-ui,sans-serif;font-size:13px;line-height:1.4;color:#6e6e73}.pay-row{display:block;width:100%}.pay-row--paying{opacity:.55;pointer-events:none}apple-pay-button{--apple-pay-button-width:100%;--apple-pay-button-height:48px;--apple-pay-button-border-radius:10px;--apple-pay-button-padding:0;display:block;width:100%;min-height:48px;cursor:pointer}.state{text-align:center;font-family:system-ui,sans-serif;font-size:15px;color:#86868b;margin:0}`;class ApplePayCheckoutSuccessEvent extends Event{static{this.eventName="payment-success"}constructor(e){super(ApplePayCheckoutSuccessEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class ApplePayCheckoutDeniedEvent extends Event{static{this.eventName="payment-denied"}constructor(e){super(ApplePayCheckoutDeniedEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class ApplePayCheckoutErrorEvent extends Event{static{this.eventName="payment-error"}constructor(e){super(ApplePayCheckoutErrorEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}function A(e,t){n.warn(e,{error:t instanceof Error?t.message:String(t)})}let C=class MqApplePayCheckout extends r{constructor(){super(...arguments),this._availabilityPhase="checking",this._showQrHelper=!1,this._paying=!1,this._suppressCancelEvent=!1,this._availabilityGeneration=0,this._loginTokenTask=new i(this,m,{args:()=>[this.apiKey,this.token],onComplete:e=>{m.setAuthToken(e.access_token),this._refreshAvailability()},onError:()=>{this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"auth"}))}}),this._onPayClick=()=>{if(this._paying||"ready"!==this._availabilityPhase)return;let e;try{e=new ApplePaySession(3,this._buildPaymentRequest())}catch(e){return A("mq-apple-pay-checkout: failed to create ApplePaySession",e),void this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"unsupported"}))}this._paying=!0,this._suppressCancelEvent=!1,e.onvalidatemerchant=async t=>{try{const a=await m.payments.validateApplePayMerchant({order_id:this.sessionId,validation_url:t.validationURL});e.completeMerchantValidation(v(a))}catch(t){A("mq-apple-pay-checkout: validate-merchant failed",t),this._suppressCancelEvent=!0,this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"merchant"})),e.abort(),this._paying=!1}},e.onpaymentauthorized=async t=>{try{const a=await m.payments.authorizeApplePay({order_id:this.sessionId,token:b(t.payment.token)}),{status:s,consultation_id:i}=a.data,n=k(s,i,this.sessionId);switch(n.kind){case"success":e.completePayment(ApplePaySession.STATUS_SUCCESS),this.dispatchEvent(new ApplePayCheckoutSuccessEvent({sessionId:n.sessionId,reference:n.reference}));break;case"denied":e.completePayment(ApplePaySession.STATUS_FAILURE),this.dispatchEvent(new ApplePayCheckoutDeniedEvent({sessionId:n.sessionId}));break;case"error":e.completePayment(ApplePaySession.STATUS_FAILURE),this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:n.reason}))}}catch(t){A("mq-apple-pay-checkout: authorize failed",t),e.completePayment(ApplePaySession.STATUS_FAILURE),this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"authorize"}))}finally{this._paying=!1}},e.oncancel=()=>{this._paying=!1,this._suppressCancelEvent?this._suppressCancelEvent=!1:this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"cancelled"}))};try{e.begin()}catch(e){A("mq-apple-pay-checkout: session.begin() failed",e),this._paying=!1,this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"unsupported"}))}}}static{this.styles=S}willUpdate(e){if(e.has("env")&&this.env&&h(this.env),e.has("apiKey")&&m.setApiKey(this.apiKey),e.has("locale")){const e=y(this.locale)?this.locale:"es_ES";d(e),m.setLanguage(e)}e.has("merchantId")&&this._loginTokenTask.value&&this._refreshAvailability()}async _refreshAvailability(){const e=++this._availabilityGeneration;this._availabilityPhase="checking",this._showQrHelper=!1;const t=await P(this.merchantId??"");e===this._availabilityGeneration&&(t.available?(this._availabilityPhase="ready",this._showQrHelper=t.usesQrFlow):this._availabilityPhase="unavailable")}get _resolvedLocale(){return y(this.locale)?this.locale:"es_ES"}_buildPaymentRequest(){return{countryCode:this.country,currencyCode:this.currency,supportedNetworks:[...E],merchantCapabilities:[..._],total:{label:this.label,amount:this.amount}}}_renderUnavailable(){return this.merchantId?.trim()?"undefined"==typeof ApplePaySession?p`<p class="state">${a("No se ha podido cargar Apple Pay. Comprueba la configuración del sitio e inténtalo de nuevo.")}</p>`:p`<p class="state">${a("Apple Pay no está disponible")}</p>`:p`<p class="state">${a("Falta el identificador de comercio de Apple Pay")}</p>`}render(){return this._loginTokenTask.render({pending:()=>p`<p class="state">${a("Preparando Apple Pay…")}</p>`,error:()=>p`<p class="state">${a("No hemos podido iniciar el pago")}</p>`,complete:()=>{return"checking"===this._availabilityPhase?p`<p class="state">${a("Comprobando Apple Pay…")}</p>`:"unavailable"===this._availabilityPhase?this._renderUnavailable():p`${this._showQrHelper?p`<p class="helper">${a("Para pagar con Apple Pay, escanea el código QR con tu iPhone (iOS 18 o posterior) y confirma el pago.")}</p>`:null}<div class="pay-row ${this._paying?"pay-row--paying":""}"><apple-pay-button buttonstyle="black" type="pay" locale="${e=this._resolvedLocale,g[e]??"es-ES"}" aria-label="${a("Pagar con Apple Pay")}" @click="${this._onPayClick}"></apple-pay-button></div>`;var e}})}};e([l({type:String,attribute:"env"})],C.prototype,"env",void 0),e([l({type:String,attribute:"api-key"})],C.prototype,"apiKey",void 0),e([l({type:String,attribute:"token"})],C.prototype,"token",void 0),e([l({type:String,attribute:"locale",reflect:!0})],C.prototype,"locale",void 0),e([l({type:String,attribute:"merchant-id"})],C.prototype,"merchantId",void 0),e([l({type:String,attribute:"session-id"})],C.prototype,"sessionId",void 0),e([l({type:String,attribute:"amount"})],C.prototype,"amount",void 0),e([l({type:String,attribute:"currency"})],C.prototype,"currency",void 0),e([l({type:String,attribute:"country"})],C.prototype,"country",void 0),e([l({type:String,attribute:"label"})],C.prototype,"label",void 0),e([c()],C.prototype,"_availabilityPhase",void 0),e([c()],C.prototype,"_showQrHelper",void 0),e([c()],C.prototype,"_paying",void 0),C=e([s(),t("mq-apple-pay-checkout")],C);export{ApplePayCheckoutDeniedEvent,ApplePayCheckoutErrorEvent,ApplePayCheckoutSuccessEvent,C as MqApplePayCheckout};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as e}from"./chunks/custom-element-D2ziPxYE.js";import{a as o,x as i}from"./chunks/lit-element-DiWJYFwC.js";import{n as s}from"./chunks/property-scuRaFcM.js";import{o as n}from"./chunks/if-defined-BYeVdwgd.js";import{a as p}from"./chunks/api-chat-client-
|
|
1
|
+
import{_ as t,c as e}from"./chunks/custom-element-D2ziPxYE.js";import{a as o,x as i}from"./chunks/lit-element-DiWJYFwC.js";import{n as s}from"./chunks/property-scuRaFcM.js";import{o as n}from"./chunks/if-defined-BYeVdwgd.js";import{a as p}from"./chunks/api-chat-client-BiiYnU-b.js";import"./mq-checkout.js";import"./chunks/external-CJj32K_p.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./env.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/localized-decorator-BlOuLhym.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/login-token-task-BI-L2zSV.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/state-LQivXIgA.js";import"./theme.js";import"./i18n.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./chunks/directive-2EDmOukv.js";class AppointmentPaidEvent extends Event{static{this.eventName="payment-success"}constructor(t){super(AppointmentPaidEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}let r=class MqAppointmentCheckout extends o{constructor(){super(...arguments),this._provideSession=async()=>{const t=await p.payments.createPaymentLink({slot_id:this.slotId,service_id:this.serviceId,specialty_id:this.specialtyId,consultation_reason:this.consultationReason,discount_code:this.discountCode,preconsultation_documents:this.preconsultationDocuments});return{sessionId:t.session_id,paymentUrl:t.payment_link}},this._onSuccess=t=>{t.stopPropagation(),this.dispatchEvent(new AppointmentPaidEvent({appointmentId:t.detail.reference}))}}render(){return i`<mq-checkout env="${n(this.env)}" api-key="${this.apiKey}" token="${this.token}" locale="${this.locale}" .provideSession="${this._provideSession}" @payment-success="${this._onSuccess}"></mq-checkout>`}};t([s({type:String,attribute:"env"})],r.prototype,"env",void 0),t([s({type:String,attribute:"api-key"})],r.prototype,"apiKey",void 0),t([s({type:String,attribute:"token"})],r.prototype,"token",void 0),t([s({type:String,attribute:"locale",reflect:!0})],r.prototype,"locale",void 0),t([s({type:String,attribute:"slot-id"})],r.prototype,"slotId",void 0),t([s({type:String,attribute:"service-id"})],r.prototype,"serviceId",void 0),t([s({type:String,attribute:"specialty-id"})],r.prototype,"specialtyId",void 0),t([s({type:String,attribute:"consultation-reason"})],r.prototype,"consultationReason",void 0),t([s({type:String,attribute:"discount-code"})],r.prototype,"discountCode",void 0),t([s({attribute:!1})],r.prototype,"preconsultationDocuments",void 0),r=t([e("mq-appointment-checkout")],r);export{AppointmentPaidEvent,r as MqAppointmentCheckout};
|
|
@@ -2,7 +2,7 @@ import * as lit_html from 'lit-html';
|
|
|
2
2
|
import { LitElement, PropertyValues } from 'lit';
|
|
3
3
|
import { Env } from './env.js';
|
|
4
4
|
import './ui/mq-button.js';
|
|
5
|
-
import './chunks/mq-chat-room-
|
|
5
|
+
import './chunks/mq-chat-room-CRPruRJD.js';
|
|
6
6
|
import './ui/mq-floating-bubble.js';
|
|
7
7
|
import './ui/mq-card.js';
|
|
8
8
|
import './ui/mq-unread-badge.js';
|
|
@@ -12,7 +12,7 @@ import './chunks/mq-layout-D8Mak16a.js';
|
|
|
12
12
|
import './ui/mq-avatar.js';
|
|
13
13
|
import './ui/mq-skeleton.js';
|
|
14
14
|
import 'zod';
|
|
15
|
-
import './chunks/appointment.model.d-
|
|
15
|
+
import './chunks/appointment.model.d-BWwBLaEL.js';
|
|
16
16
|
import '@tanstack/query-core';
|
|
17
17
|
import './chunks/document.model.d-DIzMiOmd.js';
|
|
18
18
|
|