@everfur/sdk 0.13.0 → 0.14.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 (202) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/README.md +11 -10
  3. package/dist/{Chat.d-Dts8u_1a.d.cts → Chat.d-aycmX1CA.d.cts} +12 -4
  4. package/dist/{Chat.d-DUNTfzqC.d.ts → Chat.d-puminpyi.d.ts} +12 -4
  5. package/dist/{DepthViews.d-CubkMPbU.d.ts → DepthViews.d-BdvFZgPs.d.cts} +1 -1
  6. package/dist/{DepthViews.d-Ce2Zhnrb.d.ts → DepthViews.d-DIvxzLDf.d.ts} +1 -1
  7. package/dist/{DepthViews.d-BMU2jFPw.d.cts → DepthViews.d-Dy0Zl-s-.d.ts} +1 -1
  8. package/dist/{DepthViews.d-BIp599lz.d.cts → DepthViews.d-wLNkzk9f.d.cts} +1 -1
  9. package/dist/RecordsPage.d-9Ank15PT.d.ts +93 -0
  10. package/dist/RecordsPage.d-DMKU0IKc.d.cts +93 -0
  11. package/dist/animations/index.d.cts +5 -5
  12. package/dist/animations/index.d.ts +5 -5
  13. package/dist/{attachments.d-D1yhJjcZ.d.ts → attachments.d--sIsfk6e.d.ts} +2 -2
  14. package/dist/{attachments.d-Bp2qbHxn.d.cts → attachments.d-DNUCiyy5.d.cts} +6 -24
  15. package/dist/{attachments.d-DisnvB9R.d.cts → attachments.d-ZEpTUeWN.d.cts} +2 -2
  16. package/dist/{attachments.d-Djy9z_0Z.d.ts → attachments.d-rp3xs-Q3.d.ts} +6 -24
  17. package/dist/{bookingCopy.d-BJF6gd1A.d.ts → bookingCopy.d-D0uIIFAJ.d.ts} +2 -2
  18. package/dist/{bookingCopy.d-BlBmhAJc.d.cts → bookingCopy.d-DUrmVcLs.d.cts} +2 -2
  19. package/dist/{branding.d-DI8S400y.d.cts → branding.d-CTXTUg_8.d.cts} +1 -1
  20. package/dist/{branding.d-OIGLbQeM.d.ts → branding.d-DxJSoFce.d.ts} +1 -1
  21. package/dist/{casesRepository.d-CT2LTicS.d.cts → casesRepository.d-DCnix2pT.d.cts} +1 -1
  22. package/dist/{casesRepository.d-UsWOz9bv.d.ts → casesRepository.d-DbirgbyH.d.ts} +1 -1
  23. package/dist/chat/index.cjs +43 -41
  24. package/dist/chat/index.d.cts +26 -13
  25. package/dist/chat/index.d.ts +26 -13
  26. package/dist/chat/index.js +43 -41
  27. package/dist/client/index.cjs +2 -2
  28. package/dist/client/index.d.cts +10 -10
  29. package/dist/client/index.d.ts +10 -10
  30. package/dist/client/index.js +2 -2
  31. package/dist/clinicBatch.d-Ccmrngcu.d.cts +71 -0
  32. package/dist/clinicBatch.d-D9Ci7IpP.d.ts +71 -0
  33. package/dist/clinicModels.d-BXgKZqDb.d.cts +68 -0
  34. package/dist/clinicModels.d-CaS64-P-.d.ts +68 -0
  35. package/dist/clinicRequestProps.d-1dCtouGA.d.cts +65 -0
  36. package/dist/clinicRequestProps.d-CjsMg_OD.d.ts +65 -0
  37. package/dist/{config.d-BR3DT9ho.d.cts → config.d-DJ4mvf_w.d.cts} +1 -1
  38. package/dist/{config.d-Dy6igYlH.d.ts → config.d-MX7IKP2f.d.ts} +1 -1
  39. package/dist/consent/index.d.cts +5 -5
  40. package/dist/consent/index.d.ts +5 -5
  41. package/dist/{context.d-QcCgguzA.d.ts → context.d-BdnBe8Oe.d.ts} +7 -7
  42. package/dist/{context.d-Cwks0p3C.d.cts → context.d-C6MJsMpN.d.cts} +7 -7
  43. package/dist/{copy.d-CiMn2IIt.d.ts → copy.d-BIfQOoDB.d.ts} +2 -2
  44. package/dist/{copy.d-DLJTyRfT.d.cts → copy.d-C_u7shha.d.cts} +2 -2
  45. package/dist/core/index.cjs +3 -3
  46. package/dist/core/index.d.cts +20 -18
  47. package/dist/core/index.d.ts +20 -18
  48. package/dist/core/index.js +3 -3
  49. package/dist/{depth.d-OSALbYM7.d.ts → depth.d-COFxYWLU.d.ts} +6 -133
  50. package/dist/{depth.d-CjPGVPDL.d.cts → depth.d-D2e5WZuE.d.cts} +6 -133
  51. package/dist/{entitlementRepository.d-CVQa1DA1.d.cts → entitlementRepository.d-BP15dFbe.d.cts} +4 -4
  52. package/dist/{entitlementRepository.d-Cf3LbTwD.d.ts → entitlementRepository.d-DLuxnGi5.d.ts} +4 -4
  53. package/dist/{features.d-fNsGcg0R.d.ts → features.d-DrQxTw3-.d.cts} +1 -1
  54. package/dist/{features.d-fNsGcg0R.d.cts → features.d-DrQxTw3-.d.ts} +1 -1
  55. package/dist/{focus.d-DMg2ngHI.d.ts → focus.d-C0Tr0oVJ.d.ts} +109 -348
  56. package/dist/{focus.d-az9cqUz3.d.cts → focus.d-jQWp0hdK.d.cts} +109 -348
  57. package/dist/health-plan/index.cjs +165 -151
  58. package/dist/health-plan/index.d.cts +53 -11
  59. package/dist/health-plan/index.d.ts +53 -11
  60. package/dist/health-plan/index.js +169 -155
  61. package/dist/{idempotency.d-D461_DPD.d.cts → idempotency.d-DXb1BN2A.d.ts} +151 -6
  62. package/dist/{idempotency.d-WpXx9zQo.d.ts → idempotency.d-HF6fyRt2.d.cts} +151 -6
  63. package/dist/{identity.d-DzTijonw.d.ts → identity.d-BePPZ7Uv.d.ts} +1 -1
  64. package/dist/{identity.d-60LeJt_s.d.cts → identity.d-CJfnWOdH.d.cts} +1 -1
  65. package/dist/index.cjs +46 -44
  66. package/dist/index.d.cts +19 -18
  67. package/dist/index.d.ts +19 -18
  68. package/dist/index.js +46 -44
  69. package/dist/introEvents.d-BkGDT_kG.d.cts +175 -0
  70. package/dist/introEvents.d-DHlMvmC7.d.ts +175 -0
  71. package/dist/introEvents.d-dS3fJCH1.d.cts +5 -0
  72. package/dist/introEvents.d-dS3fJCH1.d.ts +5 -0
  73. package/dist/{models.d-BnLm3VAA.d.cts → models.d-BSqvbTE1.d.cts} +8 -1
  74. package/dist/{models.d-BagXhafD.d.ts → models.d-DOwnr8fi.d.ts} +8 -1
  75. package/dist/notifications/index.d.cts +4 -4
  76. package/dist/notifications/index.d.ts +4 -4
  77. package/dist/{optInView.d-CEyHR6PK.d.cts → optInView.d-0iI5JoAf.d.cts} +119 -3
  78. package/dist/{optInView.d-acKpV8V2.d.ts → optInView.d-s-w4aGN3.d.ts} +119 -3
  79. package/dist/{parse.d-C8CXyS58.d.ts → parse.d-COt1qVA6.d.ts} +1 -1
  80. package/dist/{parse.d-tEzufgJX.d.cts → parse.d-EmsgOUMQ.d.cts} +1 -1
  81. package/dist/{pets.d-C_53_fzo.d.ts → pets.d-BFT_b53y.d.ts} +1 -1
  82. package/dist/{pets.d-NbJvP_kh.d.cts → pets.d-nNAVnw7f.d.cts} +1 -1
  83. package/dist/{petsRepository.d-lp1BHRqM.d.cts → petsRepository.d-B2TpRE7r.d.cts} +1 -1
  84. package/dist/{petsRepository.d-BuGHymNx.d.ts → petsRepository.d-RGwSZcYl.d.ts} +1 -1
  85. package/dist/planSignals.d-BDbp2e-k.d.cts +126 -0
  86. package/dist/planSignals.d-DSnxKoWe.d.ts +126 -0
  87. package/dist/{ports.d-COIyN624.d.ts → ports.d-D2n4HRUy.d.ts} +4 -4
  88. package/dist/{ports.d-CEROoqnA.d.cts → ports.d-DBA_gsq5.d.cts} +4 -4
  89. package/dist/{presentation.d-DMbdad7G.d.cts → presentation.d-vy8kTGfR.d.cts} +6 -0
  90. package/dist/{presentation.d-DMbdad7G.d.ts → presentation.d-vy8kTGfR.d.ts} +6 -0
  91. package/dist/quickPrompts.d-NM_81Jc1.d.cts +19 -0
  92. package/dist/quickPrompts.d-NM_81Jc1.d.ts +19 -0
  93. package/dist/records/depth/index.d.cts +13 -9
  94. package/dist/records/depth/index.d.ts +13 -9
  95. package/dist/records/index.cjs +252 -138
  96. package/dist/records/index.d.cts +88 -23
  97. package/dist/records/index.d.ts +88 -23
  98. package/dist/records/index.js +253 -139
  99. package/dist/{requestFunnel.d-CXUMPw1K.d.ts → requestFunnel.d-D9edIEjZ.d.ts} +2 -2
  100. package/dist/{requestFunnel.d-DWQQpjFR.d.cts → requestFunnel.d-RZex94XX.d.cts} +2 -2
  101. package/dist/{resolve.d-jI8FmBj3.d.cts → resolve.d-CoQWUy1Y.d.cts} +1 -1
  102. package/dist/{resolve.d-jI8FmBj3.d.ts → resolve.d-CoQWUy1Y.d.ts} +1 -1
  103. package/dist/{runtimeTypes.d-4yFNNuYR.d.ts → runtimeTypes.d-BYq38b17.d.ts} +6 -6
  104. package/dist/{runtimeTypes.d-D6N_fhxx.d.cts → runtimeTypes.d-LkwZaF7z.d.cts} +6 -6
  105. package/dist/{useRecordsDepth.d-DFcCfiXm.d.ts → screenProps.d-BVzRzowC.d.ts} +5 -91
  106. package/dist/{useRecordsDepth.d-sAq2Qkhr.d.cts → screenProps.d-CQ0qZJkr.d.cts} +5 -91
  107. package/dist/server/events/index.cjs +1 -1
  108. package/dist/server/events/index.d.cts +2 -2
  109. package/dist/server/events/index.d.ts +2 -2
  110. package/dist/server/events/index.js +1 -1
  111. package/dist/server/index.cjs +1 -1
  112. package/dist/server/index.d.cts +3 -3
  113. package/dist/server/index.d.ts +3 -3
  114. package/dist/server/index.js +1 -1
  115. package/dist/{sheetSeam.d-Cviqk89n.d.ts → sheetSeam.d-B09jf4YC.d.ts} +8 -4
  116. package/dist/{sheetSeam.d-DCS3LW8g.d.cts → sheetSeam.d-BBuEIVsa.d.cts} +8 -4
  117. package/dist/shop/index.cjs +224 -58
  118. package/dist/shop/index.d.cts +23 -5
  119. package/dist/shop/index.d.ts +23 -5
  120. package/dist/shop/index.js +225 -59
  121. package/dist/tabs/index.cjs +195 -0
  122. package/dist/tabs/index.d.cts +174 -0
  123. package/dist/tabs/index.d.ts +174 -0
  124. package/dist/tabs/index.js +195 -0
  125. package/dist/tabsModel.d-BfIQg6yS.d.cts +31 -0
  126. package/dist/tabsModel.d-BfIQg6yS.d.ts +31 -0
  127. package/dist/televet/booking/index.d.cts +6 -6
  128. package/dist/televet/booking/index.d.ts +6 -6
  129. package/dist/testing/index.cjs +1 -1
  130. package/dist/testing/index.d.cts +1 -1
  131. package/dist/testing/index.d.ts +1 -1
  132. package/dist/testing/index.js +1 -1
  133. package/dist/testing/rn/index.cjs +1 -1
  134. package/dist/testing/rn/index.d.cts +11 -11
  135. package/dist/testing/rn/index.d.ts +11 -11
  136. package/dist/testing/rn/index.js +1 -1
  137. package/dist/testing/web/index.d.cts +12 -12
  138. package/dist/testing/web/index.d.ts +12 -12
  139. package/dist/texting/index.cjs +40 -5
  140. package/dist/texting/index.d.cts +40 -7
  141. package/dist/texting/index.d.ts +40 -7
  142. package/dist/texting/index.js +40 -5
  143. package/dist/threadOptions.d-9r4Csa7k.d.cts +458 -0
  144. package/dist/threadOptions.d-B6GA09aM.d.ts +458 -0
  145. package/dist/{timelineRows.d-CU5GvvLk.d.ts → timelineRows.d-Bes8ip2v.d.ts} +1 -1
  146. package/dist/{timelineRows.d-BNxgzYRW.d.cts → timelineRows.d-BvM2A7_G.d.cts} +1 -1
  147. package/dist/{typeStyle.d-C1HBRAI3.d.ts → typeStyle.d-Co5KF0up.d.ts} +1 -1
  148. package/dist/{typeStyle.d-Bl8pzbBy.d.cts → typeStyle.d-xIZj02Ru.d.cts} +1 -1
  149. package/dist/useIntroSeen.d-CTWFUthO.d.cts +35 -0
  150. package/dist/useIntroSeen.d-CTWFUthO.d.ts +35 -0
  151. package/dist/usePresentation.d-BGz32Vlm.d.ts +285 -0
  152. package/dist/usePresentation.d-DYTF_ZGf.d.cts +285 -0
  153. package/dist/{useRecords.d-Cb-36SF5.d.cts → useRecords.d-BYNX01El.d.cts} +2 -2
  154. package/dist/{useRecords.d-aQTzQZoV.d.ts → useRecords.d-DWk61a4c.d.ts} +2 -2
  155. package/dist/useRecordsDepth.d--LLA_4ga.d.cts +32 -0
  156. package/dist/useRecordsDepth.d-BQRL0Hez.d.ts +32 -0
  157. package/dist/{view.d-Dps5C8-s.d.cts → view.d-0yBjLTV3.d.cts} +6 -4
  158. package/dist/{view.d-C-SNpDJX.d.ts → view.d-DqbCADFa.d.ts} +6 -4
  159. package/dist/web/consent/index.d.cts +5 -5
  160. package/dist/web/consent/index.d.ts +5 -5
  161. package/dist/web/health-plan/index.cjs +50 -43
  162. package/dist/web/health-plan/index.d.cts +46 -192
  163. package/dist/web/health-plan/index.d.ts +46 -192
  164. package/dist/web/health-plan/index.js +65 -58
  165. package/dist/web/index.cjs +61 -45
  166. package/dist/web/index.d.cts +165 -25
  167. package/dist/web/index.d.ts +165 -25
  168. package/dist/web/index.js +62 -46
  169. package/dist/web/intro/index.cjs +167 -0
  170. package/dist/web/intro/index.d.cts +79 -0
  171. package/dist/web/intro/index.d.ts +79 -0
  172. package/dist/web/intro/index.js +167 -0
  173. package/dist/web/notifications/index.d.cts +3 -3
  174. package/dist/web/notifications/index.d.ts +3 -3
  175. package/dist/web/records/depth/index.d.cts +13 -9
  176. package/dist/web/records/depth/index.d.ts +13 -9
  177. package/dist/web/records/index.cjs +7 -7
  178. package/dist/web/records/index.d.cts +21 -82
  179. package/dist/web/records/index.d.ts +21 -82
  180. package/dist/web/records/index.js +7 -7
  181. package/dist/web/records-sheet/index.cjs +181 -127
  182. package/dist/web/records-sheet/index.d.cts +18 -16
  183. package/dist/web/records-sheet/index.d.ts +18 -16
  184. package/dist/web/records-sheet/index.js +181 -127
  185. package/dist/web/shop/index.cjs +191 -76
  186. package/dist/web/shop/index.d.cts +21 -4
  187. package/dist/web/shop/index.d.ts +21 -4
  188. package/dist/web/shop/index.js +191 -76
  189. package/dist/web/televet/booking/index.d.cts +6 -6
  190. package/dist/web/televet/booking/index.d.ts +6 -6
  191. package/dist/web/texting/index.cjs +36 -5
  192. package/dist/web/texting/index.d.cts +40 -7
  193. package/dist/web/texting/index.d.ts +40 -7
  194. package/dist/web/texting/index.js +36 -5
  195. package/package.json +35 -4
  196. package/tabs/package.json +8 -0
  197. package/web/intro/native-blocked.cjs +12 -0
  198. package/web/intro/package.json +8 -0
  199. package/dist/threadOptions.d-B1pTMmDF.d.cts +0 -260
  200. package/dist/threadOptions.d-B1pTMmDF.d.ts +0 -260
  201. package/dist/usePresentation.d-D6qsFzBz.d.cts +0 -9
  202. package/dist/usePresentation.d-DuGQe_Do.d.ts +0 -9
