@everfur/sdk 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/CHANGELOG.md +251 -4
  2. package/README.md +9 -3
  3. package/dist/{Chat-DwAC2vhB.d.ts → Chat-BOX-03ho.d.ts} +17 -3
  4. package/dist/{Chat-DPUD6dnc.d.cts → Chat-TA-aTcVF.d.cts} +17 -3
  5. package/dist/{DepthViews-DP0R-DhB.d.cts → DepthViews-CgjX2AJ5.d.ts} +1 -1
  6. package/dist/{DepthViews-DbFhR4Du.d.cts → DepthViews-Cviea-ri.d.cts} +1 -1
  7. package/dist/{DepthViews-DNEM96Se.d.ts → DepthViews-D2dRqWRq.d.ts} +1 -1
  8. package/dist/{DepthViews-D_3hl4xk.d.ts → DepthViews-DSFyaSeL.d.cts} +1 -1
  9. package/dist/{ErrorPolicyPort-CwbfmxzJ.d.ts → ErrorPolicyPort-D22LUVrK.d.ts} +1 -1
  10. package/dist/{ErrorPolicyPort-CNf4uQZP.d.cts → ErrorPolicyPort-D6CybiqJ.d.cts} +1 -1
  11. package/dist/{EverfurResult-DN9pL2Ab.d.cts → EverfurError-DmELDpXp.d.cts} +1 -67
  12. package/dist/{EverfurResult-DN9pL2Ab.d.ts → EverfurError-DmELDpXp.d.ts} +1 -67
  13. package/dist/EverfurResult-SGvHKsCB.d.ts +69 -0
  14. package/dist/EverfurResult-ZtH-YV1h.d.cts +69 -0
  15. package/dist/animations/index.cjs +1 -1
  16. package/dist/animations/index.d.cts +6 -5
  17. package/dist/animations/index.d.ts +6 -5
  18. package/dist/animations/index.js +1 -1
  19. package/dist/{attachments-5NeobOCd.d.ts → attachments-C_vtFu2f.d.ts} +7 -5
  20. package/dist/{attachments-D8T5re7e.d.cts → attachments-DHvnITuE.d.cts} +7 -5
  21. package/dist/{attachments-Bw3iMQgu.d.ts → attachments-oD5U2fXI.d.ts} +3 -3
  22. package/dist/{attachments-CQgFrEQ7.d.cts → attachments-pIdGOQfm.d.cts} +3 -3
  23. package/dist/bookingCopy-CJir9mjb.d.ts +1135 -0
  24. package/dist/bookingCopy-DfuA13dh.d.cts +1135 -0
  25. package/dist/branding-Xb_wL8N1.d.cts +212 -0
  26. package/dist/branding-xpQ056sM.d.ts +212 -0
  27. package/dist/callCopy-rDH9JTFo.d.cts +45 -0
  28. package/dist/callCopy-rDH9JTFo.d.ts +45 -0
  29. package/dist/callRoom-7wrE3RP2.d.ts +62 -0
  30. package/dist/callRoom-B_EqaUzx.d.cts +62 -0
  31. package/dist/casesRepository-B-Eg8ZJ3.d.cts +63 -0
  32. package/dist/casesRepository-DHgIYKN9.d.ts +63 -0
  33. package/dist/chat/index.cjs +1 -1
  34. package/dist/chat/index.d.cts +12 -10
  35. package/dist/chat/index.d.ts +12 -10
  36. package/dist/chat/index.js +1 -1
  37. package/dist/client/index.cjs +5 -5
  38. package/dist/client/index.d.cts +15 -11
  39. package/dist/client/index.d.ts +15 -11
  40. package/dist/client/index.js +5 -5
  41. package/dist/{config-CzTZGlfF.d.cts → config-ClI7QxB0.d.ts} +4 -3
  42. package/dist/{config-DW60uRb9.d.ts → config-DAFbf721.d.cts} +4 -3
  43. package/dist/consent/index.cjs +1 -1
  44. package/dist/consent/index.d.cts +9 -8
  45. package/dist/consent/index.d.ts +9 -8
  46. package/dist/consent/index.js +1 -1
  47. package/dist/{context-XvTzq1tE.d.cts → context-B-dUM1Qf.d.cts} +9 -8
  48. package/dist/{context-DXhqHlPU.d.ts → context-CZbgF_OH.d.ts} +9 -8
  49. package/dist/{copy-Mjoo91aS.d.ts → copy-CeRH3NXy.d.ts} +5 -4
  50. package/dist/{copy-bKDNigLb.d.cts → copy-CneuYdrO.d.cts} +5 -4
  51. package/dist/core/index.cjs +9 -9
  52. package/dist/core/index.d.cts +123 -32
  53. package/dist/core/index.d.ts +123 -32
  54. package/dist/core/index.js +9 -9
  55. package/dist/{depth-CErXCU8J.d.cts → depth-B3NFKlF9.d.cts} +38 -6
  56. package/dist/{depth-DjDcJ6kH.d.ts → depth-DO3Ko_qs.d.ts} +38 -6
  57. package/dist/entitlementRepository-74kW5mK0.d.ts +43 -0
  58. package/dist/entitlementRepository-m6zLUmiB.d.cts +43 -0
  59. package/dist/{identity-DI4eVx9S.d.cts → identity-C7uxGwfT.d.cts} +3 -3
  60. package/dist/{identity-BMx2SUOM.d.ts → identity-CLAUq-K4.d.ts} +3 -3
  61. package/dist/index.cjs +6 -6
  62. package/dist/index.d.cts +20 -17
  63. package/dist/index.d.ts +20 -17
  64. package/dist/index.js +6 -6
  65. package/dist/{models-D2EUxPZY.d.cts → models-Bn2z0NNo.d.cts} +1 -1
  66. package/dist/{models-B-Uh2LTf.d.ts → models-DSqA5Ahs.d.ts} +1 -1
  67. package/dist/notifications/index.cjs +2 -2
  68. package/dist/notifications/index.d.cts +5 -4
  69. package/dist/notifications/index.d.ts +5 -4
  70. package/dist/notifications/index.js +2 -2
  71. package/dist/optionalModule-DbJmsq5f.d.cts +21 -0
  72. package/dist/optionalModule-DbJmsq5f.d.ts +21 -0
  73. package/dist/{pets-aB8q0JyX.d.cts → pets-BoB5B7kp.d.cts} +2 -2
  74. package/dist/{pets-CtQdRpWo.d.ts → pets-w4M9d-Dn.d.ts} +2 -2
  75. package/dist/{casesRepository-ClLv6qMl.d.ts → petsRepository-BjKJ8UsN.d.ts} +3 -49
  76. package/dist/{casesRepository-DHwtGRYY.d.cts → petsRepository-DZZoEG3r.d.cts} +3 -49
  77. package/dist/photo/index.cjs +1 -1
  78. package/dist/photo/index.d.cts +3 -2
  79. package/dist/photo/index.d.ts +3 -2
  80. package/dist/photo/index.js +1 -1
  81. package/dist/{ports-DMolTRzU.d.ts → ports-BO3bzTJg.d.ts} +14 -17
  82. package/dist/{ports-DEBzEhbp.d.cts → ports-C2EVK416.d.cts} +14 -17
  83. package/dist/records/depth/index.cjs +2 -2
  84. package/dist/records/depth/index.d.cts +11 -10
  85. package/dist/records/depth/index.d.ts +11 -10
  86. package/dist/records/depth/index.js +2 -2
  87. package/dist/records/index.cjs +3 -3
  88. package/dist/records/index.d.cts +25 -14
  89. package/dist/records/index.d.ts +25 -14
  90. package/dist/records/index.js +3 -3
  91. package/dist/{requestFunnel-CjW7uDuA.d.ts → requestFunnel-D7ipek3e.d.ts} +28 -4
  92. package/dist/{requestFunnel-L-BQfi0z.d.cts → requestFunnel-Djjwgoe9.d.cts} +28 -4
  93. package/dist/{runtime-BR9ysG0J.d.ts → runtimeTypes-CTL3yToK.d.ts} +10 -100
  94. package/dist/{runtime-B8s-_hv8.d.cts → runtimeTypes-D2C9uD85.d.cts} +10 -100
  95. package/dist/server/events/index.cjs +1 -1
  96. package/dist/server/events/index.d.cts +4 -3
  97. package/dist/server/events/index.d.ts +4 -3
  98. package/dist/server/events/index.js +1 -1
  99. package/dist/server/index.cjs +1 -1
  100. package/dist/server/index.d.cts +5 -4
  101. package/dist/server/index.d.ts +5 -4
  102. package/dist/server/index.js +1 -1
  103. package/dist/televet/booking/index.cjs +1 -0
  104. package/dist/televet/booking/index.d.cts +566 -0
  105. package/dist/televet/booking/index.d.ts +566 -0
  106. package/dist/televet/booking/index.js +1 -0
  107. package/dist/televet/call/index.cjs +1 -0
  108. package/dist/televet/call/index.d.cts +161 -0
  109. package/dist/televet/call/index.d.ts +161 -0
  110. package/dist/televet/call/index.js +1 -0
  111. package/dist/televet/index.cjs +1 -1
  112. package/dist/televet/index.d.cts +64 -12
  113. package/dist/televet/index.d.ts +64 -12
  114. package/dist/televet/index.js +1 -1
  115. package/dist/televetGlobal-CEk0_cW9.d.cts +34 -0
  116. package/dist/televetGlobal-Cs9Wbqsy.d.ts +34 -0
  117. package/dist/testing/index.cjs +4 -4
  118. package/dist/testing/index.d.cts +4 -3
  119. package/dist/testing/index.d.ts +4 -3
  120. package/dist/testing/index.js +4 -4
  121. package/dist/testing/rn/index.cjs +1 -1
  122. package/dist/testing/rn/index.d.cts +13 -10
  123. package/dist/testing/rn/index.d.ts +13 -10
  124. package/dist/testing/rn/index.js +1 -1
  125. package/dist/testing/web/index.cjs +1 -1
  126. package/dist/testing/web/index.d.cts +14 -12
  127. package/dist/testing/web/index.d.ts +14 -12
  128. package/dist/testing/web/index.js +1 -1
  129. package/dist/{timelineRows-DZed6dAM.d.ts → timelineRows-7yFNK_rU.d.ts} +1 -1
  130. package/dist/{timelineRows-CaohZzXS.d.cts → timelineRows-CzR1T2DR.d.cts} +1 -1
  131. package/dist/tokens-CIngRkvt.d.cts +362 -0
  132. package/dist/tokens-CIngRkvt.d.ts +362 -0
  133. package/dist/typeStyle-DHJzDaUo.d.cts +112 -0
  134. package/dist/typeStyle-YPS_MXeI.d.ts +112 -0
  135. package/dist/{useRecordsDepth-BHBzJ76R.d.cts → useRecordsDepth-Bnw36jPr.d.cts} +24 -5
  136. package/dist/{useRecordsDepth-BU-OhzH6.d.ts → useRecordsDepth-DFF7Faxx.d.ts} +24 -5
  137. package/dist/{useVetVisit-CjmMa896.d.ts → useVetVisit-BsjoDO-n.d.ts} +21 -6
  138. package/dist/{useVetVisit-Bc84hWUU.d.cts → useVetVisit-Ds8f1peV.d.cts} +21 -6
  139. package/dist/video/index.cjs +1 -1
  140. package/dist/video/index.d.cts +3 -2
  141. package/dist/video/index.d.ts +3 -2
  142. package/dist/video/index.js +1 -1
  143. package/dist/{view-DtSPYpKa.d.ts → view-BqcOYFTr.d.ts} +5 -4
  144. package/dist/{view-C3qPIXGX.d.cts → view-CaJs8WFH.d.cts} +5 -4
  145. package/dist/web/consent/index.cjs +1 -1
  146. package/dist/web/consent/index.d.cts +9 -8
  147. package/dist/web/consent/index.d.ts +9 -8
  148. package/dist/web/consent/index.js +1 -1
  149. package/dist/web/index.cjs +10 -10
  150. package/dist/web/index.d.cts +43 -19
  151. package/dist/web/index.d.ts +43 -19
  152. package/dist/web/index.js +10 -10
  153. package/dist/web/notifications/index.cjs +2 -2
  154. package/dist/web/notifications/index.d.cts +7 -6
  155. package/dist/web/notifications/index.d.ts +7 -6
  156. package/dist/web/notifications/index.js +2 -2
  157. package/dist/web/records/depth/index.cjs +2 -2
  158. package/dist/web/records/depth/index.d.cts +11 -10
  159. package/dist/web/records/depth/index.d.ts +11 -10
  160. package/dist/web/records/depth/index.js +2 -2
  161. package/dist/web/records/index.cjs +3 -3
  162. package/dist/web/records/index.d.cts +123 -14
  163. package/dist/web/records/index.d.ts +123 -14
  164. package/dist/web/records/index.js +3 -3
  165. package/dist/web/televet/booking/index.cjs +2 -0
  166. package/dist/web/televet/booking/index.d.cts +770 -0
  167. package/dist/web/televet/booking/index.d.ts +770 -0
  168. package/dist/web/televet/booking/index.js +2 -0
  169. package/dist/web/televet/call/index.cjs +1 -0
  170. package/dist/web/televet/call/index.d.cts +144 -0
  171. package/dist/web/televet/call/index.d.ts +144 -0
  172. package/dist/web/televet/call/index.js +1 -0
  173. package/dist/web/televet/index.cjs +1 -1
  174. package/dist/web/televet/index.d.cts +61 -9
  175. package/dist/web/televet/index.d.ts +61 -9
  176. package/dist/web/televet/index.js +1 -1
  177. package/package.json +74 -5
  178. package/televet/booking/package.json +8 -0
  179. package/televet/call/package.json +8 -0
  180. package/web/televet/booking/native-blocked.cjs +12 -0
  181. package/web/televet/booking/package.json +8 -0
  182. package/web/televet/call/native-blocked.cjs +12 -0
  183. package/web/televet/call/package.json +8 -0
  184. package/dist/entitlementRepository-DKdXFgTo.d.cts +0 -698
  185. package/dist/entitlementRepository-DSbzuyAW.d.ts +0 -698
  186. package/dist/typeStyle-0TydiZ1w.d.cts +0 -19
  187. package/dist/typeStyle-CWMsoe6b.d.ts +0 -19
