@everfur/sdk 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{Chat.d-BXuEjJsg.d.ts → Chat.d-BCfyvzX8.d.ts} +1 -1
- package/dist/{Chat.d-D9n8tSDD.d.cts → Chat.d-Od44h51D.d.cts} +1 -1
- package/dist/{DepthViews.d-PmjccZLr.d.cts → DepthViews.d-BGspxovy.d.cts} +1 -1
- package/dist/{DepthViews.d-aOChkwU2.d.ts → DepthViews.d-BIHVrf9r.d.ts} +1 -1
- package/dist/{DepthViews.d-ktxIIsnb.d.cts → DepthViews.d-BaLh7Lsi.d.cts} +1 -1
- package/dist/{DepthViews.d-CpF_Y_z9.d.ts → DepthViews.d-CEVk9poG.d.ts} +1 -1
- package/dist/ErrorPolicyPort.d-BIdmYQnk.d.cts +43 -0
- package/dist/ErrorPolicyPort.d-BnI5qWg4.d.ts +43 -0
- package/dist/{RecordsPage.d-BfMSOsg_.d.ts → RecordsPage.d-D10RIgdc.d.ts} +1 -1
- package/dist/{RecordsPage.d-DWjFpZs1.d.cts → RecordsPage.d-DbhYNSbq.d.cts} +1 -1
- package/dist/animations/index.cjs +1 -1
- package/dist/animations/index.d.cts +3 -3
- package/dist/animations/index.d.ts +3 -3
- package/dist/animations/index.js +1 -1
- package/dist/{attachments.d-DjWUR-h9.d.ts → attachments.d-BlukNfIf.d.ts} +2 -2
- package/dist/{attachments.d-Bsg6duaq.d.cts → attachments.d-CF4lLuGK.d.cts} +2 -2
- package/dist/{bookingCopy.d-ITpabqPr.d.ts → bookingCopy.d-BuDv16WP.d.ts} +12 -12
- package/dist/{bookingCopy.d-B39JAmIZ.d.cts → bookingCopy.d-rnBSqOSN.d.cts} +12 -12
- package/dist/{branding.d-Bzs4HJoN.d.cts → branding.d-CqDLKj1U.d.cts} +1 -1
- package/dist/{branding.d-CiC6xfGT.d.ts → branding.d-XrZYClN4.d.ts} +1 -1
- package/dist/{callCopy.d-Bw6oZT54.d.cts → callCopy.d-BQxpwXqT.d.cts} +3 -3
- package/dist/{callCopy.d-Bw6oZT54.d.ts → callCopy.d-BQxpwXqT.d.ts} +3 -3
- package/dist/{callRoom.d-B1DoYdJe.d.cts → callRoom.d-9Dm7XnUr.d.cts} +1 -1
- package/dist/{callRoom.d-Dqm1rUqT.d.ts → callRoom.d-t-khijDv.d.ts} +1 -1
- package/dist/{casesRepository.d-De4ZtgJ_.d.cts → casesRepository.d-CVuKTkJo.d.cts} +1 -1
- package/dist/{casesRepository.d-DsEeFd0F.d.ts → casesRepository.d-Dn1fK1b2.d.ts} +1 -1
- package/dist/chat/index.cjs +195 -195
- package/dist/chat/index.d.cts +14 -14
- package/dist/chat/index.d.ts +14 -14
- package/dist/chat/index.js +203 -203
- package/dist/chat/lite/index.cjs +206 -206
- package/dist/chat/lite/index.d.cts +14 -14
- package/dist/chat/lite/index.d.ts +14 -14
- package/dist/chat/lite/index.js +206 -206
- package/dist/{chatHandoffToken.d-sbumx0He.d.cts → chatHandoffToken.d-BjfmIxXk.d.cts} +7 -7
- package/dist/{chatHandoffToken.d-YJY6TZbj.d.ts → chatHandoffToken.d-CFiI6IMc.d.ts} +7 -7
- package/dist/{checkin.d-DxpoRutq.d.cts → checkin.d-BP3ZWBfX.d.cts} +19 -7
- package/dist/{checkin.d-C6vh9KVr.d.ts → checkin.d-CokpahFL.d.ts} +19 -7
- package/dist/{chunk-FZ6DAQFH.js → chunk-4KFFE42Z.js} +20 -20
- package/dist/{chunk-ZPIOCHKW.js → chunk-6IHY7HS7.js} +1 -1
- package/dist/{chunk-II4QDD6F.js → chunk-BMYNDBUR.js} +1 -1
- package/dist/{chunk-AJEELSFO.js → chunk-HHCGXQJR.js} +13 -13
- package/dist/client/index.cjs +31 -31
- package/dist/client/index.d.cts +24 -21
- package/dist/client/index.d.ts +24 -21
- package/dist/client/index.js +31 -31
- package/dist/{clinicBatch.d-B3YJc8IO.d.cts → clinicBatch.d-C0xx5L4j.d.cts} +3 -3
- package/dist/{clinicBatch.d-DhvQuPHV.d.ts → clinicBatch.d-DNi4UURs.d.ts} +3 -3
- package/dist/{config.d-DRoQ2lAx.d.ts → config.d-B7Z-KTGq.d.ts} +10 -2
- package/dist/{config.d-BiVy0fLx.d.cts → config.d-ClAI2RZ6.d.cts} +10 -2
- package/dist/consent/index.cjs +1 -1
- package/dist/consent/index.d.cts +6 -6
- package/dist/consent/index.d.ts +6 -6
- package/dist/consent/index.js +2 -2
- package/dist/{context.d-Cq2C4vdh.d.cts → context.d-Bj6-xYPA.d.cts} +13 -7
- package/dist/{context.d-D1l56nFr.d.ts → context.d-DS1GXUEY.d.ts} +13 -7
- package/dist/{copy.d-Ce_8KuZg.d.cts → copy.d--F5A9cXK.d.cts} +3 -3
- package/dist/{copy.d-BP36f_63.d.ts → copy.d-DmxuFJFe.d.ts} +3 -3
- package/dist/core/index.cjs +42 -41
- package/dist/core/index.d.cts +20 -20
- package/dist/core/index.d.ts +20 -20
- package/dist/core/index.js +42 -41
- package/dist/{depth.d-DzMMmRN4.d.ts → depth.d-CgzYE6_n.d.ts} +3 -3
- package/dist/{depth.d-BtlcIqPJ.d.cts → depth.d-DLaP0o8Y.d.cts} +3 -3
- package/dist/{entitlementRepository.d-x2YFdgYD.d.ts → entitlementRepository.d-CkUTlVAb.d.ts} +3 -3
- package/dist/{entitlementRepository.d-CEDU1gZE.d.cts → entitlementRepository.d-DVTp-BB9.d.cts} +3 -3
- package/dist/{focus.d-BX7oahFk.d.cts → focus.d-CLTjm6In.d.cts} +1 -1
- package/dist/{focus.d-armXecf0.d.ts → focus.d-u-HYvim0.d.ts} +1 -1
- package/dist/health-plan/index.cjs +1 -1
- package/dist/health-plan/index.d.cts +17 -17
- package/dist/health-plan/index.d.ts +17 -17
- package/dist/health-plan/index.js +1 -1
- package/dist/{healthPlanRepository.d-DBx7-NLE.d.cts → healthPlanRepository.d-B22kjrYa.d.cts} +3 -3
- package/dist/{healthPlanRepository.d-C7K9dJK5.d.ts → healthPlanRepository.d-CwRXeoM7.d.ts} +3 -3
- package/dist/{idempotency.d-Dak2-pON.d.cts → idempotency.d-CFVMhWcv.d.cts} +1 -1
- package/dist/{idempotency.d-symqJ8Tt.d.ts → idempotency.d-dOFfV91-.d.ts} +1 -1
- package/dist/{identity.d-DOKJFaiz.d.ts → identity.d-D4VtpqRr.d.ts} +1 -1
- package/dist/{identity.d-DIH9h3Le.d.cts → identity.d-DDpXOtas.d.cts} +1 -1
- package/dist/{inbox.d-AuGKeaZv.d.cts → inbox.d-CPcMMz-Y.d.cts} +2 -2
- package/dist/{inbox.d-B5b57OXc.d.ts → inbox.d-DJ9xgU1Z.d.ts} +2 -2
- package/dist/index.cjs +248 -247
- package/dist/index.d.cts +22 -22
- package/dist/index.d.ts +22 -22
- package/dist/index.js +247 -246
- package/dist/{introEvents.d-ehik7PEn.d.cts → introEvents.d-B7acmGwf.d.cts} +1 -1
- package/dist/{introEvents.d-S4Q4BOSt.d.ts → introEvents.d-DW3gLljE.d.ts} +1 -1
- package/dist/{layout.d-Bm2_1wa4.d.ts → layout.d-C8y_ki1V.d.ts} +1 -1
- package/dist/{layout.d-CFF-nBXf.d.cts → layout.d-DfaFM_lp.d.cts} +1 -1
- package/dist/{models.d-DOwpK1ZF.d.ts → models.d-BKmOfoqV.d.cts} +2 -2
- package/dist/{models.d-Su_BBBTW.d.cts → models.d-BULqCO2R.d.ts} +2 -2
- package/dist/notifications/inbox/index.cjs +9 -9
- package/dist/notifications/inbox/index.d.cts +7 -7
- package/dist/notifications/inbox/index.d.ts +7 -7
- package/dist/notifications/inbox/index.js +9 -9
- package/dist/notifications/index.cjs +3 -3
- package/dist/notifications/index.d.cts +8 -8
- package/dist/notifications/index.d.ts +8 -8
- package/dist/notifications/index.js +6 -6
- package/dist/{optInView.d-DbGx1A9R.d.cts → optInView.d-ByDJMrMv.d.cts} +13 -13
- package/dist/{optInView.d-xnIxCLlH.d.ts → optInView.d-DVshLxbD.d.ts} +13 -13
- package/dist/{parse.d-DtHmpAMT.d.cts → parse.d-BDZ7ffgj.d.cts} +4 -1
- package/dist/{parse.d-DtHmpAMT.d.ts → parse.d-BDZ7ffgj.d.ts} +4 -1
- package/dist/{pets.d-BEqKykpu.d.ts → pets.d-BpLObpfM.d.ts} +1 -1
- package/dist/{pets.d-BS6sLxY-.d.cts → pets.d-DXhzTNuI.d.cts} +1 -1
- package/dist/{petsRepository.d-iHrHkXM2.d.ts → petsRepository.d-_QfM7F6T.d.ts} +1 -1
- package/dist/{petsRepository.d-DB5CNKsK.d.cts → petsRepository.d-ai_tZ3lu.d.cts} +1 -1
- package/dist/photo/index.cjs +1 -1
- package/dist/photo/index.js +23 -23
- package/dist/{presentation.d-CWGjwq8Z.d.cts → presentation.d-BkIvMtIl.d.cts} +3 -3
- package/dist/{presentation.d-CWGjwq8Z.d.ts → presentation.d-BkIvMtIl.d.ts} +3 -3
- package/dist/records/depth/index.cjs +1 -1
- package/dist/records/depth/index.d.cts +10 -10
- package/dist/records/depth/index.d.ts +10 -10
- package/dist/records/depth/index.js +1 -1
- package/dist/records/index.cjs +2 -2
- package/dist/records/index.d.cts +13 -13
- package/dist/records/index.d.ts +13 -13
- package/dist/records/index.js +71 -71
- package/dist/{requestFunnel.d-SySe6xHp.d.cts → requestFunnel.d-BwZDfWVD.d.cts} +3 -3
- package/dist/{requestFunnel.d-CehftayS.d.ts → requestFunnel.d-DKBPTpsy.d.ts} +3 -3
- package/dist/{route.d-9wclfD-y.d.cts → route.d-DCzQh4ix.d.cts} +3 -3
- package/dist/{route.d-IP_gkOWL.d.ts → route.d-DSYEd2MR.d.ts} +3 -3
- package/dist/{runtimeTypes.d-BdUe3tYs.d.ts → runtimeTypes.d-BzUig75K.d.ts} +15 -11
- package/dist/{runtimeTypes.d-_UZ6rMUY.d.cts → runtimeTypes.d-CL4l7ta4.d.cts} +15 -11
- package/dist/{screenProps.d-Bd2yphad.d.cts → screenProps.d-6xmE1C-V.d.cts} +2 -2
- package/dist/{screenProps.d-D9Vi-Afl.d.ts → screenProps.d-fHBKArt_.d.ts} +2 -2
- package/dist/{sdkConfigStore.d-VPvsIL8E.d.ts → sdkConfigStore.d-BNCVVEWC.d.ts} +1 -1
- package/dist/{sdkConfigStore.d-BHrzkVpP.d.cts → sdkConfigStore.d-C2BAr9kI.d.cts} +1 -1
- package/dist/server/events/index.cjs +4 -4
- package/dist/server/events/index.d.cts +2 -2
- package/dist/server/events/index.d.ts +2 -2
- package/dist/server/events/index.js +4 -4
- package/dist/server/index.cjs +9 -9
- package/dist/server/index.d.cts +18 -4
- package/dist/server/index.d.ts +18 -4
- package/dist/server/index.js +9 -9
- package/dist/shop/index.d.cts +3 -3
- package/dist/shop/index.d.ts +3 -3
- package/dist/slots/index.cjs +1 -1
- package/dist/slots/index.d.cts +6 -6
- package/dist/slots/index.d.ts +6 -6
- package/dist/slots/index.js +1 -1
- package/dist/tabs/index.cjs +88 -85
- package/dist/tabs/index.d.cts +15 -15
- package/dist/tabs/index.d.ts +15 -15
- package/dist/tabs/index.js +87 -84
- package/dist/televet/booking/index.cjs +41 -41
- package/dist/televet/booking/index.d.cts +8 -8
- package/dist/televet/booking/index.d.ts +8 -8
- package/dist/televet/booking/index.js +4 -4
- package/dist/televet/call/index.d.cts +2 -2
- package/dist/televet/call/index.d.ts +2 -2
- package/dist/televet/index.cjs +1 -1
- package/dist/televet/index.js +1 -1
- package/dist/testing/index.cjs +1 -1
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/rn/index.cjs +8 -8
- package/dist/testing/rn/index.d.cts +13 -13
- package/dist/testing/rn/index.d.ts +13 -13
- package/dist/testing/rn/index.js +9 -9
- package/dist/testing/web/index.cjs +3 -3
- package/dist/testing/web/index.d.cts +13 -13
- package/dist/testing/web/index.d.ts +13 -13
- package/dist/testing/web/index.js +1 -1
- package/dist/texting/index.cjs +1 -1
- package/dist/texting/index.d.cts +6 -6
- package/dist/texting/index.d.ts +6 -6
- package/dist/texting/index.js +26 -26
- package/dist/{threadOptions.d-bEAFkIsC.d.cts → threadOptions.d-Bqy5d5Fx.d.cts} +1 -1
- package/dist/{threadOptions.d-U5YBUKM-.d.ts → threadOptions.d-DOEIpk1t.d.ts} +1 -1
- package/dist/{threadOptions.d-BW0rePcs.d.cts → threadOptions.d-Dc57dm7h.d.cts} +7 -7
- package/dist/{threadOptions.d-CrAb71J2.d.ts → threadOptions.d-NSlFx-Lp.d.ts} +7 -7
- package/dist/{timelineRows.d-DXppCSCg.d.cts → timelineRows.d-7w8NsNi4.d.cts} +1 -1
- package/dist/{timelineRows.d-9Uhf4q5d.d.ts → timelineRows.d-CthNM5hV.d.ts} +1 -1
- package/dist/{typeStyle.d-rzVzCfLz.d.ts → typeStyle.d-8mcLhtbH.d.ts} +1 -1
- package/dist/{typeStyle.d-B-YgiWcS.d.cts → typeStyle.d-CLrQZW-r.d.cts} +1 -1
- package/dist/{unreadStore.d-gCsleb6l.d.ts → unreadStore.d-CLnChKca.d.ts} +17 -9
- package/dist/{unreadStore.d-w5x6lEpR.d.cts → unreadStore.d-Donv4bcF.d.cts} +17 -9
- package/dist/{useHealthPlanSubscription.d-CRBPMlsc.d.ts → useHealthPlanSubscription.d-CV7M21HS.d.ts} +3 -3
- package/dist/{useHealthPlanSubscription.d-DfjTYv1u.d.cts → useHealthPlanSubscription.d-SA9-SuKe.d.cts} +3 -3
- package/dist/{useInboxUnread.d-CP3KwSkn.d.ts → useInboxUnread.d-CXiaR3BZ.d.ts} +1 -1
- package/dist/{useInboxUnread.d-DiE_NbtS.d.cts → useInboxUnread.d-DERpMelw.d.cts} +1 -1
- package/dist/{usePresentation.d-DefUwatV.d.cts → usePresentation.d-BJzFicRQ.d.cts} +3 -3
- package/dist/{usePresentation.d-w5_oWKmh.d.ts → usePresentation.d-DgSGIWS-.d.ts} +3 -3
- package/dist/{useRecordsDepth.d-l6D0ZS4l.d.cts → useRecordsDepth.d-C9W45gwS.d.cts} +1 -1
- package/dist/{useRecordsDepth.d-DG2GiAyt.d.ts → useRecordsDepth.d-ZX2rhcUx.d.ts} +1 -1
- package/dist/{useUnread.d-xDOpYyqx.d.ts → useUnread.d-CedFK4k6.d.ts} +5 -5
- package/dist/{useUnread.d-DeRDFtTb.d.cts → useUnread.d-DST1GMmL.d.cts} +5 -5
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.js +1 -1
- package/dist/{view.d-ufGX_MKK.d.cts → view.d-3lxzyJlL.d.cts} +6 -6
- package/dist/{view.d-iTInze7B.d.ts → view.d-DRiYNQJ8.d.ts} +6 -6
- package/dist/web/consent/index.cjs +3 -3
- package/dist/web/consent/index.d.cts +6 -6
- package/dist/web/consent/index.d.ts +6 -6
- package/dist/web/consent/index.js +5 -5
- package/dist/web/health-plan/index.cjs +2 -2
- package/dist/web/health-plan/index.d.cts +17 -17
- package/dist/web/health-plan/index.d.ts +17 -17
- package/dist/web/health-plan/index.js +1 -1
- package/dist/web/inbox/index.cjs +5 -5
- package/dist/web/inbox/index.d.cts +9 -8
- package/dist/web/inbox/index.d.ts +9 -8
- package/dist/web/inbox/index.js +5 -5
- package/dist/web/index.cjs +196 -195
- package/dist/web/index.d.cts +34 -34
- package/dist/web/index.d.ts +34 -34
- package/dist/web/index.js +196 -195
- package/dist/web/intro/index.cjs +10 -10
- package/dist/web/intro/index.d.cts +8 -8
- package/dist/web/intro/index.d.ts +8 -8
- package/dist/web/intro/index.js +6 -6
- package/dist/web/notifications/index.cjs +5 -5
- package/dist/web/notifications/index.d.cts +7 -7
- package/dist/web/notifications/index.d.ts +7 -7
- package/dist/web/notifications/index.js +1 -1
- package/dist/web/records/depth/index.cjs +1 -1
- package/dist/web/records/depth/index.d.cts +10 -10
- package/dist/web/records/depth/index.d.ts +10 -10
- package/dist/web/records/depth/index.js +1 -1
- package/dist/web/records/index.cjs +1 -1
- package/dist/web/records/index.d.cts +13 -13
- package/dist/web/records/index.d.ts +13 -13
- package/dist/web/records/index.js +1 -1
- package/dist/web/records-sheet/index.cjs +2 -2
- package/dist/web/records-sheet/index.js +2 -2
- package/dist/web/shop/index.cjs +1 -1
- package/dist/web/shop/index.d.cts +3 -3
- package/dist/web/shop/index.d.ts +3 -3
- package/dist/web/shop/index.js +15 -15
- package/dist/web/televet/booking/index.cjs +7 -7
- package/dist/web/televet/booking/index.d.cts +9 -9
- package/dist/web/televet/booking/index.d.ts +9 -9
- package/dist/web/televet/booking/index.js +69 -69
- package/dist/web/televet/call/index.cjs +1 -1
- package/dist/web/televet/call/index.d.cts +2 -2
- package/dist/web/televet/call/index.d.ts +2 -2
- package/dist/web/televet/call/index.js +1 -1
- package/dist/web/televet/index.cjs +6 -6
- package/dist/web/televet/index.js +1 -1
- package/dist/web/texting/index.cjs +1 -1
- package/dist/web/texting/index.d.cts +6 -6
- package/dist/web/texting/index.d.ts +6 -6
- package/dist/web/texting/index.js +1 -1
- package/dist/web/ui/index.cjs +1 -1
- package/dist/web/ui/index.js +32 -32
- package/package.json +1 -32
- package/dist/ErrorPolicyPort.d-68yrE3BE.d.ts +0 -23
- package/dist/ErrorPolicyPort.d-DirW9hgO.d.cts +0 -23
package/dist/web/intro/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
"use client";
|
|
3
|
-
"use strict";var e=require("react"),t=require("react-dom"),n=require("react/jsx-runtime");var r=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"anchor_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"anchor_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"anonTokenInvalid",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"before_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_not_uploaded",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundles_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"environment_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"restricted_key",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"ticket_not_resolved",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tickets_disabled",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],i=/* @__PURE__ */Object.freeze(r.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(i.map(e=>e.wireCode));var a=/* @__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",anonTokenInvalid:"authRejected",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",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable",anchor_not_found:"resourceNotFound",anchor_ref_invalid:"validationFailed",before_invalid:"validationFailed",bundle_mismatch:"validationFailed",bundle_not_uploaded:"validationFailed",bundles_unavailable:"serviceUnavailable",environment_mismatch:"validationFailed",restricted_key:"accessDenied",ticket_not_resolved:"conflict",tickets_disabled:"resourceNotFound"}),o=/* @__PURE__ */Object.freeze(i.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:a[e.wireCode]}))),s=new Map(o.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),l=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(o.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let n=e.trim().toUpperCase();if(n.length!==0)for(let e of[t??"http_envelope",...l]){let t=s.get(e+n);if(t)return t}}var d=/* @__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(e){return d[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let n=(e??"").trim().toUpperCase(),r=n.replace(/[^A-Z0-9]/g,"");if(r==="AUTHREJECTED")return"authRejected";if(n.startsWith("AUTH"))return"authExpired";switch(r){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"FREECAPREACHED":return"paymentRequired";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 c=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return c.has(e)}var u=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||u.has(e)}var p=500,h=8e3,f=4;function backoffDelayMs(e,t=Math.random){let n=Math.max(0,e),r=Math.min(p*2**n,h);return Math.floor(t()*r)}var b="This feature isn't available on your account right now.",m="Something in that request was not right. Check the details and try again.",y=/* @__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:b,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:m,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:b,runtimeDisposed:m,unknown:"Something went wrong. Please try again."}),g="This session has ended. Please sign in again.",v="linked_account_read_only";function x(e,t,n){return e==="conflict"&&n===v?b:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?g:userFacingError(e)}function userFacingError(e){return y[e]}function k(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:false,writable:false,configurable:false})}var w=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let n=contractErrorFor(t?.wireCode,t?.wireEnvelope),r=e==="conflict"&&t?.reasonCode===v,i={code:e,category:categoryFor(e),retryable:t?.retryable??(r?false:isRetryableCode(e)),displayMessage:x(e,t?.wireCode,r?v:null)};t?.httpStatus!==void 0&&(i.httpStatus=t.httpStatus),t?.requestId&&(i.requestId=t.requestId),typeof t?.reasonCode=="string"&&w.test(t.reasonCode)&&(i.reasonCode=t.reasonCode);let a=t?.retryAfterSeconds;if(typeof a=="number"&&Number.isFinite(a)&&a>=0&&(i.retryAfterSeconds=Math.round(a)),n);return t?.wireMessage&&k(i,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&k(i,"raw",t.raw),/* @__PURE__ */Object.freeze(i)}function ok(e,t){/* @__PURE__ */
|
|
3
|
+
"use strict";var e=require("react"),t=require("react-dom"),n=require("react/jsx-runtime");var r=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"anchor_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"anchor_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"anonTokenInvalid",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"before_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_not_uploaded",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundles_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"environment_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"restricted_key",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"ticket_not_resolved",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tickets_disabled",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"timezone_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],i=/* @__PURE__ */Object.freeze(r.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(i.map(e=>e.wireCode));var a=/* @__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",anonTokenInvalid:"authRejected",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",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable",anchor_not_found:"resourceNotFound",anchor_ref_invalid:"validationFailed",before_invalid:"validationFailed",bundle_mismatch:"validationFailed",bundle_not_uploaded:"validationFailed",bundles_unavailable:"serviceUnavailable",environment_mismatch:"validationFailed",restricted_key:"accessDenied",ticket_not_resolved:"conflict",tickets_disabled:"resourceNotFound",timezone_invalid:"validationFailed"}),o=/* @__PURE__ */Object.freeze(i.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:a[e.wireCode]}))),s=new Map(o.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),l=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(o.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let n=e.trim().toUpperCase();if(n.length!==0)for(let e of[t??"http_envelope",...l]){let t=s.get(e+n);if(t)return t}}var d=/* @__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(e){return d[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let n=(e??"").trim().toUpperCase(),r=n.replace(/[^A-Z0-9]/g,"");if(r==="AUTHREJECTED")return"authRejected";if(n.startsWith("AUTH"))return"authExpired";switch(r){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"FREECAPREACHED":return"paymentRequired";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 c=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return c.has(e)}var u=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||u.has(e)}var p=500,h=8e3,f=4;function backoffDelayMs(e,t=Math.random){let n=Math.max(0,e),r=Math.min(p*2**n,h);return Math.floor(t()*r)}var b="This feature isn't available on your account right now.",m="Something in that request was not right. Check the details and try again.",y=/* @__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:b,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:m,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:b,runtimeDisposed:m,unknown:"Something went wrong. Please try again."}),g="This session has ended. Please sign in again.",v="linked_account_read_only";function x(e,t,n){return e==="conflict"&&n===v?b:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?g:userFacingError(e)}function userFacingError(e){return y[e]}function k(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:false,writable:false,configurable:false})}var _=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let n=contractErrorFor(t?.wireCode,t?.wireEnvelope),r=e==="conflict"&&t?.reasonCode===v,i={code:e,category:categoryFor(e),retryable:t?.retryable??(r?false:isRetryableCode(e)),displayMessage:x(e,t?.wireCode,r?v:null)};t?.httpStatus!==void 0&&(i.httpStatus=t.httpStatus),t?.requestId&&(i.requestId=t.requestId),typeof t?.reasonCode=="string"&&_.test(t.reasonCode)&&(i.reasonCode=t.reasonCode);let a=t?.retryAfterSeconds;if(typeof a=="number"&&Number.isFinite(a)&&a>=0&&(i.retryAfterSeconds=Math.round(a)),n);return t?.wireMessage&&k(i,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&k(i,"raw",t.raw),/* @__PURE__ */Object.freeze(i)}function ok(e,t){/* @__PURE__ */
|
|
4
4
|
return Object.freeze({ok:true,value:e})}function err(e){/* @__PURE__ */
|
|
5
|
-
return Object.freeze({ok:false,error:e})}var
|
|
5
|
+
return Object.freeze({ok:false,error:e})}var w=class _EverfurConfigError extends Error{constructor(e,t){super(t),this.name="EverfurConfigError",this.kind=e,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function C(e){let t=e.raw;if(typeof t!="object"||t===null)return null;let n=t.code;return typeof n=="string"&&n.length>0?n:null}function S(e,t){let n=C(e);if(n===null)return e;let r=t[n];return r===void 0?e:makeEverfurError(r.code,{retryable:r.retryable,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId!==void 0?{requestId:e.requestId}:{},wireCode:n,reasonCode:n,...e.wireMessage!==void 0?{wireMessage:e.wireMessage}:{},raw:e.raw})}function errorFrame(e){/* @__PURE__ */
|
|
6
6
|
return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:null,...e.freeCap?{freeCap:/* @__PURE__ */Object.freeze({...e.freeCap})}:{}})}var E="x-everfur-anon-token",$="anonTokenInvalid";async function F(e){if(e.userRef!==null||e.anonIdentity===void 0)return null;try{return await e.anonIdentity.token()}catch{return null}}function j(e,t){let n=e instanceof Error?e.message:typeof e=="string"?e:null;return makeEverfurError("authRejected",{retryable:false,...t?.wireCode?{wireCode:t.wireCode}:{},...t?.requestId?{requestId:t.requestId}:{},...n?{wireMessage:n}:{},...e!=null?{raw:e}:{}})}function authHeaders(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:(t["x-everfur-partner-key"]=e.publishableKey,e.anonToken&&(t[E]=e.anonToken)),e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}function withAuthHeaders(e,t){return{...e,headers:{...T(e.headers),...authHeaders(t)}}}function T(e){if(!e)return{};let t={};for(let[n,r]of Object.entries(e)){let e=n.toLowerCase();e==="authorization"||e==="x-everfur-partner-key"||e===E||(t[n]=r)}return t}async function authedSend(e,t){if(t.mode==="anonymous"){let n=await F(t),r=await t.transport.request(withAuthHeaders(e,I(t,n)));if(r.ok||D(r.error.raw)!==$||t.anonIdentity===void 0||t.userRef!==null)return r;let i=await t.anonIdentity.token({forceRefresh:true});return i===null||i===n?r:t.transport.request(withAuthHeaders(e,I(t,i)))}let n;try{n=await t.identity.currentToken()}catch(e){return t.identity.reportRejected?.(),err(j(e))}let r=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:n,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(r.ok||r.error.httpStatus!==401)return r;let i;try{i=await t.identity.currentToken({forceRefresh:!0})}catch(e){return t.identity.reportRejected?.(),err(j(e,{wireCode:D(r.error.raw),requestId:r.error.requestId}))}let a=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:i,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return!a.ok&&a.error.httpStatus===401?(t.identity.reportRejected?.(),err(R(a.error))):a}function I(e,t){return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}function R(e){let t=e.raw,n=D(t);return makeEverfurError("authRejected",{retryable:false,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId?{requestId:e.requestId}:{},...n?{wireCode:n}:{},...e.reasonCode?{reasonCode:e.reasonCode}:{},...e.wireMessage?{wireMessage:e.wireMessage}:{},...t!=null?{raw:t}:{}})}function D(e){if(typeof e!="object"||e===null)return null;let t=e,n=(typeof t.error=="object"&&t.error!==null?t.error.code:void 0)??t.code;return typeof n=="string"&&n.length>0?n:null}function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:O(e)})}function O(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var P=3e4,z=h*2,A="idempotency-key",N=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),M=/* @__PURE__ */Object.freeze({onEvent(){}}),L=/* @__PURE__ */Object.freeze({setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),now:()=>Date.now()});function B(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}function createRequestFunnel(e){let t=e.observer??M,n=e.timers??L,r=e.rng??Math.random,i=e.sleep??((e,t)=>re(e,n,t)),a=e.maxAttempts??f,o=e.unaryTimeoutMs??P,s=e.newIdempotencyKey??U(),l=e=>{try{t.onEvent(e)}catch{}};async function d(t,d,c){let u=c?.maxAttempts,p=Math.max(1,u??a),h=c?.idempotent??N.has(d.method),f=c?.idempotencyKey===void 0?null:B(c.idempotencyKey),b=h?f??s():null,m=q(d,b),y=0;for(;;){let a=e=>/* @__PURE__ */Object.freeze({call:t,method:d.method,path:d.path,attempt:y,...b?{idempotencyKey:b}:{},...e});l(a({phase:"attempt"}));let s=te(o,n),c=ne(s.signal,d.signal),h;try{h=await authedSend({...m,signal:c.signal},e.auth)}catch(e){h=err(networkError(e))}finally{c.dispose(),s.cancel()}if(h.ok)return l(a({phase:"settled",ok:true,reason:"ok"})),h;let f=h.error,g=H(f,y,{maxAttempts:p,rng:r,now:n.now(),aborted:d.signal?.aborted===true,...u!==void 0?{perCallMaxAttempts:u}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),v={ok:false,code:f.code,reason:g.reason,...f.httpStatus!==void 0?{httpStatus:f.httpStatus}:{},...f.requestId!==void 0?{requestId:f.requestId}:{}};if(!g.retry)return l(a({phase:"settled",...v})),err(f);if(l(a({phase:"retry",...v,delayMs:g.delayMs})),await i(g.delayMs,d.signal),d.signal?.aborted===true)return l(a({phase:"settled",...v,reason:"aborted"})),err(f);y+=1}}async function c(t){return withAuthHeaders(t,await ee(e.auth))}async function*u(t,n,r){l(
|
|
7
7
|
/* @__PURE__ */Object.freeze({call:t,phase:"stream.open",method:n.method,path:n.path,attempt:0}));try{yield*e.auth.transport.stream(n,r)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
|
|
8
|
-
return Object.freeze({send:d,authorize:c,stream:u})}function q(e,t){let n={};for(let[t,r]of Object.entries(e.headers??{}))t.toLowerCase()!==A&&(n[t]=r);return t!==null&&(n["Idempotency-Key"]=t),{...e,headers:n}}function U(){let e=0;return()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var W=10;function H(e,t,n){if(n.aborted)return{retry:false,reason:"aborted"};let r=V(e);if(r==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(r!=="burst"&&!isAutoRetryable(e.code))return{retry:false,reason:"terminal-code"};let i=r==="burst"?"burst-throttle":"retryable-code";if((()=>{if(n.policy===void 0)return false;try{return!n.policy.shouldRetry(e.code,t)}catch{return false}})())return{retry:false,reason:"terminal-code"};let a=()=>{if(n.policy===void 0)return null;let t;try{t=n.policy.maxAttempts(e.code)}catch{return null}return typeof t!="number"||!Number.isFinite(t)?null:Math.max(1,Math.min(W,Math.floor(t)))},o=n.perCallMaxAttempts??a()??n.maxAttempts;if(t+1>=o)return{retry:false,reason:"attempts-exhausted"};let s=Y(e,n.now);return s!==null?s>z?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:i,delayMs:s}:{retry:true,reason:i,delayMs:backoffDelayMs(t,n.rng)}}function V(e){let t=e.code==="unknown"?fromWire(X(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}function Y(e,t){let n=Q(e.raw);if(n!==null){let e=n-t;return e>0?e:0}let r=K(e.raw);return r===null?null:Math.round(r*1e3)}function K(e){for(let t of G(e)){let e=t.retry_after_seconds;if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return e}return null}function Q(e){for(let t of G(e)){let e=t.resets_at,n=Z(e);if(n!==null)return n}return null}function G(e){if(!J(e))return[];let t=[e];for(let n of["error","detail"]){let r=e[n];J(r)&&t.push(r)}return t}function Z(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let t=Date.parse(e);return Number.isFinite(t)?t:null}return null}function X(e){for(let t of G(e)){let e=t.code;if(typeof e=="string"&&e.length>0)return e}return null}function J(e){return typeof e=="object"&&e!==null}async function ee(e){if(e.mode==="anonymous"){let t=await F(e);return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}return{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}function te(e,t){let n=new AbortController,r=t.setTimeout(()=>n.abort(),e);return{signal:n.signal,cancel:()=>t.clearTimeout(r)}}function ne(e,t){let n=()=>{};if(!t)return{signal:e,dispose:n};let r=new AbortController;if(e.aborted||t.aborted)return r.abort(),{signal:r.signal,dispose:n};let i=()=>r.abort();return e.addEventListener("abort",i,{once:true}),t.addEventListener("abort",i,{once:true}),{signal:r.signal,dispose:()=>{e.removeEventListener("abort",i),t.removeEventListener("abort",i)}}}function re(e,t,n){return e<=0||n?.aborted===true?Promise.resolve():new Promise(r=>{let i=t.setTimeout(()=>{n?.removeEventListener("abort",a),r()},e),a=()=>{t.clearTimeout(i),r()};n?.addEventListener("abort",a,{once:true})})}var ie=/* @__PURE__ */new Set(["expo","fcm","apns"]),ae=/* @__PURE__ */new Set(["ios","android"]),oe=4096,se=128,le=64,de=/[\0- ]/;function ce(e,t){return makeEverfurError("validationFailed",{retryable:false,wireMessage:e,...t?{reasonCode:t}:{}})}function ue(e){if(typeof e!="object"||e===null)return ce("registerDevice needs an input object");let{token:t,provider:n,platform:r,installationId:i}=e;return typeof n!="string"||!ie.has(n)?ce("provider must be expo, fcm or apns"):typeof r!="string"||!ae.has(r)?ce("platform must be ios or android"):typeof t!="string"||t.trim().length===0||t.length>oe||de.test(t)?ce(`token must be a push token of 1..${oe} characters with no whitespace`,"token_invalid"):i!==void 0&&(typeof i!="string"||i.length===0||i.length>se)?ce(`installationId must be 1..${se} characters`):null}var pe=/^[A-Za-z][A-Za-z0-9_+-]*(\/[A-Za-z0-9_+-]+){0,2}$/,he=64,fe=/^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$/,be=35;function me(e){return e.httpStatus===400&&e.code==="validationFailed"}function ye(e){let t={...e};return delete t.timezone,delete t.locale,t}function ge(e,t,n){return typeof e=="string"&&e.length<=n&&t.test(e)?e:null}function ve(e){return typeof e!="string"||e.length===0||e.length>le?ce(`deviceId must be 1..${le} characters`):de.test(e)||e.includes("/")||e==="."||e===".."?ce("deviceId is not a device id"):null}function xe(e){if(typeof e!="object"||e===null)return ce("setPreferences needs an input object");let{pushEnabled:t,emailEnabled:n}=e;return typeof t!="boolean"||typeof n!="boolean"?ce("pushEnabled and emailEnabled must both be booleans: the route replaces both switches"):null}function ke(e){return typeof e=="string"&&e.length>0?e:null}function
|
|
9
|
-
return Object.freeze({deviceId:n,provider:r,platform:i,installationId:typeof s=="string"&&s.length>0?s:null,registeredAt:a,lastSeenAt:o})}function _e(e){if(typeof e!="object"||e===null)return null;let t=e,n=ke(t.updated_at);return typeof t.push_enabled!="boolean"||typeof t.email_enabled!="boolean"||n===null?null:/* @__PURE__ */Object.freeze({pushEnabled:t.push_enabled,emailEnabled:t.email_enabled,updatedAt:n})}function Ce(e){return makeEverfurError("internalError",{retryable:false,wireMessage:`${e}: the response was not the documented shape`})}var Se=/* @__PURE__ */Object.freeze({provider_unsupported:{code:"validationFailed",retryable:false},token_invalid:{code:"validationFailed",retryable:false},device_cipher_unavailable:{code:"serviceUnavailable",retryable:true}});function Ee(e){return S(e,Se)}function $e(e){return makeEverfurError("validationFailed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${e} was called after unmount`})}function createNotificationsClient(e){let t=()=>{let{services:t}=e.registry;return Fe({auth:t.authFor(null),...t.errorPolicy?{errorPolicy:t.errorPolicy}:{}})};return{registerDevice:(n,r)=>e.isDisposed?Promise.resolve(err($e("registerDevice"))):t().registerDevice(n,r),unregisterDevice:(n,r)=>e.isDisposed?Promise.resolve(err($e("unregisterDevice"))):t().unregisterDevice(n,r),setPreferences:(n,r)=>e.isDisposed?Promise.resolve(err($e("setPreferences"))):t().setPreferences(n,r)}}function Fe(e){let t=e.funnel??createRequestFunnel({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),n=(e,t)=>t?{...e,signal:t}:e;return{async registerDevice(e,r){let i=ue(e);if(i!==null)return err(i);let a={token:e.token,provider:e.provider,platform:e.platform};e.installationId!==void 0&&(a.installation_id=e.installationId);let o=ge(e.timezone,pe,he);o!==null&&(a.timezone=o);let s=ge(e.locale,fe,be);s!==null&&(a.locale=s);let l=e=>t.send("notifications.registerDevice",n({method:"POST",path:"/widget/v1/me/devices",body:e},r?.signal)),d=await l(a);if(!d.ok&&me(d.error)&&(o!==null||s!==null)&&(d=await l(ye(a))),!d.ok)return err(Ee(d.error));let c=we(d.value);return c===null?err(Ce("registerDevice")):ok(c)},async unregisterDevice(e,r){let i=ve(e);if(i!==null)return err(i);let a=await t.send("notifications.unregisterDevice",n({method:"DELETE",path:`/widget/v1/me/devices/${encodeURIComponent(e)}`},r?.signal));return a.ok?ok(void 0):err(Ee(a.error))},async setPreferences(e,r){let i=xe(e);if(i!==null)return err(i);let a=await t.send("notifications.setPreferences",n({method:"PUT",path:"/widget/v1/me/notification-preferences",body:{push_enabled:e.pushEnabled,email_enabled:e.emailEnabled}},r?.signal));if(!a.ok)return err(Ee(a.error));let o=_e(a.value);return o===null?err(Ce("setPreferences")):ok(o)}}}var je=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),Te=globalThis,Ie=Te[je]??(Te[je]=e.createContext(null));Ie.displayName??="EverfurContext";function Re(){let t=e.useContext(Ie);if(t===null)throw new _("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return t}var De=/* @__PURE__ */Object.freeze({display:/* @__PURE__ */Object.freeze({size:29,lineHeight:1.06,weight:"800",face:"heading",letterSpacing:-.01,uppercase:false,tier:"heading"}),title:/* @__PURE__ */Object.freeze({size:23,lineHeight:1.12,weight:"800",face:"heading",letterSpacing:-.01,uppercase:false,tier:"heading"}),cardTitle:/* @__PURE__ */Object.freeze({size:19,lineHeight:1.22,weight:"800",face:"sans",letterSpacing:0,uppercase:false,tier:"heading"}),rowTitle:/* @__PURE__ */Object.freeze({size:15.5,lineHeight:1.4,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),body:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),message:/* @__PURE__ */Object.freeze({size:15.5,lineHeight:1.5,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),bodySmall:/* @__PURE__ */Object.freeze({size:14.5,lineHeight:1.4,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),caption:/* @__PURE__ */Object.freeze({size:13,lineHeight:1.4,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),label:/* @__PURE__ */Object.freeze({size:10.5,lineHeight:1.4,weight:"400",face:"mono",letterSpacing:.05,uppercase:true,tier:"compact"}),eyebrow:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"400",face:"mono",letterSpacing:.07,uppercase:true,tier:"compact"}),chip:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.3,weight:"600",face:"sans",letterSpacing:0,uppercase:false,tier:"compact"}),tab:/* @__PURE__ */Object.freeze({size:16,lineHeight:1.5,weight:"600",face:"sans",letterSpacing:0,uppercase:false,tier:"compact"}),button:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"control"}),badge:/* @__PURE__ */Object.freeze({size:12,lineHeight:1.5,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"badge"})});var Oe=Object.freeze;function deepFreeze(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Oe(e);for(let t of Object.keys(e))deepFreeze(e[t])}return e}var Pe=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3});var ze={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Ae={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Ne={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},Me={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Le={regular:"400",medium:"500",bold:"700"},Be={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},qe=0,Ue="System",We="monospace",He=["content","heading","control","compact","badge"];function Ve(e){let t={};for(let n of He)t[n]=e;return t}var Ye=[];function Ke(){return{family:Ue,mono:We,fontUrl:null,families:{regular:Ue,medium:Ue,bold:Ue,mono:We,monoMedium:We,monoBold:We},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Ne,tierSizes:Ve(Ne),lineHeight:Me,weight:Le,letterSpacing:Be,scale:1,maxScale:qe,scaleCaps:Pe,headingFamily:null,headingWeight:null,fontSources:Ye,roles:De,typeScale:1}}var Qe={},Ge=/* @__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(e){return`cubic-bezier(${e.join(", ")})`}var Ze={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(Ge.standard),emphasized:cssCubicBezier(Ge.emphasized),exit:cssCubicBezier(Ge.exit)},reducedMotion:false},Xe={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)"},Je=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:Xe,space:ze,radius:Ae,type:Ke(),motion:Ze,slots:Qe}),et={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:et,space:ze,radius:Ae,type:Ke(),motion:Ze,slots:Qe});var tt=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),nt=globalThis,rt=nt[tt]??(nt[tt]=e.createContext(Je));rt.displayName??="EverfurThemeContext";function useEverfurTheme(){return e.useContext(rt)}function it(e){if(typeof e=="number")return st(e);if(typeof e!="string")return null;let t=e.trim();if(t.length===0)return null;if(t.startsWith("#"))return at(t.slice(1));if(t.toLowerCase().startsWith("0x"))return at(t.slice(2));if(t.toLowerCase().startsWith("rgb"))return ot(t);if(/^[0-9a-fA-F]+$/.test(t)){let e=at(t);if(e!==null)return e}return/^\d+$/.test(t)?st(Number.parseInt(t,10)):null}function at(e){let t=e.trim();if(!/^[0-9a-fA-F]+$/.test(t))return null;if(t.length===3)return{r:dt(t[0]),g:dt(t[1]),b:dt(t[2]),a:1};if(t.length===6)return{r:lt(t,0),g:lt(t,2),b:lt(t,4),a:1};if(t.length===8){let e=lt(t,0);return{r:lt(t,2),g:lt(t,4),b:lt(t,6),a:e/255}}return null}function ot(e){let t=e.indexOf("("),n=e.indexOf(")");if(t<0||n<0||n<t)return null;let r=e.slice(t+1,n).split(",").map(e=>e.trim());if(r.length<3)return null;let i=ct(Number(r[0])),a=ct(Number(r[1])),o=ct(Number(r[2]));if(i===null||a===null||o===null)return null;let s=1;if(r.length>=4){let e=Number(r[3]);if(!Number.isFinite(e))return null;s=Math.min(1,Math.max(0,e))}return{r:i,g:a,b:o,a:s}}function st(e){if(!Number.isFinite(e))return null;let t=Math.trunc(e)>>>0,n=t>>>24&255;return{r:t>>>16&255,g:t>>>8&255,b:t&255,a:n===0?1:n/255}}function lt(e,t){return Number.parseInt(e.slice(t,t+2),16)}function dt(e){return Number.parseInt(`${e??"0"}${e??"0"}`,16)}function ct(e){return Number.isFinite(e)?Math.min(255,Math.max(0,Math.round(e))):null}function ut(e,t,n){return`#${pt(e)}${pt(t)}${pt(n)}`.toUpperCase()}function pt(e){return e.toString(16).padStart(2,"0")}var ht="#111111",ft="#FFFFFF",bt="#000000";function readableOn(e){let t=it(e);if(t===null)return ft;let n=gt(t),r=gt({r:17,g:17,b:17}),i=gt({r:255,g:255,b:255});return xt(n,i)>=xt(n,r)?ft:ht}function mt(e,t){let n=readableOn(e);return contrastRatio(n,e)>=t?n:contrastRatio(ft,e)>=contrastRatio(bt,e)?ft:bt}function yt(e){let t=t=>e.reduce((e,n)=>Math.min(e,contrastRatio(t,n)),Number.POSITIVE_INFINITY);return t(ft)>=t(bt)?ft:bt}function gt(e){let t=vt(e.r/255),n=vt(e.g/255),r=vt(e.b/255);return.2126*t+.7152*n+.0722*r}function vt(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function xt(e,t){let n=Math.max(e,t),r=Math.min(e,t);return(n+.05)/(r+.05)}function contrastRatio(e,t){let n=it(e),r=it(t);if(n===null||r===null)return 1;let i=r.a>=1?r:{...r},a=n.a>=1?n:kt(n,i);return xt(gt(a),gt(i))}function kt(e,t){let n=e.a,r=(e,t)=>Math.round(e*n+t*(1-n));return{r:r(e.r,t.r),g:r(e.g,t.g),b:r(e.b,t.b),a:1}}function wt(e,t){let n=it(e),r=it(t);if(n===null||r===null)return null;let i=n.a>=1?n:kt(n,{...r});return ut(i.r,i.g,i.b)}function _t(e,t){let n=it(e);if(n===null)return null;let r=Math.min(1,Math.max(0,t));return`rgba(${n.r}, ${n.g}, ${n.b}, ${r})`}var Ct=.05;function St(e,t,n,r){let i=t[0];if(i===void 0)return n;let a=e=>t.every(t=>contrastRatio(e,t)>=r);if(it(e)===null)return n;if(a(e))return e;let o=wt(e,i),s=o===null?null:it(o),l=it(n);if(s===null||l===null)return n;for(let e=1;e<1/Ct;e+=1){let t=e*Ct,n=(e,n)=>Math.round(e+(n-e)*t),r=ut(n(s.r,l.r),n(s.g,l.g),n(s.b,l.b));if(a(r))return r}return n}var Et=/* @__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"}),$t=/* @__PURE__ */new WeakMap;function Ft(e){let t=$t.get(e);if(t!==void 0)return t;let n=e.color,r=e.brightness==="dark",i=r?{dark:r,ink:n.text.primary,ink2:n.text.secondary,ink3:n.text.muted,paper:n.background,card:n.surface,line:n.borderRingCream,tile:n.surfaceSubtle,shadow:n.shadow,riskBg:n.badgeBgCritical,riskInk:n.danger,riskDot:n.danger,clearBg:n.badgeBgPositive,clearInk:n.success,clearDot:n.success,watchDot:n.warningStrong}:{dark:r,...Et},a=(e,t)=>St(e,t,yt(t),jt),o=(e,t)=>contrastRatio(e,t)>=jt?e:mt(t,jt),s=[i.card,i.paper].map(e=>wt(n.brandSoft,e)??e),l={primary:n.primary,onPrimary:o(n.onPrimary,n.primary),accent:n.accent,onAccent:o(n.onAccent,n.accent),link:a(n.linkInk,[i.card,i.paper,i.tile]),badge:n.brandSoft,onBadge:a(n.brandInk,s)},d=/* @__PURE__ */Object.freeze({...i,...l});return $t.set(e,d),d}var jt=4.5;function Tt(e,t){for(let n of t)if(contrastRatio(n,e)>=jt)return n;return mt(e,jt)}function It(e,t,n){let r=_t(e,t);return(r===null?null:wt(r,n))??n}function Rt(e){let t=Ft(e),n=e.color,r=t.card;return{ink:t.ink,ink2:t.ink2,ink3:t.ink3,paper:t.paper,tile:t.tile,line:t.line,card:r,onInk:t.dark?n.background:"#FFFFFF",primary:t.primary,onPrimary:t.onPrimary,accent:t.accent,onAccent:Tt(t.accent,[t.ink,t.onAccent]),accent2:It(t.accent,.75,r),accent4:It(t.accent,.17,r),accentChip:It(t.accent,.47,r),link:t.link,linkChip:It(t.link,.2,r),riskDot:t.riskDot,riskChip:t.dark?n.badgeBgCritical:"#FFD8D6",clearBg:t.clearBg,clearInk:t.clearInk,clearChip:t.dark?n.badgeBgPositive:"#DDEFC4",byInk:n.brandInk}}var Dt=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});var Ot='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',Pt="System";function zt(e){let t=e.trim();return t.length===0||t===Pt?Ot:`${Nt(t)}, ${Ot}`}function At(e){let t=e.trim();return t.length===0||t==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${Nt(t)}, ui-monospace, Menlo, Consolas, monospace`}function Nt(e){return`"${e.replace(/[\\"]/g,"\\$&")}"`}function faceCss(e,t){let n=e.type,r=n.families[t];return{fontFamily:t==="mono"||t==="monoMedium"||t==="monoBold"?At(r):zt(r),fontWeight:n.namedFaces[t]?n.weight.regular:n.weight[Dt[t]]}}function headingFaceCss(e,t="bold"){let{headingFamily:n,headingWeight:r}=e.type,i=faceCss(e,t);return n===null&&r===null?i:n!==null?{fontFamily:zt(n),fontWeight:r??e.type.weight[Dt[t]]}:e.type.namedFaces[t]||r===null?i:{fontFamily:i.fontFamily,fontWeight:r}}function Mt(){try{return process.env.NODE_ENV!=="production"}catch{return false}}function Lt(e){return{...Rt(e),sans:faceCss(e,"regular").fontFamily,serif:headingFaceCss(e,"bold").fontFamily,mono:At(e.type.mono)}}var Bt=/* @__PURE__ */new Set;function qt(e){Bt.has(e)||!Mt()||(Bt.add(e),globalThis.console?.warn?.(`[everfur] unknown style rule ${e}`))}var Ut=e=>e.startsWith("--")?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());function Wt(e,t,n){let r=Lt(e),i=e.brightness==="dark",a=e=>e.replace(/\$(n_[0-9A-F]{6}|[a-zA-Z0-9]+)/g,(e,t)=>t.startsWith("n_")?i?r.line??e:`#${t.slice(2)}`:r[t]??e),o=/* @__PURE__ */new Map;return(...r)=>{let i=r.filter(e=>typeof e=="string"&&e!==""),s=i.join("|"),l=o.get(s);if(l!==void 0)return l;let d={};for(let r of i){let i=t[r];if(i===void 0){qt(r);continue}for(let[e,t]of i)d[Ut(e)]=a(t);if(e.motion.reducedMotion)for(let[e,t]of n[r]??[])d[Ut(e)]=a(t)}let c=/* @__PURE__ */Object.freeze(d);return o.set(s,c),c}}function Ht(e){let t=Lt(e);return{root:{boxSizing:"border-box",fontFamily:t.sans,fontSize:17,lineHeight:1.5,color:t.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 Vt=/* @__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:e=>`Typed signature: ${e}`,missingSignature:"Please add your signature before submitting.",recentlyUsed:"Recently used",moreClinics:"Load more"});var Yt=/* @__PURE__ */Object.freeze({title:Vt.title,titleFor:e=>{let t=e?.trim()??"";return t.length>0?`Request ${t}’s records`:Vt.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:e=>[{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 ${e}’s records.`}],placeholder:Vt.placeholder,searchA11y:Vt.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:Vt.recentlyUsed,noMatch:e=>`No clinics match “${e}”. You can still request records using the option above.`,loadingMore:"Loading more…",loadMoreFailed:"Couldn’t load more. Tap to retry.",selectA11y:e=>`Request records from ${e}`,resultsCount:e=>e===1?"Showing 1 clinic":`Showing ${String(e)} 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 Kt=1.609344;function Qt(e){return e===null||!Number.isFinite(e)?null:(e/Kt).toFixed(1)}function Gt(e){let t=Qt(e);return t===null?"":`${t} mi`}var Zt=300,Xt=2;var Jt=/* @__PURE__ */Object.freeze({loading:"Loading",empty:"No records yet",upload:"Upload records",consentRequired:"Consent required",allow:"Allow",allPetsConsent:"This covers all your pets. You can withdraw it at any time.",sessionRequired:"Sign in required",recordUnavailable:"Record unavailable",retry:"Try again",records:"Records",beingReviewed:"being reviewed"});function en(t,n){let[r,i]=e.useState(""),[a,o]=e.useState(""),[s,l]=e.useState([]),[d,c]=e.useState(null),[u,p]=e.useState([]),[h,f]=e.useState(true),[b,m]=e.useState(false),[y,g]=e.useState(false),[v,x]=e.useState(null),[k,w]=e.useState(null),[_,C]=e.useState(0),S=e.useRef(0),E=e.useRef(true),$=n?.latitude,F=n?.longitude,j=e.useMemo(()=>void 0,[$,F]);e.useEffect(()=>(E.current=true,()=>{E.current=false,S.current+=1}),[t]),e.useEffect(()=>{let e=true;return f(true),t.recentClinics({limit:5}).then(t=>{e&&(t.ok&&p(t.value.clinics),f(false))}).catch(()=>{e&&f(false)}),()=>{e=false}},[t]),e.useEffect(()=>{let e=r.trim();if(e.length<Xt){o("");return}let t=setTimeout(()=>o(e),Zt);return()=>clearTimeout(t)},[r]);let T=a.length>=Xt;e.useEffect(()=>{let e=S.current+=1;if(l([]),c(null),x(null),w(null),!T){m(false);return}m(true),t.searchClinics({query:a,limit:25,...j?{location:j}:{}}).then(t=>{!E.current||e!==S.current||(t.ok?(l(t.value.clinics),c(t.value.nextCursor)):x(t.error),m(false))}).catch(()=>{E.current&&e===S.current&&m(false)})},[t,a,T,j,_]);let I=e.useCallback(()=>{if(!T||d===null||y)return;let e=S.current;g(true),w(null),t.searchClinics({query:a,limit:25,cursor:d,...j?{location:j}:{}}).then(t=>{!E.current||e!==S.current||(t.ok?(l(e=>[...e,...t.value.clinics]),c(t.value.nextCursor)):w(t.error),g(false))}).catch(()=>{E.current&&e===S.current&&g(false)})},[t,d,a,T,y,j]),R=e.useCallback(e=>i(e),[]),D=e.useCallback(()=>C(e=>e+1),[]);return e.useMemo(()=>({query:r,debouncedQuery:a,isSearchActive:T,clinics:s,recent:u,recentLoading:h,initialLoading:b,loadingMore:y,hasNextPage:d!==null,error:v,pageError:k,setQuery:R,loadMore:I,retry:D}),[r,a,T,s,u,h,b,y,d,v,k,R,I,D])}function tn(e,t,n,r){/* @__PURE__ */
|
|
8
|
+
return Object.freeze({send:d,authorize:c,stream:u})}function q(e,t){let n={};for(let[t,r]of Object.entries(e.headers??{}))t.toLowerCase()!==A&&(n[t]=r);return t!==null&&(n["Idempotency-Key"]=t),{...e,headers:n}}function U(){let e=0;return()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var W=10;function H(e,t,n){if(n.aborted)return{retry:false,reason:"aborted"};let r=V(e);if(r==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(r!=="burst"&&!isAutoRetryable(e.code))return{retry:false,reason:"terminal-code"};let i=r==="burst"?"burst-throttle":"retryable-code";if((()=>{if(n.policy===void 0)return false;try{return!n.policy.shouldRetry(e.code,t)}catch{return false}})())return{retry:false,reason:"terminal-code"};let a=()=>{if(n.policy===void 0)return null;let t;try{t=n.policy.maxAttempts(e.code)}catch{return null}return typeof t!="number"||!Number.isFinite(t)?null:Math.max(1,Math.min(W,Math.floor(t)))},o=n.perCallMaxAttempts??a()??n.maxAttempts;if(t+1>=o)return{retry:false,reason:"attempts-exhausted"};let s=Y(e,n.now);return s!==null?s>z?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:i,delayMs:s}:{retry:true,reason:i,delayMs:backoffDelayMs(t,n.rng)}}function V(e){let t=e.code==="unknown"?fromWire(X(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}function Y(e,t){let n=Q(e.raw);if(n!==null){let e=n-t;return e>0?e:0}let r=K(e.raw);return r===null?null:Math.round(r*1e3)}function K(e){for(let t of G(e)){let e=t.retry_after_seconds;if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return e}return null}function Q(e){for(let t of G(e)){let e=t.resets_at,n=Z(e);if(n!==null)return n}return null}function G(e){if(!J(e))return[];let t=[e];for(let n of["error","detail"]){let r=e[n];J(r)&&t.push(r)}return t}function Z(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let t=Date.parse(e);return Number.isFinite(t)?t:null}return null}function X(e){for(let t of G(e)){let e=t.code;if(typeof e=="string"&&e.length>0)return e}return null}function J(e){return typeof e=="object"&&e!==null}async function ee(e){if(e.mode==="anonymous"){let t=await F(e);return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}return{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}function te(e,t){let n=new AbortController,r=t.setTimeout(()=>n.abort(),e);return{signal:n.signal,cancel:()=>t.clearTimeout(r)}}function ne(e,t){let n=()=>{};if(!t)return{signal:e,dispose:n};let r=new AbortController;if(e.aborted||t.aborted)return r.abort(),{signal:r.signal,dispose:n};let i=()=>r.abort();return e.addEventListener("abort",i,{once:true}),t.addEventListener("abort",i,{once:true}),{signal:r.signal,dispose:()=>{e.removeEventListener("abort",i),t.removeEventListener("abort",i)}}}function re(e,t,n){return e<=0||n?.aborted===true?Promise.resolve():new Promise(r=>{let i=t.setTimeout(()=>{n?.removeEventListener("abort",a),r()},e),a=()=>{t.clearTimeout(i),r()};n?.addEventListener("abort",a,{once:true})})}var ie=/* @__PURE__ */new Set(["expo","fcm","apns"]),ae=/* @__PURE__ */new Set(["ios","android"]),oe=4096,se=128,le=64,de=/[\0- ]/;function ce(e,t){return makeEverfurError("validationFailed",{retryable:false,wireMessage:e,...t?{reasonCode:t}:{}})}function ue(e){if(typeof e!="object"||e===null)return ce("registerDevice needs an input object");let{token:t,provider:n,platform:r,installationId:i}=e;return typeof n!="string"||!ie.has(n)?ce("provider must be expo, fcm or apns"):typeof r!="string"||!ae.has(r)?ce("platform must be ios or android"):typeof t!="string"||t.trim().length===0||t.length>oe||de.test(t)?ce(`token must be a push token of 1..${oe} characters with no whitespace`,"token_invalid"):i!==void 0&&(typeof i!="string"||i.length===0||i.length>se)?ce(`installationId must be 1..${se} characters`):null}var pe=/^[A-Za-z][A-Za-z0-9_+-]*(\/[A-Za-z0-9_+-]+){0,2}$/,he=64,fe=/^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$/,be=35;function me(e){return e.httpStatus===400&&e.code==="validationFailed"}function ye(e){let t={...e};return delete t.timezone,delete t.locale,t}function ge(e,t,n){return typeof e=="string"&&e.length<=n&&t.test(e)?e:null}function ve(e){return typeof e!="string"||e.length===0||e.length>le?ce(`deviceId must be 1..${le} characters`):de.test(e)||e.includes("/")||e==="."||e===".."?ce("deviceId is not a device id"):null}function xe(e){if(typeof e!="object"||e===null)return ce("setPreferences needs an input object");let{pushEnabled:t,emailEnabled:n}=e;return typeof t!="boolean"||typeof n!="boolean"?ce("pushEnabled and emailEnabled must both be booleans: the route replaces both switches"):null}function ke(e){return typeof e=="string"&&e.length>0?e:null}function _e(e){if(typeof e!="object"||e===null)return null;let t=e,n=ke(t.device_id),r=ke(t.provider),i=ke(t.platform),a=ke(t.registered_at),o=ke(t.last_seen_at);if(n===null||r===null||i===null||a===null||o===null||!ie.has(r)||!ae.has(i))return null;let s=t.installation_id;/* @__PURE__ */
|
|
9
|
+
return Object.freeze({deviceId:n,provider:r,platform:i,installationId:typeof s=="string"&&s.length>0?s:null,registeredAt:a,lastSeenAt:o})}function we(e){if(typeof e!="object"||e===null)return null;let t=e,n=ke(t.updated_at);return typeof t.push_enabled!="boolean"||typeof t.email_enabled!="boolean"||n===null?null:/* @__PURE__ */Object.freeze({pushEnabled:t.push_enabled,emailEnabled:t.email_enabled,updatedAt:n})}function Ce(e){return makeEverfurError("internalError",{retryable:false,wireMessage:`${e}: the response was not the documented shape`})}var Se=/* @__PURE__ */Object.freeze({provider_unsupported:{code:"validationFailed",retryable:false},token_invalid:{code:"validationFailed",retryable:false},device_cipher_unavailable:{code:"serviceUnavailable",retryable:true}});function Ee(e){return S(e,Se)}function $e(e){return makeEverfurError("validationFailed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${e} was called after unmount`})}function createNotificationsClient(e){let t=()=>{let{services:t}=e.registry;return Fe({auth:t.authFor(null),...t.errorPolicy?{errorPolicy:t.errorPolicy}:{}})};return{registerDevice:(n,r)=>e.isDisposed?Promise.resolve(err($e("registerDevice"))):t().registerDevice(n,r),unregisterDevice:(n,r)=>e.isDisposed?Promise.resolve(err($e("unregisterDevice"))):t().unregisterDevice(n,r),setPreferences:(n,r)=>e.isDisposed?Promise.resolve(err($e("setPreferences"))):t().setPreferences(n,r)}}function Fe(e){let t=e.funnel??createRequestFunnel({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),n=(e,t)=>t?{...e,signal:t}:e;return{async registerDevice(e,r){let i=ue(e);if(i!==null)return err(i);let a={token:e.token,provider:e.provider,platform:e.platform};e.installationId!==void 0&&(a.installation_id=e.installationId);let o=ge(e.timezone,pe,he);o!==null&&(a.timezone=o);let s=ge(e.locale,fe,be);s!==null&&(a.locale=s);let l=e=>t.send("notifications.registerDevice",n({method:"POST",path:"/widget/v1/me/devices",body:e},r?.signal)),d=await l(a);if(!d.ok&&me(d.error)&&(o!==null||s!==null)&&(d=await l(ye(a))),!d.ok)return err(Ee(d.error));let c=_e(d.value);return c===null?err(Ce("registerDevice")):ok(c)},async unregisterDevice(e,r){let i=ve(e);if(i!==null)return err(i);let a=await t.send("notifications.unregisterDevice",n({method:"DELETE",path:`/widget/v1/me/devices/${encodeURIComponent(e)}`},r?.signal));return a.ok?ok(void 0):err(Ee(a.error))},async setPreferences(e,r){let i=xe(e);if(i!==null)return err(i);let a=await t.send("notifications.setPreferences",n({method:"PUT",path:"/widget/v1/me/notification-preferences",body:{push_enabled:e.pushEnabled,email_enabled:e.emailEnabled}},r?.signal));if(!a.ok)return err(Ee(a.error));let o=we(a.value);return o===null?err(Ce("setPreferences")):ok(o)}}}var je=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),Te=globalThis,Ie=Te[je]??(Te[je]=e.createContext(null));Ie.displayName??="EverfurContext";function Re(){let t=e.useContext(Ie);if(t===null)throw new w("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return t}var De=/* @__PURE__ */Object.freeze({display:/* @__PURE__ */Object.freeze({size:29,lineHeight:1.06,weight:"800",face:"heading",letterSpacing:-.01,uppercase:false,tier:"heading"}),title:/* @__PURE__ */Object.freeze({size:23,lineHeight:1.12,weight:"800",face:"heading",letterSpacing:-.01,uppercase:false,tier:"heading"}),cardTitle:/* @__PURE__ */Object.freeze({size:19,lineHeight:1.22,weight:"800",face:"sans",letterSpacing:0,uppercase:false,tier:"heading"}),rowTitle:/* @__PURE__ */Object.freeze({size:15.5,lineHeight:1.4,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),body:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),message:/* @__PURE__ */Object.freeze({size:15.5,lineHeight:1.5,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),bodySmall:/* @__PURE__ */Object.freeze({size:14.5,lineHeight:1.4,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),caption:/* @__PURE__ */Object.freeze({size:13,lineHeight:1.4,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),label:/* @__PURE__ */Object.freeze({size:10.5,lineHeight:1.4,weight:"400",face:"mono",letterSpacing:.05,uppercase:true,tier:"compact"}),eyebrow:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"400",face:"mono",letterSpacing:.07,uppercase:true,tier:"compact"}),chip:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.3,weight:"600",face:"sans",letterSpacing:0,uppercase:false,tier:"compact"}),tab:/* @__PURE__ */Object.freeze({size:16,lineHeight:1.5,weight:"600",face:"sans",letterSpacing:0,uppercase:false,tier:"compact"}),button:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"control"}),badge:/* @__PURE__ */Object.freeze({size:12,lineHeight:1.5,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"badge"})});var Oe=Object.freeze;function deepFreeze(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Oe(e);for(let t of Object.keys(e))deepFreeze(e[t])}return e}var Pe=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3});var ze={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Ae={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Ne={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},Me={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Le={regular:"400",medium:"500",bold:"700"},Be={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},qe=0,Ue="System",We="monospace",He=["content","heading","control","compact","badge"];function Ve(e){let t={};for(let n of He)t[n]=e;return t}var Ye=[];function Ke(){return{family:Ue,mono:We,fontUrl:null,families:{regular:Ue,medium:Ue,bold:Ue,mono:We,monoMedium:We,monoBold:We},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Ne,tierSizes:Ve(Ne),lineHeight:Me,weight:Le,letterSpacing:Be,scale:1,maxScale:qe,scaleCaps:Pe,headingFamily:null,headingWeight:null,fontSources:Ye,roles:De,typeScale:1}}var Qe={},Ge=/* @__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(e){return`cubic-bezier(${e.join(", ")})`}var Ze={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(Ge.standard),emphasized:cssCubicBezier(Ge.emphasized),exit:cssCubicBezier(Ge.exit)},reducedMotion:false},Xe={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)"},Je=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:Xe,space:ze,radius:Ae,type:Ke(),motion:Ze,slots:Qe}),et={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:et,space:ze,radius:Ae,type:Ke(),motion:Ze,slots:Qe});var tt=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),nt=globalThis,rt=nt[tt]??(nt[tt]=e.createContext(Je));rt.displayName??="EverfurThemeContext";function useEverfurTheme(){return e.useContext(rt)}function it(e){if(typeof e=="number")return st(e);if(typeof e!="string")return null;let t=e.trim();if(t.length===0)return null;if(t.startsWith("#"))return at(t.slice(1));if(t.toLowerCase().startsWith("0x"))return at(t.slice(2));if(t.toLowerCase().startsWith("rgb"))return ot(t);if(/^[0-9a-fA-F]+$/.test(t)){let e=at(t);if(e!==null)return e}return/^\d+$/.test(t)?st(Number.parseInt(t,10)):null}function at(e){let t=e.trim();if(!/^[0-9a-fA-F]+$/.test(t))return null;if(t.length===3)return{r:dt(t[0]),g:dt(t[1]),b:dt(t[2]),a:1};if(t.length===6)return{r:lt(t,0),g:lt(t,2),b:lt(t,4),a:1};if(t.length===8){let e=lt(t,0);return{r:lt(t,2),g:lt(t,4),b:lt(t,6),a:e/255}}return null}function ot(e){let t=e.indexOf("("),n=e.indexOf(")");if(t<0||n<0||n<t)return null;let r=e.slice(t+1,n).split(",").map(e=>e.trim());if(r.length<3)return null;let i=ct(Number(r[0])),a=ct(Number(r[1])),o=ct(Number(r[2]));if(i===null||a===null||o===null)return null;let s=1;if(r.length>=4){let e=Number(r[3]);if(!Number.isFinite(e))return null;s=Math.min(1,Math.max(0,e))}return{r:i,g:a,b:o,a:s}}function st(e){if(!Number.isFinite(e))return null;let t=Math.trunc(e)>>>0,n=t>>>24&255;return{r:t>>>16&255,g:t>>>8&255,b:t&255,a:n===0?1:n/255}}function lt(e,t){return Number.parseInt(e.slice(t,t+2),16)}function dt(e){return Number.parseInt(`${e??"0"}${e??"0"}`,16)}function ct(e){return Number.isFinite(e)?Math.min(255,Math.max(0,Math.round(e))):null}function ut(e,t,n){return`#${pt(e)}${pt(t)}${pt(n)}`.toUpperCase()}function pt(e){return e.toString(16).padStart(2,"0")}var ht="#111111",ft="#FFFFFF",bt="#000000";function readableOn(e){let t=it(e);if(t===null)return ft;let n=gt(t),r=gt({r:17,g:17,b:17}),i=gt({r:255,g:255,b:255});return xt(n,i)>=xt(n,r)?ft:ht}function mt(e,t){let n=readableOn(e);return contrastRatio(n,e)>=t?n:contrastRatio(ft,e)>=contrastRatio(bt,e)?ft:bt}function yt(e){let t=t=>e.reduce((e,n)=>Math.min(e,contrastRatio(t,n)),Number.POSITIVE_INFINITY);return t(ft)>=t(bt)?ft:bt}function gt(e){let t=vt(e.r/255),n=vt(e.g/255),r=vt(e.b/255);return.2126*t+.7152*n+.0722*r}function vt(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function xt(e,t){let n=Math.max(e,t),r=Math.min(e,t);return(n+.05)/(r+.05)}function contrastRatio(e,t){let n=it(e),r=it(t);if(n===null||r===null)return 1;let i=r.a>=1?r:{...r},a=n.a>=1?n:kt(n,i);return xt(gt(a),gt(i))}function kt(e,t){let n=e.a,r=(e,t)=>Math.round(e*n+t*(1-n));return{r:r(e.r,t.r),g:r(e.g,t.g),b:r(e.b,t.b),a:1}}function _t(e,t){let n=it(e),r=it(t);if(n===null||r===null)return null;let i=n.a>=1?n:kt(n,{...r});return ut(i.r,i.g,i.b)}function wt(e,t){let n=it(e);if(n===null)return null;let r=Math.min(1,Math.max(0,t));return`rgba(${n.r}, ${n.g}, ${n.b}, ${r})`}var Ct=.05;function St(e,t,n,r){let i=t[0];if(i===void 0)return n;let a=e=>t.every(t=>contrastRatio(e,t)>=r);if(it(e)===null)return n;if(a(e))return e;let o=_t(e,i),s=o===null?null:it(o),l=it(n);if(s===null||l===null)return n;for(let e=1;e<1/Ct;e+=1){let t=e*Ct,n=(e,n)=>Math.round(e+(n-e)*t),r=ut(n(s.r,l.r),n(s.g,l.g),n(s.b,l.b));if(a(r))return r}return n}var Et=/* @__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"}),$t=/* @__PURE__ */new WeakMap;function Ft(e){let t=$t.get(e);if(t!==void 0)return t;let n=e.color,r=e.brightness==="dark",i=r?{dark:r,ink:n.text.primary,ink2:n.text.secondary,ink3:n.text.muted,paper:n.background,card:n.surface,line:n.borderRingCream,tile:n.surfaceSubtle,shadow:n.shadow,riskBg:n.badgeBgCritical,riskInk:n.danger,riskDot:n.danger,clearBg:n.badgeBgPositive,clearInk:n.success,clearDot:n.success,watchDot:n.warningStrong}:{dark:r,...Et},a=(e,t)=>St(e,t,yt(t),jt),o=(e,t)=>contrastRatio(e,t)>=jt?e:mt(t,jt),s=[i.card,i.paper].map(e=>_t(n.brandSoft,e)??e),l={primary:n.primary,onPrimary:o(n.onPrimary,n.primary),accent:n.accent,onAccent:o(n.onAccent,n.accent),link:a(n.linkInk,[i.card,i.paper,i.tile]),badge:n.brandSoft,onBadge:a(n.brandInk,s)},d=/* @__PURE__ */Object.freeze({...i,...l});return $t.set(e,d),d}var jt=4.5;function Tt(e,t){for(let n of t)if(contrastRatio(n,e)>=jt)return n;return mt(e,jt)}function It(e,t,n){let r=wt(e,t);return(r===null?null:_t(r,n))??n}function Rt(e){let t=Ft(e),n=e.color,r=t.card;return{ink:t.ink,ink2:t.ink2,ink3:t.ink3,paper:t.paper,tile:t.tile,line:t.line,card:r,onInk:t.dark?n.background:"#FFFFFF",primary:t.primary,onPrimary:t.onPrimary,accent:t.accent,onAccent:Tt(t.accent,[t.ink,t.onAccent]),accent2:It(t.accent,.75,r),accent4:It(t.accent,.17,r),accentChip:It(t.accent,.47,r),link:t.link,linkChip:It(t.link,.2,r),riskDot:t.riskDot,riskChip:t.dark?n.badgeBgCritical:"#FFD8D6",clearBg:t.clearBg,clearInk:t.clearInk,clearChip:t.dark?n.badgeBgPositive:"#DDEFC4",byInk:n.brandInk}}var Dt=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});var Ot='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',Pt="System";function zt(e){let t=e.trim();return t.length===0||t===Pt?Ot:`${Nt(t)}, ${Ot}`}function At(e){let t=e.trim();return t.length===0||t==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${Nt(t)}, ui-monospace, Menlo, Consolas, monospace`}function Nt(e){return`"${e.replace(/[\\"]/g,"\\$&")}"`}function faceCss(e,t){let n=e.type,r=n.families[t];return{fontFamily:t==="mono"||t==="monoMedium"||t==="monoBold"?At(r):zt(r),fontWeight:n.namedFaces[t]?n.weight.regular:n.weight[Dt[t]]}}function headingFaceCss(e,t="bold"){let{headingFamily:n,headingWeight:r}=e.type,i=faceCss(e,t);return n===null&&r===null?i:n!==null?{fontFamily:zt(n),fontWeight:r??e.type.weight[Dt[t]]}:e.type.namedFaces[t]||r===null?i:{fontFamily:i.fontFamily,fontWeight:r}}function Mt(){try{return process.env.NODE_ENV!=="production"}catch{return false}}function Lt(e){return{...Rt(e),sans:faceCss(e,"regular").fontFamily,serif:headingFaceCss(e,"bold").fontFamily,mono:At(e.type.mono)}}var Bt=/* @__PURE__ */new Set;function qt(e){Bt.has(e)||!Mt()||(Bt.add(e),globalThis.console?.warn?.(`[everfur] unknown style rule ${e}`))}var Ut=e=>e.startsWith("--")?e:e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());function Wt(e,t,n){let r=Lt(e),i=e.brightness==="dark",a=e=>e.replace(/\$(n_[0-9A-F]{6}|[a-zA-Z0-9]+)/g,(e,t)=>t.startsWith("n_")?i?r.line??e:`#${t.slice(2)}`:r[t]??e),o=/* @__PURE__ */new Map;return(...r)=>{let i=r.filter(e=>typeof e=="string"&&e!==""),s=i.join("|"),l=o.get(s);if(l!==void 0)return l;let d={};for(let r of i){let i=t[r];if(i===void 0){qt(r);continue}for(let[e,t]of i)d[Ut(e)]=a(t);if(e.motion.reducedMotion)for(let[e,t]of n[r]??[])d[Ut(e)]=a(t)}let c=/* @__PURE__ */Object.freeze(d);return o.set(s,c),c}}function Ht(e){let t=Lt(e);return{root:{boxSizing:"border-box",fontFamily:t.sans,fontSize:17,lineHeight:1.5,color:t.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 Vt=/* @__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:e=>`Typed signature: ${e}`,missingSignature:"Please add your signature before submitting.",recentlyUsed:"Recently used",moreClinics:"Load more"});var Yt=/* @__PURE__ */Object.freeze({title:Vt.title,titleFor:e=>{let t=e?.trim()??"";return t.length>0?`Request ${t}’s records`:Vt.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:e=>[{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 ${e}’s records.`}],placeholder:Vt.placeholder,searchA11y:Vt.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:Vt.recentlyUsed,noMatch:e=>`No clinics match “${e}”. You can still request records using the option above.`,loadingMore:"Loading more…",loadMoreFailed:"Couldn’t load more. Tap to retry.",selectA11y:e=>`Request records from ${e}`,resultsCount:e=>e===1?"Showing 1 clinic":`Showing ${String(e)} 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 Kt=1.609344;function Qt(e){return e===null||!Number.isFinite(e)?null:(e/Kt).toFixed(1)}function Gt(e){let t=Qt(e);return t===null?"":`${t} mi`}var Zt=300,Xt=2;var Jt=/* @__PURE__ */Object.freeze({loading:"Loading",empty:"No records yet",upload:"Upload records",consentRequired:"Consent required",allow:"Allow",allPetsConsent:"This covers all your pets. You can withdraw it at any time.",sessionRequired:"Sign in required",recordUnavailable:"Record unavailable",retry:"Try again",records:"Records",beingReviewed:"being reviewed"});function en(t,n){let[r,i]=e.useState(""),[a,o]=e.useState(""),[s,l]=e.useState([]),[d,c]=e.useState(null),[u,p]=e.useState([]),[h,f]=e.useState(true),[b,m]=e.useState(false),[y,g]=e.useState(false),[v,x]=e.useState(null),[k,_]=e.useState(null),[w,C]=e.useState(0),S=e.useRef(0),E=e.useRef(true),$=n?.latitude,F=n?.longitude,j=e.useMemo(()=>void 0,[$,F]);e.useEffect(()=>(E.current=true,()=>{E.current=false,S.current+=1}),[t]),e.useEffect(()=>{let e=true;return f(true),t.recentClinics({limit:5}).then(t=>{e&&(t.ok&&p(t.value.clinics),f(false))}).catch(()=>{e&&f(false)}),()=>{e=false}},[t]),e.useEffect(()=>{let e=r.trim();if(e.length<Xt){o("");return}let t=setTimeout(()=>o(e),Zt);return()=>clearTimeout(t)},[r]);let T=a.length>=Xt;e.useEffect(()=>{let e=S.current+=1;if(l([]),c(null),x(null),_(null),!T){m(false);return}m(true),t.searchClinics({query:a,limit:25,...j?{location:j}:{}}).then(t=>{!E.current||e!==S.current||(t.ok?(l(t.value.clinics),c(t.value.nextCursor)):x(t.error),m(false))}).catch(()=>{E.current&&e===S.current&&m(false)})},[t,a,T,j,w]);let I=e.useCallback(()=>{if(!T||d===null||y)return;let e=S.current;g(true),_(null),t.searchClinics({query:a,limit:25,cursor:d,...j?{location:j}:{}}).then(t=>{!E.current||e!==S.current||(t.ok?(l(e=>[...e,...t.value.clinics]),c(t.value.nextCursor)):_(t.error),g(false))}).catch(()=>{E.current&&e===S.current&&g(false)})},[t,d,a,T,y,j]),R=e.useCallback(e=>i(e),[]),D=e.useCallback(()=>C(e=>e+1),[]);return e.useMemo(()=>({query:r,debouncedQuery:a,isSearchActive:T,clinics:s,recent:u,recentLoading:h,initialLoading:b,loadingMore:y,hasNextPage:d!==null,error:v,pageError:k,setQuery:R,loadMore:I,retry:D}),[r,a,T,s,u,h,b,y,d,v,k,R,I,D])}function tn(e,t,n,r){/* @__PURE__ */
|
|
10
10
|
return Object.freeze({key:e?.id??`free:${t??""}`,clinic:e,freeText:t,email:n,idempotencyKey:r})}var nn={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"};function rn(e){switch(e){case"chat":/* @__PURE__ */
|
|
11
11
|
return n.jsx("path",{...nn,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__ */
|
|
12
12
|
return n.jsxs("g",{...nn,strokeWidth:1.8,children:[
|
|
@@ -21,7 +21,7 @@ return n.jsxs("g",{...nn,strokeWidth:1.8,children:[
|
|
|
21
21
|
return n.jsx("path",{...nn,strokeWidth:2.4,d:"m5 12.6 4.4 4.4L19 7.4"});case"bell":/* @__PURE__ */
|
|
22
22
|
return n.jsx("path",{...nn,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:e,style:t}){/* @__PURE__ */
|
|
23
23
|
return n.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",style:{display:"block",...t},children:rn(e)})}var an="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:e}){/* @__PURE__ */
|
|
24
|
-
return n.jsx("svg",{viewBox:"0 0 108.10 38.43","aria-hidden":"true",focusable:"false",style:{display:"block",...e},children:/* @__PURE__ */n.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:an})})}var on=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function sn(e){return[e.address?.trim()??"",Gt(e.distanceKm)].filter(e=>e!=="").join(" · ")}function ln(t){return function({sx:r,reset:i,text:a,titleId:o,titleRef:s,onPick:l,onUpload:d}){let c=t.useEverfurRecordsClinic(),u=en(c),p=e.useRef(U()),[h,f]=e.useState(null),[b,m]=e.useState(false),[y,g]=e.useState(""),[v,x]=e.useState(""),k=u.isSearchActive?u.clinics:u.recent,
|
|
24
|
+
return n.jsx("svg",{viewBox:"0 0 108.10 38.43","aria-hidden":"true",focusable:"false",style:{display:"block",...e},children:/* @__PURE__ */n.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:an})})}var on=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function sn(e){return[e.address?.trim()??"",Gt(e.distanceKm)].filter(e=>e!=="").join(" · ")}function ln(t){return function({sx:r,reset:i,text:a,titleId:o,titleRef:s,onPick:l,onUpload:d}){let c=t.useEverfurRecordsClinic(),u=en(c),p=e.useRef(U()),[h,f]=e.useState(null),[b,m]=e.useState(false),[y,g]=e.useState(""),[v,x]=e.useState(""),k=u.isSearchActive?u.clinics:u.recent,_=k.find(e=>e.id===h)??k[0]??null,w=u.isSearchActive&&!u.initialLoading&&u.error===null&&k.length===0,C=y.trim()===""?u.query.trim():y.trim(),S=C!==""&&on.test(v.trim()),E=()=>{if(b){S&&l(tn(null,C,v.trim().toLowerCase(),p.current()));return}_!==null&&l(tn(_,null,"",p.current()))},$=b?S:_!==null,F=i.button,j={...r(".in-search input")};/* @__PURE__ */
|
|
25
25
|
return n.jsxs(n.Fragment,{children:[
|
|
26
26
|
/* @__PURE__ */n.jsx("h3",{id:o,ref:s,tabIndex:-1,style:{...i.text,...r(".serif",".in-h")},children:a.title}),
|
|
27
27
|
/* @__PURE__ */n.jsxs("label",{style:r(".in-search"),children:[
|
|
@@ -29,15 +29,15 @@ return n.jsxs(n.Fragment,{children:[
|
|
|
29
29
|
/* @__PURE__ */n.jsx("input",{type:"search",value:u.query,placeholder:a.search,"aria-label":a.searchLabel,autoComplete:"off",style:j,onChange:e=>{u.setQuery(e.target.value),m(false)},onKeyDown:e=>{e.key==="Enter"&&(e.preventDefault(),E())}})]}),b?/* @__PURE__ */n.jsxs("div",{style:r(".in-clinics"),children:[
|
|
30
30
|
/* @__PURE__ */n.jsx("label",{style:r(".in-search"),children:/* @__PURE__ */n.jsx("input",{type:"text",value:y===""?u.query:y,placeholder:Yt.fallback.namePlaceholder,"aria-label":Yt.fallback.nameLabel,autoComplete:"off",maxLength:200,style:j,onChange:e=>g(e.target.value)})}),
|
|
31
31
|
/* @__PURE__ */n.jsx("label",{style:r(".in-search"),children:/* @__PURE__ */n.jsx("input",{type:"email",value:v,placeholder:Yt.fallback.emailPlaceholder,"aria-label":Yt.fallback.emailLabel,autoComplete:"off",maxLength:320,style:j,onChange:e=>x(e.target.value)})}),
|
|
32
|
-
/* @__PURE__ */n.jsx("p",{style:{...i.text,...r(".in-p",".in-p--s")},children:Yt.fallback.reviewNote})]}):/* @__PURE__ */n.jsxs("div",{role:"radiogroup","aria-label":a.list,"aria-busy":u.initialLoading||!u.isSearchActive&&u.recentLoading,style:r(".in-clinics"),children:[k.map(e=>{let t=
|
|
32
|
+
/* @__PURE__ */n.jsx("p",{style:{...i.text,...r(".in-p",".in-p--s")},children:Yt.fallback.reviewNote})]}):/* @__PURE__ */n.jsxs("div",{role:"radiogroup","aria-label":a.list,"aria-busy":u.initialLoading||!u.isSearchActive&&u.recentLoading,style:r(".in-clinics"),children:[k.map(e=>{let t=_?.id===e.id,i=sn(e);/* @__PURE__ */
|
|
33
33
|
return n.jsxs("button",{type:"button",role:"radio","aria-checked":t,style:{...F,...r(".in-clinic",t&&'.in-clinic[aria-checked="true"]')},onClick:()=>f(e.id),children:[
|
|
34
34
|
/* @__PURE__ */n.jsxs("span",{children:[
|
|
35
35
|
/* @__PURE__ */n.jsx("b",{style:r(".in-clinic b"),children:e.name}),i===""?null:/* @__PURE__ */n.jsx("small",{style:r(".in-clinic small"),children:i})]}),
|
|
36
|
-
/* @__PURE__ */n.jsx("span",{style:r(".in-tick",t&&'.in-clinic[aria-checked="true"] .in-tick'),children:/* @__PURE__ */n.jsx(IntroIcon,{name:"check",style:r(".in-tick svg",t&&'.in-clinic[aria-checked="true"] .in-tick svg')})})]},e.id)}),u.error!==null&&u.isSearchActive?/* @__PURE__ */n.jsxs("p",{role:"alert",style:{...i.text,...r(".in-none")},children:[u.error.displayMessage,u.error.retryable?/* @__PURE__ */n.jsx("button",{type:"button",style:{...F,...r(".in-link",".in-none .in-link")},onClick:u.retry,children:Jt.retry}):null]}):null,
|
|
36
|
+
/* @__PURE__ */n.jsx("span",{style:r(".in-tick",t&&'.in-clinic[aria-checked="true"] .in-tick'),children:/* @__PURE__ */n.jsx(IntroIcon,{name:"check",style:r(".in-tick svg",t&&'.in-clinic[aria-checked="true"] .in-tick svg')})})]},e.id)}),u.error!==null&&u.isSearchActive?/* @__PURE__ */n.jsxs("p",{role:"alert",style:{...i.text,...r(".in-none")},children:[u.error.displayMessage,u.error.retryable?/* @__PURE__ */n.jsx("button",{type:"button",style:{...F,...r(".in-link",".in-none .in-link")},onClick:u.retry,children:Jt.retry}):null]}):null,w?/* @__PURE__ */n.jsxs("p",{style:{...i.text,...r(".in-none")},children:[`${Yt.fallback.title} ${Yt.fallback.subtitle}`
|
|
37
37
|
/* @__PURE__ */,n.jsx("button",{type:"button",style:{...F,...r(".in-link",".in-none .in-link")},onClick:()=>m(true),children:a.add})]}):null]}),
|
|
38
38
|
/* @__PURE__ */n.jsx("p",{style:{...i.text,...r(".in-p",".in-p--s")},children:a.more}),
|
|
39
39
|
/* @__PURE__ */n.jsx("button",{type:"button",disabled:!$,style:{...F,...r(".emb-btn",".emb-btn--block",".in-body .emb-btn",!$&&".emb-btn[disabled]")},onClick:E,children:a.request}),d===void 0?null:/* @__PURE__ */n.jsx("button",{type:"button",style:{...F,...r(".in-link")},onClick:d,children:a.upload})]})}}function dn(e){return function({petRef:petRef,petName:t,draft:r,ownerName:i,onCaptureSignature:a,onCreated:o}){/* @__PURE__ */
|
|
40
|
-
return n.jsx(e.EverfurRecordsConsent,{petRef:petRef,...t===void 0?{}:{petName:t},clinic:r,...i===void 0?{}:{ownerName:i},...a===void 0?{}:{onCaptureSignature:a},onCreated:o})}}var cn=null;function un(){return cn===null&&(cn=import("@everfur/sdk/web/records").then(e=>({Clinic:ln(e),Consent:dn(e)}),()=>(cn=null,null))),cn}function pn(t){let[n,r]=e.useState(null);return e.useEffect(()=>{if(!t||n!==null)return;let e=true;return un().then(t=>{e&&t!==null&&r(t)}),()=>{e=false}},[t,n]),e.useMemo(()=>n,[n])}function healthPlanPetWords(e,t){let n=e?.trim()??"",r=n===""?"your pet":n,i=n===""?"Your pet":n;return t==="female"?{name:r,Name:i,poss:"her",Poss:"Her",obj:"her"}:t==="male"?{name:r,Name:i,poss:"his",Poss:"His",obj:"him"}:{name:r,Name:i,poss:`${r}'s`,Poss:`${i}'s`,obj:r}}var hn=e=>e===null?"":`${e.productName} renews every ${e.intervalDays} days at ${e.box??""} until you cancel; skip or cancel anytime in the app.`;function healthPlanFocusCopyFor(e){let t=healthPlanPetWords(e.name,e.sex),n=e=>e.petName?.trim()||t.name,NameOf=e=>e.petName?.trim()||t.Name,r=/* @__PURE__ */Object.freeze({jumpKicker:(e,n)=>n?`In ${t.poss} plan, every ${e.intervalDays} days`:e.offer?`${e.discountPercent}% off ${t.poss} first box`:e.intervalDays>0?`Ships every ${e.intervalDays} days`:r.onceLine(e),optionsLabel:"How to buy",subscribe:"Subscribe",bestValue:"Best value",subscribeLine:e=>e.offer?`First box, then ${e.box??""}`:`${e.box??""} every ${e.intervalDays} days`,priceLine:e=>e.offer?`${e.discountPercent}% off the first box. Ships every ${e.intervalDays} days.`:e.intervalDays>0?`Ships every ${e.intervalDays} days.`:r.onceOffer(e),once:"One box",onceLine:e=>e.onceDiscountPercent>0?`${e.onceDiscountPercent}% off, ships once`:"Ships once",buyOnce:e=>`Buy one box, ${e.once??e.box??""}`,subscribed:"Subscribed",subscribedLine:(e,t)=>t===null?`Every ${e.intervalDays} days`:`Every ${e.intervalDays} days · next box ${t}`,manage:"Manage",checkoutKicker:"Checkout",checkoutTitle:e=>`Checkout: ${e.productName}`,checkoutOffer:e=>`${e.discountPercent}% off your first box.`,shipsEvery:"Ships every",days:e=>`${e} days`,buyOnceOption:"Buy once",checkoutGo:(e,t,n)=>`${t?"Subscribe":"Buy now"} · ${n} today`,renews:e=>`Renews every ${e.intervalDays} days at ${e.box??""} until you cancel; skip or cancel anytime in the app.`,onceFine:"One box, ships tomorrow.",onceOffer:e=>e.onceDiscountPercent>0?`${e.onceDiscountPercent}% off, ships once.`:"Ships once.",checkoutNote:"",close:"Close",startedTitle:e=>`${NameOf(e)}'s plan has started.`,orderedTitle:()=>"Order placed.",startedWhat:e=>`${e.productName} ships tomorrow.`,startedNote:"",startedSteps:"What happens next",tomorrow:"Tomorrow",firstBoxShips:`${t.Poss} first box ships.`,trackingComesByText:"Tracking comes by text.",checkin:e=>e===null?"A 2-week check-in by text.":`A 2-week check-in by text: ${e}`,refill:`A text 3 days before ${t.poss} next box. Reply SKIP to skip it.`,nextBoxShips:e=>`${t.Poss} next box ships, ${e.box??""}.`,startedDone:`Back to ${t.poss} plan`,manageKicker:"Your subscription",manageTitle:e=>`Manage ${e.productName}`,skip:"Skip the next box",cancel:"Cancel subscription",skipped:(e,n)=>n===null?"Skipped.":`Skipped. ${t.Poss} next box ships ${n}.`,cancelled:e=>`${e.productName} is cancelled. Restart it from ${t.poss} plan anytime.`,orders:"Orders",startedHeader:"Subscribed",placedHeader:"Order placed",cartCheckoutTitle:"Checkout",orderNote:"",cartLabel:e=>e>0?`Cart, ${e} item${e>1?"s":""}`:"Cart, empty",addToCart:e=>`Add to cart · ${e}`,viewCart:"View cart",addedToCart:(e,t)=>`${e.productName} is in your cart${t?", as a subscription":""}.`,removedFromCart:e=>`${e} is out of your cart.`,cartTitle:"Cart",cartEmptyTitle:"Your cart is empty",cartEmptyBody:e=>`${NameOf(e)}'s plan pick lands here when you add it.`,seeOrders:`See ${t.poss} orders`,quantityLabel:e=>`How many: ${e}`,fewer:"One fewer",more:"One more",remove:"Remove",cartSubLine:e=>e.offer?`First box ${e.discountPercent}% off, then ${e.box??""} every ${e.intervalDays} days`:`Every ${e.intervalDays} days`,cartOnceLine:(e,n)=>n?`An extra box. ${t.Poss} plan keeps shipping.`:e.onceDiscountPercent>0?`One box, ${e.onceDiscountPercent}% off`:"One box",cartModeLabel:e=>`How to buy ${e}`,cartModeSubscribe:e=>e.offer?`Subscribe, ${e.discountPercent}% off the first box`:"Subscribe",cartModeOnce:e=>e.onceDiscountPercent>0?`One box, ${e.onceDiscountPercent}% off`:"One box",subtotal:"Subtotal",shipping:"Shipping",shippingValue:"",shippingTag:"",total:"Total",dueToday:"Due today",thenRenews:e=>`Then ${e.productName}`,renewsEvery:e=>`${e.box??""} every ${e.intervalDays} days`,checkoutCart:e=>`Checkout · ${e}`,cartOneAtATime:"",cartSubscriptionApart:"",cartItemSubscription:e=>`Subscription, every ${e.intervalDays} days`,cartItemQuantity:e=>`Qty ${e}`,placeOrder:(e,t)=>`${t?"Place order and subscribe":"Place order"} · ${e}`,cartFine:e=>`${e===null?"":`${hn(e)} `}Ships tomorrow.`,placedSteps:"What's coming",placedShips:"It ships.",placedArrives:"It arrives at home.",viewOrder:"View order",herSubscription:`${t.Poss} subscription`,nextBox:e=>`Next box ${e}`,everyDays:e=>`Every ${e} days`,ordersHeading:e=>e?"Orders":`${t.Poss} orders`,ordersFine:"",ordersEmptyTitle:"No orders yet",ordersEmptyBody:e=>`The boxes from ${n(e)}'s plan show up here.`,moreOrders:"",orderSteps:["Ordered","Shipped","Out for delivery","Delivered"],subscriptionBox:"Subscription box",orderTitle:e=>e===null?"Order":`Order ${e}`,arrivesBy:e=>`Arrives by ${e}`,deliveredOn:e=>`Delivered ${e}`,expected:e=>`Expected ${e}`,tracking:"Tracking",trackingByText:"The tracking number comes by text when it ships.",trackOn:e=>`Track on ${e}`,trackLink:"",inThisOrder:"In this order",orderItemLine:(e,t)=>`Qty ${e}${t?" · subscription box":""}`,paidWith:"Paid with",buyAgain:"Buy again",orderHelp:"Get help with this order",addWeightTitle:`Add ${t.poss} weight to size ${t.poss} dose`,addWeightBody:`From a home scale or ${t.poss} last vet visit.`,connectRecordsTitle:`Connect ${t.poss} vet records`,connectRecordsBody:`${t.Poss} weight, visits and labs make ${t.poss} plan sharper.`,weightKicker:`${t.Poss} weight`,weightTitle:e=>`Add ${n(e)}'s weight`,weightBody:`From a home scale or ${t.poss} last vet visit. ${t.Poss} plan uses it to size ${t.poss} dose.`,weightField:`${t.Poss} weight`,weightUnit:"lb",weightUnitKg:"kg",weightErrorKg:"Enter your pet’s weight",weightError:`Enter ${t.poss} weight in pounds, like 14.1.`,weightSave:`Save ${t.poss} weight`,weightSaved:e=>`Saved: ${e} lb. ${t.Poss} dose is sized for ${t.obj}.`,weightSavedKg:e=>`Saved: ${e} kg. ${t.Poss} dose is sized for ${t.obj}.`,checkoutFailed:"That didn't go through. Please try again.",builtWith:e=>`Built with ${e}`,fromVet:e=>`From ${e}`,waitVetTips:e=>`Free tips from ${e}, built around that risk`,signalsFit:e=>`${e} of ${e} signals fit ${t.Name}`,signalsValue:e=>`${e}/${e}`,noPick:`No supplement for this one. ${t.Poss} vet comes first.`,callYourVet:"Call your vet today",callAVet:"Call a vet today",saveForCheckup:`Save for ${t.poss} next checkup`,savedForCheckup:`Saved for ${t.poss} next checkup`,blanksLabel:`${t.Poss} three blanks`,blanksAsked:e=>`Asked ${e}`,blanksAskedNoClinic:"",blanksWaitPill:"2 to 5 days",blanksFilledKicker:`From ${t.poss} vet records`,blanksFilled:(e,t)=>`${e} of ${t} filled`,blanksWeight:`Keep ${t.obj} at `,blanksWeightSource:`From ${t.poss} vet visits`,blanksDose:(e,t)=>`${e} of ${t}`,blanksDoseSource:`Sized to ${t.poss} weight`,blanksShots:`${t.Poss} next shots are due `,blanksShotsSource:`From ${t.poss} clinic`,blankEmpty:"blank",recordsLanded:`${t.Poss} records are in. ${t.Poss} plan now uses ${t.poss} weight and ${t.poss} visits.`,todayLabel:`${t.Poss} Health Plan`,poweredBy:"powered by",poweredByName:"Everfur",seeMore:"See more",seeLess:"See less",reportActions:"Actions to take",openReport:`Open it in ${t.poss} report`,askReport:"Ask about it",fullOpen:`See ${t.poss} full plan`,fullOpenLine:`${t.Poss} vet, reviews and ${t.poss} checkup`,fullClose:`Show ${t.poss} brief plan`,fullCloseLine:`${t.Poss} risk, tips, pick and signs`,hopeNoted:e=>`Noted. When ${t.poss} results land, we'll start with ${e}.`,productLink:e=>`${e}, see the product`,productPhotos:e=>`${e} photos, swipe for more`,shopAll:"Shop all",madeFor:`Made for ${t.name}`,ratingLine:e=>`· ${e} reviews`,productOffer:e=>`${e.discountPercent}% off ${t.poss} first box`,productEvery:e=>`Every ${e.intervalDays} days`,productOnce:e=>e.onceDiscountPercent>0?`One box, ${e.onceDiscountPercent}% off`:"One box",productExtraBox:"An extra box",productOnPlan:e=>`On ${t.poss} plan, every ${e.intervalDays} days. This adds one extra box.`,quantity:"Quantity",description:"Description",readMore:"Read more",readLess:"Read less",whatsInside:"What's inside",howMuch:"How much",reviewsTitle:"Reviews",reviewCount:e=>`${e} reviews`,reviewsSwipe:"Reviews, swipe for more",readAllReviews:e=>`Read all ${e} reviews`,starsLabel:e=>`${e} out of 5 stars`,buyNow:"Buy now"});return r}healthPlanFocusCopyFor({sex:"female"});var fn=/* @__PURE__ */Object.freeze({eyebrow:"",lede:"",pendingLede:"",recordsRowMore:"",planTopic:"",askTitle:"",noVetTitle:"",sentFine:"",clinicEta:"",blanksDetail:"",bannerBody:"",appName:""});function introPetWords(e,t){let n=healthPlanPetWords(e,t);return{...n,subj:t==="female"?"she":t==="male"?"he":n.name}}var bn=["","one","two","three","four","five","six","seven","eight","nine","ten"];function numberWord(e){return Number.isInteger(e)&&e>=1&&e<=10?bn[e]??null:null}var mn=e=>e===""?e:e.charAt(0).toUpperCase()+e.slice(1);function defaultIntroBlanks(e){return[{before:`Keep ${e.obj} at `,after:" lb",source:`From ${e.poss} vet visits`},{before:`${e.Poss} next shots are due `,after:"",source:`From ${e.poss} clinic`,width:"l"}]}function introFacts(e,t){let n=e?.pet.name??t??null,r=e?.page??null,i=r?.byline?.name?.trim()??"";return{pet:introPetWords(n,e?.pet.sex??null),planTitle:r?.title.trim()??"",vetName:e?.vetReviewed===true&&i!==""?i:null,tips:r?.routine?.steps.length??0}}function introText(e){let{facts:t,copy:n,resultsPending:r}=e,i=t.pet,a=numberWord(e.blanks),o=numberWord(t.tips),s=n.planTopic.trim(),l=t.vetName===null?null:t.vetName.replace(/ /g," "),d=s===""?"":`One plan for ${i.poss} ${s}${l===null?"":`, built with ${l}`}.`,c=o===null?"":`${mn(o)} tips, one thing to add.`,u=r?`${i.Poss} plan arrives with ${i.poss} results.`:[d,c].filter(e=>e!=="").join(" "),p=[`What could go wrong for ${i.name}, and what's changed.`,n.recordsRowMore.trim()].filter(e=>e!=="").join(" ");return{sheetLabel:{intro:`Welcome to ${i.Name}'s tab`,records:`Request ${i.poss} records`},back:"Back",skip:"Skip",close:"Close",poweredBy:"powered by",tabs:{eyebrow:n.eyebrow,title:`${i.Name}'s health, in three tabs.`,lede:r?n.pendingLede:n.lede,ask:`Trained on 50,000+ peer-reviewed vet publications. Ask about ${i.name} any hour (the 2 am ones too).`,plan:u,records:p,next:"Next",seePlan:`See ${i.poss} plan`},ask:{title:n.askTitle,lede:a===null?"":`${i.Poss} plan has ${a} blanks only ${i.poss} vet can fill (we ask the clinic for you).`,blanksPill:`${e.blanks} blanks`,blankLabel:"blank",later:"Later",connect:`Connect ${i.poss} vet`,fine:`We send ${i.poss} clinic a secure request and read every page they send back.`,noVet:`${i.Name} doesn't have a vet yet`},clinic:{title:`Where does ${i.name} see ${i.poss} vet?`,search:"Clinic name, city or zip",searchLabel:`Search for ${i.poss} clinic`,list:"Clinics",more:`Sees more than one? Start with the one ${i.subj} sees most.`,request:`Request ${i.poss} records`,upload:"Upload a PDF or a photo instead",add:`Add ${i.poss} clinic`},sent:{eyebrow:"Request sent",title:"Sent. Now it's the clinic's turn.",track:`${i.Poss} records request`,sentStep:"Request sent",sentTo:e=>`Today, to ${e}`,clinicStep:`${i.Poss} clinic sends ${i.poss} records`,clinicEta:n.clinicEta,blanksStep:a===null?"":`${i.Poss} ${a} blanks fill in`,blanksDetail:n.blanksDetail,lede:`Turn on notifications and we'll tell you the minute ${i.name}'s records are in.`,notify:"Turn on notifications",notNow:"Not now",fine:n.sentFine},noVet:{title:n.noVetTitle,lede:a===null?"":`When ${i.subj} does, connect ${i.poss} vet in Records and ${i.poss} ${a} blanks fill in.`,seePlan:`See ${i.poss} plan`},toast:{on:`Notifications on. We'll tell you the minute ${i.name}'s records are in.`,off:`Requested. ${i.Name}'s records will show up here when they're in.`,landed:`${i.Poss} records are in. ${i.Poss} plan now uses ${i.poss} weight and ${i.poss} visits.`},banner:{app:n.appName,now:"now",title:`${i.Name}'s records are in`,body:n.bannerBody}}}function yn(e,t){let n=`${t.key}\n${t.email}`,r=e.get(n);return r===void 0?(e.set(n,t.idempotencyKey),t):r===t.idempotencyKey?t:/* @__PURE__ */Object.freeze({...t,idempotencyKey:r})}function isIntroSwipeOut(e,t){let n=t>0?Math.abs(e)/t:0;return e>90||e>12&&n>.11}var gn="everfur:records-requested",vn="everfur:records-landed";function xn(e,t){try{if(typeof window>"u"||typeof CustomEvent!="function")return;window.dispatchEvent(new CustomEvent(e,{detail:t}))}catch{}}var kn={".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"]]},wn={".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"]]},_n="cubic-bezier(0.23, 1, 0.32, 1)";var Cn={inRow:[["from",[["opacity","0"],["transform","translateY(8px)"]]]]};function Sn(e,t,n){return n==="sent"||n==="consent"||t.scrollTop>0?true:e instanceof Element&&e.closest("button, input, textarea, select, a, canvas, label")!==null}var En=60;function $n(e){let t=e?.querySelector("h1, h2, h3")??null;return t!==null&&!t.hasAttribute("tabindex")&&(t.tabIndex=-1),t}function EverfurIntro(r){let{petRef:petRef,onClose:i,onClosed:a,onFrame:o}=r,s=r.mode??"intro",l=useEverfurTheme(),d=l.motion.reducedMotion,c=e.useMemo(()=>Wt(l,kn,wn),[l]),u=e.useMemo(()=>Ht(l),[l]),p=e.useMemo(()=>Lt(l),[l]),{runtime:h}=Re(),f=e.useMemo(()=>({...fn,...r.copy}),[r.copy]),b=e.useMemo(()=>introFacts(r.page??null,r.petName),[r.page,r.petName]),m=e.useMemo(()=>r.blanks??defaultIntroBlanks(b.pet),[r.blanks,b.pet]),y=e.useMemo(()=>introText({facts:b,copy:f,blanks:m.length,resultsPending:r.resultsPending===true}),[b,f,m.length,r.resultsPending]),[g,v]=e.useState(s==="records"?"clinic":"tabs"),[x,k]=e.useState(false),[w,_]=e.useState(false),[C,S]=e.useState(false),[E,$]=e.useState(null),F=e.useRef(/* @__PURE__ */new Map),[j,T]=e.useState(""),[I,R]=e.useState(false),[D,O]=e.useState(null),[P,z]=e.useState(null),A=e.useRef(null),N=e.useRef(null),M=e.useRef(null),L=e.useRef(null),B=e.useRef(null),q=e.useRef([]),U=e.useId(),W=pn(g==="clinic"||g==="consent"),H=e.useCallback((e,t)=>{q.current.push(setTimeout(e,t))},[]);e.useEffect(()=>()=>q.current.forEach(clearTimeout),[]);let V=e.useCallback(()=>{H(()=>M.current?.focus({preventScroll:true}),En)},[H]);e.useEffect(()=>{o?.(w?null:g)},[g,w,o]),e.useEffect(()=>()=>o?.(null),[o]);let Y=r.container??P?.parentElement??null,K=r.tabBar??null;e.useLayoutEffect(()=>{if(Y===null||K===null)return;let e=()=>{let e=Y.getBoundingClientRect(),t=K.getBoundingClientRect();O({t:Math.round(t.top-e.top),h:Math.round(t.height)})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[Y,K]),e.useEffect(()=>{if(P===null)return;let e=P.parentElement;L.current=document.activeElement;let t=[];if(e!==null)for(let n of Array.from(e.children))n===P||!(n instanceof HTMLElement)||n.inert||(n.inert=true,t.push(n));let n=requestAnimationFrame(()=>k(true));return V(),()=>{cancelAnimationFrame(n);for(let e of t)e.inert=false;let e=document.activeElement,r=L.current;(e===null||e===document.body||!e.isConnected)&&r instanceof HTMLElement&&r.isConnected&&r.focus({preventScroll:true})}},[P,V]),e.useLayoutEffect(()=>{if(P===null||d||g!=="tabs")return;let e=N.current?.querySelectorAll("li")??[],t=Object.fromEntries((Cn.inRow?.[0]?.[1]??[]).map(([e,t])=>[e,t]));e.forEach((e,n)=>{if(typeof e.animate=="function")try{e.animate([t,{opacity:1,transform:"none"}],{duration:260,delay:560+n*60,easing:_n,fill:"both"})}catch{}})},[P]),e.useEffect(()=>{if(g!=="ask"||d)return;(N.current?.querySelectorAll("[data-blank]")??[]).forEach((e,t)=>{if(typeof e.animate=="function")try{let n=p.accent4??"";e.animate([{background:n},{background:p.accent2??n,offset:.5},{background:n}],{duration:520,delay:300+t*80,easing:"ease-in-out",fill:"both"})}catch{}})},[g,d,p]),e.useLayoutEffect(()=>{let e=B.current;B.current=null;let t=A.current,n=N.current;if(!(e===null||t===null||n===null)){t.scrollTop=0;try{if(d)typeof n.animate=="function"&&n.animate([{opacity:0},{opacity:1}],{duration:150,easing:"ease"});else{let r=t.offsetHeight;e.h0!==r&&typeof t.animate=="function"&&t.animate([{height:`${e.h0}px`},{height:`${r}px`}],{duration:240,easing:_n}),typeof n.animate=="function"&&n.animate([{opacity:0,transform:`translateX(${e.back?-24:24}px)`},{opacity:1,transform:"none"}],{duration:240,easing:_n})}}catch{}V()}},[g,d,V]);let Q=e.useCallback((e,t=false)=>{B.current={h0:A.current?.offsetHeight??0,back:t},v(e)},[]),G=e.useCallback((e,t=null,n=null)=>{if(!w){if(_(true),k(false),i({exit:e,toast:t,notifications:n}),e==="stay"){let e=L.current;e instanceof HTMLElement&&e.isConnected&&e.focus({preventScroll:true})}H(()=>a?.(),d?160:260)}},[w,i,a,H,d]),Z=e.useCallback(()=>G(s==="records"?"stay":"ask"),[G,s]),X=r.onUpload,J=e.useMemo(()=>X===void 0?void 0:()=>{G("stay"),X()},[X,G]),ee=e.useCallback(e=>G("plan",e?y.toast.on:y.toast.off,e),[G,y]),te=e.useCallback(async()=>{if(I)return;R(true);let e=false;try{r.onEnableNotifications!==void 0?e=await r.onEnableNotifications()===!0:e=(await createNotificationsClient(h).setPreferences({pushEnabled:!0,emailEnabled:!0})).ok}catch{e=false}R(false),ee(e)},[I,r,h,ee]);e.useEffect(()=>{if(w)return;let e=e=>{e.key!=="Escape"||e.defaultPrevented||(e.preventDefault(),g==="sent"?ee(false):Z())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[w,g,ee,Z]);let ne=e.useRef(null),re=e=>{let t=A.current;if(!(ne.current!==null||t===null||w||Sn(e.target,t,g))){ne.current={y:e.clientY,t:performance.now(),dy:0,id:e.pointerId};try{t.setPointerCapture(e.pointerId)}catch{}S(true)}},ie=e=>{let t=ne.current,n=A.current;if(t===null||n===null)return;let r=e.clientY-t.y;t.dy=r>0?r:r/4,n.style.transform=`translateY(${t.dy}px)`},ae=()=>{let e=ne.current,t=A.current;e!==null&&(ne.current=null,S(false),isIntroSwipeOut(e.dy,performance.now()-e.t)?Z():t!==null&&(t.style.transform="none"))},oe=e.useCallback(e=>{let t=E===null?"":E.clinic?.name??E.freeText??"",n={petRef:petRef,clinicName:t,requestId:e.id,at:/* @__PURE__ */(new Date).toISOString()};T(t),xn(gn,{petRef:n.petRef,requestId:n.requestId,at:n.at}),r.onRequested?.(n),Q("sent")},[E,petRef,r,Q]),se=g!=="tabs",le={"--in-t":`${D?.t??0}px`,"--in-h":`${D?.h??0}px`},de=g==="clinic"&&s!=="records"||g==="novet"||g==="consent",ce=g!=="sent",ue=u.button,pe=(e,t,r=false)=>t===""?null:/* @__PURE__ */n.jsx("p",{style:{...u.text,...e},...r?{ref:e=>{M.current=e},tabIndex:-1,id:U}:{},children:t}),he=e=>e===""?null:/* @__PURE__ */n.jsx("h3",{id:U,ref:e=>{M.current=e},tabIndex:-1,style:{...u.text,...c(".serif",".in-h")},children:e}),fe=(e,t,...r)=>/* @__PURE__ */n.jsx("button",{type:"button",style:{...ue,...c(".emb-btn",".in-body .emb-btn",...r)},onClick:t,children:e}),be=(e,t)=>/* @__PURE__ */n.jsx("button",{type:"button",style:{...ue,...c(".in-link")},onClick:t,children:e}),me=e=>{let t=l.meta.hidePoweredBy?null:/* @__PURE__ */n.jsxs("span",{style:c(".in-by"),children:[y.poweredBy,
|
|
40
|
+
return n.jsx(e.EverfurRecordsConsent,{petRef:petRef,...t===void 0?{}:{petName:t},clinic:r,...i===void 0?{}:{ownerName:i},...a===void 0?{}:{onCaptureSignature:a},onCreated:o})}}var cn=null;function un(){return cn===null&&(cn=import("@everfur/sdk/web/records").then(e=>({Clinic:ln(e),Consent:dn(e)}),()=>(cn=null,null))),cn}function pn(t){let[n,r]=e.useState(null);return e.useEffect(()=>{if(!t||n!==null)return;let e=true;return un().then(t=>{e&&t!==null&&r(t)}),()=>{e=false}},[t,n]),e.useMemo(()=>n,[n])}function healthPlanPetWords(e,t){let n=e?.trim()??"",r=n===""?"your pet":n,i=n===""?"Your pet":n;return t==="female"?{name:r,Name:i,poss:"her",Poss:"Her",obj:"her"}:t==="male"?{name:r,Name:i,poss:"his",Poss:"His",obj:"him"}:{name:r,Name:i,poss:`${r}'s`,Poss:`${i}'s`,obj:r}}var hn=e=>e===null?"":`${e.productName} renews every ${e.intervalDays} days at ${e.box??""} until you cancel; skip or cancel anytime in the app.`;function healthPlanFocusCopyFor(e){let t=healthPlanPetWords(e.name,e.sex),n=e=>e.petName?.trim()||t.name,NameOf=e=>e.petName?.trim()||t.Name,r=/* @__PURE__ */Object.freeze({jumpKicker:(e,n)=>n?`In ${t.poss} plan, every ${e.intervalDays} days`:e.offer?`${e.discountPercent}% off ${t.poss} first box`:e.intervalDays>0?`Ships every ${e.intervalDays} days`:r.onceLine(e),optionsLabel:"How to buy",subscribe:"Subscribe",bestValue:"Best value",subscribeLine:e=>e.offer?`First box, then ${e.box??""}`:`${e.box??""} every ${e.intervalDays} days`,priceLine:e=>e.offer?`${e.discountPercent}% off the first box. Ships every ${e.intervalDays} days.`:e.intervalDays>0?`Ships every ${e.intervalDays} days.`:r.onceOffer(e),once:"One box",onceLine:e=>e.onceDiscountPercent>0?`${e.onceDiscountPercent}% off, ships once`:"Ships once",buyOnce:e=>`Buy one box, ${e.once??e.box??""}`,subscribed:"Subscribed",subscribedLine:(e,t)=>t===null?`Every ${e.intervalDays} days`:`Every ${e.intervalDays} days · next box ${t}`,manage:"Manage",checkoutKicker:"Checkout",checkoutTitle:e=>`Checkout: ${e.productName}`,checkoutOffer:e=>`${e.discountPercent}% off your first box.`,shipsEvery:"Ships every",days:e=>`${e} days`,buyOnceOption:"Buy once",checkoutGo:(e,t,n)=>`${t?"Subscribe":"Buy now"} · ${n} today`,renews:e=>`Renews every ${e.intervalDays} days at ${e.box??""} until you cancel; skip or cancel anytime in the app.`,onceFine:"One box, ships tomorrow.",onceOffer:e=>e.onceDiscountPercent>0?`${e.onceDiscountPercent}% off, ships once.`:"Ships once.",checkoutNote:"",close:"Close",startedTitle:e=>`${NameOf(e)}'s plan has started.`,orderedTitle:()=>"Order placed.",startedWhat:e=>`${e.productName} ships tomorrow.`,startedNote:"",startedSteps:"What happens next",tomorrow:"Tomorrow",firstBoxShips:`${t.Poss} first box ships.`,trackingComesByText:"Tracking comes by text.",checkin:e=>e===null?"A 2-week check-in by text.":`A 2-week check-in by text: ${e}`,refill:`A text 3 days before ${t.poss} next box. Reply SKIP to skip it.`,nextBoxShips:e=>`${t.Poss} next box ships, ${e.box??""}.`,startedDone:`Back to ${t.poss} plan`,manageKicker:"Your subscription",manageTitle:e=>`Manage ${e.productName}`,skip:"Skip the next box",cancel:"Cancel subscription",skipped:(e,n)=>n===null?"Skipped.":`Skipped. ${t.Poss} next box ships ${n}.`,cancelled:e=>`${e.productName} is cancelled. Restart it from ${t.poss} plan anytime.`,orders:"Orders",startedHeader:"Subscribed",placedHeader:"Order placed",cartCheckoutTitle:"Checkout",orderNote:"",cartLabel:e=>e>0?`Cart, ${e} item${e>1?"s":""}`:"Cart, empty",addToCart:e=>`Add to cart · ${e}`,viewCart:"View cart",addedToCart:(e,t)=>`${e.productName} is in your cart${t?", as a subscription":""}.`,removedFromCart:e=>`${e} is out of your cart.`,cartTitle:"Cart",cartEmptyTitle:"Your cart is empty",cartEmptyBody:e=>`${NameOf(e)}'s plan pick lands here when you add it.`,seeOrders:`See ${t.poss} orders`,quantityLabel:e=>`How many: ${e}`,fewer:"One fewer",more:"One more",remove:"Remove",cartSubLine:e=>e.offer?`First box ${e.discountPercent}% off, then ${e.box??""} every ${e.intervalDays} days`:`Every ${e.intervalDays} days`,cartOnceLine:(e,n)=>n?`An extra box. ${t.Poss} plan keeps shipping.`:e.onceDiscountPercent>0?`One box, ${e.onceDiscountPercent}% off`:"One box",cartModeLabel:e=>`How to buy ${e}`,cartModeSubscribe:e=>e.offer?`Subscribe, ${e.discountPercent}% off the first box`:"Subscribe",cartModeOnce:e=>e.onceDiscountPercent>0?`One box, ${e.onceDiscountPercent}% off`:"One box",subtotal:"Subtotal",shipping:"Shipping",shippingValue:"",shippingTag:"",total:"Total",dueToday:"Due today",thenRenews:e=>`Then ${e.productName}`,renewsEvery:e=>`${e.box??""} every ${e.intervalDays} days`,checkoutCart:e=>`Checkout · ${e}`,cartOneAtATime:"",cartSubscriptionApart:"",cartItemSubscription:e=>`Subscription, every ${e.intervalDays} days`,cartItemQuantity:e=>`Qty ${e}`,placeOrder:(e,t)=>`${t?"Place order and subscribe":"Place order"} · ${e}`,cartFine:e=>`${e===null?"":`${hn(e)} `}Ships tomorrow.`,placedSteps:"What's coming",placedShips:"It ships.",placedArrives:"It arrives at home.",viewOrder:"View order",herSubscription:`${t.Poss} subscription`,nextBox:e=>`Next box ${e}`,everyDays:e=>`Every ${e} days`,ordersHeading:e=>e?"Orders":`${t.Poss} orders`,ordersFine:"",ordersEmptyTitle:"No orders yet",ordersEmptyBody:e=>`The boxes from ${n(e)}'s plan show up here.`,moreOrders:"",orderSteps:["Ordered","Shipped","Out for delivery","Delivered"],subscriptionBox:"Subscription box",orderTitle:e=>e===null?"Order":`Order ${e}`,arrivesBy:e=>`Arrives by ${e}`,deliveredOn:e=>`Delivered ${e}`,expected:e=>`Expected ${e}`,tracking:"Tracking",trackingByText:"The tracking number comes by text when it ships.",trackOn:e=>`Track on ${e}`,trackLink:"",inThisOrder:"In this order",orderItemLine:(e,t)=>`Qty ${e}${t?" · subscription box":""}`,paidWith:"Paid with",buyAgain:"Buy again",orderHelp:"Get help with this order",addWeightTitle:`Add ${t.poss} weight to size ${t.poss} dose`,addWeightBody:`From a home scale or ${t.poss} last vet visit.`,connectRecordsTitle:`Connect ${t.poss} vet records`,connectRecordsBody:`${t.Poss} weight, visits and labs make ${t.poss} plan sharper.`,weightKicker:`${t.Poss} weight`,weightTitle:e=>`Add ${n(e)}'s weight`,weightBody:`From a home scale or ${t.poss} last vet visit. ${t.Poss} plan uses it to size ${t.poss} dose.`,weightField:`${t.Poss} weight`,weightUnit:"lb",weightUnitKg:"kg",weightErrorKg:"Enter your pet’s weight",weightError:`Enter ${t.poss} weight in pounds, like 14.1.`,weightSave:`Save ${t.poss} weight`,weightSaved:e=>`Saved: ${e} lb. ${t.Poss} dose is sized for ${t.obj}.`,weightSavedKg:e=>`Saved: ${e} kg. ${t.Poss} dose is sized for ${t.obj}.`,checkoutFailed:"That didn't go through. Please try again.",builtWith:e=>`Built with ${e}`,fromVet:e=>`From ${e}`,waitVetTips:e=>`Free tips from ${e}, built around that risk`,signalsFit:e=>`${e} of ${e} signals fit ${t.Name}`,signalsValue:e=>`${e}/${e}`,noPick:`No supplement for this one. ${t.Poss} vet comes first.`,callYourVet:"Call your vet today",callAVet:"Call a vet today",saveForCheckup:`Save for ${t.poss} next checkup`,savedForCheckup:`Saved for ${t.poss} next checkup`,blanksLabel:`${t.Poss} three blanks`,blanksAsked:e=>`Asked ${e}`,blanksAskedNoClinic:"",blanksWaitPill:"2 to 5 days",blanksFilledKicker:`From ${t.poss} vet records`,blanksFilled:(e,t)=>`${e} of ${t} filled`,blanksWeight:`Keep ${t.obj} at `,blanksWeightSource:`From ${t.poss} vet visits`,blanksDose:(e,t)=>`${e} of ${t}`,blanksDoseSource:`Sized to ${t.poss} weight`,blanksShots:`${t.Poss} next shots are due `,blanksShotsSource:`From ${t.poss} clinic`,blankEmpty:"blank",recordsLanded:`${t.Poss} records are in. ${t.Poss} plan now uses ${t.poss} weight and ${t.poss} visits.`,todayLabel:`${t.Poss} Health Plan`,poweredBy:"powered by",poweredByName:"Everfur",seeMore:"See more",seeLess:"See less",reportActions:"Actions to take",openReport:`Open it in ${t.poss} report`,askReport:"Ask about it",fullOpen:`See ${t.poss} full plan`,fullOpenLine:`${t.Poss} vet, reviews and ${t.poss} checkup`,fullClose:`Show ${t.poss} brief plan`,fullCloseLine:`${t.Poss} risk, tips, pick and signs`,hopeNoted:e=>`Noted. When ${t.poss} results land, we'll start with ${e}.`,productLink:e=>`${e}, see the product`,productPhotos:e=>`${e} photos, swipe for more`,shopAll:"Shop all",madeFor:`Made for ${t.name}`,ratingLine:e=>`· ${e} reviews`,productOffer:e=>`${e.discountPercent}% off ${t.poss} first box`,productEvery:e=>`Every ${e.intervalDays} days`,productOnce:e=>e.onceDiscountPercent>0?`One box, ${e.onceDiscountPercent}% off`:"One box",productExtraBox:"An extra box",productOnPlan:e=>`On ${t.poss} plan, every ${e.intervalDays} days. This adds one extra box.`,quantity:"Quantity",description:"Description",readMore:"Read more",readLess:"Read less",whatsInside:"What's inside",howMuch:"How much",reviewsTitle:"Reviews",reviewCount:e=>`${e} reviews`,reviewsSwipe:"Reviews, swipe for more",readAllReviews:e=>`Read all ${e} reviews`,starsLabel:e=>`${e} out of 5 stars`,buyNow:"Buy now"});return r}healthPlanFocusCopyFor({sex:"female"});var fn=/* @__PURE__ */Object.freeze({eyebrow:"",lede:"",pendingLede:"",recordsRowMore:"",planTopic:"",askTitle:"",noVetTitle:"",sentFine:"",clinicEta:"",blanksDetail:"",bannerBody:"",appName:""});function introPetWords(e,t){let n=healthPlanPetWords(e,t);return{...n,subj:t==="female"?"she":t==="male"?"he":n.name}}var bn=["","one","two","three","four","five","six","seven","eight","nine","ten"];function numberWord(e){return Number.isInteger(e)&&e>=1&&e<=10?bn[e]??null:null}var mn=e=>e===""?e:e.charAt(0).toUpperCase()+e.slice(1);function defaultIntroBlanks(e){return[{before:`Keep ${e.obj} at `,after:" lb",source:`From ${e.poss} vet visits`},{before:`${e.Poss} next shots are due `,after:"",source:`From ${e.poss} clinic`,width:"l"}]}function introFacts(e,t){let n=e?.pet.name??t??null,r=e?.page??null,i=r?.byline?.name?.trim()??"";return{pet:introPetWords(n,e?.pet.sex??null),planTitle:r?.title.trim()??"",vetName:e?.vetReviewed===true&&i!==""?i:null,tips:r?.routine?.steps.length??0}}function introText(e){let{facts:t,copy:n,resultsPending:r}=e,i=t.pet,a=numberWord(e.blanks),o=numberWord(t.tips),s=n.planTopic.trim(),l=t.vetName===null?null:t.vetName.replace(/ /g," "),d=s===""?"":`One plan for ${i.poss} ${s}${l===null?"":`, built with ${l}`}.`,c=o===null?"":`${mn(o)} tips, one thing to add.`,u=r?`${i.Poss} plan arrives with ${i.poss} results.`:[d,c].filter(e=>e!=="").join(" "),p=[`What could go wrong for ${i.name}, and what's changed.`,n.recordsRowMore.trim()].filter(e=>e!=="").join(" ");return{sheetLabel:{intro:`Welcome to ${i.Name}'s tab`,records:`Request ${i.poss} records`},back:"Back",skip:"Skip",close:"Close",poweredBy:"powered by",tabs:{eyebrow:n.eyebrow,title:`${i.Name}'s health, in three tabs.`,lede:r?n.pendingLede:n.lede,ask:`Trained on 50,000+ peer-reviewed vet publications. Ask about ${i.name} any hour (the 2 am ones too).`,plan:u,records:p,next:"Next",seePlan:`See ${i.poss} plan`},ask:{title:n.askTitle,lede:a===null?"":`${i.Poss} plan has ${a} blanks only ${i.poss} vet can fill (we ask the clinic for you).`,blanksPill:`${e.blanks} blanks`,blankLabel:"blank",later:"Later",connect:`Connect ${i.poss} vet`,fine:`We send ${i.poss} clinic a secure request and read every page they send back.`,noVet:`${i.Name} doesn't have a vet yet`},clinic:{title:`Where does ${i.name} see ${i.poss} vet?`,search:"Clinic name, city or zip",searchLabel:`Search for ${i.poss} clinic`,list:"Clinics",more:`Sees more than one? Start with the one ${i.subj} sees most.`,request:`Request ${i.poss} records`,upload:"Upload a PDF or a photo instead",add:`Add ${i.poss} clinic`},sent:{eyebrow:"Request sent",title:"Sent. Now it's the clinic's turn.",track:`${i.Poss} records request`,sentStep:"Request sent",sentTo:e=>`Today, to ${e}`,clinicStep:`${i.Poss} clinic sends ${i.poss} records`,clinicEta:n.clinicEta,blanksStep:a===null?"":`${i.Poss} ${a} blanks fill in`,blanksDetail:n.blanksDetail,lede:`Turn on notifications and we'll tell you the minute ${i.name}'s records are in.`,notify:"Turn on notifications",notNow:"Not now",fine:n.sentFine},noVet:{title:n.noVetTitle,lede:a===null?"":`When ${i.subj} does, connect ${i.poss} vet in Records and ${i.poss} ${a} blanks fill in.`,seePlan:`See ${i.poss} plan`},toast:{on:`Notifications on. We'll tell you the minute ${i.name}'s records are in.`,off:`Requested. ${i.Name}'s records will show up here when they're in.`,landed:`${i.Poss} records are in. ${i.Poss} plan now uses ${i.poss} weight and ${i.poss} visits.`},banner:{app:n.appName,now:"now",title:`${i.Name}'s records are in`,body:n.bannerBody}}}function yn(e,t){let n=`${t.key}\n${t.email}`,r=e.get(n);return r===void 0?(e.set(n,t.idempotencyKey),t):r===t.idempotencyKey?t:/* @__PURE__ */Object.freeze({...t,idempotencyKey:r})}function isIntroSwipeOut(e,t){let n=t>0?Math.abs(e)/t:0;return e>90||e>12&&n>.11}var gn="everfur:records-requested",vn="everfur:records-landed";function xn(e,t){try{if(typeof window>"u"||typeof CustomEvent!="function")return;window.dispatchEvent(new CustomEvent(e,{detail:t}))}catch{}}var kn={".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"]]},_n={".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"]]},wn="cubic-bezier(0.23, 1, 0.32, 1)";var Cn={inRow:[["from",[["opacity","0"],["transform","translateY(8px)"]]]]};function Sn(e,t,n){return n==="sent"||n==="consent"||t.scrollTop>0?true:e instanceof Element&&e.closest("button, input, textarea, select, a, canvas, label")!==null}var En=60;function $n(e){let t=e?.querySelector("h1, h2, h3")??null;return t!==null&&!t.hasAttribute("tabindex")&&(t.tabIndex=-1),t}function EverfurIntro(r){let{petRef:petRef,onClose:i,onClosed:a,onFrame:o}=r,s=r.mode??"intro",l=useEverfurTheme(),d=l.motion.reducedMotion,c=e.useMemo(()=>Wt(l,kn,_n),[l]),u=e.useMemo(()=>Ht(l),[l]),p=e.useMemo(()=>Lt(l),[l]),{runtime:h}=Re(),f=e.useMemo(()=>({...fn,...r.copy}),[r.copy]),b=e.useMemo(()=>introFacts(r.page??null,r.petName),[r.page,r.petName]),m=e.useMemo(()=>r.blanks??defaultIntroBlanks(b.pet),[r.blanks,b.pet]),y=e.useMemo(()=>introText({facts:b,copy:f,blanks:m.length,resultsPending:r.resultsPending===true}),[b,f,m.length,r.resultsPending]),[g,v]=e.useState(s==="records"?"clinic":"tabs"),[x,k]=e.useState(false),[_,w]=e.useState(false),[C,S]=e.useState(false),[E,$]=e.useState(null),F=e.useRef(/* @__PURE__ */new Map),[j,T]=e.useState(""),[I,R]=e.useState(false),[D,O]=e.useState(null),[P,z]=e.useState(null),A=e.useRef(null),N=e.useRef(null),M=e.useRef(null),L=e.useRef(null),B=e.useRef(null),q=e.useRef([]),U=e.useId(),W=pn(g==="clinic"||g==="consent"),H=e.useCallback((e,t)=>{q.current.push(setTimeout(e,t))},[]);e.useEffect(()=>()=>q.current.forEach(clearTimeout),[]);let V=e.useCallback(()=>{H(()=>M.current?.focus({preventScroll:true}),En)},[H]);e.useEffect(()=>{o?.(_?null:g)},[g,_,o]),e.useEffect(()=>()=>o?.(null),[o]);let Y=r.container??P?.parentElement??null,K=r.tabBar??null;e.useLayoutEffect(()=>{if(Y===null||K===null)return;let e=()=>{let e=Y.getBoundingClientRect(),t=K.getBoundingClientRect();O({t:Math.round(t.top-e.top),h:Math.round(t.height)})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[Y,K]),e.useEffect(()=>{if(P===null)return;let e=P.parentElement;L.current=document.activeElement;let t=[];if(e!==null)for(let n of Array.from(e.children))n===P||!(n instanceof HTMLElement)||n.inert||(n.inert=true,t.push(n));let n=requestAnimationFrame(()=>k(true));return V(),()=>{cancelAnimationFrame(n);for(let e of t)e.inert=false;let e=document.activeElement,r=L.current;(e===null||e===document.body||!e.isConnected)&&r instanceof HTMLElement&&r.isConnected&&r.focus({preventScroll:true})}},[P,V]),e.useLayoutEffect(()=>{if(P===null||d||g!=="tabs")return;let e=N.current?.querySelectorAll("li")??[],t=Object.fromEntries((Cn.inRow?.[0]?.[1]??[]).map(([e,t])=>[e,t]));e.forEach((e,n)=>{if(typeof e.animate=="function")try{e.animate([t,{opacity:1,transform:"none"}],{duration:260,delay:560+n*60,easing:wn,fill:"both"})}catch{}})},[P]),e.useEffect(()=>{if(g!=="ask"||d)return;(N.current?.querySelectorAll("[data-blank]")??[]).forEach((e,t)=>{if(typeof e.animate=="function")try{let n=p.accent4??"";e.animate([{background:n},{background:p.accent2??n,offset:.5},{background:n}],{duration:520,delay:300+t*80,easing:"ease-in-out",fill:"both"})}catch{}})},[g,d,p]),e.useLayoutEffect(()=>{let e=B.current;B.current=null;let t=A.current,n=N.current;if(!(e===null||t===null||n===null)){t.scrollTop=0;try{if(d)typeof n.animate=="function"&&n.animate([{opacity:0},{opacity:1}],{duration:150,easing:"ease"});else{let r=t.offsetHeight;e.h0!==r&&typeof t.animate=="function"&&t.animate([{height:`${e.h0}px`},{height:`${r}px`}],{duration:240,easing:wn}),typeof n.animate=="function"&&n.animate([{opacity:0,transform:`translateX(${e.back?-24:24}px)`},{opacity:1,transform:"none"}],{duration:240,easing:wn})}}catch{}V()}},[g,d,V]);let Q=e.useCallback((e,t=false)=>{B.current={h0:A.current?.offsetHeight??0,back:t},v(e)},[]),G=e.useCallback((e,t=null,n=null)=>{if(!_){if(w(true),k(false),i({exit:e,toast:t,notifications:n}),e==="stay"){let e=L.current;e instanceof HTMLElement&&e.isConnected&&e.focus({preventScroll:true})}H(()=>a?.(),d?160:260)}},[_,i,a,H,d]),Z=e.useCallback(()=>G(s==="records"?"stay":"ask"),[G,s]),X=r.onUpload,J=e.useMemo(()=>X===void 0?void 0:()=>{G("stay"),X()},[X,G]),ee=e.useCallback(e=>G("plan",e?y.toast.on:y.toast.off,e),[G,y]),te=e.useCallback(async()=>{if(I)return;R(true);let e=false;try{r.onEnableNotifications!==void 0?e=await r.onEnableNotifications()===!0:e=(await createNotificationsClient(h).setPreferences({pushEnabled:!0,emailEnabled:!0})).ok}catch{e=false}R(false),ee(e)},[I,r,h,ee]);e.useEffect(()=>{if(_)return;let e=e=>{e.key!=="Escape"||e.defaultPrevented||(e.preventDefault(),g==="sent"?ee(false):Z())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[_,g,ee,Z]);let ne=e.useRef(null),re=e=>{let t=A.current;if(!(ne.current!==null||t===null||_||Sn(e.target,t,g))){ne.current={y:e.clientY,t:performance.now(),dy:0,id:e.pointerId};try{t.setPointerCapture(e.pointerId)}catch{}S(true)}},ie=e=>{let t=ne.current,n=A.current;if(t===null||n===null)return;let r=e.clientY-t.y;t.dy=r>0?r:r/4,n.style.transform=`translateY(${t.dy}px)`},ae=()=>{let e=ne.current,t=A.current;e!==null&&(ne.current=null,S(false),isIntroSwipeOut(e.dy,performance.now()-e.t)?Z():t!==null&&(t.style.transform="none"))},oe=e.useCallback(e=>{let t=E===null?"":E.clinic?.name??E.freeText??"",n={petRef:petRef,clinicName:t,requestId:e.id,at:/* @__PURE__ */(new Date).toISOString()};T(t),xn(gn,{petRef:n.petRef,requestId:n.requestId,at:n.at}),r.onRequested?.(n),Q("sent")},[E,petRef,r,Q]),se=g!=="tabs",le={"--in-t":`${D?.t??0}px`,"--in-h":`${D?.h??0}px`},de=g==="clinic"&&s!=="records"||g==="novet"||g==="consent",ce=g!=="sent",ue=u.button,pe=(e,t,r=false)=>t===""?null:/* @__PURE__ */n.jsx("p",{style:{...u.text,...e},...r?{ref:e=>{M.current=e},tabIndex:-1,id:U}:{},children:t}),he=e=>e===""?null:/* @__PURE__ */n.jsx("h3",{id:U,ref:e=>{M.current=e},tabIndex:-1,style:{...u.text,...c(".serif",".in-h")},children:e}),fe=(e,t,...r)=>/* @__PURE__ */n.jsx("button",{type:"button",style:{...ue,...c(".emb-btn",".in-body .emb-btn",...r)},onClick:t,children:e}),be=(e,t)=>/* @__PURE__ */n.jsx("button",{type:"button",style:{...ue,...c(".in-link")},onClick:t,children:e}),me=e=>{let t=l.meta.hidePoweredBy?null:/* @__PURE__ */n.jsxs("span",{style:c(".in-by"),children:[y.poweredBy,
|
|
41
41
|
/* @__PURE__ */n.jsx(EverfurWordmark,{style:c(".in-by svg")})]});return e===""&&t===null?null:/* @__PURE__ */n.jsxs("p",{style:{...u.text,...c(".in-eyebrow")},children:[e,t]})},ye=null;if(g==="tabs"){let e=[["ask","chat",".in-ic--y",r.tabLabels?.ask??"Ask",y.tabs.ask],["plan","heartcheck",".in-ic--c",r.tabLabels?.plan??"Health Plan",y.tabs.plan],["records","file",".in-ic--g",r.tabLabels?.records??"Records",y.tabs.records]];ye=/* @__PURE__ */n.jsxs(n.Fragment,{children:[me(y.tabs.eyebrow),he(y.tabs.title),pe(c(".in-p"),y.tabs.lede),
|
|
42
42
|
/* @__PURE__ */n.jsx("ul",{style:c(".in-rows"),children:e.map(([e,t,r,i,a])=>/* @__PURE__ */n.jsxs("li",{style:c(".in-rows li"),children:[
|
|
43
43
|
/* @__PURE__ */n.jsx("span",{style:c(".in-ic",r),children:/* @__PURE__ */n.jsx(IntroIcon,{name:t,style:c(".in-ic svg")})}),
|
|
@@ -60,14 +60,14 @@ return n.jsxs("li",{style:c(".sh-track li",".in-sent .sh-track li",o&&".sh-track
|
|
|
60
60
|
/* @__PURE__ */n.jsx("strong",{style:c(".sh-track strong",i===""&&".sh-track li:not(.is-done):not(.is-now) strong"),children:t}),r===""?null:/* @__PURE__ */n.jsx("small",{style:c(".sh-track small"),children:r})]})]},t)})})}),pe(c(".in-p"),y.sent.lede),
|
|
61
61
|
/* @__PURE__ */n.jsxs("div",{style:c(".in-stack"),children:[
|
|
62
62
|
/* @__PURE__ */n.jsxs("button",{type:"button",disabled:I,"aria-busy":I,style:{...ue,...c(".emb-btn",".emb-btn--block",".in-body .emb-btn")},onClick:()=>{te()},children:[
|
|
63
|
-
/* @__PURE__ */n.jsx(IntroIcon,{name:"bell",style:c(".emb-btn svg",".in-stack .emb-btn svg")}),y.sent.notify]}),fe(y.sent.notNow,()=>ee(false),".emb-btn--block",".emb-btn--ghost")]}),pe(c(".in-fine"),y.sent.fine)]})}else ye=/* @__PURE__ */n.jsxs(n.Fragment,{children:[me(y.tabs.eyebrow),he(y.noVet.title),pe(c(".in-p"),y.noVet.lede,y.noVet.title===""),fe(y.noVet.seePlan,()=>G("plan"),".emb-btn--block")]});let ge=/* @__PURE__ */n.jsxs("div",{ref:z,"data-everfur-intro":"","data-in-frame":
|
|
63
|
+
/* @__PURE__ */n.jsx(IntroIcon,{name:"bell",style:c(".emb-btn svg",".in-stack .emb-btn svg")}),y.sent.notify]}),fe(y.sent.notNow,()=>ee(false),".emb-btn--block",".emb-btn--ghost")]}),pe(c(".in-fine"),y.sent.fine)]})}else ye=/* @__PURE__ */n.jsxs(n.Fragment,{children:[me(y.tabs.eyebrow),he(y.noVet.title),pe(c(".in-p"),y.noVet.lede,y.noVet.title===""),fe(y.noVet.seePlan,()=>G("plan"),".emb-btn--block")]});let ge=/* @__PURE__ */n.jsxs("div",{ref:z,"data-everfur-intro":"","data-in-frame":_?"":g,style:{...u.root,...c(".ph-intro"),...le},children:[
|
|
64
64
|
/* @__PURE__ */n.jsx("div",{"aria-hidden":"true",style:c(".in-dim",".in-dim--top",x&&".ph-intro.is-on .in-dim--top")}),
|
|
65
65
|
/* @__PURE__ */n.jsx("div",{"aria-hidden":"true",style:c(".in-dim",".in-dim--mid",x&&se&&".ph-intro.is-on.is-all .in-dim--mid")}),
|
|
66
66
|
/* @__PURE__ */n.jsx("div",{"aria-hidden":"true",style:c(".in-dim",".in-dim--bot",x&&".ph-intro.is-on .in-dim--bot")}),
|
|
67
67
|
/* @__PURE__ */n.jsxs("section",{ref:A,role:"dialog","aria-modal":"true","aria-label":s==="intro"?y.sheetLabel.intro:y.sheetLabel.records,...g==="consent"?{}:{"aria-labelledby":U},"data-mode":s,style:c(".in-sheet",se&&".ph-intro.is-all .in-sheet",x&&".ph-intro.is-on .in-sheet",C&&".in-sheet.is-drag"),onPointerDown:re,onPointerMove:ie,onPointerUp:ae,onPointerCancel:ae,children:[
|
|
68
68
|
/* @__PURE__ */n.jsx("div",{"aria-hidden":"true",style:c(".in-grab")}),
|
|
69
69
|
/* @__PURE__ */n.jsxs("div",{style:c(".in-top",s==="records"&&'.in-sheet[data-mode="records"] .in-top'),children:[de?/* @__PURE__ */n.jsx("button",{type:"button","aria-label":y.back,style:{...ue,...c(".in-back")},onClick:()=>Q(g==="consent"?"clinic":"ask",true),children:/* @__PURE__ */n.jsx(IntroIcon,{name:"back",style:c(".in-back svg")})}):null,s==="intro"?/* @__PURE__ */n.jsx("div",{"aria-hidden":"true",style:c(".in-bars"),children:[0,1].map(e=>/* @__PURE__ */n.jsx("b",{style:c(".in-bars b"),children:/* @__PURE__ */n.jsx("span",{style:{display:"block",...c(".in-bars b::after",(e===0||se)&&".in-bars b.on::after")}})},e))}):null,ce&&s==="intro"?/* @__PURE__ */n.jsx("button",{type:"button",style:{...ue,...c(".in-skip")},onClick:Z,children:y.skip}):null,ce&&s==="records"?/* @__PURE__ */n.jsx("button",{type:"button","aria-label":y.close,style:{...ue,...c(".in-x")},onClick:Z,children:/* @__PURE__ */n.jsx(IntroIcon,{name:"x",style:c(".in-x svg")})}):null]}),
|
|
70
|
-
/* @__PURE__ */n.jsx("div",{ref:N,style:c(".in-body"),children:ye})]})]});return r.container?t.createPortal(ge,r.container):ge}var Fn=6e3;function EverfurRecordsLandedBanner({text:t,icon:r,onLand:i}){let a=useEverfurTheme(),o=e.useMemo(()=>Wt(a,kn,
|
|
70
|
+
/* @__PURE__ */n.jsx("div",{ref:N,style:c(".in-body"),children:ye})]})]});return r.container?t.createPortal(ge,r.container):ge}var Fn=6e3;function EverfurRecordsLandedBanner({text:t,icon:r,onLand:i}){let a=useEverfurTheme(),o=e.useMemo(()=>Wt(a,kn,_n),[a]),s=e.useMemo(()=>Ht(a),[a]),[l,d]=e.useState(false),c=e.useRef(false),u=e.useRef(i);return u.current=i,e.useEffect(()=>{let e=requestAnimationFrame(()=>d(true)),t=setTimeout(()=>{c.current||(c.current=true,u.current())},Fn);return()=>{cancelAnimationFrame(e),clearTimeout(t)}},[]),/* @__PURE__ */n.jsxs("button",{type:"button","data-everfur-records-banner":"",style:{...s.root,...s.button,...o(".ph-banner",l&&".ph-banner.is-on")},onClick:()=>{c.current||(c.current=true,i())},children:[
|
|
71
71
|
/* @__PURE__ */n.jsx("span",{"aria-hidden":"true",style:o(".ph-banner__app"),children:r}),
|
|
72
72
|
/* @__PURE__ */n.jsxs("span",{children:[
|
|
73
73
|
/* @__PURE__ */n.jsxs("span",{style:o(".ph-banner__meta"),children:[t.app===""?/* @__PURE__ */n.jsx("span",{}):/* @__PURE__ */n.jsx("strong",{style:o(".ph-banner__meta strong"),children:t.app}),
|