@everfur/sdk 1.6.0 → 1.7.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/dist/{Chat.d-B4GybUU4.d.ts → Chat.d-BIr_4AJt.d.ts} +1 -1
- package/dist/{Chat.d-DPM2ncxi.d.cts → Chat.d-BhevtXn9.d.cts} +1 -1
- package/dist/{DepthViews.d-BGspxovy.d.cts → DepthViews.d-C8KdfzwR.d.cts} +1 -1
- package/dist/{DepthViews.d-BaLh7Lsi.d.cts → DepthViews.d-DWQ-J208.d.cts} +1 -1
- package/dist/{DepthViews.d-BIHVrf9r.d.ts → DepthViews.d-DYVUq4Xk.d.ts} +1 -1
- package/dist/{DepthViews.d-CEVk9poG.d.ts → DepthViews.d-oKr9R0Ql.d.ts} +1 -1
- package/dist/{IntakeMedia.d-CwSkSLNM.d.ts → IntakeMedia.d-B-ZZK6vd.d.ts} +1 -1
- package/dist/{IntakeMedia.d-LRXO38_z.d.cts → IntakeMedia.d-CuVkzIsO.d.cts} +1 -1
- package/dist/{IntakeMedia.d-DmaeGU6T.d.cts → IntakeMedia.d-CyF6NPHx.d.cts} +1 -1
- package/dist/{IntakeMedia.d-Dyb9R8b0.d.ts → IntakeMedia.d-vU8g9OM5.d.ts} +1 -1
- package/dist/{RecordsPage.d-D10RIgdc.d.ts → RecordsPage.d-DU8Nswzh.d.ts} +1 -1
- package/dist/{RecordsPage.d-DbhYNSbq.d.cts → RecordsPage.d-DzPhqMHW.d.cts} +1 -1
- package/dist/animations/index.d.cts +3 -3
- package/dist/animations/index.d.ts +3 -3
- package/dist/{attachments.d-CF4lLuGK.d.cts → attachments.d-0nOPDIng.d.cts} +1 -1
- package/dist/{attachments.d-BlukNfIf.d.ts → attachments.d-BlyI-RCY.d.ts} +1 -1
- package/dist/{bookingCopy.d-Bn8bdo89.d.ts → bookingCopy.d-ClL8OxBS.d.ts} +3 -3
- package/dist/{bookingCopy.d-Dg7bPM-U.d.cts → bookingCopy.d-DUVqhF5f.d.cts} +3 -3
- package/dist/{branding.d-XrZYClN4.d.ts → branding.d-D0LV3aFE.d.ts} +1 -1
- package/dist/{branding.d-CqDLKj1U.d.cts → branding.d-DzSPLZKl.d.cts} +1 -1
- package/dist/{casesRepository.d-CVuKTkJo.d.cts → casesRepository.d-DnanKXJ1.d.cts} +1 -1
- package/dist/{casesRepository.d-Dn1fK1b2.d.ts → casesRepository.d-_4QucKVC.d.ts} +1 -1
- package/dist/chat/index.cjs +239 -238
- package/dist/chat/index.d.cts +11 -11
- package/dist/chat/index.d.ts +11 -11
- package/dist/chat/index.js +241 -240
- package/dist/chat/lite/index.cjs +239 -238
- package/dist/chat/lite/index.d.cts +11 -11
- package/dist/chat/lite/index.d.ts +11 -11
- package/dist/chat/lite/index.js +239 -238
- package/dist/chat-cards/index.cjs +2 -2
- package/dist/chat-cards/index.js +9 -9
- package/dist/{chatHandoffToken.d-zdp23Ukr.d.ts → chatHandoffToken.d-BoZGGbIB.d.ts} +5 -5
- package/dist/{chatHandoffToken.d-Cap2z62P.d.cts → chatHandoffToken.d-DhhGdLNH.d.cts} +5 -5
- package/dist/{checkin.d-CuIUahcd.d.cts → checkin.d-DB-HlK7r.d.cts} +9 -4
- package/dist/{checkin.d-BoZXWjxX.d.ts → checkin.d-DogrR06X.d.ts} +9 -4
- package/dist/{chunk-LMIBOI3I.js → chunk-6E3J6IVM.js} +13 -13
- package/dist/{chunk-6AIEUA4V.js → chunk-J5ZUBY3S.js} +1 -1
- package/dist/{chunk-BN7OAFBS.js → chunk-LPHBCDJP.js} +21 -21
- package/dist/{chunk-IXHLESYC.js → chunk-ULQDOC75.js} +1 -1
- package/dist/client/index.cjs +28 -27
- package/dist/client/index.d.cts +13 -13
- package/dist/client/index.d.ts +13 -13
- package/dist/client/index.js +25 -24
- package/dist/{clinicBatch.d-C0xx5L4j.d.cts → clinicBatch.d-BvPF6vXS.d.cts} +2 -2
- package/dist/{clinicBatch.d-DNi4UURs.d.ts → clinicBatch.d-CF0GIvpx.d.ts} +2 -2
- package/dist/{config.d-B7Z-KTGq.d.ts → config.d-Bc41Ax6M.d.ts} +5 -1
- package/dist/{config.d-ClAI2RZ6.d.cts → config.d-Bn6GEGfl.d.cts} +5 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/{context.d-D7zX6Q0J.d.ts → context.d-0QfLaI3W.d.ts} +5 -5
- package/dist/{context.d-guaLkx5t.d.cts → context.d-CyQpedoU.d.cts} +5 -5
- package/dist/{copy.d--F5A9cXK.d.cts → copy.d-B55PpLxr.d.cts} +2 -2
- package/dist/{copy.d-DmxuFJFe.d.ts → copy.d-B8wIE6cH.d.ts} +2 -2
- package/dist/core/index.cjs +32 -31
- package/dist/core/index.d.cts +22 -16
- package/dist/core/index.d.ts +22 -16
- package/dist/core/index.js +37 -36
- package/dist/{depth.d-CgzYE6_n.d.ts → depth.d-CrtZXnLy.d.ts} +2 -2
- package/dist/{depth.d-DLaP0o8Y.d.cts → depth.d-Cxz6VisZ.d.cts} +2 -2
- package/dist/{entitlementRepository.d-CkUTlVAb.d.ts → entitlementRepository.d-BaZTIe1B.d.ts} +3 -3
- package/dist/{entitlementRepository.d-DVTp-BB9.d.cts → entitlementRepository.d-YeNG2TKI.d.cts} +3 -3
- package/dist/{focus.d-u-HYvim0.d.ts → focus.d-520VEHKB.d.ts} +1 -1
- package/dist/{focus.d-CLTjm6In.d.cts → focus.d-DoempN1I.d.cts} +1 -1
- package/dist/health-plan/index.cjs +236 -235
- package/dist/health-plan/index.d.cts +15 -15
- package/dist/health-plan/index.d.ts +15 -15
- package/dist/health-plan/index.js +236 -235
- package/dist/{healthPlanRepository.d-CwRXeoM7.d.ts → healthPlanRepository.d-BHu9LO0r.d.ts} +2 -2
- package/dist/{healthPlanRepository.d-B22kjrYa.d.cts → healthPlanRepository.d-tUR1f_5s.d.cts} +2 -2
- package/dist/{idempotency.d-DrxKLPPe.d.cts → idempotency.d-CcFLvzYW.d.cts} +1 -1
- package/dist/{idempotency.d-CbB07p64.d.ts → idempotency.d-CvqKG3Uq.d.ts} +1 -1
- package/dist/{identity.d-D4VtpqRr.d.ts → identity.d-Bex_XJZx.d.ts} +1 -1
- package/dist/{identity.d-DDpXOtas.d.cts → identity.d-Dm0Buvn8.d.cts} +1 -1
- package/dist/{inbox.d-B2JXK0uI.d.ts → inbox.d-9ajb0oiJ.d.ts} +1 -1
- package/dist/{inbox.d-CwA1ogzV.d.cts → inbox.d-CGCYOZIq.d.cts} +1 -1
- package/dist/index.cjs +259 -258
- package/dist/index.d.cts +17 -17
- package/dist/index.d.ts +17 -17
- package/dist/index.js +258 -257
- package/dist/{introEvents.d-DW3gLljE.d.ts → introEvents.d-CuVaufTy.d.ts} +1 -1
- package/dist/{introEvents.d-B7acmGwf.d.cts → introEvents.d-DU6feqx4.d.cts} +1 -1
- package/dist/{layout.d-C8y_ki1V.d.ts → layout.d-BQ5IVS-m.d.ts} +1 -1
- package/dist/{layout.d-DfaFM_lp.d.cts → layout.d-CSPr33BP.d.cts} +1 -1
- package/dist/notifications/inbox/index.d.cts +6 -6
- package/dist/notifications/inbox/index.d.ts +6 -6
- package/dist/notifications/index.d.cts +7 -7
- package/dist/notifications/index.d.ts +7 -7
- package/dist/{optInView.d-Cps7aLQN.d.ts → optInView.d-DpGXnpGw.d.ts} +21 -3
- package/dist/{optInView.d-ChJyJMBA.d.cts → optInView.d-dLjrI3co.d.cts} +21 -3
- package/dist/{pets.d-BpLObpfM.d.ts → pets.d-CHdSIoBf.d.ts} +1 -1
- package/dist/{pets.d-DXhzTNuI.d.cts → pets.d-jnhrJhqm.d.cts} +1 -1
- package/dist/{petsRepository.d-ai_tZ3lu.d.cts → petsRepository.d-BeKRiNao.d.cts} +1 -1
- package/dist/{petsRepository.d-_QfM7F6T.d.ts → petsRepository.d-BjwB1vku.d.ts} +1 -1
- package/dist/{presentation.d-BkIvMtIl.d.cts → presentation.d-Br3TnwA6.d.cts} +17 -1
- package/dist/{presentation.d-BkIvMtIl.d.ts → presentation.d-Br3TnwA6.d.ts} +17 -1
- package/dist/records/depth/index.d.cts +9 -9
- package/dist/records/depth/index.d.ts +9 -9
- package/dist/records/index.cjs +237 -228
- package/dist/records/index.d.cts +39 -12
- package/dist/records/index.d.ts +39 -12
- package/dist/records/index.js +155 -146
- package/dist/{requestFunnel.d-DKBPTpsy.d.ts → requestFunnel.d-C_NMgz9R.d.ts} +2 -2
- package/dist/{requestFunnel.d-BwZDfWVD.d.cts → requestFunnel.d-DoJWLySc.d.cts} +2 -2
- package/dist/{route.d-QBCoO62z.d.cts → route.d-BW2abFVK.d.cts} +2 -2
- package/dist/{route.d-B3u14HJT.d.ts → route.d-Olr_gXaa.d.ts} +2 -2
- package/dist/{runtimeTypes.d-hjN6xvxm.d.ts → runtimeTypes.d-Bp2VW6YE.d.ts} +6 -6
- package/dist/{runtimeTypes.d-BSxuUCOX.d.cts → runtimeTypes.d-StvJY45N.d.cts} +6 -6
- package/dist/{screenProps.d-fHBKArt_.d.ts → screenProps.d-BTLSji0N.d.ts} +1 -1
- package/dist/{screenProps.d-6xmE1C-V.d.cts → screenProps.d-B_5Bh7aQ.d.cts} +1 -1
- package/dist/server/events/index.cjs +2 -2
- package/dist/server/events/index.d.cts +19 -5
- package/dist/server/events/index.d.ts +19 -5
- package/dist/server/events/index.js +2 -2
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +1 -1
- package/dist/shop/index.d.cts +3 -3
- package/dist/shop/index.d.ts +3 -3
- package/dist/slots/index.cjs +200 -199
- package/dist/slots/index.d.cts +5 -5
- package/dist/slots/index.d.ts +5 -5
- package/dist/slots/index.js +200 -199
- package/dist/tabs/index.cjs +200 -190
- package/dist/tabs/index.d.cts +68 -11
- package/dist/tabs/index.d.ts +68 -11
- package/dist/tabs/index.js +201 -191
- package/dist/tabs-bar/index.cjs +247 -0
- package/dist/tabs-bar/index.d.cts +10 -0
- package/dist/tabs-bar/index.d.ts +10 -0
- package/dist/tabs-bar/index.js +247 -0
- package/dist/{tabsModel.d-D9GWPFrL.d.ts → tabsModel.d-B4MSQB57.d.cts} +5 -2
- package/dist/{tabsModel.d-D9GWPFrL.d.cts → tabsModel.d-C8pd-DP3.d.ts} +5 -2
- package/dist/televet/booking/index.cjs +147 -145
- package/dist/televet/booking/index.d.cts +10 -10
- package/dist/televet/booking/index.d.ts +10 -10
- package/dist/televet/booking/index.js +163 -161
- package/dist/televet/call/index.cjs +52 -52
- package/dist/televet/call/index.d.cts +5 -0
- package/dist/televet/call/index.d.ts +5 -0
- package/dist/televet/call/index.js +25 -25
- package/dist/televet/index.d.cts +3 -3
- package/dist/televet/index.d.ts +3 -3
- package/dist/{televetGlobal.d-gZrXPaLl.d.cts → televetGlobal.d-B_I_fy7O.d.cts} +9 -0
- package/dist/{televetGlobal.d-DkJkV55Y.d.ts → televetGlobal.d-DN7o45WJ.d.ts} +9 -0
- package/dist/testing/index.cjs +3 -3
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +3 -3
- package/dist/testing/rn/index.d.cts +9 -9
- package/dist/testing/rn/index.d.ts +9 -9
- package/dist/testing/web/index.d.cts +9 -9
- package/dist/testing/web/index.d.ts +9 -9
- package/dist/texting/index.cjs +32 -27
- package/dist/texting/index.d.cts +5 -5
- package/dist/texting/index.d.ts +5 -5
- package/dist/texting/index.js +52 -47
- package/dist/{threadOptions.d-NSlFx-Lp.d.ts → threadOptions.d-D_3hk79R.d.ts} +5 -5
- package/dist/{threadOptions.d-Dc57dm7h.d.cts → threadOptions.d-D_GU6lp9.d.cts} +5 -5
- package/dist/{timelineRows.d-CthNM5hV.d.ts → timelineRows.d-BbVuARtc.d.ts} +1 -1
- package/dist/{timelineRows.d-7w8NsNi4.d.cts → timelineRows.d-BiLAAbYl.d.cts} +1 -1
- package/dist/{typeStyle.d-8mcLhtbH.d.ts → typeStyle.d-DSk99BuZ.d.ts} +1 -1
- package/dist/{typeStyle.d-CLrQZW-r.d.cts → typeStyle.d-DqR6mWCF.d.cts} +1 -1
- package/dist/{useHealthPlanSubscription.d-CV7M21HS.d.ts → useHealthPlanSubscription.d-CpE6l1VW.d.ts} +3 -3
- package/dist/{useHealthPlanSubscription.d-SA9-SuKe.d.cts → useHealthPlanSubscription.d-DRiWDJXq.d.cts} +3 -3
- package/dist/{useInboxUnread.d-0DrQPn7J.d.ts → useInboxUnread.d-BV7PkWDH.d.ts} +1 -1
- package/dist/{useInboxUnread.d-CRcOTkmu.d.cts → useInboxUnread.d-CElyXBkY.d.cts} +1 -1
- package/dist/{usePresentation.d-BJzFicRQ.d.cts → usePresentation.d-BcazazQH.d.cts} +3 -3
- package/dist/{usePresentation.d-DgSGIWS-.d.ts → usePresentation.d-CMOypLlH.d.ts} +3 -3
- package/dist/{useRecordsDepth.d-ZX2rhcUx.d.ts → useRecordsDepth.d-Bka4KQhq.d.ts} +1 -1
- package/dist/{useRecordsDepth.d-C9W45gwS.d.cts → useRecordsDepth.d-TgmpxKdX.d.cts} +1 -1
- package/dist/{useUnread.d-4SbFChbd.d.ts → useUnread.d-CGqaP-dB.d.ts} +27 -5
- package/dist/{useUnread.d-B0YhhR_D.d.cts → useUnread.d-DVVnYNPU.d.cts} +27 -5
- package/dist/{view.d-3lxzyJlL.d.cts → view.d-CwruYhQy.d.cts} +3 -3
- package/dist/{view.d-DRiYNQJ8.d.ts → view.d-DamH8TQF.d.ts} +3 -3
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/health-plan/index.cjs +9 -8
- package/dist/web/health-plan/index.d.cts +16 -16
- package/dist/web/health-plan/index.d.ts +16 -16
- package/dist/web/health-plan/index.js +49 -48
- package/dist/web/inbox/index.d.cts +7 -7
- package/dist/web/inbox/index.d.ts +7 -7
- package/dist/web/index.cjs +185 -184
- package/dist/web/index.d.cts +32 -32
- package/dist/web/index.d.ts +32 -32
- package/dist/web/index.js +187 -186
- package/dist/web/intro/index.d.cts +7 -7
- package/dist/web/intro/index.d.ts +7 -7
- package/dist/web/notifications/index.d.cts +6 -6
- package/dist/web/notifications/index.d.ts +6 -6
- package/dist/web/records/depth/index.d.cts +9 -9
- package/dist/web/records/depth/index.d.ts +9 -9
- package/dist/web/records/index.d.cts +11 -11
- package/dist/web/records/index.d.ts +11 -11
- package/dist/web/records-sheet/index.cjs +111 -110
- package/dist/web/records-sheet/index.js +111 -110
- 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 +1 -1
- package/dist/web/televet/booking/index.cjs +3 -3
- package/dist/web/televet/booking/index.d.cts +10 -10
- package/dist/web/televet/booking/index.d.ts +10 -10
- package/dist/web/televet/booking/index.js +69 -69
- package/dist/web/televet/call/index.cjs +1 -1
- package/dist/web/televet/call/index.js +1 -1
- package/dist/web/televet/index.d.cts +3 -3
- package/dist/web/televet/index.d.ts +3 -3
- package/dist/web/texting/index.cjs +34 -29
- package/dist/web/texting/index.d.cts +5 -5
- package/dist/web/texting/index.d.ts +5 -5
- package/dist/web/texting/index.js +45 -40
- package/dist/web/ui/index.cjs +1 -1
- package/dist/web/ui/index.js +33 -33
- package/package.json +16 -1
- package/tabs-bar/package.json +8 -0
package/dist/records/index.js
CHANGED
|
@@ -12,7 +12,7 @@ return Object.freeze({petRef:petRef,schemaVersion:e,isEmpty:false,withheld:true,
|
|
|
12
12
|
return Object.freeze({petRef:typeof r.pet_ref=="string"&&r.pet_ref.length>0?r.pet_ref:petRef,granted:r.granted===true,version:r.version??null,grantedAt:r.granted_at??null})}var lt=/* @__PURE__ */u.object({granted:/* @__PURE__ */u.boolean().optional(),version:/* @__PURE__ */u.string().nullish(),granted_at:/* @__PURE__ */u.string().nullish(),pets:/* @__PURE__ */u.array(/* @__PURE__ */u.unknown()).optional()});function ot(e){let t=lt.safeParse(e),r=t.success?t.data:{};/* @__PURE__ */
|
|
13
13
|
return Object.freeze({scope:"all_pets",granted:r.granted===true,version:r.version??null,grantedAt:r.granted_at??null,pets:/* @__PURE__ */Object.freeze((r.pets??[]).map(e=>it("",e)).filter(e=>e.petRef))})}function at(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function st(e,t){return typeof e=="string"&&e.length>0?e:t}function dt(e){return typeof e=="string"&&e.length>0?e:null}var ct=/* @__PURE__ */Object.freeze(["published","failed","revoked"]);function isTerminalStatus(e){return ct.includes(e)}function recordsDenialReasonOf(e){if(e===null)return null;let t=e.recordsReason;return t==="consent_required"||t==="session_required"||t==="entitlement"||t==="pet_not_found"?t:null}var ut="records_consent_required";function ht(e){let t=e.raw;if(t===null||typeof t!="object")return null;let r=t,n=typeof r.error=="object"&&r.error!==null?r.error.code:r.code;return typeof n=="string"&&n.length>0?n:null}function pt(e){return e===null||e.httpStatus!==409?false:ht(e)===ut}var gt=/* @__PURE__ */Object.freeze({postMultipart(){return Promise.reject(new Error("UploadTransport is unavailable; no records upload adapter was injected"))}});function ft(e){return e!==gt}var mt=/* @__PURE__ */Object.freeze({record(){}}),bt=25*1024*1024,yt=64,vt=128,wt=128;var kt=9e4;function xt(e,t){let r=!t[0]&&e.length>0&&e.every(e=>e.granted);/* @__PURE__ */
|
|
14
14
|
return Object.freeze({scope:"all_pets",granted:r,version:r?e[0]?.version??null:null,grantedAt:null,pets:/* @__PURE__ */Object.freeze(e),...t[0]?{failed:/* @__PURE__ */Object.freeze(t)}:{}})}function Tt(e){return new Ct(e)}var Ct=class{constructor(e){this.recordCache=/* @__PURE__ */new Map;this.consentEpoch=/* @__PURE__ */new Map;this.reportedGaps=/* @__PURE__ */new Set;this.features=De;this.repository=e.repository,this.uploads=e.uploads,this.telemetry=e.telemetry??mt,this.newIdempotencyKey=e.newIdempotencyKey??Ht(),this.timers=e.timers??It,this.uploadDeadlineMs=e.uploadDeadlineMs??kt}async createUploadRequest(e){let t=await this.repository.createRequest({pet_ref:e.petRef,idempotency_key:e.idempotencyKey});if(!t.ok)return this.onRequestError(t.error);let r=Ee(t.value);return r===null?err(zt()):(this.observeRequest(r),ok(r))}async getRequest(e){let t=await this.repository.getRequest(e);if(!t.ok)return this.onRequestError(t.error);let r=Ee(t.value);return r===null?err(zt()):(this.observeRequest(r),ok(r))}async listRequests(){let e=await this.repository.listRequests();if(!e.ok)return this.onRequestError(e.error);let t=Ne(e.value);for(let e of t)this.observeRequest(e);return ok(t)}async readFeatures(){let e=this.repository.getFeatures;if(e===void 0)return this.features=De;let t=De;try{let r=await e.call(this.repository);r.ok&&(t=Le(r.value))}catch{}return this.features=t,t}async uploadDocument(e){let{requestId:t,file:r}=e,n=_t(r,this.features.uploadContentTypes);if(n!==null)return this.telemetry.record("records.upload.rejected",{reason:n}),err(St(`upload rejected: ${n}`));let i=await this.repository.initiateUpload(t,{content_type:r.mimeType,file_size:r.sizeBytes});if(!i.ok)return this.onRequestError(i.error);let l=await this.postToS3(i.value,r,e);if(!l.ok)return this.telemetry.record("records.upload.failed",{reason:l.reason}),err(St(l.reason));let o=await this.repository.completeUpload(t,{upload_id:i.value.upload_id});if(!o.ok)return o.error.code==="mediaUploadFailed"&&this.telemetry.record("records.upload.rejected",{reason:Rt(o.error)??"corrupt"}),this.onRequestError(o.error);let a=Ue(o.value);return a===null?err(zt()):ok(a)}async postToS3(e,t,r){let n=new AbortController,i=Dt(n.signal,r.signal),l=this.timers.setTimeout(()=>n.abort(),this.uploadDeadlineMs);try{let n={signal:i};return r.onProgress&&(n.onProgress=r.onProgress),await this.uploads.postMultipart(e,t,n),{ok:!0}}catch{return{ok:false,reason:n.signal.aborted&&r.signal?.aborted!==true?"timeout":"upload_error"}}finally{this.timers.clearTimeout(l)}}async getRecord(e){let t=this.consentEpoch.get(e)??0,r=await this.repository.getRecord(e);if(t!==(this.consentEpoch.get(e)??0))return err(/* @__PURE__ */Object.freeze({...makeEverfurError("accessDenied",{retryable:false}),recordsReason:"consent_required"}));if(!r.ok){let t=recordsDenialReasonOf(r.error);return t==="consent_required"?(this.recordCache.delete(e),this.telemetry.record("records.consent.denied",{pet_ref:e})):t==="entitlement"&&this.telemetry.record("records.capability.denied",{pet_ref:e}),err(r.error)}let n=tt(e,r.value);return n.petRef!==e?err(zt()):n.withheld?(this.telemetry.record("records.redaction.withheld",{pet_ref:e}),this.recordCache.delete(e),ok(n)):(this.recordCache.set(e,n),ok(n))}peekCachedRecord(e){return this.recordCache.get(e)??null}async getConsent(e){let t=await this.repository.getConsent(e);return t.ok?ok(it(e,t.value)):err(t.error)}async grantConsent(e){let t=await this.repository.putConsent(e.petRef,{consent_version:e.consentVersion,idempotency_key:e.idempotencyKey});return t.ok?ok(it(e.petRef,t.value)):(recordsDenialReasonOf(t.error)==="entitlement"&&this.telemetry.record("records.capability.denied",{pet_ref:e.petRef}),err(t.error))}async revokeConsent(e){let t=await this.repository.deleteConsent(e);return t.ok?(this.consentEpoch.set(e,(this.consentEpoch.get(e)??0)+1),this.recordCache.delete(e),ok(it(e,t.value))):err(t.error)}async getMemberConsent(){let e=await(this.repository.getMemberConsent?.());return e?e.ok?ok(ot(e.value)):e:err(makeEverfurError("resourceNotFound",{retryable:false,httpStatus:404}))}grantConsentAllPets(e){return this.allPets(e,true)}revokeConsentAllPets(e){return this.allPets(e,false)}async allPets(e,t){let{petRef:petRef,consentVersion:r,idempotencyKey:n}=e,i=await(t?this.repository.putMemberConsent?.({consent_version:r,idempotency_key:n}):this.repository.deleteMemberConsent?.());if(i?.ok){let r=ot(i.value);if(!t){let t=/* @__PURE__ */new Set([petRef,...this.recordCache.keys(),...r.pets.map(e=>e.petRef)]);for(let e of t)this.consentEpoch.set(e,(this.consentEpoch.get(e)??0)+1);this.recordCache.clear();for(let r of t)e.onRevoked?.(r)}return ok(r)}if(i&&i.error.httpStatus!==404&&i.error.httpStatus!==405)return t&&recordsDenialReasonOf(i.error)==="entitlement"&&this.telemetry.record("records.capability.denied",{pet_ref:petRef}),i;let l;try{l=e.listPetRefs?ok(await e.listPetRefs()):await(this.repository.listPetRefs?.())??err(makeEverfurError("notImplemented",{retryable:!1}))}catch{l=err(makeEverfurError("internalError"))}let o=[],a=[];for(let i of l.ok?/* @__PURE__ */new Set([petRef,...l.value]):[petRef]){let l=await(t?this.grantConsent({petRef:i,consentVersion:r,idempotencyKey:n}):this.revokeConsent(i));if(l.ok)t||e.onRevoked?.(i);else{if(t&&i===petRef)return l;a.push(/* @__PURE__ */Object.freeze({petRef:i,error:l.error}))}o.push(l.ok?l.value:it(i,null))}let s=t?null:a[0]?.error??(l.ok?null:l.error);return s?err(s):ok(xt(o,a))}reportCapabilityDenied(e){this.telemetry.record("records.capability.denied",e?{pet_ref:e}:{})}observeRequest(e){e.reviewStartedAt!==null&&!this.reportedGaps.has(e.id)&&(this.reportedGaps.add(e.id),this.telemetry.record("records.parse.gap",{request_id:e.id}))}onRequestError(e){return recordsDenialReasonOf(e)==="entitlement"&&this.telemetry.record("records.capability.denied",{}),err(e)}};function _t(e,t){if(!Ie(e.mimeType,t))return"unsupported_format";let r=e.sizeBytes;return typeof r!="number"||!Number.isFinite(r)||r<=0||r>bt?"oversize":null}function Rt(e){let t=e.wireMessage;return t==="unsupported_format"||t==="oversize"||t==="corrupt"?t:null}function St(e){return makeEverfurError("mediaUploadFailed",{retryable:false,wireMessage:e})}function zt(){return makeEverfurError("internalError",{retryable:true})}var It={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)};function Dt(e,t){if(!t)return e;let r=new AbortController;if(e.aborted||t.aborted)return r.abort(),r.signal;let n=()=>r.abort();return e.addEventListener("abort",n,{once:true}),t.addEventListener("abort",n,{once:true}),r.signal}function Ht(){let e=0;return()=>`records-${Date.now().toString(36)}-${(e++).toString(36)}-${Math.random().toString(36).slice(2,10)}`}function assertNever(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}function errorFrame(e){/* @__PURE__ */
|
|
15
|
-
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 Lt="x-everfur-anon-token",Pt="anonTokenInvalid";async function Ot(e){if(e.userRef!==null||e.anonIdentity===void 0)return null;try{return await e.anonIdentity.token()}catch{return null}}function $t(e,t){let r=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}:{},...r?{wireMessage:r}:{},...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[Lt]=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:{...Bt(e.headers),...authHeaders(t)}}}function Bt(e){if(!e)return{};let t={};for(let[r,n]of Object.entries(e)){let e=r.toLowerCase();e==="authorization"||e==="x-everfur-partner-key"||e===Lt||(t[r]=n)}return t}async function authedSend(e,t){if(t.mode==="anonymous"){let r=await Ot(t),n=await t.transport.request(withAuthHeaders(e,jt(t,r)));if(n.ok||Et(n.error.raw)!==Pt||t.anonIdentity===void 0||t.userRef!==null)return n;let i=await t.anonIdentity.token({forceRefresh:true});return i===null||i===r?n:t.transport.request(withAuthHeaders(e,jt(t,i)))}let r;try{r=await t.identity.currentToken()}catch(e){return t.identity.reportRejected?.(),err($t(e))}let n=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:r,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let i;try{i=await t.identity.currentToken({forceRefresh:!0})}catch(e){return t.identity.reportRejected?.(),err($t(e,{wireCode:Et(n.error.raw),requestId:n.error.requestId}))}let l=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:i,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return!l.ok&&l.error.httpStatus===401?(t.identity.reportRejected?.(),err(At(l.error))):l}function jt(e,t){return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}function At(e){let t=e.raw,r=Et(t);return makeEverfurError("authRejected",{retryable:false,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId?{requestId:e.requestId}:{},...r?{wireCode:r}:{},...e.reasonCode?{reasonCode:e.reasonCode}:{},...e.wireMessage?{wireMessage:e.wireMessage}:{},...t!=null?{raw:t}:{}})}function Et(e){if(typeof e!="object"||e===null)return null;let t=e,r=(typeof t.error=="object"&&t.error!==null?t.error.code:void 0)??t.code;return typeof r=="string"&&r.length>0?r:null}var Ft="1.
|
|
15
|
+
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 Lt="x-everfur-anon-token",Pt="anonTokenInvalid";async function Ot(e){if(e.userRef!==null||e.anonIdentity===void 0)return null;try{return await e.anonIdentity.token()}catch{return null}}function $t(e,t){let r=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}:{},...r?{wireMessage:r}:{},...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[Lt]=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:{...Bt(e.headers),...authHeaders(t)}}}function Bt(e){if(!e)return{};let t={};for(let[r,n]of Object.entries(e)){let e=r.toLowerCase();e==="authorization"||e==="x-everfur-partner-key"||e===Lt||(t[r]=n)}return t}async function authedSend(e,t){if(t.mode==="anonymous"){let r=await Ot(t),n=await t.transport.request(withAuthHeaders(e,jt(t,r)));if(n.ok||Et(n.error.raw)!==Pt||t.anonIdentity===void 0||t.userRef!==null)return n;let i=await t.anonIdentity.token({forceRefresh:true});return i===null||i===r?n:t.transport.request(withAuthHeaders(e,jt(t,i)))}let r;try{r=await t.identity.currentToken()}catch(e){return t.identity.reportRejected?.(),err($t(e))}let n=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:r,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let i;try{i=await t.identity.currentToken({forceRefresh:!0})}catch(e){return t.identity.reportRejected?.(),err($t(e,{wireCode:Et(n.error.raw),requestId:n.error.requestId}))}let l=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:i,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return!l.ok&&l.error.httpStatus===401?(t.identity.reportRejected?.(),err(At(l.error))):l}function jt(e,t){return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}function At(e){let t=e.raw,r=Et(t);return makeEverfurError("authRejected",{retryable:false,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId?{requestId:e.requestId}:{},...r?{wireCode:r}:{},...e.reasonCode?{reasonCode:e.reasonCode}:{},...e.wireMessage?{wireMessage:e.wireMessage}:{},...t!=null?{raw:t}:{}})}function Et(e){if(typeof e!="object"||e===null)return null;let t=e,r=(typeof t.error=="object"&&t.error!==null?t.error.code:void 0)??t.code;return typeof r=="string"&&r.length>0?r:null}var Ft="1.7.0";function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:qt(e)})}function qt(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var Mt=3e4,Nt=Q*2,Wt="idempotency-key",Ut=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),Gt=/* @__PURE__ */Object.freeze({onEvent(){}}),Vt=/* @__PURE__ */Object.freeze({setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),now:()=>Date.now()});function Kt(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??Gt,r=e.timers??Vt,n=e.rng??Math.random,i=e.sleep??((e,t)=>cr(e,r,t)),l=e.maxAttempts??J,o=e.unaryTimeoutMs??Mt,a=e.newIdempotencyKey??Xt(),s=e=>{try{t.onEvent(e)}catch{}};async function d(t,d,c){let u=c?.maxAttempts,h=Math.max(1,u??l),p=c?.idempotent??Ut.has(d.method),g=c?.idempotencyKey===void 0?null:Kt(c.idempotencyKey),f=p?g??a():null,m=Yt(d,f),b=0;for(;;){let l=e=>/* @__PURE__ */Object.freeze({call:t,method:d.method,path:d.path,attempt:b,...f?{idempotencyKey:f}:{},...e});s(l({phase:"attempt"}));let a=sr(o,r),c=dr(a.signal,d.signal),p;try{p=await authedSend({...m,signal:c.signal},e.auth)}catch(e){p=err(networkError(e))}finally{c.dispose(),a.cancel()}if(p.ok)return s(l({phase:"settled",ok:true,reason:"ok"})),p;let g=p.error,y=Jt(g,b,{maxAttempts:h,rng:n,now:r.now(),aborted:d.signal?.aborted===true,...u!==void 0?{perCallMaxAttempts:u}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),v={ok:false,code:g.code,reason:y.reason,...g.httpStatus!==void 0?{httpStatus:g.httpStatus}:{},...g.requestId!==void 0?{requestId:g.requestId}:{}};if(!y.retry)return s(l({phase:"settled",...v})),err(g);if(s(l({phase:"retry",...v,delayMs:y.delayMs})),await i(y.delayMs,d.signal),d.signal?.aborted===true)return s(l({phase:"settled",...v,reason:"aborted"})),err(g);b+=1}}async function c(t){return withAuthHeaders(t,await ar(e.auth))}async function*u(t,r,n){s(
|
|
16
16
|
/* @__PURE__ */Object.freeze({call:t,phase:"stream.open",method:r.method,path:r.path,attempt:0}));try{yield*e.auth.transport.stream(r,n)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
|
|
17
17
|
return Object.freeze({send:d,authorize:c,stream:u})}function Yt(e,t){let r={};for(let[t,n]of Object.entries(e.headers??{}))t.toLowerCase()!==Wt&&(r[t]=n);return t!==null&&(r["Idempotency-Key"]=t),{...e,headers:r}}function Xt(){let e=0;return()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var Qt=10;function Jt(e,t,r){if(r.aborted)return{retry:false,reason:"aborted"};let n=Zt(e);if(n==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!isAutoRetryable(e.code))return{retry:false,reason:"terminal-code"};let i=n==="burst"?"burst-throttle":"retryable-code";if((()=>{if(r.policy===void 0)return false;try{return!r.policy.shouldRetry(e.code,t)}catch{return false}})())return{retry:false,reason:"terminal-code"};let l=()=>{if(r.policy===void 0)return null;let t;try{t=r.policy.maxAttempts(e.code)}catch{return null}return typeof t!="number"||!Number.isFinite(t)?null:Math.max(1,Math.min(Qt,Math.floor(t)))},o=r.perCallMaxAttempts??l()??r.maxAttempts;if(t+1>=o)return{retry:false,reason:"attempts-exhausted"};let a=er(e,r.now);return a!==null?a>Nt?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:i,delayMs:a}:{retry:true,reason:i,delayMs:backoffDelayMs(t,r.rng)}}function Zt(e){let t=e.code==="unknown"?fromWire(lr(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}function er(e,t){let r=rr(e.raw);if(r!==null){let e=r-t;return e>0?e:0}let n=tr(e.raw);return n===null?null:Math.round(n*1e3)}function tr(e){for(let t of nr(e)){let e=t.retry_after_seconds;if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return e}return null}function rr(e){for(let t of nr(e)){let e=t.resets_at,r=ir(e);if(r!==null)return r}return null}function nr(e){if(!or(e))return[];let t=[e];for(let r of["error","detail"]){let n=e[r];or(n)&&t.push(n)}return t}function ir(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 lr(e){for(let t of nr(e)){let e=t.code;if(typeof e=="string"&&e.length>0)return e}return null}function or(e){return typeof e=="object"&&e!==null}async function ar(e){if(e.mode==="anonymous"){let t=await Ot(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 sr(e,t){let r=new AbortController,n=t.setTimeout(()=>r.abort(),e);return{signal:r.signal,cancel:()=>t.clearTimeout(n)}}function dr(e,t){let r=()=>{};if(!t)return{signal:e,dispose:r};let n=new AbortController;if(e.aborted||t.aborted)return n.abort(),{signal:n.signal,dispose:r};let i=()=>n.abort();return e.addEventListener("abort",i,{once:true}),t.addEventListener("abort",i,{once:true}),{signal:n.signal,dispose:()=>{e.removeEventListener("abort",i),t.removeEventListener("abort",i)}}}function cr(e,t,r){return e<=0||r?.aborted===true?Promise.resolve():new Promise(n=>{let i=t.setTimeout(()=>{r?.removeEventListener("abort",l),n()},e),l=()=>{t.clearTimeout(i),n()};r?.addEventListener("abort",l,{once:true})})}function ur(e){for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r>=55296&&r<=56319){let r=e.charCodeAt(t+1);if(!(r>=56320&&r<=57343))return true;t+=1}else if(r>=56320&&r<=57343)return true}return false}function hr(e){return[...e].length}function pr(e){return e!=null&&(e.httpStatus===404||e.category==="notFound")}function gr(e){return e.code!=="conversationNotFound"?e:makeEverfurError("resourceNotFound",{retryable:false,...e.httpStatus===void 0?{}:{httpStatus:e.httpStatus},...e.requestId===void 0?{}:{requestId:e.requestId},...e.reasonCode===void 0?{}:{reasonCode:e.reasonCode},...e.wireMessage===void 0?{}:{wireMessage:e.wireMessage},...e.raw===void 0?{}:{raw:e.raw}})}function fr(e){return e.ok?e:err(gr(e.error))}function mr(e){return{send:async(...t)=>fr(await e.send(...t)),authorize:t=>e.authorize(t),stream:(t,r,n)=>e.stream(t,r,n)}}var br="/widget/v1/records";function yr(e){let{auth:t}=e,r=t.mode,n=e.funnel??createRequestFunnel({auth:t,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),i=async(e,t,i)=>{let l=await n.send(e,t);return l.ok?l:err(xr(gr(l.error),r,i))},l=(e,t)=>typeof t!="string"||t.length===0?makeEverfurError("validationFailed",{retryable:false,wireMessage:`${e} is required and must be a non-empty string`}):ur(t)?makeEverfurError("validationFailed",{retryable:false,wireMessage:`${e} contains an unpaired surrogate and cannot be encoded`}):null,o=(e,t,r)=>{let n=l(e,t);if(n!==null)return n;let i=[...t].length;return i>r?makeEverfurError("validationFailed",{retryable:false,wireMessage:`${e} is ${i} characters; the server accepts at most ${r}`}):null},a=(...e)=>e.find(e=>e!==null)??null,s=e=>a(o("consent_version",e.consent_version,yt),o("idempotency_key",e.idempotency_key,vt));return{createRequest:e=>{let t=a(o("idempotency_key",e.idempotency_key,vt),o("pet_ref",e.pet_ref,wt));return t?Promise.resolve(err(t)):i("records.createRequest",Cr(`${br}/requests`,e),"request")},initiateUpload:(e,t)=>{let r=l("request_id",e);return r?Promise.resolve(err(r)):i("records.initiateUpload",Cr(`${br}/requests/${encodeURIComponent(e)}/uploads/initiate`,t),"request")},completeUpload:(e,t)=>{let r=l("request_id",e);return r?Promise.resolve(err(r)):i("records.completeUpload",Cr(`${br}/requests/${encodeURIComponent(e)}/uploads/complete`,t),"request")},getRequest:e=>{let t=l("request_id",e);return t?Promise.resolve(err(t)):i("records.getRequest",Tr(`${br}/requests/${encodeURIComponent(e)}`),"request")},listRequests:async()=>{let e=await i("records.listRequests",Tr(`${br}/requests`),"request");if(!e.ok)return e;let t=e.value;return{ok:true,value:Array.isArray(t)?t:t.items??[]}},listPetRefs:async()=>{let e=await i("records.listPetRefs",Tr("/widget/v1/pets"),"request");if(!e.ok)return e;let t=e.value,r=Array.isArray(t)?t:t?.pets;return{ok:true,value:(Array.isArray(r)?r:[]).map(e=>e?.pet_ref).filter(e=>typeof e=="string"&&e.length>0)}},getRecord:petRef=>{let e=o("pet_ref",petRef,wt);return e?Promise.resolve(err(e)):i("records.getRecord",Tr(`${br}/pets/${encodeURIComponent(petRef)}/record`),"content")},getConsent:petRef=>{let e=o("pet_ref",petRef,wt);return e?Promise.resolve(err(e)):i("records.getConsent",Tr(`${br}/pets/${encodeURIComponent(petRef)}/consent`),"consent")},putConsent:(petRef,e)=>{let t=a(s(e),o("pet_ref",petRef,wt));return t?Promise.resolve(err(t)):i("records.putConsent",_r(`${br}/pets/${encodeURIComponent(petRef)}/consent`,e),"consent")},getMemberConsent:()=>i("records.getMemberConsent",Tr(`${br}/consent`),"consent"),putMemberConsent:e=>{let t=s(e);return t?Promise.resolve(err(t)):i("records.putMemberConsent",_r(`${br}/consent`,e),"consent")},deleteMemberConsent:()=>i("records.deleteMemberConsent",Rr(`${br}/consent`),"consent"),getFeatures:()=>i("records.getFeatures",Tr(`${br}/features`),"request"),deleteConsent:petRef=>{let e=o("pet_ref",petRef,wt);return e?Promise.resolve(err(e)):i("records.deleteConsent",Rr(`${br}/pets/${encodeURIComponent(petRef)}/consent`),"consent")}}}function vr(e,t){let r={...e,recordsReason:t};for(let t of["wireMessage","raw"]){let n=Object.getOwnPropertyDescriptor(e,t);n!==void 0&&Object.defineProperty(r,t,n)}/* @__PURE__ */
|
|
18
18
|
return Object.freeze(r)}var wr="pet_not_registered";function kr(e){return e.httpStatus!==404?null:e.reasonCode===wr?"pet_not_found":"entitlement"}function xr(e,t,r){let n=kr(e);return n!==null?vr(e,n):e.code!=="accessDenied"?e:vr(e,t==="anonymous"?"session_required":r==="content"?"consent_required":"entitlement")}function Tr(e){return{method:"GET",path:e}}function Cr(e,t){return{method:"POST",path:e,body:t}}function _r(e,t){return{method:"PUT",path:e,body:t}}function Rr(e){return{method:"DELETE",path:e}}var Sr=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),zr=globalThis,Ir=zr[Sr]??(zr[Sr]=createContext(null));Ir.displayName??="EverfurContext";function Dr(){let e=s(Ir);if(e===null)throw new ae("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}var Hr=/* @__PURE__ */new Map,Lr=/* @__PURE__ */new Set;function Pr(petRef){Hr.set(petRef,(Hr.get(petRef)??0)+1);for(let e of[...Lr])e()}function Or(petRef){return Hr.get(petRef)??0}function $r(e){return Lr.add(e),()=>{Lr.delete(e)}}function Br(petRef){let e=l(()=>Or(petRef),[petRef]);return d($r,e,e)}var jr={record:null,requests:[],consent:null,error:null,denialReason:null,withheld:false,loading:true,isUploading:false,uploadProgress:null,uploadQueue:[],uploadContentTypes:De.uploadContentTypes},Ar=4e3,Er=30;function useEverfurRecords(e){let{petRef:petRef}=e,t=r(e.uploadTransport);t.current=e.uploadTransport;let s=e.uploadTransport!==void 0,{runtime:d,userRef:userRef,scopeEpoch:c}=Dr(),u=n(()=>({}),[d,userRef,petRef,c,e.controller]),h=r(u),[p,g]=i({scope:u,controller:e.controller??null}),f=e.controller??(p.scope===u?p.controller:null),[m,b]=i({scope:u,value:jr}),y=m.scope===u?m.value:jr,v=l(e=>{b(t=>t.scope===u?{scope:u,value:e(t.value)}:t)},[u]),w=r(0);o(()=>(h.current=u,b({scope:u,value:jr}),()=>{h.current=null,w.current+=1}),[u]),o(()=>{if(e.controller)return;let{services:r}=d.registry,n={record:(e,t)=>r.telemetry.track(e,t)},i=d.registry.acquire("records",`${userRef??""}|${petRef}${s?"|own-upload":""}`,()=>Tt({repository:yr({auth:r.authFor(userRef),...r.errorPolicy?{errorPolicy:r.errorPolicy}:{}}),uploads:s?{postMultipart:(e,n,i)=>(t.current??r.uploadTransport).postMultipart(e,n,i)}:r.uploadTransport,telemetry:n}),()=>{});return g({scope:u,controller:i}),()=>{d.registry.release(i)}},[d,userRef,petRef,e.controller,c,u,s]);let k=l(e=>{v(t=>({...t,...e}))},[v]),x=l(async()=>{if(!f||h.current!==u)return;let e=w.current+=1;S.current=0,D(),k({loading:true,error:null,denialReason:null,withheld:false});let[t,r]=await Promise.all([f.getConsent(petRef),f.listRequests()]);if(e!==w.current)return;let n=t.ok?t.value:null,i=r.ok?r.value.filter(e=>e.petRef===petRef):[],l=r.ok?null:r.error;if(n&&n.granted){let t=await f.getRecord(petRef);if(e!==w.current)return;if(t.ok){k({consent:n,requests:i,record:t.value,withheld:t.value.withheld,error:t.value.withheld?Gr():l,denialReason:null,loading:false});return}k({consent:n,requests:i,record:null,error:t.error,denialReason:recordsDenialReasonOf(t.error),withheld:false,loading:false});return}k({consent:n,requests:i,record:null,error:t.ok?l:t.error,denialReason:n?"consent_required":Ur(t),withheld:false,loading:false})},[f,petRef,k,u]);o(()=>(x(),()=>{w.current+=1}),[x]);let T=e.readUploadFeatures===true;o(()=>{if(!T||!f?.readFeatures)return;let e=true;return f.readFeatures().then(t=>{e&&h.current===u&&k({uploadContentTypes:t.uploadContentTypes})}),()=>{e=false}},[f,T,k,u]);let C=n(()=>Nr(y.requests),[y.requests]),_=C?.id??null,R=C?.status??null,S=r(0),z=r(null),[I,D]=a(e=>e+1,0);o(()=>{if(!f||_===null||R===null||isTerminalStatus(R)||R==="in_review")return;z.current!==String(_)&&(z.current=String(_),S.current=0);let e=false,t=async()=>{if(e||S.current>=Er)return;S.current+=1;let n=await f.getRequest(_);if(!e){if(n.ok&&n.value.petRef===petRef){if(v(e=>({...e,requests:Wr(e.requests,n.value)})),isTerminalStatus(n.value.status)){n.value.status==="published"&&x();return}if(n.value.status==="in_review")return}r=setTimeout(()=>{t()},Ar)}},r=setTimeout(()=>{t()},Ar);return()=>{e=true,clearTimeout(r)}},[f,_,R,x,I,petRef,v]);let H=l(async e=>{if(!f||h.current!==u)return Vr();let t=await f.createUploadRequest({petRef:petRef,idempotencyKey:e});return h.current===u&&t.ok&&t.value.petRef===petRef&&v(e=>({...e,requests:Wr(e.requests,t.value)})),t},[f,petRef,u,v]),L=l((e,t)=>{v(r=>({...r,uploadQueue:r.uploadQueue.map(r=>r.key===e?t(r):r)}))},[v]),P=l(async(e,t)=>{let r=Date.now().toString(36),n=t.map((e,t)=>{let n=Fr(e,y.uploadContentTypes);return{key:`${r}-${t}`,name:e.name??null,status:n===null?"queued":"skipped",progress:0,skipReason:n,error:null}}),i=[...n];if(!f||h.current!==u)/* @__PURE__ */return Object.freeze(i);v(e=>({...e,uploadQueue:n,isUploading:true,uploadProgress:0}));for(let[r,l]of t.entries()){let t=n[r];if(t.status==="skipped")continue;if(h.current!==u)break;L(t.key,e=>({...e,status:"uploading",progress:0})),k({uploadProgress:0});let o=await f.uploadDocument({requestId:e,file:l,onProgress:e=>{if(h.current!==u)return;let r=Math.min(1,Math.max(0,e));L(t.key,e=>({...e,progress:Math.max(e.progress,r)})),k({uploadProgress:r})}});if(h.current!==u)break;let a=o.ok?{...t,status:"done",progress:1}:{...t,status:"failed",error:o.error};if(i[r]=a,L(t.key,()=>a),o.ok){let t=await f.getRequest(e);h.current===u&&t.ok&&t.value.petRef===petRef&&v(e=>({...e,requests:Wr(e.requests,t.value)}))}}return h.current===u&&k({isUploading:false,uploadProgress:null}),/* @__PURE__ */Object.freeze(i)},[f,k,L,petRef,u,v,y.uploadContentTypes]),O=l(async(e,t)=>{if(!f||h.current!==u)return Vr();let r=`${Date.now().toString(36)}-0`;v(e=>({...e,isUploading:true,uploadProgress:0,uploadQueue:[{key:r,name:t.name??null,status:"uploading",progress:0,skipReason:null,error:null}]}));let n=await f.uploadDocument({requestId:e,file:t,onProgress:e=>{h.current===u&&(k({uploadProgress:e}),L(r,t=>({...t,progress:Math.max(t.progress,Math.min(1,e))})))}});if(h.current!==u)return n;if(k({isUploading:false,uploadProgress:null}),L(r,e=>n.ok?{...e,status:"done",progress:1}:{...e,status:"failed",error:n.error}),n.ok){let t=await f.getRequest(e);h.current===u&&t.ok&&t.value.petRef===petRef&&v(e=>({...e,requests:Wr(e.requests,t.value)}))}return n},[f,k,L,petRef,u,v]),$=e.consentScope==="all_pets"&&f?.grantConsentAllPets&&f.revokeConsentAllPets?"all_pets":"pet",B=l(async(e,t)=>{if(!f||h.current!==u)return Vr();let r;if($==="all_pets"&&f.grantConsentAllPets){let n=await f.grantConsentAllPets({petRef:petRef,consentVersion:e,idempotencyKey:t}),i=n.ok?n.value.failed?.[0]:void 0;r=n.ok?i?err(i.error):ok(n.value.pets.find(e=>e.petRef===petRef)??it(petRef,{granted:n.value.granted,version:n.value.version,granted_at:n.value.grantedAt})):n}else r=await f.grantConsent({petRef:petRef,consentVersion:e,idempotencyKey:t});return r.ok&&h.current===u&&x(),r},[f,petRef,x,u,$]),j=l(e=>{Pr(e),!(e!==petRef||h.current!==u)&&(w.current+=1,k({record:null,withheld:false,loading:false,denialReason:"consent_required",consent:it(petRef,null)}))},[petRef,k,u]),A=l(async()=>{if(!f||h.current!==u)return Vr();if(!f.revokeConsentAllPets)return err(makeEverfurError("notImplemented",{retryable:false}));let e=false,t=await f.revokeConsentAllPets({petRef:petRef,onRevoked:t=>{e=true,j(t)}});if(t.ok&&!e)for(let e of[petRef,...t.value.pets.map(e=>e.petRef)])j(e);return t},[f,petRef,u,j]),E=l(async()=>{if(!f||h.current!==u)return Vr();if($==="all_pets"){let e=await A();return e.ok?ok(e.value.pets.find(e=>e.petRef===petRef)??it(petRef,null)):e}let e=await f.revokeConsent(petRef);return e.ok&&j(petRef),e.ok&&h.current===u&&k({consent:e.value}),e},[f,petRef,k,u,$,A,j]),F=l(()=>x(),[x]),q=Mr(y,f!==null);return n(()=>({status:q,record:y.record,requests:y.requests,activeRequest:C,consent:y.consent,consentScope:$,error:y.error,denialReason:y.denialReason,withheld:y.withheld,isUploading:y.isUploading,uploadProgress:y.uploadProgress,uploadQueue:y.uploadQueue,uploadContentTypes:y.uploadContentTypes,createRequest:H,uploadDocument:O,uploadDocuments:P,grantConsent:B,revokeConsent:E,revokeConsentAllPets:A,refresh:F}),[q,y,C,$,H,O,P,B,E,A,F])}function Fr(e,t){if(!Ie(e.mimeType,t))return"unsupported";let r=e.sizeBytes;return typeof r!="number"||!Number.isFinite(r)||r<=0||r>bt?"too_large":null}function qr(e,t){let r=[],n=[];for(let i of e){let e=Fr(i,t);e===null?r.push(i):n.push({name:i.name??null,reason:e})}return{uploadable:r,skipped:n}}function Mr(e,t){return e.loading||!t?"loading":e.withheld||e.denialReason!==null||e.error!==null?"error":e.record!==null&&!e.record.isEmpty||e.requests.length>0?"populated":"empty"}function Nr(e){if(e.length===0)return null;let t=e[0];for(let r of e)r.updatedAt>t.updatedAt&&(t=r);return t}function Wr(e,t){let r=e.filter(e=>e.id!==t.id);return[t,...r]}function Ur(e){return e.ok?"consent_required":recordsDenialReasonOf(e.error)??"consent_required"}function Gr(){return makeEverfurError("internalError",{retryable:false})}function Vr(){return{ok:false,error:makeEverfurError("internalError",{retryable:true})}}function Kr(e){let t={};if(e==null)return t;for(let r of Object.keys(e))e[r]!==void 0&&(t[r]=e[r]);return t}function Yr(e){let t=globalThis.console;try{t?.error?.("[everfur] A host callback threw; the SDK ignored it.",e)}catch{}}function Xr(e){return(typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}function Qr(e,...t){if(typeof e=="function")try{let r=e(...t);return Xr(r)&&Promise.resolve(r).then(void 0,Yr),r}catch(e){Yr(e);return}}var Jr=/* @__PURE__ */new WeakMap;function Zr(e){if(typeof e!="function")return;let t=Jr.get(e);if(t!==void 0)return t;let r=(...t)=>{Qr(e,...t)};return Jr.set(e,r),r}function en(e,t){let r=null;for(let n of t){let t=e[n];typeof t=="function"&&(r??={...e},r[n]=Zr(t))}return r??e}function tn(e,...t){let r;try{r=e(...t)}catch(e){return Yr(e),Promise.resolve({ok:false,error:e})}return Promise.resolve(r).then(e=>({ok:true,value:e}),e=>({ok:false,error:e}))}var rn=/* @__PURE__ */Object.freeze({name:"dashboard"});function initialRecordsNav(e=rn){/* @__PURE__ */
|
|
@@ -760,145 +760,146 @@ return Object.freeze(Object.fromEntries(Object.entries(e).filter(([,e])=>e!=null
|
|
|
760
760
|
return Object.freeze({petRef:Bg(t.pet_ref,Hg)??petRef,pet:/* @__PURE__ */Object.freeze({name:Bg(r?.name,120),species:Bg(r?.species,60),sex:n==="female"||n==="male"?n:null,breed:Bg(r?.breed,120),weightKg:qg(r?.weight_kg),weightLb:qg(r?.weight_lb)}),checkout:t.checkout==="everfur_stripe"?"everfur_stripe":"partner",page:healthPlanFocusDesignFromWire(t.page),vetReviewed:t.vet_reviewed===true,trackingTextsEnabled:t.tracking_texts_enabled===true})}function Zg(e){return makeEverfurError("validationFailed",{retryable:false,wireMessage:e})}function ef(e){return makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:`${e}: the response was not the expected shape`})}function tf(e){return makeEverfurError("runtimeDisposed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${e} was called after unmount`})}var rf=e=>typeof e=="string"&&e.length>0&&e.length<=Hg;function nf(petRef){return`/widget/v1/pets/${encodeURIComponent(petRef)}/plan`}async function lf(e,petRef,t){if(!rf(petRef))return err(Zg("petRef must be 1..128 characters"));let r=await e.send("healthPlan.page.read",{method:"GET",path:`${nf(petRef)}/page`,...t?.signal?{signal:t.signal}:{}});if(!r.ok)return err(r.error);let n=healthPlanPageFromWire(r.value,petRef);return n===null?err(ef("healthPlan.page.read")):ok(n)}var of=/* @__PURE__ */new WeakMap;function af(e){let t=of.get(e);if(t!==void 0)return t;let r=sf(e);return of.set(e,r),r}function sf(e){return{getPage:(petRef,t)=>{if(e.isDisposed)return Promise.resolve(err(tf("getPage")));let{services:r}=e.registry,n=mr(createRequestFunnel({auth:r.authFor(null),...r.errorPolicy?{errorPolicy:r.errorPolicy}:{}}));return lf(n,petRef,t)}}}var df=6e4;function cf({lifecycle:e,refreshKey:t,readyAt:n,revalidate:i,refresh:l,now:a=Date.now}){let s=r({readyAt:n,revalidate:i,refresh:l??i,now:a});s.current={readyAt:n,revalidate:i,refresh:l??i,now:a},o(()=>{if(e==null)return;let t=Qr(()=>e.onForeground(()=>{let{readyAt:e,revalidate:t,now:r}=s.current;e!==null&&r()-e>=df&&t()}));return()=>{typeof t=="function"&&Qr(t)}},[e]);let d=r(t);o(()=>{Object.is(d.current,t)||(d.current=t,s.current.refresh())},[t])}var uf=df,hf=/* @__PURE__ */Symbol.for("@everfur/sdk#HealthPlanPageReads@v1");function pf(){let e=globalThis,t=e[hf];if(t instanceof WeakMap)return t;let r=/* @__PURE__ */new WeakMap;return e[hf]=r,r}function gf(e,t,userRef,petRef,r){let n=pf(),i=n.get(t);i===void 0&&(i=/* @__PURE__ */new Map,n.set(t,i));let l=i,o=`${userRef}\0${petRef}`,a=l.get(o);if(!r&&a!==void 0&&(a.at===null||Date.now()-a.at<uf))return a.promise;let s={at:null,promise:e.getPage(petRef).then(e=>(l.get(o)===s&&(e.ok||pr(e.error)?s.at=Date.now():l.delete(o)),e))};return l.set(o,s),s.promise}function useHealthPlanPage(e){let{userRef:userRef,runtime:t}=Dr(),a=n(()=>af(t),[t]),s=e.repository,d=s??a,c=l((e,r)=>s!==void 0||userRef==null?d.getPage(e):gf(a,t,userRef,e,r),[s,d,a,t,userRef]),{petRef:petRef}=e,u=e.enabled!==false&&userRef!=null&&petRef!==null,[h,p]=i({phase:"idle",petRef:null,page:null,error:null}),g=r(0),f=r(0),m=l(async e=>{let t=++g.current;if(!u||petRef===null){p(e=>e.phase==="idle"&&e.petRef===null?e:{phase:"idle",petRef:null,page:null,error:null});return}p(e=>({phase:"loading",petRef:petRef,page:e.petRef===petRef?e.page:null,error:null}));let r=await c(petRef,e);t===g.current&&(r.ok?p({phase:"ready",petRef:petRef,page:r.value,error:null,readyAt:Date.now()}):pr(r.error)?p({phase:"ready",petRef:petRef,page:null,error:null,missing:true,readyAt:Date.now()}):p({phase:"failed",petRef:petRef,page:null,error:r.error}))},[u,petRef,c]),b=l(()=>m(true),[m]),y=h.phase==="ready"&&h.petRef===petRef,v=l(async()=>{if(!u||petRef===null||!y)return;let e=g.current,t=++f.current,r=await c(petRef,true);e!==g.current||t!==f.current||!r.ok||p(e=>e.phase==="ready"&&e.petRef===petRef?{phase:"ready",petRef:petRef,page:r.value,error:null,readyAt:Date.now()}:e)},[u,petRef,y,c]);cf({lifecycle:e.lifecycle,refreshKey:e.refreshKey,readyAt:y?h.readyAt??null:null,revalidate:()=>{v()},refresh:()=>{y?v():b()}}),o(()=>(m(false),()=>{g.current+=1}),[m]);let w=u&&h.petRef!==petRef;return n(()=>({phase:w?"loading":h.phase,page:w?null:h.page,error:w?null:h.error,missing:!w&&h.missing===true,refresh:b}),[w,h,b])}var ff=/* @__PURE__ */Object.freeze({dog:"dog",canine:"dog",k9:"dog",puppy:"dog",cat:"cat",feline:"cat",kitten:"cat"});function canonicalPetSpecies(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(ff,t)?ff[t]:null}var mf=50,bf=128,yf=120,vf=120,wf=2e3,kf=120,xf=80,Tf=/* @__PURE__ */new Set(["male","female","unknown"]),Cf=/* @__PURE__ */new Set(["day","month","year"]),_f=/* @__PURE__ */new Set(["low","medium","high","athletic"]),Rf=/* @__PURE__ */new Set(["indoor","outdoor","both"]),Sf=/* @__PURE__ */new Set(["mild","moderate","severe"]),zf=/^(\d{4})-(\d{2})-(\d{2})$/,If=[["sex","sex"],["spayedNeutered","spayed_neutered"],["birthDate","birth_date"],["birthDatePrecision","birth_date_precision"],["activityLevel","activity_level"],["indoorOutdoor","indoor_outdoor"],["foodBrand","food_brand"],["foodType","food_type"],["microchipId","microchip_id"]],Df=[["allergies","allergies"],["medications","medications"],["supplements","supplements"],["conditions","conditions"]];/* @__PURE__ */Object.freeze([...If,...Df].map(([e])=>e));function Hf(e){let t=zf.exec(e);if(t===null)return false;let[r,n,i]=[Number(t[1]),Number(t[2]),Number(t[3])],l=new Date(Date.UTC(r,n-1,i));return l.getUTCFullYear()===r&&l.getUTCMonth()===n-1&&l.getUTCDate()===i}var Lf=e=>(t,r)=>typeof r=="string"&&e.has(r)?null:`${t} must be one of ${[...e].join(", ")}`,Pf=(e,t)=>typeof t=="boolean"?null:`${e} must be true or false`,Of=(e,t)=>typeof t=="string"&&Hf(t)?null:`${e} must be a real date written YYYY-MM-DD`,$f=(e,t={})=>(r,n)=>{if(typeof n!="string")return`${r} must be a string`;if(ur(n))return`${r} contains an unpaired surrogate and cannot be encoded`;let i=t.trimmed?n.trim():n;if(t.required&&i.length===0)return`${r} is required and must not be blank`;let l=hr(i);return l<=e?null:`${r} is ${l} characters; the server accepts at most ${e}`},Bf={sex:Lf(Tf),spayedNeutered:Pf,birthDate:Of,birthDatePrecision:Lf(Cf),activityLevel:Lf(_f),indoorOutdoor:Lf(Rf),foodBrand:$f(kf),foodType:$f(kf),microchipId:$f(xf)},jf=["ref","ref",false,$f(bf,{required:true,trimmed:true})],Af=["notes","notes",false,$f(wf,{trimmed:true})],Ef=[jf,["name","name",true,$f(yf,{required:true,trimmed:true})],["dose","dose",false,$f(vf,{trimmed:true})],["frequency","frequency",false,$f(vf,{trimmed:true})],["startDate","start_date",false,Of],["endDate","end_date",false,Of],Af],Ff={allergies:[jf,["allergen","allergen",true,$f(yf,{required:true,trimmed:true})],["severity","severity",false,Lf(Sf)],Af],medications:Ef,supplements:Ef,conditions:[jf,["conditionName","condition_name",true,$f(yf,{required:true,trimmed:true})],["diagnosedDate","diagnosed_date",false,Of],Af]};function qf(e,t,r){let n=`${e}[${t}]`;if(typeof r!="object"||r===null||Array.isArray(r))return{error:`${n} must be an object`};let i=r,l={};for(let[t,r,o,a]of Ff[e]){let e=i[t];if(e==null){if(o)return{error:`${n}.${t} is required`};e===null&&(l[r]=null);continue}let s=a(`${n}.${t}`,e);if(s!==null)return{error:s};l[r]=e}let o=l.start_date,a=l.end_date;return typeof o=="string"&&typeof a=="string"&&a<o?{error:`${n}.endDate must not be before startDate`}:{item:l}}function Mf(e,t){if(!Array.isArray(t))return{error:`${e} must be an array (send [] to clear it)`};if(t.length>mf)return{error:`${e} has ${t.length} items; the server accepts at most ${mf}`};let r=[],n=/* @__PURE__ */new Set;for(let i=0;i<t.length;i+=1){let l=qf(e,i,t[i]);if("error"in l)return l;let o=l.item.ref;if(typeof o=="string"){let t=o.trim();if(n.has(t))return{error:`${e}: ref ${JSON.stringify(t)} is used twice; a ref names one item`};n.add(t)}r.push(l.item)}return{items:r}}function Nf(e,t){let r=e,n={};for(let[e,t]of If){let i=r[e];if(i!==void 0){if(i!==null){let t=Bf[e](e,i);if(t!==null)return{error:t}}n[t]=i}}let i=r.birthDate!==void 0,l=r.birthDatePrecision!==void 0;if(i!==l||i&&r.birthDate===null!=(r.birthDatePrecision===null))return{error:"birthDate and birthDatePrecision must be sent together, both set or both null"};for(let[e,t]of Df){let i=r[e];if(i===void 0)continue;let l=Mf(e,i);if("error"in l)return l;n[t]=l.items}return Object.keys(n).length>0&&t!==void 0&&canonicalPetSpecies(t)===null?{error:"health fields need a pet Everfur reads as a dog or a cat (dog, canine, k9, puppy, cat, feline, kitten)"}:{body:n}}var Wf=e=>typeof e=="string"?e:null,Uf=(e,t)=>typeof t=="string"&&e.has(t)?t:null,Gf=e=>typeof e=="boolean"?e:null;function Vf(e,t){return Array.isArray(e)?/* @__PURE__ */Object.freeze(e.flatMap(e=>{if(typeof e!="object"||e===null||Array.isArray(e))return[];let r=t(e);return r===null?[]:[r]})):/* @__PURE__ */Object.freeze([])}function Kf(e){let t=Wf(e.name);return t===null||t.length===0?null:/* @__PURE__ */Object.freeze({ref:Wf(e.ref),name:t,dose:Wf(e.dose),frequency:Wf(e.frequency),startDate:Wf(e.start_date),endDate:Wf(e.end_date),notes:Wf(e.notes)})}function Yf(e){let t=e.profile_version;/* @__PURE__ */
|
|
761
761
|
return Object.freeze({profileVersion:typeof t=="number"&&Number.isInteger(t)&&t>=0?t:0,sex:Uf(Tf,e.sex),spayedNeutered:Gf(e.spayed_neutered),birthDate:Wf(e.birth_date),birthDatePrecision:Uf(Cf,e.birth_date_precision),activityLevel:Uf(_f,e.activity_level),indoorOutdoor:Uf(Rf,e.indoor_outdoor),foodBrand:Wf(e.food_brand),foodType:Wf(e.food_type),microchipId:Wf(e.microchip_id),allergies:Vf(e.allergies,e=>{let t=Wf(e.allergen);return t===null||t.length===0?null:/* @__PURE__ */Object.freeze({ref:Wf(e.ref),allergen:t,severity:Uf(Sf,e.severity),notes:Wf(e.notes)})}),medications:Vf(e.medications,Kf),supplements:Vf(e.supplements,Kf),conditions:Vf(e.conditions,e=>{let t=Wf(e.condition_name);return t===null||t.length===0?null:/* @__PURE__ */Object.freeze({ref:Wf(e.ref),conditionName:t,diagnosedDate:Wf(e.diagnosed_date),notes:Wf(e.notes)})})})}var Xf=100,Qf=50,Jf=100,Zf=50,em=500,tm=128,rm=6e4;function nm(e){return makeEverfurError("validationFailed",{retryable:false,wireMessage:e})}function im(e,t,r){if(typeof t!="string")return nm(`${e} must be a string`);let n=hr(t);return n<=r?null:nm(`${e} is ${n} characters; the server accepts at most ${r}`)}function lm(e,t,r){return typeof t=="number"&&Number.isFinite(t)&&t>=0&&t<=r?null:nm(`${e} must be a finite number between 0 and ${r}`)}function om(petRef,e){if(typeof petRef!="string")return nm("pet_ref must be a string");if(petRef.trim().length===0)return nm("pet_ref must not be blank");if(ur(petRef))return nm("pet_ref contains an unpaired surrogate and cannot be encoded");if(e!=null&&typeof e!="object")return nm("profile must be an object");let t=[im("pet_ref",petRef,tm)];return e?.name!==void 0&&t.push(im("name",e.name,Xf)),e?.species!==void 0&&t.push(im("species",e.species,Qf)),e?.breed!==void 0&&t.push(im("breed",e.breed,Jf)),e?.ageYears!==void 0&&t.push(lm("age_years",e.ageYears,Zf)),e?.weightKg!==void 0&&t.push(lm("weight_kg",e.weightKg,em)),t.find(e=>e!==null)??null}function am(e,t){let r=Nf(e,t);return"error"in r?{error:nm(r.error)}:r}function sm(e){if(typeof e!="object"||e===null)return{error:nm("patch must be an object")};let t=e,r=[["name","name",e=>im("name",e,Xf)],["species","species",e=>im("species",e,Qf)],["breed","breed",e=>im("breed",e,Jf)],["ageYears","age_years",e=>lm("age_years",e,Zf)],["weightKg","weight_kg",e=>lm("weight_kg",e,em)]],n={};for(let[e,i,l]of r){let r=t[e];if(r!==void 0){if(r!==null){let e=l(r);if(e!==null)return{error:e}}n[i]=r}}let i=am(t,t.species);return"error"in i?i:(Object.assign(n,i.body),Object.keys(n).length===0?{error:nm("patch must change at least one field")}:{body:n})}function dm(e){if(e==null)return{body:{}};let t=am(e,e.species);return"error"in t?t:{body:{...e.name!==void 0?{name:e.name}:{},...e.species!==void 0?{species:e.species}:{},...e.breed!==void 0?{breed:e.breed}:{},...e.ageYears!==void 0?{age_years:e.ageYears}:{},...e.weightKg!==void 0?{weight_kg:e.weightKg}:{},...t.body}}}var cm=e=>typeof e=="string"?e:null,um=e=>typeof e=="number"&&Number.isFinite(e)?e:null;function hm(e,petRef){let t=typeof e=="object"&&e!==null?e:{};/* @__PURE__ */
|
|
762
762
|
return Object.freeze({petRef:cm(t.pet_ref)??petRef,name:cm(t.name),species:cm(t.species),breed:cm(t.breed),ageYears:um(t.age_years),weightKg:um(t.weight_kg)})}function widgetPetFromWire(e){if(typeof e!="object"||e===null)return null;let t=e,petRef=cm(t.pet_ref);return petRef===null||petRef.length===0?null:/* @__PURE__ */Object.freeze({petId:cm(t.pet_id),petRef:petRef,name:cm(t.name),species:cm(t.species),breed:cm(t.breed),ageYears:um(t.age_years),weightKg:um(t.weight_kg),updatedAt:cm(t.updated_at)})}function pm(e){let t=widgetPetFromWire(e);return t===null?null:/* @__PURE__ */Object.freeze({...t,...Yf(e)})}function gm(e){let t=Array.isArray(e)?e:typeof e=="object"&&e!==null&&Array.isArray(e.pets)?e.pets:[];/* @__PURE__ */
|
|
763
|
-
return Object.freeze(t.flatMap(e=>{let t=widgetPetFromWire(e);return t===null?[]:[t]}))}function createPetsRepository(e){return fm(createRequestFunnel({auth:e}),createRequestFunnel({auth:e,unaryTimeoutMs:rm}))}function fm(e,t=e){let r=(e,t)=>t?{...e,signal:t}:e,n=petRef=>om(petRef,void 0)??`/widget/v1/pets/${encodeURIComponent(petRef)}`;return{async list(t){let n=await e.send("pets.list",r({method:"GET",path:"/widget/v1/pets"},t?.signal));return n.ok?ok(gm(n.value)):err(n.error)},async registerPet(petRef,t,r){let n=om(petRef,t);if(n!==null)return err(n);let i=dm(t);if("error"in i)return err(i.error);let l={method:"POST",path:`/widget/v1/pets/${encodeURIComponent(petRef)}`,body:i.body},o=await e.send("pets.registerPet",r?.signal?{...l,signal:r.signal}:l);return o.ok?ok(hm(o.value,petRef)):err(o.error)},async updatePet(petRef,t,i){let l=n(petRef);if(typeof l!="string")return err(l);let o=sm(t);if("error"in o)return err(o.error);let a=await e.send("pets.updatePet",r({method:"PATCH",path:l,body:o.body},i?.signal));return a.ok?ok(hm(a.value,petRef)):err(a.error)},async getPetProfile(petRef,t){let i=n(petRef);if(typeof i!="string")return err(i);let l=await e.send("pets.getPetProfile",r({method:"GET",path:`${i}/profile`},t?.signal));if(!l.ok)return err(l.error);let o=pm(l.value);return o===null?err(makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:"the pet profile response carried no pet_ref"})):ok(o)},async deletePet(petRef,t){let i=n(petRef);if(typeof i!="string")return err(i);let l=await e.send("pets.deletePet",r({method:"DELETE",path:i},t?.signal));return l.ok?ok(void 0):err(l.error)},async eraseUserData(e){let n=await t.send("pets.eraseUserData",r({method:"DELETE",path:"/widget/v1/me"},e?.signal),{maxAttempts:1});return n.ok?ok(void 0):err(n.error)}}}var mm=/* @__PURE__ */new WeakMap;function bm(e,t){let r=mm.get(e);return r===void 0&&(r=/* @__PURE__ */new Set,mm.set(e,r)),r.add(t),()=>{r?.delete(t)}}function useEverfurPets(){let{runtime:e,userRef:userRef,activePet:t,scopeEpoch:a}=Dr(),s=n(()=>createPetsRepository(e.registry.services.authFor(userRef)),[e,userRef,a]),[d,c]=i({repository:s,pets:[],loading:true,error:null}),u=d.repository===s?d:{pets:[],loading:true,error:null},h=r(0),p=l(async()=>{let e=++h.current;c(e=>({...e,repository:s,loading:true,error:null,pets:e.repository===s?e.pets:[]}));let t=await s.list();e===h.current&&c(t.ok?{repository:s,pets:t.value,loading:false,error:null}:e=>({repository:s,pets:e.repository===s?e.pets:[],loading:false,error:t.error}))},[s]);o(()=>(p(),()=>{h.current+=1}),[p]),o(()=>bm(e,()=>{p()}),[e,p]);let g=n(()=>t===null?null:u.pets.find(e=>e.petRef===t)??null,[t,u.pets]);return n(()=>({pets:u.pets,activePet:g,loading:u.loading,error:u.error,refresh:p}),[u.pets,u.loading,u.error,g,p])}var ym=()=>()=>{},vm=()=>null;function wm(e,t){return d(t?.subscribe??ym,t?.get??vm,t?.get??vm)??e}var km=/* @__PURE__ */Object.freeze({chatAnswerStyle:"cards",chatHistoryStyle:"sheet",chatTopCard:"focus",chatFollowUpCount:3,chatFollowUpsExcludeTelevet:false,chatComposerMic:true,chatComposerUpload:true,safetyDisclaimerPlacement:"composer",healthPlanLayout:"focus_plan",recordsTopRiskLine:true,recordsClearResultsFilter:true,chatComposerStyle:"compact",chatComposerPlaceholder:"pet_name",chatHistoryBar:"scroll",chatGeneralBanner:true,chatSendButton:"always_dark",chatTextingAsk:true,serverSlots:false}),
|
|
764
|
-
return Object.freeze(a)}var Im=/* @__PURE__ */Object.freeze({branding:null}),Dm=/* @__PURE__ */Object.freeze({subscribe:()=>()=>{},getSnapshot:()=>Im});function Hm(e){return e?Object.keys(e).sort().map(t=>`${t}=${String(e[t])}`).join("&"):""}function useEverfurPresentation(e){return Lm(e).presentation}function Lm(e){let{runtime:t}=Dr(),r=t?.entitlements??Dm,i=l(()=>r.getSnapshot()?.branding??null,[r]),o=wm(d(r.subscribe,i,i),t?.sdkConfigHost?.branding),a=Hm(e);return n(()=>{let t=o?.lockedFields??null;return{presentation:resolvePresentation({server:o?.presentation??null,locked:t,client:e??null}),isLocked:e=>isPresentationFieldLocked(e,t)}},[o,a])}var Pm=3600*1e3;function Om(e,t=true){let[n,l]=i(()=>e??Date.now()),a=r(true);return o(()=>{if(a.current){a.current=false;return}e===void 0&&t&&l(Date.now())},[e,t]),o(()=>{if(e!==void 0||!t)return;let r=setInterval(()=>l(Date.now()),Pm),n=()=>{document.visibilityState==="visible"&&l(Date.now())},i=typeof document<"u"&&typeof document.addEventListener=="function"?document:null;return i?.addEventListener("visibilitychange",n),()=>{clearInterval(r),i?.removeEventListener("visibilitychange",n)}},[e,t]),e??n}var $m=e=>e.charAt(0).toUpperCase()+e.slice(1);function Bm(e,t){let r=e.trim(),n=r.length>0?r:Qn,i=$m(n);return t==="her"?{name:n,Name:i,poss:"her",Poss:"Her",subj:"she"}:t==="his"?{name:n,Name:i,poss:"his",Poss:"His",subj:"he"}:{name:n,Name:i,poss:`${n}'s`,Poss:`${i}'s`,subj:n}}var jm=/* @__PURE__ */Object.freeze({vitalsFrom:(e,t,r)=>`Vitals from ${e.poss} ${t}, ${r}`,vitalsSource:e=>`Where ${e.name}'s vitals come from`,temperature:"Temperature",heartRate:"Heart rate",breathing:"Breathing",upcomingCare:"Upcoming care",overdueBy:e=>`Overdue · due by ${e}`,dueSoon:"Due soon",later:"Later",noDate:"No date",dueIn:(e,t)=>`Due ${e} · in ${t} ${t===1?"day":"days"}`,dueToday:e=>`Due ${e} · today`,overdueByDays:(e,t)=>`Overdue by ${t} ${t===1?"day":"days"} · due ${e}`,recordsHistory:"Records & history",labs:"Labs & bloodwork",results:"results",screenings:"Screenings",screeningsClear:"All clear",screeningsToReview:e=>`${e} to review`,noScreenings:"No screenings yet",visits:"Visits & records",timeline:"Timeline",events:e=>`${e} ${e===1?"event":"events"}`,weight:"Weight",vetVisits:e=>`${e} vet ${e===1?"visit":"visits"}`,history:"History",theirClinic:e=>`${e.Poss} clinic`,bloodPanel:"Blood panel",aboveRange:"above range",belowRange:"below range",othersInRange:"Other values in range.",addRecords:e=>`Add ${e.name}'s records`,moreThanOneClinic:"Records can come from more than one clinic over a lifetime.",visitsCount:e=>`${e} ${e===1?"visit":"visits"}`,panelsCount:e=>`${e} blood ${e===1?"panel":"panels"}`,requestFromClinic:"Request from a clinic",uploadDocument:"Upload a document",onFileNow:"On file now",firstRecord:e=>`Add ${e.name}'s first record`,firstLead:e=>`Records can come from more than one clinic over a lifetime. Start with the one ${e.subj} sees most, and this page fills in from there.`,requestFromTheirClinic:e=>`Request from ${e.poss} clinic`,requestDetail:"We send a secure request and read every page they send back.",uploadDetail:"A PDF, or a photo of a paper record.",findClinic:e=>`Find ${e.name}'s clinic`,chooseFile:"Choose a file",sayBeats:/* @__PURE__ */Object.freeze(["Hmmm","I wonder","what I may be","hiding"]),sayStill:"I wonder what I may be hiding",sample:"Sample",peekLead:e=>`A sneak peek at how ${e.name}'s records will read. Every number links back to the page it came from.`,sampleNote:e=>`Sample data until ${e.poss} records arrive.`,onTheWay:e=>`${e.Name}'s records are on the way`,clinicsTake:"Clinics usually take 2 to 5 days.",anotherClinic:"Another clinic",anotherClinicDetail:"Seen more than one vet? We ask each one.",noDueDate:"No due date on file",noLabs:e=>`No lab results on file for ${e.name} yet. They show up here when a record includes a blood or urine panel.`,noVisits:e=>`No visits in ${e.name}'s records yet. They show up here when a record includes one.`,oneReading:"One reading so far: we'll plot a trend as more come in.",takingNow:"Taking now",noCurrentMeds:"No current medications on file.",noVetTitle:e=>`When ${e.name} has a vet, start here.`,requestedFrom:e=>`Requested from ${e}. Clinics usually take 2 to 5 days.`,onTheWayFrom:(e,t)=>`${e.Name}'s records from ${t} are on the way.`,readingUpload:"We're reading the document you uploaded.",seeWhereItStands:"See where it stands",topRisk:e=>`${e.Poss} top risk`,seePlan:e=>`See ${e.poss} Health Plan`,panelOn:e=>`${e} blood panel`,latestReading:"Latest reading",rangeLine:(e,t,r)=>`range ${e} to ${t}${r?` ${r}`:""}`,noRange:"No range on the report",above:"Above",inRange:"In range",below:"Below",high:"High",belowRangePill:"Below range",changeUp:(e,t)=>`Up ${e}${t?` ${t}`:""}`,changeDown:(e,t)=>`Down ${e}${t?` ${t}`:""}`,changeSince:(e,t)=>` since ${e}, about ${t}%.`,whatIs:e=>`What ${e} is`,otherValues:e=>`Other ${e} values`,panelTitle:(e,t)=>`${e} · ${t}`,askAboutThis:"Ask about this"});var Am=864e5,Em=30,Fm=2.20462,qm=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Mm(e){if(e==null||e.length===0)return null;let t=Date.parse(/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T00:00:00Z`:e);return Number.isNaN(t)?null:t}function Nm(e){let t=new Date(e);return`${qm[t.getUTCMonth()]??""} ${t.getUTCDate()}`}function Wm(e){return`${Nm(e)}, ${new Date(e).getUTCFullYear()}`}function Um(e){let t=new Date(e);return`${t.getUTCMonth()+1}/${String(t.getUTCFullYear()%100).padStart(2,"0")}`}var Gm=e=>new Date(e).toISOString().slice(0,10);function Vm(e){return String(Math.round(e*100)/100)}var Km=e=>Math.round(e*Fm*10)/10;function Ym(e){let t=e.trim();return t.length<2||t[1]===t[1]?.toUpperCase()?t:t.charAt(0).toLowerCase()+t.slice(1)}function Xm(e){return/temp/i.test(e)?"temp":/heart|pulse/i.test(e)?"heart":/resp|breath/i.test(e)?"breath":null}var Qm=["temp","heart","breath"],Jm={temp:jm.temperature,heart:jm.heartRate,breath:jm.breathing};function Zm(e){if(e===null||e.withheld)return{vitals:[],observedMs:null};let t=/* @__PURE__ */new Map;for(let r of e.entities){if(r.category!=="vital"||r.value===null||r.value.trim().length===0)continue;let e=Xm(`${r.canonicalKey??""} ${r.key} ${r.label}`);if(e===null)continue;let n=Mm(r.observedAt)??0,i=t.get(e);(i===void 0||n>i.ms)&&t.set(e,{value:r.value.trim(),unit:r.unit,ms:n})}let r=Qm.flatMap(e=>{let r=t.get(e);return r===void 0?[]:[{kind:e,value:r.value,unit:r.unit,label:Jm[e]}]}),n=[...t.values()].map(e=>e.ms).filter(e=>e>0);return{vitals:r,observedMs:n.length>0?Math.max(...n):null}}function eb(e,t){let r=Gm(t);return e.find(e=>{let t=Mm(e.date);return t!==null&&Gm(t)===r})??null}function tb(e){return/vaccin|rabies|dhpp|booster|bordetella|lepto|lyme|parvo|distemper/i.test(e)?"efi-shield":/\b(alt|alp|lab|labs|blood|panel|bloodwork|urinalysis|chemistry|cbc)\b/i.test(e)?"efi-flask-sm":"efi-calendar"}function rb(e,t){return e.map(e=>{let r=Mm(e.dueAt),n=tb(e.title);if(r!==null&&r<t-Am+1)return{item:e,title:e.title,when:jm.overdueBy(Nm(r)),tone:"alert",pill:null,icon:n};let i=e.detail??(r===null?jm.noDueDate:Wm(r));if(r===null)return{item:e,title:e.title,when:i,tone:"none",pill:null,icon:n};let l=r-t<=Em*Am;return{item:e,title:e.title,when:i,tone:l?"watch":"later",pill:l?jm.dueSoon:jm.later,icon:n}})}function nb(e){return e==null?null:/above|high/i.test(e)?"above":/below|low/i.test(e)?"below":/in_range|normal|in range/i.test(e)?"in":null}var ib=e=>Math.round(e*10)/10;function lb(e,t){let r=`${Vm(Km(e))} lb`,n=`${Vm(ib(e))} kg`;return t==="kg"?{main:n,other:r}:{main:r,other:n}}function ob(e,t){if(e===null||e.withheld)return null;let r=e.weights.flatMap(e=>{let t=Mm(e.observedOn);return t===null||e.weightKg===null?[]:[{ms:t,kg:e.weightKg}]}).sort((e,t)=>e.ms-t.ms),n=r[r.length-1];if(n===void 0)return null;let i=r.map(e=>Km(e.kg)),l=Math.min(...i),o=Math.max(...i),a=r[0]?.ms??n.ms,s=n.ms-a,d=r.map((e,r)=>({x:s>0?Math.round((3.55+93.45*(e.ms-a)/s)*100)/100:50,y:o>l?Math.round((75-50*((i[r]??l)-l)/(o-l))*10)/10:50,lb:i[r]??0,value:t==="kg"?ib(e.kg):i[r]??0,ms:e.ms})),c=d.length<=4?d:[d[0],d[d.length-1]].filter(e=>e!==void 0),u=lb(n.kg,t);return{latest:u.main,sub:`${u.other} · ${Nm(n.ms)}`,single:d.length===1,points:d,ticks:c.map(e=>({x:e.x,label:Um(e.ms)})),vetCount:d.length}}function ab(e){let t=/* @__PURE__ */new Map;if(e===null||e.withheld)return t;for(let r of e.markers)for(let e of r.points){let n=Mm(e.at);if(n===null)continue;let i=Gm(n),l=t.get(i)??{ms:n,flagged:[],total:0,inRange:0,clinics:/* @__PURE__ */new Set};l.total+=1;let o=nb(e.status);o==="in"&&(l.inRange+=1),(o==="above"||o==="below")&&l.flagged.push({marker:r,point:e,ms:n,flag:o}),e.sourceClinic&&l.clinics.add(e.sourceClinic),t.set(i,l)}return t}function sb(e,t){let r=[];for(let[e,n]of t)n.flagged.forEach((t,i)=>{let l=t.point.value===null?t.point.qualitativeResult??"":Vm(t.point.value),o=t.point.unit??t.marker.unit,a=n.flagged.length===1&&n.inRange===n.total-1&&n.total>1;r.push({key:`lab-${e}-${t.marker.markerId}-${i}`,ms:n.ms,date:`${Nm(n.ms)} · ${jm.bloodPanel}`,title:`${t.marker.name} ${l}${o?` ${o}`:""}, ${t.flag==="above"?jm.aboveRange:jm.belowRange}`,text:a?jm.othersInRange:null,alert:true,markerId:t.marker.markerId,order:0})});let n=e.depth?.withheld===false?e.depth.encounters:[],i=e.timeline?.withheld===false?e.timeline.visits:[],l=/* @__PURE__ */new Set;n.forEach((e,t)=>{let n=Mm(e.date);if(n===null)return;let o=i.find(t=>e.docId!==null&&t.docId===e.docId||Mm(t.visitDate)!==null&&Gm(Mm(t.visitDate)??0)===Gm(n))??null;o!==null&&l.add(o.visitId);let a=o?.summary?.trim()||null,s=e.type?.trim()||null,d=a??s;d!==null&&r.push({key:`enc-${e.encounterId}-${t}`,ms:n,date:a!==null&&s!==null?`${Nm(n)} · ${s}`:Nm(n),title:d,text:null,alert:false,markerId:null,order:1})});for(let e of i){let t=Mm(e.visitDate),n=e.summary?.trim()||null;l.has(e.visitId)||t===null||n===null||r.push({key:`visit-${e.visitId}`,ms:t,date:Nm(t),title:n,text:null,alert:false,markerId:null,order:1})}r.sort((e,t)=>t.ms-e.ms||e.order-t.order);let o=[];for(let e of r){let t={key:e.key,ms:e.ms,date:e.date,title:e.title,text:e.text,alert:e.alert,markerId:e.markerId},r=String(new Date(t.ms).getUTCFullYear()),n=o[o.length-1];n!==void 0&&n.year===r?n.items.push(t):o.push({year:r,items:[t]})}return{years:o,count:r.length}}function db(e,t){let r=e.depth?.withheld===false?e.depth.encounters:[],n=t=>t?.trim()||jm.theirClinic(e.words),i=/* @__PURE__ */new Map;for(let e of r)i.set(n(e.clinicName),(i.get(n(e.clinicName))??0)+1);let l=/* @__PURE__ */new Map,o=i.size===1?[...i.keys()][0]:void 0;for(let r of t.values()){let t=r.clinics.size>0?[...r.clinics].map(n):[o??jm.theirClinic(e.words)];for(let e of t)l.set(e,(l.get(e)??0)+1)}return[.../* @__PURE__ */new Set([...i.keys(),...l.keys()])].map(e=>({label:e,detail:[(i.get(e)??0)>0?jm.visitsCount(i.get(e)??0):null,(l.get(e)??0)>0?jm.panelsCount(l.get(e)??0):null].filter(e=>e!==null).join(" · ")}))}var cb={requested:15,awaiting_clinic:35,awaiting_upload:35,received:60,parsing:75,in_review:90};function ub(e){let t=e.filter(e=>!isTerminalStatus(e.status)).sort((e,t)=>(Mm(t.updatedAt)??0)-(Mm(e.updatedAt)??0))[0];if(t===void 0)return null;let r=(t.waitingExpectation?.trim()||t.statusLabel).trim();return r.length===0?null:{step:r,pct:cb[t.status]??15}}var hb=e=>[...e].sort((e,t)=>(Mm(t.updatedAt)??0)-(Mm(e.updatedAt)??0)),pb=e=>/[.!?]$/.test(e)?e:`${e}.`;function gb(e,t){let r=hb(t).filter(e=>!isTerminalStatus(e.status)),n=r.filter(e=>e.status==="awaiting_upload"),i=r.filter(e=>e.status!=="awaiting_upload"),l=[],o=/* @__PURE__ */new Map;for(let e of i){let t=e.clinicName?.trim()??"";e.source!=="clinic_request"||t===""||o.has(t)||o.set(t,e)}for(let[t,r]of o)l.push({key:`clinic-${t}`,text:jm.onTheWayFrom(e,t),requestId:r.id});let a=i.find(e=>e.source==="owner_provided");a!==void 0&&l.push({key:"upload",text:jm.readingUpload,requestId:a.id});let s=n[0],d=s?.statusLabel.trim()??"";return s!==void 0&&d!==""&&l.push({key:"awaiting-upload",text:pb(d),requestId:s.id}),l}function fb(e){return hb(e).find(e=>!isTerminalStatus(e.status)&&e.status!=="awaiting_upload"&&e.source==="clinic_request"&&(e.clinicName?.trim()??"")!=="")?.clinicName?.trim()??null}function mb(e){if(e===null||e.withheld)return null;let t=e.medications.filter(e=>(e.drugName?.trim()??"")!=="");return t.length===0?null:{current:t.filter(e=>(e.stoppedOn?.trim()??"")==="").map(e=>{let t=[e.dose,e.frequency,e.route].map(e=>e?.trim()??"").filter(e=>e!==""),r=e.sig?.trim()||(t.length>0?t.join(" · "):null);return{key:e.medicationId,name:(e.drugName??"").trim(),detail:r}})}}function bb(e){if(e.some(e=>!isTerminalStatus(e.status)))return null;let t=[...e].sort((e,t)=>(Mm(t.updatedAt)??0)-(Mm(e.updatedAt)??0))[0];if(t===void 0||t.status!=="failed")return null;let r=t.statusLabel.trim();return r.length>0?r:null}function yb(e,t,r){return e!==null&&!e.withheld&&!e.isEmpty||t!==null&&!t.withheld&&t.markers.length>0?true:r!==null&&!r.withheld&&r.encounters.length>0}function vb(e){if(typeof e!="number"||!Number.isFinite(e)||e<=0)return null;let t=Math.floor(e*12+1e-9),r=Math.floor(t/12),n=t%12;return r<=0?`${n}M`:n>0?`${r}Y ${n}M`:`${r}Y`}function wb(e){let{record:t,depth:r,markers:n,nowMs:i}=e,l=yb(t,n,r),o=ub(e.requests),a=ab(n),{vitals:s,observedMs:d}=Zm(t),c=r?.withheld===false?r.encounters:[],u=d===null?null:eb(c,d),h=d!==null&&u?.type?jm.vitalsFrom(e.words,Ym(u.type),Nm(d)):null,p=e.weightUnit??"lb",g=ob(e.timeline,p),f=g!==null?null:e.petWeightKg,m=[e.breed?.trim()||null,vb(e.petAgeYears),g?.latest??(f!==null?lb(f,p).main:null)].filter(e=>e!==null),b=e.timeline?.withheld===false?e.timeline.visits.length:0,y=sb(e,a),v=c.map(e=>Mm(e.date)).filter(e=>e!==null),w=n?.withheld===false?n.markers:[],k=n?.featuredMarkerId??w.find(e=>nb(e.latest?.status)==="above"||nb(e.latest?.status)==="below")?.markerId??w[0]?.markerId??null;return{state:l?"full":o!==null?"onTheWay":"none",meta:m.length>0?m.join(" · "):null,vitals:s,vitalsFrom:h,due:t!==null&&!t.withheld?rb(t.forwardLooking,i):[],labsCount:n?.withheld===false?n.summary?.totalMarkers??n.markers.length:0,featuredMarkerId:k,latestVisit:v.length>0?Wm(Math.max(...v)):null,weight:g,history:y.years,historyCount:y.count,sources:db(e,a),pull:o,hasVisits:c.length>0||b>0,medications:mb(e.timeline),failedRequest:o===null?bb(e.requests):null,inFlight:gb(e.words,e.requests),requestedClinic:fb(e.requests)}}function kb(e){let t=e.points.filter(e=>e.value!==null);return t[t.length-1]??e.points[e.points.length-1]??null}function xb(e){return e===null||e.refLow===null||e.refHigh===null||!Number.isFinite(e.refLow)||!Number.isFinite(e.refHigh)||e.refHigh<=e.refLow?null:{low:e.refLow,high:e.refHigh}}function Tb(e,t=kb(e)){let r=xb(t),n=t?.unit??e.unit,i=t?.value??null;return{markerId:e.markerId,name:e.name,value:i===null?t?.qualitativeResult??"":Vm(i),unit:n,range:r===null?null:`${Vm(r.low)} to ${Vm(r.high)}${n?` ${n}`:""}`,at:r===null||i===null?null:Math.round(Math.min(100,Math.max(0,20+60*(i-r.low)/(r.high-r.low)))),flag:nb(t?.status??e.latest?.status??null)}}function Cb(e){return e==="above"?jm.high:e==="below"?jm.belowRangePill:e==="in"?jm.inRange:null}var _b=e=>{let t=e.replace(/\s+panel$/i,"").trim()||e;return t.length>1&&t[1]===t[1]?.toUpperCase()?t:t.charAt(0).toLowerCase()+t.slice(1)};function Rb(e,t){let r=e.markers.find(e=>e.markerId===t);if(r===void 0)return null;let n=kb(r),i=Tb(r,n),l=Mm(n?.at??r.latest?.at??null),o=xb(n),a=[l===null?null:Nm(l),o===null?jm.noRange:jm.rangeLine(Vm(o.low),Vm(o.high),i.unit)].filter(e=>e!==null).join(" · "),s=r.points.flatMap(e=>{let t=Mm(e.at);return e.value===null||t===null?[]:[{p:e,ms:t,v:e.value}]}),d=[];if(s.length>0){let e=s.map(e=>e.v),t=o?.low??Math.min(...e),r=o?.high??Math.max(...e);d=s.map((e,n)=>({x:s.length===1?50:Math.round((18+64*n/(s.length-1))*100)/100,y:r>t?Math.min(98,Math.max(2,Math.round((75-50*(e.v-t)/(r-t))*10)/10)):50,label:Vm(e.v),out:nb(e.p.status)==="above"||nb(e.p.status)==="below",tick:Nm(e.ms)}))}let c=s[0],u=s[s.length-1],h=null;if(c!==void 0&&u!==void 0&&s.length>=2&&u.v!==c.v){let e=Math.abs(u.v-c.v),t=c.v!==0?Math.round(e/Math.abs(c.v)*100):null,r=u.v>c.v?jm.changeUp(Vm(e),i.unit):jm.changeDown(Vm(e),i.unit);h=t===null?null:{lead:r,rest:jm.changeSince(Nm(c.ms),t)}}let p=[],g=l===null?null:Gm(l),f=e.markers.filter(e=>e.markerId!==r.markerId),m=f.filter(e=>e.panel!==null&&e.panel===r.panel);if(m.length>0&&r.panel!==null){let e=m.map(e=>Tb(e));p.push({title:jm.otherValues(_b(r.panel)),allInRange:e.every(e=>e.flag==="in"),rows:e})}if(g!==null&&l!==null){let e=/* @__PURE__ */new Map;for(let t of f){if(t.panel===null||t.panel===r.panel)continue;let n=[...t.points].reverse().find(e=>{let t=Mm(e.at);return t!==null&&Gm(t)===g});n!==void 0&&e.set(t.panel,[...e.get(t.panel)??[],Tb(t,n)])}for(let[t,r]of e)p.push({title:jm.panelTitle(t,Nm(l)),allInRange:r.every(e=>e.flag==="in"),rows:r})}return{markerId:r.markerId,name:r.name,meta:l===null?null:jm.panelOn(Wm(l)),pill:Cb(i.flag),flagged:i.flag==="above"||i.flag==="below",latest:`${i.value}${i.unit?` ${i.unit}`:""}`,latestSub:a,hasRange:o!==null,chart:d,change:h,meaning:(r.meaning??"").split(/\n\s*\n/).map(e=>e.trim()).filter(e=>e.length>0),groups:p}}var Sb=/* @__PURE__ */Object.freeze({vitalsFromLabel:e=>`Where ${e}’s vitals come from`,vitalsFrom:(e,t)=>`From ${e}’s exam, ${t}. `,examNotes:"Exam notes",onTheWayFrom:(e,t)=>`${e}’s records from ${t} are on the way.`,readingUpload:"We’re reading the document you uploaded.",uploadFormatHint:"Upload PDF records you already have, up to 25 MB each. You can pick several at once. We'll read them and add the results to your records.",uploadLimitHint:"PDFs up to 25 MB each. You can pick several at once.",results:e=>e===1?"result":"results",noScreenings:"No screenings yet",screeningsToReview:e=>`${e} to review`,screeningsClear:"All clear",noVisits:"No visits yet",oneReading:"One reading so far: we’ll plot a trend as more come in.",uploadedDocument:"Uploaded document"}),zb=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ib(e){let t=new Date(e);return`${zb[t.getUTCMonth()]??""} ${t.getUTCDate()}, ${t.getUTCFullYear()}`}function Db(e){let t=Sb,r=e.filter(e=>(e.latest?.qualitativeResult??"").trim().length>0);if(r.length===0)return null;let n=r.filter(e=>Hb(e.latest?.status??null,e.latest?.qualitativeResult??"")),i=n[0]??r[0];return n.length>0?{label:t.screeningsToReview(n.length),flagged:true,markerId:i.markerId}:{label:t.screeningsClear,flagged:false,markerId:i.markerId}}function Hb(e,t){return e==="in_range"?false:e==="above"||e==="below"?true:/negative|not detected|clear|none/i.test(t)?false:/positive|detected|present|reactive/i.test(t)}function Lb(e){let t=e.replace(/_/g," ").trim();return t.length>0?t.charAt(0).toUpperCase()+t.slice(1):e}function Pb(e,t){if(e===null||e.withheld)return[];let r=/* @__PURE__ */new Map;if(t!==null&&!t.withheld)for(let e of t.encounters){let t=e.clinicName?.trim();e.docId!==null&&t&&r.set(e.docId,t)}return Object.values(e.documents).sort((e,t)=>(Mm(t.receivedAt)??0)-(Mm(e.receivedAt)??0)).slice(0,4).reverse().map(e=>{let t=Mm(e.receivedAt);return{key:e.docId,name:r.get(e.docId)??Sb.uploadedDocument,meta:[e.documentClass?Lb(e.documentClass):null,t!==null?Ib(t):null].filter(e=>e!==null).join(" · ")}})}var Ob=["January","February","March","April","May","June","July","August","September","October","November","December"];function $b(e){let t=new Date(e);return`${Ob[t.getUTCMonth()]??""} ${t.getUTCDate()}`}function Bb(e,t){if(t===null||e===null||e.withheld)return null;let r=new Date(t).toISOString().slice(0,10),n=e.encounters.find(e=>{let t=Mm(e.date);return t!==null&&new Date(t).toISOString().slice(0,10)===r}),i=n?.veterinarian?.trim(),l=Mm(n?.date);return i&&l!==null?{vet:i,date:$b(l)}:null}function jb(e,t){let r=Sb;return gb(Bm(e,null),t).map(t=>t.key==="upload"?{...t,text:r.readingUpload}:t.key.startsWith("clinic-")?{...t,text:r.onTheWayFrom(e,t.key.slice(7))}:t)}function Ab(e){let t={url:e.url,kind:e.kind,expiresAt:e.expires_at};return typeof e.loop_duration_ms=="number"&&(t.loopDurationMs=e.loop_duration_ms),typeof e.cache_key=="string"&&e.cache_key.length>0&&(t.cacheKey=e.cache_key),/* @__PURE__ */Object.freeze(t)}function mapPetStateResponse(e){let t={};e.tiers.animation&&(t.animation=Ab(e.tiers.animation)),e.tiers.image&&(t.image=Ab(e.tiers.image));let r={};e.overlays.weather_alert&&(r.weatherAlert=Ab(e.overlays.weather_alert));let n={category:e.category,tiers:/* @__PURE__ */Object.freeze(t),overlays:/* @__PURE__ */Object.freeze(r),idle:"bundled",ttlSeconds:e.ttl_seconds,degraded:e.degraded};return typeof e.cache_epoch=="number"&&(n.cacheEpoch=e.cache_epoch),/* @__PURE__ */Object.freeze(n)}var Eb=/* @__PURE__ */u.enum(["webp","video"]),Fb=/* @__PURE__ */u.enum(["health","attention","moment","activity","mood","idle"]),qb=/* @__PURE__ */u.object({url:/* @__PURE__ */u.string(),kind:/* @__PURE__ */Eb.default("webp"),loop_duration_ms:/* @__PURE__ */u.number().nullish(),expires_at:/* @__PURE__ */u.string(),cache_key:/* @__PURE__ */u.string().nullish()}),Mb=/* @__PURE__ */u.object({category:Fb,tiers:/* @__PURE__ */u.object({animation:/* @__PURE__ */qb.nullish(),image:/* @__PURE__ */qb.nullish()}).default({}),overlays:/* @__PURE__ */u.object({weather_alert:/* @__PURE__ */qb.nullish()}).default({}),idle:/* @__PURE__ */u.literal("bundled").default("bundled"),ttl_seconds:/* @__PURE__ */u.number(),degraded:/* @__PURE__ */u.boolean().default(false),cache_epoch:/* @__PURE__ */u.number().default(0)});function parsePetStateWire(e){let t=Mb.safeParse(e);return t.success?t.data:null}function createPetStateRepository(e){return Nb(createRequestFunnel({auth:e}))}function Nb(e){return{async getState(petRef,t){if(ur(petRef))return err(makeEverfurError("validationFailed",{retryable:false,wireMessage:"pet_ref contains an unpaired surrogate and cannot be encoded"}));let r=`/widget/v1/pets/${encodeURIComponent(petRef)}/state`,n=await e.send("animations.getState",t?.signal?{method:"GET",path:r,signal:t.signal}:{method:"GET",path:r},t?.maxAttempts!==void 0?{maxAttempts:t.maxAttempts}:void 0);if(n.ok){let e=parsePetStateWire(n.value);return e===null?err(makeEverfurError("internalError",{retryable:true})):ok(mapPetStateResponse(e))}return n.error.httpStatus===404?ok(null):err(n.error)}}}var Wb=/* @__PURE__ */Object.freeze({status:"loading"}),Ub=/* @__PURE__ */Object.freeze({status:"none"}),Gb=3e4,Vb=/* @__PURE__ */Object.freeze([2e3,6e3]),Kb=/* @__PURE__ */Object.freeze({animation:false,image:false});function Yb(e,t,r){if(e.kind==="pending")return Wb;if(e.kind==="failed"||e.value===null)return Ub;let{animation:n,image:i}=e.value.tiers;return n!==void 0&&n.kind==="webp"&&!r&&!t.animation?{status:"art",url:n.url,key:n.cacheKey??n.url,animated:true}:i!==void 0&&i.kind==="webp"&&!t.image?{status:"art",url:i.url,key:i.cacheKey??i.url,animated:false}:Ub}function Xb(petRef,e){let t=s(Ir),a=t?.runtime??null,userRef=t?.userRef??null,d=a!==null&&userRef!==null&&petRef!==null?`${userRef}|${petRef}`:null,[c,u]=i({scope:d,read:{kind:"pending"}}),[h,p]=i({scope:d,failed:Kb}),[g,f]=i({scope:d,at:0}),m=c.scope===d?c.read:{kind:"pending"},b=m.kind==="answer"&&m.value===null,y=r({scope:d,n:0});o(()=>{if(d===null||a===null||userRef===null||petRef===null||!e.isFocused||b)return;let t=g.scope===d?g.at:0,r=true,n=typeof AbortController=="function"?new AbortController:null,i=()=>{createPetStateRepository(a.registry.services.authFor(userRef)).getState(petRef,n?{signal:n.signal,maxAttempts:1}:{maxAttempts:1}).then(e=>{if(!r)return;if(e.ok){y.current={scope:d,n:0};let t=e.value;u(e=>t!==null&&t.degraded&&e.scope===d&&e.read.kind==="answer"&&e.read.value!==null?e:{scope:d,read:{kind:"answer",value:t}}),t!==null&&(t.degraded||p({scope:d,failed:Kb}),f({scope:d,at:Date.now()+Math.max(30,t.ttlSeconds)*1e3}));return}if(e.error.httpStatus===403){u({scope:d,read:{kind:"answer",value:null}});return}let t=y.current.scope===d?y.current.n:0,n=Vb[t];y.current={scope:d,n:t+1},u(e=>e.scope===d&&e.read.kind==="answer"?e:n!==void 0?{scope:d,read:{kind:"pending"}}:{scope:d,read:{kind:"failed"}}),f({scope:d,at:Date.now()+(n??Gb)})})},l=Math.max(0,t-Date.now()),o=l===0?null:setTimeout(i,l);return o===null&&i(),()=>{r=false,o!==null&&clearTimeout(o),n?.abort()}},[d,a,userRef,petRef,e.isFocused,b,g]);let v=h.scope===d?h.failed:Kb,w=n(()=>d===null?Ub:Yb(m,v,e.reducedMotion),[d,m,v,e.reducedMotion]),k=l(()=>{w.status==="art"&&p(e=>{let t=e.scope===d?e.failed:Kb;return{scope:d,failed:w.animated?{...t,animation:true}:{...t,image:true}}})},[w,d]);return n(()=>({art:w,onError:k}),[w,k])}var Qb=/* @__PURE__ */Object.freeze({temperature:"Temperature",heartRate:"Heart rate",breathing:"Breathing",vitalsLabel:e=>`Vitals at ${e}’s last exam`,vitalLabel:(e,t,r,n=true)=>`${e}, ${t} ${r}.${n?" More about it":""}`,sayLine:"I wonder what I may be hiding",sayPhrases:["Hmmm","I wonder","what I may be","hiding"],upcomingCare:"Upcoming Care",viewAll:"View all →",dueSoon:"Due soon",later:"Later",nothingDue:e=>`Nothing due for ${e} right now.`,overdueBy:e=>`Overdue by ${e} ${e===1?"day":"days"}`,dueToday:"Due today",dueIn:e=>`Due in ${e} ${e===1?"day":"days"}`,noDueDate:"No due date on file",withDue:(e,t)=>`${e} · due ${t}`,dueOn:e=>`Due ${e}`,thisDay:(e,t)=>`${e} · this ${t}`,inWeeks:(e,t)=>`${e} · in ${t} ${t===1?"week":"weeks"}`,recordsHistory:"Records & History",labs:"Labs & bloodwork",labsA11y:(e,t)=>`Labs and bloodwork, ${e} ${t}`,labsA11yUnknown:"Labs and bloodwork",labsCountUnknown:"--",screenings:"Screenings",screeningsA11y:e=>`Screenings${e!==null?`, ${e}`:""}`,toReview:e=>`${e} to review`,allClear:"All clear",visits:"Visits & records",visitsA11y:e=>`Visits and records${e!==null?`, latest ${e}`:""}`,timeline:"Timeline",events:e=>`${e} events`,timelineA11y:e=>`Timeline${e>0?`, ${e} events`:""}`,weight:"Weight",estimatedRange:"Estimated Optimal Adult Range",noWeights:e=>`No weights on file yet. They show up here from ${e}’s vet visits.`,legendOver:["OVER","WEIGHT"],legendStable:["STABLE"],legendUnder:["UNDER","WEIGHT"],trendSummary:(e,t,r,n,i)=>`${e===1?"1 reading":`${e} readings`}, latest ${t}${e===1?"":`, trend ${r}`}.${n!==null&&i!==null?` Healthy range ${n} to ${i}.`:""}`,pointLabel:(e,t,r)=>e!==null?`${e}, ${t} ${r}`:`${t} ${r}`,addRecords:e=>`Add ${e}’s records`,moreThanOneClinic:"Records can come from more than one clinic over a lifetime.",onFileNow:"On file now",videoVisit:"Everfur video visit",requestFromClinic:"Request from a clinic",uploadDocument:"Upload a document",onTheWay:e=>`${e}’s records are on the way`,clinicsTake:"Clinics usually take 2 to 5 days.",requestSentTo:e=>e!==null?`Request sent to ${e}`:"Request sent",signedRelease:e=>`${e} · you signed the release`,waitingFor:e=>`Waiting for ${e} records`,inHealthTab:e=>`In ${e} Health tab`,everyPageRead:"Every page read: vaccines, labs, visits, meds",today:"Today",anotherClinic:"Another clinic",anotherClinicText:"Seen more than one vet? We ask each one.",uploadText:"A PDF, or a photo of a paper record.",requestTitle:e=>`${e}’s records request`,requestA11y:(e,t)=>`Records request for ${e}. ${t}`,sample:"Sample",peekLead:e=>`A sneak peek at how ${e}’s records will read. Every number links back to the page it came from.`,previousGroup:"Previous group",nextGroup:"Next group",markerGroups:"Marker groups",sampleNotTheirs:e=>`This is a sample, not ${e}’s result.`,sampleNote:e=>` Add ${e} records to see ${e} own numbers. Anything outside the range gets flagged like this, with what it measures and what to ask ${e} vet.`,columns:["Test","Result","Unit","Range"],slideOf:(e,t,r)=>`${e}, ${t} of ${r}`,high:"High",legal:Xn,noVetTitle:e=>`When ${e.name} has a vet, start here.`});function Jb(e){let t=Math.floor(e/12),r=e%12;return t<=0?`${r}m`:r>0?`${t}y ${r}m`:`${t}y`}var Zb={cap:"Read from the lab report, page 2",who:"Chemistry panel",page:"p. 2 of 12"},ey=/* @__PURE__ */Object.freeze([{key:"liver",chip:"Liver",lead:"What the liver makes and clears.",markers:[{name:"ALT",flag:"High",what:"An enzyme found mostly in liver cells.",at:92,value:"118",unit:"U/L"},{name:"ALP",what:"An enzyme from the liver and bones.",at:33,value:"64",unit:"U/L"},{name:"GGT",what:"An enzyme tied to the liver’s bile ducts.",at:36,value:"3",unit:"U/L"},{name:"Total bilirubin",what:"A yellow pigment the liver clears.",at:33,value:"0.2",unit:"mg/dL"}],from:{...Zb,rows:[{test:"ALB",result:"3.2",unit:"g/dL",range:"2.3-4.0"},{test:"ALP",result:"64",unit:"U/L",range:"23-212",lit:true},{test:"ALT",result:"118 H",unit:"U/L",range:"10-100",lit:true},{test:"BUN",result:"18",unit:"mg/dL",range:"7-27"},{test:"GGT",result:"3",unit:"U/L",range:"0-11",lit:true},{test:"T. BILI",result:"0.2",unit:"mg/dL",range:"0.0-0.9",lit:true}]}},{key:"kidney",chip:"Kidney",lead:"What the kidneys filter out and keep in balance.",markers:[{name:"BUN",what:"Protein waste the kidneys filter out.",at:53,value:"18",unit:"mg/dL"},{name:"Creatinine",what:"Muscle waste the kidneys filter out.",at:48,value:"1.1",unit:"mg/dL"},{name:"SDMA",what:"Another measure of kidney filtering.",at:59,value:"9",unit:"µg/dL"},{name:"Phosphorus",what:"A mineral the kidneys keep in balance.",at:42,value:"4.1",unit:"mg/dL"}],from:{...Zb,rows:[{test:"ALT",result:"45",unit:"U/L",range:"10-100"},{test:"BUN",result:"18",unit:"mg/dL",range:"7-27",lit:true},{test:"CA",result:"10.1",unit:"mg/dL",range:"7.9-12.0"},{test:"CREA",result:"1.1",unit:"mg/dL",range:"0.5-1.8",lit:true},{test:"PHOS",result:"4.1",unit:"mg/dL",range:"2.5-6.8",lit:true},{test:"SDMA",result:"9",unit:"µg/dL",range:"0-14",lit:true}]}},{key:"blood",chip:"Blood cells",lead:"The cells that carry oxygen, fight infection and help blood clot.",markers:[{name:"Red blood cells",what:"Cells that carry oxygen around the body.",at:43,value:"6.9",unit:"M/µL"},{name:"Hemoglobin",what:"The part of red cells that holds oxygen.",at:42,value:"15.8",unit:"g/dL"},{name:"White blood cells",what:"Cells that fight infection.",at:44,value:"9.8",unit:"K/µL"},{name:"Platelets",what:"Cell fragments that help blood clot.",at:41,value:"265",unit:"K/µL"}],from:{cap:"Read from the lab report, page 3",who:"Complete blood count",page:"p. 3 of 12",rows:[{test:"HCT",result:"46",unit:"%",range:"37.3-61.7"},{test:"HGB",result:"15.8",unit:"g/dL",range:"13.1-20.5",lit:true},{test:"NEUT",result:"6.1",unit:"K/µL",range:"2.95-11.64"},{test:"PLT",result:"265",unit:"K/µL",range:"148-484",lit:true},{test:"RBC",result:"6.9",unit:"M/µL",range:"5.65-8.87",lit:true},{test:"WBC",result:"9.8",unit:"K/µL",range:"5.05-16.76",lit:true}]}},{key:"sugar",chip:"Sugar and salts",lead:"Fuel, and the salts that keep fluids, nerves and muscles steady.",markers:[{name:"Glucose",what:"Blood sugar, the body’s main fuel.",at:41,value:"96",unit:"mg/dL"},{name:"Sodium",what:"A salt that keeps fluids in balance.",at:31,value:"147",unit:"mmol/L"},{name:"Potassium",what:"A salt that helps nerves and muscles work.",at:49,value:"4.6",unit:"mmol/L"},{name:"Calcium",what:"A mineral for bones, muscles and nerves.",at:52,value:"10.1",unit:"mg/dL"}],from:{...Zb,rows:[{test:"CA",result:"10.1",unit:"mg/dL",range:"7.9-12.0",lit:true},{test:"CL",result:"112",unit:"mmol/L",range:"109-122"},{test:"GLU",result:"96",unit:"mg/dL",range:"70-143",lit:true},{test:"K",result:"4.6",unit:"mmol/L",range:"3.5-5.8",lit:true},{test:"NA",result:"147",unit:"mmol/L",range:"144-160",lit:true},{test:"PHOS",result:"4.1",unit:"mg/dL",range:"2.5-6.8"}]}}]),ty=/* @__PURE__ */Object.freeze([{key:"screenings",title:"Screenings",tint:"pink",lead:"Tests that look for common problems early, and what came back.",rows:[{title:"Heartworm test",pill:"Negative",tone:"clear"},{title:"Tick panel (4Dx)",pill:"Negative",tone:"clear"}]},{key:"visits",title:"Visits & records",tint:"blue",lead:"Every visit, with the vet’s notes and the pages they came from.",rows:[{title:"Wellness exam",text:"38 pages"},{title:"Everfur video visit",text:"3 pages"}]},{key:"timeline",title:"Timeline",tint:"yellow",lead:"Her whole history in order, with what’s due next.",rows:[{title:"Rabies vaccine",pill:"Due soon",tone:"soon"},{title:"Heartworm test",text:"Apr 18"}]}]);var ry=/* @__PURE__ */Object.freeze({ink:"#10462E",go:"#07C168",muted:"#6B6B6B",line:"#E4E4E4",text:"#000000",bg:"#FFFFFF",white:"#FFFFFF",mist:"#F1F5F2",charcoal:"#3D3D3D",alert:"#C03410",alertDeep:"#6D1D14",pink:"#FFC3BC",yellow:"#F2C763",skyBlue:"#4E98C9",tintSage:"#E6ECE8",tintPink:"#FFEAE8",tintPinkSoft:"#FFF6F5",tintBlue:"#EAEEF6",tintYellow:"#FCF0D6",tintYellowEdge:"#F6D892",tintRed:"#FBF1EE",tintGo:"#DCF6EA",icoGrey:"#6B6B6B",icoSage:"#819E90",icoBlue:"#4E98C9",barTrack:"#ECECEC",pillPlainEdge:"rgba(16, 70, 46, 0.2)"}),ny=/* @__PURE__ */Object.freeze({screenTitle:/* @__PURE__ */Object.freeze({size:22,lineHeight:26.4,face:"medium",color:"ink",letterSpacing:-.33}),cardTitle:/* @__PURE__ */Object.freeze({size:18,lineHeight:22.5,face:"bold",color:"ink",letterSpacing:-.36}),body:/* @__PURE__ */Object.freeze({size:17,lineHeight:26.35,face:"regular",color:"text",letterSpacing:0}),bodySm:/* @__PURE__ */Object.freeze({size:15,lineHeight:21.75,face:"regular",color:"text",letterSpacing:0}),bodySmBold:/* @__PURE__ */Object.freeze({size:15,lineHeight:21.75,face:"bold",color:"ink",letterSpacing:0}),fine:/* @__PURE__ */Object.freeze({size:13,lineHeight:18.2,face:"regular",color:"muted",letterSpacing:0}),labelMono:/* @__PURE__ */Object.freeze({size:12,lineHeight:16.8,face:"monoBold",color:"muted",letterSpacing:.72,upper:true}),pill:/* @__PURE__ */Object.freeze({size:12,lineHeight:14.4,face:"monoBold",color:"ink",letterSpacing:.72,upper:true}),button:/* @__PURE__ */Object.freeze({size:15,lineHeight:18,face:"bold",color:"ink",letterSpacing:0}),buttonRow:/* @__PURE__ */Object.freeze({size:14,lineHeight:16.8,face:"bold",color:"ink",letterSpacing:0}),chip:/* @__PURE__ */Object.freeze({size:14,lineHeight:16.8,face:"medium",color:"ink",letterSpacing:0}),hand:/* @__PURE__ */Object.freeze({size:22,lineHeight:26.4,face:"hand",color:"ink",letterSpacing:0})}),iy=/* @__PURE__ */Object.freeze({surface:"#FFFFFF",textPrimary:"#111111",textMuted:"#6E6660",border:"#C8BEB4",brand:"#10462E",brandSoft:"rgba(16, 70, 46, 0.1)",danger:"#B91C1C"}),ly=/* @__PURE__ */Object.freeze({dot:24,check:12,core:10,ring:2,rowGap:12,bodyBottom:18,bodyGap:2,titleGap:8,rail:2,railMin:22,railGap:2,titleSize:14,titleLineHeight:18,dateSize:12,dateLineHeight:16,detailSize:13,detailLineHeight:17,upcomingOpacity:.7});var oy=/* @__PURE__ */Object.freeze({screen:{gap:12,padX:16,padBottom:24,legalTop:20},hero:{nameSize:22,nameLineHeight:26,nameTracking:-.44,metaTop:2,metaLineHeight:18,metaTracking:.26,stageHeight:280,stageTop:4,grassFraction:.46,petBottom:40,petBoxHeight:224,petTop:16,sayWidth:230,sayHeight:61,sayFontSize:22,sayArcPath:"M 12 60 Q 120 -4 228 60",sayViewBox:[240,64],vitalsTop:8,vitalsLeft:8,vitalMinHeight:40,vitalPadX:8,vitalGap:6,vitalIcon:22,vitalValueSize:17,vitalUnitSize:13,lawnOverlap:26,lawnRadius:28},card:{pad:16,radius:20,border:1,headGap:8,headBottom:12},button:{md:52,sm:46,row:36,padMd:24,padSm:16,padRow:14,iconMd:22,iconSm:20,iconRow:17,edge:1.5,gap:8,mdLabel:17,textGap:6,textMinHeight:24},pill:{minHeight:24,padX:10,edgeThin:1.25,edgeThick:1.5},upcoming:{listGap:4,bleed:8,rowPadY:10,rowPadX:8,rowGap:12,rowRadius:10,icon:20,maxRows:4},tiles:{top:8,titleBottom:12,gap:12,pad:16,radius:20,innerGap:8,icon:22,chevron:20,titleLineHeight:19,footMinHeight:28,numSize:20,numLineHeight:22,numTracking:-.4,countGap:8},weight:{headGap:4,headBottom:16,numSize:32,numLineHeight:34,numTracking:-.64,numGap:8},chart:{height:176,plotTop:24,axisBand:20,rightInset:14,indicatorWidth:8,plotLeft:62,dataLeft:76,dot:6,dotRing:1.5,lineWidth:2,labelGap:7,labelMax:12,labelMin:9,labelCharWidth:.62,edgePad:4,legendX:14,legendLine:14.4,legendSize:12,legendTracking:.24,monthY:172,monthSize:12,maxTicks:5,maxValues:8,bandFrom:.3,bandTo:.7,reach:.88,bandPct:.1,lineColor:"#111111",gridColor:"#EAEAEA",bandColor:"#D8F3E3"},add:{gap:12,headGap:8,icon:26,sourcesGap:6,sourcesTop:4,sourcePadY:10,sourcePadX:14,sourceRadius:10,sourceColumnGap:12,actsGap:12,actsTop:4},peek:{top:12,headGap:12,leadTop:8,labsTop:16,chipsTop:10,chipsGap:8,slideTop:16,slideGap:4,slideLeadTop:2,slideLeadBottom:8,markerPad:12,markerGap:8,markerRadius:10,markerTopGap:12,barHeight:8,barDot:12,barDotRing:2,valueGap:4,fromMinHeight:40,fromGap:6,fromIcon:16,fromChevron:18,moreGap:12,moreTop:16,morePad:16,moreInnerGap:12,moreRadius:20,moreIcon:22,moreHeadGap:8,rowsGap:6,rowMinHeight:44,rowPadY:8,rowPadX:14,rowRadius:10,roundButton:36,chipHeight:36,chipPadX:14},onTheWay:{dot:28,titleSize:22,titleLineHeight:25,titleTracking:-.44,wayIcon:26,wayPad:16,wayRadius:20},inProgress:{radius:18,pad:18,gap:16,titleSize:16,titleLineHeight:20,statusRadius:14,statusPad:14,statusSize:13,statusLineHeight:19}});var ay=/* @__PURE__ */new WeakMap;function sy(e){let t=ay.get(e);if(t!==void 0)return t;let r=e.slots.primaryButton,n=/* @__PURE__ */Object.freeze({card:{borderRadius:e.radius.lg,...jn(En(e.slots),1)},button:r===void 0?null:jn(r),buttonInk:r?.textColor,radius:r?.borderRadius===void 0?null:{borderRadius:r.borderRadius}});return ay.set(e,n),n}function dy(){let e=useEverfurTheme();return n(()=>sy(e),[e])}function cy(e){let t=recordsSheetLook(e);if(t.dark)/* @__PURE__ */
|
|
765
|
-
return Object.freeze({dark:true,bg:t.ground,white:t.card,text:t.text,muted:t.muted,line:t.line,charcoal:t.muted,ink:t.ink,fill:t.fill,onFill:t.onFill,accentOnFill:t.accentOnFill,go:t.go,alert:t.alert,alertDeep:t.alertDeep,yellow:t.watch,tintSage:t.tintSage,tintPink:t.tintPartner,tintPinkSoft:t.card,tintBlue:t.tintBlue,tintYellow:t.tintYellow,tintYellowEdge:t.watch,tintRed:t.alertTint,tintGo:t.goTint,icoGrey:t.muted,icoSage:t.chevron,icoBlue:t.wind,barTrack:t.barTrack,pillPlainEdge:t.plainEdge,chartLine:t.text,chartGrid:t.line,chartBand:t.goTint,legacyText:t.text,legacyMuted:t.muted,legacyBorder:t.line,brand:t.ink,brandSoft:ql(t.ink,.1)??t.tintSage,watch:t.watch,tintPartner:t.tintPartner,mist:t.rowGround});let r=co(e),n=r?ry.ink:t.ink;/* @__PURE__ */
|
|
766
|
-
return Object.freeze({dark:
|
|
767
|
-
return
|
|
768
|
-
return j(
|
|
769
|
-
return j(
|
|
770
|
-
return
|
|
771
|
-
|
|
772
|
-
|
|
763
|
+
return Object.freeze(t.flatMap(e=>{let t=widgetPetFromWire(e);return t===null?[]:[t]}))}function createPetsRepository(e){return fm(createRequestFunnel({auth:e}),createRequestFunnel({auth:e,unaryTimeoutMs:rm}))}function fm(e,t=e){let r=(e,t)=>t?{...e,signal:t}:e,n=petRef=>om(petRef,void 0)??`/widget/v1/pets/${encodeURIComponent(petRef)}`;return{async list(t){let n=await e.send("pets.list",r({method:"GET",path:"/widget/v1/pets"},t?.signal));return n.ok?ok(gm(n.value)):err(n.error)},async registerPet(petRef,t,r){let n=om(petRef,t);if(n!==null)return err(n);let i=dm(t);if("error"in i)return err(i.error);let l={method:"POST",path:`/widget/v1/pets/${encodeURIComponent(petRef)}`,body:i.body},o=await e.send("pets.registerPet",r?.signal?{...l,signal:r.signal}:l);return o.ok?ok(hm(o.value,petRef)):err(o.error)},async updatePet(petRef,t,i){let l=n(petRef);if(typeof l!="string")return err(l);let o=sm(t);if("error"in o)return err(o.error);let a=await e.send("pets.updatePet",r({method:"PATCH",path:l,body:o.body},i?.signal));return a.ok?ok(hm(a.value,petRef)):err(a.error)},async getPetProfile(petRef,t){let i=n(petRef);if(typeof i!="string")return err(i);let l=await e.send("pets.getPetProfile",r({method:"GET",path:`${i}/profile`},t?.signal));if(!l.ok)return err(l.error);let o=pm(l.value);return o===null?err(makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:"the pet profile response carried no pet_ref"})):ok(o)},async deletePet(petRef,t){let i=n(petRef);if(typeof i!="string")return err(i);let l=await e.send("pets.deletePet",r({method:"DELETE",path:i},t?.signal));return l.ok?ok(void 0):err(l.error)},async eraseUserData(e){let n=await t.send("pets.eraseUserData",r({method:"DELETE",path:"/widget/v1/me"},e?.signal),{maxAttempts:1});return n.ok?ok(void 0):err(n.error)}}}var mm=/* @__PURE__ */new WeakMap;function bm(e,t){let r=mm.get(e);return r===void 0&&(r=/* @__PURE__ */new Set,mm.set(e,r)),r.add(t),()=>{r?.delete(t)}}function useEverfurPets(){let{runtime:e,userRef:userRef,activePet:t,scopeEpoch:a}=Dr(),s=n(()=>createPetsRepository(e.registry.services.authFor(userRef)),[e,userRef,a]),[d,c]=i({repository:s,pets:[],loading:true,error:null}),u=d.repository===s?d:{pets:[],loading:true,error:null},h=r(0),p=l(async()=>{let e=++h.current;c(e=>({...e,repository:s,loading:true,error:null,pets:e.repository===s?e.pets:[]}));let t=await s.list();e===h.current&&c(t.ok?{repository:s,pets:t.value,loading:false,error:null}:e=>({repository:s,pets:e.repository===s?e.pets:[],loading:false,error:t.error}))},[s]);o(()=>(p(),()=>{h.current+=1}),[p]),o(()=>bm(e,()=>{p()}),[e,p]);let g=n(()=>t===null?null:u.pets.find(e=>e.petRef===t)??null,[t,u.pets]);return n(()=>({pets:u.pets,activePet:g,loading:u.loading,error:u.error,refresh:p}),[u.pets,u.loading,u.error,g,p])}var ym=()=>()=>{},vm=()=>null;function wm(e,t){return d(t?.subscribe??ym,t?.get??vm,t?.get??vm)??e}var km=/* @__PURE__ */Object.freeze(["ask","vet","plan","records"]),xm=/* @__PURE__ */Object.freeze({chatAnswerStyle:"cards",chatHistoryStyle:"sheet",chatTopCard:"focus",chatFollowUpCount:3,chatFollowUpsExcludeTelevet:false,chatComposerMic:true,chatComposerUpload:true,safetyDisclaimerPlacement:"composer",healthPlanLayout:"focus_plan",recordsTopRiskLine:true,recordsClearResultsFilter:true,chatComposerStyle:"compact",chatComposerPlaceholder:"pet_name",chatHistoryBar:"scroll",chatGeneralBanner:true,chatSendButton:"always_dark",chatTextingAsk:true,serverSlots:false,shellTabs:null,shellHeader:"classic"}),Tm=/* @__PURE__ */Object.freeze({chatAnswerStyle:"chat_answer_style",chatHistoryStyle:"chat_history_style",chatTopCard:"chat_top_card",chatFollowUpCount:"chat_follow_up_count",chatFollowUpsExcludeTelevet:"chat_follow_ups_exclude_televet",chatComposerMic:"chat_composer_mic",chatComposerUpload:"chat_composer_upload",safetyDisclaimerPlacement:"safety_disclaimer_placement",healthPlanLayout:"health_plan_layout",recordsTopRiskLine:"records_top_risk_line",recordsClearResultsFilter:"records_clear_results_filter",chatComposerStyle:"chat_composer_style",chatComposerPlaceholder:"chat_composer_placeholder",chatHistoryBar:"chat_history_bar",chatGeneralBanner:"chat_general_banner",chatSendButton:"chat_send_button",chatTextingAsk:"chat_texting_ask",serverSlots:"server_slots",shellTabs:"shell_tabs",shellHeader:"shell_header"}),Cm=Object.keys(Tm),_m="presentation",Rm="presentation.";var Sm={chatAnswerStyle:["bubbles","cards"],chatHistoryStyle:["drawer","sheet"],chatTopCard:["none","focus"],safetyDisclaimerPlacement:["composer","answer_footer","none"],healthPlanLayout:["standard","focus_plan"],chatComposerStyle:["standard","compact"],chatComposerPlaceholder:["generic","pet_name"],chatHistoryBar:["pinned","scroll"],chatSendButton:["always_dark","dim_when_empty"],shellHeader:["classic","tabs_bar"]};function zm(e){if(!Array.isArray(e)||e.length===0)return;let t=/* @__PURE__ */new Set;for(let r of e){if(typeof r!="string"||!km.includes(r)||t.has(r))return;t.add(r)}/* @__PURE__ */
|
|
764
|
+
return Object.freeze([...e])}var Im=/* @__PURE__ */new Set(["chatFollowUpsExcludeTelevet","chatComposerMic","chatComposerUpload","recordsTopRiskLine","recordsClearResultsFilter","chatGeneralBanner","chatTextingAsk","serverSlots"]);function Dm(e,t){if(t==null)return;if(e==="shellTabs")return zm(t);let r=Sm[e];return r!==void 0?typeof t=="string"&&r.includes(t)?t:void 0:Im.has(e)?typeof t=="boolean"?t:void 0:typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=3?t:void 0}function parsePresentation(e){if(e===null||typeof e!="object"||Array.isArray(e))return null;let t=e,r={};for(let e of Cm){let n=Tm[e],i=Object.prototype.hasOwnProperty.call(t,n)?t[n]:t[e],l=Dm(e,i);l!==void 0&&(r[e]=l)}return Object.keys(r).length===0?null:/* @__PURE__ */Object.freeze(r)}function isPresentationFieldLocked(e,t){if(t==null)return false;let r=`${Rm}${Tm[e]}`;for(let e of t)if(e===_m||e===r)return true;return false}function resolvePresentation(e){let t=parsePresentation(e?.server??null)??{},{safetyDisclaimerPlacement:r,...n}=t,i=r==="none"||r===void 0?n:{...n,safetyDisclaimerPlacement:r},l=parsePresentation(e?.client??null)??{},o=e?.locked?[...e.locked]:null,a={};for(let e of Cm){let t=i[e],r=isPresentationFieldLocked(e,o)?void 0:l[e];a[e]=r??t??xm[e]}/* @__PURE__ */
|
|
765
|
+
return Object.freeze(a)}var Hm=/* @__PURE__ */Object.freeze({branding:null}),Lm=/* @__PURE__ */Object.freeze({subscribe:()=>()=>{},getSnapshot:()=>Hm});function Pm(e){return e?Object.keys(e).sort().map(t=>`${t}=${String(e[t])}`).join("&"):""}function useEverfurPresentation(e){return Om(e).presentation}function Om(e){let{runtime:t}=Dr(),r=t?.entitlements??Lm,i=l(()=>r.getSnapshot()?.branding??null,[r]),o=wm(d(r.subscribe,i,i),t?.sdkConfigHost?.branding),a=Pm(e);return n(()=>{let t=o?.lockedFields??null;return{presentation:resolvePresentation({server:o?.presentation??null,locked:t,client:e??null}),isLocked:e=>isPresentationFieldLocked(e,t)}},[o,a])}var $m=3600*1e3;function Bm(e,t=true){let[n,l]=i(()=>e??Date.now()),a=r(true);return o(()=>{if(a.current){a.current=false;return}e===void 0&&t&&l(Date.now())},[e,t]),o(()=>{if(e!==void 0||!t)return;let r=setInterval(()=>l(Date.now()),$m),n=()=>{document.visibilityState==="visible"&&l(Date.now())},i=typeof document<"u"&&typeof document.addEventListener=="function"?document:null;return i?.addEventListener("visibilitychange",n),()=>{clearInterval(r),i?.removeEventListener("visibilitychange",n)}},[e,t]),e??n}var jm=e=>e.charAt(0).toUpperCase()+e.slice(1);function Am(e,t){let r=e.trim(),n=r.length>0?r:Qn,i=jm(n);return t==="her"?{name:n,Name:i,poss:"her",Poss:"Her",subj:"she"}:t==="his"?{name:n,Name:i,poss:"his",Poss:"His",subj:"he"}:{name:n,Name:i,poss:`${n}'s`,Poss:`${i}'s`,subj:n}}var Em=/* @__PURE__ */Object.freeze({vitalsFrom:(e,t,r)=>`Vitals from ${e.poss} ${t}, ${r}`,vitalsSource:e=>`Where ${e.name}'s vitals come from`,temperature:"Temperature",heartRate:"Heart rate",breathing:"Breathing",upcomingCare:"Upcoming care",overdueBy:e=>`Overdue · due by ${e}`,dueSoon:"Due soon",later:"Later",noDate:"No date",dueIn:(e,t)=>`Due ${e} · in ${t} ${t===1?"day":"days"}`,dueToday:e=>`Due ${e} · today`,overdueByDays:(e,t)=>`Overdue by ${t} ${t===1?"day":"days"} · due ${e}`,recordsHistory:"Records & history",labs:"Labs & bloodwork",results:"results",screenings:"Screenings",screeningsClear:"All clear",screeningsToReview:e=>`${e} to review`,noScreenings:"No screenings yet",visits:"Visits & records",timeline:"Timeline",events:e=>`${e} ${e===1?"event":"events"}`,weight:"Weight",vetVisits:e=>`${e} vet ${e===1?"visit":"visits"}`,history:"History",theirClinic:e=>`${e.Poss} clinic`,bloodPanel:"Blood panel",aboveRange:"above range",belowRange:"below range",othersInRange:"Other values in range.",addRecords:e=>`Add ${e.name}'s records`,moreThanOneClinic:"Records can come from more than one clinic over a lifetime.",visitsCount:e=>`${e} ${e===1?"visit":"visits"}`,panelsCount:e=>`${e} blood ${e===1?"panel":"panels"}`,requestFromClinic:"Request from a clinic",uploadDocument:"Upload a document",onFileNow:"On file now",firstRecord:e=>`Add ${e.name}'s first record`,firstLead:e=>`Records can come from more than one clinic over a lifetime. Start with the one ${e.subj} sees most, and this page fills in from there.`,requestFromTheirClinic:e=>`Request from ${e.poss} clinic`,requestDetail:"We send a secure request and read every page they send back.",uploadDetail:"A PDF, or a photo of a paper record.",findClinic:e=>`Find ${e.name}'s clinic`,chooseFile:"Choose a file",sayBeats:/* @__PURE__ */Object.freeze(["Hmmm","I wonder","what I may be","hiding"]),sayStill:"I wonder what I may be hiding",sample:"Sample",peekLead:e=>`A sneak peek at how ${e.name}'s records will read. Every number links back to the page it came from.`,sampleNote:e=>`Sample data until ${e.poss} records arrive.`,onTheWay:e=>`${e.Name}'s records are on the way`,clinicsTake:"Clinics usually take 2 to 5 days.",anotherClinic:"Another clinic",anotherClinicDetail:"Seen more than one vet? We ask each one.",noDueDate:"No due date on file",noLabs:e=>`No lab results on file for ${e.name} yet. They show up here when a record includes a blood or urine panel.`,noVisits:e=>`No visits in ${e.name}'s records yet. They show up here when a record includes one.`,oneReading:"One reading so far: we'll plot a trend as more come in.",takingNow:"Taking now",noCurrentMeds:"No current medications on file.",noVetTitle:e=>`When ${e.name} has a vet, start here.`,requestedFrom:e=>`Requested from ${e}. Clinics usually take 2 to 5 days.`,onTheWayFrom:(e,t)=>`${e.Name}'s records from ${t} are on the way.`,readingUpload:"We're reading the document you uploaded.",seeWhereItStands:"See where it stands",topRisk:e=>`${e.Poss} top risk`,seePlan:e=>`See ${e.poss} Health Plan`,panelOn:e=>`${e} blood panel`,latestReading:"Latest reading",rangeLine:(e,t,r)=>`range ${e} to ${t}${r?` ${r}`:""}`,noRange:"No range on the report",above:"Above",inRange:"In range",below:"Below",high:"High",belowRangePill:"Below range",changeUp:(e,t)=>`Up ${e}${t?` ${t}`:""}`,changeDown:(e,t)=>`Down ${e}${t?` ${t}`:""}`,changeSince:(e,t)=>` since ${e}, about ${t}%.`,whatIs:e=>`What ${e} is`,otherValues:e=>`Other ${e} values`,panelTitle:(e,t)=>`${e} · ${t}`,askAboutThis:"Ask about this"});var Fm=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function qm(e){if(e==null||e.length===0)return null;let t=Date.parse(/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T00:00:00Z`:e);return Number.isNaN(t)?null:t}function Mm(e){let t=new Date(e);return`${Fm[t.getUTCMonth()]??""} ${t.getUTCDate()}`}var Nm=864e5,Wm=30,Um=2.20462;function Gm(e){return`${Mm(e)}, ${new Date(e).getUTCFullYear()}`}function Vm(e){let t=new Date(e);return`${t.getUTCMonth()+1}/${String(t.getUTCFullYear()%100).padStart(2,"0")}`}var Km=e=>new Date(e).toISOString().slice(0,10);function Ym(e){return String(Math.round(e*100)/100)}var Xm=e=>Math.round(e*Um*10)/10;function Qm(e){let t=e.trim();return t.length<2||t[1]===t[1]?.toUpperCase()?t:t.charAt(0).toLowerCase()+t.slice(1)}function Jm(e){return/temp/i.test(e)?"temp":/heart|pulse/i.test(e)?"heart":/resp|breath/i.test(e)?"breath":null}var Zm=["temp","heart","breath"],eb={temp:Em.temperature,heart:Em.heartRate,breath:Em.breathing};function tb(e){if(e===null||e.withheld)return{vitals:[],observedMs:null};let t=/* @__PURE__ */new Map;for(let r of e.entities){if(r.category!=="vital"||r.value===null||r.value.trim().length===0)continue;let e=Jm(`${r.canonicalKey??""} ${r.key} ${r.label}`);if(e===null)continue;let n=qm(r.observedAt)??0,i=t.get(e);(i===void 0||n>i.ms)&&t.set(e,{value:r.value.trim(),unit:r.unit,ms:n})}let r=Zm.flatMap(e=>{let r=t.get(e);return r===void 0?[]:[{kind:e,value:r.value,unit:r.unit,label:eb[e]}]}),n=[...t.values()].map(e=>e.ms).filter(e=>e>0);return{vitals:r,observedMs:n.length>0?Math.max(...n):null}}function rb(e,t){let r=Km(t);return e.find(e=>{let t=qm(e.date);return t!==null&&Km(t)===r})??null}function nb(e){return/vaccin|rabies|dhpp|booster|bordetella|lepto|lyme|parvo|distemper/i.test(e)?"efi-shield":/\b(alt|alp|lab|labs|blood|panel|bloodwork|urinalysis|chemistry|cbc)\b/i.test(e)?"efi-flask-sm":"efi-calendar"}function ib(e,t){return e.map(e=>{let r=qm(e.dueAt),n=nb(e.title);if(r!==null&&r<t-Nm+1)return{item:e,title:e.title,when:Em.overdueBy(Mm(r)),tone:"alert",pill:null,icon:n};let i=e.detail??(r===null?Em.noDueDate:Gm(r));if(r===null)return{item:e,title:e.title,when:i,tone:"none",pill:null,icon:n};let l=r-t<=Wm*Nm;return{item:e,title:e.title,when:i,tone:l?"watch":"later",pill:l?Em.dueSoon:Em.later,icon:n}})}function lb(e){return e==null?null:/above|high/i.test(e)?"above":/below|low/i.test(e)?"below":/in_range|normal|in range/i.test(e)?"in":null}var ob=e=>Math.round(e*10)/10;function ab(e,t){let r=`${Ym(Xm(e))} lb`,n=`${Ym(ob(e))} kg`;return t==="kg"?{main:n,other:r}:{main:r,other:n}}function sb(e,t){if(e===null||e.withheld)return null;let r=e.weights.flatMap(e=>{let t=qm(e.observedOn);return t===null||e.weightKg===null?[]:[{ms:t,kg:e.weightKg}]}).sort((e,t)=>e.ms-t.ms),n=r[r.length-1];if(n===void 0)return null;let i=r.map(e=>Xm(e.kg)),l=Math.min(...i),o=Math.max(...i),a=r[0]?.ms??n.ms,s=n.ms-a,d=r.map((e,r)=>({x:s>0?Math.round((3.55+93.45*(e.ms-a)/s)*100)/100:50,y:o>l?Math.round((75-50*((i[r]??l)-l)/(o-l))*10)/10:50,lb:i[r]??0,value:t==="kg"?ob(e.kg):i[r]??0,ms:e.ms})),c=d.length<=4?d:[d[0],d[d.length-1]].filter(e=>e!==void 0),u=ab(n.kg,t);return{latest:u.main,sub:`${u.other} · ${Mm(n.ms)}`,single:d.length===1,points:d,ticks:c.map(e=>({x:e.x,label:Vm(e.ms)})),vetCount:d.length}}function db(e){let t=/* @__PURE__ */new Map;if(e===null||e.withheld)return t;for(let r of e.markers)for(let e of r.points){let n=qm(e.at);if(n===null)continue;let i=Km(n),l=t.get(i)??{ms:n,flagged:[],total:0,inRange:0,clinics:/* @__PURE__ */new Set};l.total+=1;let o=lb(e.status);o==="in"&&(l.inRange+=1),(o==="above"||o==="below")&&l.flagged.push({marker:r,point:e,ms:n,flag:o}),e.sourceClinic&&l.clinics.add(e.sourceClinic),t.set(i,l)}return t}function cb(e,t){let r=[];for(let[e,n]of t)n.flagged.forEach((t,i)=>{let l=t.point.value===null?t.point.qualitativeResult??"":Ym(t.point.value),o=t.point.unit??t.marker.unit,a=n.flagged.length===1&&n.inRange===n.total-1&&n.total>1;r.push({key:`lab-${e}-${t.marker.markerId}-${i}`,ms:n.ms,date:`${Mm(n.ms)} · ${Em.bloodPanel}`,title:`${t.marker.name} ${l}${o?` ${o}`:""}, ${t.flag==="above"?Em.aboveRange:Em.belowRange}`,text:a?Em.othersInRange:null,alert:true,markerId:t.marker.markerId,order:0})});let n=e.depth?.withheld===false?e.depth.encounters:[],i=e.timeline?.withheld===false?e.timeline.visits:[],l=/* @__PURE__ */new Set;n.forEach((e,t)=>{let n=qm(e.date);if(n===null)return;let o=i.find(t=>e.docId!==null&&t.docId===e.docId||qm(t.visitDate)!==null&&Km(qm(t.visitDate)??0)===Km(n))??null;o!==null&&l.add(o.visitId);let a=o?.summary?.trim()||null,s=e.type?.trim()||null,d=a??s;d!==null&&r.push({key:`enc-${e.encounterId}-${t}`,ms:n,date:a!==null&&s!==null?`${Mm(n)} · ${s}`:Mm(n),title:d,text:null,alert:false,markerId:null,order:1})});for(let e of i){let t=qm(e.visitDate),n=e.summary?.trim()||null;l.has(e.visitId)||t===null||n===null||r.push({key:`visit-${e.visitId}`,ms:t,date:Mm(t),title:n,text:null,alert:false,markerId:null,order:1})}r.sort((e,t)=>t.ms-e.ms||e.order-t.order);let o=[];for(let e of r){let t={key:e.key,ms:e.ms,date:e.date,title:e.title,text:e.text,alert:e.alert,markerId:e.markerId},r=String(new Date(t.ms).getUTCFullYear()),n=o[o.length-1];n!==void 0&&n.year===r?n.items.push(t):o.push({year:r,items:[t]})}return{years:o,count:r.length}}function ub(e,t){let r=e.depth?.withheld===false?e.depth.encounters:[],n=t=>t?.trim()||Em.theirClinic(e.words),i=/* @__PURE__ */new Map;for(let e of r)i.set(n(e.clinicName),(i.get(n(e.clinicName))??0)+1);let l=/* @__PURE__ */new Map,o=i.size===1?[...i.keys()][0]:void 0;for(let r of t.values()){let t=r.clinics.size>0?[...r.clinics].map(n):[o??Em.theirClinic(e.words)];for(let e of t)l.set(e,(l.get(e)??0)+1)}return[.../* @__PURE__ */new Set([...i.keys(),...l.keys()])].map(e=>({label:e,detail:[(i.get(e)??0)>0?Em.visitsCount(i.get(e)??0):null,(l.get(e)??0)>0?Em.panelsCount(l.get(e)??0):null].filter(e=>e!==null).join(" · ")}))}var hb={requested:15,awaiting_clinic:35,awaiting_upload:35,received:60,parsing:75,in_review:90};function pb(e){let t=e.filter(e=>!isTerminalStatus(e.status)).sort((e,t)=>(qm(t.updatedAt)??0)-(qm(e.updatedAt)??0))[0];if(t===void 0)return null;let r=(t.waitingExpectation?.trim()||t.statusLabel).trim();return r.length===0?null:{step:r,pct:hb[t.status]??15}}var gb=e=>[...e].sort((e,t)=>(qm(t.updatedAt)??0)-(qm(e.updatedAt)??0)),fb=e=>/[.!?]$/.test(e)?e:`${e}.`;function mb(e,t){let r=gb(t).filter(e=>!isTerminalStatus(e.status)),n=r.filter(e=>e.status==="awaiting_upload"),i=r.filter(e=>e.status!=="awaiting_upload"),l=[],o=/* @__PURE__ */new Map;for(let e of i){let t=e.clinicName?.trim()??"";e.source!=="clinic_request"||t===""||o.has(t)||o.set(t,e)}for(let[t,r]of o)l.push({key:`clinic-${t}`,text:Em.onTheWayFrom(e,t),requestId:r.id});let a=i.find(e=>e.source==="owner_provided");a!==void 0&&l.push({key:"upload",text:Em.readingUpload,requestId:a.id});let s=n[0],d=s?.statusLabel.trim()??"";return s!==void 0&&d!==""&&l.push({key:"awaiting-upload",text:fb(d),requestId:s.id}),l}function bb(e){return gb(e).find(e=>!isTerminalStatus(e.status)&&e.status!=="awaiting_upload"&&e.source==="clinic_request"&&(e.clinicName?.trim()??"")!=="")?.clinicName?.trim()??null}function yb(e){if(e===null||e.withheld)return null;let t=e.medications.filter(e=>(e.drugName?.trim()??"")!=="");return t.length===0?null:{current:t.filter(e=>(e.stoppedOn?.trim()??"")==="").map(e=>{let t=[e.dose,e.frequency,e.route].map(e=>e?.trim()??"").filter(e=>e!==""),r=e.sig?.trim()||(t.length>0?t.join(" · "):null);return{key:e.medicationId,name:(e.drugName??"").trim(),detail:r}})}}function vb(e){if(e.some(e=>!isTerminalStatus(e.status)))return null;let t=[...e].sort((e,t)=>(qm(t.updatedAt)??0)-(qm(e.updatedAt)??0))[0];if(t===void 0||t.status!=="failed")return null;let r=t.statusLabel.trim();return r.length>0?r:null}function wb(e,t,r){return e!==null&&!e.withheld&&!e.isEmpty||t!==null&&!t.withheld&&t.markers.length>0?true:r!==null&&!r.withheld&&r.encounters.length>0}function kb(e){if(typeof e!="number"||!Number.isFinite(e)||e<=0)return null;let t=Math.floor(e*12+1e-9),r=Math.floor(t/12),n=t%12;return r<=0?`${n}M`:n>0?`${r}Y ${n}M`:`${r}Y`}function xb(e){let{record:t,depth:r,markers:n,nowMs:i}=e,l=wb(t,n,r),o=pb(e.requests),a=db(n),{vitals:s,observedMs:d}=tb(t),c=r?.withheld===false?r.encounters:[],u=d===null?null:rb(c,d),h=d!==null&&u?.type?Em.vitalsFrom(e.words,Qm(u.type),Mm(d)):null,p=e.weightUnit??"lb",g=sb(e.timeline,p),f=g!==null?null:e.petWeightKg,m=[e.breed?.trim()||null,kb(e.petAgeYears),g?.latest??(f!==null?ab(f,p).main:null)].filter(e=>e!==null),b=e.timeline?.withheld===false?e.timeline.visits.length:0,y=cb(e,a),v=c.map(e=>qm(e.date)).filter(e=>e!==null),w=n?.withheld===false?n.markers:[],k=n?.featuredMarkerId??w.find(e=>lb(e.latest?.status)==="above"||lb(e.latest?.status)==="below")?.markerId??w[0]?.markerId??null;return{state:l?"full":o!==null?"onTheWay":"none",meta:m.length>0?m.join(" · "):null,vitals:s,vitalsFrom:h,due:t!==null&&!t.withheld?ib(t.forwardLooking,i):[],labsCount:n?.withheld===false?n.summary?.totalMarkers??n.markers.length:0,featuredMarkerId:k,latestVisit:v.length>0?Gm(Math.max(...v)):null,weight:g,history:y.years,historyCount:y.count,sources:ub(e,a),pull:o,hasVisits:c.length>0||b>0,medications:yb(e.timeline),failedRequest:o===null?vb(e.requests):null,inFlight:mb(e.words,e.requests),requestedClinic:bb(e.requests)}}function Tb(e){let t=e.points.filter(e=>e.value!==null);return t[t.length-1]??e.points[e.points.length-1]??null}function Cb(e){return e===null||e.refLow===null||e.refHigh===null||!Number.isFinite(e.refLow)||!Number.isFinite(e.refHigh)||e.refHigh<=e.refLow?null:{low:e.refLow,high:e.refHigh}}function _b(e,t=Tb(e)){let r=Cb(t),n=t?.unit??e.unit,i=t?.value??null;return{markerId:e.markerId,name:e.name,value:i===null?t?.qualitativeResult??"":Ym(i),unit:n,range:r===null?null:`${Ym(r.low)} to ${Ym(r.high)}${n?` ${n}`:""}`,at:r===null||i===null?null:Math.round(Math.min(100,Math.max(0,20+60*(i-r.low)/(r.high-r.low)))),flag:lb(t?.status??e.latest?.status??null)}}function Rb(e){return e==="above"?Em.high:e==="below"?Em.belowRangePill:e==="in"?Em.inRange:null}var Sb=e=>{let t=e.replace(/\s+panel$/i,"").trim()||e;return t.length>1&&t[1]===t[1]?.toUpperCase()?t:t.charAt(0).toLowerCase()+t.slice(1)};function zb(e,t){let r=e.markers.find(e=>e.markerId===t);if(r===void 0)return null;let n=Tb(r),i=_b(r,n),l=qm(n?.at??r.latest?.at??null),o=Cb(n),a=[l===null?null:Mm(l),o===null?Em.noRange:Em.rangeLine(Ym(o.low),Ym(o.high),i.unit)].filter(e=>e!==null).join(" · "),s=r.points.flatMap(e=>{let t=qm(e.at);return e.value===null||t===null?[]:[{p:e,ms:t,v:e.value}]}),d=[];if(s.length>0){let e=s.map(e=>e.v),t=o?.low??Math.min(...e),r=o?.high??Math.max(...e);d=s.map((e,n)=>({x:s.length===1?50:Math.round((18+64*n/(s.length-1))*100)/100,y:r>t?Math.min(98,Math.max(2,Math.round((75-50*(e.v-t)/(r-t))*10)/10)):50,label:Ym(e.v),out:lb(e.p.status)==="above"||lb(e.p.status)==="below",tick:Mm(e.ms)}))}let c=s[0],u=s[s.length-1],h=null;if(c!==void 0&&u!==void 0&&s.length>=2&&u.v!==c.v){let e=Math.abs(u.v-c.v),t=c.v!==0?Math.round(e/Math.abs(c.v)*100):null,r=u.v>c.v?Em.changeUp(Ym(e),i.unit):Em.changeDown(Ym(e),i.unit);h=t===null?null:{lead:r,rest:Em.changeSince(Mm(c.ms),t)}}let p=[],g=l===null?null:Km(l),f=e.markers.filter(e=>e.markerId!==r.markerId),m=f.filter(e=>e.panel!==null&&e.panel===r.panel);if(m.length>0&&r.panel!==null){let e=m.map(e=>_b(e));p.push({title:Em.otherValues(Sb(r.panel)),allInRange:e.every(e=>e.flag==="in"),rows:e})}if(g!==null&&l!==null){let e=/* @__PURE__ */new Map;for(let t of f){if(t.panel===null||t.panel===r.panel)continue;let n=[...t.points].reverse().find(e=>{let t=qm(e.at);return t!==null&&Km(t)===g});n!==void 0&&e.set(t.panel,[...e.get(t.panel)??[],_b(t,n)])}for(let[t,r]of e)p.push({title:Em.panelTitle(t,Mm(l)),allInRange:r.every(e=>e.flag==="in"),rows:r})}return{markerId:r.markerId,name:r.name,meta:l===null?null:Em.panelOn(Gm(l)),pill:Rb(i.flag),flagged:i.flag==="above"||i.flag==="below",latest:`${i.value}${i.unit?` ${i.unit}`:""}`,latestSub:a,hasRange:o!==null,chart:d,change:h,meaning:(r.meaning??"").split(/\n\s*\n/).map(e=>e.trim()).filter(e=>e.length>0),groups:p}}var Ib=/* @__PURE__ */Object.freeze({vitalsFromLabel:e=>`Where ${e}’s vitals come from`,vitalsFrom:(e,t)=>`From ${e}’s exam, ${t}. `,examNotes:"Exam notes",onTheWayFrom:(e,t)=>`${e}’s records from ${t} are on the way.`,readingUpload:"We’re reading the document you uploaded.",uploadFormatHint:"Upload PDF records you already have, up to 25 MB each. You can pick several at once. We'll read them and add the results to your records.",uploadLimitHint:"PDFs up to 25 MB each. You can pick several at once.",results:e=>e===1?"result":"results",noScreenings:"No screenings yet",screeningsToReview:e=>`${e} to review`,screeningsClear:"All clear",noVisits:"No visits yet",oneReading:"One reading so far: we’ll plot a trend as more come in.",uploadedDocument:"Uploaded document"}),Db=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Hb(e){let t=new Date(e);return`${Db[t.getUTCMonth()]??""} ${t.getUTCDate()}, ${t.getUTCFullYear()}`}function Lb(e){let t=Ib,r=e.filter(e=>(e.latest?.qualitativeResult??"").trim().length>0);if(r.length===0)return null;let n=r.filter(e=>Pb(e.latest?.status??null,e.latest?.qualitativeResult??"")),i=n[0]??r[0];return n.length>0?{label:t.screeningsToReview(n.length),flagged:true,markerId:i.markerId}:{label:t.screeningsClear,flagged:false,markerId:i.markerId}}function Pb(e,t){return e==="in_range"?false:e==="above"||e==="below"?true:/negative|not detected|clear|none/i.test(t)?false:/positive|detected|present|reactive/i.test(t)}function Ob(e){let t=e.replace(/_/g," ").trim();return t.length>0?t.charAt(0).toUpperCase()+t.slice(1):e}function $b(e,t){if(e===null||e.withheld)return[];let r=/* @__PURE__ */new Map;if(t!==null&&!t.withheld)for(let e of t.encounters){let t=e.clinicName?.trim();e.docId!==null&&t&&r.set(e.docId,t)}return Object.values(e.documents).sort((e,t)=>(qm(t.receivedAt)??0)-(qm(e.receivedAt)??0)).slice(0,4).reverse().map(e=>{let t=qm(e.receivedAt);return{key:e.docId,name:r.get(e.docId)??Ib.uploadedDocument,meta:[e.documentClass?Ob(e.documentClass):null,t!==null?Hb(t):null].filter(e=>e!==null).join(" · ")}})}var Bb=["January","February","March","April","May","June","July","August","September","October","November","December"];function jb(e){let t=new Date(e);return`${Bb[t.getUTCMonth()]??""} ${t.getUTCDate()}`}function Ab(e,t){if(t===null||e===null||e.withheld)return null;let r=new Date(t).toISOString().slice(0,10),n=e.encounters.find(e=>{let t=qm(e.date);return t!==null&&new Date(t).toISOString().slice(0,10)===r}),i=n?.veterinarian?.trim(),l=qm(n?.date);return i&&l!==null?{vet:i,date:jb(l)}:null}function Eb(e,t){let r=Ib;return mb(Am(e,null),t).map(t=>t.key==="upload"?{...t,text:r.readingUpload}:t.key.startsWith("clinic-")?{...t,text:r.onTheWayFrom(e,t.key.slice(7))}:t)}function Fb(e){let t={url:e.url,kind:e.kind,expiresAt:e.expires_at};return typeof e.loop_duration_ms=="number"&&(t.loopDurationMs=e.loop_duration_ms),typeof e.cache_key=="string"&&e.cache_key.length>0&&(t.cacheKey=e.cache_key),/* @__PURE__ */Object.freeze(t)}function mapPetStateResponse(e){let t={};e.tiers.animation&&(t.animation=Fb(e.tiers.animation)),e.tiers.image&&(t.image=Fb(e.tiers.image));let r={};e.overlays.weather_alert&&(r.weatherAlert=Fb(e.overlays.weather_alert));let n={category:e.category,tiers:/* @__PURE__ */Object.freeze(t),overlays:/* @__PURE__ */Object.freeze(r),idle:"bundled",ttlSeconds:e.ttl_seconds,degraded:e.degraded};return typeof e.cache_epoch=="number"&&(n.cacheEpoch=e.cache_epoch),/* @__PURE__ */Object.freeze(n)}var qb=/* @__PURE__ */u.enum(["webp","video"]),Mb=/* @__PURE__ */u.enum(["health","attention","moment","activity","mood","idle"]),Nb=/* @__PURE__ */u.object({url:/* @__PURE__ */u.string(),kind:/* @__PURE__ */qb.default("webp"),loop_duration_ms:/* @__PURE__ */u.number().nullish(),expires_at:/* @__PURE__ */u.string(),cache_key:/* @__PURE__ */u.string().nullish()}),Wb=/* @__PURE__ */u.object({category:Mb,tiers:/* @__PURE__ */u.object({animation:/* @__PURE__ */Nb.nullish(),image:/* @__PURE__ */Nb.nullish()}).default({}),overlays:/* @__PURE__ */u.object({weather_alert:/* @__PURE__ */Nb.nullish()}).default({}),idle:/* @__PURE__ */u.literal("bundled").default("bundled"),ttl_seconds:/* @__PURE__ */u.number(),degraded:/* @__PURE__ */u.boolean().default(false),cache_epoch:/* @__PURE__ */u.number().default(0)});function parsePetStateWire(e){let t=Wb.safeParse(e);return t.success?t.data:null}function createPetStateRepository(e){return Ub(createRequestFunnel({auth:e}))}function Ub(e){return{async getState(petRef,t){if(ur(petRef))return err(makeEverfurError("validationFailed",{retryable:false,wireMessage:"pet_ref contains an unpaired surrogate and cannot be encoded"}));let r=`/widget/v1/pets/${encodeURIComponent(petRef)}/state`,n=await e.send("animations.getState",t?.signal?{method:"GET",path:r,signal:t.signal}:{method:"GET",path:r},t?.maxAttempts!==void 0?{maxAttempts:t.maxAttempts}:void 0);if(n.ok){let e=parsePetStateWire(n.value);return e===null?err(makeEverfurError("internalError",{retryable:true})):ok(mapPetStateResponse(e))}return n.error.httpStatus===404?ok(null):err(n.error)}}}var Gb=/* @__PURE__ */Object.freeze({status:"loading"}),Vb=/* @__PURE__ */Object.freeze({status:"none"}),Kb=3e4,Yb=/* @__PURE__ */Object.freeze([2e3,6e3]),Xb=/* @__PURE__ */Object.freeze({animation:false,image:false});function Qb(e,t,r){if(e.kind==="pending")return Gb;if(e.kind==="failed"||e.value===null)return Vb;let{animation:n,image:i}=e.value.tiers;return n!==void 0&&n.kind==="webp"&&!r&&!t.animation?{status:"art",url:n.url,key:n.cacheKey??n.url,animated:true}:i!==void 0&&i.kind==="webp"&&!t.image?{status:"art",url:i.url,key:i.cacheKey??i.url,animated:false}:Vb}function Jb(petRef,e){let t=s(Ir),a=t?.runtime??null,userRef=t?.userRef??null,d=a!==null&&userRef!==null&&petRef!==null?`${userRef}|${petRef}`:null,[c,u]=i({scope:d,read:{kind:"pending"}}),[h,p]=i({scope:d,failed:Xb}),[g,f]=i({scope:d,at:0}),m=c.scope===d?c.read:{kind:"pending"},b=m.kind==="answer"&&m.value===null,y=r({scope:d,n:0});o(()=>{if(d===null||a===null||userRef===null||petRef===null||!e.isFocused||b)return;let t=g.scope===d?g.at:0,r=true,n=typeof AbortController=="function"?new AbortController:null,i=()=>{createPetStateRepository(a.registry.services.authFor(userRef)).getState(petRef,n?{signal:n.signal,maxAttempts:1}:{maxAttempts:1}).then(e=>{if(!r)return;if(e.ok){y.current={scope:d,n:0};let t=e.value;u(e=>t!==null&&t.degraded&&e.scope===d&&e.read.kind==="answer"&&e.read.value!==null?e:{scope:d,read:{kind:"answer",value:t}}),t!==null&&(t.degraded||p({scope:d,failed:Xb}),f({scope:d,at:Date.now()+Math.max(30,t.ttlSeconds)*1e3}));return}if(e.error.httpStatus===403){u({scope:d,read:{kind:"answer",value:null}});return}let t=y.current.scope===d?y.current.n:0,n=Yb[t];y.current={scope:d,n:t+1},u(e=>e.scope===d&&e.read.kind==="answer"?e:n!==void 0?{scope:d,read:{kind:"pending"}}:{scope:d,read:{kind:"failed"}}),f({scope:d,at:Date.now()+(n??Kb)})})},l=Math.max(0,t-Date.now()),o=l===0?null:setTimeout(i,l);return o===null&&i(),()=>{r=false,o!==null&&clearTimeout(o),n?.abort()}},[d,a,userRef,petRef,e.isFocused,b,g]);let v=h.scope===d?h.failed:Xb,w=n(()=>d===null?Vb:Qb(m,v,e.reducedMotion),[d,m,v,e.reducedMotion]),k=l(()=>{w.status==="art"&&p(e=>{let t=e.scope===d?e.failed:Xb;return{scope:d,failed:w.animated?{...t,animation:true}:{...t,image:true}}})},[w,d]);return n(()=>({art:w,onError:k}),[w,k])}var Zb=/* @__PURE__ */Object.freeze({temperature:"Temperature",heartRate:"Heart rate",breathing:"Breathing",vitalsLabel:e=>`Vitals at ${e}’s last exam`,vitalLabel:(e,t,r,n=true)=>`${e}, ${t} ${r}.${n?" More about it":""}`,sayLine:"I wonder what I may be hiding",sayPhrases:["Hmmm","I wonder","what I may be","hiding"],upcomingCare:"Upcoming Care",viewAll:"View all →",dueSoon:"Due soon",later:"Later",nothingDue:e=>`Nothing due for ${e} right now.`,overdueBy:e=>`Overdue by ${e} ${e===1?"day":"days"}`,dueToday:"Due today",dueIn:e=>`Due in ${e} ${e===1?"day":"days"}`,noDueDate:"No due date on file",withDue:(e,t)=>`${e} · due ${t}`,dueOn:e=>`Due ${e}`,thisDay:(e,t)=>`${e} · this ${t}`,inWeeks:(e,t)=>`${e} · in ${t} ${t===1?"week":"weeks"}`,recordsHistory:"Records & History",labs:"Labs & bloodwork",labsA11y:(e,t)=>`Labs and bloodwork, ${e} ${t}`,labsA11yUnknown:"Labs and bloodwork",labsCountUnknown:"--",screenings:"Screenings",screeningsA11y:e=>`Screenings${e!==null?`, ${e}`:""}`,toReview:e=>`${e} to review`,allClear:"All clear",visits:"Visits & records",visitsA11y:e=>`Visits and records${e!==null?`, latest ${e}`:""}`,timeline:"Timeline",events:e=>`${e} events`,timelineA11y:e=>`Timeline${e>0?`, ${e} events`:""}`,weight:"Weight",estimatedRange:"Estimated Optimal Adult Range",noWeights:e=>`No weights on file yet. They show up here from ${e}’s vet visits.`,legendOver:["OVER","WEIGHT"],legendStable:["STABLE"],legendUnder:["UNDER","WEIGHT"],trendSummary:(e,t,r,n,i)=>`${e===1?"1 reading":`${e} readings`}, latest ${t}${e===1?"":`, trend ${r}`}.${n!==null&&i!==null?` Healthy range ${n} to ${i}.`:""}`,pointLabel:(e,t,r)=>e!==null?`${e}, ${t} ${r}`:`${t} ${r}`,addRecords:e=>`Add ${e}’s records`,moreThanOneClinic:"Records can come from more than one clinic over a lifetime.",onFileNow:"On file now",videoVisit:"Everfur video visit",requestFromClinic:"Request from a clinic",uploadDocument:"Upload a document",onTheWay:e=>`${e}’s records are on the way`,clinicsTake:"Clinics usually take 2 to 5 days.",requestSentTo:e=>e!==null?`Request sent to ${e}`:"Request sent",signedRelease:e=>`${e} · you signed the release`,waitingFor:e=>`Waiting for ${e} records`,inHealthTab:e=>`In ${e} Health tab`,everyPageRead:"Every page read: vaccines, labs, visits, meds",today:"Today",anotherClinic:"Another clinic",anotherClinicText:"Seen more than one vet? We ask each one.",uploadText:"A PDF, or a photo of a paper record.",requestTitle:e=>`${e}’s records request`,requestA11y:(e,t)=>`Records request for ${e}. ${t}`,sample:"Sample",peekLead:e=>`A sneak peek at how ${e}’s records will read. Every number links back to the page it came from.`,previousGroup:"Previous group",nextGroup:"Next group",markerGroups:"Marker groups",sampleNotTheirs:e=>`This is a sample, not ${e}’s result.`,sampleNote:e=>` Add ${e} records to see ${e} own numbers. Anything outside the range gets flagged like this, with what it measures and what to ask ${e} vet.`,columns:["Test","Result","Unit","Range"],slideOf:(e,t,r)=>`${e}, ${t} of ${r}`,high:"High",legal:Xn,noVetTitle:e=>`When ${e.name} has a vet, start here.`});function ey(e){let t=Math.floor(e/12),r=e%12;return t<=0?`${r}m`:r>0?`${t}y ${r}m`:`${t}y`}var ty={cap:"Read from the lab report, page 2",who:"Chemistry panel",page:"p. 2 of 12"},ry=/* @__PURE__ */Object.freeze([{key:"liver",chip:"Liver",lead:"What the liver makes and clears.",markers:[{name:"ALT",flag:"High",what:"An enzyme found mostly in liver cells.",at:92,value:"118",unit:"U/L"},{name:"ALP",what:"An enzyme from the liver and bones.",at:33,value:"64",unit:"U/L"},{name:"GGT",what:"An enzyme tied to the liver’s bile ducts.",at:36,value:"3",unit:"U/L"},{name:"Total bilirubin",what:"A yellow pigment the liver clears.",at:33,value:"0.2",unit:"mg/dL"}],from:{...ty,rows:[{test:"ALB",result:"3.2",unit:"g/dL",range:"2.3-4.0"},{test:"ALP",result:"64",unit:"U/L",range:"23-212",lit:true},{test:"ALT",result:"118 H",unit:"U/L",range:"10-100",lit:true},{test:"BUN",result:"18",unit:"mg/dL",range:"7-27"},{test:"GGT",result:"3",unit:"U/L",range:"0-11",lit:true},{test:"T. BILI",result:"0.2",unit:"mg/dL",range:"0.0-0.9",lit:true}]}},{key:"kidney",chip:"Kidney",lead:"What the kidneys filter out and keep in balance.",markers:[{name:"BUN",what:"Protein waste the kidneys filter out.",at:53,value:"18",unit:"mg/dL"},{name:"Creatinine",what:"Muscle waste the kidneys filter out.",at:48,value:"1.1",unit:"mg/dL"},{name:"SDMA",what:"Another measure of kidney filtering.",at:59,value:"9",unit:"µg/dL"},{name:"Phosphorus",what:"A mineral the kidneys keep in balance.",at:42,value:"4.1",unit:"mg/dL"}],from:{...ty,rows:[{test:"ALT",result:"45",unit:"U/L",range:"10-100"},{test:"BUN",result:"18",unit:"mg/dL",range:"7-27",lit:true},{test:"CA",result:"10.1",unit:"mg/dL",range:"7.9-12.0"},{test:"CREA",result:"1.1",unit:"mg/dL",range:"0.5-1.8",lit:true},{test:"PHOS",result:"4.1",unit:"mg/dL",range:"2.5-6.8",lit:true},{test:"SDMA",result:"9",unit:"µg/dL",range:"0-14",lit:true}]}},{key:"blood",chip:"Blood cells",lead:"The cells that carry oxygen, fight infection and help blood clot.",markers:[{name:"Red blood cells",what:"Cells that carry oxygen around the body.",at:43,value:"6.9",unit:"M/µL"},{name:"Hemoglobin",what:"The part of red cells that holds oxygen.",at:42,value:"15.8",unit:"g/dL"},{name:"White blood cells",what:"Cells that fight infection.",at:44,value:"9.8",unit:"K/µL"},{name:"Platelets",what:"Cell fragments that help blood clot.",at:41,value:"265",unit:"K/µL"}],from:{cap:"Read from the lab report, page 3",who:"Complete blood count",page:"p. 3 of 12",rows:[{test:"HCT",result:"46",unit:"%",range:"37.3-61.7"},{test:"HGB",result:"15.8",unit:"g/dL",range:"13.1-20.5",lit:true},{test:"NEUT",result:"6.1",unit:"K/µL",range:"2.95-11.64"},{test:"PLT",result:"265",unit:"K/µL",range:"148-484",lit:true},{test:"RBC",result:"6.9",unit:"M/µL",range:"5.65-8.87",lit:true},{test:"WBC",result:"9.8",unit:"K/µL",range:"5.05-16.76",lit:true}]}},{key:"sugar",chip:"Sugar and salts",lead:"Fuel, and the salts that keep fluids, nerves and muscles steady.",markers:[{name:"Glucose",what:"Blood sugar, the body’s main fuel.",at:41,value:"96",unit:"mg/dL"},{name:"Sodium",what:"A salt that keeps fluids in balance.",at:31,value:"147",unit:"mmol/L"},{name:"Potassium",what:"A salt that helps nerves and muscles work.",at:49,value:"4.6",unit:"mmol/L"},{name:"Calcium",what:"A mineral for bones, muscles and nerves.",at:52,value:"10.1",unit:"mg/dL"}],from:{...ty,rows:[{test:"CA",result:"10.1",unit:"mg/dL",range:"7.9-12.0",lit:true},{test:"CL",result:"112",unit:"mmol/L",range:"109-122"},{test:"GLU",result:"96",unit:"mg/dL",range:"70-143",lit:true},{test:"K",result:"4.6",unit:"mmol/L",range:"3.5-5.8",lit:true},{test:"NA",result:"147",unit:"mmol/L",range:"144-160",lit:true},{test:"PHOS",result:"4.1",unit:"mg/dL",range:"2.5-6.8"}]}}]),ny=/* @__PURE__ */Object.freeze([{key:"screenings",title:"Screenings",tint:"pink",lead:"Tests that look for common problems early, and what came back.",rows:[{title:"Heartworm test",pill:"Negative",tone:"clear"},{title:"Tick panel (4Dx)",pill:"Negative",tone:"clear"}]},{key:"visits",title:"Visits & records",tint:"blue",lead:"Every visit, with the vet’s notes and the pages they came from.",rows:[{title:"Wellness exam",text:"38 pages"},{title:"Everfur video visit",text:"3 pages"}]},{key:"timeline",title:"Timeline",tint:"yellow",lead:"Her whole history in order, with what’s due next.",rows:[{title:"Rabies vaccine",pill:"Due soon",tone:"soon"},{title:"Heartworm test",text:"Apr 18"}]}]);var iy=/* @__PURE__ */Object.freeze({ink:"#10462E",go:"#07C168",muted:"#6B6B6B",line:"#E4E4E4",text:"#000000",bg:"#FFFFFF",white:"#FFFFFF",mist:"#F1F5F2",charcoal:"#3D3D3D",alert:"#C03410",alertDeep:"#6D1D14",pink:"#FFC3BC",yellow:"#F2C763",skyBlue:"#4E98C9",tintSage:"#E6ECE8",tintPink:"#FFEAE8",tintPinkSoft:"#FFF6F5",tintBlue:"#EAEEF6",tintYellow:"#FCF0D6",tintYellowEdge:"#F6D892",tintRed:"#FBF1EE",tintGo:"#DCF6EA",icoGrey:"#6B6B6B",icoSage:"#819E90",icoBlue:"#4E98C9",barTrack:"#ECECEC",pillPlainEdge:"rgba(16, 70, 46, 0.2)"}),ly=/* @__PURE__ */Object.freeze({screenTitle:/* @__PURE__ */Object.freeze({size:22,lineHeight:26.4,face:"medium",color:"ink",letterSpacing:-.33}),cardTitle:/* @__PURE__ */Object.freeze({size:18,lineHeight:22.5,face:"bold",color:"ink",letterSpacing:-.36}),body:/* @__PURE__ */Object.freeze({size:17,lineHeight:26.35,face:"regular",color:"text",letterSpacing:0}),bodySm:/* @__PURE__ */Object.freeze({size:15,lineHeight:21.75,face:"regular",color:"text",letterSpacing:0}),bodySmBold:/* @__PURE__ */Object.freeze({size:15,lineHeight:21.75,face:"bold",color:"ink",letterSpacing:0}),fine:/* @__PURE__ */Object.freeze({size:13,lineHeight:18.2,face:"regular",color:"muted",letterSpacing:0}),labelMono:/* @__PURE__ */Object.freeze({size:12,lineHeight:16.8,face:"monoBold",color:"muted",letterSpacing:.72,upper:true}),pill:/* @__PURE__ */Object.freeze({size:12,lineHeight:14.4,face:"monoBold",color:"ink",letterSpacing:.72,upper:true}),button:/* @__PURE__ */Object.freeze({size:15,lineHeight:18,face:"bold",color:"ink",letterSpacing:0}),buttonRow:/* @__PURE__ */Object.freeze({size:14,lineHeight:16.8,face:"bold",color:"ink",letterSpacing:0}),chip:/* @__PURE__ */Object.freeze({size:14,lineHeight:16.8,face:"medium",color:"ink",letterSpacing:0}),hand:/* @__PURE__ */Object.freeze({size:22,lineHeight:26.4,face:"hand",color:"ink",letterSpacing:0})}),oy=/* @__PURE__ */Object.freeze({surface:"#FFFFFF",textPrimary:"#111111",textMuted:"#6E6660",border:"#C8BEB4",brand:"#10462E",brandSoft:"rgba(16, 70, 46, 0.1)",danger:"#B91C1C"}),ay=/* @__PURE__ */Object.freeze({dot:24,check:12,core:10,ring:2,rowGap:12,bodyBottom:18,bodyGap:2,titleGap:8,rail:2,railMin:22,railGap:2,titleSize:14,titleLineHeight:18,dateSize:12,dateLineHeight:16,detailSize:13,detailLineHeight:17,upcomingOpacity:.7});var sy=/* @__PURE__ */Object.freeze({screen:{gap:12,padX:16,padBottom:24,legalTop:20},hero:{nameSize:22,nameLineHeight:26,nameTracking:-.44,metaTop:2,metaLineHeight:18,metaTracking:.26,stageHeight:280,stageTop:4,grassFraction:.46,petBottom:40,petBoxHeight:224,petTop:16,sayWidth:230,sayHeight:61,sayFontSize:22,sayArcPath:"M 12 60 Q 120 -4 228 60",sayViewBox:[240,64],vitalsTop:8,vitalsLeft:8,vitalMinHeight:40,vitalPadX:8,vitalGap:6,vitalIcon:22,vitalValueSize:17,vitalUnitSize:13,lawnOverlap:26,lawnRadius:28},card:{pad:16,radius:20,border:1,headGap:8,headBottom:12},button:{md:52,sm:46,row:36,padMd:24,padSm:16,padRow:14,iconMd:22,iconSm:20,iconRow:17,edge:1.5,gap:8,mdLabel:17,textGap:6,textMinHeight:24},pill:{minHeight:24,padX:10,edgeThin:1.25,edgeThick:1.5},upcoming:{listGap:4,bleed:8,rowPadY:10,rowPadX:8,rowGap:12,rowRadius:10,icon:20,maxRows:4},tiles:{top:8,titleBottom:12,gap:12,pad:16,radius:20,innerGap:8,icon:22,chevron:20,titleLineHeight:19,footMinHeight:28,numSize:20,numLineHeight:22,numTracking:-.4,countGap:8},weight:{headGap:4,headBottom:16,numSize:32,numLineHeight:34,numTracking:-.64,numGap:8},chart:{height:176,plotTop:24,axisBand:20,rightInset:14,indicatorWidth:8,plotLeft:62,dataLeft:76,dot:6,dotRing:1.5,lineWidth:2,labelGap:7,labelMax:12,labelMin:9,labelCharWidth:.62,edgePad:4,legendX:14,legendLine:14.4,legendSize:12,legendTracking:.24,monthY:172,monthSize:12,maxTicks:5,maxValues:8,bandFrom:.3,bandTo:.7,reach:.88,bandPct:.1,lineColor:"#111111",gridColor:"#EAEAEA",bandColor:"#D8F3E3"},add:{gap:12,headGap:8,icon:26,sourcesGap:6,sourcesTop:4,sourcePadY:10,sourcePadX:14,sourceRadius:10,sourceColumnGap:12,actsGap:12,actsTop:4},peek:{top:12,headGap:12,leadTop:8,labsTop:16,chipsTop:10,chipsGap:8,slideTop:16,slideGap:4,slideLeadTop:2,slideLeadBottom:8,markerPad:12,markerGap:8,markerRadius:10,markerTopGap:12,barHeight:8,barDot:12,barDotRing:2,valueGap:4,fromMinHeight:40,fromGap:6,fromIcon:16,fromChevron:18,moreGap:12,moreTop:16,morePad:16,moreInnerGap:12,moreRadius:20,moreIcon:22,moreHeadGap:8,rowsGap:6,rowMinHeight:44,rowPadY:8,rowPadX:14,rowRadius:10,roundButton:36,chipHeight:36,chipPadX:14},onTheWay:{dot:28,titleSize:22,titleLineHeight:25,titleTracking:-.44,wayIcon:26,wayPad:16,wayRadius:20},inProgress:{radius:18,pad:18,gap:16,titleSize:16,titleLineHeight:20,statusRadius:14,statusPad:14,statusSize:13,statusLineHeight:19}});var dy=/* @__PURE__ */new WeakMap;function cy(e){let t=dy.get(e);if(t!==void 0)return t;let r=e.slots.primaryButton,n=/* @__PURE__ */Object.freeze({card:{borderRadius:e.radius.lg,...jn(En(e.slots),1)},button:r===void 0?null:jn(r),buttonInk:r?.textColor,radius:r?.borderRadius===void 0?null:{borderRadius:r.borderRadius}});return dy.set(e,n),n}function uy(){let e=useEverfurTheme();return n(()=>cy(e),[e])}function hy(e){let t=recordsSheetLook(e);if(t.dark)/* @__PURE__ */
|
|
766
|
+
return Object.freeze({dark:true,bg:t.ground,white:t.card,text:t.text,muted:t.muted,line:t.line,charcoal:t.muted,ink:t.ink,fill:t.fill,onFill:t.onFill,accentOnFill:t.accentOnFill,go:t.go,alert:t.alert,alertDeep:t.alertDeep,yellow:t.watch,tintSage:t.tintSage,tintPink:t.tintPartner,tintPinkSoft:t.card,tintBlue:t.tintBlue,tintYellow:t.tintYellow,tintYellowEdge:t.watch,tintRed:t.alertTint,tintGo:t.goTint,icoGrey:t.muted,icoSage:t.chevron,icoBlue:t.wind,barTrack:t.barTrack,pillPlainEdge:t.plainEdge,chartLine:t.text,chartGrid:t.line,chartBand:t.goTint,legacyText:t.text,legacyMuted:t.muted,legacyBorder:t.line,brand:t.ink,brandSoft:ql(t.ink,.1)??t.tintSage,watch:t.watch,tintPartner:t.tintPartner,mist:t.rowGround});let r=co(e),n=r?iy.ink:t.ink;/* @__PURE__ */
|
|
767
|
+
return Object.freeze({dark:false,bg:iy.bg,white:iy.white,text:iy.text,muted:iy.muted,line:iy.line,charcoal:iy.charcoal,ink:n,fill:r?iy.ink:t.fill,onFill:r?iy.white:t.onFill,accentOnFill:r?iy.go:t.accentOnFill,go:iy.go,alert:iy.alert,alertDeep:iy.alertDeep,yellow:iy.yellow,tintSage:r?iy.tintSage:t.tintSage,tintPink:r||!uo(e)?iy.tintPink:t.tintPartner,tintPinkSoft:iy.tintPinkSoft,tintBlue:iy.tintBlue,tintYellow:iy.tintYellow,tintYellowEdge:iy.tintYellowEdge,tintRed:iy.tintRed,tintGo:iy.tintGo,icoGrey:iy.icoGrey,icoSage:r?iy.icoSage:t.chevron,icoBlue:iy.icoBlue,barTrack:iy.barTrack,pillPlainEdge:r?iy.pillPlainEdge:t.plainEdge,chartLine:sy.chart.lineColor,chartGrid:sy.chart.gridColor,chartBand:sy.chart.bandColor,legacyText:oy.textPrimary,legacyMuted:oy.textMuted,legacyBorder:oy.border,brand:r?oy.brand:n,brandSoft:r?oy.brandSoft:ql(n,.1)??t.tintSage,watch:t.watch,tintPartner:t.tintPartner,mist:t.rowGround})}var py=/* @__PURE__ */Symbol.for("everfur.sdk.rn.recordsHubKit.v1"),gy=globalThis[py]??=createContext(null);function fy(e,t){let r=hy(e),n=r=>r==="hand"?t!==null?{fontFamily:t}:face(e,"regular"):face(e,r),i=/* @__PURE__ */new Map;return{theme:e,look:r,type:e=>{let t=i.get(e);if(t!==void 0)return t;let l=ly[e],o={...n(l.face),fontSize:l.size,lineHeight:l.lineHeight,color:r[l.color],...l.letterSpacing!==0?{letterSpacing:l.letterSpacing}:{},...l.upper===true?{textTransform:"uppercase"}:{}};return i.set(e,o),o},face:n}}function HubKitProvider({handFamily:e,theme:t,children:r}){let i=useEverfurTheme(),l=t??i,o=n(()=>fy(l,e),[l,e]);/* @__PURE__ */
|
|
768
|
+
return j(gy.Provider,{value:o,children:r})}function my(){let e=useEverfurTheme(),t=n(()=>fy(e,null),[e]);return s(gy)??t}function HubText({variant:e="bodySm",color:t,style:r,children:n,tier:i,...l}){let{type:o}=my();/* @__PURE__ */
|
|
769
|
+
return j(Text,{tier:i??(e==="screenTitle"||e==="cardTitle"?"heading":e==="button"||e==="buttonRow"?"control":e==="pill"||e==="labelMono"||e==="chip"?"compact":"content"),...l,style:[o(e),t!==void 0?{color:t}:null,r],children:n})}var by={accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",pointerEvents:"none"};function HubIcon({name:e,size:t=24,color:r,style:n}){let{look:i}=my(),l=r??i.ink,o;switch(e){case"flask":o=/* @__PURE__ */j(FlaskGlyph,{size:t,color:l});break;case"flask-sm":o=/* @__PURE__ */j(FlaskGlyph,{size:t,color:l});break;case"syringe":o=/* @__PURE__ */j(SyringeGlyph,{size:t,color:l});break;case"calendar":o=/* @__PURE__ */j(CalendarGlyph,{size:t,color:l});break;case"shield":o=/* @__PURE__ */j(ShieldGlyph,{size:t,color:l});break;case"folder":o=/* @__PURE__ */j(FolderGlyph,{size:t,color:l});break;case"clock":o=/* @__PURE__ */j(ClockFaceGlyph,{size:t,color:l});break;case"clip":o=/* @__PURE__ */j(ClipboardGlyph,{size:t,color:l});break;case"download":o=/* @__PURE__ */j(DownloadGlyph2,{size:t,color:l});break;case"upload":o=/* @__PURE__ */j(UploadArrowGlyph,{size:t,color:l});break;case"thermo":o=/* @__PURE__ */j(ThermoGlyph,{size:t,color:l});break;case"heart":o=/* @__PURE__ */j(HeartGlyph,{size:t,color:l});break;case"wind":o=/* @__PURE__ */j(WindGlyph,{size:t,color:l});break;case"file":o=/* @__PURE__ */j(FileGlyph,{size:t,color:l});break;case"check":o=/* @__PURE__ */j(CheckGlyph,{size:t,color:l});break;case"chevron":o=/* @__PURE__ */j(ChevronGlyph,{size:t,color:l,direction:"right"});break;default:o=null}/* @__PURE__ */
|
|
770
|
+
return j(m,{style:[{width:t,height:t,alignItems:"center",justifyContent:"center"},n],...by,children:o})}function HubCard({title:e,titleEnd:t,style:r,children:n,testID:i}){let{look:l}=my(),o=uy();/* @__PURE__ */
|
|
771
|
+
return A(m,{style:[{padding:eo(".efh-card","paddingTop"),backgroundColor:l.white,borderRadius:eo(".efh-card","borderRadius"),shadowColor:"#000000",shadowOpacity:l.dark?0:.09,shadowRadius:3,shadowOffset:{width:0,height:1},elevation:l.dark?0:1,borderWidth:l.dark?sy.card.border:0,borderColor:l.line},o.card,r],testID:i,children:[e!==void 0?/* @__PURE__ */A(m,{style:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:sy.card.headGap,marginBottom:sy.card.headBottom},children:[
|
|
772
|
+
/* @__PURE__ */j(HubText,{variant:"cardTitle",accessibilityRole:"header",style:{flexGrow:1,flexShrink:1},children:e}),t]}):null,n]})}function HubPill({label:e,tone:t="plain",small:r=false,testID:n}){let{look:i}=my(),l={stable:{bg:i.tintGo,fg:i.ink},overdue:{bg:i.white,fg:i.alert,edge:i.alert,w:sy.pill.edgeThin},soon:{bg:i.white,fg:i.ink,edge:i.tintYellowEdge,w:sy.pill.edgeThin},later:{bg:i.white,fg:i.muted,edge:i.line,w:sy.pill.edgeThin},clear:{bg:i.white,fg:i.go,edge:i.go,w:sy.pill.edgeThick},plain:{bg:i.white,fg:i.ink,edge:i.pillPlainEdge,w:sy.pill.edgeThick},high:{bg:i.white,fg:i.alert,edge:i.alert,w:sy.pill.edgeThin},watch:{bg:i.watch,fg:i.ink}}[t],o=r?eo(".efh-tile__foot .efh-pill","fontSize"):eo(".efh-pill","fontSize");/* @__PURE__ */
|
|
773
|
+
return j(m,{testID:n,style:[{alignSelf:"flex-start",maxWidth:"100%",borderRadius:999,justifyContent:"center",backgroundColor:l.bg,minHeight:r?eo(".efh-tile__foot .efh-pill","minHeight"):eo(".efh-pill","minHeight"),paddingHorizontal:r?eo(".efh-tile__foot .efh-pill","paddingLeft"):eo(".efh-pill","paddingLeft")},l.edge!==void 0?{borderWidth:l.w,borderColor:l.edge}:null],children:/* @__PURE__ */j(HubText,{variant:"pill",color:l.fg,numberOfLines:1,style:{fontSize:o,lineHeight:o,letterSpacing:r?eo(".efh-tile__foot .efh-pill","letterSpacing"):eo(".efh-pill","letterSpacing")},children:e})})}function HubButton({label:e,onPress:t,variant:r="primary",size:n="md",icon:i,block:l=false,bold:o=false,style:a,accessibilityLabel:s,accessibilityHint:d,testID:c}){let{look:u,face:h}=my(),p=uy(),g=r==="text",f=r==="primary"?p.buttonInk??u.onFill:u.ink,m=n==="md"?sy.button.md:n==="sm"?sy.button.sm:n==="lg"?eo(".efh-btn","minHeight"):eo(".efh-btn--row","minHeight"),y=n==="md"?sy.button.padMd:n==="sm"?sy.button.padSm:n==="lg"?eo(".efh-btn","paddingLeft"):eo(".efh-btn--row","paddingLeft"),v=n==="row"?sy.button.iconRow:n==="sm"?sy.button.iconSm:sy.button.iconMd,w=g?{flexDirection:"row",alignItems:"center",gap:sy.button.textGap,minHeight:sy.button.textMinHeight}:[{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:sy.button.gap,borderRadius:999,minHeight:m,paddingHorizontal:y},r==="primary"?[n==="row"||n==="lg"?{backgroundColor:u.fill}:{backgroundColor:u.fill,borderWidth:sy.button.edge,borderColor:u.white},p.button]:[{backgroundColor:"transparent",borderWidth:sy.button.edge,borderColor:u.ink},p.radius]];/* @__PURE__ */
|
|
773
774
|
return A(b,{onPress:t,disabled:t===void 0,accessibilityRole:"button",accessibilityLabel:s??e,...d!==void 0?{accessibilityHint:d}:{},hitSlop:n==="row"||g?4:void 0,style:[l?{alignSelf:"stretch"}:null,w,a],testID:c,children:[i!==void 0?/* @__PURE__ */j(HubIcon,{name:i,size:v,color:f}):null,
|
|
774
|
-
/* @__PURE__ */j(HubText,{variant:n==="row"?"buttonRow":"button",color:f,numberOfLines:1,style:[n==="md"&&!g?{fontSize:
|
|
775
|
-
return j(b,{onPress:r,hitSlop:4,accessibilityRole:"button",accessibilityLabel:e,accessibilityState:{selected:t},style:{flexDirection:"row",alignItems:"center",gap:6,borderRadius:999,minHeight:
|
|
776
|
-
return j(b,{onPress:i,disabled:n,hitSlop:4,accessibilityRole:"button",accessibilityLabel:r,accessibilityState:{disabled:n},style:{width:a,height:a,borderRadius:a/2,alignItems:"center",justifyContent:"center",borderWidth:1.5,borderColor:o.ink,backgroundColor:o.white},testID:l,children:/* @__PURE__ */j(HubIcon,{name:e,size:18,style:t!==0?{transform:[{rotate:`${t}deg`}]}:void 0})})}var fy=864e5,my=30,by=60,yy=2.20462,vy=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wy=["January","February","March","April","May","June","July","August","September","October","November","December"],ky=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function xy(e){if(e==null||e.trim()==="")return null;let t=Date.parse(e);return Number.isNaN(t)?null:t}function Ty(e){let t=xy(e);if(t===null)return null;let r=new Date(t),n=r.getUTCFullYear(),i=r.getUTCMonth(),l=r.getUTCDate();return{y:n,m:i,d:l,ms:Date.UTC(n,i,l)}}function Cy(e){let t=new Date(e);return{y:t.getFullYear(),ms:Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()),weekday:t.getDay()}}function _y(e){let t=Math.round(e*10)/10;return Number.isInteger(t)?String(t):t.toFixed(1)}function Ry(e,t,r){let n=typeof t=="number"&&Number.isFinite(t)&&t>0?Jb(Math.floor(t*12+1e-9)):null,i=[e?.trim()||null,n,r?.primary??null].filter(e=>e!==null);return i.length>0?i.join(" · "):null}var Sy=/* @__PURE__ */Object.freeze({dhpp:"DHPP",dhlpp:"DHLPP",dhppi:"DHPPi",dapp:"DAPP",dap:"DAP",fvrcp:"FVRCP",felv:"FeLV",fiv:"FIV",hw:"HW",bcs:"BCS","4dx":"4DX"});function zy(e){return e.split(/[_\s]+/).filter(Boolean).map(e=>Sy[e.toLowerCase()]??e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Iy(e){let t=e.toLowerCase();return t.includes("vacc")||t.includes("booster")||t.includes("rabies")||t.includes("dhpp")?"syringe":t.includes("test")||t.includes("screen")||t.includes("fecal")||t.includes("heartworm")||t.includes("worm")?"flask-sm":"calendar"}function Dy(e,t){let r=/* @__PURE__ */new Map;for(let t of e){let e=t.careItemKey?.trim()||t.title,n=r.get(e),i=xy(t.dueAt),l=n===void 0?null:xy(n.dueAt);(n===void 0||i!==null&&(l===null||i<l))&&r.set(e,t)}let n=Cy(t);return[...r.entries()].map(([e,r])=>{let i=Ty(r.dueAt),l=r.careItemKey?.trim()?zy(r.careItemKey.trim()):r.title;if(i===null)return{at:Number.POSITIVE_INFINITY,row:{key:e,label:l,when:Qb.noDueDate,tone:"upcoming",icon:Iy(e),pill:{label:Qb.later,tone:"later"}}};let o=Math.round((xy(r.dueAt)-t)/fy),a=o<0?"overdue":o<=my?"dueSoon":"upcoming",s=o<0?Qb.overdueBy(-o):o===0?Qb.dueToday:Qb.dueIn(o),d=`${vy[i.m]} ${i.d}`,c=Math.round((i.ms-n.ms)/fy),u;a==="overdue"||c<0?u=Qb.withDue(s,d):c===0?u=s:c<=6?u=new Date(i.ms).getUTCDay()>n.weekday?Qb.thisDay(Qb.dueOn(d),ky[new Date(i.ms).getUTCDay()]):Qb.dueOn(d):c<by?u=Qb.inWeeks(Qb.dueOn(d),Math.round(c/7)):u=Qb.dueOn(i.y===n.y?wy[i.m]:`${wy[i.m]} ${i.y}`);let h=a==="dueSoon"?{label:Qb.dueSoon,tone:"watch"}:a==="upcoming"?{label:Qb.later,tone:"later"}:null;return{at:i.ms,row:{key:e,label:l,when:u,tone:a,icon:Iy(e),pill:h}}}).sort((e,t)=>e.at-t.at).slice(0,oy.upcoming.maxRows).map(e=>e.row)}function Hy(e,t,r,n){let i=t!==null&&!t.withheld,l=i?t.summary?.totalMarkers??t.markers.length:0,o=Sb.results(l),a=Db(i?t.markers:[]),s=a!==null?{label:a.label,tone:a.flagged?"high":"clear",markerId:a.markerId}:null,d=r!==null&&!r.withheld?r.encounters:[],c=n!==null&&!n.withheld?n.visits:[],u=[...d.map(e=>Ty(e.date)),...d.length>0?[]:c.map(e=>Ty(e.visitDate))].filter(e=>e!==null).sort((e,t)=>t.ms-e.ms)[0]??null,h=u===null?null:`${String(u.m+1).padStart(2,"0")}.${String(u.d).padStart(2,"0")}.${u.y}`,p=n!==null&&!n.withheld?n.visits.length+n.vaccines.length+n.weights.length+n.medications.length:0,g=e!==null&&!e.withheld?e.entitySeries.filter(e=>/^(medication|problem)[:|]/.test(e.key)&&e.points.length>0).length:0;return{labsTotal:l,labsNoun:o,screeningsPill:s,visitDate:h,timelineCount:p+g}}function Ly(e,t,r){let n=t!==null&&!t.withheld?t.weights.filter(e=>e.weightKg!==null&&Number.isFinite(e.weightKg)).map(e=>({kg:e.weightKg,date:e.observedOn})):[],i=e!==null&&!e.withheld?e.entities.filter(e=>e.category==="body_weight"&&e.value!==null).map(e=>{let t=Number(e.value);return{kg:/lb/i.test(e.unit??"")?t/yy:t,date:e.observedAt}}).filter(e=>Number.isFinite(e.kg)&&e.kg>0):[],l=(n.length>0?n:i).slice().sort((e,t)=>(xy(e.date)??0)-(xy(t.date)??0));if(l.length===0)return null;let o=l.map(e=>e.kg),a=null;if(o.length>=2){let e=o.slice().sort((e,t)=>e-t),t=Math.floor(e.length/2),r=e.length%2===1?e[t]:(e[t-1]+e[t])/2;r>0&&(a={lowKg:r*(1-oy.chart.bandPct),highKg:r*(1+oy.chart.bandPct)})}let s=l.map(e=>({...e,status:a===null?null:e.kg>a.highKg?"over":e.kg<a.lowKg?"under":"in"})),d=o[o.length-1],c=`${_y(d*yy)} lb`,u=`${_y(d)} kg`,h=l.length===1?Mm(l[0].date):null;return{primary:r==="kg"?u:c,secondary:r==="kg"?c:u,unit:r,points:s,band:a,date:h!==null?Ib(h):null}}function Py(e){let t=xy(e);if(t===null)return null;let r=new Date(t);return`${r.getUTCMonth()+1}/${String(r.getUTCFullYear()%100).padStart(2,"0")}`}function Oy(e){let t=xy(e);if(t===null)return null;let r=new Date(t);return`${r.getUTCMonth()+1}/${r.getUTCFullYear()}`}var $y=(e,t,r)=>Math.max(t,Math.min(r,e));function By(e,t,r,n,i){return r==="start"?$y(e,n,Math.max(n,i-t)):r==="end"?$y(e,Math.min(i,n+t),i):$y(e,n+t/2,Math.max(n+t/2,i-t/2))}function jy(e,t){if(e<=0)return[];if(e<=t)return Array.from({length:e},(e,t)=>t);let r=/* @__PURE__ */new Set;for(let n=0;n<t;n+=1)r.add(Math.round(n*(e-1)/(t-1)));return[...r]}var Ay=8,Ey=.82,Fy=2,qy=.6;function My(e,t){let r=oy.chart,n=r.plotTop,i=r.height-r.axisBand,l=i-n,o=t=>e.unit==="kg"?t:t*yy,a=e.points.slice(-36),s=a.map(e=>e.kg),d,c=0,u=0,h=e.band,p=h!==null&&h.highKg>h.lowKg;if(p){let e=(h.highKg+h.lowKg)/2,t=(h.highKg-h.lowKg)/2,i=s.reduce((t,r)=>Math.max(t,Math.abs(r-e)),0),o=Math.max(t/(r.bandTo-r.bandFrom),i/r.reach),a=e+o;d=e=>n+(a-e)/(2*o)*l,c=d(h.highKg),u=d(h.lowKg)}else{let e=Math.min(...s),t=Math.max(...s);e===t&&(e-=1,t+=1);let r=(t-e)*.15;e-=r,t+=r,d=r=>i-(r-e)/(t-e)*l}let g=p?r.dataLeft:64,f=p?r.plotLeft:12,m=t-r.rightInset,b=a.length,y=e=>b<=1?(g+m)/2:g+e/(b-1)*(m-g),v=a.map(e=>_y(o(e.kg))),w=v.reduce((e,t)=>Math.max(e,t.length),1),k=b>1?(m-g)/(b-1):m-g,x=$y(Math.min(r.labelMax,(k-r.edgePad)/(w*r.labelCharWidth)),r.labelMin,r.labelMax),T=a.map((n,l)=>{let o=y(l),a=d(n.kg),s=v[l],c=l===0?"start":l===b-1?"end":"middle",u=x*Ey,h=i-2,p=a+r.dot+r.labelGap+u,g=n.status==="under"&&p<=h,f=$y(g?p:a-r.dot-r.labelGap,Fy+u,h),m=By(o,s.length*r.labelCharWidth*x,c,r.edgePad,t-r.edgePad);return{x:o,y:a,status:n.status,label:s,labelX:m,labelAnchor:c,labelBaseline:f,spoken:Qb.pointLabel(Oy(n.date),s,e.unit)}}),C=jy(b,r.maxTicks).flatMap(e=>{let n=p?Py(a[e].date):Oy(a[e].date);if(n===null)return[];let i=e===0?"start":e===b-1?"end":"middle";return[{x:By(y(e),n.length*qy*r.monthSize,i,r.edgePad,t-r.edgePad),anchor:i,label:n}]}),_=r.legendLine,R=(e,t,n)=>{let l=e*_,o=$y((t+n)/2-l/2,0,Math.max(0,i-l));return Array.from({length:e},(e,t)=>o+t*_+_/2+r.legendSize*.35)},S=p?[{zone:"over",lines:Qb.legendOver,top:n,bottom:c},{zone:"in",lines:Qb.legendStable,top:c,bottom:u},{zone:"under",lines:Qb.legendUnder,top:u,bottom:i}].map(e=>({zone:e.zone,lines:e.lines,baselines:R(e.lines.length,e.top,e.bottom)})):[],z=s.map(o),I=z[z.length-1]??0,D=z[0]??0,H=I>D?"rising":I<D?"falling":"steady",L=Qb.trendSummary(z.length,_y(I),H,p?_y(o(h.lowKg)):null,p?_y(o(h.highKg)):null);return{width:t,hasBand:p,yBandTop:c,yBandBottom:u,plotTop:n,plotBottom:i,plotLeft:f,dataRight:m,cols:a.map((e,t)=>y(t)),dots:T,showValues:b<=Ay,valueFont:x,months:C,legend:S,summary:L}}var Ny=3.55,Wy=97,Uy=3;function Gy(e){let t=t=>e.unit==="kg"?t:t*yy,r=e.points.slice(-36),n=r.map(e=>e.kg),i=e.band,l=i!==null&&i.highKg>i.lowKg,o;if(l){let e=(i.highKg+i.lowKg)/2,t=(i.highKg-i.lowKg)/2;o=r=>50-(r-e)/(2*t)*50}else{let e=Math.min(...n),t=Math.max(...n);e===t&&(e-=1,t+=1),o=r=>90-(r-e)/(t-e)*80}let a=r.length,s=e=>a<=1?50:Ny+e/(a-1)*(Wy-Ny),d=e=>a<=1?null:e===0?"start":e===a-1?"end":null,c=r.map(e=>e.status==="over"||e.status==="under"||l&&(e.kg>i.highKg||e.kg<i.lowKg)),u=n.map(t),h=u[u.length-1]??0,p=u[0]??0,g=h>p?"rising":h<p?"falling":"steady";return{hasBand:l,points:r.map((e,r)=>({x:s(r),y:$y(o(e.kg),Uy,100-Uy),label:_y(t(e.kg)),out:c[r],edge:d(r)})),allValues:a<=Ay,ticks:jy(a,oy.chart.maxTicks).flatMap(e=>{let t=Py(r[e].date);return t===null?[]:[{x:s(e),label:t,edge:d(e)}]}),legend:[Qb.legendOver.join(" "),Qb.legendStable.join(" "),Qb.legendUnder.join(" ")],summary:Qb.trendSummary(u.length,_y(h),g,l?_y(t(i.lowKg)):null,l?_y(t(i.highKg)):null)}}function Vy(e,t){return Pb(e,t).map(e=>({key:e.key,name:e.name,meta:e.meta.length>0?e.meta:null}))}function Ky(e){let t=xy(e);if(t===null)return null;let r=new Date(t);return`${vy[r.getMonth()]} ${r.getDate()}, ${r.getFullYear()}`}var Yy=typeof __EVERFUR_SDK_VERSION__=="string"&&__EVERFUR_SDK_VERSION__.length>0?__EVERFUR_SDK_VERSION__:Ft,Xy=typeof __EVERFUR_CDN_ORIGIN__=="string"&&__EVERFUR_CDN_ORIGIN__.length>0?__EVERFUR_CDN_ORIGIN__:"https://sdk.everfur.com",Qy=`${Xy}/${Yy}/assets/grass.webp`;var Jy=/* @__PURE__ */Object.freeze({uri:Qy}),Zy=null,EASE_OUT=e=>(Zy??=O.bezier(.23,1,.32,1))(e);function ev(e,t){let n=t?1:0,i=r(new L.Value(n)).current,l=r(new L.Value(n)).current,a=r(new L.Value(n)).current,s=r(new L.Value(n)).current,d=r(t);o(()=>{if(t){for(let e of[i,l,a,s])e.setValue(1);return}if(d.current)return;d.current=true;let e=(e,t,r=0)=>L.timing(e,{toValue:1,duration:t,delay:r,easing:EASE_OUT,useNativeDriver:true}),r=L.parallel([e(i,400,60),e(l,700,60),e(a,820),e(s,360)]);return r.start(),()=>r.stop()},[t,i,l,a,s]);let c=r(null);if(c.current===null||c.current.pet.opacity!==i){let t=a.interpolate({inputRange:[0,1],outputRange:[.35,1]}),r=a.interpolate({inputRange:[0,1],outputRange:[e*.65/2,0]});c.current={pet:{opacity:i,transform:[{translateY:l.interpolate({inputRange:[0,1],outputRange:[16,0]})}]},grass:{opacity:s,transform:[{translateY:r},{scaleY:t}]}}}return c.current}function RiseIn({index:e,reduced:t,children:n}){let i=r(new L.Value(t?1:0)).current;return o(()=>{if(t){i.setValue(1);return}let r=L.timing(i,{toValue:1,duration:400,delay:e*60,easing:EASE_OUT,useNativeDriver:true});return r.start(),()=>r.stop()},[t,e,i]),/* @__PURE__ */j(L.View,{style:{opacity:i,transform:[{translateY:i.interpolate({inputRange:[0,1],outputRange:[8,0]})}]},children:n})}function HubPetArt({art:e,onError:t,reduced:r}){return e.status!=="art"?null:/* @__PURE__ */j(PetImage,{url:e.url,onError:t,reduced:r},e.key)}function PetImage({url:e,onError:t,reduced:n}){let i=r(new L.Value(0)).current,l=()=>{if(n){i.setValue(1);return}L.timing(i,{toValue:1,duration:200,easing:EASE_OUT,useNativeDriver:true}).start()};/* @__PURE__ */
|
|
777
|
-
return j(m,{style:{width:"100%",height:"100%"},testID:"everfur-records-sheet-pet-art",children:/* @__PURE__ */j(L.Image,{source:{uri:e},onLoad:l,onError:t,resizeMode:"contain",style:{width:"100%",height:"100%",opacity:i}})})}var
|
|
778
|
-
return j(L.View,{style:[n,c],testID:i,children:l})}function
|
|
775
|
+
/* @__PURE__ */j(HubText,{variant:n==="row"?"buttonRow":"button",color:f,numberOfLines:1,style:[n==="md"&&!g?{fontSize:sy.button.mdLabel}:null,n==="row"?{fontSize:eo(".efh-btn--row","fontSize"),lineHeight:eo(".efh-btn--row","fontSize")*1.2}:null,n==="lg"?{fontSize:eo(".efh-btn","fontSize"),lineHeight:eo(".efh-btn","fontSize")*1.2}:null,r==="secondary"&&!o?h("regular"):null],children:e})]})}function HubChip({label:e,selected:t,onPress:r,testID:n}){let{look:i}=my();/* @__PURE__ */
|
|
776
|
+
return j(b,{onPress:r,hitSlop:4,accessibilityRole:"button",accessibilityLabel:e,accessibilityState:{selected:t},style:{flexDirection:"row",alignItems:"center",gap:6,borderRadius:999,minHeight:sy.peek.chipHeight,paddingHorizontal:sy.peek.chipPadX,borderWidth:1.5,borderColor:t?i.fill:i.line,backgroundColor:t?i.fill:i.white},testID:n,children:/* @__PURE__ */j(HubText,{variant:"chip",color:t?i.onFill:i.ink,numberOfLines:1,children:e})})}function HubRound({icon:e,rotate:t=0,label:r,disabled:n,onPress:i,testID:l}){let{look:o}=my(),a=sy.peek.roundButton;/* @__PURE__ */
|
|
777
|
+
return j(b,{onPress:i,disabled:n,hitSlop:4,accessibilityRole:"button",accessibilityLabel:r,accessibilityState:{disabled:n},style:{width:a,height:a,borderRadius:a/2,alignItems:"center",justifyContent:"center",borderWidth:1.5,borderColor:o.ink,backgroundColor:o.white},testID:l,children:/* @__PURE__ */j(HubIcon,{name:e,size:18,style:t!==0?{transform:[{rotate:`${t}deg`}]}:void 0})})}var yy=864e5,vy=30,wy=60,ky=2.20462,xy=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ty=["January","February","March","April","May","June","July","August","September","October","November","December"],Cy=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function _y(e){if(e==null||e.trim()==="")return null;let t=Date.parse(e);return Number.isNaN(t)?null:t}function Ry(e){let t=_y(e);if(t===null)return null;let r=new Date(t),n=r.getUTCFullYear(),i=r.getUTCMonth(),l=r.getUTCDate();return{y:n,m:i,d:l,ms:Date.UTC(n,i,l)}}function Sy(e){let t=new Date(e);return{y:t.getFullYear(),ms:Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()),weekday:t.getDay()}}function zy(e){let t=Math.round(e*10)/10;return Number.isInteger(t)?String(t):t.toFixed(1)}function Iy(e,t,r){let n=typeof t=="number"&&Number.isFinite(t)&&t>0?ey(Math.floor(t*12+1e-9)):null,i=[e?.trim()||null,n,r?.primary??null].filter(e=>e!==null);return i.length>0?i.join(" · "):null}var Dy=/* @__PURE__ */Object.freeze({dhpp:"DHPP",dhlpp:"DHLPP",dhppi:"DHPPi",dapp:"DAPP",dap:"DAP",fvrcp:"FVRCP",felv:"FeLV",fiv:"FIV",hw:"HW",bcs:"BCS","4dx":"4DX"});function Hy(e){return e.split(/[_\s]+/).filter(Boolean).map(e=>Dy[e.toLowerCase()]??e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Ly(e){let t=e.toLowerCase();return t.includes("vacc")||t.includes("booster")||t.includes("rabies")||t.includes("dhpp")?"syringe":t.includes("test")||t.includes("screen")||t.includes("fecal")||t.includes("heartworm")||t.includes("worm")?"flask-sm":"calendar"}function Py(e,t){let r=/* @__PURE__ */new Map;for(let t of e){let e=t.careItemKey?.trim()||t.title,n=r.get(e),i=_y(t.dueAt),l=n===void 0?null:_y(n.dueAt);(n===void 0||i!==null&&(l===null||i<l))&&r.set(e,t)}let n=Sy(t);return[...r.entries()].map(([e,r])=>{let i=Ry(r.dueAt),l=r.careItemKey?.trim()?Hy(r.careItemKey.trim()):r.title;if(i===null)return{at:Number.POSITIVE_INFINITY,row:{key:e,label:l,when:Zb.noDueDate,tone:"upcoming",icon:Ly(e),pill:{label:Zb.later,tone:"later"}}};let o=Math.round((_y(r.dueAt)-t)/yy),a=o<0?"overdue":o<=vy?"dueSoon":"upcoming",s=o<0?Zb.overdueBy(-o):o===0?Zb.dueToday:Zb.dueIn(o),d=`${xy[i.m]} ${i.d}`,c=Math.round((i.ms-n.ms)/yy),u;a==="overdue"||c<0?u=Zb.withDue(s,d):c===0?u=s:c<=6?u=new Date(i.ms).getUTCDay()>n.weekday?Zb.thisDay(Zb.dueOn(d),Cy[new Date(i.ms).getUTCDay()]):Zb.dueOn(d):c<wy?u=Zb.inWeeks(Zb.dueOn(d),Math.round(c/7)):u=Zb.dueOn(i.y===n.y?Ty[i.m]:`${Ty[i.m]} ${i.y}`);let h=a==="dueSoon"?{label:Zb.dueSoon,tone:"watch"}:a==="upcoming"?{label:Zb.later,tone:"later"}:null;return{at:i.ms,row:{key:e,label:l,when:u,tone:a,icon:Ly(e),pill:h}}}).sort((e,t)=>e.at-t.at).slice(0,sy.upcoming.maxRows).map(e=>e.row)}function Oy(e,t,r,n){let i=t!==null&&!t.withheld,l=i?t.summary?.totalMarkers??t.markers.length:0,o=Ib.results(l),a=Lb(i?t.markers:[]),s=a!==null?{label:a.label,tone:a.flagged?"high":"clear",markerId:a.markerId}:null,d=r!==null&&!r.withheld?r.encounters:[],c=n!==null&&!n.withheld?n.visits:[],u=[...d.map(e=>Ry(e.date)),...d.length>0?[]:c.map(e=>Ry(e.visitDate))].filter(e=>e!==null).sort((e,t)=>t.ms-e.ms)[0]??null,h=u===null?null:`${String(u.m+1).padStart(2,"0")}.${String(u.d).padStart(2,"0")}.${u.y}`,p=n!==null&&!n.withheld?n.visits.length+n.vaccines.length+n.weights.length+n.medications.length:0,g=e!==null&&!e.withheld?e.entitySeries.filter(e=>/^(medication|problem)[:|]/.test(e.key)&&e.points.length>0).length:0;return{labsTotal:l,labsNoun:o,screeningsPill:s,visitDate:h,timelineCount:p+g}}function $y(e,t,r){let n=t!==null&&!t.withheld?t.weights.filter(e=>e.weightKg!==null&&Number.isFinite(e.weightKg)).map(e=>({kg:e.weightKg,date:e.observedOn})):[],i=e!==null&&!e.withheld?e.entities.filter(e=>e.category==="body_weight"&&e.value!==null).map(e=>{let t=Number(e.value);return{kg:/lb/i.test(e.unit??"")?t/ky:t,date:e.observedAt}}).filter(e=>Number.isFinite(e.kg)&&e.kg>0):[],l=(n.length>0?n:i).slice().sort((e,t)=>(_y(e.date)??0)-(_y(t.date)??0));if(l.length===0)return null;let o=l.map(e=>e.kg),a=null;if(o.length>=2){let e=o.slice().sort((e,t)=>e-t),t=Math.floor(e.length/2),r=e.length%2===1?e[t]:(e[t-1]+e[t])/2;r>0&&(a={lowKg:r*(1-sy.chart.bandPct),highKg:r*(1+sy.chart.bandPct)})}let s=l.map(e=>({...e,status:a===null?null:e.kg>a.highKg?"over":e.kg<a.lowKg?"under":"in"})),d=o[o.length-1],c=`${zy(d*ky)} lb`,u=`${zy(d)} kg`,h=l.length===1?qm(l[0].date):null;return{primary:r==="kg"?u:c,secondary:r==="kg"?c:u,unit:r,points:s,band:a,date:h!==null?Hb(h):null}}function By(e){let t=_y(e);if(t===null)return null;let r=new Date(t);return`${r.getUTCMonth()+1}/${String(r.getUTCFullYear()%100).padStart(2,"0")}`}function jy(e){let t=_y(e);if(t===null)return null;let r=new Date(t);return`${r.getUTCMonth()+1}/${r.getUTCFullYear()}`}var Ay=(e,t,r)=>Math.max(t,Math.min(r,e));function Ey(e,t,r,n,i){return r==="start"?Ay(e,n,Math.max(n,i-t)):r==="end"?Ay(e,Math.min(i,n+t),i):Ay(e,n+t/2,Math.max(n+t/2,i-t/2))}function Fy(e,t){if(e<=0)return[];if(e<=t)return Array.from({length:e},(e,t)=>t);let r=/* @__PURE__ */new Set;for(let n=0;n<t;n+=1)r.add(Math.round(n*(e-1)/(t-1)));return[...r]}var qy=8,My=.82,Ny=2,Wy=.6;function Uy(e,t){let r=sy.chart,n=r.plotTop,i=r.height-r.axisBand,l=i-n,o=t=>e.unit==="kg"?t:t*ky,a=e.points.slice(-36),s=a.map(e=>e.kg),d,c=0,u=0,h=e.band,p=h!==null&&h.highKg>h.lowKg;if(p){let e=(h.highKg+h.lowKg)/2,t=(h.highKg-h.lowKg)/2,i=s.reduce((t,r)=>Math.max(t,Math.abs(r-e)),0),o=Math.max(t/(r.bandTo-r.bandFrom),i/r.reach),a=e+o;d=e=>n+(a-e)/(2*o)*l,c=d(h.highKg),u=d(h.lowKg)}else{let e=Math.min(...s),t=Math.max(...s);e===t&&(e-=1,t+=1);let r=(t-e)*.15;e-=r,t+=r,d=r=>i-(r-e)/(t-e)*l}let g=p?r.dataLeft:64,f=p?r.plotLeft:12,m=t-r.rightInset,b=a.length,y=e=>b<=1?(g+m)/2:g+e/(b-1)*(m-g),v=a.map(e=>zy(o(e.kg))),w=v.reduce((e,t)=>Math.max(e,t.length),1),k=b>1?(m-g)/(b-1):m-g,x=Ay(Math.min(r.labelMax,(k-r.edgePad)/(w*r.labelCharWidth)),r.labelMin,r.labelMax),T=a.map((n,l)=>{let o=y(l),a=d(n.kg),s=v[l],c=l===0?"start":l===b-1?"end":"middle",u=x*My,h=i-2,p=a+r.dot+r.labelGap+u,g=n.status==="under"&&p<=h,f=Ay(g?p:a-r.dot-r.labelGap,Ny+u,h),m=Ey(o,s.length*r.labelCharWidth*x,c,r.edgePad,t-r.edgePad);return{x:o,y:a,status:n.status,label:s,labelX:m,labelAnchor:c,labelBaseline:f,spoken:Zb.pointLabel(jy(n.date),s,e.unit)}}),C=Fy(b,r.maxTicks).flatMap(e=>{let n=p?By(a[e].date):jy(a[e].date);if(n===null)return[];let i=e===0?"start":e===b-1?"end":"middle";return[{x:Ey(y(e),n.length*Wy*r.monthSize,i,r.edgePad,t-r.edgePad),anchor:i,label:n}]}),_=r.legendLine,R=(e,t,n)=>{let l=e*_,o=Ay((t+n)/2-l/2,0,Math.max(0,i-l));return Array.from({length:e},(e,t)=>o+t*_+_/2+r.legendSize*.35)},S=p?[{zone:"over",lines:Zb.legendOver,top:n,bottom:c},{zone:"in",lines:Zb.legendStable,top:c,bottom:u},{zone:"under",lines:Zb.legendUnder,top:u,bottom:i}].map(e=>({zone:e.zone,lines:e.lines,baselines:R(e.lines.length,e.top,e.bottom)})):[],z=s.map(o),I=z[z.length-1]??0,D=z[0]??0,H=I>D?"rising":I<D?"falling":"steady",L=Zb.trendSummary(z.length,zy(I),H,p?zy(o(h.lowKg)):null,p?zy(o(h.highKg)):null);return{width:t,hasBand:p,yBandTop:c,yBandBottom:u,plotTop:n,plotBottom:i,plotLeft:f,dataRight:m,cols:a.map((e,t)=>y(t)),dots:T,showValues:b<=qy,valueFont:x,months:C,legend:S,summary:L}}var Gy=3.55,Vy=97,Ky=3;function Yy(e){let t=t=>e.unit==="kg"?t:t*ky,r=e.points.slice(-36),n=r.map(e=>e.kg),i=e.band,l=i!==null&&i.highKg>i.lowKg,o;if(l){let e=(i.highKg+i.lowKg)/2,t=(i.highKg-i.lowKg)/2;o=r=>50-(r-e)/(2*t)*50}else{let e=Math.min(...n),t=Math.max(...n);e===t&&(e-=1,t+=1),o=r=>90-(r-e)/(t-e)*80}let a=r.length,s=e=>a<=1?50:Gy+e/(a-1)*(Vy-Gy),d=e=>a<=1?null:e===0?"start":e===a-1?"end":null,c=r.map(e=>e.status==="over"||e.status==="under"||l&&(e.kg>i.highKg||e.kg<i.lowKg)),u=n.map(t),h=u[u.length-1]??0,p=u[0]??0,g=h>p?"rising":h<p?"falling":"steady";return{hasBand:l,points:r.map((e,r)=>({x:s(r),y:Ay(o(e.kg),Ky,100-Ky),label:zy(t(e.kg)),out:c[r],edge:d(r)})),allValues:a<=qy,ticks:Fy(a,sy.chart.maxTicks).flatMap(e=>{let t=By(r[e].date);return t===null?[]:[{x:s(e),label:t,edge:d(e)}]}),legend:[Zb.legendOver.join(" "),Zb.legendStable.join(" "),Zb.legendUnder.join(" ")],summary:Zb.trendSummary(u.length,zy(h),g,l?zy(t(i.lowKg)):null,l?zy(t(i.highKg)):null)}}function Xy(e,t){return $b(e,t).map(e=>({key:e.key,name:e.name,meta:e.meta.length>0?e.meta:null}))}function Qy(e){let t=_y(e);if(t===null)return null;let r=new Date(t);return`${xy[r.getMonth()]} ${r.getDate()}, ${r.getFullYear()}`}var Jy=typeof __EVERFUR_SDK_VERSION__=="string"&&__EVERFUR_SDK_VERSION__.length>0?__EVERFUR_SDK_VERSION__:Ft,Zy=typeof __EVERFUR_CDN_ORIGIN__=="string"&&__EVERFUR_CDN_ORIGIN__.length>0?__EVERFUR_CDN_ORIGIN__:"https://sdk.everfur.com",ev=`${Zy}/${Jy}/assets/grass.webp`;var tv=/* @__PURE__ */Object.freeze({uri:ev}),rv=null,EASE_OUT=e=>(rv??=O.bezier(.23,1,.32,1))(e);function nv(e,t){let n=t?1:0,i=r(new L.Value(n)).current,l=r(new L.Value(n)).current,a=r(new L.Value(n)).current,s=r(new L.Value(n)).current,d=r(t);o(()=>{if(t){for(let e of[i,l,a,s])e.setValue(1);return}if(d.current)return;d.current=true;let e=(e,t,r=0)=>L.timing(e,{toValue:1,duration:t,delay:r,easing:EASE_OUT,useNativeDriver:true}),r=L.parallel([e(i,400,60),e(l,700,60),e(a,820),e(s,360)]);return r.start(),()=>r.stop()},[t,i,l,a,s]);let c=r(null);if(c.current===null||c.current.pet.opacity!==i){let t=a.interpolate({inputRange:[0,1],outputRange:[.35,1]}),r=a.interpolate({inputRange:[0,1],outputRange:[e*.65/2,0]});c.current={pet:{opacity:i,transform:[{translateY:l.interpolate({inputRange:[0,1],outputRange:[16,0]})}]},grass:{opacity:s,transform:[{translateY:r},{scaleY:t}]}}}return c.current}function RiseIn({index:e,reduced:t,children:n}){let i=r(new L.Value(t?1:0)).current;return o(()=>{if(t){i.setValue(1);return}let r=L.timing(i,{toValue:1,duration:400,delay:e*60,easing:EASE_OUT,useNativeDriver:true});return r.start(),()=>r.stop()},[t,e,i]),/* @__PURE__ */j(L.View,{style:{opacity:i,transform:[{translateY:i.interpolate({inputRange:[0,1],outputRange:[8,0]})}]},children:n})}function HubPetArt({art:e,onError:t,reduced:r}){return e.status!=="art"?null:/* @__PURE__ */j(PetImage,{url:e.url,onError:t,reduced:r},e.key)}function PetImage({url:e,onError:t,reduced:n}){let i=r(new L.Value(0)).current,l=()=>{if(n){i.setValue(1);return}L.timing(i,{toValue:1,duration:200,easing:EASE_OUT,useNativeDriver:true}).start()};/* @__PURE__ */
|
|
778
|
+
return j(m,{style:{width:"100%",height:"100%"},testID:"everfur-records-sheet-pet-art",children:/* @__PURE__ */j(L.Image,{source:{uri:e},onLoad:l,onError:t,resizeMode:"contain",style:{width:"100%",height:"100%",opacity:i}})})}var iv=/* @__PURE__ */Object.freeze({reveal:480,revealFade:320,revealStagger:60,revealMaxSteps:8,revealRiseBlock:14,rollDigits:900,rollDigitStagger:55,chartDraw:850,slideTravel:48,slideMs:320}),lv=null,HUB_EASE_OUT=e=>(lv??=O.bezier(.23,1,.32,1))(e);function ov(e){return Math.min(Math.max(0,e),iv.revealMaxSteps-1)*iv.revealStagger}function HubReveal({index:e,reduced:t,style:n,testID:i,children:l}){let a=r(new L.Value(t?1:0)).current,s=r(new L.Value(t?1:0)).current,d=r(t);o(()=>{if(t){a.setValue(1),s.setValue(1);return}if(d.current)return;let r=ov(e),n=L.parallel([L.timing(a,{toValue:1,duration:iv.reveal,delay:r,easing:HUB_EASE_OUT,useNativeDriver:true}),L.timing(s,{toValue:1,duration:iv.revealFade,delay:r,easing:HUB_EASE_OUT,useNativeDriver:true})]);return n.start(({finished:e})=>{e&&(d.current=true)}),()=>n.stop()},[t,e,a,s]);let c={opacity:s,transform:[{translateY:a.interpolate({inputRange:[0,1],outputRange:[iv.revealRiseBlock,0]})}]};/* @__PURE__ */
|
|
779
|
+
return j(L.View,{style:[n,c],testID:i,children:l})}function av(e,t){let n=r(new L.Value(t?1:0)).current,i=r(t);return o(()=>{if(t){n.setValue(1);return}if(!e||i.current)return;let r=L.timing(n,{toValue:1,duration:iv.chartDraw,easing:HUB_EASE_OUT,useNativeDriver:true});return r.start(({finished:e})=>{e&&(i.current=true)}),()=>r.stop()},[e,t,n]),n}function sv(e){let t=e.slice(1).map((t,r)=>Math.hypot(t.x-e[r].x,t.y-e[r].y)),r=t.reduce((e,t)=>e+t,0),n=0;return t.map(e=>{let t=r>0?n/r:0;return n+=e,[t,r>0?n/r:1]})}function dv(e,t,r){let[n,i]=t,l=i>n?i:n+1e-4,o=e.interpolate({inputRange:[n,l],outputRange:[1e-4,1],extrapolate:"clamp"});return{translateX:e.interpolate({inputRange:[n,l],outputRange:[-r/2,0],extrapolate:"clamp"}),scaleX:o}}function cv(e,t){return t<=0?0:e[t-1]?.[1]??1}function uv(e,t){return e.interpolate({inputRange:[t-.0011,t-.001],outputRange:[0,1],extrapolate:"clamp"})}function hv(e,t){let n=r(e),i=r(new L.Value(0)).current,l=r(new L.Value(1)).current;return o(()=>{let r=Math.sign(e-n.current);if(n.current=e,r===0||t)return;i.setValue(r*iv.slideTravel),l.setValue(0);let o=L.parallel([L.timing(i,{toValue:0,duration:iv.slideMs,easing:HUB_EASE_OUT,useNativeDriver:true}),L.timing(l,{toValue:1,duration:iv.slideMs,easing:HUB_EASE_OUT,useNativeDriver:true})]);return o.start(),()=>o.stop()},[e,t,i,l]),r({opacity:l,transform:[{translateX:i}]}).current}function pv(e){return Array.from(e,e=>({char:e,digit:/\d/.test(e)?Number(e):null}))}function gv(e){let t=Math.min(1,Math.max(0,e));return 1-Math.pow(1-t,3)}function HubRollingDigits({text:e,reduced:t,renderText:n,testID:l}){let[a,s]=i(()=>!t&&/\d/.test(e)),d=r(e);return o(()=>{d.current!==e&&s(false)},[e]),o(()=>{t&&s(false)},[t]),a?/* @__PURE__ */A(m,{accessible:true,accessibilityRole:"text",accessibilityLabel:e,children:[
|
|
779
780
|
/* @__PURE__ */j(m,{style:{opacity:0},importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:true,children:n(e,l!==void 0?{testID:l}:{})}),
|
|
780
|
-
/* @__PURE__ */j(RollOverlay,{text:e,renderText:n,onDone:()=>s(false)})]}):n(e,l!==void 0?{testID:l}:{})}function RollOverlay({text:e,renderText:t,onDone:n}){let i=
|
|
781
|
-
return j(m,{style:{position:"absolute",left:0,top:0,right:0,bottom:0,flexDirection:"row",alignItems:"flex-end"},pointerEvents:"none",importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:true,children:i.map((e,r)=>e.digit===null?/* @__PURE__ */j(m,{children:t(e.char)},r):(c+=1,/* @__PURE__ */j(RollCell,{cell:e,t:s,delay:c*
|
|
781
|
+
/* @__PURE__ */j(RollOverlay,{text:e,renderText:n,onDone:()=>s(false)})]}):n(e,l!==void 0?{testID:l}:{})}function RollOverlay({text:e,renderText:t,onDone:n}){let i=pv(e),l=i.filter(e=>e.digit!==null).length,a=iv.rollDigits+Math.max(0,l-1)*iv.rollDigitStagger,s=r(new L.Value(0)).current,d=r(n);d.current=n,o(()=>{let e=L.timing(s,{toValue:a,duration:a,easing:O.linear,useNativeDriver:true});return e.start(({finished:e})=>{e&&d.current()}),()=>e.stop()},[s,a]);let c=-1;/* @__PURE__ */
|
|
782
|
+
return j(m,{style:{position:"absolute",left:0,top:0,right:0,bottom:0,flexDirection:"row",alignItems:"flex-end"},pointerEvents:"none",importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:true,children:i.map((e,r)=>e.digit===null?/* @__PURE__ */j(m,{children:t(e.char)},r):(c+=1,/* @__PURE__ */j(RollCell,{cell:e,t:s,delay:c*iv.rollDigitStagger,renderText:t},r)))})}var fv=[0,1,2,3,4,5,6,7,8,9],mv=24;function RollCell({cell:e,t:t,delay:r,renderText:n}){let[l,o]=i(0),a=e=>{let t=e.nativeEvent.layout.height;t>0&&t!==l&&o(t)},s=e.digit??0,d=[],c=[];for(let e=0;e<=mv;e+=1){let t=e/mv;d.push(r+t*iv.rollDigits),c.push(-s*l*gv(t))}let u=t.interpolate({inputRange:d,outputRange:c,extrapolate:"clamp"});/* @__PURE__ */
|
|
782
783
|
return A(m,{style:{overflow:"hidden"},onLayout:a,children:[
|
|
783
|
-
/* @__PURE__ */j(m,{style:{opacity:0},children:n(e.char)}),l>0?/* @__PURE__ */j(L.View,{style:{position:"absolute",left:0,right:0,top:0,transform:[{translateY:u}]},children:
|
|
784
|
+
/* @__PURE__ */j(m,{style:{opacity:0},children:n(e.char)}),l>0?/* @__PURE__ */j(L.View,{style:{position:"absolute",left:0,right:0,top:0,transform:[{translateY:u}]},children:fv.map(e=>/* @__PURE__ */j(m,{style:{height:l},children:n(String(e))},e))}):null]})}function bv(e){return e===void 0||!("grassSrc"in e)?e:{grassSource:{uri:e.grassSrc},petSource:{uri:e.petSrc},...e.head!==void 0?{head:e.head}:{},...e.handFontFamily!==void 0?{handFontFamily:e.handFontFamily}:{}}}function yv(e){let t=e/(Ql.viewBox[2]-Ql.viewBox[0]),r=Ql.fontSize*t,n=Math.round(r*1.25),{x0:i,y0:l,cx:o,cy:a,x1:s,y1:d}=Ql.path,c=e=>{let r=1-e;return[(r*r*i+2*r*e*o+e*e*s)*t,(r*r*l+2*r*e*a+e*e*d)*t]},u=120,h=[{len:0,t:0}],[p,g]=c(0),f=0;for(let e=1;e<=u;e+=1){let t=e/u,[r,n]=c(t);f+=Math.hypot(r-p,n-g),h.push({len:f,t:t}),p=r,g=n}let m=e=>{let t=Math.min(f,Math.max(0,e)),r=1;for(;r<h.length-1&&h[r].len<t;)r+=1;let n=h[r-1],u=h[r],p=n.t+(u.t-n.t)*((t-n.len)/Math.max(1e-6,u.len-n.len)),[g,m]=c(p),b=1-p,y=2*b*(o-i)+2*p*(s-o),v=2*b*(a-l)+2*p*(d-a);return{x:g,y:m,angle:Math.atan2(v,y)}};return{width:e,boxH:(Ql.viewBox[3]-Ql.viewBox[1])*t,font:r,line:n,baseline:(n-r)/2+r*.8,length:f,at:m}}var vv=yv(Ql.width);function wv(e){return e===Ql.width?vv:yv(e)}function ArcLine({line:e,text:t,geom:r,opacity:l}){let o=n(()=>Array.from(e),[e]),[a,s]=i(()=>o.map(()=>null)),d=e=>t=>{let r=t.nativeEvent.layout.width;s(t=>t[e]===r?t:t.map((t,n)=>n===e?r:t))},c=a.every(e=>e!==null),u=null;if(c){let e=a,n=e.reduce((e,t)=>e+t,0),i=r.length/2-n/2;u=o.map((n,l)=>{let o=e[l],a=r.at(i+o/2);i+=o;let s=r.baseline-r.line/2,d=a.x+Math.sin(a.angle)*s,c=a.y-Math.cos(a.angle)*s;/* @__PURE__ */
|
|
784
785
|
return j(Text,{allowFontScaling:false,style:[t,{position:"absolute",left:d-o/2,top:c-r.line/2,width:o,textAlign:"center",transform:[{rotate:`${a.angle}rad`}]}],children:n},l)})}/* @__PURE__ */
|
|
785
786
|
return A(L.View,{style:{position:"absolute",left:0,top:0,right:0,bottom:0,opacity:l},children:[
|
|
786
|
-
/* @__PURE__ */j(m,{style:{position:"absolute",left:0,top:0,width:r.width*4,flexDirection:"row",opacity:0},children:o.map((e,r)=>/* @__PURE__ */j(Text,{allowFontScaling:false,style:[t,{flexShrink:0}],onLayout:d(r),children:e},r))}),u]})}var
|
|
787
|
-
return j(m,{style:{width:t,height:t,alignItems:"center",justifyContent:"center"},...
|
|
788
|
-
return j(m,{style:[l.pill,r?l.pillSmall:null,d[t],n],testID:i,children:/* @__PURE__ */j(Text,{tier:"compact",style:[l.pillText,r?l.pillTextSmall:null,{color:c}],children:e})})}function SheetCard({children:e,style:t,testID:r}){let{s:n}=
|
|
789
|
-
return j(m,{style:[n.card,i.card,t],testID:r,children:e})}function SheetMarkerRow({name:e,value:t,unit:r,range:n,at:i,pill:l,testID:o}){let{s:a,look:s}=
|
|
787
|
+
/* @__PURE__ */j(m,{style:{position:"absolute",left:0,top:0,width:r.width*4,flexDirection:"row",opacity:0},children:o.map((e,r)=>/* @__PURE__ */j(Text,{allowFontScaling:false,style:[t,{flexShrink:0}],onLayout:d(r),children:e},r))}),u]})}var kv={accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",pointerEvents:"none"},xv=eo(".efh-stage","height")*ro(".efh-stage__pet","height");function SheetIcon({kind:e,size:t=no.icon,color:r}){let n;switch(e){case"flask":n=/* @__PURE__ */j(FlaskGlyph,{size:t,color:r});break;case"thermo":n=/* @__PURE__ */j(ThermoGlyph,{size:t,color:r});break;case"heart":n=/* @__PURE__ */j(HeartGlyph,{size:t,color:r});break;case"wind":n=/* @__PURE__ */j(WindGlyph,{size:t,color:r});break;case"shield":n=/* @__PURE__ */j(ShieldGlyph,{size:t,color:r});break;case"folder":n=/* @__PURE__ */j(FolderGlyph,{size:t,color:r});break;case"clip":n=/* @__PURE__ */j(ClipboardGlyph,{size:t,color:r});break;case"clock":n=/* @__PURE__ */j(ClockFaceGlyph,{size:t,color:r});break;case"calendar":n=/* @__PURE__ */j(CalendarGlyph,{size:t,color:r});break;case"chevron":n=/* @__PURE__ */j(ChevronGlyph,{size:t,color:r,direction:"right"});break;case"upload":n=/* @__PURE__ */j(UploadArrowGlyph,{size:t,color:r});break;case"download":n=/* @__PURE__ */j(DownloadGlyph2,{size:t,color:r});break;default:n=null}/* @__PURE__ */
|
|
788
|
+
return j(m,{style:{width:t,height:t,alignItems:"center",justifyContent:"center"},...kv,children:n})}var Tv=createContext(null);function Cv(e){let t=useEverfurTheme(),r=e??t;return n(()=>{let e=recordsSheetLook(r);return{theme:r,look:e,s:zv(r,e)}},[r])}function _v(e,t){let r=useEverfurTheme(),i=t?.font,l=t?.mono;return n(()=>po(r,e,{...i!==void 0?{font:i}:{},...l!==void 0?{mono:l}:{}}),[r,e,i,l])}var Rv=Tv.Provider;function Sv(){let e=Cv();return s(Tv)??e}function SheetPill({label:e,tone:t,small:r=false,style:n,testID:i}){let{s:l,look:o}=Sv();if(e.trim().length===0)return null;let a=r?7:10,s=(e,t)=>({backgroundColor:o.card,borderWidth:e,borderColor:t,paddingHorizontal:a-e}),d={watch:{backgroundColor:o.watch},stable:{backgroundColor:o.goTint},later:s(1.25,o.line),clear:s(1.5,o.go),plain:s(1.5,o.plainEdge),high:s(1.25,o.alert)},c=t==="later"?o.muted:t==="clear"?o.go:t==="high"?o.alert:o.ink;/* @__PURE__ */
|
|
789
|
+
return j(m,{style:[l.pill,r?l.pillSmall:null,d[t],n],testID:i,children:/* @__PURE__ */j(Text,{tier:"compact",style:[l.pillText,r?l.pillTextSmall:null,{color:c}],children:e})})}function SheetCard({children:e,style:t,testID:r}){let{s:n}=Sv(),i=uy();/* @__PURE__ */
|
|
790
|
+
return j(m,{style:[n.card,i.card,t],testID:r,children:e})}function SheetMarkerRow({name:e,value:t,unit:r,range:n,at:i,pill:l,testID:o}){let{s:a,look:s}=Sv();/* @__PURE__ */
|
|
790
791
|
return A(m,{style:a.mk,testID:o,children:[
|
|
791
792
|
/* @__PURE__ */A(m,{style:a.mkText,children:[
|
|
792
793
|
/* @__PURE__ */A(m,{style:a.mkNameRow,children:[
|
|
793
794
|
/* @__PURE__ */j(Text,{style:a.mkName,children:e}),l!==null?/* @__PURE__ */j(SheetPill,{label:l,tone:"high"}):null]}),
|
|
794
795
|
/* @__PURE__ */A(m,{style:a.mkLine,children:[
|
|
795
|
-
/* @__PURE__ */j(Text,{style:a.mkValue,children:t}),r?/* @__PURE__ */j(Text,{style:a.mkLineText,children:r}):null,n!==null?/* @__PURE__ */j(Text,{style:a.mkLineText,children:`· ${n}`}):null]})]}),i!==null?/* @__PURE__ */A(m,{style:a.mkBar,...
|
|
796
|
+
/* @__PURE__ */j(Text,{style:a.mkValue,children:t}),r?/* @__PURE__ */j(Text,{style:a.mkLineText,children:r}):null,n!==null?/* @__PURE__ */j(Text,{style:a.mkLineText,children:`· ${n}`}):null]})]}),i!==null?/* @__PURE__ */A(m,{style:a.mkBar,...kv,children:[
|
|
796
797
|
/* @__PURE__ */j(m,{style:[a.mkBarIn,{backgroundColor:s.go}]}),
|
|
797
798
|
/* @__PURE__ */j(m,{style:[a.mkBarDot,{left:`${i}%`,backgroundColor:s.ink,borderColor:s.card}]})]}):null]})}function ChartLine({points:e,color:t}){let[r,n]=i(null),l=e=>{let{width:t,height:i}=e.nativeEvent.layout;(r===null||r.w!==t||r.h!==i)&&n({w:t,h:i})},o=r===null?[]:e.slice(1).map((t,n)=>{let i=e[n]??t,l=i.x/100*r.w,o=i.y/100*r.h,a=t.x/100*r.w,s=t.y/100*r.h,d=Math.hypot(a-l,s-o),c=Math.atan2(s-o,a-l)*180/Math.PI;return{key:n,left:(l+a)/2-d/2,top:(o+s)/2-.75,length:d,angle:c}});/* @__PURE__ */
|
|
798
|
-
return j(m,{style:Du,onLayout:l,...yv,children:o.map(e=>/* @__PURE__ */j(m,{style:{position:"absolute",left:e.left,top:e.top,width:e.length,height:1.5,backgroundColor:t,transform:[{rotate:`${e.angle}deg`}]}},e.key))})}function _v(e,t){let r=face(e,"regular"),n=face(e,"bold"),i=headingFace(e,"bold"),l=face(e,"mono"),o=face(e,"monoBold"),a=(e,t)=>zv(e*t);return w.create({scroll:{flexGrow:1},topSlot:{paddingHorizontal:no.sheetPadX},sheet:{flexGrow:1,gap:no.gap,paddingTop:no.sheetPadTop,paddingHorizontal:no.sheetPadX,paddingBottom:no.sheetPadBottom,borderTopLeftRadius:no.sheetRadius,borderTopRightRadius:no.sheetRadius,backgroundColor:t.ground},sheetUnderSlot:{marginTop:no.sheetGap},card:{padding:no.cardPad,backgroundColor:t.card,borderRadius:no.cardRadius,shadowColor:"#000000",shadowOpacity:t.dark?0:.09,shadowRadius:3,shadowOffset:{width:0,height:1},elevation:t.dark?0:1,borderWidth:t.dark?1:0,borderColor:t.line},cardHead:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between",gap:8,marginBottom:12},cardTitle:{...n,fontSize:no.cardTitle,lineHeight:a(no.cardTitle,1.25),letterSpacing:-.36,color:t.ink},cardTitleGap:{marginBottom:12},sec:{marginTop:8,marginBottom:12},head:{marginBottom:eo(".efh-head","marginBottom")},name:{...i,fontSize:no.name,lineHeight:a(no.name,1.2),letterSpacing:-.44,color:t.ink,flexShrink:1},meta:{...r,marginTop:2,fontSize:no.small,lineHeight:a(no.small,1.4),letterSpacing:.26,textTransform:"uppercase",color:t.muted},label:{...o,marginTop:eo(".efh-head__from","marginTop"),fontSize:no.mono,lineHeight:a(no.mono,1.4),letterSpacing:.72,textTransform:"uppercase",color:t.muted},vitals:{flexDirection:"row",gap:8,marginTop:8},stage:{position:"relative",height:eo(".efh-stage","height"),marginTop:eo(".efh-stage","marginTop"),marginHorizontal:eo(".efh-stage","marginLeft"),overflow:"hidden"},stageGrass:{position:"absolute",left:0,right:0,bottom:0,height:`${ro(".efh-stage__grass","height")*100}%`,overflow:"hidden"},stagePet:{position:"absolute",left:`${ro(".efh-stage__pet","left")*100}%`,bottom:eo(".efh-stage__pet","bottom"),height:vv},stageVitals:{position:"absolute",top:eo(".efh-stage .efh-vitals","top"),left:eo(".efh-stage .efh-vitals","left"),gap:eo(".efh-stage .efh-vitals","gap")},vital:{flex:1,minWidth:0},vitalTop:{flexDirection:"row",alignItems:"center",gap:6},vitalValue:{...n,fontSize:17,lineHeight:a(17,1.2),color:t.ink},vitalUnit:{...r,fontSize:no.small,color:t.muted},vitalLabel:{...r,marginTop:2,fontSize:no.small,lineHeight:a(no.small,1.4),color:t.muted},due:{gap:4,marginHorizontal:-12},dueRow:{flexDirection:"row",alignItems:"center",gap:12,padding:12,borderRadius:no.rowRadius},dueText:{flex:1,minWidth:0,gap:2},duePill:{alignSelf:"center"},dueTitle:{...n,fontSize:no.rowTitle,lineHeight:a(no.rowTitle,1.3),color:t.ink},dueWhen:{...r,fontSize:no.small,lineHeight:a(no.small,1.4),color:t.muted},pill:{minHeight:no.pill,paddingHorizontal:10,borderRadius:999,alignItems:"center",justifyContent:"center",alignSelf:"flex-start"},pillSmall:{minHeight:22,paddingHorizontal:7},pillText:{...o,fontSize:no.mono,lineHeight:no.mono+2,letterSpacing:.72,textTransform:"uppercase"},pillTextSmall:{fontSize:10.5,letterSpacing:.21},tiles:{flexDirection:"row",flexWrap:"wrap",gap:no.tileGap},tile:{flexGrow:1,flexBasis:"45%",minWidth:0,gap:8,padding:16,borderRadius:no.cardRadius},tileTop:{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between"},tileTitle:{...n,fontSize:no.body,lineHeight:a(no.body,1.25),letterSpacing:-.15,color:t.ink},tileFoot:{flexDirection:"row",flexWrap:"wrap",alignItems:"baseline",gap:8,minHeight:28},tileNum:{...n,fontSize:no.tileNum,lineHeight:no.tileNum+2,letterSpacing:-.4,color:t.ink},tileUnit:{...r,fontSize:no.small,color:t.muted},emptyLine:{...r,fontSize:no.small,lineHeight:a(no.small,1.5),color:t.muted},wt:{flexDirection:"row",flexWrap:"wrap",alignItems:"baseline",gap:8},wtValue:{...n,fontSize:no.big,lineHeight:eo(".efh-wt b","lineHeight"),letterSpacing:-.64,color:t.ink},wtSub:{...r,fontSize:no.body,color:t.muted},chart:{marginTop:20},plot:{position:"relative",height:no.plot},point:{position:"absolute",width:12,height:12,marginLeft:-6,marginTop:-6,borderRadius:6,borderWidth:1.5,borderColor:t.card},pointLabel:{...face(e,"medium"),position:"absolute",width:46,marginLeft:-23,textAlign:"center",fontSize:no.mono,lineHeight:no.mono+2,color:t.dark?t.text:Rv},xAxis:{position:"relative",height:18,marginTop:8},xTick:{...l,position:"absolute",top:0,width:56,marginLeft:-28,textAlign:"center",fontSize:no.mono,lineHeight:a(no.mono,1.3),color:t.muted},key:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:6,marginTop:12},keyDot:{width:12,height:12,borderRadius:6,backgroundColor:t.ink},keyText:{...r,fontSize:no.small,lineHeight:a(no.small,1.4),color:t.muted},tlKey:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:4},tlKeyDot:{width:10,height:10,borderRadius:5,borderWidth:2.5,borderColor:t.ink,backgroundColor:t.card},tlYear:{...o,marginTop:20,marginBottom:12,marginLeft:40,fontSize:no.mono,lineHeight:a(no.mono,1.4),letterSpacing:.72,textTransform:"uppercase",color:t.muted},tlItem:{position:"relative",flexDirection:"row",gap:16,paddingBottom:24},tlItemLast:{paddingBottom:0},tlRail:{position:"absolute",left:11,top:22,bottom:-2,width:2,borderRadius:1,backgroundColor:t.line},tlRailEnd:{bottom:12},tlDot:{width:16,height:16,marginTop:3,marginHorizontal:4,borderRadius:8,borderWidth:3,borderColor:t.ink,backgroundColor:t.card},tlBody:{flex:1,minWidth:0},tlBtn:{marginTop:-8,marginHorizontal:-8,paddingVertical:8,paddingLeft:8,paddingRight:36,borderRadius:no.rowRadius,backgroundColor:t.alertTint},tlChevron:{position:"absolute",right:8,top:"50%",marginTop:-10},tlDate:{...l,fontSize:no.mono,lineHeight:a(no.mono,1.4),letterSpacing:.48,textTransform:"uppercase",color:t.muted},tlTitle:{...n,marginTop:2,fontSize:no.rowTitle,lineHeight:a(no.rowTitle,1.3),color:t.ink},tlText:{...r,marginTop:2,fontSize:no.body,lineHeight:a(no.body,1.5),color:t.text},pull:{paddingTop:4,paddingBottom:24,paddingLeft:40},pullStep:{...n,fontSize:no.body,lineHeight:a(no.body,1.4),color:t.ink},pullBar:{height:6,marginTop:10,overflow:"hidden",borderRadius:999,backgroundColor:t.line},pullFill:{height:"100%",backgroundColor:t.accent},failed:{flexDirection:"row",alignItems:"center",gap:12,padding:12,borderRadius:no.rowRadius,backgroundColor:t.alertTint},failedText:{...n,flex:1,fontSize:no.body,lineHeight:a(no.body,1.4),color:t.alertDeep},add:{gap:12},addHead:{flexDirection:"row",alignItems:"center",gap:8},addLead:{...r,fontSize:no.body,lineHeight:a(no.body,1.5),color:t.text},sources:{gap:6},source:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between",columnGap:12,paddingVertical:10,paddingHorizontal:14,borderRadius:no.rowRadius,backgroundColor:t.rowGround},sourceLabel:{...r,fontSize:no.body,lineHeight:a(no.body,1.4),color:t.text},sourceDetail:{...r,fontSize:no.small,color:t.muted},addActs:{gap:12,paddingTop:4},button:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,minHeight:no.button,paddingHorizontal:20,borderRadius:999},buttonRow:{minHeight:no.rowButton,paddingHorizontal:16},buttonText:{...n,fontSize:16,lineHeight:20},buttonTextRow:{fontSize:no.body},noneWithScene:{paddingTop:eo(".efh-none","paddingTop")},scene:{position:"relative",height:Jl.height,marginHorizontal:eo(".efh-none__scene","marginLeft"),marginBottom:eo(".efh-none__scene","marginBottom"),overflow:"hidden",borderTopLeftRadius:no.cardRadius,borderTopRightRadius:no.cardRadius},sceneGrass:{position:"absolute",left:0,right:0,bottom:0,height:Jl.grassHeight,overflow:"hidden"},scenePet:{position:"absolute",left:"50%",bottom:Jl.petBottom,height:Jl.petHeight},noneTitle:{...i,fontSize:eo(".efh-none__t","fontSize"),lineHeight:eo(".efh-none__t","lineHeight"),letterSpacing:eo(".efh-none__t","letterSpacing"),color:t.ink},noneLead:{...r,marginTop:eo(".efh-none__lead","marginTop"),fontSize:eo(".efh-none__lead","fontSize"),lineHeight:eo(".efh-none__lead","lineHeight"),color:t.text},noneLine:{flexDirection:"row",flexWrap:"wrap",alignItems:"baseline",columnGap:4,marginTop:eo(".efh-none__lead","marginTop")},noneLineText:{...r,fontSize:eo(".efh-none__lead","fontSize"),lineHeight:eo(".efh-none__lead","lineHeight"),color:t.text},noneLink:{...n,fontSize:eo(".efh-none__lead","fontSize"),lineHeight:eo(".efh-none__lead","lineHeight"),color:t.ink,textDecorationLine:"underline"},repeatLine:{...n,marginTop:eo(".efh-ways","gap"),fontSize:eo(".efh-none__lead","fontSize"),lineHeight:eo(".efh-none__lead","lineHeight"),color:t.ink},ways:{gap:eo(".efh-ways","gap"),marginTop:eo(".efh-ways","marginTop")},way:{flexDirection:"row",alignItems:"center",gap:eo(".efh-way","columnGap"),padding:eo(".efh-way","paddingTop"),borderRadius:eo(".efh-way","borderRadius")},wayText:{flex:1,minWidth:0,gap:eo(".efh-way__w","gap")},wayTitle:{...n,fontSize:eo(".efh-way__t","fontSize"),lineHeight:eo(".efh-way__t","lineHeight")},wayDetail:{...r,fontSize:eo(".efh-way__x","fontSize"),lineHeight:eo(".efh-way__x","lineHeight")},tracker:{marginTop:16},step:{flexDirection:"row",gap:16,paddingBottom:20},stepLast:{paddingBottom:0},stepRail:{position:"absolute",left:Sv/2-1,top:Sv+2,bottom:2,width:2,borderRadius:1,backgroundColor:t.line},stepRailDone:{backgroundColor:t.ink},stepDot:{width:Sv,height:Sv,borderRadius:Sv/2,borderWidth:2,borderColor:t.line,backgroundColor:t.card,alignItems:"center",justifyContent:"center"},stepDotOn:{borderColor:t.ink},stepDotDone:{backgroundColor:t.fill,borderColor:t.fill},stepNow:{width:10,height:10,borderRadius:5,backgroundColor:t.accent},stepText:{flex:1,minWidth:0,paddingTop:3,gap:2},stepTitle:{...n,fontSize:eo(".efh-mk__name","fontSize"),lineHeight:22,color:t.ink},stepWhen:{...r,fontSize:eo(".efh-mk__line","fontSize"),lineHeight:eo(".efh-mk__line","lineHeight"),color:t.muted},peek:{gap:12,marginTop:12},peekHead:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:12},peekLead:{...r,marginTop:-4,fontSize:no.body,lineHeight:a(no.body,1.5),color:t.text},peekLabsTitle:{marginBottom:eo(".efh-peek__labs .efh-card__title","marginBottom")},peekGroup:{marginBottom:eo(".efh-peek__g","marginBottom")},peekGroupTitle:{...n,fontSize:eo(".efh-peek__g b","fontSize"),lineHeight:zv(eo(".efh-peek__g b","fontSize")*(eo(".efh-peek__g","lineHeight")/eo(".efh-peek__g","fontSize"))),color:t.ink},peekGroupLead:{...r,fontSize:eo(".efh-peek__g","fontSize"),lineHeight:eo(".efh-peek__g","lineHeight"),color:t.muted},more:{gap:10},moreCard:{gap:10,padding:16,borderRadius:no.cardRadius},moreHead:{flexDirection:"row",alignItems:"center",gap:8},moreTitle:{...n,fontSize:16,lineHeight:a(16,1.3),color:t.ink},moreLead:{...r,fontSize:no.body,lineHeight:a(no.body,1.5),color:t.text},moreRows:{gap:6},moreRow:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:44,paddingVertical:8,paddingHorizontal:14,borderRadius:no.rowRadius,backgroundColor:t.card},moreRowLabel:{...r,flexShrink:1,fontSize:no.body,lineHeight:a(no.body,1.4),color:t.text},moreWhen:{...l,fontSize:no.mono,letterSpacing:.24,color:t.muted},note:{...r,marginTop:eo(".efh-sheet .rec-note","marginTop"),fontSize:eo(".rec-note","fontSize"),textAlign:"center",color:t.muted},mks:{gap:2,marginHorizontal:-8},mk:{flexDirection:"row",alignItems:"center",gap:12,paddingVertical:10,paddingHorizontal:8},mkText:{flex:1,minWidth:0},mkNameRow:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:8},mkName:{...n,fontSize:no.rowTitle,lineHeight:a(no.rowTitle,1.3),color:t.ink},mkLine:{flexDirection:"row",flexWrap:"wrap",alignItems:"baseline",rowGap:eo(".efh-mk__line","rowGap"),columnGap:eo(".efh-mk__line","columnGap"),marginTop:eo(".efh-mk__line","marginTop")},mkLineText:{...r,fontSize:eo(".efh-mk__line","fontSize"),lineHeight:eo(".efh-mk__line","lineHeight"),color:t.muted,fontVariant:["tabular-nums"]},mkValue:{...n,fontSize:eo(".efh-mk__line b","fontSize"),lineHeight:zv(eo(".efh-mk__line b","fontSize")*(eo(".efh-mk__line","lineHeight")/eo(".efh-mk__line","fontSize"))),color:t.text,fontVariant:["tabular-nums"]},mkBar:{position:"relative",width:96,height:6,borderRadius:999,backgroundColor:t.barTrack},mkBarIn:{position:"absolute",top:0,bottom:0,left:"20%",right:"20%",borderRadius:999},mkBarDot:{position:"absolute",top:-2,width:10,height:10,marginLeft:-5,borderRadius:5,borderWidth:2},topRisk:{gap:eo(".rec-top","gap"),paddingTop:eo(".rec-top","paddingTop"),paddingRight:eo(".rec-top","paddingRight"),paddingBottom:eo(".rec-top","paddingBottom"),paddingLeft:eo(".rec-top","paddingLeft"),backgroundColor:t.topFill,borderRadius:eo(".rec-top","borderRadius"),borderWidth:0,shadowOpacity:0,elevation:0},topRiskKicker:{flexDirection:"row",alignItems:"center",gap:eo(".rec-top__k","gap")},topRiskDot:{width:8,height:8,borderRadius:4,backgroundColor:t.alert},topRiskK:{...l,fontSize:eo(".rec-top__k","fontSize"),lineHeight:eo(".rec-top__k","fontSize")*1.5,letterSpacing:eo(".rec-top__k","letterSpacing"),textTransform:"uppercase",color:t.topKicker},topRiskText:{...n,fontSize:no.rowTitle,lineHeight:a(no.rowTitle,1.35),color:t.topInk},disclaimer:{...r,fontSize:no.small,lineHeight:a(no.small,1.5),textAlign:"center",color:t.muted},lab:{gap:no.gap,paddingTop:8,paddingHorizontal:16,paddingBottom:32,backgroundColor:t.ground},labTitle:{...face(e,"medium"),fontSize:no.name,lineHeight:a(no.name,1.2),letterSpacing:-.33,color:t.ink},labMeta:{...l,fontSize:no.small,lineHeight:a(no.small,1.45),color:t.muted},latest:{flexDirection:"row",flexWrap:"wrap",alignItems:"baseline",columnGap:12,rowGap:4},latestSub:{...r,fontSize:no.body,color:t.muted},change:{...r,marginTop:12,fontSize:no.body,color:t.text},changeLead:{...n,color:t.ink},ctx:{gap:12},ctxText:{...r,fontSize:no.rowTitle,lineHeight:a(no.rowTitle,1.55),color:t.text},labBody:{flexDirection:"row",gap:8},rail:{width:8,height:no.plot,overflow:"hidden",borderRadius:2},legend:{width:82,height:no.plot,position:"relative"},range:{...o,position:"absolute",left:0,right:0,fontSize:no.mono,lineHeight:a(no.mono,1.2),letterSpacing:.24,textTransform:"uppercase",color:t.dark?t.text:Rv},band:{position:"absolute",left:0,right:0,top:"25%",height:"50%",backgroundColor:t.goTint}})}var Rv="#3D3D3D",Sv=28,zv=e=>Math.round(e*100)/100;var Iv={accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",pointerEvents:"none"},Dv=bv(oy.hero.sayWidth),Hv=eo(".efh-stage","height"),Lv=Hv*ro(".efh-stage__grass","height");function Pv(e){let t=Number(e);return e.trim()!==""&&Number.isFinite(t)?String(t):e}var Ov=44e3,$v=1100,Bv=1188,jv=1200,Av=3600;function SayPhrase({text:e,index:t,family:n}){let{look:i}=py(),l=r(new L.Value(0)).current;return o(()=>{l.setValue(0);let e=O.inOut(O.ease),r=L.sequence([L.delay(jv+t*Av),L.loop(L.sequence([L.timing(l,{toValue:1,duration:$v,easing:e,useNativeDriver:true}),L.delay(Bv),L.timing(l,{toValue:0,duration:$v,easing:e,useNativeDriver:true}),L.delay(Ov-$v*2-Bv)]))]);return r.start(),()=>r.stop()},[t,l]),/* @__PURE__ */j(ArcLine,{line:e,geom:Dv,opacity:l,text:{fontFamily:n,fontWeight:"500",fontSize:Dv.font,lineHeight:Dv.line,color:i.ink}})}function HubSay({family:e}){let{look:t}=py();return useEverfurTheme().motion.reducedMotion?/* @__PURE__ */j(ArcLine,{line:Qb.sayLine,geom:Dv,opacity:1,text:{fontFamily:e,fontWeight:"500",fontSize:Dv.font,lineHeight:Dv.line,color:t.ink}}):/* @__PURE__ */j(E,{children:Qb.sayPhrases.map((t,r)=>/* @__PURE__ */j(SayPhrase,{text:t,index:r,family:e},t))})}function HubHero({name:e,meta:t,stage:r,art:n,handFontFamily:l,say:o,vitals:a,vitalsName:s,renderStage:d,exam:c,onOpenExam:u,headPill:h,fromLine:p}){let{look:g,face:f}=py(),y=useEverfurTheme().motion.reducedMotion,[v,w]=i(false),k=c!=null,x=r!==void 0||d===void 0,T=ev(Lv,y),_=r?.grassSource??Jy,[R,S]=i(null),z=Nv(_),I=a.length>0?/* @__PURE__ */j(m,{style:x?{position:"absolute",top:eo(".efh-stage .efh-vitals","top"),left:eo(".efh-stage .efh-vitals","left"),gap:eo(".efh-stage .efh-vitals","gap")}:{paddingHorizontal:oy.screen.padX,marginTop:4,gap:eo(".efh-stage .efh-vitals","gap")},accessibilityLabel:Qb.vitalsLabel(s),testID:"everfur-records-sheet-vitals",children:a.map((e,t)=>{let r=Pv(e.value),n=e.kind==="temp"?Qb.temperature:e.kind==="heart"?Qb.heartRate:Qb.breathing,i=e.kind==="temp"?"thermo":e.kind==="heart"?"heart":"wind",l=e.kind==="temp"?g.ink:e.kind==="heart"?g.alert:g.icoBlue;/* @__PURE__ */
|
|
799
|
-
return j(RiseIn,{index:t,reduced:y,children:/* @__PURE__ */A(b,{disabled:!k,onPress:()=>w(e=>!e),accessible:true,...k?{accessibilityRole:"button",accessibilityState:{expanded:v}}:{},accessibilityLabel:
|
|
800
|
-
/* @__PURE__ */j(HubIcon,{name:i,size:
|
|
801
|
-
/* @__PURE__ */j(HubText,{variant:"bodySmBold",tier:"compact",color:g.ink,style:{fontSize:
|
|
802
|
-
/* @__PURE__ */j(HubText,{variant:"bodySm",children:
|
|
803
|
-
/* @__PURE__ */j(AnnounceLine,{line:
|
|
804
|
-
return A(m,{style:{marginTop:4,marginHorizontal:-
|
|
805
|
-
/* @__PURE__ */A(m,{style:[{flexDirection:"row",alignItems:"center",gap:8,paddingHorizontal:
|
|
806
|
-
/* @__PURE__ */j(HubText,{variant:"screenTitle",accessibilityRole:"header",numberOfLines:1,testID:"everfur-records-sheet-name",style:[f("bold"),{flexShrink:1,fontSize:
|
|
807
|
-
/* @__PURE__ */j(L.View,{style:[{position:"absolute",left:0,right:0,bottom:0,height
|
|
808
|
-
/* @__PURE__ */j(L.View,{style:[{position:"absolute",left:`${(2*ro(".efh-stage__pet","left")-1)*100}%`,right:0,bottom:eo(".efh-stage__pet","bottom"),alignItems:"center"},o?{top:
|
|
799
|
+
return j(m,{style:Du,onLayout:l,...kv,children:o.map(e=>/* @__PURE__ */j(m,{style:{position:"absolute",left:e.left,top:e.top,width:e.length,height:1.5,backgroundColor:t,transform:[{rotate:`${e.angle}deg`}]}},e.key))})}function zv(e,t){let r=face(e,"regular"),n=face(e,"bold"),i=headingFace(e,"bold"),l=face(e,"mono"),o=face(e,"monoBold"),a=(e,t)=>Hv(e*t);return w.create({scroll:{flexGrow:1},topSlot:{paddingHorizontal:no.sheetPadX},sheet:{flexGrow:1,gap:no.gap,paddingTop:no.sheetPadTop,paddingHorizontal:no.sheetPadX,paddingBottom:no.sheetPadBottom,borderTopLeftRadius:no.sheetRadius,borderTopRightRadius:no.sheetRadius,backgroundColor:t.ground},sheetUnderSlot:{marginTop:no.sheetGap},card:{padding:no.cardPad,backgroundColor:t.card,borderRadius:no.cardRadius,shadowColor:"#000000",shadowOpacity:t.dark?0:.09,shadowRadius:3,shadowOffset:{width:0,height:1},elevation:t.dark?0:1,borderWidth:t.dark?1:0,borderColor:t.line},cardHead:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between",gap:8,marginBottom:12},cardTitle:{...n,fontSize:no.cardTitle,lineHeight:a(no.cardTitle,1.25),letterSpacing:-.36,color:t.ink},cardTitleGap:{marginBottom:12},sec:{marginTop:8,marginBottom:12},head:{marginBottom:eo(".efh-head","marginBottom")},name:{...i,fontSize:no.name,lineHeight:a(no.name,1.2),letterSpacing:-.44,color:t.ink,flexShrink:1},meta:{...r,marginTop:2,fontSize:no.small,lineHeight:a(no.small,1.4),letterSpacing:.26,textTransform:"uppercase",color:t.muted},label:{...o,marginTop:eo(".efh-head__from","marginTop"),fontSize:no.mono,lineHeight:a(no.mono,1.4),letterSpacing:.72,textTransform:"uppercase",color:t.muted},vitals:{flexDirection:"row",gap:8,marginTop:8},stage:{position:"relative",height:eo(".efh-stage","height"),marginTop:eo(".efh-stage","marginTop"),marginHorizontal:eo(".efh-stage","marginLeft"),overflow:"hidden"},stageGrass:{position:"absolute",left:0,right:0,bottom:0,height:`${ro(".efh-stage__grass","height")*100}%`,overflow:"hidden"},stagePet:{position:"absolute",left:`${ro(".efh-stage__pet","left")*100}%`,bottom:eo(".efh-stage__pet","bottom"),height:xv},stageVitals:{position:"absolute",top:eo(".efh-stage .efh-vitals","top"),left:eo(".efh-stage .efh-vitals","left"),gap:eo(".efh-stage .efh-vitals","gap")},vital:{flex:1,minWidth:0},vitalTop:{flexDirection:"row",alignItems:"center",gap:6},vitalValue:{...n,fontSize:17,lineHeight:a(17,1.2),color:t.ink},vitalUnit:{...r,fontSize:no.small,color:t.muted},vitalLabel:{...r,marginTop:2,fontSize:no.small,lineHeight:a(no.small,1.4),color:t.muted},due:{gap:4,marginHorizontal:-12},dueRow:{flexDirection:"row",alignItems:"center",gap:12,padding:12,borderRadius:no.rowRadius},dueText:{flex:1,minWidth:0,gap:2},duePill:{alignSelf:"center"},dueTitle:{...n,fontSize:no.rowTitle,lineHeight:a(no.rowTitle,1.3),color:t.ink},dueWhen:{...r,fontSize:no.small,lineHeight:a(no.small,1.4),color:t.muted},pill:{minHeight:no.pill,paddingHorizontal:10,borderRadius:999,alignItems:"center",justifyContent:"center",alignSelf:"flex-start"},pillSmall:{minHeight:22,paddingHorizontal:7},pillText:{...o,fontSize:no.mono,lineHeight:no.mono+2,letterSpacing:.72,textTransform:"uppercase"},pillTextSmall:{fontSize:10.5,letterSpacing:.21},tiles:{flexDirection:"row",flexWrap:"wrap",gap:no.tileGap},tile:{flexGrow:1,flexBasis:"45%",minWidth:0,gap:8,padding:16,borderRadius:no.cardRadius},tileTop:{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between"},tileTitle:{...n,fontSize:no.body,lineHeight:a(no.body,1.25),letterSpacing:-.15,color:t.ink},tileFoot:{flexDirection:"row",flexWrap:"wrap",alignItems:"baseline",gap:8,minHeight:28},tileNum:{...n,fontSize:no.tileNum,lineHeight:no.tileNum+2,letterSpacing:-.4,color:t.ink},tileUnit:{...r,fontSize:no.small,color:t.muted},emptyLine:{...r,fontSize:no.small,lineHeight:a(no.small,1.5),color:t.muted},wt:{flexDirection:"row",flexWrap:"wrap",alignItems:"baseline",gap:8},wtValue:{...n,fontSize:no.big,lineHeight:eo(".efh-wt b","lineHeight"),letterSpacing:-.64,color:t.ink},wtSub:{...r,fontSize:no.body,color:t.muted},chart:{marginTop:20},plot:{position:"relative",height:no.plot},point:{position:"absolute",width:12,height:12,marginLeft:-6,marginTop:-6,borderRadius:6,borderWidth:1.5,borderColor:t.card},pointLabel:{...face(e,"medium"),position:"absolute",width:46,marginLeft:-23,textAlign:"center",fontSize:no.mono,lineHeight:no.mono+2,color:t.dark?t.text:Iv},xAxis:{position:"relative",height:18,marginTop:8},xTick:{...l,position:"absolute",top:0,width:56,marginLeft:-28,textAlign:"center",fontSize:no.mono,lineHeight:a(no.mono,1.3),color:t.muted},key:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:6,marginTop:12},keyDot:{width:12,height:12,borderRadius:6,backgroundColor:t.ink},keyText:{...r,fontSize:no.small,lineHeight:a(no.small,1.4),color:t.muted},tlKey:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:4},tlKeyDot:{width:10,height:10,borderRadius:5,borderWidth:2.5,borderColor:t.ink,backgroundColor:t.card},tlYear:{...o,marginTop:20,marginBottom:12,marginLeft:40,fontSize:no.mono,lineHeight:a(no.mono,1.4),letterSpacing:.72,textTransform:"uppercase",color:t.muted},tlItem:{position:"relative",flexDirection:"row",gap:16,paddingBottom:24},tlItemLast:{paddingBottom:0},tlRail:{position:"absolute",left:11,top:22,bottom:-2,width:2,borderRadius:1,backgroundColor:t.line},tlRailEnd:{bottom:12},tlDot:{width:16,height:16,marginTop:3,marginHorizontal:4,borderRadius:8,borderWidth:3,borderColor:t.ink,backgroundColor:t.card},tlBody:{flex:1,minWidth:0},tlBtn:{marginTop:-8,marginHorizontal:-8,paddingVertical:8,paddingLeft:8,paddingRight:36,borderRadius:no.rowRadius,backgroundColor:t.alertTint},tlChevron:{position:"absolute",right:8,top:"50%",marginTop:-10},tlDate:{...l,fontSize:no.mono,lineHeight:a(no.mono,1.4),letterSpacing:.48,textTransform:"uppercase",color:t.muted},tlTitle:{...n,marginTop:2,fontSize:no.rowTitle,lineHeight:a(no.rowTitle,1.3),color:t.ink},tlText:{...r,marginTop:2,fontSize:no.body,lineHeight:a(no.body,1.5),color:t.text},pull:{paddingTop:4,paddingBottom:24,paddingLeft:40},pullStep:{...n,fontSize:no.body,lineHeight:a(no.body,1.4),color:t.ink},pullBar:{height:6,marginTop:10,overflow:"hidden",borderRadius:999,backgroundColor:t.line},pullFill:{height:"100%",backgroundColor:t.accent},failed:{flexDirection:"row",alignItems:"center",gap:12,padding:12,borderRadius:no.rowRadius,backgroundColor:t.alertTint},failedText:{...n,flex:1,fontSize:no.body,lineHeight:a(no.body,1.4),color:t.alertDeep},add:{gap:12},addHead:{flexDirection:"row",alignItems:"center",gap:8},addLead:{...r,fontSize:no.body,lineHeight:a(no.body,1.5),color:t.text},sources:{gap:6},source:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between",columnGap:12,paddingVertical:10,paddingHorizontal:14,borderRadius:no.rowRadius,backgroundColor:t.rowGround},sourceLabel:{...r,fontSize:no.body,lineHeight:a(no.body,1.4),color:t.text},sourceDetail:{...r,fontSize:no.small,color:t.muted},addActs:{gap:12,paddingTop:4},button:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,minHeight:no.button,paddingHorizontal:20,borderRadius:999},buttonRow:{minHeight:no.rowButton,paddingHorizontal:16},buttonText:{...n,fontSize:16,lineHeight:20},buttonTextRow:{fontSize:no.body},noneWithScene:{paddingTop:eo(".efh-none","paddingTop")},scene:{position:"relative",height:Jl.height,marginHorizontal:eo(".efh-none__scene","marginLeft"),marginBottom:eo(".efh-none__scene","marginBottom"),overflow:"hidden",borderTopLeftRadius:no.cardRadius,borderTopRightRadius:no.cardRadius},sceneGrass:{position:"absolute",left:0,right:0,bottom:0,height:Jl.grassHeight,overflow:"hidden"},scenePet:{position:"absolute",left:"50%",bottom:Jl.petBottom,height:Jl.petHeight},noneTitle:{...i,fontSize:eo(".efh-none__t","fontSize"),lineHeight:eo(".efh-none__t","lineHeight"),letterSpacing:eo(".efh-none__t","letterSpacing"),color:t.ink},noneLead:{...r,marginTop:eo(".efh-none__lead","marginTop"),fontSize:eo(".efh-none__lead","fontSize"),lineHeight:eo(".efh-none__lead","lineHeight"),color:t.text},noneLine:{flexDirection:"row",flexWrap:"wrap",alignItems:"baseline",columnGap:4,marginTop:eo(".efh-none__lead","marginTop")},noneLineText:{...r,fontSize:eo(".efh-none__lead","fontSize"),lineHeight:eo(".efh-none__lead","lineHeight"),color:t.text},noneLink:{...n,fontSize:eo(".efh-none__lead","fontSize"),lineHeight:eo(".efh-none__lead","lineHeight"),color:t.ink,textDecorationLine:"underline"},repeatLine:{...n,marginTop:eo(".efh-ways","gap"),fontSize:eo(".efh-none__lead","fontSize"),lineHeight:eo(".efh-none__lead","lineHeight"),color:t.ink},ways:{gap:eo(".efh-ways","gap"),marginTop:eo(".efh-ways","marginTop")},way:{flexDirection:"row",alignItems:"center",gap:eo(".efh-way","columnGap"),padding:eo(".efh-way","paddingTop"),borderRadius:eo(".efh-way","borderRadius")},wayText:{flex:1,minWidth:0,gap:eo(".efh-way__w","gap")},wayTitle:{...n,fontSize:eo(".efh-way__t","fontSize"),lineHeight:eo(".efh-way__t","lineHeight")},wayDetail:{...r,fontSize:eo(".efh-way__x","fontSize"),lineHeight:eo(".efh-way__x","lineHeight")},tracker:{marginTop:16},step:{flexDirection:"row",gap:16,paddingBottom:20},stepLast:{paddingBottom:0},stepRail:{position:"absolute",left:Dv/2-1,top:Dv+2,bottom:2,width:2,borderRadius:1,backgroundColor:t.line},stepRailDone:{backgroundColor:t.ink},stepDot:{width:Dv,height:Dv,borderRadius:Dv/2,borderWidth:2,borderColor:t.line,backgroundColor:t.card,alignItems:"center",justifyContent:"center"},stepDotOn:{borderColor:t.ink},stepDotDone:{backgroundColor:t.fill,borderColor:t.fill},stepNow:{width:10,height:10,borderRadius:5,backgroundColor:t.accent},stepText:{flex:1,minWidth:0,paddingTop:3,gap:2},stepTitle:{...n,fontSize:eo(".efh-mk__name","fontSize"),lineHeight:22,color:t.ink},stepWhen:{...r,fontSize:eo(".efh-mk__line","fontSize"),lineHeight:eo(".efh-mk__line","lineHeight"),color:t.muted},peek:{gap:12,marginTop:12},peekHead:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:12},peekLead:{...r,marginTop:-4,fontSize:no.body,lineHeight:a(no.body,1.5),color:t.text},peekLabsTitle:{marginBottom:eo(".efh-peek__labs .efh-card__title","marginBottom")},peekGroup:{marginBottom:eo(".efh-peek__g","marginBottom")},peekGroupTitle:{...n,fontSize:eo(".efh-peek__g b","fontSize"),lineHeight:Hv(eo(".efh-peek__g b","fontSize")*(eo(".efh-peek__g","lineHeight")/eo(".efh-peek__g","fontSize"))),color:t.ink},peekGroupLead:{...r,fontSize:eo(".efh-peek__g","fontSize"),lineHeight:eo(".efh-peek__g","lineHeight"),color:t.muted},more:{gap:10},moreCard:{gap:10,padding:16,borderRadius:no.cardRadius},moreHead:{flexDirection:"row",alignItems:"center",gap:8},moreTitle:{...n,fontSize:16,lineHeight:a(16,1.3),color:t.ink},moreLead:{...r,fontSize:no.body,lineHeight:a(no.body,1.5),color:t.text},moreRows:{gap:6},moreRow:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:44,paddingVertical:8,paddingHorizontal:14,borderRadius:no.rowRadius,backgroundColor:t.card},moreRowLabel:{...r,flexShrink:1,fontSize:no.body,lineHeight:a(no.body,1.4),color:t.text},moreWhen:{...l,fontSize:no.mono,letterSpacing:.24,color:t.muted},note:{...r,marginTop:eo(".efh-sheet .rec-note","marginTop"),fontSize:eo(".rec-note","fontSize"),textAlign:"center",color:t.muted},mks:{gap:2,marginHorizontal:-8},mk:{flexDirection:"row",alignItems:"center",gap:12,paddingVertical:10,paddingHorizontal:8},mkText:{flex:1,minWidth:0},mkNameRow:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:8},mkName:{...n,fontSize:no.rowTitle,lineHeight:a(no.rowTitle,1.3),color:t.ink},mkLine:{flexDirection:"row",flexWrap:"wrap",alignItems:"baseline",rowGap:eo(".efh-mk__line","rowGap"),columnGap:eo(".efh-mk__line","columnGap"),marginTop:eo(".efh-mk__line","marginTop")},mkLineText:{...r,fontSize:eo(".efh-mk__line","fontSize"),lineHeight:eo(".efh-mk__line","lineHeight"),color:t.muted,fontVariant:["tabular-nums"]},mkValue:{...n,fontSize:eo(".efh-mk__line b","fontSize"),lineHeight:Hv(eo(".efh-mk__line b","fontSize")*(eo(".efh-mk__line","lineHeight")/eo(".efh-mk__line","fontSize"))),color:t.text,fontVariant:["tabular-nums"]},mkBar:{position:"relative",width:96,height:6,borderRadius:999,backgroundColor:t.barTrack},mkBarIn:{position:"absolute",top:0,bottom:0,left:"20%",right:"20%",borderRadius:999},mkBarDot:{position:"absolute",top:-2,width:10,height:10,marginLeft:-5,borderRadius:5,borderWidth:2},topRisk:{gap:eo(".rec-top","gap"),paddingTop:eo(".rec-top","paddingTop"),paddingRight:eo(".rec-top","paddingRight"),paddingBottom:eo(".rec-top","paddingBottom"),paddingLeft:eo(".rec-top","paddingLeft"),backgroundColor:t.topFill,borderRadius:eo(".rec-top","borderRadius"),borderWidth:0,shadowOpacity:0,elevation:0},topRiskKicker:{flexDirection:"row",alignItems:"center",gap:eo(".rec-top__k","gap")},topRiskDot:{width:8,height:8,borderRadius:4,backgroundColor:t.alert},topRiskK:{...l,fontSize:eo(".rec-top__k","fontSize"),lineHeight:eo(".rec-top__k","fontSize")*1.5,letterSpacing:eo(".rec-top__k","letterSpacing"),textTransform:"uppercase",color:t.topKicker},topRiskText:{...n,fontSize:no.rowTitle,lineHeight:a(no.rowTitle,1.35),color:t.topInk},disclaimer:{...r,fontSize:no.small,lineHeight:a(no.small,1.5),textAlign:"center",color:t.muted},lab:{gap:no.gap,paddingTop:8,paddingHorizontal:16,paddingBottom:32,backgroundColor:t.ground},labTitle:{...face(e,"medium"),fontSize:no.name,lineHeight:a(no.name,1.2),letterSpacing:-.33,color:t.ink},labMeta:{...l,fontSize:no.small,lineHeight:a(no.small,1.45),color:t.muted},latest:{flexDirection:"row",flexWrap:"wrap",alignItems:"baseline",columnGap:12,rowGap:4},latestSub:{...r,fontSize:no.body,color:t.muted},change:{...r,marginTop:12,fontSize:no.body,color:t.text},changeLead:{...n,color:t.ink},ctx:{gap:12},ctxText:{...r,fontSize:no.rowTitle,lineHeight:a(no.rowTitle,1.55),color:t.text},labBody:{flexDirection:"row",gap:8},rail:{width:8,height:no.plot,overflow:"hidden",borderRadius:2},legend:{width:82,height:no.plot,position:"relative"},range:{...o,position:"absolute",left:0,right:0,fontSize:no.mono,lineHeight:a(no.mono,1.2),letterSpacing:.24,textTransform:"uppercase",color:t.dark?t.text:Iv},band:{position:"absolute",left:0,right:0,top:"25%",height:"50%",backgroundColor:t.goTint}})}var Iv="#3D3D3D",Dv=28,Hv=e=>Math.round(e*100)/100;var Lv={accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",pointerEvents:"none"},Pv=wv(sy.hero.sayWidth),Ov=eo(".efh-stage","height"),$v=Ov*ro(".efh-stage__grass","height");function Bv(e){let t=Number(e);return e.trim()!==""&&Number.isFinite(t)?String(t):e}var jv=44e3,Av=1100,Ev=1188,Fv=1200,qv=3600;function SayPhrase({text:e,index:t,family:n}){let{look:i}=my(),l=r(new L.Value(0)).current;return o(()=>{l.setValue(0);let e=O.inOut(O.ease),r=L.sequence([L.delay(Fv+t*qv),L.loop(L.sequence([L.timing(l,{toValue:1,duration:Av,easing:e,useNativeDriver:true}),L.delay(Ev),L.timing(l,{toValue:0,duration:Av,easing:e,useNativeDriver:true}),L.delay(jv-Av*2-Ev)]))]);return r.start(),()=>r.stop()},[t,l]),/* @__PURE__ */j(ArcLine,{line:e,geom:Pv,opacity:l,text:{fontFamily:n,fontWeight:"500",fontSize:Pv.font,lineHeight:Pv.line,color:i.ink}})}function HubSay({family:e}){let{look:t}=my();return useEverfurTheme().motion.reducedMotion?/* @__PURE__ */j(ArcLine,{line:Zb.sayLine,geom:Pv,opacity:1,text:{fontFamily:e,fontWeight:"500",fontSize:Pv.font,lineHeight:Pv.line,color:t.ink}}):/* @__PURE__ */j(E,{children:Zb.sayPhrases.map((t,r)=>/* @__PURE__ */j(SayPhrase,{text:t,index:r,family:e},t))})}function HubHero({name:e,meta:t,stage:r,art:n,handFontFamily:l,say:o,vitals:a,vitalsName:s,renderStage:d,exam:c,onOpenExam:u,headPill:h,fromLine:p}){let{look:g,face:f}=my(),y=useEverfurTheme().motion.reducedMotion,[v,w]=i(false),k=c!=null,x=r!==void 0||d===void 0,T=nv($v,y),_=r?.grassSource??tv,[R,S]=i(null),z=Gv(_),I=a.length>0?/* @__PURE__ */j(m,{style:x?{position:"absolute",top:eo(".efh-stage .efh-vitals","top"),left:eo(".efh-stage .efh-vitals","left"),gap:eo(".efh-stage .efh-vitals","gap")}:{paddingHorizontal:sy.screen.padX,marginTop:4,gap:eo(".efh-stage .efh-vitals","gap")},accessibilityLabel:Zb.vitalsLabel(s),testID:"everfur-records-sheet-vitals",children:a.map((e,t)=>{let r=Bv(e.value),n=e.kind==="temp"?Zb.temperature:e.kind==="heart"?Zb.heartRate:Zb.breathing,i=e.kind==="temp"?"thermo":e.kind==="heart"?"heart":"wind",l=e.kind==="temp"?g.ink:e.kind==="heart"?g.alert:g.icoBlue;/* @__PURE__ */
|
|
800
|
+
return j(RiseIn,{index:t,reduced:y,children:/* @__PURE__ */A(b,{disabled:!k,onPress:()=>w(e=>!e),accessible:true,...k?{accessibilityRole:"button",accessibilityState:{expanded:v}}:{},accessibilityLabel:Zb.vitalLabel(n,r,e.unit??"",k),hitSlop:6,style:{flexDirection:"row",alignItems:"center",gap:sy.hero.vitalGap},testID:`everfur-records-sheet-vital-${e.kind}`,children:[
|
|
801
|
+
/* @__PURE__ */j(HubIcon,{name:i,size:sy.hero.vitalIcon,color:l}),
|
|
802
|
+
/* @__PURE__ */j(HubText,{variant:"bodySmBold",tier:"compact",color:g.ink,style:{fontSize:sy.hero.vitalValueSize,lineHeight:sy.hero.vitalValueSize*1.2},children:r}),e.unit?/* @__PURE__ */j(HubText,{variant:"fine",tier:"compact",style:{fontSize:sy.hero.vitalUnitSize},children:e.unit}):null]})},e.kind)})}):null,D=k&&v?/* @__PURE__ */A(m,{accessibilityLiveRegion:"polite",style:{marginTop:8,marginHorizontal:sy.screen.padX,padding:sy.card.pad,borderRadius:sy.card.radius,backgroundColor:g.white,borderWidth:1,borderColor:g.line},testID:"everfur-records-sheet-vitals-from",children:[
|
|
803
|
+
/* @__PURE__ */j(HubText,{variant:"bodySm",children:Ib.vitalsFrom(c.vet,c.date)}),
|
|
804
|
+
/* @__PURE__ */j(AnnounceLine,{line:Ib.vitalsFrom(c.vet,c.date)}),u!==void 0?/* @__PURE__ */j(HubButton,{label:Ib.examNotes,variant:"text",onPress:u,testID:"everfur-records-sheet-vitals-exam-notes"}):null]}):null,H=l;/* @__PURE__ */
|
|
805
|
+
return A(m,{style:{marginTop:4,marginHorizontal:-sy.screen.padX},testID:"everfur-records-hub-hero",children:[
|
|
806
|
+
/* @__PURE__ */A(m,{style:[{flexDirection:"row",alignItems:"center",gap:8,paddingHorizontal:sy.screen.padX},o?null:{minHeight:sy.peek.roundButton}],testID:"everfur-records-sheet-head",children:[
|
|
807
|
+
/* @__PURE__ */j(HubText,{variant:"screenTitle",accessibilityRole:"header",numberOfLines:1,testID:"everfur-records-sheet-name",style:[f("bold"),{flexShrink:1,fontSize:sy.hero.nameSize,lineHeight:sy.hero.nameSize*1.2,letterSpacing:sy.hero.nameTracking}],children:e}),h!=null?/* @__PURE__ */j(HubPill,{label:h.label,tone:h.tone,testID:"everfur-records-sheet-head-pill"}):null]}),t!==null?/* @__PURE__ */j(HubText,{variant:"fine",testID:"everfur-records-sheet-meta",style:{marginTop:sy.hero.metaTop,paddingHorizontal:sy.screen.padX,lineHeight:sy.hero.metaLineHeight,textTransform:"uppercase",letterSpacing:sy.hero.metaTracking},children:t}):null,x?/* @__PURE__ */A(m,{style:{height:Ov,marginTop:eo(".efh-stage","marginTop"),overflow:"hidden"},testID:"everfur-records-sheet-stage",children:[
|
|
808
|
+
/* @__PURE__ */j(L.View,{style:[{position:"absolute",left:0,right:0,bottom:0,height:$v,overflow:"hidden"},T.grass],...Lv,children:R===z?null:/* @__PURE__ */j(C,{source:_,onError:()=>S(z),style:{position:"absolute",top:0,left:0,right:0,height:"100%"},resizeMode:"cover",testID:"everfur-records-sheet-grass"})}),
|
|
809
|
+
/* @__PURE__ */j(L.View,{style:[{position:"absolute",left:`${(2*ro(".efh-stage__pet","left")-1)*100}%`,right:0,bottom:eo(".efh-stage__pet","bottom"),alignItems:"center"},o?{top:sy.hero.sayHeight-4}:{height:`${ro(".efh-stage__pet","height")*100}%`},T.pet],...Lv,children:r!==void 0?/* @__PURE__ */j(C,{source:r.petSource,style:{width:"100%",height:"100%"},resizeMode:"contain"}):/* @__PURE__ */j(HubPetArt,{art:n.art,onError:n.onError,reduced:y})}),o&&H!==null?/* @__PURE__ */j(m,{style:{position:"absolute",top:0,left:"50%",width:sy.hero.sayWidth,height:sy.hero.sayHeight,marginLeft:-sy.hero.sayWidth/2},testID:"everfur-records-sheet-say",...Lv,children:/* @__PURE__ */j(HubSay,{family:H})}):null,I]}):/* @__PURE__ */A(E,{children:[d!==void 0?/* @__PURE__ */j(HostRender,{render:d,fallback:null,resetKey:e}):null,I]}),p!=null&&p.trim().length>0&&a.length>0?/* @__PURE__ */j(HubText,{variant:"labelMono",testID:"everfur-records-sheet-vitals-line",style:{marginTop:eo(".efh-head__from","marginTop"),paddingHorizontal:sy.screen.padX},children:p}):null,D]})}function HubPrompt({title:e,canAct:t,canRequest:r,onRequest:n,onUpload:i,note:l}){let o=useEverfurTheme().motion.reducedMotion;/* @__PURE__ */
|
|
809
810
|
return j(HubReveal,{index:1,reduced:o,children:/* @__PURE__ */A(HubCard,{title:e,testID:"everfur-records-records-prompt",children:[
|
|
810
|
-
/* @__PURE__ */j(HubText,{variant:"bodySm",children:
|
|
811
|
-
return j(HubCard,{title:
|
|
811
|
+
/* @__PURE__ */j(HubText,{variant:"bodySm",children:Zb.moreThanOneClinic}),t&&r?/* @__PURE__ */j(HubButton,{label:Zb.requestFromClinic,icon:"download",block:true,onPress:n,style:{marginTop:12},testID:"everfur-records-sheet-none-request"}):null,t&&r&&l?/* @__PURE__ */j(m,{style:{marginTop:12},children:l}):null,t?/* @__PURE__ */j(HubButton,{label:Zb.uploadDocument,icon:"upload",variant:"secondary",block:true,onPress:i,style:{marginTop:12},testID:"everfur-records-sheet-none-upload"}):null]})})}function HubUpcoming({rows:e,items:t,onViewAll:r,renderAction:n,actionLabel:i,onAction:l}){let{look:o}=my(),a=sy.upcoming,s=useEverfurTheme().motion.reducedMotion;/* @__PURE__ */
|
|
812
|
+
return j(HubCard,{title:Zb.upcomingCare,titleEnd:r!==void 0?/* @__PURE__ */j(HubButton,{label:Zb.viewAll,variant:"text",onPress:r,testID:"everfur-records-sheet-upcoming-all"}):void 0,testID:"everfur-records-hub-upcoming",children:/* @__PURE__ */j(m,{style:{gap:a.listGap,marginHorizontal:eo(".efh-due","marginLeft")},children:e.map((e,r)=>{let d=e.tone==="overdue",c=t.get(e.key);/* @__PURE__ */
|
|
812
813
|
return j(RiseIn,{index:r,reduced:s,children:/* @__PURE__ */A(m,{style:[{flexDirection:"row",alignItems:"center",gap:eo(".efh-due li","gap"),padding:eo(".efh-due li","paddingTop"),borderRadius:eo(".efh-due li","borderRadius")},d?{backgroundColor:o.tintRed}:null],testID:`everfur-records-sheet-due-${r}`,children:[
|
|
813
814
|
/* @__PURE__ */A(m,{style:{flex:1,flexDirection:"row",alignItems:"center",gap:a.rowGap},accessible:true,accessibilityLabel:`${e.label}, ${e.when}`,children:[
|
|
814
815
|
/* @__PURE__ */j(HubIcon,{name:e.icon,size:a.icon,color:d?o.alert:o.icoGrey}),
|
|
815
816
|
/* @__PURE__ */A(m,{style:{flex:1,minWidth:0},children:[
|
|
816
817
|
/* @__PURE__ */j(HubText,{variant:"bodySmBold",numberOfLines:2,style:{fontSize:eo(".efh-due__title","fontSize"),lineHeight:eo(".efh-due__title","lineHeight")},children:e.label}),
|
|
817
818
|
/* @__PURE__ */j(HubText,{variant:"fine",children:e.when})]})]}),d&&n!==void 0&&c!==void 0?/* @__PURE__ */j(HostRender,{render:()=>n(c),fallback:null,resetKey:c}):d&&l!==void 0&&i!==void 0?/* @__PURE__ */j(HubButton,{label:i,size:"row",onPress:()=>l(e),accessibilityLabel:`${i}, ${e.label}`,testID:`everfur-records-sheet-due-${r}-action`}):e.pill!==null?/* @__PURE__ */j(HubPill,{label:e.pill.label,tone:e.pill.tone}):null]})},e.key)})})})}function HubUpcomingEmpty({name:e}){/* @__PURE__ */
|
|
818
|
-
return j(HubCard,{title:
|
|
819
|
+
return j(HubCard,{title:Zb.upcomingCare,testID:"everfur-records-hub-upcoming-empty",children:/* @__PURE__ */j(HubText,{variant:"bodySm",children:Zb.nothingDue(e)})})}function Tile({index:e,tint:t,icon:r,title:n,label:i,foot:l,footGap:o=eo(".efh-tile__foot","gap"),onOpen:a,testID:s}){let{look:d}=my(),c=sy.tiles,u=/* @__PURE__ */A(E,{children:[
|
|
819
820
|
/* @__PURE__ */A(m,{style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[
|
|
820
821
|
/* @__PURE__ */j(HubIcon,{name:r,size:c.icon}),a!==void 0?/* @__PURE__ */j(HubIcon,{name:"chevron",size:c.chevron,color:d.icoSage}):null]}),
|
|
821
822
|
/* @__PURE__ */j(m,{style:{flexGrow:1,justifyContent:"flex-end"},children:/* @__PURE__ */j(HubText,{variant:"bodySmBold",style:{fontSize:eo(".efh-tile__title","fontSize"),lineHeight:eo(".efh-tile__title","lineHeight"),letterSpacing:eo(".efh-tile__title","letterSpacing")},children:n})}),
|
|
822
823
|
/* @__PURE__ */j(m,{style:{minHeight:eo(".efh-tile__foot","minHeight"),flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:o},children:l})]}),h={flexGrow:1,padding:eo(".efh-tile","paddingTop"),borderRadius:eo(".efh-tile","borderRadius"),gap:eo(".efh-tile","gap"),backgroundColor:t},p=useEverfurTheme().motion.reducedMotion;/* @__PURE__ */
|
|
823
|
-
return j(HubReveal,{index:e,reduced:p,style:{width:"48%",flexGrow:1,flexDirection:"column"},children:a!==void 0?/* @__PURE__ */j(b,{onPress:a,accessibilityRole:"button",accessibilityLabel:i,style:h,testID:s,children:u}):/* @__PURE__ */j(m,{style:h,accessible:true,accessibilityLabel:i,testID:s,children:u})})}function HubTilesSection({tiles:e,labsUnknown:t,onOpenLabs:r,onOpenScreenings:n,onOpenVisits:i,onOpenTimeline:l,screeningsPills:o}){let{look:a}=
|
|
824
|
+
return j(HubReveal,{index:e,reduced:p,style:{width:"48%",flexGrow:1,flexDirection:"column"},children:a!==void 0?/* @__PURE__ */j(b,{onPress:a,accessibilityRole:"button",accessibilityLabel:i,style:h,testID:s,children:u}):/* @__PURE__ */j(m,{style:h,accessible:true,accessibilityLabel:i,testID:s,children:u})})}function HubTilesSection({tiles:e,labsUnknown:t,onOpenLabs:r,onOpenScreenings:n,onOpenVisits:i,onOpenTimeline:l,screeningsPills:o}){let{look:a}=my(),s=sy.tiles,d=[...o??[],...e.screeningsPill!==null?[e.screeningsPill]:[]];/* @__PURE__ */
|
|
824
825
|
return A(m,{style:{marginTop:eo(".efh-sec","marginTop")},testID:"everfur-records-hub-records",children:[
|
|
825
|
-
/* @__PURE__ */j(HubText,{variant:"cardTitle",accessibilityRole:"header",style:{marginBottom:eo(".efh-sec","marginBottom")},children:
|
|
826
|
+
/* @__PURE__ */j(HubText,{variant:"cardTitle",accessibilityRole:"header",style:{marginBottom:eo(".efh-sec","marginBottom")},children:Zb.recordsHistory}),
|
|
826
827
|
/* @__PURE__ */A(m,{style:{flexDirection:"row",flexWrap:"wrap",gap:eo(".efh-tiles","gap")},children:[
|
|
827
|
-
/* @__PURE__ */j(Tile,{index:0,tint:a.tintSage,icon:"flask",title:
|
|
828
|
-
/* @__PURE__ */j(HubText,{variant:"bodySmBold",testID:"everfur-records-sheet-labs-count",style:{fontSize:eo(".efh-tile__num","fontSize"),lineHeight:eo(".efh-tile__num","lineHeight"),letterSpacing:eo(".efh-tile__num","letterSpacing")},children:t?
|
|
829
|
-
/* @__PURE__ */j(Tile,{index:1,tint:a.tintPartner,icon:"shield",title:
|
|
830
|
-
/* @__PURE__ */j(Tile,{index:2,tint:a.tintBlue,icon:"folder",title:
|
|
831
|
-
/* @__PURE__ */j(Tile,{index:3,tint:a.tintYellow,icon:"clock",title:
|
|
832
|
-
return j(Text,{allowFontScaling:false,numberOfLines:1,style:[i,{position:"absolute",top:o,fontSize:n,lineHeight:n},s],children:l})}function WeightChart({weight:e}){let{look:t,face:r}=
|
|
828
|
+
/* @__PURE__ */j(Tile,{index:0,tint:a.tintSage,icon:"flask",title:Zb.labs,label:t?Zb.labsA11yUnknown:Zb.labsA11y(e.labsTotal,e.labsNoun),onOpen:r,testID:"everfur-records-sheet-tile-labs",foot:/* @__PURE__ */A(m,{style:{flexDirection:"row",flexWrap:"wrap",alignItems:"baseline",gap:s.countGap},children:[
|
|
829
|
+
/* @__PURE__ */j(HubText,{variant:"bodySmBold",testID:"everfur-records-sheet-labs-count",style:{fontSize:eo(".efh-tile__num","fontSize"),lineHeight:eo(".efh-tile__num","lineHeight"),letterSpacing:eo(".efh-tile__num","letterSpacing")},children:t?Zb.labsCountUnknown:String(e.labsTotal)}),t?null:/* @__PURE__ */j(HubText,{variant:"fine",children:e.labsNoun})]})}),
|
|
830
|
+
/* @__PURE__ */j(Tile,{index:1,tint:a.tintPartner,icon:"shield",title:Zb.screenings,onOpen:n,testID:"everfur-records-sheet-tile-screenings",label:Zb.screeningsA11y(d.length>0?d.map(e=>e.label).join(", "):null),footGap:d.length>1?eo(".efh-tile__foot:has(.efh-pill + .efh-pill)","gap"):void 0,foot:d.length>0?d.map((e,t)=>/* @__PURE__ */j(HubPill,{small:true,label:e.label,tone:e.tone,testID:`everfur-records-sheet-screenings-pill-${t}`},`${e.label}${t}`)):/* @__PURE__ */j(HubText,{variant:"fine",children:Ib.noScreenings})}),
|
|
831
|
+
/* @__PURE__ */j(Tile,{index:2,tint:a.tintBlue,icon:"folder",title:Zb.visits,label:Zb.visitsA11y(e.visitDate),onOpen:i,testID:"everfur-records-sheet-tile-record",foot:e.visitDate!==null?/* @__PURE__ */j(HubPill,{small:true,label:e.visitDate,tone:"plain"}):/* @__PURE__ */j(HubText,{variant:"fine",children:Ib.noVisits})}),
|
|
832
|
+
/* @__PURE__ */j(Tile,{index:3,tint:a.tintYellow,icon:"clock",title:Zb.timeline,label:Zb.timelineA11y(e.timelineCount),onOpen:l,testID:"everfur-records-sheet-tile-timeline",foot:e.timelineCount>0?/* @__PURE__ */j(HubPill,{small:true,label:Zb.events(e.timelineCount),tone:"plain"}):null})]})]})}var Mv=.85;function ChartText({x:e,y:t,anchor:r,size:n,style:i,children:l}){let o=t-n*Mv,a=160,s=r==="start"?{left:e}:r==="end"?{left:e-a,width:a,textAlign:"right"}:{left:e-a/2,width:a,textAlign:"center"};/* @__PURE__ */
|
|
833
|
+
return j(Text,{allowFontScaling:false,numberOfLines:1,style:[i,{position:"absolute",top:o,fontSize:n,lineHeight:n},s],children:l})}function WeightChart({weight:e}){let{look:t,face:r}=my(),[n,l]=i(0),[o,a]=i(null),s=useEverfurTheme().motion.reducedMotion,d=av(n>0,s),c=e=>{let t=Math.round(e.nativeEvent.layout.width);t>0&&t!==n&&l(t)},u=sy.chart;if(n===0)/* @__PURE__ */return j(m,{onLayout:c,style:{height:u.height}});let h=Uy(e,n),p=u.dot+u.dotRing/2,g=h.cols.length>1?h.cols[1]-h.cols[0]:h.dataRight-(h.cols[0]??0),f=o!==null?h.dots[o]??null:null,y=sv(h.dots);/* @__PURE__ */
|
|
833
834
|
return A(m,{onLayout:c,style:{height:u.height},children:[
|
|
834
835
|
/* @__PURE__ */A(m,{accessible:true,accessibilityRole:"image",accessibilityLabel:h.summary,style:{position:"absolute",left:0,top:0,right:0,bottom:0},children:[h.hasBand?/* @__PURE__ */A(E,{children:[
|
|
835
836
|
/* @__PURE__ */j(m,{style:{position:"absolute",left:0,top:h.plotTop,width:u.indicatorWidth,height:h.plotBottom-h.plotTop,borderRadius:u.indicatorWidth/2,backgroundColor:t.chartGrid}}),
|
|
836
837
|
/* @__PURE__ */j(m,{style:{position:"absolute",left:0,top:h.yBandTop,width:u.indicatorWidth,height:Math.max(0,h.yBandBottom-h.yBandTop),borderRadius:u.indicatorWidth/2,backgroundColor:t.go}}),
|
|
837
|
-
/* @__PURE__ */j(m,{style:{position:"absolute",left:h.plotLeft,top:h.yBandTop,width:Math.max(0,h.dataRight-h.plotLeft),height:Math.max(0,h.yBandBottom-h.yBandTop),backgroundColor:t.chartBand}})]}):null,h.cols.map((e,r)=>/* @__PURE__ */j(m,{style:{position:"absolute",left:e-.5,top:h.plotTop,width:1,height:h.plotBottom-h.plotTop,backgroundColor:t.chartGrid}},`g-${r}`)),h.hasBand?[h.yBandTop,h.yBandBottom].map((e,r)=>/* @__PURE__ */j(m,{style:{position:"absolute",left:h.plotLeft,top:e-.5,width:Math.max(0,h.dataRight-h.plotLeft),height:1,backgroundColor:t.line}},`e-${r}`)):null,h.dots.slice(1).map((e,r)=>{let n=h.dots[r],i=Math.hypot(e.x-n.x,e.y-n.y),l=u.lineWidth,o=
|
|
838
|
-
return j(L.View,{style:{position:"absolute",left:(n.x+e.x)/2-(i+l)/2,top:(n.y+e.y)/2-l/2,width:i+l,height:l,borderRadius:l/2,backgroundColor:t.chartLine,transform:[{rotate:`${Math.atan2(e.y-n.y,e.x-n.x)}rad`},{translateX:o.translateX},{scaleX:o.scaleX}]}},`l-${r}`)}),h.dots.map((e,r)=>/* @__PURE__ */j(L.View,{style:{position:"absolute",left:e.x-p,top:e.y-p,width:p*2,height:p*2,borderRadius:p,borderWidth:u.dotRing,borderColor:t.white,backgroundColor:e.status==="over"||e.status==="under"?t.yellow:t.go,opacity:
|
|
838
|
+
/* @__PURE__ */j(m,{style:{position:"absolute",left:h.plotLeft,top:h.yBandTop,width:Math.max(0,h.dataRight-h.plotLeft),height:Math.max(0,h.yBandBottom-h.yBandTop),backgroundColor:t.chartBand}})]}):null,h.cols.map((e,r)=>/* @__PURE__ */j(m,{style:{position:"absolute",left:e-.5,top:h.plotTop,width:1,height:h.plotBottom-h.plotTop,backgroundColor:t.chartGrid}},`g-${r}`)),h.hasBand?[h.yBandTop,h.yBandBottom].map((e,r)=>/* @__PURE__ */j(m,{style:{position:"absolute",left:h.plotLeft,top:e-.5,width:Math.max(0,h.dataRight-h.plotLeft),height:1,backgroundColor:t.line}},`e-${r}`)):null,h.dots.slice(1).map((e,r)=>{let n=h.dots[r],i=Math.hypot(e.x-n.x,e.y-n.y),l=u.lineWidth,o=dv(d,y[r],i+l);/* @__PURE__ */
|
|
839
|
+
return j(L.View,{style:{position:"absolute",left:(n.x+e.x)/2-(i+l)/2,top:(n.y+e.y)/2-l/2,width:i+l,height:l,borderRadius:l/2,backgroundColor:t.chartLine,transform:[{rotate:`${Math.atan2(e.y-n.y,e.x-n.x)}rad`},{translateX:o.translateX},{scaleX:o.scaleX}]}},`l-${r}`)}),h.dots.map((e,r)=>/* @__PURE__ */j(L.View,{style:{position:"absolute",left:e.x-p,top:e.y-p,width:p*2,height:p*2,borderRadius:p,borderWidth:u.dotRing,borderColor:t.white,backgroundColor:e.status==="over"||e.status==="under"?t.yellow:t.go,opacity:uv(d,cv(y,r))}},`d-${r}`)),h.showValues?h.dots.map((e,n)=>/* @__PURE__ */j(ChartText,{x:e.labelX,y:e.labelBaseline,anchor:e.labelAnchor,size:h.valueFont,style:[r("bold"),{color:t.text}],children:e.label},`v-${n}`)):null,h.legend.flatMap(e=>e.lines.map((n,i)=>/* @__PURE__ */j(ChartText,{x:u.legendX,y:e.baselines[i],anchor:"start",size:u.legendSize,style:[r("monoBold"),{color:t.charcoal,letterSpacing:u.legendTracking}],children:n},`k-${e.zone}-${i}`))),h.months.map((e,n)=>/* @__PURE__ */j(ChartText,{x:e.x,y:u.monthY,anchor:e.anchor,size:u.monthSize,style:[r("mono"),{color:t.muted}],children:e.label},`m-${n}`))]}),h.dots.map((e,t)=>{let r=g/2;/* @__PURE__ */
|
|
839
840
|
return j(b,{onPress:()=>a(e=>e===t?null:t),accessibilityRole:"button",accessibilityLabel:e.spoken,style:{position:"absolute",left:Math.max(0,e.x-r),top:h.plotTop,width:Math.max(1,r*2),height:Math.max(1,h.plotBottom-h.plotTop)}},`t-${t}`)}),f!==null?
|
|
840
|
-
/* @__PURE__ */j(m,{pointerEvents:"none",style:{position:"absolute",width:92,height:40,borderRadius:8,paddingHorizontal:8,paddingVertical:5,backgroundColor:t.chartLine,alignItems:"center",justifyContent:"center",left:Math.min(Math.max(f.x-46,u.edgePad),Math.max(u.edgePad,n-92-u.edgePad)),top:f.y-40-u.dot-4>=0?f.y-40-u.dot-4:f.y+u.dot+4},children:/* @__PURE__ */j(Text,{style:[r("bold"),{fontSize:13,color:t.white}],children:`${f.label} ${e.unit}`})}):null]})}function PhoneWeightChart({weight:e}){let{s:t,look:r}=
|
|
841
|
+
/* @__PURE__ */j(m,{pointerEvents:"none",style:{position:"absolute",width:92,height:40,borderRadius:8,paddingHorizontal:8,paddingVertical:5,backgroundColor:t.chartLine,alignItems:"center",justifyContent:"center",left:Math.min(Math.max(f.x-46,u.edgePad),Math.max(u.edgePad,n-92-u.edgePad)),top:f.y-40-u.dot-4>=0?f.y-40-u.dot-4:f.y+u.dot+4},children:/* @__PURE__ */j(Text,{style:[r("bold"),{fontSize:13,color:t.white}],children:`${f.label} ${e.unit}`})}):null]})}function PhoneWeightChart({weight:e}){let{s:t,look:r}=Sv(),n=Yy(e),i=12,l=r.dark?r.text:r.ink,o=-(4+(t.pointLabel.lineHeight??14)),a=[{top:"0%",height:"25%",word:n.legend[0]},{top:"25%",height:"50%",word:n.legend[1]},{top:"75%",height:"25%",word:n.legend[2]}];/* @__PURE__ */
|
|
841
842
|
return A(m,{testID:"everfur-records-sheet-weight-chart",children:[
|
|
842
843
|
/* @__PURE__ */A(m,{style:t.labBody,children:[n.hasBand?/* @__PURE__ */A(E,{children:[
|
|
843
|
-
/* @__PURE__ */A(m,{style:t.rail,...
|
|
844
|
+
/* @__PURE__ */A(m,{style:t.rail,...Lv,children:[
|
|
844
845
|
/* @__PURE__ */j(m,{style:{flex:1,backgroundColor:r.line}}),
|
|
845
846
|
/* @__PURE__ */j(m,{style:{flex:2,backgroundColor:r.go}}),
|
|
846
847
|
/* @__PURE__ */j(m,{style:{flex:1,backgroundColor:r.line}})]}),
|
|
847
|
-
/* @__PURE__ */j(m,{style:t.legend,...
|
|
848
|
-
/* @__PURE__ */A(m,{style:[t.plot,{flex:1,minWidth:0}],accessible:true,accessibilityRole:"image",accessibilityLabel:n.summary,children:[n.hasBand?/* @__PURE__ */j(m,{style:t.band,...
|
|
849
|
-
/* @__PURE__ */j(m,{style:[t.xAxis,n.hasBand?{marginLeft:106}:null],...
|
|
850
|
-
return j(HubReveal,{index:3,reduced:o,children:/* @__PURE__ */j(HubCard,{title:
|
|
851
|
-
return j(HubReveal,{index:3,reduced:o,children:/* @__PURE__ */A(HubCard,{title:
|
|
848
|
+
/* @__PURE__ */j(m,{style:t.legend,...Lv,children:a.map(e=>/* @__PURE__ */j(m,{style:{position:"absolute",left:0,right:0,top:e.top,height:e.height,justifyContent:"center"},children:/* @__PURE__ */j(Text,{style:[t.range,{position:"relative"}],maxFontSizeMultiplier:1,children:e.word})},e.word))})]}):null,
|
|
849
|
+
/* @__PURE__ */A(m,{style:[t.plot,{flex:1,minWidth:0}],accessible:true,accessibilityRole:"image",accessibilityLabel:n.summary,children:[n.hasBand?/* @__PURE__ */j(m,{style:t.band,...Lv}):null,n.points.length>1?/* @__PURE__ */j(ChartLine,{points:n.points,color:r.dark?r.text:Yl.efBlack}):null,n.points.map((e,n)=>/* @__PURE__ */j(m,{...Lv,style:[t.point,{left:`${e.x}%`,top:`${e.y}%`,width:i,height:i,marginLeft:-i/2,marginTop:-i/2,borderRadius:i/2,backgroundColor:e.out?r.alert:l}]},`d${n}`)),n.points.map((e,l)=>n.allValues||l===n.points.length-1?/* @__PURE__ */j(Text,{maxFontSizeMultiplier:1,...Lv,style:[t.pointLabel,e.edge==="end"?{left:void 0,right:`${100-e.x}%`,marginLeft:0,marginRight:-4,textAlign:"right"}:e.edge==="start"?{left:`${e.x}%`,marginLeft:-4,textAlign:"left"}:{left:`${e.x}%`},{top:`${e.y}%`,marginTop:o-i/2},e.out?{color:r.alert,fontWeight:"700"}:null],children:e.label},`v${l}`):null)]})]}),
|
|
850
|
+
/* @__PURE__ */j(m,{style:[t.xAxis,n.hasBand?{marginLeft:106}:null],...Lv,children:n.ticks.map((e,r)=>/* @__PURE__ */j(Text,{maxFontSizeMultiplier:1,style:[t.xTick,e.edge==="end"?{left:void 0,right:`${100-e.x}%`,marginLeft:0,marginRight:-4,textAlign:"right"}:e.edge==="start"?{left:`${e.x}%`,marginLeft:-4,textAlign:"left"}:{left:`${e.x}%`}],children:e.label},r))})]})}var Nv={textTransform:"uppercase",letterSpacing:sy.hero.metaTracking,lineHeight:sy.hero.metaLineHeight};function HubWeightCard({weight:e,name:t,extras:r,chart:n="phone"}){let{look:i}=my(),l=sy.weight,o=useEverfurTheme().motion.reducedMotion;if(e===null)/* @__PURE__ */
|
|
851
|
+
return j(HubReveal,{index:3,reduced:o,children:/* @__PURE__ */j(HubCard,{title:Zb.weight,testID:"everfur-records-hub-weight",children:/* @__PURE__ */j(HubText,{variant:"bodySm",children:Zb.noWeights(t)})})});let a={fontSize:eo(".efh-wt b","fontSize"),lineHeight:eo(".efh-wt b","lineHeight"),letterSpacing:eo(".efh-wt b","letterSpacing")},s=r?.status??null,d=r?.prediction??null,c=r?.key??[];/* @__PURE__ */
|
|
852
|
+
return j(HubReveal,{index:3,reduced:o,children:/* @__PURE__ */A(HubCard,{title:Zb.weight,titleEnd:s!==null?/* @__PURE__ */j(HubPill,{label:s.label,tone:s.tone,testID:"everfur-records-sheet-weight-status"}):void 0,testID:"everfur-records-hub-weight",children:[
|
|
852
853
|
/* @__PURE__ */j(m,{style:{gap:l.headGap},children:/* @__PURE__ */A(m,{style:{flexDirection:"row",flexWrap:"wrap",alignItems:"baseline",gap:eo(".efh-wt","gap")},children:[
|
|
853
|
-
/* @__PURE__ */j(HubRollingDigits,{text:e.primary,reduced:o,testID:"everfur-records-sheet-weight-latest",renderText:(e,t)=>/* @__PURE__ */j(HubText,{variant:"bodySmBold",style:[a,t?.style],...t?.testID!==void 0?{testID:t.testID}:{},children:e})}),e.secondary!==null?/* @__PURE__ */j(HubText,{variant:"bodySm",color:i.muted,style:{lineHeight:eo(".efh","fontSize")*1.5},children:e.secondary}):null]})}),d!==null&&d.text.trim().length>0?/* @__PURE__ */A(m,{style:{flexDirection:"row",alignItems:"center",gap:eo(".efh-emb","gap"),marginTop:eo(".efh-emb","marginTop")},testID:"everfur-records-sheet-weight-prediction",children:[d.icon!==void 0?/* @__PURE__ */j(m,{...
|
|
854
|
+
/* @__PURE__ */j(HubRollingDigits,{text:e.primary,reduced:o,testID:"everfur-records-sheet-weight-latest",renderText:(e,t)=>/* @__PURE__ */j(HubText,{variant:"bodySmBold",style:[a,t?.style],...t?.testID!==void 0?{testID:t.testID}:{},children:e})}),e.secondary!==null?/* @__PURE__ */j(HubText,{variant:"bodySm",color:i.muted,style:{lineHeight:eo(".efh","fontSize")*1.5},children:e.secondary}):null]})}),d!==null&&d.text.trim().length>0?/* @__PURE__ */A(m,{style:{flexDirection:"row",alignItems:"center",gap:eo(".efh-emb","gap"),marginTop:eo(".efh-emb","marginTop")},testID:"everfur-records-sheet-weight-prediction",children:[d.icon!==void 0?/* @__PURE__ */j(m,{...Lv,children:d.icon}):null,
|
|
854
855
|
/* @__PURE__ */j(HubText,{variant:"bodySm",style:{flex:1,minWidth:0,fontSize:eo(".efh-emb","fontSize"),lineHeight:eo(".efh-emb","lineHeight")},children:d.text})]}):null,e.points.length>=2?/* @__PURE__ */A(m,{style:{marginTop:eo(".efh-wchart","marginTop")},children:[n==="app"?/* @__PURE__ */j(WeightChart,{weight:e}):/* @__PURE__ */j(PhoneWeightChart,{weight:e}),c.length>0?/* @__PURE__ */j(m,{style:{flexDirection:"row",flexWrap:"wrap",rowGap:eo(".efh-wkey","rowGap"),columnGap:eo(".efh-wkey","columnGap"),marginTop:eo(".efh-wkey","marginTop")},testID:"everfur-records-sheet-weight-key",children:c.map(e=>{let t=e.kind==="vet"?12:7;/* @__PURE__ */
|
|
855
856
|
return A(m,{style:{flexDirection:"row",alignItems:"center",gap:eo(".efh-wkey span","gap")},children:[
|
|
856
857
|
/* @__PURE__ */j(m,{style:{width:t,height:t,borderRadius:t/2,backgroundColor:e.kind==="vet"?i.ink:i.go}}),
|
|
857
|
-
/* @__PURE__ */j(HubText,{variant:"fine",style:{fontSize:eo(".efh-wkey","fontSize"),lineHeight:eo(".efh-wkey","lineHeight")},children:e.label})]},e.label)})}):e.band!==null?/* @__PURE__ */j(HubText,{variant:"fine",children:
|
|
858
|
-
/* @__PURE__ */A(m,{style:{gap:8,marginTop:l.headBottom},children:[e.date!==null?/* @__PURE__ */j(HubText,{variant:"fine",style:
|
|
859
|
-
/* @__PURE__ */j(HubText,{variant:"fine",style:
|
|
860
|
-
return j(HubButton,{label:
|
|
861
|
-
/* @__PURE__ */j(HubText,{variant:"bodySm",children:e.text}),t!==void 0?/* @__PURE__ */j(SeeWhereItStands,{onPress:()=>t(e.requestId)}):null]},e.key))})}function HubAddRecords({words:e,sources:t,canRequest:r,onRequest:n,onUpload:i,note:l,inFlight:o=[],onOpenRequest:a,uploadHint:s}){let{look:d}=
|
|
858
|
+
/* @__PURE__ */j(HubText,{variant:"fine",style:{fontSize:eo(".efh-wkey","fontSize"),lineHeight:eo(".efh-wkey","lineHeight")},children:e.label})]},e.label)})}):e.band!==null?/* @__PURE__ */j(HubText,{variant:"fine",children:Zb.estimatedRange}):null]}):e.points.length===1?
|
|
859
|
+
/* @__PURE__ */A(m,{style:{gap:8,marginTop:l.headBottom},children:[e.date!==null?/* @__PURE__ */j(HubText,{variant:"fine",style:Nv,testID:"everfur-records-sheet-weight-date",children:e.date}):null,
|
|
860
|
+
/* @__PURE__ */j(HubText,{variant:"fine",style:Nv,testID:"everfur-records-sheet-weight-single",children:Ib.oneReading})]}):null]})})}function SeeWhereItStands({onPress:e,testID:t="everfur-records-sheet-on-the-way-go"}){/* @__PURE__ */
|
|
861
|
+
return j(HubButton,{label:Em.seeWhereItStands,variant:"secondary",size:"sm",icon:"chevron",onPress:e,style:{alignSelf:"flex-start"},testID:t})}function HubInFlight({lines:e,onOpenRequest:t}){return e.length===0?null:/* @__PURE__ */j(m,{style:{gap:12},testID:"everfur-records-sheet-in-flight",children:e.map(e=>/* @__PURE__ */A(m,{style:{gap:8,alignItems:"flex-start"},testID:"everfur-records-sheet-on-the-way",children:[
|
|
862
|
+
/* @__PURE__ */j(HubText,{variant:"bodySm",children:e.text}),t!==void 0?/* @__PURE__ */j(SeeWhereItStands,{onPress:()=>t(e.requestId)}):null]},e.key))})}function HubAddRecords({words:e,sources:t,canRequest:r,onRequest:n,onUpload:i,note:l,inFlight:o=[],onOpenRequest:a,uploadHint:s}){let{look:d}=my(),c=sy.add,u=useEverfurTheme().motion.reducedMotion;/* @__PURE__ */
|
|
862
863
|
return j(HubReveal,{index:4,reduced:u,children:/* @__PURE__ */j(HubCard,{testID:"everfur-records-hub-add-records",children:/* @__PURE__ */A(m,{style:{gap:eo(".efh-add","gap")},children:[
|
|
863
864
|
/* @__PURE__ */A(m,{style:{flexDirection:"row",alignItems:"center",gap:c.headGap},children:[
|
|
864
865
|
/* @__PURE__ */j(HubIcon,{name:"clip",size:c.icon,color:d.alert}),
|
|
865
|
-
/* @__PURE__ */j(HubText,{variant:"cardTitle",accessibilityRole:"header",style:{flex:1},children:
|
|
866
|
-
/* @__PURE__ */j(HubText,{variant:"bodySm",style:{lineHeight:eo(".efh-add > p","lineHeight")},children:
|
|
867
|
-
/* @__PURE__ */j(HubInFlight,{lines:o,onOpenRequest:a}),t.length>0?/* @__PURE__ */j(m,{style:{gap:c.sourcesGap,marginTop:c.sourcesTop},accessibilityLabel:
|
|
866
|
+
/* @__PURE__ */j(HubText,{variant:"cardTitle",accessibilityRole:"header",style:{flex:1},children:Zb.addRecords(e.name)})]}),
|
|
867
|
+
/* @__PURE__ */j(HubText,{variant:"bodySm",style:{lineHeight:eo(".efh-add > p","lineHeight")},children:Zb.moreThanOneClinic}),
|
|
868
|
+
/* @__PURE__ */j(HubInFlight,{lines:o,onOpenRequest:a}),t.length>0?/* @__PURE__ */j(m,{style:{gap:c.sourcesGap,marginTop:c.sourcesTop},accessibilityLabel:Zb.onFileNow,testID:"everfur-records-sheet-sources",children:t.map(e=>/* @__PURE__ */A(m,{style:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between",columnGap:c.sourceColumnGap,paddingVertical:c.sourcePadY,paddingHorizontal:c.sourcePadX,borderRadius:c.sourceRadius,backgroundColor:d.mist},children:[
|
|
868
869
|
/* @__PURE__ */j(HubText,{variant:"bodySm",style:{flexShrink:1,lineHeight:eo(".efh-add > p","fontSize")*1.4},children:e.name}),e.meta!==null?/* @__PURE__ */j(HubText,{variant:"fine",children:e.meta}):null]},e.key))}):null,
|
|
869
|
-
/* @__PURE__ */A(m,{style:{gap:c.actsGap,paddingTop:c.actsTop},children:[r?/* @__PURE__ */j(HubButton,{label:
|
|
870
|
-
/* @__PURE__ */j(HubButton,{label:
|
|
870
|
+
/* @__PURE__ */A(m,{style:{gap:c.actsGap,paddingTop:c.actsTop},children:[r?/* @__PURE__ */j(HubButton,{label:Zb.requestFromClinic,icon:"download",size:"lg",block:true,onPress:n,testID:"everfur-records-sheet-request"}):null,r?l:null,
|
|
871
|
+
/* @__PURE__ */j(HubButton,{label:Zb.uploadDocument,icon:"upload",size:"lg",variant:"secondary",bold:true,block:true,onPress:i,...s!==void 0?{accessibilityHint:s}:{},style:{backgroundColor:d.white,borderRadius:999},testID:"everfur-records-sheet-upload"})]})]})})})}function Step({state:e,title:t,when:r,last:n=false,testID:i}){let{look:l}=my(),o=sy.onTheWay.dot;/* @__PURE__ */
|
|
871
872
|
return A(m,{style:{flexDirection:"row",gap:16,paddingBottom:n?0:20},accessible:true,accessibilityLabel:r!==null?`${t}. ${r}`:t,testID:`${i}-${e}`,children:[n?null:/* @__PURE__ */j(m,{style:{position:"absolute",left:o/2-1,top:o+2,bottom:2,width:2,borderRadius:1,backgroundColor:e==="done"?l.ink:l.line}}),
|
|
872
873
|
/* @__PURE__ */A(m,{style:{width:o,height:o,borderRadius:o/2,borderWidth:2,borderColor:e!=="next"?l.ink:l.line,backgroundColor:e==="done"?l.fill:l.white,alignItems:"center",justifyContent:"center"},children:[e==="done"?/* @__PURE__ */j(CheckGlyph,{size:16,color:l.onFill}):null,e==="now"?/* @__PURE__ */j(m,{style:{width:10,height:10,borderRadius:5,backgroundColor:l.go}}):null]}),
|
|
873
874
|
/* @__PURE__ */A(m,{style:{flex:1,minWidth:0,paddingTop:3,gap:2},children:[
|
|
874
|
-
/* @__PURE__ */j(HubText,{variant:"bodySmBold",color:e==="next"?l.muted:void 0,style:{fontSize:17,lineHeight:22},children:t}),r!==null?/* @__PURE__ */j(HubText,{variant:"fine",children:r}):null]})]})}function Way({ink:e,icon:t,title:r,text:n,onPress:i,testID:l}){let{look:o}=
|
|
875
|
+
/* @__PURE__ */j(HubText,{variant:"bodySmBold",color:e==="next"?l.muted:void 0,style:{fontSize:17,lineHeight:22},children:t}),r!==null?/* @__PURE__ */j(HubText,{variant:"fine",children:r}):null]})]})}function Way({ink:e,icon:t,title:r,text:n,onPress:i,testID:l}){let{look:o}=my(),a=e?o.onFill:o.ink,s=sy.onTheWay;/* @__PURE__ */
|
|
875
876
|
return A(b,{onPress:i,accessibilityRole:"button",accessibilityLabel:`${r}. ${n}`,style:[{flexDirection:"row",alignItems:"center",gap:12,padding:s.wayPad,borderRadius:s.wayRadius},e?{backgroundColor:o.fill}:{borderWidth:1.5,borderStyle:"dashed",borderColor:o.ink,backgroundColor:o.white}],testID:l,children:[
|
|
876
877
|
/* @__PURE__ */j(HubIcon,{name:t,size:s.wayIcon,color:a}),
|
|
877
878
|
/* @__PURE__ */A(m,{style:{flex:1,minWidth:0,gap:2},children:[
|
|
878
879
|
/* @__PURE__ */j(HubText,{variant:"bodySmBold",color:a,style:{fontSize:17,lineHeight:22},children:r}),
|
|
879
880
|
/* @__PURE__ */j(HubText,{variant:"bodySm",color:a,children:n})]}),
|
|
880
|
-
/* @__PURE__ */j(HubIcon,{name:"chevron",size:20,color:e?o.accentOnFill:o.ink})]})}function HubOnTheWay({words:e,request:t,steps:r,sentWhen:n,canAct:i,canRequest:l,onAnotherClinic:o,onUpload:a,onOpenRequest:s}){let d=e.poss==="her"||e.poss==="his"?e.poss:`${e.name}’s`,c=
|
|
881
|
+
/* @__PURE__ */j(HubIcon,{name:"chevron",size:20,color:e?o.accentOnFill:o.ink})]})}function HubOnTheWay({words:e,request:t,steps:r,sentWhen:n,canAct:i,canRequest:l,onAnotherClinic:o,onUpload:a,onOpenRequest:s}){let d=e.poss==="her"||e.poss==="his"?e.poss:`${e.name}’s`,c=sy.onTheWay,[u,h,p]=r,g=t.clinicName?.trim()||null,f=t.statusLabel.trim()||null,b=t.waitingExpectation?.trim()||(h==="now"?f:null),y=useEverfurTheme().motion.reducedMotion;/* @__PURE__ */
|
|
881
882
|
return j(HubReveal,{index:1,reduced:y,children:/* @__PURE__ */A(HubCard,{testID:"everfur-records-hub-on-the-way",children:[
|
|
882
|
-
/* @__PURE__ */j(HubText,{variant:"screenTitle",accessibilityRole:"header",style:{fontSize:c.titleSize,lineHeight:c.titleLineHeight,letterSpacing:c.titleTracking},children:
|
|
883
|
-
/* @__PURE__ */j(HubText,{variant:"body",style:{marginTop:8},children:
|
|
883
|
+
/* @__PURE__ */j(HubText,{variant:"screenTitle",accessibilityRole:"header",style:{fontSize:c.titleSize,lineHeight:c.titleLineHeight,letterSpacing:c.titleTracking},children:Zb.onTheWay(e.Name)}),
|
|
884
|
+
/* @__PURE__ */j(HubText,{variant:"body",style:{marginTop:8},children:Zb.clinicsTake}),
|
|
884
885
|
/* @__PURE__ */A(m,{style:{marginTop:16},accessibilityRole:"list",testID:"everfur-records-sheet-tracker",children:[
|
|
885
|
-
/* @__PURE__ */j(Step,{state:u,title:
|
|
886
|
-
/* @__PURE__ */j(Step,{state:h,title:
|
|
887
|
-
/* @__PURE__ */j(Step,{state:p,last:true,title:
|
|
888
|
-
/* @__PURE__ */j(Way,{ink:false,icon:"upload",title:
|
|
886
|
+
/* @__PURE__ */j(Step,{state:u,title:Zb.requestSentTo(g),when:n!==null?Zb.signedRelease(n):null,testID:"everfur-records-sheet-step-sent"}),
|
|
887
|
+
/* @__PURE__ */j(Step,{state:h,title:Zb.waitingFor(d),when:b,testID:"everfur-records-sheet-step-waiting"}),
|
|
888
|
+
/* @__PURE__ */j(Step,{state:p,last:true,title:Zb.inHealthTab(d),when:p==="now"?f:Zb.everyPageRead,testID:"everfur-records-sheet-step-ready"})]}),s!==void 0?/* @__PURE__ */j(m,{style:{marginTop:16},children:/* @__PURE__ */j(SeeWhereItStands,{onPress:s})}):null,i?/* @__PURE__ */A(m,{style:{gap:12,marginTop:16},testID:"everfur-records-sheet-none-ways",children:[l?/* @__PURE__ */j(Way,{ink:true,icon:"download",title:Zb.anotherClinic,text:Zb.anotherClinicText,onPress:o,testID:"everfur-records-sheet-another-clinic"}):null,
|
|
889
|
+
/* @__PURE__ */j(Way,{ink:false,icon:"upload",title:Zb.uploadDocument,text:Zb.uploadText,onPress:a,testID:"everfur-records-sheet-none-upload"})]}):null]})})}function RailDot({state:e}){let{look:t}=my(),r={width:ay.dot,height:ay.dot,borderRadius:ay.dot/2,alignItems:"center",justifyContent:"center"};return e==="done"?/* @__PURE__ */j(m,{style:[r,{backgroundColor:t.brand}],...Lv,children:/* @__PURE__ */j(CheckGlyph,{size:ay.check,color:t.white})}):e==="failed"?/* @__PURE__ */A(m,{style:[r,{backgroundColor:t.alert}],...Lv,children:[
|
|
889
890
|
/* @__PURE__ */j(m,{style:{width:2,height:6,borderRadius:1,backgroundColor:t.white}}),
|
|
890
|
-
/* @__PURE__ */j(m,{style:{width:2,height:2,borderRadius:1,marginTop:1.5,backgroundColor:t.white}})]}):e==="current"?/* @__PURE__ */j(m,{style:[r,{borderWidth:
|
|
891
|
-
return j(HubReveal,{index:1,reduced:d,children:/* @__PURE__ */A(m,{style:{borderRadius:l.radius,backgroundColor:n.white,padding:l.pad,gap:l.gap},accessibilityRole:"summary",accessibilityLabel:
|
|
891
|
+
/* @__PURE__ */j(m,{style:{width:2,height:2,borderRadius:1,marginTop:1.5,backgroundColor:t.white}})]}):e==="current"?/* @__PURE__ */j(m,{style:[r,{borderWidth:ay.ring,borderColor:t.brand,backgroundColor:t.white}],...Lv,children:/* @__PURE__ */j(m,{style:{width:ay.core,height:ay.core,borderRadius:ay.core/2,backgroundColor:t.brand}})}):/* @__PURE__ */j(m,{style:[r,{borderWidth:ay.ring,borderColor:t.legacyBorder,backgroundColor:t.white}],...Lv})}function HubInProgress({words:e,request:t,onOpenRequest:r}){let{look:n,face:i}=my(),l=sy.inProgress,o=tp(t),a=t.clinicName?.trim()||Zb.requestTitle(e.Name),s=t.statusLabel.trim(),d=useEverfurTheme().motion.reducedMotion;/* @__PURE__ */
|
|
892
|
+
return j(HubReveal,{index:1,reduced:d,children:/* @__PURE__ */A(m,{style:{borderRadius:l.radius,backgroundColor:n.white,padding:l.pad,gap:l.gap},accessibilityRole:"summary",accessibilityLabel:Zb.requestA11y(e.name,s),testID:"everfur-records-records-in-progress",children:[
|
|
892
893
|
/* @__PURE__ */j(m,{style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8},children:/* @__PURE__ */j(Text,{style:[i("bold"),{flex:1,fontSize:l.titleSize,lineHeight:l.titleLineHeight,color:n.legacyText}],children:a})}),
|
|
893
|
-
/* @__PURE__ */j(m,{accessibilityRole:"summary",testID:"everfur-records-sheet-rail",children:o.map((e,t)=>{let r=e.at!==null?
|
|
894
|
-
return A(m,{style:{flexDirection:"row",alignItems:"flex-start",gap:
|
|
895
|
-
/* @__PURE__ */A(m,{style:{alignItems:"center",width:
|
|
896
|
-
/* @__PURE__ */j(RailDot,{state:e.state}),t<o.length-1?/* @__PURE__ */j(m,{style:{width:
|
|
897
|
-
/* @__PURE__ */A(m,{style:{flex:1,paddingBottom:
|
|
898
|
-
/* @__PURE__ */A(m,{style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:
|
|
899
|
-
/* @__PURE__ */j(Text,{style:[i(a?"regular":"bold"),{flex:1,fontSize:
|
|
900
|
-
/* @__PURE__ */j(HubText,{variant:"bodySmBold",style:{fontSize:17,lineHeight:22},children:e.name}),e.detail!==null?/* @__PURE__ */j(HubText,{variant:"fine",children:e.detail}):null]},e.key))})})})}function
|
|
901
|
-
return j(HubReveal,{index:6,reduced:a,children:/* @__PURE__ */A(HubCard,{title:
|
|
894
|
+
/* @__PURE__ */j(m,{accessibilityRole:"summary",testID:"everfur-records-sheet-rail",children:o.map((e,t)=>{let r=e.at!==null?Qy(e.at):null,l=e.state==="done"?"completed":e.state==="current"?"in progress":e.state==="failed"?"needs attention":"not started",a=e.state==="upcoming";/* @__PURE__ */
|
|
895
|
+
return A(m,{style:{flexDirection:"row",alignItems:"flex-start",gap:ay.rowGap},accessibilityRole:"text",accessibilityLabel:[e.title,e.detail,r,l].filter(Boolean).join(", "),testID:`everfur-records-sheet-rail-${e.key}`,children:[
|
|
896
|
+
/* @__PURE__ */A(m,{style:{alignItems:"center",width:ay.dot,alignSelf:"stretch"},children:[
|
|
897
|
+
/* @__PURE__ */j(RailDot,{state:e.state}),t<o.length-1?/* @__PURE__ */j(m,{style:{width:ay.rail,flex:1,minHeight:ay.railMin,marginVertical:ay.railGap,backgroundColor:e.state==="done"?n.brand:n.legacyBorder},...Lv}):null]}),
|
|
898
|
+
/* @__PURE__ */A(m,{style:{flex:1,paddingBottom:ay.bodyBottom,gap:ay.bodyGap},children:[
|
|
899
|
+
/* @__PURE__ */A(m,{style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:ay.titleGap},children:[
|
|
900
|
+
/* @__PURE__ */j(Text,{style:[i(a?"regular":"bold"),{flex:1,fontSize:ay.titleSize,lineHeight:ay.titleLineHeight,color:e.state==="current"?n.brand:e.state==="failed"?n.alert:a?n.legacyMuted:n.legacyText}],children:e.title}),r!==null?/* @__PURE__ */j(Text,{style:[i("regular"),{fontSize:ay.dateSize,lineHeight:ay.dateLineHeight,color:n.legacyMuted}],children:r}):null]}),e.detail!==null?/* @__PURE__ */j(Text,{style:[i("regular"),{fontSize:ay.detailSize,lineHeight:ay.detailLineHeight,color:n.legacyMuted},a?{opacity:ay.upcomingOpacity}:null],children:e.detail}):null]})]},e.key)})}),s.length>0?/* @__PURE__ */j(m,{style:{borderRadius:l.statusRadius,backgroundColor:n.brandSoft,padding:l.statusPad},children:/* @__PURE__ */j(Text,{style:[i("regular"),{fontSize:l.statusSize,lineHeight:l.statusLineHeight,color:n.legacyText}],children:s})}):null,r!==void 0?/* @__PURE__ */j(SeeWhereItStands,{onPress:r}):null]})})}function HubMedications({medications:e}){let{look:t}=my(),r=useEverfurTheme().motion.reducedMotion;return e===null?null:/* @__PURE__ */j(HubReveal,{index:5,reduced:r,children:/* @__PURE__ */j(HubCard,{title:Em.takingNow,testID:"everfur-records-sheet-meds",children:e.current.length===0?/* @__PURE__ */j(HubText,{variant:"bodySm",children:Em.noCurrentMeds}):/* @__PURE__ */j(m,{accessibilityRole:"list",style:{gap:sy.upcoming.listGap},children:e.current.map((e,r)=>/* @__PURE__ */A(m,{style:[{paddingVertical:sy.upcoming.rowPadY},r===0?null:{borderTopWidth:1,borderTopColor:t.line}],testID:`everfur-records-sheet-med-${e.key}`,children:[
|
|
901
|
+
/* @__PURE__ */j(HubText,{variant:"bodySmBold",style:{fontSize:17,lineHeight:22},children:e.name}),e.detail!==null?/* @__PURE__ */j(HubText,{variant:"fine",children:e.detail}):null]},e.key))})})})}function Wv(e,t){let r=[...e.flatMap(e=>e.items.map(e=>({...e,source:"clinic"}))),...t.map(e=>({key:`host-${e.key}`,ms:e.ms,date:e.date,title:e.title,text:e.text??null,alert:false,markerId:null,source:e.source,...e.onPress!==void 0?{onPress:e.onPress}:{}}))].sort((e,t)=>t.ms-e.ms),n=[];for(let e of r){let t=String(new Date(e.ms).getUTCFullYear()),r=n[n.length-1];r!==void 0&&r.year===t?r.items.push(e):n.push({year:t,items:[e]})}return n}function HubHistory({words:e,history:t,onOpenMarker:r,sourceKey:n,extra:i=[]}){let{look:l,face:o}=my(),a=useEverfurTheme().motion.reducedMotion,s=Wv(t,i);if(s.length===0)return null;let d=e=>e==="everfur"?l.go:e==="partner"?Yl.embTealInk:l.ink,c=[["clinic",n?.clinic??Em.theirClinic(e)],...["everfur","partner"].flatMap(e=>n?.[e]!==void 0?[[e,n[e]]]:[])],u={...o("mono"),fontSize:eo(".efh-tl__date","fontSize"),lineHeight:eo(".efh-tl__date","lineHeight"),letterSpacing:eo(".efh-tl__date","letterSpacing"),textTransform:"uppercase",color:l.muted};/* @__PURE__ */
|
|
902
|
+
return j(HubReveal,{index:6,reduced:a,children:/* @__PURE__ */A(HubCard,{title:Em.history,testID:"everfur-records-sheet-history",children:[
|
|
902
903
|
/* @__PURE__ */j(m,{style:{flexDirection:"row",flexWrap:"wrap",rowGap:eo(".efh-key","rowGap"),columnGap:eo(".efh-key","columnGap"),marginBottom:16},testID:"everfur-records-sheet-history-key",children:c.map(([e,t])=>/* @__PURE__ */A(m,{style:{flexDirection:"row",alignItems:"center",gap:eo(".efh-key span","gap")},children:[
|
|
903
904
|
/* @__PURE__ */j(m,{style:{width:eo(".efh-key span::before","width"),height:eo(".efh-key span::before","width"),borderRadius:999,borderWidth:2.5,borderColor:d(e),backgroundColor:l.white}}),
|
|
904
905
|
/* @__PURE__ */j(HubText,{variant:"fine",style:{fontSize:eo(".efh-key","fontSize"),lineHeight:eo(".efh-key","lineHeight")},children:t})]},e))}),s.map((e,t)=>/* @__PURE__ */A(m,{children:[
|
|
@@ -906,24 +907,24 @@ return j(HubReveal,{index:6,reduced:a,children:/* @__PURE__ */A(HubCard,{title:j
|
|
|
906
907
|
/* @__PURE__ */j(HubText,{variant:"fine",style:u,children:t.date}),
|
|
907
908
|
/* @__PURE__ */j(HubText,{variant:"bodySmBold",color:s?l.alertDeep:void 0,style:{marginTop:eo(".efh-tl__title","marginTop"),fontSize:eo(".efh-tl__title","fontSize"),lineHeight:eo(".efh-tl__title","lineHeight")},children:t.title}),t.text!==null?/* @__PURE__ */j(HubText,{variant:"bodySm",style:{marginTop:eo(".efh-tl__text","marginTop"),lineHeight:eo(".efh-tl__text","lineHeight")},children:t.text}):null]}),p=o!==null?`everfur-records-sheet-history-marker-${o}`:`everfur-records-sheet-history-${t.key}`;/* @__PURE__ */
|
|
908
909
|
return A(m,{style:{flexDirection:"row",gap:eo(".efh-tl__item","gap"),paddingBottom:i?0:eo(".efh-tl__item","paddingBottom")},children:[
|
|
909
|
-
/* @__PURE__ */j(m,{style:{position:"absolute",left:eo(".efh-tl__item::before","left"),top:eo(".efh-tl__item::before","top"),bottom:i?12:eo(".efh-tl__item::before","bottom"),width:2,borderRadius:1,backgroundColor:l.line},...
|
|
910
|
-
/* @__PURE__ */j(m,{style:{width:24,alignItems:"center"},...
|
|
911
|
-
/* @__PURE__ */j(m,{style:{position:"absolute",right:0,top:"50%",marginTop:-10},...
|
|
910
|
+
/* @__PURE__ */j(m,{style:{position:"absolute",left:eo(".efh-tl__item::before","left"),top:eo(".efh-tl__item::before","top"),bottom:i?12:eo(".efh-tl__item::before","bottom"),width:2,borderRadius:1,backgroundColor:l.line},...Lv}),
|
|
911
|
+
/* @__PURE__ */j(m,{style:{width:24,alignItems:"center"},...Lv,children:/* @__PURE__ */j(m,{style:{width:eo(".efh-tl__dot","width"),height:eo(".efh-tl__dot","width"),marginTop:eo(".efh-tl__dot","marginTop"),borderRadius:999,borderWidth:3,borderColor:t.alert?l.alert:d(t.source),backgroundColor:l.white},testID:`everfur-records-sheet-history-dot-${t.key}`})}),a!==void 0?/* @__PURE__ */A(b,{onPress:a,accessibilityRole:"button",accessibilityLabel:c,testID:p,style:({pressed:e})=>[{flex:1,minWidth:0},s?{marginTop:-8,paddingVertical:8,paddingRight:28}:null,e?{transform:[{scale:.98}]}:null],children:[s?/* @__PURE__ */j(m,{style:{position:"absolute",top:0,bottom:0,left:-8,right:-8,borderRadius:10,backgroundColor:l.tintRed},...Lv}):null,h,
|
|
912
|
+
/* @__PURE__ */j(m,{style:{position:"absolute",right:0,top:"50%",marginTop:-10},...Lv,children:/* @__PURE__ */j(HubIcon,{name:"chevron",size:20,color:s?l.alert:l.icoSage})})]}):/* @__PURE__ */j(m,{style:{flex:1,minWidth:0},accessible:true,accessibilityLabel:c,testID:p,children:h})]},t.key)})]},e.year))]})})}function MarkerLine({marker:e}){let{look:t}=my(),r=sy.peek,n=e.flag!==void 0;/* @__PURE__ */
|
|
912
913
|
return A(E,{children:[
|
|
913
914
|
/* @__PURE__ */A(m,{style:{flexDirection:"row",alignItems:"center",gap:r.markerTopGap},children:[
|
|
914
915
|
/* @__PURE__ */A(m,{style:{flex:1,minWidth:0},children:[
|
|
915
916
|
/* @__PURE__ */A(m,{style:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:8},children:[
|
|
916
|
-
/* @__PURE__ */j(HubText,{variant:"bodySmBold",style:{fontSize:17,lineHeight:22},children:e.name}),n?/* @__PURE__ */j(HubPill,{label:
|
|
917
|
+
/* @__PURE__ */j(HubText,{variant:"bodySmBold",style:{fontSize:17,lineHeight:22},children:e.name}),n?/* @__PURE__ */j(HubPill,{label:Zb.high,tone:"high"}):null]}),
|
|
917
918
|
/* @__PURE__ */j(HubText,{variant:"bodySm",color:t.muted,children:e.what})]}),
|
|
918
919
|
/* @__PURE__ */A(m,{style:{flexDirection:"row",alignItems:"baseline",gap:r.valueGap},children:[
|
|
919
920
|
/* @__PURE__ */j(HubText,{variant:"bodySmBold",color:n?t.alert:void 0,style:{fontSize:17,lineHeight:22},children:e.value}),
|
|
920
921
|
/* @__PURE__ */j(HubText,{variant:"fine",color:t.muted,children:e.unit})]})]}),
|
|
921
|
-
/* @__PURE__ */A(m,{style:{height:r.barHeight,borderRadius:999,backgroundColor:t.barTrack},...
|
|
922
|
+
/* @__PURE__ */A(m,{style:{height:r.barHeight,borderRadius:999,backgroundColor:t.barTrack},...Lv,children:[
|
|
922
923
|
/* @__PURE__ */j(m,{style:{position:"absolute",top:0,bottom:0,left:"20%",right:"20%",borderRadius:999,backgroundColor:t.go}}),
|
|
923
|
-
/* @__PURE__ */j(m,{style:{position:"absolute",top:-(r.barDot-r.barHeight)/2,left:`${e.at}%`,width:r.barDot,height:r.barDot,marginLeft:-r.barDot/2,borderRadius:r.barDot/2,borderWidth:r.barDotRing,borderColor:t.white,backgroundColor:n?t.alert:t.ink}})]})]})}function FlaggedMarker({marker:e,name:t,poss:r}){let{look:n}=
|
|
924
|
+
/* @__PURE__ */j(m,{style:{position:"absolute",top:-(r.barDot-r.barHeight)/2,left:`${e.at}%`,width:r.barDot,height:r.barDot,marginLeft:-r.barDot/2,borderRadius:r.barDot/2,borderWidth:r.barDotRing,borderColor:t.white,backgroundColor:n?t.alert:t.ink}})]})]})}function FlaggedMarker({marker:e,name:t,poss:r}){let{look:n}=my(),l=sy.peek,[o,a]=i(false);/* @__PURE__ */
|
|
924
925
|
return A(m,{style:[{borderRadius:l.markerRadius},o?{backgroundColor:n.tintRed}:null],children:[
|
|
925
926
|
/* @__PURE__ */j(b,{onPress:()=>a(e=>!e),accessibilityRole:"button",accessibilityState:{expanded:o},style:{gap:l.markerGap,padding:l.markerPad,borderRadius:l.markerRadius,backgroundColor:n.tintRed},testID:`everfur-records-sheet-sample-flag-${e.name}`,children:/* @__PURE__ */j(MarkerLine,{marker:e})}),o?/* @__PURE__ */j(m,{style:{gap:8,paddingHorizontal:l.markerPad,paddingBottom:l.markerPad,alignItems:"flex-start"},testID:"everfur-records-sheet-sample-flag-note",children:/* @__PURE__ */A(HubText,{variant:"bodySm",children:[
|
|
926
|
-
/* @__PURE__ */j(HubText,{variant:"bodySmBold",color:n.alertDeep,children:
|
|
927
|
+
/* @__PURE__ */j(HubText,{variant:"bodySmBold",color:n.alertDeep,children:Zb.sampleNotTheirs(t)}),Zb.sampleNote(r)]})}):null]})}function FromPage({from:e}){let{look:t,face:r}=my(),n=sy.peek,[l,o]=i(false),a=[r("mono"),{color:t.muted}];/* @__PURE__ */
|
|
927
928
|
return A(m,{style:{marginTop:8},testID:"everfur-records-sheet-sample-from",children:[
|
|
928
929
|
/* @__PURE__ */A(b,{onPress:()=>o(e=>!e),accessibilityRole:"button",accessibilityLabel:e.cap,accessibilityState:{expanded:l},style:[{flexDirection:"row",alignItems:"center",gap:n.fromGap,minHeight:n.fromMinHeight,alignSelf:"flex-start"},l?{marginBottom:8}:null],testID:"everfur-records-sheet-sample-from-cap",children:[
|
|
929
930
|
/* @__PURE__ */j(HubIcon,{name:"file",size:n.fromIcon,color:t.icoSage}),
|
|
@@ -932,30 +933,30 @@ return A(m,{style:{marginTop:8},testID:"everfur-records-sheet-sample-from",child
|
|
|
932
933
|
/* @__PURE__ */A(m,{style:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between",gap:8},children:[
|
|
933
934
|
/* @__PURE__ */j(HubText,{variant:"bodySmBold",children:e.who}),
|
|
934
935
|
/* @__PURE__ */j(Text,{style:[a,{fontSize:12,lineHeight:18}],children:e.page})]}),
|
|
935
|
-
/* @__PURE__ */j(m,{style:{flexDirection:"row"},children:
|
|
936
|
+
/* @__PURE__ */j(m,{style:{flexDirection:"row"},children:Zb.columns.map((e,t)=>/* @__PURE__ */j(Text,{style:[a,{flex:t===0?1.1:1,paddingHorizontal:8,paddingBottom:2,fontSize:12,lineHeight:16,letterSpacing:.48,textTransform:"uppercase"}],children:e},e))}),e.rows.map(e=>/* @__PURE__ */j(m,{style:[{flexDirection:"row",marginTop:3,borderRadius:6},e.lit===true?{backgroundColor:t.tintYellow}:null],children:[e.test,e.result,e.unit,e.range].map((e,n)=>/* @__PURE__ */j(Text,{numberOfLines:1,style:[r("mono"),{flex:n===0?1.1:1,paddingHorizontal:8,paddingVertical:5,fontSize:13,lineHeight:18,color:t.text,fontVariant:["tabular-nums"]}],children:e},n))},e.test))]}):null]})}var Uv=/heartworm|4dx/i;function HubSamplePeek({name:e,poss:t="her",species:r}){let{look:n}=my(),l=sy.peek,[o,a]=i(0),s=ry.length-1,d=ry[o],c=r!==null&&/^(dog|canine)$/i.test(r.trim()),u={pink:n.tintPink,blue:n.tintBlue,yellow:n.tintYellow},h={screenings:"shield",visits:"folder",timeline:"clock"},p=useEverfurTheme().motion.reducedMotion,g=hv(o,p);/* @__PURE__ */
|
|
936
937
|
return A(m,{style:{marginTop:l.top},testID:"everfur-records-sample-peek",children:[
|
|
937
938
|
/* @__PURE__ */A(m,{style:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:l.headGap},children:[
|
|
938
|
-
/* @__PURE__ */j(HubText,{variant:"cardTitle",accessibilityRole:"header",children:
|
|
939
|
-
/* @__PURE__ */j(HubPill,{label:
|
|
940
|
-
/* @__PURE__ */j(HubText,{variant:"bodySm",style:{marginTop:l.leadTop},children:
|
|
939
|
+
/* @__PURE__ */j(HubText,{variant:"cardTitle",accessibilityRole:"header",children:Zb.recordsHistory}),
|
|
940
|
+
/* @__PURE__ */j(HubPill,{label:Zb.sample,tone:"plain"})]}),
|
|
941
|
+
/* @__PURE__ */j(HubText,{variant:"bodySm",style:{marginTop:l.leadTop},children:Zb.peekLead(e)}),
|
|
941
942
|
/* @__PURE__ */j(HubReveal,{index:0,reduced:p,style:{marginTop:l.labsTop},children:/* @__PURE__ */A(HubCard,{testID:"everfur-records-sheet-sample-labs",children:[
|
|
942
943
|
/* @__PURE__ */A(m,{style:{flexDirection:"row",alignItems:"center",gap:6},children:[
|
|
943
|
-
/* @__PURE__ */j(HubText,{variant:"cardTitle",accessibilityRole:"header",style:{flex:1},children:
|
|
944
|
-
/* @__PURE__ */j(m,{style:o===0?{opacity:.35}:null,children:/* @__PURE__ */j(HubRound,{icon:"chevron",rotate:180,label:
|
|
945
|
-
/* @__PURE__ */j(m,{style:o===s?{opacity:.35}:null,children:/* @__PURE__ */j(HubRound,{icon:"chevron",label:
|
|
946
|
-
/* @__PURE__ */j(y,{horizontal:true,showsHorizontalScrollIndicator:false,style:{marginTop:l.chipsTop,flexGrow:0},contentContainerStyle:{flexDirection:"row",gap:l.chipsGap},accessibilityLabel:
|
|
947
|
-
/* @__PURE__ */A(L.View,{style:[{marginTop:l.slideTop,gap:l.slideGap},g],accessibilityLabel:
|
|
944
|
+
/* @__PURE__ */j(HubText,{variant:"cardTitle",accessibilityRole:"header",style:{flex:1},children:Zb.labs}),
|
|
945
|
+
/* @__PURE__ */j(m,{style:o===0?{opacity:.35}:null,children:/* @__PURE__ */j(HubRound,{icon:"chevron",rotate:180,label:Zb.previousGroup,disabled:o===0,onPress:()=>a(e=>Math.max(0,e-1)),testID:"everfur-records-sheet-sample-prev"})}),
|
|
946
|
+
/* @__PURE__ */j(m,{style:o===s?{opacity:.35}:null,children:/* @__PURE__ */j(HubRound,{icon:"chevron",label:Zb.nextGroup,disabled:o===s,onPress:()=>a(e=>Math.min(s,e+1)),testID:"everfur-records-sheet-sample-next"})})]}),
|
|
947
|
+
/* @__PURE__ */j(y,{horizontal:true,showsHorizontalScrollIndicator:false,style:{marginTop:l.chipsTop,flexGrow:0},contentContainerStyle:{flexDirection:"row",gap:l.chipsGap},accessibilityLabel:Zb.markerGroups,children:ry.map((e,t)=>/* @__PURE__ */j(HubChip,{label:e.chip,selected:t===o,onPress:()=>a(t),testID:`everfur-records-sheet-sample-group-${e.key}`},e.key))}),
|
|
948
|
+
/* @__PURE__ */A(L.View,{style:[{marginTop:l.slideTop,gap:l.slideGap},g],accessibilityLabel:Zb.slideOf(d.chip,o+1,ry.length),testID:"everfur-records-sheet-sample-slide",children:[
|
|
948
949
|
/* @__PURE__ */j(HubText,{variant:"bodySmBold",style:{fontSize:17,lineHeight:22},children:d.chip}),
|
|
949
950
|
/* @__PURE__ */j(HubText,{variant:"bodySm",style:{marginTop:l.slideLeadTop,marginBottom:l.slideLeadBottom},children:d.lead}),d.markers.map(r=>r.flag!==void 0?/* @__PURE__ */j(FlaggedMarker,{marker:r,name:e,poss:t},r.name):/* @__PURE__ */j(m,{style:{gap:l.markerGap,padding:l.markerPad,borderRadius:l.markerRadius},children:/* @__PURE__ */j(MarkerLine,{marker:r})},r.name)),
|
|
950
951
|
/* @__PURE__ */j(FromPage,{from:d.from},d.key)]})]})}),
|
|
951
|
-
/* @__PURE__ */j(m,{style:{gap:l.moreGap,marginTop:l.moreTop},testID:"everfur-records-sheet-sample-more",children:
|
|
952
|
+
/* @__PURE__ */j(m,{style:{gap:l.moreGap,marginTop:l.moreTop},testID:"everfur-records-sheet-sample-more",children:ny.map((e,t)=>{let r=c?e.rows:e.rows.filter(e=>!Uv.test(e.title));return r.length===0?null:/* @__PURE__ */j(HubReveal,{index:t+1,reduced:p,children:/* @__PURE__ */A(m,{style:{gap:l.moreInnerGap,padding:l.morePad,borderRadius:l.moreRadius,backgroundColor:u[e.tint]},testID:`everfur-records-sheet-sample-${e.key}`,children:[
|
|
952
953
|
/* @__PURE__ */A(m,{style:{flexDirection:"row",alignItems:"center",gap:l.moreHeadGap},children:[
|
|
953
954
|
/* @__PURE__ */j(HubIcon,{name:h[e.key],size:l.moreIcon}),
|
|
954
955
|
/* @__PURE__ */j(HubText,{variant:"bodySmBold",accessibilityRole:"header",style:{fontSize:17,lineHeight:22},children:e.title})]}),
|
|
955
956
|
/* @__PURE__ */j(HubText,{variant:"bodySm",children:e.lead}),
|
|
956
957
|
/* @__PURE__ */j(m,{style:{gap:l.rowsGap},children:r.map(e=>/* @__PURE__ */A(m,{style:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:l.rowMinHeight,paddingVertical:l.rowPadY,paddingHorizontal:l.rowPadX,borderRadius:l.rowRadius,backgroundColor:n.white},children:[
|
|
957
958
|
/* @__PURE__ */j(HubText,{variant:"bodySm",style:{flexShrink:1},children:e.title}),e.pill!==void 0?/* @__PURE__ */j(HubPill,{label:e.pill,tone:e.tone??"plain"}):/* @__PURE__ */j(HubText,{variant:"labelMono",color:n.muted,children:e.text??""})]},e.title))})]})},e.key)})})]})}function HubLegal(){let e=useEverfurTheme().motion.reducedMotion;/* @__PURE__ */
|
|
958
|
-
return j(HubReveal,{index:5,reduced:e,children:/* @__PURE__ */j(m,{style:{marginTop:
|
|
959
|
+
return j(HubReveal,{index:5,reduced:e,children:/* @__PURE__ */j(m,{style:{marginTop:sy.screen.legalTop},testID:"everfur-records-hub-legal",children:/* @__PURE__ */j(HubText,{variant:"fine",style:{textAlign:"center"},accessibilityRole:"text",testID:"records-footnote",children:Zb.legal})})})}function Gv(e){return e!==null&&typeof e=="object"&&typeof e.uri=="string"?e.uri:e}var Vv=3;function Kv(){let e=eo(".efh-tile__title","fontSize")*1.25*2;return eo(".efh-tile","paddingTop")*2+20+eo(".efh-tile","gap")*2+e+eo(".efh-tile__foot","minHeight")}function HubSkeleton({testID:e="everfur-records-sheet-loading"}){let t=eo(".efh-due li","paddingLeft"),r=Kv(),n=e=>/* @__PURE__ */A(m,{style:{flexDirection:"row",gap:eo(".efh-tiles","gap")},children:[
|
|
959
960
|
/* @__PURE__ */j(SkeletonBlock,{width:"48%",height:r,radius:eo(".efh-tile","borderRadius"),style:{flex:1}}),
|
|
960
961
|
/* @__PURE__ */j(SkeletonBlock,{width:"48%",height:r,radius:eo(".efh-tile","borderRadius"),style:{flex:1}})]},e);/* @__PURE__ */
|
|
961
962
|
return A(m,{accessible:true,accessibilityRole:"progressbar",accessibilityLabel:Zn.loading,testID:e,style:{paddingTop:20,gap:16},children:[
|
|
@@ -964,7 +965,7 @@ return A(m,{accessible:true,accessibilityRole:"progressbar",accessibilityLabel:Z
|
|
|
964
965
|
/* @__PURE__ */j(SkeletonBlock,{width:160,height:eo(".efh-meta","fontSize"),radius:6})]}),
|
|
965
966
|
/* @__PURE__ */j(SkeletonBlock,{width:"100%",height:eo(".efh-stage","height"),radius:0}),
|
|
966
967
|
/* @__PURE__ */A(m,{style:{marginHorizontal:16,gap:4},children:[
|
|
967
|
-
/* @__PURE__ */j(SkeletonBlock,{width:140,height:18,radius:6,style:{marginBottom:8}}),Array.from({length:
|
|
968
|
+
/* @__PURE__ */j(SkeletonBlock,{width:140,height:18,radius:6,style:{marginBottom:8}}),Array.from({length:Vv},(e,r)=>/* @__PURE__ */A(m,{style:{flexDirection:"row",alignItems:"center",gap:eo(".efh-due li","gap"),padding:t},children:[
|
|
968
969
|
/* @__PURE__ */j(SkeletonBlock,{width:20,height:20,radius:10}),
|
|
969
970
|
/* @__PURE__ */A(m,{style:{flex:1,gap:6},children:[
|
|
970
971
|
/* @__PURE__ */j(SkeletonBlock,{width:"60%",height:16,radius:6}),
|
|
@@ -975,26 +976,26 @@ return A(m,{accessible:true,accessibilityRole:"progressbar",accessibilityLabel:Z
|
|
|
975
976
|
/* @__PURE__ */j(SkeletonBlock,{width:90,height:eo(".efh-title","fontSize"),radius:6}),
|
|
976
977
|
/* @__PURE__ */j(SkeletonBlock,{width:"70%",height:eo(".efh-smeta","fontSize"),radius:6})]}),
|
|
977
978
|
/* @__PURE__ */j(SkeletonBlock,{width:"100%",height:260,radius:20}),
|
|
978
|
-
/* @__PURE__ */j(SkeletonBlock,{width:"100%",height:120,radius:20})]})}function EverfurRecordsLabDetail({palette:e,fonts:t,...r}){return e===void 0&&t===void 0?/* @__PURE__ */j(LabDetail,{...r}):/* @__PURE__ */j(LabKit,{palette:e,fonts:t,children:/* @__PURE__ */j(LabDetail,{...r})})}function LabKit({palette:e,fonts:t,children:r}){let n=
|
|
979
|
-
return j(
|
|
980
|
-
return j(LabBody,{model:c,renderExtra:r,renderVetNote:n,askIcon:i,ask:l!==void 0&&u!==null?()=>{let t=Tc(e,{canonicalName:u.name,markerId:u.markerId,latestValueText:c.latest,statusText:c.pill,trajectoryText:null,meaningText:u.meaning});l(t.prompt,t.entityRef)}:void 0,renderAskButton:o,style:a})}function LabBody({model:e,renderExtra:t,renderVetNote:r,askIcon:n,ask:i,renderAskButton:l,style:o}){let{s:a,look:s}=
|
|
979
|
+
/* @__PURE__ */j(SkeletonBlock,{width:"100%",height:120,radius:20})]})}function EverfurRecordsLabDetail({palette:e,fonts:t,...r}){return e===void 0&&t===void 0?/* @__PURE__ */j(LabDetail,{...r}):/* @__PURE__ */j(LabKit,{palette:e,fonts:t,children:/* @__PURE__ */j(LabDetail,{...r})})}function LabKit({palette:e,fonts:t,children:r}){let n=_v(e,t),i=Cv(n);/* @__PURE__ */
|
|
980
|
+
return j(Rv,{value:i,children:r})}function LabDetail({petRef:petRef,petName:e,markerId:t,renderExtra:r,renderVetNote:n,askIcon:i,onAsk:l,renderAskButton:o,style:a}){let s=useRecordsMarkers(petRef),d=s.markers,c=d===null||d.withheld?null:zb(d,t);if(c===null)return s.status==="loading"?/* @__PURE__ */j(LabSkeleton,{}):s.status==="error"?/* @__PURE__ */j(RecordsEmptyState,{variant:si(s.error),onAction:s.refresh,testID:"everfur-records-lab-error"}):/* @__PURE__ */j(RecordsEmptyState,{variant:"no_records",testID:"everfur-records-lab-empty"});let u=d?.markers.find(e=>e.markerId===t)??null;/* @__PURE__ */
|
|
981
|
+
return j(LabBody,{model:c,renderExtra:r,renderVetNote:n,askIcon:i,ask:l!==void 0&&u!==null?()=>{let t=Tc(e,{canonicalName:u.name,markerId:u.markerId,latestValueText:c.latest,statusText:c.pill,trajectoryText:null,meaningText:u.meaning});l(t.prompt,t.entityRef)}:void 0,renderAskButton:o,style:a})}function LabBody({model:e,renderExtra:t,renderVetNote:r,askIcon:n,ask:i,renderAskButton:l,style:o}){let{s:a,look:s}=Sv(),d=i!==void 0&&l===void 0;/* @__PURE__ */
|
|
981
982
|
return A(m,{style:{flex:1},children:[
|
|
982
983
|
/* @__PURE__ */A(y,{contentContainerStyle:[a.lab,d?{paddingBottom:eo(".efh-lab","paddingBottom")}:null,o],testID:`everfur-records-lab-${e.markerId}`,children:[
|
|
983
984
|
/* @__PURE__ */A(m,{children:[
|
|
984
985
|
/* @__PURE__ */j(Text,{style:a.labTitle,accessibilityRole:"header",children:e.name}),e.meta!==null?/* @__PURE__ */j(Text,{style:a.labMeta,children:e.meta}):null]}),
|
|
985
986
|
/* @__PURE__ */A(SheetCard,{children:[
|
|
986
987
|
/* @__PURE__ */A(m,{style:a.cardHead,children:[
|
|
987
|
-
/* @__PURE__ */j(Text,{style:a.cardTitle,accessibilityRole:"header",children:
|
|
988
|
+
/* @__PURE__ */j(Text,{style:a.cardTitle,accessibilityRole:"header",children:Em.latestReading}),e.pill!==null?/* @__PURE__ */j(SheetPill,{label:e.pill,tone:e.flagged?"high":"clear"}):null]}),
|
|
988
989
|
/* @__PURE__ */A(m,{style:a.latest,children:[
|
|
989
990
|
/* @__PURE__ */j(Text,{style:[a.wtValue,{color:e.flagged?s.alert:s.ink}],children:e.latest}),
|
|
990
991
|
/* @__PURE__ */j(Text,{style:a.latestSub,children:e.latestSub})]}),
|
|
991
992
|
/* @__PURE__ */j(LabChart,{model:e}),e.change!==null?/* @__PURE__ */A(Text,{style:a.change,children:[
|
|
992
993
|
/* @__PURE__ */j(Text,{style:a.changeLead,children:e.change.lead}),e.change.rest]}):null]}),t!==void 0?/* @__PURE__ */j(HostRender,{render:()=>t(e.markerId),fallback:null,resetKey:e.markerId}):null,r!==void 0?/* @__PURE__ */j(HostRender,{render:()=>r(e.markerId),fallback:null,resetKey:`${e.markerId}-note`}):null,e.meaning.length>0?/* @__PURE__ */A(SheetCard,{children:[
|
|
993
|
-
/* @__PURE__ */j(Text,{style:[a.cardTitle,a.cardTitleGap],accessibilityRole:"header",children:
|
|
994
|
+
/* @__PURE__ */j(Text,{style:[a.cardTitle,a.cardTitleGap],accessibilityRole:"header",children:Em.whatIs(e.name)}),
|
|
994
995
|
/* @__PURE__ */j(m,{style:a.ctx,children:e.meaning.map((e,t)=>/* @__PURE__ */j(Text,{style:a.ctxText,children:e},t))})]}):null,e.groups.map((e,t)=>/* @__PURE__ */A(SheetCard,{children:[
|
|
995
996
|
/* @__PURE__ */A(m,{style:a.cardHead,children:[
|
|
996
|
-
/* @__PURE__ */j(Text,{style:a.cardTitle,accessibilityRole:"header",children:e.title}),e.allInRange?/* @__PURE__ */j(SheetPill,{label:
|
|
997
|
-
/* @__PURE__ */j(m,{style:a.mks,children:e.rows.map(e=>/* @__PURE__ */j(SheetMarkerRow,{name:e.name,value:e.value,unit:e.unit,range:e.range,at:e.at,pill:e.flag==="above"?
|
|
997
|
+
/* @__PURE__ */j(Text,{style:a.cardTitle,accessibilityRole:"header",children:e.title}),e.allInRange?/* @__PURE__ */j(SheetPill,{label:Em.inRange,tone:"clear"}):null]}),
|
|
998
|
+
/* @__PURE__ */j(m,{style:a.mks,children:e.rows.map(e=>/* @__PURE__ */j(SheetMarkerRow,{name:e.name,value:e.value,unit:e.unit,range:e.range,at:e.at,pill:e.flag==="above"?Em.high:e.flag==="below"?Em.belowRangePill:null},e.markerId))})]},`${e.title}-${t}`)),i!==void 0&&l!==void 0?/* @__PURE__ */j(HostRender,{render:()=>l(i,Em.askAboutThis),fallback:null,resetKey:e.markerId}):null]}),d?/* @__PURE__ */j(RecordsAskPill,{label:Em.askAboutThis,onPress:i,...n!==void 0?{icon:n}:{},testID:"everfur-records-lab-ask"}):null]})}function LabChart({model:e}){let{s:t,look:r}=Sv();if(e.chart.length===0)return null;let n=e.hasRange;/* @__PURE__ */
|
|
998
999
|
return A(m,{style:t.chart,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:[
|
|
999
1000
|
/* @__PURE__ */A(m,{style:t.labBody,children:[n?/* @__PURE__ */A(E,{children:[
|
|
1000
1001
|
/* @__PURE__ */A(m,{style:t.rail,children:[
|
|
@@ -1002,42 +1003,50 @@ return A(m,{style:t.chart,accessibilityElementsHidden:true,importantForAccessibi
|
|
|
1002
1003
|
/* @__PURE__ */j(m,{style:{flex:2,backgroundColor:r.go}}),
|
|
1003
1004
|
/* @__PURE__ */j(m,{style:{flex:1,backgroundColor:r.line}})]}),
|
|
1004
1005
|
/* @__PURE__ */A(m,{style:t.legend,children:[
|
|
1005
|
-
/* @__PURE__ */j(Text,{style:[t.range,{top:"6%"}],children:
|
|
1006
|
-
/* @__PURE__ */j(Text,{style:[t.range,{top:"44%"}],children:
|
|
1007
|
-
/* @__PURE__ */j(Text,{style:[t.range,{top:"82%"}],children:
|
|
1006
|
+
/* @__PURE__ */j(Text,{style:[t.range,{top:"6%"}],children:Em.above}),
|
|
1007
|
+
/* @__PURE__ */j(Text,{style:[t.range,{top:"44%"}],children:Em.inRange}),
|
|
1008
|
+
/* @__PURE__ */j(Text,{style:[t.range,{top:"82%"}],children:Em.below})]})]}):null,
|
|
1008
1009
|
/* @__PURE__ */A(m,{style:[t.plot,{flex:1}],children:[n?/* @__PURE__ */j(m,{style:t.band}):null,e.chart.length>1?/* @__PURE__ */j(ChartLine,{points:e.chart,color:r.ink}):null,e.chart.map((e,i)=>/* @__PURE__ */j(m,{style:[t.point,{left:`${e.x}%`,top:`${e.y}%`,backgroundColor:e.out?r.alert:n?r.go:r.ink}]},i)),e.chart.map((e,n)=>/* @__PURE__ */j(Text,{style:[t.pointLabel,{left:`${e.x}%`,top:`${e.y}%`,marginTop:-(10+(t.pointLabel.lineHeight??14))},e.out?{color:r.alert}:null],children:e.label},`v${n}`))]})]}),
|
|
1009
1010
|
/* @__PURE__ */j(m,{style:[t.xAxis,n?{marginLeft:106}:null],children:e.chart.map((r,n)=>{let i=e.chart.length>1&&n===e.chart.length-1?"end":e.chart.length>1&&n===0?"start":null;/* @__PURE__ */
|
|
1010
|
-
return j(Text,{style:[t.xTick,i==="end"?{right:`${100-r.x}%`,marginLeft:0,marginRight:-4,textAlign:"right"}:i==="start"?{left:`${r.x}%`,marginLeft:-4,textAlign:"left"}:{left:`${r.x}%`}],children:r.tick},n)})})]})}function
|
|
1011
|
-
return Object.freeze({...i,Poss:
|
|
1012
|
-
return j(CapabilityGate,{capability:"records",style:t,...r?{renderPending:r}:{},...Uo(n.onBack,Ao),children:/* @__PURE__ */j(
|
|
1011
|
+
return j(Text,{style:[t.xTick,i==="end"?{right:`${100-r.x}%`,marginLeft:0,marginRight:-4,textAlign:"right"}:i==="start"?{left:`${r.x}%`,marginLeft:-4,textAlign:"left"}:{left:`${r.x}%`}],children:r.tick},n)})})]})}var Yv=/* @__PURE__ */Symbol.for("everfur.sdk.tabsBar.v1");function Xv(){return globalThis[Yv]??null}function Qv(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function Jv(e){return e==="female"?"her":e==="male"?"his":null}function Zv(e,t){let r=e?.trim()??"",n=r.length>0?r:Qn,i=Am(n,t);/* @__PURE__ */
|
|
1012
|
+
return Object.freeze({...i,Poss:Qv(i.Poss)})}function ew(e){let t="";return t.length>0?t:pa.document.namelessPet}var tw=/* @__PURE__ */Object.freeze({topRiskKicker:e=>`${e.Poss} top risk`,seePlan:e=>`See ${e.poss} Health Plan`,startPlan:e=>`Start ${e.poss} Health Plan`,labsTitle:e=>`${e.Poss} labs`,askRecords:e=>`Ask about ${e.name}'s records…`,askField:e=>`Ask about ${e.name}`,askAdd:"Add a photo or file",askSend:"Send",speakToVet:"Speak to vet",today:"Today"});function rw(e,petRef){return e.filter(e=>e.petRef===petRef&&!isTerminalStatus(e.status)).sort((e,t)=>(qm(t.updatedAt)??0)-(qm(e.updatedAt)??0))[0]??null}function nw(e,petRef){return rw(e.filter(e=>!iw(e)),petRef)}function iw(e){return e.source==="owner_provided"}function lw(e){switch(e){case"received":case"parsing":case"in_review":case"published":return["done","done","now"];case"awaiting_clinic":return["done","now","next"];default:return["now","next","next"]}}var ow=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function aw(e,t){let r=qm(e);if(r===null)return null;let n=new Date(r),i=new Date(t),l=n.getFullYear()===i.getFullYear()&&n.getMonth()===i.getMonth()&&n.getDate()===i.getDate(),o=n.getHours(),a=`${o%12===0?12:o%12}:${String(n.getMinutes()).padStart(2,"0")} ${o<12?"AM":"PM"}`;return`${l?tw.today:`${ow[n.getMonth()]??""} ${n.getDate()}`}, ${a}`}var sw=/* @__PURE__ */Object.freeze({undatedPill:""});function dw(e,petRef){let t=e.filter(e=>e.petRef===petRef);if(t.some(e=>!isTerminalStatus(e.status)))return null;let r=[...t].sort((e,t)=>(qm(t.updatedAt)??0)-(qm(e.updatedAt)??0))[0];if(r===void 0||r.status!=="failed"&&r.status!=="revoked")return null;let n=selectPrimaryLabel(r).trim();return n.length>0?{id:r.id,label:n}:null}function cw(e){if(e==null)return null;let t=[e.risk?.lead?.trim()??"",e.risk?.body?.trim()??""].filter(e=>e.length>0).join(" ");if(t.length>0)return t;let r=e.title.trim();return r.length>0?r:null}function uw(e){return e?.sex??null}function hw(e){if(e==null||e.withheld)return null;let t=e.identity.find(e=>e.label.trim().toLowerCase()==="sex")?.value.trim().toLowerCase()??"";return t.length===0?null:/\bfemale\b/.test(t)||/^(f|fs)$/.test(t)?"female":/\bmale\b/.test(t)||/^(m|mn)$/.test(t)?"male":null}var pw=e=>{let t=(e??[]).filter(e=>e.label.trim().length>0).map((e,t)=>({key:`host-${t}`,name:e.label.trim(),meta:e.detail?.trim()||null}));return t.length>0?t:null},gw=e=>e==null||e.label.trim().length===0?null:{label:e.label,tone:e.tone??"watch"},fw=(e,petRef)=>e.getRecordDepth(petRef),mw=e=>!e.available,bw=(e,petRef)=>e.getTimeline(petRef),yw=e=>e.isEmpty,vw=/* @__PURE__ */Object.freeze({});function ww(e){let t=ho(e?.fonts?.hand);return e?.stage!==void 0?e.stage.handFontFamily??t:e?.handFontFamily!==void 0?e.handFontFamily:t!==null?t:g.OS==="android"||g.OS==="web"?"cursive":null}function EverfurRecordsSheet(e){let{style:t,renderPending:r,...n}=en(e,["onNavigate","onBack","onAsk"]),i=_v(n.options?.palette,n.options?.fonts),l=Cv(i),{userRef:userRef}=Dr();/* @__PURE__ */
|
|
1013
|
+
return j(CapabilityGate,{capability:"records",style:t,...r?{renderPending:r}:{},...Uo(n.onBack,Ao),children:/* @__PURE__ */j(Rv,{value:l,children:/* @__PURE__ */j(HubKitProvider,{handFamily:ww(n.options),theme:i,children:userRef===null?
|
|
1013
1014
|
/* @__PURE__ */A(m,{style:[{flex:1},t],testID:"everfur-records-sheet-session-required",children:[
|
|
1014
1015
|
/* @__PURE__ */j(SessionRequiredState,{}),
|
|
1015
|
-
/* @__PURE__ */j(RecordsFootnote,{})]}):/* @__PURE__ */j(SheetScreen,{...n,style:t})})})})}function SheetScreen({petRef:petRef,petName:e,controller:t,consentVersion:l,consentScope:a,consentText:s,onNavigate:d,onBack:c,onAsk:u,options:
|
|
1016
|
-
return j(m,{style:[{flex:1,
|
|
1017
|
-
|
|
1018
|
-
/* @__PURE__ */j(
|
|
1019
|
-
/* @__PURE__ */j(
|
|
1020
|
-
/* @__PURE__ */
|
|
1021
|
-
/* @__PURE__ */
|
|
1022
|
-
/* @__PURE__ */
|
|
1023
|
-
/* @__PURE__ */j(
|
|
1024
|
-
/* @__PURE__ */j(
|
|
1025
|
-
/* @__PURE__ */
|
|
1026
|
-
/* @__PURE__ */j(RecordsEmptyState,{variant:si(
|
|
1027
|
-
/* @__PURE__ */
|
|
1028
|
-
/* @__PURE__ */j(
|
|
1029
|
-
/* @__PURE__ */j(
|
|
1016
|
+
/* @__PURE__ */j(RecordsFootnote,{})]}):/* @__PURE__ */j(SheetScreen,{...n,style:t})})})})}function SheetScreen({petRef:petRef,petName:e,controller:t,consentVersion:l,consentScope:a,consentText:s,onNavigate:d,onBack:c,onAsk:u,onOpenUrl:h,onCopy:p,options:g=vw,style:f}){let{s:b,look:v}=Sv(),w=my(),k=useEverfurRecords({petRef:petRef,readUploadFeatures:true,...t?{controller:t}:{},...a?{consentScope:a}:{}}),x=useRecordsMarkers(petRef),T=useRecordsDepthRead(petRef,fw,mw),C=useRecordsDepthRead(petRef,bw,yw),{pets:S}=useEverfurPets(),z=S.find(e=>e.petRef===petRef)??null,I=n(()=>g.topRiskLine===void 0?g.presentation??null:{...g.presentation,recordsTopRiskLine:g.topRiskLine},[g.presentation,g.topRiskLine]),D=useEverfurPresentation(I),H=Xv()?.records??null,L=H!==null&&(g.layout??(D.shellHeader==="tabs_bar"?"tabs_bar":"hub"))==="tabs_bar",P=n(()=>bv(g.stage),[g.stage]);yh(l,s);let O=n(()=>Nc(l,k.consent),[l,k.consent]),$=n(()=>pp(k,l),[k,l]),B=useCapability("recordsClinic"),E=B.enabled||B.isPending,[F,q]=i(null),[M,N]=i(false),[W,U]=i(false),G=g.active??true,[V,K]=i(()=>_.currentState!=="background");o(()=>{let e=_.addEventListener("change",e=>K(e==="active"));return()=>e.remove()},[]);let Y=Bm(g.nowMs,G&&V),X=useEverfurTheme().motion.reducedMotion,Q=Jb(P===void 0&&g.renderStage===void 0?petRef:null,{reducedMotion:X,isFocused:G&&V}),J=g.pronoun??Jv(g.sex)??Jv(hw(k.record))??null,Z=J===null&&k.status!=="loading",ee=useCapability("healthPlan"),te=useHealthPlanPage({petRef:petRef,enabled:ee.enabled&&(D.recordsTopRiskLine||Z)}),re=te.page?.pet??null,ne=J??Jv(uw(re)),ie=e?.trim()||z?.name?.trim()||re?.name?.trim()||"",le=g.species??z?.species??re?.species??null,oe=g.weightUnit??"lb",ae=Zv(ie,ne),se=ie.length>0?ae.Name:ew(),de=z?.breed??re?.breed??null,ce=n(()=>xb({words:ae,record:k.record,depth:T.value,markers:x.markers,timeline:C.value,requests:k.requests,breed:de,petWeightKg:z?.weightKg??re?.weightKg??null,nowMs:Y}),[ie,ne,k.record,k.requests,T.value,x.markers,C.value,z,re,Y]),ue=n(()=>$y(k.record,C.value,oe),[k.record,C.value,oe]),he=r(null),pe=r(0),ge=r(0),fe=Iy(de,z?.ageYears??null,ue),me=dw(k.requests,petRef),be=D.recordsTopRiskLine?cw(te.page?.page?.focus):null,ye=[x.markers?.disclaimer,k.record?.disclaimer,C.value?.disclaimer].map(e=>e?.trim()??"").find(e=>e.length>0)??"";o(()=>{if(F===null&&!M||!G)return;let e=R.addEventListener("hardwareBackPress",()=>(F!==null?q(null):N(false),true));return()=>{e.remove()}},[F,M,G]);let ve=e=>{g.onOpenMarker!==void 0?g.onOpenMarker(e):q(e)},we=rw(k.requests,petRef),ke=d!==void 0,xe={request:()=>{if(g.onRequestFromClinic!==void 0){let e=g.onRequestFromClinic({petRef:petRef});e!==void 0&&typeof e.then=="function"&&e.then(()=>k.refresh(),()=>k.refresh()).then(void 0,()=>{})}else d?.({name:"clinicPicker"})},upload:()=>d?.({name:"upload"}),record:()=>d?.({name:"record"})},Te=ce.history.length>0?()=>he.current?.scrollTo({y:Math.max(0,pe.current+ge.current),animated:!X}):ke?xe.record:void 0,Ce=ke?e=>d?.({name:"request",requestId:e}):void 0,_e=()=>Promise.all([k.refresh(),x.refresh(),T.refresh(),C.refresh()].map(e=>Promise.resolve(e).then(void 0,()=>{}))).then(()=>{}),Re=ag(_e,"everfur-records-sheet-refresh"),Se=n(()=>k.requests.filter(e=>e.petRef===petRef),[k.requests,petRef]),ze=n(()=>Eb(ie,Se),[ie,Se]),Ie=acceptsPhotos(k.uploadContentTypes)?Em.uploadDetail:Ib.uploadFormatHint,De=Ab(T.value,k.record!==null?tb(k.record).observedMs:null),He=xw(),Le=nw(k.requests,petRef)?.clinicName?.trim()||null,Pe=Le!==null?He.show:xe.request,Oe=Le!==null&&He.on?/* @__PURE__ */j(RequestedNote,{clinic:Le},He.shown):null;if(L&&H!==null&&(F!==null||M))/* @__PURE__ */
|
|
1017
|
+
return j(m,{style:[{flex:1},f],children:/* @__PURE__ */j(SdkTabletColumn,{children:/* @__PURE__ */j(H.TabsDeepScreen,{petRef:petRef,petName:ie,markerId:F,title:tw.labsTitle(ae),onBack:()=>F!==null?q(null):N(false),onOpenMarker:ve,shellPush:G?g.shellPush:void 0,vetNote:g.labVetNote,foot:/* @__PURE__ */j(RecordsFootnote,{})})})});if(F!==null)/* @__PURE__ */
|
|
1018
|
+
return j(m,{style:[{flex:1,backgroundColor:v.ground},f],children:/* @__PURE__ */A(SdkTabletColumn,{children:[
|
|
1019
|
+
/* @__PURE__ */j(RecordsPushHeader,{title:tw.labsTitle(ae),onBack:()=>q(null),look:v,testID:"everfur-records-lab-header"}),
|
|
1020
|
+
/* @__PURE__ */j(EverfurRecordsLabDetail,{petRef:petRef,markerId:F,...ie.length>0?{petName:ie}:{},...u?{onAsk:u}:{}}),
|
|
1021
|
+
/* @__PURE__ */j(RecordsFootnote,{})]})});let $e,Be="full",je=true,Ae=me!==null?/* @__PURE__ */j(FailedLine,{label:me.label,onPress:ke?()=>d?.({name:"request",requestId:me.id}):void 0}):null,Ee=g.renderTopSlot!==void 0?/* @__PURE__ */j(m,{testID:"everfur-records-sheet-top-slot",children:/* @__PURE__ */j(HostRender,{render:()=>g.renderTopSlot?.({clearResultsFilter:D.recordsClearResultsFilter})??null,fallback:null,resetKey:petRef})}):null,Fe=be!==null?/* @__PURE__ */j(TopRisk,{words:ae,text:be,onOpenPlan:g.onOpenPlan,start:g.topRiskPlanAction==="start"}):null,qe=(...e)=>{let t=e.filter(e=>e!=null&&e!==false);return t.length===0?null:/* @__PURE__ */j(m,{style:{paddingTop:eo(".rec","paddingTop"),paddingHorizontal:eo(".rec","paddingLeft"),gap:eo(".rec-dna","marginTop")},testID:"everfur-records-sheet-paper",children:t})},Me=e=>[b.sheet,{backgroundColor:w.look.bg,gap:sy.screen.gap},e?{marginTop:eo(".efh-sheet","marginTop")}:{borderTopLeftRadius:0,borderTopRightRadius:0}],Ne=u,We=Ne!==void 0&&g.askBar!==false?/* @__PURE__ */j(RecordsAskBar,{placeholder:tw.askRecords(ae),label:tw.askField(ae),sendLabel:tw.askSend,addLabel:tw.askAdd,...ke?{onAdd:xe.upload}:{},onSend:e=>Ne(e,{type:"records",id:petRef}),ground:v.paper,ink:v.dark?v.text:Yl.topInk,muted:v.dark?v.muted:Yl.embInk3,field:v.card}):null,Ue=g.renderUpcomingCareAction===void 0?g.onSpeakToVet:void 0,Ge=ye.length>0&&!Co(ye)?/* @__PURE__ */j(HubDisclaimer,{text:ye}):null,Ve=g.vitalsLine!==void 0?g.vitalsLine?.trim()||null:De!==null?Ib.vitalsFrom(De.vet,De.date).trim():null,Ke=e=>/* @__PURE__ */j(HubHero,{headPill:e?null:gw(g.headPill),fromLine:e?null:Ve,name:se,meta:fe,stage:P,art:Q,handFontFamily:ww(g),say:e,vitals:e?[]:ce.vitals,vitalsName:ae.name,renderStage:g.renderStage,exam:e?null:De,onOpenExam:ke?xe.record:void 0});if(k.status==="loading"&&k.record===null)$e=/* @__PURE__ */j(HubSkeleton,{}),Be="loading",je=false;else if(k.status==="error"){let e=Wc(k,O);Uc(e)?(Be="consent",$e=/* @__PURE__ */A(y,{contentContainerStyle:{flexGrow:1},refreshControl:Re,children:[qe(Fe,Ee),
|
|
1022
|
+
/* @__PURE__ */A(m,{style:Me(Fe!==null||Ee!==null),testID:"everfur-records-sheet-content",children:[hp(k,$,O,s,true),ke?/* @__PURE__ */j(HubAddRecords,{words:ae,sources:[],canRequest:E,onRequest:Pe,onUpload:xe.upload,note:Oe,uploadHint:Ie}):null,
|
|
1023
|
+
/* @__PURE__ */j(HubLegal,{})]})]})):e.kind==="error"||e.kind==="pet_not_found"?(Be="error",je=false,$e=/* @__PURE__ */j(RecordsEmptyState,{variant:si(e.error),message:e.error.displayMessage,onAction:e.error.retryable?_e:void 0,testID:"everfur-records-sheet-error"})):(Be=e.kind,je=false,$e=hp(k,$,O,s))}else if(ce.state!=="full")Be=we===null?"none":iw(we)?"processing":"onTheWay",$e=/* @__PURE__ */j(y,{contentContainerStyle:{flexGrow:1},refreshControl:Re,children:/* @__PURE__ */A(m,{testID:"everfur-records-sheet-content",style:[{flexGrow:1},g.style],children:[qe(Fe,Ee,Ae),
|
|
1024
|
+
/* @__PURE__ */A(m,{style:Me(Fe!==null||Ee!==null||Ae!==null),children:[Ke(true),Be==="onTheWay"&&we!==null?/* @__PURE__ */j(HubOnTheWay,{words:ae,request:we,steps:lw(we.status),sentWhen:aw(we.createdAt,Y),canAct:ke,canRequest:E,onAnotherClinic:xe.request,onUpload:xe.upload,onOpenRequest:Ce!==void 0?()=>Ce(we.id):void 0}):Be==="processing"&&we!==null?/* @__PURE__ */j(HubInProgress,{words:ae,request:we,onOpenRequest:Ce!==void 0?()=>Ce(we.id):void 0}):/* @__PURE__ */j(HubPrompt,{title:g.noVet===true?Zb.noVetTitle(ae):Zb.addRecords(ae.name),canAct:ke,canRequest:E,onRequest:Pe,onUpload:xe.upload,note:Oe}),ue!==null?/* @__PURE__ */j(HubWeightCard,{weight:ue,name:ae.name,chart:g.weightChart??"phone"}):null,
|
|
1025
|
+
/* @__PURE__ */j(HubSamplePeek,{name:ae.name,poss:ae.poss,species:le}),Ge,
|
|
1026
|
+
/* @__PURE__ */j(HubLegal,{})]})]})});else{let t=Py(k.record?.forwardLooking??[],Y),r=new Map((k.record?.forwardLooking??[]).map(e=>[e.careItemKey?.trim()||e.title,e])),n=Oy(k.record,x.markers,T.value,C.value),i=ce.featuredMarkerId,l=n.screeningsPill?.markerId??null,o=x.status==="error"||C.status==="error",a=(x.status==="error"?x.error:null)??(C.status==="error"?C.error:null),s=o?
|
|
1027
|
+
/* @__PURE__ */j(RecordsEmptyState,{variant:si(a),onAction:_e,testID:"everfur-records-sheet-partial-error"}):null,d=ce.history.length>0||(g.historyItems?.length??0)>0?/* @__PURE__ */j(m,{onLayout:e=>{ge.current=e.nativeEvent.layout.y},testID:"everfur-records-sheet-history-anchor",children:/* @__PURE__ */j(HubHistory,{words:ae,history:ce.history,onOpenMarker:ve,...g.historySources!==void 0?{sourceKey:g.historySources}:{},...g.historyItems!==void 0?{extra:g.historyItems}:{}})}):null,c=ke?/* @__PURE__ */j(HubAddRecords,{words:ae,sources:pw(g.onFileRows)??Xy(k.record,T.value),canRequest:E,onRequest:Pe,onUpload:xe.upload,note:Oe,inFlight:ze,onOpenRequest:Ce,uploadHint:Ie}):null,u=k.record!==null?tb(k.record).observedMs:null,h=g.renderUpcomingCareAction;$e=L&&H!==null?/* @__PURE__ */j(y,{ref:he,contentContainerStyle:{flexGrow:1},refreshControl:Re,children:/* @__PURE__ */A(m,{testID:"everfur-records-sheet-content",style:[{flexGrow:1,backgroundColor:v.card},g.style],children:[qe(Ee,Ae),
|
|
1028
|
+
/* @__PURE__ */A(m,{style:[Me(Ee!==null||Ae!==null),{borderTopLeftRadius:0,borderTopRightRadius:0,backgroundColor:v.card}],onLayout:e=>{pe.current=e.nativeEvent.layout.y},testID:"everfur-records-sheet-tabs",children:[
|
|
1029
|
+
/* @__PURE__ */j(H.TabsPetHead,{petRef:petRef,name:se,meta:fe,pill:gw(g.headPill),photoUrl:g.petPhotoUrl??null,onShare:ke?()=>U(true):void 0,shareLabel:ka.openA11yFor(e)}),s,
|
|
1030
|
+
/* @__PURE__ */j(H.TabsVitals,{title:g.vitalsLine!==void 0?g.vitalsLine?.trim()||null:u!==null?H.vitalsFrom(ae.poss,Mm(u)):null,vitals:ce.vitals}),
|
|
1031
|
+
/* @__PURE__ */j(H.TabsTiles,{tiles:n,labsUnknown:x.status==="loading"||x.status==="error",screeningsWords:g.screeningsPills?.[0]?.label??null,onOpenLabs:(x.markers?.markers.length??0)>0?()=>N(true):ke?xe.record:void 0,onOpenScreenings:g.onOpenScreenings??(l!==null?()=>ve(l):ke?xe.record:void 0),onOpenVisits:ke?xe.record:void 0,onOpenTimeline:Te}),
|
|
1032
|
+
/* @__PURE__ */j(H.TabsUpcoming,{rows:t,emptyText:Zb.nothingDue(ae.name),onViewAll:Te,renderAction:h!==void 0?e=>{let t=r.get(e.key);return e.tone==="overdue"&&t!==void 0?/* @__PURE__ */j(HostRender,{render:()=>h(t),fallback:null,resetKey:t}):null}:void 0}),
|
|
1033
|
+
/* @__PURE__ */j(HubMedications,{medications:ce.medications}),d,c,Ge,
|
|
1034
|
+
/* @__PURE__ */j(HubLegal,{})]})]})}):/* @__PURE__ */j(y,{ref:he,contentContainerStyle:{flexGrow:1},refreshControl:Re,children:/* @__PURE__ */A(m,{testID:"everfur-records-sheet-content",style:[{flexGrow:1},g.style],children:[qe(Fe,Ee,Ae),
|
|
1035
|
+
/* @__PURE__ */A(m,{style:Me(Fe!==null||Ee!==null||Ae!==null),onLayout:e=>{pe.current=e.nativeEvent.layout.y},children:[Ke(false),s,t.length>0?/* @__PURE__ */j(HubUpcoming,{rows:t,items:r,onViewAll:Te,renderAction:g.renderUpcomingCareAction,...Ue!==void 0?{actionLabel:tw.speakToVet,onAction:Ue}:{}}):/* @__PURE__ */j(HubUpcomingEmpty,{name:ae.name}),
|
|
1036
|
+
/* @__PURE__ */j(HubTilesSection,{tiles:n,labsUnknown:x.status==="loading"||x.status==="error",onOpenLabs:i!==null?()=>ve(i):ke?xe.record:void 0,onOpenScreenings:g.onOpenScreenings??(l!==null?()=>ve(l):ke?xe.record:void 0),onOpenVisits:ke?xe.record:void 0,onOpenTimeline:Te,...g.screeningsPills!==void 0?{screeningsPills:g.screeningsPills.map(gw).filter(e=>e!==null)}:{}}),
|
|
1037
|
+
/* @__PURE__ */j(HubWeightCard,{weight:ue,name:ae.name,chart:g.weightChart??"phone",extras:{status:gw(g.weightStatus),prediction:g.weightPrediction??null,...g.weightKey!==void 0?{key:g.weightKey}:{}}}),
|
|
1038
|
+
/* @__PURE__ */j(HubMedications,{medications:ce.medications}),d,c,Ge,
|
|
1030
1039
|
/* @__PURE__ */j(HubLegal,{})]})]})})}/* @__PURE__ */
|
|
1031
|
-
return j(m,{style:[{flex:1,backgroundColor:
|
|
1032
|
-
/* @__PURE__ */j(m,{style:{flex:1},testID:`everfur-records-sheet-state-${
|
|
1033
|
-
return j(m,{accessibilityLiveRegion:"polite",style:{paddingVertical:
|
|
1034
|
-
return j(Text,{style:[t("fine"),{textAlign:"center",marginTop:
|
|
1040
|
+
return j(m,{style:[{flex:1,backgroundColor:je?v.paper:v.ground},f],testID:"everfur-records-sheet",children:/* @__PURE__ */A(SdkTabletColumn,{children:[c!==void 0?/* @__PURE__ */j(fo,{value:"legacy",children:/* @__PURE__ */j(ScreenHeader,{title:Zn.titleNative(e),onBack:c,testID:"everfur-records-sheet-header"})}):null,
|
|
1041
|
+
/* @__PURE__ */j(m,{style:{flex:1},testID:`everfur-records-sheet-state-${Be}`,children:$e}),je?We:/* @__PURE__ */j(RecordsFootnote,{}),W?/* @__PURE__ */j(ShareSheet,{petRef:petRef,petName:e,onClose:()=>U(false),onNavigate:d,...h?{onOpenUrl:h}:{},...p?{onCopy:p}:{}}):null]})})}var kw=2600;function xw(){let[e,t]=i(false),[n,a]=i(0),s=r(null);o(()=>()=>{s.current!==null&&clearTimeout(s.current)},[]);let d=l(()=>{s.current!==null&&clearTimeout(s.current),t(true),a(e=>e+1),s.current=setTimeout(()=>{s.current=null,t(false)},kw)},[]);return{on:e,shown:n,show:d}}function RequestedNote({clinic:e}){let{look:t}=my();/* @__PURE__ */
|
|
1042
|
+
return j(m,{accessibilityLiveRegion:"polite",style:{paddingVertical:sy.upcoming.rowPadY,paddingHorizontal:sy.card.pad,borderRadius:sy.card.radius,backgroundColor:t.fill},testID:"everfur-records-sheet-requested-note",children:/* @__PURE__ */j(HubText,{variant:"bodySm",color:t.onFill,children:Em.requestedFrom(e)})})}function HubDisclaimer({text:e}){let{type:t}=my();/* @__PURE__ */
|
|
1043
|
+
return j(Text,{style:[t("fine"),{textAlign:"center",marginTop:sy.screen.legalTop}],testID:"everfur-records-sheet-disclaimer",children:e})}function TopRisk({words:e,text:t,onOpenPlan:r,start:n}){let{s:i,look:l}=Sv(),o=n?tw.startPlan(e):tw.seePlan(e);/* @__PURE__ */
|
|
1035
1044
|
return A(SheetCard,{style:i.topRisk,testID:"everfur-records-sheet-top-risk",children:[
|
|
1036
1045
|
/* @__PURE__ */A(m,{style:i.topRiskKicker,children:[
|
|
1037
1046
|
/* @__PURE__ */j(m,{style:i.topRiskDot}),
|
|
1038
|
-
/* @__PURE__ */j(Text,{style:i.topRiskK,children:
|
|
1047
|
+
/* @__PURE__ */j(Text,{style:i.topRiskK,children:tw.topRiskKicker(e)})]}),
|
|
1039
1048
|
/* @__PURE__ */j(Text,{style:i.topRiskText,children:t}),r!==void 0?
|
|
1040
|
-
/* @__PURE__ */j(b,{onPress:r,accessibilityRole:"button",accessibilityLabel:o,style:({pressed:e})=>[i.button,i.buttonRow,{alignSelf:"flex-start",marginTop:eo(".rec-top .emb-btn","marginTop"),backgroundColor:l.topInk},e?{transform:[{scale:.97}]}:null],testID:"everfur-records-sheet-top-risk-plan",children:/* @__PURE__ */j(Text,{tier:"control",style:[i.buttonText,i.buttonTextRow,{color:Kl(l.topInk,[Yl.efWhite,Yl.topInk])}],children:o})}):null]})}function FailedLine({label:e,onPress:t}){let{s:r,look:n}=
|
|
1049
|
+
/* @__PURE__ */j(b,{onPress:r,accessibilityRole:"button",accessibilityLabel:o,style:({pressed:e})=>[i.button,i.buttonRow,{alignSelf:"flex-start",marginTop:eo(".rec-top .emb-btn","marginTop"),backgroundColor:l.topInk},e?{transform:[{scale:.97}]}:null],testID:"everfur-records-sheet-top-risk-plan",children:/* @__PURE__ */j(Text,{tier:"control",style:[i.buttonText,i.buttonTextRow,{color:Kl(l.topInk,[Yl.efWhite,Yl.topInk])}],children:o})}):null]})}function FailedLine({label:e,onPress:t}){let{s:r,look:n}=Sv(),i=/* @__PURE__ */A(E,{children:[
|
|
1041
1050
|
/* @__PURE__ */j(Text,{style:r.failedText,children:e}),t!==void 0?/* @__PURE__ */j(SheetIcon,{kind:"chevron",size:20,color:n.alertDeep}):null]});return t!==void 0?/* @__PURE__ */j(b,{onPress:t,accessibilityRole:"button",accessibilityLabel:e,style:r.failed,testID:"everfur-records-sheet-failed",children:i}):/* @__PURE__ */j(m,{style:r.failed,testID:"everfur-records-sheet-failed",children:i})}function EverfurRecordsFlow(e){let{petRef:petRef,petName:t,controller:r,clinicController:i,onPickDocument:s,onPickPhotos:d,uploadTransport:c,consentVersion:u,consentScope:h,consentText:p,ownerName:g,onCaptureSignature:f,initialScreen:m,onExit:b,style:y,renderPending:v,onOpenUrl:w,onCopy:k,onAsk:x,location:T,sheet:C=true,onNavigate:_,alwaysShowWays:S,renderUpcomingCareAction:z,noVet:I,weightUnit:D,onOpenPlan:H,onSpeakToVet:L,onOpenScreenings:P,onRequestFromClinic:O}=en(e,["onExit","onNavigate"]),$=n(()=>C===false?null:{...Kr({renderUpcomingCareAction:z,noVet:I,weightUnit:D,onOpenPlan:H,onSpeakToVet:L,onOpenScreenings:P,onRequestFromClinic:O}),...typeof C=="object"?Kr(C):{}},[C,z,I,D,H,L,P,O]),[B,A]=a(recordsNavReducer,m,initialRecordsNav),E=currentRecordsScreen(B),F=B.stack.length;o(()=>{let e=()=>F<=1?false:(A({type:"pop"}),true),t=R.addEventListener("hardwareBackPress",e);return()=>{t.remove()}},[F]);let q=l(e=>{_?_(e):A({type:"navigate",screen:e})},[_]),M=n(()=>popRecordsNav(B).handled?()=>A({type:"pop"}):b,[B,b]),N={onNavigate:q,...M?{onBack:M}:{},...t!==void 0?{petName:t}:{},...w?{onOpenUrl:w}:{},...k?{onCopy:k}:{},...x?{onAsk:x}:{},...T?{location:T}:{}},W={...r?{controller:r}:{},...u!==void 0?{consentVersion:u}:{},...h!==void 0?{consentScope:h}:{},...p!==void 0?{consentText:p}:{}},U={...s?{onPickDocument:s}:{},...d?{onPickPhotos:d}:{},...c?{uploadTransport:c}:{}},G=v?{renderPending:v}:{};/* @__PURE__ */
|
|
1042
1051
|
return j(fo,{value:$===null?"legacy":"sheet",children:V()});function V(){switch(E.name){case"dashboard":return $!==null?/* @__PURE__ */j(EverfurRecordsSheet,{petRef:petRef,...N,...W,...G,options:$,style:y}):/* @__PURE__ */j(EverfurRecordsDashboard,{petRef:petRef,...N,...W,...G,...S===true?{alwaysShowWays:S}:{},style:y});case"request":/* @__PURE__ */
|
|
1043
1052
|
return j(EverfurRecordsRequest,{petRef:petRef,requestId:E.requestId,...N,...W,...U,...G,style:y});case"timeline":/* @__PURE__ */
|
|
@@ -1049,7 +1058,7 @@ return j(EverfurClinicPicker,{petRef:petRef,...N,...i?{controller:i}:{},...r?{re
|
|
|
1049
1058
|
return j(EverfurClinicRequestBatch,{petRef:petRef,petName:t??"",ownerName:g??"",onClose:M??(()=>A({type:"navigate",screen:{name:"dashboard"}})),...f?{onCaptureSignature:f}:{},...i?{controller:i}:{},style:y});case"consent":/* @__PURE__ */
|
|
1050
1059
|
return j(EverfurRecordsConsent,{petRef:petRef,clinic:E.clinic,...N,...g!==void 0?{ownerName:g}:{},...f?{onCaptureSignature:f}:{},...i?{controller:i}:{},style:y});case"upload":/* @__PURE__ */
|
|
1051
1060
|
return j(EverfurRecordsUpload,{petRef:petRef,...N,...r?{controller:r}:{},...U,...G,style:y});case"requests":/* @__PURE__ */
|
|
1052
|
-
return j(EverfurRecordsRequests,{petRef:petRef,...N,...r?{controller:r}:{},...G,style:y});default:return assertNever(E)}}}var
|
|
1061
|
+
return j(EverfurRecordsRequests,{petRef:petRef,...N,...r?{controller:r}:{},...G,style:y});default:return assertNever(E)}}}var Tw=EverfurRecordsFlow;function EverfurClinicRequest(e){let{userRef:userRef,scopeEpoch:t}=Dr();/* @__PURE__ */
|
|
1053
1062
|
return j(CapabilityGate,{capability:"recordsClinic",...Uo(e.onClose,Fn.cancel),children:userRef===null?/* @__PURE__ */j(Text,{accessibilityRole:"alert",children:Yn.sessionRequired}):/* @__PURE__ */j(ClinicRequestBody,{...en(e,["onClose","onCreated"])},JSON.stringify([userRef,t,e.petRef,e.petName]))})}function ClinicRequestBody(e){let t=useEverfurRecordsClinic(),[r,n]=i(null),o=l(async()=>r===null?null:{signaturePngBase64:r},[r]),a=us(e,e.controller??t,e.onCaptureSignature??o),s=e.onCaptureSignature!==void 0||r!==null,d=useEverfurTheme(),c={minHeight:44,padding:d.space.sm,borderWidth:1,borderColor:d.color.borderHairlineGreen,borderRadius:d.radius.sm,color:d.color.text.primary,backgroundColor:d.color.surface},u={...c,...jn(d.slots.input,1),...An(d.slots.input)},h={color:d.color.text.primary,fontSize:d.type.size.body},p=(e,t,r=false,n)=>/* @__PURE__ */j(b,{accessibilityRole:"button",accessibilityLabel:e,accessibilityState:{disabled:r},disabled:r,onPress:t,...n?{testID:n}:{},style:[c,{justifyContent:"center",opacity:r?.5:1}],children:/* @__PURE__ */j(Text,{style:h,children:e})});/* @__PURE__ */
|
|
1054
1063
|
return A(m,{accessibilityLabel:Fn.title,style:[{backgroundColor:d.color.surface,padding:d.space.lg,gap:d.space.md,borderRadius:d.radius.lg,minHeight:120},e.style],children:[
|
|
1055
1064
|
/* @__PURE__ */j(Text,{accessibilityRole:"header",style:[h,{...headingFace(d,"bold"),fontSize:d.type.size.heading}],children:Fn.title}),
|
|
@@ -1061,21 +1070,21 @@ return A(m,{accessibilityLabel:Fn.title,style:[{backgroundColor:d.color.surface,
|
|
|
1061
1070
|
/* @__PURE__ */j(Text,{style:h,children:Fn.email}),
|
|
1062
1071
|
/* @__PURE__ */j(Bn,{accessibilityLabel:Fn.email,style:u,value:a.email,placeholder:Fn.emailPlaceholder,placeholderTextColor:d.color.text.placeholder,maxLength:320,editable:!a.busy,keyboardType:"email-address",autoCapitalize:"none",autoCorrect:false,onChangeText:a.setEmail})]}),
|
|
1063
1072
|
/* @__PURE__ */j(Text,{accessibilityRole:"header",style:h,children:Fn.scopeHeading}),a.copy?/* @__PURE__ */j(Text,{style:h,children:a.query.trim()&&a.ownerName.trim()?a.scope??makeEverfurError("internalError").displayMessage:Yn.consentRequired}):!a.error&&/* @__PURE__ */j(Text,{accessibilityLiveRegion:"polite",style:h,children:Yn.loading}),!e.onCaptureSignature&&/* @__PURE__ */j(SignaturePad,{onChange:n,disabled:a.busy}),!s&&a.ready&&/* @__PURE__ */j(Text,{accessibilityRole:"alert",style:h,children:Fn.missingSignature}),a.error&&/* @__PURE__ */j(Text,{accessibilityRole:"alert",accessibilityLiveRegion:"assertive",style:h,children:a.error.displayMessage}),!a.copy&&a.error&&p(Yn.retry,a.retryCopy),p(a.busy?Fn.sending:Fn.send,()=>{a.submit()},a.busy||!a.ready||!s)]}),e.onClose&&p(Fn.cancel,e.onClose,a.busy),
|
|
1064
|
-
/* @__PURE__ */j(RecordsFootnote,{})]})}var
|
|
1073
|
+
/* @__PURE__ */j(RecordsFootnote,{})]})}var Cw=[Yl.embB1,Yl.embB2,Yl.embB3,Yl.embB4],_w={accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants"};function Rw(e){return`${Number.isFinite(e)?Number(e.toFixed(1)):0}%`}function RecordsDnaCard({title:e,subtitle:t,breeds:r=[],result:n,clear:i,icon:l,style:o,testID:a="everfur-records-dna-card"}){let s=useEverfurTheme(),d=face(s,"regular"),c=face(s,"mono"),u=face(s,"bold"),h=eo(".emb-tile","width"),p=r.filter(e=>e.percent>0),g=p.map(e=>`${e.name} ${Rw(e.percent)}`).join(", "),f=(e,t)=>e.color??Cw[t%Cw.length]??Yl.embB1,y=eo(".mixlegend","columnGap");/* @__PURE__ */
|
|
1065
1074
|
return A(m,{style:[{padding:eo(".rec-dna","paddingTop"),borderRadius:eo(".emb-card","borderRadius"),backgroundColor:Yl.efWhite,shadowColor:Yl.topInk,shadowOpacity:.06,shadowRadius:3,shadowOffset:{width:0,height:1},elevation:1},o],testID:a,children:[
|
|
1066
1075
|
/* @__PURE__ */A(m,{style:{flexDirection:"row",alignItems:"center",gap:eo(".rec-dna__top","gap"),marginBottom:eo(".rec-dna__top","marginBottom")},children:[
|
|
1067
|
-
/* @__PURE__ */j(m,{style:{width:h,height:eo(".emb-tile","height"),borderRadius:eo(".emb-tile","borderRadius"),backgroundColor:Yl.embCyan1,alignItems:"center",justifyContent:"center"},...
|
|
1076
|
+
/* @__PURE__ */j(m,{style:{width:h,height:eo(".emb-tile","height"),borderRadius:eo(".emb-tile","borderRadius"),backgroundColor:Yl.embCyan1,alignItems:"center",justifyContent:"center"},..._w,children:l??/* @__PURE__ */j(DnaGlyph,{size:23,color:Yl.embTealInk})}),
|
|
1068
1077
|
/* @__PURE__ */A(m,{style:{flex:1,minWidth:0},children:[
|
|
1069
1078
|
/* @__PURE__ */j(Text,{accessibilityRole:"header",style:{...u,fontSize:eo(".rec-dna__top h3","fontSize"),lineHeight:eo(".rec-dna__top h3","fontSize")*1.15,color:Yl.topInk},children:e}),t!==void 0&&t.trim().length>0?/* @__PURE__ */j(Text,{style:{...c,marginTop:eo(".rec-dna__top p","marginTop"),fontSize:eo(".rec-dna__top p","fontSize"),lineHeight:eo(".rec-dna__top p","fontSize")*1.5,letterSpacing:eo(".rec-dna__top p","letterSpacing"),textTransform:"uppercase",color:Yl.embInk3},children:t}):null]})]}),p.length>0?/* @__PURE__ */A(E,{children:[
|
|
1070
1079
|
/* @__PURE__ */j(m,{accessible:true,accessibilityRole:"image",accessibilityLabel:g,style:{flexDirection:"row",gap:eo(".mixbar","gap"),height:eo(".mixbar","height"),borderRadius:999,overflow:"hidden"},testID:`${a}-mix`,children:p.map((e,t)=>/* @__PURE__ */j(m,{style:{flexGrow:e.percent,flexShrink:0,flexBasis:0,backgroundColor:f(e,t)}},`${e.name}${t}`))}),
|
|
1071
|
-
/* @__PURE__ */j(m,{style:{flexDirection:"row",flexWrap:"wrap",columnGap:y,rowGap:eo(".mixlegend","rowGap"),marginTop:eo(".mixlegend","marginTop")},...
|
|
1080
|
+
/* @__PURE__ */j(m,{style:{flexDirection:"row",flexWrap:"wrap",columnGap:y,rowGap:eo(".mixlegend","rowGap"),marginTop:eo(".mixlegend","marginTop")},..._w,children:p.map((e,t)=>/* @__PURE__ */A(m,{style:{flexBasis:"45%",flexGrow:1,minWidth:0,flexDirection:"row",alignItems:"center",gap:eo(".mixlegend li","gap")},children:[
|
|
1072
1081
|
/* @__PURE__ */j(m,{style:{width:eo(".mixlegend i","width"),height:eo(".mixlegend i","width"),borderRadius:999,backgroundColor:f(e,t)}}),
|
|
1073
1082
|
/* @__PURE__ */j(Text,{style:{...d,flex:1,minWidth:0,fontSize:eo(".mixlegend","fontSize"),lineHeight:eo(".mixlegend","fontSize")*1.5,color:Yl.topInk},children:e.name}),
|
|
1074
|
-
/* @__PURE__ */j(Text,{style:{...c,fontSize:eo(".mixlegend b","fontSize"),lineHeight:eo(".mixlegend b","fontSize")*1.5,color:Yl.embInk2},children:
|
|
1083
|
+
/* @__PURE__ */j(Text,{style:{...c,fontSize:eo(".mixlegend b","fontSize"),lineHeight:eo(".mixlegend b","fontSize")*1.5,color:Yl.embInk2},children:Rw(e.percent)})]},`${e.name}${t}`))})]}):null,n!==void 0?/* @__PURE__ */j(DnaResult,{result:n}):null,i!==void 0?/* @__PURE__ */A(b,{onPress:i.onPress,disabled:i.onPress===void 0,accessibilityRole:i.onPress!==void 0?"button":"text",accessibilityLabel:i.label,style:{alignSelf:"flex-start",flexDirection:"row",alignItems:"center",gap:eo(".rec-dna__clear","gap"),minHeight:eo(".rec-dna__clear","minHeight"),marginTop:eo(".rec-dna__clear","marginTop"),paddingHorizontal:eo(".rec-dna__clear","paddingLeft")},testID:`${a}-clear`,children:[
|
|
1075
1084
|
/* @__PURE__ */j(m,{style:{width:eo(".rec-dna__clear .dot","width"),height:eo(".rec-dna__clear .dot","width"),borderRadius:999,backgroundColor:Yl.embClearDot}}),
|
|
1076
|
-
/* @__PURE__ */j(Text,{style:{...d,fontSize:eo(".rec-dna__clear","fontSize"),lineHeight:eo(".rec-dna__clear","fontSize")*1.5,color:Yl.embInk3},children:i.label}),i.onPress!==void 0?/* @__PURE__ */j(m,{...
|
|
1085
|
+
/* @__PURE__ */j(Text,{style:{...d,fontSize:eo(".rec-dna__clear","fontSize"),lineHeight:eo(".rec-dna__clear","fontSize")*1.5,color:Yl.embInk3},children:i.label}),i.onPress!==void 0?/* @__PURE__ */j(m,{..._w,children:/* @__PURE__ */j(ChevronGlyph,{size:14,color:Yl.embInk3,direction:"right"})}):null]}):null]})}function DnaResult({result:e}){let t=useEverfurTheme(),r=face(t,"bold"),n=/* @__PURE__ */A(E,{children:[
|
|
1077
1086
|
/* @__PURE__ */j(m,{style:{width:eo(".dot","width"),height:eo(".dot","width"),borderRadius:999,backgroundColor:Yl.embRiskDot}}),
|
|
1078
1087
|
/* @__PURE__ */A(m,{style:{flex:1,minWidth:0},children:[
|
|
1079
1088
|
/* @__PURE__ */j(Text,{style:{...r,fontSize:eo(".rec-dna__risk small","fontSize"),lineHeight:eo(".rec-dna__risk small","fontSize")*1.5,color:Yl.embRiskInk},children:e.kicker}),
|
|
1080
|
-
/* @__PURE__ */j(Text,{style:{...r,marginTop:eo(".rec-dna__risk strong","marginTop"),fontSize:eo(".rec-dna__risk strong","fontSize"),lineHeight:eo(".rec-dna__risk strong","lineHeight"),color:Yl.topInk},children:e.title})]}),e.onPress!==void 0?/* @__PURE__ */j(m,{...
|
|
1081
|
-
return Object.freeze({...e})}var
|
|
1089
|
+
/* @__PURE__ */j(Text,{style:{...r,marginTop:eo(".rec-dna__risk strong","marginTop"),fontSize:eo(".rec-dna__risk strong","fontSize"),lineHeight:eo(".rec-dna__risk strong","lineHeight"),color:Yl.topInk},children:e.title})]}),e.onPress!==void 0?/* @__PURE__ */j(m,{..._w,children:/* @__PURE__ */j(ChevronGlyph,{size:18,color:Yl.embInk3,direction:"right"})}):null]}),i={flexDirection:"row",alignItems:"center",gap:eo(".rec-dna__risk","gap"),marginTop:eo(".rec-dna__risk","marginTop"),paddingTop:eo(".rec-dna__risk","paddingTop"),paddingRight:eo(".rec-dna__risk","paddingRight"),paddingBottom:eo(".rec-dna__risk","paddingBottom"),paddingLeft:eo(".rec-dna__risk","paddingLeft"),borderRadius:eo(".rec-dna__risk","borderRadius"),backgroundColor:Yl.paper};return e.onPress!==void 0?/* @__PURE__ */j(b,{onPress:e.onPress,accessibilityRole:"button",accessibilityLabel:`${e.kicker}. ${e.title}`,style:i,testID:"everfur-records-dna-card-result",children:n}):/* @__PURE__ */j(m,{style:i,testID:"everfur-records-dna-card-result",children:n})}function recordsSheet(e={}){/* @__PURE__ */
|
|
1090
|
+
return Object.freeze({...e})}var Sw=hy(In),zw=eo(".efh-btn--row","fontSize"),Iw=/* @__PURE__ */Object.freeze({style:/* @__PURE__ */Object.freeze({flexDirection:"row",alignItems:"center",justifyContent:"center",gap:sy.button.gap,borderRadius:999,minHeight:eo(".efh-btn--row","minHeight"),paddingHorizontal:eo(".efh-btn--row","paddingLeft"),backgroundColor:Sw.fill}),labelStyle:/* @__PURE__ */Object.freeze({...face(In,"bold"),fontSize:zw,lineHeight:zw*1.2,color:Sw.onFill})});export{EverfurClinicPicker,EverfurClinicRequest,EverfurClinicRequestBatch,EverfurRecordDetail,EverfurRecordDocument,Tw as EverfurRecords,EverfurRecordsConsent,EverfurRecordsDashboard,EverfurRecordsFlow,EverfurRecordsLabDetail,EverfurRecordsRequest,EverfurRecordsRequests,EverfurRecordsSheet,EverfurRecordsUpload,wi as RECORDS_CLINIC_BATCH_MAX,sw as RECORDS_SHEET_RN_COPY,Iw as RECORDS_SHEET_ROW_BUTTON_STYLE,ct as RECORDS_TERMINAL,Ph as REQUEST_TIMELINE_TITLES,RecordsDnaCard,RequestDocumentsList,SignaturePad,acceptsPhotos,applyFactOverlay,buildRequestTimeline,currentRecordsScreen,deriveRecordsDashboardState,initialRecordsNav,isFactEditable,isTerminalStatus,pickPetRecordsRequest,popRecordsNav,pushRecordsNav,recordsDenialReasonOf,recordsNavReducer,recordsSheet,recordsSheetLook,registerRnSignature,replaceRecordsNav,resetRecordsNav,selectClinicCall,selectDashboardView,selectPrimaryLabel,selectRequestList,selectRequestTitle,transitionRecordsNav,useEverfurRecords,useEverfurRecordsClinic,useEverfurRecordsClinicBatch,useRecordFactEdit,useRecordPdfLink,useRecordShares,useRecordsMarkers};
|