@@ -0,0 +1,161 @@
1
+ import { ComponentType, ReactNode } from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ import { T as TelemetryPort } from '../../TelemetryPort-BDNr00hu.cjs';
4
+ import { O as OptionalModule } from '../../optionalModule-DbJmsq5f.cjs';
5
+ export { V as VetCallPhase, i as isSafeRoomUrl, a as isUsableRoomCredential } from '../../callRoom-B_EqaUzx.cjs';
6
+ export { V as VET_CALL_CONSULT_MINUTES, a as VET_CALL_COPY } from '../../callCopy-rDH9JTFo.cjs';
7
+ import '../../EverfurError-DmELDpXp.cjs';
8
+
9
+ /**
10
+ * A participant's media track. Daily types this `MediaStreamTrack | false | null`: `false` means the track
11
+ * is off, which renders the same as absent. The SDK never reads inside it, so it stays opaque.
12
+ */
13
+ type VetCallTrack = unknown;
14
+ /** One participant in the room, narrowed to what the call surface reads. */
15
+ interface VetCallParticipant {
16
+ readonly local: boolean;
17
+ readonly videoTrack?: VetCallTrack;
18
+ readonly audioTrack?: VetCallTrack;
19
+ }
20
+ /** The Daily events the call surface subscribes to. */
21
+ type VetCallEvent = 'participant-joined' | 'participant-updated' | 'participant-left' | 'left-meeting' | 'error';
22
+ type VetCallHandler = (...args: readonly unknown[]) => void;
23
+ /**
24
+ * The Daily call object, narrowed to the members the call surface actually calls. Narrow on purpose: the SDK
25
+ * never asks for host powers. `is_owner` is the CLINICIAN's and the server decides it when it mints the token;
26
+ * it starts recording and grants admit/eject, and nothing here requests either.
27
+ *
28
+ * THE LAST TWO ARE OPTIONAL, and a control is drawn only when its method is there: `cycleCamera` is the front
29
+ * and back flip and `setNativeInCallAudioMode` the loudspeaker and earpiece routes, both of which the consumer
30
+ * app calls on the same native module (TelevetCallScreen.tsx:559-581). A module version without them keeps
31
+ * the call working and simply offers fewer controls, rather than failing its shape check.
32
+ */
33
+ interface VetCallObject {
34
+ join(options: {
35
+ readonly url: string;
36
+ readonly token: string;
37
+ }): Promise<unknown>;
38
+ leave(): Promise<unknown>;
39
+ destroy(): Promise<unknown>;
40
+ participants(): Record<string, VetCallParticipant>;
41
+ setLocalAudio(enabled: boolean): unknown;
42
+ setLocalVideo(enabled: boolean): unknown;
43
+ on(event: VetCallEvent, handler: VetCallHandler): unknown;
44
+ off(event: VetCallEvent, handler: VetCallHandler): unknown;
45
+ /** The front/back flip. Resolves with the facing mode it landed on (`device.facingMode`). */
46
+ cycleCamera?(): Promise<{
47
+ readonly device?: {
48
+ readonly facingMode?: string;
49
+ } | null;
50
+ } | null | undefined>;
51
+ /** `'video'` routes the call to the loudspeaker (Daily's default), `'voice'` to the earpiece. */
52
+ setNativeInCallAudioMode?(mode: 'video' | 'voice'): unknown;
53
+ }
54
+ /** The props the call surface renders `DailyMediaView` with. */
55
+ interface VetCallMediaViewProps {
56
+ readonly videoTrack: VetCallTrack;
57
+ readonly audioTrack: VetCallTrack;
58
+ readonly mirror?: boolean;
59
+ readonly objectFit?: 'cover' | 'contain';
60
+ readonly style?: unknown;
61
+ }
62
+ /** The shape of `@daily-co/react-native-daily-js` this package uses, and nothing else. */
63
+ interface EverfurDailyModule {
64
+ createCallObject(): VetCallObject;
65
+ readonly DailyMediaView: ComponentType<VetCallMediaViewProps>;
66
+ }
67
+ /** The thunk a partner registers. Typically `() => require('@daily-co/react-native-daily-js')`. */
68
+ type EverfurDailyLoader = () => unknown;
69
+ /**
70
+ * DEVELOPER-FACING, never rendered to a member. It is handed to `onUnavailable` and written to
71
+ * `console.warn` once, so a partner who mounts the call surface without the native peer reads what to do
72
+ * instead of watching a blank screen. End-user copy is never authored in this repository.
73
+ */
74
+ declare const EVERFUR_DAILY_SETUP: string;
75
+ /** A present-but-wrong-shape module (a version whose surface drifted) is treated as unavailable, not trusted. */
76
+ declare function isEverfurDailyModule(candidate: unknown): candidate is EverfurDailyModule;
77
+ /**
78
+ * Register the Daily native module for the in-app vet call. Call it ONCE, in your app entry, before any
79
+ * Everfur call surface mounts:
80
+ *
81
+ * ```ts
82
+ * import { registerEverfurDaily } from '@everfur/sdk/televet';
83
+ * registerEverfurDaily(() => require('@daily-co/react-native-daily-js'));
84
+ * ```
85
+ *
86
+ * Passing `null` unregisters it, which is what a test does between cases. Registering clears the memo, so a
87
+ * later registration always wins over an earlier failed load.
88
+ */
89
+ declare function registerEverfurDaily(next: EverfurDailyLoader | null): void;
90
+ /**
91
+ * The guarded load: a missing loader, a throwing loader and a wrong-shape module all settle to
92
+ * `{ available: false }`. NEVER throws, and never returns a partially usable module.
93
+ *
94
+ * Memoized, because the call surface asks on every render and a `require` on every render of a live video
95
+ * screen is work on the path that can least afford it.
96
+ */
97
+ declare function loadEverfurDaily(): OptionalModule<EverfurDailyModule>;
98
+
99
+ /** Why the call surface refused to render. Both values are DEVELOPER-facing, never shown to a member. */
100
+ type VetCallUnavailableReason = 'dailyMissing' | 'roomUnusable';
101
+ interface EverfurVetCallProps {
102
+ /** The `room_url` the server minted for this consult. Must be https; anything else is refused. */
103
+ readonly roomUrl: string;
104
+ /** The short-lived, per-participant join token. NEVER rendered, NEVER logged, NEVER a telemetry prop. */
105
+ readonly token: string;
106
+ /** Called once the member has left, so the host can pop the screen. */
107
+ readonly onLeave: () => void;
108
+ /** Shown in the lobby while the clinician has not joined. Null in production today; never invented. */
109
+ readonly clinicianName?: string | null | undefined;
110
+ /** The pet's display name for the lobby's prep line; absent, the pet-free form is used. */
111
+ readonly petName?: string | null | undefined;
112
+ /**
113
+ * Host/test seam: the Daily module, instead of the one `registerEverfurDaily` registered. A partner with
114
+ * its own module resolution passes it here and calls no register function at all.
115
+ */
116
+ readonly daily?: EverfurDailyModule | undefined;
117
+ /** Your analytics sink for the two call events. Defaults to a no-op; never receives a credential. */
118
+ readonly telemetry?: TelemetryPort | undefined;
119
+ /**
120
+ * Called instead of rendering when the call cannot run, with a developer-facing explanation. `dailyMissing`
121
+ * means the native modules are not registered; `roomUnusable` means the credential failed its floor.
122
+ */
123
+ readonly onUnavailable?: ((reason: VetCallUnavailableReason, detail: string) => void) | undefined;
124
+ /**
125
+ * What to draw when the call cannot run. THE SDK DRAWS NOTHING BY DEFAULT, and that is deliberate: there is
126
+ * no owner-approved member-facing sentence for "this app was built without the video modules", and this
127
+ * package does not author user-facing copy. The consumer app's own answer to a missing native module is to
128
+ * fall back to the browser (`televetJoin.ts`: "an owner on an old build still gets into the consult, in a
129
+ * browser, instead of a crash"), so the intended wiring here is the same:
130
+ *
131
+ * ```tsx
132
+ * <VetCall ... renderUnavailable={() => <VetVisitButton visitRef={visitRef} intent="join" />} />
133
+ * ```
134
+ */
135
+ readonly renderUnavailable?: ((reason: VetCallUnavailableReason, detail: string) => ReactNode) | undefined;
136
+ readonly style?: StyleProp<ViewStyle>;
137
+ }
138
+ /** The in-app consult. Mount it with the credentials `POST /consults/{id}/join` returned. */
139
+ declare function EverfurVetCall(props: EverfurVetCallProps): ReactNode;
140
+
141
+ interface EverfurVetCallLobbyProps {
142
+ /** Null until the consult carries a display name. NEVER invented. */
143
+ readonly clinicianName?: string | null | undefined;
144
+ /** Null when the roster has not resolved; the prep line degrades, it does not break. */
145
+ readonly petName?: string | null | undefined;
146
+ readonly micOn: boolean;
147
+ readonly cameraOn: boolean;
148
+ readonly onToggleMic: () => void;
149
+ readonly onToggleCamera: () => void;
150
+ /** The front/back flip. Absent (a native module without `cycleCamera`), the control is not drawn. */
151
+ readonly onSwitchCamera?: (() => void) | undefined;
152
+ readonly onLeave: () => void;
153
+ readonly style?: StyleProp<ViewStyle>;
154
+ }
155
+ /**
156
+ * The waiting room shown until the clinician is IN the room (present, with or without a camera). Mounted by
157
+ * `EverfurVetCall`.
158
+ */
159
+ declare function EverfurVetCallLobby(props: EverfurVetCallLobbyProps): ReactNode;
160
+
161
+ export { EVERFUR_DAILY_SETUP, type EverfurDailyLoader, type EverfurDailyModule, EverfurVetCall, EverfurVetCallLobby, type EverfurVetCallLobbyProps, type EverfurVetCallProps, OptionalModule, TelemetryPort, type VetCallEvent, type VetCallHandler, type VetCallMediaViewProps, type VetCallObject, type VetCallParticipant, type VetCallTrack, type VetCallUnavailableReason, isEverfurDailyModule, loadEverfurDaily, registerEverfurDaily };
@@ -0,0 +1,161 @@
1
+ import { ComponentType, ReactNode } from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ import { T as TelemetryPort } from '../../TelemetryPort-BDNr00hu.js';
4
+ import { O as OptionalModule } from '../../optionalModule-DbJmsq5f.js';
5
+ export { V as VetCallPhase, i as isSafeRoomUrl, a as isUsableRoomCredential } from '../../callRoom-7wrE3RP2.js';
6
+ export { V as VET_CALL_CONSULT_MINUTES, a as VET_CALL_COPY } from '../../callCopy-rDH9JTFo.js';
7
+ import '../../EverfurError-DmELDpXp.js';
8
+
9
+ /**
10
+ * A participant's media track. Daily types this `MediaStreamTrack | false | null`: `false` means the track
11
+ * is off, which renders the same as absent. The SDK never reads inside it, so it stays opaque.
12
+ */
13
+ type VetCallTrack = unknown;
14
+ /** One participant in the room, narrowed to what the call surface reads. */
15
+ interface VetCallParticipant {
16
+ readonly local: boolean;
17
+ readonly videoTrack?: VetCallTrack;
18
+ readonly audioTrack?: VetCallTrack;
19
+ }
20
+ /** The Daily events the call surface subscribes to. */
21
+ type VetCallEvent = 'participant-joined' | 'participant-updated' | 'participant-left' | 'left-meeting' | 'error';
22
+ type VetCallHandler = (...args: readonly unknown[]) => void;
23
+ /**
24
+ * The Daily call object, narrowed to the members the call surface actually calls. Narrow on purpose: the SDK
25
+ * never asks for host powers. `is_owner` is the CLINICIAN's and the server decides it when it mints the token;
26
+ * it starts recording and grants admit/eject, and nothing here requests either.
27
+ *
28
+ * THE LAST TWO ARE OPTIONAL, and a control is drawn only when its method is there: `cycleCamera` is the front
29
+ * and back flip and `setNativeInCallAudioMode` the loudspeaker and earpiece routes, both of which the consumer
30
+ * app calls on the same native module (TelevetCallScreen.tsx:559-581). A module version without them keeps
31
+ * the call working and simply offers fewer controls, rather than failing its shape check.
32
+ */
33
+ interface VetCallObject {
34
+ join(options: {
35
+ readonly url: string;
36
+ readonly token: string;
37
+ }): Promise<unknown>;
38
+ leave(): Promise<unknown>;
39
+ destroy(): Promise<unknown>;
40
+ participants(): Record<string, VetCallParticipant>;
41
+ setLocalAudio(enabled: boolean): unknown;
42
+ setLocalVideo(enabled: boolean): unknown;
43
+ on(event: VetCallEvent, handler: VetCallHandler): unknown;
44
+ off(event: VetCallEvent, handler: VetCallHandler): unknown;
45
+ /** The front/back flip. Resolves with the facing mode it landed on (`device.facingMode`). */
46
+ cycleCamera?(): Promise<{
47
+ readonly device?: {
48
+ readonly facingMode?: string;
49
+ } | null;
50
+ } | null | undefined>;
51
+ /** `'video'` routes the call to the loudspeaker (Daily's default), `'voice'` to the earpiece. */
52
+ setNativeInCallAudioMode?(mode: 'video' | 'voice'): unknown;
53
+ }
54
+ /** The props the call surface renders `DailyMediaView` with. */
55
+ interface VetCallMediaViewProps {
56
+ readonly videoTrack: VetCallTrack;
57
+ readonly audioTrack: VetCallTrack;
58
+ readonly mirror?: boolean;
59
+ readonly objectFit?: 'cover' | 'contain';
60
+ readonly style?: unknown;
61
+ }
62
+ /** The shape of `@daily-co/react-native-daily-js` this package uses, and nothing else. */
63
+ interface EverfurDailyModule {
64
+ createCallObject(): VetCallObject;
65
+ readonly DailyMediaView: ComponentType<VetCallMediaViewProps>;
66
+ }
67
+ /** The thunk a partner registers. Typically `() => require('@daily-co/react-native-daily-js')`. */
68
+ type EverfurDailyLoader = () => unknown;
69
+ /**
70
+ * DEVELOPER-FACING, never rendered to a member. It is handed to `onUnavailable` and written to
71
+ * `console.warn` once, so a partner who mounts the call surface without the native peer reads what to do
72
+ * instead of watching a blank screen. End-user copy is never authored in this repository.
73
+ */
74
+ declare const EVERFUR_DAILY_SETUP: string;
75
+ /** A present-but-wrong-shape module (a version whose surface drifted) is treated as unavailable, not trusted. */
76
+ declare function isEverfurDailyModule(candidate: unknown): candidate is EverfurDailyModule;
77
+ /**
78
+ * Register the Daily native module for the in-app vet call. Call it ONCE, in your app entry, before any
79
+ * Everfur call surface mounts:
80
+ *
81
+ * ```ts
82
+ * import { registerEverfurDaily } from '@everfur/sdk/televet';
83
+ * registerEverfurDaily(() => require('@daily-co/react-native-daily-js'));
84
+ * ```
85
+ *
86
+ * Passing `null` unregisters it, which is what a test does between cases. Registering clears the memo, so a
87
+ * later registration always wins over an earlier failed load.
88
+ */
89
+ declare function registerEverfurDaily(next: EverfurDailyLoader | null): void;
90
+ /**
91
+ * The guarded load: a missing loader, a throwing loader and a wrong-shape module all settle to
92
+ * `{ available: false }`. NEVER throws, and never returns a partially usable module.
93
+ *
94
+ * Memoized, because the call surface asks on every render and a `require` on every render of a live video
95
+ * screen is work on the path that can least afford it.
96
+ */
97
+ declare function loadEverfurDaily(): OptionalModule<EverfurDailyModule>;
98
+
99
+ /** Why the call surface refused to render. Both values are DEVELOPER-facing, never shown to a member. */
100
+ type VetCallUnavailableReason = 'dailyMissing' | 'roomUnusable';
101
+ interface EverfurVetCallProps {
102
+ /** The `room_url` the server minted for this consult. Must be https; anything else is refused. */
103
+ readonly roomUrl: string;
104
+ /** The short-lived, per-participant join token. NEVER rendered, NEVER logged, NEVER a telemetry prop. */
105
+ readonly token: string;
106
+ /** Called once the member has left, so the host can pop the screen. */
107
+ readonly onLeave: () => void;
108
+ /** Shown in the lobby while the clinician has not joined. Null in production today; never invented. */
109
+ readonly clinicianName?: string | null | undefined;
110
+ /** The pet's display name for the lobby's prep line; absent, the pet-free form is used. */
111
+ readonly petName?: string | null | undefined;
112
+ /**
113
+ * Host/test seam: the Daily module, instead of the one `registerEverfurDaily` registered. A partner with
114
+ * its own module resolution passes it here and calls no register function at all.
115
+ */
116
+ readonly daily?: EverfurDailyModule | undefined;
117
+ /** Your analytics sink for the two call events. Defaults to a no-op; never receives a credential. */
118
+ readonly telemetry?: TelemetryPort | undefined;
119
+ /**
120
+ * Called instead of rendering when the call cannot run, with a developer-facing explanation. `dailyMissing`
121
+ * means the native modules are not registered; `roomUnusable` means the credential failed its floor.
122
+ */
123
+ readonly onUnavailable?: ((reason: VetCallUnavailableReason, detail: string) => void) | undefined;
124
+ /**
125
+ * What to draw when the call cannot run. THE SDK DRAWS NOTHING BY DEFAULT, and that is deliberate: there is
126
+ * no owner-approved member-facing sentence for "this app was built without the video modules", and this
127
+ * package does not author user-facing copy. The consumer app's own answer to a missing native module is to
128
+ * fall back to the browser (`televetJoin.ts`: "an owner on an old build still gets into the consult, in a
129
+ * browser, instead of a crash"), so the intended wiring here is the same:
130
+ *
131
+ * ```tsx
132
+ * <VetCall ... renderUnavailable={() => <VetVisitButton visitRef={visitRef} intent="join" />} />
133
+ * ```
134
+ */
135
+ readonly renderUnavailable?: ((reason: VetCallUnavailableReason, detail: string) => ReactNode) | undefined;
136
+ readonly style?: StyleProp<ViewStyle>;
137
+ }
138
+ /** The in-app consult. Mount it with the credentials `POST /consults/{id}/join` returned. */
139
+ declare function EverfurVetCall(props: EverfurVetCallProps): ReactNode;
140
+
141
+ interface EverfurVetCallLobbyProps {
142
+ /** Null until the consult carries a display name. NEVER invented. */
143
+ readonly clinicianName?: string | null | undefined;
144
+ /** Null when the roster has not resolved; the prep line degrades, it does not break. */
145
+ readonly petName?: string | null | undefined;
146
+ readonly micOn: boolean;
147
+ readonly cameraOn: boolean;
148
+ readonly onToggleMic: () => void;
149
+ readonly onToggleCamera: () => void;
150
+ /** The front/back flip. Absent (a native module without `cycleCamera`), the control is not drawn. */
151
+ readonly onSwitchCamera?: (() => void) | undefined;
152
+ readonly onLeave: () => void;
153
+ readonly style?: StyleProp<ViewStyle>;
154
+ }
155
+ /**
156
+ * The waiting room shown until the clinician is IN the room (present, with or without a camera). Mounted by
157
+ * `EverfurVetCall`.
158
+ */
159
+ declare function EverfurVetCallLobby(props: EverfurVetCallLobbyProps): ReactNode;
160
+
161
+ export { EVERFUR_DAILY_SETUP, type EverfurDailyLoader, type EverfurDailyModule, EverfurVetCall, EverfurVetCallLobby, type EverfurVetCallLobbyProps, type EverfurVetCallProps, OptionalModule, TelemetryPort, type VetCallEvent, type VetCallHandler, type VetCallMediaViewProps, type VetCallObject, type VetCallParticipant, type VetCallTrack, type VetCallUnavailableReason, isEverfurDailyModule, loadEverfurDaily, registerEverfurDaily };
@@ -0,0 +1 @@
1
+ import {createContext,forwardRef,createElement,useMemo,useRef,useEffect,useState,useCallback,useContext}from'react';import {StyleSheet,TextInput,useWindowDimensions,View,Pressable,Text,Animated}from'react-native';import {useSafeAreaInsets}from'react-native-safe-area-context';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var Nt=Object.defineProperty;var o=(e,t)=>Nt(e,"name",{value:t,configurable:true});var Mt=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function b(e,t){let r=e.type,a=r.families[t];return t==="mono"||r.namedFaces[t]?{fontFamily:a}:{fontFamily:a,fontWeight:r.weight[Mt[t]]}}o(b,"face");var $e=Object.freeze({track(){},trackExpectedFailure(){}});function Ye(e){try{return new URL(e.trim()).protocol==="https:"}catch{return false}}o(Ye,"isSafeRoomUrl");function be(e,t){return Ye(e)&&t.trim().length>0}o(be,"isUsableRoomCredential");function qe(e){let t=globalThis.console;try{t?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(qe,"reportHostFailure");function _t(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(_t,"isThenable");function ge(e,...t){if(typeof e=="function")try{let r=e(...t);return _t(r)&&Promise.resolve(r).then(void 0,qe),r}catch(r){qe(r);return}}o(ge,"callHost");var Ke=new WeakMap;function jt(e){if(typeof e!="function")return;let t=Ke.get(e);if(t!==void 0)return t;let r=o((...a)=>{ge(e,...a);},"guarded");return Ke.set(e,r),r}o(jt,"guardHost");function Je(e,t){let r=null;for(let a of t){let n=e[a];typeof n=="function"&&(r??={...e},r[a]=jt(n));}return r??e}o(Je,"guardHostProps");var W=10,i=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:o(e=>{let t=e?.trim()??"";return t.length>0?`${t} is joining`:i.lobbyTitleNoName},"lobbyTitle"),lobbyPrep:o(e=>{let t=e?.trim()??"";return t.length>0?`Have ${t} nearby and somewhere well lit.`:i.lobbyPrepNoPet},"lobbyPrep"),lobbyDuration:o(e=>`${e} MINUTE VISIT`,"lobbyDuration"),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 Ze(e){let t=Math.max(0,Math.floor(e/1e3)),r=String(t%60).padStart(2,"0"),a=Math.floor(t%3600/60),n=Math.floor(t/3600);return n>0?`${n}:${String(a).padStart(2,"0")}:${r}`:`${a}:${r}`}o(Ze,"formatElapsed");function Ce(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.keys(e))Ce(e[t]);}return e}o(Ce,"deepFreeze");var Ht=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),Qe={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},et={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Xe={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},zt={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Ut={regular:"400",medium:"500",bold:"700"},Wt={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Gt=0,re="System",oe="monospace",$t=["content","heading","control","compact","badge"];function Yt(e){let t={};for(let r of $t)t[r]=e;return t}o(Yt,"authoredTierSizes");function tt(){return {family:re,mono:oe,fontUrl:null,families:{regular:re,medium:re,bold:re,mono:oe,monoMedium:oe,monoBold:oe},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Xe,tierSizes:Yt(Xe),lineHeight:zt,weight:Ut,letterSpacing:Wt,scale:1,maxScale:Gt,scaleCaps:Ht}}o(tt,"baseType");var rt={},he=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function ve(e){return `cubic-bezier(${e.join(", ")})`}o(ve,"cssCubicBezier");var ot={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:ve(he.standard),emphasized:ve(he.emphasized),exit:ve(he.exit)},reducedMotion:false},qt={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:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",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:"#B91C1C",errorRed:"#FF1B00",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(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},nt=Ce({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:qt,space:Qe,radius:et,type:tt(),motion:ot,slots:rt}),Kt={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:"#9A938C",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",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",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};Ce({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Kt,space:Qe,radius:et,type:tt(),motion:ot,slots:rt});var at=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),lt=globalThis,Te=lt[at]??(lt[at]=createContext(nt));Te.displayName??="EverfurThemeContext";function O(){return useContext(Te)}o(O,"useEverfurTheme");function tr(e,t){let r=e.scaleCaps[t];return r>0?r:void 0}o(tr,"tierMultiplier");function g({tier:e="content",...t}){let{type:r}=O(),a=tr(r,e);return createElement(Text,a===void 0?t:{maxFontSizeMultiplier:a,...t})}o(g,"Text");forwardRef(o(function(t,r){return createElement(TextInput,{...t,...r===null?{}:{ref:r}})},"TextInput"));function st(e,t,r){let a;try{a=t();}catch(h){return xe(`optional peer '${e}' is not installed: ${or(h)}`)}let n=rr(a);return n==null?xe(`optional peer '${e}' resolved to no module`):r&&!r(n)?xe(`optional peer '${e}' is present but failed its shape check`):Object.freeze({available:true,module:n})}o(st,"optionalModule");function rr(e){return typeof e=="object"&&e!==null&&"default"in e&&Object.keys(e).length<=2?e.default:e}o(rr,"unwrapDefault");function xe(e){return Object.freeze({available:false,module:null,reason:e})}o(xe,"frozenUnavailable");function or(e){return e instanceof Error?e.message:typeof e=="string"?e:"unknown load error"}o(or,"describe");var dt=Symbol.for("@everfur/sdk/televet");function nr(){let e=globalThis,t=e[dt];if(t!==void 0)return t;let r={presenter:null,snapshot:Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:new Set,dailyRegistered:false};return e[dt]=r,r}o(nr,"televetGlobal");function ut(e){nr().dailyRegistered=e;}o(ut,"markEverfurDailyRegistered");var Ee=`[everfur] The in-app vet call needs the Daily native modules, which this app has not registered. Install @daily-co/react-native-daily-js, @daily-co/react-native-webrtc and (Expo) @daily-co/config-plugin-rn-daily-js, rebuild the native app (a JS-only OTA cannot add a native module), and call registerEverfurDaily(() => require('@daily-co/react-native-daily-js')) once in your app entry. ON EXPO GO THIS CANNOT BE FIXED BY INSTALLING: Expo Go runs a fixed set of native modules and cannot load Daily at any version, so you need a development build (expo prebuild, then run the native app) before the in-app call works at all. Until then the in-app visit tells the member the call cannot be joined; <VetVisitButton prefer="redirect" /> is the explicit way to the hosted visit in the browser, which needs no native module.`,ke="@daily-co/react-native-daily-js",ar=`optional peer '${ke}' has no registered loader`,ct=`optional peer '${ke}' is present but failed its shape check`;function ae(e){return typeof e=="object"&&e!==null}o(ae,"isRecordLike");function lr(e){return ae(e)&&"box"in e}o(lr,"isDailyBox");function ir(e){let t=ae(e.default)?e.default:{},r=e.createCallObject??t.createCallObject,a=e.DailyMediaView??t.DailyMediaView,n={createCallObject:r,DailyMediaView:a};return ft(n)?n:null}o(ir,"normalizeDailyModule");function ft(e){if(!ae(e)||typeof e.createCallObject!="function")return false;let t=e.DailyMediaView;return typeof t=="function"||typeof t=="object"&&t!==null}o(ft,"isEverfurDailyModule");var yt=null,T=null;function ne(e){return Object.freeze({available:false,module:null,reason:e})}o(ne,"unavailable");function sr(e){yt=e,T=null,ut(e!==null);}o(sr,"registerEverfurDaily");function we(){if(T!==null)return T;let e=yt;if(e===null)return T=ne(ar),T;let t=st(ke,()=>({box:e()}),lr);if(!t.available)return T=ne(t.reason),T;let r=t.module.box;if(!ae(r))return T=ne(ct),T;let a=ir(r);return T=a===null?ne(ct):Object.freeze({available:true,module:a}),T}o(we,"loadEverfurDaily");function _({label:e,glyph:t,onPress:r,testID:a,muted:n=false,style:h}){return jsx(Pressable,{onPress:r,testID:a,accessibilityRole:"button",accessibilityLabel:e,accessibilityState:{selected:n},style:h,children:t})}o(_,"CallControl");function G({children:e,testID:t}){return jsx(View,{style:c.box,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",testID:t,children:e})}o(G,"GlyphBox");function Re({color:e}){return jsx(View,{style:[c.slash,{backgroundColor:e}]})}o(Re,"Slash");function le({color:e,off:t=false}){return jsxs(G,{testID:t?"glyph-mic-off":"glyph-mic",children:[jsxs(View,{style:c.column,children:[jsx(View,{style:[c.micCapsule,{borderColor:e}]}),jsx(View,{style:[c.micCradle,{borderColor:e}]}),jsx(View,{style:[c.micStem,{backgroundColor:e}]})]}),t?jsx(Re,{color:e}):null]})}o(le,"MicGlyph");function ie({color:e,off:t=false}){return jsxs(G,{testID:t?"glyph-camera-off":"glyph-camera",children:[jsxs(View,{style:c.row,children:[jsx(View,{style:[c.cameraBody,{borderColor:e}]}),jsx(View,{style:[c.cameraLens,{borderRightColor:e}]})]}),t?jsx(Re,{color:e}):null]})}o(ie,"CameraGlyph");function pt({color:e,off:t=false}){return jsxs(G,{testID:t?"glyph-speaker-off":"glyph-speaker",children:[jsxs(View,{style:c.row,children:[jsx(View,{style:[c.speakerBox,{backgroundColor:e}]}),jsx(View,{style:[c.speakerCone,{borderRightColor:e}]}),t?null:jsx(View,{style:[c.speakerWave,{borderColor:e}]})]}),t?jsx(Re,{color:e}):null]})}o(pt,"SpeakerGlyph");function se({color:e}){return jsx(G,{testID:"glyph-switch-camera",children:jsxs(View,{style:[c.switchBody,{borderColor:e}],children:[jsx(View,{style:[c.switchTurn,{borderColor:e,borderTopColor:"transparent"}]}),jsx(View,{style:[c.switchHead,{borderBottomColor:e}]})]})})}o(se,"SwitchCameraGlyph");function mt({color:e}){return jsx(G,{testID:"glyph-leave",children:jsxs(View,{style:c.column,children:[jsx(View,{style:[c.receiver,{borderColor:e}]}),jsxs(View,{style:c.receiverPads,children:[jsx(View,{style:[c.receiverPad,{backgroundColor:e}]}),jsx(View,{style:[c.receiverPad,{backgroundColor:e}]})]})]})})}o(mt,"LeaveGlyph");var c=StyleSheet.create({box:{width:24,height:24,alignItems:"center",justifyContent:"center"},row:{flexDirection:"row",alignItems:"center"},column:{alignItems:"center"},slash:{position:"absolute",width:2,height:28,borderRadius:1,transform:[{rotate:"-45deg"}]},micCapsule:{width:10,height:14,borderRadius:5,borderWidth:2},micCradle:{width:16,height:8,marginTop:-5,borderWidth:2,borderTopWidth:0,borderBottomLeftRadius:8,borderBottomRightRadius:8},micStem:{width:2,height:3},cameraBody:{width:14,height:12,borderRadius:3,borderWidth:2},cameraLens:{width:0,height:0,marginLeft:1,borderTopWidth:5,borderBottomWidth:5,borderRightWidth:6,borderTopColor:"transparent",borderBottomColor:"transparent"},speakerBox:{width:4,height:8,borderRadius:1},speakerCone:{width:0,height:0,borderTopWidth:7,borderBottomWidth:7,borderRightWidth:7,borderTopColor:"transparent",borderBottomColor:"transparent",transform:[{rotate:"180deg"}]},speakerWave:{width:7,height:12,marginLeft:2,borderWidth:2,borderLeftWidth:0,borderTopRightRadius:6,borderBottomRightRadius:6},switchBody:{width:20,height:15,borderRadius:3,borderWidth:2,alignItems:"center",justifyContent:"center"},switchTurn:{width:9,height:9,borderRadius:4.5,borderWidth:2},switchHead:{position:"absolute",top:2,right:4,width:0,height:0,borderLeftWidth:3,borderRightWidth:3,borderBottomWidth:4,borderLeftColor:"transparent",borderRightColor:"transparent"},receiver:{width:22,height:10,borderWidth:3,borderBottomWidth:0,borderTopLeftRadius:11,borderTopRightRadius:11},receiverPads:{flexDirection:"row",width:22,justifyContent:"space-between",marginTop:-1},receiverPad:{width:5,height:4,borderRadius:1}});var S=Object.freeze({surface:"rgba(255,255,255,0.08)",surfaceRaised:"rgba(255,255,255,0.14)",surfaceActive:"rgba(255,255,255,0.24)",hairline:"rgba(255,255,255,0.18)",glyph:"rgba(255,255,255,0.72)",textSecondary:"rgba(255,255,255,0.78)",textTertiary:"rgba(255,255,255,0.56)"}),bt=3,gt=180,ht=420,vt=.35,gr=.6,hr=360,vr=132,Cr=184,Tr=44;function xr({reducedMotion:e,styles:t}){let r=useRef(Array.from({length:bt},()=>new Animated.Value(vt))).current;return useEffect(()=>{if(e)return;let a=r.map((n,h)=>Animated.loop(Animated.sequence([Animated.delay(h*gt),Animated.timing(n,{toValue:1,duration:ht,useNativeDriver:true}),Animated.timing(n,{toValue:vt,duration:ht,useNativeDriver:true}),Animated.delay((bt-h-1)*gt)])));for(let n of a)n.start();return ()=>{for(let n of a)n.stop();}},[e,r]),jsx(View,{style:t.dotRow,testID:"everfur-vet-lobby-dots",accessibilityElementsHidden:true,importantForAccessibility:"no",children:r.map((a,n)=>jsx(Animated.View,{style:[t.dot,{opacity:e?gr:a}]},n))})}o(xr,"WaitingDots");function Se({label:e,glyph:t,active:r,onPress:a,testID:n,styles:h}){return jsx(Pressable,{onPress:a,testID:n,accessibilityRole:"button",accessibilityState:{selected:!r},accessibilityLabel:e,style:[h.control,r?null:h.controlOff],children:t})}o(Se,"LobbyControl");function De(e){let{clinicianName:t,petName:r,micOn:a,cameraOn:n,onToggleMic:h,onToggleCamera:k,onSwitchCamera:q,onLeave:K,style:J}=e,v=O(),s=useMemo(()=>Er(v),[v]),l=useSafeAreaInsets(),{width:F}=useWindowDimensions(),P=F<hr?vr:Cr;return jsxs(View,{style:[s.root,{paddingTop:l.top+v.space.sm,paddingBottom:l.bottom+v.space.lg},J],testID:"everfur-vet-lobby",children:[jsx(View,{style:s.topRow,children:jsx(Pressable,{onPress:K,accessibilityRole:"button",accessibilityLabel:i.leaveCta,testID:"everfur-vet-lobby-leave",hitSlop:12,style:s.leaveHit,children:jsx(g,{tier:"control",style:s.leaveLabel,children:i.leaveCta})})}),jsxs(View,{style:s.center,children:[jsxs(View,{style:[s.avatar,{width:P,height:P,borderRadius:P/2}],testID:"everfur-vet-lobby-avatar",accessibilityElementsHidden:true,importantForAccessibility:"no",children:[jsx(View,{style:s.avatarGlyphHead}),jsx(View,{style:s.avatarGlyphBody})]}),jsxs(View,{accessibilityLiveRegion:"polite",accessible:true,children:[jsx(g,{tier:"heading",style:s.title,testID:"everfur-vet-lobby-title",children:i.lobbyTitle(t)}),jsx(g,{style:s.subtitle,testID:"everfur-vet-lobby-subtitle",children:i.lobbySubtitle})]}),jsx(xr,{reducedMotion:v.motion.reducedMotion,styles:s})]}),jsxs(View,{style:s.prepCard,testID:"everfur-vet-lobby-prep",children:[jsx(g,{tier:"badge",style:s.prepLabel,children:i.lobbyPrepLabel}),jsx(g,{style:s.prepBody,children:i.lobbyPrep(r)})]}),jsxs(View,{style:s.controls,children:[jsx(Se,{label:a?i.muteCta:i.unmuteCta,glyph:jsx(le,{color:v.color.text.onBrand,off:!a}),active:a,onPress:h,testID:"everfur-vet-lobby-mic",styles:s}),jsx(Se,{label:n?i.cameraOffCta:i.cameraOnCta,glyph:jsx(ie,{color:v.color.text.onBrand,off:!n}),active:n,onPress:k,testID:"everfur-vet-lobby-camera",styles:s}),n&&q?jsx(Se,{label:i.switchCameraCta,glyph:jsx(se,{color:v.color.text.onBrand}),active:true,onPress:q,testID:"everfur-vet-lobby-switch-camera",styles:s}):null]}),jsx(g,{tier:"badge",style:s.duration,testID:"everfur-vet-lobby-duration",children:i.lobbyDuration(10)})]})}o(De,"EverfurVetCallLobby");function Er(e){let{color:t,space:r,radius:a,type:n}=e;return StyleSheet.create({root:{flex:1,backgroundColor:t.brand,paddingHorizontal:r.lg},topRow:{flexDirection:"row",alignItems:"center"},leaveHit:{minHeight:Tr,justifyContent:"center",paddingVertical:r.xs,paddingRight:r.md},leaveLabel:{...b(e,"medium"),color:t.text.onBrand,fontSize:n.size.body},center:{flex:1,alignItems:"center",justifyContent:"center"},avatar:{alignItems:"center",justifyContent:"center",borderWidth:2,borderColor:t.success,backgroundColor:S.surface,marginBottom:r.lg,overflow:"hidden"},avatarGlyphHead:{width:34,height:34,borderRadius:17,borderWidth:2,borderColor:S.glyph,marginBottom:6},avatarGlyphBody:{width:66,height:33,borderTopLeftRadius:33,borderTopRightRadius:33,borderWidth:2,borderBottomWidth:0,borderColor:S.glyph},title:{...b(e,"bold"),color:t.text.onBrand,fontSize:n.size.heading,lineHeight:Math.round(n.size.heading*n.lineHeight.snug),textAlign:"center",paddingHorizontal:r.sm},subtitle:{...b(e,"regular"),color:S.textSecondary,fontSize:n.size.body,textAlign:"center",marginTop:r.xs},dotRow:{flexDirection:"row",gap:r.xs,marginTop:r.lg},dot:{width:8,height:8,borderRadius:4,backgroundColor:t.success},prepCard:{borderRadius:a.lg,borderWidth:1,borderColor:S.hairline,backgroundColor:S.surface,padding:r.lg,marginBottom:r.lg},prepLabel:{...b(e,"medium"),color:t.accent,fontSize:n.size.micro,letterSpacing:1.2,marginBottom:r.sm},prepBody:{...b(e,"regular"),color:t.text.onBrand,fontSize:n.size.subtitle,lineHeight:Math.round(n.size.subtitle*n.lineHeight.relaxed)},controls:{flexDirection:"row",justifyContent:"center",gap:r.lg,marginBottom:r.lg},control:{minWidth:64,minHeight:48,paddingHorizontal:r.md,alignItems:"center",justifyContent:"center",borderRadius:a.pill,backgroundColor:S.surfaceRaised},controlOff:{backgroundColor:S.surfaceActive},duration:{...b(e,"medium"),color:S.textTertiary,fontSize:n.size.micro,letterSpacing:1.6,textAlign:"center"}})}o(Er,"makeStyles");function Tt(e){let[t,r]=useState(true),a=useRef(true),n=useCallback(()=>{let h=e.current;if(!h?.setNativeInCallAudioMode)return;let k=!a.current;a.current=k,r(k),h.setNativeInCallAudioMode(k?"video":"voice");},[e]);return {speakerOn:t,toggleSpeaker:n}}o(Tt,"useSpeakerRoute");function Ie(e){return e??null}o(Ie,"asTrack");function Dr(e){return !!e?.videoTrack}o(Dr,"hasVideo");function Lr({styles:e}){return jsxs(View,{style:e.remoteOffAvatar,accessibilityElementsHidden:true,importantForAccessibility:"no",children:[jsx(View,{style:e.remoteOffHead}),jsx(View,{style:e.remoteOffBody})]})}o(Lr,"PersonMark");function Vr(e){let{roomUrl:t,token:r,onLeave:a,clinicianName:n,petName:h,daily:k,telemetry:q,onUnavailable:K,renderUnavailable:J,style:v}=Je(e,["onLeave"]),s=O(),l=useMemo(()=>Ir(s),[s]),F=useSafeAreaInsets(),P=q??$e,ue=useRef(P);useEffect(()=>{ue.current=P;});let Z=useRef(a);useEffect(()=>{Z.current=a;});let I=useRef(null),[ce,wt]=useState(false),[Rt,X]=useState("joining"),[Q,St]=useState(null),[Be,Dt]=useState(null),[B,Lt]=useState(true),[w,Vt]=useState(true),{speakerOn:H,toggleSpeaker:Ft}=Tt(I),[It,Ot]=useState(true),[fe,Pt]=useState({flip:false,speaker:false}),[z,Bt]=useState(null),[Ae,Ne]=useState(0),Me=be(t,r),A=useMemo(()=>Me?k?{available:true,module:k,reason:""}:we():null,[Me,k]),U=A?.available?A.module:null,L=useMemo(()=>A===null?{reason:"roomUnusable",detail:"[everfur] The vet call needs an https room URL and a non-empty join token."}:A.available?null:{reason:"dailyMissing",detail:`${Ee} (${A.reason})`},[A]),ye=useRef(false);useEffect(()=>{if(L===null){ye.current=false;return}if(ge(K,L.reason,L.detail),!ye.current){ye.current=true;try{globalThis.console?.warn?.(L.detail);}catch{}}},[L,K]);let ee=useCallback(async()=>{let y=I.current;if(I.current=null,!!y){try{await y.leave();}catch{}try{await y.destroy();}catch{}}},[]);useEffect(()=>{if(U===null||!ce)return;let y=false,m=U.createCallObject();I.current=m,Pt({flip:typeof m.cycleCamera=="function",speaker:typeof m.setNativeInCallAudioMode=="function"});let N=o(()=>{let M=Object.values(m.participants());Dt(M.find(me=>me.local)??null),St(M.find(me=>!me.local)??null);},"syncParticipants"),Ue=["participant-joined","participant-updated","participant-left"];for(let M of Ue)m.on(M,N);let We=o(()=>{y||(X("left"),Z.current());},"onLeftMeeting"),Ge=o(()=>{y||X("error");},"onError");return m.on("left-meeting",We),m.on("error",Ge),m.join({url:t,token:r}).then(()=>{y||(X("joined"),Bt(Date.now()),N(),ue.current.track("televet.call.joined",{provider:"daily"}));}).catch(()=>{y||(X("error"),ue.current.trackExpectedFailure("televet.call.join_failed",{provider:"daily"}));}),()=>{y=true;for(let M of Ue)m.off(M,N);m.off("left-meeting",We),m.off("error",Ge),ee();}},[U,ce,t,r,ee]),useEffect(()=>{if(z===null)return;Ne(Date.now()-z);let y=setInterval(()=>{Ne(Date.now()-z);},1e3);return ()=>{clearInterval(y);}},[z]);let _e=useCallback(()=>{let y=I.current;y&&Lt(m=>(y.setLocalAudio(!m),!m));},[]),je=useCallback(()=>{let y=I.current;y&&Vt(m=>(y.setLocalVideo(!m),!m));},[]),He=useCallback(()=>{let y=I.current;y?.cycleCamera&&y.cycleCamera().then(m=>{let N=m?.device?.facingMode;N&&Ot(N==="user");},()=>{});},[]),pe=useCallback(()=>{ee().then(()=>Z.current());},[ee]);if(L!==null)return J?jsx(Fragment,{children:J(L.reason,L.detail)}):null;if(U===null)return null;if(!ce)return jsxs(View,{style:[l.notice,{paddingTop:F.top+s.space.xl,paddingBottom:F.bottom+s.space.xl},v],testID:"everfur-vet-call-recording-notice",children:[jsx(g,{style:l.noticeTitle,accessibilityRole:"header",children:i.recordingNoticeTitle}),jsx(Pressable,{onPress:()=>wt(true),accessibilityRole:"button",accessibilityLabel:i.recordingNoticeCta,testID:"everfur-vet-call-recording-continue",style:l.noticeContinue,children:jsx(g,{tier:"control",style:l.noticeContinueLabel,children:i.recordingNoticeCta})}),jsx(Pressable,{onPress:()=>Z.current(),accessibilityRole:"button",accessibilityLabel:i.leaveCta,testID:"everfur-vet-call-recording-leave",style:l.errorLeaveHit,children:jsx(g,{tier:"control",style:l.noticeLeave,children:i.leaveCta})})]});if(Rt==="error")return jsxs(View,{style:[l.centered,v],testID:"everfur-vet-call-error",children:[jsx(g,{style:l.status,accessibilityLiveRegion:"polite",children:i.joinFailedReason}),jsx(Pressable,{onPress:pe,accessibilityRole:"button",accessibilityLabel:i.leaveCta,testID:"everfur-vet-call-error-leave",style:l.errorLeaveHit,children:jsx(g,{tier:"control",style:l.errorLeave,children:i.leaveCta})})]});if(Q===null)return jsx(De,{clinicianName:n,petName:h,micOn:B,cameraOn:w,onToggleMic:_e,onToggleCamera:je,...fe.flip?{onSwitchCamera:He}:{},onLeave:pe,style:v});let ze=U.DailyMediaView,te=n?.trim()??"",At=Ae>=10*6e4;return jsxs(View,{style:[l.root,v],testID:"everfur-vet-call",children:[jsxs(View,{style:l.fill,testID:"everfur-vet-call-remote",children:[jsx(ze,{videoTrack:Ie(Q.videoTrack),audioTrack:Ie(Q.audioTrack),mirror:false,objectFit:"cover",style:l.fill}),Dr(Q)?null:jsxs(View,{style:l.remoteOff,testID:"everfur-vet-call-remote-camera-off",children:[jsx(Lr,{styles:l}),te.length>0?jsx(g,{style:l.remoteOffName,numberOfLines:1,children:te}):null]})]}),jsxs(View,{style:[l.statusRow,{top:F.top+s.space.sm}],pointerEvents:"none",children:[te.length>0?jsx(g,{tier:"compact",style:l.statusName,numberOfLines:1,testID:"everfur-vet-call-remote-name",children:te}):null,z!==null?jsx(g,{tier:"badge",style:[l.statusMeta,At?l.statusMetaOver:null],testID:"everfur-vet-call-elapsed",children:Ze(Ae)}):null]}),jsxs(View,{style:[l.selfView,{top:F.top+s.space.sm}],testID:"everfur-vet-call-self",children:[jsx(ze,{videoTrack:w?Ie(Be?.videoTrack):null,audioTrack:null,mirror:It,objectFit:"cover",style:l.fill}),Be?.videoTrack&&w?null:jsx(View,{style:[l.selfViewOff,l.fill],testID:"everfur-vet-call-self-off",children:jsx(g,{tier:"badge",style:l.selfViewOffLabel,children:i.selfCameraOffLabel})})]}),jsxs(View,{style:[l.controlBar,{bottom:F.bottom+s.space.lg}],children:[fe.speaker?jsx(_,{label:H?i.speakerOffCta:i.speakerOnCta,glyph:jsx(pt,{color:H?s.color.text.onBrand:Pe,off:!H}),muted:!H,onPress:Ft,testID:"everfur-vet-call-speaker",style:[l.control,H?null:l.controlMuted]}):null,jsx(_,{label:B?i.muteCta:i.unmuteCta,glyph:jsx(le,{color:B?s.color.text.onBrand:Pe,off:!B}),muted:!B,onPress:_e,testID:"everfur-vet-call-mic",style:[l.control,B?null:l.controlMuted]}),jsx(_,{label:w?i.cameraOffCta:i.cameraOnCta,glyph:jsx(ie,{color:w?s.color.text.onBrand:Pe,off:!w}),muted:!w,onPress:je,testID:"everfur-vet-call-camera",style:[l.control,w?null:l.controlMuted]}),fe.flip&&w?jsx(_,{label:i.switchCameraCta,glyph:jsx(se,{color:s.color.text.onBrand}),onPress:He,testID:"everfur-vet-call-switch-camera",style:l.control}):null,jsx(_,{label:i.leaveCta,glyph:jsx(mt,{color:s.color.text.onBrand}),onPress:pe,testID:"everfur-vet-call-leave",style:[l.control,l.controlDanger]})]})]})}o(Vr,"EverfurVetCall");var Oe="#141414",xt="#1B1B1B",Fr="rgba(20,20,20,0.62)",Pe="#141414",Et=104,kt={textShadowColor:"rgba(0,0,0,0.55)",textShadowRadius:6};function Ir(e){let{color:t,space:r,radius:a,type:n}=e;return StyleSheet.create({root:{flex:1,backgroundColor:Oe},fill:{...StyleSheet.absoluteFillObject},centered:{flex:1,alignItems:"center",justifyContent:"center",gap:r.lg,padding:r.xl,backgroundColor:Oe},statusRow:{position:"absolute",left:r.md,right:Et+r.md*2,flexDirection:"column",alignItems:"flex-start",gap:2},statusName:{flexShrink:1,...b(e,"medium"),color:t.text.onBrand,fontSize:n.size.body,...kt},statusMeta:{...b(e,"mono"),color:t.text.onBrand,fontSize:n.size.caption,...kt},statusMetaOver:{color:t.danger},selfView:{position:"absolute",right:r.md,width:Et,height:148,borderRadius:a.lg,overflow:"hidden",backgroundColor:xt,borderWidth:1,borderColor:"rgba(255,255,255,0.24)",shadowColor:"#000",shadowOpacity:.35,shadowRadius:12,shadowOffset:{width:0,height:4},elevation:6},selfViewOff:{alignItems:"center",justifyContent:"center",paddingHorizontal:r.xs,backgroundColor:xt},remoteOff:{...StyleSheet.absoluteFillObject,alignItems:"center",justifyContent:"center",gap:r.md,backgroundColor:Oe},remoteOffAvatar:{width:96,height:96,borderRadius:a.pill,overflow:"hidden",alignItems:"center",justifyContent:"flex-end",backgroundColor:"rgba(255,255,255,0.14)"},remoteOffHead:{width:36,height:36,borderRadius:18,marginBottom:6,backgroundColor:"rgba(255,255,255,0.56)"},remoteOffBody:{width:64,height:28,borderTopLeftRadius:32,borderTopRightRadius:32,backgroundColor:"rgba(255,255,255,0.56)"},remoteOffName:{...b(e,"medium"),color:t.text.onBrand,fontSize:n.size.subtitle,paddingHorizontal:r.xl},notice:{flex:1,justifyContent:"center",gap:r.lg,paddingHorizontal:r.xl,backgroundColor:t.surface},noticeTitle:{...b(e,"medium"),fontSize:n.size.subtitle,lineHeight:Math.round(n.size.subtitle*n.lineHeight.relaxed),color:t.text.primary},noticeContinue:{minHeight:44,alignItems:"center",justifyContent:"center",paddingHorizontal:r.xl,borderRadius:a.pill,backgroundColor:t.primary},noticeContinueLabel:{...b(e,"medium"),color:t.onPrimary,fontSize:n.size.body},noticeLeave:{...b(e,"medium"),color:t.brand,fontSize:n.size.body},selfViewOffLabel:{...b(e,"medium"),color:"rgba(255,255,255,0.78)",fontSize:n.size.micro,textAlign:"center"},controlBar:{position:"absolute",left:0,right:0,flexDirection:"row",justifyContent:"center",alignItems:"center",gap:r.sm},control:{minWidth:54,minHeight:56,paddingHorizontal:r.md,alignItems:"center",justifyContent:"center",borderRadius:a.pill,backgroundColor:Fr},controlMuted:{backgroundColor:t.text.onBrand},controlDanger:{backgroundColor:t.danger},status:{...b(e,"medium"),fontSize:n.size.subtitle,lineHeight:Math.round(n.size.subtitle*n.lineHeight.relaxed),color:t.surface,textAlign:"center"},errorLeaveHit:{minHeight:44,minWidth:44,alignItems:"center",justifyContent:"center",paddingHorizontal:r.lg},errorLeave:{...b(e,"medium"),color:t.surface,fontSize:n.size.body,textDecorationLine:"underline"}})}o(Ir,"makeStyles");export{Ee as EVERFUR_DAILY_SETUP,Vr as EverfurVetCall,De as EverfurVetCallLobby,W as VET_CALL_CONSULT_MINUTES,i as VET_CALL_COPY,ft as isEverfurDailyModule,Ye as isSafeRoomUrl,be as isUsableRoomCredential,we as loadEverfurDaily,sr as registerEverfurDaily};