@everfur/sdk 0.9.1 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/README.md +1 -1
- package/dist/{Chat-DbHkTbqz.d.cts → Chat-Bkv-MLLu.d.cts} +3 -3
- package/dist/{Chat-BoVmqEeF.d.ts → Chat-Dy1L27a8.d.ts} +3 -3
- package/dist/{DepthViews-yO1H371y.d.ts → DepthViews-BwyzpEyX.d.ts} +1 -1
- package/dist/{DepthViews-DK7EJ6Hp.d.cts → DepthViews-CBalhef3.d.cts} +1 -1
- package/dist/{DepthViews-BzwflaJ3.d.ts → DepthViews-De6yb5Tq.d.ts} +1 -1
- package/dist/{DepthViews-Chyp69Ue.d.cts → DepthViews-eRdy2ayE.d.cts} +1 -1
- package/dist/animations/index.d.cts +3 -3
- package/dist/animations/index.d.ts +3 -3
- package/dist/{attachments-BmMrn9tU.d.ts → attachments-BAcQdIz7.d.ts} +5 -5
- package/dist/{attachments-Dcb19rMP.d.ts → attachments-Brt7ivEo.d.ts} +2 -2
- package/dist/{attachments-B7TrtyfH.d.cts → attachments-DhGAelCA.d.cts} +2 -2
- package/dist/{attachments-Dnpqk1Gl.d.cts → attachments-tPWJ0DJI.d.cts} +5 -5
- package/dist/{bookingCopy-DR0-SmqH.d.ts → bookingCopy-CJLAgEgK.d.ts} +2 -2
- package/dist/{bookingCopy-C153FHEC.d.cts → bookingCopy-Ds2JGcPE.d.cts} +2 -2
- package/dist/{callCopy-DHjem0R-.d.cts → callCopy-Bw6oZT54.d.cts} +7 -2
- package/dist/{callCopy-DHjem0R-.d.ts → callCopy-Bw6oZT54.d.ts} +7 -2
- package/dist/{casesRepository-DC9lEQez.d.cts → casesRepository-D0aQSXkb.d.cts} +1 -1
- package/dist/{casesRepository-BXdwCWQF.d.ts → casesRepository-DjhMfm_n.d.ts} +1 -1
- package/dist/chat/index.cjs +9 -8
- package/dist/chat/index.d.cts +9 -9
- package/dist/chat/index.d.ts +9 -9
- package/dist/chat/index.js +9 -8
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +6 -6
- package/dist/client/index.d.ts +6 -6
- package/dist/client/index.js +1 -1
- package/dist/{config-BRyNmzhx.d.cts → config-C68HTCf4.d.cts} +1 -1
- package/dist/{config-DdK2czhD.d.ts → config-DeUmccwl.d.ts} +1 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/{context-jaONuHXM.d.cts → context-DY9pcjdK.d.cts} +5 -5
- package/dist/{context-_EyjBNKI.d.ts → context-D_2sCvoo.d.ts} +5 -5
- package/dist/{copy-D8iSBQE6.d.cts → copy-tYW0C83H.d.cts} +2 -2
- package/dist/{copy-BJpRsqK-.d.ts → copy-wAnv8ldC.d.ts} +2 -2
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +12 -12
- package/dist/core/index.d.ts +12 -12
- package/dist/core/index.js +1 -1
- package/dist/{depth-bKpg3L9r.d.ts → depth-C7RIscDR.d.ts} +2 -2
- package/dist/{depth-DJ1KGMww.d.cts → depth-jbSWsweM.d.cts} +2 -2
- package/dist/{entitlementRepository-4x_tBE73.d.cts → entitlementRepository-Ccc6K6wB.d.cts} +2 -2
- package/dist/{entitlementRepository-CojBLazH.d.ts → entitlementRepository-D7Fc7OdG.d.ts} +2 -2
- package/dist/{identity-A8fVB518.d.ts → identity-BTT6YtH5.d.ts} +1 -1
- package/dist/{identity-CmxZ4GR0.d.cts → identity-ScajqjK5.d.cts} +1 -1
- package/dist/index.cjs +10 -9
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +10 -9
- package/dist/notifications/index.d.cts +2 -2
- package/dist/notifications/index.d.ts +2 -2
- package/dist/{pets-e5RjSP6O.d.ts → pets-CqeoV1Jv.d.ts} +1 -1
- package/dist/{pets-DjBlY7yg.d.cts → pets-uKMldfz0.d.cts} +1 -1
- package/dist/{petsRepository-DkQ2fwZY.d.cts → petsRepository-BYe7_MUo.d.cts} +1 -1
- package/dist/{petsRepository-CQh8paML.d.ts → petsRepository-BdfbY9Oe.d.ts} +1 -1
- package/dist/{ports-CzVBbI_A.d.ts → ports-D4FQKTBS.d.ts} +4 -4
- package/dist/{ports-2voZkqty.d.cts → ports-okLpXkpu.d.cts} +4 -4
- package/dist/records/depth/index.cjs +6 -4
- package/dist/records/depth/index.d.cts +7 -7
- package/dist/records/depth/index.d.ts +7 -7
- package/dist/records/depth/index.js +6 -4
- package/dist/records/index.cjs +19 -17
- package/dist/records/index.d.cts +9 -9
- package/dist/records/index.d.ts +9 -9
- package/dist/records/index.js +19 -17
- package/dist/{requestFunnel-CQ42Kf9G.d.ts → requestFunnel-Dhaj0yUq.d.ts} +2 -2
- package/dist/{requestFunnel-CA0ANsWj.d.cts → requestFunnel-u8qnM5Ll.d.cts} +2 -2
- package/dist/{runtimeTypes-C0tI7s-V.d.ts → runtimeTypes-BFes64Vp.d.ts} +4 -4
- package/dist/{runtimeTypes-BxtQXaYi.d.cts → runtimeTypes-C67itXfp.d.cts} +4 -4
- package/dist/server/events/index.cjs +1 -1
- package/dist/server/events/index.d.cts +2 -2
- package/dist/server/events/index.d.ts +2 -2
- package/dist/server/events/index.js +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +1 -1
- package/dist/televet/booking/index.cjs +1 -1
- package/dist/televet/booking/index.d.cts +6 -6
- package/dist/televet/booking/index.d.ts +6 -6
- package/dist/televet/booking/index.js +1 -1
- package/dist/televet/call/index.cjs +3 -5
- package/dist/televet/call/index.d.cts +1 -1
- package/dist/televet/call/index.d.ts +1 -1
- package/dist/televet/call/index.js +3 -5
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/rn/index.d.cts +7 -7
- package/dist/testing/rn/index.d.ts +7 -7
- package/dist/testing/web/index.d.cts +7 -7
- package/dist/testing/web/index.d.ts +7 -7
- package/dist/{timelineRows-WFv_3EOi.d.cts → timelineRows-CDSO3ElK.d.cts} +1 -1
- package/dist/{timelineRows-GSpzKLla.d.ts → timelineRows-pd4wYVbe.d.ts} +1 -1
- package/dist/{useRecordsDepth-BQF0Zynl.d.ts → useRecordsDepth-CqSMkcyR.d.ts} +1 -1
- package/dist/{useRecordsDepth-BL5Pf3oK.d.cts → useRecordsDepth-W3UAKQRN.d.cts} +1 -1
- package/dist/{view-rgB1iqWO.d.ts → view-CKfIaJYp.d.ts} +8 -2
- package/dist/{view-D3kOelPL.d.cts → view-h7RPJAEe.d.cts} +8 -2
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/index.cjs +7 -5
- package/dist/web/index.d.cts +14 -14
- package/dist/web/index.d.ts +14 -14
- package/dist/web/index.js +7 -5
- package/dist/web/notifications/index.d.cts +3 -3
- package/dist/web/notifications/index.d.ts +3 -3
- package/dist/web/records/depth/index.cjs +5 -4
- package/dist/web/records/depth/index.d.cts +7 -7
- package/dist/web/records/depth/index.d.ts +7 -7
- package/dist/web/records/depth/index.js +6 -5
- package/dist/web/records/index.cjs +10 -9
- package/dist/web/records/index.d.cts +9 -9
- package/dist/web/records/index.d.ts +9 -9
- package/dist/web/records/index.js +10 -9
- package/dist/web/televet/booking/index.cjs +1 -1
- package/dist/web/televet/booking/index.d.cts +6 -6
- package/dist/web/televet/booking/index.d.ts +6 -6
- package/dist/web/televet/booking/index.js +1 -1
- package/dist/web/televet/call/index.cjs +3 -5
- package/dist/web/televet/call/index.d.cts +1 -1
- package/dist/web/televet/call/index.d.ts +1 -1
- package/dist/web/televet/call/index.js +3 -5
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactNode, CSSProperties } from 'react';
|
|
2
2
|
import { P as PetRef } from '../../../ids-B2GAAifq.cjs';
|
|
3
3
|
export { B as Brand, _ as __brand } from '../../../ids-B2GAAifq.cjs';
|
|
4
|
-
import { c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../../bookingCopy-
|
|
5
|
-
export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, aR as TelevetJoinBlock, aS as TelevetJoinDecision, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UseVetThreadOptions, V as VET_MESSAGES_COPY, I as VET_MESSAGE_CONTENT_MAX, J as VET_MESSAGE_PAGE_DEFAULT, K as VET_MESSAGE_PAGE_MAX, L as VetMessage, M as VetMessagePage, O as VetMessageRole, P as VetMessagesAvailability, Q as VetSendFailure, R as VetThread, S as VetThreadState, W as VetThreadsState, X as VisitSummary, Y as VisitSummaryMedication, Z as VisitSummaryState, _ as attestation, $ as canConfirm, a0 as canManageTelevetVisit, a1 as createTelevetBookingController, a2 as currentStep, a3 as emptyTelevetDraft, a4 as formatVisitRange, a5 as formatWhen, a6 as formatWhenWithDay, a7 as hasPreviousStep, a8 as initialTelevetBookingState, a9 as isHoldExpired, aa as isMediaShortfallEmpty, ab as isSkipped, ac as isTelevetBookingCopyReady, ad as isVetMessagesDark, ae as isVetThreadVetFirst, af as mediaShortfallFromUnsentPicks, ag as splitTelevetVisits, ah as televetBookingKey, ai as televetBookingReducer, aj as televetBookingRefusal, ak as televetCancelCall, al as televetConsultCall, am as televetEmptyRosterCause, an as televetEmptyRosterView, ao as televetHoldCall, ap as televetJoinCall, aT as televetJoinDecision, aq as televetJoinOpensAtMs, as as televetMediaShortfallLines, at as televetRescheduleCall, au as televetThreadMessagesCall, av as televetThreadReadCall, aw as televetVisitSummaryCall, ax as useEarlyTriage, ay as useStateInterest, az as useTelevetBookConsult, aA as useTelevetBookingAvailable, aB as useTelevetBookingController, aC as useTelevetBookingEntitlement, aD as useTelevetCancellationPolicy, aE as useTelevetClinicians, aF as useTelevetHoldSlot, aG as useTelevetJoin, aH as useTelevetNextSlot, aI as useTelevetRescheduleConsult, aJ as useTelevetSlots, aK as useTelevetStatePolicy, aL as useVetThread, aM as useVetThreads, aN as useVisitSummary, aO as validateBookingBody, aP as vetThreadPetRef, aQ as withUnsentPicks } from '../../../bookingCopy-
|
|
4
|
+
import { c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../../bookingCopy-Ds2JGcPE.cjs';
|
|
5
|
+
export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, aR as TelevetJoinBlock, aS as TelevetJoinDecision, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UseVetThreadOptions, V as VET_MESSAGES_COPY, I as VET_MESSAGE_CONTENT_MAX, J as VET_MESSAGE_PAGE_DEFAULT, K as VET_MESSAGE_PAGE_MAX, L as VetMessage, M as VetMessagePage, O as VetMessageRole, P as VetMessagesAvailability, Q as VetSendFailure, R as VetThread, S as VetThreadState, W as VetThreadsState, X as VisitSummary, Y as VisitSummaryMedication, Z as VisitSummaryState, _ as attestation, $ as canConfirm, a0 as canManageTelevetVisit, a1 as createTelevetBookingController, a2 as currentStep, a3 as emptyTelevetDraft, a4 as formatVisitRange, a5 as formatWhen, a6 as formatWhenWithDay, a7 as hasPreviousStep, a8 as initialTelevetBookingState, a9 as isHoldExpired, aa as isMediaShortfallEmpty, ab as isSkipped, ac as isTelevetBookingCopyReady, ad as isVetMessagesDark, ae as isVetThreadVetFirst, af as mediaShortfallFromUnsentPicks, ag as splitTelevetVisits, ah as televetBookingKey, ai as televetBookingReducer, aj as televetBookingRefusal, ak as televetCancelCall, al as televetConsultCall, am as televetEmptyRosterCause, an as televetEmptyRosterView, ao as televetHoldCall, ap as televetJoinCall, aT as televetJoinDecision, aq as televetJoinOpensAtMs, as as televetMediaShortfallLines, at as televetRescheduleCall, au as televetThreadMessagesCall, av as televetThreadReadCall, aw as televetVisitSummaryCall, ax as useEarlyTriage, ay as useStateInterest, az as useTelevetBookConsult, aA as useTelevetBookingAvailable, aB as useTelevetBookingController, aC as useTelevetBookingEntitlement, aD as useTelevetCancellationPolicy, aE as useTelevetClinicians, aF as useTelevetHoldSlot, aG as useTelevetJoin, aH as useTelevetNextSlot, aI as useTelevetRescheduleConsult, aJ as useTelevetSlots, aK as useTelevetStatePolicy, aL as useVetThread, aM as useVetThreads, aN as useVisitSummary, aO as validateBookingBody, aP as vetThreadPetRef, aQ as withUnsentPicks } from '../../../bookingCopy-Ds2JGcPE.cjs';
|
|
6
6
|
import { T as TelevetConsult, E as EverfurTelevetFlowRequest, c as TelevetSlot } from '../../../televetGlobal-C5dTUACe.cjs';
|
|
7
7
|
export { C as CANCELLATION_POLICY_VERSION_MAX, d as CANCEL_REASON_MAX, e as CONSULT_KINDS, f as CONSULT_STATUSES, g as ConsultKind, h as ConsultStatus, M as MEDIA_REFS_MAX, R as REASON_TEXT_MAX, i as TERMINAL_CONSULT_STATUSES, j as TelevetBookingBody, k as TelevetBookingEntitlement, b as TelevetCancelReceipt, l as TelevetCancellationPolicy, m as TelevetClinician, n as TelevetSlotHold, o as TelevetStatePolicy, p as TelevetTriageVerdict, q as isWellFormedStateCode } from '../../../televetGlobal-C5dTUACe.cjs';
|
|
8
8
|
import { V as VetVisitIntent } from '../../../visitIntent-D7_yVp1I.cjs';
|
|
@@ -12,11 +12,11 @@ import { m as EverfurTheme } from '../../../tokens-DLj8OnLH.cjs';
|
|
|
12
12
|
export { b as VetCallCredential, c as VetCallJoinRefusal, d as VetCallLimits, p as parseVetCallCredential, v as vetCallJoinReason, e as vetCallJoinRefusal } from '../../../callRoom-BhIdadyV.cjs';
|
|
13
13
|
export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../../EverfurError-DeBqRpQV.cjs';
|
|
14
14
|
export { E as EverfurResult } from '../../../EverfurResult-COlXj1wq.cjs';
|
|
15
|
-
export { W as WidgetPet } from '../../../petsRepository-
|
|
16
|
-
import '../../../requestFunnel-
|
|
15
|
+
export { W as WidgetPet } from '../../../petsRepository-BYe7_MUo.cjs';
|
|
16
|
+
import '../../../requestFunnel-u8qnM5Ll.cjs';
|
|
17
17
|
import '../../../ErrorPolicyPort-10s3HJCt.cjs';
|
|
18
|
-
import '../../../config-
|
|
19
|
-
import '../../../identity-
|
|
18
|
+
import '../../../config-C68HTCf4.cjs';
|
|
19
|
+
import '../../../identity-ScajqjK5.cjs';
|
|
20
20
|
import '../../../TelemetryPort-BDNr00hu.cjs';
|
|
21
21
|
import '../../../profile-CSs1wlXT.cjs';
|
|
22
22
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactNode, CSSProperties } from 'react';
|
|
2
2
|
import { P as PetRef } from '../../../ids-B2GAAifq.js';
|
|
3
3
|
export { B as Brand, _ as __brand } from '../../../ids-B2GAAifq.js';
|
|
4
|
-
import { c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../../bookingCopy-
|
|
5
|
-
export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, aR as TelevetJoinBlock, aS as TelevetJoinDecision, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UseVetThreadOptions, V as VET_MESSAGES_COPY, I as VET_MESSAGE_CONTENT_MAX, J as VET_MESSAGE_PAGE_DEFAULT, K as VET_MESSAGE_PAGE_MAX, L as VetMessage, M as VetMessagePage, O as VetMessageRole, P as VetMessagesAvailability, Q as VetSendFailure, R as VetThread, S as VetThreadState, W as VetThreadsState, X as VisitSummary, Y as VisitSummaryMedication, Z as VisitSummaryState, _ as attestation, $ as canConfirm, a0 as canManageTelevetVisit, a1 as createTelevetBookingController, a2 as currentStep, a3 as emptyTelevetDraft, a4 as formatVisitRange, a5 as formatWhen, a6 as formatWhenWithDay, a7 as hasPreviousStep, a8 as initialTelevetBookingState, a9 as isHoldExpired, aa as isMediaShortfallEmpty, ab as isSkipped, ac as isTelevetBookingCopyReady, ad as isVetMessagesDark, ae as isVetThreadVetFirst, af as mediaShortfallFromUnsentPicks, ag as splitTelevetVisits, ah as televetBookingKey, ai as televetBookingReducer, aj as televetBookingRefusal, ak as televetCancelCall, al as televetConsultCall, am as televetEmptyRosterCause, an as televetEmptyRosterView, ao as televetHoldCall, ap as televetJoinCall, aT as televetJoinDecision, aq as televetJoinOpensAtMs, as as televetMediaShortfallLines, at as televetRescheduleCall, au as televetThreadMessagesCall, av as televetThreadReadCall, aw as televetVisitSummaryCall, ax as useEarlyTriage, ay as useStateInterest, az as useTelevetBookConsult, aA as useTelevetBookingAvailable, aB as useTelevetBookingController, aC as useTelevetBookingEntitlement, aD as useTelevetCancellationPolicy, aE as useTelevetClinicians, aF as useTelevetHoldSlot, aG as useTelevetJoin, aH as useTelevetNextSlot, aI as useTelevetRescheduleConsult, aJ as useTelevetSlots, aK as useTelevetStatePolicy, aL as useVetThread, aM as useVetThreads, aN as useVisitSummary, aO as validateBookingBody, aP as vetThreadPetRef, aQ as withUnsentPicks } from '../../../bookingCopy-
|
|
4
|
+
import { c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../../bookingCopy-CJLAgEgK.js';
|
|
5
|
+
export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, aR as TelevetJoinBlock, aS as TelevetJoinDecision, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UseVetThreadOptions, V as VET_MESSAGES_COPY, I as VET_MESSAGE_CONTENT_MAX, J as VET_MESSAGE_PAGE_DEFAULT, K as VET_MESSAGE_PAGE_MAX, L as VetMessage, M as VetMessagePage, O as VetMessageRole, P as VetMessagesAvailability, Q as VetSendFailure, R as VetThread, S as VetThreadState, W as VetThreadsState, X as VisitSummary, Y as VisitSummaryMedication, Z as VisitSummaryState, _ as attestation, $ as canConfirm, a0 as canManageTelevetVisit, a1 as createTelevetBookingController, a2 as currentStep, a3 as emptyTelevetDraft, a4 as formatVisitRange, a5 as formatWhen, a6 as formatWhenWithDay, a7 as hasPreviousStep, a8 as initialTelevetBookingState, a9 as isHoldExpired, aa as isMediaShortfallEmpty, ab as isSkipped, ac as isTelevetBookingCopyReady, ad as isVetMessagesDark, ae as isVetThreadVetFirst, af as mediaShortfallFromUnsentPicks, ag as splitTelevetVisits, ah as televetBookingKey, ai as televetBookingReducer, aj as televetBookingRefusal, ak as televetCancelCall, al as televetConsultCall, am as televetEmptyRosterCause, an as televetEmptyRosterView, ao as televetHoldCall, ap as televetJoinCall, aT as televetJoinDecision, aq as televetJoinOpensAtMs, as as televetMediaShortfallLines, at as televetRescheduleCall, au as televetThreadMessagesCall, av as televetThreadReadCall, aw as televetVisitSummaryCall, ax as useEarlyTriage, ay as useStateInterest, az as useTelevetBookConsult, aA as useTelevetBookingAvailable, aB as useTelevetBookingController, aC as useTelevetBookingEntitlement, aD as useTelevetCancellationPolicy, aE as useTelevetClinicians, aF as useTelevetHoldSlot, aG as useTelevetJoin, aH as useTelevetNextSlot, aI as useTelevetRescheduleConsult, aJ as useTelevetSlots, aK as useTelevetStatePolicy, aL as useVetThread, aM as useVetThreads, aN as useVisitSummary, aO as validateBookingBody, aP as vetThreadPetRef, aQ as withUnsentPicks } from '../../../bookingCopy-CJLAgEgK.js';
|
|
6
6
|
import { T as TelevetConsult, E as EverfurTelevetFlowRequest, c as TelevetSlot } from '../../../televetGlobal-CnjrfhT4.js';
|
|
7
7
|
export { C as CANCELLATION_POLICY_VERSION_MAX, d as CANCEL_REASON_MAX, e as CONSULT_KINDS, f as CONSULT_STATUSES, g as ConsultKind, h as ConsultStatus, M as MEDIA_REFS_MAX, R as REASON_TEXT_MAX, i as TERMINAL_CONSULT_STATUSES, j as TelevetBookingBody, k as TelevetBookingEntitlement, b as TelevetCancelReceipt, l as TelevetCancellationPolicy, m as TelevetClinician, n as TelevetSlotHold, o as TelevetStatePolicy, p as TelevetTriageVerdict, q as isWellFormedStateCode } from '../../../televetGlobal-CnjrfhT4.js';
|
|
8
8
|
import { V as VetVisitIntent } from '../../../visitIntent-D7_yVp1I.js';
|
|
@@ -12,11 +12,11 @@ import { m as EverfurTheme } from '../../../tokens-DLj8OnLH.js';
|
|
|
12
12
|
export { b as VetCallCredential, c as VetCallJoinRefusal, d as VetCallLimits, p as parseVetCallCredential, v as vetCallJoinReason, e as vetCallJoinRefusal } from '../../../callRoom-B92eH_ij.js';
|
|
13
13
|
export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../../EverfurError-DeBqRpQV.js';
|
|
14
14
|
export { E as EverfurResult } from '../../../EverfurResult-ClPTS0P2.js';
|
|
15
|
-
export { W as WidgetPet } from '../../../petsRepository-
|
|
16
|
-
import '../../../requestFunnel-
|
|
15
|
+
export { W as WidgetPet } from '../../../petsRepository-BdfbY9Oe.js';
|
|
16
|
+
import '../../../requestFunnel-Dhaj0yUq.js';
|
|
17
17
|
import '../../../ErrorPolicyPort-C3nNSS_j.js';
|
|
18
|
-
import '../../../config-
|
|
19
|
-
import '../../../identity-
|
|
18
|
+
import '../../../config-DeUmccwl.js';
|
|
19
|
+
import '../../../identity-BTT6YtH5.js';
|
|
20
20
|
import '../../../TelemetryPort-BDNr00hu.js';
|
|
21
21
|
import '../../../profile-CSs1wlXT.js';
|
|
22
22
|
|
|
@@ -290,7 +290,7 @@ return jsx(NestedHeadingLevelContext.Provider,{value:nestedLevel,children:/* @__
|
|
|
290
290
|
/* @__PURE__ */jsx(TelevetMediaDropNotice,{shortfall:sendMedia.bookedShortfall(bookedConsult),testIDPrefix:"televet-booked"})]}):null}):step==="clinician"&&clinicianOutcome?
|
|
291
291
|
/* @__PURE__ */jsx(TelevetClinicianOutcome,{state:clinicianState,cause:emptyRosterCause,locationStatus:locationStatus,...onRequestLocation?{onRequestLocation:onRequestLocation}:{},onRetry:()=>clinicians.refetch(),stateInterest:noLicensedVetInterest,...renderUnavailable?{renderUnavailable:renderUnavailable}:{}}):step==="clinician"?/* @__PURE__ */jsx(ClinicianStep,{headingRef:headingRef,clinicians:clinicians.data??[],isPending:clinicians.enabled&&clinicians.isPending,isError:clinicians.isError,error:clinicians.error,selectedId:draft.clinicianId,stateCode:draft.state,stateName:where.stateName,onRetry:()=>clinicians.refetch(),onSelect:clinicianId=>{dispatch({type:"patch",patch:{clinicianId:clinicianId}}),dispatch({type:"next"})}}):step==="issues"?/* @__PURE__ */jsx(IssuesStep,{headingRef:headingRef,petName:nameOf(pets,draft.petId),chips:intake.issueChips,selected:intake.concernIds,onToggle:intake.toggleConcern,onNext:()=>dispatch({type:"next"})}):step==="reason"?/* @__PURE__ */jsx(ReasonStep,{headingRef:headingRef,value:reasonText,composed:composedReason,vetName:matchedClinician?.displayName??null,onChange:setReasonText,media:media,onChangeMedia:setMedia,mediaLive:sendMedia.live,...onPickMedia?{onPickMedia:onPickMedia}:{},checking:triage.checking,onNext:()=>{triage.check(composedReason).then(goOn=>{goOn&&dispatch({type:"next"})})}}):step==="pet"?
|
|
292
292
|
/* @__PURE__ */jsx(PetStep,{headingRef:headingRef,pets:pets,isPending:roster.loading,isError:roster.error!==null,error:roster.error,onRetry:()=>{roster.refresh()},onAddPet:onAddPet,selectedId:draft.petId,onSelect:petId=>dispatch({type:"patch",patch:{petId:petId}}),onNext:()=>dispatch({type:"next"})}):step==="where"?/* @__PURE__ */jsx(WhereStep,{headingRef:headingRef,petName:petName,where:where,onNext:()=>dispatch({type:"next"})}):step==="emergency"?/* @__PURE__ */jsx(EmergencyStep,{headingRef:headingRef,petName:petName,answer:intake.emergencyAnswer,onAnswer:intake.setEmergencyAnswer,onNext:()=>dispatch({type:"next"}),onHandled:()=>{triage.acknowledge(composedReason),dispatch({type:"next"})},...primaryVet?{primaryVet:primaryVet}:{},onFindEmergencyVet:onFindEmergencyVet}):
|
|
293
|
-
/* @__PURE__ */jsx("div",{style:local.marker,"data-testid":`televet-booking-step-${step}`})]})})})}var SLOT=/* @__PURE__ */Symbol.for("@everfur/sdk/televet");function televetGlobal(){let realm=globalThis,existing=realm[SLOT];if(existing!==void 0)return existing;let created={presenter:null,snapshot:/* @__PURE__ */Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:/* @__PURE__ */new Set,dailyRegistered:false};return realm[SLOT]=created,created}function isEverfurDailyRegistered(){return televetGlobal().dailyRegistered}function noticeReceipts(){let g=televetGlobal(),existing=g.noticeReceipts;if(existing!==void 0)return existing;let created=/* @__PURE__ */new Map;return g.noticeReceipts=created,created}function markRecordingNoticeAccepted(roomUrl){let receipts=noticeReceipts(),held=receipts.get(roomUrl);held!==void 0?held.holders+=1:receipts.set(roomUrl,{holders:1,joined:false})}function clearRecordingNoticeAccepted(roomUrl){let receipts=noticeReceipts(),held=receipts.get(roomUrl);held!==void 0&&(held.holders-=1,held.holders<=0&&receipts.delete(roomUrl))}function isTelevetCallJoined(roomUrl){return noticeReceipts().get(roomUrl)?.joined===true}var VET_CALL_COPY=/* @__PURE__ */Object.freeze({muteCta:"Mute",unmuteCta:"Unmute",cameraOffCta:"Camera off",cameraOnCta:"Camera on",leaveCta:"Leave",switchCameraCta:"Switch camera",speakerOffCta:"Speaker off",speakerOnCta:"Speaker on",lobbyTitleNoName:"Your vet is joining",lobbySubtitle:"
|
|
293
|
+
/* @__PURE__ */jsx("div",{style:local.marker,"data-testid":`televet-booking-step-${step}`})]})})})}var SLOT=/* @__PURE__ */Symbol.for("@everfur/sdk/televet");function televetGlobal(){let realm=globalThis,existing=realm[SLOT];if(existing!==void 0)return existing;let created={presenter:null,snapshot:/* @__PURE__ */Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:/* @__PURE__ */new Set,dailyRegistered:false};return realm[SLOT]=created,created}function isEverfurDailyRegistered(){return televetGlobal().dailyRegistered}function noticeReceipts(){let g=televetGlobal(),existing=g.noticeReceipts;if(existing!==void 0)return existing;let created=/* @__PURE__ */new Map;return g.noticeReceipts=created,created}function markRecordingNoticeAccepted(roomUrl){let receipts=noticeReceipts(),held=receipts.get(roomUrl);held!==void 0?held.holders+=1:receipts.set(roomUrl,{holders:1,joined:false})}function clearRecordingNoticeAccepted(roomUrl){let receipts=noticeReceipts(),held=receipts.get(roomUrl);held!==void 0&&(held.holders-=1,held.holders<=0&&receipts.delete(roomUrl))}function isTelevetCallJoined(roomUrl){return noticeReceipts().get(roomUrl)?.joined===true}var VET_CALL_COPY=/* @__PURE__ */Object.freeze({muteCta:"Mute",unmuteCta:"Unmute",cameraOffCta:"Camera off",cameraOnCta:"Camera on",leaveCta:"Leave",switchCameraCta:"Switch camera",speakerOffCta:"Speaker off",speakerOnCta:"Speaker on",lobbyTitleNoName:"Your vet is joining",lobbySubtitle:"",lobbyPrepLabel:"While you wait",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:clinicianName=>{let name=clinicianName?.trim()??"";return name.length>0?`${name} is joining`:VET_CALL_COPY.lobbyTitleNoName},lobbyPrep:petName=>{let pet=petName?.trim()??"";return pet.length>0?`Have ${pet} nearby and somewhere well lit.`:VET_CALL_COPY.lobbyPrepNoPet},lobbyDuration:minutes=>`${minutes} minutes`,waitingRoomLabel:"Waiting room",leaveWaitingRoomLabel:"Leave the waiting room",lobbyTipsTitle:clinicianName=>{let name=clinicianName?.trim()??"";return name.length>0?`Before ${name} joins`:VET_CALL_COPY.lobbyPrepLabel},lobbyTipSpot:"Find a bright, quiet spot.",joinFailedReason:"That did not open. Try again.",recordingNoticeTitle:"This consultation is recorded.",recordingNoticeCta:"Continue to the call",recordingNoticeDecline:"Not now",selfCameraOffLabel:"Your camera is off"});function televetJoinRefusalWebCopy(reason){switch(reason){case"too_early":return"This visit has not opened yet.";case"too_late":return"This visit has ended.";case"room_not_ready":return"We are still setting up the video room. Try again in a moment.";case"status_cancelled_owner":return"You cancelled this visit.";case"status_cancelled_ops":return"This visit was cancelled. Please book another time.";case"status_no_show_owner":return"This visit was missed.";case"status_no_show_vet":return"The vet could not make this visit. Please book another time.";case"status_awaiting_summary":return"This visit has ended. Your summary is on its way.";case"status_completed":return"This visit has ended.";default:return TELEVET_JOIN_UNAVAILABLE_WEB}}var TELEVET_JOIN_UNAVAILABLE_WEB="This visit cannot be joined right now.";function televetJoinIsRetryable(refusal){return refusal==="room_not_ready"||refusal==="unknown"}function memoizeTelevetLoader(load){let pending=null;return()=>{if(pending!==null)return pending;let started=load();return pending=started,started.then(void 0,()=>{pending===started&&(pending=null)}),started}}var JOINING=/* @__PURE__ */Object.freeze({status:"joining"});function useTelevetJoin(consultId,controller){let[attempt,setAttempt]=useState(0),[state,setState]=useState(JOINING),inflight=useRef(null);useEffect(()=>{let join=controller?.joinConsult;if(controller===null||join===void 0){setState(/* @__PURE__ */Object.freeze({status:"refused",refusal:"unavailable",reason:null}));return}let key=`${consultId}#${String(attempt)}`,entry=inflight.current;if(entry===null||entry.key!==key){let promise;try{promise=join.call(controller,consultId)}catch(cause){promise=Promise.reject(cause)}entry={key:key,promise:promise},inflight.current=entry}let live=true;return setState(JOINING),entry.promise.then(res=>{live&&(res.ok?setState(/* @__PURE__ */Object.freeze({status:"ready",credential:res.value})):setState(/* @__PURE__ */Object.freeze({status:"refused",refusal:vetCallJoinRefusal(res.error),reason:vetCallJoinReason(res.error)})))},()=>{live&&setState(/* @__PURE__ */Object.freeze({status:"refused",refusal:"unknown",reason:null}))}),()=>{live=false}},[consultId,controller,attempt]);let retry=useCallback(()=>setAttempt(n=>n+1),[]);return{state:state,retry:retry}}var loadCall=memoizeTelevetLoader(()=>import("@everfur/sdk/web/televet/call")),JOIN_HOLD_MS=FUNNEL_UNARY_TIMEOUT_MS;function TelevetJoinScreen({consultId:consultId,controller:controller,onLeave:onLeave,style:style}){let styles=useBookingStyles(),[acceptedFor,setAcceptedFor]=useState(null),accepted=acceptedFor===consultId,[canHostCall]=useState(isEverfurDailyRegistered);useEffect(()=>{if(canHostCall)return;let live=true;return loadCall().then(loaded=>{live&&warnSetupOnce(loaded.EVERFUR_DAILY_SETUP)},()=>{}),()=>{live=false}},[canHostCall]),useTelevetBackChannel(()=>(onLeave(),true),!accepted);let leaveRoom=useCallback(()=>{setAcceptedFor(null),onLeave()},[onLeave]);return canHostCall?accepted?/* @__PURE__ */jsx(TelevetJoinRoom,{consultId:consultId,controller:controller,onLeave:leaveRoom,style:style},consultId):/* @__PURE__ */jsx(TelevetRecordingNotice,{onContinue:()=>setAcceptedFor(consultId),onDecline:onLeave,style:style}):/* @__PURE__ */jsxs("div",{style:{...styles.stepFill,...style},"data-testid":"televet-join-call-unavailable",children:[
|
|
294
294
|
/* @__PURE__ */jsx(TelevetFailureLine,{message:TELEVET_JOIN_UNAVAILABLE_WEB}),
|
|
295
295
|
/* @__PURE__ */jsx(TelevetButton,{label:VET_CALL_COPY.leaveCta,kind:"secondary",onPress:onLeave,testID:"televet-join-unavailable-leave"})]})}function TelevetRecordingNotice({onContinue:onContinue,onDecline:onDecline,busy:busy=false,declineHeld:declineHeld=false,style:style}){let styles=useBookingStyles(),titleId=`${useId()}-recording-notice`,noticeRef=useRef(null);return useEffect(()=>{let notice=noticeRef.current;if(!notice)return;let active=notice.ownerDocument.activeElement;active!==null&&active!==notice.ownerDocument.body||notice.focus()},[]),/* @__PURE__ */jsx("div",{style:{...styles.stepFill,...style},children:/* @__PURE__ */jsxs("div",{ref:noticeRef,role:"alertdialog","aria-labelledby":titleId,"aria-busy":busy||void 0,tabIndex:-1,"data-testid":"everfur-vet-call-recording-notice",style:styles.stateCard,children:[
|
|
296
296
|
/* @__PURE__ */jsx("p",{id:titleId,style:styles.stateTitle,children:VET_CALL_COPY.recordingNoticeTitle}),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var react=require("react"),jsxRuntime=require("react/jsx-runtime");var noopTelemetry=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});function isSafeRoomUrl(url){try{return new URL(url.trim()).protocol==="https:"}catch{return false}}function isUsableRoomCredential(roomUrl,token){return isSafeRoomUrl(roomUrl)&&token.trim().length>0}function reportHostFailure(error){let globalConsole=globalThis.console;try{globalConsole?.error?.("[everfur] A host callback threw; the SDK ignored it.",error)}catch{}}function isThenable(value){return(typeof value=="object"||typeof value=="function")&&value!==null&&typeof value.then=="function"}function callHost(fn,...args){if(typeof fn=="function")try{let result=fn(...args);return isThenable(result)&&Promise.resolve(result).then(void 0,reportHostFailure),result}catch(error){reportHostFailure(error);return}}var GUARDED=/* @__PURE__ */new WeakMap;function guardHost(fn){if(typeof fn!="function")return;let cached=GUARDED.get(fn);if(cached!==void 0)return cached;let guarded=(...args)=>{callHost(fn,...args)};return GUARDED.set(fn,guarded),guarded}function guardHostProps(props,names){let guarded=null;for(let name of names){let fn=props[name];typeof fn=="function"&&(guarded??={...props},guarded[name]=guardHost(fn))}return guarded??props}var VET_CALL_CONSULT_MINUTES=10,VET_CALL_COPY=/* @__PURE__ */Object.freeze({muteCta:"Mute",unmuteCta:"Unmute",cameraOffCta:"Camera off",cameraOnCta:"Camera on",leaveCta:"Leave",switchCameraCta:"Switch camera",speakerOffCta:"Speaker off",speakerOnCta:"Speaker on",lobbyTitleNoName:"Your vet is joining",lobbySubtitle:"Usually under a minute",lobbyPrepLabel:"WHILE YOU WAIT",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:clinicianName=>{let name=clinicianName?.trim()??"";return name.length>0?`${name} is joining`:VET_CALL_COPY.lobbyTitleNoName},lobbyPrep:petName=>{let pet=petName?.trim()??"";return pet.length>0?`Have ${pet} nearby and somewhere well lit.`:VET_CALL_COPY.lobbyPrepNoPet},lobbyDuration:minutes=>`${minutes} minutes`,waitingRoomLabel:"Waiting room",leaveWaitingRoomLabel:"Leave the waiting room",lobbyTipsTitle:clinicianName=>{let name=clinicianName?.trim()??"";return name.length>0?`Before ${name} joins`:VET_CALL_COPY.lobbyPrepLabel},lobbyTipSpot:"Find a bright, quiet spot.",joinFailedReason:"That did not open. Try again.",recordingNoticeTitle:"This consultation is recorded.",recordingNoticeCta:"Continue to the call",recordingNoticeDecline:"Not now",selfCameraOffLabel:"Your camera is off"});var SLOT=/* @__PURE__ */Symbol.for("@everfur/sdk/televet");function televetGlobal(){let realm=globalThis,existing=realm[SLOT];if(existing!==void 0)return existing;let created={presenter:null,snapshot:/* @__PURE__ */Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:/* @__PURE__ */new Set,dailyRegistered:false};return realm[SLOT]=created,created}function markEverfurDailyRegistered(registered){televetGlobal().dailyRegistered=registered}function noticeReceipts(){let g=televetGlobal(),existing=g.noticeReceipts;if(existing!==void 0)return existing;let created=/* @__PURE__ */new Map;return g.noticeReceipts=created,created}function hasRecordingNoticeAccepted(roomUrl){return noticeReceipts().has(roomUrl)}function markTelevetCallJoined(roomUrl,joined){let held=noticeReceipts().get(roomUrl);held!==void 0&&(held.joined=joined)}var freezeInPlace=Object.freeze;function deepFreeze(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value)){freezeInPlace(value);for(let key of Object.keys(value))deepFreeze(value[key])}return value}var TEXT_SCALE_TIER_CAPS=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),SPACE={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},RADIUS={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},TYPE_SIZE={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},LINE_HEIGHT={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},WEIGHT={regular:"400",medium:"500",bold:"700"},LETTER_SPACING={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},DEFAULT_MAX_FONT_SCALE=0,SYSTEM_FONT_FAMILY="System",SYSTEM_MONO_FAMILY="monospace",TIERS=["content","heading","control","compact","badge"];function authoredTierSizes(size){let out={};for(let tier of TIERS)out[tier]=size;return out}var NO_FONT_SOURCES=[];function baseType(){return{family:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,fontUrl:null,families:{regular:SYSTEM_FONT_FAMILY,medium:SYSTEM_FONT_FAMILY,bold:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,monoMedium:SYSTEM_MONO_FAMILY,monoBold:SYSTEM_MONO_FAMILY},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:TYPE_SIZE,tierSizes:authoredTierSizes(TYPE_SIZE),lineHeight:LINE_HEIGHT,weight:WEIGHT,letterSpacing:LETTER_SPACING,scale:1,maxScale:DEFAULT_MAX_FONT_SCALE,scaleCaps:TEXT_SCALE_TIER_CAPS,headingFamily:null,headingWeight:null,fontSources:NO_FONT_SOURCES}}var NO_SLOTS={},EASING_CURVES=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(curve){return`cubic-bezier(${curve.join(", ")})`}var MOTION={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(EASING_CURVES.standard),emphasized:cssCubicBezier(EASING_CURVES.emphasized),exit:cssCubicBezier(EASING_CURVES.exit)},reducedMotion:false},LIGHT_COLOR={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},EVERFUR_LIGHT=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:LIGHT_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS}),DARK_COLOR={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:DARK_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS});var EVERFUR_THEME_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),globalThemeHost=globalThis,EverfurThemeContext=globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]??(globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]=react.createContext(EVERFUR_LIGHT));EverfurThemeContext.displayName??="EverfurThemeContext";function useEverfurTheme(){return react.useContext(EverfurThemeContext)}var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function tierScale(theme,tier){let{scale:scale,scaleCaps:scaleCaps}=theme.type,cap=scaleCaps[tier];return cap>0?Math.min(scale,cap):scale}function tierPx(theme,tier,points){return Math.round(points*tierScale(theme,tier)*10)/10}var SYSTEM_UI_STACK='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',RN_SYSTEM_FAMILY="System";function cssFontFamily(family){let named=family.trim();return named.length===0||named===RN_SYSTEM_FAMILY?SYSTEM_UI_STACK:`${quote(named)}, ${SYSTEM_UI_STACK}`}function cssMonoFamily(mono){let named=mono.trim();return named.length===0||named==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${quote(named)}, ui-monospace, Menlo, Consolas, monospace`}function quote(family){return`"${family.replace(/[\\"]/g,"\\$&")}"`}function faceCss(theme,weight){let type=theme.type,family=type.families[weight];return{fontFamily:weight==="mono"||weight==="monoMedium"||weight==="monoBold"?cssMonoFamily(family):cssFontFamily(family),fontWeight:type.namedFaces[weight]?type.weight.regular:type.weight[FACE_WEIGHT[weight]]}}var SURFACE_ROOT_RESET=/* @__PURE__ */Object.freeze({textAlign:"start"});var EVERFUR_DAILY_SETUP=`[everfur] The in-page vet call needs @daily-co/daily-js, which this app has not registered. Install it and call registerEverfurDaily(() => import('@daily-co/daily-js')) once in your app entry, before any Everfur call surface mounts. Until then the in-page visit tells the member the call cannot be joined; <VetVisitButton prefer="redirect" /> is the explicit way to the hosted visit in a new tab instead.`,DAILY_PEER="@daily-co/daily-js",NOT_REGISTERED=`optional peer '${DAILY_PEER}' has no registered loader`,WRONG_SHAPE=`optional peer '${DAILY_PEER}' is present but failed its shape check`;function isRecordLike(candidate){return typeof candidate=="object"&&candidate!==null}function normalizeDailyModule(candidate){let current=candidate;for(let depth=0;depth<3;depth+=1){if(isEverfurDailyModule(current))return current;if(!isRecordLike(current)||!("default"in current))return null;current=current.default}return null}function isEverfurDailyModule(candidate){return!isRecordLike(candidate)&&typeof candidate!="function"?false:typeof candidate.createFrame=="function"}var loader=null,memo=null;function unavailable(reason){/* @__PURE__ */
|
|
2
|
+
"use strict";var react=require("react"),jsxRuntime=require("react/jsx-runtime");var noopTelemetry=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});function isSafeRoomUrl(url){try{return new URL(url.trim()).protocol==="https:"}catch{return false}}function isUsableRoomCredential(roomUrl,token){return isSafeRoomUrl(roomUrl)&&token.trim().length>0}function reportHostFailure(error){let globalConsole=globalThis.console;try{globalConsole?.error?.("[everfur] A host callback threw; the SDK ignored it.",error)}catch{}}function isThenable(value){return(typeof value=="object"||typeof value=="function")&&value!==null&&typeof value.then=="function"}function callHost(fn,...args){if(typeof fn=="function")try{let result=fn(...args);return isThenable(result)&&Promise.resolve(result).then(void 0,reportHostFailure),result}catch(error){reportHostFailure(error);return}}var GUARDED=/* @__PURE__ */new WeakMap;function guardHost(fn){if(typeof fn!="function")return;let cached=GUARDED.get(fn);if(cached!==void 0)return cached;let guarded=(...args)=>{callHost(fn,...args)};return GUARDED.set(fn,guarded),guarded}function guardHostProps(props,names){let guarded=null;for(let name of names){let fn=props[name];typeof fn=="function"&&(guarded??={...props},guarded[name]=guardHost(fn))}return guarded??props}var VET_CALL_CONSULT_MINUTES=10,VET_CALL_COPY=/* @__PURE__ */Object.freeze({muteCta:"Mute",unmuteCta:"Unmute",cameraOffCta:"Camera off",cameraOnCta:"Camera on",leaveCta:"Leave",switchCameraCta:"Switch camera",speakerOffCta:"Speaker off",speakerOnCta:"Speaker on",lobbyTitleNoName:"Your vet is joining",lobbySubtitle:"",lobbyPrepLabel:"While you wait",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:clinicianName=>{let name=clinicianName?.trim()??"";return name.length>0?`${name} is joining`:VET_CALL_COPY.lobbyTitleNoName},lobbyPrep:petName=>{let pet=petName?.trim()??"";return pet.length>0?`Have ${pet} nearby and somewhere well lit.`:VET_CALL_COPY.lobbyPrepNoPet},lobbyDuration:minutes=>`${minutes} minutes`,waitingRoomLabel:"Waiting room",leaveWaitingRoomLabel:"Leave the waiting room",lobbyTipsTitle:clinicianName=>{let name=clinicianName?.trim()??"";return name.length>0?`Before ${name} joins`:VET_CALL_COPY.lobbyPrepLabel},lobbyTipSpot:"Find a bright, quiet spot.",joinFailedReason:"That did not open. Try again.",recordingNoticeTitle:"This consultation is recorded.",recordingNoticeCta:"Continue to the call",recordingNoticeDecline:"Not now",selfCameraOffLabel:"Your camera is off"});var SLOT=/* @__PURE__ */Symbol.for("@everfur/sdk/televet");function televetGlobal(){let realm=globalThis,existing=realm[SLOT];if(existing!==void 0)return existing;let created={presenter:null,snapshot:/* @__PURE__ */Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:/* @__PURE__ */new Set,dailyRegistered:false};return realm[SLOT]=created,created}function markEverfurDailyRegistered(registered){televetGlobal().dailyRegistered=registered}function noticeReceipts(){let g=televetGlobal(),existing=g.noticeReceipts;if(existing!==void 0)return existing;let created=/* @__PURE__ */new Map;return g.noticeReceipts=created,created}function hasRecordingNoticeAccepted(roomUrl){return noticeReceipts().has(roomUrl)}function markTelevetCallJoined(roomUrl,joined){let held=noticeReceipts().get(roomUrl);held!==void 0&&(held.joined=joined)}var freezeInPlace=Object.freeze;function deepFreeze(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value)){freezeInPlace(value);for(let key of Object.keys(value))deepFreeze(value[key])}return value}var TEXT_SCALE_TIER_CAPS=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),SPACE={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},RADIUS={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},TYPE_SIZE={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},LINE_HEIGHT={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},WEIGHT={regular:"400",medium:"500",bold:"700"},LETTER_SPACING={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},DEFAULT_MAX_FONT_SCALE=0,SYSTEM_FONT_FAMILY="System",SYSTEM_MONO_FAMILY="monospace",TIERS=["content","heading","control","compact","badge"];function authoredTierSizes(size){let out={};for(let tier of TIERS)out[tier]=size;return out}var NO_FONT_SOURCES=[];function baseType(){return{family:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,fontUrl:null,families:{regular:SYSTEM_FONT_FAMILY,medium:SYSTEM_FONT_FAMILY,bold:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,monoMedium:SYSTEM_MONO_FAMILY,monoBold:SYSTEM_MONO_FAMILY},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:TYPE_SIZE,tierSizes:authoredTierSizes(TYPE_SIZE),lineHeight:LINE_HEIGHT,weight:WEIGHT,letterSpacing:LETTER_SPACING,scale:1,maxScale:DEFAULT_MAX_FONT_SCALE,scaleCaps:TEXT_SCALE_TIER_CAPS,headingFamily:null,headingWeight:null,fontSources:NO_FONT_SOURCES}}var NO_SLOTS={},EASING_CURVES=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(curve){return`cubic-bezier(${curve.join(", ")})`}var MOTION={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(EASING_CURVES.standard),emphasized:cssCubicBezier(EASING_CURVES.emphasized),exit:cssCubicBezier(EASING_CURVES.exit)},reducedMotion:false},LIGHT_COLOR={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},EVERFUR_LIGHT=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:LIGHT_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS}),DARK_COLOR={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:DARK_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS});var EVERFUR_THEME_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),globalThemeHost=globalThis,EverfurThemeContext=globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]??(globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]=react.createContext(EVERFUR_LIGHT));EverfurThemeContext.displayName??="EverfurThemeContext";function useEverfurTheme(){return react.useContext(EverfurThemeContext)}var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function tierScale(theme,tier){let{scale:scale,scaleCaps:scaleCaps}=theme.type,cap=scaleCaps[tier];return cap>0?Math.min(scale,cap):scale}function tierPx(theme,tier,points){return Math.round(points*tierScale(theme,tier)*10)/10}var SYSTEM_UI_STACK='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',RN_SYSTEM_FAMILY="System";function cssFontFamily(family){let named=family.trim();return named.length===0||named===RN_SYSTEM_FAMILY?SYSTEM_UI_STACK:`${quote(named)}, ${SYSTEM_UI_STACK}`}function cssMonoFamily(mono){let named=mono.trim();return named.length===0||named==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${quote(named)}, ui-monospace, Menlo, Consolas, monospace`}function quote(family){return`"${family.replace(/[\\"]/g,"\\$&")}"`}function faceCss(theme,weight){let type=theme.type,family=type.families[weight];return{fontFamily:weight==="mono"||weight==="monoMedium"||weight==="monoBold"?cssMonoFamily(family):cssFontFamily(family),fontWeight:type.namedFaces[weight]?type.weight.regular:type.weight[FACE_WEIGHT[weight]]}}var SURFACE_ROOT_RESET=/* @__PURE__ */Object.freeze({textAlign:"start"});var EVERFUR_DAILY_SETUP=`[everfur] The in-page vet call needs @daily-co/daily-js, which this app has not registered. Install it and call registerEverfurDaily(() => import('@daily-co/daily-js')) once in your app entry, before any Everfur call surface mounts. Until then the in-page visit tells the member the call cannot be joined; <VetVisitButton prefer="redirect" /> is the explicit way to the hosted visit in a new tab instead.`,DAILY_PEER="@daily-co/daily-js",NOT_REGISTERED=`optional peer '${DAILY_PEER}' has no registered loader`,WRONG_SHAPE=`optional peer '${DAILY_PEER}' is present but failed its shape check`;function isRecordLike(candidate){return typeof candidate=="object"&&candidate!==null}function normalizeDailyModule(candidate){let current=candidate;for(let depth=0;depth<3;depth+=1){if(isEverfurDailyModule(current))return current;if(!isRecordLike(current)||!("default"in current))return null;current=current.default}return null}function isEverfurDailyModule(candidate){return!isRecordLike(candidate)&&typeof candidate!="function"?false:typeof candidate.createFrame=="function"}var loader=null,memo=null;function unavailable(reason){/* @__PURE__ */
|
|
3
3
|
return Object.freeze({available:false,module:null,reason:reason})}function registerEverfurDaily(next){loader=next,memo=null,markEverfurDailyRegistered(next!==null)}function loadEverfurDaily(){if(memo!==null)return memo;let load=loader;if(load===null)return Promise.resolve(unavailable(NOT_REGISTERED));let pending=(async()=>{let raw;try{raw=await load()}catch(cause){return unavailable(`optional peer '${DAILY_PEER}' is not installed: ${describe(cause)}`)}let module=normalizeDailyModule(raw);return module===null?unavailable(WRONG_SHAPE):/* @__PURE__ */Object.freeze({available:true,module:module})})();return memo=pending,pending}function describe(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"unknown load error"}function dailyErrorMessage(payload){if(!isRecordLike(payload)||!("errorMsg"in payload))return null;let message=payload.errorMsg;return typeof message=="string"&&message.length>0?message:null}var MIN_TOUCH_TARGET=44,FRAME_ASPECT="16 / 9",FRAME_RADIUS="16px",FRAME_MAX_HEIGHT="calc(100dvh - 8rem)",PREJOIN_STACKED_BELOW=480,PREJOIN_PORTRAIT_ASPECT="3 / 4",PREJOIN_STACKED_MIN_HEIGHT=500,PREJOIN_WIDE_MIN_HEIGHT=270,PREJOIN_WIDE_FLOOR_RATIO=.45;function frameSize(width,joining){if(!joining||width===null)return{aspectRatio:FRAME_ASPECT,maxHeight:FRAME_MAX_HEIGHT};if(width<PREJOIN_STACKED_BELOW)return{aspectRatio:PREJOIN_PORTRAIT_ASPECT,maxHeight:FRAME_MAX_HEIGHT,minHeight:PREJOIN_STACKED_MIN_HEIGHT};let floor=Math.max(PREJOIN_WIDE_MIN_HEIGHT,Math.ceil(width*PREJOIN_WIDE_FLOOR_RATIO));return{aspectRatio:FRAME_ASPECT,maxHeight:FRAME_MAX_HEIGHT,minHeight:floor}}var LEAVE_SETTLE_MS=5e3;function EverfurVetCall(props){let{roomUrl:roomUrl,token:token,onLeave:onLeave,displayName:displayName,daily:daily,telemetry:telemetry,onUnavailable:onUnavailable,renderUnavailable:renderUnavailable,style:style,className:className}=guardHostProps(props,["onLeave","onUnavailable"]),theme=useEverfurTheme(),styles=react.useMemo(()=>makeCallStyles(theme),[theme]),noticeId=`${react.useId()}-recording-notice`,[phase,setPhase]=react.useState("joining"),[unavailable2,setUnavailable]=react.useState(null),[module,setModule]=react.useState(null),[acknowledged,setAcknowledged]=react.useState(false),[leaving,setLeaving]=react.useState(false),[frameWidth,setFrameWidth]=react.useState(null),containerRef=react.useRef(null),frameRef=react.useRef(null),leftRef=react.useRef(false),leavingRef=react.useRef(false),leavingCallRef=react.useRef(null),generationRef=react.useRef(0),hostRef=react.useRef({onLeave:onLeave,onUnavailable:onUnavailable,daily:daily,telemetry:telemetry});hostRef.current={onLeave:onLeave,onUnavailable:onUnavailable,daily:daily,telemetry:telemetry};let reportLeave=react.useCallback(()=>{leftRef.current||(leftRef.current=true,callHost(hostRef.current.onLeave))},[]);react.useEffect(()=>()=>{generationRef.current+=1},[]),react.useEffect(()=>{let cancelled=false;setModule(null),generationRef.current+=1,leftRef.current=false,leavingRef.current=false,setLeaving(false),setPhase("joining"),setAcknowledged(hasRecordingNoticeAccepted(roomUrl));let refuse=(reason,detail)=>{cancelled||(setUnavailable({reason:reason,detail:detail}),callHost(hostRef.current.onUnavailable,reason,detail))};if(!isUsableRoomCredential(roomUrl,token)){refuse("roomUnusable","the call needs an https room URL and a non-empty join token");return}let injected=hostRef.current.daily;return injected!==void 0?(setModule(()=>injected),()=>{cancelled=true}):(loadEverfurDaily().then(loaded=>{if(!cancelled){if(!loaded.available){warnOnce(EVERFUR_DAILY_SETUP),refuse("dailyMissing",loaded.reason);return}setModule(()=>loaded.module)}}),()=>{cancelled=true})},[roomUrl,token]),react.useEffect(()=>{if(module===null||!acknowledged)return;let cancelled=false,frame=null,attached=[],refuse=(reason,detail)=>{cancelled||(setUnavailable({reason:reason,detail:detail}),callHost(hostRef.current.onUnavailable,reason,detail))};return(async()=>{let container=containerRef.current;if(!container)return;let sink=hostRef.current.telemetry??noopTelemetry;try{frame=module.createFrame(container,{showLeaveButton:!0,showFullscreenButton:!1,showUserNameChangeUI:!1,iframeStyle:{width:"100%",height:"100%",border:"0",borderRadius:FRAME_RADIUS}})}catch(cause){refuse("dailyMissing",`createFrame failed: ${describe2(cause)}`);return}frameRef.current=frame;let attach=(event,handler)=>{attached.push({event:event,handler:handler}),frame?.on(event,handler)};attach("joined-meeting",()=>{cancelled||frame===null||leavingRef.current||(setPhase("joined"),markTelevetCallJoined(roomUrl,true))}),attach("left-meeting",()=>{cancelled||(markTelevetCallJoined(roomUrl,false),setPhase("left"),reportLeave())}),attach("error",payload=>{cancelled||(markTelevetCallJoined(roomUrl,false),setPhase("error"),sink.trackExpectedFailure("televet.call.join_failed",{provider:"daily",detail:dailyErrorMessage(payload)??"unknown"}))});try{if(await frame.join({url:roomUrl,token:token,userName:displayName}),cancelled)return;sink.track("televet.call.joined",{provider:"daily"})}catch(cause){if(cancelled)return;markTelevetCallJoined(roomUrl,false),setPhase("error"),sink.trackExpectedFailure("televet.call.join_failed",{provider:"daily",detail:describe2(cause)})}})(),()=>{cancelled=true,markTelevetCallJoined(roomUrl,false);for(let{event:event,handler:handler}of attached)try{frame?.off(event,handler)}catch{}let call=frameRef.current;frameRef.current=null,call?.destroy().catch(()=>{});let pending=leavingCallRef.current;pending!==null&&(pending.abandoned=true),releaseAbandoned(pending)}},[module,acknowledged,roomUrl,token,displayName,reportLeave]);let framed=module!==null&&acknowledged&&unavailable2===null&&phase!=="left";react.useEffect(()=>{let node=containerRef.current;if(!framed||node===null||typeof ResizeObserver>"u")return;let read=()=>{setFrameWidth(node.offsetWidth>0?node.offsetWidth:null)};read();let observer=new ResizeObserver(read);return observer.observe(node),()=>observer.disconnect()},[framed]),react.useEffect(()=>{if(phase!=="left")return;let call=frameRef.current;frameRef.current=null,call?.destroy().catch(()=>{}),releaseAbandoned(leavingCallRef.current)},[phase]);let leave=react.useCallback(()=>{if(leavingRef.current)return;leavingRef.current=true;let generation=generationRef.current,call=frameRef.current;if(frameRef.current=null,markTelevetCallJoined(roomUrl,false),!call){setPhase("left"),reportLeave();return}setLeaving(true);let pending={call:call,settled:false,abandoned:false};leavingCallRef.current=pending,settleWithin(teardown(call).then(()=>{pending.settled=true}),LEAVE_SETTLE_MS).then(timedOut=>{timedOut&&(pending.abandoned=true),generationRef.current===generation&&(setPhase("left"),reportLeave())})},[reportLeave,roomUrl]);return unavailable2!==null?renderUnavailable?/* @__PURE__ */jsxRuntime.jsx(jsxRuntime.Fragment,{children:renderUnavailable(unavailable2.reason,unavailable2.detail)}):null:module===null?null:acknowledged?/* @__PURE__ */jsxRuntime.jsxs("div",{className:className,"data-testid":"everfur-vet-call",style:{...styles.root,...style},children:[phase==="left"?null:/* @__PURE__ */jsxRuntime.jsx("div",{ref:containerRef,"data-testid":"everfur-vet-call-frame",style:{...styles.frame,...frameSize(frameWidth,phase==="joining"),...phase==="error"?styles.frameHidden:null}}),phase==="joining"?
|
|
4
4
|
/* @__PURE__ */jsxRuntime.jsx("button",{type:"button",onClick:leave,disabled:leaving,"aria-busy":leaving||void 0,"data-testid":"everfur-vet-call-joining-leave",style:{...styles.failedLeave,...styles.joiningLeave,...leaving?styles.leaveHeld:null},children:VET_CALL_COPY.leaveCta}):null,phase==="error"?
|
|
5
5
|
/* @__PURE__ */jsxRuntime.jsxs("div",{role:"alert","data-testid":"everfur-vet-call-failed",style:styles.failed,children:[
|
|
@@ -17,12 +17,10 @@ return jsxRuntime.jsxs("section",{className:className,"data-testid":"everfur-vet
|
|
|
17
17
|
/* @__PURE__ */jsxRuntime.jsxs("div",{"aria-hidden":"true","data-testid":"everfur-vet-call-lobby-avatar",style:styles.avatar,children:[
|
|
18
18
|
/* @__PURE__ */jsxRuntime.jsx("span",{style:styles.avatarHead}),
|
|
19
19
|
/* @__PURE__ */jsxRuntime.jsx("span",{style:styles.avatarBody})]}),
|
|
20
|
-
/* @__PURE__ */jsxRuntime.
|
|
21
|
-
/* @__PURE__ */jsxRuntime.jsx("p",{"data-testid":"everfur-vet-call-lobby-title",style:styles.title,children:title}),
|
|
22
|
-
/* @__PURE__ */jsxRuntime.jsx("p",{style:styles.subtitle,children:VET_CALL_COPY.lobbySubtitle})]}),
|
|
20
|
+
/* @__PURE__ */jsxRuntime.jsx("div",{"aria-live":"polite",style:styles.titleBlock,children:/* @__PURE__ */jsxRuntime.jsx("p",{"data-testid":"everfur-vet-call-lobby-title",style:styles.title,children:title})}),
|
|
23
21
|
/* @__PURE__ */jsxRuntime.jsx(WaitingDots,{theme:theme})]}),
|
|
24
22
|
/* @__PURE__ */jsxRuntime.jsxs("div",{"data-testid":"everfur-vet-call-lobby-prep",style:styles.prepCard,children:[
|
|
25
23
|
/* @__PURE__ */jsxRuntime.jsx("p",{style:styles.prepLabel,children:VET_CALL_COPY.lobbyTipsTitle(clinicianName)}),
|
|
26
24
|
/* @__PURE__ */jsxRuntime.jsx("ol",{style:styles.tips,children:[VET_CALL_COPY.lobbyTipSpot,prep].map((tip,i)=>/* @__PURE__ */jsxRuntime.jsxs("li",{style:styles.tip,children:[
|
|
27
25
|
/* @__PURE__ */jsxRuntime.jsx("span",{"aria-hidden":"true",style:styles.tipNumber,children:String(i+1).padStart(2,"0")}),
|
|
28
|
-
/* @__PURE__ */jsxRuntime.jsx("span",{style:styles.prepBody,children:tip})]},tip))})]}),minutes===null?null:/* @__PURE__ */jsxRuntime.jsx("p",{"data-testid":"everfur-vet-call-lobby-duration",style:styles.duration,children:VET_CALL_COPY.lobbyDuration(minutes)})]})}function makeLobbyStyles(theme){let{space:space,radius:radius,type:type}=theme,look=televetPlainLook(theme),avatarSize=112;return{root:{...SURFACE_ROOT_RESET,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:space.lg,padding:space.xl,borderRadius:radius.lg,borderStyle:"solid",borderWidth:1,borderColor:look.line,backgroundColor:look.surface,color:look.text},topRow:{display:"flex",alignItems:"center",gap:14},leave:{minHeight:MIN_TOUCH_TARGET2,padding:`0 ${space.lg}px`,margin:0,borderRadius:radius.pill,borderStyle:"solid",borderWidth:1.5,borderColor:look.line,background:look.surface,color:look.ink,cursor:"pointer",...faceCss(theme,"bold"),fontSize:type.size.bodyTight},label:{margin:0,...faceCss(theme,"monoBold"),color:look.muted,fontSize:12,letterSpacing:"0.08em",textTransform:"uppercase"},center:{display:"flex",flexDirection:"column",alignItems:"center",gap:space.md},avatar:{position:"relative",width:avatarSize,height:avatarSize,borderRadius:radius.pill,overflow:"hidden",backgroundColor:look.mist,boxShadow:`0 0 0 4px ${look.surface}, 0 0 0 6px ${look.go}`,display:"flex",alignItems:"center",justifyContent:"center"},avatarHead:{position:"absolute",top:avatarSize*.24,width:avatarSize*.28,height:avatarSize*.28,borderRadius:radius.pill,backgroundColor:look.ink,opacity:.35},avatarBody:{position:"absolute",top:avatarSize*.58,width:avatarSize*.52,height:avatarSize*.34,borderTopLeftRadius:avatarSize*.26,borderTopRightRadius:avatarSize*.26,backgroundColor:look.ink,opacity:.35},titleBlock:{textAlign:"center"},title:{margin:0,...faceCss(theme,"medium"),fontSize:tierPx(theme,"heading",28),lineHeight:1.15,letterSpacing:"-0.02em",color:look.ink},
|
|
26
|
+
/* @__PURE__ */jsxRuntime.jsx("span",{style:styles.prepBody,children:tip})]},tip))})]}),minutes===null?null:/* @__PURE__ */jsxRuntime.jsx("p",{"data-testid":"everfur-vet-call-lobby-duration",style:styles.duration,children:VET_CALL_COPY.lobbyDuration(minutes)})]})}function makeLobbyStyles(theme){let{space:space,radius:radius,type:type}=theme,look=televetPlainLook(theme),avatarSize=112;return{root:{...SURFACE_ROOT_RESET,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:space.lg,padding:space.xl,borderRadius:radius.lg,borderStyle:"solid",borderWidth:1,borderColor:look.line,backgroundColor:look.surface,color:look.text},topRow:{display:"flex",alignItems:"center",gap:14},leave:{minHeight:MIN_TOUCH_TARGET2,padding:`0 ${space.lg}px`,margin:0,borderRadius:radius.pill,borderStyle:"solid",borderWidth:1.5,borderColor:look.line,background:look.surface,color:look.ink,cursor:"pointer",...faceCss(theme,"bold"),fontSize:type.size.bodyTight},label:{margin:0,...faceCss(theme,"monoBold"),color:look.muted,fontSize:12,letterSpacing:"0.08em",textTransform:"uppercase"},center:{display:"flex",flexDirection:"column",alignItems:"center",gap:space.md},avatar:{position:"relative",width:avatarSize,height:avatarSize,borderRadius:radius.pill,overflow:"hidden",backgroundColor:look.mist,boxShadow:`0 0 0 4px ${look.surface}, 0 0 0 6px ${look.go}`,display:"flex",alignItems:"center",justifyContent:"center"},avatarHead:{position:"absolute",top:avatarSize*.24,width:avatarSize*.28,height:avatarSize*.28,borderRadius:radius.pill,backgroundColor:look.ink,opacity:.35},avatarBody:{position:"absolute",top:avatarSize*.58,width:avatarSize*.52,height:avatarSize*.34,borderTopLeftRadius:avatarSize*.26,borderTopRightRadius:avatarSize*.26,backgroundColor:look.ink,opacity:.35},titleBlock:{textAlign:"center"},title:{margin:0,...faceCss(theme,"medium"),fontSize:tierPx(theme,"heading",28),lineHeight:1.15,letterSpacing:"-0.02em",color:look.ink},prepCard:{display:"flex",flexDirection:"column",gap:space.sm,padding:space.lg,borderRadius:radius.lg,borderStyle:"solid",borderWidth:1,borderColor:look.line},prepLabel:{margin:0,...faceCss(theme,"bold"),fontSize:19,color:look.ink},tips:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"},tip:{display:"grid",gridTemplateColumns:"44px 1fr",gap:10,paddingTop:12,paddingBottom:12,borderTop:`1px solid ${look.line}`},tipNumber:{...faceCss(theme,"monoBold"),color:look.ink,fontSize:13,paddingTop:2},prepBody:{margin:0,...faceCss(theme,"regular"),fontSize:type.size.body,lineHeight:1.5,color:look.text},duration:{margin:0,textAlign:"center",...faceCss(theme,"regular"),fontSize:type.size.bodyTight,color:look.muted}}}exports.EVERFUR_DAILY_SETUP=EVERFUR_DAILY_SETUP;exports.EverfurVetCall=EverfurVetCall;exports.EverfurVetCallLobby=EverfurVetCallLobby;exports.VET_CALL_CONSULT_MINUTES=VET_CALL_CONSULT_MINUTES;exports.VET_CALL_COPY=VET_CALL_COPY;exports.isEverfurDailyModule=isEverfurDailyModule;exports.isSafeRoomUrl=isSafeRoomUrl;exports.isUsableRoomCredential=isUsableRoomCredential;exports.loadEverfurDaily=loadEverfurDaily;exports.registerEverfurDaily=registerEverfurDaily;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode, CSSProperties } from 'react';
|
|
2
2
|
import { T as TelemetryPort } from '../../../TelemetryPort-BDNr00hu.cjs';
|
|
3
3
|
export { V as VetCallPhase, i as isSafeRoomUrl, a as isUsableRoomCredential } from '../../../callRoom-BhIdadyV.cjs';
|
|
4
|
-
export { V as VET_CALL_CONSULT_MINUTES, a as VET_CALL_COPY } from '../../../callCopy-
|
|
4
|
+
export { V as VET_CALL_CONSULT_MINUTES, a as VET_CALL_COPY } from '../../../callCopy-Bw6oZT54.cjs';
|
|
5
5
|
import '../../../EverfurError-DeBqRpQV.cjs';
|
|
6
6
|
|
|
7
7
|
/** The Daily events the call surface subscribes to. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode, CSSProperties } from 'react';
|
|
2
2
|
import { T as TelemetryPort } from '../../../TelemetryPort-BDNr00hu.js';
|
|
3
3
|
export { V as VetCallPhase, i as isSafeRoomUrl, a as isUsableRoomCredential } from '../../../callRoom-B92eH_ij.js';
|
|
4
|
-
export { V as VET_CALL_CONSULT_MINUTES, a as VET_CALL_COPY } from '../../../callCopy-
|
|
4
|
+
export { V as VET_CALL_CONSULT_MINUTES, a as VET_CALL_COPY } from '../../../callCopy-Bw6oZT54.js';
|
|
5
5
|
import '../../../EverfurError-DeBqRpQV.js';
|
|
6
6
|
|
|
7
7
|
/** The Daily events the call surface subscribes to. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{createContext,useMemo,useId,useState,useRef,useCallback,useEffect,useContext}from"react";import{jsx,Fragment,jsxs}from"react/jsx-runtime";var noopTelemetry=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});function isSafeRoomUrl(url){try{return new URL(url.trim()).protocol==="https:"}catch{return false}}function isUsableRoomCredential(roomUrl,token){return isSafeRoomUrl(roomUrl)&&token.trim().length>0}function reportHostFailure(error){let globalConsole=globalThis.console;try{globalConsole?.error?.("[everfur] A host callback threw; the SDK ignored it.",error)}catch{}}function isThenable(value){return(typeof value=="object"||typeof value=="function")&&value!==null&&typeof value.then=="function"}function callHost(fn,...args){if(typeof fn=="function")try{let result=fn(...args);return isThenable(result)&&Promise.resolve(result).then(void 0,reportHostFailure),result}catch(error){reportHostFailure(error);return}}var GUARDED=/* @__PURE__ */new WeakMap;function guardHost(fn){if(typeof fn!="function")return;let cached=GUARDED.get(fn);if(cached!==void 0)return cached;let guarded=(...args)=>{callHost(fn,...args)};return GUARDED.set(fn,guarded),guarded}function guardHostProps(props,names){let guarded=null;for(let name of names){let fn=props[name];typeof fn=="function"&&(guarded??={...props},guarded[name]=guardHost(fn))}return guarded??props}var VET_CALL_CONSULT_MINUTES=10,VET_CALL_COPY=/* @__PURE__ */Object.freeze({muteCta:"Mute",unmuteCta:"Unmute",cameraOffCta:"Camera off",cameraOnCta:"Camera on",leaveCta:"Leave",switchCameraCta:"Switch camera",speakerOffCta:"Speaker off",speakerOnCta:"Speaker on",lobbyTitleNoName:"Your vet is joining",lobbySubtitle:"Usually under a minute",lobbyPrepLabel:"WHILE YOU WAIT",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:clinicianName=>{let name=clinicianName?.trim()??"";return name.length>0?`${name} is joining`:VET_CALL_COPY.lobbyTitleNoName},lobbyPrep:petName=>{let pet=petName?.trim()??"";return pet.length>0?`Have ${pet} nearby and somewhere well lit.`:VET_CALL_COPY.lobbyPrepNoPet},lobbyDuration:minutes=>`${minutes} minutes`,waitingRoomLabel:"Waiting room",leaveWaitingRoomLabel:"Leave the waiting room",lobbyTipsTitle:clinicianName=>{let name=clinicianName?.trim()??"";return name.length>0?`Before ${name} joins`:VET_CALL_COPY.lobbyPrepLabel},lobbyTipSpot:"Find a bright, quiet spot.",joinFailedReason:"That did not open. Try again.",recordingNoticeTitle:"This consultation is recorded.",recordingNoticeCta:"Continue to the call",recordingNoticeDecline:"Not now",selfCameraOffLabel:"Your camera is off"});var SLOT=/* @__PURE__ */Symbol.for("@everfur/sdk/televet");function televetGlobal(){let realm=globalThis,existing=realm[SLOT];if(existing!==void 0)return existing;let created={presenter:null,snapshot:/* @__PURE__ */Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:/* @__PURE__ */new Set,dailyRegistered:false};return realm[SLOT]=created,created}function markEverfurDailyRegistered(registered){televetGlobal().dailyRegistered=registered}function noticeReceipts(){let g=televetGlobal(),existing=g.noticeReceipts;if(existing!==void 0)return existing;let created=/* @__PURE__ */new Map;return g.noticeReceipts=created,created}function hasRecordingNoticeAccepted(roomUrl){return noticeReceipts().has(roomUrl)}function markTelevetCallJoined(roomUrl,joined){let held=noticeReceipts().get(roomUrl);held!==void 0&&(held.joined=joined)}var freezeInPlace=Object.freeze;function deepFreeze(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value)){freezeInPlace(value);for(let key of Object.keys(value))deepFreeze(value[key])}return value}var TEXT_SCALE_TIER_CAPS=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),SPACE={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},RADIUS={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},TYPE_SIZE={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},LINE_HEIGHT={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},WEIGHT={regular:"400",medium:"500",bold:"700"},LETTER_SPACING={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},DEFAULT_MAX_FONT_SCALE=0,SYSTEM_FONT_FAMILY="System",SYSTEM_MONO_FAMILY="monospace",TIERS=["content","heading","control","compact","badge"];function authoredTierSizes(size){let out={};for(let tier of TIERS)out[tier]=size;return out}var NO_FONT_SOURCES=[];function baseType(){return{family:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,fontUrl:null,families:{regular:SYSTEM_FONT_FAMILY,medium:SYSTEM_FONT_FAMILY,bold:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,monoMedium:SYSTEM_MONO_FAMILY,monoBold:SYSTEM_MONO_FAMILY},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:TYPE_SIZE,tierSizes:authoredTierSizes(TYPE_SIZE),lineHeight:LINE_HEIGHT,weight:WEIGHT,letterSpacing:LETTER_SPACING,scale:1,maxScale:DEFAULT_MAX_FONT_SCALE,scaleCaps:TEXT_SCALE_TIER_CAPS,headingFamily:null,headingWeight:null,fontSources:NO_FONT_SOURCES}}var NO_SLOTS={},EASING_CURVES=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(curve){return`cubic-bezier(${curve.join(", ")})`}var MOTION={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(EASING_CURVES.standard),emphasized:cssCubicBezier(EASING_CURVES.emphasized),exit:cssCubicBezier(EASING_CURVES.exit)},reducedMotion:false},LIGHT_COLOR={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},EVERFUR_LIGHT=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:LIGHT_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS}),DARK_COLOR={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:DARK_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS});var EVERFUR_THEME_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),globalThemeHost=globalThis,EverfurThemeContext=globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]??(globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]=createContext(EVERFUR_LIGHT));EverfurThemeContext.displayName??="EverfurThemeContext";function useEverfurTheme(){return useContext(EverfurThemeContext)}var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function tierScale(theme,tier){let{scale:scale,scaleCaps:scaleCaps}=theme.type,cap=scaleCaps[tier];return cap>0?Math.min(scale,cap):scale}function tierPx(theme,tier,points){return Math.round(points*tierScale(theme,tier)*10)/10}var SYSTEM_UI_STACK='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',RN_SYSTEM_FAMILY="System";function cssFontFamily(family){let named=family.trim();return named.length===0||named===RN_SYSTEM_FAMILY?SYSTEM_UI_STACK:`${quote(named)}, ${SYSTEM_UI_STACK}`}function cssMonoFamily(mono){let named=mono.trim();return named.length===0||named==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${quote(named)}, ui-monospace, Menlo, Consolas, monospace`}function quote(family){return`"${family.replace(/[\\"]/g,"\\$&")}"`}function faceCss(theme,weight){let type=theme.type,family=type.families[weight];return{fontFamily:weight==="mono"||weight==="monoMedium"||weight==="monoBold"?cssMonoFamily(family):cssFontFamily(family),fontWeight:type.namedFaces[weight]?type.weight.regular:type.weight[FACE_WEIGHT[weight]]}}var SURFACE_ROOT_RESET=/* @__PURE__ */Object.freeze({textAlign:"start"});var EVERFUR_DAILY_SETUP=`[everfur] The in-page vet call needs @daily-co/daily-js, which this app has not registered. Install it and call registerEverfurDaily(() => import('@daily-co/daily-js')) once in your app entry, before any Everfur call surface mounts. Until then the in-page visit tells the member the call cannot be joined; <VetVisitButton prefer="redirect" /> is the explicit way to the hosted visit in a new tab instead.`,DAILY_PEER="@daily-co/daily-js",NOT_REGISTERED=`optional peer '${DAILY_PEER}' has no registered loader`,WRONG_SHAPE=`optional peer '${DAILY_PEER}' is present but failed its shape check`;function isRecordLike(candidate){return typeof candidate=="object"&&candidate!==null}function normalizeDailyModule(candidate){let current=candidate;for(let depth=0;depth<3;depth+=1){if(isEverfurDailyModule(current))return current;if(!isRecordLike(current)||!("default"in current))return null;current=current.default}return null}function isEverfurDailyModule(candidate){return!isRecordLike(candidate)&&typeof candidate!="function"?false:typeof candidate.createFrame=="function"}var loader=null,memo=null;function unavailable(reason){/* @__PURE__ */
|
|
2
|
+
import{createContext,useMemo,useId,useState,useRef,useCallback,useEffect,useContext}from"react";import{jsx,Fragment,jsxs}from"react/jsx-runtime";var noopTelemetry=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});function isSafeRoomUrl(url){try{return new URL(url.trim()).protocol==="https:"}catch{return false}}function isUsableRoomCredential(roomUrl,token){return isSafeRoomUrl(roomUrl)&&token.trim().length>0}function reportHostFailure(error){let globalConsole=globalThis.console;try{globalConsole?.error?.("[everfur] A host callback threw; the SDK ignored it.",error)}catch{}}function isThenable(value){return(typeof value=="object"||typeof value=="function")&&value!==null&&typeof value.then=="function"}function callHost(fn,...args){if(typeof fn=="function")try{let result=fn(...args);return isThenable(result)&&Promise.resolve(result).then(void 0,reportHostFailure),result}catch(error){reportHostFailure(error);return}}var GUARDED=/* @__PURE__ */new WeakMap;function guardHost(fn){if(typeof fn!="function")return;let cached=GUARDED.get(fn);if(cached!==void 0)return cached;let guarded=(...args)=>{callHost(fn,...args)};return GUARDED.set(fn,guarded),guarded}function guardHostProps(props,names){let guarded=null;for(let name of names){let fn=props[name];typeof fn=="function"&&(guarded??={...props},guarded[name]=guardHost(fn))}return guarded??props}var VET_CALL_CONSULT_MINUTES=10,VET_CALL_COPY=/* @__PURE__ */Object.freeze({muteCta:"Mute",unmuteCta:"Unmute",cameraOffCta:"Camera off",cameraOnCta:"Camera on",leaveCta:"Leave",switchCameraCta:"Switch camera",speakerOffCta:"Speaker off",speakerOnCta:"Speaker on",lobbyTitleNoName:"Your vet is joining",lobbySubtitle:"",lobbyPrepLabel:"While you wait",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:clinicianName=>{let name=clinicianName?.trim()??"";return name.length>0?`${name} is joining`:VET_CALL_COPY.lobbyTitleNoName},lobbyPrep:petName=>{let pet=petName?.trim()??"";return pet.length>0?`Have ${pet} nearby and somewhere well lit.`:VET_CALL_COPY.lobbyPrepNoPet},lobbyDuration:minutes=>`${minutes} minutes`,waitingRoomLabel:"Waiting room",leaveWaitingRoomLabel:"Leave the waiting room",lobbyTipsTitle:clinicianName=>{let name=clinicianName?.trim()??"";return name.length>0?`Before ${name} joins`:VET_CALL_COPY.lobbyPrepLabel},lobbyTipSpot:"Find a bright, quiet spot.",joinFailedReason:"That did not open. Try again.",recordingNoticeTitle:"This consultation is recorded.",recordingNoticeCta:"Continue to the call",recordingNoticeDecline:"Not now",selfCameraOffLabel:"Your camera is off"});var SLOT=/* @__PURE__ */Symbol.for("@everfur/sdk/televet");function televetGlobal(){let realm=globalThis,existing=realm[SLOT];if(existing!==void 0)return existing;let created={presenter:null,snapshot:/* @__PURE__ */Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:/* @__PURE__ */new Set,dailyRegistered:false};return realm[SLOT]=created,created}function markEverfurDailyRegistered(registered){televetGlobal().dailyRegistered=registered}function noticeReceipts(){let g=televetGlobal(),existing=g.noticeReceipts;if(existing!==void 0)return existing;let created=/* @__PURE__ */new Map;return g.noticeReceipts=created,created}function hasRecordingNoticeAccepted(roomUrl){return noticeReceipts().has(roomUrl)}function markTelevetCallJoined(roomUrl,joined){let held=noticeReceipts().get(roomUrl);held!==void 0&&(held.joined=joined)}var freezeInPlace=Object.freeze;function deepFreeze(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value)){freezeInPlace(value);for(let key of Object.keys(value))deepFreeze(value[key])}return value}var TEXT_SCALE_TIER_CAPS=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),SPACE={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},RADIUS={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},TYPE_SIZE={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},LINE_HEIGHT={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},WEIGHT={regular:"400",medium:"500",bold:"700"},LETTER_SPACING={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},DEFAULT_MAX_FONT_SCALE=0,SYSTEM_FONT_FAMILY="System",SYSTEM_MONO_FAMILY="monospace",TIERS=["content","heading","control","compact","badge"];function authoredTierSizes(size){let out={};for(let tier of TIERS)out[tier]=size;return out}var NO_FONT_SOURCES=[];function baseType(){return{family:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,fontUrl:null,families:{regular:SYSTEM_FONT_FAMILY,medium:SYSTEM_FONT_FAMILY,bold:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,monoMedium:SYSTEM_MONO_FAMILY,monoBold:SYSTEM_MONO_FAMILY},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:TYPE_SIZE,tierSizes:authoredTierSizes(TYPE_SIZE),lineHeight:LINE_HEIGHT,weight:WEIGHT,letterSpacing:LETTER_SPACING,scale:1,maxScale:DEFAULT_MAX_FONT_SCALE,scaleCaps:TEXT_SCALE_TIER_CAPS,headingFamily:null,headingWeight:null,fontSources:NO_FONT_SOURCES}}var NO_SLOTS={},EASING_CURVES=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(curve){return`cubic-bezier(${curve.join(", ")})`}var MOTION={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(EASING_CURVES.standard),emphasized:cssCubicBezier(EASING_CURVES.emphasized),exit:cssCubicBezier(EASING_CURVES.exit)},reducedMotion:false},LIGHT_COLOR={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},EVERFUR_LIGHT=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:LIGHT_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS}),DARK_COLOR={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:DARK_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS});var EVERFUR_THEME_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),globalThemeHost=globalThis,EverfurThemeContext=globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]??(globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]=createContext(EVERFUR_LIGHT));EverfurThemeContext.displayName??="EverfurThemeContext";function useEverfurTheme(){return useContext(EverfurThemeContext)}var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function tierScale(theme,tier){let{scale:scale,scaleCaps:scaleCaps}=theme.type,cap=scaleCaps[tier];return cap>0?Math.min(scale,cap):scale}function tierPx(theme,tier,points){return Math.round(points*tierScale(theme,tier)*10)/10}var SYSTEM_UI_STACK='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',RN_SYSTEM_FAMILY="System";function cssFontFamily(family){let named=family.trim();return named.length===0||named===RN_SYSTEM_FAMILY?SYSTEM_UI_STACK:`${quote(named)}, ${SYSTEM_UI_STACK}`}function cssMonoFamily(mono){let named=mono.trim();return named.length===0||named==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${quote(named)}, ui-monospace, Menlo, Consolas, monospace`}function quote(family){return`"${family.replace(/[\\"]/g,"\\$&")}"`}function faceCss(theme,weight){let type=theme.type,family=type.families[weight];return{fontFamily:weight==="mono"||weight==="monoMedium"||weight==="monoBold"?cssMonoFamily(family):cssFontFamily(family),fontWeight:type.namedFaces[weight]?type.weight.regular:type.weight[FACE_WEIGHT[weight]]}}var SURFACE_ROOT_RESET=/* @__PURE__ */Object.freeze({textAlign:"start"});var EVERFUR_DAILY_SETUP=`[everfur] The in-page vet call needs @daily-co/daily-js, which this app has not registered. Install it and call registerEverfurDaily(() => import('@daily-co/daily-js')) once in your app entry, before any Everfur call surface mounts. Until then the in-page visit tells the member the call cannot be joined; <VetVisitButton prefer="redirect" /> is the explicit way to the hosted visit in a new tab instead.`,DAILY_PEER="@daily-co/daily-js",NOT_REGISTERED=`optional peer '${DAILY_PEER}' has no registered loader`,WRONG_SHAPE=`optional peer '${DAILY_PEER}' is present but failed its shape check`;function isRecordLike(candidate){return typeof candidate=="object"&&candidate!==null}function normalizeDailyModule(candidate){let current=candidate;for(let depth=0;depth<3;depth+=1){if(isEverfurDailyModule(current))return current;if(!isRecordLike(current)||!("default"in current))return null;current=current.default}return null}function isEverfurDailyModule(candidate){return!isRecordLike(candidate)&&typeof candidate!="function"?false:typeof candidate.createFrame=="function"}var loader=null,memo=null;function unavailable(reason){/* @__PURE__ */
|
|
3
3
|
return Object.freeze({available:false,module:null,reason:reason})}function registerEverfurDaily(next){loader=next,memo=null,markEverfurDailyRegistered(next!==null)}function loadEverfurDaily(){if(memo!==null)return memo;let load=loader;if(load===null)return Promise.resolve(unavailable(NOT_REGISTERED));let pending=(async()=>{let raw;try{raw=await load()}catch(cause){return unavailable(`optional peer '${DAILY_PEER}' is not installed: ${describe(cause)}`)}let module=normalizeDailyModule(raw);return module===null?unavailable(WRONG_SHAPE):/* @__PURE__ */Object.freeze({available:true,module:module})})();return memo=pending,pending}function describe(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"unknown load error"}function dailyErrorMessage(payload){if(!isRecordLike(payload)||!("errorMsg"in payload))return null;let message=payload.errorMsg;return typeof message=="string"&&message.length>0?message:null}var MIN_TOUCH_TARGET=44,FRAME_ASPECT="16 / 9",FRAME_RADIUS="16px",FRAME_MAX_HEIGHT="calc(100dvh - 8rem)",PREJOIN_STACKED_BELOW=480,PREJOIN_PORTRAIT_ASPECT="3 / 4",PREJOIN_STACKED_MIN_HEIGHT=500,PREJOIN_WIDE_MIN_HEIGHT=270,PREJOIN_WIDE_FLOOR_RATIO=.45;function frameSize(width,joining){if(!joining||width===null)return{aspectRatio:FRAME_ASPECT,maxHeight:FRAME_MAX_HEIGHT};if(width<PREJOIN_STACKED_BELOW)return{aspectRatio:PREJOIN_PORTRAIT_ASPECT,maxHeight:FRAME_MAX_HEIGHT,minHeight:PREJOIN_STACKED_MIN_HEIGHT};let floor=Math.max(PREJOIN_WIDE_MIN_HEIGHT,Math.ceil(width*PREJOIN_WIDE_FLOOR_RATIO));return{aspectRatio:FRAME_ASPECT,maxHeight:FRAME_MAX_HEIGHT,minHeight:floor}}var LEAVE_SETTLE_MS=5e3;function EverfurVetCall(props){let{roomUrl:roomUrl,token:token,onLeave:onLeave,displayName:displayName,daily:daily,telemetry:telemetry,onUnavailable:onUnavailable,renderUnavailable:renderUnavailable,style:style,className:className}=guardHostProps(props,["onLeave","onUnavailable"]),theme=useEverfurTheme(),styles=useMemo(()=>makeCallStyles(theme),[theme]),noticeId=`${useId()}-recording-notice`,[phase,setPhase]=useState("joining"),[unavailable2,setUnavailable]=useState(null),[module,setModule]=useState(null),[acknowledged,setAcknowledged]=useState(false),[leaving,setLeaving]=useState(false),[frameWidth,setFrameWidth]=useState(null),containerRef=useRef(null),frameRef=useRef(null),leftRef=useRef(false),leavingRef=useRef(false),leavingCallRef=useRef(null),generationRef=useRef(0),hostRef=useRef({onLeave:onLeave,onUnavailable:onUnavailable,daily:daily,telemetry:telemetry});hostRef.current={onLeave:onLeave,onUnavailable:onUnavailable,daily:daily,telemetry:telemetry};let reportLeave=useCallback(()=>{leftRef.current||(leftRef.current=true,callHost(hostRef.current.onLeave))},[]);useEffect(()=>()=>{generationRef.current+=1},[]),useEffect(()=>{let cancelled=false;setModule(null),generationRef.current+=1,leftRef.current=false,leavingRef.current=false,setLeaving(false),setPhase("joining"),setAcknowledged(hasRecordingNoticeAccepted(roomUrl));let refuse=(reason,detail)=>{cancelled||(setUnavailable({reason:reason,detail:detail}),callHost(hostRef.current.onUnavailable,reason,detail))};if(!isUsableRoomCredential(roomUrl,token)){refuse("roomUnusable","the call needs an https room URL and a non-empty join token");return}let injected=hostRef.current.daily;return injected!==void 0?(setModule(()=>injected),()=>{cancelled=true}):(loadEverfurDaily().then(loaded=>{if(!cancelled){if(!loaded.available){warnOnce(EVERFUR_DAILY_SETUP),refuse("dailyMissing",loaded.reason);return}setModule(()=>loaded.module)}}),()=>{cancelled=true})},[roomUrl,token]),useEffect(()=>{if(module===null||!acknowledged)return;let cancelled=false,frame=null,attached=[],refuse=(reason,detail)=>{cancelled||(setUnavailable({reason:reason,detail:detail}),callHost(hostRef.current.onUnavailable,reason,detail))};return(async()=>{let container=containerRef.current;if(!container)return;let sink=hostRef.current.telemetry??noopTelemetry;try{frame=module.createFrame(container,{showLeaveButton:!0,showFullscreenButton:!1,showUserNameChangeUI:!1,iframeStyle:{width:"100%",height:"100%",border:"0",borderRadius:FRAME_RADIUS}})}catch(cause){refuse("dailyMissing",`createFrame failed: ${describe2(cause)}`);return}frameRef.current=frame;let attach=(event,handler)=>{attached.push({event:event,handler:handler}),frame?.on(event,handler)};attach("joined-meeting",()=>{cancelled||frame===null||leavingRef.current||(setPhase("joined"),markTelevetCallJoined(roomUrl,true))}),attach("left-meeting",()=>{cancelled||(markTelevetCallJoined(roomUrl,false),setPhase("left"),reportLeave())}),attach("error",payload=>{cancelled||(markTelevetCallJoined(roomUrl,false),setPhase("error"),sink.trackExpectedFailure("televet.call.join_failed",{provider:"daily",detail:dailyErrorMessage(payload)??"unknown"}))});try{if(await frame.join({url:roomUrl,token:token,userName:displayName}),cancelled)return;sink.track("televet.call.joined",{provider:"daily"})}catch(cause){if(cancelled)return;markTelevetCallJoined(roomUrl,false),setPhase("error"),sink.trackExpectedFailure("televet.call.join_failed",{provider:"daily",detail:describe2(cause)})}})(),()=>{cancelled=true,markTelevetCallJoined(roomUrl,false);for(let{event:event,handler:handler}of attached)try{frame?.off(event,handler)}catch{}let call=frameRef.current;frameRef.current=null,call?.destroy().catch(()=>{});let pending=leavingCallRef.current;pending!==null&&(pending.abandoned=true),releaseAbandoned(pending)}},[module,acknowledged,roomUrl,token,displayName,reportLeave]);let framed=module!==null&&acknowledged&&unavailable2===null&&phase!=="left";useEffect(()=>{let node=containerRef.current;if(!framed||node===null||typeof ResizeObserver>"u")return;let read=()=>{setFrameWidth(node.offsetWidth>0?node.offsetWidth:null)};read();let observer=new ResizeObserver(read);return observer.observe(node),()=>observer.disconnect()},[framed]),useEffect(()=>{if(phase!=="left")return;let call=frameRef.current;frameRef.current=null,call?.destroy().catch(()=>{}),releaseAbandoned(leavingCallRef.current)},[phase]);let leave=useCallback(()=>{if(leavingRef.current)return;leavingRef.current=true;let generation=generationRef.current,call=frameRef.current;if(frameRef.current=null,markTelevetCallJoined(roomUrl,false),!call){setPhase("left"),reportLeave();return}setLeaving(true);let pending={call:call,settled:false,abandoned:false};leavingCallRef.current=pending,settleWithin(teardown(call).then(()=>{pending.settled=true}),LEAVE_SETTLE_MS).then(timedOut=>{timedOut&&(pending.abandoned=true),generationRef.current===generation&&(setPhase("left"),reportLeave())})},[reportLeave,roomUrl]);return unavailable2!==null?renderUnavailable?/* @__PURE__ */jsx(Fragment,{children:renderUnavailable(unavailable2.reason,unavailable2.detail)}):null:module===null?null:acknowledged?/* @__PURE__ */jsxs("div",{className:className,"data-testid":"everfur-vet-call",style:{...styles.root,...style},children:[phase==="left"?null:/* @__PURE__ */jsx("div",{ref:containerRef,"data-testid":"everfur-vet-call-frame",style:{...styles.frame,...frameSize(frameWidth,phase==="joining"),...phase==="error"?styles.frameHidden:null}}),phase==="joining"?
|
|
4
4
|
/* @__PURE__ */jsx("button",{type:"button",onClick:leave,disabled:leaving,"aria-busy":leaving||void 0,"data-testid":"everfur-vet-call-joining-leave",style:{...styles.failedLeave,...styles.joiningLeave,...leaving?styles.leaveHeld:null},children:VET_CALL_COPY.leaveCta}):null,phase==="error"?
|
|
5
5
|
/* @__PURE__ */jsxs("div",{role:"alert","data-testid":"everfur-vet-call-failed",style:styles.failed,children:[
|
|
@@ -17,12 +17,10 @@ return jsxs("section",{className:className,"data-testid":"everfur-vet-call-lobby
|
|
|
17
17
|
/* @__PURE__ */jsxs("div",{"aria-hidden":"true","data-testid":"everfur-vet-call-lobby-avatar",style:styles.avatar,children:[
|
|
18
18
|
/* @__PURE__ */jsx("span",{style:styles.avatarHead}),
|
|
19
19
|
/* @__PURE__ */jsx("span",{style:styles.avatarBody})]}),
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */jsx("p",{"data-testid":"everfur-vet-call-lobby-title",style:styles.title,children:title}),
|
|
22
|
-
/* @__PURE__ */jsx("p",{style:styles.subtitle,children:VET_CALL_COPY.lobbySubtitle})]}),
|
|
20
|
+
/* @__PURE__ */jsx("div",{"aria-live":"polite",style:styles.titleBlock,children:/* @__PURE__ */jsx("p",{"data-testid":"everfur-vet-call-lobby-title",style:styles.title,children:title})}),
|
|
23
21
|
/* @__PURE__ */jsx(WaitingDots,{theme:theme})]}),
|
|
24
22
|
/* @__PURE__ */jsxs("div",{"data-testid":"everfur-vet-call-lobby-prep",style:styles.prepCard,children:[
|
|
25
23
|
/* @__PURE__ */jsx("p",{style:styles.prepLabel,children:VET_CALL_COPY.lobbyTipsTitle(clinicianName)}),
|
|
26
24
|
/* @__PURE__ */jsx("ol",{style:styles.tips,children:[VET_CALL_COPY.lobbyTipSpot,prep].map((tip,i)=>/* @__PURE__ */jsxs("li",{style:styles.tip,children:[
|
|
27
25
|
/* @__PURE__ */jsx("span",{"aria-hidden":"true",style:styles.tipNumber,children:String(i+1).padStart(2,"0")}),
|
|
28
|
-
/* @__PURE__ */jsx("span",{style:styles.prepBody,children:tip})]},tip))})]}),minutes===null?null:/* @__PURE__ */jsx("p",{"data-testid":"everfur-vet-call-lobby-duration",style:styles.duration,children:VET_CALL_COPY.lobbyDuration(minutes)})]})}function makeLobbyStyles(theme){let{space:space,radius:radius,type:type}=theme,look=televetPlainLook(theme),avatarSize=112;return{root:{...SURFACE_ROOT_RESET,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:space.lg,padding:space.xl,borderRadius:radius.lg,borderStyle:"solid",borderWidth:1,borderColor:look.line,backgroundColor:look.surface,color:look.text},topRow:{display:"flex",alignItems:"center",gap:14},leave:{minHeight:MIN_TOUCH_TARGET2,padding:`0 ${space.lg}px`,margin:0,borderRadius:radius.pill,borderStyle:"solid",borderWidth:1.5,borderColor:look.line,background:look.surface,color:look.ink,cursor:"pointer",...faceCss(theme,"bold"),fontSize:type.size.bodyTight},label:{margin:0,...faceCss(theme,"monoBold"),color:look.muted,fontSize:12,letterSpacing:"0.08em",textTransform:"uppercase"},center:{display:"flex",flexDirection:"column",alignItems:"center",gap:space.md},avatar:{position:"relative",width:avatarSize,height:avatarSize,borderRadius:radius.pill,overflow:"hidden",backgroundColor:look.mist,boxShadow:`0 0 0 4px ${look.surface}, 0 0 0 6px ${look.go}`,display:"flex",alignItems:"center",justifyContent:"center"},avatarHead:{position:"absolute",top:avatarSize*.24,width:avatarSize*.28,height:avatarSize*.28,borderRadius:radius.pill,backgroundColor:look.ink,opacity:.35},avatarBody:{position:"absolute",top:avatarSize*.58,width:avatarSize*.52,height:avatarSize*.34,borderTopLeftRadius:avatarSize*.26,borderTopRightRadius:avatarSize*.26,backgroundColor:look.ink,opacity:.35},titleBlock:{textAlign:"center"},title:{margin:0,...faceCss(theme,"medium"),fontSize:tierPx(theme,"heading",28),lineHeight:1.15,letterSpacing:"-0.02em",color:look.ink},
|
|
26
|
+
/* @__PURE__ */jsx("span",{style:styles.prepBody,children:tip})]},tip))})]}),minutes===null?null:/* @__PURE__ */jsx("p",{"data-testid":"everfur-vet-call-lobby-duration",style:styles.duration,children:VET_CALL_COPY.lobbyDuration(minutes)})]})}function makeLobbyStyles(theme){let{space:space,radius:radius,type:type}=theme,look=televetPlainLook(theme),avatarSize=112;return{root:{...SURFACE_ROOT_RESET,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:space.lg,padding:space.xl,borderRadius:radius.lg,borderStyle:"solid",borderWidth:1,borderColor:look.line,backgroundColor:look.surface,color:look.text},topRow:{display:"flex",alignItems:"center",gap:14},leave:{minHeight:MIN_TOUCH_TARGET2,padding:`0 ${space.lg}px`,margin:0,borderRadius:radius.pill,borderStyle:"solid",borderWidth:1.5,borderColor:look.line,background:look.surface,color:look.ink,cursor:"pointer",...faceCss(theme,"bold"),fontSize:type.size.bodyTight},label:{margin:0,...faceCss(theme,"monoBold"),color:look.muted,fontSize:12,letterSpacing:"0.08em",textTransform:"uppercase"},center:{display:"flex",flexDirection:"column",alignItems:"center",gap:space.md},avatar:{position:"relative",width:avatarSize,height:avatarSize,borderRadius:radius.pill,overflow:"hidden",backgroundColor:look.mist,boxShadow:`0 0 0 4px ${look.surface}, 0 0 0 6px ${look.go}`,display:"flex",alignItems:"center",justifyContent:"center"},avatarHead:{position:"absolute",top:avatarSize*.24,width:avatarSize*.28,height:avatarSize*.28,borderRadius:radius.pill,backgroundColor:look.ink,opacity:.35},avatarBody:{position:"absolute",top:avatarSize*.58,width:avatarSize*.52,height:avatarSize*.34,borderTopLeftRadius:avatarSize*.26,borderTopRightRadius:avatarSize*.26,backgroundColor:look.ink,opacity:.35},titleBlock:{textAlign:"center"},title:{margin:0,...faceCss(theme,"medium"),fontSize:tierPx(theme,"heading",28),lineHeight:1.15,letterSpacing:"-0.02em",color:look.ink},prepCard:{display:"flex",flexDirection:"column",gap:space.sm,padding:space.lg,borderRadius:radius.lg,borderStyle:"solid",borderWidth:1,borderColor:look.line},prepLabel:{margin:0,...faceCss(theme,"bold"),fontSize:19,color:look.ink},tips:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"},tip:{display:"grid",gridTemplateColumns:"44px 1fr",gap:10,paddingTop:12,paddingBottom:12,borderTop:`1px solid ${look.line}`},tipNumber:{...faceCss(theme,"monoBold"),color:look.ink,fontSize:13,paddingTop:2},prepBody:{margin:0,...faceCss(theme,"regular"),fontSize:type.size.body,lineHeight:1.5,color:look.text},duration:{margin:0,textAlign:"center",...faceCss(theme,"regular"),fontSize:type.size.bodyTight,color:look.muted}}}export{EVERFUR_DAILY_SETUP,EverfurVetCall,EverfurVetCallLobby,VET_CALL_CONSULT_MINUTES,VET_CALL_COPY,isEverfurDailyModule,isSafeRoomUrl,isUsableRoomCredential,loadEverfurDaily,registerEverfurDaily};
|