@@ -0,0 +1,167 @@
1
+ "use client";
2
+ "use strict";var react=require("react"),reactDom=require("react-dom"),jsxRuntime=require("react/jsx-runtime");var CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze([
3
+ /* @__PURE__ */Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),
4
+ /* @__PURE__ */Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),
5
+ /* @__PURE__ */Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),
6
+ /* @__PURE__ */Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),
7
+ /* @__PURE__ */Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),
8
+ /* @__PURE__ */Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),
9
+ /* @__PURE__ */Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),
10
+ /* @__PURE__ */Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),
11
+ /* @__PURE__ */Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),
12
+ /* @__PURE__ */Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),
13
+ /* @__PURE__ */Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),
14
+ /* @__PURE__ */Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),
15
+ /* @__PURE__ */Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),
16
+ /* @__PURE__ */Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),
17
+ /* @__PURE__ */Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),
18
+ /* @__PURE__ */Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),
19
+ /* @__PURE__ */Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),
20
+ /* @__PURE__ */Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),
21
+ /* @__PURE__ */Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),
22
+ /* @__PURE__ */Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),
23
+ /* @__PURE__ */Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),
24
+ /* @__PURE__ */Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),
25
+ /* @__PURE__ */Object.freeze({wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false}),
26
+ /* @__PURE__ */Object.freeze({wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false}),
27
+ /* @__PURE__ */Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
28
+ /* @__PURE__ */Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),
29
+ /* @__PURE__ */Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),
30
+ /* @__PURE__ */Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),
31
+ /* @__PURE__ */Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
32
+ /* @__PURE__ */Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
33
+ /* @__PURE__ */Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
34
+ /* @__PURE__ */Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
35
+ /* @__PURE__ */Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),
36
+ /* @__PURE__ */Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),
37
+ /* @__PURE__ */Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
38
+ /* @__PURE__ */Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),
39
+ /* @__PURE__ */Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),
40
+ /* @__PURE__ */Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),
41
+ /* @__PURE__ */Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),
42
+ /* @__PURE__ */Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),
43
+ /* @__PURE__ */Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),
44
+ /* @__PURE__ */Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),
45
+ /* @__PURE__ */Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),
46
+ /* @__PURE__ */Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),
47
+ /* @__PURE__ */Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),
48
+ /* @__PURE__ */Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),
49
+ /* @__PURE__ */Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),
50
+ /* @__PURE__ */Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),
51
+ /* @__PURE__ */Object.freeze({wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false}),
52
+ /* @__PURE__ */Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),
53
+ /* @__PURE__ */Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),
54
+ /* @__PURE__ */Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),
55
+ /* @__PURE__ */Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),
56
+ /* @__PURE__ */Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),
57
+ /* @__PURE__ */Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),
58
+ /* @__PURE__ */Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),
59
+ /* @__PURE__ */Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),
60
+ /* @__PURE__ */Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),
61
+ /* @__PURE__ */Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),
62
+ /* @__PURE__ */Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),
63
+ /* @__PURE__ */Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),
64
+ /* @__PURE__ */Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),
65
+ /* @__PURE__ */Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),
66
+ /* @__PURE__ */Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),
67
+ /* @__PURE__ */Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),
68
+ /* @__PURE__ */Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),
69
+ /* @__PURE__ */Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
70
+ /* @__PURE__ */Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),
71
+ /* @__PURE__ */Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),
72
+ /* @__PURE__ */Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),
73
+ /* @__PURE__ */Object.freeze({wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false}),
74
+ /* @__PURE__ */Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),
75
+ /* @__PURE__ */Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),
76
+ /* @__PURE__ */Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),
77
+ /* @__PURE__ */Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
78
+ /* @__PURE__ */Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),
79
+ /* @__PURE__ */Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),
80
+ /* @__PURE__ */Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),
81
+ /* @__PURE__ */Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),
82
+ /* @__PURE__ */Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
83
+ /* @__PURE__ */Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),
84
+ /* @__PURE__ */Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),
85
+ /* @__PURE__ */Object.freeze({wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false}),
86
+ /* @__PURE__ */Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),
87
+ /* @__PURE__ */Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),
88
+ /* @__PURE__ */Object.freeze({wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
89
+ /* @__PURE__ */Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),
90
+ /* @__PURE__ */Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),
91
+ /* @__PURE__ */Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),
92
+ /* @__PURE__ */Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
93
+ /* @__PURE__ */Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),
94
+ /* @__PURE__ */Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
95
+ /* @__PURE__ */Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}var CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function categoryFor(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:ACCESS_DENIED_COPY,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:VALIDATION_FAILED_COPY,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."}),SESSION_REVOKED_COPY="This session has ended. Please sign in again.",LINKED_ACCOUNT_READ_ONLY="linked_account_read_only";function displayFor(code,wireCode,reasonCode){return code==="conflict"&&reasonCode===LINKED_ACCOUNT_READ_ONLY?ACCESS_DENIED_COPY:(code==="authRejected"||code==="authExpired")&&typeof wireCode=="string"&&wireCode.trim().toLowerCase()==="session_revoked"?SESSION_REVOKED_COPY:userFacingError(code)}function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),linkedReadOnly=code==="conflict"&&opts?.reasonCode===LINKED_ACCOUNT_READ_ONLY,error={code:code,category:categoryFor(code),retryable:opts?.retryable??(linkedReadOnly?false:isRetryableCode(code)),displayMessage:displayFor(code,opts?.wireCode,linkedReadOnly?LINKED_ACCOUNT_READ_ONLY:null)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function ok(value,warning){/* @__PURE__ */
96
+ return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
97
+ return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function wireCodeOf(error){let raw=error.raw;if(typeof raw!="object"||raw===null)return null;let code=raw.code;return typeof code=="string"&&code.length>0?code:null}function foldWireReason(error,table){let wire=wireCodeOf(error);if(wire===null)return error;let fold=table[wire];return fold===void 0?error:makeEverfurError(fold.code,{retryable:fold.retryable,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{},wireCode:wire,reasonCode:wire,...error.wireMessage!==void 0?{wireMessage:error.wireMessage}:{},raw:error.raw})}function errorFrame(fields){/* @__PURE__ */
98
+ return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function mintFailedError(cause,refusal){let message=cause instanceof Error?cause.message:typeof cause=="string"?cause:null;return makeEverfurError("authRejected",{retryable:false,...refusal?.wireCode?{wireCode:refusal.wireCode}:{},...refusal?.requestId?{requestId:refusal.requestId}:{},...message?{wireMessage:message}:{},...cause!=null?{raw:cause}:{}})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause))}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause,{wireCode:wireCodeOf2(first.error.raw),requestId:first.error.requestId}))}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(refusedAfterRemintError(retry.error))):retry}function refusedAfterRemintError(refusal){let raw=refusal.raw,wireCode=wireCodeOf2(raw);return makeEverfurError("authRejected",{retryable:false,...refusal.httpStatus!==void 0?{httpStatus:refusal.httpStatus}:{},...refusal.requestId?{requestId:refusal.requestId}:{},...wireCode?{wireCode:wireCode}:{},...refusal.reasonCode?{reasonCode:refusal.reasonCode}:{},...refusal.wireMessage?{wireMessage:refusal.wireMessage}:{},...raw!=null?{raw:raw}:{}})}function wireCodeOf2(body){if(typeof body!="object"||body===null)return null;let b=body,code=(typeof b.error=="object"&&b.error!==null?b.error.code:void 0)??b.code;return typeof code=="string"&&code.length>0?code:null}function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled;try{settled=await authedSend({...base,signal:merged.signal},deps.auth)}catch(cause){settled=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled;let error=settled.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp({phase:"settled",...settledEvent})),err(error);if(emit(stamp({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
99
+ /* @__PURE__ */Object.freeze({call:call,phase:"stream.open",method:req.method,path:req.path,attempt:0}));try{yield*deps.auth.transport.stream(req,signal)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
100
+ return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop=()=>{};if(!caller)return{signal:deadline,dispose:noop};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}var PROVIDERS=/* @__PURE__ */new Set(["expo","fcm","apns"]),PLATFORMS=/* @__PURE__ */new Set(["ios","android"]),TOKEN_MAX=4096,INSTALLATION_ID_MAX=128,DEVICE_ID_MAX=64,CONTROL_OR_SPACE=/[\0- ]/;function invalid(wireMessage,reasonCode){return makeEverfurError("validationFailed",{retryable:false,wireMessage:wireMessage,...reasonCode?{reasonCode:reasonCode}:{}})}function validateRegister(input){if(typeof input!="object"||input===null)return invalid("registerDevice needs an input object");let{token:token,provider:provider,platform:platform,installationId:installationId}=input;return typeof provider!="string"||!PROVIDERS.has(provider)?invalid("provider must be expo, fcm or apns"):typeof platform!="string"||!PLATFORMS.has(platform)?invalid("platform must be ios or android"):typeof token!="string"||token.trim().length===0||token.length>TOKEN_MAX||CONTROL_OR_SPACE.test(token)?invalid(`token must be a push token of 1..${TOKEN_MAX} characters with no whitespace`,"token_invalid"):installationId!==void 0&&(typeof installationId!="string"||installationId.length===0||installationId.length>INSTALLATION_ID_MAX)?invalid(`installationId must be 1..${INSTALLATION_ID_MAX} characters`):null}function validateDeviceId(deviceId){return typeof deviceId!="string"||deviceId.length===0||deviceId.length>DEVICE_ID_MAX?invalid(`deviceId must be 1..${DEVICE_ID_MAX} characters`):CONTROL_OR_SPACE.test(deviceId)||deviceId.includes("/")||deviceId==="."||deviceId===".."?invalid("deviceId is not a device id"):null}function validatePreferences(input){if(typeof input!="object"||input===null)return invalid("setPreferences needs an input object");let{pushEnabled:pushEnabled,emailEnabled:emailEnabled}=input;return typeof pushEnabled!="boolean"||typeof emailEnabled!="boolean"?invalid("pushEnabled and emailEnabled must both be booleans: the route replaces both switches"):null}function str(value){return typeof value=="string"&&value.length>0?value:null}function parseDevice(raw){if(typeof raw!="object"||raw===null)return null;let o=raw,deviceId=str(o.device_id),provider=str(o.provider),platform=str(o.platform),registeredAt=str(o.registered_at),lastSeenAt=str(o.last_seen_at);if(deviceId===null||provider===null||platform===null||registeredAt===null||lastSeenAt===null||!PROVIDERS.has(provider)||!PLATFORMS.has(platform))return null;let installation=o.installation_id;/* @__PURE__ */
101
+ return Object.freeze({deviceId:deviceId,provider:provider,platform:platform,installationId:typeof installation=="string"&&installation.length>0?installation:null,registeredAt:registeredAt,lastSeenAt:lastSeenAt})}function parsePreferences(raw){if(typeof raw!="object"||raw===null)return null;let o=raw,updatedAt=str(o.updated_at);return typeof o.push_enabled!="boolean"||typeof o.email_enabled!="boolean"||updatedAt===null?null:/* @__PURE__ */Object.freeze({pushEnabled:o.push_enabled,emailEnabled:o.email_enabled,updatedAt:updatedAt})}function malformed(call){return makeEverfurError("internalError",{retryable:false,wireMessage:`${call}: the response was not the documented shape`})}var ROUTE_REASONS=/* @__PURE__ */Object.freeze({provider_unsupported:{code:"validationFailed",retryable:false},token_invalid:{code:"validationFailed",retryable:false},device_cipher_unavailable:{code:"serviceUnavailable",retryable:true}});function refine(error){return foldWireReason(error,ROUTE_REASONS)}function disposed(verb){return makeEverfurError("validationFailed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${verb} was called after unmount`})}function createNotificationsClient(runtime){let over=()=>{let{services:services}=runtime.registry;return createNotificationsClientOver({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})};return{registerDevice:(input,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("registerDevice"))):over().registerDevice(input,opts),unregisterDevice:(deviceId,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("unregisterDevice"))):over().unregisterDevice(deviceId,opts),setPreferences:(input,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("setPreferences"))):over().setPreferences(input,opts)}}function createNotificationsClientOver(deps){let funnel=deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}}),withSignal=(req,signal)=>signal?{...req,signal:signal}:req;return{async registerDevice(input,opts){let bad=validateRegister(input);if(bad!==null)return err(bad);let body={token:input.token,provider:input.provider,platform:input.platform};input.installationId!==void 0&&(body.installation_id=input.installationId);let res=await funnel.send("notifications.registerDevice",withSignal({method:"POST",path:"/widget/v1/me/devices",body:body},opts?.signal));if(!res.ok)return err(refine(res.error));let device=parseDevice(res.value);return device===null?err(malformed("registerDevice")):ok(device)},async unregisterDevice(deviceId,opts){let bad=validateDeviceId(deviceId);if(bad!==null)return err(bad);let res=await funnel.send("notifications.unregisterDevice",withSignal({method:"DELETE",path:`/widget/v1/me/devices/${encodeURIComponent(deviceId)}`},opts?.signal));return res.ok?ok(void 0):err(refine(res.error))},async setPreferences(input,opts){let bad=validatePreferences(input);if(bad!==null)return err(bad);let res=await funnel.send("notifications.setPreferences",withSignal({method:"PUT",path:"/widget/v1/me/notification-preferences",body:{push_enabled:input.pushEnabled,email_enabled:input.emailEnabled}},opts?.signal));if(!res.ok)return err(refine(res.error));let preferences=parsePreferences(res.value);return preferences===null?err(malformed("setPreferences")):ok(preferences)}}}var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=react.createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=react.useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}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)}function toRgba(value){if(typeof value=="number")return argbIntToRgba(value);if(typeof value!="string")return null;let s=value.trim();if(s.length===0)return null;if(s.startsWith("#"))return fromHex(s.slice(1));if(s.toLowerCase().startsWith("0x"))return fromHex(s.slice(2));if(s.toLowerCase().startsWith("rgb"))return fromRgbFunc(s);if(/^[0-9a-fA-F]+$/.test(s)){let hex=fromHex(s);if(hex!==null)return hex}return/^\d+$/.test(s)?argbIntToRgba(Number.parseInt(s,10)):null}function fromHex(hex){let h=hex.trim();if(!/^[0-9a-fA-F]+$/.test(h))return null;if(h.length===3)return{r:dup(h[0]),g:dup(h[1]),b:dup(h[2]),a:1};if(h.length===6)return{r:byte(h,0),g:byte(h,2),b:byte(h,4),a:1};if(h.length===8){let a=byte(h,0);return{r:byte(h,2),g:byte(h,4),b:byte(h,6),a:a/255}}return null}function fromRgbFunc(input){let open=input.indexOf("("),close=input.indexOf(")");if(open<0||close<0||close<open)return null;let parts=input.slice(open+1,close).split(",").map(p=>p.trim());if(parts.length<3)return null;let r=clampByte(Number(parts[0])),g=clampByte(Number(parts[1])),b=clampByte(Number(parts[2]));if(r===null||g===null||b===null)return null;let a=1;if(parts.length>=4){let alpha=Number(parts[3]);if(!Number.isFinite(alpha))return null;a=Math.min(1,Math.max(0,alpha))}return{r:r,g:g,b:b,a:a}}function argbIntToRgba(n){if(!Number.isFinite(n))return null;let int=Math.trunc(n)>>>0,a=int>>>24&255;return{r:int>>>16&255,g:int>>>8&255,b:int&255,a:a===0?1:a/255}}function byte(hex,at){return Number.parseInt(hex.slice(at,at+2),16)}function dup(nibble){return Number.parseInt(`${nibble??"0"}${nibble??"0"}`,16)}function clampByte(n){return Number.isFinite(n)?Math.min(255,Math.max(0,Math.round(n))):null}function rgbToHex(r,g,b){return`#${hex2(r)}${hex2(g)}${hex2(b)}`.toUpperCase()}function hex2(n){return n.toString(16).padStart(2,"0")}var NEAR_BLACK="#111111",WHITE="#FFFFFF",BLACK="#000000";function readableOn(background){let rgba=toRgba(background);if(rgba===null)return WHITE;let bg=relativeLuminance(rgba),black=relativeLuminance({r:17,g:17,b:17}),white=relativeLuminance({r:255,g:255,b:255});return luminanceContrast(bg,white)>=luminanceContrast(bg,black)?WHITE:NEAR_BLACK}function legibleOn(background,target){let first=readableOn(background);return contrastRatio(first,background)>=target?first:contrastRatio(WHITE,background)>=contrastRatio(BLACK,background)?WHITE:BLACK}function poleForGrounds(grounds){let worst=ink=>grounds.reduce((low,ground)=>Math.min(low,contrastRatio(ink,ground)),Number.POSITIVE_INFINITY);return worst(WHITE)>=worst(BLACK)?WHITE:BLACK}function relativeLuminance(rgba){let r=linearize(rgba.r/255),g=linearize(rgba.g/255),b=linearize(rgba.b/255);return.2126*r+.7152*g+.0722*b}function linearize(channel){return channel<=.03928?channel/12.92:Math.pow((channel+.055)/1.055,2.4)}function luminanceContrast(l1,l2){let lighter=Math.max(l1,l2),darker=Math.min(l1,l2);return(lighter+.05)/(darker+.05)}function contrastRatio(a,b){let fg=toRgba(a),bg=toRgba(b);if(fg===null||bg===null)return 1;let ground=bg.a>=1?bg:{...bg},fore=fg.a>=1?fg:composite(fg,ground);return luminanceContrast(relativeLuminance(fore),relativeLuminance(ground))}function composite(fg,bg){let a=fg.a,mix2=(f,g)=>Math.round(f*a+g*(1-a));return{r:mix2(fg.r,bg.r),g:mix2(fg.g,bg.g),b:mix2(fg.b,bg.b),a:1}}function flattenOnto(color,background){let fg=toRgba(color),bg=toRgba(background);if(fg===null||bg===null)return null;let out=fg.a>=1?fg:composite(fg,{...bg});return rgbToHex(out.r,out.g,out.b)}function withAlpha(color,alpha){let rgba=toRgba(color);if(rgba===null)return null;let a=Math.min(1,Math.max(0,alpha));return`rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${a})`}var PUSH_STEP=.05;function pushToContrast(color,grounds,pole,target){let first=grounds[0];if(first===void 0)return pole;let reads=candidate=>grounds.every(ground=>contrastRatio(candidate,ground)>=target);if(toRgba(color)===null)return pole;if(reads(color))return color;let flat=flattenOnto(color,first),from=flat===null?null:toRgba(flat),to=toRgba(pole);if(from===null||to===null)return pole;for(let step=1;step<1/PUSH_STEP;step+=1){let t=step*PUSH_STEP,mix2=(a,b)=>Math.round(a+(b-a)*t),candidate=rgbToHex(mix2(from.r,to.r),mix2(from.g,to.g),mix2(from.b,to.b));if(reads(candidate))return candidate}return pole}var RAPH_V3_LIGHT=/* @__PURE__ */Object.freeze({ink:"#262523",ink2:"#4A4845",ink3:"#6B6863",paper:"#F8F7F4",card:"#FFFFFF",line:"#E7E6E2",tile:"#F2F1EE",shadow:"rgba(38, 37, 35, .07)",riskBg:"#FFE3E1",riskInk:"#B0231B",riskDot:"#E5372B",clearBg:"#E6F4D3",clearInk:"#2F6A12",clearDot:"#5FA82B",watchDot:"#E5A000"}),cache=/* @__PURE__ */new WeakMap;function v3Palette(theme){let hit=cache.get(theme);if(hit!==void 0)return hit;let c=theme.color,dark=theme.brightness==="dark",neutrals=dark?{dark:dark,ink:c.text.primary,ink2:c.text.secondary,ink3:c.text.muted,paper:c.background,card:c.surface,line:c.borderRingCream,tile:c.surfaceSubtle,shadow:c.shadow,riskBg:c.badgeBgCritical,riskInk:c.danger,riskDot:c.danger,clearBg:c.badgeBgPositive,clearInk:c.success,clearDot:c.success,watchDot:c.warningStrong}:{dark:dark,...RAPH_V3_LIGHT},textOn=(ink,grounds)=>pushToContrast(ink,grounds,poleForGrounds(grounds),V3_TEXT_CONTRAST),labelOn=(ink,fill)=>contrastRatio(ink,fill)>=V3_TEXT_CONTRAST?ink:legibleOn(fill,V3_TEXT_CONTRAST),badgeGrounds=[neutrals.card,neutrals.paper].map(under=>flattenOnto(c.brandSoft,under)??under),brand={primary:c.primary,onPrimary:labelOn(c.onPrimary,c.primary),accent:c.accent,onAccent:labelOn(c.onAccent,c.accent),link:textOn(c.linkInk,[neutrals.card,neutrals.paper,neutrals.tile]),badge:c.brandSoft,onBadge:textOn(c.brandInk,badgeGrounds)},palette=/* @__PURE__ */Object.freeze({...neutrals,...brand});return cache.set(theme,palette),palette}var V3_TEXT_CONTRAST=4.5;function v3InkOn(fill,inks){for(let ink of inks)if(contrastRatio(ink,fill)>=V3_TEXT_CONTRAST)return ink;return legibleOn(fill,V3_TEXT_CONTRAST)}function mix(color,share,ground){let over=withAlpha(color,share);return(over===null?null:flattenOnto(over,ground))??ground}function askIntroColors(theme){let v=v3Palette(theme),c=theme.color,card=v.card;return{ink:v.ink,ink2:v.ink2,ink3:v.ink3,paper:v.paper,tile:v.tile,line:v.line,card:card,onInk:v.dark?c.background:"#FFFFFF",primary:v.primary,onPrimary:v.onPrimary,accent:v.accent,onAccent:v3InkOn(v.accent,[v.ink,v.onAccent]),accent2:mix(v.accent,.75,card),accent4:mix(v.accent,.17,card),accentChip:mix(v.accent,.47,card),link:v.link,linkChip:mix(v.link,.2,card),riskDot:v.riskDot,riskChip:v.dark?c.badgeBgCritical:"#FFD8D6",clearBg:v.clearBg,clearInk:v.clearInk,clearChip:v.dark?c.badgeBgPositive:"#DDEFC4",byInk:c.brandInk}}var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});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]]}}function headingFaceCss(theme,fallback="bold"){let{headingFamily:headingFamily,headingWeight:headingWeight}=theme.type,base=faceCss(theme,fallback);return headingFamily===null&&headingWeight===null?base:headingFamily!==null?{fontFamily:cssFontFamily(headingFamily),fontWeight:headingWeight??theme.type.weight[FACE_WEIGHT[fallback]]}:theme.type.namedFaces[fallback]||headingWeight===null?base:{fontFamily:base.fontFamily,fontWeight:headingWeight}}function isWebDevelopment(){try{return process.env.NODE_ENV!=="production"}catch{return false}}function askIntroTokens(theme){return{...askIntroColors(theme),sans:faceCss(theme,"regular").fontFamily,serif:headingFaceCss(theme,"bold").fontFamily,mono:cssMonoFamily(theme.type.mono)}}var warned=/* @__PURE__ */new Set;function warnUnknownRule(key){warned.has(key)||!isWebDevelopment()||(warned.add(key),globalThis.console?.warn?.(`[everfur] unknown style rule ${key}`))}var camel=prop=>prop.startsWith("--")?prop:prop.replace(/-([a-z])/g,(_m,ch)=>ch.toUpperCase());function askIntroSx(theme,rules,reduced){let tokens=askIntroTokens(theme),dark=theme.brightness==="dark",fill=value=>value.replace(/\$(n_[0-9A-F]{6}|[a-zA-Z0-9]+)/g,(whole,key)=>key.startsWith("n_")?dark?tokens.line??whole:`#${key.slice(2)}`:tokens[key]??whole),cache2=/* @__PURE__ */new Map;return(...selectors)=>{let keys=selectors.filter(s=>typeof s=="string"&&s!==""),id=keys.join("|"),hit=cache2.get(id);if(hit!==void 0)return hit;let out={};for(let key of keys){let decls=rules[key];if(decls===void 0){warnUnknownRule(key);continue}for(let[prop,value]of decls)out[camel(prop)]=fill(value);if(theme.motion.reducedMotion)for(let[prop,value]of reduced[key]??[])out[camel(prop)]=fill(value)}let style=/* @__PURE__ */Object.freeze(out);return cache2.set(id,style),style}}function askIntroReset(theme){let tokens=askIntroTokens(theme);return{root:{boxSizing:"border-box",fontFamily:tokens.sans,fontSize:17,lineHeight:1.5,color:tokens.ink,WebkitFontSmoothing:"antialiased",textRendering:"optimizeLegibility",fontVariationSettings:'"SOFT" 0, "WONK" 0',fontVariantLigatures:"no-common-ligatures"},button:{boxSizing:"border-box",font:"inherit",color:"inherit",background:"none",border:0,padding:0,margin:0,cursor:"pointer",textAlign:"inherit",WebkitTapHighlightColor:"transparent",touchAction:"manipulation"},text:{margin:0,boxSizing:"border-box"},srOnly:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"}}}var CLINIC_REQUEST_COPY=/* @__PURE__ */Object.freeze({title:"Request records",clinic:"Clinic",search:"Search clinics by name or location",placeholder:"Clinic name, city, or ZIP",email:"Clinic email",emailPlaceholder:"records@clinic.com",ownerName:"Your full name",scopeHeading:"What you’re authorizing",send:"Send request",sending:"Sending…",cancel:"Cancel",sign:"Signature",draw:"Draw your signature",type:"Type your name to sign",toType:"Can’t draw? Type your name instead",toDraw:"Draw your signature instead",clear:"Clear",drawHint:"Draw your signature in the box above.",clearA11y:"Clear signature",typedSignatureA11y:name=>`Typed signature: ${name}`,missingSignature:"Please add your signature before submitting.",recentlyUsed:"Recently used",moreClinics:"Load more"});var CLINIC_PICKER_COPY=/* @__PURE__ */Object.freeze({title:CLINIC_REQUEST_COPY.title,titleFor:petName=>{let name=petName?.trim()??"";return name.length>0?`Request ${name}’s records`:CLINIC_REQUEST_COPY.title},leadWeb:"Find the clinic that has them. We send a secure request and read every page they send back.",leadNative:"Find the clinic that has them.",searchLabelWeb:"Find the clinic",howItWorks:"How it works",howSteps:petName=>[{title:"We send a secure request",body:"With your permission, straight to the clinic’s records team."},{title:"The clinic sends the file",body:"Most clinics respond within 3 to 5 business days. We follow up for you."},{title:"Everfur reads every page",body:`Visits, vaccines, labs and prescriptions land in ${petName}’s records.`}],placeholder:CLINIC_REQUEST_COPY.placeholder,searchA11y:CLINIC_REQUEST_COPY.search,clearSearch:"Clear search",loading:"Loading clinics",uploadOwn:"I already have the records",uploadOwnStarting:"Setting up your upload…",noPet:"Add a pet first, then come back to request their records.",recentlyUsed:CLINIC_REQUEST_COPY.recentlyUsed,noMatch:query=>`No clinics match “${query}”. You can still request records using the option above.`,loadingMore:"Loading more…",loadMoreFailed:"Couldn’t load more. Tap to retry.",selectA11y:summary=>`Request records from ${summary}`,resultsCount:count=>count===1?"Showing 1 clinic":`Showing ${String(count)} clinics`,fallback:/* @__PURE__ */Object.freeze({title:"Can’t find your clinic?",subtitle:"Add it by email and we’ll request your records.",nameLabel:"Clinic name",namePlaceholder:"Your clinic’s name",emailLabel:"Clinic email",emailPlaceholder:"records@clinic.com",reviewNote:"We review every request by hand before reaching out to the clinic.",submit:"Continue"})});var KM_PER_MILE=1.609344;function milesLabel(km){return km===null||!Number.isFinite(km)?null:(km/KM_PER_MILE).toFixed(1)}function formatClinicDistanceLabel(km){let miles=milesLabel(km);return miles===null?"":`${miles} mi`}var CLINIC_SEARCH_DEBOUNCE_MS=300,CLINIC_SEARCH_MIN_CHARS=2;var RECORDS_COPY=/* @__PURE__ */Object.freeze({loading:"Loading",empty:"No records yet",upload:"Upload records",consentRequired:"Consent required",allow:"Allow",sessionRequired:"Sign in required",recordUnavailable:"Record unavailable",retry:"Try again",records:"Records",beingReviewed:"being reviewed"});function useClinicPicker(controller,location){let[query,setQueryValue]=react.useState(""),[debouncedQuery,setDebounced]=react.useState(""),[clinics,setClinics]=react.useState([]),[cursor,setCursor]=react.useState(null),[recent,setRecent]=react.useState([]),[recentLoading,setRecentLoading]=react.useState(true),[initialLoading,setInitialLoading]=react.useState(false),[loadingMore,setLoadingMore]=react.useState(false),[error,setError]=react.useState(null),[pageError,setPageError]=react.useState(null),[attempt,setAttempt]=react.useState(0),generation=react.useRef(0),live=react.useRef(true),lat=location?.latitude,lng=location?.longitude,bias=react.useMemo(()=>void 0,[lat,lng]);react.useEffect(()=>(live.current=true,()=>{live.current=false,generation.current+=1}),[controller]),react.useEffect(()=>{let alive=true;return setRecentLoading(true),controller.recentClinics({limit:5}).then(result=>{alive&&(result.ok&&setRecent(result.value.clinics),setRecentLoading(false))}).catch(()=>{alive&&setRecentLoading(false)}),()=>{alive=false}},[controller]),react.useEffect(()=>{let trimmed=query.trim();if(trimmed.length<CLINIC_SEARCH_MIN_CHARS){setDebounced("");return}let handle=setTimeout(()=>setDebounced(trimmed),CLINIC_SEARCH_DEBOUNCE_MS);return()=>clearTimeout(handle)},[query]);let isSearchActive=debouncedQuery.length>=CLINIC_SEARCH_MIN_CHARS;react.useEffect(()=>{let revision=generation.current+=1;if(setClinics([]),setCursor(null),setError(null),setPageError(null),!isSearchActive){setInitialLoading(false);return}setInitialLoading(true),controller.searchClinics({query:debouncedQuery,limit:25,...bias?{location:bias}:{}}).then(result=>{!live.current||revision!==generation.current||(result.ok?(setClinics(result.value.clinics),setCursor(result.value.nextCursor)):setError(result.error),setInitialLoading(false))}).catch(()=>{live.current&&revision===generation.current&&setInitialLoading(false)})},[controller,debouncedQuery,isSearchActive,bias,attempt]);let loadMore=react.useCallback(()=>{if(!isSearchActive||cursor===null||loadingMore)return;let revision=generation.current;setLoadingMore(true),setPageError(null),controller.searchClinics({query:debouncedQuery,limit:25,cursor:cursor,...bias?{location:bias}:{}}).then(result=>{!live.current||revision!==generation.current||(result.ok?(setClinics(current=>[...current,...result.value.clinics]),setCursor(result.value.nextCursor)):setPageError(result.error),setLoadingMore(false))}).catch(()=>{live.current&&revision===generation.current&&setLoadingMore(false)})},[controller,cursor,debouncedQuery,isSearchActive,loadingMore,bias]),setQuery=react.useCallback(value=>setQueryValue(value),[]),retry=react.useCallback(()=>setAttempt(n=>n+1),[]);return react.useMemo(()=>({query:query,debouncedQuery:debouncedQuery,isSearchActive:isSearchActive,clinics:clinics,recent:recent,recentLoading:recentLoading,initialLoading:initialLoading,loadingMore:loadingMore,hasNextPage:cursor!==null,error:error,pageError:pageError,setQuery:setQuery,loadMore:loadMore,retry:retry}),[query,debouncedQuery,isSearchActive,clinics,recent,recentLoading,initialLoading,loadingMore,cursor,error,pageError,setQuery,loadMore,retry])}function clinicDraftFor(clinic,freeText,email,idempotencyKey){/* @__PURE__ */
102
+ return Object.freeze({key:clinic?.id??`free:${freeText??""}`,clinic:clinic,freeText:freeText,email:email,idempotencyKey:idempotencyKey})}var STROKE={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"};function paths(name){switch(name){case"chat":/* @__PURE__ */
103
+ return jsxRuntime.jsx("path",{...STROKE,strokeLinecap:"butt",strokeWidth:1.7,d:"M5 5.2h14a1.6 1.6 0 0 1 1.6 1.6v8.6a1.6 1.6 0 0 1-1.6 1.6h-8.7l-4.8 3.6v-3.6H5a1.6 1.6 0 0 1-1.6-1.6V6.8A1.6 1.6 0 0 1 5 5.2z"});case"heartcheck":/* @__PURE__ */
104
+ return jsxRuntime.jsxs("g",{...STROKE,strokeWidth:1.8,children:[
105
+ /* @__PURE__ */jsxRuntime.jsx("path",{d:"M12 20.2s-7.6-4.6-7.6-10.1A4.3 4.3 0 0 1 12 7.6a4.3 4.3 0 0 1 7.6 2.5c0 5.5-7.6 10.1-7.6 10.1z"}),
106
+ /* @__PURE__ */jsxRuntime.jsx("path",{d:"m8.9 12.7 2.1 2.1 4-4.2"})]});case"file":/* @__PURE__ */
107
+ return jsxRuntime.jsx("path",{...STROKE,strokeWidth:1.7,d:"M7 3.5h7.2l4.3 4.3v12.2a.6.6 0 0 1-.6.6H7a.6.6 0 0 1-.6-.6V4.1a.6.6 0 0 1 .6-.6zM14 3.6V8h4.4M9.4 12.4h5.2M9.4 15.8h5.2"});case"back":/* @__PURE__ */
108
+ return jsxRuntime.jsx("path",{...STROKE,strokeWidth:2.2,d:"M15 5 8 12l7 7"});case"x":/* @__PURE__ */
109
+ return jsxRuntime.jsx("path",{...STROKE,strokeWidth:2,d:"M6.5 6.5l11 11M17.5 6.5l-11 11"});case"search":/* @__PURE__ */
110
+ return jsxRuntime.jsxs("g",{...STROKE,strokeWidth:1.8,children:[
111
+ /* @__PURE__ */jsxRuntime.jsx("circle",{cx:"10.8",cy:"10.8",r:"6"}),
112
+ /* @__PURE__ */jsxRuntime.jsx("path",{d:"m15.4 15.4 4.4 4.4"})]});case"check":/* @__PURE__ */
113
+ return jsxRuntime.jsx("path",{...STROKE,strokeWidth:2.4,d:"m5 12.6 4.4 4.4L19 7.4"});case"bell":/* @__PURE__ */
114
+ return jsxRuntime.jsx("path",{...STROKE,strokeWidth:1.6,d:"M6.4 16.6V11a5.6 5.6 0 0 1 11.2 0v5.6l1.6 1.9H4.8zM9.9 20.6a2.3 2.3 0 0 0 4.2 0"})}}function IntroIcon({name:name,style:style}){/* @__PURE__ */
115
+ return jsxRuntime.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",style:{display:"block",...style},children:paths(name)})}var WORDMARK="M15.27 10.93 15.2 11 15.2 12.83 15.23 12.87 16.37 12.87 16.7 12.97 17.03 13.17 17.33 13.47 17.73 14.07 18.03 14.77 18.03 14.87 18.13 15 18.13 15.1 18.73 16.47 18.83 16.8 19.13 17.43 19.13 17.53 19.23 17.67 19.23 17.77 19.53 18.4 19.53 18.5 19.83 19.13 19.83 19.23 19.93 19.37 19.93 19.47 20.63 21.07 20.63 21.17 21.03 22.03 21.13 22.37 21.33 22.77 21.33 22.87 21.43 23 21.43 23.1 21.63 23.5 21.63 23.6 21.73 23.73 21.83 24.07 22.13 24.7 22.13 24.8 22.23 24.93 22.23 25.03 22.43 25.43 22.43 25.53 22.53 25.67 22.53 25.77 22.83 26.4 22.83 26.5 23.03 26.97 23.13 27.07 25.83 27.07 25.93 26.93 26.23 26.13 26.3 26.07 26.3 25.97 26.5 25.57 26.5 25.47 26.6 25.33 26.6 25.23 26.9 24.6 26.9 24.5 27.2 23.87 27.53 22.97 27.6 22.9 27.6 22.8 27.67 22.73 28.3 21.1 28.6 20.47 28.6 20.37 28.8 19.97 28.8 19.87 28.9 19.73 28.9 19.63 29.2 19 29.2 18.9 29.27 18.83 29.3 18.67 29.5 18.27 29.5 18.17 29.9 17.3 29.9 17.2 30.2 16.57 30.2 16.47 30.5 15.83 30.53 15.67 31.3 13.83 31.57 13.4 31.93 13.07 32.17 12.97 32.63 12.87 33.77 12.87 33.8 12.83 33.8 10.97 33.77 10.93 26.6 10.93 26.57 10.97 26.57 12.87 28.6 12.87 28.93 12.97 29.13 13.17 29.17 13.67 29.07 14.03 28.43 15.53 28.43 15.63 27.93 16.8 27.93 16.9 27.73 17.3 27.73 17.4 27.53 17.8 27.4 18.23 27.33 18.3 27.33 18.4 26.77 19.73 26.63 20.17 26.43 20.57 26.43 20.67 26.23 21.07 26.23 21.17 26.03 21.57 26.03 21.67 25.33 23.33 25.33 23.43 25.13 23.83 25.13 23.93 25.03 24.07 24.97 24.07 24.6 23.2 24.6 23.1 24.4 22.7 24.3 22.33 23.7 20.93 23.7 20.83 23.6 20.67 23.3 19.83 23.2 19.67 23.2 19.57 23 19.17 23 19.07 22.8 18.67 22.7 18.3 22.63 18.23 22.6 18.07 22.3 17.4 22.3 17.3 22.1 16.9 22.1 16.8 21.9 16.4 21.9 16.3 21.2 14.63 21.2 14.53 20.9 13.87 20.83 13.6 20.83 13.27 20.9 13.13 21.07 12.97 21.37 12.87 23.7 12.87 23.7 10.97 23.67 10.93ZM63.1 11.4 62.73 11.13 62.13 10.8 62.03 10.8 61.6 10.6 61.47 10.6 61.2 10.5 60.6 10.4 60.07 10.4 60.03 10.37 59.37 10.4 59.2 10.47 58.87 10.5 58.03 10.8 57.57 11.03 56.87 11.5 56.07 12.23 55.53 12.9 55.23 13.37 55.2 13.5 55.07 13.57 55.03 13.53 55.03 10.97 55 10.93 48.97 10.93 48.93 10.97 48.93 12.87 51.07 12.87 51.37 12.97 51.53 13.07 51.8 13.37 51.93 13.67 52 14.03 52 23.93 51.9 24.4 51.73 24.7 51.4 25 51.13 25.1 48.97 25.1 48.93 25.13 48.93 27.03 48.97 27.07 59.07 27.07 59.1 27.03 59.1 25.13 59.03 25.1 58.97 25.13 56.03 25.1 55.67 24.93 55.33 24.6 55.2 24.33 55.1 24 55.1 19.2 55.3 17.6 55.4 17.27 55.4 17.1 55.5 16.87 55.5 16.7 55.7 16.03 56.1 15.03 56.53 14.23 57.03 13.53 57.6 12.97 58 12.67 58.6 12.37 59.2 12.23 60.1 12.27 60.43 12.37 60.73 12.57 60.73 12.67 60.6 12.73 60.03 13.37 59.73 14.13 59.7 14.63 59.77 15.17 59.83 15.4 60.23 16.1 60.57 16.43 60.9 16.67 61.37 16.87 61.67 16.93 62.47 16.93 62.77 16.87 63.43 16.53 63.9 16.1 64.2 15.63 64.4 15.03 64.43 14.27 64.3 13.27 64.1 12.8 64.1 12.7 63.6 11.90ZM39.93 10.3 38.6 10.6 38.43 10.7 38.33 10.7 37.8 10.9 36.93 11.33 36.5 11.6 35.6 12.3 34.97 12.93 34.43 13.6 33.93 14.4 33.43 15.5 33.03 16.97 32.9 18 32.9 19.67 33.03 20.63 33.23 21.33 33.23 21.47 33.47 22.13 33.53 22.2 33.53 22.3 33.83 22.93 34.3 23.7 34.87 24.43 35.6 25.17 36.67 25.97 36.73 25.97 37 26.17 37.6 26.47 38.23 26.73 38.73 26.87 38.93 26.97 39.53 27.07 39.83 27.17 40.07 27.17 40.6 27.27 41.23 27.27 41.27 27.3 42.37 27.27 42.83 27.17 43.07 27.17 43.2 27.1 43.5 27.07 44.2 26.87 44.63 26.67 44.73 26.67 45.33 26.37 45.83 26.07 46.37 25.67 47.2 24.87 47.8 24.07 48.3 23.1 48.5 22.53 48.6 22.07 48.67 21.17 48.53 21.1 48.5 21.13 46.87 21.13 46.83 21.1 46.73 21.13 46.53 22.07 46.33 22.57 46 23.17 45.73 23.53 45.2 24.1 44.37 24.7 43.73 25 42.77 25.27 42.13 25.33 40.87 25.3 39.97 25.07 39.3 24.77 38.87 24.5 38.2 23.93 37.6 23.2 37.1 22.33 36.73 21.3 36.5 20.07 36.5 19.53 36.47 19.5 36.5 19.33 36.6 19.27 36.67 19.3 48.6 19.3 48.63 19.27 48.77 19.3 48.83 19.23 48.83 18.27 48.8 18.23 48.8 17.33 48.7 16.87 48.7 16.63 48.4 15.37 48.2 14.8 47.8 13.93 47.5 13.43 47 12.77 46.4 12.13 45.8 11.63 44.97 11.1 44.57 10.9 44.17 10.77 44.1 10.7 43.1 10.4 42.93 10.4 42.6 10.3 41.53 10.23 41.5 10.20ZM36.6 16.43 36.9 15.3 37.33 14.37 37.9 13.57 38.53 12.97 38.97 12.67 39.37 12.47 40.4 12.17 41.43 12.13 42.03 12.2 42.93 12.47 43.37 12.7 43.73 12.97 44.33 13.57 44.83 14.33 45.23 15.33 45.43 16.13 45.57 17.5 45.5 17.63 36.57 17.63 36.5 17.53ZM7.03 10.3 6.1 10.5 5.87 10.6 5.73 10.6 5.57 10.7 5.43 10.7 4.7 11 4.07 11.33 3.33 11.8 2.83 12.2 2.03 13 1.63 13.5 1.13 14.27 0.73 15.07 0.43 15.87 0.23 16.6 0.03 17.83 0.03 18.4 0 18.43 0.03 19.8 0.13 20.27 0.13 20.5 0.33 21.37 0.47 21.8 0.63 22.13 0.63 22.23 0.83 22.7 1.33 23.57 1.93 24.37 2.83 25.27 3.63 25.87 3.7 25.87 4.13 26.17 4.93 26.57 5.03 26.57 5.37 26.73 5.87 26.87 6.07 26.97 6.67 27.07 6.97 27.17 7.2 27.17 7.73 27.27 8.4 27.27 8.43 27.3 9.47 27.27 9.93 27.17 10.17 27.17 11.03 26.97 11.2 26.87 11.6 26.77 12.27 26.47 12.57 26.27 12.63 26.27 12.73 26.17 12.8 26.17 13.5 25.67 14.27 24.93 14.9 24.1 15.4 23.17 15.7 22.2 15.8 21.57 15.8 21.17 15.7 21.1 15.67 21.13 13.87 21.13 13.8 21.27 13.73 21.8 13.67 21.9 13.53 22.4 13.03 23.3 12.8 23.6 12.2 24.2 11.3 24.8 10.57 25.1 9.67 25.3 9.23 25.3 9.2 25.33 8 25.3 7.1 25.07 6.3 24.7 5.5 24.1 5.2 23.8 4.7 23.17 4.3 22.5 3.9 21.47 3.7 20.57 3.7 20.3 3.6 19.77 3.6 19.37 3.7 19.27 3.8 19.3 15.7 19.3 15.73 19.27 15.87 19.3 15.93 19.27 15.93 17.63 15.8 16.43 15.73 16.3 15.57 15.5 15.5 15.4 15.3 14.73 15.1 14.27 14.6 13.4 14.1 12.73 13.27 11.9 12.6 11.4 12.2 11.2 12.1 11.1 11.3 10.73 10.73 10.53 9.73 10.3 8.7 10.23 8.67 10.20ZM3.63 17.23 3.8 16.07 4.03 15.27 4.43 14.4 4.93 13.67 5.7 12.93 6.1 12.67 6.73 12.37 7.53 12.17 8.6 12.13 8.63 12.17 9.03 12.17 9.33 12.27 9.5 12.27 10.27 12.57 10.87 12.97 11.43 13.53 11.63 13.8 12.13 14.7 12.13 14.8 12.23 14.93 12.43 15.6 12.63 16.67 12.67 17.57 12.6 17.63 3.7 17.63 3.63 17.57 3.67 17.40ZM107.57 12.4 107.2 11.87 106.73 11.4 106.37 11.13 105.77 10.8 105.4 10.7 105.23 10.6 104.27 10.4 103.8 10.4 103.77 10.37 102.97 10.4 101.87 10.7 101.23 11 100.97 11.2 100.9 11.2 100.13 11.8 99.63 12.3 99.13 12.93 98.83 13.47 98.7 13.57 98.67 13.53 98.67 11 98.6 10.93 92.63 10.93 92.57 11 92.57 12.83 92.6 12.87 94.7 12.87 94.9 12.97 95 12.97 95.33 13.23 95.53 13.6 95.63 14.03 95.63 23.93 95.53 24.37 95.4 24.63 95.17 24.9 94.77 25.1 91.53 25.1 91.27 25 91 24.77 90.8 24.43 90.7 24.13 90.7 11 90.63 10.93 84.57 10.93 84.53 10.97 84.53 12.87 86.5 12.87 86.77 12.93 87.1 13.1 87.33 13.33 87.5 13.67 87.6 14.37 87.57 14.4 87.57 17.77 87.6 17.8 87.57 17.83 87.5 19.5 87.23 21 86.93 22 86.83 22.17 86.83 22.27 86.3 23.3 85.73 24.07 85.4 24.4 84.9 24.8 84.13 25.2 83.6 25.37 83.07 25.47 82.07 25.47 81.87 25.4 81.67 25.4 81.03 25.2 80.67 25 80.27 24.7 79.8 24.17 79.53 23.67 79.3 22.83 79.3 11 79.23 10.93 73.8 10.93 73.73 10.83 73.9 10.5 73.93 10.33 74.07 10.13 74.23 9.63 74.4 9.37 74.47 9.1 74.9 8.23 74.93 8 75.3 7.33 75.37 7.03 75.7 6.47 75.7 6.37 75.87 6.13 76.37 5.1 76.5 5 76.63 4.73 76.83 4.53 77 4.23 77.67 3.57 77.93 3.37 78.4 3.17 78.83 3.07 79.6 3.1 80.17 3.37 80.27 3.37 81.17 3.97 81.43 4.07 81.6 4.07 81.63 3.87 81.87 3.53 82.03 2.9 82.2 2.8 82.2 2.6 82.33 2.33 82.33 1.9 82.3 1.8 81.9 1.4 81.7 1.3 81.2 0.9 80.77 0.7 80.67 0.6 80.23 0.4 80.13 0.4 79.97 0.27 79.77 0.27 79.6 0.13 79.4 0.17 79.27 0.07 77.97 0 77.83 0.07 77.37 0.1 77.07 0.2 77 0.27 76.8 0.27 76.63 0.4 76.47 0.43 76.3 0.57 76.17 0.6 75.67 1 75.6 1.13 75.2 1.53 74.93 1.93 74.7 2.17 74.37 2.67 74.33 2.83 74.2 3 73.83 3.83 73.67 4.03 73.43 4.6 73.27 4.8 72.43 6.4 71.63 8.27 71.33 8.83 71.33 8.93 71.13 9.3 70.93 9.87 70.83 10 70.73 10.37 70.63 10.53 70.63 10.63 70.47 10.9 70.4 10.93 64.67 10.93 64.67 11.03 65.57 12.87 69.57 12.87 69.63 13 69.43 13.4 69.43 13.5 69.33 13.67 69.23 14 69.13 14.13 69.13 14.27 69.03 14.4 69 14.63 68.83 14.93 68.5 15.97 68.23 16.5 68.13 16.9 68.03 17.03 67.93 17.4 67.63 18 67.63 18.1 67.53 18.23 66.9 19.93 66.77 20.13 66.77 20.33 66.47 20.9 66.37 21.33 66.13 21.77 66.13 21.9 65.97 22.17 65.9 22.47 65.73 22.8 65.73 22.9 65.63 23.07 65.53 23.43 65.43 23.57 65.33 23.93 64.87 24.97 64.73 25.47 64.63 25.6 64.6 25.77 64.47 26 64.43 26.2 64.03 27.07 63.93 27.43 63.73 27.8 63.7 28.03 63.57 28.3 63.53 28.5 63.23 29.13 63.13 29.53 63.03 29.67 62.93 30 62.83 30.17 62.83 30.27 62.43 31.17 62.4 31.37 62.33 31.43 62.3 31.7 62.13 31.97 61.93 32.7 61.83 32.83 61.7 33.33 61.63 33.4 61.43 33.9 61.3 34.4 61.13 34.7 61.03 35.1 60.93 35.27 60.93 35.4 60.83 35.53 60.53 36.27 60.03 37.27 60.03 37.4 59.93 37.57 59.83 38.03 59.73 38.2 59.7 38.37 59.73 38.4 59.8 38.37 59.93 38.2 60.1 38.07 60.17 38.07 60.4 37.77 61.37 36.07 61.43 35.77 61.67 35.57 62 34.97 62.2 34.73 62.43 34.27 62.8 33.73 63.3 32.83 63.4 32.73 63.4 32.67 63.57 32.43 63.6 32.3 63.7 32.2 63.97 31.63 64.3 31.13 64.4 30.83 64.9 30 66.3 27.2 66.4 26.87 66.8 26.1 67.1 25.33 67.4 24.8 67.5 24.47 68.1 23.27 68.17 23.03 68.3 22.8 68.3 22.7 68.8 21.73 68.8 21.6 69.9 19.47 70 19.17 70.2 18.8 70.3 18.47 70.7 17.7 70.8 17.33 71.2 16.6 71.3 16.27 71.6 15.7 71.8 15.13 71.9 15 71.9 14.9 72.2 14.3 72.3 13.97 72.57 13.5 72.77 12.97 72.87 12.87 75.13 12.87 75.7 13.1 75.9 13.3 76.13 13.8 76.17 14.07 76.17 22.9 76.2 22.93 76.23 23.63 76.53 24.7 76.93 25.47 77.3 25.93 77.67 26.3 78 26.57 78.67 26.97 79.13 27.17 80.17 27.47 80.83 27.57 81.87 27.6 81.9 27.63 81.93 27.6 82.43 27.6 83 27.53 83.17 27.47 83.33 27.47 83.57 27.37 83.7 27.37 84.5 27.07 85.4 26.57 86.27 25.87 86.8 25.3 87.4 24.47 87.57 24.13 87.67 24.17 87.67 27 87.73 27.07 102.7 27.07 102.77 26.97 102.73 26.9 102.73 25.23 102.77 25.17 102.7 25.1 99.7 25.1 99.4 25 98.97 24.6 98.8 24.27 98.7 23.7 98.7 19.87 98.73 19.83 98.8 18.47 98.9 17.97 98.9 17.73 99.2 16.43 99.3 16.23 99.43 15.73 99.6 15.4 99.6 15.3 100.13 14.27 100.6 13.6 101.27 12.93 101.8 12.57 102.43 12.3 102.8 12.23 103.5 12.23 104.07 12.37 104.37 12.57 104.37 12.63 103.93 13 103.67 13.37 103.43 13.87 103.33 14.33 103.33 14.83 103.43 15.3 103.77 15.97 104.33 16.53 105 16.87 105.17 16.87 105.33 16.93 106.07 16.93 106.63 16.77 107.27 16.37 107.6 16 107.9 15.47 107.9 15.37 108 15.17 108.03 14.2 108.07 14.17 108 13.87 108 13.6 107.8 12.87Z";function EverfurWordmark({style:style}){/* @__PURE__ */
116
+ return jsxRuntime.jsx("svg",{viewBox:"0 0 108.10 38.43","aria-hidden":"true",focusable:"false",style:{display:"block",...style},children:/* @__PURE__ */jsxRuntime.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:WORDMARK})})}var EMAIL=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function whereOf(clinic){return[clinic.address?.trim()??"",formatClinicDistanceLabel(clinic.distanceKm)].filter(part=>part!=="").join(" · ")}function clinicFrameOver(m){return function({sx:sx,reset:reset,text:text,titleId:titleId,titleRef:titleRef,onPick:onPick,onUpload:onUpload}){let controller=m.useEverfurRecordsClinic(),picker=useClinicPicker(controller),keys=react.useRef(defaultIdempotencyKeyFactory()),[picked,setPicked]=react.useState(null),[adding,setAdding]=react.useState(false),[name,setName]=react.useState(""),[email,setEmail]=react.useState(""),rows=picker.isSearchActive?picker.clinics:picker.recent,chosen=rows.find(clinic=>clinic.id===picked)??rows[0]??null,none=picker.isSearchActive&&!picker.initialLoading&&picker.error===null&&rows.length===0,fallbackName=name.trim()===""?picker.query.trim():name.trim(),fallbackReady=fallbackName!==""&&EMAIL.test(email.trim()),request=()=>{if(adding){fallbackReady&&onPick(clinicDraftFor(null,fallbackName,email.trim().toLowerCase(),keys.current()));return}chosen!==null&&onPick(clinicDraftFor(chosen,null,"",keys.current()))},ready=adding?fallbackReady:chosen!==null,button=reset.button,field={...sx(".in-search input")};/* @__PURE__ */
117
+ return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[
118
+ /* @__PURE__ */jsxRuntime.jsx("h3",{id:titleId,ref:titleRef,tabIndex:-1,style:{...reset.text,...sx(".serif",".in-h")},children:text.title}),
119
+ /* @__PURE__ */jsxRuntime.jsxs("label",{style:sx(".in-search"),children:[
120
+ /* @__PURE__ */jsxRuntime.jsx(IntroIcon,{name:"search",style:sx(".in-search svg")}),
121
+ /* @__PURE__ */jsxRuntime.jsx("input",{type:"search",value:picker.query,placeholder:text.search,"aria-label":text.searchLabel,autoComplete:"off",style:field,onChange:event=>{picker.setQuery(event.target.value),setAdding(false)},onKeyDown:event=>{event.key==="Enter"&&(event.preventDefault(),request())}})]}),adding?/* @__PURE__ */jsxRuntime.jsxs("div",{style:sx(".in-clinics"),children:[
122
+ /* @__PURE__ */jsxRuntime.jsx("label",{style:sx(".in-search"),children:/* @__PURE__ */jsxRuntime.jsx("input",{type:"text",value:name===""?picker.query:name,placeholder:CLINIC_PICKER_COPY.fallback.namePlaceholder,"aria-label":CLINIC_PICKER_COPY.fallback.nameLabel,autoComplete:"off",maxLength:200,style:field,onChange:event=>setName(event.target.value)})}),
123
+ /* @__PURE__ */jsxRuntime.jsx("label",{style:sx(".in-search"),children:/* @__PURE__ */jsxRuntime.jsx("input",{type:"email",value:email,placeholder:CLINIC_PICKER_COPY.fallback.emailPlaceholder,"aria-label":CLINIC_PICKER_COPY.fallback.emailLabel,autoComplete:"off",maxLength:320,style:field,onChange:event=>setEmail(event.target.value)})}),
124
+ /* @__PURE__ */jsxRuntime.jsx("p",{style:{...reset.text,...sx(".in-p",".in-p--s")},children:CLINIC_PICKER_COPY.fallback.reviewNote})]}):/* @__PURE__ */jsxRuntime.jsxs("div",{role:"radiogroup","aria-label":text.list,"aria-busy":picker.initialLoading||!picker.isSearchActive&&picker.recentLoading,style:sx(".in-clinics"),children:[rows.map(clinic=>{let on=chosen?.id===clinic.id,where=whereOf(clinic);/* @__PURE__ */
125
+ return jsxRuntime.jsxs("button",{type:"button",role:"radio","aria-checked":on,style:{...button,...sx(".in-clinic",on&&'.in-clinic[aria-checked="true"]')},onClick:()=>setPicked(clinic.id),children:[
126
+ /* @__PURE__ */jsxRuntime.jsxs("span",{children:[
127
+ /* @__PURE__ */jsxRuntime.jsx("b",{style:sx(".in-clinic b"),children:clinic.name}),where===""?null:/* @__PURE__ */jsxRuntime.jsx("small",{style:sx(".in-clinic small"),children:where})]}),
128
+ /* @__PURE__ */jsxRuntime.jsx("span",{style:sx(".in-tick",on&&'.in-clinic[aria-checked="true"] .in-tick'),children:/* @__PURE__ */jsxRuntime.jsx(IntroIcon,{name:"check",style:sx(".in-tick svg",on&&'.in-clinic[aria-checked="true"] .in-tick svg')})})]},clinic.id)}),picker.error!==null&&picker.isSearchActive?/* @__PURE__ */jsxRuntime.jsxs("p",{role:"alert",style:{...reset.text,...sx(".in-none")},children:[picker.error.displayMessage,picker.error.retryable?/* @__PURE__ */jsxRuntime.jsx("button",{type:"button",style:{...button,...sx(".in-link",".in-none .in-link")},onClick:picker.retry,children:RECORDS_COPY.retry}):null]}):null,none?/* @__PURE__ */jsxRuntime.jsxs("p",{style:{...reset.text,...sx(".in-none")},children:[`${CLINIC_PICKER_COPY.fallback.title} ${CLINIC_PICKER_COPY.fallback.subtitle}`
129
+ /* @__PURE__ */,jsxRuntime.jsx("button",{type:"button",style:{...button,...sx(".in-link",".in-none .in-link")},onClick:()=>setAdding(true),children:text.add})]}):null]}),
130
+ /* @__PURE__ */jsxRuntime.jsx("p",{style:{...reset.text,...sx(".in-p",".in-p--s")},children:text.more}),
131
+ /* @__PURE__ */jsxRuntime.jsx("button",{type:"button",disabled:!ready,style:{...button,...sx(".emb-btn",".emb-btn--block",".in-body .emb-btn",!ready&&".emb-btn[disabled]")},onClick:request,children:text.request}),onUpload===void 0?null:/* @__PURE__ */jsxRuntime.jsx("button",{type:"button",style:{...button,...sx(".in-link")},onClick:onUpload,children:text.upload})]})}}function consentFrameOver(m){return function({petRef:petRef,petName:petName,draft:draft,ownerName:ownerName,onCaptureSignature:onCaptureSignature,onCreated:onCreated}){/* @__PURE__ */
132
+ return jsxRuntime.jsx(m.EverfurRecordsConsent,{petRef:petRef,...petName===void 0?{}:{petName:petName},clinic:draft,...ownerName===void 0?{}:{ownerName:ownerName},...onCaptureSignature===void 0?{}:{onCaptureSignature:onCaptureSignature},onCreated:onCreated})}}var loading=null;function loadClinicFrames(){return loading===null&&(loading=import("@everfur/sdk/web/records").then(m=>({Clinic:clinicFrameOver(m),Consent:consentFrameOver(m)}),()=>(loading=null,null))),loading}function useClinicFrames(wanted){let[frames,setFrames]=react.useState(null);return react.useEffect(()=>{if(!wanted||frames!==null)return;let live=true;return loadClinicFrames().then(loaded=>{live&&loaded!==null&&setFrames(loaded)}),()=>{live=false}},[wanted,frames]),react.useMemo(()=>frames,[frames])}function healthPlanPetWords(name,sex){let n=name?.trim()??"",named=n===""?"your pet":n,Named=n===""?"Your pet":n;return sex==="female"?{name:named,Name:Named,poss:"her",Poss:"Her",obj:"her"}:sex==="male"?{name:named,Name:Named,poss:"his",Poss:"His",obj:"him"}:{name:named,Name:Named,poss:`${named}'s`,Poss:`${Named}'s`,obj:named}}var cartRenewal=p=>p===null?"":`${p.productName} renews every ${p.intervalDays} days at ${p.box??""} until you cancel; skip or cancel anytime in the app.`;function healthPlanFocusCopyFor(pet){let w=healthPlanPetWords(pet.name,pet.sex),nameOf=p=>p.petName?.trim()||w.name,NameOf=p=>p.petName?.trim()||w.Name,copy=/* @__PURE__ */Object.freeze({jumpKicker:(p,subscribed)=>subscribed?`In ${w.poss} plan, every ${p.intervalDays} days`:p.offer?`${p.discountPercent}% off ${w.poss} first box`:p.intervalDays>0?`Ships every ${p.intervalDays} days`:copy.onceLine(p),optionsLabel:"How to buy",subscribe:"Subscribe",bestValue:"Best value",subscribeLine:p=>p.offer?`First box, then ${p.box??""}`:`${p.box??""} every ${p.intervalDays} days`,priceLine:p=>p.offer?`${p.discountPercent}% off the first box. Ships every ${p.intervalDays} days.`:p.intervalDays>0?`Ships every ${p.intervalDays} days.`:copy.onceOffer(p),once:"One box",onceLine:p=>p.onceDiscountPercent>0?`${p.onceDiscountPercent}% off, ships once`:"Ships once",buyOnce:p=>`Buy one box, ${p.once??p.box??""}`,subscribed:"Subscribed",subscribedLine:(p,next)=>next===null?`Every ${p.intervalDays} days`:`Every ${p.intervalDays} days · next box ${next}`,manage:"Manage",checkoutKicker:"Checkout",checkoutTitle:p=>`Checkout: ${p.productName}`,checkoutOffer:p=>`${p.discountPercent}% off your first box.`,shipsEvery:"Ships every",days:n=>`${n} days`,buyOnceOption:"Buy once",checkoutGo:(_p,subscribe,today)=>`${subscribe?"Subscribe":"Buy now"} · ${today} today`,renews:p=>`Renews every ${p.intervalDays} days at ${p.box??""} until you cancel; skip or cancel anytime in the app.`,onceFine:"One box, ships tomorrow.",onceOffer:p=>p.onceDiscountPercent>0?`${p.onceDiscountPercent}% off, ships once.`:"Ships once.",checkoutNote:"",close:"Close",startedTitle:p=>`${NameOf(p)}'s plan has started.`,orderedTitle:()=>"Order placed.",startedWhat:p=>`${p.productName} ships tomorrow.`,startedNote:"",startedSteps:"What happens next",tomorrow:"Tomorrow",firstBoxShips:`${w.Poss} first box ships.`,trackingComesByText:"Tracking comes by text.",checkin:q=>q===null?"A 2-week check-in by text.":`A 2-week check-in by text: ${q}`,refill:`A text 3 days before ${w.poss} next box. Reply SKIP to skip it.`,nextBoxShips:p=>`${w.Poss} next box ships, ${p.box??""}.`,startedDone:`Back to ${w.poss} plan`,manageKicker:"Your subscription",manageTitle:p=>`Manage ${p.productName}`,skip:"Skip the next box",cancel:"Cancel subscription",skipped:(_p,next)=>next===null?"Skipped.":`Skipped. ${w.Poss} next box ships ${next}.`,cancelled:p=>`${p.productName} is cancelled. Restart it from ${w.poss} plan anytime.`,orders:"Orders",startedHeader:"Subscribed",placedHeader:"Order placed",cartCheckoutTitle:"Checkout",orderNote:"",cartLabel:n=>n>0?`Cart, ${n} item${n>1?"s":""}`:"Cart, empty",addToCart:price=>`Add to cart · ${price}`,viewCart:"View cart",addedToCart:(p,subscription)=>`${p.productName} is in your cart${subscription?", as a subscription":""}.`,removedFromCart:name=>`${name} is out of your cart.`,cartTitle:"Cart",cartEmptyTitle:"Your cart is empty",cartEmptyBody:p=>`${NameOf(p)}'s plan pick lands here when you add it.`,seeOrders:`See ${w.poss} orders`,quantityLabel:name=>`How many: ${name}`,fewer:"One fewer",more:"One more",remove:"Remove",cartSubLine:p=>p.offer?`First box ${p.discountPercent}% off, then ${p.box??""} every ${p.intervalDays} days`:`Every ${p.intervalDays} days`,cartOnceLine:(p,subscribed)=>subscribed?`An extra box. ${w.Poss} plan keeps shipping.`:p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",cartModeLabel:name=>`How to buy ${name}`,cartModeSubscribe:p=>p.offer?`Subscribe, ${p.discountPercent}% off the first box`:"Subscribe",cartModeOnce:p=>p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",subtotal:"Subtotal",shipping:"Shipping",shippingValue:"",shippingTag:"",total:"Total",dueToday:"Due today",thenRenews:p=>`Then ${p.productName}`,renewsEvery:p=>`${p.box??""} every ${p.intervalDays} days`,checkoutCart:total=>`Checkout · ${total}`,cartOneAtATime:"",cartSubscriptionApart:"",cartItemSubscription:p=>`Subscription, every ${p.intervalDays} days`,cartItemQuantity:n=>`Qty ${n}`,placeOrder:(total,subscribe)=>`${subscribe?"Place order and subscribe":"Place order"} · ${total}`,cartFine:p=>`${p===null?"":`${cartRenewal(p)} `}Ships tomorrow.`,placedSteps:"What's coming",placedShips:"It ships.",placedArrives:"It arrives at home.",viewOrder:"View order",herSubscription:`${w.Poss} subscription`,nextBox:day=>`Next box ${day}`,everyDays:n=>`Every ${n} days`,ordersHeading:afterSubscription=>afterSubscription?"Orders":`${w.Poss} orders`,ordersFine:"",ordersEmptyTitle:"No orders yet",ordersEmptyBody:p=>`The boxes from ${nameOf(p)}'s plan show up here.`,moreOrders:"",orderSteps:["Ordered","Shipped","Out for delivery","Delivered"],subscriptionBox:"Subscription box",orderTitle:n=>n===null?"Order":`Order ${n}`,arrivesBy:day=>`Arrives by ${day}`,deliveredOn:day=>`Delivered ${day}`,expected:day=>`Expected ${day}`,tracking:"Tracking",trackingByText:"The tracking number comes by text when it ships.",trackOn:carrier=>`Track on ${carrier}`,trackLink:"",inThisOrder:"In this order",orderItemLine:(n,box)=>`Qty ${n}${box?" · subscription box":""}`,paidWith:"Paid with",buyAgain:"Buy again",orderHelp:"Get help with this order",addWeightTitle:`Add ${w.poss} weight to size ${w.poss} dose`,addWeightBody:`From a home scale or ${w.poss} last vet visit.`,connectRecordsTitle:`Connect ${w.poss} vet records`,connectRecordsBody:`${w.Poss} weight, visits and labs make ${w.poss} plan sharper.`,weightKicker:`${w.Poss} weight`,weightTitle:p=>`Add ${nameOf(p)}'s weight`,weightBody:`From a home scale or ${w.poss} last vet visit. ${w.Poss} plan uses it to size ${w.poss} dose.`,weightField:`${w.Poss} weight`,weightUnit:"lb",weightUnitKg:"kg",weightErrorKg:"Enter your pet’s weight",weightError:`Enter ${w.poss} weight in pounds, like 14.1.`,weightSave:`Save ${w.poss} weight`,weightSaved:lb=>`Saved: ${lb} lb. ${w.Poss} dose is sized for ${w.obj}.`,weightSavedKg:kg=>`Saved: ${kg} kg. ${w.Poss} dose is sized for ${w.obj}.`,checkoutFailed:"That didn't go through. Please try again.",builtWith:vet=>`Built with ${vet}`,fromVet:shortName=>`From ${shortName}`,waitVetTips:vet=>`Free tips from ${vet}, built around that risk`,signalsFit:count=>`${count} of ${count} signals fit ${w.Name}`,signalsValue:count=>`${count}/${count}`,noPick:`No supplement for this one. ${w.Poss} vet comes first.`,callYourVet:"Call your vet today",callAVet:"Call a vet today",saveForCheckup:`Save for ${w.poss} next checkup`,savedForCheckup:`Saved for ${w.poss} next checkup`,blanksLabel:`${w.Poss} three blanks`,blanksAsked:clinic=>`Asked ${clinic}`,blanksAskedNoClinic:"",blanksWaitPill:"2 to 5 days",blanksFilledKicker:`From ${w.poss} vet records`,blanksFilled:(filled,total)=>`${filled} of ${total} filled`,blanksWeight:`Keep ${w.obj} at `,blanksWeightSource:`From ${w.poss} vet visits`,blanksDose:(dose,product)=>`${dose} of ${product}`,blanksDoseSource:`Sized to ${w.poss} weight`,blanksShots:`${w.Poss} next shots are due `,blanksShotsSource:`From ${w.poss} clinic`,blankEmpty:"blank",recordsLanded:`${w.Poss} records are in. ${w.Poss} plan now uses ${w.poss} weight and ${w.poss} visits.`});return copy}healthPlanFocusCopyFor({sex:"female"});var EVERFUR_INTRO_COPY=/* @__PURE__ */Object.freeze({eyebrow:"",lede:"",pendingLede:"",recordsRowMore:"",planTopic:"",askTitle:"",noVetTitle:"",sentFine:"",clinicEta:"",blanksDetail:"",bannerBody:"",appName:""});function introPetWords(name,sex){let words=healthPlanPetWords(name,sex);return{...words,subj:sex==="female"?"she":sex==="male"?"he":words.name}}var NUMBER_WORDS=["","one","two","three","four","five","six","seven","eight","nine","ten"];function numberWord(n){return Number.isInteger(n)&&n>=1&&n<=10?NUMBER_WORDS[n]??null:null}var cap=s=>s===""?s:s.charAt(0).toUpperCase()+s.slice(1);function defaultIntroBlanks(p){return[{before:`Keep ${p.obj} at `,after:" lb",source:`From ${p.poss} vet visits`},{before:`${p.Poss} next shots are due `,after:"",source:`From ${p.poss} clinic`,width:"l"}]}function introFacts(page,petName){let name=page?.pet.name??petName??null,design=page?.page??null,byline=design?.byline?.name?.trim()??"";return{pet:introPetWords(name,page?.pet.sex??null),planTitle:design?.title.trim()??"",vetName:page?.vetReviewed===true&&byline!==""?byline:null,tips:design?.routine?.steps.length??0}}function introText(input){let{facts:facts,copy:copy,resultsPending:resultsPending}=input,p=facts.pet,n=numberWord(input.blanks),tips=numberWord(facts.tips),topic=copy.planTopic.trim(),vet=facts.vetName===null?null:facts.vetName.replace(/ /g," "),planFor=topic===""?"":`One plan for ${p.poss} ${topic}${vet===null?"":`, built with ${vet}`}.`,tipsLine=tips===null?"":`${cap(tips)} tips, one thing to add.`,planRow=resultsPending?`${p.Poss} plan arrives with ${p.poss} results.`:[planFor,tipsLine].filter(s=>s!=="").join(" "),recordsRow=[`What could go wrong for ${p.name}, and what's changed.`,copy.recordsRowMore.trim()].filter(s=>s!=="").join(" ");return{sheetLabel:{intro:`Welcome to ${p.Name}'s tab`,records:`Request ${p.poss} records`},back:"Back",skip:"Skip",close:"Close",poweredBy:"powered by",tabs:{eyebrow:copy.eyebrow,title:`${p.Name}'s health, in three tabs.`,lede:resultsPending?copy.pendingLede:copy.lede,ask:`Trained on 50,000+ peer-reviewed vet publications. Ask about ${p.name} any hour (the 2 am ones too).`,plan:planRow,records:recordsRow,next:"Next",seePlan:`See ${p.poss} plan`},ask:{title:copy.askTitle,lede:n===null?"":`${p.Poss} plan has ${n} blanks only ${p.poss} vet can fill (we ask the clinic for you).`,blanksPill:`${input.blanks} blanks`,blankLabel:"blank",later:"Later",connect:`Connect ${p.poss} vet`,fine:`We send ${p.poss} clinic a secure request and read every page they send back.`,noVet:`${p.Name} doesn't have a vet yet`},clinic:{title:`Where does ${p.name} see ${p.poss} vet?`,search:"Clinic name, city or zip",searchLabel:`Search for ${p.poss} clinic`,list:"Clinics",more:`Sees more than one? Start with the one ${p.subj} sees most.`,request:`Request ${p.poss} records`,upload:"Upload a PDF or a photo instead",add:`Add ${p.poss} clinic`},sent:{eyebrow:"Request sent",title:"Sent. Now it's the clinic's turn.",track:`${p.Poss} records request`,sentStep:"Request sent",sentTo:clinic=>`Today, to ${clinic}`,clinicStep:`${p.Poss} clinic sends ${p.poss} records`,clinicEta:copy.clinicEta,blanksStep:n===null?"":`${p.Poss} ${n} blanks fill in`,blanksDetail:copy.blanksDetail,lede:`Turn on notifications and we'll tell you the minute ${p.name}'s records are in.`,notify:"Turn on notifications",notNow:"Not now",fine:copy.sentFine},noVet:{title:copy.noVetTitle,lede:n===null?"":`When ${p.subj} does, connect ${p.poss} vet in Records and ${p.poss} ${n} blanks fill in.`,seePlan:`See ${p.poss} plan`},toast:{on:`Notifications on. We'll tell you the minute ${p.name}'s records are in.`,off:`Requested. ${p.Name}'s records will show up here when they're in.`,landed:`${p.Poss} records are in. ${p.Poss} plan now uses ${p.poss} weight and ${p.poss} visits.`},banner:{app:copy.appName,now:"now",title:`${p.Name}'s records are in`,body:copy.bannerBody}}}function keepClinicDraftKey(keys,draft){let clinic=`${draft.key}\n${draft.email}`,kept=keys.get(clinic);return kept===void 0?(keys.set(clinic,draft.idempotencyKey),draft):kept===draft.idempotencyKey?draft:/* @__PURE__ */Object.freeze({...draft,idempotencyKey:kept})}function isIntroSwipeOut(dy,ms){let v=ms>0?Math.abs(dy)/ms:0;return dy>90||dy>12&&v>.11}var EVERFUR_RECORDS_REQUESTED_EVENT="everfur:records-requested",EVERFUR_RECORDS_LANDED_EVENT="everfur:records-landed";function emitRecordsEvent(name,detail){try{if(typeof window>"u"||typeof CustomEvent!="function")return;window.dispatchEvent(new CustomEvent(name,{detail:detail}))}catch{}}var INTRO_RULES={".serif":[["font-family","$serif"],["font-weight","800"],["font-variation-settings",'"SOFT" 0, "WONK" 0'],["letter-spacing","-0.01em"],["text-wrap","balance"]],".emb-btn":[["display","inline-flex"],["align-items","center"],["justify-content","center"],["gap","8px"],["min-height","48px"],["padding","0 22px"],["border-radius","999px"],["background","$primary"],["color","$onPrimary"],["font-weight","700"],["font-size","16px"],["text-decoration","none"],["transition-property","transform, opacity"],["transition-duration","160ms, 160ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1), ease"],["transition-delay","0s, 0s"]],".emb-btn svg":[["width","20px"],["height","20px"]],".emb-btn--block":[["width","100%"]],".emb-btn--ghost":[["background","transparent"],["color","$ink"],["box-shadow","inset 0 0 0 1.5px $ink"]],".emb-btn--sm":[["min-height","40px"],["padding","0 16px"],["font-size","15px"]],".emb-btn--lg":[["min-height","56px"],["padding","0 28px"],["font-size","17px"]],".emb-btn[disabled]":[["opacity",".32"],["pointer-events","none"]],".cp-tag":[["font-family","$mono"],["font-size","10px"],["letter-spacing",".06em"],["text-transform","uppercase"],["background","$ink"],["color","$onInk"],["padding","2px 6px"],["border-radius","5px"]],".cp-tag--s":[["background","$card"],["color","$ink"]],".sh-track":[["list-style","none"],["margin","0"],["padding","0"]],".sh-track li":[["position","relative"],["display","grid"],["grid-template-columns","22px minmax(0, 1fr)"],["gap","12px"],["padding-bottom","16px"]],".sh-track li:last-child":[["padding-bottom","0"]],".sh-track li::before":[["position","absolute"],["left","10px"],["top","20px"],["bottom","-2px"],["width","2px"],["border-radius","1px"],["background","$n_E2DFD9"]],".sh-track li:last-child::before":[["display","none"]],".sh-track li.is-done:has(+ li.is-done)::before":[["background","$primary"]],".sh-track__dot":[["width","22px"],["height","22px"],["border-radius","50%"],["display","grid"],["place-items","center"],["background","$card"],["box-shadow","inset 0 0 0 2px $n_CFCBC4"],["position","relative"],["z-index","1"]],".sh-track__dot svg":[["width","13px"],["height","13px"],["color","$card"]],".sh-track .is-done .sh-track__dot":[["background","$ink"],["box-shadow","none"]],".sh-track .is-now .sh-track__dot":[["background","$accent"],["box-shadow","inset 0 0 0 2px $ink"]],".sh-track strong":[["display","block"],["font-size","15.5px"],["font-weight","800"],["line-height","1.3"]],".sh-track small":[["display","block"],["margin-top","1px"],["font-size","14px"],["line-height","1.35"],["color","$ink3"]],".sh-track li:not(.is-done):not(.is-now) strong":[["color","$ink3"],["font-weight","700"]],".ph-intro":[["position","absolute"],["inset","0"],["z-index","45"]],".in-dim":[["position","absolute"],["left","0"],["right","0"],["background","rgba(38, 37, 35, .5)"],["opacity","0"],["transition-property","opacity"],["transition-duration","240ms"],["transition-timing-function","ease"],["transition-delay","0s"]],".in-dim--top":[["top","0"],["height","var(--in-t, 140px)"]],".in-dim--mid":[["top","var(--in-t, 140px)"],["height","var(--in-h, 46px)"]],".in-dim--bot":[["top","calc(var(--in-t, 140px) + var(--in-h, 46px))"],["bottom","0"]],".ph-intro.is-on .in-dim--top":[["opacity","1"],["transition-duration","380ms"]],".ph-intro.is-on .in-dim--bot":[["opacity","1"],["transition-duration","380ms"]],".ph-intro.is-on.is-all .in-dim--mid":[["opacity","1"],["transition-duration","380ms"]],".in-sheet":[["position","absolute"],["left","0"],["right","0"],["bottom","0"],["max-height","calc(100% - var(--in-t, 140px) - var(--in-h, 46px) - 10px)"],["overflow","hidden auto"],["scrollbar-width","none"],["overscroll-behavior","contain"],["background","$card"],["border-radius","28px 28px 0 0"],["padding","10px 20px 30px"],["box-shadow","0 -10px 30px rgba(38, 37, 35, .14)"],["transform","translateY(100%)"],["transition-property","transform"],["transition-duration","240ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"],["touch-action","pan-y"]],".ph-intro.is-all .in-sheet":[["max-height","calc(100% - 56px)"]],".ph-intro.is-on .in-sheet":[["transform","none"],["transition-property","transform"],["transition-duration","380ms"],["transition-timing-function","cubic-bezier(0.32, 0.72, 0, 1)"],["transition-delay","0s"]],".in-sheet.is-drag":[["transition-property","none",1],["transition-duration","0s",1],["transition-timing-function","ease",1],["transition-delay","0s",1]],".in-grab":[["width","40px"],["height","5px"],["border-radius","3px"],["background","$n_DAD7D1"],["margin","0 auto 8px"]],".in-top":[["display","flex"],["align-items","center"],["gap","12px"],["min-height","40px"]],".in-back":[["width","40px"],["height","40px"],["margin-left","-10px"],["display","grid"],["place-items","center"],["border-radius","50%"],["flex","none"]],".in-x":[["width","40px"],["height","40px"],["margin-left","-10px"],["display","grid"],["place-items","center"],["border-radius","50%"],["flex","none"],["margin","0 -10px 0 auto"]],".in-back svg":[["width","22px"],["height","22px"]],".in-x svg":[["width","22px"],["height","22px"]],".in-bars":[["flex","1"],["display","flex"],["gap","6px"]],".in-bars b":[["flex","1"],["height","4px"],["border-radius","2px"],["background","$line"],["overflow","hidden"],["position","relative"]],".in-bars b::after":[["position","absolute"],["inset","0"],["background","$ink"],["border-radius","2px"],["transform","scaleX(0)"],["transform-origin","left"],["transition-property","transform"],["transition-duration","240ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".in-bars b.on::after":[["transform","none"]],".in-skip":[["min-height","40px"],["padding","0 4px 0 10px"],["margin-right","-4px"],["font-size","15.5px"],["font-weight","700"],["color","$ink2"],["flex","none"]],'.in-sheet[data-mode="records"] .in-bars':[["display","none"]],'.in-sheet[data-mode="records"] .in-skip':[["display","none"]],'.in-sheet[data-mode="intro"] .in-x':[["display","none"]],'.in-sheet[data-mode="records"] .in-top':[["justify-content","space-between"]],".in-body":[["display","grid"],["gap","14px"],["padding-top","6px"]],".in-eyebrow":[["display","flex"],["align-items","center"],["flex-wrap","wrap"],["gap","4px 8px"],["font-size","12.5px"],["font-weight","800"],["letter-spacing",".07em"],["text-transform","uppercase"],["color","$ink3"]],".in-by":[["display","inline-flex"],["align-items","center"],["gap","5px"],["text-transform","none"],["letter-spacing","0"],["font-weight","500"],["font-size","13px"]],".in-by svg":[["width","54px"],["height","19px"],["color","$n_10462E"]],".in-h":[["font-size","29px"],["line-height","1.08"],["margin","-2px 0 0"],["outline","none"]],".in-p":[["font-size","16px"],["line-height","1.45"],["color","$ink2"],["text-wrap","pretty"]],".in-p--s":[["font-size","15px"]],".in-rows":[["list-style","none"],["margin","2px 0 0"],["padding","0"],["display","grid"],["gap","9px"]],".in-rows li":[["display","grid"],["grid-template-columns","40px minmax(0, 1fr)"],["gap","12px"],["align-items","start"],["background","$paper"],["border-radius","18px"],["padding","13px 14px"]],".in-rows b":[["display","block"],["font-size","17px"],["font-weight","800"],["line-height","1.25"]],".in-rows li > span:last-child > span":[["display","block"],["font-size","15px"],["line-height","1.4"],["color","$ink2"],["text-wrap","pretty"],["margin-top","1px"]],".in-ic":[["width","40px"],["height","40px"],["border-radius","12px"],["display","grid"],["place-items","center"]],".in-ic svg":[["width","22px"],["height","22px"]],".in-ic--y":[["background","$accentChip"]],".in-ic--c":[["background","$linkChip"]],".in-ic--g":[["background","$clearChip"]],".in-rise .in-rows li":[["animation","inRow 260ms cubic-bezier(0.23, 1, 0.32, 1) both"],["animation-delay","calc(560ms + var(--i, 0) * 60ms)"]],".in-pair":[["display","grid"],["grid-template-columns","1fr 1.5fr"],["gap","10px"]],".in-stack":[["display","grid"],["gap","8px"]],".in-body .emb-btn":[["transition-property","transform, opacity"],["transition-duration","120ms, 160ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1), ease"],["transition-delay","0s, 0s"]],".in-fine":[["font-size","13.5px"],["line-height","1.4"],["color","$ink3"],["text-align","center"],["text-wrap","pretty"]],".in-link":[["justify-self","center"],["min-height","40px"],["padding","0 8px"],["font-size","15px"],["font-weight","700"],["color","$link"],["text-decoration","underline"],["text-underline-offset","3px"],["transition-property","transform"],["transition-duration","120ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".blanks":[["display","grid"],["gap","8px"],["background","$paper"],["border-radius","20px"],["padding","12px 12px 13px"]],".blanks__h":[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","10px"],["padding","0 2px 2px"],["font-size","12.5px"],["font-weight","800"],["letter-spacing",".07em"],["text-transform","uppercase"],["color","$ink3"]],".blanks__h em":[["font-style","normal"],["letter-spacing",".01em"],["text-transform","none"],["font-size","13px"],["font-weight","800"],["color","$onAccent"],["background","$accent"],["border-radius","999px"],["padding","2px 10px"],["white-space","nowrap"]],'.blanks[data-st="filled"] .blanks__h em':[["background","$clearBg"],["color","$clearInk"]],".blanks ol":[["list-style","none"],["margin","0"],["padding","0"],["display","grid"],["gap","7px"]],".blanks li":[["display","grid"],["grid-template-columns","34px minmax(0, 1fr)"],["column-gap","11px"],["align-items","center"],["background","$card"],["border-radius","15px"],["padding","9px 12px 9px 9px"]],".blanks li > b":[["grid-row","span 2"],["width","34px"],["height","40px"],["border-radius","11px"],["display","grid"],["place-items","center"],["font-family","$serif"],["font-size","22px"],["font-weight","800"],["background","$accentChip"]],".blanks li > span":[["font-size","16px"],["font-weight","700"],["line-height","1.35"]],".blanks li > small":[["font-size","13.5px"],["color","$ink3"]],".blank":[["display","inline-block"],["min-width","36px"],["height","20px"],["vertical-align","-3px"],["border-radius","6px"],["background","$accent4"],["box-shadow","inset 0 0 0 1.5px $accent"],["font-style","normal"]],".blank--s":[["min-width","24px"]],".blank--l":[["min-width","64px"]],'.blanks[data-st="filled"] .blank':[["height","auto"],["min-width","0"],["vertical-align","0"],["background","none"],["box-shadow","none"],["padding","0 3px"],["margin","0 -3px"],["border-radius","6px"]],".blank.is-flash":[["animation","blankFlash 900ms ease-out both"],["animation-delay","calc(var(--i, 0) * 80ms)"]],".in-body .blank":[["animation","blankPulse 520ms ease-in-out both"],["animation-delay","calc(300ms + var(--i, 0) * 80ms)"]],".in-search":[["display","flex"],["align-items","center"],["gap","10px"],["height","50px"],["border-radius","14px"],["background","$paper"],["box-shadow","inset 0 0 0 1.5px $ink"],["padding","0 14px"]],".in-search svg":[["width","20px"],["height","20px"],["color","$ink3"],["flex","none"]],".in-search input":[["flex","1"],["min-width","0"],["border","0"],["background","none"],["font","inherit"],["font-size","16px"],["color","$ink"],["outline","none"]],".in-clinics":[["display","grid"],["gap","8px"]],".in-clinic":[["width","100%"],["display","grid"],["grid-template-columns","minmax(0, 1fr) 24px"],["align-items","center"],["gap","10px"],["text-align","left"],["background","$paper"],["border-radius","16px"],["padding","12px 14px"],["transition-property","transform, background-color, box-shadow"],["transition-duration","120ms, 160ms, 160ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1), ease, ease"],["transition-delay","0s, 0s, 0s"]],".in-clinic b":[["display","block"],["font-size","16px"],["line-height","1.3"]],".in-clinic b .cp-tag":[["margin-left","6px"],["vertical-align","2px"],["box-shadow","inset 0 0 0 1px $line"]],".in-clinic small":[["display","block"],["font-size","14px"],["color","$ink3"],["margin-top","1px"]],'.in-clinic[aria-checked="true"]':[["background","$accent4"],["box-shadow","inset 0 0 0 1.5px $accent"]],".in-tick":[["width","24px"],["height","24px"],["border-radius","50%"],["display","grid"],["place-items","center"],["box-shadow","inset 0 0 0 1.5px $n_CFCBC4"]],".in-tick svg":[["width","14px"],["height","14px"],["color","$card"],["opacity","0"]],'.in-clinic[aria-checked="true"] .in-tick':[["background","$ink"],["box-shadow","none"]],'.in-clinic[aria-checked="true"] .in-tick svg':[["opacity","1"]],".in-none":[["font-size","15px"],["color","$ink2"],["background","$paper"],["border-radius","16px"],["padding","12px 14px"],["display","grid"],["gap","4px"]],".in-none .in-link":[["justify-self","start"],["padding","0"]],".in-prog":[["display","grid"],["gap","7px"],["font-size","15px"],["color","$ink2"]],".in-prog__bar":[["height","5px"],["border-radius","3px"],["background","$tile"],["overflow","hidden"]],".in-prog__bar i":[["display","block"],["height","100%"],["width","0"],["background","$ink"],["border-radius","3px"],["transition-property","width"],["transition-duration","600ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".in-sent":[["background","$paper"],["border-radius","20px"],["padding","16px 16px 16px 14px"]],".in-sent .sh-track li":[["padding-bottom","14px"]],".in-sent .sh-track li:last-child":[["padding-bottom","0"]],".in-stack .emb-btn svg":[["width","20px"],["height","20px"]],".ph-banner":[["position","absolute"],["left","10px"],["right","10px"],["top","54px"],["z-index","55"],["display","grid"],["grid-template-columns","38px minmax(0, 1fr)"],["gap","11px"],["align-items","start"],["text-align","left"],["padding","12px 14px"],["border-radius","22px"],["background","rgba(250, 250, 249, .97)"],["box-shadow","0 14px 34px -10px rgba(38, 37, 35, .4), 0 0 0 1px rgba(38, 37, 35, .06)"],["transform","translateY(calc(-100% - 60px))"],["transition-property","transform"],["transition-duration","240ms"],["transition-timing-function","cubic-bezier(0.23, 1, 0.32, 1)"],["transition-delay","0s"]],".ph-banner.is-on":[["transform","none"],["transition-property","transform"],["transition-duration","380ms"],["transition-timing-function","cubic-bezier(0.32, 0.72, 0, 1)"],["transition-delay","0s"]],".ph-banner__app":[["width","38px"],["height","38px"],["border-radius","10px"],["background","$accent"],["display","grid"],["place-items","center"]],".ph-banner__app svg":[["width","24px"],["height","23px"]],".ph-banner__meta":[["display","flex"],["justify-content","space-between"],["font-size","13px"],["color","$ink3"]],".ph-banner__meta strong":[["font-size","13px"],["font-weight","600"],["color","$ink3"]],".ph-banner__txt > strong":[["display","block"],["font-size","15.5px"],["font-weight","700"],["line-height","1.3"],["margin-top","1px"]],".ph-banner__txt > span:last-child":[["display","block"],["font-size","15px"],["line-height","1.35"],["color","$ink2"]]},INTRO_REDUCED_RULES={".in-sheet":[["transform","none"],["opacity","0"],["transition-property","opacity"],["transition-duration","150ms"],["transition-timing-function","ease"],["transition-delay","0s"]],".ph-intro.is-on .in-sheet":[["transform","none"],["opacity","0"],["transition-property","opacity"],["transition-duration","150ms"],["transition-timing-function","ease"],["transition-delay","0s"],["opacity","1"]],".in-sheet.is-drag":[["opacity","1"]],".in-dim":[["transition-duration","150ms"]],".ph-intro.is-on .in-dim--top":[["transition-duration","150ms"]],".ph-intro.is-on .in-dim--bot":[["transition-duration","150ms"]],".ph-intro.is-on.is-all .in-dim--mid":[["transition-duration","150ms"]],".in-rise .in-rows li":[["animation","none"]],".in-body .blank":[["animation","none"]],".blank.is-flash":[["animation-duration","900ms"]],".ph-banner":[["transform","none"],["opacity","0"],["visibility","hidden"],["transition-property","opacity, visibility"],["transition-duration","150ms, 0s"],["transition-timing-function","ease, linear"],["transition-delay","0s, 150ms"]],".ph-banner.is-on":[["transform","none"],["opacity","0"],["visibility","hidden"],["transition-property","opacity, visibility"],["transition-duration","150ms, 0s"],["transition-timing-function","ease, linear"],["transition-delay","0s, 150ms"],["opacity","1"],["visibility","visible"],["transition-property","opacity, visibility"],["transition-duration","150ms, 0s"],["transition-timing-function","ease, ease"],["transition-delay","0s, 0s"]]},EASE_OUT="cubic-bezier(0.23, 1, 0.32, 1)";var INTRO_KEYFRAMES={inRow:[["from",[["opacity","0"],["transform","translateY(8px)"]]]]};function dragBlocked(target,sheet,frame){return frame==="sent"||frame==="consent"||sheet.scrollTop>0?true:target instanceof Element&&target.closest("button, input, textarea, select, a, canvas, label")!==null}var FOCUS_DELAY_MS=60;function focusableHeading(root){let heading=root?.querySelector("h1, h2, h3")??null;return heading!==null&&!heading.hasAttribute("tabindex")&&(heading.tabIndex=-1),heading}function EverfurIntro(props){let{petRef:petRef,onClose:onClose,onClosed:onClosed,onFrame:onFrame}=props,mode=props.mode??"intro",theme=useEverfurTheme(),reduced=theme.motion.reducedMotion,sx=react.useMemo(()=>askIntroSx(theme,INTRO_RULES,INTRO_REDUCED_RULES),[theme]),reset=react.useMemo(()=>askIntroReset(theme),[theme]),tokens=react.useMemo(()=>askIntroTokens(theme),[theme]),{runtime:runtime}=useEverfurContext(),copy=react.useMemo(()=>({...EVERFUR_INTRO_COPY,...props.copy}),[props.copy]),facts=react.useMemo(()=>introFacts(props.page??null,props.petName),[props.page,props.petName]),blanks=react.useMemo(()=>props.blanks??defaultIntroBlanks(facts.pet),[props.blanks,facts.pet]),text=react.useMemo(()=>introText({facts:facts,copy:copy,blanks:blanks.length,resultsPending:props.resultsPending===true}),[facts,copy,blanks.length,props.resultsPending]),[frame,setFrame]=react.useState(mode==="records"?"clinic":"tabs"),[on,setOn]=react.useState(false),[closing,setClosing]=react.useState(false),[dragging,setDragging]=react.useState(false),[draft,setDraft]=react.useState(null),draftKeys=react.useRef(/* @__PURE__ */new Map),[sentTo,setSentTo]=react.useState(""),[busy,setBusy]=react.useState(false),[dims,setDims]=react.useState(null),[host,setHost]=react.useState(null),sheetRef=react.useRef(null),bodyRef=react.useRef(null),titleRef=react.useRef(null),opener=react.useRef(null),frameChange=react.useRef(null),timers=react.useRef([]),titleId=react.useId(),frames=useClinicFrames(frame==="clinic"||frame==="consent"),later=react.useCallback((fn,ms)=>{timers.current.push(setTimeout(fn,ms))},[]);react.useEffect(()=>()=>timers.current.forEach(clearTimeout),[]);let focusTitle=react.useCallback(()=>{later(()=>titleRef.current?.focus({preventScroll:true}),FOCUS_DELAY_MS)},[later]);react.useEffect(()=>{onFrame?.(closing?null:frame)},[frame,closing,onFrame]),react.useEffect(()=>()=>onFrame?.(null),[onFrame]);let covered=props.container??host?.parentElement??null,tabBar=props.tabBar??null;react.useLayoutEffect(()=>{if(covered===null||tabBar===null)return;let place=()=>{let box=covered.getBoundingClientRect(),bar=tabBar.getBoundingClientRect();setDims({t:Math.round(bar.top-box.top),h:Math.round(bar.height)})};return place(),window.addEventListener("resize",place),()=>window.removeEventListener("resize",place)},[covered,tabBar]),react.useEffect(()=>{if(host===null)return;let parent=host.parentElement;opener.current=document.activeElement;let made=[];if(parent!==null)for(let child of Array.from(parent.children))child===host||!(child instanceof HTMLElement)||child.inert||(child.inert=true,made.push(child));let raf=requestAnimationFrame(()=>setOn(true));return focusTitle(),()=>{cancelAnimationFrame(raf);for(let child of made)child.inert=false;let active=document.activeElement,back=opener.current;(active===null||active===document.body||!active.isConnected)&&back instanceof HTMLElement&&back.isConnected&&back.focus({preventScroll:true})}},[host,focusTitle]),react.useLayoutEffect(()=>{if(host===null||reduced||frame!=="tabs")return;let rows=bodyRef.current?.querySelectorAll("li")??[],from=Object.fromEntries((INTRO_KEYFRAMES.inRow?.[0]?.[1]??[]).map(([k,v])=>[k,v]));rows.forEach((row,i)=>{if(typeof row.animate=="function")try{row.animate([from,{opacity:1,transform:"none"}],{duration:260,delay:560+i*60,easing:EASE_OUT,fill:"both"})}catch{}})},[host]),react.useEffect(()=>{if(frame!=="ask"||reduced)return;(bodyRef.current?.querySelectorAll("[data-blank]")??[]).forEach((mark,i)=>{if(typeof mark.animate=="function")try{let rest=tokens.accent4??"";mark.animate([{background:rest},{background:tokens.accent2??rest,offset:.5},{background:rest}],{duration:520,delay:300+i*80,easing:"ease-in-out",fill:"both"})}catch{}})},[frame,reduced,tokens]),react.useLayoutEffect(()=>{let change=frameChange.current;frameChange.current=null;let sheet=sheetRef.current,body2=bodyRef.current;if(!(change===null||sheet===null||body2===null)){sheet.scrollTop=0;try{if(reduced)typeof body2.animate=="function"&&body2.animate([{opacity:0},{opacity:1}],{duration:150,easing:"ease"});else{let h1=sheet.offsetHeight;change.h0!==h1&&typeof sheet.animate=="function"&&sheet.animate([{height:`${change.h0}px`},{height:`${h1}px`}],{duration:240,easing:EASE_OUT}),typeof body2.animate=="function"&&body2.animate([{opacity:0,transform:`translateX(${change.back?-24:24}px)`},{opacity:1,transform:"none"}],{duration:240,easing:EASE_OUT})}}catch{}focusTitle()}},[frame,reduced,focusTitle]);let go=react.useCallback((next,back=false)=>{frameChange.current={h0:sheetRef.current?.offsetHeight??0,back:back},setFrame(next)},[]),close=react.useCallback((exit,toast=null,notifications=null)=>{if(!closing){if(setClosing(true),setOn(false),onClose({exit:exit,toast:toast,notifications:notifications}),exit==="stay"){let back=opener.current;back instanceof HTMLElement&&back.isConnected&&back.focus({preventScroll:true})}later(()=>onClosed?.(),reduced?160:260)}},[closing,onClose,onClosed,later,reduced]),leave=react.useCallback(()=>close(mode==="records"?"stay":"ask"),[close,mode]),hostUpload=props.onUpload,upload=react.useMemo(()=>hostUpload===void 0?void 0:()=>{close("stay"),hostUpload()},[hostUpload,close]),afterSent=react.useCallback(notified=>close("plan",notified?text.toast.on:text.toast.off,notified),[close,text]),notify=react.useCallback(async()=>{if(busy)return;setBusy(true);let turnedOn=false;try{props.onEnableNotifications!==void 0?turnedOn=await props.onEnableNotifications()===!0:turnedOn=(await createNotificationsClient(runtime).setPreferences({pushEnabled:!0,emailEnabled:!0})).ok}catch{turnedOn=false}setBusy(false),afterSent(turnedOn)},[busy,props,runtime,afterSent]);react.useEffect(()=>{if(closing)return;let onKey=event=>{event.key!=="Escape"||event.defaultPrevented||(event.preventDefault(),frame==="sent"?afterSent(false):leave())};return document.addEventListener("keydown",onKey),()=>document.removeEventListener("keydown",onKey)},[closing,frame,afterSent,leave]);let drag=react.useRef(null),onPointerDown=event=>{let sheet=sheetRef.current;if(!(drag.current!==null||sheet===null||closing||dragBlocked(event.target,sheet,frame))){drag.current={y:event.clientY,t:performance.now(),dy:0,id:event.pointerId};try{sheet.setPointerCapture(event.pointerId)}catch{}setDragging(true)}},onPointerMove=event=>{let d=drag.current,sheet=sheetRef.current;if(d===null||sheet===null)return;let dy=event.clientY-d.y;d.dy=dy>0?dy:dy/4,sheet.style.transform=`translateY(${d.dy}px)`},endDrag=()=>{let d=drag.current,sheet=sheetRef.current;d!==null&&(drag.current=null,setDragging(false),isIntroSwipeOut(d.dy,performance.now()-d.t)?leave():sheet!==null&&(sheet.style.transform="none"))},onCreated=react.useCallback(request=>{let clinicName=draft===null?"":draft.clinic?.name??draft.freeText??"",event={petRef:petRef,clinicName:clinicName,requestId:request.id,at:/* @__PURE__ */(new Date).toISOString()};setSentTo(clinicName),emitRecordsEvent(EVERFUR_RECORDS_REQUESTED_EVENT,{petRef:event.petRef,requestId:event.requestId,at:event.at}),props.onRequested?.(event),go("sent")},[draft,petRef,props,go]),all=frame!=="tabs",dimVars={"--in-t":`${dims?.t??0}px`,"--in-h":`${dims?.h??0}px`},showBack=frame==="clinic"&&mode!=="records"||frame==="novet"||frame==="consent",showSkip=frame!=="sent",button=reset.button,p=(style,children,focus=false)=>children===""?null:/* @__PURE__ */jsxRuntime.jsx("p",{style:{...reset.text,...style},...focus?{ref:el=>{titleRef.current=el},tabIndex:-1,id:titleId}:{},children:children}),title=words=>words===""?null:/* @__PURE__ */jsxRuntime.jsx("h3",{id:titleId,ref:el=>{titleRef.current=el},tabIndex:-1,style:{...reset.text,...sx(".serif",".in-h")},children:words}),btn=(label,onClick,...rules)=>/* @__PURE__ */jsxRuntime.jsx("button",{type:"button",style:{...button,...sx(".emb-btn",".in-body .emb-btn",...rules)},onClick:onClick,children:label}),link=(label,onClick)=>/* @__PURE__ */jsxRuntime.jsx("button",{type:"button",style:{...button,...sx(".in-link")},onClick:onClick,children:label}),eyebrow=words=>{let lockup=theme.meta.hidePoweredBy?null:/* @__PURE__ */jsxRuntime.jsxs("span",{style:sx(".in-by"),children:[text.poweredBy,
133
+ /* @__PURE__ */jsxRuntime.jsx(EverfurWordmark,{style:sx(".in-by svg")})]});return words===""&&lockup===null?null:/* @__PURE__ */jsxRuntime.jsxs("p",{style:{...reset.text,...sx(".in-eyebrow")},children:[words,lockup]})},body=null;if(frame==="tabs"){let rows=[["ask","chat",".in-ic--y",props.tabLabels?.ask??"Ask",text.tabs.ask],["plan","heartcheck",".in-ic--c",props.tabLabels?.plan??"Health Plan",text.tabs.plan],["records","file",".in-ic--g",props.tabLabels?.records??"Records",text.tabs.records]];body=/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[eyebrow(text.tabs.eyebrow),title(text.tabs.title),p(sx(".in-p"),text.tabs.lede),
134
+ /* @__PURE__ */jsxRuntime.jsx("ul",{style:sx(".in-rows"),children:rows.map(([key,icon,tint,label,line])=>/* @__PURE__ */jsxRuntime.jsxs("li",{style:sx(".in-rows li"),children:[
135
+ /* @__PURE__ */jsxRuntime.jsx("span",{style:sx(".in-ic",tint),children:/* @__PURE__ */jsxRuntime.jsx(IntroIcon,{name:icon,style:sx(".in-ic svg")})}),
136
+ /* @__PURE__ */jsxRuntime.jsxs("span",{children:[
137
+ /* @__PURE__ */jsxRuntime.jsx("b",{style:sx(".in-rows b"),children:label}),line===""?null:/* @__PURE__ */jsxRuntime.jsx("span",{style:sx(".in-rows li > span:last-child > span"),children:line})]})]},key))}),props.recordsConnected===true?btn(text.tabs.seePlan,()=>close("plan"),".emb-btn--block"):btn(text.tabs.next,()=>go("ask"),".emb-btn--block")]})}else if(frame==="ask")body=/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[eyebrow(text.tabs.eyebrow),title(text.ask.title),p(sx(".in-p"),text.ask.lede,text.ask.title===""),
138
+ /* @__PURE__ */jsxRuntime.jsxs("div",{style:sx(".blanks"),children:[
139
+ /* @__PURE__ */jsxRuntime.jsxs("p",{style:{...reset.text,...sx(".blanks__h")},children:[
140
+ /* @__PURE__ */jsxRuntime.jsx("span",{children:facts.planTitle}),
141
+ /* @__PURE__ */jsxRuntime.jsx("em",{style:sx(".blanks__h em"),children:text.ask.blanksPill})]}),
142
+ /* @__PURE__ */jsxRuntime.jsx("ol",{style:sx(".blanks ol"),children:blanks.map((blank,i)=>/* @__PURE__ */jsxRuntime.jsxs("li",{style:sx(".blanks li"),children:[
143
+ /* @__PURE__ */jsxRuntime.jsx("b",{"aria-hidden":"true",style:sx(".blanks li > b"),children:i+1}),
144
+ /* @__PURE__ */jsxRuntime.jsxs("span",{style:sx(".blanks li > span"),children:[blank.before,
145
+ /* @__PURE__ */jsxRuntime.jsx("i",{"data-blank":"",style:sx(".blank",blank.width==="s"&&".blank--s",blank.width==="l"&&".blank--l"),children:/* @__PURE__ */jsxRuntime.jsx("span",{style:reset.srOnly,children:text.ask.blankLabel})}),blank.after]}),
146
+ /* @__PURE__ */jsxRuntime.jsx("small",{style:sx(".blanks li > small"),children:blank.source})]},i))})]}),
147
+ /* @__PURE__ */jsxRuntime.jsxs("div",{style:sx(".in-pair"),children:[btn(text.ask.later,leave,".emb-btn--ghost"),btn(text.ask.connect,()=>go("clinic"))]}),p(sx(".in-fine"),text.ask.fine),link(text.ask.noVet,()=>go("novet"))]});else if(frame==="clinic")body=frames===null?title(text.clinic.title):/* @__PURE__ */jsxRuntime.jsx(frames.Clinic,{sx:sx,reset:reset,text:text.clinic,titleId:titleId,titleRef:el=>{titleRef.current=el},onPick:picked=>{setDraft(keepClinicDraftKey(draftKeys.current,picked)),go("consent")},...upload===void 0?{}:{onUpload:upload}});else if(frame==="consent")body=frames===null||draft===null?null:/* @__PURE__ */jsxRuntime.jsx("div",{ref:el=>{titleRef.current=focusableHeading(el)},children:/* @__PURE__ */jsxRuntime.jsx(frames.Consent,{petRef:petRef,...facts.pet.name==="your pet"?{}:{petName:facts.pet.name},draft:draft,...props.ownerName===void 0?{}:{ownerName:props.ownerName},...props.onCaptureSignature===void 0?{}:{onCaptureSignature:props.onCaptureSignature},onCreated:onCreated})});else if(frame==="sent"){let shown=[[text.sent.sentStep,sentTo===""?"":text.sent.sentTo(sentTo),"done"],[text.sent.clinicStep,text.sent.clinicEta,"now"],[text.sent.blanksStep,text.sent.blanksDetail,""]].filter(([t])=>t!=="");body=/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[eyebrow(text.sent.eyebrow),title(text.sent.title),
148
+ /* @__PURE__ */jsxRuntime.jsx("div",{style:sx(".in-sent"),children:/* @__PURE__ */jsxRuntime.jsx("ol",{"aria-label":text.sent.track,style:sx(".sh-track"),children:shown.map(([t,d,st],i)=>{let last=i===shown.length-1,nextDone=shown[i+1]?.[2]==="done";/* @__PURE__ */
149
+ return jsxRuntime.jsxs("li",{style:sx(".sh-track li",".in-sent .sh-track li",last&&".sh-track li:last-child",last&&".in-sent .sh-track li:last-child"),children:[last?null:/* @__PURE__ */jsxRuntime.jsx("span",{"aria-hidden":"true",style:sx(".sh-track li::before",st==="done"&&nextDone&&".sh-track li.is-done:has(+ li.is-done)::before")}),
150
+ /* @__PURE__ */jsxRuntime.jsx("span",{style:sx(".sh-track__dot",st==="done"&&".sh-track .is-done .sh-track__dot",st==="now"&&".sh-track .is-now .sh-track__dot"),children:st==="done"?/* @__PURE__ */jsxRuntime.jsx(IntroIcon,{name:"check",style:sx(".sh-track__dot svg")}):null}),
151
+ /* @__PURE__ */jsxRuntime.jsxs("span",{children:[
152
+ /* @__PURE__ */jsxRuntime.jsx("strong",{style:sx(".sh-track strong",st===""&&".sh-track li:not(.is-done):not(.is-now) strong"),children:t}),d===""?null:/* @__PURE__ */jsxRuntime.jsx("small",{style:sx(".sh-track small"),children:d})]})]},t)})})}),p(sx(".in-p"),text.sent.lede),
153
+ /* @__PURE__ */jsxRuntime.jsxs("div",{style:sx(".in-stack"),children:[
154
+ /* @__PURE__ */jsxRuntime.jsxs("button",{type:"button",disabled:busy,"aria-busy":busy,style:{...button,...sx(".emb-btn",".emb-btn--block",".in-body .emb-btn")},onClick:()=>{notify()},children:[
155
+ /* @__PURE__ */jsxRuntime.jsx(IntroIcon,{name:"bell",style:sx(".emb-btn svg",".in-stack .emb-btn svg")}),text.sent.notify]}),btn(text.sent.notNow,()=>afterSent(false),".emb-btn--block",".emb-btn--ghost")]}),p(sx(".in-fine"),text.sent.fine)]})}else body=/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[eyebrow(text.tabs.eyebrow),title(text.noVet.title),p(sx(".in-p"),text.noVet.lede,text.noVet.title===""),btn(text.noVet.seePlan,()=>close("plan"),".emb-btn--block")]});let intro=/* @__PURE__ */jsxRuntime.jsxs("div",{ref:setHost,"data-everfur-intro":"","data-in-frame":closing?"":frame,style:{...reset.root,...sx(".ph-intro"),...dimVars},children:[
156
+ /* @__PURE__ */jsxRuntime.jsx("div",{"aria-hidden":"true",style:sx(".in-dim",".in-dim--top",on&&".ph-intro.is-on .in-dim--top")}),
157
+ /* @__PURE__ */jsxRuntime.jsx("div",{"aria-hidden":"true",style:sx(".in-dim",".in-dim--mid",on&&all&&".ph-intro.is-on.is-all .in-dim--mid")}),
158
+ /* @__PURE__ */jsxRuntime.jsx("div",{"aria-hidden":"true",style:sx(".in-dim",".in-dim--bot",on&&".ph-intro.is-on .in-dim--bot")}),
159
+ /* @__PURE__ */jsxRuntime.jsxs("section",{ref:sheetRef,role:"dialog","aria-modal":"true","aria-label":mode==="intro"?text.sheetLabel.intro:text.sheetLabel.records,...frame==="consent"?{}:{"aria-labelledby":titleId},"data-mode":mode,style:sx(".in-sheet",all&&".ph-intro.is-all .in-sheet",on&&".ph-intro.is-on .in-sheet",dragging&&".in-sheet.is-drag"),onPointerDown:onPointerDown,onPointerMove:onPointerMove,onPointerUp:endDrag,onPointerCancel:endDrag,children:[
160
+ /* @__PURE__ */jsxRuntime.jsx("div",{"aria-hidden":"true",style:sx(".in-grab")}),
161
+ /* @__PURE__ */jsxRuntime.jsxs("div",{style:sx(".in-top",mode==="records"&&'.in-sheet[data-mode="records"] .in-top'),children:[showBack?/* @__PURE__ */jsxRuntime.jsx("button",{type:"button","aria-label":text.back,style:{...button,...sx(".in-back")},onClick:()=>go(frame==="consent"?"clinic":"ask",true),children:/* @__PURE__ */jsxRuntime.jsx(IntroIcon,{name:"back",style:sx(".in-back svg")})}):null,mode==="intro"?/* @__PURE__ */jsxRuntime.jsx("div",{"aria-hidden":"true",style:sx(".in-bars"),children:[0,1].map(i=>/* @__PURE__ */jsxRuntime.jsx("b",{style:sx(".in-bars b"),children:/* @__PURE__ */jsxRuntime.jsx("span",{style:{display:"block",...sx(".in-bars b::after",(i===0||all)&&".in-bars b.on::after")}})},i))}):null,showSkip&&mode==="intro"?/* @__PURE__ */jsxRuntime.jsx("button",{type:"button",style:{...button,...sx(".in-skip")},onClick:leave,children:text.skip}):null,showSkip&&mode==="records"?/* @__PURE__ */jsxRuntime.jsx("button",{type:"button","aria-label":text.close,style:{...button,...sx(".in-x")},onClick:leave,children:/* @__PURE__ */jsxRuntime.jsx(IntroIcon,{name:"x",style:sx(".in-x svg")})}):null]}),
162
+ /* @__PURE__ */jsxRuntime.jsx("div",{ref:bodyRef,style:sx(".in-body"),children:body})]})]});return props.container?reactDom.createPortal(intro,props.container):intro}var RECORDS_BANNER_MS=6e3;function EverfurRecordsLandedBanner({text:text,icon:icon,onLand:onLand}){let theme=useEverfurTheme(),sx=react.useMemo(()=>askIntroSx(theme,INTRO_RULES,INTRO_REDUCED_RULES),[theme]),reset=react.useMemo(()=>askIntroReset(theme),[theme]),[on,setOn]=react.useState(false),landed=react.useRef(false),land=react.useRef(onLand);return land.current=onLand,react.useEffect(()=>{let raf=requestAnimationFrame(()=>setOn(true)),timer=setTimeout(()=>{landed.current||(landed.current=true,land.current())},RECORDS_BANNER_MS);return()=>{cancelAnimationFrame(raf),clearTimeout(timer)}},[]),/* @__PURE__ */jsxRuntime.jsxs("button",{type:"button","data-everfur-records-banner":"",style:{...reset.root,...reset.button,...sx(".ph-banner",on&&".ph-banner.is-on")},onClick:()=>{landed.current||(landed.current=true,onLand())},children:[
163
+ /* @__PURE__ */jsxRuntime.jsx("span",{"aria-hidden":"true",style:sx(".ph-banner__app"),children:icon}),
164
+ /* @__PURE__ */jsxRuntime.jsxs("span",{children:[
165
+ /* @__PURE__ */jsxRuntime.jsxs("span",{style:sx(".ph-banner__meta"),children:[text.app===""?/* @__PURE__ */jsxRuntime.jsx("span",{}):/* @__PURE__ */jsxRuntime.jsx("strong",{style:sx(".ph-banner__meta strong"),children:text.app}),
166
+ /* @__PURE__ */jsxRuntime.jsx("small",{children:text.now})]}),
167
+ /* @__PURE__ */jsxRuntime.jsx("strong",{style:sx(".ph-banner__txt > strong"),children:text.title}),text.body===""?null:/* @__PURE__ */jsxRuntime.jsx("span",{style:sx(".ph-banner__txt > span:last-child"),children:text.body})]})]})}var INTRO_PATH="/widget/v1/me/intro";function disposed2(verb){return makeEverfurError("runtimeDisposed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${verb} was called after unmount`})}function malformed2(call){return makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:`${call}: the response was not the documented shape`})}function introStateFromWire(raw){if(raw===null||typeof raw!="object"||Array.isArray(raw))return null;let o=raw;if(!("seen_at"in o))return null;let at=o.seen_at;return at===null?/* @__PURE__ */Object.freeze({seenAt:null}):typeof at!="string"||at.length===0||at.length>64||Number.isNaN(Date.parse(at))?null:/* @__PURE__ */Object.freeze({seenAt:at})}function createIntroRepository(runtime){let over=()=>{let{services:services}=runtime.registry;return createIntroRepositoryOver({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})},gone=verb=>Promise.resolve(err(disposed2(verb)));return{read:opts=>runtime.isDisposed?gone("read"):over().read(opts),markSeen:()=>runtime.isDisposed?gone("markSeen"):over().markSeen()}}function createIntroRepositoryOver(deps){let funnel=deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}}),call=async(name,req,opts)=>{let res=await funnel.send(name,req,opts);if(!res.ok)return err(res.error);let state=introStateFromWire(res.value);return state===null?err(malformed2(name)):ok(state)};return{read(opts){let req=opts?.signal?{method:"GET",path:INTRO_PATH,signal:opts.signal}:{method:"GET",path:INTRO_PATH};return call("intro.read",req,{maxAttempts:1})},markSeen(){return call("intro.markSeen",{method:"PUT",path:INTRO_PATH,body:{seen:true}})}}}var INTRO_SEEN_KV_PREFIX="everfur.intro.seen.v1:",keyFor=userRef=>`${INTRO_SEEN_KV_PREFIX}${userRef}`;async function readIntroSeenLocally(kv,userRef){try{return await kv.getItem(keyFor(userRef))!==null}catch{return false}}async function keepIntroSeenLocally(kv,userRef,at){try{await kv.setItem(keyFor(userRef),at)}catch{}}async function shouldPlayIntro(deps){let{repo:repo,kv:kv,userRef:userRef,signal:signal}=deps;if(userRef===null||await readIntroSeenLocally(kv,userRef))return false;let read;try{read=await repo.read(signal?{signal:signal}:void 0)}catch{return false}return signal?.aborted===true||!read.ok?false:read.value.seenAt!==null?(await keepIntroSeenLocally(kv,userRef,read.value.seenAt),false):true}async function markIntroSeen(deps){let{repo:repo,kv:kv,userRef:userRef}=deps;if(userRef!==null){await keepIntroSeenLocally(kv,userRef,(deps.now?.()??/* @__PURE__ */new Date).toISOString());try{await repo.markSeen()}catch{}}}function useEverfurIntroSeen(){let{runtime:runtime,userRef:userRef}=useEverfurContext();return react.useMemo(()=>{let repo=createIntroRepository(runtime),kv=runtime.registry.services.kv;return{shouldPlay:signal=>shouldPlayIntro({repo:repo,kv:kv,userRef:userRef,...signal===void 0?{}:{signal:signal}}),markSeen:()=>markIntroSeen({repo:repo,kv:kv,userRef:userRef})}},[runtime,userRef])}exports.EVERFUR_INTRO_COPY=EVERFUR_INTRO_COPY;exports.EVERFUR_RECORDS_LANDED_EVENT=EVERFUR_RECORDS_LANDED_EVENT;exports.EVERFUR_RECORDS_REQUESTED_EVENT=EVERFUR_RECORDS_REQUESTED_EVENT;exports.EverfurIntro=EverfurIntro;exports.EverfurRecordsLandedBanner=EverfurRecordsLandedBanner;exports.RECORDS_BANNER_MS=RECORDS_BANNER_MS;exports.defaultIntroBlanks=defaultIntroBlanks;exports.introFacts=introFacts;exports.introPetWords=introPetWords;exports.introText=introText;exports.isIntroSwipeOut=isIntroSwipeOut;exports.numberWord=numberWord;exports.useEverfurIntroSeen=useEverfurIntroSeen;
@@ -0,0 +1,79 @@
1
+ import { ReactNode } from 'react';
2
+ import { H as HealthPlanPage } from '../../focus.d-jQWp0hdK.cjs';
3
+ import { P as PetRef } from '../../ids.d-B2GAAifq.cjs';
4
+ import { C as CaptureRecordsSignature } from '../../clinicRequestProps.d-1dCtouGA.cjs';
5
+ import { E as EverfurIntroCopy, a as EverfurIntroBlank, b as EverfurRecordsRequested, I as IntroText } from '../../introEvents.d-BkGDT_kG.cjs';
6
+ export { c as EVERFUR_INTRO_COPY, d as EverfurRecordsLanded, e as IntroFacts, f as IntroPetWords, g as IntroTextInput, h as defaultIntroBlanks, i as introFacts, j as introPetWords, k as introText, n as numberWord } from '../../introEvents.d-BkGDT_kG.cjs';
7
+ import { E as EverfurIntroMode, a as EverfurIntroFrame, b as EverfurIntroClose, c as EverfurIntroTabLabels } from '../../useIntroSeen.d-CTWFUthO.cjs';
8
+ export { d as EverfurIntroExit, e as EverfurIntroSeen, i as isIntroSwipeOut, u as useEverfurIntroSeen } from '../../useIntroSeen.d-CTWFUthO.cjs';
9
+ export { E as EVERFUR_RECORDS_LANDED_EVENT, a as EVERFUR_RECORDS_REQUESTED_EVENT } from '../../introEvents.d-dS3fJCH1.cjs';
10
+ import '../../EverfurError.d-8NHtlgzA.cjs';
11
+ import '../../EverfurResult.d-BFH-3s6E.cjs';
12
+ import '../../requestFunnel.d-RZex94XX.cjs';
13
+ import '../../ErrorPolicyPort.d-DirW9hgO.cjs';
14
+ import '../../config.d-DJ4mvf_w.cjs';
15
+ import '../../identity.d-CJfnWOdH.cjs';
16
+ import '../../clinicModels.d-BXgKZqDb.cjs';
17
+ import '../../models.d-BSqvbTE1.cjs';
18
+
19
+ interface EverfurIntroProps {
20
+ readonly petRef: PetRef;
21
+ /** Defaults to 'intro'. */
22
+ readonly mode?: EverfurIntroMode;
23
+ /**
24
+ * The pet's Health Plan page: the pet's name and sex (her pronoun), the plan's title (the blanks card's header),
25
+ * its tips, and its vet byline. Null or absent: `petName` and the lines that need the page are not drawn.
26
+ */
27
+ readonly page?: HealthPlanPage | null;
28
+ readonly petName?: string | null;
29
+ /** The pet's vet records are already in: frame 1 only, and its button reads "See her plan". */
30
+ readonly recordsConnected?: boolean;
31
+ /** The pet's results are not back yet: frame 1's waiting lines. */
32
+ readonly resultsPending?: boolean;
33
+ /** Your own words (each defaults to empty, and an empty line is not drawn). */
34
+ readonly copy?: Partial<EverfurIntroCopy>;
35
+ /** The plan's blanks, in order. Absent: the pet's weight and next shots. */
36
+ readonly blanks?: readonly EverfurIntroBlank[];
37
+ /**
38
+ * The element the intro covers, positioned (relative or absolute). The intro mounts in it, and its other children
39
+ * turn inert while it is open. Absent: the intro mounts where it is rendered, over its parent.
40
+ */
41
+ readonly container?: HTMLElement | null;
42
+ /** The tab bar frame 1 lights: the dims leave it clear. */
43
+ readonly tabBar?: HTMLElement | null;
44
+ /** The frame shown, and null once closed: frame 1 lights the tab bar ('tabs'). */
45
+ readonly onFrame?: (frame: EverfurIntroFrame | null) => void;
46
+ /** The member closed it (the sheet is still going down). */
47
+ readonly onClose: (close: EverfurIntroClose) => void;
48
+ /** The sheet is down: unmount it. */
49
+ readonly onClosed?: () => void;
50
+ readonly onRequested?: (event: EverfurRecordsRequested) => void;
51
+ /**
52
+ * Sent's "Turn on notifications": resolve true once they are on (your app's own permission ask and device
53
+ * registration). Absent: Everfur's preferences for the member, push and email on (`setPreferences`).
54
+ */
55
+ readonly onEnableNotifications?: () => boolean | Promise<boolean>;
56
+ /** The clinic frame's "Upload a PDF or a photo instead", run once the intro closes. Absent: the link is not drawn. */
57
+ readonly onUpload?: () => void;
58
+ /** The consent step's owner name, and your own signature capture. */
59
+ readonly ownerName?: string;
60
+ readonly onCaptureSignature?: CaptureRecordsSignature;
61
+ /** The tab labels frame 1's rows carry. Defaults to Raph's: Ask, Health Plan, Records. */
62
+ readonly tabLabels?: EverfurIntroTabLabels;
63
+ }
64
+
65
+ declare function EverfurIntro(props: EverfurIntroProps): ReactNode;
66
+
67
+ /** How long his banner stays before the records land (S.bannerT, 6000ms). */
68
+ declare const RECORDS_BANNER_MS = 6000;
69
+ interface EverfurRecordsLandedBannerProps {
70
+ /** The banner's lines (`introText(...).banner`). */
71
+ readonly text: IntroText['banner'];
72
+ /** The partner's app tile (his Embark mark). Absent: the tile is drawn plain, in the accent colour. */
73
+ readonly icon?: ReactNode;
74
+ /** Tapped, or its six seconds ran out: land the records (open the Health Plan, say they are in). */
75
+ readonly onLand: () => void;
76
+ }
77
+ declare function EverfurRecordsLandedBanner({ text, icon, onLand }: EverfurRecordsLandedBannerProps): ReactNode;
78
+
79
+ export { EverfurIntro, EverfurIntroBlank, EverfurIntroClose, EverfurIntroCopy, EverfurIntroFrame, EverfurIntroMode, type EverfurIntroProps, EverfurIntroTabLabels, EverfurRecordsLandedBanner, type EverfurRecordsLandedBannerProps, EverfurRecordsRequested, IntroText, RECORDS_BANNER_MS };