@mediquo/elements 0.4.0 → 0.5.1

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.
Files changed (147) hide show
  1. package/README.md +86 -1
  2. package/dist/chunks/api-chat-client-vbjgaIRV.js +1 -0
  3. package/dist/chunks/{apple-pay-outcomes-BNkcTbbM.js → apple-pay-outcomes-DxrMPQqB.js} +1 -1
  4. package/dist/chunks/appointment-card-skeleton-1c7552Ln.d.ts +398 -0
  5. package/dist/chunks/appointment-card-skeleton-CYFfacro.js +1 -0
  6. package/dist/chunks/chunk-4FFT6DC2-CVWibomC.js +1 -0
  7. package/dist/chunks/chunk-GZF3YFSX-BzloXkVp.js +1 -0
  8. package/dist/chunks/chunk-RCFIJTXZ-C6Ir0-sM.js +1 -0
  9. package/dist/chunks/chunk-S5RWG6G2-DPesx3Od.js +1 -0
  10. package/dist/chunks/chunk-YMQSBQHL-De_r7BNk.js +1 -0
  11. package/dist/chunks/chunk-YTQUGGS3-p18naHsk.js +1 -0
  12. package/dist/chunks/consume-CovVqBjI.js +1 -0
  13. package/dist/chunks/context-consumer-ESdICVAb.js +1 -0
  14. package/dist/chunks/context-provider--AKuwfs9.js +1 -0
  15. package/dist/chunks/create-context-DqP79qjF.js +1 -0
  16. package/dist/chunks/documentation-view-CS4Q-UpO.js +1 -0
  17. package/dist/chunks/external-mrLCXx_f.js +1 -0
  18. package/dist/chunks/{format-Cm3B1GMy.js → format-CRFiCNHw.js} +1 -1
  19. package/dist/chunks/get-appointment-query-Ck68BEMg.js +1 -0
  20. package/dist/chunks/get-patient-documents-query-DIQH-TMM.js +1 -0
  21. package/dist/chunks/get-patient-profile-query-B0tUDJmT.js +1 -0
  22. package/dist/chunks/i18n-formats-DYS91YEa.js +1 -0
  23. package/dist/chunks/index-BJYWtEmT.js +1 -0
  24. package/dist/chunks/index-CGnPsMVQ.js +1 -0
  25. package/dist/chunks/index-CvDnN2NR.js +1 -0
  26. package/dist/chunks/index-DBMxJ4Dp.js +1 -0
  27. package/dist/chunks/index-DNUbmrQl.d.ts +31 -0
  28. package/dist/chunks/index-czcKClL3.d.ts +47 -0
  29. package/dist/chunks/index-yd2JNJSr.js +1 -0
  30. package/dist/chunks/isBefore-CPpTogxo.js +1 -0
  31. package/dist/chunks/{isSameDay-DPfclwIL.js → isSameDay-CuhZMy1T.js} +1 -1
  32. package/dist/chunks/localized-decorator-BlOuLhym.js +1 -0
  33. package/dist/chunks/mq-layout-CGcdxGMQ.js +1 -0
  34. package/dist/chunks/mq-professional-presence-sync-cmg6CXhz.d.ts +22 -0
  35. package/dist/chunks/mq-unread-count-sync-DTn9dfR4.d.ts +22 -0
  36. package/dist/chunks/mutation-controller-CR2qcqhH.js +1 -0
  37. package/dist/chunks/parseISO-Dj3qSTG8.js +1 -0
  38. package/dist/chunks/price-CdF63nRC.js +1 -0
  39. package/dist/chunks/professional-overview-CfjgnTw4.js +1 -0
  40. package/dist/chunks/{provide-CfT7g_Zi.js → provide-D2fnEhT2.js} +1 -1
  41. package/dist/chunks/query-Cjvi4_dT.js +1 -0
  42. package/dist/chunks/query-controller-BlO1Ax65.js +1 -0
  43. package/dist/chunks/{refund-cancel-policy-CnbrIqH0.js → refund-cancel-policy-Bl9qE8wD.js} +1 -1
  44. package/dist/chunks/schemas.d-5LR6aN9I.d.ts +134 -0
  45. package/dist/chunks/telemetry-client-BLJVs9me.js +1 -0
  46. package/dist/env.js +1 -1
  47. package/dist/events.d.ts +11 -1
  48. package/dist/events.js +1 -1
  49. package/dist/i18n.js +1 -1
  50. package/dist/index.d.ts +1 -1
  51. package/dist/index.js +1 -1
  52. package/dist/mq-apple-pay-checkout.js +1 -1
  53. package/dist/mq-appointment-checkout.js +1 -1
  54. package/dist/mq-appointment-documentation.d.ts +48 -0
  55. package/dist/mq-appointment-documentation.js +1 -0
  56. package/dist/mq-chat-room.js +1 -1
  57. package/dist/mq-checkout.js +1 -1
  58. package/dist/mq-dashboard.d.ts +224 -0
  59. package/dist/mq-dashboard.js +1 -0
  60. package/dist/mq-documents.d.ts +46 -0
  61. package/dist/mq-documents.js +1 -0
  62. package/dist/mq-google-pay-checkout.js +1 -1
  63. package/dist/mq-immediate-videocall-checkout.js +1 -1
  64. package/dist/mq-my-appointments.d.ts +13 -525
  65. package/dist/mq-my-appointments.js +1 -1
  66. package/dist/mq-professional-presence-sync.d.ts +30 -0
  67. package/dist/mq-professional-presence-sync.js +1 -0
  68. package/dist/mq-query-client-provider.js +1 -1
  69. package/dist/mq-schedule-success.d.ts +9 -0
  70. package/dist/mq-schedule-success.js +2 -2
  71. package/dist/mq-schedule.d.ts +22 -10
  72. package/dist/mq-schedule.js +1 -1
  73. package/dist/mq-session-provider.d.ts +28 -0
  74. package/dist/mq-session-provider.js +1 -0
  75. package/dist/mq-socket-provider.js +1 -1
  76. package/dist/mq-support-chat.js +1 -1
  77. package/dist/mq-terms-and-conditions.d.ts +23 -0
  78. package/dist/mq-terms-and-conditions.js +1 -0
  79. package/dist/mq-unread-count-sync.d.ts +21 -0
  80. package/dist/mq-unread-count-sync.js +1 -0
  81. package/dist/mq-videocall.d.ts +35 -26
  82. package/dist/mq-videocall.js +1 -1
  83. package/dist/react/mq-apple-pay-checkout.d.ts +24 -7
  84. package/dist/react/mq-apple-pay-checkout.js +1 -1
  85. package/dist/react/mq-appointment-checkout.d.ts +20 -5
  86. package/dist/react/mq-appointment-checkout.js +1 -1
  87. package/dist/react/mq-appointment-documentation.d.ts +39 -0
  88. package/dist/react/mq-appointment-documentation.js +2 -0
  89. package/dist/react/mq-chat-room.d.ts +31 -6
  90. package/dist/react/mq-chat-room.js +1 -1
  91. package/dist/react/mq-checkout.d.ts +22 -8
  92. package/dist/react/mq-checkout.js +1 -1
  93. package/dist/react/mq-dashboard.d.ts +57 -0
  94. package/dist/react/mq-dashboard.js +2 -0
  95. package/dist/react/mq-documents.d.ts +27 -0
  96. package/dist/react/mq-documents.js +2 -0
  97. package/dist/react/mq-google-pay-checkout.d.ts +29 -7
  98. package/dist/react/mq-google-pay-checkout.js +1 -1
  99. package/dist/react/mq-immediate-videocall-checkout.d.ts +15 -5
  100. package/dist/react/mq-immediate-videocall-checkout.js +1 -1
  101. package/dist/react/mq-my-appointments.d.ts +27 -6
  102. package/dist/react/mq-my-appointments.js +1 -1
  103. package/dist/react/mq-professional-presence-sync.d.ts +13 -0
  104. package/dist/react/mq-professional-presence-sync.js +2 -0
  105. package/dist/react/mq-query-client-provider.d.ts +9 -2
  106. package/dist/react/mq-query-client-provider.js +1 -1
  107. package/dist/react/mq-schedule-success.d.ts +31 -5
  108. package/dist/react/mq-schedule-success.js +1 -1
  109. package/dist/react/mq-schedule.d.ts +47 -6
  110. package/dist/react/mq-schedule.js +1 -1
  111. package/dist/react/mq-session-provider.d.ts +19 -0
  112. package/dist/react/mq-session-provider.js +2 -0
  113. package/dist/react/mq-socket-provider.d.ts +13 -2
  114. package/dist/react/mq-socket-provider.js +1 -1
  115. package/dist/react/mq-support-chat.d.ts +31 -2
  116. package/dist/react/mq-support-chat.js +1 -1
  117. package/dist/react/mq-terms-and-conditions.d.ts +30 -0
  118. package/dist/react/mq-terms-and-conditions.js +2 -0
  119. package/dist/react/mq-theme-provider.d.ts +13 -2
  120. package/dist/react/mq-toast-container.d.ts +16 -0
  121. package/dist/react/mq-toast-container.js +2 -0
  122. package/dist/react/mq-unread-count-sync.d.ts +13 -0
  123. package/dist/react/mq-unread-count-sync.js +2 -0
  124. package/dist/react/mq-videocall.d.ts +33 -3
  125. package/dist/react/mq-videocall.js +1 -1
  126. package/dist/toast.d.ts +3 -0
  127. package/dist/toast.js +1 -0
  128. package/dist/ui/mq-calendar.js +1 -1
  129. package/dist/ui/mq-time-slot-picker.js +1 -1
  130. package/dist/ui/mq-toast.js +1 -1
  131. package/package.json +33 -1
  132. package/dist/chunks/api-chat-client-C8SqZtCa.js +0 -1
  133. package/dist/chunks/chunk-S5RWG6G2-oTcdgk2H.js +0 -1
  134. package/dist/chunks/chunk-YTQUGGS3-DN-JZpgG.js +0 -1
  135. package/dist/chunks/context-provider-CiMFpvDA.js +0 -1
  136. package/dist/chunks/exports-G_7Ih_GH.js +0 -1
  137. package/dist/chunks/external-zAbuzxDj.js +0 -1
  138. package/dist/chunks/get-patient-profile-query-C8T8DJ7z.js +0 -1
  139. package/dist/chunks/index-Bxh8Qfwr.js +0 -1
  140. package/dist/chunks/index-DiqYAEHW.js +0 -1
  141. package/dist/chunks/isBefore-Cof0D841.js +0 -1
  142. package/dist/chunks/mq-layout-CpIZTsV2.js +0 -1
  143. package/dist/chunks/mutation-controller-OVT8NEt6.js +0 -1
  144. package/dist/chunks/parseISO-jT42c8Ob.js +0 -1
  145. package/dist/chunks/price-tImUmtpX.js +0 -1
  146. package/dist/chunks/query-QJ1INUTG.js +0 -1
  147. package/dist/chunks/telemetry-client-BRVJU-fZ.js +0 -1
@@ -0,0 +1 @@
1
+ import{_ as t,t as o}from"./custom-element-DA9Fxvxd.js";import{m as C}from"./runtime-Bg1WXVCx.js";import{l as a}from"./localized-decorator-BlOuLhym.js";import{a as r,i as e,x as i}from"./lit-element-DiWJYFwC.js";import{n}from"./property-scuRaFcM.js";let d=class MQLayout extends r{constructor(){super(...arguments),this.background="default",this.variant="default",this.showMediquoBranding=!0}static{this.styles=e`:host{--content-max-width:560px;display:flex;flex-direction:column;height:100%;width:100%;max-width:var(--content-max-width);margin:0 auto;background-color:var(--color-background)}:host([background=solid]){background-color:var(--color-background)}:host([background=transparent]){background-color:transparent}:host([variant=wide]){--content-max-width:1000px}.content{flex:1;padding:var(--mq-layout-padding,0)}footer{display:flex;flex-direction:column;align-items:center;gap:var(--sp-4);padding-top:var(--sp-10);padding-bottom:var(--sp-3);padding-inline:var(--mq-layout-padding,0);margin-bottom:var(--sp-3);text-align:center}.branding{display:flex;justify-content:center;align-items:center;gap:var(--size-2);font-family:var(--font-body);font-size:var(--text-sm);line-height:normal;font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default)}`}render(){return this.showMediquoBranding?i`<div class="content"><slot></slot></div><footer><div class="branding">${C("Servicio y plataforma prestados por")} ${i`<svg width="82" height="16" viewBox="0 0 82 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M52.4506 8.97739V10.5665C52.4506 11.1054 52.0077 11.5477 51.4682 11.5477C50.9288 11.5477 50.486 11.1054 50.486 10.5665V8.97739H48.8531C48.3276 8.97739 47.8984 8.54894 47.8984 8.02383C47.8984 7.49893 48.3276 7.07053 48.8531 7.07053H50.486V5.48128C50.486 4.94243 50.9288 4.5002 51.4682 4.5002C52.0077 4.5002 52.4506 4.94243 52.4506 5.48128V7.07053H54.0836C54.609 7.07053 55.0379 7.49893 55.0379 8.02383C55.0379 8.54894 54.609 8.97739 54.0836 8.97739H52.4506ZM56.8563 5.46693C56.055 3.75203 54.5229 2.55033 52.6531 2.16979C52.3272 2.10809 51.9339 2.06818 51.5273 2.05679C48.7327 2.10005 46.4191 3.93204 45.7665 6.6209C45.397 8.13705 45.6843 9.78156 46.555 11.134C47.4258 12.4867 48.8053 13.431 50.3396 13.7243C51.7168 13.9883 53.0199 13.8046 54.2312 13.1767L54.2853 13.1506C54.554 13.0306 54.8304 12.9977 55.1481 13.0559L55.2243 13.0728C55.8277 13.2312 56.4308 13.389 57.0345 13.5467C56.8787 12.9784 56.7231 12.4168 56.5656 11.86L56.5512 11.8035C56.4673 11.4258 56.5163 11.0837 56.7011 10.7579C57.5947 9.11014 57.6548 7.17549 56.8563 5.46693ZM59.2901 15.5846C59.0891 15.8486 58.7811 16 58.4446 16C58.2872 16 58.1621 15.967 58.0617 15.9405L57.0944 15.6878C56.3739 15.4997 55.6553 15.312 54.936 15.1233C53.8594 15.6379 52.7204 15.8988 51.5464 15.8988C51.0243 15.8988 50.4877 15.8466 49.9521 15.7439C47.8668 15.3452 45.9973 14.0703 44.823 12.2461C43.6488 10.4223 43.2634 8.19505 43.7656 6.13553C44.6446 2.51324 47.7615 0.0472629 51.5211 0.000260881L51.5409 0L51.5605 0.000391321C52.0913 0.0140876 52.5926 0.0651767 53.0508 0.152094C55.5798 0.666768 57.6424 2.28597 58.7224 4.59729C59.7655 6.82947 59.7232 9.34593 58.6144 11.5401C58.8921 12.5275 59.1643 13.5268 59.4414 14.5471C59.4869 14.7106 59.6124 15.1611 59.2901 15.5846ZM79.7577 8.77869C79.7577 7.05748 78.5162 5.63246 76.7557 5.63246C74.9582 5.63246 73.8092 7.03887 73.8092 8.7416V8.77869C73.8092 10.4814 75.0508 11.9064 76.7927 11.9064C78.6089 11.9064 79.7577 10.4999 79.7577 8.81573V8.77869ZM76.7557 13.868C73.7722 13.868 71.5669 11.5915 71.5669 8.81573V8.77869C71.5669 5.98404 73.7907 3.67068 76.7927 3.67068C79.7949 3.67068 82 5.94717 82 8.7416V8.77869C82 11.5545 79.7764 13.868 76.7557 13.868ZM68.7934 13.7387C68.1816 13.7387 67.6628 13.2571 67.6628 12.6281V12.1285C67.0328 13.0538 66.1247 13.8495 64.6051 13.8495C62.4 13.8495 61.1213 12.3691 61.1213 10.0925V4.89208C61.1213 4.2631 61.6216 3.76329 62.2331 3.76329C62.8633 3.76329 63.3637 4.2631 63.3637 4.89208V9.42637C63.3637 10.944 64.1233 11.7951 65.4575 11.7951C66.7547 11.7951 67.6628 10.9071 67.6628 9.38919V4.89208C67.6628 4.2631 68.1631 3.76329 68.7934 3.76329C69.4048 3.76329 69.9236 4.2631 69.9236 4.89208V12.6281C69.9236 13.2386 69.4233 13.7387 68.7934 13.7387ZM40.4153 3.76329C41.0454 3.76329 41.5457 4.2631 41.5457 4.89208V12.6281C41.5457 13.2571 41.0454 13.7387 40.4153 13.7387C39.8038 13.7387 39.3034 13.2571 39.3034 12.6281V4.89208C39.3034 4.2631 39.7852 3.76329 40.4153 3.76329ZM40.4153 2.4678C39.6925 2.4678 39.1368 2.02361 39.1368 1.35732V1.2464C39.1368 0.580156 39.6925 0.154442 40.4153 0.154442C41.1379 0.154442 41.694 0.580156 41.694 1.2464V1.35732C41.694 2.02361 41.1379 2.4678 40.4153 2.4678ZM34.7693 8.7416C34.7693 6.85382 33.435 5.6139 31.9339 5.6139C30.3961 5.6139 29.1173 6.79821 29.1173 8.7416V8.77869C29.1173 10.6665 30.4145 11.9064 31.9339 11.9064C33.435 11.9064 34.7693 10.6476 34.7693 8.77869V8.7416ZM35.8627 13.7387C35.2325 13.7387 34.7321 13.2571 34.7321 12.6281V12.0172C34.0095 13.0353 32.9903 13.8495 31.3966 13.8495C29.0988 13.8495 26.8566 12.0172 26.8566 8.77869V8.7416C26.8566 5.50298 29.0616 3.67068 31.3966 3.67068C33.0088 3.67068 34.028 4.4665 34.7321 5.39189V1.15383C34.7321 0.524632 35.2325 0.0434802 35.8439 0.0434802C36.4742 0.0434802 36.9745 0.524632 36.9745 1.15383V12.6281C36.9745 13.2571 36.4742 13.7387 35.8627 13.7387ZM21.0065 5.50298C19.6353 5.50298 18.6718 6.55763 18.4678 8.07548H23.4897C23.3416 6.63203 22.4892 5.50298 21.0065 5.50298ZM24.6203 9.55589H18.4864C18.7272 11.1477 19.8578 12.0357 21.3032 12.0357C22.2482 12.0357 22.9895 11.7028 23.6196 11.1846C23.7863 11.0548 23.9346 10.981 24.194 10.981C24.6945 10.981 25.0836 11.3698 25.0836 11.8879C25.0836 12.1654 24.9539 12.406 24.787 12.5727C23.8975 13.3683 22.7858 13.868 21.2662 13.868C18.4308 13.868 16.244 11.8136 16.244 8.79712V8.76021C16.244 5.96556 18.227 3.67068 21.0253 3.67068C24.1384 3.67068 25.6765 6.22475 25.6765 8.48246C25.6765 9.1117 25.1948 9.55589 24.6203 9.55589ZM13.7686 13.7387C13.1387 13.7387 12.6382 13.2571 12.6382 12.6281V8.09396C12.6382 6.53915 11.9155 5.70655 10.6555 5.70655C9.43232 5.70655 8.56142 6.55763 8.56142 8.13083V12.6281C8.56142 13.2571 8.06108 13.7387 7.44958 13.7387C6.81941 13.7387 6.3192 13.2571 6.3192 12.6281V8.07548C6.3192 6.55763 5.57796 5.70655 4.33625 5.70655C3.09479 5.70655 2.24235 6.63203 2.24235 8.13083V12.6281C2.24235 13.2571 1.74205 13.7387 1.1118 13.7387C0.500341 13.7387 0 13.2571 0 12.6281V4.89208C0 4.2631 0.481844 3.76329 1.1118 3.76329C1.74205 3.76329 2.24235 4.2631 2.24235 4.89208V5.35475C2.87235 4.48511 3.72475 3.67068 5.22586 3.67068C6.63431 3.67068 7.63481 4.35545 8.15378 5.39189C8.93198 4.35545 9.96987 3.67068 11.4522 3.67068C13.5833 3.67068 14.8804 5.02183 14.8804 7.40919V12.6281C14.8804 13.2571 14.3988 13.7387 13.7686 13.7387Z" fill="#0A0A22"/></svg>`}</div></footer>`:i`<div class="content"><slot></slot></div>`}};t([n({type:String})],d.prototype,"background",void 0),t([n()],d.prototype,"variant",void 0),t([n({type:Boolean,attribute:"show-mediquo-branding"})],d.prototype,"showMediquoBranding",void 0),d=t([a(),o("mq-layout")],d);
@@ -0,0 +1,22 @@
1
+ import { LitElement } from 'lit';
2
+
3
+ /**
4
+ * Headless element that runs the {@link ProfessionalPresenceSyncController}.
5
+ * Renders nothing — mount it once under the socket + query-client providers and
6
+ * it keeps cached professional presence (`active_absence`) current from realtime
7
+ * socket events. Standalone replacement for the equivalent `mq-router` internal,
8
+ * consumable from any host (React included via
9
+ * `@mediquo/elements/react/mq-professional-presence-sync`).
10
+ */
11
+ declare class MqProfessionalPresenceSync extends LitElement {
12
+ private _controller;
13
+ createRenderRoot(): this;
14
+ render(): symbol;
15
+ }
16
+ declare global {
17
+ interface HTMLElementTagNameMap {
18
+ "mq-professional-presence-sync": MqProfessionalPresenceSync;
19
+ }
20
+ }
21
+
22
+ export { MqProfessionalPresenceSync as M };
@@ -0,0 +1,22 @@
1
+ import { LitElement } from 'lit';
2
+
3
+ /**
4
+ * Headless element that runs the {@link UnreadCountSyncController}. Renders
5
+ * nothing — mount it once anywhere under the socket + query-client providers
6
+ * (e.g. next to your sidebar) and it keeps cached unread counts current from
7
+ * realtime socket messages. This is the standalone replacement for the
8
+ * equivalent `mq-router` internal, consumable from any host (React included via
9
+ * `@mediquo/elements/react/mq-unread-count-sync`).
10
+ */
11
+ declare class MqUnreadCountSync extends LitElement {
12
+ private _controller;
13
+ createRenderRoot(): this;
14
+ render(): symbol;
15
+ }
16
+ declare global {
17
+ interface HTMLElementTagNameMap {
18
+ "mq-unread-count-sync": MqUnreadCountSync;
19
+ }
20
+ }
21
+
22
+ export { MqUnreadCountSync as M };
@@ -0,0 +1 @@
1
+ var t=class{constructor(t,s){this.host=t,this.options=s,this._isPending=!1,this._isError=!1,this._isSuccess=!1,this._data=void 0,this._error=void 0,this.host.addController(this)}hostConnected(){}hostDisconnected(){}async run(t){this._isPending=!0,this._isError=!1,this._isSuccess=!1,this._data=void 0,this._error=void 0,this.host.requestUpdate();try{const s=await this.options.mutationFn(t);return this._isPending=!1,this._isSuccess=!0,this._data=s,this.host.requestUpdate(),this.options.onSuccess&&await this.options.onSuccess(s,t),this.options.onSettled&&await this.options.onSettled(s,void 0,t),s}catch(s){if(this._isPending=!1,this._isError=!0,this._error=s,this.host.requestUpdate(),this.options.onError&&await this.options.onError(s,t),this.options.onSettled&&await this.options.onSettled(void 0,s,t),this.options.throwOnError)throw s;return}}reset(){this._isPending=!1,this._isError=!1,this._isSuccess=!1,this._data=void 0,this._error=void 0,this.host.requestUpdate()}updateOptions(t){this.options={...this.options,...t}}get isPending(){return this._isPending}get isError(){return this._isError}get isSuccess(){return this._isSuccess}get isIdle(){return!this._isPending&&!this._isError&&!this._isSuccess}get data(){return this._data}get error(){return this._error}};export{t as M};
@@ -0,0 +1 @@
1
+ const t=6048e5,e=864e5,n=6e4,r=36e5,i=Symbol.for("constructDateFrom");function a(t,e){return"function"==typeof t?t(e):t&&"object"==typeof t&&i in t?t[i](e):t instanceof Date?new t.constructor(e):new Date(e)}function o(t,e){return a(e||t,t)}let s={};function u(){return s}function c(t,e){const n=u(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=o(t,e?.in),a=i.getDay(),s=(a<r?7:0)+a-r;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function l(t,...e){const n=a.bind(null,e.find(t=>"object"==typeof t));return e.map(n)}function f(t,e){const n=o(t,e?.in);return n.setHours(0,0,0,0),n}function d(t,e){const i=()=>a(e?.in,NaN),s=function(t){const e={},n=t.split(m.dateTimeDelimiter);let r;if(n.length>2)return e;/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],m.timeZoneDelimiter.test(e.date)&&(e.date=t.split(m.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length)));if(r){const t=m.timezone.exec(r);t?(e.time=r.replace(t[1],""),e.timezone=t[1]):e.time=r}return e}(t);let u;if(s.date){const t=function(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const i=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:null===a?i:100*a,restDateString:t.slice((r[1]||r[2]).length)}}(s.date,2);u=function(t,e){if(null===e)return new Date(NaN);const n=t.match(D);if(!n)return new Date(NaN);const r=!!n[4],i=p(n[1]),a=p(n[2])-1,o=p(n[3]),s=p(n[4]),u=p(n[5])-1;if(r)return function(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}(0,s,u)?function(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const i=r.getUTCDay()||7,a=7*(e-1)+n+1-i;return r.setUTCDate(r.getUTCDate()+a),r}(e,s,u):new Date(NaN);{const t=new Date(0);return function(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(w[e]||(C(t)?29:28))}(e,a,o)&&function(t,e){return e>=1&&e<=(C(t)?366:365)}(e,i)?(t.setUTCFullYear(e,a,Math.max(i,o)),t):new Date(NaN)}}(t.restDateString,t.year)}if(!u||isNaN(+u))return i();const c=+u;let l,f=0;if(s.time&&(f=function(t){const e=t.match(N);if(!e)return NaN;const i=T(e[1]),a=T(e[2]),o=T(e[3]);if(!function(t,e,n){if(24===t)return 0===e&&0===n;return n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}(i,a,o))return NaN;return i*r+a*n+1e3*o}(s.time),isNaN(f)))return i();if(!s.timezone){const t=new Date(c+f),n=o(0,e?.in);return n.setFullYear(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),n.setHours(t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()),n}return l=function(t){if("Z"===t)return 0;const e=t.match(g);if(!e)return 0;const i="+"===e[1]?-1:1,a=parseInt(e[2]),o=e[3]&&parseInt(e[3])||0;if(!function(t,e){return e>=0&&e<=59}(0,o))return NaN;return i*(a*r+o*n)}(s.timezone),isNaN(l)?i():o(c+f+l,e?.in)}const m={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},D=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,N=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,g=/^([+-])(\d{2})(?::?(\d{2}))?$/;function p(t){return t?parseInt(t):1}function T(t){return t&&parseFloat(t.replace(",","."))||0}const w=[31,null,31,30,31,30,31,31,30,31,30,31];function C(t){return t%400==0||t%4==0&&t%100!=0}export{c as a,t as b,a as c,u as g,e as m,l as n,d as p,f as s,o as t};
@@ -0,0 +1 @@
1
+ import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{b as n}from"./api-chat-client-vbjgaIRV.js";import{a as r}from"./telemetry-client-BLJVs9me.js";import{i as a,a as s,E as l,x as m}from"./lit-element-DiWJYFwC.js";import{n as p}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 u}from"../ui/icons/calendar-icon.js";import{clockIcon as f}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 y=a`.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 g=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=y}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),a=r(o,this.duration),s=e.format(o),p=i.format(o),d=i.format(a),v=this.timezone?n(this.timezone,o):"";return m`<div class="${c({"appointment-details":!0,wide:"wide"===this.variant})}"><div class="detail-row">${u({size:24})} <span>${s}</span></div><div class="detail-row">${f({size:24})} <span>${p} - ${d}${v?` (${v})`:""}</span></div>${this.channel?m`<div class="detail-row full-width">${this._appointmentChannelToIcon(this.channel)} <span>${this._appointmentChannelToLabel(this.channel)}</span></div>`:l}</div>`}};function x(t){return t/100}function z(t,e){const i=e.replaceAll("_","-");return new Intl.NumberFormat(i,{style:"currency",currency:t.currency}).format(x(t.amount))}function j(t){return null!=t&&t.amount>0}t([p({type:String})],g.prototype,"startsAt",void 0),t([p({type:Number})],g.prototype,"duration",void 0),t([p({type:String})],g.prototype,"channel",void 0),t([p({type:String})],g.prototype,"variant",void 0),t([p({type:Boolean,attribute:"strike-through"})],g.prototype,"strikeThrough",void 0),t([p({type:String})],g.prototype,"timezone",void 0),g=t([o(),e("appointment-details")],g);export{g as A,x as c,z as f,j as h};
@@ -0,0 +1 @@
1
+ import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{m as a,s as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{i as s,a as r,x as n,E as l}from"./lit-element-DiWJYFwC.js";import{n as d}from"./property-scuRaFcM.js";import{r as p}from"./state-LQivXIgA.js";import{getLocale as m}from"../i18n.js";import{chevronDownIcon as f}from"../ui/icons/chevron-down-icon.js";import"../ui/mq-text-button.js";import"../ui/mq-avatar.js";const g=s`.header{display:flex;align-items:center;gap:var(--sp-4);margin-bottom:0}.header.expanded{margin-bottom:var(--sp-4)}@media (max-width:768px){.header{--avatar-size-lg:var(--avatar-size-md)}}.professional-info{flex:1}.professional-name{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutral-link-dark);margin:0}.professional-specialty{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-neutral-text-default);margin:0}.collegiate-number{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);color:var(--color-neutrals-text-medium);margin:0;text-transform:uppercase}.languages{display:flex;flex-wrap:wrap;gap:var(--sp-3)}.language-pill{display:inline-block;background-color:#e5e5e5;color:var(--colors-neutral-text-default);font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-medium);padding:var(--sp-1) var(--sp-2);border-radius:26px;text-transform:uppercase}.description{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-normal);margin-bottom:0;color:var(--color-neutrals-text-medium)}.icon{transition:transform .1s ease-in-out}.rotate-180{transform:rotate(180deg)}.details{display:grid;grid-template-rows:0fr;transition:grid-template-rows .2s ease-out;overflow:hidden}.details[data-expanded=true]{grid-template-rows:1fr}.details-content{overflow:hidden}.details-content>:not(:first-child){margin-top:var(--sp-3)}@media (min-width:769px){:host([always-expanded-on-desktop]) .details{grid-template-rows:1fr}:host([always-expanded-on-desktop]) mq-text-button{display:none}:host([always-expanded-on-desktop]) .header{margin-bottom:var(--sp-4)}}`;let c=class ProfessionalOverview extends r{constructor(){super(...arguments),this.alwaysExpandedOnDesktop=!1,this.detailsExpanded=!1}static{this.styles=g}render(){const t=m().replace("_","-"),e=this.languages.map(e=>n`<span class="language-pill">${new Intl.DisplayNames(t,{type:"language"}).of(e)}</span>`);return n`<div class="header ${this.detailsExpanded?"expanded":""}"><mq-avatar src="${this.avatar}" fallback="${this.name}" alt="${this.name}" size="lg"></mq-avatar><div class="professional-info"><h2 class="professional-name">${this.name}</h2>${this.specialtyName?n`<p class="professional-specialty">${this.specialtyName}</p>`:l}<mq-text-button type="button" size="sm" fontWeight="bold" @click="${()=>{this.detailsExpanded=!this.detailsExpanded}}">${this.detailsExpanded?a("Ocultar detalles"):a("Ver detalles")} ${f({size:24,className:"icon "+(this.detailsExpanded?"rotate-180":"")})}</mq-text-button></div></div><div class="details" data-expanded="${this.detailsExpanded}"><div class="details-content"><div class="languages">${e}</div>${this.collegiateNumber?n`<p class="collegiate-number">${a(i`Nº COL. ${this.collegiateNumber}`)}</p>`:l}<p class="description">${this.description}</p></div></div>`}};t([d({type:String})],c.prototype,"name",void 0),t([d({type:String})],c.prototype,"specialtyName",void 0),t([d({type:String})],c.prototype,"collegiateNumber",void 0),t([d({type:String})],c.prototype,"description",void 0),t([d({type:Array})],c.prototype,"languages",void 0),t([d({type:String})],c.prototype,"avatar",void 0),t([d({type:Boolean,reflect:!0,attribute:"always-expanded-on-desktop"})],c.prototype,"alwaysExpandedOnDesktop",void 0),t([p()],c.prototype,"detailsExpanded",void 0),c=t([o(),e("professional-overview")],c);export{c as P};
@@ -1 +1 @@
1
- import{i as t}from"./context-provider-CiMFpvDA.js";function e({context:e}){return(r,n)=>{const s=new WeakMap;if("object"==typeof n)return{get(){return r.get.call(this)},set(t){return s.get(this).setValue(t),r.set.call(this,t)},init(r){return s.set(this,new t(this,{context:e,initialValue:r})),r}};{r.constructor.addInitializer(r=>{s.set(r,new t(r,{context:e}))});const i=Object.getOwnPropertyDescriptor(r,n);let o;if(void 0===i){const t=new WeakMap;o={get(){return t.get(this)},set(e){s.get(this).setValue(e),t.set(this,e)},configurable:!0,enumerable:!0}}else{const t=i.set;o={...i,set(e){s.get(this).setValue(e),t?.call(this,e)}}}return void Object.defineProperty(r,n,o)}}}export{e};
1
+ import{i as t}from"./context-provider--AKuwfs9.js";function e({context:e}){return(r,n)=>{const s=new WeakMap;if("object"==typeof n)return{get(){return r.get.call(this)},set(t){return s.get(this).setValue(t),r.set.call(this,t)},init(r){return s.set(this,new t(this,{context:e,initialValue:r})),r}};{r.constructor.addInitializer(r=>{s.set(r,new t(r,{context:e}))});const i=Object.getOwnPropertyDescriptor(r,n);let o;if(void 0===i){const t=new WeakMap;o={get(){return t.get(this)},set(e){s.get(this).setValue(e),t.set(this,e)},configurable:!0,enumerable:!0}}else{const t=i.set;o={...i,set(e){s.get(this).setValue(e),t?.call(this,e)}}}return void Object.defineProperty(r,n,o)}}}export{e};
@@ -0,0 +1 @@
1
+ var t=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},e={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},s=new class{#t=e;#e=!1;setTimeoutProvider(t){this.#t=t}setTimeout(t,e){return this.#t.setTimeout(t,e)}clearTimeout(t){this.#t.clearTimeout(t)}setInterval(t,e){return this.#t.setInterval(t,e)}clearInterval(t){this.#t.clearInterval(t)}};var i="undefined"==typeof window||"Deno"in globalThis;function n(){}function r(t,e){return"function"==typeof t?t(e):t}function a(t){return"number"==typeof t&&t>=0&&t!==1/0}function o(t,e){return Math.max(t+(e||0)-Date.now(),0)}function c(t,e){return"function"==typeof t?t(e):t}function u(t,e){return"function"==typeof t?t(e):t}function h(t,e){const{type:s="all",exact:i,fetchStatus:n,predicate:r,queryKey:a,stale:o}=t;if(a)if(i){if(e.queryHash!==d(a,e.options))return!1}else if(!p(e.queryKey,a))return!1;if("all"!==s){const t=e.isActive();if("active"===s&&!t)return!1;if("inactive"===s&&t)return!1}return("boolean"!=typeof o||e.isStale()===o)&&((!n||n===e.state.fetchStatus)&&!(r&&!r(e)))}function l(t,e){const{exact:s,status:i,predicate:n,mutationKey:r}=t;if(r){if(!e.options.mutationKey)return!1;if(s){if(f(e.options.mutationKey)!==f(r))return!1}else if(!p(e.options.mutationKey,r))return!1}return(!i||e.state.status===i)&&!(n&&!n(e))}function d(t,e){return(e?.queryKeyHashFn||f)(t)}function f(t){return JSON.stringify(t,(t,e)=>g(e)?Object.keys(e).sort().reduce((t,s)=>(t[s]=e[s],t),{}):e)}function p(t,e){return t===e||typeof t==typeof e&&(!(!t||!e||"object"!=typeof t||"object"!=typeof e)&&Object.keys(e).every(s=>p(t[s],e[s])))}var y=Object.prototype.hasOwnProperty;function v(t,e){if(t===e)return t;const s=m(t)&&m(e);if(!(s||g(t)&&g(e)))return e;const i=(s?t:Object.keys(t)).length,n=s?e:Object.keys(e),r=n.length,a=s?new Array(r):{};let o=0;for(let c=0;c<r;c++){const r=s?c:n[c],u=t[r],h=e[r];if(u===h){a[r]=u,(s?c<i:y.call(t,r))&&o++;continue}if(null===u||null===h||"object"!=typeof u||"object"!=typeof h){a[r]=h;continue}const l=v(u,h);a[r]=l,l===u&&o++}return i===r&&o===i?t:a}function b(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function m(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function g(t){if(!S(t))return!1;const e=t.constructor;if(void 0===e)return!0;const s=e.prototype;return!!S(s)&&(!!s.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(t)===Object.prototype)}function S(t){return"[object Object]"===Object.prototype.toString.call(t)}function w(t,e,s){return"function"==typeof s.structuralSharing?s.structuralSharing(t,e):!1!==s.structuralSharing?v(t,e):e}function O(t,e,s=0){const i=[...t,e];return s&&i.length>s?i.slice(1):i}function F(t,e,s=0){const i=[e,...t];return s&&i.length>s?i.slice(0,-1):i}var C=Symbol();function T(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:t.queryFn&&t.queryFn!==C?t.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`))}var j=new class extends t{#s;#i;#n;constructor(){super(),this.#n=t=>{if(!i&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#i||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(t){this.#n=t,this.#i?.(),this.#i=t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()})}setFocused(t){this.#s!==t&&(this.#s=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return"boolean"==typeof this.#s?this.#s:"hidden"!==globalThis.document?.visibilityState}};function q(){let t,e;const s=new Promise((s,i)=>{t=s,e=i});function i(t){Object.assign(s,t),delete s.resolve,delete s.reject}return s.status="pending",s.catch(()=>{}),s.resolve=e=>{i({status:"fulfilled",value:e}),t(e)},s.reject=t=>{i({status:"rejected",reason:t}),e(t)},s}var U=function(t){setTimeout(t,0)};var A=function(){let t=[],e=0,s=t=>{t()},i=t=>{t()},n=U;const r=i=>{e?t.push(i):n(()=>{s(i)})};return{batch:r=>{let a;e++;try{a=r()}finally{e--,e||(()=>{const e=t;t=[],e.length&&n(()=>{i(()=>{e.forEach(t=>{s(t)})})})})()}return a},batchCalls:t=>(...e)=>{r(()=>{t(...e)})},schedule:r,setNotifyFunction:t=>{s=t},setBatchNotifyFunction:t=>{i=t},setScheduler:t=>{n=t}}}(),E=new class extends t{#r=!0;#i;#n;constructor(){super(),this.#n=t=>{if(!i&&window.addEventListener){const e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#i||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(t){this.#n=t,this.#i?.(),this.#i=t(this.setOnline.bind(this))}setOnline(t){this.#r!==t&&(this.#r=t,this.listeners.forEach(e=>{e(t)}))}isOnline(){return this.#r}};function R(t){return Math.min(1e3*2**t,3e4)}function P(t){return"online"!==(t??"online")||E.isOnline()}var D=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function L(t){let e,n=!1,r=0;const a=q(),o=()=>"pending"!==a.status,c=()=>j.isFocused()&&("always"===t.networkMode||E.isOnline())&&t.canRun(),u=()=>P(t.networkMode)&&t.canRun(),h=t=>{o()||(e?.(),a.resolve(t))},l=t=>{o()||(e?.(),a.reject(t))},d=()=>new Promise(s=>{e=t=>{(o()||c())&&s(t)},t.onPause?.()}).then(()=>{e=void 0,o()||t.onContinue?.()}),f=()=>{if(o())return;let e;const a=0===r?t.initialPromise:void 0;try{e=a??t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(h).catch(e=>{if(o())return;const a=t.retry??(i?0:3),u=t.retryDelay??R,h="function"==typeof u?u(r,e):u,p=!0===a||"number"==typeof a&&r<a||"function"==typeof a&&a(r,e);var y;!n&&p?(r++,t.onFail?.(r,e),(y=h,new Promise(t=>{s.setTimeout(t,y)})).then(()=>c()?void 0:d()).then(()=>{n?l(e):f()})):l(e)})};return{promise:a,status:()=>a.status,cancel:e=>{if(!o()){const s=new D(e);l(s),t.onCancel?.(s)}},continue:()=>(e?.(),a),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:u,start:()=>(u()?f():d().then(f),a)}}var I=class{#a;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),a(this.gcTime)&&(this.#a=s.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(i?1/0:3e5))}clearGcTimeout(){this.#a&&(s.clearTimeout(this.#a),this.#a=void 0)}},k=class extends I{#o;#c;#u;#h;#l;#d;#f;constructor(t){super(),this.#f=!1,this.#d=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#h=t.client,this.#u=this.#h.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#o=M(this.options),this.state=t.state??this.#o,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#l?.promise}setOptions(t){if(this.options={...this.#d,...t},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const t=M(this.options);void 0!==t.data&&(this.setData(t.data,{updatedAt:t.dataUpdatedAt,manual:!0}),this.#o=t)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(t,e){const s=w(this.state.data,t,this.options);return this.#p({data:s,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),s}setState(t,e){this.#p({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#l?.promise;return this.#l?.cancel(t),e?e.then(n).catch(n):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#o)}isActive(){return this.observers.some(t=>!1!==u(t.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===C||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(t=>"static"===c(t.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(t=0){return void 0===this.state.data||"static"!==t&&(!!this.state.isInvalidated||!o(this.state.dataUpdatedAt,t))}onFocus(){const t=this.observers.find(t=>t.shouldFetchOnWindowFocus());t?.refetch({cancelRefetch:!1}),this.#l?.continue()}onOnline(){const t=this.observers.find(t=>t.shouldFetchOnReconnect());t?.refetch({cancelRefetch:!1}),this.#l?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#l&&(this.#f?this.#l.cancel({revert:!0}):this.#l.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#p({type:"invalidate"})}async fetch(t,e){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#l?.status())if(void 0!==this.state.data&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#l)return this.#l.continueRetry(),this.#l.promise;if(t&&this.setOptions(t),!this.options.queryFn){const t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}const s=new AbortController,i=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(this.#f=!0,s.signal)})},n=()=>{const t=T(this.options,e),s=(()=>{const t={client:this.#h,queryKey:this.queryKey,meta:this.meta};return i(t),t})();return this.#f=!1,this.options.persister?this.options.persister(t,s,this):t(s)},r=(()=>{const t={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#h,state:this.state,fetchFn:n};return i(t),t})();this.options.behavior?.onFetch(r,this),this.#c=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===r.fetchOptions?.meta||this.#p({type:"fetch",meta:r.fetchOptions?.meta}),this.#l=L({initialPromise:e?.initialPromise,fn:r.fetchFn,onCancel:t=>{t instanceof D&&t.revert&&this.setState({...this.#c,fetchStatus:"idle"}),s.abort()},onFail:(t,e)=>{this.#p({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#p({type:"pause"})},onContinue:()=>{this.#p({type:"continue"})},retry:r.options.retry,retryDelay:r.options.retryDelay,networkMode:r.options.networkMode,canRun:()=>!0});try{const t=await this.#l.start();if(void 0===t)throw new Error(`${this.queryHash} data is undefined`);return this.setData(t),this.#u.config.onSuccess?.(t,this),this.#u.config.onSettled?.(t,this.state.error,this),t}catch(t){if(t instanceof D){if(t.silent)return this.#l.promise;if(t.revert){if(void 0===this.state.data)throw t;return this.state.data}}throw this.#p({type:"error",error:t}),this.#u.config.onError?.(t,this),this.#u.config.onSettled?.(this.state.data,t,this),t}finally{this.scheduleGc()}}#p(t){this.state=(e=>{switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...K(e.data,this.options),fetchMeta:t.meta??null};case"success":const s={...e,data:t.data,dataUpdateCount:e.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#c=t.manual?s:void 0,s;case"error":const i=t.error;return{...e,error:i,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}})(this.state),A.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:t})})}};function K(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:P(e.networkMode)?"fetching":"paused",...void 0===t&&{error:null,status:"pending"}}}function M(t){const e="function"==typeof t.initialData?t.initialData():t.initialData,s=void 0!==e,i=s?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}export{k as Q,I as R,t as S,c as a,a as b,s as c,K as d,w as e,j as f,A as g,T as h,i,F as j,O as k,L as l,l as m,n,d as o,q as p,h as q,u as r,b as s,o as t,E as u,r as v,f as w,p as x,C as y};
@@ -0,0 +1 @@
1
+ import{Q as t}from"./chunk-RCFIJTXZ-C6Ir0-sM.js";import{s as e}from"./context-consumer-ESdICVAb.js";import{S as s,p as r,r as i,s as n,a as u,n as a,i as h,b as o,t as c,c as l,f as d,d as p,e as f,g as y}from"./query-Cjvi4_dT.js";var b=class extends s{constructor(t,e){super(),this.options=e,this.#t=t,this.#e=null,this.#s=r(),this.bindMethods(),this.setOptions(e)}#t;#r=void 0;#i=void 0;#n=void 0;#u;#a;#s;#e;#h;#o;#c;#l;#d;#p;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#r.addObserver(this),R(this.#r,this.options)?this.#y():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return v(this.#r,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return v(this.#r,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#R(),this.#v(),this.#r.removeObserver(this)}setOptions(t){const e=this.options,s=this.#r;if(this.options=this.#t.defaultQueryOptions(t),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof i(this.options.enabled,this.#r))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#Q(),this.#r.setOptions(this.options),e._defaulted&&!n(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#r,observer:this});const r=this.hasListeners();r&&Q(this.#r,s,this.options,e)&&this.#y(),this.updateResult(),!r||this.#r===s&&i(this.options.enabled,this.#r)===i(e.enabled,this.#r)&&u(this.options.staleTime,this.#r)===u(e.staleTime,this.#r)||this.#m();const a=this.#I();!r||this.#r===s&&i(this.options.enabled,this.#r)===i(e.enabled,this.#r)&&a===this.#p||this.#O(a)}getOptimisticResult(t){const e=this.#t.getQueryCache().build(this.#t,t),s=this.createResult(e,t);return function(t,e){if(!n(t.getCurrentResult(),e))return!0;return!1}(this,s)&&(this.#n=s,this.#a=this.options,this.#u=this.#r.state),s}getCurrentResult(){return this.#n}trackResult(t,e){return new Proxy(t,{get:(t,s)=>(this.trackProp(s),e?.(s),"promise"!==s||this.options.experimental_prefetchInRender||"pending"!==this.#s.status||this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(t,s))})}trackProp(t){this.#f.add(t)}getCurrentQuery(){return this.#r}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#t.defaultQueryOptions(t),s=this.#t.getQueryCache().build(this.#t,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#y({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#y(t){this.#Q();let e=this.#r.fetch(this.options,t);return t?.throwOnError||(e=e.catch(a)),e}#m(){this.#R();const t=u(this.options.staleTime,this.#r);if(h||this.#n.isStale||!o(t))return;const e=c(this.#n.dataUpdatedAt,t)+1;this.#l=l.setTimeout(()=>{this.#n.isStale||this.updateResult()},e)}#I(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#r):this.options.refetchInterval)??!1}#O(t){this.#v(),this.#p=t,!h&&!1!==i(this.options.enabled,this.#r)&&o(this.#p)&&0!==this.#p&&(this.#d=l.setInterval(()=>{(this.options.refetchIntervalInBackground||d.isFocused())&&this.#y()},this.#p))}#b(){this.#m(),this.#O(this.#I())}#R(){this.#l&&(l.clearTimeout(this.#l),this.#l=void 0)}#v(){this.#d&&(l.clearInterval(this.#d),this.#d=void 0)}createResult(t,e){const s=this.#r,n=this.options,u=this.#n,a=this.#u,h=this.#a,o=t!==s?t.state:this.#i,{state:c}=t;let l,d={...c},y=!1;if(e._optimisticResults){const r=this.hasListeners(),i=!r&&R(t,e),u=r&&Q(t,s,e,n);(i||u)&&(d={...d,...p(c.data,t.options)}),"isRestoring"===e._optimisticResults&&(d.fetchStatus="idle")}let{error:b,errorUpdatedAt:v,status:I}=d;l=d.data;let O=!1;if(void 0!==e.placeholderData&&void 0===l&&"pending"===I){let t;u?.isPlaceholderData&&e.placeholderData===h?.placeholderData?(t=u.data,O=!0):t="function"==typeof e.placeholderData?e.placeholderData(this.#c?.state.data,this.#c):e.placeholderData,void 0!==t&&(I="success",l=f(u?.data,t,e),y=!0)}if(e.select&&void 0!==l&&!O)if(u&&l===a?.data&&e.select===this.#h)l=this.#o;else try{this.#h=e.select,l=e.select(l),l=f(u?.data,l,e),this.#o=l,this.#e=null}catch(t){this.#e=t}this.#e&&(b=this.#e,l=this.#o,v=Date.now(),I="error");const g="fetching"===d.fetchStatus,w="pending"===I,C="error"===I,S=w&&g,T=void 0!==l,F={status:I,fetchStatus:d.fetchStatus,isPending:w,isSuccess:"success"===I,isError:C,isInitialLoading:S,isLoading:S,data:l,dataUpdatedAt:d.dataUpdatedAt,error:b,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>o.dataUpdateCount||d.errorUpdateCount>o.errorUpdateCount,isFetching:g,isRefetching:g&&!w,isLoadingError:C&&!T,isPaused:"paused"===d.fetchStatus,isPlaceholderData:y,isRefetchError:C&&T,isStale:m(t,e),refetch:this.refetch,promise:this.#s,isEnabled:!1!==i(e.enabled,t)};if(this.options.experimental_prefetchInRender){const e=t=>{"error"===F.status?t.reject(F.error):void 0!==F.data&&t.resolve(F.data)},i=()=>{const t=this.#s=F.promise=r();e(t)},n=this.#s;switch(n.status){case"pending":t.queryHash===s.queryHash&&e(n);break;case"fulfilled":"error"!==F.status&&F.data===n.value||i();break;case"rejected":"error"===F.status&&F.error===n.reason||i()}}return F}updateResult(){const t=this.#n,e=this.createResult(this.#r,this.options);if(this.#u=this.#r.state,this.#a=this.options,void 0!==this.#u.data&&(this.#c=this.#r),n(e,t))return;this.#n=e;this.#g({listeners:(()=>{if(!t)return!0;const{notifyOnChangeProps:e}=this.options,s="function"==typeof e?e():e;if("all"===s||!s&&!this.#f.size)return!0;const r=new Set(s??this.#f);return this.options.throwOnError&&r.add("error"),Object.keys(this.#n).some(e=>{const s=e;return this.#n[s]!==t[s]&&r.has(s)})})()})}#Q(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#r)return;const e=this.#r;this.#r=t,this.#i=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#g(t){y.batch(()=>{t.listeners&&this.listeners.forEach(t=>{t(this.#n)}),this.#t.getQueryCache().notify({query:this.#r,type:"observerResultsUpdated"})})}};function R(t,e){return function(t,e){return!1!==i(e.enabled,t)&&void 0===t.state.data&&!("error"===t.state.status&&!1===e.retryOnMount)}(t,e)||void 0!==t.state.data&&v(t,e,e.refetchOnMount)}function v(t,e,s){if(!1!==i(e.enabled,t)&&"static"!==u(e.staleTime,t)){const r="function"==typeof s?s(t):s;return"always"===r||!1!==r&&m(t,e)}return!1}function Q(t,e,s,r){return(t!==e||!1===i(r.enabled,t))&&(!s.suspense||"error"!==t.state.status)&&m(t,s)}function m(t,e){return!1!==i(e.enabled,t)&&t.isStaleByTime(u(e.staleTime,t))}Promise.withResolvers||(Promise.withResolvers=function(){let t,e;const s=new this((s,r)=>{t=s,e=r});return{resolve:t,reject:e,promise:s}});var I=class{constructor(s,r,i){this.host=s,this.optionsFn=r,this._queryClient=i,this.whenQueryClient=Promise.withResolvers(),this.whenQueryObserver=Promise.withResolvers(),this.host.addController(this),this.context=new e(this.host,{context:t,subscribe:!0,callback:t=>{t&&(this.queryClient=t)}}),this.optionsFn&&this.observeQuery(this.optionsFn)}set queryClient(t){this._queryClient=t,t&&this.whenQueryClient.resolve(t),this.host.requestUpdate()}get queryClient(){return this._queryClient}async observeQuery(t,e=!0){const s=await this.whenQueryClient.promise,r=await this.getDefaultedOptions("function"==typeof t?t():t);this.queryObserver=new b(s,r),this.result=e?this.queryObserver.getOptimisticResult(r):void 0,this.host.requestUpdate(),this.whenQueryObserver.resolve(this.queryObserver)}async hostUpdate(){if(this.optionsFn){const t=await this.whenQueryObserver.promise,e=await this.getDefaultedOptions(this.optionsFn());t.setOptions(e)}}hostConnected(){this.subscribe()}async subscribe(){const t=await this.whenQueryObserver.promise;this.unsubscribe?.(),this.unsubscribe=t.subscribe(t=>{this.result=t,this.host.requestUpdate()}),t.updateResult(),this.host.requestUpdate()}hostDisconnected(){this.unsubscribe?.(),this.unsubscribe=void 0}async getDefaultedOptions(t){return(await this.whenQueryClient.promise).defaultQueryOptions(t)}render(t){const e=this.result;return"pending"!==e?.status||"idle"!==e?.fetchStatus||e?.data?e?.isPending?t.pending?.()??null:e?.isError?t.error?.(e?.error)??null:e?.isSuccess?t.complete(e?.data):t.initial?.()??null:t.initial?.()??null}};export{I as Q};
@@ -1 +1 @@
1
- import{a as e}from"./api-chat-client-C8SqZtCa.js";import{t}from"./parseISO-jT42c8Ob.js";function n(e,n,r){const s=function(e,n){return+t(e)-+t(n)}(e,n)/1e3;return(c=r?.roundingMethod,e=>{const t=(c?Math[c]:Math.trunc)(e);return 0===t?0:t})(s);var c}function r(e){return{queryKey:["schedule-services"],queryFn:()=>e.schedules.getScheduleServices()}}function s(t){const{startsAtIso:r,refundPolicySeconds:s,now:c=new Date}=t,o=n(e(r),c);return!(o<0)&&(null==s||o>=s)}export{s as c,r as g};
1
+ import{g as e}from"./api-chat-client-vbjgaIRV.js";import{t}from"./parseISO-Dj3qSTG8.js";function n(e,n,r){const s=function(e,n){return+t(e)-+t(n)}(e,n)/1e3;return(c=r?.roundingMethod,e=>{const t=(c?Math[c]:Math.trunc)(e);return 0===t?0:t})(s);var c}function r(e){return{queryKey:["schedule-services"],queryFn:()=>e.schedules.getScheduleServices()}}function s(t){const{startsAtIso:r,refundPolicySeconds:s,now:c=new Date}=t,o=n(e(r),c);return!(o<0)&&(null==s||o>=s)}export{s as c,r as g};
@@ -0,0 +1,134 @@
1
+ import z from 'zod';
2
+
3
+ declare const LoginTokenResponseSchema: z.ZodObject<{
4
+ access_token: z.ZodString;
5
+ patient: z.ZodObject<{
6
+ hash: z.ZodString;
7
+ country_code: z.ZodString;
8
+ timezone: z.ZodString;
9
+ first_name: z.ZodString;
10
+ last_name: z.ZodString;
11
+ name: z.ZodString;
12
+ birth_date: z.ZodString;
13
+ email: z.ZodString;
14
+ language_code: z.ZodString;
15
+ phone: z.ZodString;
16
+ phone_prefix: z.ZodString;
17
+ tax_id: z.ZodString;
18
+ legal_consent: z.ZodObject<{
19
+ accepted_at: z.ZodNullable<z.ZodString>;
20
+ last_version_at: z.ZodNullable<z.ZodString>;
21
+ terms_url: z.ZodString;
22
+ privacy_url: z.ZodString;
23
+ has_commercial_communications: z.ZodBoolean;
24
+ organization_name: z.ZodString;
25
+ }, "strip", z.ZodTypeAny, {
26
+ accepted_at: string | null;
27
+ last_version_at: string | null;
28
+ terms_url: string;
29
+ privacy_url: string;
30
+ has_commercial_communications: boolean;
31
+ organization_name: string;
32
+ }, {
33
+ accepted_at: string | null;
34
+ last_version_at: string | null;
35
+ terms_url: string;
36
+ privacy_url: string;
37
+ has_commercial_communications: boolean;
38
+ organization_name: string;
39
+ }>;
40
+ }, "strip", z.ZodTypeAny, {
41
+ hash: string;
42
+ name: string;
43
+ country_code: string;
44
+ timezone: string;
45
+ first_name: string;
46
+ last_name: string;
47
+ birth_date: string;
48
+ email: string;
49
+ language_code: string;
50
+ phone: string;
51
+ phone_prefix: string;
52
+ tax_id: string;
53
+ legal_consent: {
54
+ accepted_at: string | null;
55
+ last_version_at: string | null;
56
+ terms_url: string;
57
+ privacy_url: string;
58
+ has_commercial_communications: boolean;
59
+ organization_name: string;
60
+ };
61
+ }, {
62
+ hash: string;
63
+ name: string;
64
+ country_code: string;
65
+ timezone: string;
66
+ first_name: string;
67
+ last_name: string;
68
+ birth_date: string;
69
+ email: string;
70
+ language_code: string;
71
+ phone: string;
72
+ phone_prefix: string;
73
+ tax_id: string;
74
+ legal_consent: {
75
+ accepted_at: string | null;
76
+ last_version_at: string | null;
77
+ terms_url: string;
78
+ privacy_url: string;
79
+ has_commercial_communications: boolean;
80
+ organization_name: string;
81
+ };
82
+ }>;
83
+ }, "strip", z.ZodTypeAny, {
84
+ patient: {
85
+ hash: string;
86
+ name: string;
87
+ country_code: string;
88
+ timezone: string;
89
+ first_name: string;
90
+ last_name: string;
91
+ birth_date: string;
92
+ email: string;
93
+ language_code: string;
94
+ phone: string;
95
+ phone_prefix: string;
96
+ tax_id: string;
97
+ legal_consent: {
98
+ accepted_at: string | null;
99
+ last_version_at: string | null;
100
+ terms_url: string;
101
+ privacy_url: string;
102
+ has_commercial_communications: boolean;
103
+ organization_name: string;
104
+ };
105
+ };
106
+ access_token: string;
107
+ }, {
108
+ patient: {
109
+ hash: string;
110
+ name: string;
111
+ country_code: string;
112
+ timezone: string;
113
+ first_name: string;
114
+ last_name: string;
115
+ birth_date: string;
116
+ email: string;
117
+ language_code: string;
118
+ phone: string;
119
+ phone_prefix: string;
120
+ tax_id: string;
121
+ legal_consent: {
122
+ accepted_at: string | null;
123
+ last_version_at: string | null;
124
+ terms_url: string;
125
+ privacy_url: string;
126
+ has_commercial_communications: boolean;
127
+ organization_name: string;
128
+ };
129
+ };
130
+ access_token: string;
131
+ }>;
132
+ type LoginTokenResponse = z.infer<typeof LoginTokenResponseSchema>;
133
+
134
+ export type { LoginTokenResponse as L };
@@ -0,0 +1 @@
1
+ import{c as t,t as e}from"./parseISO-Dj3qSTG8.js";function n(n,i,a){return function(n,i){return t(n,+e(n)+i)}(n,1e3*i)}function i(t,e){return{action_type:"event",event_type:"access to videocall button click",patient_hash:t,id_appointment:e}}function a(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function p(t,e){return{action_type:"event",event_type:"modify appoinment button click",patient_hash:t,id_appointment:e}}function o(t,e){return{action_type:"event",event_type:"cancel appoinment button click",patient_hash:t,id_appointment:e}}function s(t,e){return{action_type:"event",event_type:"view appointment document list button click",patient_hash:t,id_appointment:e}}function c(t,e){return{action_type:"event",event_type:"repeat appointment button click",patient_hash:t,id_appointment:e}}function _(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function r(t,e){return{action_type:"event",event_type:"access to videocall button click",patient_hash:t,id_appointment:e}}function u(t,e){return{action_type:"event",event_type:"add to calendar button click",patient_hash:t,id_appointment:e}}function h(t,e){return{action_type:"pageview",event_type:"appointment success page view",patient_hash:t,id_appointment:e}}function y(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function l(t,e){return{action_type:"event",event_type:"update documentation",patient_hash:t,id_appointment:e}}function v(t,e){return{action_type:"pageview",event_type:"documentation page view",patient_hash:t,id_appointment:e}}function d(t){return{action_type:"event",event_type:"view documentation list button click",patient_hash:t}}function f(t){return{action_type:"event",event_type:"make an appointment button click",patient_hash:t}}function m(t){return{action_type:"event",event_type:"view appointment list button click",patient_hash:t}}function b(t){return{action_type:"pageview",event_type:"home page view",patient_hash:t}}function k(t,e,n){return{action_type:"event",event_type:"find availability button click",patient_hash:t,speciality_id:e,service_id:n}}function w(t,e,n,i,a,p,o){return{action_type:"debug",event_type:"find availability result",patient_hash:t,speciality_id:e,service_id:n,first_slot_date:i,first_slot_professional_hash:a,total_professionals:p,total_slots:o}}function g(t,e,n,i,a){return{action_type:"event",event_type:"professional schedule slot button click",patient_hash:t,professional_hash:e,start_date:n,speciality_id:i,service_id:a}}function T(t,e,n,i){return{action_type:"event",event_type:"professional availability button click",patient_hash:t,professional_hash:e,speciality_id:n,service_id:i}}function K(t,e,n,i,a){return{action_type:"event",event_type:"confirm appointment button click",patient_hash:t,professional_hash:e,start_date:n,speciality_id:i,service_id:a}}function C(t){return{action_type:"pageview",event_type:"select professional step page view",patient_hash:t}}function q(t,e){return{action_type:"pageview",event_type:"not time yet pageview",patient_hash:t,id_appointment:e}}function x(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function j(t,e){return{action_type:"pageview",event_type:"waiting room pageview",patient_hash:t,id_appointment:e}}function A(t,e){return{action_type:"pageview",event_type:"videocall pageview",patient_hash:t,id_appointment:e}}class HttpTransport{endpoint;apiKey;constructor(t,e){this.endpoint=t,this.apiKey=e}send(t){fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":this.apiKey},body:JSON.stringify(t)}).catch(()=>{})}}class MediquoTelemetryClient{_apiKey=null;_transport=null;setApiKey(t){this._apiKey=t,this._buildTransport()}track(t){null!==this._transport&&this._transport.send(t)}_buildTransport(){null!==this._apiKey&&(this._transport=new HttpTransport("https://tracking.____.mediquo.com/sdk",this._apiKey))}}const O=new class AppTelemetryClient extends MediquoTelemetryClient{track(t){}};export{x as A,j as B,A as C,n as a,l as b,y as c,v as d,h as e,u as f,_ as g,r as h,b as i,p as j,o as k,c as l,f as m,i as n,s as o,a as p,k as q,d as r,K as s,O as t,g as u,m as v,T as w,w as x,C as y,q as z};
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.4.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
+ const E="https://mediquo-landing.s3.eu-central-1.amazonaws.com/sdk-web/elements",o="production",e="0.5.1",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};
package/dist/events.d.ts CHANGED
@@ -124,6 +124,15 @@ declare class DownloadFileEvent extends Event {
124
124
  filename: string;
125
125
  });
126
126
  }
127
+ /**
128
+ * The user asked to see their full documents list (from the dashboard's
129
+ * "recent documents" widget). No payload — the destination is a top-level
130
+ * screen the host owns.
131
+ */
132
+ declare class MqViewDocumentsEvent extends Event {
133
+ static eventName: string;
134
+ constructor();
135
+ }
127
136
  declare global {
128
137
  interface HTMLElementEventMap {
129
138
  "mq-back": MqBackEvent;
@@ -133,9 +142,10 @@ declare global {
133
142
  "mq-appointment-book": MqAppointmentBookEvent;
134
143
  "mq-appointment-join-videocall": MqAppointmentJoinVideocallEvent;
135
144
  "mq-appointment-view-documentation": MqAppointmentViewDocumentationEvent;
145
+ "mq-view-documents": MqViewDocumentsEvent;
136
146
  "mq-download-file": DownloadFileEvent;
137
147
  }
138
148
  }
139
149
 
140
- export { DownloadFileEvent, MqAppointmentBookEvent, MqAppointmentJoinVideocallEvent, MqAppointmentRescheduleEvent, MqAppointmentViewDocumentationEvent, MqBackEvent, MqHomeEvent, MqViewAppointmentsEvent };
150
+ export { DownloadFileEvent, MqAppointmentBookEvent, MqAppointmentJoinVideocallEvent, MqAppointmentRescheduleEvent, MqAppointmentViewDocumentationEvent, MqBackEvent, MqHomeEvent, MqViewAppointmentsEvent, MqViewDocumentsEvent };
141
151
  export type { MqAppointmentsTab };
package/dist/events.js CHANGED
@@ -1 +1 @@
1
- class MqBackEvent extends Event{static{this.eventName="mq-back"}constructor(e={}){super(MqBackEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqHomeEvent extends Event{static{this.eventName="mq-home"}constructor(){super(MqHomeEvent.eventName,{bubbles:!0,composed:!0})}}class MqViewAppointmentsEvent extends Event{static{this.eventName="mq-view-appointments"}constructor(e){super(MqViewAppointmentsEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentRescheduleEvent extends Event{static{this.eventName="mq-appointment-reschedule"}constructor(e){super(MqAppointmentRescheduleEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentBookEvent extends Event{static{this.eventName="mq-appointment-book"}constructor(e={}){super(MqAppointmentBookEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentJoinVideocallEvent extends Event{static{this.eventName="mq-appointment-join-videocall"}constructor(e){super(MqAppointmentJoinVideocallEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentViewDocumentationEvent extends Event{static{this.eventName="mq-appointment-view-documentation"}constructor(e){super(MqAppointmentViewDocumentationEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class DownloadFileEvent extends Event{static{this.eventName="mq-download-file"}constructor(e){super(DownloadFileEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}export{DownloadFileEvent,MqAppointmentBookEvent,MqAppointmentJoinVideocallEvent,MqAppointmentRescheduleEvent,MqAppointmentViewDocumentationEvent,MqBackEvent,MqHomeEvent,MqViewAppointmentsEvent};
1
+ class MqBackEvent extends Event{static{this.eventName="mq-back"}constructor(e={}){super(MqBackEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqHomeEvent extends Event{static{this.eventName="mq-home"}constructor(){super(MqHomeEvent.eventName,{bubbles:!0,composed:!0})}}class MqViewAppointmentsEvent extends Event{static{this.eventName="mq-view-appointments"}constructor(e){super(MqViewAppointmentsEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentRescheduleEvent extends Event{static{this.eventName="mq-appointment-reschedule"}constructor(e){super(MqAppointmentRescheduleEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentBookEvent extends Event{static{this.eventName="mq-appointment-book"}constructor(e={}){super(MqAppointmentBookEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentJoinVideocallEvent extends Event{static{this.eventName="mq-appointment-join-videocall"}constructor(e){super(MqAppointmentJoinVideocallEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentViewDocumentationEvent extends Event{static{this.eventName="mq-appointment-view-documentation"}constructor(e){super(MqAppointmentViewDocumentationEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class DownloadFileEvent extends Event{static{this.eventName="mq-download-file"}constructor(e){super(DownloadFileEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqViewDocumentsEvent extends Event{static{this.eventName="mq-view-documents"}constructor(){super(MqViewDocumentsEvent.eventName,{bubbles:!0,composed:!0})}}export{DownloadFileEvent,MqAppointmentBookEvent,MqAppointmentJoinVideocallEvent,MqAppointmentRescheduleEvent,MqAppointmentViewDocumentationEvent,MqBackEvent,MqHomeEvent,MqViewAppointmentsEvent,MqViewDocumentsEvent};
package/dist/i18n.js CHANGED
@@ -1 +1 @@
1
- import{c as e}from"./chunks/runtime-Bg1WXVCx.js";import{z as t,l as n}from"./chunks/external-zAbuzxDj.js";const c=["ca_ES","de_DE","en_US","pt_PT"],a=t.enum(["en_US","pt_PT","de_DE","es_ES","ca_ES"]);function s(e){return a.safeParse(e).success}const o="__mqElementsLocalization__";function i(){const e=globalThis;return e[o]||(e[o]={initialized:!1}),e[o]}function r(){const t=i();if(!t.initialized){t.initialized=!0;try{const{setLocale:n,getLocale:a}=e({sourceLocale:"es_ES",targetLocales:c,loadLocale:async e=>{switch(e){case"en_US":default:return import("./chunks/en_US-BslWF9nj.js");case"pt_PT":return import("./chunks/pt_PT-CFbbWowX.js");case"de_DE":return import("./chunks/de_DE-CrwfSJnS.js");case"ca_ES":return import("./chunks/ca_ES-nttMFJzr.js")}}});t.setLocale=n,t.getLocale=a}catch(e){n.warn("Localization was already configured on this page.",e)}}}const u="Localization not initialized yet.";async function l(e){const{setLocale:t}=i();if(t)return t(e);n.warn(u)}function _(){const{getLocale:e}=i();return e?e():(n.warn(u),"es_ES")}export{_ as getLocale,r as initLocalization,s as isValidLocale,l as setLocale};
1
+ import{c as e}from"./chunks/runtime-Bg1WXVCx.js";import{l as t}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{z as n}from"./chunks/external-mrLCXx_f.js";const c=["ca_ES","de_DE","en_US","pt_PT"],s=n.enum(["en_US","pt_PT","de_DE","es_ES","ca_ES"]);function a(e){return s.safeParse(e).success}const o="__mqElementsLocalization__";function i(){const e=globalThis;return e[o]||(e[o]={initialized:!1}),e[o]}function r(){const n=i();if(!n.initialized){n.initialized=!0;try{const{setLocale:t,getLocale:s}=e({sourceLocale:"es_ES",targetLocales:c,loadLocale:async e=>{switch(e){case"en_US":default:return import("./chunks/en_US-BslWF9nj.js");case"pt_PT":return import("./chunks/pt_PT-CFbbWowX.js");case"de_DE":return import("./chunks/de_DE-CrwfSJnS.js");case"ca_ES":return import("./chunks/ca_ES-nttMFJzr.js")}}});n.setLocale=t,n.getLocale=s}catch(e){t.warn("Localization was already configured on this page.",e)}}}const u="Localization not initialized yet.";async function l(e){const{setLocale:n}=i();if(n)return n(e);t.warn(u)}function _(){const{getLocale:e}=i();return e?e():(t.warn(u),"es_ES")}export{_ as getLocale,r as initLocalization,a as isValidLocale,l as setLocale};
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { MqThemeProvider, ThemeName } from './mq-theme-provider.js';
2
- export { DownloadFileEvent, MqAppointmentBookEvent, MqAppointmentJoinVideocallEvent, MqAppointmentRescheduleEvent, MqAppointmentViewDocumentationEvent, MqAppointmentsTab, MqBackEvent, MqHomeEvent, MqViewAppointmentsEvent } from './events.js';
2
+ export { DownloadFileEvent, MqAppointmentBookEvent, MqAppointmentJoinVideocallEvent, MqAppointmentRescheduleEvent, MqAppointmentViewDocumentationEvent, MqAppointmentsTab, MqBackEvent, MqHomeEvent, MqViewAppointmentsEvent, MqViewDocumentsEvent } from './events.js';
3
3
  export { d as defaultTheme } from './chunks/default-IpEn36CA.js';
4
4
  import 'lit-html';
5
5
  import 'lit';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export{MqThemeProvider}from"./mq-theme-provider.js";export{DownloadFileEvent,MqAppointmentBookEvent,MqAppointmentJoinVideocallEvent,MqAppointmentRescheduleEvent,MqAppointmentViewDocumentationEvent,MqBackEvent,MqHomeEvent,MqViewAppointmentsEvent}from"./events.js";export{defaultTheme}from"./theme.js";import"./chunks/custom-element-DA9Fxvxd.js";import"./chunks/lit-element-DiWJYFwC.js";import"./chunks/property-scuRaFcM.js";import"./chunks/state-LQivXIgA.js";import"./chunks/ensure-context-root-DbdqwnKB.js";import"./chunks/context-request-event-Dfydf1ub.js";
1
+ export{MqThemeProvider}from"./mq-theme-provider.js";export{DownloadFileEvent,MqAppointmentBookEvent,MqAppointmentJoinVideocallEvent,MqAppointmentRescheduleEvent,MqAppointmentViewDocumentationEvent,MqBackEvent,MqHomeEvent,MqViewAppointmentsEvent,MqViewDocumentsEvent}from"./events.js";export{defaultTheme}from"./theme.js";import"./chunks/custom-element-DA9Fxvxd.js";import"./chunks/lit-element-DiWJYFwC.js";import"./chunks/property-scuRaFcM.js";import"./chunks/state-LQivXIgA.js";import"./chunks/ensure-context-root-DbdqwnKB.js";import"./chunks/context-request-event-Dfydf1ub.js";
@@ -1 +1 @@
1
- import{_ as e,t}from"./chunks/custom-element-DA9Fxvxd.js";import{m as a}from"./chunks/runtime-Bg1WXVCx.js";import{l as s}from"./chunks/parseISO-jT42c8Ob.js";import{L as i}from"./chunks/login-token-task-BI-L2zSV.js";import{l as n}from"./chunks/external-zAbuzxDj.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{b as m}from"./chunks/api-chat-client-C8SqZtCa.js";import{u as v,s as b,r as f}from"./chunks/apple-pay-outcomes-BNkcTbbM.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/format-Cm3B1GMy.js";import"./chunks/isBefore-Cof0D841.js";function k(){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:!k()}}}((await t.applePayCapabilities(e)).paymentCredentialStatus)}catch{return t.canMakePayments()?{available:!0,usesQrFlow:!k()}:{available:!1,reason:"unsupported"}}return t.canMakePayments()?{available:!0,usesQrFlow:!k()}:{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 w=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=f(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"})],w.prototype,"env",void 0),e([l({type:String,attribute:"api-key"})],w.prototype,"apiKey",void 0),e([l({type:String,attribute:"token"})],w.prototype,"token",void 0),e([l({type:String,attribute:"locale",reflect:!0})],w.prototype,"locale",void 0),e([l({type:String,attribute:"merchant-id"})],w.prototype,"merchantId",void 0),e([l({type:String,attribute:"session-id"})],w.prototype,"sessionId",void 0),e([l({type:String,attribute:"amount"})],w.prototype,"amount",void 0),e([l({type:String,attribute:"currency"})],w.prototype,"currency",void 0),e([l({type:String,attribute:"country"})],w.prototype,"country",void 0),e([l({type:String,attribute:"label"})],w.prototype,"label",void 0),e([c()],w.prototype,"_availabilityPhase",void 0),e([c()],w.prototype,"_showQrHelper",void 0),e([c()],w.prototype,"_paying",void 0),w=e([s(),t("mq-apple-pay-checkout")],w);export{ApplePayCheckoutDeniedEvent,ApplePayCheckoutErrorEvent,ApplePayCheckoutSuccessEvent,w as MqApplePayCheckout};
1
+ import{_ as e,t}from"./chunks/custom-element-DA9Fxvxd.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-vbjgaIRV.js";import{u as v,s as b,r as k}from"./chunks/apple-pay-outcomes-DxrMPQqB.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/external-mrLCXx_f.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,t as e}from"./chunks/custom-element-DA9Fxvxd.js";import{a as i,x as o}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{b as p}from"./chunks/api-chat-client-C8SqZtCa.js";import"./mq-checkout.js";import"./chunks/external-zAbuzxDj.js";import"./chunks/parseISO-jT42c8Ob.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/format-Cm3B1GMy.js";import"./chunks/isBefore-Cof0D841.js";import"./env.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/login-token-task-BI-L2zSV.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 i{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 o`<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};
1
+ import{_ as t,t as e}from"./chunks/custom-element-DA9Fxvxd.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-vbjgaIRV.js";import"./mq-checkout.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/external-mrLCXx_f.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};
@@ -0,0 +1,48 @@
1
+ import * as lit_html from 'lit-html';
2
+ import { LitElement, PropertyValues } from 'lit';
3
+ import { Env } from './env.js';
4
+ import './ui/mq-button.js';
5
+ import './chunks/mq-chat-room-DuG4RuIp.js';
6
+ import './ui/mq-floating-bubble.js';
7
+ import './ui/mq-card.js';
8
+ import './ui/mq-unread-badge.js';
9
+ import './ui/back-link.js';
10
+ import './chunks/index-DNUbmrQl.js';
11
+ import './chunks/mq-layout-D8Mak16a.js';
12
+ import './ui/mq-avatar.js';
13
+ import './ui/mq-skeleton.js';
14
+ import 'zod';
15
+ import './chunks/appointment.model.d-Dy50gMPg.js';
16
+ import '@tanstack/query-core';
17
+ import './ui/mq-text-button.js';
18
+
19
+ /**
20
+ * Standalone "appointment documentation" screen: fetches an appointment by id
21
+ * and renders the shared `documentation-view` (professional summary + shared
22
+ * documents + finished-consultation actions).
23
+ *
24
+ * `documentation-view` reads the patient session (hash + timezone) from
25
+ * `loginTokenContext`, so mount this element under `mq-session-provider`
26
+ * (alongside the query-client provider it needs for data fetching).
27
+ */
28
+ declare class MqAppointmentDocumentation extends LitElement {
29
+ appointmentId: string;
30
+ /** Already-exchanged access token. Required when used standalone. */
31
+ token: string;
32
+ /** Mediquo API key. Required when used standalone. */
33
+ apiKey?: string;
34
+ /** Locale (e.g. "es_ES"). Optional; defaults to the host/build locale. */
35
+ locale?: string;
36
+ /** Environment override ("development" | "production"). Optional. */
37
+ env?: Env;
38
+ private getAppointmentQuery;
39
+ protected willUpdate(changed: PropertyValues<this>): void;
40
+ render(): lit_html.TemplateResult<1>;
41
+ }
42
+ declare global {
43
+ interface HTMLElementTagNameMap {
44
+ "mq-appointment-documentation": MqAppointmentDocumentation;
45
+ }
46
+ }
47
+
48
+ export { MqAppointmentDocumentation };
@@ -0,0 +1 @@
1
+ import{isValidLocale as t,setLocale as e,initLocalization as i}from"./i18n.js";import{_ as s,t as o}from"./chunks/custom-element-DA9Fxvxd.js";import{Q as r}from"./chunks/query-controller-BlO1Ax65.js";import{g as n}from"./chunks/get-appointment-query-Ck68BEMg.js";import{a,i as c,x as m}from"./chunks/lit-element-DiWJYFwC.js";import{n as d}from"./chunks/property-scuRaFcM.js";import{setEnv as p}from"./env.js";import{a as l}from"./chunks/api-chat-client-vbjgaIRV.js";import"./chunks/documentation-view-CS4Q-UpO.js";import"./ui/mq-card.js";import"./chunks/mq-layout-CGcdxGMQ.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/external-mrLCXx_f.js";import"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/query-Cjvi4_dT.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./chunks/localized-decorator-BlOuLhym.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/telemetry-client-BLJVs9me.js";import"./ui/icons/calendar-icon.js";import"./ui/icons/types.js";import"./ui/icons/clock-icon.js";import"./chunks/state-LQivXIgA.js";import"./ui/icons/info-circle-outine-icon.js";import"./ui/mq-button.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/directive-2EDmOukv.js";import"./chunks/chunk-S5RWG6G2-DPesx3Od.js";import"./ui/icons/message-bubble-icon.js";import"./mq-chat-room.js";import"./chunks/provide-D2fnEhT2.js";import"./chunks/context-provider--AKuwfs9.js";import"./chunks/consume-CovVqBjI.js";import"./theme.js";import"./ui/icons/x-icon.js";import"./ui/mq-avatar.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./chunks/chunk-YMQSBQHL-De_r7BNk.js";import"./chunks/if-defined-BYeVdwgd.js";import"./ui/icons/chevron-left-icon.js";import"./chunks/query-CeeutdfT.js";import"./events.js";import"./chunks/chunk-GZF3YFSX-BzloXkVp.js";import"./ui/icons/check-double-icon.js";import"./ui/icons/check-icon.js";import"./chunks/chunk-YTQUGGS3-p18naHsk.js";import"./chunks/mutation-controller-CR2qcqhH.js";import"./ui/mq-floating-bubble.js";import"./ui/mq-unread-badge.js";import"./ui/back-link.js";import"./ui/mq-text-button.js";import"./chunks/index-DBMxJ4Dp.js";import"./ui/icons/download-icon.js";import"./chunks/get-organization-setup-query-BMbuRi6v.js";import"./chunks/i18n-formats-DYS91YEa.js";let u=class DocumentationViewSkeleton extends a{static{this.styles=c`.skeleton{border-radius:var(--border-radius-md);background-color:#f0f0f0;animation:skeleton-pulse 1.5s infinite}.back-link-skeleton{width:60px;height:20px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-6)}.title-skeleton{width:200px;height:32px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-3)}.description-skeleton{width:100%;height:16px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-2)}.description-skeleton:last-of-type{width:70%;margin-bottom:var(--size-5)}.professional-card{padding:var(--size-4);margin-bottom:var(--size-4)}.professional-name-skeleton{width:180px;height:24px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-1)}.professional-speciality-skeleton{width:140px;height:16px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-4)}.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);font-family:var(--font-body)}.icon-skeleton{width:20px;height:20px;border-radius:var(--border-radius-sm)}.text-skeleton{width:120px;height:16px;border-radius:var(--border-radius-sm)}.documents-card{padding:var(--size-4);margin-bottom:var(--size-6)}.documents-card .skeleton{background-color:var(--color-muted)}.documents-card-title-skeleton{width:150px;height:24px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-4)}.button-skeleton{width:100%;height:44px;border-radius:var(--border-radius-md);margin-top:var(--size-4)}@keyframes skeleton-pulse{0%{opacity:1}50%{opacity:.6}100%{opacity:1}}`}render(){return m`<div class="skeleton back-link-skeleton"></div><div class="skeleton title-skeleton"></div><div class="skeleton description-skeleton"></div><div class="skeleton description-skeleton"></div><mq-card class="professional-card" roundness="md"><div><div class="skeleton professional-name-skeleton"></div><div class="skeleton professional-speciality-skeleton"></div></div><dl class="description-list"><div class="description-list-item"><div class="skeleton icon-skeleton"></div><div class="skeleton text-skeleton"></div></div><div class="description-list-item"><div class="skeleton icon-skeleton"></div><div class="skeleton text-skeleton"></div></div></dl></mq-card><mq-card class="documents-card" roundness="md"><div class="skeleton documents-card-title-skeleton"></div><div class="skeleton button-skeleton"></div></mq-card>`}};u=s([o("documentation-view-skeleton")],u);let k=class MqAppointmentDocumentation extends a{constructor(){super(...arguments),this.getAppointmentQuery=new r(this,()=>n(l,{id:this.appointmentId}))}willUpdate(i){i.has("env")&&this.env&&p(this.env),i.has("apiKey")&&this.apiKey&&l.setApiKey(this.apiKey),i.has("token")&&this.token&&l.setAuthToken(this.token),i.has("locale")&&this.locale&&t(this.locale)&&(e(this.locale),l.setLanguage(this.locale))}render(){return m`<mq-layout background="transparent">${this.getAppointmentQuery.render({complete:t=>m`<documentation-view .token="${this.token}" .appointment="${t}"></documentation-view>`,error:()=>m``,pending:()=>m`<documentation-view-skeleton></documentation-view-skeleton>`})}</mq-layout>`}};s([d({type:String,attribute:"appointment-id"})],k.prototype,"appointmentId",void 0),s([d({type:String,attribute:"token"})],k.prototype,"token",void 0),s([d({type:String,attribute:"api-key"})],k.prototype,"apiKey",void 0),s([d({type:String,attribute:"locale"})],k.prototype,"locale",void 0),s([d({type:String,attribute:"env"})],k.prototype,"env",void 0),k=s([o("mq-appointment-documentation")],k),i();export{k as MqAppointmentDocumentation};